From: Eric Blake <eblake@redhat.com>
To: arei.gonglei@huawei.com, qemu-devel@nongnu.org
Cc: chenliang88@huawei.com, weidong.huang@huawei.com, mst@redhat.com,
aik@ozlabs.ru, hutao@cn.fujitsu.com, armbru@redhat.com,
kraxel@redhat.com, akong@redhat.com, agraf@suse.de,
aliguori@amazon.com, gaowanlong@cn.fujitsu.com,
ehabkost@redhat.com, luonengjun@huawei.com,
peter.huangpeng@huawei.com, hani@linux.com, stefanha@redhat.com,
pbonzini@redhat.com, lcapitulino@redhat.com, kwolf@redhat.com,
peter.crosthwaite@xilinx.com, imammedo@redhat.com,
afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v3 5/7] qmp: add set-bootindex command
Date: Wed, 30 Jul 2014 16:36:59 -0600 [thread overview]
Message-ID: <53D9738B.2040701@redhat.com> (raw)
In-Reply-To: <1406349933-17536-6-git-send-email-arei.gonglei@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2235 bytes --]
On 07/25/2014 10:45 PM, arei.gonglei@huawei.com wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> Adds "set-bootindex id=xx,bootindex=xx,suffix=xx" QMP command.
>
> Example QMP command:
> -> { "execute": "set-bootindex", "arguments": { "id": "ide0-0-1", "bootindex": 1, "suffix": "/disk@0"}}
> <- { "return": {} }
>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> Signed-off-by: Chenliang <chenliang88@huawei.com>
> ---
> qapi-schema.json | 16 ++++++++++++++++
> qmp-commands.hx | 24 ++++++++++++++++++++++++
> qmp.c | 17 +++++++++++++++++
> 3 files changed, 57 insertions(+)
>
> diff --git a/qapi-schema.json b/qapi-schema.json
> index b11aad2..a9ef0be 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1704,6 +1704,22 @@
> { 'command': 'device_del', 'data': {'id': 'str'} }
>
> ##
> +# @set-bootindex:
> +#
> +# set bootindex of a devcie
s/devcie/device/
Just to make sure this command is not write-only, it would be nice to
mention which query-* command can be used to learn a device's current
bootindex.
> +#
> +# @id: the name of the device
> +# @bootindex: the bootindex of the device
> +# @suffix: #optional a suffix of the device
> +#
> +# Returns: Nothing on success
> +# If @id is not a valid device, DeviceNotFound
> +#
> +# Since: 2.2
> +##
> +{ 'command': 'set-bootindex', 'data': {'id': 'str', 'bootindex': 'int', '*suffix': 'str'} }
Long line; wrap it to stay in 80 columns.
> +
> +SQMP
> +set-bootindex
> +--------------------
Match the ---- length to the command name.
> +++ b/qmp.c
> @@ -684,6 +684,23 @@ void qmp_object_del(const char *id, Error **errp)
> object_unparent(obj);
> }
>
> +void qmp_set_bootindex(const char *id, int64_t bootindex,
> + bool has_suffix, const char *suffix, Error **errp)
Indentation is off.
> +{
> + DeviceState *dev;
> +
> + dev = qdev_find_recursive(sysbus_get_default(), id);
> + if (NULL == dev) {
Code like Yoda we do not. This is more idiomatically written 'if
(!dev)' or 'if (dev == NULL)'.
--
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-07-30 22:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-26 4:45 [Qemu-devel] [PATCH v3 0/7] modify boot order of guest, and take effect after rebooting arei.gonglei
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 1/7] bootindex: add modify_boot_device_path function arei.gonglei
2014-07-27 3:51 ` 陈梁
2014-07-28 2:57 ` Gonglei (Arei)
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 2/7] bootindex: add del_boot_device_path function arei.gonglei
2014-07-31 2:21 ` Eric Blake
2014-07-31 2:24 ` Gonglei (Arei)
2014-08-01 14:06 ` Eduardo Habkost
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 3/7] fw_cfg: add fw_cfg_machine_reset function arei.gonglei
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 4/7] bootindex: delete bootindex when device is removed arei.gonglei
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 5/7] qmp: add set-bootindex command arei.gonglei
2014-07-30 22:36 ` Eric Blake [this message]
2014-07-31 1:22 ` Gonglei (Arei)
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 6/7] qemu-monitor: HMP set-bootindex wrapper arei.gonglei
2014-07-26 4:45 ` [Qemu-devel] [PATCH v3 7/7] spapr: fix possible memory leak arei.gonglei
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=53D9738B.2040701@redhat.com \
--to=eblake@redhat.com \
--cc=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=akong@redhat.com \
--cc=aliguori@amazon.com \
--cc=arei.gonglei@huawei.com \
--cc=armbru@redhat.com \
--cc=chenliang88@huawei.com \
--cc=ehabkost@redhat.com \
--cc=gaowanlong@cn.fujitsu.com \
--cc=hani@linux.com \
--cc=hutao@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=luonengjun@huawei.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.crosthwaite@xilinx.com \
--cc=peter.huangpeng@huawei.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=weidong.huang@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.