diff --git a/libvirt-qemu-Don-t-leave-beingDestroyed-true-on-inactive-domain.patch b/libvirt-qemu-Don-t-leave-beingDestroyed-true-on-inactive-domain.patch deleted file mode 100644 index a630ae1..0000000 --- a/libvirt-qemu-Don-t-leave-beingDestroyed-true-on-inactive-domain.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 53b691e4d85f8a442f14ecf4b3bf0b17d607fb2b Mon Sep 17 00:00:00 2001 -Message-ID: <53b691e4d85f8a442f14ecf4b3bf0b17d607fb2b.1720800605.git.jdenemar@redhat.com> -From: Jiri Denemark -Date: Thu, 11 Jul 2024 13:49:09 +0200 -Subject: [PATCH] qemu: Don't leave beingDestroyed=true on inactive domain - -Recent commit v10.4.0-87-gd9935a5c4f made a reasonable change to only -reset beingDestroyed back to false when vm->def->id is reset to make -sure other code can detect a domain is (about to become) inactive. It -even added a comment saying any caller of qemuProcessBeginStopJob is -supposed to call qemuProcessStop to clear beingDestroyed. But not every -caller really does so because they first call qemuProcessBeginStopJob -and then check whether a domain is still running. If not the -qemuProcessStop call is skipped leaving beingDestroyed=true. In case of -a persistent domain this may block incoming migrations of such domain as -the migration code would think the domain died unexpectedly (even though -it's still running). - -The qemuProcessBeginStopJob function is a wrapper around -virDomainObjBeginJob, but virDomainObjEndJob was used directly for -cleanup. This patch introduces a new qemuProcessEndStopJob wrapper -around virDomainObjEndJob to properly undo everything -qemuProcessBeginStopJob did. - -https://issues.redhat.com/browse/RHEL-43309 - -Signed-off-by: Jiri Denemark -Reviewed-by: Peter Krempa -(cherry picked from commit bec903cae84c21850d47a1b4d3ab57ca81189519) -Signed-off-by: Jiri Denemark ---- - src/qemu/qemu_driver.c | 4 ++-- - src/qemu/qemu_process.c | 20 ++++++++++++++++---- - src/qemu/qemu_process.h | 1 + - 3 files changed, 19 insertions(+), 6 deletions(-) - -diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c -index fc1704f4fc..d9073b2154 100644 ---- a/src/qemu/qemu_driver.c -+++ b/src/qemu/qemu_driver.c -@@ -2115,7 +2115,7 @@ qemuDomainDestroyFlags(virDomainPtr dom, - endjob: - if (ret == 0) - qemuDomainRemoveInactive(driver, vm, 0, false); -- virDomainObjEndJob(vm); -+ qemuProcessEndStopJob(vm); - - cleanup: - virDomainObjEndAPI(&vm); -@@ -3901,7 +3901,7 @@ processMonitorEOFEvent(virQEMUDriver *driver, - - endjob: - qemuDomainRemoveInactive(driver, vm, 0, false); -- virDomainObjEndJob(vm); -+ qemuProcessEndStopJob(vm); - } - - -diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c -index b9b6ccf1de..bea42d38c6 100644 ---- a/src/qemu/qemu_process.c -+++ b/src/qemu/qemu_process.c -@@ -8422,7 +8422,8 @@ qemuProcessKill(virDomainObj *vm, unsigned int flags) - * qemuProcessBeginStopJob: - * - * Stop all current jobs by killing the domain and start a new one for -- * qemuProcessStop. -+ * qemuProcessStop. The caller has to make sure qemuProcessEndStopJob is -+ * called to properly cleanup the job. - */ - int - qemuProcessBeginStopJob(virDomainObj *vm, -@@ -8449,8 +8450,9 @@ qemuProcessBeginStopJob(virDomainObj *vm, - goto error; - - /* priv->beingDestroyed is deliberately left set to 'true' here. Caller -- * is supposed to call qemuProcessStop, which will reset it after -- * 'vm->def->id' is set to -1 */ -+ * is supposed to call qemuProcessStop (which will reset it after -+ * 'vm->def->id' is set to -1) and/or qemuProcessEndStopJob to do proper -+ * cleanup. */ - return 0; - - error: -@@ -8459,6 +8461,16 @@ qemuProcessBeginStopJob(virDomainObj *vm, - } - - -+void -+qemuProcessEndStopJob(virDomainObj *vm) -+{ -+ if (!virDomainObjIsActive(vm)) -+ QEMU_DOMAIN_PRIVATE(vm)->beingDestroyed = false; -+ -+ virDomainObjEndJob(vm); -+} -+ -+ - void qemuProcessStop(virQEMUDriver *driver, - virDomainObj *vm, - virDomainShutoffReason reason, -@@ -8801,7 +8813,7 @@ qemuProcessAutoDestroy(virDomainObj *dom, - - qemuDomainRemoveInactive(driver, dom, 0, false); - -- virDomainObjEndJob(dom); -+ qemuProcessEndStopJob(dom); - - virObjectEventStateQueue(driver->domainEventState, event); - } -diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h -index c1ea949215..cb67bfcd2d 100644 ---- a/src/qemu/qemu_process.h -+++ b/src/qemu/qemu_process.h -@@ -169,6 +169,7 @@ typedef enum { - int qemuProcessBeginStopJob(virDomainObj *vm, - virDomainJob job, - bool forceKill); -+void qemuProcessEndStopJob(virDomainObj *vm); - void qemuProcessStop(virQEMUDriver *driver, - virDomainObj *vm, - virDomainShutoffReason reason, --- -2.45.2 diff --git a/libvirt-qemu-do-not-use-deprecated-options-for-new-virtiofsd.patch b/libvirt-qemu-do-not-use-deprecated-options-for-new-virtiofsd.patch deleted file mode 100644 index 269e75f..0000000 --- a/libvirt-qemu-do-not-use-deprecated-options-for-new-virtiofsd.patch +++ /dev/null @@ -1,128 +0,0 @@ -From c30b3dd904c094c478c5b362de6b3580379edd8b Mon Sep 17 00:00:00 2001 -Message-ID: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 4 Jul 2024 15:54:29 +0200 -Subject: [PATCH] qemu: do not use deprecated options for new virtiofsd -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Use the to-be-introduced virtiofsd capability to mark whether -new options are safe to use. - -Depends on: -https://gitlab.com/virtio-fs/virtiofsd/-/merge_requests/231 - -https://issues.redhat.com/browse/RHEL-7108 - -Signed-off-by: Ján Tomko -Reviewed-by: Michal Privoznik -(cherry picked from commit 8dc04cafecd2432c071c73366e4c6eb3b7bff495) - -https://issues.redhat.com/browse/RHEL-7108 - -Signed-off-by: Ján Tomko ---- - src/qemu/qemu_virtiofs.c | 83 +++++++++++++++++++++++++++------------- - 1 file changed, 57 insertions(+), 26 deletions(-) - -diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c -index 0df8d67b1b..0e3c7dbb58 100644 ---- a/src/qemu/qemu_virtiofs.c -+++ b/src/qemu/qemu_virtiofs.c -@@ -139,36 +139,67 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg, - virCommandPassFD(cmd, *fd, VIR_COMMAND_PASS_FD_CLOSE_PARENT); - *fd = -1; - -- virCommandAddArg(cmd, "-o"); -- virBufferAddLit(&opts, "source="); -- virQEMUBuildBufferEscapeComma(&opts, fs->src->path); -- if (fs->cache) -- virBufferAsprintf(&opts, ",cache=%s", virDomainFSCacheModeTypeToString(fs->cache)); -- if (fs->sandbox) -- virBufferAsprintf(&opts, ",sandbox=%s", virDomainFSSandboxModeTypeToString(fs->sandbox)); -- -- if (fs->xattr == VIR_TRISTATE_SWITCH_ON) -- virBufferAddLit(&opts, ",xattr"); -- else if (fs->xattr == VIR_TRISTATE_SWITCH_OFF) -- virBufferAddLit(&opts, ",no_xattr"); -- -- if (fs->flock == VIR_TRISTATE_SWITCH_ON) -- virBufferAddLit(&opts, ",flock"); -- else if (fs->flock == VIR_TRISTATE_SWITCH_OFF) -- virBufferAddLit(&opts, ",no_flock"); -- -- if (fs->posix_lock == VIR_TRISTATE_SWITCH_ON) -- virBufferAddLit(&opts, ",posix_lock"); -- else if (fs->posix_lock == VIR_TRISTATE_SWITCH_OFF) -- virBufferAddLit(&opts, ",no_posix_lock"); -- -- virCommandAddArgBuffer(cmd, &opts); -+ if (virBitmapIsBitSet(fs->caps, QEMU_VHOST_USER_FS_FEATURE_SEPARATE_OPTIONS)) { -+ /* Note that this option format is used by the Rust version of the daemon -+ * since v1.0.0, which is way longer than the capability existed. -+ * The -o style of options can be removed once we bump the minimal -+ * QEMU version to 8.0.0, which dropped the C virtiofsd daemon */ -+ virCommandAddArg(cmd, "--shared-dir"); -+ virCommandAddArg(cmd, fs->src->path); -+ -+ if (fs->cache) { -+ virCommandAddArg(cmd, "--cache"); -+ virCommandAddArg(cmd, virDomainFSCacheModeTypeToString(fs->cache)); -+ } -+ if (fs->sandbox) { -+ virCommandAddArg(cmd, "--sandbox"); -+ virCommandAddArg(cmd, virDomainFSSandboxModeTypeToString(fs->sandbox)); -+ } -+ -+ if (fs->xattr == VIR_TRISTATE_SWITCH_ON) -+ virCommandAddArg(cmd, "--xattr"); -+ -+ if (fs->posix_lock != VIR_TRISTATE_SWITCH_ABSENT || -+ fs->flock != VIR_TRISTATE_SWITCH_ABSENT) { -+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("locking options are not supported by this virtiofsd")); -+ return NULL; -+ } -+ } else { -+ virCommandAddArg(cmd, "-o"); -+ virBufferAddLit(&opts, "source="); -+ virQEMUBuildBufferEscapeComma(&opts, fs->src->path); -+ if (fs->cache) -+ virBufferAsprintf(&opts, ",cache=%s", virDomainFSCacheModeTypeToString(fs->cache)); -+ if (fs->sandbox) -+ virBufferAsprintf(&opts, ",sandbox=%s", virDomainFSSandboxModeTypeToString(fs->sandbox)); -+ -+ if (fs->xattr == VIR_TRISTATE_SWITCH_ON) -+ virBufferAddLit(&opts, ",xattr"); -+ else if (fs->xattr == VIR_TRISTATE_SWITCH_OFF) -+ virBufferAddLit(&opts, ",no_xattr"); -+ -+ if (fs->flock == VIR_TRISTATE_SWITCH_ON) -+ virBufferAddLit(&opts, ",flock"); -+ else if (fs->flock == VIR_TRISTATE_SWITCH_OFF) -+ virBufferAddLit(&opts, ",no_flock"); -+ -+ if (fs->posix_lock == VIR_TRISTATE_SWITCH_ON) -+ virBufferAddLit(&opts, ",posix_lock"); -+ else if (fs->posix_lock == VIR_TRISTATE_SWITCH_OFF) -+ virBufferAddLit(&opts, ",no_posix_lock"); -+ -+ virCommandAddArgBuffer(cmd, &opts); -+ } - - if (fs->thread_pool_size >= 0) - virCommandAddArgFormat(cmd, "--thread-pool-size=%i", fs->thread_pool_size); - -- if (cfg->virtiofsdDebug) -- virCommandAddArg(cmd, "-d"); -+ if (cfg->virtiofsdDebug) { -+ if (virBitmapIsBitSet(fs->caps, QEMU_VHOST_USER_FS_FEATURE_SEPARATE_OPTIONS)) -+ virCommandAddArgList(cmd, "--log-level", "debug", NULL); -+ else -+ virCommandAddArg(cmd, "-d"); -+ } - - for (i = 0; i < fs->idmap.nuidmap; i++) { - virCommandAddArgFormat(cmd, "--uid-map=:%u:%u:%u:", --- -2.45.2 diff --git a/libvirt-qemu-fill-capabilities-for-virtiofsd.patch b/libvirt-qemu-fill-capabilities-for-virtiofsd.patch deleted file mode 100644 index 915c1ab..0000000 --- a/libvirt-qemu-fill-capabilities-for-virtiofsd.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 26c0a729f2ae6dcd932a42bd437fc76da9e6b2cc Mon Sep 17 00:00:00 2001 -Message-ID: <26c0a729f2ae6dcd932a42bd437fc76da9e6b2cc.1720800605.git.jdenemar@redhat.com> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 4 Jul 2024 15:54:28 +0200 -Subject: [PATCH] qemu: fill capabilities for virtiofsd -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Run the daemon with --print-capabilities first, to see what it supports. - -Signed-off-by: Ján Tomko -Reviewed-by: Michal Privoznik -(cherry picked from commit 730eaafaace6b9202f9f694b732196299a0baec2) - -https://issues.redhat.com/browse/RHEL-7108 -https://issues.redhat.com/browse/RHEL-40135 - -Signed-off-by: Ján Tomko ---- - src/conf/domain_conf.c | 1 + - src/conf/domain_conf.h | 1 + - src/qemu/qemu_vhost_user.c | 58 +++++++++++++++++++ - src/qemu/qemu_vhost_user.h | 11 ++++ - src/qemu/qemu_virtiofs.c | 9 ++- - .../qemu/vhost-user/50-qemu-virtiofsd.json | 2 +- - tests/qemuxmlconftest.c | 2 + - 7 files changed, 81 insertions(+), 3 deletions(-) - -diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c -index 8a3c63b1fc..1523341b34 100644 ---- a/src/conf/domain_conf.c -+++ b/src/conf/domain_conf.c -@@ -2600,6 +2600,7 @@ void virDomainFSDefFree(virDomainFSDef *def) - g_free(def->sock); - g_free(def->idmap.uidmap); - g_free(def->idmap.gidmap); -+ virBitmapFree(def->caps); - - g_free(def); - } -diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h -index 2818a9f1f5..b3a0d26cde 100644 ---- a/src/conf/domain_conf.h -+++ b/src/conf/domain_conf.h -@@ -899,6 +899,7 @@ struct _virDomainFSDef { - virDomainIdMapDef idmap; - virDomainVirtioOptions *virtio; - virObject *privateData; -+ virBitmap *caps; - }; - - -diff --git a/src/qemu/qemu_vhost_user.c b/src/qemu/qemu_vhost_user.c -index 0294daab80..de3ef640a3 100644 ---- a/src/qemu/qemu_vhost_user.c -+++ b/src/qemu/qemu_vhost_user.c -@@ -22,6 +22,7 @@ - - #include "qemu_vhost_user.h" - #include "qemu_interop_config.h" -+#include "virbitmap.h" - #include "virjson.h" - #include "virlog.h" - #include "viralloc.h" -@@ -90,6 +91,12 @@ VIR_ENUM_IMPL(qemuVhostUserGPUFeature, - "render-node", - ); - -+VIR_ENUM_IMPL(qemuVhostUserFSFeature, -+ QEMU_VHOST_USER_FS_FEATURE_LAST, -+ "migrate-precopy", -+ "separate-options", -+); -+ - typedef struct _qemuVhostUserGPU qemuVhostUserGPU; - struct _qemuVhostUserGPU { - size_t nfeatures; -@@ -414,6 +421,52 @@ qemuVhostUserFillDomainGPU(virQEMUDriver *driver, - return ret; - } - -+int -+qemuVhostUserFillFSCapabilities(virBitmap **caps, -+ const char *binary) -+{ -+ g_autoptr(virJSONValue) doc = NULL; -+ g_autofree char *output = NULL; -+ g_autoptr(virCommand) cmd = NULL; -+ virJSONValue *featuresJSON; -+ size_t nfeatures; -+ size_t i; -+ g_autoptr(virBitmap) features = NULL; -+ -+ cmd = virCommandNewArgList(binary, "--print-capabilities", NULL); -+ virCommandSetOutputBuffer(cmd, &output); -+ if (virCommandRun(cmd, NULL) < 0) -+ return -2; -+ -+ if (!(doc = virJSONValueFromString(output))) { -+ virReportError(VIR_ERR_INTERNAL_ERROR, -+ _("unable to parse json capabilities '%1$s'"), -+ binary); -+ return -1; -+ } -+ -+ /* Older virtiofsd did not print any features */ -+ if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) -+ return 0; -+ -+ features = virBitmapNew(0); -+ nfeatures = virJSONValueArraySize(featuresJSON); -+ -+ for (i = 0; i < nfeatures; i++) { -+ virJSONValue *item = virJSONValueArrayGet(featuresJSON, i); -+ const char *tmpStr = virJSONValueGetString(item); -+ int tmp; -+ -+ if ((tmp = qemuVhostUserFSFeatureTypeFromString(tmpStr)) < 0) { -+ VIR_DEBUG("ignoring unknown virtiofs feature '%s'", tmpStr); -+ continue; -+ } -+ virBitmapSetBitExpand(features, tmp); -+ } -+ -+ *caps = g_steal_pointer(&features); -+ return 0; -+} - - int - qemuVhostUserFillDomainFS(virQEMUDriver *driver, -@@ -435,6 +488,11 @@ qemuVhostUserFillDomainFS(virQEMUDriver *driver, - continue; - - fs->binary = g_strdup(vu->binary); -+ -+ /* skip binaries that can't report their capabilities */ -+ if (qemuVhostUserFillFSCapabilities(&fs->caps, -+ vu->binary) == -1) -+ continue; - break; - } - -diff --git a/src/qemu/qemu_vhost_user.h b/src/qemu/qemu_vhost_user.h -index d1aa6ca189..c39fbfebe8 100644 ---- a/src/qemu/qemu_vhost_user.h -+++ b/src/qemu/qemu_vhost_user.h -@@ -46,3 +46,14 @@ qemuVhostUserFillDomainGPU(virQEMUDriver *driver, - int - qemuVhostUserFillDomainFS(virQEMUDriver *driver, - virDomainFSDef *fs); -+ -+int -+qemuVhostUserFillFSCapabilities(virBitmap **caps, -+ const char *binary); -+typedef enum { -+ QEMU_VHOST_USER_FS_FEATURE_MIGRATE_PRECOPY = 0, -+ QEMU_VHOST_USER_FS_FEATURE_SEPARATE_OPTIONS, -+ QEMU_VHOST_USER_FS_FEATURE_LAST -+} qemuVhostUserFSFeature; -+ -+VIR_ENUM_DECL(qemuVhostUserFSFeature); -diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c -index 78897d8177..0df8d67b1b 100644 ---- a/src/qemu/qemu_virtiofs.c -+++ b/src/qemu/qemu_virtiofs.c -@@ -446,8 +446,13 @@ qemuVirtioFSPrepareDomain(virQEMUDriver *driver, - if (fs->sock) - return 0; - -- if (!fs->binary && qemuVhostUserFillDomainFS(driver, fs) < 0) -- return -1; -+ if (fs->binary) { -+ if (qemuVhostUserFillFSCapabilities(&fs->caps, fs->binary) < 0) -+ return -1; -+ } else { -+ if (qemuVhostUserFillDomainFS(driver, fs) < 0) -+ return -1; -+ } - - if (!driver->privileged && !fs->idmap.uidmap) { - if (qemuVirtioFSPrepareIdMap(fs) < 0) -diff --git a/tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-qemu-virtiofsd.json b/tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-qemu-virtiofsd.json -index b908bc6b30..5cf2c986f8 100644 ---- a/tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-qemu-virtiofsd.json -+++ b/tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-qemu-virtiofsd.json -@@ -1,5 +1,5 @@ - { - "description": "virtiofsd vhost-user-fs", - "type": "fs", -- "binary": "/usr/libexec/qemu/vhost-user/test-vhost-user-gpu" -+ "binary": "/usr/libexec/qemu/vhost-user/test-virtiofsd" - } -diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c -index 8e0d47c6fd..a3a399e16c 100644 ---- a/tests/qemuxmlconftest.c -+++ b/tests/qemuxmlconftest.c -@@ -1079,6 +1079,8 @@ mymain(void) - - virFileWrapperAddPrefix("/usr/libexec/qemu/vhost-user", - abs_srcdir "/qemuvhostuserdata/usr/libexec/qemu/vhost-user"); -+ virFileWrapperAddPrefix("/usr/libexec/virtiofsd", -+ abs_srcdir "/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-virtiofsd"); - - if (!(conn = virGetConnect())) - return EXIT_FAILURE; --- -2.45.2 diff --git a/libvirt-qemu-migration-allow-migration-for-virtiofs.patch b/libvirt-qemu-migration-allow-migration-for-virtiofs.patch deleted file mode 100644 index d54da10..0000000 --- a/libvirt-qemu-migration-allow-migration-for-virtiofs.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 5f73e98cc870b13a053fd99d4d2707fed50e57d0 Mon Sep 17 00:00:00 2001 -Message-ID: <5f73e98cc870b13a053fd99d4d2707fed50e57d0.1720800605.git.jdenemar@redhat.com> -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Thu, 4 Jul 2024 15:54:30 +0200 -Subject: [PATCH] qemu: migration: allow migration for virtiofs -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Allow migration if the "migrate-precopy" capability is present or -libvirt is not the one running the virtiofs daemon. - -Signed-off-by: Ján Tomko -Reviewed-by: Michal Privoznik -(cherry picked from commit d94b31a68ab94f27f8a1d6d216817b49881c38ae) - -https://issues.redhat.com/browse/RHEL-40135 - -Signed-off-by: Ján Tomko ---- - src/qemu/qemu_migration.c | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c -index 26c082fc08..4fd7a0aafb 100644 ---- a/src/qemu/qemu_migration.c -+++ b/src/qemu/qemu_migration.c -@@ -39,6 +39,7 @@ - #include "qemu_slirp.h" - #include "qemu_block.h" - #include "qemu_tpm.h" -+#include "qemu_vhost_user.h" - - #include "domain_audit.h" - #include "virlog.h" -@@ -1576,8 +1577,12 @@ qemuMigrationSrcIsAllowed(virDomainObj *vm, - virDomainFSDef *fs = vm->def->fss[i]; - - if (fs->fsdriver == VIR_DOMAIN_FS_DRIVER_TYPE_VIRTIOFS) { -- virReportError(VIR_ERR_OPERATION_INVALID, "%s", -- _("migration with virtiofs device is not supported")); -+ if (fs->sock || -+ virBitmapIsBitSet(fs->caps, QEMU_VHOST_USER_FS_FEATURE_MIGRATE_PRECOPY)) -+ continue; -+ -+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", -+ _("migration with this virtiofs device is not supported")); - return false; - } - } --- -2.45.2 diff --git a/libvirt-qemu-virtiofs-cache-use-never-instead-of-none.patch b/libvirt-qemu-virtiofs-cache-use-never-instead-of-none.patch deleted file mode 100644 index ef29da5..0000000 --- a/libvirt-qemu-virtiofs-cache-use-never-instead-of-none.patch +++ /dev/null @@ -1,49 +0,0 @@ -From d7285cb688e4f6b61dd842be7d0a2e773ad7d21b Mon Sep 17 00:00:00 2001 -Message-ID: -From: =?UTF-8?q?J=C3=A1n=20Tomko?= -Date: Tue, 23 Jul 2024 14:14:13 +0200 -Subject: [PATCH] qemu: virtiofs: cache: use 'never' instead of 'none' -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -The new option style renamed one of the cache modes. - -https://issues.redhat.com/browse/RHEL-50329 - -Signed-off-by: Ján Tomko -Reviewed-by: Michal Privoznik -(cherry picked from commit 8d3b2397372111d15d6b79138c5c5a80203f85f5) -Signed-off-by: Ján Tomko ---- - src/qemu/qemu_virtiofs.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c -index 0e3c7dbb58..c7be2766a2 100644 ---- a/src/qemu/qemu_virtiofs.c -+++ b/src/qemu/qemu_virtiofs.c -@@ -147,10 +147,20 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg, - virCommandAddArg(cmd, "--shared-dir"); - virCommandAddArg(cmd, fs->src->path); - -- if (fs->cache) { -+ switch (fs->cache) { -+ case VIR_DOMAIN_FS_CACHE_MODE_DEFAULT: -+ case VIR_DOMAIN_FS_CACHE_MODE_LAST: -+ break; -+ case VIR_DOMAIN_FS_CACHE_MODE_NONE: -+ virCommandAddArg(cmd, "--cache"); -+ virCommandAddArg(cmd, "never"); -+ break; -+ case VIR_DOMAIN_FS_CACHE_MODE_ALWAYS: - virCommandAddArg(cmd, "--cache"); - virCommandAddArg(cmd, virDomainFSCacheModeTypeToString(fs->cache)); -+ break; - } -+ - if (fs->sandbox) { - virCommandAddArg(cmd, "--sandbox"); - virCommandAddArg(cmd, virDomainFSSandboxModeTypeToString(fs->sandbox)); --- -2.46.0 diff --git a/libvirt-qemu_domain-Strip-acpi-from-s390-x-definitions.patch b/libvirt-qemu_domain-Strip-acpi-from-s390-x-definitions.patch deleted file mode 100644 index 9666ca8..0000000 --- a/libvirt-qemu_domain-Strip-acpi-from-s390-x-definitions.patch +++ /dev/null @@ -1,105 +0,0 @@ -From f34372c108e5b4f1e37c333a7ff2c50faa9f534e Mon Sep 17 00:00:00 2001 -Message-ID: -From: Peter Krempa -Date: Wed, 31 Jul 2024 11:34:59 +0200 -Subject: [PATCH] qemu_domain: Strip from s390(x) definitions - -The s390(x) machines never supported ACPI. That didn't stop users -enabling ACPI in their config. As of libvirt-9.2 (98c4e3d073) with new -enough qemu we reject configs which require ACPI, but qemu can't satisfy -it. - -This breaks migration of existing VMs with the old wrong configs to new -libvirt installations. - -To address this introduce a post-parse fixup removing the ACPI flag -specifically for s390 machines which do enable it in the definition. - -The advantage of doing it in post-parse, rather than simply relaxing the -ABI stability check to allow users providing an fixed XML when migrating -(allowing change of the ACPI flag for s390 in ABI stability check, as it - doesn't impact ABI), is that only the destination installation needs to -be patched in order to preserve migration. - -To mitigate the disadvantage of simply stripping it from all s390(x) -configs the hack is not applied when defining or starting a new domain -from the XML, to preserve the error about unsupported configuration. - -Resolves: https://issues.redhat.com/browse/RHEL-49516 -Signed-off-by: Peter Krempa -Reviewed-by: Andrea Bolognani -Reviewed-by: Boris Fiuczynski -(cherry picked from commit 4ba4f659e42a30c3fa8ece414616a23a992acfaa) ---- - src/qemu/qemu_domain.c | 49 ++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 49 insertions(+) - -diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c -index 1a90311ca5..1bafe3708a 100644 ---- a/src/qemu/qemu_domain.c -+++ b/src/qemu/qemu_domain.c -@@ -5013,6 +5013,53 @@ qemuDomainDefPostParseBasic(virDomainDef *def, - } - - -+/** -+ * qemuDomainDefACPIPostParse: -+ * @def: domain definition -+ * @qemuCaps: qemu capabilities object -+ * -+ * Fixup the use of ACPI flag on certain architectures that never supported it -+ * and users for some reason used it, which would break migration to newer -+ * libvirt versions which check whether given machine type supports ACPI. -+ * -+ * The fixup is done in post-parse as it's hard to update the ABI stability -+ * check on source of the migration. -+ */ -+static void -+qemuDomainDefACPIPostParse(virDomainDef *def, -+ virQEMUCaps *qemuCaps, -+ unsigned int parseFlags) -+{ -+ /* Only cases when ACPI is enabled need to be fixed up */ -+ if (def->features[VIR_DOMAIN_FEATURE_ACPI] != VIR_TRISTATE_SWITCH_ON) -+ return; -+ -+ /* Strip the feature only for non-fresh configs, in order to still -+ * produce an error if the feature is present in a newly defined one. -+ * -+ * The use of the VIR_DOMAIN_DEF_PARSE_ABI_UPDATE looks counter-intuitive, -+ * but it's used only in qemuDomainCreateXML/qemuDomainDefineXMLFlags APIs -+ * */ -+ if (parseFlags & VIR_DOMAIN_DEF_PARSE_ABI_UPDATE) -+ return; -+ -+ /* This fixup is applicable _only_ on architectures which were present as of -+ * libvirt-9.2 and *never* supported ACPI. The fixup is currently done only -+ * for existing users of s390(x) to fix migration for configs which had -+ * despite being ignored. -+ */ -+ if (def->os.arch != VIR_ARCH_S390 && -+ def->os.arch != VIR_ARCH_S390X) -+ return; -+ -+ /* To be sure, we only strip ACPI if given machine type doesn't support it */ -+ if (virQEMUCapsMachineSupportsACPI(qemuCaps, def->virtType, def->os.machine) != VIR_TRISTATE_BOOL_NO) -+ return; -+ -+ def->features[VIR_DOMAIN_FEATURE_ACPI] = VIR_TRISTATE_SWITCH_ABSENT; -+} -+ -+ - static int - qemuDomainDefPostParse(virDomainDef *def, - unsigned int parseFlags, -@@ -5033,6 +5080,8 @@ qemuDomainDefPostParse(virDomainDef *def, - if (qemuDomainDefMachinePostParse(def, qemuCaps) < 0) - return -1; - -+ qemuDomainDefACPIPostParse(def, qemuCaps, parseFlags); -+ - if (qemuDomainDefBootPostParse(def, driver, parseFlags) < 0) - return -1; - --- -2.46.0 diff --git a/libvirt-qemuxmlconftest-Add-tests-for-the-ACPI-stripping-hack-on-s390.patch b/libvirt-qemuxmlconftest-Add-tests-for-the-ACPI-stripping-hack-on-s390.patch deleted file mode 100644 index 46a1466..0000000 --- a/libvirt-qemuxmlconftest-Add-tests-for-the-ACPI-stripping-hack-on-s390.patch +++ /dev/null @@ -1,435 +0,0 @@ -From 94915522e99b56933fd792dfd801f70a188f3534 Mon Sep 17 00:00:00 2001 -Message-ID: <94915522e99b56933fd792dfd801f70a188f3534.1723213495.git.jdenemar@redhat.com> -From: Peter Krempa -Date: Wed, 31 Jul 2024 12:38:23 +0200 -Subject: [PATCH] qemuxmlconftest: Add tests for the ACPI stripping hack on - s390 - -Replace the 'misc-acpi' case by testing a bunch of architectures for how -ACPI is handled including a test for the s390 ACPI strip hack added in -previous commit. - -The input files are adapted from the corresponding '-minimal.xml' files. - -Signed-off-by: Peter Krempa -Reviewed-by: Andrea Bolognani -Reviewed-by: Boris Fiuczynski -(cherry picked from commit 432e442ca8eeb4ed8c0dcc3a3c7d723f85b38c40) -https://issues.redhat.com/browse/RHEL-49516 ---- - .../aarch64-noacpi-acpi.aarch64-latest.err | 1 + - tests/qemuxmlconfdata/aarch64-noacpi-acpi.xml | 18 ++++++++ - .../misc-acpi.x86_64-latest.args | 34 --------------- - .../misc-acpi.x86_64-latest.xml | 41 ------------------- - tests/qemuxmlconfdata/misc-acpi.xml | 33 --------------- - .../riscv64-virt-acpi.riscv64-latest.args | 33 +++++++++++++++ - .../riscv64-virt-acpi.riscv64-latest.xml | 36 ++++++++++++++++ - tests/qemuxmlconfdata/riscv64-virt-acpi.xml | 15 +++++++ - ...s390x-ccw-acpi.s390x-latest.abi-update.err | 1 + - .../s390x-ccw-acpi.s390x-latest.args | 32 +++++++++++++++ - .../s390x-ccw-acpi.s390x-latest.xml | 27 ++++++++++++ - tests/qemuxmlconfdata/s390x-ccw-acpi.xml | 15 +++++++ - tests/qemuxmlconftest.c | 18 +++++++- - 13 files changed, 195 insertions(+), 109 deletions(-) - create mode 100644 tests/qemuxmlconfdata/aarch64-noacpi-acpi.aarch64-latest.err - create mode 100644 tests/qemuxmlconfdata/aarch64-noacpi-acpi.xml - delete mode 100644 tests/qemuxmlconfdata/misc-acpi.x86_64-latest.args - delete mode 100644 tests/qemuxmlconfdata/misc-acpi.x86_64-latest.xml - delete mode 100644 tests/qemuxmlconfdata/misc-acpi.xml - create mode 100644 tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args - create mode 100644 tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml - create mode 100644 tests/qemuxmlconfdata/riscv64-virt-acpi.xml - create mode 100644 tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.abi-update.err - create mode 100644 tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.args - create mode 100644 tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.xml - create mode 100644 tests/qemuxmlconfdata/s390x-ccw-acpi.xml - -diff --git a/tests/qemuxmlconfdata/aarch64-noacpi-acpi.aarch64-latest.err b/tests/qemuxmlconfdata/aarch64-noacpi-acpi.aarch64-latest.err -new file mode 100644 -index 0000000000..5f379d56ce ---- /dev/null -+++ b/tests/qemuxmlconfdata/aarch64-noacpi-acpi.aarch64-latest.err -@@ -0,0 +1 @@ -+unsupported configuration: machine type 'borzoi' does not support ACPI -diff --git a/tests/qemuxmlconfdata/aarch64-noacpi-acpi.xml b/tests/qemuxmlconfdata/aarch64-noacpi-acpi.xml -new file mode 100644 -index 0000000000..10dbeabd6d ---- /dev/null -+++ b/tests/qemuxmlconfdata/aarch64-noacpi-acpi.xml -@@ -0,0 +1,18 @@ -+ -+ aarch64test -+ 6ba410c5-1e5c-4d57-bee7-2228e7ffa32f -+ 1048576 -+ 1 -+ -+ -+ hvm -+ -+ -+ -+ -+ -+ -+ /usr/bin/qemu-system-aarch64 -+ -+ -+ -diff --git a/tests/qemuxmlconfdata/misc-acpi.x86_64-latest.args b/tests/qemuxmlconfdata/misc-acpi.x86_64-latest.args -deleted file mode 100644 -index c4e09c0af2..0000000000 ---- a/tests/qemuxmlconfdata/misc-acpi.x86_64-latest.args -+++ /dev/null -@@ -1,34 +0,0 @@ --LC_ALL=C \ --PATH=/bin \ --HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ --USER=test \ --LOGNAME=test \ --XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ --XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ --XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ --/usr/bin/qemu-system-x86_64 \ ---name guest=QEMUGuest1,debug-threads=on \ ---S \ ---object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ ---machine pc,usb=off,dump-guest-core=off,memory-backend=pc.ram,acpi=on \ ---accel tcg \ ---cpu qemu64 \ ---m size=219136k \ ---object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \ ---overcommit mem-lock=off \ ---smp 1,sockets=1,cores=1,threads=1 \ ---uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ ---display none \ ---no-user-config \ ---nodefaults \ ---chardev socket,id=charmonitor,fd=1729,server=on,wait=off \ ---mon chardev=charmonitor,id=monitor,mode=control \ ---rtc base=utc \ ---no-shutdown \ ---boot strict=on \ ---device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0x2"}' \ ---blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","read-only":false}' \ ---device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-storage","id":"ide0-0-0","bootindex":1}' \ ---audiodev '{"id":"audio1","driver":"none"}' \ ---sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ ---msg timestamp=on -diff --git a/tests/qemuxmlconfdata/misc-acpi.x86_64-latest.xml b/tests/qemuxmlconfdata/misc-acpi.x86_64-latest.xml -deleted file mode 100644 -index 176926bb60..0000000000 ---- a/tests/qemuxmlconfdata/misc-acpi.x86_64-latest.xml -+++ /dev/null -@@ -1,41 +0,0 @@ -- -- QEMUGuest1 -- c7a5fdbd-edaf-9455-926a-d65c16db1809 -- 219136 -- 219136 -- 1 -- -- hvm -- -- -- -- -- -- -- qemu64 -- -- -- destroy -- restart -- destroy -- -- /usr/bin/qemu-system-x86_64 -- -- -- -- --
-- -- --
-- -- --
-- -- -- -- --