From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJLw4-00076C-HN for qemu-devel@nongnu.org; Sat, 02 Jul 2016 10:30:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJLw2-0004aO-BZ for qemu-devel@nongnu.org; Sat, 02 Jul 2016 10:30:19 -0400 References: <3816b0cafeee5a2e11c7fd649ca4a43e32dfae1e.1467386530.git.berto@igalia.com> From: Max Reitz Message-ID: <57c064d0-e1bd-b57b-0f83-81e0db2ffa56@redhat.com> Date: Sat, 2 Jul 2016 16:30:06 +0200 MIME-Version: 1.0 In-Reply-To: <3816b0cafeee5a2e11c7fd649ca4a43e32dfae1e.1467386530.git.berto@igalia.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6iEoaDp3UH3vsUxA46GrcBebna37w1j7s" Subject: Re: [Qemu-devel] [PATCH v3 06/11] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror' List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Jeff Cody , John Snow This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6iEoaDp3UH3vsUxA46GrcBebna37w1j7s From: Max Reitz To: Alberto Garcia , qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Eric Blake , Jeff Cody , John Snow Message-ID: <57c064d0-e1bd-b57b-0f83-81e0db2ffa56@redhat.com> Subject: Re: [PATCH v3 06/11] mirror: Add 'job-id' parameter to 'blockdev-mirror' and 'drive-mirror' References: <3816b0cafeee5a2e11c7fd649ca4a43e32dfae1e.1467386530.git.berto@igalia.com> In-Reply-To: <3816b0cafeee5a2e11c7fd649ca4a43e32dfae1e.1467386530.git.berto@igalia.com> Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 01.07.2016 17:52, Alberto Garcia wrote: > This patch adds a new optional 'job-id' parameter to 'blockdev-mirror' > and 'drive-mirror', allowing the user to specify the ID of the block > job to be created. >=20 > The HMP 'drive_mirror' command remains unchanged. >=20 > Signed-off-by: Alberto Garcia > Reviewed-by: Max Reitz > Reviewed-by: Eric Blake > --- > block/mirror.c | 15 ++++++++------- > blockdev.c | 15 ++++++++------- > hmp.c | 2 +- > include/block/block_int.h | 6 ++++-- > qapi/block-core.json | 10 +++++++--- > qmp-commands.hx | 8 +++++--- > 6 files changed, 33 insertions(+), 23 deletions(-) >=20 [...] > diff --git a/include/block/block_int.h b/include/block/block_int.h > index 549b1ed..dd45fec 100644 > --- a/include/block/block_int.h > +++ b/include/block/block_int.h > @@ -680,6 +680,8 @@ void commit_active_start(BlockDriverState *bs, Bloc= kDriverState *base, > void *opaque, Error **errp); > /* > * mirror_start: > + * @job_id: The id of the newly-created job, or %NULL to have one > + * generated automatically. No, NULL to use the device name (same in the three following patches). > * @bs: Block device to operate on. > * @target: Block device to write to. > * @replaces: Block graph node name to replace once the mirror is done= =2E Can > @@ -701,8 +703,8 @@ void commit_active_start(BlockDriverState *bs, Bloc= kDriverState *base, > * manually completed. At the end of a successful mirroring job, > * @bs will be switched to read from @target. > */ > -void mirror_start(BlockDriverState *bs, BlockDriverState *target, > - const char *replaces, > +void mirror_start(const char *job_id, BlockDriverState *bs, > + BlockDriverState *target, const char *replaces, > int64_t speed, uint32_t granularity, int64_t buf_siz= e, > MirrorSyncMode mode, BlockMirrorBackingMode backing_= mode, > BlockdevOnError on_source_error, > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 98a20d2..6f015c8 100644 > --- a/qapi/block-core.json > +++ b/qapi/block-core.json > @@ -1108,6 +1108,8 @@ > # > # Start mirroring a block device's writes to a new destination. > # > +# @job-id: #optional identifier for the newly-created block job (Since= 2.7) You should probably mention that this defaults to @device (as below and in the three following patches). Max > +# > # @device: the name of the device whose writes should be mirrored. > # > # @target: the target of the new image. If the file exists, or if it > @@ -1160,8 +1162,8 @@ > # Since 1.3 > ## > { 'command': 'drive-mirror', > - 'data': { 'device': 'str', 'target': 'str', '*format': 'str', > - '*node-name': 'str', '*replaces': 'str', > + 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', > + '*format': 'str', '*node-name': 'str', '*replaces': 'str',= > 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', > '*speed': 'int', '*granularity': 'uint32', > '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',= > @@ -1243,6 +1245,8 @@ > # > # Start mirroring a block device's writes to a new destination. > # > +# @job-id: #optional identifier for the newly-created block job (Since= 2.7) > +# > # @device: the name of the device whose writes should be mirrored. > # > # @target: the id or node-name of the block device to mirror to. This = mustn't be > @@ -1279,7 +1283,7 @@ > # Since 2.6 > ## > { 'command': 'blockdev-mirror', > - 'data': { 'device': 'str', 'target': 'str', > + 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str', > '*replaces': 'str', > 'sync': 'MirrorSyncMode', > '*speed': 'int', '*granularity': 'uint32', > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 6937e83..d9a9510 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -1656,8 +1656,8 @@ EQMP > =20 > { > .name =3D "drive-mirror", > - .args_type =3D "sync:s,device:B,target:s,speed:i?,mode:s?,for= mat:s?," > - "node-name:s?,replaces:s?," > + .args_type =3D "job-id:s?,sync:s,device:B,target:s,speed:i?,m= ode:s?," > + "format:s?,node-name:s?,replaces:s?," > "on-source-error:s?,on-target-error:s?," > "unmap:b?," > "granularity:i?,buf-size:i?", > @@ -1677,6 +1677,7 @@ of the source. > =20 > Arguments: > =20 > +- "job-id": identifier for the newly-created block job (json-string, o= ptional) > - "device": device name to operate on (json-string) > - "target": name of new image file (json-string) > - "format": format of new image (json-string, optional) > @@ -1720,7 +1721,7 @@ EQMP > =20 > { > .name =3D "blockdev-mirror", > - .args_type =3D "sync:s,device:B,target:B,replaces:s?,speed:i?= ," > + .args_type =3D "job-id:s?,sync:s,device:B,target:B,replaces:s= ?,speed:i?," > "on-source-error:s?,on-target-error:s?," > "granularity:i?,buf-size:i?", > .mhandler.cmd_new =3D qmp_marshal_blockdev_mirror, > @@ -1735,6 +1736,7 @@ specifies the target of mirror operation. > =20 > Arguments: > =20 > +- "job-id": identifier for the newly-created block job (json-string, o= ptional) > - "device": device name to operate on (json-string) > - "target": device name to mirror to (json-string) > - "replaces": the block driver node name to replace when finished >=20 --6iEoaDp3UH3vsUxA46GrcBebna37w1j7s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEvBAEBCAAZBQJXd8/uEhxtcmVpdHpAcmVkaGF0LmNvbQAKCRA7sUIC6DisrQxM CACXg2Qq3f2tID10zo+WBx4N6dlrvCKBR+zpTDFcVjRzaIQo20Glu9ltotOZ3+6u VffbpieTrMibkxLrdf+juJH7fgPfq90stdKm2tiqxFafRzGFQKz2rYVJDoMNctRm 93BcyN6PybD/hWMEYgtnjKO6GzasnwO9dk4U8njRx+P+3+clcCW41npDUZn1bpL5 vipUAKAbgLi3+GIo/wgWa2K7Uk27+WrkIYUrZRO8ukEdKxxzytdkCe/urOLbYDJz R0c8fZcU39c/WutU6X5YJEXK/BYLE1dEeXq4ZDOcdSAL/if5DYRDIJZIHYdvzsw0 WhgobxU694nYyyf0zm5f5NnX =epv/ -----END PGP SIGNATURE----- --6iEoaDp3UH3vsUxA46GrcBebna37w1j7s--