From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YjFP4-0003iP-E1 for qemu-devel@nongnu.org; Fri, 17 Apr 2015 19:10:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YjFP3-00009r-6m for qemu-devel@nongnu.org; Fri, 17 Apr 2015 19:10:30 -0400 Message-ID: <553192DB.8030202@redhat.com> Date: Fri, 17 Apr 2015 17:10:19 -0600 From: Eric Blake MIME-Version: 1.0 References: <1428531604-9428-1-git-send-email-jsnow@redhat.com> <1428531604-9428-11-git-send-email-jsnow@redhat.com> <55318E5C.4040602@redhat.com> <553190FB.4050001@redhat.com> In-Reply-To: <553190FB.4050001@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Jrflp2vtwFp3B9bU5LJ4UlSc7VQxWv2Pv" Subject: Re: [Qemu-devel] [PATCH v5 10/21] qmp: Add support of "dirty-bitmap" sync mode for drive-backup List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow , qemu-block@nongnu.org Cc: kwolf@redhat.com, famz@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com, vsementsov@parallels.com, stefanha@redhat.com, mreitz@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Jrflp2vtwFp3B9bU5LJ4UlSc7VQxWv2Pv Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/17/2015 05:02 PM, John Snow wrote: >>> { 'type': 'DriveBackup', >>> 'data': { 'device': 'str', 'target': 'str', '*format': 'str', >>> 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', >>> - '*speed': 'int', >>> + '*speed': 'int', '*bitmap': 'str', >> >> Looks okay. Is it an error if bitmap is supplied, but mode is not >> dirty-bitmap? Likewise, if mode is dirty-bitmap but bitmap is not >> supplied? >> >=20 > Yes: Then we _could_ do this as a flat union (here, using a shorthand syntax of anonymous inline types, although qapi does not yet support it): { 'type': 'DriveBackupBase', 'data': { 'device': 'str', 'target': 'str', '*format': 'str', 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode', '*speed': 'int', '*on-source-error': 'BlockdevOnError', '*on-target-error': 'BlockdevOnError' } } { 'union': 'DriveBackup', 'base': 'DriveBackupBase', 'discriminator': 'sync', 'data': { 'top': {}, 'full': {}, 'none': {}, 'dirty-bitmap': { 'bitmap': 'str' } } } which would enforce that 'bitmap' be present exactly when 'sync':'dirty-bitmap'. But that's probably overkill; I don't expect you to do it (especially since qapi shorthand for anonymous inline types is not there yet). --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Jrflp2vtwFp3B9bU5LJ4UlSc7VQxWv2Pv 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/ iQEcBAEBCAAGBQJVMZLbAAoJEKeha0olJ0Nqqi8H/Rsvmx1yG/vY5/GV/11t+lse Dn9Q+36nW1M61lN4B2NAUgHyLD+Rw6odg/S7TwNDZTgeWumbIvQWvSDxchw7avjW Bo/Z+purXa+ZFMu9CTyqG/LaFO7U5gKRsONcoqr35iEQ14gd4WCikB7h0uNkp3mV SotzVksMHFQOqKc0o8Vud1gNbYi1TNIuDF26pJ8z2zSKbT8tb4EV+Wo4upQ4H71m PN0My0RnYNzD8eCAucISAm+zaGlJNTd/9I4/lIZ0u5k6p8C9X8LId1KzaIlNsRxe dHR88X+LdaiUTRlmCtnCo5bssxHxSgiAaI3U6UKtLK6Vzkmrx/0lzzZpvx0miek= =LUOp -----END PGP SIGNATURE----- --Jrflp2vtwFp3B9bU5LJ4UlSc7VQxWv2Pv--