From: Eric Blake <eblake@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 1/3] qga: introduce guest-get-vcpus / guest-set-vcpus with stubs
Date: Wed, 06 Mar 2013 15:32:00 -0700 [thread overview]
Message-ID: <5137C3E0.3060600@redhat.com> (raw)
In-Reply-To: <1362607171-24668-2-git-send-email-lersek@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2977 bytes --]
On 03/06/2013 02:59 PM, Laszlo Ersek wrote:
> Signed-off-by: Laszlo Ersek <lersek@redhat.com>
> ---
> qga/qapi-schema.json | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++
> qga/commands-posix.c | 12 ++++++++
> qga/commands-win32.c | 12 ++++++++
> 3 files changed, 96 insertions(+), 0 deletions(-)
>
> diff --git a/qga/qapi-schema.json b/qga/qapi-schema.json
> index d91d903..cba881c 100644
> --- a/qga/qapi-schema.json
> +++ b/qga/qapi-schema.json
> @@ -515,3 +515,75 @@
> ##
> { 'command': 'guest-network-get-interfaces',
> 'returns': ['GuestNetworkInterface'] }
> +
> +##
> +# @GuestLogicalProcessor:
> +#
> +# @logical-id: Arbitrary guest-specific unique identifier of the VCPU.
> +#
> +# @online: Whether the VCPU is enabled.
> +#
> +# @can-offline: Whether offlining the VCPU is possible. This member is always
> +# filled in by the guest agent when the structure is returned,
> +# and always ignored on input (hence it can be omitted then).
Other places have used the notation '#optional' when documenting a
parameter that need not be present on input; although we don't have
anything that strictly requires/enforces that notation.
> +#
> +# Since: 1.5
> +##
> +{ 'type': 'GuestLogicalProcessor',
> + 'data': {'logical-id': 'int',
Should logical-id be 'str' instead of 'int', since we said it is
arbitrary what the guest names its vcpus? Then again, integers can be
made to work (even if the guest OS prefers to name cpus via strings, the
agent can track a 1:1 lookup table between OS string and integer number
handed over qga, perhaps even by returning an invariant pointer address
of the OS string as the integer identifier), so I won't insist.
> +# Returns: The length of the initial sublist that has been successfully
> +# processed. The guest agent maximizes this value. Possible cases:
> +#
> +# 0: if the @vcpus list was empty on input. Guest state
> +# has not been changed. Otherwise,
> +#
> +# Error: processing the first node of @vcpus failed for the
> +# reason returned. Guest state has not been changed.
> +# Otherwise,
> +#
> +
> +int64_t qmp_guest_set_vcpus(GuestLogicalProcessorList *vcpus, Error **errp)
> +{
> + error_set(errp, QERR_UNSUPPORTED);
> + return -1;
This returns an error even on an empty input @vcpus, while the docs said
that returning 0 takes priority. But it's so much of a corner case that
I don't care; always returning an error seems fine.
Thus, although there are things you might change if you have to respin
the series for later review comments, I'm perfectly fine leaving this
as-is and you can use:
Reviewed-by: Eric Blake <eblake@redhat.com>
--
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: 621 bytes --]
next prev parent reply other threads:[~2013-03-06 22:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 21:59 [Qemu-devel] [PATCH v2 0/3] qga/Linux: online/offline/query VCPUs via guest sysfs Laszlo Ersek
2013-03-06 21:59 ` [Qemu-devel] [PATCH v2 1/3] qga: introduce guest-get-vcpus / guest-set-vcpus with stubs Laszlo Ersek
2013-03-06 22:32 ` Eric Blake [this message]
2013-03-06 22:48 ` Laszlo Ersek
2013-03-06 23:24 ` mdroth
2013-03-06 21:59 ` [Qemu-devel] [PATCH v2 2/3] qga: implement qmp_guest_get_vcpus() for Linux with sysfs Laszlo Ersek
2013-03-06 23:15 ` Eric Blake
2013-03-06 23:40 ` Laszlo Ersek
2013-03-06 21:59 ` [Qemu-devel] [PATCH v2 3/3] qga: implement qmp_guest_set_vcpus() " Laszlo Ersek
2013-03-06 23:20 ` Eric Blake
2013-03-06 23:55 ` Laszlo Ersek
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=5137C3E0.3060600@redhat.com \
--to=eblake@redhat.com \
--cc=lersek@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).