[PATCH] qemu:qemu_snapshot: Fix a libvirtd cransh when delete snapshot
by jungle man
qemuDomainDiskByName() can return a NULL pointer on failure, but this
returned value in qemuSnapshotDeleteValidate is not checked.
It will make libvirtd crash.
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 5b3aadcbf0..52312b4a7b 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -4235,8 +4235,11 @@ qemuSnapshotDeleteValidate(virDomainObj *vm,
virDomainDiskDef *vmdisk = NULL;
virDomainDiskDef *disk = NULL;
- vmdisk = qemuDomainDiskByName(vm->def, snapDisk->name);
- disk = qemuDomainDiskByName(snapdef->parent.dom,
snapDisk->name);
+ if (!(vmdisk = qemuDomainDiskByName(vm->def, snapDisk->name)))
+ return -1;
+
+ if (!(disk = qemuDomainDiskByName(snapdef->parent.dom,
snapDisk->name)))
+ return -1;
if (!virStorageSourceIsSameLocation(vmdisk->src, disk->src)) {
virReportError(VIR_ERR_OPERATION_UNSUPPORTED,
3 weeks, 6 days
[PATCH] qemu: enable QEMU core dump by default on Linux
by Daniel P. Berrangé
The Linux MADV_DONTDUMP flag was added to Linux kernels > 3.3,
back in 2012, and the dump-guest-core flag was added to QEMU
> 1.0 at the same time.
IOW, on Linux we have long been able to assume that QEMU core
dumps will exclude guest memory, unless the user has overridden
the host level defaults in the domain XML.
It is desirable to permit QEMU core dumps out of the box to make
it easier for users to report crashes to their OS vendor without
having to reconfigure and restart libvirt daemons and their
running guests.
While there is a risk that an admin may have set 'dump_guest_core'
to true, while leaving 'max_core' to 0, on balance the benefits
of easier troubleshooting outweigh the risk of changing the
defaults to permit core dumps.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
src/qemu/qemu.conf.in | 8 +++++---
src/qemu/qemu_conf.c | 10 +++++++---
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in
index 89c9b6b913..d853136f10 100644
--- a/src/qemu/qemu.conf.in
+++ b/src/qemu/qemu.conf.in
@@ -709,7 +709,9 @@
# As a special case it can be set to the string "unlimited" to
# to allow arbitrarily sized core dumps.
#
-# By default the core dump size is set to 0 disabling all dumps
+# By default the core dump size is set to unlimited on
+# Linux where 'dump_guest_core' defaults to false, and
+# is set to 0 on other platforms, disabling all dumps
#
# Size is a positive integer specifying bytes or the
# string "unlimited"
@@ -717,8 +719,8 @@
#max_core = "unlimited"
# Determine if guest RAM is included in QEMU core dumps. By
-# default guest RAM will be excluded if a new enough QEMU is
-# present and host kernel supports it. Setting this to '1' will
+# default guest RAM will be excluded on Linux platforms,
+# and included on all other patforms. Setting this to '1' will
# force guest RAM to always be included in QEMU core dumps.
#
# This setting will be ignored if the guest XML has set the
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 7c15c521c7..8b9fe4e381 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -291,10 +291,14 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privileged,
cfg->deprecationBehavior = g_strdup("none");
cfg->storageUseNbdkit = USE_NBDKIT_DEFAULT;
-#ifndef MADV_DONTDUMP
+#ifdef MADV_DONTDUMP
+ cfg->maxCore = ULLONG_MAX;
+#else
/* QEMU uses Linux extensions to madvise() (MADV_DODUMP/MADV_DONTDUMP) to
- * include/exclude guest memory from core dump. These might be unavailable
- * on some systems. Provide sane default. */
+ * include/exclude guest memory from core dump. On non-Linux systems
+ * core dumps will unavoidably include all guest RAM, so toggle the
+ * default to reflect this and warn the admin.
+ */
VIR_INFO("Host kernel doesn't support MADV_DONTDUMP. Enabling dump_guest_core");
cfg->dumpGuestCore = true;
#endif
--
2.46.0
3 weeks, 6 days
[PATCH] docs: Document how to enable coredumps for session qemu
by Richard W.M. Jones
Thanks: Daniel P. Berrangé
Signed-off-by: Richard W.M. Jones <rjones(a)redhat.com>
---
docs/kbase/qemu-core-dump.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/kbase/qemu-core-dump.rst b/docs/kbase/qemu-core-dump.rst
index 5c3781cf90..4bd3ff0b9d 100644
--- a/docs/kbase/qemu-core-dump.rst
+++ b/docs/kbase/qemu-core-dump.rst
@@ -53,6 +53,13 @@ that may get interrupted. In particular long running jobs like live
migration or block device copy jobs may abort. It is thus wise to check
that the host is mostly idle before restarting the daemons.
+Session mode qemu
+=================
+
+For session mode (non-root) qemu, you have to create a new file called
+``$HOME/.config/libvirt/qemu.conf``, add the line(s) above, and kill
+the user ``virtqemud`` instance.
+
Guest core dump configuration
=============================
--
2.46.0
3 weeks, 6 days
Entering freeze for libvirt-10.10.0
by Jiri Denemark
I have just tagged v10.10.0-rc1 in the repository and pushed signed
tarballs to https://download.libvirt.org/
Please give the release candidate some testing and in case you find a
serious issue which should have a fix in the upcoming release, feel
free to reply to this thread to make sure the issue is more visible.
If you have not done so yet, please update NEWS.rst to document any
significant change you made since the last release.
Thanks,
Jirka
4 weeks
[PATCH] NEWS: Document features/improvements/bug fixes I've participated in
by Michal Privoznik
There are some features/improvements/bug fixes I've either
contributed or reviewed/merged. Document them for upcoming
release.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
NEWS.rst | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 4b7f4e8244..65e21c4299 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -46,6 +46,12 @@ v10.10.0 (unreleased)
required to keep data "raw" on disk, but the use case requires features
of the QCOW2 format such as incremental backups.
+ * swtpm: Add support for profiles
+
+ Upcoming swtpm release will have TPM profile support that allows to
+ restrict a TPM's provided set of crypto algorithms and commands. Users can
+ now select profile by using ``<profile/>`` in their TPM XML definition.
+
* **Improvements**
* qemu: Support UEFI NVRAM images on block storage
@@ -55,6 +61,21 @@ v10.10.0 (unreleased)
qcow2 is used as the format, the images are now also auto-populated from the
template.
+ * qemu: Automatically add IOMMU when needed
+
+ When domain of 'qemu' or 'kvm' type has more than 255 vCPUs IOMMU with EIM
+ mode is required. Starting with this release libvirt automatically adds one
+ (or turns on the EIM mode if there's IOMMU without it).
+
+ * ch: allow hostdevs in domain definition
+
+ The Cloud Hypervisor driver (ch) now supports ``<hostdev/>``-s.
+
+ * ch: Enable callbacks for ch domain events
+
+ The Cloud Hypervisor driver (ch) now supports emitting events on domain
+ define, undefine, start, boot, stop and destroy.
+
* **Bug fixes**
* qemu: Fix reversion and inactive deletion of internal snapshots with UEFI NVRAM
@@ -63,6 +84,13 @@ v10.10.0 (unreleased)
firmware was allowed, but certain operations such as reversion or inactive
deletion didn't work properly as they didn't consider the NVRAM qcow2 file.
+ * virnetdevopenvswitch: Warn on unsupported QoS settings
+
+ For OpenVSwitch vNICs libivrt does not set QoS directly using 'tc' but
+ offloads setting to OVS. But OVS is not as feature full as libvirt in this
+ regard and setting different 'peak' than 'average' results in vNIC always
+ sticking with 'peak'. Produce a warning if that's the case.
+
v10.9.0 (2024-11-01)
====================
--
2.45.2
4 weeks
[PATCH 0/8] qemu: fixes for blockjobs with <dataStore>
by Peter Krempa
Couple fixes for the <dataStore> feature when used with blockjobs:
- fixes for qemuBlockReopenAccess (code driving 'blockdev-reopen' in
qemu) for bugs noticed during testing of <dataStore>
- the 'auto-read-only' qemu feature doesn't apply od the 'data-file'
blockdevs, thus libvirt needs to handle them explicitly
- lookup of the node name associated with the <dataStore> volume in the
chains (for block threshold event handling)
Peter Krempa (8):
qemuBlockReopenAccess: Add debug log entry about state of the image
qemuBlockReopenAccess: Fix update of 'readonly' state
qemuBlockReopenAccess: Don't require backing chain terminator for
non-chained images
qemu: block: Ensure that <dataStore> is in appropriate state
qemu: snapshot: Change 'data-file' to read-only after snapshot
qemuDomainVirStorageSourceFindByNodeName: Extract nodename matching
qemuDomainVirStorageSourceFindByNodeName: Match also '<dataStore>'
sources
qemuDomainGetStorageSourceByDevstr: Lookup also '<dataStore>'
src/qemu/qemu_block.c | 60 +++++++++++++++++++++++++++++++---------
src/qemu/qemu_blockjob.c | 16 ++++++++++-
src/qemu/qemu_domain.c | 38 +++++++++++++++++++++----
src/qemu/qemu_snapshot.c | 12 ++++++--
4 files changed, 105 insertions(+), 21 deletions(-)
--
2.47.0
4 weeks
[PATCH for 10.10.0 0/5] Fix broken XML schemas and 'virschematest'
by Peter Krempa
'virschematest' didn't test the majority of files for some time so some
schema problems snuck in.
Peter Krempa (5):
schemas: domain: Make <identity> subelement of NFS disk source
optional
schemas: domaincaps: Add schema for 'panic' device
schemas: domaincaps: Add schema for 'canonical' cpu model name
schemas: domaincaps: Add schema for CPU 'blockers'
virschematest: Don't skip all "directory" tests
src/conf/schemas/domaincaps.rng | 29 +++++++++++++++++++++++++++++
src/conf/schemas/domaincommon.rng | 26 ++++++++++++++------------
tests/virschematest.c | 9 +++++----
3 files changed, 48 insertions(+), 16 deletions(-)
--
2.47.0
4 weeks
[PATCH] NEWS: Mention qcow2 'data-file', block NVRAM, and internal snapshot reversion
by Peter Krempa
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
NEWS.rst | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 185880d0e8..4b7f4e8244 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -38,10 +38,31 @@ v10.10.0 (unreleased)
Updates to QEMU CPU models with -vN suffix can now be used in libvirt just
like any other CPU model.
+ * qemu: Support for the 'data-file' QCOW2 image feature
+
+ The QEMU hypervisor driver now supports QCOW2 images with 'data-file'
+ feature present (both when probing form the image itself and when specified
+ explicitly via ``<dataStore>`` element). This can be useful when it's
+ required to keep data "raw" on disk, but the use case requires features
+ of the QCOW2 format such as incremental backups.
+
* **Improvements**
+ * qemu: Support UEFI NVRAM images on block storage
+
+ Libvirt now allows users to use block storage as backend for UEFI NVRAM
+ images and allows them to be in format different than the template. When
+ qcow2 is used as the format, the images are now also auto-populated from the
+ template.
+
* **Bug fixes**
+ * qemu: Fix reversion and inactive deletion of internal snapshots with UEFI NVRAM
+
+ In `v10.9.0 (2024-11-01)`_ creation of internal snapshots of VMs with UEFI
+ firmware was allowed, but certain operations such as reversion or inactive
+ deletion didn't work properly as they didn't consider the NVRAM qcow2 file.
+
v10.9.0 (2024-11-01)
====================
--
2.47.0
4 weeks, 1 day
[PATCH] qemu: Validate QoS values in qemuDomainSetInterfaceParameters()
by Michal Privoznik
This is similar to one of my previous commits (v10.7.0-rc1~22)
which introduce a check that <bandwidth/> values fit into certain
limits. My original commit validated values when parsing
<bandwidth/> XML, but completely missed the case when values are
set over virDomainSetInterfaceParameters() API.
Solution is simple - just perform validation after bandwidth
structure is reconstructed from arguments passed to the API.
Resolves: https://issues.redhat.com/browse/RHEL-65372
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d1b32de56a..09f7edda7d 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9883,6 +9883,9 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
if (!bandwidth->out->average)
VIR_FREE(bandwidth->out);
+ if (!virNetDevBandwidthValidate(bandwidth))
+ goto endjob;
+
if (net) {
newBandwidth = g_new0(virNetDevBandwidth, 1);
--
2.45.2
4 weeks, 1 day
[PATCH] NEWS: Document support for versioned CPU models
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index 88ac38834a..557c5b18d3 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -33,6 +33,11 @@ v10.10.0 (unreleased)
Limitation: The s390x BIOS will try to IPL up to 8 total devices, any
number of which may be disks or network devices.
+ * qemu: Add support for versioned CPU models
+
+ Updates to QEMU CPU models with -vN suffix can now be used in libvirt just
+ like any other CPU model.
+
* **Improvements**
* **Bug fixes**
--
2.47.0
4 weeks, 1 day