From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvw9-0001qI-6w for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:48:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aLvw4-000428-3F for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:48:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aLvw3-000424-S8 for qemu-devel@nongnu.org; Wed, 20 Jan 2016 11:48:44 -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 (Postfix) with ESMTPS id 6539AC943F for ; Wed, 20 Jan 2016 16:48:43 +0000 (UTC) References: <1453208789-42479-1-git-send-email-imammedo@redhat.com> <1453208789-42479-7-git-send-email-imammedo@redhat.com> From: Eric Blake Message-ID: <569FBA69.3030505@redhat.com> Date: Wed, 20 Jan 2016 09:48:41 -0700 MIME-Version: 1.0 In-Reply-To: <1453208789-42479-7-git-send-email-imammedo@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="d7l5i2nA24C3ETqOsEIGQu9HEOH9ls3TX" Subject: Re: [Qemu-devel] [PATCH v17 6/9] qmp/hmp: add set-vm-generation-id commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Igor Mammedov , qemu-devel@nongnu.org Cc: ehabkost@redhat.com, mst@redhat.com, ghammer@redhat.com, lcapitulino@redhat.com, pbonzini@redhat.com, lersek@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --d7l5i2nA24C3ETqOsEIGQu9HEOH9ls3TX Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 01/19/2016 06:06 AM, Igor Mammedov wrote: > Add set-vm-generation-id command to set Virtual Machine > Generation ID counter. >=20 > QMP command example: > { "execute": "set-vm-generation-id", > "arguments": { > "uuid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87" > } > } >=20 > HMP command example: > set-vm-generation-id 324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87 >=20 > Signed-off-by: Igor Mammedov > --- > +++ b/hmp.c > @@ -2384,3 +2384,15 @@ void hmp_info_vm_generation_id(Monitor *mon, con= st QDict *qdict) > } > qapi_free_UuidInfo(info); > } > + > +void hmp_set_vm_generation_id(Monitor *mon, const QDict *qdict) > +{ > + Error *errp =3D NULL; > + const char *uuid =3D qdict_get_str(qdict, "uuid"); > + > + qmp_set_vm_generation_id(uuid, &errp); > + if (errp !=3D NULL) { I might have written 'if (errp)', but that's cosmetic style. > +++ b/qapi-schema.json > @@ -4090,3 +4090,12 @@ > # Since 2.6 > ## > { 'command': 'query-vm-generation-id', 'returns': 'UuidInfo' } > + > +## > +# @set-vm-generation-id > +# > +# Set Virtual Machine Generation ID > +# Missing documentation of the @uuid argument. > +# Since 2.6 > +## > +{ 'command': 'set-vm-generation-id', 'data': { 'uuid': 'str' } } > diff --git a/qmp-commands.hx b/qmp-commands.hx > index 9408a3d..306082f 100644 > --- a/qmp-commands.hx > +++ b/qmp-commands.hx > @@ -4814,3 +4814,25 @@ Example: > =20 > -> { "execute": "query-vm-generation-id" } > <- {"return": {"UUID": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87"}} Annoying that the set uses 'uuid' and the query responds with 'UUID'; I prefer the lowercase version in new API, so maybe patch 5/9 should create a new return type with desirable spelling rather than reusing the older type. > +SQMP > +Set Virtual Machine Generation ID counter > +----- > + > +Arguments: > + > +- "UUID": counter ID in UUID string representation (json-string)" wrong case, per the example. > + > +Example: > + > +-> { "execute": "set-vm-generation-id" , > + "arguments": { "uuid": "324e6eaf-d1d1-4bf6-bf41-b9bb6c91fb87" } }= > +<- {"return": {}} --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --d7l5i2nA24C3ETqOsEIGQu9HEOH9ls3TX 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/ iQEcBAEBCAAGBQJWn7pqAAoJEKeha0olJ0NqdukH/jHqJ4ptwUjKv8iiYuOlF0N1 P0gnyWjcieve1VeEwHaYDN9mnEBQ0KQmq29mOulstphu4o+S+b9Xx8CmEPJ7KqEU mKbqhlCPRqks5uB/OqVb3rirCEozvZmUDX79ITovLLqQPniKfbOoKcbghTspwqIk WAguvyNE3eDaPWem2YFdRbIbGxes6428nM7J5neyWaMXqpRtLsJPWWQ3c3TRKAZR oDTYe8G7ZYyt0/yNV1sJdqPzg+eAlrMLlQToTW4o0/NnMOyeijzCFhShz1j9y3LW 5jD0bTK3rsTxulxTyMtGzt2JSFPo/vxouo3hITnCb6ICNAMFTLoh5Ebdts5s9SM= =AM++ -----END PGP SIGNATURE----- --d7l5i2nA24C3ETqOsEIGQu9HEOH9ls3TX--