From 95d05af7e8b98838e2fc56463a529b36269d46dbbb2e94af0584d5992d8be37f Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Fri, 23 Jul 2021 21:27:33 +0000 Subject: [PATCH 1/3] Accepting request 908023 from home:jfehlig:branches:Virtualization:ovmf - libxl: ovmf now provides only one firmware for Xen. The firmware is named ovmf-x86_64-xen-4m.bin in the SUSE ovmf package. Adjust the upstream default firmware path to match the SUSE name. - packaging: To improve maintainability, rename suse-ovmf-paths.patch to suse-qemu-ovmf-paths.patch and suse-xen-ovmf-loaders.patch to suse-xen-ovmf-paths.patch OBS-URL: https://build.opensuse.org/request/show/908023 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=898 --- libvirt.changes | 10 +++++++ libvirt.spec | 4 +-- ...-paths.patch => suse-qemu-ovmf-paths.patch | 5 ++++ suse-xen-ovmf-loaders.patch | 27 ------------------- suse-xen-ovmf-paths.patch | 20 ++++++++++++++ 5 files changed, 37 insertions(+), 29 deletions(-) rename suse-ovmf-paths.patch => suse-qemu-ovmf-paths.patch (93%) delete mode 100644 suse-xen-ovmf-loaders.patch create mode 100644 suse-xen-ovmf-paths.patch diff --git a/libvirt.changes b/libvirt.changes index d140938..b9b7f76 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Jul 22 22:19:47 UTC 2021 - James Fehlig + +- libxl: ovmf now provides only one firmware for Xen. The firmware + is named ovmf-x86_64-xen-4m.bin in the SUSE ovmf package. Adjust + the upstream default firmware path to match the SUSE name. +- packaging: To improve maintainability, rename suse-ovmf-paths.patch + to suse-qemu-ovmf-paths.patch and suse-xen-ovmf-loaders.patch to + suse-xen-ovmf-paths.patch + ------------------------------------------------------------------- Fri Jul 16 23:05:03 UTC 2021 - James Fehlig diff --git a/libvirt.spec b/libvirt.spec index fcf8f34..6f1344b 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -302,13 +302,13 @@ Patch156: 0001-libxl-add-support-for-BlockResize-API.patch Patch200: suse-libvirtd-disable-tls.patch Patch201: suse-libvirt-guests-service.patch Patch202: suse-qemu-conf.patch -Patch203: suse-ovmf-paths.patch +Patch203: suse-qemu-ovmf-paths.patch Patch204: libxl-support-block-script.patch Patch205: qemu-apparmor-screenshot.patch Patch206: libvirt-suse-netcontrol.patch Patch207: lxc-wait-after-eth-del.patch Patch208: suse-libxl-disable-autoballoon.patch -Patch209: suse-xen-ovmf-loaders.patch +Patch209: suse-xen-ovmf-paths.patch Patch210: virt-create-rootfs.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/suse-ovmf-paths.patch b/suse-qemu-ovmf-paths.patch similarity index 93% rename from suse-ovmf-paths.patch rename to suse-qemu-ovmf-paths.patch index b321aa6..84022b0 100644 --- a/suse-ovmf-paths.patch +++ b/suse-qemu-ovmf-paths.patch @@ -1,5 +1,10 @@ Adjust paths of OVMF firmwares on SUSE distros +Note: SLE15 SP2 and newer support automatic firmware selection. Firmwares +advertised and used by libvirt are automatically detected. Until upstream +removes the old DEFAULT_LOADER_NVRAM approach and associated code, this +patch will stay. + Index: libvirt-7.5.0/src/qemu/qemu.conf =================================================================== --- libvirt-7.5.0.orig/src/qemu/qemu.conf diff --git a/suse-xen-ovmf-loaders.patch b/suse-xen-ovmf-loaders.patch deleted file mode 100644 index d38e67f..0000000 --- a/suse-xen-ovmf-loaders.patch +++ /dev/null @@ -1,27 +0,0 @@ -libxl: Temporarily hardcode paths to ovmf firmwares - -This is a quick, hacky fix for bsc#1159793 until there is time to work on -upstream support for firmware autoselection in the xen driver. Sadly, the -upstream efforts to improve firmware handling in the qemu driver broke -the firmware handling in the xen driver. - -Index: libvirt-7.5.0/src/libxl/libxl_conf.c -=================================================================== ---- libvirt-7.5.0.orig/src/libxl/libxl_conf.c -+++ libvirt-7.5.0/src/libxl/libxl_conf.c -@@ -1802,6 +1802,15 @@ libxlDriverConfigNew(void) - cfg->autoDumpDir = g_strdup(LIBXL_DUMP_DIR); - cfg->channelDir = g_strdup(LIBXL_CHANNEL_DIR); - -+ /* Begin hack --- -+ * bsc#1159793: Until there is time to work on proper upstream support for -+ * firmware autoselection in the xen driver we'll go with this minimal fix. -+ */ -+#define DEFAULT_LOADER_NVRAM "/usr/share/qemu/ovmf-x86_64-ms-4m.bin:/usr/share/qemu/ovmf-x86_64-ms-4m-vars.bin:/usr/share/qemu/ovmf-x86_64-ms.bin:/usr/share/qemu/ovmf-x86_64-ms-vars.bin" -+ /* -+ * --- End hack -+ */ -+ - #ifdef DEFAULT_LOADER_NVRAM - if (virFirmwareParseList(DEFAULT_LOADER_NVRAM, - &cfg->firmwares, diff --git a/suse-xen-ovmf-paths.patch b/suse-xen-ovmf-paths.patch new file mode 100644 index 0000000..9f608f7 --- /dev/null +++ b/suse-xen-ovmf-paths.patch @@ -0,0 +1,20 @@ +libxl: Use the SUSE ovmf firmware path for Xen + +The libxl driver trivially supports firmware autoselection since as of +June 2021 ovmf only supports one firmware for Xen. This patch adjusts +the firmware path to match the one provided by the ovmf package. + + +Index: libvirt-7.5.0/src/libxl/libxl_conf.c +=================================================================== +--- libvirt-7.5.0.orig/src/libxl/libxl_conf.c ++++ libvirt-7.5.0/src/libxl/libxl_conf.c +@@ -1813,7 +1813,7 @@ libxlDriverConfigNew(void) + cfg->firmwares = g_new0(virFirmware *, 1); + cfg->nfirmwares = 1; + cfg->firmwares[0] = g_new0(virFirmware, 1); +- cfg->firmwares[0]->name = g_strdup(LIBXL_FIRMWARE_DIR "/ovmf.bin"); ++ cfg->firmwares[0]->name = g_strdup(DATADIR "/qemu/ovmf-x86_64-xen-4m.bin"); + #endif + + /* Always add hvmloader to firmwares */ From 0af4927a977387bc1e16106cf67a9147da17f7681d978bc60bc9e36feca1bc3e Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 27 Jul 2021 18:13:14 +0000 Subject: [PATCH 2/3] - spec: Re-exec'ing virt{lock,log}d in posttrans was mistakenly dropped in a previous change. Add it back. OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=899 --- libvirt.changes | 6 ++++++ libvirt.spec | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/libvirt.changes b/libvirt.changes index b9b7f76..3fc04dc 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 27 18:10:29 UTC 2021 - James Fehlig + +- spec: Re-exec'ing virt{lock,log}d in posttrans was mistakenly + dropped in a previous change. Add it back. + ------------------------------------------------------------------- Thu Jul 22 22:19:47 UTC 2021 - James Fehlig diff --git a/libvirt.spec b/libvirt.spec index 6f1344b..e7c9311 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -1147,6 +1147,10 @@ fi %service_del_postun_without_restart libvirtd.service libvirtd.socket libvirtd-ro.socket libvirt-guests.service libvirtd-admin.socket libvirtd-tcp.socket libvirtd-tls.socket virtlockd.service virtlockd.socket virtlogd.service virtlogd.socket virtlockd-admin.socket virtlogd-admin.socket virtproxyd.service virtproxyd.socket virtproxyd-ro.socket virtproxyd-admin.socket virtproxyd-tcp.socket virtproxyd-tls.socket virt-guest-shutdown.target %posttrans daemon +# virtlockd and virtlogd must not be restarted, particularly virtlockd since the +# locks it uses to protect VM resources would be lost. Both are safe to re-exec. + %{_bindir}/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || : + %{_bindir}/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : # The '--listen' option is incompatible with socket activation. # Check if the existing install uses --listen listen_mode=no From 5ed1374fd3ee7deaa542453c646f51374efa71c0e0dbac104ba8953ee5919660 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Tue, 27 Jul 2021 18:14:27 +0000 Subject: [PATCH 3/3] remove spurious whitespace from spec file OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=900 --- libvirt.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt.spec b/libvirt.spec index e7c9311..dfebc2d 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -1149,8 +1149,8 @@ fi %posttrans daemon # virtlockd and virtlogd must not be restarted, particularly virtlockd since the # locks it uses to protect VM resources would be lost. Both are safe to re-exec. - %{_bindir}/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || : - %{_bindir}/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : +%{_bindir}/systemctl reload-or-try-restart virtlockd.service >/dev/null 2>&1 || : +%{_bindir}/systemctl reload-or-try-restart virtlogd.service >/dev/null 2>&1 || : # The '--listen' option is incompatible with socket activation. # Check if the existing install uses --listen listen_mode=no