[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/38] qom: Make "object" QemuOptsList optional
From: |
Kevin Wolf |
Subject: |
[PULL 29/38] qom: Make "object" QemuOptsList optional |
Date: |
Thu, 11 Mar 2021 15:48:02 +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>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@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 7661270b98..d4df2334b7 100644
--- a/qom/object_interfaces.c
+++ b/qom/object_interfaces.c
@@ -299,6 +299,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;
@@ -318,8 +319,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
- [PULL 16/38] qapi/qom: Add ObjectOptions for memory-backend-*, (continued)
- [PULL 16/38] qapi/qom: Add ObjectOptions for memory-backend-*, Kevin Wolf, 2021/03/11
- [PULL 07/38] test: new qTest case to test the vhost-user-blk-server, Kevin Wolf, 2021/03/11
- [PULL 19/38] qapi/qom: Add ObjectOptions for secret*, deprecate 'loaded', Kevin Wolf, 2021/03/11
- [PULL 17/38] qapi/qom: Add ObjectOptions for rng-*, deprecate 'opened', Kevin Wolf, 2021/03/11
- [PULL 21/38] qapi/qom: Add ObjectOptions for can-*, Kevin Wolf, 2021/03/11
- [PULL 20/38] qapi/qom: Add ObjectOptions for tls-*, deprecate 'loaded', Kevin Wolf, 2021/03/11
- [PULL 24/38] qapi/qom: Add ObjectOptions for pr-manager-helper, Kevin Wolf, 2021/03/11
- [PULL 22/38] qapi/qom: Add ObjectOptions for colo-compare, Kevin Wolf, 2021/03/11
- [PULL 27/38] qapi/qom: Add ObjectOptions for x-remote-object, Kevin Wolf, 2021/03/11
- [PULL 23/38] qapi/qom: Add ObjectOptions for filter-*, Kevin Wolf, 2021/03/11
- [PULL 29/38] qom: Make "object" QemuOptsList optional,
Kevin Wolf <=
- [PULL 32/38] qom: Factor out user_creatable_process_cmdline(), Kevin Wolf, 2021/03/11
- [PULL 31/38] qom: Remove user_creatable_add_dict(), Kevin Wolf, 2021/03/11
- [PULL 25/38] qapi/qom: Add ObjectOptions for confidential-guest-support, Kevin Wolf, 2021/03/11
- [PULL 28/38] qapi/qom: QAPIfy object-add, Kevin Wolf, 2021/03/11
- [PULL 26/38] qapi/qom: Add ObjectOptions for input-*, Kevin Wolf, 2021/03/11
- [PULL 30/38] qemu-storage-daemon: Implement --object with qmp_object_add(), Kevin Wolf, 2021/03/11
- [PULL 34/38] qemu-nbd: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/03/11
- [PULL 33/38] qemu-io: Use user_creatable_process_cmdline() for --object, Kevin Wolf, 2021/03/11
- [PULL 35/38] qom: Add user_creatable_add_from_str(), Kevin Wolf, 2021/03/11
- [PULL 38/38] qom: Add user_creatable_parse_str(), Kevin Wolf, 2021/03/11