SHA256
1
0
forked from pool/qemu
qemu/qom-handle-case-of-chardev-spice-module-.patch
2022-05-27 12:52:53 +00:00

33 lines
1.1 KiB
Diff

From: Bruce Rogers <brogers@suse.com>
Date: Mon, 25 Jan 2021 22:09:27 -0700
Subject: qom: handle case of chardev-spice module unavailability
When qemu is built with modules, but a given module doesn't load
qemu should handle that gracefully. When chardev-spice.so isn't
able to be loaded and qemu is invoked with -display spice-app,
qemu will reach an abort call. Explicitly detect these conditions
and error out in a normal way before we reach the abort.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
qom/object.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qom/object.c b/qom/object.c
index 4f0677cca9e494a3eb20d9dabd0c..63ed3d67b61f7c5c67a3ee25e201 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -237,6 +237,12 @@ static bool type_is_ancestor(TypeImpl *type, TypeImpl *target_type)
return true;
}
+
+ if (type->parent && !strcmp(type->parent, "chardev-spiceport")) {
+ if (!type->parent_type && !type_get_by_name(type->parent)) {
+ return false;
+ }
+ }
type = type_get_parent(type);
}