[PATCH v2 00/11] Implement IOThreads related APIs for test driver
by Luke Yue
v2:
- Move the extracted functions to hypervisor/domain_driver.c
- Implement virDomainPinIOThread
- Implement virDomainSetIOThreadParams
- Implement virConnectGetAllDomainStats, currently only supports get
state and IOThread info
- Add more tests
Luke Yue (11):
domain_driver.c: Introduce and use virDomainDriverAddIOThreadCheck()
test_driver: Introduce testIOThreadInfo and generate IOThread infos
test_driver: Implement virDomainAddIOThread
test_driver: Implement virDomainDelIOThread
domain_driver.c: Introduce and use virDomainDriverGetIOThreadsConfig()
test_driver: Implement virDomainGetIOThreadInfo
test_driver: Implement virDomainPinIOThread
test_driver: Implement testDomainSetIOThreadParams
test_driver: Implement virConnectGetAllDomainStats
test_driver: Introduce testDomainGetStatsIOThread
tests: Test IOThread related functions for test driver
examples/xml/test/testdomfc4.xml | 5 +
src/hypervisor/domain_driver.c | 123 ++++++++
src/hypervisor/domain_driver.h | 9 +
src/libvirt_private.syms | 3 +
src/qemu/qemu_driver.c | 113 +------
src/test/meson.build | 1 +
src/test/test_driver.c | 509 +++++++++++++++++++++++++++++++
tests/virshtest.c | 90 ++++++
8 files changed, 745 insertions(+), 108 deletions(-)
--
2.32.0
3 years, 3 months
[PATCH 0/4] Implement some job related APIs for test driver
by Luke Yue
Luke Yue (4):
test_driver: Implement virDomainGetJobInfo
test_driver: Implement virDomainGetJobStats
test_driver: Implement virDomainAbortJob
virshtest: add test for domjobinfo
src/test/test_driver.c | 170 +++++++++++++++++++++++++++++++++++++++++
tests/virshtest.c | 11 +++
2 files changed, 181 insertions(+)
--
2.32.0
3 years, 3 months
[PATCH] qemu_migration: check for interface type 'hostdev'
by Kristina Hanicova
When we try to migrate vm, we check if it contains only devices
that are able to migrate. If a hostdev device is not able to
migrate we raise an error with <hostdev/>, but it can actually be
<interface/>, so we need to check if hostdev device was created
by us from interface and show the right error message.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1942315
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/qemu/qemu_migration.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 4d651aeb1a..34eee9c8b6 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -1272,9 +1272,15 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def)
}
/* all other PCI hostdevs can't be migrated */
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
- _("cannot migrate a domain with <hostdev mode='subsystem' type='%s'>"),
- virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
+ if (hostdev->parentnet) {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("cannot migrate a domain with <interface type='%s'>"),
+ virDomainNetTypeToString(hostdev->parentnet->type));
+ } else {
+ virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
+ _("cannot migrate a domain with <hostdev mode='subsystem' type='%s'>"),
+ virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type));
+ }
return false;
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST:
--
2.31.1
3 years, 3 months
[PATCH v4 0/4] Implement virDomainGetMessages for test driver
by Luke Yue
v4:
- Move testDomainObjCheckTaint to testParseDomains()
- Add CPU tainted and deprecation check
- Add a new xml with more tainted configs
Luke Yue (4):
conf: domain: Introduce and use virDomainObjGetMessages()
test_driver: Implement virDomainGetMessages
test_driver: Introduce testDomainObjCheckTaint
examples: test: Add a new test xml with more tainted configs for
testing
examples/xml/test/testdomfc5.xml | 51 +++++++++++++++
examples/xml/test/testnode.xml | 1 +
examples/xml/test/testnodeinline.xml | 51 +++++++++++++++
src/conf/domain_conf.c | 53 +++++++++++++++
src/conf/domain_conf.h | 5 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 34 +---------
src/test/test_driver.c | 98 ++++++++++++++++++++++++++++
tests/virshtest.c | 52 +++++++++++++--
9 files changed, 306 insertions(+), 40 deletions(-)
create mode 100644 examples/xml/test/testdomfc5.xml
--
2.32.0
3 years, 3 months
[PATCH] vmx: Parse vm.genid
by Michal Privoznik
The VMware metadata file contains genid but we are not parsing
and thus reporting it in domain XML. However, it's not as
straightforward as one might think. The UUID reported by VMware
is not in its usual string form, but split into two signed long
longs. That means, we have to do a bit of trickery when parsing.
But looking around it's the same magic that libguestfs does:
https://github.com/libguestfs/virt-v2v/blob/master/v2v/input_vmx.ml#L421
It's also explained by Rich on qemu-devel:
https://lists.nongnu.org/archive/html/qemu-devel/2018-07/msg02019.html
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1598348
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
I've successfully ran vmx2xmltest on an s390x machine which means that
there shouldn't be any endiandness problem.
src/vmx/vmx.c | 30 +++++++++++++++++++
.../vmx2xml-esx-in-the-wild-10.xml | 1 +
2 files changed, 31 insertions(+)
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index 1cd5a82227..04eabff18a 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -1337,6 +1337,32 @@ virVMXConfigScanResultsCollector(const char* name,
}
+static int
+virVMXParseGenID(virConf *conf,
+ virDomainDef *def)
+{
+ long long vmid[2] = { 0 };
+ g_autofree char *uuidstr = NULL;
+
+ if (virVMXGetConfigLong(conf, "vm.genid", &vmid[0], 0, true) < 0 ||
+ virVMXGetConfigLong(conf, "vm.genidX", &vmid[1], 0, true) < 0)
+ return -1;
+
+ if (vmid[0] == 0 && vmid[1] == 0)
+ return 0;
+
+ uuidstr = g_strdup_printf("%.16llx%.16llx", vmid[0], vmid[1]);
+ if (virUUIDParse(uuidstr, def->genid) < 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse UUID from string '%s'"), uuidstr);
+ return -1;
+ }
+ def->genidRequested = true;
+
+ return 0;
+}
+
+
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* VMX -> Domain XML
@@ -1466,6 +1492,10 @@ virVMXParseConfig(virVMXContext *ctx,
}
}
+ /* vmx:vm.genid + vm.genidX -> def:genid */
+ if (virVMXParseGenID(conf, def) < 0)
+ goto cleanup;
+
/* vmx:annotation -> def:description */
if (virVMXGetConfigString(conf, "annotation", &def->description,
true) < 0) {
diff --git a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-10.xml b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-10.xml
index b8c522af1f..47ed637920 100644
--- a/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-10.xml
+++ b/tests/vmx2xmldata/vmx2xml-esx-in-the-wild-10.xml
@@ -1,6 +1,7 @@
<domain type='vmware'>
<name>w2019biosvmware</name>
<uuid>421a6177-5aa9-abb7-5924-fc376c18a1b4</uuid>
+ <genid>13c67c91-9f47-526f-b0d6-e4dd2e4bb4f9</genid>
<memory unit='KiB'>4194304</memory>
<currentMemory unit='KiB'>4194304</currentMemory>
<vcpu placement='static'>2</vcpu>
--
2.31.1
3 years, 3 months
lxc container startup error and RFC patch
by Cole Robinson
Hi all,
I'm seeing LXC container startup failures. This is with libvirt git,
fedora 34 host with systemd-248.6-1.fc34.x86_64 (I didn't confirm with
other versions). Reproducer:
sudo virt-install --connect lxc:/// --name test-container --memory 128
--boot init=/bin/sh
Starting install...
ERROR error from service:
GDBus.Error:org.freedesktop.machine1.NoMachineForPID: PID 2145047 does
not belong to any known machine
libvirt 7.0.0 works but 7.1.0+ does not. The root error seems to predate
that, showing up in syslog, but commit 9c1693eff made it fatal:
commit 9c1693eff427661616ce1bd2795688f87288a412
Author: Pavel Hrdina <phrdina(a)redhat.com>
Date: Fri Feb 5 16:17:35 2021 +0100
vircgroup: use DBus call to systemd for some APIs
The error comes from virSystemdGetMachineByPID. The PID that shows up in
the above error message does not match the leader PID as reported by
machinectl. This change fixes the error but I don't know if it's correct
or if it has other implications:
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 066e013ed4..54ecb1316b 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -866,12 +866,12 @@ static int virLXCControllerSetupCgroupLimits(virLXCController *ctrl)
nodeset = virDomainNumatuneGetNodeset(ctrl->def->numa, auto_nodeset, -1);
if (!(ctrl->cgroup = virLXCCgroupCreate(ctrl->def,
- ctrl->initpid,
+ getpid(),
ctrl->nnicindexes,
ctrl->nicindexes)))
goto cleanup;
- if (virCgroupAddMachineProcess(ctrl->cgroup, getpid()) < 0)
+ if (virCgroupAddMachineProcess(ctrl->cgroup, ctrl->initpid) < 0)
goto cleanup;
/* Add all qemu-nbd tasks to the cgroup */
Maybe something else isn't working elsewhere. Clearly we try to add both
pids to the systemd machine, but virSystemdGetMachineByPID is not
working to match the non-leader pid, which is the one that the LXC
driver knows about.
Thoughts?
Can anyone else reproduce?
Thanks,
Cole
3 years, 3 months
[PATCH v4 13/13] docs/deprecated: deprecate passing plugin args through `arg=`
by Mahmoud Mandour
Signed-off-by: Mahmoud Mandour <ma.mandourr(a)gmail.com>
---
docs/system/deprecated.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/system/deprecated.rst b/docs/system/deprecated.rst
index e2e0090878..7ae6f1f727 100644
--- a/docs/system/deprecated.rst
+++ b/docs/system/deprecated.rst
@@ -126,6 +126,13 @@ other options have been processed. This will either have no effect (if
if they were not given. The property is therefore useless and should not be
specified.
+Plugin argument passing through ``arg=<string>`` (since 6.1)
+''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
+
+Passing TCG plugins arguments through ``arg=`` is redundant is makes the
+command-line less readable, especially when the argument itself consist of a
+name and a value, e.g. ``-plugin plugin_name,arg="arg_name=arg_value"``.
+Therefore, the usage of ``arg`` is redundant.
QEMU Machine Protocol (QMP) commands
------------------------------------
--
2.25.1
3 years, 3 months
[PATCH] gitlab: Add disclaimer to the 'feature' issue template
by Peter Krempa
Add a disclaimer that filing a feature request issue has no guarantees
that anybody will actually implement the feature.
Based on the disclaimer in the QEMU project.
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
.gitlab/issue_templates/feature.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/.gitlab/issue_templates/feature.md b/.gitlab/issue_templates/feature.md
index f32faae82b..50f5486701 100644
--- a/.gitlab/issue_templates/feature.md
+++ b/.gitlab/issue_templates/feature.md
@@ -1,3 +1,19 @@
+<!--
+This is the upstream libvirt issue tracker.
+
+Please note that libvirt, like most open source projects, relies on
+contributors who have motivation, skills and available time to work on
+implementing particular features.
+
+Feature requests can be helpful for determining demand and interest, but
+they are not a guarantee that a contributor will volunteer to implement
+it. We welcome and encourage even draft patches to implement a feature
+be sent to the mailing list where it can be discussed and developed
+further by the community.
+
+Thank you for your interest in helping us to make libvirt better!
+-->
+
## Goal
<!-- Describe the final result you want to achieve. Avoid design specifics. -->
--
2.31.1
3 years, 3 months
[PATCH v2 0/2] qemu: Ignore RESET/SHUTDOWN events during startup
by Peter Krempa
Before we resume the CPUs there was no guest code executed so the events
emitted by qemu are purely based on libvirt actions. Ignore them since
they are emitted when we are resetting the machine so that it picks up
hotplugged disks.
Peter Krempa (2):
qemu: process: Ignore 'RESET' event during startup
qemu: process: Ignore 'SHUTDOWN' event during startup
src/qemu/qemu_process.c | 27 +++++++++++++++++++++++++--
1 file changed, 25 insertions(+), 2 deletions(-)
--
2.31.1
3 years, 3 months