block: Accept any target node for transactional blockdev-backup
PATCH 1/1 block: Accept any target node for transactional blockdev-backup
Commit 0d978913 changed blockdev-backup to accept arbitrary node names instead of device names (i.e. root nodes) for the backup target. However, it forgot to make the same change in transactions and to update the documentation. This patch fixes these omissions.
--- blockdev.c | 8 ++++---- qapi/block-core.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
blockdev.c +4 -4
@@ -1937,7 +1937,8 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockdevBackup *backup; -BlockBackend *blk, *target; +BlockBackend *blk; +BlockDriverState *target;Error *local_err =NULL ;assert (common->action->type ==TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP );
@@ -1954,15 +1955,14 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp)return ; } - target =blk_by_name (backup->target); + target =bdrv_lookup_bs (backup->target, backup->target, errp);if (!target) { -error_setg (errp,"Device '%s' not found" , backup->target);return ; }/* AioContext is released in .clean() */ state->aio_context =blk_get_aio_context (blk); -if (state->aio_context !=blk_get_aio_context (target)) { +if (state->aio_context !=bdrv_get_aio_context (target)) { state->aio_context =NULL ;error_setg (errp,"Backup between two IO threads is not implemented" );return ;
qapi/block-core.json +1 -1
@@ -927,7 +927,7 @@ # # @device: the name of the device which should be copied. # -# @target: the name of the backup target device. +# @target: the device name or node-name of the backup target node. # # @sync: what parts of the disk image should be copied to the destination # (all the disk, only the sectors allocated in the topmost image, or
Signature · 1 line
1.8.3.1
Quoted 3 lines · Kevin Wolf
Commit
0d978913changed blockdev-backup to accept arbitrary node names instead of device names (i.e. root nodes) for the backup target. However, it forgot to make the same change in transactions and to update
http://i.imgur.com/PfBxuOb.gif
Quoted 46 lines
the documentation. This patch fixes these omissions.
Signed-off-by Kevin Wolf <[email protected]>--- blockdev.c | 8 ++++---- qapi/block-core.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)blockdev.c +4
-4@@ -1937,7 +1937,8 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockdevBackup *backup; -BlockBackend *blk, *target; +BlockBackend *blk; +BlockDriverState *target;Error *local_err =NULL ;assert (common->action->type ==TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP );@@ -1954,15 +1955,14 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp)return ; } - target =blk_by_name (backup->target); + target =bdrv_lookup_bs (backup->target, backup->target, errp);if (!target) { -error_setg (errp,"Device '%s' not found" , backup->target);return ; }/* AioContext is released in .clean() */ state->aio_context =blk_get_aio_context (blk); -if (state->aio_context !=blk_get_aio_context (target)) { +if (state->aio_context !=bdrv_get_aio_context (target)) { state->aio_context =NULL ;error_setg (errp,"Backup between two IO threads is not implemented" );return ;qapi/block-core.json +0
-0
qapi/block-core.json line 933
Quoted 8 lines
qapi/block-core.json +1
-1@@ -927,7 +927,7 @@ # # @device: the name of the device which should be copied. # -# @target: the name of the backup target device. +# @target: the device name or node-name of the backup target node. # # @sync: what parts of the disk image should be copied to the destination # (all the disk, only the sectors allocated in the topmost image, or
Quoted 60 lines · Kevin Wolf
Commit
0d978913changed blockdev-backup to accept arbitrary node names instead of device names (i.e. root nodes) for the backup target. However, it forgot to make the same change in transactions and to update the documentation. This patch fixes these omissions.Signed-off-by Kevin Wolf <[email protected]>--- blockdev.c | 8 ++++---- qapi/block-core.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)blockdev.c +4
-4@@ -1937,7 +1937,8 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp) {BlockdevBackupState *state =DO_UPCAST (BlockdevBackupState, common, common);BlockdevBackup *backup; -BlockBackend *blk, *target; +BlockBackend *blk; +BlockDriverState *target;Error *local_err =NULL ;assert (common->action->type ==TRANSACTION_ACTION_KIND_BLOCKDEV_BACKUP );@@ -1954,15 +1955,14 @@ static void blockdev_backup_prepare(BlkActionState *common, Error **errp)return ; } - target =blk_by_name (backup->target); + target =bdrv_lookup_bs (backup->target, backup->target, errp);if (!target) { -error_setg (errp,"Device '%s' not found" , backup->target);return ; }/* AioContext is released in .clean() */ state->aio_context =blk_get_aio_context (blk); -if (state->aio_context !=blk_get_aio_context (target)) { +if (state->aio_context !=bdrv_get_aio_context (target)) { state->aio_context =NULL ;error_setg (errp,"Backup between two IO threads is not implemented" );return ;qapi/block-core.json +1
-1@@ -927,7 +927,7 @@ # # @device: the name of the device which should be copied. # -# @target: the name of the backup target device. +# @target: the device name or node-name of the backup target node. # # @sync: what parts of the disk image should be copied to the destination # (all the disk, only the sectors allocated in the topmost image, orSignature · 1 line
1.8.3.1
Quoted 10 lines · Kevin Wolf
Commit
0d978913changed blockdev-backup to accept arbitrary node names instead of device names (i.e. root nodes) for the backup target. However, it forgot to make the same change in transactions and to update the documentation. This patch fixes these omissions.Signed-off-by Kevin Wolf <[email protected]>--- blockdev.c | 8 ++++---- qapi/block-core.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)