[libvirt PATCH] Revert "qemuDomainSetNumaParamsLive: set nodeset for root cgroup"
by Pavel Hrdina
This reverts commit <1b22dd6dd44202094e0f78f887cbe790c00e9ebc>.
First of all, the reverted commit is incomplete. It only sets
cpuset.mems in the VM root cgroup when the API is used but there is no
code that would do the same when the VM is started.
Libvirt never places any process into the VM root cgroup directly. All
the supporting processes like slirp-helper or dbus-daemon are placed
into the emulator sub-cgroup and all the QEMU threads are distributed
between emulator, vcpu* and iothread* sub-cgroups. The scenario
described in the reverted commit can happen only if someone manually
adds any process there which we should not care about.
If we would like to set the limit in the VM root cgroup we need to
introduce better logic:
- set both (old and new) numa group in the VM root cgroup
- change the numa group in all sub-cgroups to new value
- finally set only the new value in the VM root cgroup
The simplest fix now is to revert the commit.
Signed-off-by: Pavel Hrdina <phrdina(a)redhat.com>
---
src/qemu/qemu_driver.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index e10e699a1a..a972662c3f 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8797,10 +8797,6 @@ qemuDomainSetNumaParamsLive(virDomainObj *vm,
return -1;
}
- /* set nodeset for root cgroup */
- if (virCgroupSetCpusetMems(priv->cgroup, nodeset_str) < 0)
- return -1;
-
return 0;
}
--
2.31.1
3 years, 7 months
RFC: qemu log permissions
by Kristina Hanicova
Hello everyone,
I came across this issue:
https://gitlab.com/libvirt/libvirt/-/issues/71
and I would like your opinion on implementing support to define mode
(maybe even user/group/other?) in config, which the qemu log files would be
created with.
In this case, it is desired so that this tool 'Elasticsearch' can read logs.
Is it worth implementing? What are your thoughts?
Kristina
3 years, 7 months
[PATCH] schema: Allow '0' offset for a <slice> of <disk>
by Peter Krempa
Using slice to cut off the end of the image is a perfectly vaid
configuration. Use 'unsignedInt' instead of 'positiveInteger' for the
'offset' attribute in the XML schema and modify one test case to cover
this use case.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1960993
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
docs/schemas/domaincommon.rng | 2 +-
tests/qemuxml2argvdata/disk-slices.x86_64-latest.args | 2 +-
tests/qemuxml2argvdata/disk-slices.xml | 2 +-
tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index a2e5c50c1d..475f7f1a42 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1638,7 +1638,7 @@
<define name="diskSourceSlice">
<attribute name="offset">
- <ref name="positiveInteger"/>
+ <ref name="unsignedInt"/>
</attribute>
<attribute name="size">
<ref name="positiveInteger"/>
diff --git a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args b/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
index d337ea91a7..f41bbeea09 100644
--- a/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
+++ b/tests/qemuxml2argvdata/disk-slices.x86_64-latest.args
@@ -28,7 +28,7 @@ XDG_CONFIG_HOME=/tmp/lib/domain--1-QEMUGuest1/.config \
-boot strict=on \
-device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img","node-name":"libvirt-6-storage","auto-read-only":true,"discard":"unmap"}' \
--blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw","offset":1234,"size":321,"file":"libvirt-6-storage"}' \
+-blockdev '{"node-name":"libvirt-6-format","read-only":false,"driver":"raw","offset":0,"size":321,"file":"libvirt-6-storage"}' \
-device virtio-blk-pci,bus=pci.0,addr=0x2,drive=libvirt-6-format,id=virtio-disk0,bootindex=1 \
-blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/raw.img","node-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \
-blockdev '{"driver":"raw","node-name":"libvirt-5-slice-sto","offset":9876,"size":123456789,"file":"libvirt-5-storage","auto-read-only":true,"discard":"unmap"}' \
diff --git a/tests/qemuxml2argvdata/disk-slices.xml b/tests/qemuxml2argvdata/disk-slices.xml
index 1675766a46..016aa1b905 100644
--- a/tests/qemuxml2argvdata/disk-slices.xml
+++ b/tests/qemuxml2argvdata/disk-slices.xml
@@ -18,7 +18,7 @@
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/raw.img'>
<slices>
- <slice type='storage' offset='1234' size='321'/>
+ <slice type='storage' offset='0' size='321'/>
</slices>
</source>
<backingStore/>
diff --git a/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml b/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
index 5c200ad31c..be5cd25084 100644
--- a/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
+++ b/tests/qemuxml2xmloutdata/disk-slices.x86_64-latest.xml
@@ -21,7 +21,7 @@
<driver name='qemu' type='raw'/>
<source file='/var/lib/libvirt/images/raw.img'>
<slices>
- <slice type='storage' offset='1234' size='321'/>
+ <slice type='storage' offset='0' size='321'/>
</slices>
</source>
<backingStore/>
--
2.31.1
3 years, 7 months
[PATCH v3 0/3] Introduce <input type='evdev'>
by Kristina Hanicova
This is v3 from:
https://listman.redhat.com/archives/libvir-list/2021-May/msg00324.html
v1 here:
https://listman.redhat.com/archives/libvir-list/2021-April/msg01307.html
Diff to v2:
- Fixed formatting
- Enable xml test call
Kristina Hanicova (3):
qemu_capabilities: Add QEMU_CAPS_INPUT_LINUX
conf: Parse/format XML input type 'evdev'
qemu: Build command line for object input-linux
docs/formatdomain.rst | 37 ++++++----
docs/schemas/domaincommon.rng | 20 ++++++
src/conf/domain_audit.c | 1 +
src/conf/domain_conf.c | 69 ++++++++++++++++---
src/conf/domain_conf.h | 12 ++++
src/conf/domain_validate.c | 8 +++
src/libvirt_private.syms | 2 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_cgroup.c | 2 +
src/qemu/qemu_command.c | 33 ++++++++-
src/qemu/qemu_domain_address.c | 1 +
src/qemu/qemu_hotplug.c | 1 +
src/qemu/qemu_validate.c | 6 ++
src/security/security_apparmor.c | 1 +
src/security/security_dac.c | 2 +
src/security/security_selinux.c | 2 +
src/security/virt-aa-helper.c | 3 +-
.../caps_2.11.0.s390x.xml | 1 +
.../caps_2.11.0.x86_64.xml | 1 +
.../caps_2.12.0.aarch64.xml | 1 +
.../caps_2.12.0.ppc64.xml | 1 +
.../caps_2.12.0.s390x.xml | 1 +
.../caps_2.12.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 +
.../caps_3.0.0.riscv32.xml | 1 +
.../caps_3.0.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_3.0.0.s390x.xml | 1 +
.../caps_3.0.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 +
.../caps_3.1.0.x86_64.xml | 1 +
.../caps_4.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +
.../caps_4.0.0.riscv32.xml | 1 +
.../caps_4.0.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_4.0.0.s390x.xml | 1 +
.../caps_4.0.0.x86_64.xml | 1 +
.../caps_4.1.0.x86_64.xml | 1 +
.../caps_4.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 +
.../qemucapabilitiesdata/caps_4.2.0.s390x.xml | 1 +
.../caps_4.2.0.x86_64.xml | 1 +
.../caps_5.0.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 +
.../caps_5.0.0.riscv64.xml | 1 +
.../caps_5.0.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_5.1.0.sparc.xml | 1 +
.../caps_5.1.0.x86_64.xml | 1 +
.../caps_5.2.0.aarch64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0.ppc64.xml | 1 +
.../caps_5.2.0.riscv64.xml | 1 +
.../qemucapabilitiesdata/caps_5.2.0.s390x.xml | 1 +
.../caps_5.2.0.x86_64.xml | 1 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 +
.../caps_6.0.0.x86_64.xml | 1 +
.../caps_6.1.0.x86_64.xml | 1 +
.../input-linux.x86_64-latest.args | 34 +++++++++
tests/qemuxml2argvdata/input-linux.xml | 31 +++++++++
tests/qemuxml2argvtest.c | 2 +
tests/qemuxml2xmloutdata/input-linux.xml | 1 +
tests/qemuxml2xmltest.c | 2 +
61 files changed, 287 insertions(+), 24 deletions(-)
create mode 100644 tests/qemuxml2argvdata/input-linux.x86_64-latest.args
create mode 100644 tests/qemuxml2argvdata/input-linux.xml
create mode 120000 tests/qemuxml2xmloutdata/input-linux.xml
--
2.31.1
3 years, 7 months
[PATCH 0/2] qemu: auto-create <nvram> with defined permissions
by Kristina Hanicova
Kristina Hanicova (2):
qemu: Use qemuDomainOpenFile() in qemuPrepareNVRAM()
qemu: Return -EINVAL to keep qemuDomainOpenFile() consistent
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_process.c | 21 +++++++++++----------
2 files changed, 12 insertions(+), 11 deletions(-)
--
2.31.1
3 years, 7 months
[PATCH] qemu: Add check for needed paths for memory devices
by Kristina Hanicova
When building a commandline for a DIMM memory device with
non-default access mode, the qemuBuildMemoryBackendProps() will
tell QEMU to allocate memory from per-domain memory backing dir.
But later, when preparing the host, the
qemuProcessNeedMemoryBackingPath() does not check for memory
devices at all resulting in per-domain memory backing dir not
being created which upsets QEMU.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1961114
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
src/qemu/qemu_process.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b69a9d1927..35213f81ec 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3938,6 +3938,11 @@ qemuProcessNeedMemoryBackingPath(virDomainDef *def,
return true;
}
+ for (i = 0; i < def->nmems; i++) {
+ if (def->mems[i]->access != VIR_DOMAIN_MEMORY_ACCESS_DEFAULT)
+ return true;
+ }
+
if (mem) {
switch (mem->model) {
case VIR_DOMAIN_MEMORY_MODEL_DIMM:
--
2.31.1
3 years, 7 months
[PATCH 0/4] Support for launchSecurity type s390-pv
by Boris Fiuczynski
This patch series introduces the launch security type s390-pv.
Specifying s390-pv as launch security type in an s390 domain prepares for
running the guest in protected virtualization secure mode, also known as
IBM Secure Execution.
Boris Fiuczynski (4):
conf: refactor launch security to allow more types
qemu: add s390-pv-guest capability
conf: add s390-pv as launch security type
docs: add s390-pv documentation
docs/formatdomain.rst | 7 +
docs/kbase/s390_protected_virt.rst | 55 +++++-
docs/schemas/domaincommon.rng | 13 +-
src/conf/domain_conf.c | 164 +++++++++++-------
src/conf/domain_conf.h | 14 +-
src/conf/virconftypes.h | 2 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_cgroup.c | 4 +-
src/qemu/qemu_command.c | 64 ++++++-
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_firmware.c | 4 +-
src/qemu/qemu_namespace.c | 21 ++-
src/qemu/qemu_process.c | 36 +++-
src/qemu/qemu_validate.c | 30 +++-
src/security/security_dac.c | 4 +-
.../launch-security-s390-pv-ignore-policy.xml | 24 +++
.../launch-security-s390-pv.xml | 18 ++
.../launch-security-s390-pv-ignore-policy.xml | 1 +
tests/genericxml2xmltest.c | 2 +
.../qemucapabilitiesdata/caps_6.0.0.s390x.xml | 1 +
...ty-s390-pv-ignore-policy.s390x-latest.args | 35 ++++
.../launch-security-s390-pv-ignore-policy.xml | 33 ++++
.../launch-security-s390-pv.s390x-latest.args | 35 ++++
.../launch-security-s390-pv.xml | 30 ++++
...urity-sev-missing-policy.x86_64-2.12.0.err | 1 +
.../launch-security-sev-missing-policy.xml | 34 ++++
tests/qemuxml2argvtest.c | 4 +
28 files changed, 538 insertions(+), 103 deletions(-)
create mode 100644 tests/genericxml2xmlindata/launch-security-s390-pv-ignore-policy.xml
create mode 100644 tests/genericxml2xmlindata/launch-security-s390-pv.xml
create mode 120000 tests/genericxml2xmloutdata/launch-security-s390-pv-ignore-policy.xml
create mode 100644 tests/qemuxml2argvdata/launch-security-s390-pv-ignore-policy.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/launch-security-s390-pv-ignore-policy.xml
create mode 100644 tests/qemuxml2argvdata/launch-security-s390-pv.s390x-latest.args
create mode 100644 tests/qemuxml2argvdata/launch-security-s390-pv.xml
create mode 100644 tests/qemuxml2argvdata/launch-security-sev-missing-policy.x86_64-2.12.0.err
create mode 100644 tests/qemuxml2argvdata/launch-security-sev-missing-policy.xml
--
2.30.2
3 years, 7 months
[PATCH v2] virNodeDevCapMdevParseXML: Use virXMLPropEnum() for ./start/@type
by Michal Privoznik
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
v2 of:
https://listman.redhat.com/archives/libvir-list/2021-May/msg00604.html
diff to v1:
- Switch from virXMLPropEnum() to virXMLPropEnumDefault() per Peter's
review
src/conf/node_device_conf.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 5598d420fe..af72e160a5 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1919,7 +1919,7 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt,
g_autofree xmlNodePtr *attrs = NULL;
size_t i;
g_autofree char *uuidstr = NULL;
- g_autofree char *starttype = NULL;
+ xmlNodePtr startNode = NULL;
ctxt->node = node;
@@ -1941,17 +1941,15 @@ virNodeDevCapMdevParseXML(xmlXPathContextPtr ctxt,
virUUIDFormat(uuidbuf, mdev->uuid);
}
- if ((starttype = virXPathString("string(./start[1]/@type)", ctxt))) {
- int tmp;
- if ((tmp = virNodeDevMdevStartTypeFromString(starttype)) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("unknown mdev start type '%s' for '%s'"), starttype, def->name);
- return -1;
- }
+ mdev->start = VIR_NODE_DEV_MDEV_START_MANUAL;
- mdev->start = tmp;
- } else {
- mdev->start = VIR_NODE_DEV_MDEV_START_MANUAL;
+ startNode = virXPathNode("./start[1]", ctxt);
+ if (startNode &&
+ virXMLPropEnumDefault(startNode, "type",
+ virNodeDevMdevStartTypeFromString,
+ VIR_XML_PROP_NONE, &mdev->start,
+ VIR_NODE_DEV_MDEV_START_MANUAL) < 0) {
+ return -1;
}
/* 'iommuGroup' is optional, only report an error if the supplied value is
--
2.26.3
3 years, 7 months
[PATCH 0/4] Add win-dmp crashdump format
by Michal Privoznik
*** BLURB HERE ***
Michal Prívozník (4):
include: Fix copy-paste error in comment to virDomainCoreDumpFormat
enum
lib: Add win-dmp crashdump format
virsh: Expose new win-dmp dump format
NEWS: Document new memory dump format
NEWS.rst | 5 +++++
docs/manpages/virsh.rst | 5 +++--
include/libvirt/libvirt-domain.h | 3 ++-
src/qemu/qemu_driver.c | 1 +
tools/virsh-domain.c | 2 ++
5 files changed, 13 insertions(+), 3 deletions(-)
--
2.26.3
3 years, 7 months
[PATCH 0/2] Remove static analysis cruft
by Peter Krempa
Remove comments for silencing coverity and static assers which are no
longer needed.
CI pipelines:
Yesterday's all-green:
https://gitlab.com/pipo.sk/libvirt/-/pipelines/305953275
New run started when I've rebased this to current master:
https://gitlab.com/pipo.sk/libvirt/-/pipelines/306458103
Peter Krempa (2):
Drop magic comments for coverity
Remove static analysis assertions
src/conf/domain_conf.c | 13 -------------
src/conf/virdomainobjlist.c | 2 --
src/conf/virnwfilterbindingobjlist.c | 1 -
src/cpu/cpu_x86.c | 1 -
src/libxl/libxl_driver.c | 9 ---------
src/qemu/qemu_command.c | 2 --
src/qemu/qemu_driver.c | 2 --
src/qemu/qemu_monitor.c | 3 ---
src/qemu/qemu_process.c | 2 --
src/remote/remote_driver.c | 1 -
src/rpc/virnetserver.c | 4 ----
src/storage/parthelper.c | 2 --
src/util/vircommand.c | 3 ---
src/util/virconf.c | 6 ------
src/util/virhostmem.c | 2 --
src/util/virnetdev.c | 1 -
src/util/virobject.c | 1 -
src/util/virprocess.c | 1 -
src/util/virutil.c | 3 ---
tests/commandtest.c | 2 --
tests/virdrivermoduletest.c | 1 -
tools/virsh.c | 1 -
tools/virt-admin.c | 1 -
tools/vsh.c | 1 -
24 files changed, 65 deletions(-)
--
2.31.1
3 years, 7 months