Received: from eggs.gnu.org ([2001:4830:134:3::10]:51676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1YDq-0006EW-KN for qemu-devel@nongnu.org; Thu, 18 Dec 2014 05:22:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y1YDk-0004ib-Dm for qemu-devel@nongnu.org; Thu, 18 Dec 2014 05:22:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y1YDk-0004i6-54 for qemu-devel@nongnu.org; Thu, 18 Dec 2014 05:22:12 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sBIAMB36023592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 18 Dec 2014 05:22:11 -0500 Date: Thu, 18 Dec 2014 18:22:45 +0800 From: Fam Zheng Message-ID: <20141218102245.GA19637@fam-t430.nay.redhat.com> References: <1418820703-17179-1-git-send-email-famz@redhat.com> <1418820703-17179-3-git-send-email-famz@redhat.com> <5491ED2F.1090607@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5491ED2F.1090607@redhat.com> Subject: Re: [Qemu-devel] [PATCH v5 2/4] qmp: Add command 'blockdev-backup' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: Kevin Wolf , mreitz@redhat.com, qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster On Wed, 12/17 15:53, John Snow wrote: > >+ aio_context = bdrv_get_aio_context(bs); > >+ aio_context_acquire(aio_context); > >+ > >+ target_bs = bdrv_find(target); > >+ if (!target_bs) { > >+ error_set(errp, QERR_DEVICE_NOT_FOUND, target); > >+ goto out; > >+ } > >+ > >+ bdrv_ref(target_bs); > >+ bdrv_set_aio_context(target_bs, bdrv_get_aio_context(bs)); > > why call bdrv_get_aio_context(bs) again instead of just using aio_context? > Will this cause issues? Could be simply aio_context. [...] > >diff --git a/qmp-commands.hx b/qmp-commands.hx > >index 3348782..a7bb90b 100644 > >--- a/qmp-commands.hx > >+++ b/qmp-commands.hx > >@@ -1094,6 +1094,48 @@ Example: > > "sync": "full", > > "target": "backup.img" } } > > <- { "return": {} } > >+ > >+EQMP > >+ > >+ { > >+ .name = "blockdev-backup", > >+ .args_type = "sync:s,device:B,target:B,speed:i?," > >+ "on-source-error:s?,on-target-error:s?", > >+ .mhandler.cmd_new = qmp_marshal_input_blockdev_backup, > >+ }, > >+ > >+SQMP > >+blockdev-backup > >+------------ > > ^ Pad out the dashes to match the line length of the command. Mentioning > only because Eric got me on that one last time :) OK, thanks. Fam