[libvirt] [PATCH 0/9] qemuxml2argvtest cleanups
by Ján Tomko
While looking at how slow this test has gotten,
I found a lost test case, some redundancies.
Thankfully, not running the HostModel functions
twice helped, but there is still room for improvement:
we spend a lot of time in the CPU driver comparing
the same strings over and over again and with over 300
entries in virQEMUCaps enum, we can reduce some of these
string comparisons in the future to cope with more
and more QEMU versions being tested.
Ján Tomko (9):
tests: drop 'drive' from qemuxml2startup tests
tests: add macro for dealing with exclusive flags
tests: introduce macro for qemu XML->startup XML
tests: only run startup XML tests if requested
tests: report errors in QEMU XML->startup XML tests
tests: drop redundant virQEMUCapsFilterByMachineType
tests: do not mangle real qemu caps in xml2argvtest
tests: turn skipLegacyCPUs into a flag
qemu: remove unnecessary virQEMUCapsFreeHostCPUModel
src/qemu/qemu_capabilities.c | 25 +------
src/qemu/qemu_capspriv.h | 5 --
tests/qemuxml2argvtest.c | 76 +++++++++++++---------
.../{disk-drive-shared.xml => disk-shared.xml} | 0
4 files changed, 49 insertions(+), 57 deletions(-)
rename tests/qemuxml2startupxmloutdata/{disk-drive-shared.xml => disk-shared.xml} (100%)
--
2.16.4
6 years, 2 months
[libvirt] [PATCH] qemu: free SEV caps in virQEMUCapsDispose
by Ján Tomko
Commit 77f51ab5 started parsing an copying the SEV capabilities,
but omitted the free call.
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_capabilities.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 08cf822b88..308f5602ca 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -1662,6 +1662,8 @@ void virQEMUCapsDispose(void *obj)
VIR_FREE(qemuCaps->gicCapabilities);
+ virSEVCapabilitiesFree(qemuCaps->sevCapabilities);
+
virQEMUCapsHostCPUDataClear(&qemuCaps->kvmCPU);
virQEMUCapsHostCPUDataClear(&qemuCaps->tcgCPU);
}
--
2.16.4
6 years, 2 months
[libvirt] [PATCH] add nodeset='all' and default for interleave mode
by Peng Hao
For interleave mode,sometimes we want to allocate mmeory regularly
in all nodes on the host. But different hosts has different node number.
So we add nodeset='all' for interleave mode and if nodeset=NULL default
nodeset is 'all' for interleave mode.
Signed-off-by: Peng Hao <peng.hao2(a)zte.com.cn>
---
src/conf/numa_conf.c | 73 ++++++++++++++++++++++++++++++++++++++++------------
1 file changed, 57 insertions(+), 16 deletions(-)
diff --git a/src/conf/numa_conf.c b/src/conf/numa_conf.c
index 97a3ca4..de5fb9c 100644
--- a/src/conf/numa_conf.c
+++ b/src/conf/numa_conf.c
@@ -29,6 +29,10 @@
#include "virnuma.h"
#include "virstring.h"
+#if WITH_NUMACTL
+#include <numa.h>
+#endif
+
/*
* Distance definitions defined Conform ACPI 2.0 SLIT.
* See include/linux/topology.h
@@ -66,6 +70,7 @@ typedef virDomainNumaNode *virDomainNumaNodePtr;
struct _virDomainNuma {
struct {
bool specified;
+ bool allnode;
virBitmapPtr nodeset;
virDomainNumatuneMemMode mode;
virDomainNumatunePlacement placement;
@@ -259,13 +264,17 @@ virDomainNumatuneParseXML(virDomainNumaPtr numa,
tmp = virXMLPropString(node, "nodeset");
if (tmp) {
- if (virBitmapParse(tmp, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
- goto cleanup;
-
- if (virBitmapIsAllClear(nodeset)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("Invalid value of 'nodeset': %s"), tmp);
- goto cleanup;
+ if (strcmp(tmp, "all") == 0) {
+ numa->memory.allnode = true;
+ } else {
+ if (virBitmapParse(tmp, &nodeset, VIR_DOMAIN_CPUMASK_LEN) < 0)
+ goto cleanup;
+
+ if (virBitmapIsAllClear(nodeset)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("Invalid value of 'nodeset': %s"), tmp);
+ goto cleanup;
+ }
}
VIR_FREE(tmp);
@@ -319,10 +328,14 @@ virDomainNumatuneFormatXML(virBufferPtr buf,
virBufferAsprintf(buf, "<memory mode='%s' ", tmp);
if (numatune->memory.placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC) {
- if (!(nodeset = virBitmapFormat(numatune->memory.nodeset)))
- return -1;
- virBufferAsprintf(buf, "nodeset='%s'/>\n", nodeset);
- VIR_FREE(nodeset);
+ if (numatune->memory.allnode == true) {
+ virBufferAsprintf(buf, "nodeset='all'/>\n");
+ } else {
+ if (!(nodeset = virBitmapFormat(numatune->memory.nodeset)))
+ return -1;
+ virBufferAsprintf(buf, "nodeset='%s'/>\n", nodeset);
+ VIR_FREE(nodeset);
+ }
} else if (numatune->memory.placement) {
tmp = virDomainNumatunePlacementTypeToString(numatune->memory.placement);
virBufferAsprintf(buf, "placement='%s'/>\n", tmp);
@@ -497,6 +510,9 @@ virDomainNumatuneSet(virDomainNumaPtr numa,
virBitmapPtr nodeset)
{
int ret = -1;
+ int i = 0, maxnode = 0;
+ virBitmapPtr bitmap = NULL;
+
/* No need to do anything in this case */
if (mode == -1 && placement == -1 && !nodeset)
@@ -538,7 +554,7 @@ virDomainNumatuneSet(virDomainNumaPtr numa,
}
if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_DEFAULT) {
- if (numa->memory.nodeset || placement_static)
+ if (numa->memory.nodeset || placement_static || numa->memory.allnode)
placement = VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC;
else
placement = VIR_DOMAIN_NUMATUNE_PLACEMENT_AUTO;
@@ -546,10 +562,35 @@ virDomainNumatuneSet(virDomainNumaPtr numa,
if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC &&
!numa->memory.nodeset) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("nodeset for NUMA memory tuning must be set "
- "if 'placement' is 'static'"));
- goto cleanup;
+ if (mode != VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("nodeset for NUMA memory tuning must be set "
+ "if 'placement' is 'static'"));
+ goto cleanup;
+ } else {
+ /* default set all node if nodeset is NULL, when placement
+ * is static and mode is interleave.
+ */
+ numa->memory.allnode = true;
+ }
+ }
+
+ if (placement == VIR_DOMAIN_NUMATUNE_PLACEMENT_STATIC &&
+ mode == VIR_DOMAIN_NUMATUNE_MEM_INTERLEAVE &&
+ numa->memory.allnode) {
+ if ((bitmap = virBitmapNew(VIR_DOMAIN_CPUMASK_LEN)) == NULL)
+ goto cleanup;
+ virBitmapClearAll(bitmap);
+ maxnode = numa_max_node();
+ for (i = 0; i <= maxnode; i++) {
+ if (virBitmapSetBit(bitmap, i) < 0) {
+ virBitmapFree(bitmap);
+ goto cleanup;
+ }
+ }
+ if (numa->memory.nodeset)
+ virBitmapFree(numa->memory.nodeset);
+ numa->memory.nodeset = bitmap;
}
/* setting nodeset when placement auto is invalid */
--
1.8.3.1
6 years, 2 months
[libvirt] [PATCH] docs: Fix missing timestamp inside backingStore.
by Julio Faracco
All backingStore XML definitions have a XML tag with the timestamp. This
timestamp is not defined insinde RNG volume storage schema and it is
causing some problems to validate and check volume XMLs.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1594266
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
docs/schemas/storagevol.rng | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/schemas/storagevol.rng b/docs/schemas/storagevol.rng
index 96d6b3e6d0..32aaa2784d 100644
--- a/docs/schemas/storagevol.rng
+++ b/docs/schemas/storagevol.rng
@@ -139,6 +139,7 @@
</element>
<ref name='format'/>
<ref name='permissions'/>
+ <ref name='timestamps'/>
</interleave>
</element>
</define>
--
2.17.1
6 years, 2 months
[libvirt] [PATCH] qemu: fix deadlock if create qemuProcessReconnect thread failed
by Wang Yechao
qemuProcessReconnectHelper has hold the doms lock, if create
qemuProcessReconnect thread failed, it will get the doms lock
again to remove the dom from doms list.
add obj->inReconnetCtx flag to avoid deadlock.
Signed-off-by: Wang Yechao <wang.yechao255(a)zte.com.cn>
---
src/conf/domain_conf.h | 1 +
src/conf/virdomainobjlist.c | 6 ++++--
src/qemu/qemu_process.c | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index e30a4b2..5bc5771 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2608,6 +2608,7 @@ struct _virDomainObj {
virDomainSnapshotObjPtr current_snapshot;
bool hasManagedSave;
+ bool inReconnectCtx;
void *privateData;
void (*privateDataFreeFunc)(void *);
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index 805fe94..30300b4 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -397,11 +397,13 @@ virDomainObjListRemove(virDomainObjListPtr doms,
dom->removing = true;
virObjectRef(dom);
virObjectUnlock(dom);
- virObjectRWLockWrite(doms);
+ if (!dom->inReconnectCtx)
+ virObjectRWLockWrite(doms);
virObjectLock(dom);
virDomainObjListRemoveLocked(doms, dom);
virObjectUnref(dom);
- virObjectRWUnlock(doms);
+ if (!dom->inReconnectCtx)
+ virObjectRWUnlock(doms);
}
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index eb9904b..8c30850 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8029,6 +8029,7 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
*/
qemuProcessStop(src->driver, obj, VIR_DOMAIN_SHUTOFF_FAILED,
QEMU_ASYNC_JOB_NONE, 0);
+ obj->inReconnectCtx = true;
qemuDomainRemoveInactiveJob(src->driver, obj);
virDomainObjEndAPI(&obj);
--
1.8.3.1
6 years, 2 months
[libvirt] [PATCH] qemu: check for vhostusers bandwidth
by Roland Schulz
https://bugzilla.redhat.com/show_bug.cgi?id=1524230
Signed-off-by: Roland Schulz <schullzroll(a)gmail.com>
---
src/qemu/qemu_command.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index ff9589f593..284c2709fc 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -8244,6 +8244,8 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
virQEMUCapsPtr qemuCaps,
unsigned int bootindex)
{
+ virNetDevBandwidthPtr actualBandwidth = virDomainNetGetActualBandwidth(net);
+ virDomainNetType actualType = virDomainNetGetActualType(net);
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
char *chardev = NULL;
char *netdev = NULL;
@@ -8257,6 +8259,19 @@ qemuBuildVhostuserCommandLine(virQEMUDriverPtr driver,
goto cleanup;
}
+ /* Set bandwidth or warn if requested and not supported. */
+ if (actualBandwidth) {
+ if (virNetDevSupportBandwidth(actualType)) {
+ if (virNetDevBandwidthSet(net->ifname, actualBandwidth, false,
+ !virDomainNetTypeSharesHostView(net)) < 0)
+ goto cleanup;
+ } else {
+ VIR_WARN("setting bandwidth on interfaces of "
+ "type '%s' is not implemented yet",
+ virDomainNetTypeToString(actualType));
+ }
+ }
+
switch ((virDomainChrType)net->data.vhostuser->type) {
case VIR_DOMAIN_CHR_TYPE_UNIX:
if (!(chardev = qemuBuildChrChardevStr(logManager, secManager,
--
2.17.1
6 years, 2 months
[libvirt] [PATCH 0/5] libxl: various migration V3 improvements
by Jim Fehlig
Patch 5 fixes a long standing problem found by some very slow hosts in
xen's osstest
https://lists.xenproject.org/archives/html/xen-devel/2018-08/msg01945.html
While working on the fix, I discovered other problems in libxl's V3
migration protocol. E.g. a modify job on the migrating VM was not
handled properly across the phases on either src or dst host. Patches
1-4 fix this and other problems found along the way.
Jim Fehlig (5):
libxl: migration: defer removing VM until finish phase
libxl: fix logic in P2P migration
libxl: fix job handling across migration phases on src
libxl: fix job handling across migration phases on dst
libxl: join with thread receiving migration data
src/libxl/libxl_domain.h | 1 +
src/libxl/libxl_driver.c | 7 --
src/libxl/libxl_migration.c | 168 ++++++++++++++++++++++++------------
3 files changed, 114 insertions(+), 62 deletions(-)
--
2.18.0
6 years, 2 months