From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0uup-0000zo-0x for qemu-devel@nongnu.org; Tue, 16 Dec 2014 11:24:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y0uuk-0004FH-Lo for qemu-devel@nongnu.org; Tue, 16 Dec 2014 11:24:02 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y0uuk-0004F6-E0 for qemu-devel@nongnu.org; Tue, 16 Dec 2014 11:23:58 -0500 Message-ID: <54905C92.7070203@redhat.com> Date: Tue, 16 Dec 2014 09:23:46 -0700 From: Eric Blake MIME-Version: 1.0 References: <1418715038-4664-1-git-send-email-zhang.zhanghailiang@huawei.com> <1418715038-4664-2-git-send-email-zhang.zhanghailiang@huawei.com> In-Reply-To: <1418715038-4664-2-git-send-email-zhang.zhanghailiang@huawei.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Bud9oF3S1bF1nngP3558hbIfVe5F4Sk8j" Subject: Re: [Qemu-devel] [RFC PATCH 1/2] qga: Introduce guest-get-os-version command with stubs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: zhanghailiang , qemu-devel@nongnu.org Cc: lilei@linux.vnet.ibm.com, lcapitulino@redhat.com, lersek@redhat.com, peter.huangpeng@huawei.com, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Bud9oF3S1bF1nngP3558hbIfVe5F4Sk8j Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/16/2014 12:30 AM, zhanghailiang wrote: > Signed-off-by: zhanghailiang > --- Might be nice to show an example (intended) usage of the new command in the commit message. > +++ b/qga/qapi-schema.json > @@ -738,3 +738,29 @@ > ## > { 'command': 'guest-get-fsinfo', > 'returns': ['GuestFilesystemInfo'] } > +## Blank line between commands. > +# @GuestOSVersion: > +# > +# @name: system version. > +# > +# @:type: 64-bit or 32-bit. s/@:/@/ 'type' feels like the wrong name for word-width. Maybe 'word-width' is a better name? > +# > +# Since: 2.3 > +## > +{ 'type': 'GuestOSVersion', > + 'data': {'name': 'str', 'type': 'int'} } 'name' feels a bit vague; it looks like you are intending to use the string as a free-form text field, where the guest can supply arbitrary strings. Maybe name it 'info' instead? Is it worth being any stricter, such as having actual enums of known values? On the other hand, tying to known enums means we have to update qemu-ga every time a new guest gains support for running the agent, while free-form string leaves us a bit more flexible. Or maybe you want both, as in: { 'enum': 'GuestOSFamily', 'data': ['Windows', 'Linux', 'other'] } { 'type': 'GuestOSVersion', 'data': { 'info': 'str', 'family': 'GuestOSFamily', 'word-width': 'int' } } > + > +## > +# @guest-get-os-version: > +# > +# Get the guest's operating system version and bit. s/bit/word width/ > +# > +# This is a read-only operation. > +# > +# Returns: version > +# > +# Since: 2.3 > +## > +{ 'command': 'guest-get-os-version', > + 'returns': 'GuestOSVersion' } with my suggestions, a usage might be: =3D> { "execute": "guest-get-os-version" } <=3D { "return": { "family": "Windows", "info": "Microsoft Windows Server 2012 R2", "word-width": 64 } } --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Bud9oF3S1bF1nngP3558hbIfVe5F4Sk8j Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJUkFySAAoJEKeha0olJ0Nqw4wIAJEs+Jr+U9cH7rShLAeoANC5 18oawYNwUo3r9xwrAbDRysrgDic277JbSTC8qmOl1KzDcchrCwMe4Ce4EkdR/i+c yGT6KNtYI2PJrujVRW6pJ+D171plf4chtM6bLZqQTix6bD1bv44PHiMVI1qzLHwI o0m5eEytsEq4SrVekKCt39eq2TsdBVgtSvoinrAOrYGt3Fb6csbZwDHrIyWC/9U5 uol9160ut6PRHbIu0JS7y/Q/KpDDmy5PW4EUupWcQ9n7RQgBoixbTVqbN/78zJBd wM3LJ+0xGc5EffJdInm4iTsYEQ2cSbndjRPbphpRv+5tX1UuTNZNn3X9O2DXBws= =T6T0 -----END PGP SIGNATURE----- --Bud9oF3S1bF1nngP3558hbIfVe5F4Sk8j--