From: Eric Blake <eblake@redhat.com>
To: zhanghailiang <zhang.zhanghailiang@huawei.com>, 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
Subject: Re: [Qemu-devel] [RFC PATCH 1/2] qga: Introduce guest-get-os-version command with stubs
Date: Tue, 16 Dec 2014 09:23:46 -0700 [thread overview]
Message-ID: <54905C92.7070203@redhat.com> (raw)
In-Reply-To: <1418715038-4664-2-git-send-email-zhang.zhanghailiang@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1993 bytes --]
On 12/16/2014 12:30 AM, zhanghailiang wrote:
> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
> ---
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:
=> { "execute": "guest-get-os-version" }
<= { "return": { "family": "Windows",
"info": "Microsoft Windows Server 2012 R2",
"word-width": 64 } }
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]
next prev parent reply other threads:[~2014-12-16 16:24 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-16 7:30 [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version for windows zhanghailiang
2014-12-16 7:30 ` [Qemu-devel] [RFC PATCH 1/2] qga: Introduce guest-get-os-version command with stubs zhanghailiang
2014-12-16 16:23 ` Eric Blake [this message]
2015-01-03 0:32 ` Richard W.M. Jones
2014-12-16 7:30 ` [Qemu-devel] [RFC PATCH 2/2] qga: implement qmp_guest_get_os_version for windows zhanghailiang
2014-12-16 11:48 ` Yan Vugenfirer
2014-12-16 16:26 ` Eric Blake
2014-12-17 8:14 ` zhanghailiang
2014-12-16 9:38 ` [Qemu-devel] [RFC PATCH 0/2] qga: add guest-get-os-version " Yan Vugenfirer
2014-12-16 11:06 ` zhanghailiang
2014-12-16 16:25 ` Eric Blake
2014-12-17 8:12 ` zhanghailiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54905C92.7070203@redhat.com \
--to=eblake@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=lersek@redhat.com \
--cc=lilei@linux.vnet.ibm.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=zhang.zhanghailiang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.