qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup
@ 2016-08-02 17:22 Kevin Wolf
  2016-08-02 22:22 ` [Qemu-devel] [Qemu-block] " John Snow
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kevin Wolf @ 2016-08-02 17:22 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, stefanha, famz, mreitz, eblake, qemu-devel

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.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.c           | 8 ++++----
 qapi/block-core.json | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/blockdev.c b/blockdev.c
index eafeba9..2161400 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -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;
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 2bbc027..5e2d7d7 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -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
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup
  2016-08-02 17:22 [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup Kevin Wolf
@ 2016-08-02 22:22 ` John Snow
  2016-08-03  3:18 ` [Qemu-devel] " Fam Zheng
  2016-08-04 12:09 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: John Snow @ 2016-08-02 22:22 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: famz, qemu-devel, mreitz, stefanha



On 08/02/2016 01:22 PM, Kevin Wolf wrote:
> 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

http://i.imgur.com/PfBxuOb.gif

> the documentation. This patch fixes these omissions.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c           | 8 ++++----
>  qapi/block-core.json | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/blockdev.c b/blockdev.c
> index eafeba9..2161400 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -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;
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 2bbc027..5e2d7d7 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -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
>

Reviewed-by: John Snow <jsnow@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup
  2016-08-02 17:22 [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup Kevin Wolf
  2016-08-02 22:22 ` [Qemu-devel] [Qemu-block] " John Snow
@ 2016-08-03  3:18 ` Fam Zheng
  2016-08-04 12:09 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Fam Zheng @ 2016-08-03  3:18 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, qemu-devel, mreitz, stefanha

On Tue, 08/02 19:22, Kevin Wolf wrote:
> 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.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c           | 8 ++++----
>  qapi/block-core.json | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/blockdev.c b/blockdev.c
> index eafeba9..2161400 100644
> --- a/blockdev.c
> +++ b/blockdev.c
> @@ -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;
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index 2bbc027..5e2d7d7 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -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
> -- 
> 1.8.3.1
> 
> 

Reviewed-by: Fam Zheng <famz@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup
  2016-08-02 17:22 [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup Kevin Wolf
  2016-08-02 22:22 ` [Qemu-devel] [Qemu-block] " John Snow
  2016-08-03  3:18 ` [Qemu-devel] " Fam Zheng
@ 2016-08-04 12:09 ` Stefan Hajnoczi
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2016-08-04 12:09 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-block, famz, mreitz, eblake, qemu-devel

[-- Attachment #1: Type: text/plain, Size: 571 bytes --]

On Tue, Aug 02, 2016 at 07:22:04PM +0200, Kevin Wolf wrote:
> 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.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  blockdev.c           | 8 ++++----
>  qapi/block-core.json | 2 +-
>  2 files changed, 5 insertions(+), 5 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-04 12:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-02 17:22 [Qemu-devel] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup Kevin Wolf
2016-08-02 22:22 ` [Qemu-devel] [Qemu-block] " John Snow
2016-08-03  3:18 ` [Qemu-devel] " Fam Zheng
2016-08-04 12:09 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).