From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMIH2-0000IG-71 for qemu-devel@nongnu.org; Thu, 21 Jan 2016 11:39:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMIH1-0004bC-09 for qemu-devel@nongnu.org; Thu, 21 Jan 2016 11:39:52 -0500 References: <1453375338-13508-1-git-send-email-rudyflyzhang@gmail.com> <1453375338-13508-2-git-send-email-rudyflyzhang@gmail.com> From: Eric Blake Message-ID: <56A109D1.4000701@redhat.com> Date: Thu, 21 Jan 2016 09:39:45 -0700 MIME-Version: 1.0 In-Reply-To: <1453375338-13508-2-git-send-email-rudyflyzhang@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="cj9qcdT2tnpJOJoIbhO7NLUB30TjRmEEa" Subject: Re: [Qemu-devel] [PATCH 1/2] hmp: add hmp command for incremental backup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Rudy Zhang , qemu-devel@nongnu.org Cc: famz@redhat.com, qemu-block@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --cj9qcdT2tnpJOJoIbhO7NLUB30TjRmEEa Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/21/2016 04:22 AM, Rudy Zhang wrote: > Add hmp command for incremental backup in drive-backup. > It need a bitmap to backup data from drive-image to incremental image, > so before it need add bitmap for this device to track io. > Usage: > drive_backup [-n] [-f] device target [bitmap] [format] >=20 > Signed-off-by: Rudy Zhang > --- > hmp-commands.hx | 5 +++-- > hmp.c | 16 ++++++++++++++-- > 2 files changed, 17 insertions(+), 4 deletions(-) >=20 > diff --git a/hmp-commands.hx b/hmp-commands.hx > index bb52e4d..7378aaa 100644 > --- a/hmp-commands.hx > +++ b/hmp-commands.hx > @@ -1180,12 +1180,13 @@ ETEXI > =20 > { > .name =3D "drive_backup", > - .args_type =3D "reuse:-n,full:-f,device:B,target:s,format:s?"= , > - .params =3D "[-n] [-f] device target [format]", > + .args_type =3D "reuse:-n,full:-f,device:B,target:s,bitmap:s?,= format:s?", > + .params =3D "[-n] [-f] device target [bitmap] [format]", This is HMP, so it may not matter, but this is not backwards compatible. Scripts targetting the old style of passing a format will now have that format string interpreted as a bitmap name with no format. Better would be to stick [bitmap] at the end, not the middle. > @@ -1098,6 +1100,17 @@ void hmp_drive_backup(Monitor *mon, const QDict = *qdict) > return; > } > =20 > + if (full && bitmap) { > + error_setg(&err, "Parameter 'bitmap' if conflict with '-f'"); s/if conflict/conflicts/ > + hmp_handle_error(mon, &err); > + return; > + } else if (full) > + sync =3D MIRROR_SYNC_MODE_FULL; Needs {}. Run your patch through scripts/checkpatch.pl, to flag this and other style violations. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --cj9qcdT2tnpJOJoIbhO7NLUB30TjRmEEa 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 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWoQnRAAoJEKeha0olJ0NqEekH/R1snH0CJwmA/krpV/nqKD6L UoeMnv6d6FA20hx6OiMdd1c4+y52u5m/kPlKCeRHfrwzhzs2CvsbwnOZR54EGUEg JjMZLCBspgue0YRHFf0UMkjmqWxgY5dOY/R6hGA4bb0UA+GINI/1M6txgKYIp30w n5EH+AOH/WgihFMapE4YjHT2SkiyIAwJZ9KR20QBIxGim1RGsFARSdB4Vjnlx1jm aY5uMRxByNOUTg0JN9UUvz0IFjIdXk+x/dlpUXNnNp5X/5mmgvhaftNVBCvhRCuW BK2e37Vipj4+CkFc25UXtxI1GCamymQ2hCPGBxyz/3y6OXMctmV2Mjr/v6DXLAg= =rqoE -----END PGP SIGNATURE----- --cj9qcdT2tnpJOJoIbhO7NLUB30TjRmEEa--