Import OL libvirt-10.5.0-7.2.0.1.el9_5
This commit is contained in:
parent
46fe2f828e
commit
c8b8224c1d
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/libvirt-10.0.0.tar.xz
|
||||
SOURCES/libvirt-10.5.0.tar.xz
|
||||
|
@ -1 +1 @@
|
||||
7a2e402bfb1ad295544de6cd527c4c04e85c5096 SOURCES/libvirt-10.0.0.tar.xz
|
||||
345a0557aeca3b74afb7f048ff4e281782503a16 SOURCES/libvirt-10.5.0.tar.xz
|
||||
|
@ -1,679 +0,0 @@
|
||||
From 9a31f486329e36bbe6f6156eb89d4d455fc0a7d8 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9a31f486329e36bbe6f6156eb89d4d455fc0a7d8.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 15:50:27 +0100
|
||||
Subject: [PATCH] Don't overwrite error message from 'virXPathNodeSet'
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
'virXPathNodeSet' returns -1 only when 'ctxt' or 'xpath' are NULL or
|
||||
when the 'xpath' string is invalid. Both are programming errors. It
|
||||
doesn't make sense for the code to overwrite the error message for
|
||||
anything supposedly more relevant.
|
||||
|
||||
The majority of calls to 'virXPathNodeSet' already didn't do this, so
|
||||
this patch fixes the rest to prevent it from spreading again.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit a9f76d6ab7278864150d9f4776750ea22d7ef508)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/conf/domain_conf.c | 78 +++++++------------------------
|
||||
src/conf/network_conf.c | 80 ++++++++------------------------
|
||||
src/conf/node_device_conf.c | 17 ++-----
|
||||
src/conf/numa_conf.c | 15 +++---
|
||||
src/cpu/cpu_ppc64.c | 5 +-
|
||||
src/qemu/qemu_capabilities.c | 30 +++---------
|
||||
src/qemu/qemu_domain.c | 23 +++------
|
||||
src/qemu/qemu_migration_cookie.c | 5 +-
|
||||
src/qemu/qemu_nbdkit.c | 5 +-
|
||||
src/vz/vz_sdk.c | 5 +-
|
||||
10 files changed, 72 insertions(+), 191 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index ac06fa39f6..52a5796ad2 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -17765,11 +17765,8 @@ virDomainResctrlMonDefParse(virDomainDef *def,
|
||||
|
||||
ctxt->node = node;
|
||||
|
||||
- if ((n = virXPathNodeSet("./monitor", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("Cannot extract monitor nodes"));
|
||||
+ if ((n = virXPathNodeSet("./monitor", ctxt, &nodes)) < 0)
|
||||
goto cleanup;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
domresmon = g_new0(virDomainResctrlMonDef, 1);
|
||||
@@ -17897,11 +17894,8 @@ virDomainCachetuneDefParse(virDomainDef *def,
|
||||
if (virBitmapIsAllClear(vcpus))
|
||||
return 0;
|
||||
|
||||
- if ((n = virXPathNodeSet("./cache", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("Cannot extract cache nodes under cachetune"));
|
||||
+ if ((n = virXPathNodeSet("./cache", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (virDomainResctrlVcpuMatch(def, vcpus, &resctrl) < 0)
|
||||
return -1;
|
||||
@@ -18167,11 +18161,8 @@ virDomainDefParseMemory(virDomainDef *def,
|
||||
|
||||
if (virXPathNode("./memoryBacking/hugepages", ctxt)) {
|
||||
/* hugepages will be used */
|
||||
- if ((n = virXPathNodeSet("./memoryBacking/hugepages/page", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract hugepages nodes"));
|
||||
+ if ((n = virXPathNodeSet("./memoryBacking/hugepages/page", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (n) {
|
||||
def->mem.hugepages = g_new0(virDomainHugePage, n);
|
||||
@@ -18255,11 +18246,8 @@ virDomainMemorytuneDefParse(virDomainDef *def,
|
||||
if (virBitmapIsAllClear(vcpus))
|
||||
return 0;
|
||||
|
||||
- if ((n = virXPathNodeSet("./node", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("Cannot extract memory nodes under memorytune"));
|
||||
+ if ((n = virXPathNodeSet("./node", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (virDomainResctrlVcpuMatch(def, vcpus, &resctrl) < 0)
|
||||
return -1;
|
||||
@@ -18326,11 +18314,9 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
&def->blkio.weight) < 0)
|
||||
def->blkio.weight = 0;
|
||||
|
||||
- if ((n = virXPathNodeSet("./blkiotune/device", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("cannot extract blkiotune nodes"));
|
||||
+ if ((n = virXPathNodeSet("./blkiotune/device", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (n)
|
||||
def->blkio.devices = g_new0(virBlkioDevice, n);
|
||||
|
||||
@@ -18441,11 +18427,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/emulatorpin", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract emulatorpin nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/emulatorpin", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (n) {
|
||||
if (n > 1) {
|
||||
@@ -18460,11 +18443,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
VIR_FREE(nodes);
|
||||
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/iothreadpin", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract iothreadpin nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/iothreadpin", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (virDomainIOThreadPinDefParseXML(nodes[i], def) < 0)
|
||||
@@ -18472,11 +18452,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/vcpusched", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract vcpusched nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/vcpusched", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (virDomainVcpuThreadSchedParse(nodes[i], def) < 0)
|
||||
@@ -18484,11 +18461,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/iothreadsched", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract iothreadsched nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/iothreadsched", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (virDomainIOThreadSchedParse(nodes[i], def) < 0)
|
||||
@@ -18496,11 +18470,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/emulatorsched", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract emulatorsched nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/emulatorsched", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (n) {
|
||||
if (n > 1) {
|
||||
@@ -18514,11 +18485,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/cachetune", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract cachetune nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/cachetune", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (virDomainCachetuneDefParse(def, ctxt, nodes[i], flags) < 0)
|
||||
@@ -18526,11 +18494,8 @@ virDomainDefTunablesParse(virDomainDef *def,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./cputune/memorytune", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract memorytune nodes"));
|
||||
+ if ((n = virXPathNodeSet("./cputune/memorytune", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (virDomainMemorytuneDefParse(def, ctxt, nodes[i], flags) < 0)
|
||||
@@ -18834,11 +18799,8 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt,
|
||||
!virDomainIOThreadIDArrayHasPin(def))
|
||||
def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO;
|
||||
|
||||
- if ((n = virXPathNodeSet("./resource", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("cannot extract resource nodes"));
|
||||
+ if ((n = virXPathNodeSet("./resource", ctxt, &nodes)) < 0)
|
||||
return NULL;
|
||||
- }
|
||||
|
||||
if (n > 1) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
@@ -18886,11 +18848,9 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt,
|
||||
return NULL;
|
||||
|
||||
/* analysis of the resource leases */
|
||||
- if ((n = virXPathNodeSet("./devices/lease", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("cannot extract device leases"));
|
||||
+ if ((n = virXPathNodeSet("./devices/lease", ctxt, &nodes)) < 0)
|
||||
return NULL;
|
||||
- }
|
||||
+
|
||||
if (n)
|
||||
def->leases = g_new0(virDomainLeaseDef *, n);
|
||||
for (i = 0; i < n; i++) {
|
||||
@@ -19009,11 +18969,9 @@ virDomainDefParseXML(xmlXPathContextPtr ctxt,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("cannot extract console devices"));
|
||||
+ if ((n = virXPathNodeSet("./devices/console", ctxt, &nodes)) < 0)
|
||||
return NULL;
|
||||
- }
|
||||
+
|
||||
if (n)
|
||||
def->consoles = g_new0(virDomainChrDef *, n);
|
||||
|
||||
diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
|
||||
index 6f8a0d2d0b..52c90e53f8 100644
|
||||
--- a/src/conf/network_conf.c
|
||||
+++ b/src/conf/network_conf.c
|
||||
@@ -892,13 +892,9 @@ virNetworkDNSDefParseXML(const char *networkName,
|
||||
&def->forwardPlainNames) < 0)
|
||||
return -1;
|
||||
|
||||
- nfwds = virXPathNodeSet("./forwarder", ctxt, &fwdNodes);
|
||||
- if (nfwds < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <forwarder> element found in <dns> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nfwds = virXPathNodeSet("./forwarder", ctxt, &fwdNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (nfwds > 0) {
|
||||
def->forwarders = g_new0(virNetworkDNSForwarder, nfwds);
|
||||
|
||||
@@ -922,13 +918,9 @@ virNetworkDNSDefParseXML(const char *networkName,
|
||||
}
|
||||
}
|
||||
|
||||
- nhosts = virXPathNodeSet("./host", ctxt, &hostNodes);
|
||||
- if (nhosts < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <host> element found in <dns> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nhosts = virXPathNodeSet("./host", ctxt, &hostNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (nhosts > 0) {
|
||||
def->hosts = g_new0(virNetworkDNSHostDef, nhosts);
|
||||
|
||||
@@ -941,13 +933,9 @@ virNetworkDNSDefParseXML(const char *networkName,
|
||||
}
|
||||
}
|
||||
|
||||
- nsrvs = virXPathNodeSet("./srv", ctxt, &srvNodes);
|
||||
- if (nsrvs < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <srv> element found in <dns> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nsrvs = virXPathNodeSet("./srv", ctxt, &srvNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (nsrvs > 0) {
|
||||
def->srvs = g_new0(virNetworkDNSSrvDef, nsrvs);
|
||||
|
||||
@@ -960,13 +948,9 @@ virNetworkDNSDefParseXML(const char *networkName,
|
||||
}
|
||||
}
|
||||
|
||||
- ntxts = virXPathNodeSet("./txt", ctxt, &txtNodes);
|
||||
- if (ntxts < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <txt> element found in <dns> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((ntxts = virXPathNodeSet("./txt", ctxt, &txtNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (ntxts > 0) {
|
||||
def->txts = g_new0(virNetworkDNSTxtDef, ntxts);
|
||||
|
||||
@@ -1222,13 +1206,10 @@ virNetworkForwardNatDefParseXML(const char *networkName,
|
||||
return -1;
|
||||
|
||||
/* addresses for SNAT */
|
||||
- nNatAddrs = virXPathNodeSet("./address", ctxt, &natAddrNodes);
|
||||
- if (nNatAddrs < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <address> element found in <forward> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nNatAddrs = virXPathNodeSet("./address", ctxt, &natAddrNodes)) < 0)
|
||||
return -1;
|
||||
- } else if (nNatAddrs > 1) {
|
||||
+
|
||||
+ if (nNatAddrs > 1) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("Only one <address> element is allowed in <nat> in <forward> in network %1$s"),
|
||||
networkName);
|
||||
@@ -1284,13 +1265,10 @@ virNetworkForwardNatDefParseXML(const char *networkName,
|
||||
}
|
||||
|
||||
/* ports for SNAT and MASQUERADE */
|
||||
- nNatPorts = virXPathNodeSet("./port", ctxt, &natPortNodes);
|
||||
- if (nNatPorts < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <port> element found in <forward> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nNatPorts = virXPathNodeSet("./port", ctxt, &natPortNodes)) < 0)
|
||||
return -1;
|
||||
- } else if (nNatPorts > 1) {
|
||||
+
|
||||
+ if (nNatPorts > 1) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("Only one <port> element is allowed in <nat> in <forward> in network %1$s"),
|
||||
networkName);
|
||||
@@ -1358,37 +1336,19 @@ virNetworkForwardDefParseXML(const char *networkName,
|
||||
}
|
||||
|
||||
/* bridge and hostdev modes can use a pool of physical interfaces */
|
||||
- nForwardIfs = virXPathNodeSet("./interface", ctxt, &forwardIfNodes);
|
||||
- if (nForwardIfs < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <interface> element found in <forward> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nForwardIfs = virXPathNodeSet("./interface", ctxt, &forwardIfNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
- nForwardAddrs = virXPathNodeSet("./address", ctxt, &forwardAddrNodes);
|
||||
- if (nForwardAddrs < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <address> element found in <forward> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nForwardAddrs = virXPathNodeSet("./address", ctxt, &forwardAddrNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
- nForwardPfs = virXPathNodeSet("./pf", ctxt, &forwardPfNodes);
|
||||
- if (nForwardPfs < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <pf> element found in <forward> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nForwardPfs = virXPathNodeSet("./pf", ctxt, &forwardPfNodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
- nForwardNats = virXPathNodeSet("./nat", ctxt, &forwardNatNodes);
|
||||
- if (nForwardNats < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("invalid <nat> element found in <forward> of network %1$s"),
|
||||
- networkName);
|
||||
+ if ((nForwardNats = virXPathNodeSet("./nat", ctxt, &forwardNatNodes)) < 0)
|
||||
return -1;
|
||||
- } else if (nForwardNats > 1) {
|
||||
+
|
||||
+ if (nForwardNats > 1) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("Only one <nat> element is allowed in <forward> of network %1$s"),
|
||||
networkName);
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index 95de77abe9..dd174d3020 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -960,11 +960,9 @@ virNodeDeviceCapVPDParseCustomFields(xmlXPathContextPtr ctxt, virPCIVPDResource
|
||||
g_autofree xmlNodePtr *nodes = NULL;
|
||||
size_t i = 0;
|
||||
|
||||
- if ((nfields = virXPathNodeSet("./vendor_field[@index]", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("failed to evaluate <vendor_field> elements"));
|
||||
+ if ((nfields = virXPathNodeSet("./vendor_field[@index]", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
for (i = 0; i < nfields; i++) {
|
||||
g_autofree char *value = NULL;
|
||||
g_autofree char *index = NULL;
|
||||
@@ -989,11 +987,9 @@ virNodeDeviceCapVPDParseCustomFields(xmlXPathContextPtr ctxt, virPCIVPDResource
|
||||
VIR_FREE(nodes);
|
||||
|
||||
if (!readOnly) {
|
||||
- if ((nfields = virXPathNodeSet("./system_field[@index]", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("failed to evaluate <system_field> elements"));
|
||||
+ if ((nfields = virXPathNodeSet("./system_field[@index]", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
for (i = 0; i < nfields; i++) {
|
||||
g_autofree char *value = NULL;
|
||||
g_autofree char *index = NULL;
|
||||
@@ -1074,11 +1070,8 @@ virNodeDeviceCapVPDParseXML(xmlXPathContextPtr ctxt, virPCIVPDResource **res)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((nfields = virXPathNodeSet("./fields[@access]", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("no VPD <fields> elements with an access type attribute found"));
|
||||
+ if ((nfields = virXPathNodeSet("./fields[@access]", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < nfields; i++) {
|
||||
g_autofree char *access = NULL;
|
||||
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
|
||||
index bcd7838e00..d8120de6d2 100644
|
||||
--- a/src/conf/numa_conf.c
|
||||
+++ b/src/conf/numa_conf.c
|
||||
@@ -135,11 +135,8 @@ virDomainNumatuneNodeParseXML(virDomainNuma *numa,
|
||||
size_t i = 0;
|
||||
g_autofree xmlNodePtr *nodes = NULL;
|
||||
|
||||
- if ((n = virXPathNodeSet("./numatune/memnode", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("Cannot extract memnode nodes"));
|
||||
+ if ((n = virXPathNodeSet("./numatune/memnode", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (!n)
|
||||
return 0;
|
||||
@@ -700,7 +697,10 @@ virDomainNumaDefNodeDistanceParseXML(virDomainNuma *def,
|
||||
if (!virXPathNode("./distances[1]", ctxt))
|
||||
return 0;
|
||||
|
||||
- if ((sibling = virXPathNodeSet("./distances[1]/sibling", ctxt, &nodes)) <= 0) {
|
||||
+ if ((sibling = virXPathNodeSet("./distances[1]/sibling", ctxt, &nodes)) < 0)
|
||||
+ goto cleanup;
|
||||
+
|
||||
+ if (sibling == 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("NUMA distances defined without siblings"));
|
||||
goto cleanup;
|
||||
@@ -852,7 +852,10 @@ virDomainNumaDefParseXML(virDomainNuma *def,
|
||||
if (!virXPathNode("./cpu/numa[1]", ctxt))
|
||||
return 0;
|
||||
|
||||
- if ((n = virXPathNodeSet("./cpu/numa[1]/cell", ctxt, &cell)) <= 0) {
|
||||
+ if ((n = virXPathNodeSet("./cpu/numa[1]/cell", ctxt, &cell)) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (n == 0) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("NUMA topology defined without NUMA cells"));
|
||||
return -1;
|
||||
diff --git a/src/cpu/cpu_ppc64.c b/src/cpu/cpu_ppc64.c
|
||||
index e13cdbdf6b..448a0a7d85 100644
|
||||
--- a/src/cpu/cpu_ppc64.c
|
||||
+++ b/src/cpu/cpu_ppc64.c
|
||||
@@ -334,7 +334,10 @@ ppc64ModelParse(xmlXPathContextPtr ctxt,
|
||||
}
|
||||
}
|
||||
|
||||
- if ((n = virXPathNodeSet("./pvr", ctxt, &nodes)) <= 0) {
|
||||
+ if ((n = virXPathNodeSet("./pvr", ctxt, &nodes)) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
+ if (n == 0) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Missing PVR information for CPU model %1$s"),
|
||||
model->name);
|
||||
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||
index e13df2b27d..10090e0986 100644
|
||||
--- a/src/qemu/qemu_capabilities.c
|
||||
+++ b/src/qemu/qemu_capabilities.c
|
||||
@@ -4015,11 +4015,8 @@ virQEMUCapsLoadCPUModels(virArch arch,
|
||||
int n;
|
||||
xmlNodePtr node;
|
||||
|
||||
- if ((n = virXPathNodeSet(xpath, ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse qemu capabilities cpus"));
|
||||
+ if ((n = virXPathNodeSet(xpath, ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (n == 0)
|
||||
return 0;
|
||||
@@ -4057,11 +4054,8 @@ virQEMUCapsLoadCPUModels(virArch arch,
|
||||
nblockers = virXPathNodeSet("./blocker", ctxt, &blockerNodes);
|
||||
ctxt->node = node;
|
||||
|
||||
- if (nblockers < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse CPU blockers in QEMU capabilities"));
|
||||
+ if (nblockers < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (nblockers > 0) {
|
||||
size_t j;
|
||||
@@ -4100,11 +4094,8 @@ virQEMUCapsLoadMachines(virQEMUCapsAccel *caps,
|
||||
size_t i;
|
||||
int n;
|
||||
|
||||
- if ((n = virXPathNodeSet(xpath, ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse qemu capabilities machines"));
|
||||
+ if ((n = virXPathNodeSet(xpath, ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (n == 0)
|
||||
return 0;
|
||||
@@ -4317,11 +4308,8 @@ virQEMUCapsParseSGXInfo(virQEMUCaps *qemuCaps,
|
||||
ctxt->node = sgxSections;
|
||||
nSgxSections = virXPathNodeSet("./section", ctxt, §ionNodes);
|
||||
|
||||
- if (nSgxSections < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse SGX sections in QEMU capabilities cache"));
|
||||
+ if (nSgxSections < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
sgx->nSgxSections = nSgxSections;
|
||||
sgx->sgxSections = g_new0(virSGXSection, nSgxSections);
|
||||
@@ -4404,11 +4392,8 @@ virQEMUCapsParseFlags(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
|
||||
size_t i;
|
||||
int n;
|
||||
|
||||
- if ((n = virXPathNodeSet("./flag", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse qemu capabilities flags"));
|
||||
+ if ((n = virXPathNodeSet("./flag", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
VIR_DEBUG("Got flags %d", n);
|
||||
for (i = 0; i < n; i++) {
|
||||
@@ -4442,11 +4427,8 @@ virQEMUCapsParseGIC(virQEMUCaps *qemuCaps, xmlXPathContextPtr ctxt)
|
||||
size_t i;
|
||||
int n;
|
||||
|
||||
- if ((n = virXPathNodeSet("./gic", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse qemu capabilities gic"));
|
||||
+ if ((n = virXPathNodeSet("./gic", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (n > 0) {
|
||||
unsigned int uintValue;
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index e2a1bf2c13..97520bb49c 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -3155,11 +3155,8 @@ qemuDomainObjPrivateXMLParseSlirpFeatures(xmlNodePtr featuresNode,
|
||||
|
||||
ctxt->node = featuresNode;
|
||||
|
||||
- if ((n = virXPathNodeSet("./feature", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("failed to parse slirp-helper features"));
|
||||
+ if ((n = virXPathNodeSet("./feature", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
g_autofree char *str = virXMLPropString(nodes[i], "name");
|
||||
@@ -3273,11 +3270,9 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("failed to parse qemu capabilities flags"));
|
||||
+ if ((n = virXPathNodeSet("./qemuCaps/flag", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (n > 0) {
|
||||
qemuCaps = virQEMUCapsNew();
|
||||
|
||||
@@ -3305,11 +3300,9 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
|
||||
priv->fakeReboot = virXPathBoolean("boolean(./fakereboot)", ctxt) == 1;
|
||||
|
||||
- if ((n = virXPathNodeSet("./devices/device", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse qemu device list"));
|
||||
+ if ((n = virXPathNodeSet("./devices/device", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
if (n > 0) {
|
||||
/* NULL-terminated list */
|
||||
priv->qemuDevices = g_new0(char *, n + 1);
|
||||
@@ -3325,11 +3318,9 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
- if ((n = virXPathNodeSet("./slirp/helper", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse slirp helper list"));
|
||||
+ if ((n = virXPathNodeSet("./slirp/helper", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
+
|
||||
for (i = 0; i < n; i++) {
|
||||
g_autofree char *alias = virXMLPropString(nodes[i], "alias");
|
||||
g_autofree char *pid = virXMLPropString(nodes[i], "pid");
|
||||
diff --git a/src/qemu/qemu_migration_cookie.c b/src/qemu/qemu_migration_cookie.c
|
||||
index 5505fdaf22..4361949cca 100644
|
||||
--- a/src/qemu/qemu_migration_cookie.c
|
||||
+++ b/src/qemu/qemu_migration_cookie.c
|
||||
@@ -947,11 +947,8 @@ qemuMigrationCookieNetworkXMLParse(xmlXPathContextPtr ctxt)
|
||||
g_autofree xmlNodePtr *interfaces = NULL;
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||
|
||||
- if ((n = virXPathNodeSet("./network/interface", ctxt, &interfaces)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "%s", _("missing interface information"));
|
||||
+ if ((n = virXPathNodeSet("./network/interface", ctxt, &interfaces)) < 0)
|
||||
return NULL;
|
||||
- }
|
||||
|
||||
optr->nnets = n;
|
||||
optr->net = g_new0(qemuMigrationCookieNetData, optr->nnets);
|
||||
diff --git a/src/qemu/qemu_nbdkit.c b/src/qemu/qemu_nbdkit.c
|
||||
index 85e61be44c..3343241aaf 100644
|
||||
--- a/src/qemu/qemu_nbdkit.c
|
||||
+++ b/src/qemu/qemu_nbdkit.c
|
||||
@@ -400,11 +400,8 @@ qemuNbdkitCapsParseFlags(qemuNbdkitCaps *nbdkitCaps,
|
||||
size_t i;
|
||||
int n;
|
||||
|
||||
- if ((n = virXPathNodeSet("./flag", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("failed to parse qemu capabilities flags"));
|
||||
+ if ((n = virXPathNodeSet("./flag", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
- }
|
||||
|
||||
VIR_DEBUG("Got flags %d", n);
|
||||
for (i = 0; i < n; i++) {
|
||||
diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
|
||||
index 6a15d60577..ce4586a3f5 100644
|
||||
--- a/src/vz/vz_sdk.c
|
||||
+++ b/src/vz/vz_sdk.c
|
||||
@@ -4612,11 +4612,8 @@ prlsdkParseSnapshotTree(const char *treexml)
|
||||
"ParallelsSavedStates", &ctxt, NULL, false)))
|
||||
goto cleanup;
|
||||
|
||||
- if ((n = virXPathNodeSet("//SavedStateItem", ctxt, &nodes)) < 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- _("cannot extract snapshot nodes"));
|
||||
+ if ((n = virXPathNodeSet("//SavedStateItem", ctxt, &nodes)) < 0)
|
||||
goto cleanup;
|
||||
- }
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
if (nodes[i]->parent == xmlDocGetRootElement(xml))
|
||||
--
|
||||
2.43.0
|
@ -1,44 +0,0 @@
|
||||
From 676946491ea25cacc4f6fd11f27bd9989b84767d Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <676946491ea25cacc4f6fd11f27bd9989b84767d.1708614745.git.jdenemar@redhat.com>
|
||||
From: Laine Stump <laine@redhat.com>
|
||||
Date: Fri, 16 Feb 2024 12:43:59 -0500
|
||||
Subject: [PATCH] Set stubDriverName from hostdev driver model attribute during
|
||||
pci device setup
|
||||
|
||||
commit v9.10.0-129-g8b93d78c83 (first appearing in libvirt-10.0.0) was
|
||||
supposed to allow forcing a PCI hostdev to be bound to a particular
|
||||
driver by adding <driver model='blah'/> to the XML for the
|
||||
device. Unfortunately, a single line was missed during the final
|
||||
changes to the patch prior to pushing, and the result was that the
|
||||
driver model could be set to *anything* and it would be accepted but
|
||||
just ignored.
|
||||
|
||||
This patch adds the missing line, which will set the stubDriverName
|
||||
field of the virPCIDevice object from the hostdev object as the
|
||||
virPCIDevice is being created. This ends up being used by
|
||||
virPCIDeviceBindToStub() as the driver that it binds the device to.
|
||||
|
||||
Fixes: 8b93d78c8325f1fba5db98848350f3db43f5e7d5
|
||||
Signed-off-by: Laine Stump <laine@redhat.com>
|
||||
Reviewed-by: Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 41fe8524870facae02be067097ea494c475d77f0)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-25858 [9.4.0]
|
||||
---
|
||||
src/hypervisor/virhostdev.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/hypervisor/virhostdev.c b/src/hypervisor/virhostdev.c
|
||||
index 40f8a4bc2c..185ec2ca50 100644
|
||||
--- a/src/hypervisor/virhostdev.c
|
||||
+++ b/src/hypervisor/virhostdev.c
|
||||
@@ -242,6 +242,7 @@ virHostdevGetPCIHostDevice(const virDomainHostdevDef *hostdev,
|
||||
return -1;
|
||||
|
||||
virPCIDeviceSetManaged(actual, hostdev->managed);
|
||||
+ virPCIDeviceSetStubDriverName(actual, pcisrc->driver.model);
|
||||
|
||||
if (pcisrc->driver.name == VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_VFIO) {
|
||||
virPCIDeviceSetStubDriverType(actual, VIR_PCI_STUB_DRIVER_VFIO);
|
||||
--
|
||||
2.43.2
|
@ -1,144 +0,0 @@
|
||||
From 5359921ef11b68dab549b6b28ba11a784e6946a5 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <5359921ef11b68dab549b6b28ba11a784e6946a5.1706524416.git.jdenemar@redhat.com>
|
||||
From: Jiri Denemark <jdenemar@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 19:23:54 +0100
|
||||
Subject: [PATCH] build: Make daemons depend on generated *_protocol.[ch]
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This should fix build failures when a daemon code is compiled before the
|
||||
included *_protocol.h headers are ready, such as:
|
||||
|
||||
FAILED: src/virtqemud.p/remote_remote_daemon_config.c.o
|
||||
../src/remote/remote_daemon_config.c: In function ‘daemonConfigNew’:
|
||||
../src/remote/remote_daemon_config.c:111:30: error:
|
||||
‘REMOTE_AUTH_POLKIT’ undeclared (first use in this function)
|
||||
111 | data->auth_unix_rw = REMOTE_AUTH_POLKIT;
|
||||
| ^~~~~~~~~~~~~~~~~~
|
||||
../src/remote/remote_daemon_config.c:111:30: note: each undeclared
|
||||
identifier is reported only once for each function it appears in
|
||||
../src/remote/remote_daemon_config.c:115:30: error:
|
||||
‘REMOTE_AUTH_NONE’ undeclared (first use in this function)
|
||||
115 | data->auth_unix_rw = REMOTE_AUTH_NONE;
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
../src/remote/remote_daemon_config.c: In function
|
||||
‘daemonConfigLoadOptions’:
|
||||
../src/remote/remote_daemon_config.c:252:31: error:
|
||||
‘REMOTE_AUTH_POLKIT’ undeclared (first use in this function)
|
||||
252 | if (data->auth_unix_rw == REMOTE_AUTH_POLKIT) {
|
||||
| ^~~~~~~~~~~~~~~~~~
|
||||
|
||||
or
|
||||
|
||||
FAILED: src/virtqemud.p/remote_remote_daemon_dispatch.c.o
|
||||
In file included from ../src/remote/remote_daemon.h:28,
|
||||
from ../src/remote/remote_daemon_dispatch.c:26:
|
||||
src/remote/lxc_protocol.h:13:5: error:
|
||||
unknown type name ‘remote_nonnull_domain’
|
||||
13 | remote_nonnull_domain dom;
|
||||
| ^~~~~~~~~~~~~~~~~~~~~
|
||||
In file included from ../src/remote/remote_daemon.h:29,
|
||||
from ../src/remote/remote_daemon_dispatch.c:26:
|
||||
src/remote/qemu_protocol.h:13:5: error:
|
||||
unknown type name ‘remote_nonnull_domain’
|
||||
13 | remote_nonnull_domain dom;
|
||||
| ^~~~~~~~~~~~~~~~~~~~~
|
||||
src/remote/qemu_protocol.h:14:5: error:
|
||||
unknown type name ‘remote_nonnull_string’
|
||||
14 | remote_nonnull_string cmd;
|
||||
| ^~~~~~~~~~~~~~~~~~~~~
|
||||
...
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
|
||||
(cherry picked from commit dcfe548cb01d64e2bdeac456c428e578158232b9)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-15267
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
---
|
||||
po/meson.build | 1 +
|
||||
src/meson.build | 6 +++++-
|
||||
src/remote/meson.build | 15 +++++++++++----
|
||||
3 files changed, 17 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/po/meson.build b/po/meson.build
|
||||
index a20877ad34..592b254447 100644
|
||||
--- a/po/meson.build
|
||||
+++ b/po/meson.build
|
||||
@@ -20,6 +20,7 @@ potfiles_dep = [
|
||||
access_gen_sources,
|
||||
admin_client_generated,
|
||||
admin_driver_generated,
|
||||
+ remote_protocol_generated,
|
||||
remote_driver_generated,
|
||||
remote_daemon_generated,
|
||||
]
|
||||
diff --git a/src/meson.build b/src/meson.build
|
||||
index 6538c43628..f52d2d5994 100644
|
||||
--- a/src/meson.build
|
||||
+++ b/src/meson.build
|
||||
@@ -616,7 +616,11 @@ foreach daemon : virt_daemons
|
||||
bin = executable(
|
||||
daemon['name'],
|
||||
[
|
||||
- daemon.get('sources', [ remote_daemon_sources, remote_daemon_generated ]),
|
||||
+ daemon.get('sources', [
|
||||
+ remote_protocol_generated,
|
||||
+ remote_daemon_sources,
|
||||
+ remote_daemon_generated
|
||||
+ ]),
|
||||
dtrace_gen_objects,
|
||||
],
|
||||
c_args: [
|
||||
diff --git a/src/remote/meson.build b/src/remote/meson.build
|
||||
index 16b903fcaf..43bf2d0083 100644
|
||||
--- a/src/remote/meson.build
|
||||
+++ b/src/remote/meson.build
|
||||
@@ -7,8 +7,6 @@ remote_driver_generated = []
|
||||
|
||||
foreach name : [ 'remote', 'qemu', 'lxc' ]
|
||||
client_bodies_h = '@0@_client_bodies.h'.format(name)
|
||||
- protocol_c = '@0@_protocol.c'.format(name)
|
||||
- protocol_h = '@0@_protocol.h'.format(name)
|
||||
protocol_x = '@0@_protocol.x'.format(name)
|
||||
|
||||
remote_driver_generated += custom_target(
|
||||
@@ -20,8 +18,16 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
|
||||
],
|
||||
capture: true,
|
||||
)
|
||||
+endforeach
|
||||
|
||||
- remote_driver_generated += custom_target(
|
||||
+remote_protocol_generated = []
|
||||
+
|
||||
+foreach name : [ 'remote', 'qemu', 'lxc' ]
|
||||
+ protocol_c = '@0@_protocol.c'.format(name)
|
||||
+ protocol_h = '@0@_protocol.h'.format(name)
|
||||
+ protocol_x = '@0@_protocol.x'.format(name)
|
||||
+
|
||||
+ remote_protocol_generated += custom_target(
|
||||
protocol_h,
|
||||
input: protocol_x,
|
||||
output: protocol_h,
|
||||
@@ -32,7 +38,7 @@ foreach name : [ 'remote', 'qemu', 'lxc' ]
|
||||
],
|
||||
)
|
||||
|
||||
- remote_driver_generated += custom_target(
|
||||
+ remote_protocol_generated += custom_target(
|
||||
protocol_c,
|
||||
input: protocol_x,
|
||||
output: protocol_c,
|
||||
@@ -143,6 +149,7 @@ if conf.has('WITH_REMOTE')
|
||||
remote_driver_lib = static_library(
|
||||
'virt_remote_driver',
|
||||
[
|
||||
+ remote_protocol_generated,
|
||||
remote_driver_sources,
|
||||
remote_driver_generated,
|
||||
],
|
||||
--
|
||||
2.43.0
|
@ -1,976 +0,0 @@
|
||||
From 413d6c8c6490caa5ec5479ab10aa493677cc45c0 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <413d6c8c6490caa5ec5479ab10aa493677cc45c0.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Fri, 5 Jan 2024 18:20:14 +0100
|
||||
Subject: [PATCH] conf: Allow specifying CPU clusters
|
||||
|
||||
The default number of CPU clusters is 1, and values other than
|
||||
that one are currently rejected by all hypervisor drivers.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit ef5c397584b1d03a81c74c27074ec4b1a05d3339)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/bhyve/bhyve_command.c | 5 +++++
|
||||
src/conf/cpu_conf.c | 16 +++++++++++++++-
|
||||
src/conf/cpu_conf.h | 1 +
|
||||
src/conf/domain_conf.c | 1 +
|
||||
src/conf/schemas/cputypes.rng | 5 +++++
|
||||
src/cpu/cpu.c | 1 +
|
||||
src/libxl/libxl_capabilities.c | 1 +
|
||||
src/qemu/qemu_command.c | 5 +++++
|
||||
src/vmx/vmx.c | 7 +++++++
|
||||
.../x86_64-host+guest,model486-result.xml | 2 +-
|
||||
.../x86_64-host+guest,models-result.xml | 2 +-
|
||||
tests/cputestdata/x86_64-host+guest-result.xml | 2 +-
|
||||
tests/cputestdata/x86_64-host+guest.xml | 2 +-
|
||||
.../x86_64-host+host-model-nofallback.xml | 2 +-
|
||||
...host-Haswell-noTSX+Haswell,haswell-result.xml | 2 +-
|
||||
...aswell-noTSX+Haswell-noTSX,haswell-result.xml | 2 +-
|
||||
...4-host-Haswell-noTSX+Haswell-noTSX-result.xml | 2 +-
|
||||
.../x86_64-host-worse+guest-result.xml | 2 +-
|
||||
.../ppc64-modern-bulk-result-conf.xml | 2 +-
|
||||
.../ppc64-modern-bulk-result-live.xml | 2 +-
|
||||
.../ppc64-modern-individual-result-conf.xml | 2 +-
|
||||
.../ppc64-modern-individual-result-live.xml | 2 +-
|
||||
.../x86-modern-bulk-result-conf.xml | 2 +-
|
||||
.../x86-modern-bulk-result-live.xml | 2 +-
|
||||
.../x86-modern-individual-add-result-conf.xml | 2 +-
|
||||
.../x86-modern-individual-add-result-live.xml | 2 +-
|
||||
...e-timeout+graphics-spice-timeout-password.xml | 2 +-
|
||||
.../qemuhotplug-graphics-spice-timeout.xml | 2 +-
|
||||
.../fd-memory-no-numa-topology.xml | 2 +-
|
||||
.../qemuxml2argvdata/fd-memory-numa-topology.xml | 2 +-
|
||||
.../fd-memory-numa-topology2.xml | 2 +-
|
||||
.../fd-memory-numa-topology3.xml | 2 +-
|
||||
tests/qemuxml2argvdata/hugepages-nvdimm.xml | 2 +-
|
||||
.../memfd-memory-default-hugepage.xml | 2 +-
|
||||
tests/qemuxml2argvdata/memfd-memory-numa.xml | 2 +-
|
||||
.../memory-hotplug-nvdimm-access.xml | 2 +-
|
||||
.../memory-hotplug-nvdimm-align.xml | 2 +-
|
||||
.../memory-hotplug-nvdimm-label.xml | 2 +-
|
||||
.../memory-hotplug-nvdimm-pmem.xml | 2 +-
|
||||
.../memory-hotplug-nvdimm-readonly.xml | 2 +-
|
||||
tests/qemuxml2argvdata/memory-hotplug-nvdimm.xml | 2 +-
|
||||
.../memory-hotplug-virtio-mem.xml | 2 +-
|
||||
.../memory-hotplug-virtio-pmem.xml | 2 +-
|
||||
.../cpu-numa-disjoint.x86_64-latest.xml | 2 +-
|
||||
.../cpu-numa-disordered.x86_64-latest.xml | 2 +-
|
||||
.../cpu-numa-memshared.x86_64-latest.xml | 2 +-
|
||||
.../cpu-numa-no-memory-element.x86_64-latest.xml | 2 +-
|
||||
.../cpu-numa1.x86_64-latest.xml | 2 +-
|
||||
.../cpu-numa2.x86_64-latest.xml | 2 +-
|
||||
.../memory-hotplug-dimm-addr.x86_64-latest.xml | 2 +-
|
||||
.../memory-hotplug-dimm.x86_64-latest.xml | 2 +-
|
||||
.../memory-hotplug-multiple.x86_64-latest.xml | 2 +-
|
||||
...plug-nvdimm-ppc64-abi-update.ppc64-latest.xml | 2 +-
|
||||
.../memory-hotplug-nvdimm-ppc64.ppc64-latest.xml | 2 +-
|
||||
.../memory-hotplug.x86_64-latest.xml | 2 +-
|
||||
...mad-auto-memory-vcpu-cpuset.x86_64-latest.xml | 2 +-
|
||||
...cpu-no-cpuset-and-placement.x86_64-latest.xml | 2 +-
|
||||
...numad-auto-vcpu-no-numatune.x86_64-latest.xml | 2 +-
|
||||
...mad-static-vcpu-no-numatune.x86_64-latest.xml | 2 +-
|
||||
.../pci-expander-bus.x86_64-latest.xml | 2 +-
|
||||
.../pcie-expander-bus.x86_64-latest.xml | 2 +-
|
||||
.../pseries-phb-numa-node.ppc64-latest.xml | 2 +-
|
||||
tests/vmx2xmldata/esx-in-the-wild-10.xml | 2 +-
|
||||
tests/vmx2xmldata/esx-in-the-wild-8.xml | 2 +-
|
||||
tests/vmx2xmldata/esx-in-the-wild-9.xml | 2 +-
|
||||
65 files changed, 97 insertions(+), 57 deletions(-)
|
||||
|
||||
diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c
|
||||
index 5b388c7a8f..d05b01ae5d 100644
|
||||
--- a/src/bhyve/bhyve_command.c
|
||||
+++ b/src/bhyve/bhyve_command.c
|
||||
@@ -672,6 +672,11 @@ virBhyveProcessBuildBhyveCmd(struct _bhyveConn *driver, virDomainDef *def,
|
||||
_("Only 1 die per socket is supported"));
|
||||
return NULL;
|
||||
}
|
||||
+ if (def->cpu->clusters != 1) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
+ _("Only 1 cluster per die is supported"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
if (nvcpus != def->cpu->sockets * def->cpu->cores * def->cpu->threads) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Invalid CPU topology: total number of vCPUs must equal the product of sockets, cores, and threads"));
|
||||
diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c
|
||||
index 7abe489733..6e6e1b9a89 100644
|
||||
--- a/src/conf/cpu_conf.c
|
||||
+++ b/src/conf/cpu_conf.c
|
||||
@@ -241,6 +241,7 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu)
|
||||
copy->fallback = cpu->fallback;
|
||||
copy->sockets = cpu->sockets;
|
||||
copy->dies = cpu->dies;
|
||||
+ copy->clusters = cpu->clusters;
|
||||
copy->cores = cpu->cores;
|
||||
copy->threads = cpu->threads;
|
||||
copy->arch = cpu->arch;
|
||||
@@ -572,6 +573,12 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt,
|
||||
return -1;
|
||||
}
|
||||
|
||||
+ if (virXMLPropUIntDefault(topology, "clusters", 10,
|
||||
+ VIR_XML_PROP_NONZERO,
|
||||
+ &def->clusters, 1) < 0) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
if (virXMLPropUInt(topology, "cores", 10,
|
||||
VIR_XML_PROP_REQUIRED | VIR_XML_PROP_NONZERO,
|
||||
&def->cores) < 0) {
|
||||
@@ -827,10 +834,11 @@ virCPUDefFormatBuf(virBuffer *buf,
|
||||
virBufferAddLit(buf, "/>\n");
|
||||
}
|
||||
|
||||
- if (def->sockets && def->dies && def->cores && def->threads) {
|
||||
+ if (def->sockets && def->dies && def->clusters && def->cores && def->threads) {
|
||||
virBufferAddLit(buf, "<topology");
|
||||
virBufferAsprintf(buf, " sockets='%u'", def->sockets);
|
||||
virBufferAsprintf(buf, " dies='%u'", def->dies);
|
||||
+ virBufferAsprintf(buf, " clusters='%u'", def->clusters);
|
||||
virBufferAsprintf(buf, " cores='%u'", def->cores);
|
||||
virBufferAsprintf(buf, " threads='%u'", def->threads);
|
||||
virBufferAddLit(buf, "/>\n");
|
||||
@@ -1106,6 +1114,12 @@ virCPUDefIsEqual(virCPUDef *src,
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (src->clusters != dst->clusters) {
|
||||
+ MISMATCH(_("Target CPU clusters %1$d does not match source %2$d"),
|
||||
+ dst->clusters, src->clusters);
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
if (src->cores != dst->cores) {
|
||||
MISMATCH(_("Target CPU cores %1$d does not match source %2$d"),
|
||||
dst->cores, src->cores);
|
||||
diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h
|
||||
index 3e4c53675c..2694022fed 100644
|
||||
--- a/src/conf/cpu_conf.h
|
||||
+++ b/src/conf/cpu_conf.h
|
||||
@@ -148,6 +148,7 @@ struct _virCPUDef {
|
||||
unsigned int microcodeVersion;
|
||||
unsigned int sockets;
|
||||
unsigned int dies;
|
||||
+ unsigned int clusters;
|
||||
unsigned int cores;
|
||||
unsigned int threads;
|
||||
unsigned int sigFamily;
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index 5d55d2acda..6211d2a51b 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -2316,6 +2316,7 @@ virDomainDefGetVcpusTopology(const virDomainDef *def,
|
||||
|
||||
/* multiplication of 32bit numbers fits into a 64bit variable */
|
||||
if ((tmp *= def->cpu->dies) > UINT_MAX ||
|
||||
+ (tmp *= def->cpu->clusters) > UINT_MAX ||
|
||||
(tmp *= def->cpu->cores) > UINT_MAX ||
|
||||
(tmp *= def->cpu->threads) > UINT_MAX) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
diff --git a/src/conf/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng
|
||||
index db1aa57158..3a8910e09f 100644
|
||||
--- a/src/conf/schemas/cputypes.rng
|
||||
+++ b/src/conf/schemas/cputypes.rng
|
||||
@@ -92,6 +92,11 @@
|
||||
<ref name="positiveInteger"/>
|
||||
</attribute>
|
||||
</optional>
|
||||
+ <optional>
|
||||
+ <attribute name="clusters">
|
||||
+ <ref name="positiveInteger"/>
|
||||
+ </attribute>
|
||||
+ </optional>
|
||||
<attribute name="cores">
|
||||
<ref name="positiveInteger"/>
|
||||
</attribute>
|
||||
diff --git a/src/cpu/cpu.c b/src/cpu/cpu.c
|
||||
index bc43aa4e93..4f048d0dad 100644
|
||||
--- a/src/cpu/cpu.c
|
||||
+++ b/src/cpu/cpu.c
|
||||
@@ -435,6 +435,7 @@ virCPUGetHost(virArch arch,
|
||||
if (nodeInfo) {
|
||||
cpu->sockets = nodeInfo->sockets;
|
||||
cpu->dies = 1;
|
||||
+ cpu->clusters = 1;
|
||||
cpu->cores = nodeInfo->cores;
|
||||
cpu->threads = nodeInfo->threads;
|
||||
}
|
||||
diff --git a/src/libxl/libxl_capabilities.c b/src/libxl/libxl_capabilities.c
|
||||
index dfb602ca2f..522256777d 100644
|
||||
--- a/src/libxl/libxl_capabilities.c
|
||||
+++ b/src/libxl/libxl_capabilities.c
|
||||
@@ -152,6 +152,7 @@ libxlCapsInitCPU(virCaps *caps, libxl_physinfo *phy_info)
|
||||
cpu->cores = phy_info->cores_per_socket;
|
||||
cpu->threads = phy_info->threads_per_core;
|
||||
cpu->dies = 1;
|
||||
+ cpu->clusters = 1;
|
||||
cpu->sockets = phy_info->nr_cpus / (cpu->cores * cpu->threads);
|
||||
|
||||
if (!(data = libxlCapsNodeData(cpu, phy_info->hw_cap)) ||
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||
index 653817173b..71daa85e55 100644
|
||||
--- a/src/qemu/qemu_command.c
|
||||
+++ b/src/qemu/qemu_command.c
|
||||
@@ -7226,6 +7226,11 @@ qemuBuildSmpCommandLine(virCommand *cmd,
|
||||
_("Only 1 die per socket is supported"));
|
||||
return -1;
|
||||
}
|
||||
+ if (def->cpu->clusters != 1) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
+ _("Only 1 cluster per die is supported"));
|
||||
+ return -1;
|
||||
+ }
|
||||
virBufferAsprintf(&buf, ",sockets=%u", def->cpu->sockets);
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMP_DIES))
|
||||
virBufferAsprintf(&buf, ",dies=%u", def->cpu->dies);
|
||||
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
|
||||
index 26b89776e1..4ac2320251 100644
|
||||
--- a/src/vmx/vmx.c
|
||||
+++ b/src/vmx/vmx.c
|
||||
@@ -1583,6 +1583,7 @@ virVMXParseConfig(virVMXContext *ctx,
|
||||
goto cleanup;
|
||||
}
|
||||
cpu->dies = 1;
|
||||
+ cpu->clusters = 1;
|
||||
cpu->cores = coresPerSocket;
|
||||
cpu->threads = 1;
|
||||
|
||||
@@ -3377,6 +3378,12 @@ virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOption *xmlopt, virDomainDef
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ if (def->cpu->clusters != 1) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
+ _("Only 1 cluster per die is supported"));
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
+
|
||||
calculated_vcpus = def->cpu->sockets * def->cpu->cores;
|
||||
if (calculated_vcpus != maxvcpus) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
diff --git a/tests/cputestdata/x86_64-host+guest,model486-result.xml b/tests/cputestdata/x86_64-host+guest,model486-result.xml
|
||||
index ea8e2d3a48..b533f22b88 100644
|
||||
--- a/tests/cputestdata/x86_64-host+guest,model486-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host+guest,model486-result.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>486</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='1'/>
|
||||
<feature policy='require' name='de'/>
|
||||
<feature policy='require' name='tsc'/>
|
||||
<feature policy='require' name='msr'/>
|
||||
diff --git a/tests/cputestdata/x86_64-host+guest,models-result.xml b/tests/cputestdata/x86_64-host+guest,models-result.xml
|
||||
index 42664a48b4..e975d9bc18 100644
|
||||
--- a/tests/cputestdata/x86_64-host+guest,models-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host+guest,models-result.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='1'/>
|
||||
<feature policy='force' name='pbe'/>
|
||||
<feature policy='force' name='monitor'/>
|
||||
<feature policy='require' name='ssse3'/>
|
||||
diff --git a/tests/cputestdata/x86_64-host+guest-result.xml b/tests/cputestdata/x86_64-host+guest-result.xml
|
||||
index 28e3152cbf..cf41b3f872 100644
|
||||
--- a/tests/cputestdata/x86_64-host+guest-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host+guest-result.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Penryn</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='1'/>
|
||||
<feature policy='require' name='dca'/>
|
||||
<feature policy='require' name='xtpr'/>
|
||||
<feature policy='disable' name='sse4.2'/>
|
||||
diff --git a/tests/cputestdata/x86_64-host+guest.xml b/tests/cputestdata/x86_64-host+guest.xml
|
||||
index 28e3152cbf..cf41b3f872 100644
|
||||
--- a/tests/cputestdata/x86_64-host+guest.xml
|
||||
+++ b/tests/cputestdata/x86_64-host+guest.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Penryn</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='1'/>
|
||||
<feature policy='require' name='dca'/>
|
||||
<feature policy='require' name='xtpr'/>
|
||||
<feature policy='disable' name='sse4.2'/>
|
||||
diff --git a/tests/cputestdata/x86_64-host+host-model-nofallback.xml b/tests/cputestdata/x86_64-host+host-model-nofallback.xml
|
||||
index 16d6e1daf2..881eea7bd0 100644
|
||||
--- a/tests/cputestdata/x86_64-host+host-model-nofallback.xml
|
||||
+++ b/tests/cputestdata/x86_64-host+host-model-nofallback.xml
|
||||
@@ -1,7 +1,7 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='forbid'>Penryn</model>
|
||||
<vendor>Intel</vendor>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
<feature policy='require' name='dca'/>
|
||||
<feature policy='require' name='xtpr'/>
|
||||
<feature policy='require' name='tm2'/>
|
||||
diff --git a/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell,haswell-result.xml b/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell,haswell-result.xml
|
||||
index 8eda6684a0..67994c62cc 100644
|
||||
--- a/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell,haswell-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell,haswell-result.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Haswell</model>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='2'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='2'/>
|
||||
<feature policy='disable' name='rtm'/>
|
||||
<feature policy='disable' name='hle'/>
|
||||
</cpu>
|
||||
diff --git a/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX,haswell-result.xml b/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX,haswell-result.xml
|
||||
index cb02449d60..4804c0b818 100644
|
||||
--- a/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX,haswell-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX,haswell-result.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Haswell</model>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='2'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='2'/>
|
||||
<feature policy='disable' name='hle'/>
|
||||
<feature policy='disable' name='rtm'/>
|
||||
</cpu>
|
||||
diff --git a/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX-result.xml b/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX-result.xml
|
||||
index 7ee926aba8..c21b331248 100644
|
||||
--- a/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host-Haswell-noTSX+Haswell-noTSX-result.xml
|
||||
@@ -1,4 +1,4 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Haswell-noTSX</model>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='2'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='2'/>
|
||||
</cpu>
|
||||
diff --git a/tests/cputestdata/x86_64-host-worse+guest-result.xml b/tests/cputestdata/x86_64-host-worse+guest-result.xml
|
||||
index 9d54c66a8f..712c3ad341 100644
|
||||
--- a/tests/cputestdata/x86_64-host-worse+guest-result.xml
|
||||
+++ b/tests/cputestdata/x86_64-host-worse+guest-result.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<cpu mode='custom' match='exact'>
|
||||
<model fallback='allow'>Penryn</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='1'/>
|
||||
<feature policy='disable' name='dca'/>
|
||||
<feature policy='disable' name='xtpr'/>
|
||||
<feature policy='disable' name='sse4.2'/>
|
||||
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml
|
||||
index ad11b2f8a6..1a0d28257e 100644
|
||||
--- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-conf.xml
|
||||
@@ -44,7 +44,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='1' dies='1' cores='4' threads='8'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml
|
||||
index 2a3b4a495f..b127883b36 100644
|
||||
--- a/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/ppc64-modern-bulk-result-live.xml
|
||||
@@ -44,7 +44,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='1' dies='1' cores='4' threads='8'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml
|
||||
index 34aec9b965..29f1a5ac45 100644
|
||||
--- a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-conf.xml
|
||||
@@ -44,7 +44,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='1' dies='1' cores='4' threads='8'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml
|
||||
index 5ce2cfd0b0..76a85ac9f0 100644
|
||||
--- a/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/ppc64-modern-individual-result-live.xml
|
||||
@@ -44,7 +44,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='1' dies='1' cores='4' threads='8'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='4' threads='8'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml
|
||||
index 8d52ffedb4..bec46987ff 100644
|
||||
--- a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-conf.xml
|
||||
@@ -20,7 +20,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='4' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml
|
||||
index f416397e33..be9769c686 100644
|
||||
--- a/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/x86-modern-bulk-result-live.xml
|
||||
@@ -20,7 +20,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='4' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml
|
||||
index 0bd2af8e43..539f607818 100644
|
||||
--- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-conf.xml
|
||||
@@ -20,7 +20,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='4' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml
|
||||
index b31e6ebe55..acbdd3cfd5 100644
|
||||
--- a/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml
|
||||
+++ b/tests/qemuhotplugtestcpus/x86-modern-individual-add-result-live.xml
|
||||
@@ -20,7 +20,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='4' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout+graphics-spice-timeout-password.xml b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout+graphics-spice-timeout-password.xml
|
||||
index 03964ad01c..ee53339338 100644
|
||||
--- a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout+graphics-spice-timeout-password.xml
|
||||
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout+graphics-spice-timeout-password.xml
|
||||
@@ -18,7 +18,7 @@
|
||||
<cpu mode='custom' match='exact' check='partial'>
|
||||
<model fallback='allow'>core2duo</model>
|
||||
<vendor>Intel</vendor>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
<feature policy='require' name='lahf_lm'/>
|
||||
<feature policy='require' name='xtpr'/>
|
||||
<feature policy='require' name='cx16'/>
|
||||
diff --git a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml
|
||||
index e6b0cc833a..eb9b902fc5 100644
|
||||
--- a/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml
|
||||
+++ b/tests/qemuhotplugtestdomains/qemuhotplug-graphics-spice-timeout.xml
|
||||
@@ -18,7 +18,7 @@
|
||||
<cpu mode='custom' match='exact' check='partial'>
|
||||
<model fallback='allow'>core2duo</model>
|
||||
<vendor>Intel</vendor>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
<feature policy='require' name='lahf_lm'/>
|
||||
<feature policy='require' name='xtpr'/>
|
||||
<feature policy='require' name='cx16'/>
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml
|
||||
index 2090bb8288..92f418fb88 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='8' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='8' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology.xml b/tests/qemuxml2argvdata/fd-memory-numa-topology.xml
|
||||
index 2f94690656..543509d832 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-numa-topology.xml
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-numa-topology.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='1' dies='1' cores='8' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='8' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='14680064' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml b/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml
|
||||
index 3a4e9b478e..d3b98da3c6 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-numa-topology2.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='1' dies='1' cores='20' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='20' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7,16-19' memory='14680064' unit='KiB'/>
|
||||
<cell id='1' cpus='8-15' memory='14680064' unit='KiB' memAccess='shared'/>
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml b/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml
|
||||
index 0f7f74283b..459d1b9d1d 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-numa-topology3.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='1' dies='1' cores='32' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='32' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1,6-31' memory='14680064' unit='KiB'/>
|
||||
<cell id='1' cpus='2-3' memory='14680064' unit='KiB' memAccess='shared'/>
|
||||
diff --git a/tests/qemuxml2argvdata/hugepages-nvdimm.xml b/tests/qemuxml2argvdata/hugepages-nvdimm.xml
|
||||
index 1a1500895b..b786b0d3dd 100644
|
||||
--- a/tests/qemuxml2argvdata/hugepages-nvdimm.xml
|
||||
+++ b/tests/qemuxml2argvdata/hugepages-nvdimm.xml
|
||||
@@ -17,7 +17,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
|
||||
index 238d4c6b52..a70bd53134 100644
|
||||
--- a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
|
||||
+++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.xml
|
||||
@@ -19,7 +19,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='1' dies='1' cores='8' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='8' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='14680064' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.xml b/tests/qemuxml2argvdata/memfd-memory-numa.xml
|
||||
index 1ac87e3aef..0c5d7ba4ef 100644
|
||||
--- a/tests/qemuxml2argvdata/memfd-memory-numa.xml
|
||||
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.xml
|
||||
@@ -22,7 +22,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='1' dies='1' cores='8' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='8' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='14680064' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.xml
|
||||
index bee0346aca..84baf82bf5 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
|
||||
index decf87db63..664418e805 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.xml
|
||||
index 8a0dab3908..f998f7f276 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
|
||||
index a712adfe1e..d66481fd35 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.xml
|
||||
index 57629ccb8c..56d6b7b712 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.xml b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.xml
|
||||
index 865ddcf0ea..ff6e3b7b0f 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
index c578209d8a..52fa6b14e9 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.xml b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.xml
|
||||
index a8b22dd3c5..2786a739ad 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-numa-disjoint.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-numa-disjoint.x86_64-latest.xml
|
||||
index fa2ec31463..4f33094949 100644
|
||||
--- a/tests/qemuxml2xmloutdata/cpu-numa-disjoint.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-numa-disjoint.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-3,8-11' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='4-7,12-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-numa-disordered.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-numa-disordered.x86_64-latest.xml
|
||||
index 1b4d0bfa67..75dcb8c9e2 100644
|
||||
--- a/tests/qemuxml2xmloutdata/cpu-numa-disordered.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-numa-disordered.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-5' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='11-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-numa-memshared.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-numa-memshared.x86_64-latest.xml
|
||||
index 47ed9efd69..c45e295921 100644
|
||||
--- a/tests/qemuxml2xmloutdata/cpu-numa-memshared.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-numa-memshared.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='109550' unit='KiB' memAccess='shared'/>
|
||||
<cell id='1' cpus='8-15' memory='109550' unit='KiB' memAccess='private'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-numa-no-memory-element.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-numa-no-memory-element.x86_64-latest.xml
|
||||
index 57bbacdff0..663d137ff5 100644
|
||||
--- a/tests/qemuxml2xmloutdata/cpu-numa-no-memory-element.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-numa-no-memory-element.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='8-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-numa1.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-numa1.x86_64-latest.xml
|
||||
index 57bbacdff0..663d137ff5 100644
|
||||
--- a/tests/qemuxml2xmloutdata/cpu-numa1.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-numa1.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='8-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-numa2.x86_64-latest.xml b/tests/qemuxml2xmloutdata/cpu-numa2.x86_64-latest.xml
|
||||
index 57bbacdff0..663d137ff5 100644
|
||||
--- a/tests/qemuxml2xmloutdata/cpu-numa2.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-numa2.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='8-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml b/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml
|
||||
index 0a32d5491a..38b41e6719 100644
|
||||
--- a/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-dimm-addr.x86_64-latest.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-dimm.x86_64-latest.xml b/tests/qemuxml2xmloutdata/memory-hotplug-dimm.x86_64-latest.xml
|
||||
index 7c1b7b2c5d..7f0dc85c0e 100644
|
||||
--- a/tests/qemuxml2xmloutdata/memory-hotplug-dimm.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-dimm.x86_64-latest.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
</idmap>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-multiple.x86_64-latest.xml b/tests/qemuxml2xmloutdata/memory-hotplug-multiple.x86_64-latest.xml
|
||||
index 42b0f7b880..b3306fb569 100644
|
||||
--- a/tests/qemuxml2xmloutdata/memory-hotplug-multiple.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-multiple.x86_64-latest.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='2095104' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml
|
||||
index ae157c4849..4cc0c674df 100644
|
||||
--- a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.xml b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.xml
|
||||
index 3c1cbc731d..a5c26e3c5b 100644
|
||||
--- a/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/memory-hotplug.x86_64-latest.xml b/tests/qemuxml2xmloutdata/memory-hotplug.x86_64-latest.xml
|
||||
index 083102e8d6..697819387f 100644
|
||||
--- a/tests/qemuxml2xmloutdata/memory-hotplug.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/memory-hotplug.x86_64-latest.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-1' memory='219136' unit='KiB'/>
|
||||
</numa>
|
||||
diff --git a/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.xml b/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.xml
|
||||
index 2d04bc23c2..6068a76464 100644
|
||||
--- a/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.xml
|
||||
@@ -13,7 +13,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.xml b/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.xml
|
||||
index 80f7284126..6c558526e9 100644
|
||||
--- a/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.xml
|
||||
@@ -13,7 +13,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuxml2xmloutdata/numad-auto-vcpu-no-numatune.x86_64-latest.xml b/tests/qemuxml2xmloutdata/numad-auto-vcpu-no-numatune.x86_64-latest.xml
|
||||
index 724209f6e3..6e1fecb488 100644
|
||||
--- a/tests/qemuxml2xmloutdata/numad-auto-vcpu-no-numatune.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/numad-auto-vcpu-no-numatune.x86_64-latest.xml
|
||||
@@ -13,7 +13,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuxml2xmloutdata/numad-static-vcpu-no-numatune.x86_64-latest.xml b/tests/qemuxml2xmloutdata/numad-static-vcpu-no-numatune.x86_64-latest.xml
|
||||
index 2a4ee0d496..c42d7066f9 100644
|
||||
--- a/tests/qemuxml2xmloutdata/numad-static-vcpu-no-numatune.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/numad-static-vcpu-no-numatune.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='1'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/qemuxml2xmloutdata/pci-expander-bus.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pci-expander-bus.x86_64-latest.xml
|
||||
index b63c8c145a..2a6c329a40 100644
|
||||
--- a/tests/qemuxml2xmloutdata/pci-expander-bus.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/pci-expander-bus.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='8-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml b/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml
|
||||
index a441be8ebe..99612740b2 100644
|
||||
--- a/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/pcie-expander-bus.x86_64-latest.xml
|
||||
@@ -10,7 +10,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>qemu64</model>
|
||||
- <topology sockets='2' dies='1' cores='4' threads='2'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='4' threads='2'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-7' memory='109550' unit='KiB'/>
|
||||
<cell id='1' cpus='8-15' memory='109550' unit='KiB'/>
|
||||
diff --git a/tests/qemuxml2xmloutdata/pseries-phb-numa-node.ppc64-latest.xml b/tests/qemuxml2xmloutdata/pseries-phb-numa-node.ppc64-latest.xml
|
||||
index 59015846fb..0a044f50b0 100644
|
||||
--- a/tests/qemuxml2xmloutdata/pseries-phb-numa-node.ppc64-latest.xml
|
||||
+++ b/tests/qemuxml2xmloutdata/pseries-phb-numa-node.ppc64-latest.xml
|
||||
@@ -14,7 +14,7 @@
|
||||
</os>
|
||||
<cpu mode='custom' match='exact' check='none'>
|
||||
<model fallback='forbid'>POWER9</model>
|
||||
- <topology sockets='2' dies='1' cores='1' threads='4'/>
|
||||
+ <topology sockets='2' dies='1' clusters='1' cores='1' threads='4'/>
|
||||
<numa>
|
||||
<cell id='0' cpus='0-3' memory='1048576' unit='KiB'/>
|
||||
<cell id='1' cpus='4-7' memory='1048576' unit='KiB'/>
|
||||
diff --git a/tests/vmx2xmldata/esx-in-the-wild-10.xml b/tests/vmx2xmldata/esx-in-the-wild-10.xml
|
||||
index 47ed637920..78129682bd 100644
|
||||
--- a/tests/vmx2xmldata/esx-in-the-wild-10.xml
|
||||
+++ b/tests/vmx2xmldata/esx-in-the-wild-10.xml
|
||||
@@ -12,7 +12,7 @@
|
||||
<type arch='x86_64'>hvm</type>
|
||||
</os>
|
||||
<cpu>
|
||||
- <topology sockets='1' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='1' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/vmx2xmldata/esx-in-the-wild-8.xml b/tests/vmx2xmldata/esx-in-the-wild-8.xml
|
||||
index 0eea610709..47d22ced2a 100644
|
||||
--- a/tests/vmx2xmldata/esx-in-the-wild-8.xml
|
||||
+++ b/tests/vmx2xmldata/esx-in-the-wild-8.xml
|
||||
@@ -11,7 +11,7 @@
|
||||
<type arch='x86_64'>hvm</type>
|
||||
</os>
|
||||
<cpu>
|
||||
- <topology sockets='4' dies='1' cores='2' threads='1'/>
|
||||
+ <topology sockets='4' dies='1' clusters='1' cores='2' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
diff --git a/tests/vmx2xmldata/esx-in-the-wild-9.xml b/tests/vmx2xmldata/esx-in-the-wild-9.xml
|
||||
index 66eca400dd..ee6be2527f 100644
|
||||
--- a/tests/vmx2xmldata/esx-in-the-wild-9.xml
|
||||
+++ b/tests/vmx2xmldata/esx-in-the-wild-9.xml
|
||||
@@ -12,7 +12,7 @@
|
||||
<type arch='x86_64'>hvm</type>
|
||||
</os>
|
||||
<cpu>
|
||||
- <topology sockets='4' dies='1' cores='4' threads='1'/>
|
||||
+ <topology sockets='4' dies='1' clusters='1' cores='4' threads='1'/>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
--
|
||||
2.43.0
|
@ -1,152 +0,0 @@
|
||||
From de94232ffb9eef84bb72631979f59bbadfc3cb9e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <de94232ffb9eef84bb72631979f59bbadfc3cb9e.1707394626.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Thu, 4 Jan 2024 10:03:36 +0100
|
||||
Subject: [PATCH] conf: Introduce dynamicMemslots attribute for virtio-mem
|
||||
|
||||
Introduced in v8.2.0-rc0~74^2~2, QEMU now allows setting
|
||||
.dynamic-memslots attribute for virtio-mem-pci devices. When
|
||||
turned on, it allows memory exposed to guest to be split into
|
||||
multiple memslots and thus smaller memory footprint (see the
|
||||
original commit for detailed explanation).
|
||||
|
||||
Therefore, introduce new <target/> attribute which will control
|
||||
that QEMU knob.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 53258205854e649bc82310542373df004a4734ab)
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-15316
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
docs/formatdomain.rst | 13 +++++++++++++
|
||||
src/conf/domain_conf.c | 18 +++++++++++++++++-
|
||||
src/conf/domain_conf.h | 1 +
|
||||
src/conf/schemas/domaincommon.rng | 5 +++++
|
||||
.../memory-hotplug-virtio-mem.xml | 2 +-
|
||||
5 files changed, 37 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
|
||||
index 298ad46a45..34b2564909 100644
|
||||
--- a/docs/formatdomain.rst
|
||||
+++ b/docs/formatdomain.rst
|
||||
@@ -8437,6 +8437,19 @@ Example: usage of the memory devices
|
||||
The ``node`` subelement configures the guest NUMA node to attach the memory
|
||||
to. The element shall be used only if the guest has NUMA nodes configured.
|
||||
|
||||
+ For ``virtio-mem`` optional attribute ``dynamicMemslots`` can be specified
|
||||
+ (accepted values "yes"/"no") which allows hypervisor to spread memory into
|
||||
+ multiple memory slots (allocate them dynamically based on the amount of
|
||||
+ memory exposed to the guest), resulting in smaller memory footprint. But be
|
||||
+ aware this may affect vhost-user devices. When enabled, older vhost-user
|
||||
+ device implementations (such as virtiofs) may refuse to initialize resulting
|
||||
+ in failed domain startup or device hotplug. When only modern vhost-user
|
||||
+ based devices will be used or when no vhost-user devices are expected to be
|
||||
+ used it's beneficial to enable this feature. The current default is
|
||||
+ hypervisor dependant (for QEMU is "no"). If the default changes and you are
|
||||
+ having difficulties with vhost-user devices, try toggling this to "no".
|
||||
+ :since:`Since 10.1.0 and QEMU 8.2.0`
|
||||
+
|
||||
The following optional elements may be used:
|
||||
|
||||
``label``
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index 6211d2a51b..ac06fa39f6 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -13543,6 +13543,10 @@ virDomainMemoryTargetDefParseXML(xmlNodePtr node,
|
||||
&def->target.virtio_mem.requestedsize, false, false) < 0)
|
||||
return -1;
|
||||
|
||||
+ if (virXMLPropTristateBool(node, "dynamicMemslots", VIR_XML_PROP_NONE,
|
||||
+ &def->target.virtio_mem.dynamicMemslots) < 0)
|
||||
+ return -1;
|
||||
+
|
||||
addrNode = virXPathNode("./address", ctxt);
|
||||
addr = &def->target.virtio_mem.address;
|
||||
break;
|
||||
@@ -21217,6 +21221,12 @@ virDomainMemoryDefCheckABIStability(virDomainMemoryDef *src,
|
||||
src->target.virtio_mem.address);
|
||||
return false;
|
||||
}
|
||||
+
|
||||
+ if (src->target.virtio_mem.dynamicMemslots != dst->target.virtio_mem.dynamicMemslots) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
+ _("Target memory device 'dynamicMemslots' property doesn't match source memory device"));
|
||||
+ return false;
|
||||
+ }
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_MEMORY_MODEL_DIMM:
|
||||
@@ -25432,6 +25442,7 @@ virDomainMemoryTargetDefFormat(virBuffer *buf,
|
||||
unsigned int flags)
|
||||
{
|
||||
g_auto(virBuffer) childBuf = VIR_BUFFER_INIT_CHILD(buf);
|
||||
+ g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||
|
||||
virBufferAsprintf(&childBuf, "<size unit='KiB'>%llu</size>\n", def->size);
|
||||
if (def->targetNode >= 0)
|
||||
@@ -25471,6 +25482,11 @@ virDomainMemoryTargetDefFormat(virBuffer *buf,
|
||||
if (def->target.virtio_mem.address)
|
||||
virBufferAsprintf(&childBuf, "<address base='0x%llx'/>\n",
|
||||
def->target.virtio_mem.address);
|
||||
+
|
||||
+ if (def->target.virtio_mem.dynamicMemslots) {
|
||||
+ virBufferAsprintf(&attrBuf, " dynamicMemslots='%s'",
|
||||
+ virTristateBoolTypeToString(def->target.virtio_mem.dynamicMemslots));
|
||||
+ }
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
|
||||
@@ -25480,7 +25496,7 @@ virDomainMemoryTargetDefFormat(virBuffer *buf,
|
||||
break;
|
||||
}
|
||||
|
||||
- virXMLFormatElement(buf, "target", NULL, &childBuf);
|
||||
+ virXMLFormatElement(buf, "target", &attrBuf, &childBuf);
|
||||
}
|
||||
|
||||
static int
|
||||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
||||
index d176bda5f8..bd283d42df 100644
|
||||
--- a/src/conf/domain_conf.h
|
||||
+++ b/src/conf/domain_conf.h
|
||||
@@ -2676,6 +2676,7 @@ struct _virDomainMemoryDef {
|
||||
unsigned long long currentsize; /* kibibytes, valid for an active
|
||||
domain only and parsed */
|
||||
unsigned long long address; /* address where memory is mapped */
|
||||
+ virTristateBool dynamicMemslots;
|
||||
} virtio_mem;
|
||||
struct {
|
||||
} sgx_epc;
|
||||
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
|
||||
index a34427c330..df44cd9857 100644
|
||||
--- a/src/conf/schemas/domaincommon.rng
|
||||
+++ b/src/conf/schemas/domaincommon.rng
|
||||
@@ -7268,6 +7268,11 @@
|
||||
|
||||
<define name="memorydev-target">
|
||||
<element name="target">
|
||||
+ <optional>
|
||||
+ <attribute name="dynamicMemslots">
|
||||
+ <ref name="virYesNo"/>
|
||||
+ </attribute>
|
||||
+ </optional>
|
||||
<interleave>
|
||||
<element name="size">
|
||||
<ref name="scaledInteger"/>
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
index 52fa6b14e9..20282a131b 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.xml
|
||||
@@ -60,7 +60,7 @@
|
||||
<nodemask>1-3</nodemask>
|
||||
<pagesize unit='KiB'>2048</pagesize>
|
||||
</source>
|
||||
- <target>
|
||||
+ <target dynamicMemslots='yes'>
|
||||
<size unit='KiB'>2097152</size>
|
||||
<node>0</node>
|
||||
<block unit='KiB'>2048</block>
|
||||
--
|
||||
2.43.0
|
@ -1,684 +0,0 @@
|
||||
From 130768f856aef1a4fa09a4654fd5ddcaad985795 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <130768f856aef1a4fa09a4654fd5ddcaad985795.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Fri, 5 Jan 2024 16:03:54 +0100
|
||||
Subject: [PATCH] conf: Report CPU clusters in capabilities XML
|
||||
|
||||
For machines that don't expose useful information through sysfs,
|
||||
the dummy ID 0 is used.
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 5fc56aefb67a085a2f0fd3d2a157c7c029d2ef60)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/conf/capabilities.c | 5 +-
|
||||
src/conf/capabilities.h | 1 +
|
||||
src/conf/schemas/capability.rng | 3 ++
|
||||
src/libvirt_linux.syms | 1 +
|
||||
src/util/virhostcpu.c | 22 +++++++++
|
||||
src/util/virhostcpu.h | 1 +
|
||||
tests/capabilityschemadata/caps-qemu-kvm.xml | 32 ++++++-------
|
||||
.../vircaps-aarch64-basic-clusters.xml | 16 +++----
|
||||
.../vircaps2xmldata/vircaps-aarch64-basic.xml | 32 ++++++-------
|
||||
.../vircaps-x86_64-basic-dies.xml | 24 +++++-----
|
||||
.../vircaps2xmldata/vircaps-x86_64-basic.xml | 32 ++++++-------
|
||||
.../vircaps2xmldata/vircaps-x86_64-caches.xml | 16 +++----
|
||||
tests/vircaps2xmldata/vircaps-x86_64-hmat.xml | 48 +++++++++----------
|
||||
.../vircaps-x86_64-resctrl-cdp.xml | 24 +++++-----
|
||||
.../vircaps-x86_64-resctrl-cmt.xml | 24 +++++-----
|
||||
.../vircaps-x86_64-resctrl-fake-feature.xml | 24 +++++-----
|
||||
.../vircaps-x86_64-resctrl-skx-twocaches.xml | 2 +-
|
||||
.../vircaps-x86_64-resctrl-skx.xml | 2 +-
|
||||
.../vircaps-x86_64-resctrl.xml | 24 +++++-----
|
||||
19 files changed, 182 insertions(+), 151 deletions(-)
|
||||
|
||||
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
|
||||
index 32badee7b3..02298e40a3 100644
|
||||
--- a/src/conf/capabilities.c
|
||||
+++ b/src/conf/capabilities.c
|
||||
@@ -811,9 +811,10 @@ virCapsHostNUMACellCPUFormat(virBuffer *buf,
|
||||
return -1;
|
||||
|
||||
virBufferAsprintf(&childBuf,
|
||||
- " socket_id='%d' die_id='%d' core_id='%d' siblings='%s'",
|
||||
+ " socket_id='%d' die_id='%d' cluster_id='%d' core_id='%d' siblings='%s'",
|
||||
cpus[j].socket_id,
|
||||
cpus[j].die_id,
|
||||
+ cpus[j].cluster_id,
|
||||
cpus[j].core_id,
|
||||
siblings);
|
||||
}
|
||||
@@ -1453,6 +1454,7 @@ virCapabilitiesFillCPUInfo(int cpu_id G_GNUC_UNUSED,
|
||||
|
||||
if (virHostCPUGetSocket(cpu_id, &cpu->socket_id) < 0 ||
|
||||
virHostCPUGetDie(cpu_id, &cpu->die_id) < 0 ||
|
||||
+ virHostCPUGetCluster(cpu_id, &cpu->cluster_id) < 0 ||
|
||||
virHostCPUGetCore(cpu_id, &cpu->core_id) < 0)
|
||||
return -1;
|
||||
|
||||
@@ -1712,6 +1714,7 @@ virCapabilitiesHostNUMAInitFake(virCapsHostNUMA *caps)
|
||||
if (tmp) {
|
||||
cpus[cid].id = id;
|
||||
cpus[cid].die_id = 0;
|
||||
+ cpus[cid].cluster_id = 0;
|
||||
cpus[cid].socket_id = s;
|
||||
cpus[cid].core_id = c;
|
||||
cpus[cid].siblings = virBitmapNewCopy(siblings);
|
||||
diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h
|
||||
index 9eaf6e2807..52e395de14 100644
|
||||
--- a/src/conf/capabilities.h
|
||||
+++ b/src/conf/capabilities.h
|
||||
@@ -89,6 +89,7 @@ struct _virCapsHostNUMACellCPU {
|
||||
unsigned int id;
|
||||
unsigned int socket_id;
|
||||
unsigned int die_id;
|
||||
+ unsigned int cluster_id;
|
||||
unsigned int core_id;
|
||||
virBitmap *siblings;
|
||||
};
|
||||
diff --git a/src/conf/schemas/capability.rng b/src/conf/schemas/capability.rng
|
||||
index b1968df258..a1606941e7 100644
|
||||
--- a/src/conf/schemas/capability.rng
|
||||
+++ b/src/conf/schemas/capability.rng
|
||||
@@ -201,6 +201,9 @@
|
||||
<attribute name="die_id">
|
||||
<ref name="unsignedInt"/>
|
||||
</attribute>
|
||||
+ <attribute name="cluster_id">
|
||||
+ <ref name="unsignedInt"/>
|
||||
+ </attribute>
|
||||
<attribute name="core_id">
|
||||
<ref name="unsignedInt"/>
|
||||
</attribute>
|
||||
diff --git a/src/libvirt_linux.syms b/src/libvirt_linux.syms
|
||||
index 55649ae39c..004cbfee97 100644
|
||||
--- a/src/libvirt_linux.syms
|
||||
+++ b/src/libvirt_linux.syms
|
||||
@@ -3,6 +3,7 @@
|
||||
#
|
||||
|
||||
# util/virhostcpu.h
|
||||
+virHostCPUGetCluster;
|
||||
virHostCPUGetCore;
|
||||
virHostCPUGetDie;
|
||||
virHostCPUGetInfoPopulateLinux;
|
||||
diff --git a/src/util/virhostcpu.c b/src/util/virhostcpu.c
|
||||
index 4027547e1e..a3781ca870 100644
|
||||
--- a/src/util/virhostcpu.c
|
||||
+++ b/src/util/virhostcpu.c
|
||||
@@ -232,6 +232,28 @@ virHostCPUGetDie(unsigned int cpu, unsigned int *die)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+int
|
||||
+virHostCPUGetCluster(unsigned int cpu, unsigned int *cluster)
|
||||
+{
|
||||
+ int cluster_id;
|
||||
+ int ret = virFileReadValueInt(&cluster_id,
|
||||
+ "%s/cpu/cpu%u/topology/cluster_id",
|
||||
+ SYSFS_SYSTEM_PATH, cpu);
|
||||
+
|
||||
+ if (ret == -1)
|
||||
+ return -1;
|
||||
+
|
||||
+ /* If the file doesn't exists (old kernel) or the value contained
|
||||
+ * in it is -1 (architecture without CPU clusters), report 0 to
|
||||
+ * indicate the lack of information */
|
||||
+ if (ret == -2 || cluster_id < 0)
|
||||
+ cluster_id = 0;
|
||||
+
|
||||
+ *cluster = cluster_id;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
int
|
||||
virHostCPUGetCore(unsigned int cpu, unsigned int *core)
|
||||
{
|
||||
diff --git a/src/util/virhostcpu.h b/src/util/virhostcpu.h
|
||||
index 5f0d43e069..d7e09bff22 100644
|
||||
--- a/src/util/virhostcpu.h
|
||||
+++ b/src/util/virhostcpu.h
|
||||
@@ -68,6 +68,7 @@ int virHostCPUStatsAssign(virNodeCPUStatsPtr param,
|
||||
#ifdef __linux__
|
||||
int virHostCPUGetSocket(unsigned int cpu, unsigned int *socket);
|
||||
int virHostCPUGetDie(unsigned int cpu, unsigned int *die);
|
||||
+int virHostCPUGetCluster(unsigned int cpu, unsigned int *cluster);
|
||||
int virHostCPUGetCore(unsigned int cpu, unsigned int *core);
|
||||
|
||||
virBitmap *virHostCPUGetSiblingsList(unsigned int cpu);
|
||||
diff --git a/tests/capabilityschemadata/caps-qemu-kvm.xml b/tests/capabilityschemadata/caps-qemu-kvm.xml
|
||||
index acdbb362cc..317fa0885f 100644
|
||||
--- a/tests/capabilityschemadata/caps-qemu-kvm.xml
|
||||
+++ b/tests/capabilityschemadata/caps-qemu-kvm.xml
|
||||
@@ -64,14 +64,14 @@
|
||||
<sibling id='1' value='21'/>
|
||||
</distances>
|
||||
<cpus num='8'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='1' siblings='2'/>
|
||||
- <cpu id='4' socket_id='0' die_id='0' core_id='2' siblings='4'/>
|
||||
- <cpu id='6' socket_id='0' die_id='0' core_id='3' siblings='6'/>
|
||||
- <cpu id='8' socket_id='0' die_id='0' core_id='4' siblings='8'/>
|
||||
- <cpu id='10' socket_id='0' die_id='0' core_id='5' siblings='10'/>
|
||||
- <cpu id='12' socket_id='0' die_id='0' core_id='6' siblings='12'/>
|
||||
- <cpu id='14' socket_id='0' die_id='0' core_id='7' siblings='14'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='2'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='4'/>
|
||||
+ <cpu id='6' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='6'/>
|
||||
+ <cpu id='8' socket_id='0' die_id='0' cluster_id='0' core_id='4' siblings='8'/>
|
||||
+ <cpu id='10' socket_id='0' die_id='0' cluster_id='0' core_id='5' siblings='10'/>
|
||||
+ <cpu id='12' socket_id='0' die_id='0' cluster_id='0' core_id='6' siblings='12'/>
|
||||
+ <cpu id='14' socket_id='0' die_id='0' cluster_id='0' core_id='7' siblings='14'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -84,14 +84,14 @@
|
||||
<sibling id='1' value='10'/>
|
||||
</distances>
|
||||
<cpus num='8'>
|
||||
- <cpu id='1' socket_id='1' die_id='0' core_id='0' siblings='1'/>
|
||||
- <cpu id='3' socket_id='1' die_id='0' core_id='1' siblings='3'/>
|
||||
- <cpu id='5' socket_id='1' die_id='0' core_id='2' siblings='5'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='3' siblings='7'/>
|
||||
- <cpu id='9' socket_id='1' die_id='0' core_id='4' siblings='9'/>
|
||||
- <cpu id='11' socket_id='1' die_id='0' core_id='5' siblings='11'/>
|
||||
- <cpu id='13' socket_id='1' die_id='0' core_id='6' siblings='13'/>
|
||||
- <cpu id='15' socket_id='1' die_id='0' core_id='7' siblings='15'/>
|
||||
+ <cpu id='1' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='1'/>
|
||||
+ <cpu id='3' socket_id='1' die_id='0' cluster_id='0' core_id='1' siblings='3'/>
|
||||
+ <cpu id='5' socket_id='1' die_id='0' cluster_id='0' core_id='2' siblings='5'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='3' siblings='7'/>
|
||||
+ <cpu id='9' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='9'/>
|
||||
+ <cpu id='11' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='11'/>
|
||||
+ <cpu id='13' socket_id='1' die_id='0' cluster_id='0' core_id='6' siblings='13'/>
|
||||
+ <cpu id='15' socket_id='1' die_id='0' cluster_id='0' core_id='7' siblings='15'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml b/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml
|
||||
index fe61fc42cc..b37c8e7a20 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml
|
||||
@@ -14,10 +14,10 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='0' socket_id='36' die_id='0' core_id='0' siblings='0-1'/>
|
||||
- <cpu id='1' socket_id='36' die_id='0' core_id='0' siblings='0-1'/>
|
||||
- <cpu id='2' socket_id='36' die_id='0' core_id='1' siblings='2-3'/>
|
||||
- <cpu id='3' socket_id='36' die_id='0' core_id='1' siblings='2-3'/>
|
||||
+ <cpu id='0' socket_id='36' die_id='0' cluster_id='0' core_id='0' siblings='0-1'/>
|
||||
+ <cpu id='1' socket_id='36' die_id='0' cluster_id='0' core_id='0' siblings='0-1'/>
|
||||
+ <cpu id='2' socket_id='36' die_id='0' cluster_id='1' core_id='1' siblings='2-3'/>
|
||||
+ <cpu id='3' socket_id='36' die_id='0' cluster_id='1' core_id='1' siblings='2-3'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -26,10 +26,10 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='4' socket_id='3180' die_id='0' core_id='256' siblings='4-5'/>
|
||||
- <cpu id='5' socket_id='3180' die_id='0' core_id='256' siblings='4-5'/>
|
||||
- <cpu id='6' socket_id='3180' die_id='0' core_id='257' siblings='6-7'/>
|
||||
- <cpu id='7' socket_id='3180' die_id='0' core_id='257' siblings='6-7'/>
|
||||
+ <cpu id='4' socket_id='3180' die_id='0' cluster_id='256' core_id='256' siblings='4-5'/>
|
||||
+ <cpu id='5' socket_id='3180' die_id='0' cluster_id='256' core_id='256' siblings='4-5'/>
|
||||
+ <cpu id='6' socket_id='3180' die_id='0' cluster_id='257' core_id='257' siblings='6-7'/>
|
||||
+ <cpu id='7' socket_id='3180' die_id='0' cluster_id='257' core_id='257' siblings='6-7'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-aarch64-basic.xml b/tests/vircaps2xmldata/vircaps-aarch64-basic.xml
|
||||
index 0a04052c40..5533ae0586 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-aarch64-basic.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-aarch64-basic.xml
|
||||
@@ -16,10 +16,10 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -28,10 +28,10 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='4' socket_id='1' die_id='0' core_id='4' siblings='4'/>
|
||||
- <cpu id='5' socket_id='1' die_id='0' core_id='5' siblings='5'/>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='6' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='7' siblings='7'/>
|
||||
+ <cpu id='4' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='5'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='6' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='7' siblings='7'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='2'>
|
||||
@@ -40,10 +40,10 @@
|
||||
<pages unit='KiB' size='2048'>8192</pages>
|
||||
<pages unit='KiB' size='1048576'>10240</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='8' socket_id='2' die_id='0' core_id='8' siblings='8'/>
|
||||
- <cpu id='9' socket_id='2' die_id='0' core_id='9' siblings='9'/>
|
||||
- <cpu id='10' socket_id='2' die_id='0' core_id='10' siblings='10'/>
|
||||
- <cpu id='11' socket_id='2' die_id='0' core_id='11' siblings='11'/>
|
||||
+ <cpu id='8' socket_id='2' die_id='0' cluster_id='0' core_id='8' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='2' die_id='0' cluster_id='0' core_id='9' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='2' die_id='0' cluster_id='0' core_id='10' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='2' die_id='0' cluster_id='0' core_id='11' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='3'>
|
||||
@@ -52,10 +52,10 @@
|
||||
<pages unit='KiB' size='2048'>10240</pages>
|
||||
<pages unit='KiB' size='1048576'>12288</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='12' socket_id='3' die_id='0' core_id='12' siblings='12'/>
|
||||
- <cpu id='13' socket_id='3' die_id='0' core_id='13' siblings='13'/>
|
||||
- <cpu id='14' socket_id='3' die_id='0' core_id='14' siblings='14'/>
|
||||
- <cpu id='15' socket_id='3' die_id='0' core_id='15' siblings='15'/>
|
||||
+ <cpu id='12' socket_id='3' die_id='0' cluster_id='0' core_id='12' siblings='12'/>
|
||||
+ <cpu id='13' socket_id='3' die_id='0' cluster_id='0' core_id='13' siblings='13'/>
|
||||
+ <cpu id='14' socket_id='3' die_id='0' cluster_id='0' core_id='14' siblings='14'/>
|
||||
+ <cpu id='15' socket_id='3' die_id='0' cluster_id='0' core_id='15' siblings='15'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-basic-dies.xml b/tests/vircaps2xmldata/vircaps-x86_64-basic-dies.xml
|
||||
index 8a3ca2d13c..c86dc4defc 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-basic-dies.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-basic-dies.xml
|
||||
@@ -14,18 +14,18 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='12'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='1' core_id='0' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='1' core_id='1' siblings='3'/>
|
||||
- <cpu id='4' socket_id='0' die_id='2' core_id='0' siblings='4'/>
|
||||
- <cpu id='5' socket_id='0' die_id='2' core_id='1' siblings='5'/>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='0' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='1' siblings='7'/>
|
||||
- <cpu id='8' socket_id='1' die_id='1' core_id='0' siblings='8'/>
|
||||
- <cpu id='9' socket_id='1' die_id='1' core_id='1' siblings='9'/>
|
||||
- <cpu id='10' socket_id='1' die_id='2' core_id='0' siblings='10'/>
|
||||
- <cpu id='11' socket_id='1' die_id='2' core_id='1' siblings='11'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='1' cluster_id='0' core_id='0' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='1' cluster_id='0' core_id='1' siblings='3'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='2' cluster_id='0' core_id='0' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='0' die_id='2' cluster_id='0' core_id='1' siblings='5'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='1' siblings='7'/>
|
||||
+ <cpu id='8' socket_id='1' die_id='1' cluster_id='0' core_id='0' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='1' die_id='1' cluster_id='0' core_id='1' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='1' die_id='2' cluster_id='0' core_id='0' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='1' die_id='2' cluster_id='0' core_id='1' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-basic.xml b/tests/vircaps2xmldata/vircaps-x86_64-basic.xml
|
||||
index 4da09f889c..9ae155d571 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-basic.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-basic.xml
|
||||
@@ -14,10 +14,10 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -26,10 +26,10 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='4' socket_id='1' die_id='0' core_id='4' siblings='4'/>
|
||||
- <cpu id='5' socket_id='1' die_id='0' core_id='5' siblings='5'/>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='6' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='7' siblings='7'/>
|
||||
+ <cpu id='4' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='5'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='6' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='7' siblings='7'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='2'>
|
||||
@@ -38,10 +38,10 @@
|
||||
<pages unit='KiB' size='2048'>8192</pages>
|
||||
<pages unit='KiB' size='1048576'>10240</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='8' socket_id='2' die_id='0' core_id='8' siblings='8'/>
|
||||
- <cpu id='9' socket_id='2' die_id='0' core_id='9' siblings='9'/>
|
||||
- <cpu id='10' socket_id='2' die_id='0' core_id='10' siblings='10'/>
|
||||
- <cpu id='11' socket_id='2' die_id='0' core_id='11' siblings='11'/>
|
||||
+ <cpu id='8' socket_id='2' die_id='0' cluster_id='0' core_id='8' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='2' die_id='0' cluster_id='0' core_id='9' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='2' die_id='0' cluster_id='0' core_id='10' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='2' die_id='0' cluster_id='0' core_id='11' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='3'>
|
||||
@@ -50,10 +50,10 @@
|
||||
<pages unit='KiB' size='2048'>10240</pages>
|
||||
<pages unit='KiB' size='1048576'>12288</pages>
|
||||
<cpus num='4'>
|
||||
- <cpu id='12' socket_id='3' die_id='0' core_id='12' siblings='12'/>
|
||||
- <cpu id='13' socket_id='3' die_id='0' core_id='13' siblings='13'/>
|
||||
- <cpu id='14' socket_id='3' die_id='0' core_id='14' siblings='14'/>
|
||||
- <cpu id='15' socket_id='3' die_id='0' core_id='15' siblings='15'/>
|
||||
+ <cpu id='12' socket_id='3' die_id='0' cluster_id='0' core_id='12' siblings='12'/>
|
||||
+ <cpu id='13' socket_id='3' die_id='0' cluster_id='0' core_id='13' siblings='13'/>
|
||||
+ <cpu id='14' socket_id='3' die_id='0' cluster_id='0' core_id='14' siblings='14'/>
|
||||
+ <cpu id='15' socket_id='3' die_id='0' cluster_id='0' core_id='15' siblings='15'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml
|
||||
index 28f00c0a90..05b33147b7 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml
|
||||
@@ -17,14 +17,14 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='8'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0,4'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1,5'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2,6'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3,7'/>
|
||||
- <cpu id='4' socket_id='0' die_id='0' core_id='0' siblings='0,4'/>
|
||||
- <cpu id='5' socket_id='0' die_id='0' core_id='1' siblings='1,5'/>
|
||||
- <cpu id='6' socket_id='0' die_id='0' core_id='2' siblings='2,6'/>
|
||||
- <cpu id='7' socket_id='0' die_id='0' core_id='3' siblings='3,7'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0,4'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1,5'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2,6'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3,7'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0,4'/>
|
||||
+ <cpu id='5' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1,5'/>
|
||||
+ <cpu id='6' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2,6'/>
|
||||
+ <cpu id='7' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3,7'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-hmat.xml b/tests/vircaps2xmldata/vircaps-x86_64-hmat.xml
|
||||
index 6fe5751666..2b97354bf3 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-hmat.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-hmat.xml
|
||||
@@ -25,30 +25,30 @@
|
||||
<line value='16' unit='B'/>
|
||||
</cache>
|
||||
<cpus num='24'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='1' die_id='0' core_id='0' siblings='1'/>
|
||||
- <cpu id='2' socket_id='2' die_id='0' core_id='0' siblings='2'/>
|
||||
- <cpu id='3' socket_id='3' die_id='0' core_id='0' siblings='3'/>
|
||||
- <cpu id='4' socket_id='4' die_id='0' core_id='0' siblings='4'/>
|
||||
- <cpu id='5' socket_id='5' die_id='0' core_id='0' siblings='5'/>
|
||||
- <cpu id='6' socket_id='6' die_id='0' core_id='0' siblings='6'/>
|
||||
- <cpu id='7' socket_id='7' die_id='0' core_id='0' siblings='7'/>
|
||||
- <cpu id='8' socket_id='8' die_id='0' core_id='0' siblings='8'/>
|
||||
- <cpu id='9' socket_id='9' die_id='0' core_id='0' siblings='9'/>
|
||||
- <cpu id='10' socket_id='10' die_id='0' core_id='0' siblings='10'/>
|
||||
- <cpu id='11' socket_id='11' die_id='0' core_id='0' siblings='11'/>
|
||||
- <cpu id='12' socket_id='12' die_id='0' core_id='0' siblings='12'/>
|
||||
- <cpu id='13' socket_id='13' die_id='0' core_id='0' siblings='13'/>
|
||||
- <cpu id='14' socket_id='14' die_id='0' core_id='0' siblings='14'/>
|
||||
- <cpu id='15' socket_id='15' die_id='0' core_id='0' siblings='15'/>
|
||||
- <cpu id='16' socket_id='16' die_id='0' core_id='0' siblings='16'/>
|
||||
- <cpu id='17' socket_id='17' die_id='0' core_id='0' siblings='17'/>
|
||||
- <cpu id='18' socket_id='18' die_id='0' core_id='0' siblings='18'/>
|
||||
- <cpu id='19' socket_id='19' die_id='0' core_id='0' siblings='19'/>
|
||||
- <cpu id='20' socket_id='20' die_id='0' core_id='0' siblings='20'/>
|
||||
- <cpu id='21' socket_id='21' die_id='0' core_id='0' siblings='21'/>
|
||||
- <cpu id='22' socket_id='22' die_id='0' core_id='0' siblings='22'/>
|
||||
- <cpu id='23' socket_id='23' die_id='0' core_id='0' siblings='23'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='2' die_id='0' cluster_id='0' core_id='0' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='3' die_id='0' cluster_id='0' core_id='0' siblings='3'/>
|
||||
+ <cpu id='4' socket_id='4' die_id='0' cluster_id='0' core_id='0' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='5' die_id='0' cluster_id='0' core_id='0' siblings='5'/>
|
||||
+ <cpu id='6' socket_id='6' die_id='0' cluster_id='0' core_id='0' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='7' die_id='0' cluster_id='0' core_id='0' siblings='7'/>
|
||||
+ <cpu id='8' socket_id='8' die_id='0' cluster_id='0' core_id='0' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='9' die_id='0' cluster_id='0' core_id='0' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='10' die_id='0' cluster_id='0' core_id='0' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='11' die_id='0' cluster_id='0' core_id='0' siblings='11'/>
|
||||
+ <cpu id='12' socket_id='12' die_id='0' cluster_id='0' core_id='0' siblings='12'/>
|
||||
+ <cpu id='13' socket_id='13' die_id='0' cluster_id='0' core_id='0' siblings='13'/>
|
||||
+ <cpu id='14' socket_id='14' die_id='0' cluster_id='0' core_id='0' siblings='14'/>
|
||||
+ <cpu id='15' socket_id='15' die_id='0' cluster_id='0' core_id='0' siblings='15'/>
|
||||
+ <cpu id='16' socket_id='16' die_id='0' cluster_id='0' core_id='0' siblings='16'/>
|
||||
+ <cpu id='17' socket_id='17' die_id='0' cluster_id='0' core_id='0' siblings='17'/>
|
||||
+ <cpu id='18' socket_id='18' die_id='0' cluster_id='0' core_id='0' siblings='18'/>
|
||||
+ <cpu id='19' socket_id='19' die_id='0' cluster_id='0' core_id='0' siblings='19'/>
|
||||
+ <cpu id='20' socket_id='20' die_id='0' cluster_id='0' core_id='0' siblings='20'/>
|
||||
+ <cpu id='21' socket_id='21' die_id='0' cluster_id='0' core_id='0' siblings='21'/>
|
||||
+ <cpu id='22' socket_id='22' die_id='0' cluster_id='0' core_id='0' siblings='22'/>
|
||||
+ <cpu id='23' socket_id='23' die_id='0' cluster_id='0' core_id='0' siblings='23'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
|
||||
index ee26fe9464..167b217d8e 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml
|
||||
@@ -17,12 +17,12 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3'/>
|
||||
- <cpu id='4' socket_id='0' die_id='0' core_id='4' siblings='4'/>
|
||||
- <cpu id='5' socket_id='0' die_id='0' core_id='5' siblings='5'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='0' cluster_id='0' core_id='4' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='0' die_id='0' cluster_id='0' core_id='5' siblings='5'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -31,12 +31,12 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='0' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='1' siblings='7'/>
|
||||
- <cpu id='8' socket_id='1' die_id='0' core_id='2' siblings='8'/>
|
||||
- <cpu id='9' socket_id='1' die_id='0' core_id='3' siblings='9'/>
|
||||
- <cpu id='10' socket_id='1' die_id='0' core_id='4' siblings='10'/>
|
||||
- <cpu id='11' socket_id='1' die_id='0' core_id='5' siblings='11'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='1' siblings='7'/>
|
||||
+ <cpu id='8' socket_id='1' die_id='0' cluster_id='0' core_id='2' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='1' die_id='0' cluster_id='0' core_id='3' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml
|
||||
index acdd97ec58..311bb58e6a 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cmt.xml
|
||||
@@ -17,12 +17,12 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3'/>
|
||||
- <cpu id='4' socket_id='0' die_id='0' core_id='4' siblings='4'/>
|
||||
- <cpu id='5' socket_id='0' die_id='0' core_id='5' siblings='5'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='0' cluster_id='0' core_id='4' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='0' die_id='0' cluster_id='0' core_id='5' siblings='5'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -31,12 +31,12 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='0' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='1' siblings='7'/>
|
||||
- <cpu id='8' socket_id='1' die_id='0' core_id='2' siblings='8'/>
|
||||
- <cpu id='9' socket_id='1' die_id='0' core_id='3' siblings='9'/>
|
||||
- <cpu id='10' socket_id='1' die_id='0' core_id='4' siblings='10'/>
|
||||
- <cpu id='11' socket_id='1' die_id='0' core_id='5' siblings='11'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='1' siblings='7'/>
|
||||
+ <cpu id='8' socket_id='1' die_id='0' cluster_id='0' core_id='2' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='1' die_id='0' cluster_id='0' core_id='3' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-fake-feature.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-fake-feature.xml
|
||||
index 1327d85c98..d85407f0b1 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-fake-feature.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-fake-feature.xml
|
||||
@@ -17,12 +17,12 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3'/>
|
||||
- <cpu id='4' socket_id='0' die_id='0' core_id='4' siblings='4'/>
|
||||
- <cpu id='5' socket_id='0' die_id='0' core_id='5' siblings='5'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='0' cluster_id='0' core_id='4' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='0' die_id='0' cluster_id='0' core_id='5' siblings='5'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -31,12 +31,12 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='0' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='1' siblings='7'/>
|
||||
- <cpu id='8' socket_id='1' die_id='0' core_id='2' siblings='8'/>
|
||||
- <cpu id='9' socket_id='1' die_id='0' core_id='3' siblings='9'/>
|
||||
- <cpu id='10' socket_id='1' die_id='0' core_id='4' siblings='10'/>
|
||||
- <cpu id='11' socket_id='1' die_id='0' core_id='5' siblings='11'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='1' siblings='7'/>
|
||||
+ <cpu id='8' socket_id='1' die_id='0' cluster_id='0' core_id='2' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='1' die_id='0' cluster_id='0' core_id='3' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
|
||||
index 6769bd0591..eb53eb2142 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml
|
||||
@@ -17,7 +17,7 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='1'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
|
||||
index bc52480905..38ea0bdc27 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml
|
||||
@@ -17,7 +17,7 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='1'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
|
||||
index b638bbd1c9..fd854ee91e 100644
|
||||
--- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
|
||||
+++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml
|
||||
@@ -17,12 +17,12 @@
|
||||
<pages unit='KiB' size='2048'>4096</pages>
|
||||
<pages unit='KiB' size='1048576'>6144</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='0' socket_id='0' die_id='0' core_id='0' siblings='0'/>
|
||||
- <cpu id='1' socket_id='0' die_id='0' core_id='1' siblings='1'/>
|
||||
- <cpu id='2' socket_id='0' die_id='0' core_id='2' siblings='2'/>
|
||||
- <cpu id='3' socket_id='0' die_id='0' core_id='3' siblings='3'/>
|
||||
- <cpu id='4' socket_id='0' die_id='0' core_id='4' siblings='4'/>
|
||||
- <cpu id='5' socket_id='0' die_id='0' core_id='5' siblings='5'/>
|
||||
+ <cpu id='0' socket_id='0' die_id='0' cluster_id='0' core_id='0' siblings='0'/>
|
||||
+ <cpu id='1' socket_id='0' die_id='0' cluster_id='0' core_id='1' siblings='1'/>
|
||||
+ <cpu id='2' socket_id='0' die_id='0' cluster_id='0' core_id='2' siblings='2'/>
|
||||
+ <cpu id='3' socket_id='0' die_id='0' cluster_id='0' core_id='3' siblings='3'/>
|
||||
+ <cpu id='4' socket_id='0' die_id='0' cluster_id='0' core_id='4' siblings='4'/>
|
||||
+ <cpu id='5' socket_id='0' die_id='0' cluster_id='0' core_id='5' siblings='5'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
<cell id='1'>
|
||||
@@ -31,12 +31,12 @@
|
||||
<pages unit='KiB' size='2048'>6144</pages>
|
||||
<pages unit='KiB' size='1048576'>8192</pages>
|
||||
<cpus num='6'>
|
||||
- <cpu id='6' socket_id='1' die_id='0' core_id='0' siblings='6'/>
|
||||
- <cpu id='7' socket_id='1' die_id='0' core_id='1' siblings='7'/>
|
||||
- <cpu id='8' socket_id='1' die_id='0' core_id='2' siblings='8'/>
|
||||
- <cpu id='9' socket_id='1' die_id='0' core_id='3' siblings='9'/>
|
||||
- <cpu id='10' socket_id='1' die_id='0' core_id='4' siblings='10'/>
|
||||
- <cpu id='11' socket_id='1' die_id='0' core_id='5' siblings='11'/>
|
||||
+ <cpu id='6' socket_id='1' die_id='0' cluster_id='0' core_id='0' siblings='6'/>
|
||||
+ <cpu id='7' socket_id='1' die_id='0' cluster_id='0' core_id='1' siblings='7'/>
|
||||
+ <cpu id='8' socket_id='1' die_id='0' cluster_id='0' core_id='2' siblings='8'/>
|
||||
+ <cpu id='9' socket_id='1' die_id='0' cluster_id='0' core_id='3' siblings='9'/>
|
||||
+ <cpu id='10' socket_id='1' die_id='0' cluster_id='0' core_id='4' siblings='10'/>
|
||||
+ <cpu id='11' socket_id='1' die_id='0' cluster_id='0' core_id='5' siblings='11'/>
|
||||
</cpus>
|
||||
</cell>
|
||||
</cells>
|
||||
--
|
||||
2.43.0
|
@ -1,138 +0,0 @@
|
||||
From 8d84e4af4cbb93d73f4d9967f517552257f025f5 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <8d84e4af4cbb93d73f4d9967f517552257f025f5.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 18:26:29 +0100
|
||||
Subject: [PATCH] conf: node_device: Refactor
|
||||
'virNodeDeviceCapVPDParseCustomFields' to fix error reporting
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The errors raised in virNodeDeviceCapVPDParseCustomFields were actually
|
||||
ignored by continuing the parse rather than raised.
|
||||
|
||||
Rather than just replace 'continue' by 'return -1' this patch refactors
|
||||
the whole parser to simplify it as well as report reasonable errors.
|
||||
|
||||
Parsing of individual fields is done without XPath and is extracted into
|
||||
a common helper.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit ea8d864d9ecf3ee72910ccc1497244f1ef74e948)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/conf/node_device_conf.c | 81 ++++++++++++++++++-------------------
|
||||
1 file changed, 40 insertions(+), 41 deletions(-)
|
||||
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index d7e1a23034..0f2c341967 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -953,63 +953,62 @@ virNodeDevCapMdevTypesParseXML(xmlXPathContextPtr ctxt,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+
|
||||
static int
|
||||
-virNodeDeviceCapVPDParseCustomFields(xmlXPathContextPtr ctxt, virPCIVPDResource *res, bool readOnly)
|
||||
+virNodeDeviceCapVPDParseCustomFieldOne(xmlNodePtr node,
|
||||
+ virPCIVPDResource *res,
|
||||
+ bool read_only,
|
||||
+ const char keyword_prefix)
|
||||
+{
|
||||
+ g_autofree char *value = NULL;
|
||||
+ g_autofree char *index = NULL;
|
||||
+ g_autofree char *keyword = NULL;
|
||||
+
|
||||
+ if (!(index = virXMLPropStringRequired(node, "index")))
|
||||
+ return -1;
|
||||
+
|
||||
+ if (strlen(index) != 1) {
|
||||
+ virReportError(VIR_ERR_XML_ERROR,
|
||||
+ _("'%1$s' 'index' value '%2$s' malformed"),
|
||||
+ node->name, index);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ keyword = g_strdup_printf("%c%c", keyword_prefix, index[0]);
|
||||
+
|
||||
+ if (!(value = virXMLNodeContentString(node)))
|
||||
+ return -1;
|
||||
+
|
||||
+ virPCIVPDResourceUpdateKeyword(res, read_only, keyword, value);
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int
|
||||
+virNodeDeviceCapVPDParseCustomFields(xmlXPathContextPtr ctxt,
|
||||
+ virPCIVPDResource *res,
|
||||
+ bool readOnly)
|
||||
{
|
||||
int nfields = -1;
|
||||
g_autofree xmlNodePtr *nodes = NULL;
|
||||
size_t i = 0;
|
||||
|
||||
- if ((nfields = virXPathNodeSet("./vendor_field[@index]", ctxt, &nodes)) < 0)
|
||||
+ if ((nfields = virXPathNodeSet("./vendor_field", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < nfields; i++) {
|
||||
- g_autofree char *value = NULL;
|
||||
- g_autofree char *index = NULL;
|
||||
- VIR_XPATH_NODE_AUTORESTORE(ctxt)
|
||||
- g_autofree char *keyword = NULL;
|
||||
-
|
||||
- ctxt->node = nodes[i];
|
||||
- if (!(index = virXPathString("string(./@index[1])", ctxt)) ||
|
||||
- strlen(index) > 1) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("<vendor_field> evaluation has failed"));
|
||||
- continue;
|
||||
- }
|
||||
- if (!(value = virXPathString("string(./text())", ctxt))) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("<vendor_field> value evaluation has failed"));
|
||||
- continue;
|
||||
- }
|
||||
- keyword = g_strdup_printf("V%c", index[0]);
|
||||
- virPCIVPDResourceUpdateKeyword(res, readOnly, keyword, value);
|
||||
+ if (virNodeDeviceCapVPDParseCustomFieldOne(nodes[i], res, readOnly, 'V') < 0)
|
||||
+ return -1;
|
||||
}
|
||||
VIR_FREE(nodes);
|
||||
|
||||
if (!readOnly) {
|
||||
- if ((nfields = virXPathNodeSet("./system_field[@index]", ctxt, &nodes)) < 0)
|
||||
+ if ((nfields = virXPathNodeSet("./system_field", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < nfields; i++) {
|
||||
- g_autofree char *value = NULL;
|
||||
- g_autofree char *index = NULL;
|
||||
- g_autofree char *keyword = NULL;
|
||||
- VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
||||
-
|
||||
- ctxt->node = nodes[i];
|
||||
- if (!(index = virXPathString("string(./@index[1])", ctxt)) ||
|
||||
- strlen(index) > 1) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("<system_field> evaluation has failed"));
|
||||
- continue;
|
||||
- }
|
||||
- if (!(value = virXPathString("string(./text())", ctxt))) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("<system_field> value evaluation has failed"));
|
||||
- continue;
|
||||
- }
|
||||
- keyword = g_strdup_printf("Y%c", index[0]);
|
||||
- virPCIVPDResourceUpdateKeyword(res, readOnly, keyword, value);
|
||||
+ if (virNodeDeviceCapVPDParseCustomFieldOne(nodes[i], res, readOnly, 'Y') < 0)
|
||||
+ return -1;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,47 +0,0 @@
|
||||
From 15145b5ecb2e9186e42bbb295e1d44f93ff25cfb Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <15145b5ecb2e9186e42bbb295e1d44f93ff25cfb.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 16:27:35 +0100
|
||||
Subject: [PATCH] conf: virNodeDeviceCapVPDParse*: Remove pointless NULL checks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The function are never called with NULL argument so the checks can be
|
||||
removed.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit fb69acf5c255f6baedefe2a2535325af8088ced5)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/conf/node_device_conf.c | 6 ------
|
||||
1 file changed, 6 deletions(-)
|
||||
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index dd174d3020..d7e1a23034 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -1023,9 +1023,6 @@ virNodeDeviceCapVPDParseReadOnlyFields(xmlXPathContextPtr ctxt, virPCIVPDResourc
|
||||
"serial_number", "part_number", NULL};
|
||||
size_t i = 0;
|
||||
|
||||
- if (res == NULL)
|
||||
- return -1;
|
||||
-
|
||||
res->ro = virPCIVPDResourceRONew();
|
||||
|
||||
while (keywords[i]) {
|
||||
@@ -1061,9 +1058,6 @@ virNodeDeviceCapVPDParseXML(xmlXPathContextPtr ctxt, virPCIVPDResource **res)
|
||||
size_t i = 0;
|
||||
g_autoptr(virPCIVPDResource) newres = g_new0(virPCIVPDResource, 1);
|
||||
|
||||
- if (res == NULL)
|
||||
- return -1;
|
||||
-
|
||||
if (!(newres->name = virXPathString("string(./name)", ctxt))) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
_("Could not read a device name from the <name> element"));
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,62 @@
|
||||
From 6346bcf6e574b46defaf24baac185c32bc41ba30 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <6346bcf6e574b46defaf24baac185c32bc41ba30.1729611062.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 10 Oct 2024 08:42:20 +0200
|
||||
Subject: [PATCH] docs: Add warning about using a cleared image with
|
||||
VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES_ZEROES
|
||||
|
||||
The migration parameter causes zero detection to be enabled and zero
|
||||
blocks are *not* transferred to the destination. This means that users
|
||||
must provide pre-cleared images that read all zero, otherwise the
|
||||
non-zero blocks on destination which reside in places where the source
|
||||
has zero blocks would be kept intact corrupting the image.
|
||||
|
||||
As not transferring and overwriting the zero blocks is what the feature
|
||||
is supposed to do the users need to provide the proper environment.
|
||||
|
||||
Document the requirement, both in API and in the virsh man page for the
|
||||
'--migrate-disks-detect-zeroes' option.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
(cherry picked from commit 332ee4931a84ec23e7f6fcb963083318c1307dc7)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
docs/manpages/virsh.rst | 4 +++-
|
||||
include/libvirt/libvirt-domain.h | 5 ++++-
|
||||
2 files changed, 7 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
|
||||
index 87de338644..bb1b2e5cc4 100644
|
||||
--- a/docs/manpages/virsh.rst
|
||||
+++ b/docs/manpages/virsh.rst
|
||||
@@ -3425,7 +3425,9 @@ transfer via the comma separated ``disk-list`` argument.
|
||||
The *--migrate-disks-detect-zeroes* option which takes a comma separated list of
|
||||
disk target names enables zeroed block detection for the listed migrated disks.
|
||||
These blocks are not transferred or allocated on destination, effectively
|
||||
-sparsifying the disk at the cost of CPU overhead.
|
||||
+sparsifying the disk at the cost of CPU overhead. Users must ensure that any
|
||||
+pre-created storage source is cleared and thus reads all-zeroes before using
|
||||
+this option as otherwise the destination image may become corrupted.
|
||||
With *--copy-storage-synchronous-writes* flag used the disk data migration will
|
||||
synchronously handle guest disk writes to both the original source and the
|
||||
destination to ensure that the disk migration converges at the price of possibly
|
||||
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
|
||||
index a6afacbc22..c83dc299e7 100644
|
||||
--- a/include/libvirt/libvirt-domain.h
|
||||
+++ b/include/libvirt/libvirt-domain.h
|
||||
@@ -1245,7 +1245,10 @@ typedef enum {
|
||||
*
|
||||
* virDomainMigrate* params multiple field: The multiple values that list
|
||||
* the block devices for which zero detection (to avoid transferring zero blocks)
|
||||
- * is to be enabled. This may increase CPU overhead of the migration. At the
|
||||
+ * is to be enabled. Users must ensure that any pre-created storage source on
|
||||
+ * the destination will be cleared and thus read all-zeroes before using this
|
||||
+ * feature, otherwise the destination image may become corrupted.
|
||||
+ * This may increase CPU overhead of the migration. At the
|
||||
* moment this is only supported by the QEMU driver but not for the tunnelled
|
||||
* migration.
|
||||
*
|
||||
--
|
||||
2.47.0
|
@ -1,123 +0,0 @@
|
||||
From 8d48d5fe02c0afcf5bbe68e0a182ee11f9a108dc Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <8d48d5fe02c0afcf5bbe68e0a182ee11f9a108dc.1708614745.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Mon, 19 Feb 2024 15:37:16 +0100
|
||||
Subject: [PATCH] domain_validate: Account for NVDIMM label size properly when
|
||||
checking for memory conflicts
|
||||
|
||||
As of v9.8.0-rc1~7 we check whether two <memory/> devices don't
|
||||
overlap (since we allow setting where a <memory/> device should
|
||||
be mapped to). We do this pretty straightforward, by comparing
|
||||
start and end address of each <memory/> device combination.
|
||||
But since only the start address is given (an exposed in the
|
||||
XML), the end address is computed trivially as:
|
||||
|
||||
start + mem->size * 1024
|
||||
|
||||
And for majority of memory device types this works. Except for
|
||||
NVDIMMs. For them the <memory/> device consists of two separate
|
||||
regions: 1) actual memory device, and 2) label.
|
||||
|
||||
Label is where NVDIMM stores some additional information like
|
||||
namespaces partition and so on. But it's not mapped into the
|
||||
guest the same way as actual memory device. In fact, mem->size is
|
||||
a sum of both actual memory device and label sizes. And to make
|
||||
things a bit worse, both sizes are subject to alignment (either
|
||||
the alignsize value specified in XML, or system page size if not
|
||||
specified in XML).
|
||||
|
||||
Therefore, to get the size of actual memory device we need to
|
||||
take mem->size and substract label size rounded up to alignment.
|
||||
|
||||
If we don't do this we report there's an overlap between two
|
||||
NVDIMMs even when in reality there's none.
|
||||
|
||||
Fixes: 3fd64fb0e236fc80ffa2cc977c0d471f11fc39bf
|
||||
Fixes: 91f9a9fb4fc0d34ed8d7a869de3d9f87687c3618
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-4452?focusedId=23805174#comment-23805174
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 4545f313c23e7000451d1cec793ebc8da1a2c25f)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/conf/domain_validate.c | 51 ++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 49 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
|
||||
index 46479f10f2..faa7659f07 100644
|
||||
--- a/src/conf/domain_validate.c
|
||||
+++ b/src/conf/domain_validate.c
|
||||
@@ -2225,6 +2225,53 @@ virDomainHostdevDefValidate(const virDomainHostdevDef *hostdev)
|
||||
}
|
||||
|
||||
|
||||
+/**
|
||||
+ * virDomainMemoryGetMappedSize:
|
||||
+ * @mem: memory device definition
|
||||
+ *
|
||||
+ * For given memory device definition (@mem) calculate size mapped into
|
||||
+ * the guest. This is usually mem->size, except for NVDIMM where its
|
||||
+ * label is mapped elsewhere.
|
||||
+ *
|
||||
+ * Returns: Number of bytes a memory device takes when mapped into a
|
||||
+ * guest.
|
||||
+ */
|
||||
+static unsigned long long
|
||||
+virDomainMemoryGetMappedSize(const virDomainMemoryDef *mem)
|
||||
+{
|
||||
+ unsigned long long ret = mem->size;
|
||||
+
|
||||
+ if (mem->model == VIR_DOMAIN_MEMORY_MODEL_NVDIMM) {
|
||||
+ unsigned long long alignsize = mem->source.nvdimm.alignsize;
|
||||
+ unsigned long long labelsize = 0;
|
||||
+
|
||||
+ /* For NVDIMM the situation is a bit more complicated. Firstly,
|
||||
+ * its <label/> is not mapped as a part of memory device, so we
|
||||
+ * must subtract label size from NVDIMM size. Secondly,
|
||||
+ * remaining memory is then aligned again (rounded down). But
|
||||
+ * for our purposes we might just round label size up and
|
||||
+ * achieve the same (numeric) result. */
|
||||
+
|
||||
+ if (alignsize == 0) {
|
||||
+ long pagesize = virGetSystemPageSizeKB();
|
||||
+
|
||||
+ /* If no alignment is specified in the XML, fallback to
|
||||
+ * system page size alignment. */
|
||||
+ if (pagesize > 0)
|
||||
+ alignsize = pagesize;
|
||||
+ }
|
||||
+
|
||||
+ if (alignsize > 0) {
|
||||
+ labelsize = VIR_ROUND_UP(mem->target.nvdimm.labelsize, alignsize);
|
||||
+
|
||||
+ ret -= labelsize;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return ret * 1024;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
|
||||
const virDomainDef *def)
|
||||
@@ -2259,7 +2306,7 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
|
||||
}
|
||||
|
||||
/* thisStart and thisEnd are in bytes, mem->size in kibibytes */
|
||||
- thisEnd = thisStart + mem->size * 1024;
|
||||
+ thisEnd = thisStart + virDomainMemoryGetMappedSize(mem);
|
||||
|
||||
for (i = 0; i < def->nmems; i++) {
|
||||
const virDomainMemoryDef *other = def->mems[i];
|
||||
@@ -2316,7 +2363,7 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
|
||||
if (thisStart == 0 || otherStart == 0)
|
||||
continue;
|
||||
|
||||
- otherEnd = otherStart + other->size * 1024;
|
||||
+ otherEnd = otherStart + virDomainMemoryGetMappedSize(other);
|
||||
|
||||
if ((thisStart <= otherStart && thisEnd > otherStart) ||
|
||||
(otherStart <= thisStart && otherEnd > thisStart)) {
|
||||
--
|
||||
2.43.2
|
@ -1,53 +0,0 @@
|
||||
From d3593c911c3e02cf5c9c876cddf2fc8ba2eede06 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <d3593c911c3e02cf5c9c876cddf2fc8ba2eede06.1706524416.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Fri, 19 Jan 2024 08:22:13 +0100
|
||||
Subject: [PATCH] domain_validate: Check for domain address conflicts fully
|
||||
|
||||
Current implementation of virDomainMemoryDefCheckConflict() does
|
||||
only a one way comparison, i.e. if there's a memory device within
|
||||
def->mems[] which address falls in [mem->address, mem->address +
|
||||
mem->size] range (mem is basically an iterator within
|
||||
def->mems[]). And for static XML this works just fine. Problem is
|
||||
with hot/cold plugging of a memory device. Then mem points to
|
||||
freshly parsed memory device and these half checks are
|
||||
insufficient. Not only we must check whether an existing memory
|
||||
device doesn't clash with freshly parsed memory device, but also
|
||||
whether freshly parsed memory device does not fall into range of
|
||||
already existing memory device.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-4452
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||
(cherry picked from commit 91f9a9fb4fc0d34ed8d7a869de3d9f87687c3618)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/conf/domain_validate.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
|
||||
index d485ec4fb1..46479f10f2 100644
|
||||
--- a/src/conf/domain_validate.c
|
||||
+++ b/src/conf/domain_validate.c
|
||||
@@ -2264,6 +2264,7 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
|
||||
for (i = 0; i < def->nmems; i++) {
|
||||
const virDomainMemoryDef *other = def->mems[i];
|
||||
unsigned long long otherStart = 0;
|
||||
+ unsigned long long otherEnd = 0;
|
||||
|
||||
if (other == mem)
|
||||
continue;
|
||||
@@ -2315,7 +2316,10 @@ virDomainMemoryDefCheckConflict(const virDomainMemoryDef *mem,
|
||||
if (thisStart == 0 || otherStart == 0)
|
||||
continue;
|
||||
|
||||
- if (thisStart <= otherStart && thisEnd > otherStart) {
|
||||
+ otherEnd = otherStart + other->size * 1024;
|
||||
+
|
||||
+ if ((thisStart <= otherStart && thisEnd > otherStart) ||
|
||||
+ (otherStart <= thisStart && otherEnd > thisStart)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("memory device address [0x%1$llx:0x%2$llx] overlaps with other memory device (0x%3$llx)"),
|
||||
thisStart, thisEnd, otherStart);
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,186 @@
|
||||
From 431e35b6d23ff0948e7199139ac9ec68354cae37 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <431e35b6d23ff0948e7199139ac9ec68354cae37.1730734026.git.jdenemar@redhat.com>
|
||||
From: Jiri Denemark <jdenemar@redhat.com>
|
||||
Date: Thu, 8 Aug 2024 11:45:16 +0200
|
||||
Subject: [PATCH] qemu: Add support for postcopy-recover-setup migration state
|
||||
|
||||
This patch adds support for recognizing the new migration state reported
|
||||
by QEMU when post-copy recovery is requested. It is not actually used
|
||||
for anything yet.
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 79e0b50bb64ff6b78b897cb08c4ce0b1f02a1c92)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-63877
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
---
|
||||
src/conf/virdomainjob.c | 1 +
|
||||
src/conf/virdomainjob.h | 1 +
|
||||
src/qemu/qemu_domain.c | 2 ++
|
||||
src/qemu/qemu_domain.h | 4 ++++
|
||||
src/qemu/qemu_driver.c | 1 +
|
||||
src/qemu/qemu_migration.c | 7 +++++++
|
||||
src/qemu/qemu_monitor.c | 1 +
|
||||
src/qemu/qemu_monitor.h | 1 +
|
||||
src/qemu/qemu_monitor_json.c | 1 +
|
||||
src/qemu/qemu_process.c | 4 ++++
|
||||
10 files changed, 23 insertions(+)
|
||||
|
||||
diff --git a/src/conf/virdomainjob.c b/src/conf/virdomainjob.c
|
||||
index 38f08f1d18..2d5a857a8c 100644
|
||||
--- a/src/conf/virdomainjob.c
|
||||
+++ b/src/conf/virdomainjob.c
|
||||
@@ -106,6 +106,7 @@ virDomainJobStatusToType(virDomainJobStatus status)
|
||||
case VIR_DOMAIN_JOB_STATUS_HYPERVISOR_COMPLETED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED:
|
||||
+ case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
return VIR_DOMAIN_JOB_UNBOUNDED;
|
||||
|
||||
diff --git a/src/conf/virdomainjob.h b/src/conf/virdomainjob.h
|
||||
index 0d62bab287..8b2dccd298 100644
|
||||
--- a/src/conf/virdomainjob.h
|
||||
+++ b/src/conf/virdomainjob.h
|
||||
@@ -89,6 +89,7 @@ typedef enum {
|
||||
VIR_DOMAIN_JOB_STATUS_PAUSED,
|
||||
VIR_DOMAIN_JOB_STATUS_POSTCOPY,
|
||||
VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED,
|
||||
+ VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER,
|
||||
VIR_DOMAIN_JOB_STATUS_COMPLETED,
|
||||
VIR_DOMAIN_JOB_STATUS_FAILED,
|
||||
VIR_DOMAIN_JOB_STATUS_CANCELED,
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index f063695421..c7dedf88b1 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -1873,6 +1873,8 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv)
|
||||
virHashRemoveAll(priv->statsSchema);
|
||||
|
||||
g_slist_free_full(g_steal_pointer(&priv->threadContextAliases), g_free);
|
||||
+
|
||||
+ priv->migrationRecoverSetup = false;
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
|
||||
index d777559119..604a8ddb6f 100644
|
||||
--- a/src/qemu/qemu_domain.h
|
||||
+++ b/src/qemu/qemu_domain.h
|
||||
@@ -198,6 +198,10 @@ struct _qemuDomainObjPrivate {
|
||||
* private XML. */
|
||||
virBitmap *migrationCaps;
|
||||
|
||||
+ /* True if QEMU supports "postcopy-recover-setup" migration state. Checked
|
||||
+ * QEMU enters the state, not to be stored in private XML. */
|
||||
+ bool migrationRecoverSetup;
|
||||
+
|
||||
/* true if qemu-pr-helper process is running for the domain */
|
||||
bool prDaemonRunning;
|
||||
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index 42814834d4..e3df946478 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -11940,6 +11940,7 @@ qemuDomainGetJobInfoMigrationStats(virDomainObj *vm,
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED:
|
||||
+ case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
if (qemuMigrationAnyFetchStats(vm, VIR_ASYNC_JOB_NONE,
|
||||
jobData, NULL) < 0)
|
||||
return -1;
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index d67cae56f6..70318e26f3 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -1812,6 +1812,10 @@ qemuMigrationUpdateJobType(virDomainJobData *jobData)
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY;
|
||||
break;
|
||||
|
||||
+ case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
+ jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER;
|
||||
+ break;
|
||||
+
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED:
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_POSTCOPY_PAUSED;
|
||||
break;
|
||||
@@ -1953,6 +1957,7 @@ qemuMigrationJobCheckStatus(virDomainObj *vm,
|
||||
case VIR_DOMAIN_JOB_STATUS_MIGRATING:
|
||||
case VIR_DOMAIN_JOB_STATUS_HYPERVISOR_COMPLETED:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
+ case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
break;
|
||||
}
|
||||
@@ -2038,6 +2043,7 @@ qemuMigrationAnyCompleted(virDomainObj *vm,
|
||||
case VIR_DOMAIN_JOB_STATUS_MIGRATING:
|
||||
case VIR_DOMAIN_JOB_STATUS_POSTCOPY:
|
||||
case VIR_DOMAIN_JOB_STATUS_PAUSED:
|
||||
+ case VIR_DOMAIN_JOB_STATUS_POSTCOPY_RECOVER:
|
||||
/* The migration was aborted by us rather than QEMU itself. */
|
||||
jobData->status = VIR_DOMAIN_JOB_STATUS_FAILED;
|
||||
return -2;
|
||||
@@ -4686,6 +4692,7 @@ qemuMigrationSrcIsCanceled(virDomainObj *vm)
|
||||
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
+ case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_PRE_SWITCHOVER:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_DEVICE:
|
||||
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
|
||||
index b1c0c6a064..7f65c23748 100644
|
||||
--- a/src/qemu/qemu_monitor.c
|
||||
+++ b/src/qemu/qemu_monitor.c
|
||||
@@ -152,6 +152,7 @@ VIR_ENUM_IMPL(qemuMonitorMigrationStatus,
|
||||
"postcopy-active",
|
||||
"postcopy-paused",
|
||||
"postcopy-recover",
|
||||
+ "postcopy-recover-setup",
|
||||
"completed",
|
||||
"failed",
|
||||
"cancelling",
|
||||
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
|
||||
index 8dde3f9fff..70b230ec5b 100644
|
||||
--- a/src/qemu/qemu_monitor.h
|
||||
+++ b/src/qemu/qemu_monitor.h
|
||||
@@ -762,6 +762,7 @@ typedef enum {
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER,
|
||||
+ QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_COMPLETED,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_ERROR,
|
||||
QEMU_MONITOR_MIGRATION_STATUS_CANCELLING,
|
||||
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
||||
index 89ea33a3ab..b052d2c712 100644
|
||||
--- a/src/qemu/qemu_monitor_json.c
|
||||
+++ b/src/qemu/qemu_monitor_json.c
|
||||
@@ -2968,6 +2968,7 @@ qemuMonitorJSONGetMigrationStatsReply(virJSONValue *reply,
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_PAUSED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
+ case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_COMPLETED:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_CANCELLING:
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_PRE_SWITCHOVER:
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
||||
index bea42d38c6..d23c3f98c7 100644
|
||||
--- a/src/qemu/qemu_process.c
|
||||
+++ b/src/qemu/qemu_process.c
|
||||
@@ -1500,6 +1500,10 @@ qemuProcessHandleMigrationStatus(qemuMonitor *mon G_GNUC_UNUSED,
|
||||
}
|
||||
break;
|
||||
|
||||
+ case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP:
|
||||
+ priv->migrationRecoverSetup = true;
|
||||
+ break;
|
||||
+
|
||||
case QEMU_MONITOR_MIGRATION_STATUS_POSTCOPY_RECOVER:
|
||||
if (virDomainObjIsFailedPostcopy(vm, vm->job)) {
|
||||
int eventType = -1;
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,98 @@
|
||||
From 8d2acfa55b9c9f522c848439e8bcdad303681658 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <8d2acfa55b9c9f522c848439e8bcdad303681658.1730734026.git.jdenemar@redhat.com>
|
||||
From: Jiri Denemark <jdenemar@redhat.com>
|
||||
Date: Thu, 8 Aug 2024 13:02:08 +0200
|
||||
Subject: [PATCH] qemu: Avoid false failure when resuming post-copy migration
|
||||
|
||||
Depending on timing between QEMU and libvirt an attempt to resume failed
|
||||
post-copy migration could immediately report a failure in post-copy
|
||||
phase again even though the migration actually resumed and is
|
||||
progressing just fine.
|
||||
|
||||
This is caused by QEMU reporting the original migration state (i.e.,
|
||||
postcopy-paused) until migration is successfully resumed and QEMU
|
||||
switches to postcopy-active. QEMU 9.1 introduced a new
|
||||
postcopy-recover-setup migration state which is entered immediately
|
||||
after requesting migration to be resumed and we can reliably wait for
|
||||
the migration to either continue or fail without being confused by the
|
||||
old state.
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22166
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 11f6773f198636b80e73fb3f69adc83554860172)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-63877
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_migration.c | 25 ++++++++++++++++++++++++-
|
||||
1 file changed, 24 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 70318e26f3..a1ebb621d1 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -1972,6 +1972,7 @@ enum qemuMigrationCompletedFlags {
|
||||
QEMU_MIGRATION_COMPLETED_CHECK_STORAGE = (1 << 1),
|
||||
QEMU_MIGRATION_COMPLETED_POSTCOPY = (1 << 2),
|
||||
QEMU_MIGRATION_COMPLETED_PRE_SWITCHOVER = (1 << 3),
|
||||
+ QEMU_MIRGATION_COMPLETED_RECOVERY = (1 << 4),
|
||||
};
|
||||
|
||||
|
||||
@@ -2033,6 +2034,16 @@ qemuMigrationAnyCompleted(virDomainObj *vm,
|
||||
return 1;
|
||||
}
|
||||
|
||||
+ /* When QEMU is new enough to enter postcopy-recover-setup state during
|
||||
+ * post-copy recovery, the source waits for the recovery to start
|
||||
+ * before letting the destination wait for migration to complete.
|
||||
+ */
|
||||
+ if (flags & QEMU_MIRGATION_COMPLETED_RECOVERY &&
|
||||
+ jobData->status == VIR_DOMAIN_JOB_STATUS_POSTCOPY) {
|
||||
+ VIR_DEBUG("Post-copy recovery active");
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
if (jobData->status == VIR_DOMAIN_JOB_STATUS_HYPERVISOR_COMPLETED)
|
||||
return 1;
|
||||
else
|
||||
@@ -5131,6 +5142,7 @@ qemuMigrationSrcResume(virDomainObj *vm,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
qemuMigrationSpec *spec,
|
||||
+ virConnectPtr dconn,
|
||||
unsigned int flags)
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
@@ -5161,6 +5173,17 @@ qemuMigrationSrcResume(virDomainObj *vm,
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
+ /* Wait for postcopy recovery to start (or fail) if QEMU is new enough to
|
||||
+ * support postcopy-recover-setup migration state. */
|
||||
+ if (priv->migrationRecoverSetup) {
|
||||
+ VIR_DEBUG("Waiting for post-copy recovery to start");
|
||||
+ if (qemuMigrationSrcWaitForCompletion(vm, VIR_ASYNC_JOB_MIGRATION_OUT, dconn,
|
||||
+ QEMU_MIRGATION_COMPLETED_RECOVERY) < 0)
|
||||
+ return -1;
|
||||
+ } else {
|
||||
+ VIR_WARN("QEMU is too old, we may report a failure in post-copy phase even though the migration may be running just fine");
|
||||
+ }
|
||||
+
|
||||
if (qemuMigrationCookieFormat(mig, driver, vm,
|
||||
QEMU_MIGRATION_SOURCE,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -5265,7 +5288,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
|
||||
if (flags & VIR_MIGRATE_POSTCOPY_RESUME) {
|
||||
ret = qemuMigrationSrcResume(vm, migParams, cookiein, cookieinlen,
|
||||
- cookieout, cookieoutlen, &spec, flags);
|
||||
+ cookieout, cookieoutlen, &spec, dconn, flags);
|
||||
} else {
|
||||
ret = qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,124 @@
|
||||
From 53b691e4d85f8a442f14ecf4b3bf0b17d607fb2b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <53b691e4d85f8a442f14ecf4b3bf0b17d607fb2b.1720800605.git.jdenemar@redhat.com>
|
||||
From: Jiri Denemark <jdenemar@redhat.com>
|
||||
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 <jdenemar@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit bec903cae84c21850d47a1b4d3ab57ca81189519)
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
---
|
||||
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
|
@ -1,208 +0,0 @@
|
||||
From 8fbc827a89ef1163b64d39a2ff9b1c067ea82b63 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <8fbc827a89ef1163b64d39a2ff9b1c067ea82b63.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Fri, 5 Jan 2024 18:42:13 +0100
|
||||
Subject: [PATCH] qemu: Introduce QEMU_CAPS_SMP_CLUSTERS
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit beb27dc61ed4bfe60ca32ec2cbbc937215f9e139)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_capabilities.c | 2 ++
|
||||
src/qemu/qemu_capabilities.h | 1 +
|
||||
tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 +
|
||||
14 files changed, 15 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||
index 3d35333f09..a4d42b40ed 100644
|
||||
--- a/src/qemu/qemu_capabilities.c
|
||||
+++ b/src/qemu/qemu_capabilities.c
|
||||
@@ -699,6 +699,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||
"run-with.async-teardown", /* QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN */
|
||||
"virtio-blk-vhost-vdpa", /* QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA */
|
||||
"virtio-blk.iothread-mapping", /* QEMU_CAPS_VIRTIO_BLK_IOTHREAD_MAPPING */
|
||||
+ "smp-clusters", /* QEMU_CAPS_SMP_CLUSTERS */
|
||||
);
|
||||
|
||||
|
||||
@@ -1552,6 +1553,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsQMPSchemaQueries[] = {
|
||||
{ "query-display-options/ret-type/+sdl", QEMU_CAPS_SDL },
|
||||
{ "query-display-options/ret-type/+egl-headless", QEMU_CAPS_EGL_HEADLESS },
|
||||
{ "query-hotpluggable-cpus/ret-type/props/die-id", QEMU_CAPS_SMP_DIES },
|
||||
+ { "query-hotpluggable-cpus/ret-type/props/cluster-id", QEMU_CAPS_SMP_CLUSTERS },
|
||||
{ "query-named-block-nodes/arg-type/flat", QEMU_CAPS_QMP_QUERY_NAMED_BLOCK_NODES_FLAT },
|
||||
{ "screendump/arg-type/device", QEMU_CAPS_SCREENDUMP_DEVICE },
|
||||
{ "set-numa-node/arg-type/+hmat-lb", QEMU_CAPS_NUMA_HMAT },
|
||||
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
||||
index 279e9a8273..a353750670 100644
|
||||
--- a/src/qemu/qemu_capabilities.h
|
||||
+++ b/src/qemu/qemu_capabilities.h
|
||||
@@ -678,6 +678,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||
QEMU_CAPS_RUN_WITH_ASYNC_TEARDOWN, /* asynchronous teardown -run-with async-teardown=on|off */
|
||||
QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA, /* virtio-blk-vhost-vdpa block driver */
|
||||
QEMU_CAPS_VIRTIO_BLK_IOTHREAD_MAPPING, /* virtio-blk supports per-virtqueue iothread mapping */
|
||||
+ QEMU_CAPS_SMP_CLUSTERS, /* -smp clusters= */
|
||||
|
||||
QEMU_CAPS_LAST /* this must always be the last item */
|
||||
} virQEMUCapsFlags;
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml b/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml
|
||||
index 4315241d1d..536524cf18 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.1.0_ppc64.xml
|
||||
@@ -154,6 +154,7 @@
|
||||
<flag name='virtio-crypto'/>
|
||||
<flag name='pvpanic-pci'/>
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>7001000</version>
|
||||
<microcodeVersion>42900244</microcodeVersion>
|
||||
<package>v7.1.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml
|
||||
index bd84750dc5..58e1111982 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.1.0_x86_64.xml
|
||||
@@ -188,6 +188,7 @@
|
||||
<flag name='virtio-crypto'/>
|
||||
<flag name='pvpanic-pci'/>
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>7001000</version>
|
||||
<microcodeVersion>43100244</microcodeVersion>
|
||||
<package>v7.1.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml
|
||||
index a1fc441412..127b8ee4c2 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml
|
||||
@@ -149,6 +149,7 @@
|
||||
<flag name='virtio-crypto'/>
|
||||
<flag name='pvpanic-pci'/>
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>7002000</version>
|
||||
<microcodeVersion>0</microcodeVersion>
|
||||
<package>qemu-7.2.0-6.fc37</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
|
||||
index 06a01a2c4c..a30ec3c164 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
|
||||
@@ -192,6 +192,7 @@
|
||||
<flag name='cryptodev-backend-lkcf'/>
|
||||
<flag name='pvpanic-pci'/>
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>7002000</version>
|
||||
<microcodeVersion>43100245</microcodeVersion>
|
||||
<package>v7.2.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
|
||||
index 8ac1529c30..24ac7b8f6e 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
|
||||
@@ -192,6 +192,7 @@
|
||||
<flag name='cryptodev-backend-lkcf'/>
|
||||
<flag name='pvpanic-pci'/>
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>7002000</version>
|
||||
<microcodeVersion>43100245</microcodeVersion>
|
||||
<package>v7.2.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml
|
||||
index 31300d3d31..3f2acb5018 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.0.0_riscv64.xml
|
||||
@@ -138,6 +138,7 @@
|
||||
<flag name='virtio-crypto'/>
|
||||
<flag name='pvpanic-pci'/>
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>7002050</version>
|
||||
<microcodeVersion>0</microcodeVersion>
|
||||
<package>v7.2.0-333-g222059a0fc</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
|
||||
index c2fa8eb028..85869f6b5d 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
|
||||
@@ -196,6 +196,7 @@
|
||||
<flag name='virtio-gpu.blob'/>
|
||||
<flag name='rbd-encryption-layering'/>
|
||||
<flag name='rbd-encryption-luks-any'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>8000000</version>
|
||||
<microcodeVersion>43100244</microcodeVersion>
|
||||
<package>v8.0.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
|
||||
index 427ee9d5c7..19422f08fa 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
|
||||
@@ -112,6 +112,7 @@
|
||||
<flag name='rbd-encryption-layering'/>
|
||||
<flag name='rbd-encryption-luks-any'/>
|
||||
<flag name='run-with.async-teardown'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>8000050</version>
|
||||
<microcodeVersion>39100245</microcodeVersion>
|
||||
<package>v8.0.0-1270-g1c12355b</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
|
||||
index d266dd0f31..0caee53550 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
|
||||
@@ -198,6 +198,7 @@
|
||||
<flag name='qcow2-discard-no-unref'/>
|
||||
<flag name='run-with.async-teardown'/>
|
||||
<flag name='virtio-blk-vhost-vdpa'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>8001000</version>
|
||||
<microcodeVersion>43100245</microcodeVersion>
|
||||
<package>v8.1.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
||||
index 40d490c1c0..54fd349365 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
||||
@@ -162,6 +162,7 @@
|
||||
<flag name='rbd-encryption-luks-any'/>
|
||||
<flag name='qcow2-discard-no-unref'/>
|
||||
<flag name='run-with.async-teardown'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>8002000</version>
|
||||
<microcodeVersion>61700246</microcodeVersion>
|
||||
<package>v8.2.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
||||
index ee52952702..8a6527810a 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
||||
@@ -199,6 +199,7 @@
|
||||
<flag name='qcow2-discard-no-unref'/>
|
||||
<flag name='run-with.async-teardown'/>
|
||||
<flag name='virtio-blk-vhost-vdpa'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>8002000</version>
|
||||
<microcodeVersion>43100246</microcodeVersion>
|
||||
<package>v8.2.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
||||
index 65d86f7016..b4c3b1bae3 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
||||
@@ -200,6 +200,7 @@
|
||||
<flag name='run-with.async-teardown'/>
|
||||
<flag name='virtio-blk-vhost-vdpa'/>
|
||||
<flag name='virtio-blk.iothread-mapping'/>
|
||||
+ <flag name='smp-clusters'/>
|
||||
<version>8002050</version>
|
||||
<microcodeVersion>43100245</microcodeVersion>
|
||||
<package>v8.2.0-196-g7425b6277f</package>
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,573 @@
|
||||
From ff1e138d6f7db4c65bb0ebb7ffbffdb59c173ad2 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <ff1e138d6f7db4c65bb0ebb7ffbffdb59c173ad2.1729611062.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 09:51:20 +0200
|
||||
Subject: [PATCH] qemu: Introduce and wire in
|
||||
'VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES'
|
||||
|
||||
The new 'VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES' migration
|
||||
parameter allows users of migration to pass in a list of disks where
|
||||
zero-detection (which avoids transferring the zeroed-blocks) should be
|
||||
enabled for the migration connection. This comes at the cost of extra
|
||||
CPU cycles needed to check each block if it's all-zero.
|
||||
|
||||
This is useful for storage backends where information about the
|
||||
allocation state of a block is not available and thus without this the
|
||||
image would become fully allocated on the destination.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 621f879adf98e2c93ac5c8c869733a57f06cd9aa)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
include/libvirt/libvirt-domain.h | 13 ++++
|
||||
src/qemu/qemu_driver.c | 20 ++++--
|
||||
src/qemu/qemu_migration.c | 105 +++++++++++++++++++++++--------
|
||||
src/qemu/qemu_migration.h | 4 ++
|
||||
4 files changed, 110 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
|
||||
index 8f00e9e959..a6afacbc22 100644
|
||||
--- a/include/libvirt/libvirt-domain.h
|
||||
+++ b/include/libvirt/libvirt-domain.h
|
||||
@@ -1240,6 +1240,19 @@ typedef enum {
|
||||
*/
|
||||
# define VIR_MIGRATE_PARAM_MIGRATE_DISKS "migrate_disks"
|
||||
|
||||
+/**
|
||||
+ * VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES:
|
||||
+ *
|
||||
+ * virDomainMigrate* params multiple field: The multiple values that list
|
||||
+ * the block devices for which zero detection (to avoid transferring zero blocks)
|
||||
+ * is to be enabled. This may increase CPU overhead of the migration. At the
|
||||
+ * moment this is only supported by the QEMU driver but not for the tunnelled
|
||||
+ * migration.
|
||||
+ *
|
||||
+ * Since: 10.9.0
|
||||
+ */
|
||||
+# define VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES "migrate_disks_detect_zeroes"
|
||||
+
|
||||
/**
|
||||
* VIR_MIGRATE_PARAM_DISKS_PORT:
|
||||
*
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index 7bf1788e7c..42814834d4 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -10764,7 +10764,7 @@ qemuDomainMigratePerform(virDomainPtr dom,
|
||||
* Consume any cookie we were able to decode though
|
||||
*/
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, NULL,
|
||||
- NULL, dconnuri, uri, NULL, NULL, NULL, 0,
|
||||
+ NULL, dconnuri, uri, NULL, NULL, NULL, NULL, 0,
|
||||
NULL,
|
||||
migParams, cookie, cookielen,
|
||||
NULL, NULL, /* No output cookies in v2 */
|
||||
@@ -10840,7 +10840,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
||||
}
|
||||
|
||||
return qemuMigrationSrcBegin(domain->conn, vm, xmlin, dname,
|
||||
- cookieout, cookieoutlen, NULL, flags);
|
||||
+ cookieout, cookieoutlen, NULL, NULL, flags);
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -10854,6 +10854,7 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
const char *xmlin = NULL;
|
||||
const char *dname = NULL;
|
||||
g_autofree const char **migrate_disks = NULL;
|
||||
+ g_autofree const char **migrate_disks_detect_zeroes = NULL;
|
||||
virDomainObj *vm;
|
||||
|
||||
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
|
||||
@@ -10871,6 +10872,10 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
virTypedParamsGetStringList(params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
&migrate_disks);
|
||||
|
||||
+ virTypedParamsGetStringList(params, nparams,
|
||||
+ VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES,
|
||||
+ &migrate_disks_detect_zeroes);
|
||||
+
|
||||
if (!(vm = qemuDomainObjFromDomain(domain)))
|
||||
return NULL;
|
||||
|
||||
@@ -10881,7 +10886,8 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
|
||||
return qemuMigrationSrcBegin(domain->conn, vm, xmlin, dname,
|
||||
cookieout, cookieoutlen,
|
||||
- migrate_disks, flags);
|
||||
+ migrate_disks, migrate_disks_detect_zeroes,
|
||||
+ flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -11162,7 +11168,7 @@ qemuDomainMigratePerform3(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, xmlin, NULL,
|
||||
- dconnuri, uri, NULL, NULL, NULL, 0,
|
||||
+ dconnuri, uri, NULL, NULL, NULL, NULL, 0,
|
||||
NULL, migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -11193,6 +11199,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
const char *graphicsuri = NULL;
|
||||
const char *listenAddress = NULL;
|
||||
g_autofree const char **migrate_disks = NULL;
|
||||
+ g_autofree const char **migrate_disks_detect_zeroes = NULL;
|
||||
unsigned long long bandwidth = 0;
|
||||
int nbdPort = 0;
|
||||
g_autoptr(qemuMigrationParams) migParams = NULL;
|
||||
@@ -11249,6 +11256,9 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
|
||||
virTypedParamsGetStringList(params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
&migrate_disks);
|
||||
+ virTypedParamsGetStringList(params, nparams,
|
||||
+ VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES,
|
||||
+ &migrate_disks_detect_zeroes);
|
||||
|
||||
if (flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) ||
|
||||
migrate_disks) {
|
||||
@@ -11271,7 +11281,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, dom_xml, persist_xml,
|
||||
dconnuri, uri, graphicsuri, listenAddress,
|
||||
- migrate_disks, nbdPort,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes, nbdPort,
|
||||
nbdURI, migParams,
|
||||
cookiein, cookieinlen, cookieout, cookieoutlen,
|
||||
flags, dname, bandwidth, true);
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 658251a666..5ebe4748ce 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -1022,7 +1022,8 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDef *disk,
|
||||
int port,
|
||||
const char *socket,
|
||||
const char *tlsAlias,
|
||||
- const char *tlsHostname)
|
||||
+ const char *tlsHostname,
|
||||
+ bool detect_zeroes)
|
||||
{
|
||||
g_autoptr(virStorageSource) copysrc = NULL;
|
||||
|
||||
@@ -1031,6 +1032,9 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDef *disk,
|
||||
copysrc->protocol = VIR_STORAGE_NET_PROTOCOL_NBD;
|
||||
copysrc->format = VIR_STORAGE_FILE_RAW;
|
||||
|
||||
+ if (detect_zeroes)
|
||||
+ copysrc->detect_zeroes = VIR_DOMAIN_DISK_DETECT_ZEROES_ON;
|
||||
+
|
||||
copysrc->backingStore = virStorageSourceNew();
|
||||
|
||||
if (!(copysrc->path = qemuAliasDiskDriveFromDisk(disk)))
|
||||
@@ -1067,7 +1071,8 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virDomainObj *vm,
|
||||
unsigned int mirror_shallow,
|
||||
const char *tlsAlias,
|
||||
const char *tlsHostname,
|
||||
- bool syncWrites)
|
||||
+ bool syncWrites,
|
||||
+ bool detect_zeroes)
|
||||
{
|
||||
g_autoptr(qemuBlockStorageSourceAttachData) data = NULL;
|
||||
qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
|
||||
@@ -1081,7 +1086,8 @@ qemuMigrationSrcNBDStorageCopyBlockdev(virDomainObj *vm,
|
||||
VIR_DEBUG("starting blockdev mirror for disk=%s to host=%s", disk->dst, host);
|
||||
|
||||
if (!(copysrc = qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(disk, host, port, socket,
|
||||
- tlsAlias, tlsHostname)))
|
||||
+ tlsAlias, tlsHostname,
|
||||
+ detect_zeroes)))
|
||||
return -1;
|
||||
|
||||
if (!(data = qemuBlockStorageSourceAttachPrepareBlockdev(copysrc,
|
||||
@@ -1123,6 +1129,7 @@ qemuMigrationSrcNBDStorageCopyOne(virDomainObj *vm,
|
||||
bool mirror_shallow,
|
||||
const char *tlsAlias,
|
||||
const char *tlsHostname,
|
||||
+ bool detect_zeroes,
|
||||
unsigned int flags)
|
||||
{
|
||||
qemuDomainDiskPrivate *diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
|
||||
@@ -1147,7 +1154,8 @@ qemuMigrationSrcNBDStorageCopyOne(virDomainObj *vm,
|
||||
mirror_shallow,
|
||||
tlsAlias,
|
||||
tlsHostname,
|
||||
- syncWrites);
|
||||
+ syncWrites,
|
||||
+ detect_zeroes);
|
||||
|
||||
if (rc == 0) {
|
||||
diskPriv->migrating = true;
|
||||
@@ -1183,6 +1191,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
||||
const char *host,
|
||||
unsigned long speed,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
virConnectPtr dconn,
|
||||
const char *tlsAlias,
|
||||
const char *tlsHostname,
|
||||
@@ -1254,15 +1263,20 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
||||
|
||||
for (i = 0; i < vm->def->ndisks; i++) {
|
||||
virDomainDiskDef *disk = vm->def->disks[i];
|
||||
+ bool detect_zeroes = false;
|
||||
|
||||
/* check whether disk should be migrated */
|
||||
if (!qemuMigrationAnyCopyDisk(disk, migrate_disks))
|
||||
continue;
|
||||
|
||||
+ if (migrate_disks_detect_zeroes)
|
||||
+ detect_zeroes = g_strv_contains(migrate_disks_detect_zeroes, disk->dst);
|
||||
+
|
||||
if (qemuMigrationSrcNBDStorageCopyOne(vm, disk, host, port,
|
||||
socket,
|
||||
mirror_speed, mirror_shallow,
|
||||
- tlsAlias, tlsHostname, flags) < 0)
|
||||
+ tlsAlias, tlsHostname, detect_zeroes,
|
||||
+ flags) < 0)
|
||||
return -1;
|
||||
|
||||
if (virDomainObjSave(vm, driver->xmlopt, cfg->stateDir) < 0) {
|
||||
@@ -2590,6 +2604,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
unsigned int flags)
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
@@ -2597,10 +2612,10 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, vm=%p, xmlin=%s, dname=%s,"
|
||||
" cookieout=%p, cookieoutlen=%p,"
|
||||
- " migrate_disks=%p, flags=0x%x",
|
||||
+ " migrate_disks=%p, migrate_disks_detect_zeroes=%p, flags=0x%x",
|
||||
driver, vm, NULLSTR(xmlin), NULLSTR(dname),
|
||||
cookieout, cookieoutlen,
|
||||
- migrate_disks, flags);
|
||||
+ migrate_disks, migrate_disks_detect_zeroes, flags);
|
||||
|
||||
/* Only set the phase if we are inside VIR_ASYNC_JOB_MIGRATION_OUT.
|
||||
* Otherwise we will start the async job later in the perform phase losing
|
||||
@@ -2667,6 +2682,10 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
qemuMigrationSrcBeginPhaseValidateDiskTargetList(vm, migrate_disks) < 0)
|
||||
return NULL;
|
||||
|
||||
+ if (migrate_disks_detect_zeroes &&
|
||||
+ qemuMigrationSrcBeginPhaseValidateDiskTargetList(vm, migrate_disks_detect_zeroes) < 0)
|
||||
+ return NULL;
|
||||
+
|
||||
priv->nbdPort = 0;
|
||||
|
||||
if (qemuMigrationHasAnyStorageMigrationDisks(vm->def, migrate_disks))
|
||||
@@ -2677,6 +2696,13 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
_("use of 'VIR_MIGRATE_PARAM_MIGRATE_DISKS' requires use of 'VIR_MIGRATE_NON_SHARED_DISK' or 'VIR_MIGRATE_NON_SHARED_INC' flag"));
|
||||
return NULL;
|
||||
}
|
||||
+
|
||||
+ if (migrate_disks_detect_zeroes) {
|
||||
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
+ _("use of 'VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES' requires use of 'VIR_MIGRATE_NON_SHARED_DISK' or 'VIR_MIGRATE_NON_SHARED_INC' flag"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
if (virDomainDefHasMemoryHotplug(vm->def) ||
|
||||
@@ -2827,6 +2853,7 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
unsigned int flags)
|
||||
{
|
||||
virQEMUDriver *driver = conn->privateData;
|
||||
@@ -2876,7 +2903,9 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
|
||||
if (!(xml = qemuMigrationSrcBeginPhase(driver, vm, xmlin, dname,
|
||||
cookieout, cookieoutlen,
|
||||
- migrate_disks, flags)))
|
||||
+ migrate_disks,
|
||||
+ migrate_disks_detect_zeroes,
|
||||
+ flags)))
|
||||
goto endjob;
|
||||
|
||||
if ((flags & VIR_MIGRATE_CHANGE_PROTECTION)) {
|
||||
@@ -4722,6 +4751,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
virConnectPtr dconn,
|
||||
const char *graphicsuri,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
qemuMigrationParams *migParams,
|
||||
const char *nbdURI)
|
||||
{
|
||||
@@ -4747,11 +4777,11 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, "
|
||||
"spec=%p (dest=%d, fwd=%d), dconn=%p, graphicsuri=%s, "
|
||||
- "migrate_disks=%p",
|
||||
+ "migrate_disks=%p, migrate_disks_detect_zeroes=%p",
|
||||
driver, vm, NULLSTR(cookiein), cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
spec, spec->destType, spec->fwdType, dconn,
|
||||
- NULLSTR(graphicsuri), migrate_disks);
|
||||
+ NULLSTR(graphicsuri), migrate_disks, migrate_disks_detect_zeroes);
|
||||
|
||||
if (storageMigration)
|
||||
storageMigration = qemuMigrationHasAnyStorageMigrationDisks(vm->def,
|
||||
@@ -4889,6 +4919,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
host,
|
||||
priv->migMaxBandwidth,
|
||||
migrate_disks,
|
||||
+ migrate_disks_detect_zeroes,
|
||||
dconn, tlsAlias, tlsHostname,
|
||||
nbdURI, flags) < 0) {
|
||||
goto error;
|
||||
@@ -5146,6 +5177,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
virConnectPtr dconn,
|
||||
const char *graphicsuri,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
qemuMigrationParams *migParams,
|
||||
const char *nbdURI)
|
||||
{
|
||||
@@ -5156,10 +5188,10 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, vm=%p, uri=%s, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, "
|
||||
- "graphicsuri=%s, migrate_disks=%p",
|
||||
+ "graphicsuri=%s, migrate_disks=%p, migrate_disks_detect_zeroes=%p",
|
||||
driver, vm, uri, NULLSTR(cookiein), cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
- NULLSTR(graphicsuri), migrate_disks);
|
||||
+ NULLSTR(graphicsuri), migrate_disks, migrate_disks_detect_zeroes);
|
||||
|
||||
if (!(uribits = qemuMigrationAnyParseURI(uri, NULL)))
|
||||
return -1;
|
||||
@@ -5225,7 +5257,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
ret = qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
&spec, dconn, graphicsuri,
|
||||
- migrate_disks,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes,
|
||||
migParams, nbdURI);
|
||||
}
|
||||
|
||||
@@ -5286,9 +5318,11 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
+ /* Migration with NBD is not supported with _TUNNELLED, thus
|
||||
+ * 'migrate_disks_detect_zeroes' is NULL here */
|
||||
ret = qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource, &spec,
|
||||
- dconn, graphicsuri, migrate_disks,
|
||||
+ dconn, graphicsuri, migrate_disks, NULL,
|
||||
migParams, NULL);
|
||||
|
||||
cleanup:
|
||||
@@ -5328,7 +5362,7 @@ qemuMigrationSrcPerformResume(virQEMUDriver *driver,
|
||||
ret = qemuMigrationSrcPerformNative(driver, vm, NULL, NULL, uri,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags,
|
||||
- 0, NULL, NULL, NULL, migParams, NULL);
|
||||
+ 0, NULL, NULL, NULL, NULL, migParams, NULL);
|
||||
|
||||
virCloseCallbacksDomainAdd(vm, conn, qemuMigrationAnyConnectionClosed);
|
||||
|
||||
@@ -5436,7 +5470,7 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver,
|
||||
cookie, cookielen,
|
||||
NULL, NULL, /* No out cookie with v2 migration */
|
||||
flags, resource, dconn, NULL, NULL,
|
||||
- migParams, NULL);
|
||||
+ NULL, migParams, NULL);
|
||||
|
||||
/* Perform failed. Make sure Finish doesn't overwrite the error */
|
||||
if (ret < 0)
|
||||
@@ -5499,6 +5533,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
qemuMigrationParams *migParams,
|
||||
@@ -5525,11 +5560,11 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, dconnuri=%s, vm=%p, xmlin=%s, "
|
||||
"dname=%s, uri=%s, graphicsuri=%s, listenAddress=%s, "
|
||||
- "migrate_disks=%p, nbdPort=%d, nbdURI=%s, "
|
||||
+ "migrate_disks=%p, migrate_disks_detect_zeroes=%p, nbdPort=%d, nbdURI=%s, "
|
||||
"bandwidth=%llu, useParams=%d, flags=0x%x",
|
||||
driver, sconn, dconn, NULLSTR(dconnuri), vm, NULLSTR(xmlin),
|
||||
NULLSTR(dname), NULLSTR(uri), NULLSTR(graphicsuri),
|
||||
- NULLSTR(listenAddress), migrate_disks, nbdPort,
|
||||
+ NULLSTR(listenAddress), migrate_disks, migrate_disks_detect_zeroes, nbdPort,
|
||||
NULLSTR(nbdURI), bandwidth, useParams, flags);
|
||||
|
||||
/* Unlike the virDomainMigrateVersion3 counterpart, we don't need
|
||||
@@ -5543,7 +5578,9 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
} else {
|
||||
dom_xml = qemuMigrationSrcBeginPhase(driver, vm, xmlin, dname,
|
||||
&cookieout, &cookieoutlen,
|
||||
- migrate_disks, flags);
|
||||
+ migrate_disks,
|
||||
+ migrate_disks_detect_zeroes,
|
||||
+ flags);
|
||||
}
|
||||
if (!dom_xml)
|
||||
goto cleanup;
|
||||
@@ -5588,6 +5625,15 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
*d) < 0)
|
||||
goto cleanup;
|
||||
}
|
||||
+ if (migrate_disks_detect_zeroes) {
|
||||
+ const char **d;
|
||||
+
|
||||
+ for (d = migrate_disks_detect_zeroes; *d; d++)
|
||||
+ if (virTypedParamsAddString(¶ms, &nparams, &maxparams,
|
||||
+ VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES,
|
||||
+ *d) < 0)
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
if (nbdPort &&
|
||||
virTypedParamsAddInt(¶ms, &nparams, &maxparams,
|
||||
VIR_MIGRATE_PARAM_DISKS_PORT,
|
||||
@@ -5701,7 +5747,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
cookiein, cookieinlen,
|
||||
&cookieout, &cookieoutlen,
|
||||
flags, bandwidth, dconn, graphicsuri,
|
||||
- migrate_disks,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes,
|
||||
migParams, nbdURI);
|
||||
}
|
||||
|
||||
@@ -5875,6 +5921,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
qemuMigrationParams *migParams,
|
||||
@@ -5999,7 +6046,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
|
||||
if (*v3proto) {
|
||||
ret = qemuMigrationSrcPerformPeer2Peer3(driver, sconn, dconn, dconnuri, vm, xmlin,
|
||||
persist_xml, dname, uri, graphicsuri,
|
||||
- listenAddress, migrate_disks,
|
||||
+ listenAddress, migrate_disks, migrate_disks_detect_zeroes,
|
||||
nbdPort, nbdURI, migParams, resource,
|
||||
!!useParams, flags);
|
||||
} else {
|
||||
@@ -6036,6 +6083,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
qemuMigrationParams *migParams,
|
||||
@@ -6086,7 +6134,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
|
||||
ret = qemuMigrationSrcPerformPeer2Peer(driver, conn, vm, xmlin, persist_xml,
|
||||
dconnuri, uri, graphicsuri, listenAddress,
|
||||
- migrate_disks, nbdPort,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes, nbdPort,
|
||||
nbdURI,
|
||||
migParams, flags, dname, resource,
|
||||
&v3proto);
|
||||
@@ -6096,7 +6144,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
|
||||
ret = qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_xml, uri, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
- flags, resource, NULL, NULL, NULL,
|
||||
+ flags, resource, NULL, NULL, NULL, NULL,
|
||||
migParams, nbdURI);
|
||||
}
|
||||
if (ret < 0)
|
||||
@@ -6164,6 +6212,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
qemuMigrationParams *migParams,
|
||||
const char *cookiein,
|
||||
int cookieinlen,
|
||||
@@ -6199,7 +6248,8 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
|
||||
if (qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_xml, uri, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
flags, resource, NULL, graphicsuri,
|
||||
- migrate_disks, migParams, nbdURI) < 0)
|
||||
+ migrate_disks, migrate_disks_detect_zeroes,
|
||||
+ migParams, nbdURI) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virCloseCallbacksDomainAdd(vm, conn, qemuMigrationAnyConnectionClosed);
|
||||
@@ -6241,6 +6291,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
qemuMigrationParams *migParams,
|
||||
@@ -6284,7 +6335,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
|
||||
return qemuMigrationSrcPerformJob(driver, conn, vm, xmlin, persist_xml, dconnuri, uri,
|
||||
graphicsuri, listenAddress,
|
||||
- migrate_disks, nbdPort,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes, nbdPort,
|
||||
nbdURI, migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -6300,7 +6351,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
if (v3proto) {
|
||||
return qemuMigrationSrcPerformPhase(driver, conn, vm, xmlin, persist_xml, uri,
|
||||
graphicsuri,
|
||||
- migrate_disks,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes,
|
||||
migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -6309,7 +6360,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
|
||||
return qemuMigrationSrcPerformJob(driver, conn, vm, xmlin, persist_xml, NULL,
|
||||
uri, graphicsuri, listenAddress,
|
||||
- migrate_disks, nbdPort,
|
||||
+ migrate_disks, migrate_disks_detect_zeroes, nbdPort,
|
||||
nbdURI, migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags,
|
||||
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
|
||||
index 4dced4b166..4b7ef9688a 100644
|
||||
--- a/src/qemu/qemu_migration.h
|
||||
+++ b/src/qemu/qemu_migration.h
|
||||
@@ -74,6 +74,8 @@
|
||||
VIR_MIGRATE_PARAM_LISTEN_ADDRESS, VIR_TYPED_PARAM_STRING, \
|
||||
VIR_MIGRATE_PARAM_MIGRATE_DISKS, VIR_TYPED_PARAM_STRING | \
|
||||
VIR_TYPED_PARAM_MULTIPLE, \
|
||||
+ VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES, VIR_TYPED_PARAM_STRING | \
|
||||
+ VIR_TYPED_PARAM_MULTIPLE, \
|
||||
VIR_MIGRATE_PARAM_DISKS_PORT, VIR_TYPED_PARAM_INT, \
|
||||
VIR_MIGRATE_PARAM_COMPRESSION, VIR_TYPED_PARAM_STRING | \
|
||||
VIR_TYPED_PARAM_MULTIPLE, \
|
||||
@@ -123,6 +125,7 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
unsigned int flags);
|
||||
|
||||
virDomainDef *
|
||||
@@ -174,6 +177,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
const char **migrate_disks,
|
||||
+ const char **migrate_disks_detect_zeroes,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
qemuMigrationParams *migParams,
|
||||
--
|
||||
2.47.0
|
@ -1,117 +0,0 @@
|
||||
From 66312c8fea7d122acfd833e495e6b81642baff33 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <66312c8fea7d122acfd833e495e6b81642baff33.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Fri, 5 Jan 2024 18:51:29 +0100
|
||||
Subject: [PATCH] qemu: Make monitor aware of CPU clusters
|
||||
|
||||
This makes it so libvirt can obtain accurate information about
|
||||
guest CPUs from QEMU, and should make it possible to correctly
|
||||
perform operations such as CPU hotplug.
|
||||
|
||||
Of course this is mostly moot at the moment: only aarch64 can use
|
||||
CPU clusters, and CPU hotplug is not yet implemented on that
|
||||
architecture.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 763381df53d5a67804f828cb8db661f694d35296)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_domain.c | 3 ++-
|
||||
src/qemu/qemu_monitor.c | 2 ++
|
||||
src/qemu/qemu_monitor.h | 2 ++
|
||||
src/qemu/qemu_monitor_json.c | 5 +++++
|
||||
4 files changed, 11 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index 3a00fb689e..e2a1bf2c13 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -9900,11 +9900,12 @@ qemuDomainRefreshVcpuInfo(virDomainObj *vm,
|
||||
|
||||
if (validTIDs)
|
||||
VIR_DEBUG("vCPU[%zu] PID %llu is valid "
|
||||
- "(node=%d socket=%d die=%d core=%d thread=%d)",
|
||||
+ "(node=%d socket=%d die=%d cluster=%d core=%d thread=%d)",
|
||||
i, (unsigned long long)info[i].tid,
|
||||
info[i].node_id,
|
||||
info[i].socket_id,
|
||||
info[i].die_id,
|
||||
+ info[i].cluster_id,
|
||||
info[i].core_id,
|
||||
info[i].thread_id);
|
||||
}
|
||||
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
|
||||
index dfad4ee1ea..a1773d86d4 100644
|
||||
--- a/src/qemu/qemu_monitor.c
|
||||
+++ b/src/qemu/qemu_monitor.c
|
||||
@@ -1501,6 +1501,7 @@ qemuMonitorCPUInfoClear(qemuMonitorCPUInfo *cpus,
|
||||
cpus[i].qemu_id = -1;
|
||||
cpus[i].socket_id = -1;
|
||||
cpus[i].die_id = -1;
|
||||
+ cpus[i].cluster_id = -1;
|
||||
cpus[i].core_id = -1;
|
||||
cpus[i].thread_id = -1;
|
||||
cpus[i].node_id = -1;
|
||||
@@ -1658,6 +1659,7 @@ qemuMonitorGetCPUInfoHotplug(struct qemuMonitorQueryHotpluggableCpusEntry *hotpl
|
||||
!vcpus[mainvcpu].online;
|
||||
vcpus[mainvcpu].socket_id = hotplugvcpus[i].socket_id;
|
||||
vcpus[mainvcpu].die_id = hotplugvcpus[i].die_id;
|
||||
+ vcpus[mainvcpu].cluster_id = hotplugvcpus[i].cluster_id;
|
||||
vcpus[mainvcpu].core_id = hotplugvcpus[i].core_id;
|
||||
vcpus[mainvcpu].thread_id = hotplugvcpus[i].thread_id;
|
||||
vcpus[mainvcpu].node_id = hotplugvcpus[i].node_id;
|
||||
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
|
||||
index c4af9b407d..981c609e9f 100644
|
||||
--- a/src/qemu/qemu_monitor.h
|
||||
+++ b/src/qemu/qemu_monitor.h
|
||||
@@ -590,6 +590,7 @@ struct qemuMonitorQueryHotpluggableCpusEntry {
|
||||
int node_id;
|
||||
int socket_id;
|
||||
int die_id;
|
||||
+ int cluster_id;
|
||||
int core_id;
|
||||
int thread_id;
|
||||
|
||||
@@ -613,6 +614,7 @@ struct _qemuMonitorCPUInfo {
|
||||
* all entries are -1 */
|
||||
int socket_id;
|
||||
int die_id;
|
||||
+ int cluster_id;
|
||||
int core_id;
|
||||
int thread_id;
|
||||
int node_id;
|
||||
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
||||
index 9cb0f3d1d8..e114b6bfb1 100644
|
||||
--- a/src/qemu/qemu_monitor_json.c
|
||||
+++ b/src/qemu/qemu_monitor_json.c
|
||||
@@ -7579,12 +7579,14 @@ qemuMonitorJSONProcessHotpluggableCpusReply(virJSONValue *vcpu,
|
||||
entry->node_id = -1;
|
||||
entry->socket_id = -1;
|
||||
entry->die_id = -1;
|
||||
+ entry->cluster_id = -1;
|
||||
entry->core_id = -1;
|
||||
entry->thread_id = -1;
|
||||
|
||||
ignore_value(virJSONValueObjectGetNumberInt(props, "node-id", &entry->node_id));
|
||||
ignore_value(virJSONValueObjectGetNumberInt(props, "socket-id", &entry->socket_id));
|
||||
ignore_value(virJSONValueObjectGetNumberInt(props, "die-id", &entry->die_id));
|
||||
+ ignore_value(virJSONValueObjectGetNumberInt(props, "cluster-id", &entry->cluster_id));
|
||||
ignore_value(virJSONValueObjectGetNumberInt(props, "core-id", &entry->core_id));
|
||||
ignore_value(virJSONValueObjectGetNumberInt(props, "thread-id", &entry->thread_id));
|
||||
|
||||
@@ -7622,6 +7624,9 @@ qemuMonitorQueryHotpluggableCpusEntrySort(const void *p1,
|
||||
if (a->die_id != b->die_id)
|
||||
return a->die_id - b->die_id;
|
||||
|
||||
+ if (a->cluster_id != b->cluster_id)
|
||||
+ return a->cluster_id - b->cluster_id;
|
||||
+
|
||||
if (a->core_id != b->core_id)
|
||||
return a->core_id - b->core_id;
|
||||
|
||||
--
|
||||
2.43.0
|
86
SOURCES/libvirt-qemu-Refactor-default-panic-model.patch
Normal file
86
SOURCES/libvirt-qemu-Refactor-default-panic-model.patch
Normal file
@ -0,0 +1,86 @@
|
||||
From b005e5a27c44632b8d6485e1d4420bd0ab2aa0c2 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b005e5a27c44632b8d6485e1d4420bd0ab2aa0c2.1725606790.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Tue, 27 Aug 2024 15:03:31 +0200
|
||||
Subject: [PATCH] qemu: Refactor default panic model
|
||||
|
||||
Perform decisions based on the architecture and machine type
|
||||
in a single place instead of duplicating them.
|
||||
|
||||
This technically adds new behavior for MODEL_ISA in
|
||||
qemuDomainDefAddDefaultDevices(), but it doesn't make any
|
||||
difference functionally since we don't set addPanicDevice
|
||||
outside of ppc64(le) and s390(x). If we did, the lack of
|
||||
handling for that value would be a latent bug.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 9e1970efa5ac281febffabd57ac5b849117cccb4)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-56451
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_domain.c | 30 ++++++++++++++++++------------
|
||||
1 file changed, 18 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index 1bafe3708a..f169aca599 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -4139,6 +4139,19 @@ qemuDomainGetSCSIControllerModel(const virDomainDef *def,
|
||||
}
|
||||
|
||||
|
||||
+static virDomainPanicModel
|
||||
+qemuDomainDefaultPanicModel(const virDomainDef *def)
|
||||
+{
|
||||
+ if (qemuDomainIsPSeries(def))
|
||||
+ return VIR_DOMAIN_PANIC_MODEL_PSERIES;
|
||||
+
|
||||
+ if (ARCH_IS_S390(def->os.arch))
|
||||
+ return VIR_DOMAIN_PANIC_MODEL_S390;
|
||||
+
|
||||
+ return VIR_DOMAIN_PANIC_MODEL_ISA;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
|
||||
virDomainDef *def,
|
||||
@@ -4386,13 +4399,12 @@ qemuDomainDefAddDefaultDevices(virQEMUDriver *driver,
|
||||
return -1;
|
||||
|
||||
if (addPanicDevice) {
|
||||
+ virDomainPanicModel defaultModel = qemuDomainDefaultPanicModel(def);
|
||||
size_t j;
|
||||
+
|
||||
for (j = 0; j < def->npanics; j++) {
|
||||
if (def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT ||
|
||||
- (ARCH_IS_PPC64(def->os.arch) &&
|
||||
- def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_PSERIES) ||
|
||||
- (ARCH_IS_S390(def->os.arch) &&
|
||||
- def->panics[j]->model == VIR_DOMAIN_PANIC_MODEL_S390))
|
||||
+ def->panics[j]->model == defaultModel)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -6076,14 +6088,8 @@ static int
|
||||
qemuDomainDevicePanicDefPostParse(virDomainPanicDef *panic,
|
||||
const virDomainDef *def)
|
||||
{
|
||||
- if (panic->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT) {
|
||||
- if (qemuDomainIsPSeries(def))
|
||||
- panic->model = VIR_DOMAIN_PANIC_MODEL_PSERIES;
|
||||
- else if (ARCH_IS_S390(def->os.arch))
|
||||
- panic->model = VIR_DOMAIN_PANIC_MODEL_S390;
|
||||
- else
|
||||
- panic->model = VIR_DOMAIN_PANIC_MODEL_ISA;
|
||||
- }
|
||||
+ if (panic->model == VIR_DOMAIN_PANIC_MODEL_DEFAULT)
|
||||
+ panic->model = qemuDomainDefaultPanicModel(def);
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.46.0
|
@ -0,0 +1,80 @@
|
||||
From c438dadf5a2645b1f7d8d44a083751fffdb3b010 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c438dadf5a2645b1f7d8d44a083751fffdb3b010.1725606790.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Tue, 27 Aug 2024 16:44:31 +0200
|
||||
Subject: [PATCH] qemu: Sometimes the default panic model doesn't exist
|
||||
|
||||
Right now the fallback behavior is to use MODEL_ISA if we
|
||||
haven't been able to find a better match, but that's not very
|
||||
useful as we're still going to hit an error later, when
|
||||
QEMU_CAPS_DEVICE_PANIC is not found at Validate time.
|
||||
|
||||
Instead of doing that, allow MODEL_DEFAULT to get all the
|
||||
way to Validate and report an error upon encountering it.
|
||||
|
||||
The reported error changes slightly, but other than that the
|
||||
set of configurations that are allowed and blocked remains
|
||||
the same.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 6d92185a49f5c4107964d2d46a4aecc788646dd9)
|
||||
|
||||
Conflicts:
|
||||
|
||||
* tests/qemuxmlconfdata/riscv64-panic-no-model.riscv64-latest.err
|
||||
- missing file due to commit f22583c6c4030a9e3bb3
|
||||
not having been backported
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-56451
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_domain.c | 5 ++++-
|
||||
src/qemu/qemu_validate.c | 6 +++++-
|
||||
.../aarch64-panic-no-model.aarch64-latest.err | 2 +-
|
||||
3 files changed, 10 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index f169aca599..84f4d26285 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -4148,7 +4148,10 @@ qemuDomainDefaultPanicModel(const virDomainDef *def)
|
||||
if (ARCH_IS_S390(def->os.arch))
|
||||
return VIR_DOMAIN_PANIC_MODEL_S390;
|
||||
|
||||
- return VIR_DOMAIN_PANIC_MODEL_ISA;
|
||||
+ if (ARCH_IS_X86(def->os.arch))
|
||||
+ return VIR_DOMAIN_PANIC_MODEL_ISA;
|
||||
+
|
||||
+ return VIR_DOMAIN_PANIC_MODEL_DEFAULT;
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
|
||||
index b392428f48..f3d512acf7 100644
|
||||
--- a/src/qemu/qemu_validate.c
|
||||
+++ b/src/qemu/qemu_validate.c
|
||||
@@ -1025,8 +1025,12 @@ qemuValidateDomainDefPanic(const virDomainDef *def,
|
||||
}
|
||||
break;
|
||||
|
||||
- /* default model value was changed before in post parse */
|
||||
case VIR_DOMAIN_PANIC_MODEL_DEFAULT:
|
||||
+ /* PostParse couldn't figure out a sensible default model */
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
+ _("no panic model provided, and no default for the architecture and machine type"));
|
||||
+ return -1;
|
||||
+
|
||||
case VIR_DOMAIN_PANIC_MODEL_LAST:
|
||||
break;
|
||||
}
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
|
||||
index 8e3f2c194d..139249bbc5 100644
|
||||
--- a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
|
||||
+++ b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
|
||||
@@ -1 +1 @@
|
||||
-unsupported configuration: the QEMU binary does not support the ISA panic device
|
||||
+unsupported configuration: no panic model provided, and no default for the architecture and machine type
|
||||
--
|
||||
2.46.0
|
@ -1,646 +0,0 @@
|
||||
From 53727afb9517dbfe4182f669eaf8dbe8c38e143c Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <53727afb9517dbfe4182f669eaf8dbe8c38e143c.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Fri, 5 Jan 2024 18:44:56 +0100
|
||||
Subject: [PATCH] qemu: Use CPU clusters for guests
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 655459420adb447da4744408e62537bc6ae960dd)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_command.c | 5 ++++-
|
||||
.../qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-numa-disjoint.x86_64-latest.args | 2 +-
|
||||
.../qemuxml2argvdata/cpu-numa-disordered.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-numa-memshared.x86_64-latest.args | 2 +-
|
||||
.../cpu-numa-no-memory-element.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-numa1.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-numa2.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args | 2 +-
|
||||
.../fd-memory-no-numa-topology.x86_64-latest.args | 2 +-
|
||||
.../fd-memory-numa-topology.x86_64-latest.args | 2 +-
|
||||
.../fd-memory-numa-topology2.x86_64-latest.args | 2 +-
|
||||
.../fd-memory-numa-topology3.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args | 2 +-
|
||||
.../memfd-memory-default-hugepage.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-dimm-addr.x86_64-latest.args | 2 +-
|
||||
.../qemuxml2argvdata/memory-hotplug-dimm.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-multiple.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-access.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-align.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-label.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-pmem.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-ppc64.ppc64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm-readonly.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-nvdimm.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-virtio-mem.x86_64-latest.args | 2 +-
|
||||
.../memory-hotplug-virtio-pmem.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/memory-hotplug.x86_64-latest.args | 2 +-
|
||||
.../numad-auto-memory-vcpu-cpuset.x86_64-latest.args | 2 +-
|
||||
...to-memory-vcpu-no-cpuset-and-placement.x86_64-latest.args | 2 +-
|
||||
.../numad-auto-vcpu-no-numatune.x86_64-latest.args | 2 +-
|
||||
.../numad-auto-vcpu-static-numatune.x86_64-latest.args | 2 +-
|
||||
.../numad-static-memory-auto-vcpu.x86_64-latest.args | 2 +-
|
||||
.../numad-static-vcpu-no-numatune.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/numad.x86_64-latest.args | 2 +-
|
||||
.../numatune-auto-nodeset-invalid.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/pci-expander-bus.x86_64-latest.args | 2 +-
|
||||
tests/qemuxml2argvdata/pcie-expander-bus.x86_64-latest.args | 2 +-
|
||||
.../qemuxml2argvdata/pseries-phb-numa-node.ppc64-latest.args | 2 +-
|
||||
44 files changed, 47 insertions(+), 44 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||
index 71daa85e55..712feb7b81 100644
|
||||
--- a/src/qemu/qemu_command.c
|
||||
+++ b/src/qemu/qemu_command.c
|
||||
@@ -7226,7 +7226,8 @@ qemuBuildSmpCommandLine(virCommand *cmd,
|
||||
_("Only 1 die per socket is supported"));
|
||||
return -1;
|
||||
}
|
||||
- if (def->cpu->clusters != 1) {
|
||||
+ if (def->cpu->clusters != 1 &&
|
||||
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMP_CLUSTERS)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("Only 1 cluster per die is supported"));
|
||||
return -1;
|
||||
@@ -7234,6 +7235,8 @@ qemuBuildSmpCommandLine(virCommand *cmd,
|
||||
virBufferAsprintf(&buf, ",sockets=%u", def->cpu->sockets);
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMP_DIES))
|
||||
virBufferAsprintf(&buf, ",dies=%u", def->cpu->dies);
|
||||
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_SMP_CLUSTERS))
|
||||
+ virBufferAsprintf(&buf, ",clusters=%u", def->cpu->clusters);
|
||||
virBufferAsprintf(&buf, ",cores=%u", def->cpu->cores);
|
||||
virBufferAsprintf(&buf, ",threads=%u", def->cpu->threads);
|
||||
} else {
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args
|
||||
index 009c08d71a..af1b464104 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-hotplug-startup.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 1,maxcpus=6,sockets=3,dies=1,cores=2,threads=1 \
|
||||
+-smp 1,maxcpus=6,sockets=3,dies=1,clusters=1,cores=2,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-numa-disjoint.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-numa-disjoint.x86_64-latest.args
|
||||
index 3b12934425..22fca082a8 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-numa-disjoint.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-numa-disjoint.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-3,cpus=8-11,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-numa-disordered.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-numa-disordered.x86_64-latest.args
|
||||
index ee6974326d..bc4a6ad5f3 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-numa-disordered.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-numa-disordered.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=328704k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-5,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-numa-memshared.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-numa-memshared.x86_64-latest.args
|
||||
index 0c9ec88b8b..1e486b1bbc 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-numa-memshared.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-numa-memshared.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node0","share":true,"size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node1","mem-path":"/var/lib/libvirt/qemu/ram/-1-QEMUGuest1/ram-node1","share":false,"size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-numa-no-memory-element.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-numa-no-memory-element.x86_64-latest.args
|
||||
index 31a61f023e..59372c4ab9 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-numa-no-memory-element.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-numa-no-memory-element.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-numa1.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-numa1.x86_64-latest.args
|
||||
index 31a61f023e..59372c4ab9 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-numa1.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-numa1.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-numa2.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-numa2.x86_64-latest.args
|
||||
index 31a61f023e..59372c4ab9 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-numa2.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-numa2.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
|
||||
index 009c08d71a..af1b464104 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-topology1.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 1,maxcpus=6,sockets=3,dies=1,cores=2,threads=1 \
|
||||
+-smp 1,maxcpus=6,sockets=3,dies=1,clusters=1,cores=2,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
|
||||
index 7ba175fa80..8560eb6126 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-topology2.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 6,sockets=1,dies=1,cores=2,threads=3 \
|
||||
+-smp 6,sockets=1,dies=1,clusters=1,cores=2,threads=3 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args
|
||||
index c11b4cd307..3878c558b8 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-topology3.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 6,sockets=3,dies=1,cores=2,threads=1 \
|
||||
+-smp 6,sockets=3,dies=1,clusters=1,cores=2,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args b/tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
|
||||
index d0e31ba2b5..8720038c0d 100644
|
||||
--- a/tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/cpu-topology4.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 1,maxcpus=6,sockets=1,dies=3,cores=2,threads=1 \
|
||||
+-smp 1,maxcpus=6,sockets=1,dies=3,clusters=1,cores=2,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.x86_64-latest.args b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.x86_64-latest.args
|
||||
index 58b3c7b544..1bd75a85a6 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-no-numa-topology.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-no-numa-topology.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-instance-00000092/.config \
|
||||
-m size=14680064k \
|
||||
-object '{"qom-type":"memory-backend-file","id":"pc.ram","mem-path":"/var/lib/libvirt/qemu/ram/-1-instance-00000092/pc.ram","share":true,"x-use-canonical-path-for-ramblock-id":false,"prealloc":true,"size":15032385536}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 8,sockets=8,dies=1,cores=1,threads=1 \
|
||||
+-smp 8,sockets=8,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology.x86_64-latest.args b/tests/qemuxml2argvdata/fd-memory-numa-topology.x86_64-latest.args
|
||||
index 21f9a16540..17ef506431 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-numa-topology.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-numa-topology.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-instance-00000092/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=14680064k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 8,sockets=1,dies=1,cores=8,threads=1 \
|
||||
+-smp 8,sockets=1,dies=1,clusters=1,cores=8,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-instance-00000092/ram-node0","share":true,"prealloc":true,"size":15032385536}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-uuid 126f2720-6f8e-45ab-a886-ec9277079a67 \
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology2.x86_64-latest.args b/tests/qemuxml2argvdata/fd-memory-numa-topology2.x86_64-latest.args
|
||||
index 3bf16f9caf..b247231b85 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-numa-topology2.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-numa-topology2.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-instance-00000092/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=29360128k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 20,sockets=1,dies=1,cores=20,threads=1 \
|
||||
+-smp 20,sockets=1,dies=1,clusters=1,cores=20,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-instance-00000092/ram-node0","share":false,"prealloc":true,"size":15032385536}' \
|
||||
-numa node,nodeid=0,cpus=0-7,cpus=16-19,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node1","mem-path":"/var/lib/libvirt/qemu/ram/-1-instance-00000092/ram-node1","share":true,"prealloc":true,"size":15032385536}' \
|
||||
diff --git a/tests/qemuxml2argvdata/fd-memory-numa-topology3.x86_64-latest.args b/tests/qemuxml2argvdata/fd-memory-numa-topology3.x86_64-latest.args
|
||||
index 3153e22d56..9e94209499 100644
|
||||
--- a/tests/qemuxml2argvdata/fd-memory-numa-topology3.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/fd-memory-numa-topology3.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-instance-00000092/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=44040192k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 32,sockets=1,dies=1,cores=32,threads=1 \
|
||||
+-smp 32,sockets=1,dies=1,clusters=1,cores=32,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/var/lib/libvirt/qemu/ram/-1-instance-00000092/ram-node0","share":true,"prealloc":true,"size":15032385536}' \
|
||||
-numa node,nodeid=0,cpus=0-1,cpus=6-31,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node1","mem-path":"/var/lib/libvirt/qemu/ram/-1-instance-00000092/ram-node1","share":true,"prealloc":true,"size":15032385536}' \
|
||||
diff --git a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
|
||||
index fa376accb5..f30db0ad09 100644
|
||||
--- a/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/hugepages-nvdimm.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=1048576k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-file","id":"ram-node0","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","share":true,"prealloc":true,"size":1073741824}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
|
||||
index 55969eb2fd..f850d7be60 100644
|
||||
--- a/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memfd-memory-default-hugepage.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-instance-00000092/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=14680064k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 8,sockets=1,dies=1,cores=8,threads=1 \
|
||||
+-smp 8,sockets=1,dies=1,clusters=1,cores=8,threads=1 \
|
||||
-object '{"qom-type":"thread-context","id":"tc-ram-node0","node-affinity":[3]}' \
|
||||
-object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"size":15032385536,"host-nodes":[3],"policy":"preferred","prealloc-context":"tc-ram-node0"}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
diff --git a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
|
||||
index 1ef2d69fcb..dbe2b82a56 100644
|
||||
--- a/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memfd-memory-numa.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-instance-00000092/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=14680064k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 8,sockets=1,dies=1,cores=8,threads=1 \
|
||||
+-smp 8,sockets=1,dies=1,clusters=1,cores=8,threads=1 \
|
||||
-object '{"qom-type":"thread-context","id":"tc-ram-node0","node-affinity":[3]}' \
|
||||
-object '{"qom-type":"memory-backend-memfd","id":"ram-node0","hugetlb":true,"hugetlbsize":2097152,"share":true,"prealloc":true,"prealloc-threads":8,"size":15032385536,"host-nodes":[3],"policy":"preferred","prealloc-context":"tc-ram-node0"}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args
|
||||
index 6ae1fd1b98..c15fe191de 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-dimm-addr.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-dimm.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-dimm.x86_64-latest.args
|
||||
index 71817da309..a729930db2 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-dimm.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-dimm.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-multiple.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-multiple.x86_64-latest.args
|
||||
index ad1dad01ac..f1f2f93a11 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-multiple.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-multiple.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=2095104k,slots=2,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
|
||||
index f09ae22927..d53732b39e 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-access.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
|
||||
index 6cfe4b8263..cba467d9d3 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-align.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
|
||||
index 4041c15b2b..2ad23a0224 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-label.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
|
||||
index 3547e96c00..ac5ca187b1 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-pmem.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args
|
||||
index 9b57518fca..c2c1623d9f 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64-abi-update.ppc64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu POWER9 \
|
||||
-m size=1048576k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":1073741824}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.args
|
||||
index 9b57518fca..c2c1623d9f 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-ppc64.ppc64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu POWER9 \
|
||||
-m size=1048576k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":1073741824}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
|
||||
index 17bacfb2f6..8af4673841 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm-readonly.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
|
||||
index 1321e5556e..6531caa908 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-nvdimm.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=1048576k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":1073741824}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
|
||||
index 607ce9b0e8..dbe96ae21d 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=2095104k,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
|
||||
index 9bbde420a9..df7b7f80a9 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-pmem.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=2095104k,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":2145386496}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug.x86_64-latest.args
|
||||
index 53f0fbc68f..d04d9d73e9 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k,slots=16,maxmem=1099511627776k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":224395264}' \
|
||||
-numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
diff --git a/tests/qemuxml2argvdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.args b/tests/qemuxml2argvdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.args
|
||||
index d4238f3d9e..138c8255f7 100644
|
||||
--- a/tests/qemuxml2argvdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad-auto-memory-vcpu-cpuset.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0,1,2,3],"policy":"interleave"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.args b/tests/qemuxml2argvdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.args
|
||||
index d4238f3d9e..138c8255f7 100644
|
||||
--- a/tests/qemuxml2argvdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad-auto-memory-vcpu-no-cpuset-and-placement.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0,1,2,3],"policy":"interleave"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numad-auto-vcpu-no-numatune.x86_64-latest.args b/tests/qemuxml2argvdata/numad-auto-vcpu-no-numatune.x86_64-latest.args
|
||||
index 7022d2cc00..f13f04c9d4 100644
|
||||
--- a/tests/qemuxml2argvdata/numad-auto-vcpu-no-numatune.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad-auto-vcpu-no-numatune.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0,1,2,3],"policy":"bind"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numad-auto-vcpu-static-numatune.x86_64-latest.args b/tests/qemuxml2argvdata/numad-auto-vcpu-static-numatune.x86_64-latest.args
|
||||
index 9ddfb286b5..f1c49619db 100644
|
||||
--- a/tests/qemuxml2argvdata/numad-auto-vcpu-static-numatune.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad-auto-vcpu-static-numatune.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0],"policy":"interleave"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numad-static-memory-auto-vcpu.x86_64-latest.args b/tests/qemuxml2argvdata/numad-static-memory-auto-vcpu.x86_64-latest.args
|
||||
index d4238f3d9e..138c8255f7 100644
|
||||
--- a/tests/qemuxml2argvdata/numad-static-memory-auto-vcpu.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad-static-memory-auto-vcpu.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0,1,2,3],"policy":"interleave"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numad-static-vcpu-no-numatune.x86_64-latest.args b/tests/qemuxml2argvdata/numad-static-vcpu-no-numatune.x86_64-latest.args
|
||||
index ffbccb8408..76ca5c4bea 100644
|
||||
--- a/tests/qemuxml2argvdata/numad-static-vcpu-no-numatune.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad-static-vcpu-no-numatune.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numad.x86_64-latest.args b/tests/qemuxml2argvdata/numad.x86_64-latest.args
|
||||
index d4238f3d9e..138c8255f7 100644
|
||||
--- a/tests/qemuxml2argvdata/numad.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numad.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0,1,2,3],"policy":"interleave"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/numatune-auto-nodeset-invalid.x86_64-latest.args b/tests/qemuxml2argvdata/numatune-auto-nodeset-invalid.x86_64-latest.args
|
||||
index 57a2b893f1..e35471d91b 100644
|
||||
--- a/tests/qemuxml2argvdata/numatune-auto-nodeset-invalid.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/numatune-auto-nodeset-invalid.x86_64-latest.args
|
||||
@@ -16,7 +16,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-m size=219136k \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264,"host-nodes":[0,1,2,3],"policy":"preferred"}' \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 2,sockets=2,dies=1,cores=1,threads=1 \
|
||||
+-smp 2,sockets=2,dies=1,clusters=1,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-display none \
|
||||
-no-user-config \
|
||||
diff --git a/tests/qemuxml2argvdata/pci-expander-bus.x86_64-latest.args b/tests/qemuxml2argvdata/pci-expander-bus.x86_64-latest.args
|
||||
index bf553a8e32..d3960731be 100644
|
||||
--- a/tests/qemuxml2argvdata/pci-expander-bus.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/pci-expander-bus.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-expander-test/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/pcie-expander-bus.x86_64-latest.args b/tests/qemuxml2argvdata/pcie-expander-bus.x86_64-latest.args
|
||||
index 3fb86c29c2..b179fadc27 100644
|
||||
--- a/tests/qemuxml2argvdata/pcie-expander-bus.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/pcie-expander-bus.x86_64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-pcie-expander-bus-te/.config \
|
||||
-cpu qemu64 \
|
||||
-m size=219136k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 16,sockets=2,dies=1,cores=4,threads=2 \
|
||||
+-smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
|
||||
-numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
|
||||
diff --git a/tests/qemuxml2argvdata/pseries-phb-numa-node.ppc64-latest.args b/tests/qemuxml2argvdata/pseries-phb-numa-node.ppc64-latest.args
|
||||
index 7ffcb1d8c5..942540a296 100644
|
||||
--- a/tests/qemuxml2argvdata/pseries-phb-numa-node.ppc64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/pseries-phb-numa-node.ppc64-latest.args
|
||||
@@ -15,7 +15,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-cpu POWER9 \
|
||||
-m size=2097152k \
|
||||
-overcommit mem-lock=off \
|
||||
--smp 8,sockets=2,dies=1,cores=1,threads=4 \
|
||||
+-smp 8,sockets=2,dies=1,clusters=1,cores=1,threads=4 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":1073741824,"host-nodes":[1],"policy":"bind"}' \
|
||||
-numa node,nodeid=0,cpus=0-3,memdev=ram-node0 \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":1073741824,"host-nodes":[2],"policy":"bind"}' \
|
||||
--
|
||||
2.43.0
|
154
SOURCES/libvirt-qemu-Use-pvpanic-by-default-on-aarch64.patch
Normal file
154
SOURCES/libvirt-qemu-Use-pvpanic-by-default-on-aarch64.patch
Normal file
@ -0,0 +1,154 @@
|
||||
From 6cfa4aac1986f423e23b0f314a62b8a75f6c73d8 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <6cfa4aac1986f423e23b0f314a62b8a75f6c73d8.1725606790.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Tue, 27 Aug 2024 16:19:53 +0200
|
||||
Subject: [PATCH] qemu: Use pvpanic by default on aarch64
|
||||
|
||||
pvpanic-pci is the only reasonable implementation of a panic
|
||||
device for aarch64/virt guests. Right now we're asking users to
|
||||
provide the model name manually, but we can be more helpful and
|
||||
fill it in automatically instead.
|
||||
|
||||
With this change, the aarch64-panic-no-model test no longer
|
||||
fails and so it's no longer useful to us. Instead, we can amend
|
||||
the aarch64-virt-default-models test case to include panic
|
||||
coverage, something that until now wasn't possible.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit ad924689240af3e7964e88c32799df146b640292)
|
||||
|
||||
Conflicts:
|
||||
* tests/qemuxmlconftest.c
|
||||
- missing context due to commit f22583c6c4030a9e3bb3
|
||||
not having been backported
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-56451
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_domain.c | 3 +++
|
||||
.../aarch64-panic-no-model.aarch64-latest.err | 1 -
|
||||
tests/qemuxmlconfdata/aarch64-panic-no-model.xml | 13 -------------
|
||||
...rt-default-models.aarch64-latest.abi-update.args | 1 +
|
||||
...irt-default-models.aarch64-latest.abi-update.xml | 3 +++
|
||||
.../aarch64-virt-default-models.aarch64-latest.args | 1 +
|
||||
.../aarch64-virt-default-models.aarch64-latest.xml | 3 +++
|
||||
.../qemuxmlconfdata/aarch64-virt-default-models.xml | 2 +-
|
||||
tests/qemuxmlconftest.c | 1 -
|
||||
9 files changed, 12 insertions(+), 16 deletions(-)
|
||||
delete mode 100644 tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
|
||||
delete mode 100644 tests/qemuxmlconfdata/aarch64-panic-no-model.xml
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
||||
index 84f4d26285..f063695421 100644
|
||||
--- a/src/qemu/qemu_domain.c
|
||||
+++ b/src/qemu/qemu_domain.c
|
||||
@@ -4151,6 +4151,9 @@ qemuDomainDefaultPanicModel(const virDomainDef *def)
|
||||
if (ARCH_IS_X86(def->os.arch))
|
||||
return VIR_DOMAIN_PANIC_MODEL_ISA;
|
||||
|
||||
+ if (qemuDomainIsARMVirt(def))
|
||||
+ return VIR_DOMAIN_PANIC_MODEL_PVPANIC;
|
||||
+
|
||||
return VIR_DOMAIN_PANIC_MODEL_DEFAULT;
|
||||
}
|
||||
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err b/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
|
||||
deleted file mode 100644
|
||||
index 139249bbc5..0000000000
|
||||
--- a/tests/qemuxmlconfdata/aarch64-panic-no-model.aarch64-latest.err
|
||||
+++ /dev/null
|
||||
@@ -1 +0,0 @@
|
||||
-unsupported configuration: no panic model provided, and no default for the architecture and machine type
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-panic-no-model.xml b/tests/qemuxmlconfdata/aarch64-panic-no-model.xml
|
||||
deleted file mode 100644
|
||||
index 5207e48bbd..0000000000
|
||||
--- a/tests/qemuxmlconfdata/aarch64-panic-no-model.xml
|
||||
+++ /dev/null
|
||||
@@ -1,13 +0,0 @@
|
||||
-<domain type='qemu'>
|
||||
- <name>guest</name>
|
||||
- <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
||||
- <memory>4194304</memory>
|
||||
- <vcpu>4</vcpu>
|
||||
- <os>
|
||||
- <type arch='aarch64' machine='virt'>hvm</type>
|
||||
- </os>
|
||||
- <devices>
|
||||
- <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
- <panic/>
|
||||
- </devices>
|
||||
-</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.args b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.args
|
||||
index a503f45d0c..96fb251d80 100644
|
||||
--- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.args
|
||||
+++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.args
|
||||
@@ -44,4 +44,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
|
||||
-audiodev '{"id":"audio1","driver":"none"}' \
|
||||
-device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
|
||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
||||
+-device '{"driver":"pvpanic-pci","bus":"pcie.0","addr":"0x2"}' \
|
||||
-msg timestamp=on
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml
|
||||
index bbe1dd931d..f27e7e1522 100644
|
||||
--- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml
|
||||
+++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.abi-update.xml
|
||||
@@ -78,5 +78,8 @@
|
||||
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
|
||||
</video>
|
||||
<memballoon model='none'/>
|
||||
+ <panic model='pvpanic'>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
+ </panic>
|
||||
</devices>
|
||||
</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args
|
||||
index a503f45d0c..96fb251d80 100644
|
||||
--- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args
|
||||
+++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.args
|
||||
@@ -44,4 +44,5 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
|
||||
-audiodev '{"id":"audio1","driver":"none"}' \
|
||||
-device '{"driver":"virtio-gpu-pci","id":"video0","max_outputs":1,"bus":"pci.5","addr":"0x0"}' \
|
||||
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
||||
+-device '{"driver":"pvpanic-pci","bus":"pcie.0","addr":"0x2"}' \
|
||||
-msg timestamp=on
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml
|
||||
index bbe1dd931d..f27e7e1522 100644
|
||||
--- a/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml
|
||||
+++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.aarch64-latest.xml
|
||||
@@ -78,5 +78,8 @@
|
||||
<address type='pci' domain='0x0000' bus='0x05' slot='0x00' function='0x0'/>
|
||||
</video>
|
||||
<memballoon model='none'/>
|
||||
+ <panic model='pvpanic'>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
+ </panic>
|
||||
</devices>
|
||||
</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/aarch64-virt-default-models.xml b/tests/qemuxmlconfdata/aarch64-virt-default-models.xml
|
||||
index d9ad495e75..a8029d888d 100644
|
||||
--- a/tests/qemuxmlconfdata/aarch64-virt-default-models.xml
|
||||
+++ b/tests/qemuxmlconfdata/aarch64-virt-default-models.xml
|
||||
@@ -19,6 +19,6 @@
|
||||
</tpm>
|
||||
<video/>
|
||||
<memballoon model='none'/>
|
||||
- <!-- No default model for <panic/> on aarch64 -->
|
||||
+ <panic/>
|
||||
</devices>
|
||||
</domain>
|
||||
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
|
||||
index 0f2afad6c4..338462193b 100644
|
||||
--- a/tests/qemuxmlconftest.c
|
||||
+++ b/tests/qemuxmlconftest.c
|
||||
@@ -2672,7 +2672,6 @@ mymain(void)
|
||||
DO_TEST_CAPS_LATEST("panic");
|
||||
DO_TEST_CAPS_LATEST("panic-double");
|
||||
DO_TEST_CAPS_LATEST("panic-no-address");
|
||||
- DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("aarch64-panic-no-model", "aarch64");
|
||||
|
||||
DO_TEST_CAPS_LATEST("pvpanic-pci-x86_64");
|
||||
DO_TEST_CAPS_ARCH_LATEST("pvpanic-pci-aarch64", "aarch64");
|
||||
--
|
||||
2.46.0
|
@ -0,0 +1,128 @@
|
||||
From c30b3dd904c094c478c5b362de6b3580379edd8b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c30b3dd904c094c478c5b362de6b3580379edd8b.1720800605.git.jdenemar@redhat.com>
|
||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
||||
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 <jtomko@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 8dc04cafecd2432c071c73366e4c6eb3b7bff495)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7108
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
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
|
208
SOURCES/libvirt-qemu-fill-capabilities-for-virtiofsd.patch
Normal file
208
SOURCES/libvirt-qemu-fill-capabilities-for-virtiofsd.patch
Normal file
@ -0,0 +1,208 @@
|
||||
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?= <jtomko@redhat.com>
|
||||
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 <jtomko@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(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 <jtomko@redhat.com>
|
||||
---
|
||||
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
|
@ -0,0 +1,123 @@
|
||||
From 74c6eb6abe8757124ab7a694f8559b9f58deeab7 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <74c6eb6abe8757124ab7a694f8559b9f58deeab7.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 13:56:06 +0200
|
||||
Subject: [PATCH] qemu: migration: Avoid use of 'nmigration_disks'
|
||||
|
||||
'migration_disks' is a NULL-terminated string list, so the code can be
|
||||
converted to either iterate the string-list, use existing accessors or
|
||||
check the presence of the pointers instead of checking the count.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 4ebf1acb83161bf567c37f7c972f408b24cf8784)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_migration.c | 48 +++++++++++++++++++--------------------
|
||||
1 file changed, 23 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 60e2cad712..0d9bb7aeef 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -382,18 +382,12 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn,
|
||||
|
||||
static bool
|
||||
qemuMigrationAnyCopyDisk(virDomainDiskDef const *disk,
|
||||
- size_t nmigrate_disks, const char **migrate_disks)
|
||||
+ size_t nmigrate_disks G_GNUC_UNUSED,
|
||||
+ const char **migrate_disks)
|
||||
{
|
||||
- size_t i;
|
||||
-
|
||||
- /* Check if the disk alias is in the list */
|
||||
- if (nmigrate_disks) {
|
||||
- for (i = 0; i < nmigrate_disks; i++) {
|
||||
- if (STREQ(disk->dst, migrate_disks[i]))
|
||||
- return true;
|
||||
- }
|
||||
- return false;
|
||||
- }
|
||||
+ /* List of disks to migrate takes priority if present */
|
||||
+ if (migrate_disks)
|
||||
+ return g_strv_contains(migrate_disks, disk->dst);
|
||||
|
||||
/* Default is to migrate only non-shared non-readonly disks
|
||||
* with source */
|
||||
@@ -2649,19 +2643,20 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- if (nmigrate_disks) {
|
||||
- size_t i, j;
|
||||
+ if (migrate_disks) {
|
||||
+ size_t j;
|
||||
+ const char **d;
|
||||
+
|
||||
/* Check user requested only known disk targets. */
|
||||
- for (i = 0; i < nmigrate_disks; i++) {
|
||||
+ for (d = migrate_disks; *d; d++) {
|
||||
for (j = 0; j < vm->def->ndisks; j++) {
|
||||
- if (STREQ(vm->def->disks[j]->dst, migrate_disks[i]))
|
||||
+ if (STREQ(vm->def->disks[j]->dst, *d))
|
||||
break;
|
||||
}
|
||||
|
||||
if (j == vm->def->ndisks) {
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
- _("disk target %1$s not found"),
|
||||
- migrate_disks[i]);
|
||||
+ _("disk target %1$s not found"), *d);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -2674,7 +2669,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
nmigrate_disks))
|
||||
cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
|
||||
} else {
|
||||
- if (nmigrate_disks > 0) {
|
||||
+ if (migrate_disks) {
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
||||
_("use of 'VIR_MIGRATE_PARAM_MIGRATE_DISKS' requires use of 'VIR_MIGRATE_NON_SHARED_DISK' or 'VIR_MIGRATE_NON_SHARED_INC' flag"));
|
||||
return NULL;
|
||||
@@ -5536,7 +5531,6 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
virTypedParameterPtr params = NULL;
|
||||
int nparams = 0;
|
||||
int maxparams = 0;
|
||||
- size_t i;
|
||||
bool offline = !!(flags & VIR_MIGRATE_OFFLINE);
|
||||
|
||||
VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, dconnuri=%s, vm=%p, xmlin=%s, "
|
||||
@@ -5595,11 +5589,15 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
VIR_MIGRATE_PARAM_LISTEN_ADDRESS,
|
||||
listenAddress) < 0)
|
||||
goto cleanup;
|
||||
- for (i = 0; i < nmigrate_disks; i++)
|
||||
- if (virTypedParamsAddString(¶ms, &nparams, &maxparams,
|
||||
- VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
- migrate_disks[i]) < 0)
|
||||
- goto cleanup;
|
||||
+ if (migrate_disks) {
|
||||
+ const char **d;
|
||||
+
|
||||
+ for (d = migrate_disks; *d; d++)
|
||||
+ if (virTypedParamsAddString(¶ms, &nparams, &maxparams,
|
||||
+ VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
+ *d) < 0)
|
||||
+ goto cleanup;
|
||||
+ }
|
||||
if (nbdPort &&
|
||||
virTypedParamsAddInt(¶ms, &nparams, &maxparams,
|
||||
VIR_MIGRATE_PARAM_DISKS_PORT,
|
||||
@@ -5990,7 +5988,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
|
||||
|
||||
/* Only xmlin, dname, uri, and bandwidth parameters can be used with
|
||||
* old-style APIs. */
|
||||
- if (!useParams && (graphicsuri || listenAddress || nmigrate_disks)) {
|
||||
+ if (!useParams && (graphicsuri || listenAddress || migrate_disks)) {
|
||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
|
||||
_("Migration APIs with extensible parameters are not supported but extended parameters were passed"));
|
||||
goto cleanup;
|
||||
--
|
||||
2.47.0
|
140
SOURCES/libvirt-qemu-migration-Don-t-log-nmigrate_disks.patch
Normal file
140
SOURCES/libvirt-qemu-migration-Don-t-log-nmigrate_disks.patch
Normal file
@ -0,0 +1,140 @@
|
||||
From 59b0ca7481b8f3c463aa0ba9dc10fe38441c0f49 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <59b0ca7481b8f3c463aa0ba9dc10fe38441c0f49.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 13:40:15 +0200
|
||||
Subject: [PATCH] qemu: migration: Don't log 'nmigrate_disks'
|
||||
|
||||
The actual number of disks to migrate is not important. The presence of
|
||||
disks to migrate can be inferred from presence of the 'migrate_disks'
|
||||
pointer which is logged.
|
||||
|
||||
Since 'nmigrate_disks' will eventually be removed remove the logging
|
||||
right now.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit d98beef107d411f9b689be288695131680cfa87a)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_migration.c | 32 ++++++++++++++++----------------
|
||||
1 file changed, 16 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 09d4a31ca6..60e2cad712 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -2582,9 +2582,9 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, vm=%p, xmlin=%s, dname=%s,"
|
||||
" cookieout=%p, cookieoutlen=%p,"
|
||||
- " nmigrate_disks=%zu, migrate_disks=%p, flags=0x%x",
|
||||
+ " migrate_disks=%p, flags=0x%x",
|
||||
driver, vm, NULLSTR(xmlin), NULLSTR(dname),
|
||||
- cookieout, cookieoutlen, nmigrate_disks,
|
||||
+ cookieout, cookieoutlen,
|
||||
migrate_disks, flags);
|
||||
|
||||
/* Only set the phase if we are inside VIR_ASYNC_JOB_MIGRATION_OUT.
|
||||
@@ -3718,12 +3718,12 @@ qemuMigrationDstPrepareDirect(virQEMUDriver *driver,
|
||||
VIR_DEBUG("driver=%p, dconn=%p, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, uri_in=%s, uri_out=%p, "
|
||||
"def=%p, origname=%s, listenAddress=%s, "
|
||||
- "nmigrate_disks=%zu, migrate_disks=%p, nbdPort=%d, "
|
||||
+ "migrate_disks=%p, nbdPort=%d, "
|
||||
"nbdURI=%s, flags=0x%x",
|
||||
driver, dconn, NULLSTR(cookiein), cookieinlen,
|
||||
cookieout, cookieoutlen, NULLSTR(uri_in), uri_out,
|
||||
*def, origname, NULLSTR(listenAddress),
|
||||
- nmigrate_disks, migrate_disks, nbdPort, NULLSTR(nbdURI),
|
||||
+ migrate_disks, nbdPort, NULLSTR(nbdURI),
|
||||
flags);
|
||||
|
||||
*uri_out = NULL;
|
||||
@@ -4757,11 +4757,11 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
VIR_DEBUG("driver=%p, vm=%p, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, "
|
||||
"spec=%p (dest=%d, fwd=%d), dconn=%p, graphicsuri=%s, "
|
||||
- "nmigrate_disks=%zu, migrate_disks=%p",
|
||||
+ "migrate_disks=%p",
|
||||
driver, vm, NULLSTR(cookiein), cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
spec, spec->destType, spec->fwdType, dconn,
|
||||
- NULLSTR(graphicsuri), nmigrate_disks, migrate_disks);
|
||||
+ NULLSTR(graphicsuri), migrate_disks);
|
||||
|
||||
if (storageMigration)
|
||||
storageMigration = qemuMigrationHasAnyStorageMigrationDisks(vm->def,
|
||||
@@ -5169,10 +5169,10 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, vm=%p, uri=%s, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, "
|
||||
- "graphicsuri=%s, nmigrate_disks=%zu migrate_disks=%p",
|
||||
+ "graphicsuri=%s, migrate_disks=%p",
|
||||
driver, vm, uri, NULLSTR(cookiein), cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
- NULLSTR(graphicsuri), nmigrate_disks, migrate_disks);
|
||||
+ NULLSTR(graphicsuri), migrate_disks);
|
||||
|
||||
if (!(uribits = qemuMigrationAnyParseURI(uri, NULL)))
|
||||
return -1;
|
||||
@@ -5273,10 +5273,10 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, vm=%p, st=%p, cookiein=%s, cookieinlen=%d, "
|
||||
"cookieout=%p, cookieoutlen=%p, flags=0x%x, resource=%lu, "
|
||||
- "graphicsuri=%s, nmigrate_disks=%zu, migrate_disks=%p",
|
||||
+ "graphicsuri=%s, migrate_disks=%p",
|
||||
driver, vm, st, NULLSTR(cookiein), cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
- NULLSTR(graphicsuri), nmigrate_disks, migrate_disks);
|
||||
+ NULLSTR(graphicsuri), migrate_disks);
|
||||
|
||||
spec.fwdType = MIGRATION_FWD_STREAM;
|
||||
spec.fwd.stream = st;
|
||||
@@ -5541,11 +5541,11 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, sconn=%p, dconn=%p, dconnuri=%s, vm=%p, xmlin=%s, "
|
||||
"dname=%s, uri=%s, graphicsuri=%s, listenAddress=%s, "
|
||||
- "nmigrate_disks=%zu, migrate_disks=%p, nbdPort=%d, nbdURI=%s, "
|
||||
+ "migrate_disks=%p, nbdPort=%d, nbdURI=%s, "
|
||||
"bandwidth=%llu, useParams=%d, flags=0x%x",
|
||||
driver, sconn, dconn, NULLSTR(dconnuri), vm, NULLSTR(xmlin),
|
||||
NULLSTR(dname), NULLSTR(uri), NULLSTR(graphicsuri),
|
||||
- NULLSTR(listenAddress), nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ NULLSTR(listenAddress), migrate_disks, nbdPort,
|
||||
NULLSTR(nbdURI), bandwidth, useParams, flags);
|
||||
|
||||
/* Unlike the virDomainMigrateVersion3 counterpart, we don't need
|
||||
@@ -5907,12 +5907,12 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
|
||||
int rc;
|
||||
|
||||
VIR_DEBUG("driver=%p, sconn=%p, vm=%p, xmlin=%s, dconnuri=%s, uri=%s, "
|
||||
- "graphicsuri=%s, listenAddress=%s, nmigrate_disks=%zu, "
|
||||
+ "graphicsuri=%s, listenAddress=%s, "
|
||||
"migrate_disks=%p, nbdPort=%d, nbdURI=%s, flags=0x%x, "
|
||||
"dname=%s, resource=%lu",
|
||||
driver, sconn, vm, NULLSTR(xmlin), NULLSTR(dconnuri),
|
||||
NULLSTR(uri), NULLSTR(graphicsuri), NULLSTR(listenAddress),
|
||||
- nmigrate_disks, migrate_disks, nbdPort, NULLSTR(nbdURI),
|
||||
+ migrate_disks, nbdPort, NULLSTR(nbdURI),
|
||||
flags, NULLSTR(dname), resource);
|
||||
|
||||
if (flags & VIR_MIGRATE_TUNNELLED && uri) {
|
||||
@@ -6274,13 +6274,13 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
|
||||
VIR_DEBUG("driver=%p, conn=%p, vm=%p, xmlin=%s, dconnuri=%s, "
|
||||
"uri=%s, graphicsuri=%s, listenAddress=%s, "
|
||||
- "nmigrate_disks=%zu, migrate_disks=%p, nbdPort=%d, "
|
||||
+ "migrate_disks=%p, nbdPort=%d, "
|
||||
"nbdURI=%s, "
|
||||
"cookiein=%s, cookieinlen=%d, cookieout=%p, cookieoutlen=%p, "
|
||||
"flags=0x%x, dname=%s, resource=%lu, v3proto=%d",
|
||||
driver, conn, vm, NULLSTR(xmlin), NULLSTR(dconnuri),
|
||||
NULLSTR(uri), NULLSTR(graphicsuri), NULLSTR(listenAddress),
|
||||
- nmigrate_disks, migrate_disks, nbdPort, NULLSTR(nbdURI),
|
||||
+ migrate_disks, nbdPort, NULLSTR(nbdURI),
|
||||
NULLSTR(cookiein), cookieinlen, cookieout, cookieoutlen,
|
||||
flags, NULLSTR(dname), resource, v3proto);
|
||||
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,91 @@
|
||||
From 0326166a5240c12799cac7fe1caf5e0cc22100c6 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <0326166a5240c12799cac7fe1caf5e0cc22100c6.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 30 Sep 2024 10:38:58 +0200
|
||||
Subject: [PATCH] qemu: migration: Extract validation of disk target list
|
||||
|
||||
The migration code is checking the disk list provided via
|
||||
VIR_MIGRATE_PARAM_MIGRATE_DISKS against existing disks. Extract it to a
|
||||
helper function as we'll be passing another list of disk targets soon.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit aaefaabf5a27dcc36dc7a9bb26aec7e00a483ed8)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_migration.c | 52 +++++++++++++++++++++++++--------------
|
||||
1 file changed, 34 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 0d9bb7aeef..21d4c3ece6 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -2559,6 +2559,37 @@ qemuMigrationSrcBeginXML(virDomainObj *vm,
|
||||
}
|
||||
|
||||
|
||||
+/**
|
||||
+ * qemuMigrationSrcBeginPhaseValidateDiskTargetList:
|
||||
+ * @vm: domain object
|
||||
+ * @disks: NULL-terminated list of disk 'dst' strings to validate
|
||||
+ *
|
||||
+ * Validates that all members of the @disk list are valid disk targets.
|
||||
+ */
|
||||
+static int
|
||||
+qemuMigrationSrcBeginPhaseValidateDiskTargetList(virDomainObj *vm,
|
||||
+ const char **disks)
|
||||
+{
|
||||
+ size_t i;
|
||||
+ const char **d;
|
||||
+
|
||||
+ for (d = disks; *d; d++) {
|
||||
+ for (i = 0; i < vm->def->ndisks; i++) {
|
||||
+ if (STREQ(vm->def->disks[i]->dst, *d))
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (i == vm->def->ndisks) {
|
||||
+ virReportError(VIR_ERR_INVALID_ARG,
|
||||
+ _("disk target %1$s not found"), *d);
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+
|
||||
/* The caller is supposed to lock the vm and start a migration job. */
|
||||
static char *
|
||||
qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
@@ -2643,24 +2674,9 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- if (migrate_disks) {
|
||||
- size_t j;
|
||||
- const char **d;
|
||||
-
|
||||
- /* Check user requested only known disk targets. */
|
||||
- for (d = migrate_disks; *d; d++) {
|
||||
- for (j = 0; j < vm->def->ndisks; j++) {
|
||||
- if (STREQ(vm->def->disks[j]->dst, *d))
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (j == vm->def->ndisks) {
|
||||
- virReportError(VIR_ERR_INVALID_ARG,
|
||||
- _("disk target %1$s not found"), *d);
|
||||
- return NULL;
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
+ if (migrate_disks &&
|
||||
+ qemuMigrationSrcBeginPhaseValidateDiskTargetList(vm, migrate_disks) < 0)
|
||||
+ return NULL;
|
||||
|
||||
priv->nbdPort = 0;
|
||||
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,52 @@
|
||||
From eeef445131b8fb327d6850cf582dabc6ffd1ba80 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <eeef445131b8fb327d6850cf582dabc6ffd1ba80.1729611062.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 11 Oct 2024 18:31:28 +0200
|
||||
Subject: [PATCH] qemu: migration: Fix blockdev config with
|
||||
VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES
|
||||
|
||||
The idea of migration with VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES
|
||||
populated is to sparsify the image. The QEMU NBD client as it was
|
||||
configured in commit 621f879adf98e2c93ac5c8c869733a57f06cd9aa would
|
||||
signal to the destination to do thick allocation of holes which would
|
||||
result in a non-sparse image for any backend except a qcow2 image which
|
||||
I used to test it.
|
||||
|
||||
Switch to VIR_DOMAIN_DISK_DETECT_ZEROES_UNMAP and
|
||||
VIR_DOMAIN_DISK_DISCARD_UNMAP which tells the NBD client (and that in
|
||||
turn the NBD server) to preserve the sparse blocks it detected from the
|
||||
image.
|
||||
|
||||
Fixes: 621f879adf98e2c93ac5c8c869733a57f06cd9aa
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
(cherry picked from commit 04d6a0ec5d80c7618e00fcd6456e1bd0773207a9)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_migration.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 5ebe4748ce..d67cae56f6 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -1032,8 +1032,14 @@ qemuMigrationSrcNBDStorageCopyBlockdevPrepareSource(virDomainDiskDef *disk,
|
||||
copysrc->protocol = VIR_STORAGE_NET_PROTOCOL_NBD;
|
||||
copysrc->format = VIR_STORAGE_FILE_RAW;
|
||||
|
||||
- if (detect_zeroes)
|
||||
- copysrc->detect_zeroes = VIR_DOMAIN_DISK_DETECT_ZEROES_ON;
|
||||
+ if (detect_zeroes) {
|
||||
+ /* We need to use both VIR_DOMAIN_DISK_DETECT_ZEROES_UNMAP and
|
||||
+ * VIR_DOMAIN_DISK_DISCARD_UNMAP as the qemu NBD client otherwise singals
|
||||
+ * to the server to fully allocate the zero blocks
|
||||
+ */
|
||||
+ copysrc->detect_zeroes = VIR_DOMAIN_DISK_DETECT_ZEROES_UNMAP;
|
||||
+ copysrc->discard = VIR_DOMAIN_DISK_DISCARD_UNMAP;
|
||||
+ }
|
||||
|
||||
copysrc->backingStore = virStorageSourceNew();
|
||||
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,36 @@
|
||||
From 956b1a0e2c7ffec0ba7564e7f299f53508d8043c Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <956b1a0e2c7ffec0ba7564e7f299f53508d8043c.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 30 Sep 2024 14:16:58 +0200
|
||||
Subject: [PATCH] qemu: migration: Pre-create QCOW2 images for non-shared
|
||||
storage with 0 allocation
|
||||
|
||||
Specify that the <allocation> parameter for the newly-created qcow2
|
||||
image is 0 so that only metadata gets preallocated. Otherwise the
|
||||
storage driver code instructs qemu to use 'fallocate' preallocation mode
|
||||
and considers the image fully allocated.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 165b30e06a6d14e8719c82af290d3b20e4cbc462)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_migration.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 4fd7a0aafb..920b254351 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -361,6 +361,8 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn,
|
||||
virBufferAddLit(&buf, "<volume>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
virBufferEscapeString(&buf, "<name>%s</name>\n", volName);
|
||||
+ if (disk->src->format == VIR_STORAGE_FILE_QCOW2)
|
||||
+ virBufferAddLit(&buf, "<allocation>0</allocation>\n");
|
||||
virBufferAsprintf(&buf, "<capacity>%llu</capacity>\n", capacity);
|
||||
virBufferAddLit(&buf, "<target>\n");
|
||||
virBufferAdjustIndent(&buf, 2);
|
||||
--
|
||||
2.47.0
|
@ -1,100 +0,0 @@
|
||||
From 52036c598d2670b4d103c923be1fdd95c096be4e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <52036c598d2670b4d103c923be1fdd95c096be4e.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 16 Jan 2024 15:52:25 +0100
|
||||
Subject: [PATCH] qemu: migration: Properly handle reservation of manually
|
||||
specified NBD port
|
||||
|
||||
Originally the migration code didn't register the NBD disk port with the
|
||||
port allocator when it was manually specified. Later when commit
|
||||
e74d627bb3bc2684cbe3 refactored the code and started registering it, the
|
||||
old logic which was clearing 'priv->nbdPort' in case when it was manually
|
||||
specified was not removed.
|
||||
|
||||
This caused following problems:
|
||||
- the port was not released after successful migration
|
||||
- the port was released even when it was not allocated on failures
|
||||
regarding the NBD server start
|
||||
- the port was not released on other failures of the migration after
|
||||
NBD server startup
|
||||
|
||||
To address this we remove the assumption that 'priv->nbdPort' is used
|
||||
only for auto-allocated port and fill it only once the port is
|
||||
allocated and make the caller of qemuMigrationDstStartNBDServer
|
||||
responsible for releasing it.
|
||||
|
||||
Fixes: e74d627bb3bc2684cbe3edc1e2f7cc745b4e1ff3
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-21543
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||
(cherry picked from commit 43f027b57c4d885fc076ffb8829d525a3c343c6f)
|
||||
---
|
||||
src/qemu/qemu_migration.c | 22 +++++++---------------
|
||||
1 file changed, 7 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 25dc16a9e9..6f8b830969 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -527,6 +527,8 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
|
||||
* arguments in 'migrate' monitor command.
|
||||
* Error is reported here.
|
||||
*
|
||||
+ * Caller is responsible for releasing 'priv->nbdPort' from the port allocator.
|
||||
+ *
|
||||
* Returns 0 on success, -1 otherwise.
|
||||
*/
|
||||
static int
|
||||
@@ -627,6 +629,9 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
|
||||
server.port = port;
|
||||
}
|
||||
+
|
||||
+ /* caller will release the port */
|
||||
+ priv->nbdPort = server.port;
|
||||
}
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_MIGRATION_IN) < 0)
|
||||
@@ -643,14 +648,9 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
}
|
||||
|
||||
- if (server.transport == VIR_STORAGE_NET_HOST_TRANS_TCP)
|
||||
- priv->nbdPort = server.port;
|
||||
-
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
- if (ret < 0)
|
||||
- virPortAllocatorRelease(server.port);
|
||||
return ret;
|
||||
|
||||
exit_monitor:
|
||||
@@ -3261,11 +3261,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
|
||||
virDomainAuditStart(vm, "migrated", false);
|
||||
qemuProcessStop(driver, vm, VIR_DOMAIN_SHUTOFF_FAILED,
|
||||
VIR_ASYNC_JOB_MIGRATION_IN, stopFlags);
|
||||
- /* release if port is auto selected which is not the case if
|
||||
- * it is given in parameters
|
||||
- */
|
||||
- if (nbdPort == 0)
|
||||
- virPortAllocatorRelease(priv->nbdPort);
|
||||
+ virPortAllocatorRelease(priv->nbdPort);
|
||||
priv->nbdPort = 0;
|
||||
}
|
||||
goto cleanup;
|
||||
@@ -3425,11 +3421,7 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
|
||||
|
||||
if (autoPort)
|
||||
priv->migrationPort = port;
|
||||
- /* in this case port is not auto selected and we don't need to manage it
|
||||
- * anymore after cookie is baked
|
||||
- */
|
||||
- if (nbdPort != 0)
|
||||
- priv->nbdPort = 0;
|
||||
+
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,715 @@
|
||||
From 4a1d29eb1477d92a632947041f82d81ffe86673a Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <4a1d29eb1477d92a632947041f82d81ffe86673a.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 14:30:13 +0200
|
||||
Subject: [PATCH] qemu: migration: Remove 'nmigration_disks' variable from all
|
||||
places
|
||||
|
||||
Now that none of the functions need it we can drop it.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 448b14f74d095e25bb28edecf87ad31139d97dc9)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_driver.c | 47 ++++++-----------
|
||||
src/qemu/qemu_migration.c | 105 ++++++++++++++------------------------
|
||||
src/qemu/qemu_migration.h | 3 --
|
||||
3 files changed, 53 insertions(+), 102 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
||||
index d9073b2154..7bf1788e7c 100644
|
||||
--- a/src/qemu/qemu_driver.c
|
||||
+++ b/src/qemu/qemu_driver.c
|
||||
@@ -10714,7 +10714,7 @@ qemuDomainMigratePrepare2(virConnectPtr dconn,
|
||||
return qemuMigrationDstPrepareDirect(driver, dconn,
|
||||
NULL, 0, NULL, NULL, /* No cookies */
|
||||
uri_in, uri_out,
|
||||
- &def, origname, NULL, 0, NULL, 0, NULL,
|
||||
+ &def, origname, NULL, NULL, 0, NULL,
|
||||
migParams, flags);
|
||||
}
|
||||
|
||||
@@ -10764,7 +10764,7 @@ qemuDomainMigratePerform(virDomainPtr dom,
|
||||
* Consume any cookie we were able to decode though
|
||||
*/
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, NULL,
|
||||
- NULL, dconnuri, uri, NULL, NULL, 0, NULL, 0,
|
||||
+ NULL, dconnuri, uri, NULL, NULL, NULL, 0,
|
||||
NULL,
|
||||
migParams, cookie, cookielen,
|
||||
NULL, NULL, /* No output cookies in v2 */
|
||||
@@ -10840,7 +10840,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
|
||||
}
|
||||
|
||||
return qemuMigrationSrcBegin(domain->conn, vm, xmlin, dname,
|
||||
- cookieout, cookieoutlen, 0, NULL, flags);
|
||||
+ cookieout, cookieoutlen, NULL, flags);
|
||||
}
|
||||
|
||||
static char *
|
||||
@@ -10854,7 +10854,6 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
const char *xmlin = NULL;
|
||||
const char *dname = NULL;
|
||||
g_autofree const char **migrate_disks = NULL;
|
||||
- int nmigrate_disks;
|
||||
virDomainObj *vm;
|
||||
|
||||
virCheckFlags(QEMU_MIGRATION_FLAGS, NULL);
|
||||
@@ -10869,12 +10868,8 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
&dname) < 0)
|
||||
return NULL;
|
||||
|
||||
- nmigrate_disks = virTypedParamsGetStringList(params, nparams,
|
||||
- VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
- &migrate_disks);
|
||||
-
|
||||
- if (nmigrate_disks < 0)
|
||||
- return NULL;
|
||||
+ virTypedParamsGetStringList(params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
+ &migrate_disks);
|
||||
|
||||
if (!(vm = qemuDomainObjFromDomain(domain)))
|
||||
return NULL;
|
||||
@@ -10886,7 +10881,7 @@ qemuDomainMigrateBegin3Params(virDomainPtr domain,
|
||||
|
||||
return qemuMigrationSrcBegin(domain->conn, vm, xmlin, dname,
|
||||
cookieout, cookieoutlen,
|
||||
- nmigrate_disks, migrate_disks, flags);
|
||||
+ migrate_disks, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -10933,7 +10928,7 @@ qemuDomainMigratePrepare3(virConnectPtr dconn,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
uri_in, uri_out,
|
||||
- &def, origname, NULL, 0, NULL, 0,
|
||||
+ &def, origname, NULL, NULL, 0,
|
||||
NULL, migParams, flags);
|
||||
}
|
||||
|
||||
@@ -10956,7 +10951,6 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
|
||||
const char *uri_in = NULL;
|
||||
const char *listenAddress = NULL;
|
||||
int nbdPort = 0;
|
||||
- int nmigrate_disks;
|
||||
g_autofree const char **migrate_disks = NULL;
|
||||
g_autofree char *origname = NULL;
|
||||
g_autoptr(qemuMigrationParams) migParams = NULL;
|
||||
@@ -10986,19 +10980,15 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
|
||||
&nbdPort) < 0)
|
||||
return -1;
|
||||
|
||||
- nmigrate_disks = virTypedParamsGetStringList(params, nparams,
|
||||
- VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
- &migrate_disks);
|
||||
-
|
||||
- if (nmigrate_disks < 0)
|
||||
- return -1;
|
||||
+ virTypedParamsGetStringList(params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
+ &migrate_disks);
|
||||
|
||||
if (!(migParams = qemuMigrationParamsFromFlags(params, nparams, flags,
|
||||
QEMU_MIGRATION_DESTINATION)))
|
||||
return -1;
|
||||
|
||||
if (flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) ||
|
||||
- nmigrate_disks > 0) {
|
||||
+ migrate_disks) {
|
||||
if (uri_in && STRPREFIX(uri_in, "unix:") && !nbdURI) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("NBD URI must be supplied when migration URI uses UNIX transport method"));
|
||||
@@ -11042,7 +11032,7 @@ qemuDomainMigratePrepare3Params(virConnectPtr dconn,
|
||||
cookieout, cookieoutlen,
|
||||
uri_in, uri_out,
|
||||
&def, origname, listenAddress,
|
||||
- nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ migrate_disks, nbdPort,
|
||||
nbdURI, migParams, flags);
|
||||
}
|
||||
|
||||
@@ -11172,7 +11162,7 @@ qemuDomainMigratePerform3(virDomainPtr dom,
|
||||
goto cleanup;
|
||||
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, xmlin, NULL,
|
||||
- dconnuri, uri, NULL, NULL, 0, NULL, 0,
|
||||
+ dconnuri, uri, NULL, NULL, NULL, 0,
|
||||
NULL, migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -11202,7 +11192,6 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
const char *uri = NULL;
|
||||
const char *graphicsuri = NULL;
|
||||
const char *listenAddress = NULL;
|
||||
- int nmigrate_disks;
|
||||
g_autofree const char **migrate_disks = NULL;
|
||||
unsigned long long bandwidth = 0;
|
||||
int nbdPort = 0;
|
||||
@@ -11258,15 +11247,11 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
}
|
||||
}
|
||||
|
||||
- nmigrate_disks = virTypedParamsGetStringList(params, nparams,
|
||||
- VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
- &migrate_disks);
|
||||
-
|
||||
- if (nmigrate_disks < 0)
|
||||
- goto cleanup;
|
||||
+ virTypedParamsGetStringList(params, nparams, VIR_MIGRATE_PARAM_MIGRATE_DISKS,
|
||||
+ &migrate_disks);
|
||||
|
||||
if (flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC) ||
|
||||
- nmigrate_disks > 0) {
|
||||
+ migrate_disks) {
|
||||
if (uri && STRPREFIX(uri, "unix:") && !nbdURI) {
|
||||
virReportError(VIR_ERR_INVALID_ARG, "%s",
|
||||
_("NBD URI must be supplied when migration URI uses UNIX transport method"));
|
||||
@@ -11286,7 +11271,7 @@ qemuDomainMigratePerform3Params(virDomainPtr dom,
|
||||
|
||||
ret = qemuMigrationSrcPerform(driver, dom->conn, vm, dom_xml, persist_xml,
|
||||
dconnuri, uri, graphicsuri, listenAddress,
|
||||
- nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ migrate_disks, nbdPort,
|
||||
nbdURI, migParams,
|
||||
cookiein, cookieinlen, cookieout, cookieoutlen,
|
||||
flags, dname, bandwidth, true);
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 21d4c3ece6..658251a666 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -382,7 +382,6 @@ qemuMigrationDstPrecreateDisk(virConnectPtr *conn,
|
||||
|
||||
static bool
|
||||
qemuMigrationAnyCopyDisk(virDomainDiskDef const *disk,
|
||||
- size_t nmigrate_disks G_GNUC_UNUSED,
|
||||
const char **migrate_disks)
|
||||
{
|
||||
/* List of disks to migrate takes priority if present */
|
||||
@@ -398,13 +397,12 @@ qemuMigrationAnyCopyDisk(virDomainDiskDef const *disk,
|
||||
|
||||
static bool
|
||||
qemuMigrationHasAnyStorageMigrationDisks(virDomainDef *def,
|
||||
- const char **migrate_disks,
|
||||
- size_t nmigrate_disks)
|
||||
+ const char **migrate_disks)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
- if (qemuMigrationAnyCopyDisk(def->disks[i], nmigrate_disks, migrate_disks))
|
||||
+ if (qemuMigrationAnyCopyDisk(def->disks[i], migrate_disks))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -415,7 +413,6 @@ qemuMigrationHasAnyStorageMigrationDisks(virDomainDef *def,
|
||||
static int
|
||||
qemuMigrationDstPrepareStorage(virDomainObj *vm,
|
||||
qemuMigrationCookieNBD *nbd,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
bool incremental)
|
||||
{
|
||||
@@ -440,7 +437,7 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
|
||||
}
|
||||
|
||||
/* Skip disks we don't want to migrate. */
|
||||
- if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks))
|
||||
+ if (!qemuMigrationAnyCopyDisk(disk, migrate_disks))
|
||||
continue;
|
||||
|
||||
switch (virStorageSourceGetActualType(disk->src)) {
|
||||
@@ -547,7 +544,6 @@ static int
|
||||
qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
virDomainObj *vm,
|
||||
const char *listenAddr,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -614,7 +610,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
g_autofree char *diskAlias = NULL;
|
||||
|
||||
/* check whether disk should be migrated */
|
||||
- if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks))
|
||||
+ if (!qemuMigrationAnyCopyDisk(disk, migrate_disks))
|
||||
continue;
|
||||
|
||||
if (disk->src->readonly || virStorageSourceIsEmpty(disk->src)) {
|
||||
@@ -1186,7 +1182,6 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
||||
qemuMigrationCookie *mig,
|
||||
const char *host,
|
||||
unsigned long speed,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
virConnectPtr dconn,
|
||||
const char *tlsAlias,
|
||||
@@ -1261,7 +1256,7 @@ qemuMigrationSrcNBDStorageCopy(virQEMUDriver *driver,
|
||||
virDomainDiskDef *disk = vm->def->disks[i];
|
||||
|
||||
/* check whether disk should be migrated */
|
||||
- if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks))
|
||||
+ if (!qemuMigrationAnyCopyDisk(disk, migrate_disks))
|
||||
continue;
|
||||
|
||||
if (qemuMigrationSrcNBDStorageCopyOne(vm, disk, host, port,
|
||||
@@ -1614,7 +1609,6 @@ qemuMigrationSrcIsAllowed(virDomainObj *vm,
|
||||
static bool
|
||||
qemuMigrationSrcIsSafe(virDomainDef *def,
|
||||
virQEMUCaps *qemuCaps,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
unsigned int flags)
|
||||
|
||||
@@ -1638,7 +1632,7 @@ qemuMigrationSrcIsSafe(virDomainDef *def,
|
||||
|
||||
/* Disks which are migrated by qemu are safe too. */
|
||||
if (storagemigration &&
|
||||
- qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks))
|
||||
+ qemuMigrationAnyCopyDisk(disk, migrate_disks))
|
||||
continue;
|
||||
|
||||
/* However, disks on local FS (e.g. ext4) are not safe. */
|
||||
@@ -2420,8 +2414,7 @@ qemuMigrationAnyConnectionClosed(virDomainObj *vm,
|
||||
static int
|
||||
qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookie *mig,
|
||||
virDomainObj *vm,
|
||||
- const char **migrate_disks,
|
||||
- size_t nmigrate_disks)
|
||||
+ const char **migrate_disks)
|
||||
|
||||
{
|
||||
GSList *disks = NULL;
|
||||
@@ -2443,7 +2436,7 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookie *mig,
|
||||
if (!nodedata)
|
||||
continue;
|
||||
|
||||
- if (!qemuMigrationAnyCopyDisk(diskdef, nmigrate_disks, migrate_disks))
|
||||
+ if (!qemuMigrationAnyCopyDisk(diskdef, migrate_disks))
|
||||
continue;
|
||||
|
||||
for (j = 0; j < nodedata->nbitmaps; j++) {
|
||||
@@ -2513,7 +2506,6 @@ qemuMigrationSrcBeginXML(virDomainObj *vm,
|
||||
int *cookieoutlen,
|
||||
unsigned int cookieFlags,
|
||||
const char **migrate_disks,
|
||||
- size_t nmigrate_disks,
|
||||
unsigned int flags)
|
||||
{
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
@@ -2531,8 +2523,7 @@ qemuMigrationSrcBeginXML(virDomainObj *vm,
|
||||
|
||||
if (cookieFlags & QEMU_MIGRATION_COOKIE_NBD &&
|
||||
virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_BLOCK_BITMAP_MAPPING) &&
|
||||
- qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(mig, vm, migrate_disks,
|
||||
- nmigrate_disks) < 0)
|
||||
+ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(mig, vm, migrate_disks) < 0)
|
||||
return NULL;
|
||||
|
||||
if (qemuMigrationCookieFormat(mig, driver, vm,
|
||||
@@ -2598,7 +2589,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
const char *dname,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
unsigned int flags)
|
||||
{
|
||||
@@ -2624,8 +2614,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
return NULL;
|
||||
|
||||
if (!(flags & (VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE)) &&
|
||||
- !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps,
|
||||
- nmigrate_disks, migrate_disks, flags))
|
||||
+ !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps, migrate_disks, flags))
|
||||
return NULL;
|
||||
|
||||
if (flags & VIR_MIGRATE_POSTCOPY &&
|
||||
@@ -2680,9 +2669,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
|
||||
priv->nbdPort = 0;
|
||||
|
||||
- if (qemuMigrationHasAnyStorageMigrationDisks(vm->def,
|
||||
- migrate_disks,
|
||||
- nmigrate_disks))
|
||||
+ if (qemuMigrationHasAnyStorageMigrationDisks(vm->def, migrate_disks))
|
||||
cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
|
||||
} else {
|
||||
if (migrate_disks) {
|
||||
@@ -2704,8 +2691,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriver *driver,
|
||||
|
||||
return qemuMigrationSrcBeginXML(vm, xmlin,
|
||||
cookieout, cookieoutlen, cookieFlags,
|
||||
- migrate_disks, nmigrate_disks,
|
||||
- flags);
|
||||
+ migrate_disks, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -2795,7 +2781,7 @@ qemuMigrationSrcBeginResume(virDomainObj *vm,
|
||||
}
|
||||
|
||||
return qemuMigrationSrcBeginXML(vm, xmlin,
|
||||
- cookieout, cookieoutlen, 0, NULL, 0, flags);
|
||||
+ cookieout, cookieoutlen, 0, NULL, flags);
|
||||
}
|
||||
|
||||
|
||||
@@ -2840,7 +2826,6 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
const char *dname,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
unsigned int flags)
|
||||
{
|
||||
@@ -2891,7 +2876,7 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
|
||||
if (!(xml = qemuMigrationSrcBeginPhase(driver, vm, xmlin, dname,
|
||||
cookieout, cookieoutlen,
|
||||
- nmigrate_disks, migrate_disks, flags)))
|
||||
+ migrate_disks, flags)))
|
||||
goto endjob;
|
||||
|
||||
if ((flags & VIR_MIGRATE_CHANGE_PROTECTION)) {
|
||||
@@ -3104,7 +3089,6 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
|
||||
const char *protocol,
|
||||
unsigned short port,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -3132,8 +3116,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
|
||||
goto error;
|
||||
}
|
||||
|
||||
- if (qemuMigrationDstPrepareStorage(vm, mig->nbd,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ if (qemuMigrationDstPrepareStorage(vm, mig->nbd, migrate_disks,
|
||||
!!(flags & VIR_MIGRATE_NON_SHARED_INC)) < 0)
|
||||
goto error;
|
||||
|
||||
@@ -3228,7 +3211,7 @@ qemuMigrationDstPrepareActive(virQEMUDriver *driver,
|
||||
}
|
||||
|
||||
if (qemuMigrationDstStartNBDServer(driver, vm, incoming->address,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
nbdPort, nbdURI,
|
||||
nbdTLSAlias) < 0) {
|
||||
goto error;
|
||||
@@ -3299,7 +3282,6 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
|
||||
unsigned short port,
|
||||
bool autoPort,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -3409,7 +3391,7 @@ qemuMigrationDstPrepareFresh(virQEMUDriver *driver,
|
||||
if (!(flags & VIR_MIGRATE_OFFLINE)) {
|
||||
if (qemuMigrationDstPrepareActive(driver, vm, dconn, mig, st,
|
||||
protocol, port, listenAddress,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
nbdPort, nbdURI,
|
||||
migParams, flags) < 0) {
|
||||
goto stopjob;
|
||||
@@ -3572,7 +3554,6 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
|
||||
unsigned short port,
|
||||
bool autoPort,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -3635,7 +3616,7 @@ qemuMigrationDstPrepareAny(virQEMUDriver *driver,
|
||||
cookieout, cookieoutlen,
|
||||
def, origname, st, protocol,
|
||||
port, autoPort, listenAddress,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
nbdPort, nbdURI,
|
||||
migParams, flags);
|
||||
}
|
||||
@@ -3672,7 +3653,7 @@ qemuMigrationDstPrepareTunnel(virQEMUDriver *driver,
|
||||
|
||||
return qemuMigrationDstPrepareAny(driver, dconn, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, def, origname,
|
||||
- st, NULL, 0, false, NULL, 0, NULL, 0,
|
||||
+ st, NULL, 0, false, NULL, NULL, 0,
|
||||
NULL, migParams, flags);
|
||||
}
|
||||
|
||||
@@ -3711,7 +3692,6 @@ qemuMigrationDstPrepareDirect(virQEMUDriver *driver,
|
||||
virDomainDef **def,
|
||||
const char *origname,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -3842,7 +3822,7 @@ qemuMigrationDstPrepareDirect(virQEMUDriver *driver,
|
||||
cookieout, cookieoutlen, def, origname,
|
||||
NULL, uri ? uri->scheme : "tcp",
|
||||
port, autoPort, listenAddress,
|
||||
- nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ migrate_disks, nbdPort,
|
||||
nbdURI, migParams, flags);
|
||||
cleanup:
|
||||
if (ret != 0) {
|
||||
@@ -4741,7 +4721,6 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
qemuMigrationSpec *spec,
|
||||
virConnectPtr dconn,
|
||||
const char *graphicsuri,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
qemuMigrationParams *migParams,
|
||||
const char *nbdURI)
|
||||
@@ -4776,8 +4755,7 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
|
||||
if (storageMigration)
|
||||
storageMigration = qemuMigrationHasAnyStorageMigrationDisks(vm->def,
|
||||
- migrate_disks,
|
||||
- nmigrate_disks);
|
||||
+ migrate_disks);
|
||||
|
||||
if (storageMigration) {
|
||||
cookieFlags |= QEMU_MIGRATION_COOKIE_NBD;
|
||||
@@ -4910,7 +4888,6 @@ qemuMigrationSrcRun(virQEMUDriver *driver,
|
||||
if (qemuMigrationSrcNBDStorageCopy(driver, vm, mig,
|
||||
host,
|
||||
priv->migMaxBandwidth,
|
||||
- nmigrate_disks,
|
||||
migrate_disks,
|
||||
dconn, tlsAlias, tlsHostname,
|
||||
nbdURI, flags) < 0) {
|
||||
@@ -5168,7 +5145,6 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
unsigned long resource,
|
||||
virConnectPtr dconn,
|
||||
const char *graphicsuri,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
qemuMigrationParams *migParams,
|
||||
const char *nbdURI)
|
||||
@@ -5249,7 +5225,7 @@ qemuMigrationSrcPerformNative(virQEMUDriver *driver,
|
||||
ret = qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource,
|
||||
&spec, dconn, graphicsuri,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
migParams, nbdURI);
|
||||
}
|
||||
|
||||
@@ -5274,7 +5250,6 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver,
|
||||
unsigned long resource,
|
||||
virConnectPtr dconn,
|
||||
const char *graphicsuri,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
qemuMigrationParams *migParams)
|
||||
{
|
||||
@@ -5313,7 +5288,7 @@ qemuMigrationSrcPerformTunnel(virQEMUDriver *driver,
|
||||
|
||||
ret = qemuMigrationSrcRun(driver, vm, xmlin, persist_xml, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags, resource, &spec,
|
||||
- dconn, graphicsuri, nmigrate_disks, migrate_disks,
|
||||
+ dconn, graphicsuri, migrate_disks,
|
||||
migParams, NULL);
|
||||
|
||||
cleanup:
|
||||
@@ -5353,7 +5328,7 @@ qemuMigrationSrcPerformResume(virQEMUDriver *driver,
|
||||
ret = qemuMigrationSrcPerformNative(driver, vm, NULL, NULL, uri,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags,
|
||||
- 0, NULL, NULL, 0, NULL, migParams, NULL);
|
||||
+ 0, NULL, NULL, NULL, migParams, NULL);
|
||||
|
||||
virCloseCallbacksDomainAdd(vm, conn, qemuMigrationAnyConnectionClosed);
|
||||
|
||||
@@ -5455,12 +5430,12 @@ qemuMigrationSrcPerformPeer2Peer2(virQEMUDriver *driver,
|
||||
ret = qemuMigrationSrcPerformTunnel(driver, vm, st, NULL, NULL,
|
||||
NULL, 0, NULL, NULL,
|
||||
flags, resource, dconn,
|
||||
- NULL, 0, NULL, migParams);
|
||||
+ NULL, NULL, migParams);
|
||||
else
|
||||
ret = qemuMigrationSrcPerformNative(driver, vm, NULL, NULL, uri_out,
|
||||
cookie, cookielen,
|
||||
NULL, NULL, /* No out cookie with v2 migration */
|
||||
- flags, resource, dconn, NULL, 0, NULL,
|
||||
+ flags, resource, dconn, NULL, NULL,
|
||||
migParams, NULL);
|
||||
|
||||
/* Perform failed. Make sure Finish doesn't overwrite the error */
|
||||
@@ -5523,7 +5498,6 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -5569,7 +5543,7 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
} else {
|
||||
dom_xml = qemuMigrationSrcBeginPhase(driver, vm, xmlin, dname,
|
||||
&cookieout, &cookieoutlen,
|
||||
- nmigrate_disks, migrate_disks, flags);
|
||||
+ migrate_disks, flags);
|
||||
}
|
||||
if (!dom_xml)
|
||||
goto cleanup;
|
||||
@@ -5720,14 +5694,14 @@ qemuMigrationSrcPerformPeer2Peer3(virQEMUDriver *driver,
|
||||
cookiein, cookieinlen,
|
||||
&cookieout, &cookieoutlen,
|
||||
flags, bandwidth, dconn, graphicsuri,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
migParams);
|
||||
} else {
|
||||
ret = qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_xml, uri,
|
||||
cookiein, cookieinlen,
|
||||
&cookieout, &cookieoutlen,
|
||||
flags, bandwidth, dconn, graphicsuri,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
migParams, nbdURI);
|
||||
}
|
||||
|
||||
@@ -5900,7 +5874,6 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -6026,7 +5999,7 @@ qemuMigrationSrcPerformPeer2Peer(virQEMUDriver *driver,
|
||||
if (*v3proto) {
|
||||
ret = qemuMigrationSrcPerformPeer2Peer3(driver, sconn, dconn, dconnuri, vm, xmlin,
|
||||
persist_xml, dname, uri, graphicsuri,
|
||||
- listenAddress, nmigrate_disks, migrate_disks,
|
||||
+ listenAddress, migrate_disks,
|
||||
nbdPort, nbdURI, migParams, resource,
|
||||
!!useParams, flags);
|
||||
} else {
|
||||
@@ -6062,7 +6035,6 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -6105,8 +6077,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
goto endjob;
|
||||
|
||||
if (!(flags & (VIR_MIGRATE_UNSAFE | VIR_MIGRATE_OFFLINE)) &&
|
||||
- !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps,
|
||||
- nmigrate_disks, migrate_disks, flags))
|
||||
+ !qemuMigrationSrcIsSafe(vm->def, priv->qemuCaps, migrate_disks, flags))
|
||||
goto endjob;
|
||||
|
||||
qemuMigrationSrcStoreDomainState(vm);
|
||||
@@ -6115,7 +6086,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
if ((flags & (VIR_MIGRATE_TUNNELLED | VIR_MIGRATE_PEER2PEER))) {
|
||||
ret = qemuMigrationSrcPerformPeer2Peer(driver, conn, vm, xmlin, persist_xml,
|
||||
dconnuri, uri, graphicsuri, listenAddress,
|
||||
- nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ migrate_disks, nbdPort,
|
||||
nbdURI,
|
||||
migParams, flags, dname, resource,
|
||||
&v3proto);
|
||||
@@ -6125,7 +6096,7 @@ qemuMigrationSrcPerformJob(virQEMUDriver *driver,
|
||||
|
||||
ret = qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_xml, uri, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
- flags, resource, NULL, NULL, 0, NULL,
|
||||
+ flags, resource, NULL, NULL, NULL,
|
||||
migParams, nbdURI);
|
||||
}
|
||||
if (ret < 0)
|
||||
@@ -6192,7 +6163,6 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
|
||||
const char *persist_xml,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
qemuMigrationParams *migParams,
|
||||
const char *cookiein,
|
||||
@@ -6229,7 +6199,7 @@ qemuMigrationSrcPerformPhase(virQEMUDriver *driver,
|
||||
if (qemuMigrationSrcPerformNative(driver, vm, xmlin, persist_xml, uri, cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
flags, resource, NULL, graphicsuri,
|
||||
- nmigrate_disks, migrate_disks, migParams, nbdURI) < 0)
|
||||
+ migrate_disks, migParams, nbdURI) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virCloseCallbacksDomainAdd(vm, conn, qemuMigrationAnyConnectionClosed);
|
||||
@@ -6270,7 +6240,6 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -6315,7 +6284,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
|
||||
return qemuMigrationSrcPerformJob(driver, conn, vm, xmlin, persist_xml, dconnuri, uri,
|
||||
graphicsuri, listenAddress,
|
||||
- nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ migrate_disks, nbdPort,
|
||||
nbdURI, migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -6331,7 +6300,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
if (v3proto) {
|
||||
return qemuMigrationSrcPerformPhase(driver, conn, vm, xmlin, persist_xml, uri,
|
||||
graphicsuri,
|
||||
- nmigrate_disks, migrate_disks,
|
||||
+ migrate_disks,
|
||||
migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen,
|
||||
@@ -6340,7 +6309,7 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
|
||||
return qemuMigrationSrcPerformJob(driver, conn, vm, xmlin, persist_xml, NULL,
|
||||
uri, graphicsuri, listenAddress,
|
||||
- nmigrate_disks, migrate_disks, nbdPort,
|
||||
+ migrate_disks, nbdPort,
|
||||
nbdURI, migParams,
|
||||
cookiein, cookieinlen,
|
||||
cookieout, cookieoutlen, flags,
|
||||
diff --git a/src/qemu/qemu_migration.h b/src/qemu/qemu_migration.h
|
||||
index ed62fd4a91..4dced4b166 100644
|
||||
--- a/src/qemu/qemu_migration.h
|
||||
+++ b/src/qemu/qemu_migration.h
|
||||
@@ -122,7 +122,6 @@ qemuMigrationSrcBegin(virConnectPtr conn,
|
||||
const char *dname,
|
||||
char **cookieout,
|
||||
int *cookieoutlen,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
unsigned int flags);
|
||||
|
||||
@@ -158,7 +157,6 @@ qemuMigrationDstPrepareDirect(virQEMUDriver *driver,
|
||||
virDomainDef **def,
|
||||
const char *origname,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
@@ -175,7 +173,6 @@ qemuMigrationSrcPerform(virQEMUDriver *driver,
|
||||
const char *uri,
|
||||
const char *graphicsuri,
|
||||
const char *listenAddress,
|
||||
- size_t nmigrate_disks,
|
||||
const char **migrate_disks,
|
||||
int nbdPort,
|
||||
const char *nbdURI,
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,52 @@
|
||||
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?= <jtomko@redhat.com>
|
||||
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 <jtomko@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit d94b31a68ab94f27f8a1d6d216817b49881c38ae)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-40135
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
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
|
@ -0,0 +1,49 @@
|
||||
From bbe550bf0b916cfd71bb0accfe818fc3a18ed569 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <bbe550bf0b916cfd71bb0accfe818fc3a18ed569.1723196972.git.jdenemar@redhat.com>
|
||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
||||
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 <jtomko@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 8d3b2397372111d15d6b79138c5c5a80203f85f5)
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
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
|
@ -1,40 +0,0 @@
|
||||
From 2087ac009a019ceb206475363113bbe6c2821e2f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <2087ac009a019ceb206475363113bbe6c2821e2f.1708614745.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 16 Feb 2024 16:40:20 +0100
|
||||
Subject: [PATCH] qemuMigrationDstPrepareStorage: Properly consider path for
|
||||
'vdpa' devices
|
||||
|
||||
Allow storage migration of VDPA devices by properly checking that they
|
||||
exist on the destionation. Pre-creation is not supported but if the
|
||||
device exists the migration should be able to succeed.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 00c0a94ab5f135ea7d9f0a905ff53d13c82761db)
|
||||
https://issues.redhat.com/browse/RHEL-24825
|
||||
---
|
||||
src/qemu/qemu_migration.c | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 3e0aae4e7c..5e27cd5dbe 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -479,10 +479,13 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
|
||||
diskSrcPath = nvmePath;
|
||||
break;
|
||||
|
||||
+ case VIR_STORAGE_TYPE_VHOST_VDPA:
|
||||
+ diskSrcPath = disk->src->vdpadev;
|
||||
+ break;
|
||||
+
|
||||
case VIR_STORAGE_TYPE_NETWORK:
|
||||
case VIR_STORAGE_TYPE_VOLUME:
|
||||
case VIR_STORAGE_TYPE_VHOST_USER:
|
||||
- case VIR_STORAGE_TYPE_VHOST_VDPA:
|
||||
case VIR_STORAGE_TYPE_LAST:
|
||||
case VIR_STORAGE_TYPE_NONE:
|
||||
break;
|
||||
--
|
||||
2.43.2
|
@ -1,60 +0,0 @@
|
||||
From b73313c9679766c493afb91f0c691e437632e4fa Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b73313c9679766c493afb91f0c691e437632e4fa.1708614745.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 8 Feb 2024 16:48:25 +0100
|
||||
Subject: [PATCH] qemuMigrationDstPrepareStorage: Use 'switch' statement to
|
||||
include all storage types
|
||||
|
||||
Decrease the likelyhood that addition of a new storage type will be
|
||||
forgotten.
|
||||
|
||||
This patch also unifies the type check to consult the 'actual' type of
|
||||
the storage in both cases as the NVMe check looked for the XML declared
|
||||
type while virStorageSourceIsLocalStorage() looks for the
|
||||
actual/translated type.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit e158b523b8522931200c415ef86562641a2a7c8c)
|
||||
https://issues.redhat.com/browse/RHEL-24825
|
||||
---
|
||||
src/qemu/qemu_migration.c | 22 +++++++++++++++++++---
|
||||
1 file changed, 19 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 01ab803842..3e0aae4e7c 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -465,11 +465,27 @@ qemuMigrationDstPrepareStorage(virDomainObj *vm,
|
||||
if (!qemuMigrationAnyCopyDisk(disk, nmigrate_disks, migrate_disks))
|
||||
continue;
|
||||
|
||||
- if (disk->src->type == VIR_STORAGE_TYPE_NVME) {
|
||||
+ switch (virStorageSourceGetActualType(disk->src)) {
|
||||
+ case VIR_STORAGE_TYPE_FILE:
|
||||
+ case VIR_STORAGE_TYPE_BLOCK:
|
||||
+ case VIR_STORAGE_TYPE_DIR:
|
||||
+ diskSrcPath = virDomainDiskGetSource(disk);
|
||||
+ break;
|
||||
+
|
||||
+ case VIR_STORAGE_TYPE_NVME:
|
||||
+ /* While NVMe disks are local, they are not accessible via src->path.
|
||||
+ * Therefore, we have to return false here. */
|
||||
virPCIDeviceAddressGetSysfsFile(&disk->src->nvme->pciAddr, &nvmePath);
|
||||
diskSrcPath = nvmePath;
|
||||
- } else if (virStorageSourceIsLocalStorage(disk->src)) {
|
||||
- diskSrcPath = virDomainDiskGetSource(disk);
|
||||
+ break;
|
||||
+
|
||||
+ case VIR_STORAGE_TYPE_NETWORK:
|
||||
+ case VIR_STORAGE_TYPE_VOLUME:
|
||||
+ case VIR_STORAGE_TYPE_VHOST_USER:
|
||||
+ case VIR_STORAGE_TYPE_VHOST_VDPA:
|
||||
+ case VIR_STORAGE_TYPE_LAST:
|
||||
+ case VIR_STORAGE_TYPE_NONE:
|
||||
+ break;
|
||||
}
|
||||
|
||||
if (diskSrcPath) {
|
||||
--
|
||||
2.43.2
|
@ -1,84 +0,0 @@
|
||||
From d968a490b2fb8b4c7af2c835288e6f693ea1cc67 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <d968a490b2fb8b4c7af2c835288e6f693ea1cc67.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 16 Jan 2024 16:22:03 +0100
|
||||
Subject: [PATCH] qemuMigrationDstStartNBDServer: Refactor cleanup
|
||||
|
||||
There's nothing under the 'cleanup:' label thus the whole code can be
|
||||
simplified.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||
(cherry picked from commit 36e11cca83c6617a81528969c27579a1ab891443)
|
||||
https://issues.redhat.com/browse/RHEL-21543
|
||||
---
|
||||
src/qemu/qemu_migration.c | 18 +++++++-----------
|
||||
1 file changed, 7 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 6f8b830969..01ab803842 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -541,7 +541,6 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
const char *nbdURI,
|
||||
const char *tls_alias)
|
||||
{
|
||||
- int ret = -1;
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
size_t i;
|
||||
virStorageNetHostDef server = {
|
||||
@@ -610,22 +609,22 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
|
||||
_("Cannot migrate empty or read-only disk %1$s"),
|
||||
disk->dst);
|
||||
- goto cleanup;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (!(diskAlias = qemuAliasDiskDriveFromDisk(disk)))
|
||||
- goto cleanup;
|
||||
+ return -1;
|
||||
|
||||
if (!server_started &&
|
||||
server.transport == VIR_STORAGE_NET_HOST_TRANS_TCP) {
|
||||
if (server.port) {
|
||||
if (virPortAllocatorSetUsed(server.port) < 0)
|
||||
- goto cleanup;
|
||||
+ return -1;
|
||||
} else {
|
||||
unsigned short port = 0;
|
||||
|
||||
if (virPortAllocatorAcquire(driver->migrationPorts, &port) < 0)
|
||||
- goto cleanup;
|
||||
+ return -1;
|
||||
|
||||
server.port = port;
|
||||
}
|
||||
@@ -635,7 +634,7 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
}
|
||||
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, VIR_ASYNC_JOB_MIGRATION_IN) < 0)
|
||||
- goto cleanup;
|
||||
+ return -1;
|
||||
|
||||
if (!server_started) {
|
||||
if (qemuMonitorNBDServerStart(priv->mon, &server, tls_alias) < 0)
|
||||
@@ -648,14 +647,11 @@ qemuMigrationDstStartNBDServer(virQEMUDriver *driver,
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
}
|
||||
|
||||
- ret = 0;
|
||||
-
|
||||
- cleanup:
|
||||
- return ret;
|
||||
+ return 0;
|
||||
|
||||
exit_monitor:
|
||||
qemuDomainObjExitMonitor(vm);
|
||||
- goto cleanup;
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,50 @@
|
||||
From 7d4961b666c2d805fa777d0fca93094c3f90cb59 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <7d4961b666c2d805fa777d0fca93094c3f90cb59.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 13:33:40 +0200
|
||||
Subject: [PATCH] qemuMigrationSrcBeginPhaseBlockDirtyBitmaps: Use
|
||||
qemuMigrationAnyCopyDisk()
|
||||
|
||||
The function open-coded the checking whether a disk is being migrated
|
||||
with non-shared storage and did so badly (not taking into account if
|
||||
user doesn't explicitly provide list of disks to migrate).
|
||||
|
||||
Use the existing helper instead.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit ab52a069eed7e7436d0b5a0ba836472f894e053b)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/qemu/qemu_migration.c | 15 ++-------------
|
||||
1 file changed, 2 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
|
||||
index 920b254351..09d4a31ca6 100644
|
||||
--- a/src/qemu/qemu_migration.c
|
||||
+++ b/src/qemu/qemu_migration.c
|
||||
@@ -2449,19 +2449,8 @@ qemuMigrationSrcBeginPhaseBlockDirtyBitmaps(qemuMigrationCookie *mig,
|
||||
if (!nodedata)
|
||||
continue;
|
||||
|
||||
- if (migrate_disks) {
|
||||
- bool migrating = false;
|
||||
-
|
||||
- for (j = 0; j < nmigrate_disks; j++) {
|
||||
- if (STREQ(migrate_disks[j], diskdef->dst)) {
|
||||
- migrating = true;
|
||||
- break;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (!migrating)
|
||||
- continue;
|
||||
- }
|
||||
+ if (!qemuMigrationAnyCopyDisk(diskdef, nmigrate_disks, migrate_disks))
|
||||
+ continue;
|
||||
|
||||
for (j = 0; j < nodedata->nbitmaps; j++) {
|
||||
qemuMigrationBlockDirtyBitmapsDiskBitmap *bitmap;
|
||||
--
|
||||
2.47.0
|
@ -1,94 +0,0 @@
|
||||
From 7dd85500450b1889a81d574337331e080b218c9f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <7dd85500450b1889a81d574337331e080b218c9f.1707394626.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Thu, 4 Jan 2024 10:57:12 +0100
|
||||
Subject: [PATCH] qemu_capabilities: Add
|
||||
QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS capability
|
||||
|
||||
Starting from v8.2.0-rc0~74^2~2 QEMU has .dynamic-memslots
|
||||
attribute for virtio-mem-pci device. Introduce a capability which
|
||||
reflects that.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 497cab753b801c7a66e2a480482e5144665ecbf4)
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-15316
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_capabilities.c | 2 ++
|
||||
src/qemu/qemu_capabilities.h | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 +
|
||||
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 +
|
||||
5 files changed, 6 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
||||
index a4d42b40ed..e13df2b27d 100644
|
||||
--- a/src/qemu/qemu_capabilities.c
|
||||
+++ b/src/qemu/qemu_capabilities.c
|
||||
@@ -700,6 +700,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
||||
"virtio-blk-vhost-vdpa", /* QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA */
|
||||
"virtio-blk.iothread-mapping", /* QEMU_CAPS_VIRTIO_BLK_IOTHREAD_MAPPING */
|
||||
"smp-clusters", /* QEMU_CAPS_SMP_CLUSTERS */
|
||||
+ "virtio-mem-pci.dynamic-memslots", /* QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS */
|
||||
);
|
||||
|
||||
|
||||
@@ -1519,6 +1520,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVhostUserFS[] =
|
||||
|
||||
static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioMemPCI[] = {
|
||||
{ "prealloc", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_PREALLOC, NULL },
|
||||
+ { "dynamic-memslots", QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS, NULL },
|
||||
};
|
||||
|
||||
static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsVirtioIOMMU[] = {
|
||||
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
||||
index a353750670..82ae4b738b 100644
|
||||
--- a/src/qemu/qemu_capabilities.h
|
||||
+++ b/src/qemu/qemu_capabilities.h
|
||||
@@ -679,6 +679,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
||||
QEMU_CAPS_DEVICE_VIRTIO_BLK_VHOST_VDPA, /* virtio-blk-vhost-vdpa block driver */
|
||||
QEMU_CAPS_VIRTIO_BLK_IOTHREAD_MAPPING, /* virtio-blk supports per-virtqueue iothread mapping */
|
||||
QEMU_CAPS_SMP_CLUSTERS, /* -smp clusters= */
|
||||
+ QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS, /* -device virtio-mem-pci.dynamic-memslots= */
|
||||
|
||||
QEMU_CAPS_LAST /* this must always be the last item */
|
||||
} virQEMUCapsFlags;
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
||||
index 54fd349365..03c9343da5 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
||||
@@ -163,6 +163,7 @@
|
||||
<flag name='qcow2-discard-no-unref'/>
|
||||
<flag name='run-with.async-teardown'/>
|
||||
<flag name='smp-clusters'/>
|
||||
+ <flag name='virtio-mem-pci.dynamic-memslots'/>
|
||||
<version>8002000</version>
|
||||
<microcodeVersion>61700246</microcodeVersion>
|
||||
<package>v8.2.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
||||
index 8a6527810a..d16cd88720 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
||||
@@ -200,6 +200,7 @@
|
||||
<flag name='run-with.async-teardown'/>
|
||||
<flag name='virtio-blk-vhost-vdpa'/>
|
||||
<flag name='smp-clusters'/>
|
||||
+ <flag name='virtio-mem-pci.dynamic-memslots'/>
|
||||
<version>8002000</version>
|
||||
<microcodeVersion>43100246</microcodeVersion>
|
||||
<package>v8.2.0</package>
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
||||
index b4c3b1bae3..65eaa08cd4 100644
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
||||
@@ -201,6 +201,7 @@
|
||||
<flag name='virtio-blk-vhost-vdpa'/>
|
||||
<flag name='virtio-blk.iothread-mapping'/>
|
||||
<flag name='smp-clusters'/>
|
||||
+ <flag name='virtio-mem-pci.dynamic-memslots'/>
|
||||
<version>8002050</version>
|
||||
<microcodeVersion>43100245</microcodeVersion>
|
||||
<package>v8.2.0-196-g7425b6277f</package>
|
||||
--
|
||||
2.43.0
|
@ -1,62 +0,0 @@
|
||||
From 866ec16d8264b3ef2533b276d161e6dc1db470a0 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <866ec16d8264b3ef2533b276d161e6dc1db470a0.1707394627.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Thu, 4 Jan 2024 10:49:06 +0100
|
||||
Subject: [PATCH] qemu_command: Generate cmd line for virtio-mem
|
||||
dynamicMemslots
|
||||
|
||||
This is pretty straightforward.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-15316
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit dab99eedcd15d135e287185ce03eb05338ce225d)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_command.c | 3 +++
|
||||
.../memory-hotplug-virtio-mem.x86_64-latest.args | 2 +-
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
||||
index 712feb7b81..4d5a202c7d 100644
|
||||
--- a/src/qemu/qemu_command.c
|
||||
+++ b/src/qemu/qemu_command.c
|
||||
@@ -3653,6 +3653,7 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg,
|
||||
unsigned long long requestedsize = 0;
|
||||
unsigned long long address = 0;
|
||||
bool prealloc = false;
|
||||
+ virTristateBool dynamicMemslots = VIR_TRISTATE_BOOL_ABSENT;
|
||||
|
||||
if (!mem->info.alias) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
@@ -3694,6 +3695,7 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg,
|
||||
blocksize = mem->target.virtio_mem.blocksize;
|
||||
requestedsize = mem->target.virtio_mem.requestedsize;
|
||||
address = mem->target.virtio_mem.address;
|
||||
+ dynamicMemslots = mem->target.virtio_mem.dynamicMemslots;
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
|
||||
@@ -3716,6 +3718,7 @@ qemuBuildMemoryDeviceProps(virQEMUDriverConfig *cfg,
|
||||
"s:memdev", memdev,
|
||||
"B:prealloc", prealloc,
|
||||
"P:memaddr", address,
|
||||
+ "T:dynamic-memslots", dynamicMemslots,
|
||||
"s:id", mem->info.alias,
|
||||
NULL) < 0)
|
||||
return NULL;
|
||||
diff --git a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
|
||||
index dbe96ae21d..36cff6ec13 100644
|
||||
--- a/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
|
||||
+++ b/tests/qemuxml2argvdata/memory-hotplug-virtio-mem.x86_64-latest.args
|
||||
@@ -32,7 +32,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \
|
||||
-object '{"qom-type":"memory-backend-ram","id":"memvirtiomem0","reserve":false,"size":1073741824}' \
|
||||
-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":536870912,"memdev":"memvirtiomem0","id":"virtiomem0","bus":"pci.0","addr":"0x2"}' \
|
||||
-object '{"qom-type":"memory-backend-file","id":"memvirtiomem1","mem-path":"/dev/hugepages2M/libvirt/qemu/-1-QEMUGuest1","reserve":false,"size":2147483648,"host-nodes":[1,2,3],"policy":"bind"}' \
|
||||
--device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"memaddr":5637144576,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
|
||||
+-device '{"driver":"virtio-mem-pci","node":0,"block-size":2097152,"requested-size":1073741824,"memdev":"memvirtiomem1","prealloc":true,"memaddr":5637144576,"dynamic-memslots":true,"id":"virtiomem1","bus":"pci.1","addr":"0x1"}' \
|
||||
-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}' \
|
||||
-blockdev '{"node-name":"libvirt-1-format","read-only":false,"driver":"raw","file":"libvirt-1-storage"}' \
|
||||
-device '{"driver":"ide-hd","bus":"ide.0","unit":0,"drive":"libvirt-1-format","id":"ide0-0-0","bootindex":1}' \
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,105 @@
|
||||
From a653c588361672057647d63847421c4c52d33939 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <a653c588361672057647d63847421c4c52d33939.1723196972.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 31 Jul 2024 11:34:59 +0200
|
||||
Subject: [PATCH] qemu_domain: Strip <acpi/> 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 <pkrempa@redhat.com>
|
||||
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
|
||||
(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 <acpi/> 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
|
||||
+ * <acpi/> 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
|
@ -1,67 +0,0 @@
|
||||
From 7a7c3f71744b2211bdf50332918495d3042e3236 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <7a7c3f71744b2211bdf50332918495d3042e3236.1706524416.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 18:43:21 +0100
|
||||
Subject: [PATCH] qemu_hotplug: Don't lose 'created' flag in
|
||||
qemuDomainChangeNet()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
After v9.1.0-rc1~116 we track whether it's us who created a
|
||||
macvtap or not. But when updating a vNIC its definition might be
|
||||
replaced with a new one (though, ifname is not allowed to
|
||||
change), e.g. to reflect new QoS, link state, etc.
|
||||
|
||||
Now, the fact whether we created macvtap for given vNIC is stored
|
||||
in net->privateData->created. And replacing definition is done by
|
||||
simply freeing the old definition and making the pointer point to
|
||||
the new one. But this does not preserve the 'created' flag, which
|
||||
in turn means when a domain is shutting off, the macvtap is not
|
||||
removed (see loop inside of qemuProcessStop()).
|
||||
|
||||
Copy this flag into new definition and leave a note in
|
||||
_qemuDomainNetworkPrivate struct.
|
||||
|
||||
Fixes: 61d1b9e6592660121aeda66bf7adbcd39de06aa8
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-22714
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit ccfc5c1e1637d20e479fafde7aa3ea4c6fb29e21)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_domain.h | 2 ++
|
||||
src/qemu/qemu_hotplug.c | 5 +++++
|
||||
2 files changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
|
||||
index fa566dded6..0b5af5d014 100644
|
||||
--- a/src/qemu/qemu_domain.h
|
||||
+++ b/src/qemu/qemu_domain.h
|
||||
@@ -420,6 +420,8 @@ typedef struct _qemuDomainNetworkPrivate qemuDomainNetworkPrivate;
|
||||
struct _qemuDomainNetworkPrivate {
|
||||
virObject parent;
|
||||
|
||||
+ /* Don't forget to possibly copy these members in qemuDomainChangeNet(). */
|
||||
+
|
||||
/* True if the device was created by us. Otherwise we should
|
||||
* avoid removing it. Currently only used for
|
||||
* VIR_DOMAIN_NET_TYPE_DIRECT. */
|
||||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
||||
index 0e45bd53e1..31b00e05ca 100644
|
||||
--- a/src/qemu/qemu_hotplug.c
|
||||
+++ b/src/qemu/qemu_hotplug.c
|
||||
@@ -4166,6 +4166,11 @@ qemuDomainChangeNet(virQEMUDriver *driver,
|
||||
else
|
||||
VIR_WARN("Unable to release network device '%s'", NULLSTR(olddev->ifname));
|
||||
}
|
||||
+
|
||||
+ /* Carry over fact whether we created the device or not. */
|
||||
+ QEMU_DOMAIN_NETWORK_PRIVATE(newdev)->created =
|
||||
+ QEMU_DOMAIN_NETWORK_PRIVATE(olddev)->created;
|
||||
+
|
||||
virDomainNetDefFree(olddev);
|
||||
/* move newdev into the nets list, and NULL it out from the
|
||||
* virDomainDeviceDef that we were given so that the caller
|
||||
--
|
||||
2.43.0
|
@ -1,67 +0,0 @@
|
||||
From 743afd9422e59bc6cbda6b4a904394a045eb9aec Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <743afd9422e59bc6cbda6b4a904394a045eb9aec.1707394627.git.jdenemar@redhat.com>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 12:13:32 +0100
|
||||
Subject: [PATCH] qemu_snapshot: create: don't require disk-only flag for
|
||||
offline external snapshot
|
||||
|
||||
Historically creating offline external snapshot required disk-only flag
|
||||
as well. Now when user requests new snapshot for offline VM and at least
|
||||
one disk is specified to use external snapshot we will no longer require
|
||||
disk-only flag as all other not specified disk will use external
|
||||
snapshots as well.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-22797
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 189fdeff10b85786a495a8fcf67ba1428d9fc482)
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_snapshot.c | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
|
||||
index 871e63c9cd..0cac0c4146 100644
|
||||
--- a/src/qemu/qemu_snapshot.c
|
||||
+++ b/src/qemu/qemu_snapshot.c
|
||||
@@ -1582,15 +1582,27 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
|
||||
* to internal snapshots.
|
||||
*/
|
||||
static bool
|
||||
-qemuSnapshotCreateUseExternal(virDomainSnapshotDef *def,
|
||||
+qemuSnapshotCreateUseExternal(virDomainObj *vm,
|
||||
+ virDomainSnapshotDef *def,
|
||||
unsigned int flags)
|
||||
{
|
||||
+ size_t i;
|
||||
+
|
||||
if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)
|
||||
return true;
|
||||
|
||||
if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
||||
return true;
|
||||
|
||||
+ if (!virDomainObjIsActive(vm)) {
|
||||
+ /* No need to check all disks as function qemuSnapshotPrepare() guarantees
|
||||
+ * that we don't have a combination of internal and external location. */
|
||||
+ for (i = 0; i < def->ndisks; i++) {
|
||||
+ if (def->disks[i].snapshot == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1623,7 +1635,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (qemuSnapshotCreateUseExternal(def, flags)) {
|
||||
+ if (qemuSnapshotCreateUseExternal(vm, def, flags)) {
|
||||
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,88 +0,0 @@
|
||||
From b12f3837ddde95373b39843b8526b55e40d96500 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b12f3837ddde95373b39843b8526b55e40d96500.1707394627.git.jdenemar@redhat.com>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 11:33:23 +0100
|
||||
Subject: [PATCH] qemu_snapshot: create: refactor external snapshot detection
|
||||
|
||||
Introduce new function qemuSnapshotCreateUseExternal() that will return
|
||||
true if we will use external snapshots as default location.
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit faa2e3bb541e50d719d05e58a129b4443c0c737c)
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-22797
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_snapshot.c | 39 ++++++++++++++++++++++++++++++---------
|
||||
1 file changed, 30 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
|
||||
index af5f995b0d..871e63c9cd 100644
|
||||
--- a/src/qemu/qemu_snapshot.c
|
||||
+++ b/src/qemu/qemu_snapshot.c
|
||||
@@ -1576,6 +1576,25 @@ qemuSnapshotCreateXMLValidateDef(virDomainObj *vm,
|
||||
}
|
||||
|
||||
|
||||
+/**
|
||||
+ * Check if libvirt should use external snapshots as default align_location
|
||||
+ * that will be used by virDomainSnapshotAlignDisks(). Otherwise we default
|
||||
+ * to internal snapshots.
|
||||
+ */
|
||||
+static bool
|
||||
+qemuSnapshotCreateUseExternal(virDomainSnapshotDef *def,
|
||||
+ unsigned int flags)
|
||||
+{
|
||||
+ if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY)
|
||||
+ return true;
|
||||
+
|
||||
+ if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+
|
||||
static int
|
||||
qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
virDomainSnapshotDef *def,
|
||||
@@ -1584,7 +1603,7 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
{
|
||||
g_autofree char *xml = NULL;
|
||||
qemuDomainObjPrivate *priv = vm->privateData;
|
||||
- virDomainSnapshotLocation align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
|
||||
+ virDomainSnapshotLocation align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_DEFAULT;
|
||||
|
||||
/* Easiest way to clone inactive portion of vm->def is via
|
||||
* conversion in and back out of xml. */
|
||||
@@ -1604,17 +1623,19 @@ qemuSnapshotCreateAlignDisks(virDomainObj *vm,
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) {
|
||||
+ if (qemuSnapshotCreateUseExternal(def, flags)) {
|
||||
align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
|
||||
- if (virDomainObjIsActive(vm))
|
||||
- def->state = VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT;
|
||||
- else
|
||||
- def->state = VIR_DOMAIN_SNAPSHOT_SHUTOFF;
|
||||
- def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
- } else if (def->memory == VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL) {
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
- align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_EXTERNAL;
|
||||
+
|
||||
+ if (flags & VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY) {
|
||||
+ if (virDomainObjIsActive(vm))
|
||||
+ def->state = VIR_DOMAIN_SNAPSHOT_DISK_SNAPSHOT;
|
||||
+ else
|
||||
+ def->state = VIR_DOMAIN_SNAPSHOT_SHUTOFF;
|
||||
+ def->memory = VIR_DOMAIN_SNAPSHOT_LOCATION_NO;
|
||||
+ }
|
||||
} else {
|
||||
+ align_location = VIR_DOMAIN_SNAPSHOT_LOCATION_INTERNAL;
|
||||
def->state = virDomainObjGetState(vm, NULL);
|
||||
|
||||
if (virDomainObjIsActive(vm) &&
|
||||
--
|
||||
2.43.0
|
@ -1,66 +0,0 @@
|
||||
From aa70508df0626a00e4ed7c0ecb11b985beeb92cd Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <aa70508df0626a00e4ed7c0ecb11b985beeb92cd.1707394627.git.jdenemar@redhat.com>
|
||||
From: Pavel Hrdina <phrdina@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 13:05:22 +0100
|
||||
Subject: [PATCH] qemu_snapshot: fix detection if non-leaf snapshot isn't in
|
||||
active chain
|
||||
|
||||
The condition was completely wrong. As per the comment for function
|
||||
virDomainMomentIsAncestor() it checks that the first argument is
|
||||
descendant of the second argument.
|
||||
|
||||
Consider the following snapshot tree for VM:
|
||||
|
||||
s1
|
||||
|
|
||||
+- s2
|
||||
| |
|
||||
| +- s3
|
||||
|
|
||||
+- s4
|
||||
|
|
||||
+- s5 (current)
|
||||
|
||||
When deleting s2 with the original code we checked if
|
||||
virDomainMomentIsAncestor(s2, s5) which would return false basically for
|
||||
any snapshot as s5 is leaf snapshot so no children.
|
||||
|
||||
When deleting s2 with fixed code we check if
|
||||
virDomainMomentIsAncestor(s5, s2) which still returns false but when
|
||||
deleting s4 it will correctly return true.
|
||||
|
||||
Before this fix it fails with the following error:
|
||||
|
||||
error: Failed to delete snapshot s2
|
||||
error: invalid argument: could not find base disk source in disk source chain
|
||||
|
||||
After the fix it fails with correct error:
|
||||
|
||||
error: Failed to delete snapshot s2
|
||||
error: unsupported configuration: deletion of non-leaf external snapshot that is not in active chain is not supported
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-23212
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 7143c4e1f95b4dc804f67cc5de98fba746193892)
|
||||
|
||||
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_snapshot.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
|
||||
index 73ff533827..af5f995b0d 100644
|
||||
--- a/src/qemu/qemu_snapshot.c
|
||||
+++ b/src/qemu/qemu_snapshot.c
|
||||
@@ -3815,7 +3815,7 @@ qemuSnapshotDeleteValidate(virDomainObj *vm,
|
||||
}
|
||||
|
||||
if (snap != current && snap->nchildren != 0 &&
|
||||
- virDomainMomentIsAncestor(snap, current)) {
|
||||
+ !virDomainMomentIsAncestor(current, snap)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("deletion of non-leaf external snapshot that is not in active chain is not supported"));
|
||||
return -1;
|
||||
--
|
||||
2.43.0
|
@ -1,40 +0,0 @@
|
||||
From 9f35c04add8d64748671e76171683332bd454317 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9f35c04add8d64748671e76171683332bd454317.1707394627.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Thu, 4 Jan 2024 11:04:51 +0100
|
||||
Subject: [PATCH] qemu_validate: Check capability for virtio-mem
|
||||
dynamicMemslots
|
||||
|
||||
The QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS reflects
|
||||
whether QEMU is capable of .dynamic-memslots for virtio-mem.
|
||||
Use it when validating domain configuration.
|
||||
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 6be07af817e0a8d48613296af66873e62a73339a)
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-15316
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/qemu/qemu_validate.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
|
||||
index b22d3618fe..fe8f7ae8cc 100644
|
||||
--- a/src/qemu/qemu_validate.c
|
||||
+++ b/src/qemu/qemu_validate.c
|
||||
@@ -5066,6 +5066,13 @@ qemuValidateDomainDeviceDefMemory(virDomainMemoryDef *mem,
|
||||
_("virtio-mem isn't supported by this QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ if (mem->target.virtio_mem.dynamicMemslots == VIR_TRISTATE_BOOL_YES &&
|
||||
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS)) {
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
+ _("virtio-mem does not support dynamicMemslots"));
|
||||
+ return -1;
|
||||
+ }
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_MEMORY_MODEL_SGX_EPC:
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,435 @@
|
||||
From 374d2bbe544224e7e31ac8ce92e1d42e60bdb44e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <374d2bbe544224e7e31ac8ce92e1d42e60bdb44e.1723196972.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
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 <pkrempa@redhat.com>
|
||||
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
|
||||
(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 @@
|
||||
+<domain type='kvm'>
|
||||
+ <name>aarch64test</name>
|
||||
+ <uuid>6ba410c5-1e5c-4d57-bee7-2228e7ffa32f</uuid>
|
||||
+ <memory unit='KiB'>1048576</memory>
|
||||
+ <vcpu placement='static'>1</vcpu>
|
||||
+ <os>
|
||||
+ <!-- machine type doesn't matter as long as it has no ACPI -->
|
||||
+ <type arch='aarch64' machine='borzoi'>hvm</type>
|
||||
+ </os>
|
||||
+ <features>
|
||||
+ <acpi/>
|
||||
+ </features>
|
||||
+ <cpu mode='host-passthrough'/>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
+ <memballoon model='none'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
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 @@
|
||||
-<domain type='qemu'>
|
||||
- <name>QEMUGuest1</name>
|
||||
- <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
- <memory unit='KiB'>219136</memory>
|
||||
- <currentMemory unit='KiB'>219136</currentMemory>
|
||||
- <vcpu placement='static'>1</vcpu>
|
||||
- <os>
|
||||
- <type arch='x86_64' machine='pc'>hvm</type>
|
||||
- <boot dev='hd'/>
|
||||
- </os>
|
||||
- <features>
|
||||
- <acpi/>
|
||||
- </features>
|
||||
- <cpu mode='custom' match='exact' check='none'>
|
||||
- <model fallback='forbid'>qemu64</model>
|
||||
- </cpu>
|
||||
- <clock offset='utc'/>
|
||||
- <on_poweroff>destroy</on_poweroff>
|
||||
- <on_reboot>restart</on_reboot>
|
||||
- <on_crash>destroy</on_crash>
|
||||
- <devices>
|
||||
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
- <disk type='block' device='disk'>
|
||||
- <driver name='qemu' type='raw'/>
|
||||
- <source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
- <target dev='hda' bus='ide'/>
|
||||
- <address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
- </disk>
|
||||
- <controller type='usb' index='0' model='piix3-uhci'>
|
||||
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
||||
- </controller>
|
||||
- <controller type='ide' index='0'>
|
||||
- <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||
- </controller>
|
||||
- <controller type='pci' index='0' model='pci-root'/>
|
||||
- <input type='mouse' bus='ps2'/>
|
||||
- <input type='keyboard' bus='ps2'/>
|
||||
- <audio id='1' type='none'/>
|
||||
- <memballoon model='none'/>
|
||||
- </devices>
|
||||
-</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/misc-acpi.xml b/tests/qemuxmlconfdata/misc-acpi.xml
|
||||
deleted file mode 100644
|
||||
index 59fbe471ff..0000000000
|
||||
--- a/tests/qemuxmlconfdata/misc-acpi.xml
|
||||
+++ /dev/null
|
||||
@@ -1,33 +0,0 @@
|
||||
-<domain type='qemu'>
|
||||
- <name>QEMUGuest1</name>
|
||||
- <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
- <memory unit='KiB'>219136</memory>
|
||||
- <currentMemory unit='KiB'>219136</currentMemory>
|
||||
- <vcpu placement='static'>1</vcpu>
|
||||
- <os>
|
||||
- <type arch='x86_64' machine='pc'>hvm</type>
|
||||
- <boot dev='hd'/>
|
||||
- </os>
|
||||
- <features>
|
||||
- <acpi/>
|
||||
- </features>
|
||||
- <clock offset='utc'/>
|
||||
- <on_poweroff>destroy</on_poweroff>
|
||||
- <on_reboot>restart</on_reboot>
|
||||
- <on_crash>destroy</on_crash>
|
||||
- <devices>
|
||||
- <emulator>/usr/bin/qemu-system-x86_64</emulator>
|
||||
- <disk type='block' device='disk'>
|
||||
- <driver name='qemu' type='raw'/>
|
||||
- <source dev='/dev/HostVG/QEMUGuest1'/>
|
||||
- <target dev='hda' bus='ide'/>
|
||||
- <address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
- </disk>
|
||||
- <controller type='usb' index='0'/>
|
||||
- <controller type='ide' index='0'/>
|
||||
- <controller type='pci' index='0' model='pci-root'/>
|
||||
- <input type='mouse' bus='ps2'/>
|
||||
- <input type='keyboard' bus='ps2'/>
|
||||
- <memballoon model='none'/>
|
||||
- </devices>
|
||||
-</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args
|
||||
new file mode 100644
|
||||
index 0000000000..fcb80b009e
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.args
|
||||
@@ -0,0 +1,33 @@
|
||||
+LC_ALL=C \
|
||||
+PATH=/bin \
|
||||
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
|
||||
+USER=test \
|
||||
+LOGNAME=test \
|
||||
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
|
||||
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
|
||||
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
|
||||
+/usr/bin/qemu-system-riscv64 \
|
||||
+-name guest=guest,debug-threads=on \
|
||||
+-S \
|
||||
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
|
||||
+-machine virt,usb=off,dump-guest-core=off,memory-backend=riscv_virt_board.ram \
|
||||
+-accel tcg \
|
||||
+-m size=4194304k \
|
||||
+-object '{"qom-type":"memory-backend-ram","id":"riscv_virt_board.ram","size":4294967296}' \
|
||||
+-overcommit mem-lock=off \
|
||||
+-smp 4,sockets=4,cores=1,threads=1 \
|
||||
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
|
||||
+-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":"pcie-root-port","port":8,"chassis":1,"id":"pci.1","bus":"pcie.0","multifunction":true,"addr":"0x1"}' \
|
||||
+-device '{"driver":"pcie-root-port","port":9,"chassis":2,"id":"pci.2","bus":"pcie.0","addr":"0x1.0x1"}' \
|
||||
+-audiodev '{"id":"audio1","driver":"none"}' \
|
||||
+-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.1","addr":"0x0"}' \
|
||||
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
||||
+-msg timestamp=on
|
||||
diff --git a/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml
|
||||
new file mode 100644
|
||||
index 0000000000..075708df9c
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/riscv64-virt-acpi.riscv64-latest.xml
|
||||
@@ -0,0 +1,36 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>guest</name>
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
||||
+ <memory unit='KiB'>4194304</memory>
|
||||
+ <currentMemory unit='KiB'>4194304</currentMemory>
|
||||
+ <vcpu placement='static'>4</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='riscv64' machine='virt'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <features>
|
||||
+ <acpi/>
|
||||
+ </features>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-riscv64</emulator>
|
||||
+ <controller type='pci' index='0' model='pcie-root'/>
|
||||
+ <controller type='pci' index='1' model='pcie-root-port'>
|
||||
+ <model name='pcie-root-port'/>
|
||||
+ <target chassis='1' port='0x8'/>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0' multifunction='on'/>
|
||||
+ </controller>
|
||||
+ <controller type='pci' index='2' model='pcie-root-port'>
|
||||
+ <model name='pcie-root-port'/>
|
||||
+ <target chassis='2' port='0x9'/>
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||
+ </controller>
|
||||
+ <audio id='1' type='none'/>
|
||||
+ <memballoon model='virtio'>
|
||||
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
||||
+ </memballoon>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/riscv64-virt-acpi.xml b/tests/qemuxmlconfdata/riscv64-virt-acpi.xml
|
||||
new file mode 100644
|
||||
index 0000000000..72fc0d8e1c
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/riscv64-virt-acpi.xml
|
||||
@@ -0,0 +1,15 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>guest</name>
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
||||
+ <memory>4194304</memory>
|
||||
+ <vcpu>4</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='riscv64' machine='virt'>hvm</type>
|
||||
+ </os>
|
||||
+ <features>
|
||||
+ <acpi/>
|
||||
+ </features>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-riscv64</emulator>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.abi-update.err b/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.abi-update.err
|
||||
new file mode 100644
|
||||
index 0000000000..4ca9af1de0
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.abi-update.err
|
||||
@@ -0,0 +1 @@
|
||||
+unsupported configuration: machine type 's390-ccw-virtio' does not support ACPI
|
||||
diff --git a/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.args b/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.args
|
||||
new file mode 100644
|
||||
index 0000000000..84098e580e
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.args
|
||||
@@ -0,0 +1,32 @@
|
||||
+LC_ALL=C \
|
||||
+PATH=/bin \
|
||||
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
|
||||
+USER=test \
|
||||
+LOGNAME=test \
|
||||
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
|
||||
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
|
||||
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
|
||||
+/usr/bin/qemu-system-s390x \
|
||||
+-name guest=guest,debug-threads=on \
|
||||
+-S \
|
||||
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
|
||||
+-machine s390-ccw-virtio,usb=off,dump-guest-core=off,memory-backend=s390.ram \
|
||||
+-accel tcg \
|
||||
+-cpu qemu \
|
||||
+-m size=4194304k \
|
||||
+-object '{"qom-type":"memory-backend-ram","id":"s390.ram","size":4294967296}' \
|
||||
+-overcommit mem-lock=off \
|
||||
+-smp 4,sockets=4,cores=1,threads=1 \
|
||||
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
|
||||
+-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 \
|
||||
+-audiodev '{"id":"audio1","driver":"none"}' \
|
||||
+-device '{"driver":"virtio-balloon-ccw","id":"balloon0","devno":"fe.0.0000"}' \
|
||||
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
||||
+-msg timestamp=on
|
||||
diff --git a/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.xml b/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.xml
|
||||
new file mode 100644
|
||||
index 0000000000..df8e578212
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/s390x-ccw-acpi.s390x-latest.xml
|
||||
@@ -0,0 +1,27 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>guest</name>
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
||||
+ <memory unit='KiB'>4194304</memory>
|
||||
+ <currentMemory unit='KiB'>4194304</currentMemory>
|
||||
+ <vcpu placement='static'>4</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <cpu mode='custom' match='exact' check='none'>
|
||||
+ <model fallback='forbid'>qemu</model>
|
||||
+ </cpu>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
+ <controller type='pci' index='0' model='pci-root'/>
|
||||
+ <audio id='1' type='none'/>
|
||||
+ <memballoon model='virtio'>
|
||||
+ <address type='ccw' cssid='0xfe' ssid='0x0' devno='0x0000'/>
|
||||
+ </memballoon>
|
||||
+ <panic model='s390'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxmlconfdata/s390x-ccw-acpi.xml b/tests/qemuxmlconfdata/s390x-ccw-acpi.xml
|
||||
new file mode 100644
|
||||
index 0000000000..b7be060c66
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxmlconfdata/s390x-ccw-acpi.xml
|
||||
@@ -0,0 +1,15 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>guest</name>
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
||||
+ <memory>4194304</memory>
|
||||
+ <vcpu>4</vcpu>
|
||||
+ <features>
|
||||
+ <acpi/>
|
||||
+ </features>
|
||||
+ <os>
|
||||
+ <type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
|
||||
+ </os>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-s390x</emulator>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
|
||||
index a3a399e16c..0f2afad6c4 100644
|
||||
--- a/tests/qemuxmlconftest.c
|
||||
+++ b/tests/qemuxmlconftest.c
|
||||
@@ -1740,7 +1740,23 @@ mymain(void)
|
||||
|
||||
DO_TEST_CAPS_LATEST("input-usbmouse");
|
||||
DO_TEST_CAPS_LATEST("input-usbtablet");
|
||||
- DO_TEST_CAPS_LATEST("misc-acpi");
|
||||
+
|
||||
+ /* tests for ACPI support handling:
|
||||
+ * - existing positive test cases enabling ACPI for aarch64/x86_64/loongarch:
|
||||
+ * - firmware-manual-efi-acpi-q35
|
||||
+ * - firmware-manual-efi-acpi-aarch64
|
||||
+ * - firmware-auto-efi-loongarch64
|
||||
+ *
|
||||
+ * - negative case for aarch64 with 'borzoi' machine not supporting ACPI
|
||||
+ *
|
||||
+ * - s390x has hack to strip ACPI to preserve migration of old configs,
|
||||
+ * but should produce error when ABI_UPDATE is requested
|
||||
+ */
|
||||
+ DO_TEST_CAPS_ARCH_LATEST_PARSE_ERROR("aarch64-noacpi-acpi", "aarch64");
|
||||
+ DO_TEST_CAPS_ARCH_LATEST("riscv64-virt-acpi", "riscv64");
|
||||
+ DO_TEST_CAPS_ARCH_LATEST("s390x-ccw-acpi", "s390x");
|
||||
+ DO_TEST_CAPS_ARCH_LATEST_ABI_UPDATE_PARSE_ERROR("s390x-ccw-acpi", "s390x");
|
||||
+
|
||||
DO_TEST_CAPS_LATEST("misc-disable-s3");
|
||||
DO_TEST_CAPS_LATEST("misc-disable-suspends");
|
||||
DO_TEST_CAPS_LATEST("misc-enable-s4");
|
||||
--
|
||||
2.46.0
|
@ -1,142 +0,0 @@
|
||||
From 1b87b9821afe39c2af5c1893b11cb7f452c61014 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <1b87b9821afe39c2af5c1893b11cb7f452c61014.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 17 Jan 2024 15:55:35 +0100
|
||||
Subject: [PATCH] remoteDispatchAuthPolkit: Fix lock ordering deadlock if
|
||||
client closes connection during auth
|
||||
|
||||
Locks in following text:
|
||||
A: virNetServer
|
||||
B: virNetServerClient
|
||||
C: daemonClientPrivate
|
||||
|
||||
'virNetServerSetClientAuthenticated' locks A then B
|
||||
|
||||
'remoteDispatchAuthPolkit' calls 'virNetServerSetClientAuthenticated'
|
||||
while holding C.
|
||||
|
||||
If a client closes its connection 'virNetServerProcessClients' with the
|
||||
lock A and B locked will call 'virNetServerClientCloseLocked' which will
|
||||
try to dispose of the 'client' private data by:
|
||||
|
||||
ref(b);
|
||||
unlock(b);
|
||||
remoteClientFreePrivateCallbacks();
|
||||
lock(b);
|
||||
unref(b);
|
||||
|
||||
Unfortunately remoteClientFreePrivateCallbacks() tries lock C.
|
||||
|
||||
Thus the locks are held in the following order:
|
||||
|
||||
polkit auth: C -> A
|
||||
connection close: A -> C
|
||||
|
||||
causing a textbook-example deadlock. To resolve it we can simply drop
|
||||
lock 'C' before calling 'virNetServerSetClientAuthenticated' as the lock
|
||||
is not needed any more.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-20337
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit c697aff8a1b5542d51c0b4a10046ad37089d12d5)
|
||||
---
|
||||
src/remote/remote_daemon_dispatch.c | 76 +++++++++++++++--------------
|
||||
1 file changed, 39 insertions(+), 37 deletions(-)
|
||||
|
||||
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
|
||||
index 7daf503b51..aaabd1e56c 100644
|
||||
--- a/src/remote/remote_daemon_dispatch.c
|
||||
+++ b/src/remote/remote_daemon_dispatch.c
|
||||
@@ -3979,50 +3979,52 @@ remoteDispatchAuthPolkit(virNetServer *server,
|
||||
struct daemonClientPrivate *priv =
|
||||
virNetServerClientGetPrivateData(client);
|
||||
int rv;
|
||||
- VIR_LOCK_GUARD lock = virLockGuardLock(&priv->lock);
|
||||
-
|
||||
- action = virNetServerClientGetReadonly(client) ?
|
||||
- "org.libvirt.unix.monitor" :
|
||||
- "org.libvirt.unix.manage";
|
||||
|
||||
- VIR_DEBUG("Start PolicyKit auth %d", virNetServerClientGetFD(client));
|
||||
- if (virNetServerClientGetAuth(client) != VIR_NET_SERVER_SERVICE_AUTH_POLKIT) {
|
||||
- VIR_ERROR(_("client tried invalid PolicyKit init request"));
|
||||
- goto authfail;
|
||||
- }
|
||||
+ VIR_WITH_MUTEX_LOCK_GUARD(&priv->lock) {
|
||||
+ action = virNetServerClientGetReadonly(client) ?
|
||||
+ "org.libvirt.unix.monitor" :
|
||||
+ "org.libvirt.unix.manage";
|
||||
|
||||
- if (virNetServerClientGetUNIXIdentity(client, &callerUid, &callerGid,
|
||||
- &callerPid, ×tamp) < 0) {
|
||||
- goto authfail;
|
||||
- }
|
||||
+ VIR_DEBUG("Start PolicyKit auth %d", virNetServerClientGetFD(client));
|
||||
+ if (virNetServerClientGetAuth(client) != VIR_NET_SERVER_SERVICE_AUTH_POLKIT) {
|
||||
+ VIR_ERROR(_("client tried invalid PolicyKit init request"));
|
||||
+ goto authfail;
|
||||
+ }
|
||||
|
||||
- if (timestamp == 0) {
|
||||
- VIR_WARN("Failing polkit auth due to missing client (pid=%lld) start time",
|
||||
- (long long)callerPid);
|
||||
- goto authfail;
|
||||
- }
|
||||
+ if (virNetServerClientGetUNIXIdentity(client, &callerUid, &callerGid,
|
||||
+ &callerPid, ×tamp) < 0) {
|
||||
+ goto authfail;
|
||||
+ }
|
||||
|
||||
- VIR_INFO("Checking PID %lld running as %d",
|
||||
- (long long) callerPid, callerUid);
|
||||
+ if (timestamp == 0) {
|
||||
+ VIR_WARN("Failing polkit auth due to missing client (pid=%lld) start time",
|
||||
+ (long long)callerPid);
|
||||
+ goto authfail;
|
||||
+ }
|
||||
|
||||
- rv = virPolkitCheckAuth(action,
|
||||
- callerPid,
|
||||
- timestamp,
|
||||
- callerUid,
|
||||
- NULL,
|
||||
- true);
|
||||
- if (rv == -1)
|
||||
- goto authfail;
|
||||
- else if (rv == -2)
|
||||
- goto authdeny;
|
||||
+ VIR_INFO("Checking PID %lld running as %d",
|
||||
+ (long long) callerPid, callerUid);
|
||||
|
||||
- PROBE(RPC_SERVER_CLIENT_AUTH_ALLOW,
|
||||
- "client=%p auth=%d identity=%s",
|
||||
- client, REMOTE_AUTH_POLKIT, ident);
|
||||
- VIR_INFO("Policy allowed action %s from pid %lld, uid %d",
|
||||
- action, (long long) callerPid, callerUid);
|
||||
- ret->complete = 1;
|
||||
+ rv = virPolkitCheckAuth(action,
|
||||
+ callerPid,
|
||||
+ timestamp,
|
||||
+ callerUid,
|
||||
+ NULL,
|
||||
+ true);
|
||||
+ if (rv == -1)
|
||||
+ goto authfail;
|
||||
+ else if (rv == -2)
|
||||
+ goto authdeny;
|
||||
+
|
||||
+ PROBE(RPC_SERVER_CLIENT_AUTH_ALLOW,
|
||||
+ "client=%p auth=%d identity=%s",
|
||||
+ client, REMOTE_AUTH_POLKIT, ident);
|
||||
+ VIR_INFO("Policy allowed action %s from pid %lld, uid %d",
|
||||
+ action, (long long) callerPid, callerUid);
|
||||
+ ret->complete = 1;
|
||||
+ }
|
||||
|
||||
+ /* this must be called with the private data mutex unlocked */
|
||||
virNetServerSetClientAuthenticated(server, client);
|
||||
return 0;
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,45 +0,0 @@
|
||||
From 5821f93bf9b42e3732fe168cdae85054e9a3ac61 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <5821f93bf9b42e3732fe168cdae85054e9a3ac61.1707394626.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 10:07:05 +0100
|
||||
Subject: [PATCH] remote_driver: Restore special behavior of
|
||||
remoteDomainGetBlockIoTune()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In v9.10.0-rc1~103 the remote driver was switched to g_auto() for
|
||||
client RPC return parameters. But whilst doing so a small bug
|
||||
slipped in: previously, when virDomainGetBlockIoTune() was called
|
||||
with *nparams == 0, the function set *nparams to the number of
|
||||
supported params and zero was returned (so that client can
|
||||
allocate memory and call the API second time). IOW - the usual,
|
||||
old style of APIs where we didn't want to allocate memory on
|
||||
caller's behalf. But because of this bug, a negative one is
|
||||
returned instead.
|
||||
|
||||
Fixes: 501825011c1fe80f458820c7efe5a198e0af9be5
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 3a3f73ea9f1925ca5e256fa54c5aa451ddeaa19e)
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-22800
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
src/remote/remote_driver.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
|
||||
index 392377deae..bedf2cb833 100644
|
||||
--- a/src/remote/remote_driver.c
|
||||
+++ b/src/remote/remote_driver.c
|
||||
@@ -2570,7 +2570,7 @@ static int remoteDomainGetBlockIoTune(virDomainPtr domain,
|
||||
*/
|
||||
if (*nparams == 0) {
|
||||
*nparams = ret.nparams;
|
||||
- return -1;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
if (virTypedParamsDeserialize((struct _virTypedParameterRemote *) ret.params.params_val,
|
||||
--
|
||||
2.43.0
|
@ -1,39 +0,0 @@
|
||||
From 4c070fe8db9456a0cd33910d37e613a045a1ec77 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <4c070fe8db9456a0cd33910d37e613a045a1ec77.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 16:12:09 +0100
|
||||
Subject: [PATCH] schema: nodedev: Adjust allowed characters in
|
||||
'vpdFieldValueFormat'
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The check in 'virPCIVPDResourceIsValidTextValue' allows any printable
|
||||
characters, thus the XML schema should do the same.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit edaa1112ffef253013dcc3318794cebfaa2a6cb7)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
https://issues.redhat.com/browse/RHEL-22400 [9.3.z]
|
||||
https://issues.redhat.com/browse/RHEL-22399 [9.2.z]
|
||||
---
|
||||
src/conf/schemas/nodedev.rng | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/conf/schemas/nodedev.rng b/src/conf/schemas/nodedev.rng
|
||||
index fba4021754..ff07313968 100644
|
||||
--- a/src/conf/schemas/nodedev.rng
|
||||
+++ b/src/conf/schemas/nodedev.rng
|
||||
@@ -869,7 +869,7 @@
|
||||
|
||||
<define name="vpdFieldValueFormat">
|
||||
<data type="string">
|
||||
- <param name="pattern">[0-9a-zA-F -_,.:;=]{0,255}</param>
|
||||
+ <param name="pattern">.{0,255}</param>
|
||||
</data>
|
||||
</define>
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,919 +0,0 @@
|
||||
From 87b424cacef5bbbe7e01c69ade8a8a6707cd779c Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <87b424cacef5bbbe7e01c69ade8a8a6707cd779c.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Fri, 5 Jan 2024 15:07:06 +0100
|
||||
Subject: [PATCH] tests: Add hostcpudata for machine with CPU clusters
|
||||
|
||||
The data is taken from an HPE Apollo 70 machine, which uses
|
||||
aarch64 CPUs. It is interesting for us because non-dummy
|
||||
information about CPU clusters is exposed through sysfs.
|
||||
|
||||
In order to keep things reasonable, the data was manually
|
||||
modified so that only 8 of the original 224 CPUs are included.
|
||||
Care has been taken to ensure that the topology is otherwise
|
||||
unaltered.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit fb81a56f321019685be80b14e3be3046e46412ad)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
.../linux-basic-clusters/system/cpu | 1 +
|
||||
.../linux-basic-clusters/system/node | 1 +
|
||||
.../vircaps-aarch64-basic-clusters.xml | 39 ++++++++++
|
||||
tests/vircaps2xmltest.c | 1 +
|
||||
.../linux-aarch64-with-clusters.cpuinfo | 72 +++++++++++++++++++
|
||||
.../linux-aarch64-with-clusters.expected | 1 +
|
||||
.../cpu/cpu0/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu0/topology/cluster_id | 1 +
|
||||
.../cpu/cpu0/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu0/topology/core_id | 1 +
|
||||
.../cpu/cpu0/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu0/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu0/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu0/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu1/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu1/topology/cluster_id | 1 +
|
||||
.../cpu/cpu1/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu1/topology/core_id | 1 +
|
||||
.../cpu/cpu1/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu1/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu1/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu1/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu2/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu2/topology/cluster_id | 1 +
|
||||
.../cpu/cpu2/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu2/topology/core_id | 1 +
|
||||
.../cpu/cpu2/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu2/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu2/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu2/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu3/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu3/topology/cluster_id | 1 +
|
||||
.../cpu/cpu3/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu3/topology/core_id | 1 +
|
||||
.../cpu/cpu3/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu3/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu3/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu3/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu4/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu4/topology/cluster_id | 1 +
|
||||
.../cpu/cpu4/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu4/topology/core_id | 1 +
|
||||
.../cpu/cpu4/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu4/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu4/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu4/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu5/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu5/topology/cluster_id | 1 +
|
||||
.../cpu/cpu5/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu5/topology/core_id | 1 +
|
||||
.../cpu/cpu5/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu5/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu5/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu5/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu6/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu6/topology/cluster_id | 1 +
|
||||
.../cpu/cpu6/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu6/topology/core_id | 1 +
|
||||
.../cpu/cpu6/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu6/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu6/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu6/topology/thread_siblings_list | 1 +
|
||||
.../cpu/cpu7/topology/cluster_cpus_list | 1 +
|
||||
.../cpu/cpu7/topology/cluster_id | 1 +
|
||||
.../cpu/cpu7/topology/core_cpus_list | 1 +
|
||||
.../cpu/cpu7/topology/core_id | 1 +
|
||||
.../cpu/cpu7/topology/core_siblings_list | 1 +
|
||||
.../cpu/cpu7/topology/package_cpus_list | 1 +
|
||||
.../cpu/cpu7/topology/physical_package_id | 1 +
|
||||
.../cpu/cpu7/topology/thread_siblings_list | 1 +
|
||||
.../linux-with-clusters/cpu/online | 1 +
|
||||
.../linux-with-clusters/cpu/present | 1 +
|
||||
.../linux-with-clusters/node/node0/cpu0 | 1 +
|
||||
.../linux-with-clusters/node/node0/cpu1 | 1 +
|
||||
.../linux-with-clusters/node/node0/cpu2 | 1 +
|
||||
.../linux-with-clusters/node/node0/cpu3 | 1 +
|
||||
.../linux-with-clusters/node/node0/cpulist | 1 +
|
||||
.../linux-with-clusters/node/node1/cpu4 | 1 +
|
||||
.../linux-with-clusters/node/node1/cpu5 | 1 +
|
||||
.../linux-with-clusters/node/node1/cpu6 | 1 +
|
||||
.../linux-with-clusters/node/node1/cpu7 | 1 +
|
||||
.../linux-with-clusters/node/node1/cpulist | 1 +
|
||||
.../linux-with-clusters/node/online | 1 +
|
||||
.../linux-with-clusters/node/possible | 1 +
|
||||
tests/virhostcputest.c | 1 +
|
||||
85 files changed, 194 insertions(+)
|
||||
create mode 120000 tests/vircaps2xmldata/linux-basic-clusters/system/cpu
|
||||
create mode 120000 tests/vircaps2xmldata/linux-basic-clusters/system/node
|
||||
create mode 100644 tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml
|
||||
create mode 100644 tests/virhostcpudata/linux-aarch64-with-clusters.cpuinfo
|
||||
create mode 100644 tests/virhostcpudata/linux-aarch64-with-clusters.expected
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/package_cpus_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/physical_package_id
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/thread_siblings_list
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/online
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/cpu/present
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node0/cpu0
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node0/cpu1
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node0/cpu2
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node0/cpu3
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/node/node0/cpulist
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node1/cpu4
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node1/cpu5
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node1/cpu6
|
||||
create mode 120000 tests/virhostcpudata/linux-with-clusters/node/node1/cpu7
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/node/node1/cpulist
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/node/online
|
||||
create mode 100644 tests/virhostcpudata/linux-with-clusters/node/possible
|
||||
|
||||
diff --git a/tests/vircaps2xmldata/linux-basic-clusters/system/cpu b/tests/vircaps2xmldata/linux-basic-clusters/system/cpu
|
||||
new file mode 120000
|
||||
index 0000000000..f7354e3525
|
||||
--- /dev/null
|
||||
+++ b/tests/vircaps2xmldata/linux-basic-clusters/system/cpu
|
||||
@@ -0,0 +1 @@
|
||||
+../../../virhostcpudata/linux-with-clusters/cpu
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/vircaps2xmldata/linux-basic-clusters/system/node b/tests/vircaps2xmldata/linux-basic-clusters/system/node
|
||||
new file mode 120000
|
||||
index 0000000000..57b972ce90
|
||||
--- /dev/null
|
||||
+++ b/tests/vircaps2xmldata/linux-basic-clusters/system/node
|
||||
@@ -0,0 +1 @@
|
||||
+../../../virhostcpudata/linux-with-clusters/node
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml b/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml
|
||||
new file mode 100644
|
||||
index 0000000000..fe61fc42cc
|
||||
--- /dev/null
|
||||
+++ b/tests/vircaps2xmldata/vircaps-aarch64-basic-clusters.xml
|
||||
@@ -0,0 +1,39 @@
|
||||
+<capabilities>
|
||||
+
|
||||
+ <host>
|
||||
+ <cpu>
|
||||
+ <arch>aarch64</arch>
|
||||
+ </cpu>
|
||||
+ <power_management/>
|
||||
+ <iommu support='no'/>
|
||||
+ <topology>
|
||||
+ <cells num='2'>
|
||||
+ <cell id='0'>
|
||||
+ <memory unit='KiB'>1048576</memory>
|
||||
+ <pages unit='KiB' size='4'>2048</pages>
|
||||
+ <pages unit='KiB' size='2048'>4096</pages>
|
||||
+ <pages unit='KiB' size='1048576'>6144</pages>
|
||||
+ <cpus num='4'>
|
||||
+ <cpu id='0' socket_id='36' die_id='0' core_id='0' siblings='0-1'/>
|
||||
+ <cpu id='1' socket_id='36' die_id='0' core_id='0' siblings='0-1'/>
|
||||
+ <cpu id='2' socket_id='36' die_id='0' core_id='1' siblings='2-3'/>
|
||||
+ <cpu id='3' socket_id='36' die_id='0' core_id='1' siblings='2-3'/>
|
||||
+ </cpus>
|
||||
+ </cell>
|
||||
+ <cell id='1'>
|
||||
+ <memory unit='KiB'>2097152</memory>
|
||||
+ <pages unit='KiB' size='4'>4096</pages>
|
||||
+ <pages unit='KiB' size='2048'>6144</pages>
|
||||
+ <pages unit='KiB' size='1048576'>8192</pages>
|
||||
+ <cpus num='4'>
|
||||
+ <cpu id='4' socket_id='3180' die_id='0' core_id='256' siblings='4-5'/>
|
||||
+ <cpu id='5' socket_id='3180' die_id='0' core_id='256' siblings='4-5'/>
|
||||
+ <cpu id='6' socket_id='3180' die_id='0' core_id='257' siblings='6-7'/>
|
||||
+ <cpu id='7' socket_id='3180' die_id='0' core_id='257' siblings='6-7'/>
|
||||
+ </cpus>
|
||||
+ </cell>
|
||||
+ </cells>
|
||||
+ </topology>
|
||||
+ </host>
|
||||
+
|
||||
+</capabilities>
|
||||
diff --git a/tests/vircaps2xmltest.c b/tests/vircaps2xmltest.c
|
||||
index 26a512e87f..2fdf694640 100644
|
||||
--- a/tests/vircaps2xmltest.c
|
||||
+++ b/tests/vircaps2xmltest.c
|
||||
@@ -93,6 +93,7 @@ mymain(void)
|
||||
DO_TEST_FULL("basic", VIR_ARCH_X86_64, false, false);
|
||||
DO_TEST_FULL("basic", VIR_ARCH_AARCH64, true, false);
|
||||
DO_TEST_FULL("basic-dies", VIR_ARCH_X86_64, false, false);
|
||||
+ DO_TEST_FULL("basic-clusters", VIR_ARCH_AARCH64, false, false);
|
||||
|
||||
DO_TEST_FULL("caches", VIR_ARCH_X86_64, true, true);
|
||||
|
||||
diff --git a/tests/virhostcpudata/linux-aarch64-with-clusters.cpuinfo b/tests/virhostcpudata/linux-aarch64-with-clusters.cpuinfo
|
||||
new file mode 100644
|
||||
index 0000000000..94030201d2
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-aarch64-with-clusters.cpuinfo
|
||||
@@ -0,0 +1,72 @@
|
||||
+processor : 0
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 1
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 2
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 3
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 4
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 5
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 6
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
+processor : 7
|
||||
+BogoMIPS : 400.00
|
||||
+Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics cpuid asimdrdm
|
||||
+CPU implementer : 0x43
|
||||
+CPU architecture: 8
|
||||
+CPU variant : 0x1
|
||||
+CPU part : 0x0af
|
||||
+CPU revision : 1
|
||||
+
|
||||
diff --git a/tests/virhostcpudata/linux-aarch64-with-clusters.expected b/tests/virhostcpudata/linux-aarch64-with-clusters.expected
|
||||
new file mode 100644
|
||||
index 0000000000..bf350bd40b
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-aarch64-with-clusters.expected
|
||||
@@ -0,0 +1 @@
|
||||
+CPUs: 8/8, MHz: 0, Nodes: 2, Sockets: 1, Cores: 2, Threads: 2
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..573541ac97
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+0
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..573541ac97
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+0
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..7facc89938
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+36
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu0/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..573541ac97
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+0
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..573541ac97
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+0
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..7facc89938
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+36
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu1/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..7a9857542a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+2-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..d00491fd7e
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..7a9857542a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+2-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..d00491fd7e
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..7facc89938
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+36
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..7a9857542a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu2/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+2-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..7a9857542a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+2-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..d00491fd7e
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..7a9857542a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+2-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..d00491fd7e
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..7facc89938
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+36
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..7a9857542a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu3/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+2-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..e66d883ade
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-5
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..9183bf03fc
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+256
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..e66d883ade
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-5
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..9183bf03fc
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+256
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..58cecca290
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+3180
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..e66d883ade
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu4/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-5
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..e66d883ade
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-5
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..9183bf03fc
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+256
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..e66d883ade
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-5
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..9183bf03fc
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+256
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..58cecca290
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+3180
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..e66d883ade
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu5/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-5
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..fdd9f37517
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+6-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..a700e79997
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+257
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..fdd9f37517
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+6-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..a700e79997
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+257
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..58cecca290
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+3180
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..fdd9f37517
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu6/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+6-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..fdd9f37517
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+6-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_id
|
||||
new file mode 100644
|
||||
index 0000000000..a700e79997
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/cluster_id
|
||||
@@ -0,0 +1 @@
|
||||
+257
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..fdd9f37517
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+6-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_id
|
||||
new file mode 100644
|
||||
index 0000000000..a700e79997
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_id
|
||||
@@ -0,0 +1 @@
|
||||
+257
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/core_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/package_cpus_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/package_cpus_list
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/package_cpus_list
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/physical_package_id b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/physical_package_id
|
||||
new file mode 100644
|
||||
index 0000000000..58cecca290
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/physical_package_id
|
||||
@@ -0,0 +1 @@
|
||||
+3180
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/thread_siblings_list b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/thread_siblings_list
|
||||
new file mode 100644
|
||||
index 0000000000..fdd9f37517
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/cpu7/topology/thread_siblings_list
|
||||
@@ -0,0 +1 @@
|
||||
+6-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/online b/tests/virhostcpudata/linux-with-clusters/cpu/online
|
||||
new file mode 100644
|
||||
index 0000000000..5f4593c34a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/online
|
||||
@@ -0,0 +1 @@
|
||||
+0-223
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/cpu/present b/tests/virhostcpudata/linux-with-clusters/cpu/present
|
||||
new file mode 100644
|
||||
index 0000000000..5f4593c34a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/cpu/present
|
||||
@@ -0,0 +1 @@
|
||||
+0-223
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node0/cpu0 b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu0
|
||||
new file mode 120000
|
||||
index 0000000000..c841bea28b
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu0
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu0
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node0/cpu1 b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu1
|
||||
new file mode 120000
|
||||
index 0000000000..5f4536279e
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu1
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu1
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node0/cpu2 b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu2
|
||||
new file mode 120000
|
||||
index 0000000000..2dcca332ce
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu2
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu2
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node0/cpu3 b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu3
|
||||
new file mode 120000
|
||||
index 0000000000..c7690e5aa6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node0/cpu3
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu3
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node0/cpulist b/tests/virhostcpudata/linux-with-clusters/node/node0/cpulist
|
||||
new file mode 100644
|
||||
index 0000000000..40c7bb2f1a
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node0/cpulist
|
||||
@@ -0,0 +1 @@
|
||||
+0-3
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node1/cpu4 b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu4
|
||||
new file mode 120000
|
||||
index 0000000000..9e77a64eb4
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu4
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu4
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node1/cpu5 b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu5
|
||||
new file mode 120000
|
||||
index 0000000000..cc07c3b97b
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu5
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu5
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node1/cpu6 b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu6
|
||||
new file mode 120000
|
||||
index 0000000000..2e7576354f
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu6
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu6
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node1/cpu7 b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu7
|
||||
new file mode 120000
|
||||
index 0000000000..09e3f79b43
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node1/cpu7
|
||||
@@ -0,0 +1 @@
|
||||
+../../cpu/cpu7
|
||||
\ No newline at end of file
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/node1/cpulist b/tests/virhostcpudata/linux-with-clusters/node/node1/cpulist
|
||||
new file mode 100644
|
||||
index 0000000000..93fccd3cc6
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/node1/cpulist
|
||||
@@ -0,0 +1 @@
|
||||
+4-7
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/online b/tests/virhostcpudata/linux-with-clusters/node/online
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/online
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcpudata/linux-with-clusters/node/possible b/tests/virhostcpudata/linux-with-clusters/node/possible
|
||||
new file mode 100644
|
||||
index 0000000000..8b0fab869c
|
||||
--- /dev/null
|
||||
+++ b/tests/virhostcpudata/linux-with-clusters/node/possible
|
||||
@@ -0,0 +1 @@
|
||||
+0-1
|
||||
diff --git a/tests/virhostcputest.c b/tests/virhostcputest.c
|
||||
index 0990013878..cf310cb4ce 100644
|
||||
--- a/tests/virhostcputest.c
|
||||
+++ b/tests/virhostcputest.c
|
||||
@@ -273,6 +273,7 @@ mymain(void)
|
||||
{"subcores3", VIR_ARCH_PPC64},
|
||||
{"with-frequency", VIR_ARCH_S390X},
|
||||
{"with-die", VIR_ARCH_X86_64},
|
||||
+ {"with-clusters", VIR_ARCH_AARCH64},
|
||||
};
|
||||
|
||||
if (virInitialize() < 0)
|
||||
--
|
||||
2.43.0
|
@ -1,146 +0,0 @@
|
||||
From ce0166ed0811034173aca1edf9e7e2025a100cfb Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <ce0166ed0811034173aca1edf9e7e2025a100cfb.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Mon, 8 Jan 2024 16:21:25 +0100
|
||||
Subject: [PATCH] tests: Add test case for CPU clusters
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 82c9196bfa19e73167faccbc1c2713a6d7ddbafc)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
.../cpu-topology5.aarch64-latest.args | 31 +++++++++++++++++++
|
||||
tests/qemuxml2argvdata/cpu-topology5.xml | 17 ++++++++++
|
||||
tests/qemuxml2argvtest.c | 1 +
|
||||
.../cpu-topology5.aarch64-latest.xml | 29 +++++++++++++++++
|
||||
tests/qemuxml2xmltest.c | 2 ++
|
||||
5 files changed, 80 insertions(+)
|
||||
create mode 100644 tests/qemuxml2argvdata/cpu-topology5.aarch64-latest.args
|
||||
create mode 100644 tests/qemuxml2argvdata/cpu-topology5.xml
|
||||
create mode 100644 tests/qemuxml2xmloutdata/cpu-topology5.aarch64-latest.xml
|
||||
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-topology5.aarch64-latest.args b/tests/qemuxml2argvdata/cpu-topology5.aarch64-latest.args
|
||||
new file mode 100644
|
||||
index 0000000000..d835e1c0fa
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2argvdata/cpu-topology5.aarch64-latest.args
|
||||
@@ -0,0 +1,31 @@
|
||||
+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-aarch64 \
|
||||
+-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 virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \
|
||||
+-accel tcg \
|
||||
+-cpu cortex-a15 \
|
||||
+-m size=219136k \
|
||||
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":224395264}' \
|
||||
+-overcommit mem-lock=off \
|
||||
+-smp 1,maxcpus=8,sockets=1,dies=1,clusters=2,cores=2,threads=2 \
|
||||
+-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 \
|
||||
+-audiodev '{"id":"audio1","driver":"none"}' \
|
||||
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
||||
+-msg timestamp=on
|
||||
diff --git a/tests/qemuxml2argvdata/cpu-topology5.xml b/tests/qemuxml2argvdata/cpu-topology5.xml
|
||||
new file mode 100644
|
||||
index 0000000000..f78f0b6b54
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2argvdata/cpu-topology5.xml
|
||||
@@ -0,0 +1,17 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>QEMUGuest1</name>
|
||||
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
+ <memory unit='KiB'>219100</memory>
|
||||
+ <vcpu placement='static' current='1'>8</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='aarch64' machine='virt'>hvm</type>
|
||||
+ </os>
|
||||
+ <cpu>
|
||||
+ <topology sockets='1' dies='1' clusters='2' cores='2' threads='2'/>
|
||||
+ </cpu>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
+ <controller type='usb' model='none'/>
|
||||
+ <memballoon model='none'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
|
||||
index cb78465fc2..1be138bb0f 100644
|
||||
--- a/tests/qemuxml2argvtest.c
|
||||
+++ b/tests/qemuxml2argvtest.c
|
||||
@@ -1813,6 +1813,7 @@ mymain(void)
|
||||
DO_TEST_CAPS_LATEST("cpu-topology2");
|
||||
DO_TEST_CAPS_LATEST("cpu-topology3");
|
||||
DO_TEST_CAPS_LATEST("cpu-topology4");
|
||||
+ DO_TEST_CAPS_ARCH_LATEST("cpu-topology5", "aarch64");
|
||||
|
||||
DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-minimum1", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
|
||||
DO_TEST_CAPS_ARCH_LATEST_FULL("cpu-minimum2", "x86_64", ARG_CAPS_HOST_CPU_MODEL, QEMU_CPU_DEF_HASWELL);
|
||||
diff --git a/tests/qemuxml2xmloutdata/cpu-topology5.aarch64-latest.xml b/tests/qemuxml2xmloutdata/cpu-topology5.aarch64-latest.xml
|
||||
new file mode 100644
|
||||
index 0000000000..2f5645baab
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuxml2xmloutdata/cpu-topology5.aarch64-latest.xml
|
||||
@@ -0,0 +1,29 @@
|
||||
+<domain type='qemu'>
|
||||
+ <name>QEMUGuest1</name>
|
||||
+ <uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
+ <memory unit='KiB'>219100</memory>
|
||||
+ <currentMemory unit='KiB'>219100</currentMemory>
|
||||
+ <vcpu placement='static' current='1'>8</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='aarch64' machine='virt'>hvm</type>
|
||||
+ <boot dev='hd'/>
|
||||
+ </os>
|
||||
+ <features>
|
||||
+ <gic version='2'/>
|
||||
+ </features>
|
||||
+ <cpu mode='custom' match='exact' check='none'>
|
||||
+ <model fallback='forbid'>cortex-a15</model>
|
||||
+ <topology sockets='1' dies='1' clusters='2' cores='2' threads='2'/>
|
||||
+ </cpu>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
||||
+ <controller type='usb' index='0' model='none'/>
|
||||
+ <controller type='pci' index='0' model='pcie-root'/>
|
||||
+ <audio id='1' type='none'/>
|
||||
+ <memballoon model='none'/>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
|
||||
index 4e39763dc7..15cb6bd692 100644
|
||||
--- a/tests/qemuxml2xmltest.c
|
||||
+++ b/tests/qemuxml2xmltest.c
|
||||
@@ -674,6 +674,8 @@ mymain(void)
|
||||
|
||||
DO_TEST_CAPS_LATEST("chardev-label");
|
||||
|
||||
+ DO_TEST_CAPS_ARCH_LATEST("cpu-topology5", "aarch64");
|
||||
+
|
||||
DO_TEST_CAPS_LATEST("cpu-numa1");
|
||||
DO_TEST_CAPS_LATEST("cpu-numa2");
|
||||
DO_TEST_CAPS_LATEST("cpu-numa-no-memory-element");
|
||||
--
|
||||
2.43.0
|
@ -1,88 +0,0 @@
|
||||
From a7c145e58b5de35554004f5a779091cec7d03be1 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <a7c145e58b5de35554004f5a779091cec7d03be1.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 23 Jan 2024 16:40:34 +0100
|
||||
Subject: [PATCH] tests: Test the previously mishandled PCI VPD characters
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Modify the test data to validate '<>' and other characters.
|
||||
Unfortunately the test suite doesn't have a proper end-to-end test, thus
|
||||
we just add a XML->XML variant and also add data to the binary parser.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 9eda33161f49fcf3ba07d648bd80d2a9a2388479)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
https://issues.redhat.com/browse/RHEL-22400 [9.3.z]
|
||||
https://issues.redhat.com/browse/RHEL-22399 [9.2.z]
|
||||
---
|
||||
tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml | 4 ++--
|
||||
tests/virpcimock.c | 4 ++--
|
||||
tests/virpcivpdtest.c | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml b/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml
|
||||
index 8b56e4f6b4..c9a2901381 100644
|
||||
--- a/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml
|
||||
+++ b/tests/nodedevschemadata/pci_0000_42_00_0_vpd.xml
|
||||
@@ -15,7 +15,7 @@
|
||||
<change_level>B1</change_level>
|
||||
<manufacture_id>foobar</manufacture_id>
|
||||
<part_number>MBF2H332A-AEEOT</part_number>
|
||||
- <serial_number>MT2113X00000</serial_number>
|
||||
+ <serial_number>MT2113X00000><</serial_number>
|
||||
<vendor_field index='0'>PCIeGen4 x8</vendor_field>
|
||||
<vendor_field index='2'>MBF2H332A-AEEOT</vendor_field>
|
||||
<vendor_field index='3'>3c53d07eec484d8aab34dabd24fe575aa</vendor_field>
|
||||
@@ -25,7 +25,7 @@
|
||||
<asset_tag>fooasset</asset_tag>
|
||||
<vendor_field index='0'>vendorfield0</vendor_field>
|
||||
<vendor_field index='2'>vendorfield2</vendor_field>
|
||||
- <vendor_field index='A'>vendorfieldA</vendor_field>
|
||||
+ <vendor_field index='A'>!@#$./><</vendor_field>
|
||||
<system_field index='B'>systemfieldB</system_field>
|
||||
<system_field index='0'>systemfield0</system_field>
|
||||
</fields>
|
||||
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
|
||||
index 13b37bb23d..2f98b0cf13 100644
|
||||
--- a/tests/virpcimock.c
|
||||
+++ b/tests/virpcimock.c
|
||||
@@ -966,9 +966,9 @@ init_env(void)
|
||||
't', 'e', 's', 't', 'n', 'a', 'm', 'e',
|
||||
PCI_VPD_LARGE_RESOURCE_FLAG | PCI_VPD_READ_ONLY_LARGE_RESOURCE_FLAG, 0x16, 0x00,
|
||||
'P', 'N', 0x02, '4', '2',
|
||||
- 'E', 'C', 0x04, '4', '2', '4', '2',
|
||||
+ 'E', 'C', 0x04, '4', '<', '>', '2',
|
||||
'V', 'A', 0x02, 'E', 'X',
|
||||
- 'R', 'V', 0x02, 0x31, 0x00,
|
||||
+ 'R', 'V', 0x02, 0x1D, 0x00,
|
||||
PCI_VPD_RESOURCE_END_VAL
|
||||
};
|
||||
struct pciVPD exampleVPD = {
|
||||
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
|
||||
index b4dd68b7aa..ae5772d3f5 100644
|
||||
--- a/tests/virpcivpdtest.c
|
||||
+++ b/tests/virpcivpdtest.c
|
||||
@@ -424,7 +424,7 @@ testPCIVPDGetFieldValueFormat(const void *data G_GNUC_UNUSED)
|
||||
|
||||
# define VPD_W_EXAMPLE_FIELDS \
|
||||
'V', 'Z', 0x02, '4', '2', \
|
||||
- 'Y', 'A', 0x04, 'I', 'D', '4', '2', \
|
||||
+ 'Y', 'A', 0x04, '!', '<', '>', ':', \
|
||||
'Y', 'F', 0x02, 'E', 'X', \
|
||||
'Y', 'E', 0x00, \
|
||||
'R', 'W', 0x02, 0x00, 0x00
|
||||
@@ -579,7 +579,7 @@ testVirPCIVPDParseFullVPD(const void *opaque G_GNUC_UNUSED)
|
||||
if (testVirPCIVPDValidateExampleReadOnlyFields(res))
|
||||
return -1;
|
||||
|
||||
- if (STRNEQ_NULLABLE(res->rw->asset_tag, "ID42"))
|
||||
+ if (STRNEQ_NULLABLE(res->rw->asset_tag, "!<>:"))
|
||||
return -1;
|
||||
|
||||
if (!res->rw->vendor_specific)
|
||||
--
|
||||
2.43.0
|
@ -1,458 +0,0 @@
|
||||
From 28cda48f6a1af4868de1604755137db2ef5a2405 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <28cda48f6a1af4868de1604755137db2ef5a2405.1706524416.git.jdenemar@redhat.com>
|
||||
From: Andrea Bolognani <abologna@redhat.com>
|
||||
Date: Mon, 8 Jan 2024 18:44:25 +0100
|
||||
Subject: [PATCH] tests: Verify handling of CPU clusters in QMP data
|
||||
|
||||
Since aarch64 doesn't support CPU hotplug at the moment, we have
|
||||
to get a bit creative.
|
||||
|
||||
While the 'query-cpus-fast' output is taken directly from a VM
|
||||
configured as
|
||||
|
||||
<vcpu current='7'>16</vcpu>
|
||||
<cpu mode='host-passthrough'>
|
||||
<topology sockets='2' dies='1' clusters='2' cores='2' threads='2'/>
|
||||
</cpu>
|
||||
|
||||
the 'query-hotpluggable-cpus' output is constructed by hand
|
||||
starting from the former and using the 'x86-dies' test data as
|
||||
a model.
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit cb7abb0703f4c2b55b17cce5ecb8f83fed8775be)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7043
|
||||
|
||||
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
|
||||
---
|
||||
...torjson-cpuinfo-aarch64-clusters-cpus.json | 88 +++++++++
|
||||
...json-cpuinfo-aarch64-clusters-hotplug.json | 171 ++++++++++++++++++
|
||||
...umonitorjson-cpuinfo-aarch64-clusters.data | 108 +++++++++++
|
||||
tests/qemumonitorjsontest.c | 9 +-
|
||||
4 files changed, 375 insertions(+), 1 deletion(-)
|
||||
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-cpus.json
|
||||
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-hotplug.json
|
||||
create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters.data
|
||||
|
||||
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-cpus.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-cpus.json
|
||||
new file mode 100644
|
||||
index 0000000000..817f65d109
|
||||
--- /dev/null
|
||||
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-cpus.json
|
||||
@@ -0,0 +1,88 @@
|
||||
+{
|
||||
+ "return": [
|
||||
+ {
|
||||
+ "thread-id": 284700,
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[0]",
|
||||
+ "cpu-index": 0,
|
||||
+ "target": "aarch64"
|
||||
+ },
|
||||
+ {
|
||||
+ "thread-id": 284701,
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[1]",
|
||||
+ "cpu-index": 1,
|
||||
+ "target": "aarch64"
|
||||
+ },
|
||||
+ {
|
||||
+ "thread-id": 284702,
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[2]",
|
||||
+ "cpu-index": 2,
|
||||
+ "target": "aarch64"
|
||||
+ },
|
||||
+ {
|
||||
+ "thread-id": 284703,
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[3]",
|
||||
+ "cpu-index": 3,
|
||||
+ "target": "aarch64"
|
||||
+ },
|
||||
+ {
|
||||
+ "thread-id": 284704,
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[4]",
|
||||
+ "cpu-index": 4,
|
||||
+ "target": "aarch64"
|
||||
+ },
|
||||
+ {
|
||||
+ "thread-id": 284705,
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[5]",
|
||||
+ "cpu-index": 5,
|
||||
+ "target": "aarch64"
|
||||
+ },
|
||||
+ {
|
||||
+ "thread-id": 284706,
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "qom-path": "/machine/unattached/device[6]",
|
||||
+ "cpu-index": 6,
|
||||
+ "target": "aarch64"
|
||||
+ }
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-hotplug.json b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-hotplug.json
|
||||
new file mode 100644
|
||||
index 0000000000..7ae30bf111
|
||||
--- /dev/null
|
||||
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters-hotplug.json
|
||||
@@ -0,0 +1,171 @@
|
||||
+{
|
||||
+ "return": [
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 1,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[6]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[5]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 1
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[4]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[3]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 1,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[2]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 1,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[1]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ },
|
||||
+ {
|
||||
+ "props": {
|
||||
+ "core-id": 0,
|
||||
+ "thread-id": 0,
|
||||
+ "socket-id": 0,
|
||||
+ "cluster-id": 0
|
||||
+ },
|
||||
+ "vcpus-count": 1,
|
||||
+ "qom-path": "/machine/unattached/device[0]",
|
||||
+ "type": "host-arm-cpu"
|
||||
+ }
|
||||
+ ]
|
||||
+}
|
||||
diff --git a/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters.data b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters.data
|
||||
new file mode 100644
|
||||
index 0000000000..87e927e7a8
|
||||
--- /dev/null
|
||||
+++ b/tests/qemumonitorjsondata/qemumonitorjson-cpuinfo-aarch64-clusters.data
|
||||
@@ -0,0 +1,108 @@
|
||||
+[vcpu libvirt-id='0']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284700'
|
||||
+ enable-id='1'
|
||||
+ query-cpus-id='0'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[0]'
|
||||
+ topology: socket='0' cluster_id='0' core='0' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='1']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284701'
|
||||
+ enable-id='2'
|
||||
+ query-cpus-id='1'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[1]'
|
||||
+ topology: socket='0' cluster_id='0' core='0' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='2']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284702'
|
||||
+ enable-id='3'
|
||||
+ query-cpus-id='2'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[2]'
|
||||
+ topology: socket='0' cluster_id='0' core='1' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='3']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284703'
|
||||
+ enable-id='4'
|
||||
+ query-cpus-id='3'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[3]'
|
||||
+ topology: socket='0' cluster_id='0' core='1' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='4']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284704'
|
||||
+ enable-id='5'
|
||||
+ query-cpus-id='4'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[4]'
|
||||
+ topology: socket='0' cluster_id='1' core='0' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='5']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284705'
|
||||
+ enable-id='6'
|
||||
+ query-cpus-id='5'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[5]'
|
||||
+ topology: socket='0' cluster_id='1' core='0' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='6']
|
||||
+ online=yes
|
||||
+ hotpluggable=no
|
||||
+ thread-id='284706'
|
||||
+ enable-id='7'
|
||||
+ query-cpus-id='6'
|
||||
+ type='host-arm-cpu'
|
||||
+ qom_path='/machine/unattached/device[6]'
|
||||
+ topology: socket='0' cluster_id='1' core='1' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='7']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='0' cluster_id='1' core='1' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='8']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='0' core='0' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='9']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='0' core='0' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='10']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='0' core='1' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='11']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='0' core='1' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='12']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='1' core='0' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='13']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='1' core='0' thread='1' vcpus='1'
|
||||
+[vcpu libvirt-id='14']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='1' core='1' thread='0' vcpus='1'
|
||||
+[vcpu libvirt-id='15']
|
||||
+ online=no
|
||||
+ hotpluggable=yes
|
||||
+ type='host-arm-cpu'
|
||||
+ topology: socket='1' cluster_id='1' core='1' thread='1' vcpus='1'
|
||||
diff --git a/tests/qemumonitorjsontest.c b/tests/qemumonitorjsontest.c
|
||||
index d9ebb429e7..45cee23798 100644
|
||||
--- a/tests/qemumonitorjsontest.c
|
||||
+++ b/tests/qemumonitorjsontest.c
|
||||
@@ -2262,13 +2262,16 @@ testQemuMonitorCPUInfoFormat(qemuMonitorCPUInfo *vcpus,
|
||||
if (vcpu->qom_path)
|
||||
virBufferAsprintf(&buf, "qom_path='%s'\n", vcpu->qom_path);
|
||||
|
||||
- if (vcpu->socket_id != -1 || vcpu->core_id != -1 ||
|
||||
+ if (vcpu->socket_id != -1 || vcpu->die_id != -1 ||
|
||||
+ vcpu->cluster_id != -1 || vcpu->core_id != -1 ||
|
||||
vcpu->thread_id != -1 || vcpu->vcpus != 0) {
|
||||
virBufferAddLit(&buf, "topology:");
|
||||
if (vcpu->socket_id != -1)
|
||||
virBufferAsprintf(&buf, " socket='%d'", vcpu->socket_id);
|
||||
if (vcpu->die_id != -1)
|
||||
virBufferAsprintf(&buf, " die='%d'", vcpu->die_id);
|
||||
+ if (vcpu->cluster_id != -1)
|
||||
+ virBufferAsprintf(&buf, " cluster_id='%d'", vcpu->cluster_id);
|
||||
if (vcpu->core_id != -1)
|
||||
virBufferAsprintf(&buf, " core='%d'", vcpu->core_id);
|
||||
if (vcpu->thread_id != -1)
|
||||
@@ -2919,6 +2922,10 @@ mymain(void)
|
||||
DO_TEST_CPU_INFO("ppc64-hotplug-4", 24);
|
||||
DO_TEST_CPU_INFO("ppc64-no-threads", 16);
|
||||
|
||||
+ /* aarch64 doesn't support CPU hotplug yet, so the data used in
|
||||
+ * this test is partially synthetic */
|
||||
+ DO_TEST_CPU_INFO("aarch64-clusters", 16);
|
||||
+
|
||||
DO_TEST_CPU_INFO("s390", 2);
|
||||
|
||||
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,46 @@
|
||||
From fa4a66a178829bcd66ae91732204540111fa9e7b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <fa4a66a178829bcd66ae91732204540111fa9e7b.1720800605.git.jdenemar@redhat.com>
|
||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
||||
Date: Thu, 4 Jul 2024 15:54:27 +0200
|
||||
Subject: [PATCH] tests: qemuxmlconf: adjust test case to new virtiofsd
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Now that we have a fake virtiofsd json descriptor in our vhost-user
|
||||
test data, we can remove the explicitly specified binary and our
|
||||
mocking will ensure this test won't be affected by the host state.
|
||||
|
||||
Also remove the locking options, since they were never supported
|
||||
by the Rust version of virtiofsd.
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 132bf6d89b0eb744db6255e18494b493bd998d1d)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7108
|
||||
https://issues.redhat.com/browse/RHEL-40135
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
tests/qemuxmlconfdata/vhost-user-fs-fd-memory.xml | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/qemuxmlconfdata/vhost-user-fs-fd-memory.xml b/tests/qemuxmlconfdata/vhost-user-fs-fd-memory.xml
|
||||
index 1d0bc26c46..b0b1b44081 100644
|
||||
--- a/tests/qemuxmlconfdata/vhost-user-fs-fd-memory.xml
|
||||
+++ b/tests/qemuxmlconfdata/vhost-user-fs-fd-memory.xml
|
||||
@@ -28,10 +28,9 @@
|
||||
<controller type='pci' index='0' model='pci-root'/>
|
||||
<filesystem type='mount' accessmode='passthrough'>
|
||||
<driver type='virtiofs' queue='1024'/>
|
||||
- <binary path='/usr/libexec/virtiofsd' xattr='on'>
|
||||
+ <binary xattr='on'>
|
||||
<cache mode='always'/>
|
||||
<sandbox mode='chroot'/>
|
||||
- <lock posix='off' flock='off'/>
|
||||
<thread_pool size='16'/>
|
||||
</binary>
|
||||
<idmap>
|
||||
--
|
||||
2.45.2
|
@ -0,0 +1,69 @@
|
||||
From d0bdafd019e0071149e5bc294389386c789a66bd Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <d0bdafd019e0071149e5bc294389386c789a66bd.1720800605.git.jdenemar@redhat.com>
|
||||
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
|
||||
Date: Thu, 4 Jul 2024 15:54:26 +0200
|
||||
Subject: [PATCH] tests: vhostuser: add virtiofsd json descriptor
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Add the capabilities from the latest virtiofsd main branch and adjust
|
||||
the order in the priority test accordingly.
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit f64e658df04e9cf5b99fbe5c846ba3478e13d826)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-7108
|
||||
https://issues.redhat.com/browse/RHEL-40135
|
||||
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com>
|
||||
---
|
||||
.../usr/libexec/qemu/vhost-user/test-virtiofsd | 10 ++++++++++
|
||||
.../usr/share/qemu/vhost-user/50-qemu-virtiofsd.json | 5 +++++
|
||||
tests/qemuvhostusertest.c | 1 +
|
||||
3 files changed, 16 insertions(+)
|
||||
create mode 100755 tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-virtiofsd
|
||||
create mode 100644 tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-qemu-virtiofsd.json
|
||||
|
||||
diff --git a/tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-virtiofsd b/tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-virtiofsd
|
||||
new file mode 100755
|
||||
index 0000000000..90b38187c9
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuvhostuserdata/usr/libexec/qemu/vhost-user/test-virtiofsd
|
||||
@@ -0,0 +1,10 @@
|
||||
+#!/bin/sh
|
||||
+
|
||||
+cat <<EOF
|
||||
+{
|
||||
+ "type": "fs",
|
||||
+ "features": [
|
||||
+ "migrate-precopy"
|
||||
+ ]
|
||||
+}
|
||||
+EOF
|
||||
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
|
||||
new file mode 100644
|
||||
index 0000000000..b908bc6b30
|
||||
--- /dev/null
|
||||
+++ b/tests/qemuvhostuserdata/usr/share/qemu/vhost-user/50-qemu-virtiofsd.json
|
||||
@@ -0,0 +1,5 @@
|
||||
+{
|
||||
+ "description": "virtiofsd vhost-user-fs",
|
||||
+ "type": "fs",
|
||||
+ "binary": "/usr/libexec/qemu/vhost-user/test-vhost-user-gpu"
|
||||
+}
|
||||
diff --git a/tests/qemuvhostusertest.c b/tests/qemuvhostusertest.c
|
||||
index 4bbad94f74..1f8553fc2d 100644
|
||||
--- a/tests/qemuvhostusertest.c
|
||||
+++ b/tests/qemuvhostusertest.c
|
||||
@@ -60,6 +60,7 @@ testVUPrecedence(const void *opaque G_GNUC_UNUSED)
|
||||
const char *expected[] = {
|
||||
PREFIX "/share/qemu/vhost-user/30-gpu.json",
|
||||
SYSCONFDIR "/qemu/vhost-user/40-gpu.json",
|
||||
+ PREFIX "/share/qemu/vhost-user/50-qemu-virtiofsd.json",
|
||||
PREFIX "/share/qemu/vhost-user/60-gpu.json",
|
||||
NULL
|
||||
};
|
||||
--
|
||||
2.45.2
|
@ -1,81 +0,0 @@
|
||||
From 7c634eb7244604521b0f2a00f3a7e2e65a6a8399 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <7c634eb7244604521b0f2a00f3a7e2e65a6a8399.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 17:55:06 +0100
|
||||
Subject: [PATCH] tests: virpcivpd: Remove
|
||||
'testVirPCIVPDParseVPDStringResource' case
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The test case excercises 'virPCIVPDParseVPDLargeResourceString' which is
|
||||
also tested by other cases which parse the whole VPD block. Remove the
|
||||
specific test case as it's not adding any additional value.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 78e17cd550f0ee1f200557d496ef43724319c17e)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
tests/virpcivpdtest.c | 38 --------------------------------------
|
||||
1 file changed, 38 deletions(-)
|
||||
|
||||
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
|
||||
index aadd1b222b..fddb42f52c 100644
|
||||
--- a/tests/virpcivpdtest.c
|
||||
+++ b/tests/virpcivpdtest.c
|
||||
@@ -429,42 +429,6 @@ testPCIVPDGetFieldValueFormat(const void *data G_GNUC_UNUSED)
|
||||
'Y', 'E', 0x00, \
|
||||
'R', 'W', 0x02, 0x00, 0x00
|
||||
|
||||
-static int
|
||||
-testVirPCIVPDParseVPDStringResource(const void *opaque G_GNUC_UNUSED)
|
||||
-{
|
||||
- VIR_AUTOCLOSE fd = -1;
|
||||
- uint8_t csum = 0;
|
||||
- size_t dataLen = 0;
|
||||
- bool result = false;
|
||||
-
|
||||
- g_autoptr(virPCIVPDResource) res = g_new0(virPCIVPDResource, 1);
|
||||
- const char *expectedValue = "testname";
|
||||
-
|
||||
- const uint8_t stringResExample[] = {
|
||||
- VPD_STRING_RESOURCE_EXAMPLE_DATA
|
||||
- };
|
||||
-
|
||||
- dataLen = G_N_ELEMENTS(stringResExample);
|
||||
- if ((fd = virCreateAnonymousFile(stringResExample, dataLen)) < 0)
|
||||
- return -1;
|
||||
-
|
||||
- result = virPCIVPDParseVPDLargeResourceString(fd, 0, dataLen, &csum, res);
|
||||
-
|
||||
- if (!result) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
- "Could not parse the example resource.");
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (STRNEQ(expectedValue, res->name)) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "Unexpected string resource value: %s, expected: %s",
|
||||
- res->name, expectedValue);
|
||||
- return -1;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
testVirPCIVPDValidateExampleReadOnlyFields(virPCIVPDResource *res)
|
||||
{
|
||||
@@ -964,8 +928,6 @@ mymain(void)
|
||||
if (virTestRun("Determining a field value format by a key ",
|
||||
testPCIVPDGetFieldValueFormat, NULL) < 0)
|
||||
ret = -1;
|
||||
- if (virTestRun("Parsing VPD string resources ", testVirPCIVPDParseVPDStringResource, NULL) < 0)
|
||||
- ret = -1;
|
||||
if (virTestRun("Parsing a VPD resource with a zero-length RW ",
|
||||
testVirPCIVPDParseZeroLengthRW, NULL) < 0)
|
||||
ret = -1;
|
||||
--
|
||||
2.43.0
|
@ -1,83 +0,0 @@
|
||||
From c4b66437f7b829efa0ab6c6007347061ca257719 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c4b66437f7b829efa0ab6c6007347061ca257719.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 14:55:47 +0100
|
||||
Subject: [PATCH] tests: virpcivpdtest: Remove 'testVirPCIVPDReadVPDBytes' case
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The case checks only the 'virPCIVPDReadVPDBytes' which is also tested
|
||||
multiple times via 'virPCIVPDParse' as it's used to read the data, thus
|
||||
having a special case for this is pointless.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 1a994a9dc6424ff7ea9d0f5d325059ffd234408b)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
tests/virpcivpdtest.c | 41 -----------------------------------------
|
||||
1 file changed, 41 deletions(-)
|
||||
|
||||
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
|
||||
index ae5772d3f5..aadd1b222b 100644
|
||||
--- a/tests/virpcivpdtest.c
|
||||
+++ b/tests/virpcivpdtest.c
|
||||
@@ -429,45 +429,6 @@ testPCIVPDGetFieldValueFormat(const void *data G_GNUC_UNUSED)
|
||||
'Y', 'E', 0x00, \
|
||||
'R', 'W', 0x02, 0x00, 0x00
|
||||
|
||||
-static int
|
||||
-testVirPCIVPDReadVPDBytes(const void *opaque G_GNUC_UNUSED)
|
||||
-{
|
||||
- VIR_AUTOCLOSE fd = -1;
|
||||
- g_autofree uint8_t *buf = NULL;
|
||||
- uint8_t csum = 0;
|
||||
- size_t readBytes = 0;
|
||||
- size_t dataLen = 0;
|
||||
-
|
||||
- /* An example of a valid VPD record with one VPD-R resource and 2 fields. */
|
||||
- uint8_t fullVPDExample[] = {
|
||||
- VPD_STRING_RESOURCE_EXAMPLE_HEADER, VPD_STRING_RESOURCE_EXAMPLE_DATA,
|
||||
- VPD_R_FIELDS_EXAMPLE_HEADER, VPD_R_FIELDS_EXAMPLE_DATA,
|
||||
- PCI_VPD_RESOURCE_END_VAL
|
||||
- };
|
||||
- dataLen = G_N_ELEMENTS(fullVPDExample) - 2;
|
||||
- buf = g_malloc0(dataLen);
|
||||
-
|
||||
- if ((fd = virCreateAnonymousFile(fullVPDExample, dataLen)) < 0)
|
||||
- return -1;
|
||||
-
|
||||
- readBytes = virPCIVPDReadVPDBytes(fd, buf, dataLen, 0, &csum);
|
||||
-
|
||||
- if (readBytes != dataLen) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "The number of bytes read %zu is lower than expected %zu ",
|
||||
- readBytes, dataLen);
|
||||
- return -1;
|
||||
- }
|
||||
-
|
||||
- if (csum) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- "The sum of all VPD bytes up to and including the checksum byte"
|
||||
- "is equal to zero: 0x%02x", csum);
|
||||
- return -1;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static int
|
||||
testVirPCIVPDParseVPDStringResource(const void *opaque G_GNUC_UNUSED)
|
||||
{
|
||||
@@ -1003,8 +964,6 @@ mymain(void)
|
||||
if (virTestRun("Determining a field value format by a key ",
|
||||
testPCIVPDGetFieldValueFormat, NULL) < 0)
|
||||
ret = -1;
|
||||
- if (virTestRun("Reading VPD bytes ", testVirPCIVPDReadVPDBytes, NULL) < 0)
|
||||
- ret = -1;
|
||||
if (virTestRun("Parsing VPD string resources ", testVirPCIVPDParseVPDStringResource, NULL) < 0)
|
||||
ret = -1;
|
||||
if (virTestRun("Parsing a VPD resource with a zero-length RW ",
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,93 @@
|
||||
From e50dbb62c5dcae9c323a8eb162f83ba0d1f1626f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <e50dbb62c5dcae9c323a8eb162f83ba0d1f1626f.1725274899.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 21 Aug 2024 15:18:31 +0200
|
||||
Subject: [PATCH] udevListInterfaces: Honour array length for zero-length NULL
|
||||
arrays (CVE-2024-8235)
|
||||
|
||||
The refactor of 'udevListInterfacesByStatus()' which attempted to make
|
||||
it usable as backend for 'udevNumOfInterfacesByStatus()' neglected to
|
||||
consider the corner case of 'g_new0(..., 0)' returning NULL if the user
|
||||
actually requests 0 elements.
|
||||
|
||||
As the code was modified to report the full number of interfaces in the
|
||||
system when the list of names is NULL, the RPC code would be asked to
|
||||
serialize a NULL-list of interface names with declared lenth of 1+
|
||||
causing a crash.
|
||||
|
||||
To fix this corner case we make callers pass '-1' as @names_len (it's
|
||||
conveniently an 'int' due to RPC type usage) if they don't wish to fetch
|
||||
the actual list and convert all decisions to be done on @names_len being
|
||||
non-negative instead of @names being non-NULL.
|
||||
|
||||
CVE-2024-8235
|
||||
|
||||
Fixes: bc596f275129bc11b2c4bcf737d380c9e8aeb72d
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-55373
|
||||
Reported-by: Yanqiu Zhang <yanqzhan@redhat.com>
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
(cherry picked from commit 8dfb12cb77996519901b8d52c754ab564ebd10e8)
|
||||
---
|
||||
src/interface/interface_backend_udev.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
|
||||
index e1a50389c9..48eacdcdc2 100644
|
||||
--- a/src/interface/interface_backend_udev.c
|
||||
+++ b/src/interface/interface_backend_udev.c
|
||||
@@ -143,12 +143,13 @@ udevGetDevices(struct udev *udev, virUdevStatus status)
|
||||
*
|
||||
* @conn: connection object
|
||||
* @names: optional pointer to array to be filled with interface names
|
||||
- * @names_len: size of @names
|
||||
+ * @names_len: size of @names, -1 if only number of interfaces is required (@names is then ignored)
|
||||
* @status: status of interfaces to be listed
|
||||
* @filter: ACL filter function
|
||||
*
|
||||
* Lists interfaces with status matching @status filling them into @names (if
|
||||
- * non-NULL) and returns the number of such interfaces.
|
||||
+ * @names_len is positive, caller is expected to pass a properly sized array)
|
||||
+ * and returns the number of such interfaces.
|
||||
*
|
||||
* In case of an error -1 is returned and no interfaces are filled into @names.
|
||||
*/
|
||||
@@ -189,7 +190,7 @@ udevListInterfacesByStatus(virConnectPtr conn,
|
||||
g_autoptr(virInterfaceDef) def = NULL;
|
||||
|
||||
/* Ensure we won't exceed the size of our array */
|
||||
- if (names && count >= names_len)
|
||||
+ if (names_len >= 0 && count >= names_len)
|
||||
break;
|
||||
|
||||
path = udev_list_entry_get_name(dev_entry);
|
||||
@@ -204,7 +205,8 @@ udevListInterfacesByStatus(virConnectPtr conn,
|
||||
|
||||
def = udevGetMinimalDefForDevice(dev);
|
||||
if (filter(conn, def)) {
|
||||
- if (names)
|
||||
+ /* Fill the array only if caller want's it */
|
||||
+ if (names_len >= 0)
|
||||
names[count] = g_strdup(name);
|
||||
count++;
|
||||
}
|
||||
@@ -224,7 +226,7 @@ udevConnectNumOfInterfaces(virConnectPtr conn)
|
||||
if (virConnectNumOfInterfacesEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
- return udevListInterfacesByStatus(conn, NULL, 0, VIR_UDEV_IFACE_ACTIVE,
|
||||
+ return udevListInterfacesByStatus(conn, NULL, -1, VIR_UDEV_IFACE_ACTIVE,
|
||||
virConnectNumOfInterfacesCheckACL);
|
||||
}
|
||||
|
||||
@@ -247,7 +249,7 @@ udevConnectNumOfDefinedInterfaces(virConnectPtr conn)
|
||||
if (virConnectNumOfDefinedInterfacesEnsureACL(conn) < 0)
|
||||
return -1;
|
||||
|
||||
- return udevListInterfacesByStatus(conn, NULL, 0, VIR_UDEV_IFACE_INACTIVE,
|
||||
+ return udevListInterfacesByStatus(conn, NULL, -1, VIR_UDEV_IFACE_INACTIVE,
|
||||
virConnectNumOfDefinedInterfacesCheckACL);
|
||||
}
|
||||
|
||||
--
|
||||
2.46.0
|
@ -0,0 +1,44 @@
|
||||
From a75fd28107feb17f408b4fd2358fb68242c7cad9 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <a75fd28107feb17f408b4fd2358fb68242c7cad9.1729611062.git.jdenemar@redhat.com>
|
||||
From: Martin Kletzander <mkletzan@redhat.com>
|
||||
Date: Thu, 3 Oct 2024 17:00:48 +0200
|
||||
Subject: [PATCH] util: Look for newer name of cpu wait time statistic
|
||||
|
||||
It looks like linux changed the key for wait time in /proc/<pid>/sched
|
||||
and /proc/<pid>/task/<tid>/sched files in commit ceeadb83aea2 (or around
|
||||
that time) from se.statistics.wait_sum to just wait_sum. Similarly to
|
||||
the previous change (from se.wait_sum) just look for the new name first.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-60030
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
|
||||
(cherry picked from commit 215cada34395b6b2caad507393e043594d6c86fc)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61511
|
||||
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
---
|
||||
src/util/virprocess.c | 8 +++++---
|
||||
1 file changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
|
||||
index f1e5e4decd..05db76d834 100644
|
||||
--- a/src/util/virprocess.c
|
||||
+++ b/src/util/virprocess.c
|
||||
@@ -1848,9 +1848,11 @@ virProcessGetSchedInfo(unsigned long long *cpuWait,
|
||||
for (i = 0; lines[i] != NULL; i++) {
|
||||
const char *line = lines[i];
|
||||
|
||||
- /* Needs CONFIG_SCHEDSTATS. The second check
|
||||
- * is the old name the kernel used in past */
|
||||
- if (STRPREFIX(line, "se.statistics.wait_sum") ||
|
||||
+ /* Needs CONFIG_SCHEDSTATS. The second check is the name used before
|
||||
+ * kernel commit ceeadb83aea2, the third one is the old name the kernel
|
||||
+ * used in past */
|
||||
+ if (STRPREFIX(line, "wait_sum") ||
|
||||
+ STRPREFIX(line, "se.statistics.wait_sum") ||
|
||||
STRPREFIX(line, "se.wait_sum")) {
|
||||
line = strchr(line, ':');
|
||||
if (!line) {
|
||||
--
|
||||
2.47.0
|
@ -1,62 +0,0 @@
|
||||
From b28e30bd2b1b40fb3bec3064e883cc9f3abff7c5 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b28e30bd2b1b40fb3bec3064e883cc9f3abff7c5.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 15:53:39 +0100
|
||||
Subject: [PATCH] util: pcivpd: Refactor virPCIVPDResourceIsValidTextValue
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The function is never called with NULL argument. Remove the check and
|
||||
refactor the rest including the debug statement.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit eb3844009dc3bdd50274954618b8cd9962218317)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
https://issues.redhat.com/browse/RHEL-22400 [9.3.z]
|
||||
https://issues.redhat.com/browse/RHEL-22399 [9.2.z]
|
||||
---
|
||||
src/util/virpcivpd.c | 23 +++++++++--------------
|
||||
1 file changed, 9 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 248a9b2790..81c7c317b3 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -175,23 +175,18 @@ virPCIVPDResourceGetFieldValueFormat(const char *keyword)
|
||||
bool
|
||||
virPCIVPDResourceIsValidTextValue(const char *value)
|
||||
{
|
||||
- size_t i = 0;
|
||||
+ const char *v;
|
||||
+ bool ret = true;
|
||||
|
||||
- if (value == NULL)
|
||||
- return false;
|
||||
-
|
||||
- /* An empty string is a valid value. */
|
||||
- if (STREQ(value, ""))
|
||||
- return true;
|
||||
-
|
||||
- while (i < strlen(value)) {
|
||||
- if (!g_ascii_isprint(value[i])) {
|
||||
- VIR_DEBUG("The provided value contains non-ASCII printable characters: %s", value);
|
||||
- return false;
|
||||
+ for (v = value; *v; v++) {
|
||||
+ if (!g_ascii_isprint(*v)) {
|
||||
+ ret = false;
|
||||
+ break;
|
||||
}
|
||||
- ++i;
|
||||
}
|
||||
- return true;
|
||||
+
|
||||
+ VIR_DEBUG("val='%s' ret='%d'", value, ret);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
void
|
||||
--
|
||||
2.43.0
|
@ -1,82 +0,0 @@
|
||||
From 44db6e745e039dd10c1f4256047eaef8be61ecd6 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <44db6e745e039dd10c1f4256047eaef8be61ecd6.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 14:40:38 +0100
|
||||
Subject: [PATCH] util: pcivpd: Unexport virPCIVPDParseVPDLargeResourceFields
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The function is not used in other files.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit d395d7a20f218d5c1af956c70fae43e8e9626436)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/libvirt_private.syms | 1 -
|
||||
src/util/virpcivpd.c | 15 +--------------
|
||||
src/util/virpcivpdpriv.h | 3 ---
|
||||
3 files changed, 1 insertion(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
||||
index dbc4e26d79..89b0d01de6 100644
|
||||
--- a/src/libvirt_private.syms
|
||||
+++ b/src/libvirt_private.syms
|
||||
@@ -3700,7 +3700,6 @@ virVHBAPathExists;
|
||||
# util/virpcivpd.h
|
||||
|
||||
virPCIVPDParse;
|
||||
-virPCIVPDParseVPDLargeResourceFields;
|
||||
virPCIVPDParseVPDLargeResourceString;
|
||||
virPCIVPDResourceCustomCompareIndex;
|
||||
virPCIVPDResourceCustomFree;
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 373321a836..510be65cb6 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -436,7 +436,7 @@ virPCIVPDReadVPDBytes(int vpdFileFd, uint8_t *buf, size_t count, off_t offset, u
|
||||
* Returns: a pointer to a VPDResource which needs to be freed by the caller or
|
||||
* NULL if getting it failed for some reason.
|
||||
*/
|
||||
-bool
|
||||
+static bool
|
||||
virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t resDataLen,
|
||||
bool readOnly, uint8_t *csum, virPCIVPDResource *res)
|
||||
{
|
||||
@@ -744,19 +744,6 @@ virPCIVPDParseVPDLargeResourceString(int vpdFileFd G_GNUC_UNUSED,
|
||||
return false;
|
||||
}
|
||||
|
||||
-bool
|
||||
-virPCIVPDParseVPDLargeResourceFields(int vpdFileFd G_GNUC_UNUSED,
|
||||
- uint16_t resPos G_GNUC_UNUSED,
|
||||
- uint16_t resDataLen G_GNUC_UNUSED,
|
||||
- bool readOnly G_GNUC_UNUSED,
|
||||
- uint8_t *csum G_GNUC_UNUSED,
|
||||
- virPCIVPDResource *res G_GNUC_UNUSED)
|
||||
-{
|
||||
- virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
- _("PCI VPD reporting not available on this platform"));
|
||||
- return false;
|
||||
-}
|
||||
-
|
||||
virPCIVPDResource *
|
||||
virPCIVPDParse(int vpdFileFd G_GNUC_UNUSED)
|
||||
{
|
||||
diff --git a/src/util/virpcivpdpriv.h b/src/util/virpcivpdpriv.h
|
||||
index 17e6e14ab7..d84f1e9c8a 100644
|
||||
--- a/src/util/virpcivpdpriv.h
|
||||
+++ b/src/util/virpcivpdpriv.h
|
||||
@@ -69,8 +69,5 @@ virPCIVPDResourceCustomCompareIndex(virPCIVPDResourceCustom *a, virPCIVPDResourc
|
||||
bool
|
||||
virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const value);
|
||||
|
||||
-bool virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t resDataLen,
|
||||
- bool readOnly, uint8_t *csum, virPCIVPDResource *res);
|
||||
-
|
||||
bool virPCIVPDParseVPDLargeResourceString(int vpdFileFd, uint16_t resPos, uint16_t resDataLen,
|
||||
uint8_t *csum, virPCIVPDResource *res);
|
||||
--
|
||||
2.43.0
|
@ -1,63 +0,0 @@
|
||||
From 3c01b1ab89ad4c16862582a05394f056616925a2 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <3c01b1ab89ad4c16862582a05394f056616925a2.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 16:42:45 +0100
|
||||
Subject: [PATCH] util: virPCIVPDResourceUpdateKeyword: Remove impossible
|
||||
checks
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
All callers satisfy these checks as they are just for programming
|
||||
errors.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit dd328cd48a469d81e91eaf56fad832aa8bd288d6)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 19 -------------------
|
||||
1 file changed, 19 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index f198faaf42..3beb405252 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -313,20 +313,7 @@ bool
|
||||
virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
const char *const keyword, const char *const value)
|
||||
{
|
||||
- if (!res) {
|
||||
- VIR_INFO("Cannot update the resource: a NULL resource pointer has been provided.");
|
||||
- return false;
|
||||
- } else if (!keyword) {
|
||||
- VIR_INFO("Cannot update the resource: a NULL keyword pointer has been provided.");
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
if (readOnly) {
|
||||
- if (!res->ro) {
|
||||
- VIR_INFO("Cannot update the read-only keyword: RO section not initialized.");
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
if (STREQ("EC", keyword) || STREQ("change_level", keyword)) {
|
||||
g_free(res->ro->change_level);
|
||||
res->ro->change_level = g_strdup(value);
|
||||
@@ -353,13 +340,7 @@ virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
/* The CP keyword is currently not supported and is skipped. */
|
||||
return true;
|
||||
}
|
||||
-
|
||||
} else {
|
||||
- if (!res->rw) {
|
||||
- VIR_INFO("Cannot update the read-write keyword: read-write section not initialized.");
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
if (STREQ("YA", keyword) || STREQ("asset_tag", keyword)) {
|
||||
g_free(res->rw->asset_tag);
|
||||
res->rw->asset_tag = g_strdup(value);
|
||||
--
|
||||
2.43.0
|
@ -1,143 +0,0 @@
|
||||
From 509e56de7e817de1edbd76da806eb79dca6d45e3 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <509e56de7e817de1edbd76da806eb79dca6d45e3.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 16:11:24 +0100
|
||||
Subject: [PATCH] util: virpcivpd: Remove return value from
|
||||
virPCIVPDResourceCustomUpsertValue
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
None of the callers pass NULL, so the NULL check is pointless. Remove it
|
||||
an remove the return value.
|
||||
|
||||
The function is exported only for use in 'virpcivpdtest' thus marking
|
||||
the arguments as NONNULL is unnecessary.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit d36da8ea4a107d129bdc701f95b1b131bc3df01d)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 18 ++++--------------
|
||||
src/util/virpcivpdpriv.h | 2 +-
|
||||
tests/virpcivpdtest.c | 12 ++++--------
|
||||
3 files changed, 9 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 67065dec46..f198faaf42 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -270,7 +270,7 @@ virPCIVPDResourceCustomCompareIndex(virPCIVPDResourceCustom *a, virPCIVPDResourc
|
||||
*
|
||||
* Returns: true if a value has been updated successfully, false otherwise.
|
||||
*/
|
||||
-bool
|
||||
+void
|
||||
virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const value)
|
||||
{
|
||||
g_autoptr(virPCIVPDResourceCustom) custom = NULL;
|
||||
@@ -278,9 +278,6 @@ virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const
|
||||
guint pos = 0;
|
||||
bool found = false;
|
||||
|
||||
- if (arr == NULL || value == NULL)
|
||||
- return false;
|
||||
-
|
||||
custom = g_new0(virPCIVPDResourceCustom, 1);
|
||||
custom->idx = index;
|
||||
custom->value = g_strdup(value);
|
||||
@@ -294,7 +291,6 @@ virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const
|
||||
} else {
|
||||
g_ptr_array_add(arr, g_steal_pointer(&custom));
|
||||
}
|
||||
- return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -348,9 +344,7 @@ virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
res->ro->serial_number = g_strdup(value);
|
||||
return true;
|
||||
} else if (virPCIVPDResourceIsVendorKeyword(keyword)) {
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(res->ro->vendor_specific, keyword[1], value)) {
|
||||
- return false;
|
||||
- }
|
||||
+ virPCIVPDResourceCustomUpsertValue(res->ro->vendor_specific, keyword[1], value);
|
||||
return true;
|
||||
} else if (STREQ("FG", keyword) || STREQ("LC", keyword) || STREQ("PG", keyword)) {
|
||||
/* Legacy PICMIG keywords are skipped on purpose. */
|
||||
@@ -371,14 +365,10 @@ virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
res->rw->asset_tag = g_strdup(value);
|
||||
return true;
|
||||
} else if (virPCIVPDResourceIsVendorKeyword(keyword)) {
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(res->rw->vendor_specific, keyword[1], value)) {
|
||||
- return false;
|
||||
- }
|
||||
+ virPCIVPDResourceCustomUpsertValue(res->rw->vendor_specific, keyword[1], value);
|
||||
return true;
|
||||
} else if (virPCIVPDResourceIsSystemKeyword(keyword)) {
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(res->rw->system_specific, keyword[1], value)) {
|
||||
- return false;
|
||||
- }
|
||||
+ virPCIVPDResourceCustomUpsertValue(res->rw->system_specific, keyword[1], value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
diff --git a/src/util/virpcivpdpriv.h b/src/util/virpcivpdpriv.h
|
||||
index 617991930b..f26b64139d 100644
|
||||
--- a/src/util/virpcivpdpriv.h
|
||||
+++ b/src/util/virpcivpdpriv.h
|
||||
@@ -66,5 +66,5 @@ bool virPCIVPDResourceIsValidTextValue(const char *value);
|
||||
gboolean
|
||||
virPCIVPDResourceCustomCompareIndex(virPCIVPDResourceCustom *a, virPCIVPDResourceCustom *b);
|
||||
|
||||
-bool
|
||||
+void
|
||||
virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const value);
|
||||
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
|
||||
index fddb42f52c..8a2f337e85 100644
|
||||
--- a/tests/virpcivpdtest.c
|
||||
+++ b/tests/virpcivpdtest.c
|
||||
@@ -244,8 +244,7 @@ testPCIVPDResourceCustomUpsertValue(const void *data G_GNUC_UNUSED)
|
||||
{
|
||||
g_autoptr(GPtrArray) arr = g_ptr_array_new_full(0, (GDestroyNotify)virPCIVPDResourceCustomFree);
|
||||
virPCIVPDResourceCustom *custom = NULL;
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(arr, 'A', "testval"))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceCustomUpsertValue(arr, 'A', "testval");
|
||||
|
||||
if (arr->len != 1)
|
||||
return -1;
|
||||
@@ -255,8 +254,7 @@ testPCIVPDResourceCustomUpsertValue(const void *data G_GNUC_UNUSED)
|
||||
return -1;
|
||||
|
||||
/* Idempotency */
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(arr, 'A', "testval"))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceCustomUpsertValue(arr, 'A', "testval");
|
||||
|
||||
if (arr->len != 1)
|
||||
return -1;
|
||||
@@ -266,8 +264,7 @@ testPCIVPDResourceCustomUpsertValue(const void *data G_GNUC_UNUSED)
|
||||
return -1;
|
||||
|
||||
/* Existing value updates. */
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(arr, 'A', "testvalnew"))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceCustomUpsertValue(arr, 'A', "testvalnew");
|
||||
|
||||
if (arr->len != 1)
|
||||
return -1;
|
||||
@@ -277,8 +274,7 @@ testPCIVPDResourceCustomUpsertValue(const void *data G_GNUC_UNUSED)
|
||||
return -1;
|
||||
|
||||
/* Inserting multiple values */
|
||||
- if (!virPCIVPDResourceCustomUpsertValue(arr, '1', "42"))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceCustomUpsertValue(arr, '1', "42");
|
||||
|
||||
if (arr->len != 2)
|
||||
return -1;
|
||||
--
|
||||
2.43.0
|
@ -1,206 +0,0 @@
|
||||
From 1fe79c11dab8f390efd2035ba20c194987ba4dee Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <1fe79c11dab8f390efd2035ba20c194987ba4dee.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 17:15:10 +0100
|
||||
Subject: [PATCH] util: virpcivpd: Remove return value from
|
||||
virPCIVPDResourceUpdateKeyword
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The function always succeeded and after the removal of programing error
|
||||
checks doesn't even have a 'return false' case. Additionally one of the
|
||||
tests in 'virpcivpdtest' tested that this function never failed on wrong
|
||||
data. Embrace this logic and remove the return value and adjust logging
|
||||
to VIR_DEBUG level to avoid spamming logs.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 9aa303a948a3eb98b727a333e2571d19ae0a81ce)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 31 +++++++++++--------------------
|
||||
src/util/virpcivpd.h | 8 +++++---
|
||||
tests/virpcivpdtest.c | 38 ++++++++++++++++++--------------------
|
||||
3 files changed, 34 insertions(+), 43 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 3beb405252..0021a88f2d 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -307,54 +307,48 @@ virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const
|
||||
* used in XML elements. For vendor-specific and system-specific keywords only V%s and Y%s
|
||||
* (except "YA" which is an asset tag) formatted values are accepted.
|
||||
*
|
||||
- * Returns: true if a keyword has been updated successfully, false otherwise.
|
||||
+ * Unknown or malformed values are ignored.
|
||||
*/
|
||||
-bool
|
||||
-virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
- const char *const keyword, const char *const value)
|
||||
+void
|
||||
+virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res,
|
||||
+ const bool readOnly,
|
||||
+ const char *const keyword,
|
||||
+ const char *const value)
|
||||
{
|
||||
if (readOnly) {
|
||||
if (STREQ("EC", keyword) || STREQ("change_level", keyword)) {
|
||||
g_free(res->ro->change_level);
|
||||
res->ro->change_level = g_strdup(value);
|
||||
- return true;
|
||||
} else if (STREQ("MN", keyword) || STREQ("manufacture_id", keyword)) {
|
||||
g_free(res->ro->manufacture_id);
|
||||
res->ro->manufacture_id = g_strdup(value);
|
||||
- return true;
|
||||
} else if (STREQ("PN", keyword) || STREQ("part_number", keyword)) {
|
||||
g_free(res->ro->part_number);
|
||||
res->ro->part_number = g_strdup(value);
|
||||
- return true;
|
||||
} else if (STREQ("SN", keyword) || STREQ("serial_number", keyword)) {
|
||||
g_free(res->ro->serial_number);
|
||||
res->ro->serial_number = g_strdup(value);
|
||||
- return true;
|
||||
} else if (virPCIVPDResourceIsVendorKeyword(keyword)) {
|
||||
virPCIVPDResourceCustomUpsertValue(res->ro->vendor_specific, keyword[1], value);
|
||||
- return true;
|
||||
} else if (STREQ("FG", keyword) || STREQ("LC", keyword) || STREQ("PG", keyword)) {
|
||||
/* Legacy PICMIG keywords are skipped on purpose. */
|
||||
- return true;
|
||||
} else if (STREQ("CP", keyword)) {
|
||||
/* The CP keyword is currently not supported and is skipped. */
|
||||
- return true;
|
||||
+ } else {
|
||||
+ VIR_DEBUG("unhandled PCI VPD r/o keyword '%s'(val='%s')", keyword, value);
|
||||
}
|
||||
} else {
|
||||
if (STREQ("YA", keyword) || STREQ("asset_tag", keyword)) {
|
||||
g_free(res->rw->asset_tag);
|
||||
res->rw->asset_tag = g_strdup(value);
|
||||
- return true;
|
||||
} else if (virPCIVPDResourceIsVendorKeyword(keyword)) {
|
||||
virPCIVPDResourceCustomUpsertValue(res->rw->vendor_specific, keyword[1], value);
|
||||
- return true;
|
||||
} else if (virPCIVPDResourceIsSystemKeyword(keyword)) {
|
||||
virPCIVPDResourceCustomUpsertValue(res->rw->system_specific, keyword[1], value);
|
||||
- return true;
|
||||
+ } else {
|
||||
+ VIR_DEBUG("unhandled PCI VPD r/w keyword '%s'(val='%s')", keyword, value);
|
||||
}
|
||||
}
|
||||
- VIR_WARN("Tried to update an unsupported keyword %s: skipping.", keyword);
|
||||
- return true;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -527,10 +521,7 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
res->rw = virPCIVPDResourceRWNew();
|
||||
}
|
||||
/* The field format, keyword and value are determined. Attempt to update the resource. */
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, readOnly, fieldKeyword, fieldValue)) {
|
||||
- VIR_INFO("Could not update the VPD resource keyword: %s", fieldKeyword);
|
||||
- return false;
|
||||
- }
|
||||
+ virPCIVPDResourceUpdateKeyword(res, readOnly, fieldKeyword, fieldValue);
|
||||
}
|
||||
|
||||
/* May have exited the loop prematurely in case RV or RW were encountered and
|
||||
diff --git a/src/util/virpcivpd.h b/src/util/virpcivpd.h
|
||||
index 9bfec43e03..d8d3dd3075 100644
|
||||
--- a/src/util/virpcivpd.h
|
||||
+++ b/src/util/virpcivpd.h
|
||||
@@ -67,9 +67,11 @@ void virPCIVPDResourceRWFree(virPCIVPDResourceRW *rw);
|
||||
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(virPCIVPDResourceRW, virPCIVPDResourceRWFree);
|
||||
|
||||
-bool
|
||||
-virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
- const char *const keyword, const char *const value);
|
||||
+void
|
||||
+virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res,
|
||||
+ const bool readOnly,
|
||||
+ const char *const keyword,
|
||||
+ const char *const value);
|
||||
|
||||
void virPCIVPDResourceCustomFree(virPCIVPDResourceCustom *custom);
|
||||
|
||||
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
|
||||
index 20545759d5..a6311bfe76 100644
|
||||
--- a/tests/virpcivpdtest.c
|
||||
+++ b/tests/virpcivpdtest.c
|
||||
@@ -84,17 +84,15 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
|
||||
/* Update keywords one by one and compare actual values with the expected ones. */
|
||||
for (i = 0; i < numROCases; ++i) {
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, true,
|
||||
- readOnlyCases[i].keyword,
|
||||
- readOnlyCases[i].value))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceUpdateKeyword(res, true,
|
||||
+ readOnlyCases[i].keyword,
|
||||
+ readOnlyCases[i].value);
|
||||
if (STRNEQ(readOnlyCases[i].value, *readOnlyCases[i].actual))
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Do a basic vendor field check. */
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, true, "V0", "vendor0"))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceUpdateKeyword(res, true, "V0", "vendor0");
|
||||
|
||||
if (res->ro->vendor_specific->len != 1)
|
||||
return -1;
|
||||
@@ -105,25 +103,23 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
|
||||
/* Make sure unsupported RO keyword updates are not fatal. */
|
||||
for (i = 0; i < numUnsupportedCases; ++i) {
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, true,
|
||||
- unsupportedFieldCases[i].keyword,
|
||||
- unsupportedFieldCases[i].value))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceUpdateKeyword(res, true,
|
||||
+ unsupportedFieldCases[i].keyword,
|
||||
+ unsupportedFieldCases[i].value);
|
||||
}
|
||||
|
||||
/* Initialize RW */
|
||||
res->rw = g_steal_pointer(&rw);
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, false, "YA", "tag1")
|
||||
- || STRNEQ(res->rw->asset_tag, "tag1"))
|
||||
+ virPCIVPDResourceUpdateKeyword(res, false, "YA", "tag1");
|
||||
+ if (STRNEQ(res->rw->asset_tag, "tag1"))
|
||||
return -1;
|
||||
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, false, "asset_tag", "tag2")
|
||||
- || STRNEQ(res->rw->asset_tag, "tag2"))
|
||||
+ virPCIVPDResourceUpdateKeyword(res, false, "asset_tag", "tag2");
|
||||
+ if (STRNEQ(res->rw->asset_tag, "tag2"))
|
||||
return -1;
|
||||
|
||||
/* Do a basic system field check. */
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, false, "Y0", "system0"))
|
||||
- return -1;
|
||||
+ virPCIVPDResourceUpdateKeyword(res, false, "Y0", "system0");
|
||||
|
||||
if (res->rw->system_specific->len != 1)
|
||||
return -1;
|
||||
@@ -134,10 +130,12 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
|
||||
/* Make sure unsupported RW keyword updates are not fatal. */
|
||||
for (i = 0; i < numUnsupportedCases; ++i) {
|
||||
- if (!virPCIVPDResourceUpdateKeyword(res, false,
|
||||
- unsupportedFieldCases[i].keyword,
|
||||
- unsupportedFieldCases[i].value))
|
||||
- return -1;
|
||||
+ /* This test is deliberately left in despite
|
||||
+ * virPCIVPDResourceUpdateKeyword always succeeding to prevent
|
||||
+ * possible regressions if the function is ever rewritten */
|
||||
+ virPCIVPDResourceUpdateKeyword(res, false,
|
||||
+ unsupportedFieldCases[i].keyword,
|
||||
+ unsupportedFieldCases[i].value);
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,78 +0,0 @@
|
||||
From 5c7b4d446b4436deef45176daeb33827007a8ef2 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <5c7b4d446b4436deef45176daeb33827007a8ef2.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 17:58:17 +0100
|
||||
Subject: [PATCH] util: virpcivpd: Unexport
|
||||
'virPCIVPDParseVPDLargeResourceString'
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 810a3ca980801a57298c245c65aa558eda5fb9d8)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/libvirt_private.syms | 1 -
|
||||
src/util/virpcivpd.c | 14 +-------------
|
||||
src/util/virpcivpdpriv.h | 3 ---
|
||||
3 files changed, 1 insertion(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
||||
index 89b0d01de6..035f8c7b5d 100644
|
||||
--- a/src/libvirt_private.syms
|
||||
+++ b/src/libvirt_private.syms
|
||||
@@ -3700,7 +3700,6 @@ virVHBAPathExists;
|
||||
# util/virpcivpd.h
|
||||
|
||||
virPCIVPDParse;
|
||||
-virPCIVPDParseVPDLargeResourceString;
|
||||
virPCIVPDResourceCustomCompareIndex;
|
||||
virPCIVPDResourceCustomFree;
|
||||
virPCIVPDResourceCustomUpsertValue;
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 510be65cb6..b303e161ae 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -595,7 +595,7 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
* Returns: a pointer to a VPDResource which needs to be freed by the caller or
|
||||
* NULL if getting it failed for some reason.
|
||||
*/
|
||||
-bool
|
||||
+static bool
|
||||
virPCIVPDParseVPDLargeResourceString(int vpdFileFd, uint16_t resPos,
|
||||
uint16_t resDataLen, uint8_t *csum, virPCIVPDResource *res)
|
||||
{
|
||||
@@ -732,18 +732,6 @@ virPCIVPDParse(int vpdFileFd)
|
||||
|
||||
#else /* ! __linux__ */
|
||||
|
||||
-bool
|
||||
-virPCIVPDParseVPDLargeResourceString(int vpdFileFd G_GNUC_UNUSED,
|
||||
- uint16_t resPos G_GNUC_UNUSED,
|
||||
- uint16_t resDataLen G_GNUC_UNUSED,
|
||||
- uint8_t *csum G_GNUC_UNUSED,
|
||||
- virPCIVPDResource *res G_GNUC_UNUSED)
|
||||
-{
|
||||
- virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
- _("PCI VPD reporting not available on this platform"));
|
||||
- return false;
|
||||
-}
|
||||
-
|
||||
virPCIVPDResource *
|
||||
virPCIVPDParse(int vpdFileFd G_GNUC_UNUSED)
|
||||
{
|
||||
diff --git a/src/util/virpcivpdpriv.h b/src/util/virpcivpdpriv.h
|
||||
index d84f1e9c8a..617991930b 100644
|
||||
--- a/src/util/virpcivpdpriv.h
|
||||
+++ b/src/util/virpcivpdpriv.h
|
||||
@@ -68,6 +68,3 @@ virPCIVPDResourceCustomCompareIndex(virPCIVPDResourceCustom *a, virPCIVPDResourc
|
||||
|
||||
bool
|
||||
virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const value);
|
||||
-
|
||||
-bool virPCIVPDParseVPDLargeResourceString(int vpdFileFd, uint16_t resPos, uint16_t resDataLen,
|
||||
- uint8_t *csum, virPCIVPDResource *res);
|
||||
--
|
||||
2.43.0
|
@ -1,82 +0,0 @@
|
||||
From 225998619d4e6fb87e04d48c74b1320663543312 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <225998619d4e6fb87e04d48c74b1320663543312.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 14:58:52 +0100
|
||||
Subject: [PATCH] util: virpcivpd: Unexport 'virPCIVPDReadVPDBytes'
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The function is no longer used outside of virpcivpd.c
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 4d229ef4404f277004767bec444448fa83e8be99)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/libvirt_private.syms | 1 -
|
||||
src/util/virpcivpd.c | 14 +-------------
|
||||
src/util/virpcivpdpriv.h | 3 ---
|
||||
3 files changed, 1 insertion(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
||||
index fc26109029..dbc4e26d79 100644
|
||||
--- a/src/libvirt_private.syms
|
||||
+++ b/src/libvirt_private.syms
|
||||
@@ -3702,7 +3702,6 @@ virVHBAPathExists;
|
||||
virPCIVPDParse;
|
||||
virPCIVPDParseVPDLargeResourceFields;
|
||||
virPCIVPDParseVPDLargeResourceString;
|
||||
-virPCIVPDReadVPDBytes;
|
||||
virPCIVPDResourceCustomCompareIndex;
|
||||
virPCIVPDResourceCustomFree;
|
||||
virPCIVPDResourceCustomUpsertValue;
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 81c7c317b3..373321a836 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -401,7 +401,7 @@ virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res, const bool readOnly,
|
||||
* descriptor, it is reported and -1 is returned to the caller. If EOF is occurred, 0 is returned
|
||||
* to the caller.
|
||||
*/
|
||||
-size_t
|
||||
+static size_t
|
||||
virPCIVPDReadVPDBytes(int vpdFileFd, uint8_t *buf, size_t count, off_t offset, uint8_t *csum)
|
||||
{
|
||||
ssize_t numRead = pread(vpdFileFd, buf, count, offset);
|
||||
@@ -732,18 +732,6 @@ virPCIVPDParse(int vpdFileFd)
|
||||
|
||||
#else /* ! __linux__ */
|
||||
|
||||
-size_t
|
||||
-virPCIVPDReadVPDBytes(int vpdFileFd G_GNUC_UNUSED,
|
||||
- uint8_t *buf G_GNUC_UNUSED,
|
||||
- size_t count G_GNUC_UNUSED,
|
||||
- off_t offset G_GNUC_UNUSED,
|
||||
- uint8_t *csum G_GNUC_UNUSED)
|
||||
-{
|
||||
- virReportError(VIR_ERR_NO_SUPPORT, "%s",
|
||||
- _("PCI VPD reporting not available on this platform"));
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
bool
|
||||
virPCIVPDParseVPDLargeResourceString(int vpdFileFd G_GNUC_UNUSED,
|
||||
uint16_t resPos G_GNUC_UNUSED,
|
||||
diff --git a/src/util/virpcivpdpriv.h b/src/util/virpcivpdpriv.h
|
||||
index 0f565f81ae..17e6e14ab7 100644
|
||||
--- a/src/util/virpcivpdpriv.h
|
||||
+++ b/src/util/virpcivpdpriv.h
|
||||
@@ -69,9 +69,6 @@ virPCIVPDResourceCustomCompareIndex(virPCIVPDResourceCustom *a, virPCIVPDResourc
|
||||
bool
|
||||
virPCIVPDResourceCustomUpsertValue(GPtrArray *arr, char index, const char *const value);
|
||||
|
||||
-size_t
|
||||
-virPCIVPDReadVPDBytes(int vpdFileFd, uint8_t *buf, size_t count, off_t offset, uint8_t *csum);
|
||||
-
|
||||
bool virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t resDataLen,
|
||||
bool readOnly, uint8_t *csum, virPCIVPDResource *res);
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,64 +0,0 @@
|
||||
From 9f199b64bd22f4f740441bb690d9bd9231e8efc0 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9f199b64bd22f4f740441bb690d9bd9231e8efc0.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 16 Jan 2024 15:10:55 +0100
|
||||
Subject: [PATCH] util: virtportallocator: Add VIR_DEBUG statements for port
|
||||
allocations and release
|
||||
|
||||
Add a few debug statements to be able to trace lifetime of a
|
||||
reserved/allocated port.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
|
||||
(cherry picked from commit 19eaa854386cc5bfc0f9ed15ac2a0937cb3a4421)
|
||||
https://issues.redhat.com/browse/RHEL-21543
|
||||
---
|
||||
src/util/virportallocator.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/src/util/virportallocator.c b/src/util/virportallocator.c
|
||||
index 6d6f99778e..70393d87ee 100644
|
||||
--- a/src/util/virportallocator.c
|
||||
+++ b/src/util/virportallocator.c
|
||||
@@ -29,9 +29,12 @@
|
||||
#include "virthread.h"
|
||||
#include "virerror.h"
|
||||
#include "virutil.h"
|
||||
+#include "virlog.h"
|
||||
|
||||
#define VIR_FROM_THIS VIR_FROM_NONE
|
||||
|
||||
+VIR_LOG_INIT("util.virportallocator");
|
||||
+
|
||||
#define VIR_PORT_ALLOCATOR_NUM_PORTS 65536
|
||||
|
||||
typedef struct _virPortAllocator virPortAllocator;
|
||||
@@ -228,6 +231,8 @@ virPortAllocatorAcquire(const virPortAllocatorRange *range,
|
||||
return -1;
|
||||
}
|
||||
*port = i;
|
||||
+ VIR_DEBUG("port='%u'", *port);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -247,6 +252,8 @@ virPortAllocatorRelease(unsigned short port)
|
||||
if (!pa)
|
||||
return -1;
|
||||
|
||||
+ VIR_DEBUG("port='%u'", port);
|
||||
+
|
||||
if (!port)
|
||||
return 0;
|
||||
|
||||
@@ -265,6 +272,8 @@ virPortAllocatorSetUsed(unsigned short port)
|
||||
if (!pa)
|
||||
return -1;
|
||||
|
||||
+ VIR_DEBUG("port='%u'", port);
|
||||
+
|
||||
if (!port)
|
||||
return 0;
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,94 +0,0 @@
|
||||
From dd11b0a672feb5932548aa72c4db859889401587 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <dd11b0a672feb5932548aa72c4db859889401587.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 17:11:37 +0100
|
||||
Subject: [PATCH] virNodeDeviceCapVPDFormat: Properly escape system-originated
|
||||
strings
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Similarly to previous commit other specific fields which come from the
|
||||
system data and aren't sanitized enough to be safe for XML were also
|
||||
formatted via virBufferAsprintf.
|
||||
|
||||
Other static and safe strings used virBufferEscapeString instead of
|
||||
virBufferAddLit.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 2ccac1e42f34404e3a5af22671a31fa1dca94e94)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
https://issues.redhat.com/browse/RHEL-22400 [9.3.z]
|
||||
https://issues.redhat.com/browse/RHEL-22399 [9.2.z]
|
||||
---
|
||||
src/conf/node_device_conf.c | 32 +++++++++++++-------------------
|
||||
1 file changed, 13 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index 87c046e571..95de77abe9 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -270,14 +270,6 @@ virNodeDeviceCapVPDFormatCustomSystemField(virPCIVPDResourceCustom *field, virBu
|
||||
virNodeDeviceCapVPDFormatCustomField(buf, "system_field", field);
|
||||
}
|
||||
|
||||
-static inline void
|
||||
-virNodeDeviceCapVPDFormatRegularField(virBuffer *buf, const char *keyword, const char *value)
|
||||
-{
|
||||
- if (keyword == NULL || value == NULL)
|
||||
- return;
|
||||
-
|
||||
- virBufferAsprintf(buf, "<%s>%s</%s>\n", keyword, value, keyword);
|
||||
-}
|
||||
|
||||
static void
|
||||
virNodeDeviceCapVPDFormat(virBuffer *buf, virPCIVPDResource *res)
|
||||
@@ -290,31 +282,33 @@ virNodeDeviceCapVPDFormat(virBuffer *buf, virPCIVPDResource *res)
|
||||
virBufferEscapeString(buf, "<name>%s</name>\n", res->name);
|
||||
|
||||
if (res->ro != NULL) {
|
||||
- virBufferEscapeString(buf, "<fields access='%s'>\n", "readonly");
|
||||
-
|
||||
+ virBufferAddLit(buf, "<fields access='readonly'>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
- virNodeDeviceCapVPDFormatRegularField(buf, "change_level", res->ro->change_level);
|
||||
- virNodeDeviceCapVPDFormatRegularField(buf, "manufacture_id", res->ro->manufacture_id);
|
||||
- virNodeDeviceCapVPDFormatRegularField(buf, "part_number", res->ro->part_number);
|
||||
- virNodeDeviceCapVPDFormatRegularField(buf, "serial_number", res->ro->serial_number);
|
||||
+
|
||||
+ virBufferEscapeString(buf, "<change_level>%s</change_level>\n", res->ro->change_level);
|
||||
+ virBufferEscapeString(buf, "<manufacture_id>%s</manufacture_id>\n", res->ro->manufacture_id);
|
||||
+ virBufferEscapeString(buf, "<part_number>%s</part_number>\n", res->ro->part_number);
|
||||
+ virBufferEscapeString(buf, "<serial_number>%s</serial_number>\n", res->ro->serial_number);
|
||||
+
|
||||
g_ptr_array_foreach(res->ro->vendor_specific,
|
||||
(GFunc)virNodeDeviceCapVPDFormatCustomVendorField, buf);
|
||||
- virBufferAdjustIndent(buf, -2);
|
||||
|
||||
+ virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</fields>\n");
|
||||
}
|
||||
|
||||
if (res->rw != NULL) {
|
||||
- virBufferEscapeString(buf, "<fields access='%s'>\n", "readwrite");
|
||||
-
|
||||
+ virBufferAddLit(buf, "<fields access='readwrite'>\n");
|
||||
virBufferAdjustIndent(buf, 2);
|
||||
- virNodeDeviceCapVPDFormatRegularField(buf, "asset_tag", res->rw->asset_tag);
|
||||
+
|
||||
+ virBufferEscapeString(buf, "<asset_tag>%s</asset_tag>\n", res->rw->asset_tag);
|
||||
+
|
||||
g_ptr_array_foreach(res->rw->vendor_specific,
|
||||
(GFunc)virNodeDeviceCapVPDFormatCustomVendorField, buf);
|
||||
g_ptr_array_foreach(res->rw->system_specific,
|
||||
(GFunc)virNodeDeviceCapVPDFormatCustomSystemField, buf);
|
||||
- virBufferAdjustIndent(buf, -2);
|
||||
|
||||
+ virBufferAdjustIndent(buf, -2);
|
||||
virBufferAddLit(buf, "</fields>\n");
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,80 +0,0 @@
|
||||
From 32fe728dafc85c31b34f669b11264967bfc553dd Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <32fe728dafc85c31b34f669b11264967bfc553dd.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 15:15:03 +0100
|
||||
Subject: [PATCH] virNodeDeviceCapVPDFormatCustom*: Escape unsanitized strings
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The custom field data is taken from PCI device data which can contain
|
||||
any printable characters, and thus must be escaped when putting into
|
||||
XML.
|
||||
|
||||
Originally, based on the comment and XML schema which was fixed in
|
||||
previous commits the idea seemed to be that the parser would validate
|
||||
that only characters which don't break the XML would be present but that
|
||||
didn't seem to materialize.
|
||||
|
||||
Switch to proper escaping of the XML.
|
||||
|
||||
Fixes: 3954378d06a
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-22314
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 5373b8c02ce44d0284bc9c60b3b7bc12bff2f867)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
https://issues.redhat.com/browse/RHEL-22400 [9.3.z]
|
||||
https://issues.redhat.com/browse/RHEL-22399 [9.2.z]
|
||||
---
|
||||
src/conf/node_device_conf.c | 25 +++++++++++++++++--------
|
||||
1 file changed, 17 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index 4826be6f42..87c046e571 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -242,23 +242,32 @@ virNodeDeviceCapMdevTypesFormat(virBuffer *buf,
|
||||
}
|
||||
|
||||
static void
|
||||
-virNodeDeviceCapVPDFormatCustomVendorField(virPCIVPDResourceCustom *field, virBuffer *buf)
|
||||
+virNodeDeviceCapVPDFormatCustomField(virBuffer *buf,
|
||||
+ const char *fieldtype,
|
||||
+ virPCIVPDResourceCustom *field)
|
||||
{
|
||||
+ g_auto(virBuffer) attrBuf = VIR_BUFFER_INITIALIZER;
|
||||
+ g_auto(virBuffer) content = VIR_BUFFER_INITIALIZER;
|
||||
+
|
||||
if (field == NULL || field->value == NULL)
|
||||
return;
|
||||
|
||||
- virBufferAsprintf(buf, "<vendor_field index='%c'>%s</vendor_field>\n", field->idx,
|
||||
- field->value);
|
||||
+ virBufferAsprintf(&attrBuf, " index='%c'", field->idx);
|
||||
+ virBufferEscapeString(&content, "%s", field->value);
|
||||
+
|
||||
+ virXMLFormatElementInternal(buf, fieldtype, &attrBuf, &content, false, false);
|
||||
}
|
||||
|
||||
static void
|
||||
-virNodeDeviceCapVPDFormatCustomSystemField(virPCIVPDResourceCustom *field, virBuffer *buf)
|
||||
+virNodeDeviceCapVPDFormatCustomVendorField(virPCIVPDResourceCustom *field, virBuffer *buf)
|
||||
{
|
||||
- if (field == NULL || field->value == NULL)
|
||||
- return;
|
||||
+ virNodeDeviceCapVPDFormatCustomField(buf, "vendor_field", field);
|
||||
+}
|
||||
|
||||
- virBufferAsprintf(buf, "<system_field index='%c'>%s</system_field>\n", field->idx,
|
||||
- field->value);
|
||||
+static void
|
||||
+virNodeDeviceCapVPDFormatCustomSystemField(virPCIVPDResourceCustom *field, virBuffer *buf)
|
||||
+{
|
||||
+ virNodeDeviceCapVPDFormatCustomField(buf, "system_field", field);
|
||||
}
|
||||
|
||||
static inline void
|
||||
--
|
||||
2.43.0
|
@ -1,74 +0,0 @@
|
||||
From 9de66ba6bd07c0c5d674be4dadec1f83a39d1533 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9de66ba6bd07c0c5d674be4dadec1f83a39d1533.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 17:41:44 +0100
|
||||
Subject: [PATCH] virNodeDeviceCapVPDParseXML: Fix error reporting
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Don't overwrite already reported errors and improve parsing of
|
||||
attributes.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit dd36db2607e40d0df986108224563295b79d969c)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/conf/node_device_conf.c | 22 +++++++---------------
|
||||
1 file changed, 7 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index 0f2c341967..c68ac3af78 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -1059,11 +1059,11 @@ virNodeDeviceCapVPDParseXML(xmlXPathContextPtr ctxt, virPCIVPDResource **res)
|
||||
|
||||
if (!(newres->name = virXPathString("string(./name)", ctxt))) {
|
||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("Could not read a device name from the <name> element"));
|
||||
+ _("Could not read a device name from the <name> element"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
- if ((nfields = virXPathNodeSet("./fields[@access]", ctxt, &nodes)) < 0)
|
||||
+ if ((nfields = virXPathNodeSet("./fields", ctxt, &nodes)) < 0)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < nfields; i++) {
|
||||
@@ -1071,27 +1071,19 @@ virNodeDeviceCapVPDParseXML(xmlXPathContextPtr ctxt, virPCIVPDResource **res)
|
||||
VIR_XPATH_NODE_AUTORESTORE(ctxt);
|
||||
|
||||
ctxt->node = nodes[i];
|
||||
- if (!(access = virXPathString("string(./@access[1])", ctxt))) {
|
||||
- virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||
- _("VPD fields access type parsing has failed"));
|
||||
+
|
||||
+ if (!(access = virXMLPropStringRequired(nodes[i], "access")))
|
||||
return -1;
|
||||
- }
|
||||
|
||||
if (STREQ(access, "readonly")) {
|
||||
- if (virNodeDeviceCapVPDParseReadOnlyFields(ctxt, newres) < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("Could not parse %1$s VPD resource fields"), access);
|
||||
+ if (virNodeDeviceCapVPDParseReadOnlyFields(ctxt, newres) < 0)
|
||||
return -1;
|
||||
- }
|
||||
} else if (STREQ(access, "readwrite")) {
|
||||
- if (virNodeDeviceCapVPDParseReadWriteFields(ctxt, newres) < 0) {
|
||||
- virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("Could not parse %1$s VPD resource fields"), access);
|
||||
+ if (virNodeDeviceCapVPDParseReadWriteFields(ctxt, newres) < 0)
|
||||
return -1;
|
||||
- }
|
||||
} else {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
- _("Unsupported VPD field access type specified %1$s"),
|
||||
+ _("Unsupported VPD field access type '%1$s'"),
|
||||
access);
|
||||
return -1;
|
||||
}
|
||||
--
|
||||
2.43.0
|
@ -1,69 +0,0 @@
|
||||
From b025fc09fc5eff84bacea27f99837a013f810d60 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b025fc09fc5eff84bacea27f99837a013f810d60.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 16:59:20 +0100
|
||||
Subject: [PATCH] virPCIDeviceGetVPD: Fix multiple error handling bugs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- fix passing of 'errno' to 'virReportSystemError'
|
||||
|
||||
The 'open' syscall returns '-1' and sets 'errno' on failure. The code
|
||||
passed '-fd' as 'errno' rather than errno itself, thus always reporting
|
||||
EPERM.
|
||||
|
||||
- don't overwrite errors when closing FD
|
||||
|
||||
Use VIR_AUTOCLOSE to avoid overwriting the errors from virPCIVPDParse.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit bac86dd36e2c8c56e3d5678a94fc69f8e41a7d35)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpci.c | 19 ++++++-------------
|
||||
1 file changed, 6 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpci.c b/src/util/virpci.c
|
||||
index 99e6e6cbb1..780b4f9eec 100644
|
||||
--- a/src/util/virpci.c
|
||||
+++ b/src/util/virpci.c
|
||||
@@ -3103,28 +3103,21 @@ virPCIDeviceHasVPD(virPCIDevice *dev)
|
||||
virPCIVPDResource *
|
||||
virPCIDeviceGetVPD(virPCIDevice *dev)
|
||||
{
|
||||
- g_autofree char *vpdPath = NULL;
|
||||
- int fd;
|
||||
- g_autoptr(virPCIVPDResource) res = NULL;
|
||||
+ g_autofree char *vpdPath = virPCIFile(dev->name, "vpd");
|
||||
+ VIR_AUTOCLOSE fd = -1;
|
||||
|
||||
- vpdPath = virPCIFile(dev->name, "vpd");
|
||||
if (!virPCIDeviceHasVPD(dev)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, _("Device %1$s does not have a VPD"),
|
||||
- virPCIDeviceGetName(dev));
|
||||
- return NULL;
|
||||
- }
|
||||
- if ((fd = open(vpdPath, O_RDONLY)) < 0) {
|
||||
- virReportSystemError(-fd, _("Failed to open a VPD file '%1$s'"), vpdPath);
|
||||
+ virPCIDeviceGetName(dev));
|
||||
return NULL;
|
||||
}
|
||||
- res = virPCIVPDParse(fd);
|
||||
|
||||
- if (VIR_CLOSE(fd) < 0) {
|
||||
- virReportSystemError(errno, _("Unable to close the VPD file, fd: %1$d"), fd);
|
||||
+ if ((fd = open(vpdPath, O_RDONLY)) < 0) {
|
||||
+ virReportSystemError(errno, _("Failed to open a VPD file '%1$s'"), vpdPath);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- return g_steal_pointer(&res);
|
||||
+ return virPCIVPDParse(fd);
|
||||
}
|
||||
|
||||
#else
|
||||
--
|
||||
2.43.0
|
@ -1,52 +0,0 @@
|
||||
From 1af80ce930b188e4410f66bdfee71ca91e38d5a3 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <1af80ce930b188e4410f66bdfee71ca91e38d5a3.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 22:32:33 +0100
|
||||
Subject: [PATCH] virPCIDeviceGetVPD: Handle errors in callers
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Until now 'virPCIDeviceGetVPD' couldn't reallistically raise an error,
|
||||
but that will change. Handle the errors by either resetting it if we'd
|
||||
be ignoring it or forward it.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit e1dc851e7cbc4a525b095b0dd4fdc779a882b19c)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/conf/node_device_conf.c | 2 ++
|
||||
tests/virpcitest.c | 3 ++-
|
||||
2 files changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
|
||||
index c68ac3af78..b8c91d6ecd 100644
|
||||
--- a/src/conf/node_device_conf.c
|
||||
+++ b/src/conf/node_device_conf.c
|
||||
@@ -3052,6 +3052,8 @@ virNodeDeviceGetPCIVPDDynamicCap(virNodeDevCapPCIDev *devCapPCIDev)
|
||||
if ((res = virPCIDeviceGetVPD(pciDev))) {
|
||||
devCapPCIDev->flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VPD;
|
||||
devCapPCIDev->vpd = g_steal_pointer(&res);
|
||||
+ } else {
|
||||
+ virResetLastError();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
diff --git a/tests/virpcitest.c b/tests/virpcitest.c
|
||||
index d69a1b5118..017c283a44 100644
|
||||
--- a/tests/virpcitest.c
|
||||
+++ b/tests/virpcitest.c
|
||||
@@ -344,7 +344,8 @@ testVirPCIDeviceGetVPD(const void *opaque)
|
||||
if (!dev)
|
||||
return -1;
|
||||
|
||||
- res = virPCIDeviceGetVPD(dev);
|
||||
+ if (!(res = virPCIDeviceGetVPD(dev)))
|
||||
+ return -1;
|
||||
|
||||
/* Only basic checks - full parser validation is done elsewhere. */
|
||||
if (res->ro == NULL)
|
||||
--
|
||||
2.43.0
|
@ -1,52 +0,0 @@
|
||||
From ca12c899e642a82525e038df818ade15142de02f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <ca12c899e642a82525e038df818ade15142de02f.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 16:53:27 +0100
|
||||
Subject: [PATCH] virPCIDeviceHasVPD: Refactor "debug" messages
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
A checker function should not raise VIR_INFO or VIR_WARN messages
|
||||
especially if they contain information useful only for debugging.
|
||||
|
||||
Turn the message into a VIR_DEBUG with universal meaning.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 3ca1079318b8047a32ae05e1c6e5fb2dac9fc719)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpci.c | 15 +++++----------
|
||||
1 file changed, 5 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpci.c b/src/util/virpci.c
|
||||
index 6c04e57038..99e6e6cbb1 100644
|
||||
--- a/src/util/virpci.c
|
||||
+++ b/src/util/virpci.c
|
||||
@@ -3081,17 +3081,12 @@ virPCIGetVirtualFunctionInfo(const char *vf_sysfs_device_path,
|
||||
bool
|
||||
virPCIDeviceHasVPD(virPCIDevice *dev)
|
||||
{
|
||||
- g_autofree char *vpdPath = NULL;
|
||||
+ g_autofree char *vpdPath = virPCIFile(dev->name, "vpd");
|
||||
+ bool ret = virFileIsRegular(vpdPath);
|
||||
|
||||
- vpdPath = virPCIFile(dev->name, "vpd");
|
||||
- if (!virFileExists(vpdPath)) {
|
||||
- VIR_INFO("Device VPD file does not exist %s", vpdPath);
|
||||
- return false;
|
||||
- } else if (!virFileIsRegular(vpdPath)) {
|
||||
- VIR_WARN("VPD path does not point to a regular file %s", vpdPath);
|
||||
- return false;
|
||||
- }
|
||||
- return true;
|
||||
+ VIR_DEBUG("path='%s', exists='%d'", vpdPath, ret);
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.43.0
|
@ -1,101 +0,0 @@
|
||||
From b94d438cdd0c7a91885c204fdddece35b27bcccb Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b94d438cdd0c7a91885c204fdddece35b27bcccb.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 17:12:43 +0100
|
||||
Subject: [PATCH] virPCIVPDParse: Do reasonable error reporting
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Remove the wannabe error reporting via 'VIR_DEBUG/VIR_INFO' in favor of
|
||||
proper errors.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit f85a382a0e709afea3a4021de593b1679553a35a)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 36 ++++++++++++++++++------------------
|
||||
1 file changed, 18 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 4a440c2aea..16df468875 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -616,7 +616,7 @@ virPCIVPDParse(int vpdFileFd)
|
||||
|
||||
uint16_t resPos = 0, resDataLen;
|
||||
uint8_t tag = 0;
|
||||
- bool endResReached = false, hasReadOnly = false;
|
||||
+ bool hasReadOnly = false;
|
||||
|
||||
g_autoptr(virPCIVPDResource) res = g_new0(virPCIVPDResource, 1);
|
||||
|
||||
@@ -628,9 +628,8 @@ virPCIVPDParse(int vpdFileFd)
|
||||
/* 0x80 == 0b10000000 - the large resource data type flag. */
|
||||
if (tag & PCI_VPD_LARGE_RESOURCE_FLAG) {
|
||||
if (resPos > PCI_VPD_ADDR_MASK + 1 - 3) {
|
||||
- /* Bail if the large resource starts at the position
|
||||
- * where the end tag should be. */
|
||||
- break;
|
||||
+ /* Bail if the large resource starts at the position where the end tag should be. */
|
||||
+ goto malformed;
|
||||
}
|
||||
|
||||
/* Read the two length bytes of the large resource record. */
|
||||
@@ -649,14 +648,21 @@ virPCIVPDParse(int vpdFileFd)
|
||||
/* Change the position to the byte past the byte containing tag and length bits. */
|
||||
resPos += 1;
|
||||
}
|
||||
+
|
||||
if (tag == PCI_VPD_RESOURCE_END_TAG) {
|
||||
/* Stop VPD traversal since the end tag was encountered. */
|
||||
- endResReached = true;
|
||||
- break;
|
||||
+ if (!hasReadOnly) {
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: missing read-only section"));
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ return g_steal_pointer(&res);
|
||||
}
|
||||
+
|
||||
if (resDataLen > PCI_VPD_ADDR_MASK + 1 - resPos) {
|
||||
/* Bail if the resource is too long to fit into the VPD address space. */
|
||||
- break;
|
||||
+ goto malformed;
|
||||
}
|
||||
|
||||
switch (tag) {
|
||||
@@ -686,22 +692,16 @@ virPCIVPDParse(int vpdFileFd)
|
||||
/* While we cannot parse unknown resource types, they can still be skipped
|
||||
* based on the header and data length. */
|
||||
VIR_DEBUG("Encountered an unexpected VPD resource tag: %#x", tag);
|
||||
- resPos += resDataLen;
|
||||
- continue;
|
||||
}
|
||||
|
||||
/* Continue processing other resource records. */
|
||||
resPos += resDataLen;
|
||||
}
|
||||
- if (!hasReadOnly) {
|
||||
- VIR_DEBUG("Encountered an invalid VPD: does not have a VPD-R record");
|
||||
- return NULL;
|
||||
- } else if (!endResReached) {
|
||||
- /* Does not have an end tag. */
|
||||
- VIR_DEBUG("Encountered an invalid VPD");
|
||||
- return NULL;
|
||||
- }
|
||||
- return g_steal_pointer(&res);
|
||||
+
|
||||
+ malformed:
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: malformed data"));
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
#else /* ! __linux__ */
|
||||
--
|
||||
2.43.0
|
@ -1,65 +0,0 @@
|
||||
From 9f0e2b76c89b692aa935c76f9d21012c50e4575d Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9f0e2b76c89b692aa935c76f9d21012c50e4575d.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 15:02:39 +0100
|
||||
Subject: [PATCH] virPCIVPDParseVPDLargeResourceFields: Merge logic conditions
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Merge the pre-checks with the 'switch' statement which is operating on
|
||||
the same values to simplify further refactoring.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 037803a949cfe60c03824482f889cc315bb7b788)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 24 ++++++++++++++----------
|
||||
1 file changed, 14 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index ddd79fa8bc..ba05014e40 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -438,23 +438,27 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
fieldKeyword = g_strndup((char *)buf, 2);
|
||||
fieldFormat = virPCIVPDResourceGetFieldValueFormat(fieldKeyword);
|
||||
|
||||
- /* Handle special cases first */
|
||||
- if (!readOnly && fieldFormat == VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD) {
|
||||
- VIR_INFO("Unexpected RV keyword in the read-write section.");
|
||||
- return false;
|
||||
- } else if (readOnly && fieldFormat == VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR) {
|
||||
- VIR_INFO("Unexpected RW keyword in the read-only section.");
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
/* Determine how many bytes to read per field value type. */
|
||||
switch (fieldFormat) {
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_TEXT:
|
||||
- case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR:
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_BINARY:
|
||||
bytesToRead = fieldDataLen;
|
||||
break;
|
||||
+
|
||||
+ case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR:
|
||||
+ if (readOnly) {
|
||||
+ VIR_INFO("Unexpected RW keyword in the read-only section.");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ bytesToRead = fieldDataLen;
|
||||
+ break;
|
||||
+
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD:
|
||||
+ if (!readOnly) {
|
||||
+ VIR_INFO("Unexpected RV keyword in the read-write section.");
|
||||
+ return false;
|
||||
+ }
|
||||
/* Only need one byte to be read and accounted towards
|
||||
* the checksum calculation. */
|
||||
bytesToRead = 1;
|
||||
--
|
||||
2.43.0
|
@ -1,108 +0,0 @@
|
||||
From 3c987a4fb4a4e96bd4a9af04e43862d96169767e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <3c987a4fb4a4e96bd4a9af04e43862d96169767e.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 15:14:49 +0100
|
||||
Subject: [PATCH] virPCIVPDParseVPDLargeResourceFields: Refactor processing of
|
||||
read data
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Use a 'switch' statement instead of a bunch of if/elseif statements.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 378b82dac2f7bb7f20e32c4f0f8db49ff5f36851)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 66 +++++++++++++++++++++++++-------------------
|
||||
1 file changed, 37 insertions(+), 29 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 25c4c2c5ec..60e520c46f 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -485,36 +485,43 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
/* Advance the position to the first byte of the next field. */
|
||||
fieldPos += fieldDataLen;
|
||||
|
||||
- if (fieldFormat == VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_TEXT) {
|
||||
- /* Trim whitespace around a retrieved value and set it to be a field's value. Cases
|
||||
- * where unnecessary whitespace was present around a field value have been encountered
|
||||
- * in the wild.
|
||||
- */
|
||||
- fieldValue = g_strstrip(g_strndup((char *)buf, fieldDataLen));
|
||||
- if (!virPCIVPDResourceIsValidTextValue(fieldValue)) {
|
||||
- /* Skip fields with invalid values - this is safe assuming field length is
|
||||
- * correctly specified. */
|
||||
- VIR_DEBUG("A value for field %s contains invalid characters", fieldKeyword);
|
||||
+ switch (fieldFormat) {
|
||||
+ case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_TEXT:
|
||||
+ /* Trim whitespace around a retrieved value and set it to be a field's value. Cases
|
||||
+ * where unnecessary whitespace was present around a field value have been encountered
|
||||
+ * in the wild.
|
||||
+ */
|
||||
+ fieldValue = g_strstrip(g_strndup((char *)buf, fieldDataLen));
|
||||
+ if (!virPCIVPDResourceIsValidTextValue(fieldValue)) {
|
||||
+ /* Skip fields with invalid values - this is safe assuming field length is
|
||||
+ * correctly specified. */
|
||||
+ VIR_DEBUG("A value for field %s contains invalid characters", fieldKeyword);
|
||||
+ continue;
|
||||
+ }
|
||||
+ break;
|
||||
+
|
||||
+ case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_BINARY:
|
||||
+ fieldValue = g_malloc(fieldDataLen);
|
||||
+ memcpy(fieldValue, buf, fieldDataLen);
|
||||
+ break;
|
||||
+
|
||||
+ case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR:
|
||||
+ /* Skip the read-write space since it is used for indication only. */
|
||||
+ hasRW = true;
|
||||
+ goto done;
|
||||
+
|
||||
+ case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD:
|
||||
+ if (*csum) {
|
||||
+ /* All bytes up to and including the checksum byte should add up to 0. */
|
||||
+ VIR_INFO("Checksum validation has failed");
|
||||
+ return false;
|
||||
+ }
|
||||
+ hasChecksum = true;
|
||||
+ goto done;
|
||||
+
|
||||
+ case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_LAST:
|
||||
+ /* Skip unknown fields */
|
||||
continue;
|
||||
- }
|
||||
- } else if (fieldFormat == VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD) {
|
||||
- if (*csum) {
|
||||
- /* All bytes up to and including the checksum byte should add up to 0. */
|
||||
- VIR_INFO("Checksum validation has failed");
|
||||
- return false;
|
||||
- }
|
||||
- hasChecksum = true;
|
||||
- break;
|
||||
- } else if (fieldFormat == VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR) {
|
||||
- /* Skip the read-write space since it is used for indication only. */
|
||||
- hasRW = true;
|
||||
- break;
|
||||
- } else if (fieldFormat == VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_LAST) {
|
||||
- /* Skip unknown fields */
|
||||
- continue;
|
||||
- } else {
|
||||
- fieldValue = g_malloc(fieldDataLen);
|
||||
- memcpy(fieldValue, buf, fieldDataLen);
|
||||
}
|
||||
|
||||
if (readOnly) {
|
||||
@@ -528,6 +535,7 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
virPCIVPDResourceUpdateKeyword(res, readOnly, fieldKeyword, fieldValue);
|
||||
}
|
||||
|
||||
+ done:
|
||||
/* May have exited the loop prematurely in case RV or RW were encountered and
|
||||
* they were not the last fields in the section. */
|
||||
endReached = (fieldPos >= resPos + resDataLen);
|
||||
--
|
||||
2.43.0
|
@ -1,105 +0,0 @@
|
||||
From 72da25da974a1fa9d995b46afb76714d56f4cb9b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <72da25da974a1fa9d995b46afb76714d56f4cb9b.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 16:45:39 +0100
|
||||
Subject: [PATCH] virPCIVPDParseVPDLargeResourceFields: Refactor return logic
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Rewrite the conditions after exiting the parser so that they are easier
|
||||
to understand. This partially decreases the granularity of "error"
|
||||
messages as they are not strictly necessary albeit for debugging.
|
||||
|
||||
As it was already observed in this code the logic itself often does
|
||||
something else than the comment claims, thus the code logic is
|
||||
preserved.
|
||||
|
||||
Changes:
|
||||
- any case when not all data was processed is aggregated together and
|
||||
gets a common "error" message
|
||||
- absence of 'checksum' field is checked separately
|
||||
- helper variables are removed as they are no longer needed
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit a352bcf1c64e4efaa31ff5b193ff8ff4ca9d1329)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 32 +++++++++++++-------------------
|
||||
1 file changed, 13 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 60e520c46f..be19f7b747 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -415,10 +415,7 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
g_autofree uint8_t *buf = g_malloc0(PCI_VPD_MAX_FIELD_SIZE + 1);
|
||||
uint16_t fieldDataLen = 0, bytesToRead = 0;
|
||||
uint16_t fieldPos = resPos;
|
||||
-
|
||||
bool hasChecksum = false;
|
||||
- bool hasRW = false;
|
||||
- bool endReached = false;
|
||||
|
||||
/* Note the equal sign - fields may have a zero length in which case they will
|
||||
* just occupy 3 header bytes. In the in case of the RW field this may mean that
|
||||
@@ -507,7 +504,9 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR:
|
||||
/* Skip the read-write space since it is used for indication only. */
|
||||
- hasRW = true;
|
||||
+ /* The lack of RW is allowed on purpose in the read-write section since some vendors
|
||||
+ * violate the PCI/PCIe specs and do not include it, however, this does not prevent parsing
|
||||
+ * of valid data. */
|
||||
goto done;
|
||||
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD:
|
||||
@@ -531,6 +530,7 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
if (!res->rw)
|
||||
res->rw = virPCIVPDResourceRWNew();
|
||||
}
|
||||
+
|
||||
/* The field format, keyword and value are determined. Attempt to update the resource. */
|
||||
virPCIVPDResourceUpdateKeyword(res, readOnly, fieldKeyword, fieldValue);
|
||||
}
|
||||
@@ -538,27 +538,21 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
done:
|
||||
/* May have exited the loop prematurely in case RV or RW were encountered and
|
||||
* they were not the last fields in the section. */
|
||||
- endReached = (fieldPos >= resPos + resDataLen);
|
||||
- if (readOnly && !(hasChecksum && endReached)) {
|
||||
- VIR_DEBUG("VPD-R does not contain the mandatory RV field as the last field");
|
||||
+ if ((fieldPos < resPos + resDataLen)) {
|
||||
+ /* unparsed data still present */
|
||||
+ VIR_DEBUG("PCI VPD data parsing failed");
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ if (readOnly && !hasChecksum) {
|
||||
+ VIR_DEBUG("VPD-R does not contain the mandatory checksum");
|
||||
return false;
|
||||
- } else if (!readOnly && !endReached) {
|
||||
- /* The lack of RW is allowed on purpose in the read-write section since some vendors
|
||||
- * violate the PCI/PCIe specs and do not include it, however, this does not prevent parsing
|
||||
- * of valid data. If the RW is present, however, we make sure it is the last field in
|
||||
- * the read-write section. */
|
||||
- if (hasRW) {
|
||||
- VIR_DEBUG("VPD-W section parsing ended prematurely (RW is not the last field).");
|
||||
- return false;
|
||||
- } else {
|
||||
- VIR_DEBUG("VPD-W section parsing ended prematurely.");
|
||||
- return false;
|
||||
- }
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+
|
||||
/**
|
||||
* virPCIVPDParseVPDLargeResourceString:
|
||||
* @vpdFileFd: A file descriptor associated with a file containing PCI device VPD.
|
||||
--
|
||||
2.43.0
|
@ -1,38 +0,0 @@
|
||||
From deaf496dc41a0108a77aca108d6365021e9c5ad0 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <deaf496dc41a0108a77aca108d6365021e9c5ad0.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 15:05:20 +0100
|
||||
Subject: [PATCH] virPCIVPDParseVPDLargeResourceFields: Remove impossible
|
||||
'default' switch case
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The 'fieldFormat' variable is guaranteed to have only the proper enum
|
||||
values by virPCIVPDResourceGetFieldValueFormat.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit f1deac9635352f39fdf26e5d6bc2051f787149c9)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index ba05014e40..25c4c2c5ec 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -470,9 +470,6 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
VIR_DEBUG("Could not determine a field value format for keyword: %s", fieldKeyword);
|
||||
bytesToRead = fieldDataLen;
|
||||
break;
|
||||
- default:
|
||||
- VIR_INFO("Unexpected field value format encountered.");
|
||||
- return false;
|
||||
}
|
||||
|
||||
if (resPos + resDataLen < fieldPos + fieldDataLen) {
|
||||
--
|
||||
2.43.0
|
@ -1,189 +0,0 @@
|
||||
From 22f89f5d9f59e0636cc10d9d86687cf369f58627 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <22f89f5d9f59e0636cc10d9d86687cf369f58627.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Tue, 30 Jan 2024 16:55:50 +0100
|
||||
Subject: [PATCH] virPCIVPDParseVPDLargeResourceFields: Report proper errors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The code abused 'VIR_INFO' as an attempt at error reporting. Rework the
|
||||
code to return the usual 0/-1 and raise proper errors.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit dfc85658bd00323d6d006ab78dc6e346cafa5ed5)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 67 +++++++++++++++++++++++---------------------
|
||||
1 file changed, 35 insertions(+), 32 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index be19f7b747..4a440c2aea 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -404,12 +404,15 @@ virPCIVPDReadVPDBytes(int vpdFileFd,
|
||||
* @csum: A pointer to a 1-byte checksum.
|
||||
* @res: A pointer to virPCIVPDResource.
|
||||
*
|
||||
- * Returns: a pointer to a VPDResource which needs to be freed by the caller or
|
||||
- * NULL if getting it failed for some reason.
|
||||
+ * Returns 0 if the field was parsed sucessfully; -1 on error
|
||||
*/
|
||||
-static bool
|
||||
-virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t resDataLen,
|
||||
- bool readOnly, uint8_t *csum, virPCIVPDResource *res)
|
||||
+static int
|
||||
+virPCIVPDParseVPDLargeResourceFields(int vpdFileFd,
|
||||
+ uint16_t resPos,
|
||||
+ uint16_t resDataLen,
|
||||
+ bool readOnly,
|
||||
+ uint8_t *csum,
|
||||
+ virPCIVPDResource *res)
|
||||
{
|
||||
/* A buffer of up to one resource record field size (plus a zero byte) is needed. */
|
||||
g_autofree uint8_t *buf = g_malloc0(PCI_VPD_MAX_FIELD_SIZE + 1);
|
||||
@@ -427,7 +430,7 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
|
||||
/* Keyword resources consist of keywords (2 ASCII bytes per the spec) and 1-byte length. */
|
||||
if (virPCIVPDReadVPDBytes(vpdFileFd, buf, 3, fieldPos, csum) < 0)
|
||||
- return false;
|
||||
+ return -1;
|
||||
|
||||
fieldDataLen = buf[2];
|
||||
/* Change the position to the field's data portion skipping the keyword and length bytes. */
|
||||
@@ -444,8 +447,9 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RDWR:
|
||||
if (readOnly) {
|
||||
- VIR_INFO("Unexpected RW keyword in the read-only section.");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: unexpected RW keyword in read-only section"));
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
bytesToRead = fieldDataLen;
|
||||
@@ -453,8 +457,9 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD:
|
||||
if (!readOnly) {
|
||||
- VIR_INFO("Unexpected RV keyword in the read-write section.");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: unexpected RV keyword in read-write section"));
|
||||
+ return -1;
|
||||
}
|
||||
/* Only need one byte to be read and accounted towards
|
||||
* the checksum calculation. */
|
||||
@@ -472,12 +477,13 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
if (resPos + resDataLen < fieldPos + fieldDataLen) {
|
||||
/* In this case the field cannot simply be skipped since the position of the
|
||||
* next field is determined based on the length of a previous field. */
|
||||
- VIR_INFO("A field data length violates the resource length boundary.");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: data field length invalid"));
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (virPCIVPDReadVPDBytes(vpdFileFd, buf, bytesToRead, fieldPos, csum) < 0)
|
||||
- return false;
|
||||
+ return -1;
|
||||
|
||||
/* Advance the position to the first byte of the next field. */
|
||||
fieldPos += fieldDataLen;
|
||||
@@ -492,7 +498,6 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
if (!virPCIVPDResourceIsValidTextValue(fieldValue)) {
|
||||
/* Skip fields with invalid values - this is safe assuming field length is
|
||||
* correctly specified. */
|
||||
- VIR_DEBUG("A value for field %s contains invalid characters", fieldKeyword);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
@@ -512,8 +517,9 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
case VIR_PCI_VPD_RESOURCE_FIELD_VALUE_FORMAT_RESVD:
|
||||
if (*csum) {
|
||||
/* All bytes up to and including the checksum byte should add up to 0. */
|
||||
- VIR_INFO("Checksum validation has failed");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: invalid checksum"));
|
||||
+ return -1;
|
||||
}
|
||||
hasChecksum = true;
|
||||
goto done;
|
||||
@@ -540,16 +546,18 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
* they were not the last fields in the section. */
|
||||
if ((fieldPos < resPos + resDataLen)) {
|
||||
/* unparsed data still present */
|
||||
- VIR_DEBUG("PCI VPD data parsing failed");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: parsing ended prematurely"));
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
if (readOnly && !hasChecksum) {
|
||||
- VIR_DEBUG("VPD-R does not contain the mandatory checksum");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data: missing mandatory checksum"));
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
- return true;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -606,7 +614,6 @@ virPCIVPDParse(int vpdFileFd)
|
||||
uint8_t csum = 0;
|
||||
uint8_t headerBuf[2];
|
||||
|
||||
- bool isWellFormed = false;
|
||||
uint16_t resPos = 0, resDataLen;
|
||||
uint8_t tag = 0;
|
||||
bool endResReached = false, hasReadOnly = false;
|
||||
@@ -659,20 +666,21 @@ virPCIVPDParse(int vpdFileFd)
|
||||
&csum, res) < 0)
|
||||
return NULL;
|
||||
|
||||
- isWellFormed = true;
|
||||
break;
|
||||
/* Large resource type which is also a VPD-R: 0x80 | 0x10 == 0x90 */
|
||||
case PCI_VPD_LARGE_RESOURCE_FLAG | PCI_VPD_READ_ONLY_LARGE_RESOURCE_FLAG:
|
||||
- isWellFormed = virPCIVPDParseVPDLargeResourceFields(vpdFileFd, resPos,
|
||||
- resDataLen, true, &csum, res);
|
||||
+ if (virPCIVPDParseVPDLargeResourceFields(vpdFileFd, resPos,
|
||||
+ resDataLen, true, &csum, res) < 0)
|
||||
+ return NULL;
|
||||
/* Encountered the VPD-R tag. The resource record parsing also validates
|
||||
* the presence of the required checksum in the RV field. */
|
||||
hasReadOnly = true;
|
||||
break;
|
||||
/* Large resource type which is also a VPD-W: 0x80 | 0x11 == 0x91 */
|
||||
case PCI_VPD_LARGE_RESOURCE_FLAG | PCI_VPD_READ_WRITE_LARGE_RESOURCE_FLAG:
|
||||
- isWellFormed = virPCIVPDParseVPDLargeResourceFields(vpdFileFd, resPos, resDataLen,
|
||||
- false, &csum, res);
|
||||
+ if (virPCIVPDParseVPDLargeResourceFields(vpdFileFd, resPos, resDataLen,
|
||||
+ false, &csum, res) < 0)
|
||||
+ return NULL;
|
||||
break;
|
||||
default:
|
||||
/* While we cannot parse unknown resource types, they can still be skipped
|
||||
@@ -682,11 +690,6 @@ virPCIVPDParse(int vpdFileFd)
|
||||
continue;
|
||||
}
|
||||
|
||||
- if (!isWellFormed) {
|
||||
- VIR_DEBUG("Encountered an invalid VPD");
|
||||
- return NULL;
|
||||
- }
|
||||
-
|
||||
/* Continue processing other resource records. */
|
||||
resPos += resDataLen;
|
||||
}
|
||||
--
|
||||
2.43.0
|
@ -1,75 +0,0 @@
|
||||
From 135355109036f6c4e25df72de7d4fa3dc4ab40c1 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <135355109036f6c4e25df72de7d4fa3dc4ab40c1.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 23:42:22 +0100
|
||||
Subject: [PATCH] virPCIVPDParseVPDLargeResourceString: Properly report errors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Replace VIR_INFO being used as form of error reporting with proper
|
||||
virReportError and the usual return values.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit aa5e3cc44934d154714610104623f19f9f6d8bfe)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 21 ++++++++++++---------
|
||||
1 file changed, 12 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 10cabff0b9..ddd79fa8bc 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -557,10 +557,9 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
* @resDataLen: A length of the data portion of a resource.
|
||||
* @csum: A pointer to a 1-byte checksum.
|
||||
*
|
||||
- * Returns: a pointer to a VPDResource which needs to be freed by the caller or
|
||||
- * NULL if getting it failed for some reason.
|
||||
+ * Returns: 0 on success -1 and an error on failure
|
||||
*/
|
||||
-static bool
|
||||
+static int
|
||||
virPCIVPDParseVPDLargeResourceString(int vpdFileFd, uint16_t resPos,
|
||||
uint16_t resDataLen, uint8_t *csum, virPCIVPDResource *res)
|
||||
{
|
||||
@@ -570,15 +569,16 @@ virPCIVPDParseVPDLargeResourceString(int vpdFileFd, uint16_t resPos,
|
||||
g_autofree char *buf = g_malloc0(resDataLen + 1);
|
||||
|
||||
if (virPCIVPDReadVPDBytes(vpdFileFd, (uint8_t *)buf, resDataLen, resPos, csum) < 0)
|
||||
- return false;
|
||||
+ return -1;
|
||||
|
||||
resValue = g_strdup(g_strstrip(buf));
|
||||
if (!virPCIVPDResourceIsValidTextValue(resValue)) {
|
||||
- VIR_INFO("The string resource has invalid characters in its value");
|
||||
- return false;
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to parse PCI VPD string value with invalid characters"));
|
||||
+ return -1;
|
||||
}
|
||||
res->name = g_steal_pointer(&resValue);
|
||||
- return true;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -652,8 +652,11 @@ virPCIVPDParse(int vpdFileFd)
|
||||
switch (tag) {
|
||||
/* Large resource type which is also a string: 0x80 | 0x02 = 0x82 */
|
||||
case PCI_VPD_LARGE_RESOURCE_FLAG | PCI_VPD_STRING_RESOURCE_FLAG:
|
||||
- isWellFormed = virPCIVPDParseVPDLargeResourceString(vpdFileFd, resPos, resDataLen,
|
||||
- &csum, res);
|
||||
+ if (virPCIVPDParseVPDLargeResourceString(vpdFileFd, resPos, resDataLen,
|
||||
+ &csum, res) < 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ isWellFormed = true;
|
||||
break;
|
||||
/* Large resource type which is also a VPD-R: 0x80 | 0x10 == 0x90 */
|
||||
case PCI_VPD_LARGE_RESOURCE_FLAG | PCI_VPD_READ_ONLY_LARGE_RESOURCE_FLAG:
|
||||
--
|
||||
2.43.0
|
@ -1,156 +0,0 @@
|
||||
From 93036f97d3b6da59fadc2aab57401e42e9fc148f Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <93036f97d3b6da59fadc2aab57401e42e9fc148f.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Mon, 29 Jan 2024 23:33:07 +0100
|
||||
Subject: [PATCH] virPCIVPDReadVPDBytes: Refactor error handling
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Each caller was checking that the function read as many bytes as it
|
||||
expected. Move the check inside virPCIVPDReadVPDBytes and make it report
|
||||
a proper error rather than just a combination of VIR_DEBUG inside the
|
||||
function and a random VIR_INFO in the caller.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit c15a495902bab43454341361174c8ba3dadfcdd5)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 73 +++++++++++++++++++++++---------------------
|
||||
1 file changed, 38 insertions(+), 35 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 0021a88f2d..10cabff0b9 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -361,34 +361,40 @@ virPCIVPDResourceUpdateKeyword(virPCIVPDResource *res,
|
||||
* @offset: The offset at which bytes need to be read.
|
||||
* @csum: A pointer to a byte containing the current checksum value. Mutated by this function.
|
||||
*
|
||||
- * Returns: the number of VPD bytes read from the specified file descriptor. The csum value is
|
||||
+ * Returns 0 if exactly @count bytes were read from @vpdFileFd. The csum value is
|
||||
* also modified as bytes are read. If an error occurs while reading data from the VPD file
|
||||
- * descriptor, it is reported and -1 is returned to the caller. If EOF is occurred, 0 is returned
|
||||
- * to the caller.
|
||||
+ * descriptor, it is reported and -1 is returned to the caller.
|
||||
*/
|
||||
-static size_t
|
||||
-virPCIVPDReadVPDBytes(int vpdFileFd, uint8_t *buf, size_t count, off_t offset, uint8_t *csum)
|
||||
+static int
|
||||
+virPCIVPDReadVPDBytes(int vpdFileFd,
|
||||
+ uint8_t *buf,
|
||||
+ size_t count,
|
||||
+ off_t offset,
|
||||
+ uint8_t *csum)
|
||||
{
|
||||
ssize_t numRead = pread(vpdFileFd, buf, count, offset);
|
||||
|
||||
- if (numRead == -1) {
|
||||
- VIR_DEBUG("Unable to read %zu bytes at offset %zd from fd: %d",
|
||||
- count, (ssize_t)offset, vpdFileFd);
|
||||
- } else if (numRead) {
|
||||
- /*
|
||||
- * Update the checksum for every byte read. Per the PCI(e) specs
|
||||
- * the checksum is correct if the sum of all bytes in VPD from
|
||||
- * VPD address 0 up to and including the VPD-R RV field's first
|
||||
- * data byte is zero.
|
||||
- */
|
||||
- while (count--) {
|
||||
- *csum += *buf;
|
||||
- buf++;
|
||||
- }
|
||||
+ if (numRead != count) {
|
||||
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
|
||||
+ _("failed to read the PCI VPD data"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Update the checksum for every byte read. Per the PCI(e) specs
|
||||
+ * the checksum is correct if the sum of all bytes in VPD from
|
||||
+ * VPD address 0 up to and including the VPD-R RV field's first
|
||||
+ * data byte is zero.
|
||||
+ */
|
||||
+ while (count--) {
|
||||
+ *csum += *buf;
|
||||
+ buf++;
|
||||
}
|
||||
- return numRead;
|
||||
+
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
+
|
||||
/**
|
||||
* virPCIVPDParseVPDLargeResourceFields:
|
||||
* @vpdFileFd: A file descriptor associated with a file containing PCI device VPD.
|
||||
@@ -423,12 +429,9 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
g_autofree char *fieldValue = NULL;
|
||||
|
||||
/* Keyword resources consist of keywords (2 ASCII bytes per the spec) and 1-byte length. */
|
||||
- if (virPCIVPDReadVPDBytes(vpdFileFd, buf, 3, fieldPos, csum) != 3) {
|
||||
- /* Invalid field encountered which means the resource itself is invalid too. Report
|
||||
- * That VPD has invalid format and bail. */
|
||||
- VIR_INFO("Could not read a resource field header - VPD has invalid format");
|
||||
+ if (virPCIVPDReadVPDBytes(vpdFileFd, buf, 3, fieldPos, csum) < 0)
|
||||
return false;
|
||||
- }
|
||||
+
|
||||
fieldDataLen = buf[2];
|
||||
/* Change the position to the field's data portion skipping the keyword and length bytes. */
|
||||
fieldPos += 3;
|
||||
@@ -474,10 +477,10 @@ virPCIVPDParseVPDLargeResourceFields(int vpdFileFd, uint16_t resPos, uint16_t re
|
||||
VIR_INFO("A field data length violates the resource length boundary.");
|
||||
return false;
|
||||
}
|
||||
- if (virPCIVPDReadVPDBytes(vpdFileFd, buf, bytesToRead, fieldPos, csum) != bytesToRead) {
|
||||
- VIR_INFO("Could not parse a resource field data - VPD has invalid format");
|
||||
+
|
||||
+ if (virPCIVPDReadVPDBytes(vpdFileFd, buf, bytesToRead, fieldPos, csum) < 0)
|
||||
return false;
|
||||
- }
|
||||
+
|
||||
/* Advance the position to the first byte of the next field. */
|
||||
fieldPos += fieldDataLen;
|
||||
|
||||
@@ -566,10 +569,9 @@ virPCIVPDParseVPDLargeResourceString(int vpdFileFd, uint16_t resPos,
|
||||
/* The resource value is not NULL-terminated so add one more byte. */
|
||||
g_autofree char *buf = g_malloc0(resDataLen + 1);
|
||||
|
||||
- if (virPCIVPDReadVPDBytes(vpdFileFd, (uint8_t *)buf, resDataLen, resPos, csum) != resDataLen) {
|
||||
- VIR_INFO("Could not read a part of a resource - VPD has invalid format");
|
||||
+ if (virPCIVPDReadVPDBytes(vpdFileFd, (uint8_t *)buf, resDataLen, resPos, csum) < 0)
|
||||
return false;
|
||||
- }
|
||||
+
|
||||
resValue = g_strdup(g_strstrip(buf));
|
||||
if (!virPCIVPDResourceIsValidTextValue(resValue)) {
|
||||
VIR_INFO("The string resource has invalid characters in its value");
|
||||
@@ -610,8 +612,8 @@ virPCIVPDParse(int vpdFileFd)
|
||||
|
||||
while (resPos <= PCI_VPD_ADDR_MASK) {
|
||||
/* Read the resource data type tag. */
|
||||
- if (virPCIVPDReadVPDBytes(vpdFileFd, &tag, 1, resPos, &csum) != 1)
|
||||
- break;
|
||||
+ if (virPCIVPDReadVPDBytes(vpdFileFd, &tag, 1, resPos, &csum) < 0)
|
||||
+ return NULL;
|
||||
|
||||
/* 0x80 == 0b10000000 - the large resource data type flag. */
|
||||
if (tag & PCI_VPD_LARGE_RESOURCE_FLAG) {
|
||||
@@ -620,9 +622,10 @@ virPCIVPDParse(int vpdFileFd)
|
||||
* where the end tag should be. */
|
||||
break;
|
||||
}
|
||||
+
|
||||
/* Read the two length bytes of the large resource record. */
|
||||
- if (virPCIVPDReadVPDBytes(vpdFileFd, headerBuf, 2, resPos + 1, &csum) != 2)
|
||||
- break;
|
||||
+ if (virPCIVPDReadVPDBytes(vpdFileFd, headerBuf, 2, resPos + 1, &csum) < 0)
|
||||
+ return NULL;
|
||||
|
||||
resDataLen = headerBuf[0] + (headerBuf[1] << 8);
|
||||
/* Change the position to the byte following the tag and length bytes. */
|
||||
--
|
||||
2.43.0
|
@ -1,56 +0,0 @@
|
||||
From c820b898998aca63d597567724011182c4fa50cd Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <c820b898998aca63d597567724011182c4fa50cd.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 15:13:16 +0100
|
||||
Subject: [PATCH] virPCIVPDResourceGetKeywordPrefix: Fix logging
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Use VIR_DEBUG instead of VIR_INFO as that's more appropriate and report
|
||||
relevant information for debugging.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit ab3f4d1b0b9f29c924e928f8c6663b4076e49b38)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
src/util/virpcivpd.c | 16 ++++++++--------
|
||||
1 file changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index b303e161ae..67065dec46 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -61,20 +61,20 @@ virPCIVPDResourceGetKeywordPrefix(const char *keyword)
|
||||
g_autofree char *key = NULL;
|
||||
|
||||
/* Keywords must have a length of 2 bytes. */
|
||||
- if (strlen(keyword) != 2) {
|
||||
- VIR_INFO("The keyword length is not 2 bytes: %s", keyword);
|
||||
- return NULL;
|
||||
- } else if (!(virPCIVPDResourceIsUpperOrNumber(keyword[0]) &&
|
||||
- virPCIVPDResourceIsUpperOrNumber(keyword[1]))) {
|
||||
- VIR_INFO("The keyword is not comprised only of uppercase ASCII letters or digits");
|
||||
- return NULL;
|
||||
- }
|
||||
+ if (strlen(keyword) != 2 ||
|
||||
+ !(virPCIVPDResourceIsUpperOrNumber(keyword[0]) &&
|
||||
+ virPCIVPDResourceIsUpperOrNumber(keyword[1])))
|
||||
+ goto cleanup;
|
||||
+
|
||||
/* Special-case the system-specific keywords since they share the "Y" prefix with "YA". */
|
||||
if (virPCIVPDResourceIsSystemKeyword(keyword) || virPCIVPDResourceIsVendorKeyword(keyword))
|
||||
key = g_strndup(keyword, 1);
|
||||
else
|
||||
key = g_strndup(keyword, 2);
|
||||
|
||||
+ cleanup:
|
||||
+ VIR_DEBUG("keyword='%s' key='%s'", keyword, NULLSTR(key));
|
||||
+
|
||||
return g_steal_pointer(&key);
|
||||
}
|
||||
|
||||
--
|
||||
2.43.0
|
@ -1,54 +0,0 @@
|
||||
From 4daeb72f2eb09db6c5ac1628c35139af4ab7653e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <4daeb72f2eb09db6c5ac1628c35139af4ab7653e.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 15:24:27 +0100
|
||||
Subject: [PATCH] virPCIVPDResourceIsValidTextValue: Adjust comment to reflect
|
||||
actual code
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The function does not reject '&', '<', '>' contrary to what it actually
|
||||
states. Move and adjust the comment.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit 42df6cc1b4acc40d05ff6bc8e85587e4faec6cac)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
https://issues.redhat.com/browse/RHEL-22400 [9.3.z]
|
||||
https://issues.redhat.com/browse/RHEL-22399 [9.2.z]
|
||||
---
|
||||
src/util/virpcivpd.c | 12 ++++--------
|
||||
1 file changed, 4 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/src/util/virpcivpd.c b/src/util/virpcivpd.c
|
||||
index 39557c7347..248a9b2790 100644
|
||||
--- a/src/util/virpcivpd.c
|
||||
+++ b/src/util/virpcivpd.c
|
||||
@@ -167,19 +167,15 @@ virPCIVPDResourceGetFieldValueFormat(const char *keyword)
|
||||
* value or text field value. The expectations are based on the keywords specified
|
||||
* in relevant sections of PCI(e) specifications
|
||||
* ("I.3. VPD Definitions" in PCI specs, "6.28.1 VPD Format" PCIe 4.0).
|
||||
+ *
|
||||
+ * The PCI(e) specs mention alphanumeric characters when talking about text fields
|
||||
+ * and the string resource but also include spaces and dashes in the provided example.
|
||||
+ * Dots, commas, equal signs have also been observed in values used by major device vendors.
|
||||
*/
|
||||
bool
|
||||
virPCIVPDResourceIsValidTextValue(const char *value)
|
||||
{
|
||||
size_t i = 0;
|
||||
- /*
|
||||
- * The PCI(e) specs mention alphanumeric characters when talking about text fields
|
||||
- * and the string resource but also include spaces and dashes in the provided example.
|
||||
- * Dots, commas, equal signs have also been observed in values used by major device vendors.
|
||||
- * The specs do not specify a full set of allowed code points and for Libvirt it is important
|
||||
- * to keep values in the ranges allowed within XML elements (mainly excluding less-than,
|
||||
- * greater-than and ampersand).
|
||||
- */
|
||||
|
||||
if (value == NULL)
|
||||
return false;
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,90 @@
|
||||
From 9f029a7ab4e387abda2c43fd685fe66f3fc5eac9 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <9f029a7ab4e387abda2c43fd685fe66f3fc5eac9.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 10:55:00 +0200
|
||||
Subject: [PATCH] virTypedParamsFilter: Adjust return type and docs
|
||||
|
||||
The 'virTypedParamsFilter' function can't fail and thus it never returns
|
||||
negative values. Change the return type to 'size_t' and adjust callers
|
||||
to not check the return value for being negative.
|
||||
|
||||
Adjust the docs to hilight this and also the fact that the filtered
|
||||
typed param list returned via @ret is not a deep copy and thus callers
|
||||
must not use the common function to free it.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 933ab93e8f7bb7779717305b602ef5d08cd72bed)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/util/virtypedparam.c | 19 ++++++++++---------
|
||||
src/util/virtypedparam.h | 2 +-
|
||||
2 files changed, 11 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
|
||||
index 1be249d855..634385aa97 100644
|
||||
--- a/src/util/virtypedparam.c
|
||||
+++ b/src/util/virtypedparam.c
|
||||
@@ -394,18 +394,22 @@ virTypedParamsCopy(virTypedParameterPtr *dst,
|
||||
* @ret: pointer to the returned array
|
||||
*
|
||||
* Filters @params retaining only the parameters named @name in the
|
||||
- * resulting array @ret. Caller should free the @ret array but not
|
||||
- * the items since they are pointing to the @params elements.
|
||||
+ * resulting array @ret.
|
||||
*
|
||||
- * Returns amount of elements in @ret on success, -1 on error.
|
||||
+ * Important Caller should free the @ret array but not the items since they are
|
||||
+ * pointing to the @params elements. I.e. callers must not use
|
||||
+ * 'virTypedParamsFree' or equivalent on pointer returned via @ret.
|
||||
+ *
|
||||
+ * Returns amount of elements in @ret.
|
||||
*/
|
||||
-int
|
||||
+size_t
|
||||
virTypedParamsFilter(virTypedParameterPtr params,
|
||||
int nparams,
|
||||
const char *name,
|
||||
virTypedParameterPtr **ret)
|
||||
{
|
||||
- size_t i, n = 0;
|
||||
+ size_t i;
|
||||
+ size_t n = 0;
|
||||
|
||||
*ret = g_new0(virTypedParameterPtr, nparams);
|
||||
|
||||
@@ -443,7 +447,7 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
const char ***values)
|
||||
{
|
||||
size_t i, n;
|
||||
- int nfiltered;
|
||||
+ size_t nfiltered;
|
||||
virTypedParameterPtr *filtered = NULL;
|
||||
|
||||
virCheckNonNullArgGoto(values, error);
|
||||
@@ -451,9 +455,6 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
|
||||
nfiltered = virTypedParamsFilter(params, nparams, name, &filtered);
|
||||
|
||||
- if (nfiltered < 0)
|
||||
- goto error;
|
||||
-
|
||||
if (nfiltered)
|
||||
*values = g_new0(const char *, nfiltered);
|
||||
|
||||
diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h
|
||||
index 7454ef3ce0..afd923aacb 100644
|
||||
--- a/src/util/virtypedparam.h
|
||||
+++ b/src/util/virtypedparam.h
|
||||
@@ -81,7 +81,7 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
int nparams,
|
||||
const char *name,
|
||||
const char ***values);
|
||||
-int
|
||||
+size_t
|
||||
virTypedParamsFilter(virTypedParameterPtr params,
|
||||
int nparams,
|
||||
const char *name,
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,135 @@
|
||||
From 57cae87e990bda62cf28b0b17ab3cc6a749bbee4 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <57cae87e990bda62cf28b0b17ab3cc6a749bbee4.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 12:56:34 +0200
|
||||
Subject: [PATCH] virTypedParamsFilter: Introduce option to filter also by type
|
||||
|
||||
The only caller of this function is doing some additional filtering so
|
||||
it's useful if the filtering function was able to do so internally.
|
||||
|
||||
Introduce a 'type' parameter which will optionally filter the results by
|
||||
type and extend the testsuite to cover this scenario.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit b74fed01730beac3e7d6d31b35b771a0bf559be2)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/util/virtypedparam.c | 19 +++++++++++++------
|
||||
src/util/virtypedparam.h | 1 +
|
||||
tests/virtypedparamtest.c | 14 +++++++++++---
|
||||
3 files changed, 25 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
|
||||
index 86fbaf5e9d..a080d7ba0f 100644
|
||||
--- a/src/util/virtypedparam.c
|
||||
+++ b/src/util/virtypedparam.c
|
||||
@@ -391,10 +391,12 @@ virTypedParamsCopy(virTypedParameterPtr *dst,
|
||||
* @params: array of typed parameters
|
||||
* @nparams: number of parameters in the @params array
|
||||
* @name: name of the parameter to find
|
||||
+ * @type: type of fields to filter (ignored if 0 is passed)
|
||||
* @ret: pointer to the returned array
|
||||
*
|
||||
* Filters @params retaining only the parameters named @name in the
|
||||
- * resulting array @ret.
|
||||
+ * resulting array @ret. If @type is non-zero it also filters out parameters
|
||||
+ * whose type doesn't match @type.
|
||||
*
|
||||
* Important Caller should free the @ret array but not the items since they are
|
||||
* pointing to the @params elements. I.e. callers must not use
|
||||
@@ -406,6 +408,7 @@ size_t
|
||||
virTypedParamsFilter(virTypedParameterPtr params,
|
||||
int nparams,
|
||||
const char *name,
|
||||
+ int type,
|
||||
virTypedParameterPtr **ret)
|
||||
{
|
||||
size_t i;
|
||||
@@ -414,10 +417,14 @@ virTypedParamsFilter(virTypedParameterPtr params,
|
||||
*ret = g_new0(virTypedParameterPtr, nparams);
|
||||
|
||||
for (i = 0; i < nparams; i++) {
|
||||
- if (STREQ(params[i].field, name)) {
|
||||
- (*ret)[n] = ¶ms[i];
|
||||
- n++;
|
||||
- }
|
||||
+ if (STRNEQ(params[i].field, name))
|
||||
+ continue;
|
||||
+
|
||||
+ if (type != 0 &&
|
||||
+ params[i].type != type)
|
||||
+ continue;
|
||||
+
|
||||
+ (*ret)[n++] = ¶ms[i];
|
||||
}
|
||||
|
||||
return n;
|
||||
@@ -453,7 +460,7 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
|
||||
*values = NULL;
|
||||
|
||||
- nfiltered = virTypedParamsFilter(params, nparams, name, &filtered);
|
||||
+ nfiltered = virTypedParamsFilter(params, nparams, name, 0, &filtered);
|
||||
|
||||
if (nfiltered == 0)
|
||||
return 0;
|
||||
diff --git a/src/util/virtypedparam.h b/src/util/virtypedparam.h
|
||||
index afd923aacb..774744244a 100644
|
||||
--- a/src/util/virtypedparam.h
|
||||
+++ b/src/util/virtypedparam.h
|
||||
@@ -85,6 +85,7 @@ size_t
|
||||
virTypedParamsFilter(virTypedParameterPtr params,
|
||||
int nparams,
|
||||
const char *name,
|
||||
+ int type,
|
||||
virTypedParameterPtr **ret)
|
||||
G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
diff --git a/tests/virtypedparamtest.c b/tests/virtypedparamtest.c
|
||||
index 5ced453be5..1a8b49383f 100644
|
||||
--- a/tests/virtypedparamtest.c
|
||||
+++ b/tests/virtypedparamtest.c
|
||||
@@ -91,13 +91,14 @@ testTypedParamsFilter(const void *opaque G_GNUC_UNUSED)
|
||||
{ .field = "bar", .type = VIR_TYPED_PARAM_UINT },
|
||||
{ .field = "foo", .type = VIR_TYPED_PARAM_INT },
|
||||
{ .field = "foobar", .type = VIR_TYPED_PARAM_STRING },
|
||||
- { .field = "foo", .type = VIR_TYPED_PARAM_INT }
|
||||
+ { .field = "foo", .type = VIR_TYPED_PARAM_INT },
|
||||
+ { .field = "foobar", .type = VIR_TYPED_PARAM_INT },
|
||||
};
|
||||
virTypedParameterPtr *filtered = NULL;
|
||||
|
||||
|
||||
nfiltered = virTypedParamsFilter(params, G_N_ELEMENTS(params),
|
||||
- "foo", &filtered);
|
||||
+ "foo", 0, &filtered);
|
||||
if (nfiltered != 3)
|
||||
goto cleanup;
|
||||
|
||||
@@ -108,7 +109,7 @@ testTypedParamsFilter(const void *opaque G_GNUC_UNUSED)
|
||||
VIR_FREE(filtered);
|
||||
|
||||
nfiltered = virTypedParamsFilter(params, G_N_ELEMENTS(params),
|
||||
- "bar", &filtered);
|
||||
+ "bar", VIR_TYPED_PARAM_UINT, &filtered);
|
||||
|
||||
if (nfiltered != 2)
|
||||
goto cleanup;
|
||||
@@ -117,6 +118,13 @@ testTypedParamsFilter(const void *opaque G_GNUC_UNUSED)
|
||||
if (filtered[i] != ¶ms[i * 2])
|
||||
goto cleanup;
|
||||
}
|
||||
+ VIR_FREE(filtered);
|
||||
+
|
||||
+ nfiltered = virTypedParamsFilter(params, G_N_ELEMENTS(params),
|
||||
+ "foobar", VIR_TYPED_PARAM_STRING, &filtered);
|
||||
+
|
||||
+ if (nfiltered != 1)
|
||||
+ goto cleanup;
|
||||
|
||||
rv = 0;
|
||||
cleanup:
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,73 @@
|
||||
From 2e989d82c00a7a6f8b17d920b788fae84b0464de Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <2e989d82c00a7a6f8b17d920b788fae84b0464de.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 13:01:22 +0200
|
||||
Subject: [PATCH] virTypedParamsGetStringList: Ensure that returned array is
|
||||
NULL if there are no matching fields
|
||||
|
||||
'virTypedParamsGetStringList' fills the returned array only with string
|
||||
parameters with matching name. The filtering code though leaves the
|
||||
possibility that all items are filtered out but the return array is
|
||||
still (over)allocated.
|
||||
|
||||
Since 'virTypedParamsFilter()' now also allows filtering by type we can
|
||||
move the filtering there ensuring that we always allocate the right
|
||||
number of elements and more importantly the returned array will be NULL
|
||||
if none elements are present.
|
||||
|
||||
Rework the code and adjust docs.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 7933310ce95a7a620da6868ea7e7f822b3f8a6a3)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/util/virtypedparam.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
|
||||
index a080d7ba0f..564cb81acc 100644
|
||||
--- a/src/util/virtypedparam.c
|
||||
+++ b/src/util/virtypedparam.c
|
||||
@@ -439,7 +439,8 @@ virTypedParamsFilter(virTypedParameterPtr params,
|
||||
* @values: array of returned values
|
||||
*
|
||||
* Finds all parameters with desired @name within @params and
|
||||
- * store their values into @values.
|
||||
+ * store their values into @values. If none of the @params are strings named
|
||||
+ * @name the returned @values will be NULL.
|
||||
*
|
||||
* Important: The strings in the returned string list @values are borrowed from
|
||||
* @params and thus caller must free only the pointer returned as @values, but
|
||||
@@ -454,13 +455,12 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
const char ***values)
|
||||
{
|
||||
size_t i;
|
||||
- size_t n = 0;
|
||||
size_t nfiltered;
|
||||
g_autofree virTypedParameterPtr *filtered = NULL;
|
||||
|
||||
*values = NULL;
|
||||
|
||||
- nfiltered = virTypedParamsFilter(params, nparams, name, 0, &filtered);
|
||||
+ nfiltered = virTypedParamsFilter(params, nparams, name, VIR_TYPED_PARAM_STRING, &filtered);
|
||||
|
||||
if (nfiltered == 0)
|
||||
return 0;
|
||||
@@ -468,11 +468,10 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
*values = g_new0(const char *, nfiltered);
|
||||
|
||||
for (i = 0; i < nfiltered; i++) {
|
||||
- if (filtered[i]->type == VIR_TYPED_PARAM_STRING)
|
||||
- (*values)[n++] = filtered[i]->value.s;
|
||||
+ (*values)[i] = filtered[i]->value.s;
|
||||
}
|
||||
|
||||
- return n;
|
||||
+ return nfiltered;
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,45 @@
|
||||
From f5a76961d73fe19e4890e43852f914e269ecb05e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <f5a76961d73fe19e4890e43852f914e269ecb05e.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 11:28:22 +0200
|
||||
Subject: [PATCH] virTypedParamsGetStringList: Ensure that returned string list
|
||||
is NULL-terminated
|
||||
|
||||
This can simplify callers who don't really need to know the number of
|
||||
elements to check that a particular element is present.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 9bf319147ce4f060db641c21544e1efb1a45bd5c)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/util/virtypedparam.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
|
||||
index 564cb81acc..f25530a735 100644
|
||||
--- a/src/util/virtypedparam.c
|
||||
+++ b/src/util/virtypedparam.c
|
||||
@@ -439,8 +439,8 @@ virTypedParamsFilter(virTypedParameterPtr params,
|
||||
* @values: array of returned values
|
||||
*
|
||||
* Finds all parameters with desired @name within @params and
|
||||
- * store their values into @values. If none of the @params are strings named
|
||||
- * @name the returned @values will be NULL.
|
||||
+ * store their values into a NULL-terminated string list @values. If none of
|
||||
+ * the @params are strings named @name the returned @values will be NULL.
|
||||
*
|
||||
* Important: The strings in the returned string list @values are borrowed from
|
||||
* @params and thus caller must free only the pointer returned as @values, but
|
||||
@@ -465,7 +465,7 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
if (nfiltered == 0)
|
||||
return 0;
|
||||
|
||||
- *values = g_new0(const char *, nfiltered);
|
||||
+ *values = g_new0(const char *, nfiltered + 1);
|
||||
|
||||
for (i = 0; i < nfiltered; i++) {
|
||||
(*values)[i] = filtered[i]->value.s;
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,88 @@
|
||||
From cc6f1317a1b74ea01652c9125f0db80dea04a9cc Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <cc6f1317a1b74ea01652c9125f0db80dea04a9cc.1729611061.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 11:15:06 +0200
|
||||
Subject: [PATCH] virTypedParamsGetStringList: Refactor and adjust docs
|
||||
|
||||
Use automatic freeing, declare one variable per line and return early
|
||||
when possible. As this is an internal helper there's no need to check
|
||||
that the caller passed non-NULL @values.
|
||||
|
||||
Modify the documentation to be accurate and warn callers to not free the
|
||||
strings just the array.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit e5fae984b1c500d5199ace234cdae2bc89da9065)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
src/util/virtypedparam.c | 33 ++++++++++++++-------------------
|
||||
1 file changed, 14 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/src/util/virtypedparam.c b/src/util/virtypedparam.c
|
||||
index 634385aa97..86fbaf5e9d 100644
|
||||
--- a/src/util/virtypedparam.c
|
||||
+++ b/src/util/virtypedparam.c
|
||||
@@ -432,13 +432,13 @@ virTypedParamsFilter(virTypedParameterPtr params,
|
||||
* @values: array of returned values
|
||||
*
|
||||
* Finds all parameters with desired @name within @params and
|
||||
- * store their values into @values. The @values array is self
|
||||
- * allocated and its length is stored into @picked. When no
|
||||
- * longer needed, caller should free the returned array, but not
|
||||
- * the items since they are taken from @params array.
|
||||
+ * store their values into @values.
|
||||
*
|
||||
- * Returns amount of strings in @values array on success,
|
||||
- * -1 otherwise.
|
||||
+ * Important: The strings in the returned string list @values are borrowed from
|
||||
+ * @params and thus caller must free only the pointer returned as @values, but
|
||||
+ * not the contents.
|
||||
+ *
|
||||
+ * Returns amount of strings in @values array on success.
|
||||
*/
|
||||
int
|
||||
virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
@@ -446,31 +446,26 @@ virTypedParamsGetStringList(virTypedParameterPtr params,
|
||||
const char *name,
|
||||
const char ***values)
|
||||
{
|
||||
- size_t i, n;
|
||||
+ size_t i;
|
||||
+ size_t n = 0;
|
||||
size_t nfiltered;
|
||||
- virTypedParameterPtr *filtered = NULL;
|
||||
+ g_autofree virTypedParameterPtr *filtered = NULL;
|
||||
|
||||
- virCheckNonNullArgGoto(values, error);
|
||||
*values = NULL;
|
||||
|
||||
nfiltered = virTypedParamsFilter(params, nparams, name, &filtered);
|
||||
|
||||
- if (nfiltered)
|
||||
- *values = g_new0(const char *, nfiltered);
|
||||
+ if (nfiltered == 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ *values = g_new0(const char *, nfiltered);
|
||||
|
||||
- for (n = 0, i = 0; i < nfiltered; i++) {
|
||||
+ for (i = 0; i < nfiltered; i++) {
|
||||
if (filtered[i]->type == VIR_TYPED_PARAM_STRING)
|
||||
(*values)[n++] = filtered[i]->value.s;
|
||||
}
|
||||
|
||||
- VIR_FREE(filtered);
|
||||
return n;
|
||||
-
|
||||
- error:
|
||||
- if (values)
|
||||
- VIR_FREE(*values);
|
||||
- VIR_FREE(filtered);
|
||||
- return -1;
|
||||
}
|
||||
|
||||
|
||||
--
|
||||
2.47.0
|
@ -1,85 +0,0 @@
|
||||
From 636dbbfd795583431523972a0057ede74d110a6e Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <636dbbfd795583431523972a0057ede74d110a6e.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Wed, 24 Jan 2024 17:13:51 +0100
|
||||
Subject: [PATCH] virpcivpdtest: testPCIVPDResourceBasic: Remove tests for
|
||||
uninitialized 'ro'/'rw' section
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
This is a synthetic case which tests the behaviour if the 'ro' or 'rw'
|
||||
struct members are uninitialized, basically excercising only a pointless
|
||||
programming-error NULL check in 'virPCIVPDResourceUpdateKeyword' as real
|
||||
usage does always pass a proper pointer.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit e8f5edf556145cbe6bae53255ded3051d65f24f1)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-22314 [9.4.0]
|
||||
---
|
||||
tests/virpcivpdtest.c | 27 ---------------------------
|
||||
1 file changed, 27 deletions(-)
|
||||
|
||||
diff --git a/tests/virpcivpdtest.c b/tests/virpcivpdtest.c
|
||||
index 8a2f337e85..20545759d5 100644
|
||||
--- a/tests/virpcivpdtest.c
|
||||
+++ b/tests/virpcivpdtest.c
|
||||
@@ -64,11 +64,6 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
{.keyword = "SN", .value = "serial2", .actual = &ro->serial_number},
|
||||
{.keyword = "serial_number", .value = "serial3", .actual = &ro->serial_number},
|
||||
};
|
||||
- const TestPCIVPDKeywordValue readWriteCases[] = {
|
||||
- {.keyword = "YA", .value = "tag1", .actual = &ro->change_level},
|
||||
- {.keyword = "YA", .value = "tag2", .actual = &ro->change_level},
|
||||
- {.keyword = "asset_tag", .value = "tag3", .actual = &ro->change_level},
|
||||
- };
|
||||
const TestPCIVPDKeywordValue unsupportedFieldCases[] = {
|
||||
{.keyword = "FG", .value = "42", .actual = NULL},
|
||||
{.keyword = "LC", .value = "42", .actual = NULL},
|
||||
@@ -77,7 +72,6 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
{.keyword = "EX", .value = "42", .actual = NULL},
|
||||
};
|
||||
size_t numROCases = G_N_ELEMENTS(readOnlyCases);
|
||||
- size_t numRWCases = G_N_ELEMENTS(readWriteCases);
|
||||
size_t numUnsupportedCases = G_N_ELEMENTS(unsupportedFieldCases);
|
||||
g_autoptr(virPCIVPDResource) res = g_new0(virPCIVPDResource, 1);
|
||||
virPCIVPDResourceCustom *custom = NULL;
|
||||
@@ -85,20 +79,6 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
g_autofree char *val = g_strdup("testval");
|
||||
res->name = g_steal_pointer(&val);
|
||||
|
||||
- /* RO has not been initialized - make sure updates fail. */
|
||||
- for (i = 0; i < numROCases; ++i) {
|
||||
- if (virPCIVPDResourceUpdateKeyword(res, true,
|
||||
- readOnlyCases[i].keyword,
|
||||
- readOnlyCases[i].value))
|
||||
- return -1;
|
||||
- }
|
||||
- /* RW has not been initialized - make sure updates fail. */
|
||||
- for (i = 0; i < numRWCases; ++i) {
|
||||
- if (virPCIVPDResourceUpdateKeyword(res, false,
|
||||
- readWriteCases[i].keyword,
|
||||
- readWriteCases[i].value))
|
||||
- return -1;
|
||||
- }
|
||||
/* Initialize RO */
|
||||
res->ro = g_steal_pointer(&ro);
|
||||
|
||||
@@ -131,13 +111,6 @@ testPCIVPDResourceBasic(const void *data G_GNUC_UNUSED)
|
||||
return -1;
|
||||
}
|
||||
|
||||
- /* Check that RW updates fail if RW has not been initialized. */
|
||||
- if (virPCIVPDResourceUpdateKeyword(res, false, "YA", "tag1"))
|
||||
- return -1;
|
||||
-
|
||||
- if (virPCIVPDResourceUpdateKeyword(res, false, "asset_tag", "tag1"))
|
||||
- return -1;
|
||||
-
|
||||
/* Initialize RW */
|
||||
res->rw = g_steal_pointer(&rw);
|
||||
if (!virPCIVPDResourceUpdateKeyword(res, false, "YA", "tag1")
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,91 @@
|
||||
From 0c756898dd4a5dd9ef223c411efeab6206e5db50 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <0c756898dd4a5dd9ef223c411efeab6206e5db50.1729611062.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Fri, 27 Sep 2024 15:18:50 +0200
|
||||
Subject: [PATCH] virsh: Add support for
|
||||
VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES migration parameter
|
||||
|
||||
Expose the new parameter as '--migrate-disks-detect-zeroes' option.
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 89ce63425391a619d746af564c9b0c23ffb0aec9)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-61177
|
||||
---
|
||||
docs/manpages/virsh.rst | 8 +++++++-
|
||||
tools/virsh-domain.c | 26 ++++++++++++++++++++++++++
|
||||
2 files changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
|
||||
index fa038e4547..87de338644 100644
|
||||
--- a/docs/manpages/virsh.rst
|
||||
+++ b/docs/manpages/virsh.rst
|
||||
@@ -3389,7 +3389,9 @@ migrate
|
||||
[--postcopy-after-precopy] [--postcopy-resume] [--zerocopy]
|
||||
domain desturi [migrateuri] [graphicsuri] [listen-address] [dname]
|
||||
[--timeout seconds [--timeout-suspend | --timeout-postcopy]]
|
||||
- [--xml file] [--migrate-disks disk-list] [--disks-port port]
|
||||
+ [--xml file]
|
||||
+ [--migrate-disks disk-list] [--migrate-disks-detect-zeroes disk-list]
|
||||
+ [--disks-port port]
|
||||
[--compressed] [--comp-methods method-list]
|
||||
[--comp-mt-level] [--comp-mt-threads] [--comp-mt-dthreads]
|
||||
[--comp-xbzrle-cache] [--comp-zlib-level] [--comp-zstd-level]
|
||||
@@ -3420,6 +3422,10 @@ images on source host to the images found at the same place on the destination
|
||||
host. By default only non-shared non-readonly images are transferred. Use
|
||||
*--migrate-disks* to explicitly specify a list of disk targets to
|
||||
transfer via the comma separated ``disk-list`` argument.
|
||||
+The *--migrate-disks-detect-zeroes* option which takes a comma separated list of
|
||||
+disk target names enables zeroed block detection for the listed migrated disks.
|
||||
+These blocks are not transferred or allocated on destination, effectively
|
||||
+sparsifying the disk at the cost of CPU overhead.
|
||||
With *--copy-storage-synchronous-writes* flag used the disk data migration will
|
||||
synchronously handle guest disk writes to both the original source and the
|
||||
destination to ensure that the disk migration converges at the price of possibly
|
||||
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
|
||||
index 50e80689a2..e4923284af 100644
|
||||
--- a/tools/virsh-domain.c
|
||||
+++ b/tools/virsh-domain.c
|
||||
@@ -10691,6 +10691,11 @@ static const vshCmdOptDef opts_migrate[] = {
|
||||
.completer = virshDomainMigrateDisksCompleter,
|
||||
.help = N_("comma separated list of disks to be migrated")
|
||||
},
|
||||
+ {.name = "migrate-disks-detect-zeroes",
|
||||
+ .type = VSH_OT_STRING,
|
||||
+ .completer = virshDomainMigrateDisksCompleter,
|
||||
+ .help = N_("comma separated list of disks to be migrated with zero detection enabled")
|
||||
+ },
|
||||
{.name = "disks-port",
|
||||
.type = VSH_OT_INT,
|
||||
.unwanted_positional = true,
|
||||
@@ -10909,6 +10914,27 @@ doMigrate(void *opaque)
|
||||
}
|
||||
}
|
||||
|
||||
+ if (vshCommandOptString(ctl, cmd, "migrate-disks-detect-zeroes", &opt) < 0)
|
||||
+ goto out;
|
||||
+ if (opt) {
|
||||
+ g_autofree char **val = NULL;
|
||||
+
|
||||
+ if (!(flags & (VIR_MIGRATE_NON_SHARED_DISK | VIR_MIGRATE_NON_SHARED_INC))) {
|
||||
+ vshError(ctl, "'--migrate-disks-detect-zeroes' requires one of '--copy-storage-all', '--copy-storage-inc'");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ val = g_strsplit(opt, ",", 0);
|
||||
+
|
||||
+ if (virTypedParamsAddStringList(¶ms,
|
||||
+ &nparams,
|
||||
+ &maxparams,
|
||||
+ VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES,
|
||||
+ (const char **)val) < 0) {
|
||||
+ goto save_error;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (vshCommandOptString(ctl, cmd, "comp-methods", &opt) < 0)
|
||||
goto out;
|
||||
if (opt) {
|
||||
--
|
||||
2.47.0
|
@ -1,52 +0,0 @@
|
||||
From 44eeb458ace773226f08d0807fda964014004301 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <44eeb458ace773226f08d0807fda964014004301.1707394627.git.jdenemar@redhat.com>
|
||||
From: Peter Krempa <pkrempa@redhat.com>
|
||||
Date: Thu, 1 Feb 2024 10:40:41 +0100
|
||||
Subject: [PATCH] virt-admin: Add warning when connection to default daemon
|
||||
fails
|
||||
|
||||
The admin connection defaults to the system-wide 'libvirtd' daemon to
|
||||
manage (libvirtd:///system). As we've now switched to modular daemons
|
||||
this will not work for most users out of the box:
|
||||
|
||||
$ virt-admin version
|
||||
error: Failed to connect to the admin server
|
||||
error: no valid connection
|
||||
error: Failed to connect socket to '/run/user/1000/libvirt/libvirt-admin-sock': No such file or directory
|
||||
|
||||
As we don't want to assume which daemon the user wants to manage in the
|
||||
modular topology there's no reasonable default to pick.
|
||||
|
||||
Give a hint to the users to use the '-c' if the connection to the
|
||||
default URI fails:
|
||||
|
||||
$ virt-admin version
|
||||
NOTE: Connecting to default daemon. Specify daemon using '-c' (e.g. virtqemud:///system)
|
||||
error: Failed to connect to the admin server
|
||||
error: no valid connection
|
||||
error: Failed to connect socket to '/run/user/1000/libvirt/libvirt-admin-sock': No such file or directory
|
||||
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
|
||||
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
|
||||
(cherry picked from commit 442061583e9dc0e4e3bf314275979051345a4a93)
|
||||
https://issues.redhat.com/browse/RHEL-23170
|
||||
---
|
||||
tools/virt-admin.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
|
||||
index 1e22a3c8a9..70b6e4916f 100644
|
||||
--- a/tools/virt-admin.c
|
||||
+++ b/tools/virt-admin.c
|
||||
@@ -108,6 +108,9 @@ vshAdmConnect(vshControl *ctl, unsigned int flags)
|
||||
priv->conn = virAdmConnectOpen(ctl->connname, flags);
|
||||
|
||||
if (!priv->conn) {
|
||||
+ if (!ctl->connname)
|
||||
+ vshPrintExtra(ctl, "%s", _("NOTE: Connecting to default daemon. Specify daemon using '-c' (e.g. virtqemud:///system)\n"));
|
||||
+
|
||||
if (priv->wantReconnect)
|
||||
vshError(ctl, "%s", _("Failed to reconnect to the admin server"));
|
||||
else
|
||||
--
|
||||
2.43.0
|
@ -0,0 +1,85 @@
|
||||
From f122faf68c4921d44b98700209766cae7507deec Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <f122faf68c4921d44b98700209766cae7507deec.1721740702.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Tue, 23 Jul 2024 10:31:27 +0200
|
||||
Subject: [PATCH] virt-host-validate: Allow longer list of CPU flags
|
||||
|
||||
On various occasions, virt-host-validate parses /proc/cpuinfo to
|
||||
learn about CPU flags (see virHostValidateGetCPUFlags()). It does
|
||||
so, by reading the file line by line until the line with CPU
|
||||
flags is reached. Then the line is split into individual flags
|
||||
(using space as a delimiter) and the list of flags is then
|
||||
iterated over.
|
||||
|
||||
This works, except for cases when the line with CPU flags is too
|
||||
long. Problem is - the line is capped at 1024 bytes and on newer
|
||||
CPUs (and newer kernels), the line can be significantly longer.
|
||||
I've seen a line that's ~1200 characters long (with 164 flags
|
||||
reported).
|
||||
|
||||
Switch to unbounded read from the file (getline()).
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-39969
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
(cherry picked from commit e5232f6fd691668decd5be1b3a76cdbd3666d032)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
tools/virt-host-validate-common.c | 18 +++++++-----------
|
||||
1 file changed, 7 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
|
||||
index 591143c24d..63cc3dbe7b 100644
|
||||
--- a/tools/virt-host-validate-common.c
|
||||
+++ b/tools/virt-host-validate-common.c
|
||||
@@ -106,21 +106,19 @@ virBitmap *virHostValidateGetCPUFlags(void)
|
||||
{
|
||||
FILE *fp;
|
||||
virBitmap *flags = NULL;
|
||||
+ g_autofree char *line = NULL;
|
||||
+ size_t linelen = 0;
|
||||
|
||||
if (!(fp = fopen("/proc/cpuinfo", "r")))
|
||||
return NULL;
|
||||
|
||||
flags = virBitmapNew(VIR_HOST_VALIDATE_CPU_FLAG_LAST);
|
||||
|
||||
- do {
|
||||
- char line[1024];
|
||||
+ while (getline(&line, &linelen, fp) > 0) {
|
||||
char *start;
|
||||
g_auto(GStrv) tokens = NULL;
|
||||
GStrv next;
|
||||
|
||||
- if (!fgets(line, sizeof(line), fp))
|
||||
- break;
|
||||
-
|
||||
/* The line we're interested in is marked differently depending
|
||||
* on the architecture, so check possible prefixes */
|
||||
if (!STRPREFIX(line, "flags") &&
|
||||
@@ -129,11 +127,9 @@ virBitmap *virHostValidateGetCPUFlags(void)
|
||||
!STRPREFIX(line, "facilities"))
|
||||
continue;
|
||||
|
||||
- /* fgets() includes the trailing newline in the output buffer,
|
||||
- * so we need to clean that up ourselves. We can safely access
|
||||
- * line[strlen(line) - 1] because the checks above would cause
|
||||
- * us to skip empty strings */
|
||||
- line[strlen(line) - 1] = '\0';
|
||||
+ /* getline() may include the trailing newline in the output
|
||||
+ * buffer, so we need to clean that up ourselves. */
|
||||
+ virStringTrimOptionalNewline(line);
|
||||
|
||||
/* Skip to the separator */
|
||||
if (!(start = strchr(line, ':')))
|
||||
@@ -153,7 +149,7 @@ virBitmap *virHostValidateGetCPUFlags(void)
|
||||
if ((value = virHostValidateCPUFlagTypeFromString(*next)) >= 0)
|
||||
ignore_value(virBitmapSetBit(flags, value));
|
||||
}
|
||||
- } while (1);
|
||||
+ }
|
||||
|
||||
VIR_FORCE_FCLOSE(fp);
|
||||
|
||||
--
|
||||
2.45.2
|
46
SOURCES/libvirt-virt-host-validate-Drop-extra-PASS.patch
Normal file
46
SOURCES/libvirt-virt-host-validate-Drop-extra-PASS.patch
Normal file
@ -0,0 +1,46 @@
|
||||
From d1d455fe81027fee79666b3af2551e98b68b619b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <d1d455fe81027fee79666b3af2551e98b68b619b.1720800605.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Thu, 11 Jul 2024 09:32:40 +0200
|
||||
Subject: [PATCH] virt-host-validate: Drop extra "PASS"
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
If virt-host-validate is ran on a SEV-SNP capable machine, an
|
||||
extra "PASS" is printed out. This is because
|
||||
virHostValidateAMDSev() prints "PASS" and then returns 1
|
||||
(indicating success) which in turn makes the caller
|
||||
(virHostValidateSecureGuests()) print "PASS" again. Just drop the
|
||||
extra printing in the caller and let virHostValidateAMDSev() do
|
||||
all the printing.
|
||||
|
||||
Fixes: 1a8f646f291775d2423ce4e4df62ad69f06ab827
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-46868
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com>
|
||||
(cherry picked from commit c9fa43c48cdb1b8505929e3287975445f3004f32)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
tools/virt-host-validate-common.c | 6 +-----
|
||||
1 file changed, 1 insertion(+), 5 deletions(-)
|
||||
|
||||
diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-common.c
|
||||
index a29a5b6d5f..591143c24d 100644
|
||||
--- a/tools/virt-host-validate-common.c
|
||||
+++ b/tools/virt-host-validate-common.c
|
||||
@@ -488,11 +488,7 @@ int virHostValidateSecureGuests(const char *hvname,
|
||||
return VIR_VALIDATE_FAILURE(level);
|
||||
}
|
||||
} else if (hasAMDSev) {
|
||||
- int rc = virHostValidateAMDSev(hvname, level);
|
||||
-
|
||||
- if (rc > 0)
|
||||
- virValidatePass();
|
||||
- return rc;
|
||||
+ return virHostValidateAMDSev(hvname, level);
|
||||
}
|
||||
|
||||
virValidateFail(level,
|
||||
--
|
||||
2.45.2
|
219
SOURCES/libvirt-vmx-Allow-to-appear-in-VMX-file-keys.patch
Normal file
219
SOURCES/libvirt-vmx-Allow-to-appear-in-VMX-file-keys.patch
Normal file
@ -0,0 +1,219 @@
|
||||
From cc0211f56ab480f97e367c8cffa5ac0e578da086 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <cc0211f56ab480f97e367c8cffa5ac0e578da086.1729611062.git.jdenemar@redhat.com>
|
||||
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||||
Date: Wed, 11 Sep 2024 17:03:16 +0100
|
||||
Subject: [PATCH] vmx: Allow '*' to appear in VMX file keys
|
||||
|
||||
When connecting to a VMware server (eg using vpx://) we download and
|
||||
try to parse the VMware metadata '*.vmx' file of a guest. In this
|
||||
case a VMX file was found which contained this key:
|
||||
|
||||
pciPassthru*.present = "False"
|
||||
|
||||
The '*' character was not previously allowed in keys so this failed to
|
||||
parse with the error:
|
||||
|
||||
VIR_ERR_CONF_SYNTAX: VIR_FROM_CONF: configuration file syntax error:
|
||||
memory conf:74: expecting an assignment
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-58446
|
||||
Thanks: Daniel Berrange
|
||||
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
|
||||
(cherry picked from commit 94e8a5b650a270c28ebfce22a1bd834f88a095a3)
|
||||
|
||||
https://issues.redhat.com/browse/RHEL-58677
|
||||
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
---
|
||||
src/util/virconf.c | 2 +-
|
||||
tests/vmx2xmldata/esx-in-the-wild-14.vmx | 109 +++++++++++++++++++++++
|
||||
tests/vmx2xmldata/esx-in-the-wild-14.xml | 35 ++++++++
|
||||
tests/vmx2xmltest.c | 1 +
|
||||
4 files changed, 146 insertions(+), 1 deletion(-)
|
||||
create mode 100644 tests/vmx2xmldata/esx-in-the-wild-14.vmx
|
||||
create mode 100644 tests/vmx2xmldata/esx-in-the-wild-14.xml
|
||||
|
||||
diff --git a/src/util/virconf.c b/src/util/virconf.c
|
||||
index 8fdf40e9d0..07293039da 100644
|
||||
--- a/src/util/virconf.c
|
||||
+++ b/src/util/virconf.c
|
||||
@@ -545,7 +545,7 @@ virConfParseName(virConfParserCtxt *ctxt)
|
||||
while ((ctxt->cur < ctxt->end) &&
|
||||
(g_ascii_isalnum(CUR) || (CUR == '_') ||
|
||||
((ctxt->conf->flags & VIR_CONF_FLAG_VMX_FORMAT) &&
|
||||
- ((CUR == ':') || (CUR == '.') || (CUR == '-'))) ||
|
||||
+ ((CUR == ':') || (CUR == '.') || (CUR == '-') || (CUR == '*'))) ||
|
||||
((ctxt->conf->flags & VIR_CONF_FLAG_LXC_FORMAT) &&
|
||||
(CUR == '.'))))
|
||||
NEXT;
|
||||
diff --git a/tests/vmx2xmldata/esx-in-the-wild-14.vmx b/tests/vmx2xmldata/esx-in-the-wild-14.vmx
|
||||
new file mode 100644
|
||||
index 0000000000..1b06352348
|
||||
--- /dev/null
|
||||
+++ b/tests/vmx2xmldata/esx-in-the-wild-14.vmx
|
||||
@@ -0,0 +1,109 @@
|
||||
+.encoding = "UTF-8"
|
||||
+displayName = "wild14"
|
||||
+config.version = "8"
|
||||
+virtualHW.version = "19"
|
||||
+nvram = "wild14.nvram"
|
||||
+pciBridge0.present = "TRUE"
|
||||
+svga.present = "TRUE"
|
||||
+pciBridge4.present = "TRUE"
|
||||
+pciBridge4.virtualDev = "pcieRootPort"
|
||||
+pciBridge4.functions = "8"
|
||||
+pciBridge5.present = "TRUE"
|
||||
+pciBridge5.virtualDev = "pcieRootPort"
|
||||
+pciBridge5.functions = "8"
|
||||
+pciBridge6.present = "TRUE"
|
||||
+pciBridge6.virtualDev = "pcieRootPort"
|
||||
+pciBridge6.functions = "8"
|
||||
+pciBridge7.present = "TRUE"
|
||||
+pciBridge7.virtualDev = "pcieRootPort"
|
||||
+pciBridge7.functions = "8"
|
||||
+vmci0.present = "TRUE"
|
||||
+hpet0.present = "TRUE"
|
||||
+numvcpus = "12"
|
||||
+memSize = "32768"
|
||||
+vm.createDate = "1661219530463754"
|
||||
+scsi0.virtualDev = "pvscsi"
|
||||
+scsi0.present = "TRUE"
|
||||
+annotation = "execution env sandbox automation platform"
|
||||
+guestOS = "rhel7-64"
|
||||
+uuid.bios = "42 1b 22 3a f2 c1 c7 c9-a3 99 34 d2 d9 fd e2 6d"
|
||||
+vc.uuid = "50 1b 83 1e 75 d8 15 f8-36 fa b9 e2 25 f3 95 aa"
|
||||
+migrate.hostLog = "wild14.hlog"
|
||||
+disk.EnableUUID = "true"
|
||||
+guestinfo.Vrm.Server.Host = "wild14.local"
|
||||
+numa.autosize.cookie = "120012"
|
||||
+numa.autosize.vcpu.maxPerVirtualNode = "12"
|
||||
+sched.swap.derivedName = "/vmfs/volumes/64e4b8e0/wild/wild14.vswp"
|
||||
+pciBridge0.pciSlotNumber = "17"
|
||||
+pciBridge4.pciSlotNumber = "21"
|
||||
+pciBridge5.pciSlotNumber = "22"
|
||||
+pciBridge6.pciSlotNumber = "23"
|
||||
+pciBridge7.pciSlotNumber = "24"
|
||||
+scsi0.pciSlotNumber = "160"
|
||||
+vmci0.pciSlotNumber = "32"
|
||||
+scsi0.sasWWID = "50 05 05 6a f2 c1 c7 c0"
|
||||
+vmci0.id = "-637672851"
|
||||
+svga.vramSize = "8388608"
|
||||
+monitor.phys_bits_used = "45"
|
||||
+vmotion.checkpointFBSize = "8388608"
|
||||
+vmotion.checkpointSVGAPrimarySize = "8388608"
|
||||
+softPowerOff = "FALSE"
|
||||
+svga.guestBackedPrimaryAware = "TRUE"
|
||||
+tools.syncTime = "FALSE"
|
||||
+guestOS.detailed.data = "architecture='X86' bitness='64' distroName='Red Hat Enterprise Linux' distroVersion='8.8' familyName='Linux' kernelVersion='4.18.0-477.21.1.el8_8.x86_64' prettyName='Red Hat Enterprise Linux 8.8 (Ootpa)'"
|
||||
+tools.remindInstall = "TRUE"
|
||||
+config.readOnly = "FALSE"
|
||||
+guestInfo.detailed.data = "architecture='X86' bitness='64' cpeString='cpe:/o:redhat:enterprise_linux:8::baseos' distroAddlVersion='8.10 (Ootpa)' distroName='Red Hat Enterprise Linux' distroVersion='8.10' familyName='Linux' kernelVersion='4.18.0-553.8.1.el8_10.x86_64' prettyName='Red Hat Enterprise Linux 8.10 (Ootpa)'"
|
||||
+log.keepOld = "10"
|
||||
+tools.setInfo.sizeLimit = "1048576"
|
||||
+RemoteDisplay.maxConnections = "1"
|
||||
+isolation.tools.diskWiper.disable = "True"
|
||||
+isolation.tools.vmxDnDVersionGet.disable = "True"
|
||||
+isolation.tools.copy.disable = "true"
|
||||
+isolation.device.connectable.disable = "True"
|
||||
+tools.guestlib.enableHostInfo = "False"
|
||||
+isolation.device.edit.disable = "True"
|
||||
+isolation.tools.setGUIOptions.enable = "False"
|
||||
+pciPassthru*.present = "False"
|
||||
+isolation.tools.dnd.disable = "true"
|
||||
+log.rotateSize = "1024000"
|
||||
+isolation.tools.paste.disable = "True"
|
||||
+isolation.tools.diskShrink.disable = "True"
|
||||
+time.synchronize.restore = "False"
|
||||
+time.synchronize.resume.disk = "False"
|
||||
+time.synchronize.tools.startup = "False"
|
||||
+time.synchronize.continue = "False"
|
||||
+time.synchronize.shrink = "False"
|
||||
+time.synchronize.tools.enable = "False"
|
||||
+mks.enable3d = "False"
|
||||
+time.synchronize.resume.host = "False"
|
||||
+ethernet0.addressType = "static"
|
||||
+ethernet0.pciSlotNumber = "192"
|
||||
+ethernet0.present = "TRUE"
|
||||
+ethernet0.uptCompatibility = "TRUE"
|
||||
+ethernet0.virtualDev = "vmxnet3"
|
||||
+floppy0.present = "FALSE"
|
||||
+ide0:0.deviceType = "atapi-cdrom"
|
||||
+ide0:0.present = "TRUE"
|
||||
+ide0:0.startConnected = "FALSE"
|
||||
+ethernet0.opaqueNetwork.id = "a2636d32-fc15-469f-b3b4-f8193fefd097"
|
||||
+ethernet0.opaqueNetwork.type = "nsx.LogicalSwitch"
|
||||
+ethernet0.address = "00:00:00:00:00:00"
|
||||
+vmotion.svga.mobMaxSize = "8388608"
|
||||
+vmotion.svga.graphicsMemoryKB = "8192"
|
||||
+scsi0:0.deviceType = "scsi-hardDisk"
|
||||
+scsi0:0.fileName = "wild1.vmdk"
|
||||
+sched.scsi0:0.shares = "normal"
|
||||
+sched.scsi0:0.throughputCap = "off"
|
||||
+scsi0:0.present = "TRUE"
|
||||
+scsi0:1.deviceType = "scsi-hardDisk"
|
||||
+scsi0:1.fileName = "wild2.vmdk"
|
||||
+sched.scsi0:1.shares = "normal"
|
||||
+sched.scsi0:1.throughputCap = "off"
|
||||
+scsi0:1.present = "TRUE"
|
||||
+bios.bootDelay = "10000"
|
||||
+scsi0:1.redo = ""
|
||||
+scsi0:0.redo = ""
|
||||
+ide0:0.fileName = "emptyBackingString"
|
||||
+ide0:0.clientDevice = "TRUE"
|
||||
+cleanShutdown = "FALSE"
|
||||
diff --git a/tests/vmx2xmldata/esx-in-the-wild-14.xml b/tests/vmx2xmldata/esx-in-the-wild-14.xml
|
||||
new file mode 100644
|
||||
index 0000000000..dd5c2434ee
|
||||
--- /dev/null
|
||||
+++ b/tests/vmx2xmldata/esx-in-the-wild-14.xml
|
||||
@@ -0,0 +1,35 @@
|
||||
+<domain type='vmware'>
|
||||
+ <name>wild14</name>
|
||||
+ <uuid>421b223a-f2c1-c7c9-a399-34d2d9fde26d</uuid>
|
||||
+ <description>execution env sandbox automation platform</description>
|
||||
+ <memory unit='KiB'>33554432</memory>
|
||||
+ <currentMemory unit='KiB'>33554432</currentMemory>
|
||||
+ <vcpu placement='static'>12</vcpu>
|
||||
+ <os>
|
||||
+ <type arch='x86_64'>hvm</type>
|
||||
+ </os>
|
||||
+ <clock offset='utc'/>
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
||||
+ <on_reboot>restart</on_reboot>
|
||||
+ <on_crash>destroy</on_crash>
|
||||
+ <devices>
|
||||
+ <disk type='file' device='disk'>
|
||||
+ <source file='[datastore] directory/wild1.vmdk'/>
|
||||
+ <target dev='sda' bus='scsi'/>
|
||||
+ <address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
+ </disk>
|
||||
+ <disk type='file' device='disk'>
|
||||
+ <source file='[datastore] directory/wild2.vmdk'/>
|
||||
+ <target dev='sdb' bus='scsi'/>
|
||||
+ <address type='drive' controller='0' bus='0' target='0' unit='1'/>
|
||||
+ </disk>
|
||||
+ <controller type='scsi' index='0' model='vmpvscsi'/>
|
||||
+ <interface type='null'>
|
||||
+ <mac address='00:00:00:00:00:00' type='static'/>
|
||||
+ <model type='vmxnet3'/>
|
||||
+ </interface>
|
||||
+ <video>
|
||||
+ <model type='vmvga' vram='8192' primary='yes'/>
|
||||
+ </video>
|
||||
+ </devices>
|
||||
+</domain>
|
||||
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
|
||||
index 0fb5f13f72..3ca9541000 100644
|
||||
--- a/tests/vmx2xmltest.c
|
||||
+++ b/tests/vmx2xmltest.c
|
||||
@@ -264,6 +264,7 @@ mymain(void)
|
||||
DO_TEST("esx-in-the-wild-11");
|
||||
DO_TEST("esx-in-the-wild-12");
|
||||
DO_TEST("esx-in-the-wild-13");
|
||||
+ DO_TEST("esx-in-the-wild-14");
|
||||
|
||||
DO_TEST("gsx-in-the-wild-1");
|
||||
DO_TEST("gsx-in-the-wild-2");
|
||||
--
|
||||
2.47.0
|
@ -0,0 +1,97 @@
|
||||
From b65fb6c87242f9bdb55821217da941c33ec245d5 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <b65fb6c87242f9bdb55821217da941c33ec245d5.1721637067.git.jdenemar@redhat.com>
|
||||
From: Martin Kletzander <mkletzan@redhat.com>
|
||||
Date: Fri, 12 Jul 2024 10:36:37 +0200
|
||||
Subject: [PATCH] vmx: Be even more lax when trying to comprehend serial ports
|
||||
|
||||
So much can happen in the fileName field of the VMX that the easiest
|
||||
thing is to silently report a serial type="null".
|
||||
|
||||
This effectively reverts commits de81bdb8d4cd and 62c53db0421a, but
|
||||
keeps the test files to show the fix is still in place.
|
||||
|
||||
There is one instance where an error gets reset, but since that is a
|
||||
rare case on its own and on top of that does not happen in any of our
|
||||
long-running daemons with a logfile that might get monitored it should
|
||||
be fine to leave it there.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-32182
|
||||
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
(cherry picked from commit 239669049d9904e5e8da2d8b2a38d4d927a167e9)
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
---
|
||||
src/vmx/vmx.c | 30 +++++++++++++-----------------
|
||||
1 file changed, 13 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
|
||||
index e5bc2d793c..227744d062 100644
|
||||
--- a/src/vmx/vmx.c
|
||||
+++ b/src/vmx/vmx.c
|
||||
@@ -2975,9 +2975,6 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
|
||||
char fileName_name[48] = "";
|
||||
g_autofree char *fileName = NULL;
|
||||
|
||||
- char vspc_name[48] = "";
|
||||
- g_autofree char *vspc = NULL;
|
||||
-
|
||||
char network_endPoint_name[48] = "";
|
||||
g_autofree char *network_endPoint = NULL;
|
||||
|
||||
@@ -3000,7 +2997,6 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
|
||||
VMX_BUILD_NAME(startConnected);
|
||||
VMX_BUILD_NAME(fileType);
|
||||
VMX_BUILD_NAME(fileName);
|
||||
- VMX_BUILD_NAME(vspc);
|
||||
VMX_BUILD_NAME_EXTRA(network_endPoint, "network.endPoint");
|
||||
|
||||
/* vmx:present */
|
||||
@@ -3030,10 +3026,6 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
|
||||
if (virVMXGetConfigString(conf, fileName_name, &fileName, true) < 0)
|
||||
goto cleanup;
|
||||
|
||||
- /* vmx:fileName -> def:data.file.path */
|
||||
- if (virVMXGetConfigString(conf, vspc_name, &vspc, true) < 0)
|
||||
- goto cleanup;
|
||||
-
|
||||
/* vmx:network.endPoint -> def:data.tcp.listen */
|
||||
if (virVMXGetConfigString(conf, network_endPoint_name, &network_endPoint,
|
||||
true) < 0) {
|
||||
@@ -3065,21 +3057,25 @@ virVMXParseSerial(virVMXContext *ctx, virConf *conf, int port,
|
||||
(*def)->target.port = port;
|
||||
(*def)->source->type = VIR_DOMAIN_CHR_TYPE_PIPE;
|
||||
(*def)->source->data.file.path = g_steal_pointer(&fileName);
|
||||
- } else if (STRCASEEQ(fileType, "network") && (vspc || !fileName || STREQ(fileName, ""))) {
|
||||
- (*def)->target.port = port;
|
||||
- (*def)->source->type = VIR_DOMAIN_CHR_TYPE_NULL;
|
||||
} else if (STRCASEEQ(fileType, "network")) {
|
||||
(*def)->target.port = port;
|
||||
(*def)->source->type = VIR_DOMAIN_CHR_TYPE_TCP;
|
||||
|
||||
- if (!(parsedUri = virURIParse(fileName)))
|
||||
- goto cleanup;
|
||||
+ if (!(parsedUri = virURIParse(fileName))) {
|
||||
+ /*
|
||||
+ * Ignore anything we cannot parse since there are many variations
|
||||
+ * that could lead to unusable or non-representable serial ports
|
||||
+ * which are very commonly seen and the main consumer of this driver
|
||||
+ * (virt-v2v) ignores them anyway, so let's at least not error out.
|
||||
+ */
|
||||
+ virResetLastError();
|
||||
+ (*def)->source->type = VIR_DOMAIN_CHR_TYPE_NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
if (parsedUri->port == 0) {
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
- _("VMX entry '%1$s' doesn't contain a port part"),
|
||||
- fileName_name);
|
||||
- goto cleanup;
|
||||
+ (*def)->source->type = VIR_DOMAIN_CHR_TYPE_NULL;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
(*def)->source->data.tcp.host = g_strdup(parsedUri->server);
|
||||
--
|
||||
2.45.2
|
@ -0,0 +1,171 @@
|
||||
From 945895b9af739a93690b1771e0e604b3a23fb7e0 Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <945895b9af739a93690b1771e0e604b3a23fb7e0.1720800605.git.jdenemar@redhat.com>
|
||||
From: Martin Kletzander <mkletzan@redhat.com>
|
||||
Date: Mon, 8 Jul 2024 13:04:13 +0200
|
||||
Subject: [PATCH] vmx: Do not require all ID data for VMWare Distributed Switch
|
||||
|
||||
Similarly to commit 2482801608b8 we can safely ignore connectionId,
|
||||
portId and portgroupId in both XML and VMX as they are only a blind
|
||||
pass-through between XML and VMX and an ethernet without such parameters
|
||||
was spotted in the wild. On top of that even our documentation says the
|
||||
whole VMWare Distrubuted Switch configuration is a best-effort.
|
||||
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-46099
|
||||
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
(cherry picked from commit db622081e0fa55b481da1fc7fb81279224a60f88)
|
||||
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
|
||||
---
|
||||
src/conf/domain_conf.c | 11 ++++-----
|
||||
src/conf/schemas/domaincommon.rng | 24 ++++++++++++-------
|
||||
src/vmx/vmx.c | 24 ++++++++++++-------
|
||||
...-portid.vmx => ethernet-vds-no-params.vmx} | 2 --
|
||||
...-portid.xml => ethernet-vds-no-params.xml} | 2 +-
|
||||
5 files changed, 37 insertions(+), 26 deletions(-)
|
||||
rename tests/vmx2xmldata/{ethernet-vds-no-portid.vmx => ethernet-vds-no-params.vmx} (76%)
|
||||
rename tests/vmx2xmldata/{ethernet-vds-no-portid.xml => ethernet-vds-no-params.xml} (82%)
|
||||
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
||||
index cb1154b23f..8a3c63b1fc 100644
|
||||
--- a/src/conf/domain_conf.c
|
||||
+++ b/src/conf/domain_conf.c
|
||||
@@ -9576,15 +9576,14 @@ virDomainNetDefParseXML(virDomainXMLOption *xmlopt,
|
||||
def->data.vds.switch_id) < 0)
|
||||
return NULL;
|
||||
|
||||
- if (virXMLPropLongLong(source_node, "portid", 0, VIR_XML_PROP_REQUIRED,
|
||||
- &def->data.vds.port_id, def->data.vds.port_id) < 0)
|
||||
+ if (virXMLPropLongLong(source_node, "portid", 0, VIR_XML_PROP_NONE,
|
||||
+ &def->data.vds.port_id, 0) < 0)
|
||||
return NULL;
|
||||
|
||||
- if (!(def->data.vds.portgroup_id = virXMLPropStringRequired(source_node, "portgroupid")))
|
||||
- return NULL;
|
||||
+ def->data.vds.portgroup_id = virXMLPropString(source_node, "portgroupid");
|
||||
|
||||
- if (virXMLPropLongLong(source_node, "connectionid", 0, VIR_XML_PROP_REQUIRED,
|
||||
- &def->data.vds.connection_id, def->data.vds.connection_id) < 0)
|
||||
+ if (virXMLPropLongLong(source_node, "connectionid", 0, VIR_XML_PROP_NONE,
|
||||
+ &def->data.vds.connection_id, 0) < 0)
|
||||
return NULL;
|
||||
|
||||
break;
|
||||
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
|
||||
index 844a931deb..51572f3e70 100644
|
||||
--- a/src/conf/schemas/domaincommon.rng
|
||||
+++ b/src/conf/schemas/domaincommon.rng
|
||||
@@ -3684,15 +3684,21 @@
|
||||
<attribute name="switchid">
|
||||
<ref name="UUID"/>
|
||||
</attribute>
|
||||
- <attribute name="portid">
|
||||
- <data type="long"/>
|
||||
- </attribute>
|
||||
- <attribute name="portgroupid">
|
||||
- <data type="string"/>
|
||||
- </attribute>
|
||||
- <attribute name="connectionid">
|
||||
- <data type="long"/>
|
||||
- </attribute>
|
||||
+ <optional>
|
||||
+ <attribute name="portid">
|
||||
+ <data type="long"/>
|
||||
+ </attribute>
|
||||
+ </optional>
|
||||
+ <optional>
|
||||
+ <attribute name="portgroupid">
|
||||
+ <data type="string"/>
|
||||
+ </attribute>
|
||||
+ </optional>
|
||||
+ <optional>
|
||||
+ <attribute name="connectionid">
|
||||
+ <data type="long"/>
|
||||
+ </attribute>
|
||||
+ </optional>
|
||||
</element>
|
||||
<ref name="interface-options"/>
|
||||
</interleave>
|
||||
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
|
||||
index d082a07660..e5bc2d793c 100644
|
||||
--- a/src/vmx/vmx.c
|
||||
+++ b/src/vmx/vmx.c
|
||||
@@ -2896,7 +2896,7 @@ virVMXParseEthernet(virConf *conf, int controller, virDomainNetDef **def)
|
||||
if (virVMXGetConfigString(conf,
|
||||
portgroupId_name,
|
||||
&(*def)->data.vds.portgroup_id,
|
||||
- false) < 0 ||
|
||||
+ true) < 0 ||
|
||||
virVMXGetConfigLong(conf,
|
||||
portId_name,
|
||||
&(*def)->data.vds.port_id,
|
||||
@@ -2906,7 +2906,7 @@ virVMXParseEthernet(virConf *conf, int controller, virDomainNetDef **def)
|
||||
connectionId_name,
|
||||
&(*def)->data.vds.connection_id,
|
||||
0,
|
||||
- false) < 0)
|
||||
+ true) < 0)
|
||||
goto cleanup;
|
||||
} else if (connectionType == NULL && networkName == NULL) {
|
||||
(*def)->type = VIR_DOMAIN_NET_TYPE_NULL;
|
||||
@@ -4038,14 +4038,22 @@ virVMXFormatEthernet(virDomainNetDef *def, int controller,
|
||||
uuid[5], uuid[6], uuid[7], uuid[8], uuid[9], uuid[10],
|
||||
uuid[11], uuid[12], uuid[13], uuid[14], uuid[15]);
|
||||
|
||||
- virBufferAsprintf(buffer, "ethernet%d.dvs.portId = \"%lld\"\n",
|
||||
- controller, def->data.vds.port_id);
|
||||
+ if (def->data.vds.port_id) {
|
||||
+ virBufferAsprintf(buffer, "ethernet%d.dvs.portId = \"%lld\"\n",
|
||||
+ controller, def->data.vds.port_id);
|
||||
+ }
|
||||
+
|
||||
+ if (def->data.vds.portgroup_id) {
|
||||
+ virBufferAsprintf(buffer, "ethernet%d.dvs.", controller);
|
||||
+ virBufferEscapeString(buffer, "portgroupId = \"%s\"\n",
|
||||
+ def->data.vds.portgroup_id);
|
||||
+ }
|
||||
|
||||
- virBufferAsprintf(buffer, "ethernet%d.dvs.", controller);
|
||||
- virBufferEscapeString(buffer, "portgroupId = \"%s\"\n", def->data.vds.portgroup_id);
|
||||
+ if (def->data.vds.connection_id) {
|
||||
+ virBufferAsprintf(buffer, "ethernet%d.dvs.connectionId = \"%lld\"\n",
|
||||
+ controller, def->data.vds.connection_id);
|
||||
+ }
|
||||
|
||||
- virBufferAsprintf(buffer, "ethernet%d.dvs.connectionId = \"%lld\"\n",
|
||||
- controller, def->data.vds.connection_id);
|
||||
break;
|
||||
}
|
||||
|
||||
diff --git a/tests/vmx2xmldata/ethernet-vds-no-portid.vmx b/tests/vmx2xmldata/ethernet-vds-no-params.vmx
|
||||
similarity index 76%
|
||||
rename from tests/vmx2xmldata/ethernet-vds-no-portid.vmx
|
||||
rename to tests/vmx2xmldata/ethernet-vds-no-params.vmx
|
||||
index 7761accb3a..90afbdac30 100644
|
||||
--- a/tests/vmx2xmldata/ethernet-vds-no-portid.vmx
|
||||
+++ b/tests/vmx2xmldata/ethernet-vds-no-params.vmx
|
||||
@@ -5,6 +5,4 @@ ethernet0.virtualDev = "e1000e"
|
||||
ethernet0.addressType = "vpx"
|
||||
ethernet0.generatedAddress = "00:50:56:87:65:43"
|
||||
ethernet0.dvs.switchId = "50 34 26 b2 94 e9 3b 16-1d 68 87 bf ff 4a 54 40"
|
||||
-ethernet0.dvs.portgroupId = "dvportgroup-1285"
|
||||
-ethernet0.dvs.connectionId = "408217997"
|
||||
displayName = "test"
|
||||
diff --git a/tests/vmx2xmldata/ethernet-vds-no-portid.xml b/tests/vmx2xmldata/ethernet-vds-no-params.xml
|
||||
similarity index 82%
|
||||
rename from tests/vmx2xmldata/ethernet-vds-no-portid.xml
|
||||
rename to tests/vmx2xmldata/ethernet-vds-no-params.xml
|
||||
index 60fd9c99fe..0011ba471a 100644
|
||||
--- a/tests/vmx2xmldata/ethernet-vds-no-portid.xml
|
||||
+++ b/tests/vmx2xmldata/ethernet-vds-no-params.xml
|
||||
@@ -14,7 +14,7 @@
|
||||
<devices>
|
||||
<interface type='vds'>
|
||||
<mac address='00:50:56:87:65:43' type='generated'/>
|
||||
- <source switchid='503426b2-94e9-3b16-1d68-87bfff4a5440' portid='0' portgroupid='dvportgroup-1285' connectionid='408217997'/>
|
||||
+ <source switchid='503426b2-94e9-3b16-1d68-87bfff4a5440'/>
|
||||
<model type='e1000e'/>
|
||||
</interface>
|
||||
<video>
|
||||
--
|
||||
2.45.2
|
@ -0,0 +1,43 @@
|
||||
From 02fdc3510afcd542bd80bf3ceada6f116555c12b Mon Sep 17 00:00:00 2001
|
||||
Message-ID: <02fdc3510afcd542bd80bf3ceada6f116555c12b.1723196972.git.jdenemar@redhat.com>
|
||||
From: Michal Privoznik <mprivozn@redhat.com>
|
||||
Date: Thu, 8 Aug 2024 14:21:20 +0200
|
||||
Subject: [PATCH] vsh: Allow vshReadlineInit() to be called multiple times
|
||||
|
||||
Thing about vshReadlineInit() is - it's called multiple times.
|
||||
The first time from vshInit(), when @ctl was filled only
|
||||
partially (most notably, before any argv parsing is done, hence
|
||||
ctl->imode is set to false). The second time after argv parsing,
|
||||
from virshInit() -> vshInitReload(). In here, ctl->imode might
|
||||
have changed and thus vshReadlineInit() can't exit early - it
|
||||
needs to set up stuff for interactive mode (history basically).
|
||||
|
||||
To allow vshReadlineInit() to be called again,
|
||||
vshReadlineDeinit() must set @autoCompleteOpaque to NULL.
|
||||
|
||||
Fixes: cab1e71f0161fd24c5d6ff4c379d3a242ea8c2d9
|
||||
Resolves: https://issues.redhat.com/browse/RHEL-53560
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
|
||||
(cherry picked from commit 18fd4899f3ddd8873842ab24cf39bf51b1bf3a02)
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
|
||||
---
|
||||
tools/vsh.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/tools/vsh.c b/tools/vsh.c
|
||||
index 9fbb1f9349..5f5e2f281d 100644
|
||||
--- a/tools/vsh.c
|
||||
+++ b/tools/vsh.c
|
||||
@@ -3040,6 +3040,9 @@ vshReadlineDeinit(vshControl *ctl)
|
||||
|
||||
g_clear_pointer(&ctl->historydir, g_free);
|
||||
g_clear_pointer(&ctl->historyfile, g_free);
|
||||
+
|
||||
+ /* Allow vshReadlineInit() to be called again. */
|
||||
+ autoCompleteOpaque = NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
--
|
||||
2.46.0
|
1132
SOURCES/symlinks
1132
SOURCES/symlinks
File diff suppressed because it is too large
Load Diff
@ -90,6 +90,7 @@
|
||||
|
||||
# Other optional features
|
||||
%define with_numactl 0%{!?_without_numactl:1}
|
||||
%define with_userfaultfd_sysctl 0%{!?_without_userfaultfd_sysctl:1}
|
||||
|
||||
# A few optional bits off by default, we enable later
|
||||
%define with_fuse 0
|
||||
@ -204,6 +205,18 @@
|
||||
%define with_modular_daemons 1
|
||||
%endif
|
||||
|
||||
# Prefer nftables for future OS releases but keep using iptables
|
||||
# for existing ones
|
||||
%if 0%{?rhel} >= 10 || 0%{?fedora} >= 41
|
||||
%define prefer_nftables 1
|
||||
%define firewall_backend_priority nftables,iptables
|
||||
%else
|
||||
%define prefer_nftables 0
|
||||
%define firewall_backend_priority iptables,nftables
|
||||
%endif
|
||||
|
||||
|
||||
|
||||
# Force QEMU to run as non-root
|
||||
%define qemu_user qemu
|
||||
%define qemu_group qemu
|
||||
@ -246,6 +259,12 @@
|
||||
%define enable_werror -Dwerror=false -Dgit_werror=disabled
|
||||
%endif
|
||||
|
||||
# Fedora and RHEL-9 are new enough to support /dev/userfaultfd, which
|
||||
# does not require enabling vm.unprivileged_userfaultfd sysctl.
|
||||
%if 0%{?fedora} || 0%{?rhel} >= 9
|
||||
%define with_userfaultfd_sysctl 0
|
||||
%endif
|
||||
|
||||
%define tls_priority "@LIBVIRT,SYSTEM"
|
||||
|
||||
# libvirt 8.1.0 stops distributing any sysconfig files.
|
||||
@ -269,75 +288,52 @@
|
||||
|
||||
Summary: Library providing a simple virtualization API
|
||||
Name: libvirt
|
||||
Version: 10.0.0
|
||||
Release: 4%{?dist}%{?extra_release}
|
||||
Version: 10.5.0
|
||||
Release: 7.2.0.1%{?dist}%{?extra_release}
|
||||
License: GPL-2.0-or-later AND LGPL-2.1-only AND LGPL-2.1-or-later AND OFL-1.1
|
||||
URL: https://libvirt.org/
|
||||
|
||||
%if %(echo %{version} | grep -q "\.0$"; echo $?) == 1
|
||||
%if %(echo %{version} | grep "\.0$" >/dev/null; echo $?) == 1
|
||||
%define mainturl stable_updates/
|
||||
%endif
|
||||
Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz
|
||||
Source1: symlinks
|
||||
Patch1: libvirt-tests-Add-hostcpudata-for-machine-with-CPU-clusters.patch
|
||||
Patch2: libvirt-conf-Report-CPU-clusters-in-capabilities-XML.patch
|
||||
Patch3: libvirt-conf-Allow-specifying-CPU-clusters.patch
|
||||
Patch4: libvirt-qemu-Introduce-QEMU_CAPS_SMP_CLUSTERS.patch
|
||||
Patch5: libvirt-qemu-Use-CPU-clusters-for-guests.patch
|
||||
Patch6: libvirt-tests-Add-test-case-for-CPU-clusters.patch
|
||||
Patch7: libvirt-qemu-Make-monitor-aware-of-CPU-clusters.patch
|
||||
Patch8: libvirt-tests-Verify-handling-of-CPU-clusters-in-QMP-data.patch
|
||||
Patch9: libvirt-build-Make-daemons-depend-on-generated-_protocol.-ch.patch
|
||||
Patch10: libvirt-domain_validate-Check-for-domain-address-conflicts-fully.patch
|
||||
Patch11: libvirt-qemu_hotplug-Don-t-lose-created-flag-in-qemuDomainChangeNet.patch
|
||||
Patch12: libvirt-remote_driver-Restore-special-behavior-of-remoteDomainGetBlockIoTune.patch
|
||||
Patch13: libvirt-conf-Introduce-dynamicMemslots-attribute-for-virtio-mem.patch
|
||||
Patch14: libvirt-qemu_capabilities-Add-QEMU_CAPS_DEVICE_VIRTIO_MEM_PCI_DYNAMIC_MEMSLOTS-capability.patch
|
||||
Patch15: libvirt-qemu_validate-Check-capability-for-virtio-mem-dynamicMemslots.patch
|
||||
Patch16: libvirt-qemu_command-Generate-cmd-line-for-virtio-mem-dynamicMemslots.patch
|
||||
Patch17: libvirt-qemu_snapshot-fix-detection-if-non-leaf-snapshot-isn-t-in-active-chain.patch
|
||||
Patch18: libvirt-qemu_snapshot-create-refactor-external-snapshot-detection.patch
|
||||
Patch19: libvirt-qemu_snapshot-create-don-t-require-disk-only-flag-for-offline-external-snapshot.patch
|
||||
Patch20: libvirt-remoteDispatchAuthPolkit-Fix-lock-ordering-deadlock-if-client-closes-connection-during-auth.patch
|
||||
Patch21: libvirt-util-virtportallocator-Add-VIR_DEBUG-statements-for-port-allocations-and-release.patch
|
||||
Patch22: libvirt-qemu-migration-Properly-handle-reservation-of-manually-specified-NBD-port.patch
|
||||
Patch23: libvirt-qemuMigrationDstStartNBDServer-Refactor-cleanup.patch
|
||||
Patch24: libvirt-virPCIVPDResourceIsValidTextValue-Adjust-comment-to-reflect-actual-code.patch
|
||||
Patch25: libvirt-util-pcivpd-Refactor-virPCIVPDResourceIsValidTextValue.patch
|
||||
Patch26: libvirt-virNodeDeviceCapVPDFormatCustom-Escape-unsanitized-strings.patch
|
||||
Patch27: libvirt-virNodeDeviceCapVPDFormat-Properly-escape-system-originated-strings.patch
|
||||
Patch28: libvirt-schema-nodedev-Adjust-allowed-characters-in-vpdFieldValueFormat.patch
|
||||
Patch29: libvirt-tests-Test-the-previously-mishandled-PCI-VPD-characters.patch
|
||||
Patch30: libvirt-Don-t-overwrite-error-message-from-virXPathNodeSet.patch
|
||||
Patch31: libvirt-tests-virpcivpdtest-Remove-testVirPCIVPDReadVPDBytes-case.patch
|
||||
Patch32: libvirt-util-virpcivpd-Unexport-virPCIVPDReadVPDBytes.patch
|
||||
Patch33: libvirt-util-pcivpd-Unexport-virPCIVPDParseVPDLargeResourceFields.patch
|
||||
Patch34: libvirt-tests-virpcivpd-Remove-testVirPCIVPDParseVPDStringResource-case.patch
|
||||
Patch35: libvirt-util-virpcivpd-Unexport-virPCIVPDParseVPDLargeResourceString.patch
|
||||
Patch36: libvirt-virPCIVPDResourceGetKeywordPrefix-Fix-logging.patch
|
||||
Patch37: libvirt-util-virpcivpd-Remove-return-value-from-virPCIVPDResourceCustomUpsertValue.patch
|
||||
Patch38: libvirt-conf-virNodeDeviceCapVPDParse-Remove-pointless-NULL-checks.patch
|
||||
Patch39: libvirt-virpcivpdtest-testPCIVPDResourceBasic-Remove-tests-for-uninitialized-ro-rw-section.patch
|
||||
Patch40: libvirt-util-virPCIVPDResourceUpdateKeyword-Remove-impossible-checks.patch
|
||||
Patch41: libvirt-conf-node_device-Refactor-virNodeDeviceCapVPDParseCustomFields-to-fix-error-reporting.patch
|
||||
Patch42: libvirt-virNodeDeviceCapVPDParseXML-Fix-error-reporting.patch
|
||||
Patch43: libvirt-util-virpcivpd-Remove-return-value-from-virPCIVPDResourceUpdateKeyword.patch
|
||||
Patch44: libvirt-virPCIDeviceHasVPD-Refactor-debug-messages.patch
|
||||
Patch45: libvirt-virPCIDeviceGetVPD-Fix-multiple-error-handling-bugs.patch
|
||||
Patch46: libvirt-virPCIDeviceGetVPD-Handle-errors-in-callers.patch
|
||||
Patch47: libvirt-virPCIVPDReadVPDBytes-Refactor-error-handling.patch
|
||||
Patch48: libvirt-virPCIVPDParseVPDLargeResourceString-Properly-report-errors.patch
|
||||
Patch49: libvirt-virPCIVPDParseVPDLargeResourceFields-Merge-logic-conditions.patch
|
||||
Patch50: libvirt-virPCIVPDParseVPDLargeResourceFields-Remove-impossible-default-switch-case.patch
|
||||
Patch51: libvirt-virPCIVPDParseVPDLargeResourceFields-Refactor-processing-of-read-data.patch
|
||||
Patch52: libvirt-virPCIVPDParseVPDLargeResourceFields-Refactor-return-logic.patch
|
||||
Patch53: libvirt-virPCIVPDParseVPDLargeResourceFields-Report-proper-errors.patch
|
||||
Patch54: libvirt-virPCIVPDParse-Do-reasonable-error-reporting.patch
|
||||
Patch55: libvirt-virt-admin-Add-warning-when-connection-to-default-daemon-fails.patch
|
||||
Patch56: libvirt-Set-stubDriverName-from-hostdev-driver-model-attribute-during-pci-device-setup.patch
|
||||
Patch57: libvirt-qemuMigrationDstPrepareStorage-Use-switch-statement-to-include-all-storage-types.patch
|
||||
Patch58: libvirt-qemuMigrationDstPrepareStorage-Properly-consider-path-for-vdpa-devices.patch
|
||||
Patch59: libvirt-domain_validate-Account-for-NVDIMM-label-size-properly-when-checking-for-memory-conflicts.patch
|
||||
Patch1: libvirt-vmx-Do-not-require-all-ID-data-for-VMWare-Distributed-Switch.patch
|
||||
Patch2: libvirt-tests-vhostuser-add-virtiofsd-json-descriptor.patch
|
||||
Patch3: libvirt-tests-qemuxmlconf-adjust-test-case-to-new-virtiofsd.patch
|
||||
Patch4: libvirt-qemu-fill-capabilities-for-virtiofsd.patch
|
||||
Patch5: libvirt-qemu-do-not-use-deprecated-options-for-new-virtiofsd.patch
|
||||
Patch6: libvirt-qemu-migration-allow-migration-for-virtiofs.patch
|
||||
Patch7: libvirt-virt-host-validate-Drop-extra-PASS.patch
|
||||
Patch8: libvirt-qemu-Don-t-leave-beingDestroyed-true-on-inactive-domain.patch
|
||||
Patch9: libvirt-vmx-Be-even-more-lax-when-trying-to-comprehend-serial-ports.patch
|
||||
Patch10: libvirt-virt-host-validate-Allow-longer-list-of-CPU-flags.patch
|
||||
Patch11: libvirt-qemu-virtiofs-cache-use-never-instead-of-none.patch
|
||||
Patch12: libvirt-qemu_domain-Strip-acpi-from-s390-x-definitions.patch
|
||||
Patch13: libvirt-qemuxmlconftest-Add-tests-for-the-ACPI-stripping-hack-on-s390.patch
|
||||
Patch14: libvirt-vsh-Allow-vshReadlineInit-to-be-called-multiple-times.patch
|
||||
Patch15: libvirt-udevListInterfaces-Honour-array-length-for-zero-length-NULL-arrays-CVE-2024-8235.patch
|
||||
Patch16: libvirt-qemu-Refactor-default-panic-model.patch
|
||||
Patch17: libvirt-qemu-Sometimes-the-default-panic-model-doesn-t-exist.patch
|
||||
Patch18: libvirt-qemu-Use-pvpanic-by-default-on-aarch64.patch
|
||||
Patch19: libvirt-qemu-migration-Pre-create-QCOW2-images-for-non-shared-storage-with-0-allocation.patch
|
||||
Patch20: libvirt-virTypedParamsFilter-Adjust-return-type-and-docs.patch
|
||||
Patch21: libvirt-virTypedParamsGetStringList-Refactor-and-adjust-docs.patch
|
||||
Patch22: libvirt-virTypedParamsFilter-Introduce-option-to-filter-also-by-type.patch
|
||||
Patch23: libvirt-virTypedParamsGetStringList-Ensure-that-returned-array-is-NULL-if-there-are-no-matching-fields.patch
|
||||
Patch24: libvirt-virTypedParamsGetStringList-Ensure-that-returned-string-list-is-NULL-terminated.patch
|
||||
Patch25: libvirt-qemuMigrationSrcBeginPhaseBlockDirtyBitmaps-Use-qemuMigrationAnyCopyDisk.patch
|
||||
Patch26: libvirt-qemu-migration-Don-t-log-nmigrate_disks.patch
|
||||
Patch27: libvirt-qemu-migration-Avoid-use-of-nmigration_disks.patch
|
||||
Patch28: libvirt-qemu-migration-Extract-validation-of-disk-target-list.patch
|
||||
Patch29: libvirt-qemu-migration-Remove-nmigration_disks-variable-from-all-places.patch
|
||||
Patch30: libvirt-qemu-Introduce-and-wire-in-VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES.patch
|
||||
Patch31: libvirt-virsh-Add-support-for-VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES-migration-parameter.patch
|
||||
Patch32: libvirt-qemu-migration-Fix-blockdev-config-with-VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES.patch
|
||||
Patch33: libvirt-docs-Add-warning-about-using-a-cleared-image-with-VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES_ZEROES.patch
|
||||
Patch34: libvirt-util-Look-for-newer-name-of-cpu-wait-time-statistic.patch
|
||||
Patch35: libvirt-vmx-Allow-to-appear-in-VMX-file-keys.patch
|
||||
Patch36: libvirt-qemu-Add-support-for-postcopy-recover-setup-migration-state.patch
|
||||
Patch37: libvirt-qemu-Avoid-false-failure-when-resuming-post-copy-migration.patch
|
||||
|
||||
|
||||
Requires: libvirt-daemon = %{version}-%{release}
|
||||
@ -390,10 +386,10 @@ BuildRequires: gcc
|
||||
%if %{with_libxl}
|
||||
BuildRequires: xen-devel
|
||||
%endif
|
||||
BuildRequires: glib2-devel >= 2.56
|
||||
BuildRequires: glib2-devel >= 2.58
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: readline-devel
|
||||
BuildRequires: bash-completion >= 2.0
|
||||
BuildRequires: pkgconfig(bash-completion) >= 2.0
|
||||
BuildRequires: libtasn1-devel
|
||||
BuildRequires: gnutls-devel
|
||||
BuildRequires: libattr-devel
|
||||
@ -410,8 +406,6 @@ BuildRequires: sanlock-devel >= 2.4
|
||||
BuildRequires: libpcap-devel >= 1.5.0
|
||||
BuildRequires: libnl3-devel
|
||||
BuildRequires: libselinux-devel
|
||||
BuildRequires: iptables
|
||||
BuildRequires: ebtables
|
||||
# For modprobe
|
||||
BuildRequires: kmod
|
||||
BuildRequires: cyrus-sasl-devel
|
||||
@ -648,7 +642,11 @@ Summary: Network driver plugin for the libvirtd daemon
|
||||
Requires: libvirt-daemon-common = %{version}-%{release}
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
Requires: dnsmasq >= 2.41
|
||||
%if %{prefer_nftables}
|
||||
Requires: nftables
|
||||
%else
|
||||
Requires: iptables
|
||||
%endif
|
||||
|
||||
%description daemon-driver-network
|
||||
The network driver plugin for the libvirtd daemon, providing
|
||||
@ -674,6 +672,7 @@ Requires: libvirt-libs = %{version}-%{release}
|
||||
# needed for device enumeration
|
||||
Requires: systemd >= 185
|
||||
# For managing persistent mediated devices
|
||||
# Note: for nodedev-update support at least mdevctl v1.3.0 is required
|
||||
Requires: mdevctl
|
||||
# for modprobe of pci devices
|
||||
Requires: module-init-tools
|
||||
@ -868,6 +867,7 @@ Requires: gzip
|
||||
Requires: bzip2
|
||||
Requires: lzop
|
||||
Requires: xz
|
||||
Requires: zstd
|
||||
Requires: systemd-container
|
||||
Requires: swtpm-tools
|
||||
%if %{with_numad}
|
||||
@ -955,6 +955,7 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
|
||||
Requires: libvirt-ssh-proxy = %{version}-%{release}
|
||||
Requires: qemu
|
||||
|
||||
%description daemon-qemu
|
||||
@ -983,6 +984,7 @@ Requires: libvirt-daemon-driver-nodedev = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-nwfilter = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-secret = %{version}-%{release}
|
||||
Requires: libvirt-daemon-driver-storage = %{version}-%{release}
|
||||
Requires: libvirt-ssh-proxy = %{version}-%{release}
|
||||
Requires: qemu-kvm
|
||||
|
||||
%description daemon-kvm
|
||||
@ -1068,8 +1070,6 @@ capabilities of VirtualBox
|
||||
%package client
|
||||
Summary: Client side utilities of the libvirt library
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
# Needed by virt-pki-validate script.
|
||||
Requires: gnutls-utils
|
||||
|
||||
# Ensure smooth upgrades
|
||||
Obsoletes: libvirt-bash-completion < 7.3.0
|
||||
@ -1091,8 +1091,6 @@ with some QEMU specific features of libvirt.
|
||||
|
||||
%package libs
|
||||
Summary: Client side libraries
|
||||
# So remote clients can access libvirt over SSH tunnel
|
||||
Requires: cyrus-sasl
|
||||
# Needed by default sasl.conf - no onerous extra deps, since
|
||||
# 100's of other things on a system already pull in krb5-libs
|
||||
Requires: cyrus-sasl-gssapi
|
||||
@ -1152,6 +1150,13 @@ Requires: libvirt-daemon-driver-network = %{version}-%{release}
|
||||
Libvirt plugin for NSS for translating domain names into IP addresses.
|
||||
%endif
|
||||
|
||||
%package ssh-proxy
|
||||
Summary: Libvirt SSH proxy
|
||||
Requires: libvirt-libs = %{version}-%{release}
|
||||
|
||||
%description ssh-proxy
|
||||
Allows SSH into domains via VSOCK without need for network.
|
||||
|
||||
%if %{with_mingw32}
|
||||
%package -n mingw32-libvirt
|
||||
Summary: %{summary}
|
||||
@ -1179,23 +1184,9 @@ MinGW Windows libvirt virtualization library.
|
||||
%prep
|
||||
%autosetup -S git_am -N
|
||||
|
||||
# "make dist" replaces all symlinks with a copy of the linked files;
|
||||
# we need to replace all of them with the original symlinks
|
||||
echo "Restoring symlinks"
|
||||
while read lnk target; do
|
||||
if [ -e $lnk ]; then
|
||||
rm -rf $lnk
|
||||
ln -s $target $lnk
|
||||
fi
|
||||
done <%{_sourcedir}/symlinks || exit 1
|
||||
git add .
|
||||
git commit -q -a --allow-empty --author 'rpm-build <rpm-build>' -m symlinks
|
||||
|
||||
|
||||
git config gc.auto 0
|
||||
|
||||
%autopatch
|
||||
|
||||
|
||||
%build
|
||||
%if 0%{?fedora} >= %{min_fedora} || 0%{?rhel} >= %{min_rhel}
|
||||
%define supported_platform 1
|
||||
@ -1354,6 +1345,12 @@ exit 1
|
||||
%define arg_remote_mode -Dremote_default_mode=legacy
|
||||
%endif
|
||||
|
||||
%if %{with_userfaultfd_sysctl}
|
||||
%define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=enabled
|
||||
%else
|
||||
%define arg_userfaultfd_sysctl -Duserfaultfd_sysctl=disabled
|
||||
%endif
|
||||
|
||||
%define when %(date +"%%F-%%T")
|
||||
%define where %(hostname)
|
||||
%define who %{?packager}%{!?packager:Unknown}
|
||||
@ -1361,7 +1358,8 @@ exit 1
|
||||
%define arg_packager_version -Dpackager_version="%{release}"
|
||||
%define arg_selinux_mount -Dselinux_mount="/sys/fs/selinux"
|
||||
|
||||
# place macros above and build commands below this comment
|
||||
# Set SOURCE_DATE_EPOCH from changelog
|
||||
%define source_date_epoch_from_changelog 1
|
||||
|
||||
export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
|
||||
|
||||
@ -1369,6 +1367,8 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
|
||||
%meson \
|
||||
-Drunstatedir=%{_rundir} \
|
||||
-Dinitconfdir=%{_sysconfdir}/sysconfig \
|
||||
-Dunitdir=%{_unitdir} \
|
||||
-Dsysusersdir=%{_sysusersdir} \
|
||||
%{?arg_qemu} \
|
||||
%{?arg_openvz} \
|
||||
%{?arg_lxc} \
|
||||
@ -1433,9 +1433,13 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
|
||||
-Dqemu_moddir=%{qemu_moddir} \
|
||||
-Dqemu_datadir=%{qemu_datadir} \
|
||||
-Dtls_priority=%{tls_priority} \
|
||||
-Dsysctl_config=enabled \
|
||||
%{?arg_userfaultfd_sysctl} \
|
||||
-Dssh_proxy=enabled \
|
||||
%{?enable_werror} \
|
||||
-Dexpensive_tests=enabled \
|
||||
-Dinit_script=systemd \
|
||||
-Dfirewall_backend_priority=%{firewall_backend_priority} \
|
||||
-Ddocs=enabled \
|
||||
-Dtests=enabled \
|
||||
-Drpath=disabled \
|
||||
@ -1516,11 +1520,14 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
|
||||
-Dstorage_vstorage=disabled \
|
||||
-Dstorage_zfs=disabled \
|
||||
-Dsysctl_config=disabled \
|
||||
-Duserfaultfd_sysctl=disabled \
|
||||
-Dssh_proxy=disabled \
|
||||
-Dtests=disabled \
|
||||
-Dudev=disabled \
|
||||
-Dwireshark_dissector=disabled \
|
||||
-Dyajl=disabled
|
||||
%mingw_ninja
|
||||
-Dyajl=disabled \
|
||||
%{?enable_werror}
|
||||
%mingw_ninja
|
||||
%endif
|
||||
|
||||
%install
|
||||
@ -1551,6 +1558,7 @@ chmod 600 $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/nwfilter/*.xml
|
||||
%if ! %{with_qemu}
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_qemu.aug
|
||||
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_qemu.aug
|
||||
rm -f $RPM_BUILD_ROOT%{_sysusersdir}/libvirt-qemu.conf
|
||||
%endif
|
||||
%find_lang %{name}
|
||||
|
||||
@ -1625,7 +1633,8 @@ rm -rf $RPM_BUILD_ROOT%{mingw64_libexecdir}/libvirt-guests.sh
|
||||
%if %{with_native}
|
||||
# Building on slow archs, like emulated s390x in Fedora copr, requires
|
||||
# raising the test timeout
|
||||
VIR_TEST_DEBUG=1 %meson_test --no-suite syntax-check --timeout-multiplier 10
|
||||
export VIR_TEST_DEBUG=1
|
||||
%meson_test --no-suite syntax-check --timeout-multiplier 10
|
||||
%endif
|
||||
|
||||
%define libvirt_rpmstatedir %{_localstatedir}/lib/rpm-state/libvirt
|
||||
@ -1912,16 +1921,19 @@ exit 0
|
||||
%pre daemon-driver-qemu
|
||||
%libvirt_sysconfig_pre virtqemud
|
||||
%libvirt_systemd_unix_pre virtqemud
|
||||
|
||||
# We want soft static allocation of well-known ids, as disk images
|
||||
# are commonly shared across NFS mounts by id rather than name; see
|
||||
# https://fedoraproject.org/wiki/Packaging:UsersAndGroups
|
||||
getent group kvm >/dev/null || groupadd -f -g 36 -r kvm
|
||||
getent group qemu >/dev/null || groupadd -f -g 107 -r qemu
|
||||
if ! getent passwd qemu >/dev/null; then
|
||||
if ! getent passwd 107 >/dev/null; then
|
||||
useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
||||
# are commonly shared across NFS mounts by id rather than name.
|
||||
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/
|
||||
# We can not use the sysusers_create_compat macro here as we want to keep the
|
||||
# specfile standalone and not relying on additionnal files.
|
||||
getent group 'kvm' >/dev/null || groupadd -f -g '36' -r 'kvm' || :
|
||||
getent group 'qemu' >/dev/null || groupadd -f -g '107' -r 'qemu' || :
|
||||
if ! getent passwd 'qemu' >/dev/null; then
|
||||
if ! getent passwd '107' >/dev/null; then
|
||||
useradd -r -u '107' -g 'qemu' -G 'kvm' -d '/' -s '/sbin/nologin' -c 'qemu user' 'qemu' || :
|
||||
else
|
||||
useradd -r -g qemu -G kvm -d / -s /sbin/nologin -c "qemu user" qemu
|
||||
useradd -r -g 'qemu' -G 'kvm' -d '/' -s '/sbin/nologin' -c 'qemu user' 'qemu' || :
|
||||
fi
|
||||
fi
|
||||
exit 0
|
||||
@ -2165,6 +2177,9 @@ exit 0
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtnetworkd.conf
|
||||
%{_datadir}/augeas/lenses/virtnetworkd.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtnetworkd.aug
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/network.conf
|
||||
%{_datadir}/augeas/lenses/libvirtd_network.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_libvirtd_network.aug
|
||||
%{_unitdir}/virtnetworkd.service
|
||||
%{_unitdir}/virtnetworkd.socket
|
||||
%{_unitdir}/virtnetworkd-ro.socket
|
||||
@ -2289,7 +2304,9 @@ exit 0
|
||||
%if %{with_qemu}
|
||||
%files daemon-driver-qemu
|
||||
%config(noreplace) %{_sysconfdir}/libvirt/virtqemud.conf
|
||||
%if %{with_userfaultfd_sysctl}
|
||||
%config(noreplace) %{_prefix}/lib/sysctl.d/60-qemu-postcopy-migration.conf
|
||||
%endif
|
||||
%{_datadir}/augeas/lenses/virtqemud.aug
|
||||
%{_datadir}/augeas/lenses/tests/test_virtqemud.aug
|
||||
%{_unitdir}/virtqemud.service
|
||||
@ -2324,6 +2341,7 @@ exit 0
|
||||
%{_bindir}/virt-qemu-run
|
||||
%{_mandir}/man1/virt-qemu-run.1*
|
||||
%{_mandir}/man8/virtqemud.8*
|
||||
%{_sysusersdir}/libvirt-qemu.conf
|
||||
%endif
|
||||
|
||||
%if %{with_lxc}
|
||||
@ -2479,6 +2497,10 @@ exit 0
|
||||
%{_libdir}/libnss_libvirt.so.2
|
||||
%{_libdir}/libnss_libvirt_guest.so.2
|
||||
|
||||
%files ssh-proxy
|
||||
%config(noreplace) %{_sysconfdir}/ssh/ssh_config.d/30-libvirt-ssh-proxy.conf
|
||||
%{_libexecdir}/libvirt-ssh-proxy
|
||||
|
||||
%if %{with_lxc}
|
||||
%files login-shell
|
||||
%attr(4750, root, virtlogin) %{_bindir}/virt-login-shell
|
||||
@ -2532,7 +2554,7 @@ exit 0
|
||||
%{mingw32_bindir}/virt-admin.exe
|
||||
%{mingw32_bindir}/virt-xml-validate
|
||||
%{mingw32_bindir}/virt-pki-query-dn.exe
|
||||
%{mingw32_bindir}/virt-pki-validate
|
||||
%{mingw32_bindir}/virt-pki-validate.exe
|
||||
%{mingw32_bindir}/libvirt-lxc-0.dll
|
||||
%{mingw32_bindir}/libvirt-qemu-0.dll
|
||||
%{mingw32_bindir}/libvirt-admin-0.dll
|
||||
@ -2591,7 +2613,7 @@ exit 0
|
||||
%{mingw64_bindir}/virt-admin.exe
|
||||
%{mingw64_bindir}/virt-xml-validate
|
||||
%{mingw64_bindir}/virt-pki-query-dn.exe
|
||||
%{mingw64_bindir}/virt-pki-validate
|
||||
%{mingw64_bindir}/virt-pki-validate.exe
|
||||
%{mingw64_bindir}/libvirt-lxc-0.dll
|
||||
%{mingw64_bindir}/libvirt-qemu-0.dll
|
||||
%{mingw64_bindir}/libvirt-admin-0.dll
|
||||
@ -2641,6 +2663,115 @@ exit 0
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Sat Jan 04 2025 EL Errata <el-errata_ww@oracle.com> - 10.5.0-7.2.0.1
|
||||
- Set SOURCE_DATE_EPOCH from changelog [Orabug: 32019554]
|
||||
|
||||
* Mon Nov 4 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-7.2.el9_5
|
||||
- qemu: Add support for postcopy-recover-setup migration state (RHEL-63877)
|
||||
- qemu: Avoid false failure when resuming post-copy migration (RHEL-63877)
|
||||
|
||||
* Tue Oct 22 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-7.1.el9_5
|
||||
- qemu: migration: Pre-create QCOW2 images for non-shared storage with 0 allocation (RHEL-61177)
|
||||
- virTypedParamsFilter: Adjust return type and docs (RHEL-61177)
|
||||
- virTypedParamsGetStringList: Refactor and adjust docs (RHEL-61177)
|
||||
- virTypedParamsFilter: Introduce option to filter also by type (RHEL-61177)
|
||||
- virTypedParamsGetStringList: Ensure that returned array is NULL if there are no matching fields (RHEL-61177)
|
||||
- virTypedParamsGetStringList: Ensure that returned string list is NULL-terminated (RHEL-61177)
|
||||
- qemuMigrationSrcBeginPhaseBlockDirtyBitmaps: Use qemuMigrationAnyCopyDisk() (RHEL-61177)
|
||||
- qemu: migration: Don't log 'nmigrate_disks' (RHEL-61177)
|
||||
- qemu: migration: Avoid use of 'nmigration_disks' (RHEL-61177)
|
||||
- qemu: migration: Extract validation of disk target list (RHEL-61177)
|
||||
- qemu: migration: Remove 'nmigration_disks' variable from all places (RHEL-61177)
|
||||
- qemu: Introduce and wire in 'VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES' (RHEL-61177)
|
||||
- virsh: Add support for VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES migration parameter (RHEL-61177)
|
||||
- qemu: migration: Fix blockdev config with VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES (RHEL-61177)
|
||||
- docs: Add warning about using a cleared image with VIR_MIGRATE_PARAM_MIGRATE_DISKS_DETECT_ZEROES_ZEROES (RHEL-61177)
|
||||
- util: Look for newer name of cpu wait time statistic (RHEL-61511)
|
||||
- vmx: Allow '*' to appear in VMX file keys (RHEL-58677)
|
||||
|
||||
* Fri Sep 6 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-7
|
||||
- qemu: Refactor default panic model (RHEL-56451)
|
||||
- qemu: Sometimes the default panic model doesn't exist (RHEL-56451)
|
||||
- qemu: Use pvpanic by default on aarch64 (RHEL-56451)
|
||||
|
||||
* Mon Sep 2 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-6
|
||||
- udevListInterfaces: Honour array length for zero-length NULL arrays (CVE-2024-8235) (CVE-2024-8235, RHEL-55373)
|
||||
|
||||
* Fri Aug 9 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-5
|
||||
- qemu: virtiofs: cache: use 'never' instead of 'none' (RHEL-50329)
|
||||
- qemu_domain: Strip <acpi/> from s390(x) definitions (RHEL-49516)
|
||||
- qemuxmlconftest: Add tests for the ACPI stripping hack on s390 (RHEL-49516)
|
||||
- vsh: Allow vshReadlineInit() to be called multiple times (RHEL-53560)
|
||||
|
||||
* Tue Jul 23 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-4
|
||||
- virt-host-validate: Allow longer list of CPU flags (RHEL-39969)
|
||||
|
||||
* Mon Jul 22 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-3
|
||||
- vmx: Be even more lax when trying to comprehend serial ports (RHEL-32182)
|
||||
|
||||
* Fri Jul 12 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-2
|
||||
- vmx: Do not require all ID data for VMWare Distributed Switch (RHEL-46099)
|
||||
- tests: vhostuser: add virtiofsd json descriptor (RHEL-7108, RHEL-40135)
|
||||
- tests: qemuxmlconf: adjust test case to new virtiofsd (RHEL-7108, RHEL-40135)
|
||||
- qemu: fill capabilities for virtiofsd (RHEL-7108, RHEL-40135)
|
||||
- qemu: do not use deprecated options for new virtiofsd (RHEL-7108)
|
||||
- qemu: migration: allow migration for virtiofs (RHEL-40135)
|
||||
- virt-host-validate: Drop extra "PASS" (RHEL-46868)
|
||||
- qemu: Don't leave beingDestroyed=true on inactive domain (RHEL-43309)
|
||||
|
||||
* Mon Jul 1 2024 Jiri Denemark <jdenemar@redhat.com> - 10.5.0-1
|
||||
- Rebased to libvirt-10.5.0 (RHEL-21381)
|
||||
- The rebase also fixes the following bugs:
|
||||
RHEL-23833, RHEL-29642, RHEL-37542, RHEL-39969, RHEL-40899
|
||||
RHEL-43309
|
||||
|
||||
* Tue Jun 4 2024 Jiri Denemark <jdenemar@redhat.com> - 10.4.0-1
|
||||
- Rebased to libvirt-10.4.0 (RHEL-7489)
|
||||
- The rebase also fixes the following bugs:
|
||||
RHEL-29642, RHEL-30373, RHEL-32182, RHEL-33044, RHEL-33082
|
||||
RHEL-34615, RHEL-35948, RHEL-36565, RHEL-36721, RHEL-39271
|
||||
RHEL-39400
|
||||
|
||||
* Mon May 27 2024 Jiri Denemark <jdenemar@redhat.com> - 10.3.0-2
|
||||
- qemu: fix qemu command for pci hostdevs and ramfb='off' (RHEL-28808)
|
||||
|
||||
* Thu May 9 2024 Jiri Denemark <jdenemar@redhat.com> - 10.3.0-1
|
||||
- Rebased to libvirt-10.3.0 (RHEL-29642)
|
||||
- The rebase also fixes the following bugs:
|
||||
RHEL-25993, RHEL-7101, RHEL-7461, RHEL-16333, RHEL-7343
|
||||
RHEL-28808, RHEL-32880, RHEL-35879, RHEL-34112, RHEL-30373
|
||||
RHEL-23416, RHEL-23608, RHEL-26276, RHEL-22728
|
||||
|
||||
* Mon Apr 22 2024 Jiri Denemark <jdenemar@redhat.com> - 10.0.0-7
|
||||
- qemu: virtiofs: do not crash if cgroups are missing
|
||||
- qemu: virtiofs: set correct label when creating the socket
|
||||
- qemu: virtiofs: error out if getting the group or user name fails
|
||||
- Fix off-by-one error in udevListInterfacesByStatus (CVE-2024-1441)
|
||||
- remote: check for negative array lengths before allocation (CVE-2024-2494)
|
||||
- qemu: Fix migration with custom XML (RHEL-30622)
|
||||
|
||||
* Tue Mar 19 2024 Jiri Denemark <jdenemar@redhat.com> - 10.0.0-5
|
||||
- cpu: x86: Add support for adding features to existing CPU models (RHEL-25995)
|
||||
- qemu: domain: Check arch in qemuDomainMakeCPUMigratable (RHEL-25995)
|
||||
- conf: cpu: Introduce virCPUDefListFeatures (RHEL-25995)
|
||||
- qemu: domain: Drop added features from migratable CPU (RHEL-25995)
|
||||
- Add vmx-* features to Broadwell* (RHEL-25995)
|
||||
- Add vmx-* features to Cascadelake* (RHEL-25995)
|
||||
- Add vmx-* features to Conroe (RHEL-25995)
|
||||
- Add vmx-* features to Cooperlake (RHEL-25995)
|
||||
- Add vmx-* features to core{,2}duo (RHEL-25995)
|
||||
- Add vmx-* features to Haswell* (RHEL-25995)
|
||||
- Add vmx-* features to Icelake* (RHEL-25995)
|
||||
- Add vmx-* features to IvyBridge* (RHEL-25995)
|
||||
- Add vmx-* features to kvm* (RHEL-25995)
|
||||
- Add vmx-* features to Nehalem* (RHEL-25995)
|
||||
- Add vmx-* features to Penryn (RHEL-25995)
|
||||
- Add vmx-* features to SandyBridge* (RHEL-25995)
|
||||
- Add vmx-* features to SapphireRapids (RHEL-25995)
|
||||
- Add vmx-* features to Skylake* (RHEL-25995)
|
||||
- Add vmx-* features to Snowridge (RHEL-25995)
|
||||
- Add vmx-* features to Westmere* (RHEL-25995)
|
||||
|
||||
* Thu Feb 22 2024 Jiri Denemark <jdenemar@redhat.com> - 10.0.0-4
|
||||
- Set stubDriverName from hostdev driver model attribute during pci device setup (RHEL-25858)
|
||||
- qemuMigrationDstPrepareStorage: Use 'switch' statement to include all storage types (RHEL-24825)
|
||||
|
Loading…
Reference in New Issue
Block a user