From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bUi5L-0006MO-5g for qemu-devel@nongnu.org; Tue, 02 Aug 2016 18:22:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bUi5I-0005JM-W6 for qemu-devel@nongnu.org; Tue, 02 Aug 2016 18:22:50 -0400 References: <1470158524-24807-1-git-send-email-kwolf@redhat.com> From: John Snow Message-ID: <483394e7-b4d7-6d0d-a054-c44159778bb8@redhat.com> Date: Tue, 2 Aug 2016 18:22:41 -0400 MIME-Version: 1.0 In-Reply-To: <1470158524-24807-1-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-block] [PATCH for-2.7] block: Accept any target node for transactional blockdev-backup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-block@nongnu.org Cc: famz@redhat.com, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com 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 > --- > 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