Accepting request 867333 from home:bfrogers:branches:Virtualization

One more code location was needing to check for a missing module.

OBS-URL: https://build.opensuse.org/request/show/867333
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=608
This commit is contained in:
Bruce Rogers 2021-01-28 00:43:06 +00:00 committed by Git OBS Bridge
parent 4dca4ea015
commit 4e66254e0d
2 changed files with 21 additions and 7 deletions

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:46d1f552ea4a7255ac0240c6ecf5457cd5bdff871733916e017108b744a856bb
size 43236
oid sha256:336893b5cf72b73b6cca9f9b6764b8efeaa388dbd77b72c46105e58454255a76
size 43256

View File

@ -4,7 +4,7 @@ Subject: module: for virtio-gpu, pre-load module to avoid abort on missing
module
If the hw-display-virtio-gpu module is not loadable when the virtio-gpu
device is on the commandline or being added in monitor, qemu will call
device is on the command line or being added in monitor, qemu will call
abort. We can fail gracefully by doing the module load in a context
which is set up to handle errors properly. (bsc#1181103)
@ -12,8 +12,8 @@ Signed-off-by: Bruce Rogers <brogers@suse.com>
---
include/qemu/module.h | 1 +
qom/object.c | 12 ++++++++++++
softmmu/qdev-monitor.c | 8 ++++++++
3 files changed, 21 insertions(+)
softmmu/qdev-monitor.c | 15 +++++++++++++++
3 files changed, 28 insertions(+)
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 944d403cbd1535cc121af76a94f2..4b42dd285eeac1ba12e5c9e18ac0 100644
@ -50,10 +50,24 @@ index 10653552334549241cd5672d7a02..6f301fec34d103b0b07bc41d107c 100644
{
TypeImpl *type = type_get_by_name(typename);
diff --git a/softmmu/qdev-monitor.c b/softmmu/qdev-monitor.c
index bf79d0bbcd986320eb609f37253e..7f6ad469638ba55a5bb8bfd02fe3 100644
index bf79d0bbcd986320eb609f37253e..564dfaeeda9c3ae9dbf1afa97825 100644
--- a/softmmu/qdev-monitor.c
+++ b/softmmu/qdev-monitor.c
@@ -650,6 +650,14 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
@@ -263,6 +263,13 @@ int qdev_device_help(QemuOpts *opts)
int i;
driver = qemu_opt_get(opts, "driver");
+#ifdef CONFIG_MODULES
+ if (driver && !strcmp(driver, "virtio-gpu")) {
+ if (module_load_check("virtio-gpu-device")) {
+ return 0;
+ }
+ }
+#endif
if (driver && is_help_option(driver)) {
qdev_print_devinfos(false);
return 1;
@@ -650,6 +657,14 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **errp)
return NULL;
}