[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 27/31] qom: Add user_creatable_add_from_str()
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 27/31] qom: Add user_creatable_add_from_str() |
Date: |
Fri, 26 Feb 2021 16:21:52 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 |
On 2/24/21 7:52 AM, Kevin Wolf wrote:
> This is a version of user_creatable_process_cmdline() with an Error
> parameter that never calls exit() and is therefore usable in HMP.
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> include/qom/object_interfaces.h | 16 ++++++++++++++++
> qom/object_interfaces.c | 29 ++++++++++++++++++++++++-----
> 2 files changed, 40 insertions(+), 5 deletions(-)
>
> +/**
> + * user_creatable_add_from_str:
> + * @optarg: the object definition string as passed on the command line
> + * @errp: if an error occurs, a pointer to an area to store the error
> + *
> + * Create an instance of the user creatable object by parsing optarg
> + * with a keyval parser and implicit key 'qom-type', converting the
> + * result to ObjectOptions and calling into qmp_object_add().
> + *
> + * If a help option is given, print help instead.
> + *
> + * Returns: true when an object was successfully created, false when an error
> + * occurred (*errp is set then) or help was printed (*errp is not set).
> + */
> +bool user_creatable_add_from_str(const char *optarg, Error **errp);
This could be used to fix the exit status 2 issue in qemu-img convert,
if you rearrange the series a bit.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object, (continued)
- [PATCH v2 25/31] qemu-img: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/02/24
- [PATCH v2 22/31] qom: Remove user_creatable_add_dict(), Kevin Wolf, 2021/02/24
- [PATCH v2 29/31] qom: Add user_creatable_parse_str(), Kevin Wolf, 2021/02/24
- [PATCH v2 24/31] qemu-io: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/02/24
- [PATCH v2 27/31] qom: Add user_creatable_add_from_str(), Kevin Wolf, 2021/02/24
- Re: [PATCH v2 27/31] qom: Add user_creatable_add_from_str(),
Eric Blake <=
- [PATCH v2 26/31] qemu-nbd: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/02/24
- [PATCH v2 31/31] qom: Drop QemuOpts based interfaces, Kevin Wolf, 2021/02/24
- [PATCH v2 30/31] vl: QAPIfy -object, Kevin Wolf, 2021/02/24
- Re: [PATCH v2 00/31] qapi/qom: QAPIfy --object and object-add, Peter Krempa, 2021/02/24