From 4e66254e0dc84db4dde0baae45b240566b8b73fe244c342eadc202a7dfb56fb2 Mon Sep 17 00:00:00 2001 From: Bruce Rogers Date: Thu, 28 Jan 2021 00:43:06 +0000 Subject: [PATCH] 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 --- bundles.tar.xz | 4 ++-- ...le-for-virtio-gpu-pre-load-module-to.patch | 24 +++++++++++++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/bundles.tar.xz b/bundles.tar.xz index de1a40fb..e1d6ee43 100644 --- a/bundles.tar.xz +++ b/bundles.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:46d1f552ea4a7255ac0240c6ecf5457cd5bdff871733916e017108b744a856bb -size 43236 +oid sha256:336893b5cf72b73b6cca9f9b6764b8efeaa388dbd77b72c46105e58454255a76 +size 43256 diff --git a/module-for-virtio-gpu-pre-load-module-to.patch b/module-for-virtio-gpu-pre-load-module-to.patch index 72d55e1f..9f5abca7 100644 --- a/module-for-virtio-gpu-pre-load-module-to.patch +++ b/module-for-virtio-gpu-pre-load-module-to.patch @@ -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 --- 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; }