From a0ad90e4dca70a248760f2c31cc829cb033df16a Mon Sep 17 00:00:00 2001 From: zhangpengrui Date: Tue, 11 Nov 2025 16:28:46 +0800 Subject: [PATCH] libvirt update to version 9.10.0-19 Signed-off-by: zhangpengrui --- ...ion-problem-of-libvirtd.policy-s-pro.patch | 49 ++++ ...port-of-one-guest-numa-node-alloc-me.patch | 170 ++++++++++++ ...add-support-for-cachetune-L3-min-max.patch | 70 +++++ ...dd-support-for-hugepage-hugepage-pod.patch | 62 +++++ cpu-Add-new-Chengdu-CPU-model.patch | 148 ++++++++++ libvirt.spec | 18 +- ...on-support-vfio-pci-device-migration.patch | 101 +++++++ ...d-L3-min-max-parse-and-format-method.patch | 252 ++++++++++++++++++ 8 files changed, 869 insertions(+), 1 deletion(-) create mode 100644 Fix-the-translation-problem-of-libvirtd.policy-s-pro.patch create mode 100644 backends-add-support-of-one-guest-numa-node-alloc-me.patch create mode 100644 conf-add-support-for-cachetune-L3-min-max.patch create mode 100644 conf-add-support-for-hugepage-hugepage-pod.patch create mode 100644 cpu-Add-new-Chengdu-CPU-model.patch create mode 100644 migration-support-vfio-pci-device-migration.patch create mode 100644 util-resctrl-add-L3-min-max-parse-and-format-method.patch diff --git a/Fix-the-translation-problem-of-libvirtd.policy-s-pro.patch b/Fix-the-translation-problem-of-libvirtd.policy-s-pro.patch new file mode 100644 index 0000000..f73e586 --- /dev/null +++ b/Fix-the-translation-problem-of-libvirtd.policy-s-pro.patch @@ -0,0 +1,49 @@ +From 47a752871089002c83cf0de2e60946d776423bca Mon Sep 17 00:00:00 2001 +From: budory +Date: Fri, 16 Aug 2024 06:40:46 +0000 +Subject: [PATCH] Fix the translation problem of libvirtd.policy's prompts. + Whereas the translations of the zh_CN.po, zh_HK.po, and zh_TW.po files do not + cover the prompts in libvirtd.policy. Therefore, it is necessary to add + simplified Chinese and Traditional Chinese to the description and message in + libvirt.policy. + +Signed-off-by: budory +--- + src/remote/libvirtd.policy | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/src/remote/libvirtd.policy b/src/remote/libvirtd.policy +index e834d24327..264d74b60e 100644 +--- a/src/remote/libvirtd.policy ++++ b/src/remote/libvirtd.policy +@@ -27,7 +27,13 @@ License along with this library. If not, see + + + Monitor local virtualized systems ++ 監控本地虛擬化系統 ++ 監控本地虛擬化系統 ++ 监控本地虚拟化系统 + System policy prevents monitoring of local virtualized systems ++ 系統策略禁止監控本地虛擬化系統 ++ 系統策略禁止監控本地虛擬化系統 ++ 系统策略禁止监控本地虚拟化系统 + + +@@ -39,7 +45,13 @@ License along with this library. If not, see + + + Manage local virtualized systems ++ 管理本地虛擬化系統 ++ 管理本地虛擬化系統 ++ 管理本地虚拟化系统 + System policy prevents management of local virtualized systems ++ 系統策略禁止管理本地虛擬化系統 ++ 系統策略禁止管理本地虛擬化系統 ++ 系统策略禁止管理本地虚拟化系统 + + +-- +2.33.0 + diff --git a/backends-add-support-of-one-guest-numa-node-alloc-me.patch b/backends-add-support-of-one-guest-numa-node-alloc-me.patch new file mode 100644 index 0000000..5c300c5 --- /dev/null +++ b/backends-add-support-of-one-guest-numa-node-alloc-me.patch @@ -0,0 +1,170 @@ +From a8b544f0dde0966dbc9d7d1cf73203f71ad1acd6 Mon Sep 17 00:00:00 2001 +From: leizongkun +Date: Thu, 6 Nov 2025 20:42:36 +0800 +Subject: [PATCH] backends:add support of one guest numa node alloc memory from + multi host nodes + +It provides QEMU with a more flexible memory NUMA binding approach, +allowing a guest NUMA node to allocate memory +to different host NUMA nodes according to specified proportions. + +Signed-off-by: wangzhigang +Signed-off-by: zhangliang +Signed-off-by: leizongkun +--- + src/conf/numa_conf.c | 36 ++++++++++++++++++++++++++++++++++-- + src/conf/numa_conf.h | 4 ++++ + src/libvirt_private.syms | 1 + + src/qemu/qemu_command.c | 8 ++++++++ + 4 files changed, 47 insertions(+), 2 deletions(-) + +diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c +index bcd7838e00..6ba1cfb014 100644 +--- a/src/conf/numa_conf.c ++++ b/src/conf/numa_conf.c +@@ -105,6 +105,7 @@ struct _virDomainNuma { + + virNumaCache *caches; + size_t ncaches; ++ char *prop; + } *mem_nodes; /* guest node configuration */ + size_t nmem_nodes; + +@@ -162,7 +163,7 @@ virDomainNumatuneNodeParseXML(virDomainNuma *numa, + virDomainNumaNode *mem_node = NULL; + xmlNodePtr cur_node = nodes[i]; + g_autofree char *tmp = NULL; +- ++ char *proportion = NULL; + if (virXMLPropUInt(cur_node, "cellid", 10, VIR_XML_PROP_REQUIRED, + &cellid) < 0) + return -1; +@@ -188,6 +189,13 @@ virDomainNumatuneNodeParseXML(virDomainNuma *numa, + VIR_DOMAIN_NUMATUNE_MEM_STRICT) < 0) + return -1; + ++ proportion = virXMLPropString(cur_node, "proportion"); ++ if (proportion != NULL) { ++ numa->mem_nodes[cellid].prop = proportion; ++ continue; ++ } ++ numa->mem_nodes[cellid].prop = NULL; ++ + tmp = virXMLPropString(cur_node, "nodeset"); + if (!tmp) { + virReportError(VIR_ERR_XML_ERROR, "%s", +@@ -278,6 +286,7 @@ virDomainNumatuneFormatXML(virBuffer *buf, + const char *tmp = NULL; + char *nodeset = NULL; + bool nodesetSpecified = false; ++ bool properBindSpecified = false; + size_t i = 0; + + if (!numatune) +@@ -290,7 +299,14 @@ virDomainNumatuneFormatXML(virBuffer *buf, + } + } + +- if (!nodesetSpecified && !numatune->memory.specified) ++ for (i = 0; i < numatune->nmem_nodes; i++) { ++ if (numatune->mem_nodes[i].prop != NULL) { ++ properBindSpecified = true; ++ break; ++ } ++ } ++ ++ if (!nodesetSpecified && !numatune->memory.specified && !properBindSpecified) + return 0; + + virBufferAddLit(buf, "\n"); +@@ -313,6 +329,12 @@ virDomainNumatuneFormatXML(virBuffer *buf, + + for (i = 0; i < numatune->nmem_nodes; i++) { + virDomainNumaNode *mem_node = &numatune->mem_nodes[i]; ++ if (mem_node->prop != NULL) { ++ virBufferAsprintf(buf, ++ "\n", ++ i, ++ mem_node->prop); ++ } + + if (!mem_node->nodeset) + continue; +@@ -350,6 +372,9 @@ virDomainNumaFree(virDomainNuma *numa) + g_free(numa->mem_nodes[i].distances); + + g_free(numa->mem_nodes[i].caches); ++ if (numa->mem_nodes[i].prop != NULL) { ++ g_free(numa->mem_nodes[i].prop); ++ } + } + g_free(numa->mem_nodes); + +@@ -1466,6 +1491,13 @@ virDomainNumaGetNodeDiscard(virDomainNuma *numa, + } + + ++char * ++virDomainNumaGetNodeProportion(virDomainNuma *numa, size_t node) ++{ ++ return numa->mem_nodes[node].prop; ++} ++ ++ + unsigned long long + virDomainNumaGetNodeMemorySize(virDomainNuma *numa, + size_t node) +diff --git a/src/conf/numa_conf.h b/src/conf/numa_conf.h +index f5a20315b6..852a265f31 100644 +--- a/src/conf/numa_conf.h ++++ b/src/conf/numa_conf.h +@@ -136,6 +136,10 @@ virDomainMemoryAccess virDomainNumaGetNodeMemoryAccessMode(virDomainNuma *numa, + virTristateBool virDomainNumaGetNodeDiscard(virDomainNuma *numa, + size_t node) + ATTRIBUTE_NONNULL(1); ++ ++char *virDomainNumaGetNodeProportion(virDomainNuma *numa, size_t node) ++ ATTRIBUTE_NONNULL(1); ++ + unsigned long long virDomainNumaGetNodeMemorySize(virDomainNuma *numa, + size_t node) + ATTRIBUTE_NONNULL(1); +diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms +index 4cd5f0b2f3..5c8bc42c3b 100644 +--- a/src/libvirt_private.syms ++++ b/src/libvirt_private.syms +@@ -925,6 +925,7 @@ virDomainNumaGetNodeDistance; + virDomainNumaGetNodeInitiator; + virDomainNumaGetNodeMemoryAccessMode; + virDomainNumaGetNodeMemorySize; ++virDomainNumaGetNodeProportion; + virDomainNumaHasHMAT; + virDomainNumaNew; + virDomainNumaNodeDistanceIsUsingDefaults; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index 3e0f926927..d57c8dda87 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -7692,11 +7692,19 @@ qemuBuildNumaCommandLine(virQEMUDriverConfig *cfg, + nodemask = g_new0(virBitmap *, ncells); + + for (i = 0; i < ncells; i++) { ++ char *prop = NULL; + if ((rc = qemuBuildMemoryCellBackendProps(def, cfg, i, priv, + &nodeBackends[i], + &nodemask[i])) < 0) + goto cleanup; + ++ prop = virDomainNumaGetNodeProportion(def->numa, i); ++ if (prop != NULL) { ++ if (virJSONValueObjectPrependString(nodeBackends[i], "host-nodes-propertion", prop) < 0) { ++ goto cleanup; ++ } ++ } ++ + if (rc == 0) + needBackend = true; + } +-- +2.33.0 + diff --git a/conf-add-support-for-cachetune-L3-min-max.patch b/conf-add-support-for-cachetune-L3-min-max.patch new file mode 100644 index 0000000..fd36e5b --- /dev/null +++ b/conf-add-support-for-cachetune-L3-min-max.patch @@ -0,0 +1,70 @@ +From 272249cd189a539a5170d798a810257bccba7efb Mon Sep 17 00:00:00 2001 +From: lutong +Date: Tue, 21 Oct 2025 16:31:51 +0800 +Subject: [PATCH] conf: add support for cachetune/L3 min/max + +--- + src/conf/domain_conf.c | 8 ++++++-- + src/conf/schemas/domaincommon.rng | 2 ++ + src/util/virresctrl.c | 6 ++++-- + 3 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index e30ec0dca4..77d82e20b4 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -17761,7 +17761,9 @@ virDomainCachetuneDefParseCache(xmlXPathContextPtr ctxt, + VIR_XML_PROP_REQUIRED, &type) < 0) + return -1; + +- if (type == VIR_CACHE_TYPE_PRIORITY) { ++ if (type == VIR_CACHE_TYPE_PRIORITY || ++ type == VIR_CACHE_TYPE_MIN || ++ type == VIR_CACHE_TYPE_MAX) { + if (virXMLPropULongLong(node, "size", 10, VIR_XML_PROP_REQUIRED, &size) < 0) + return -1; + } else { +@@ -26863,7 +26865,9 @@ virDomainCachetuneDefFormatHelper(unsigned int level, + virBuffer *buf = opaque; + unsigned long long short_size = virFormatIntPretty(size, &unit); + +- if (type == VIR_CACHE_TYPE_PRIORITY) { ++ if (type == VIR_CACHE_TYPE_PRIORITY || ++ type == VIR_CACHE_TYPE_MIN || ++ type == VIR_CACHE_TYPE_MAX) { + virBufferAsprintf(buf, + "\n", +diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng +index 78773f744b..8d221d2b73 100644 +--- a/src/conf/schemas/domaincommon.rng ++++ b/src/conf/schemas/domaincommon.rng +@@ -1148,6 +1148,8 @@ + code + data + priority ++ min ++ max + + + +diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c +index a430aa3b84..c30ee10f8a 100644 +--- a/src/util/virresctrl.c ++++ b/src/util/virresctrl.c +@@ -1290,8 +1290,10 @@ virResctrlAllocCheckCollision(virResctrlAlloc *alloc, + if (!a_level) + return false; + +- if (type == VIR_CACHE_TYPE_PRIORITY) { +- a_type = a_level->types[VIR_CACHE_TYPE_PRIORITY]; ++ if (type == VIR_CACHE_TYPE_PRIORITY || ++ type == VIR_CACHE_TYPE_MIN || ++ type == VIR_CACHE_TYPE_MAX) { ++ a_type = a_level->types[type]; + + if (a_type && a_type->nsizes > cache && a_type->sizes[cache]) + return true; +-- +2.33.0 + diff --git a/conf-add-support-for-hugepage-hugepage-pod.patch b/conf-add-support-for-hugepage-hugepage-pod.patch new file mode 100644 index 0000000..841cc73 --- /dev/null +++ b/conf-add-support-for-hugepage-hugepage-pod.patch @@ -0,0 +1,62 @@ +From efdd9c635f8a4dc558ef00b4543fb6a3e397599a Mon Sep 17 00:00:00 2001 +From: leizongkun +Date: Thu, 6 Nov 2025 20:41:25 +0800 +Subject: [PATCH] conf: add support for hugepage hugepage pod + +Libvirt support optimize memory regions that use 2MB huge pages +and are not pre-allocated by setting the MADV_HUGETLB_ZEROPAGE advice, +This defers physical memory allocation, reduces memory overhead, +and achieves on-demand memory usage when starting virtual machines. + +Signed-off-by: wangzhigang +Signed-off-by: zhangliang +Signed-off-by: leizongkun +--- + src/conf/domain_conf.c | 1 + + src/conf/domain_conf.h | 1 + + src/qemu/qemu_command.c | 5 +++++ + 3 files changed, 7 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index 77d82e20b4..f8f3cbcae6 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -1407,6 +1407,7 @@ VIR_ENUM_IMPL(virDomainMemoryAllocation, + "none", + "immediate", + "ondemand", ++ "hugepage-ondemand", + ); + + VIR_ENUM_IMPL(virDomainLoader, +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index cadca33246..7611fbd86a 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -507,6 +507,7 @@ typedef enum { + VIR_DOMAIN_MEMORY_ALLOCATION_NONE = 0, /* No memory allocation defined */ + VIR_DOMAIN_MEMORY_ALLOCATION_IMMEDIATE, /* Memory allocation is set as immediate */ + VIR_DOMAIN_MEMORY_ALLOCATION_ONDEMAND, /* Memory allocation is set as ondemand */ ++ VIR_DOMAIN_MEMORY_ALLOCATION_HUGEPAGE_ONDEMAND, /* Hugepage allocation is set as ondemand */ + + VIR_DOMAIN_MEMORY_ALLOCATION_LAST, + } virDomainMemoryAllocation; +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index cc8ecfa9fb..3e0f926927 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -3413,6 +3413,11 @@ qemuBuildMemoryBackendProps(virJSONValue **backendProps, + } else if (useHugepage) { + if (qemuGetDomainHupageMemPath(priv->driver, def, pagesize, &memPath) < 0) + return -1; ++ ++ if (def->mem.allocation == VIR_DOMAIN_MEMORY_ALLOCATION_HUGEPAGE_ONDEMAND) { ++ prealloc = false; ++ virJSONValueObjectAppendBoolean(props, "reserve", 0); ++ } + } else { + /* We can have both pagesize and mem source. If that's the case, + * prefer hugepages as those are more specific. */ +-- +2.33.0 + diff --git a/cpu-Add-new-Chengdu-CPU-model.patch b/cpu-Add-new-Chengdu-CPU-model.patch new file mode 100644 index 0000000..08491ad --- /dev/null +++ b/cpu-Add-new-Chengdu-CPU-model.patch @@ -0,0 +1,148 @@ +From 0bfe89a6bde864ec89245d49ebb5e68d17ff71bd Mon Sep 17 00:00:00 2001 +From: Yanjing Zhou +Date: Mon, 19 May 2025 08:19:07 +0000 +Subject: [PATCH] cpu: Add new Chengdu CPU model + +Add Hygon Chengdu CPU model to the processor model. + +Signed-off-by: Yanjing Zhou +--- + src/cpu_map/index.xml | 1 + + src/cpu_map/meson.build | 1 + + src/cpu_map/x86_Chengdu.xml | 100 ++++++++++++++++++++++++++++++++++++ + 3 files changed, 102 insertions(+) + create mode 100644 src/cpu_map/x86_Chengdu.xml + +diff --git a/src/cpu_map/index.xml b/src/cpu_map/index.xml +index 5d18a4aed6..dd65e38554 100644 +--- a/src/cpu_map/index.xml ++++ b/src/cpu_map/index.xml +@@ -75,6 +75,7 @@ + + + ++ + + + +diff --git a/src/cpu_map/meson.build b/src/cpu_map/meson.build +index ca4934d363..ee1a10270e 100644 +--- a/src/cpu_map/meson.build ++++ b/src/cpu_map/meson.build +@@ -36,6 +36,7 @@ cpumap_data = [ + 'x86_coreduo.xml', + 'x86_cpu64-rhel5.xml', + 'x86_cpu64-rhel6.xml', ++ 'x86_Chengdu.xml', + 'x86_Dharma.xml', + 'x86_Dhyana.xml', + 'x86_EPYC-IBPB.xml', +diff --git a/src/cpu_map/x86_Chengdu.xml b/src/cpu_map/x86_Chengdu.xml +new file mode 100644 +index 0000000000..ab6cf268ab +--- /dev/null ++++ b/src/cpu_map/x86_Chengdu.xml +@@ -0,0 +1,100 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +-- +2.33.0 + diff --git a/libvirt.spec b/libvirt.spec index 2d1bf01..20739b3 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -262,7 +262,7 @@ Summary: Library providing a simple virtualization API Name: libvirt Version: 9.10.0 -Release: 18 +Release: 19 License: LGPLv2+ URL: https://libvirt.org/ @@ -357,6 +357,13 @@ Patch0083: v4-1-4-src-Add-ARM-CCA-support-in-qemu-driver-to-lau.patch Patch0084: v4-2-4-src-Add-ARM-CCA-support-in-domain-capabilitie.patch Patch0085: v4-3-4-src-Add-ARM-CCA-support-in-domain-schema.patch Patch0086: hostdev-add-numa-configure-for-host-pci-device.patch +Patch0087: Fix-the-translation-problem-of-libvirtd.policy-s-pro.patch +Patch0088: cpu-Add-new-Chengdu-CPU-model.patch +Patch0089: util-resctrl-add-L3-min-max-parse-and-format-method.patch +Patch0090: conf-add-support-for-cachetune-L3-min-max.patch +Patch0091: conf-add-support-for-hugepage-hugepage-pod.patch +Patch0092: backends-add-support-of-one-guest-numa-node-alloc-me.patch +Patch0093: migration-support-vfio-pci-device-migration.patch Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release} @@ -2648,6 +2655,15 @@ exit 0 %endif %changelog +* Tue Nov 11 2025 PengruiZhang - 9.10.0-19 +- Fix the translation problem of libvirtd.policy's prompts. +- cpu: Add new Chengdu CPU model +- util:resctrl:add L3 min/max parse and format method +- conf: add support for cachetune/L3 min/max +- conf: add support for hugepage hugepage pod +- backends:add support of one guest numa node alloc memory from multi host nodes +- migration: support vfio-pci device migration + * Mon Sep 01 2025 PengruiZhang - 9.10.0-18 - add qemu VIRTCCA capability detection - add virtcca test xml diff --git a/migration-support-vfio-pci-device-migration.patch b/migration-support-vfio-pci-device-migration.patch new file mode 100644 index 0000000..4d74e53 --- /dev/null +++ b/migration-support-vfio-pci-device-migration.patch @@ -0,0 +1,101 @@ +From c34ee3e681e9ac92ebc4655046c15e70fcd49a52 Mon Sep 17 00:00:00 2001 +From: Chengfei Huang +Date: Tue, 21 Oct 2025 18:28:29 +0800 +Subject: [PATCH] migration: support vfio-pci device migration + +add "migration" attribute to +Set migration='on' to enable migration. + +Signed-off-by: Chengfei Huang +--- + src/conf/domain_conf.c | 8 ++++++++ + src/conf/domain_conf.h | 1 + + src/conf/schemas/domaincommon.rng | 5 +++++ + src/qemu/qemu_command.c | 1 + + src/qemu/qemu_migration.c | 4 ++++ + 5 files changed, 19 insertions(+) + +diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c +index e30ec0dca4..2b249b285a 100644 +--- a/src/conf/domain_conf.c ++++ b/src/conf/domain_conf.c +@@ -6234,6 +6234,10 @@ virDomainHostdevDefParseXMLSubsys(xmlNodePtr node, + + model = virXMLPropString(node, "model"); + ++ if (virXMLPropTristateSwitch(node, "migration", VIR_XML_PROP_NONE, ++ &def->migration) < 0) ++ return -1; ++ + if (virXMLPropUInt(node, "iommufd", 10, VIR_XML_PROP_NONZERO, + &def->iommufd) < 0) { + virReportError(VIR_ERR_XML_ERROR, "%s", +@@ -26421,6 +26425,10 @@ virDomainHostdevDefFormat(virBuffer *buf, + virBufferAsprintf(buf, " managed='%s'", + def->managed ? "yes" : "no"); + ++ if (def->migration != VIR_TRISTATE_SWITCH_ABSENT) ++ virBufferAsprintf(buf, " migration='%s'", ++ virTristateSwitchTypeToString(def->migration)); ++ + if (def->source.subsys.type == VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_SCSI && + scsisrc->sgio) + virBufferAsprintf(buf, " sgio='%s'", +diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h +index cadca33246..3470b2b8f4 100644 +--- a/src/conf/domain_conf.h ++++ b/src/conf/domain_conf.h +@@ -381,6 +381,7 @@ struct _virDomainHostdevDef { + virDomainHostdevMode mode; + virDomainStartupPolicy startupPolicy; + virDomainDeviceNuma numa; ++ virTristateSwitch migration; + bool managed; + bool missing; + bool readonly; +diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng +index 78773f744b..304eccbedd 100644 +--- a/src/conf/schemas/domaincommon.rng ++++ b/src/conf/schemas/domaincommon.rng +@@ -6242,6 +6242,11 @@ + + + ++ ++ ++ ++ ++ + + + +diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c +index cc8ecfa9fb..33ed9f05d2 100644 +--- a/src/qemu/qemu_command.c ++++ b/src/qemu/qemu_command.c +@@ -4772,6 +4772,7 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def, + "s:id", dev->info->alias, + "p:bootindex", dev->info->effectiveBootIndex, + "S:failover_pair_id", failover_pair_id, ++ "S:enable-migration", qemuOnOffAuto(dev->migration), + NULL) < 0) + return NULL; + +diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c +index 5853947e31..ada8bfecd1 100644 +--- a/src/qemu/qemu_migration.c ++++ b/src/qemu/qemu_migration.c +@@ -1332,6 +1332,10 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def) + continue; + } + ++ if (hostdev->migration == VIR_TRISTATE_SWITCH_ON) { ++ continue; ++ } ++ + /* all other PCI hostdevs can't be migrated */ + if (hostdev->parentnet) { + virDomainNetType actualType = virDomainNetGetActualType(hostdev->parentnet); +-- +2.33.0 + diff --git a/util-resctrl-add-L3-min-max-parse-and-format-method.patch b/util-resctrl-add-L3-min-max-parse-and-format-method.patch new file mode 100644 index 0000000..c80153a --- /dev/null +++ b/util-resctrl-add-L3-min-max-parse-and-format-method.patch @@ -0,0 +1,252 @@ +From 3183836b6137796a905654a7c8eb0e4d505c1030 Mon Sep 17 00:00:00 2001 +From: lutong +Date: Tue, 21 Oct 2025 15:23:12 +0800 +Subject: [PATCH] util:resctrl:add L3 min/max parse and format method + +--- + src/util/virresctrl.c | 104 ++++++++++++++++++++++++++---------------- + src/util/virresctrl.h | 2 + + 2 files changed, 67 insertions(+), 39 deletions(-) + +diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c +index afd70c821a..a430aa3b84 100644 +--- a/src/util/virresctrl.c ++++ b/src/util/virresctrl.c +@@ -61,6 +61,8 @@ VIR_ENUM_IMPL(virCacheKernel, + "Instruction", + "Data", + "Priority", ++ "Min", ++ "Max", + ); + + /* Cache name mapping for our XML naming. */ +@@ -70,6 +72,8 @@ VIR_ENUM_IMPL(virCache, + "code", + "data", + "priority", ++ "min", ++ "max", + ); + + /* Cache name mapping for resctrl interface naming. */ +@@ -80,6 +84,8 @@ VIR_ENUM_IMPL(virResctrl, + "CODE", + "DATA", + "PRI", ++ "MIN", ++ "MAX", + ); + + VIR_ENUM_IMPL(virMemory, +@@ -336,9 +342,9 @@ struct _virResctrlAllocPerType { + unsigned int **cache_ids; + size_t ncache_ids; + +- /* priority for each cahe */ +- unsigned long long **priorities; +- size_t npriorities; ++ /* value for each cahe */ ++ unsigned long long **values; ++ size_t nvalues; + }; + + struct _virResctrlAllocPerLevel { +@@ -436,13 +442,13 @@ virResctrlAllocDispose(void *obj) + for (k = 0; k < type->ncache_ids; k++) + g_free(type->cache_ids[k]); + +- for (k = 0; k < type->npriorities; k++) +- g_free(type->priorities[k]); ++ for (k = 0; k < type->nvalues; k++) ++ g_free(type->values[k]); + + g_free(type->sizes); + g_free(type->masks); + g_free(type->cache_ids); +- g_free(type->priorities); ++ g_free(type->values); + g_free(type); + } + g_free(level->types); +@@ -1720,9 +1726,11 @@ virResctrlAllocFormatCache(virResctrlAlloc *alloc, + + virBufferAsprintf(buf, "L%u%s:", level, virResctrlTypeToString(type)); + +- if (type == VIR_CACHE_TYPE_PRIORITY) { +- for (cache = 0; cache < a_type->npriorities; cache++) { +- virBufferAsprintf(buf, "%u=%llu;", *(a_type->cache_ids[cache]), *(a_type->priorities[cache])); ++ if (type == VIR_CACHE_TYPE_PRIORITY || ++ type == VIR_CACHE_TYPE_MIN || ++ type == VIR_CACHE_TYPE_MAX) { ++ for (cache = 0; cache < a_type->nvalues; cache++) { ++ virBufferAsprintf(buf, "%u=%llu;", *(a_type->cache_ids[cache]), *(a_type->values[cache])); + } + } else { + for (cache = 0; cache < a_type->nmasks; cache++) { +@@ -1740,7 +1748,6 @@ virResctrlAllocFormatCache(virResctrlAlloc *alloc, + VIR_FREE(mask_str); + } + } +- + virBufferTrim(buf, ";"); + virBufferAddChar(buf, '\n'); + } +@@ -1813,18 +1820,19 @@ virResctrlAllocParseProcessCacheId(virResctrlInfo *resctrl, + + + static int +-virResctrlAllocParseProcessCachePriority(virResctrlAlloc *alloc, ++virResctrlAllocParseProcessCacheValue(virResctrlAlloc *alloc, + unsigned int level, + virCacheType type, +- char *value, ++ char *valueStr, + unsigned int node_id) + { +- unsigned int priority = 0; ++ unsigned int value = 0; + virResctrlAllocPerType *a_type = NULL; + +- if (virStrToLong_uip(value, NULL, 10, &priority) < 0) { ++ if (virStrToLong_uip(valueStr, NULL, 10, &value) < 0) { + virReportError(VIR_ERR_INTERNAL_ERROR, +- _("Invalid priority '%1$s'"), value); ++ _("Invalid value '%1$s' for cache type '%2$s'"), ++ valueStr, virCacheTypeToString(type)); + return -1; + } + +@@ -1833,15 +1841,15 @@ virResctrlAllocParseProcessCachePriority(virResctrlAlloc *alloc, + if (!a_type) + return -1; + +- if (a_type->npriorities <= node_id) { +- VIR_EXPAND_N(a_type->priorities, a_type->npriorities, +- node_id - a_type->npriorities + 1); ++ if (a_type->nvalues <= node_id) { ++ VIR_EXPAND_N(a_type->values, a_type->nvalues, ++ node_id - a_type->nvalues + 1); + } + +- if (!a_type->priorities[node_id]) +- a_type->priorities[node_id] = g_new0(unsigned long long, 1); ++ if (!a_type->values[node_id]) ++ a_type->values[node_id] = g_new0(unsigned long long, 1); + +- *(a_type->priorities[node_id]) = priority; ++ *(a_type->values[node_id]) = value; + + return 0; + } +@@ -1868,8 +1876,10 @@ virResctrlAllocParseProcessCache(virResctrlInfo *resctrl, + return -1; + } + +- if (type == VIR_CACHE_TYPE_PRIORITY) { +- return virResctrlAllocParseProcessCachePriority(alloc, level, type, tmp, node_id); ++ if (type == VIR_CACHE_TYPE_PRIORITY || ++ type == VIR_CACHE_TYPE_MIN || ++ type == VIR_CACHE_TYPE_MAX) { ++ return virResctrlAllocParseProcessCacheValue(alloc, level, type, tmp, node_id); + } + + mask = virBitmapNewString(tmp); +@@ -2416,15 +2426,15 @@ virResctrlAllocCopyCacheProperties(virResctrlAlloc *dst, + *(d_type->cache_ids[cache]) = *(s_type->cache_ids[cache]); + } + +- if (s_type->npriorities > d_type->npriorities) +- VIR_EXPAND_N(d_type->priorities, d_type->npriorities, +- s_type->npriorities - d_type->npriorities); ++ if (s_type->nvalues > d_type->nvalues) ++ VIR_EXPAND_N(d_type->values, d_type->nvalues, ++ s_type->nvalues - d_type->nvalues); + +- for (cache = 0; cache < s_type->npriorities; cache++) { +- if (d_type->priorities[cache]) ++ for (cache = 0; cache < s_type->nvalues; cache++) { ++ if (d_type->values[cache]) + continue; +- d_type->priorities[cache] = g_new0(long long unsigned int, 1); +- *(d_type->priorities[cache]) = *(s_type->priorities[cache]); ++ d_type->values[cache] = g_new0(long long unsigned int, 1); ++ *(d_type->values[cache]) = *(s_type->values[cache]); + } + } + } +@@ -2531,33 +2541,49 @@ virResctrlAllocAssign(virResctrlInfo *resctrl, + if (!a_type) + continue; + +- if (type == VIR_CACHE_TYPE_PRIORITY) { ++ if (type == VIR_CACHE_TYPE_PRIORITY || ++ type == VIR_CACHE_TYPE_MIN || ++ type == VIR_CACHE_TYPE_MAX) { + for (cache = 0; cache < a_type->nsizes; cache++) { + if (!a_type->sizes[cache]) + continue; + +- if (a_type->npriorities == 0) { ++ if (a_type->nvalues == 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("Cache level %1$d does not support tuning for scope type '%2$s'"), +- level, virCacheTypeToString(type)); ++ _("Cache level %1$d does not support tuning for scope type '%2$s'"), ++ level, virCacheTypeToString(type)); + return -1; + } + +- if (a_type->npriorities <= cache || !a_type->priorities[cache]) { ++ if (a_type->nvalues <= cache || !a_type->values[cache]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, +- _("Cache id %1$d does not exist for level %2$d"), +- cache, level); ++ _("Cache id %1$d does not exist for level %2$d"), ++ cache, level); + return -1; + } + +- if (*(a_type->sizes[cache]) > 3) { ++ if (type == VIR_CACHE_TYPE_PRIORITY && *(a_type->sizes[cache]) > 3) { + virReportError(VIR_ERR_XML_ERROR, + _("Cache level %1$d id %2$d priority value just support 0-3"), + level, cache); + return -1; + } + +- *(a_type->priorities[cache]) = *(a_type->sizes[cache]); ++ if (type == VIR_CACHE_TYPE_MIN && *(a_type->sizes[cache]) > 100) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Cache level %1$d id %2$d min value exceeding 100 is invalid"), ++ level, cache); ++ return -1; ++ } ++ ++ if (type == VIR_CACHE_TYPE_MAX && *(a_type->sizes[cache]) > 100) { ++ virReportError(VIR_ERR_XML_ERROR, ++ _("Cache level %1$d id %2$d max value exceeding 100 is invalid"), ++ level, cache); ++ return -1; ++ } ++ ++ *(a_type->values[cache]) = *(a_type->sizes[cache]); + } + continue; + } +diff --git a/src/util/virresctrl.h b/src/util/virresctrl.h +index 9b317187f5..27e6dc033b 100644 +--- a/src/util/virresctrl.h ++++ b/src/util/virresctrl.h +@@ -28,6 +28,8 @@ typedef enum { + VIR_CACHE_TYPE_CODE, + VIR_CACHE_TYPE_DATA, + VIR_CACHE_TYPE_PRIORITY, ++ VIR_CACHE_TYPE_MIN, ++ VIR_CACHE_TYPE_MAX, + + VIR_CACHE_TYPE_LAST + } virCacheType; +-- +2.33.0 + -- Gitee