[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 20/31] qom: Make "object" QemuOptsList optional
From: |
Kevin Wolf |
Subject: |
[PATCH v2 20/31] qom: Make "object" QemuOptsList optional |
Date: |
Wed, 24 Feb 2021 14:52:44 +0100 |
This code is going away anyway, but for a few more commits, we'll be in
a state where some binaries still use QemuOpts and others don't. If the
"object" QemuOptsList doesn't even exist, we don't have to remove (or
fail to remove, and therefore abort) a user creatable object from it.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
qom/object_interfaces.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/qom/object_interfaces.c b/qom/object_interfaces.c
index 1e9ad6f08a..b9a99c8bf4 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -290,6 +290,7 @@ void user_creatable_print_help_from_qdict(QDict *args)
bool user_creatable_del(const char *id, Error **errp)
{
+ QemuOptsList *opts_list;
Object *container;
Object *obj;
@@ -309,8 +310,10 @@ bool user_creatable_del(const char *id, Error **errp)
* if object was defined on the command-line, remove its corresponding
* option group entry
*/
- qemu_opts_del(qemu_opts_find(qemu_find_opts_err("object", &error_abort),
- id));
+ opts_list = qemu_find_opts_err("object", NULL);
+ if (opts_list) {
+ qemu_opts_del(qemu_opts_find(opts_list, id));
+ }
object_unparent(obj);
return true;
--
2.29.2
- [PATCH v2 08/31] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened', (continued)
- [PATCH v2 08/31] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened', Kevin Wolf, 2021/02/24
- [PATCH v2 18/31] qapi/qom: Add ObjectOptions for x-remote-object, Kevin Wolf, 2021/02/24
- [PATCH v2 15/31] qapi/qom: Add ObjectOptions for pr-manager-helper, Kevin Wolf, 2021/02/24
- [PATCH v2 13/31] qapi/qom: Add ObjectOptions for colo-compare, Kevin Wolf, 2021/02/24
- [PATCH v2 21/31] qemu-storage-daemon: Implement --object with qmp_object_add(), Kevin Wolf, 2021/02/24
- [PATCH v2 20/31] qom: Make "object" QemuOptsList optional,
Kevin Wolf <=
- [PATCH v2 17/31] qapi/qom: Add ObjectOptions for input-*, Kevin Wolf, 2021/02/24
- [PATCH v2 23/31] qom: Factor out user_creatable_process_cmdline(), Kevin Wolf, 2021/02/24
- [PATCH v2 11/31] qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded', Kevin Wolf, 2021/02/24
- [PATCH v2 09/31] qapi/qom: Add ObjectOptions for throttle-group, Kevin Wolf, 2021/02/24
- [PATCH v2 04/31] qapi/qom: Add ObjectOptions for authz-*, Kevin Wolf, 2021/02/24