[PATCH 00/12] qemu: migration: Fix crashes when VM shutdowns itself during migration in active state
by Peter Krempa
The daemon crashes due to unexpected cleanup happening due to bad
assumptions about locking and state. See patch 5.
Peter Krempa (12):
qemuBlockJobProcessEventConcludedBackup: Handle potentially NULL
'job->disk'
qemuDomainDiskPrivateDispose: Prevent dangling 'disk' pointer in
blockjob data
qemuDomainDeviceBackendChardevForeach: Fix typo in comment
qemuDomainObjWait: Add documentation
qemuProcessStop: Prevent crash when qemuDomainObjStopWorker() unlocks
the VM
qemuProcessStop: Move code not depending on 'vm->def->id' after reset
of the ID
qemu: process: Ensure that 'beingDestroyed' gets cleared only after VM
id is reset
qemu: domain: Introduce qemuDomainObjIsActive helper
qemu: migration: Properly check for live VM after qemuDomainObjWait()
qemu: migration: Inline 'qemuMigrationDstFinishResume()'
qemuMigrationSrcRun: Re-check whether VM is active before accessing
job data
qemu: migration: Preserve error across qemuDomainSetMaxMemLock() on
error paths
src/qemu/qemu_backup.c | 6 +--
src/qemu/qemu_backup.h | 2 +-
src/qemu/qemu_blockjob.c | 9 +++-
src/qemu/qemu_domain.c | 40 +++++++++++++-
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_migration.c | 43 +++++++---------
src/qemu/qemu_process.c | 106 ++++++++++++++++++++++----------------
7 files changed, 131 insertions(+), 77 deletions(-)
--
2.45.2
10 months
[PATCH] qemu: Don't specify vfio-pci.ramfb when ramfb is false
by Jonathon Jongsma
Commit 7c8e606b64c73ca56d7134cb16d01257f39c53ef attempted to fix
the specification of the ramfb property for vfio-pci devices, but it
failed when ramfb is explicitly set to 'off'. This is because only the
'vfio-pci-nohotplug' device supports the 'ramfb' property. Since we use
the base 'vfio-pci' device unless ramfb is enabled, attempting to set
the 'ramfb' parameter to 'off' this will result in an error like the
following:
error: internal error: QEMU unexpectedly closed the monitor
(vm='rhel'): 2024-06-06T04:43:22.896795Z qemu-kvm: -device
{"driver":"vfio-pci","host":"0000:b1:00.4","id":"hostdev0","display":"on
","ramfb":false,"bus":"pci.7","addr":"0x0"}: Property 'vfio-pci.ramfb'
not found.
This also more closely matches what is done for mdev devices.
Resolves: https://issues.redhat.com/browse/RHEL-28808
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/qemu/qemu_command.c | 6 ++++--
.../hostdev-pci-display-ramfb.x86_64-latest.args | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 2d0eddc79e..1e9de6460e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -4760,12 +4760,14 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def,
g_autofree char *host = virPCIDeviceAddressAsString(&pcisrc->addr);
const char *failover_pair_id = NULL;
const char *driver = NULL;
+ /* 'ramfb' property must be omitted unless it's to be enabled */
+ bool ramfb = pcisrc->ramfb == VIR_TRISTATE_SWITCH_ON;
/* caller has to assign proper passthrough driver name */
switch (pcisrc->driver.name) {
case VIR_DEVICE_HOSTDEV_PCI_DRIVER_NAME_VFIO:
/* ramfb support requires the nohotplug variant */
- if (pcisrc->ramfb == VIR_TRISTATE_SWITCH_ON)
+ if (ramfb)
driver = "vfio-pci-nohotplug";
else
driver = "vfio-pci";
@@ -4798,7 +4800,7 @@ qemuBuildPCIHostdevDevProps(const virDomainDef *def,
"p:bootindex", dev->info->effectiveBootIndex,
"S:failover_pair_id", failover_pair_id,
"S:display", qemuOnOffAuto(pcisrc->display),
- "T:ramfb", pcisrc->ramfb,
+ "B:ramfb", ramfb,
NULL) < 0)
return NULL;
diff --git a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
index e6e538ef1c..a681504c3d 100644
--- a/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
+++ b/tests/qemuxmlconfdata/hostdev-pci-display-ramfb.x86_64-latest.args
@@ -29,6 +29,6 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest2/.config \
-audiodev '{"id":"audio1","driver":"none"}' \
-vnc 127.0.0.1:0,audiodev=audio1 \
-device '{"driver":"vfio-pci-nohotplug","host":"0000:06:12.5","id":"hostdev0","display":"on","ramfb":true,"bus":"pci.0","addr":"0x2"}' \
--device '{"driver":"vfio-pci","host":"0000:06:13.6","id":"hostdev1","display":"off","ramfb":false,"bus":"pci.0","addr":"0x3"}' \
+-device '{"driver":"vfio-pci","host":"0000:06:13.6","id":"hostdev1","display":"off","bus":"pci.0","addr":"0x3"}' \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
-msg timestamp=on
--
2.45.1
10 months
[PATCH v2] Pass shutoff reason to release hook
by Swapnil Ingle
Sometimes in release hook it is useful to know if the VM shutdown was graceful
or not. This is especially useful to do cleanup based on the VM shutdown failure
reason in release hook. This patch proposes to use the last argument 'extra'
to pass VM shutoff reason in the call to release hook.
Making this change for Qemu and LXC.
Signed-off-by: Swapnil Ingle <swapnil.ingle(a)nutanix.com>
---
docs/hooks.rst | 49 +++++++++++++++++++++++++++++++++++++++--
src/lxc/lxc_process.c | 2 +-
src/qemu/qemu_process.c | 2 +-
3 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/docs/hooks.rst b/docs/hooks.rst
index 1dbc492bd4..cdcb161c7e 100644
--- a/docs/hooks.rst
+++ b/docs/hooks.rst
@@ -215,7 +215,30 @@ operation. There is no specific operation to indicate a "restart" is occurring.
::
- /etc/libvirt/hooks/qemu guest_name release end -
+ /etc/libvirt/hooks/qemu guest_name release end <shutoff-reason>
+
+ +-------------------+------------------------------------------------------------------+
+ | Shutoff reason | Description |
+ +===================+==================================================================+
+ | unknown | the reason is unknown |
+ +-------------------+------------------------------------------------------------------+
+ | shutdown | normal shutdown |
+ +-------------------+------------------------------------------------------------------+
+ | destroyed | forced poweroff |
+ +-------------------+------------------------------------------------------------------+
+ | crashed | domain crashed |
+ +-------------------+------------------------------------------------------------------+
+ | migrated | migrated to another host |
+ +-------------------+------------------------------------------------------------------+
+ | saved | saved to a file |
+ +-------------------+------------------------------------------------------------------+
+ | failed | domain failed to start |
+ +-------------------+------------------------------------------------------------------+
+ | from snapshot | restored from a snapshot which was taken while domain was shutoff|
+ +-------------------+------------------------------------------------------------------+
+ | daemon | daemon decides to kill domain during reconnection processing |
+ +-------------------+------------------------------------------------------------------+
+
- :since:`Since 0.9.11`, the qemu hook script is also called at the beginning
of incoming migration. It is called as:
@@ -312,7 +335,29 @@ operation. There is no specific operation to indicate a "restart" is occurring.
::
- /etc/libvirt/hooks/lxc guest_name release end -
+ /etc/libvirt/hooks/lxc guest_name release end <shutoff-reason>
+
+ +-------------------+------------------------------------------------------------------+
+ | Shutoff reason | Description |
+ +===================+==================================================================+
+ | unknown | the reason is unknown |
+ +-------------------+------------------------------------------------------------------+
+ | shutdown | normal shutdown |
+ +-------------------+------------------------------------------------------------------+
+ | destroyed | forced poweroff |
+ +-------------------+------------------------------------------------------------------+
+ | crashed | domain crashed |
+ +-------------------+------------------------------------------------------------------+
+ | migrated | migrated to another host |
+ +-------------------+------------------------------------------------------------------+
+ | saved | saved to a file |
+ +-------------------+------------------------------------------------------------------+
+ | failed | domain failed to start |
+ +-------------------+------------------------------------------------------------------+
+ | from snapshot | restored from a snapshot which was taken while domain was shutoff|
+ +-------------------+------------------------------------------------------------------+
+ | daemon | daemon decides to kill domain during reconnection processing |
+ +-------------------+------------------------------------------------------------------+
- :since:`Since 0.9.13`, the lxc hook script is also called when the libvirtd
daemon restarts and reconnects to previously running LXC processes. If the
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index 30ff4eb3d0..f5eb5383ec 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -244,7 +244,7 @@ static void virLXCProcessCleanup(virLXCDriver *driver,
/* we can't stop the operation even if the script raised an error */
virHookCall(VIR_HOOK_DRIVER_LXC, vm->def->name,
VIR_HOOK_LXC_OP_RELEASE, VIR_HOOK_SUBOP_END,
- NULL, xml, NULL);
+ virDomainShutoffReasonTypeToString(reason), xml, NULL);
}
if (flags & VIR_LXC_PROCESS_CLEANUP_REMOVE_TRANSIENT)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 2c33ac3bf7..9de01b1a0d 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8722,7 +8722,7 @@ void qemuProcessStop(virQEMUDriver *driver,
/* we can't stop the operation even if the script raised an error */
virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
VIR_HOOK_QEMU_OP_RELEASE, VIR_HOOK_SUBOP_END,
- NULL, xml, NULL);
+ virDomainShutoffReasonTypeToString(reason), xml, NULL);
}
virDomainObjRemoveTransientDef(vm);
--
2.45.2
10 months
[PATCH] Pass shutoff reason to release hook
by Swapnil Ingle
Sometimes in release hook it is useful to know if the VM shutdown was graceful
or not. This is especially useful to do cleanup based on the VM shutdown failure
reason in release hook. This patch proposes to use the last argument 'extra'
to pass VM shutoff reason in the call to release hook.
Signed-off-by: Swapnil Ingle <swapnil.ingle(a)nutanix.com>
---
docs/hooks.rst | 24 +++++++++++++++++++++++-
src/qemu/qemu_process.c | 2 +-
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/docs/hooks.rst b/docs/hooks.rst
index 1dbc492bd4..e76208021a 100644
--- a/docs/hooks.rst
+++ b/docs/hooks.rst
@@ -312,7 +312,29 @@ operation. There is no specific operation to indicate a "restart" is occurring.
::
- /etc/libvirt/hooks/lxc guest_name release end -
+ /etc/libvirt/hooks/lxc guest_name release end <shutoff-reason>
+
+ +-------------------+------------------------------------------------------------------+
+ | Shutoff reason | Description |
+ +===================+==================================================================+
+ | unknown | the reason is unknown |
+ +-------------------+------------------------------------------------------------------+
+ | shutdown | normal shutdown |
+ +-------------------+------------------------------------------------------------------+
+ | destroyed | forced poweroff |
+ +-------------------+------------------------------------------------------------------+
+ | crashed | domain crashed |
+ +-------------------+------------------------------------------------------------------+
+ | migrated | migrated to another host |
+ +-------------------+------------------------------------------------------------------+
+ | saved | saved to a file |
+ +-------------------+------------------------------------------------------------------+
+ | failed | domain failed to start |
+ +-------------------+------------------------------------------------------------------+
+ | from snapshot | restored from a snapshot which was taken while domain was shutoff|
+ +-------------------+------------------------------------------------------------------+
+ | daemon | daemon decides to kill domain during reconnection processing |
+ +-------------------+------------------------------------------------------------------+
- :since:`Since 0.9.13`, the lxc hook script is also called when the libvirtd
daemon restarts and reconnects to previously running LXC processes. If the
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 7ef7040a85..0a03685ca7 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -8716,7 +8716,7 @@ void qemuProcessStop(virQEMUDriver *driver,
/* we can't stop the operation even if the script raised an error */
virHookCall(VIR_HOOK_DRIVER_QEMU, vm->def->name,
VIR_HOOK_QEMU_OP_RELEASE, VIR_HOOK_SUBOP_END,
- NULL, xml, NULL);
+ virDomainShutoffReasonTypeToString(reason), xml, NULL);
}
virDomainObjRemoveTransientDef(vm);
--
2.45.2
10 months
Plans for 10.5.0 release (freeze on Tuesday 25 Jun)
by Jiri Denemark
We are getting close to 10.5.0 release of libvirt. To aim for the
release on Monday 01 Jul I suggest entering the freeze on Tuesday 25
Jun and tagging RC2 on Thursday 27 Jun.
I hope this works for everyone.
Jirka
10 months
[PATCH 0/2] qemu: implement iommu coldplug/unplug
by Adam Julis
Adam Julis (2):
syms: Properly export virDomainIOMMUDefFree()
qemu: implement iommu coldplug/unplug
src/libvirt_private.syms | 1 +
src/qemu/qemu_driver.c | 20 ++++++++++++++++++--
2 files changed, 19 insertions(+), 2 deletions(-)
--
2.45.0
10 months
[PATCH v2] ci: fix CI package list and refresh with 'lcitool manifest'
by Daniel P. Berrangé
The ci/manifest.yml file references a package 'libclang-rt-dev' that
does not exist in libvirt-ci mappings.yml. The latest refresh in
commit 0759cf3fa6ed8d12bd327c5752785c53e35c8483
Author: Michal Prívozník <mprivozn(a)redhat.com>
Date: Fri May 3 15:58:20 2024 +0200
ci: Introduce Ubuntu 24.04
was presumably done against a local change to libvirt-ci.git that
had not yet been merged, as the clang packages now appear on many
more build envs.
Signed-off-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
ci/buildenv/almalinux-9.sh | 2 +-
ci/buildenv/debian-11-cross-aarch64.sh | 1 +
ci/buildenv/debian-11-cross-armv6l.sh | 1 +
ci/buildenv/debian-11-cross-armv7l.sh | 1 +
ci/buildenv/debian-11-cross-i686.sh | 1 +
ci/buildenv/debian-11-cross-mips64el.sh | 1 +
ci/buildenv/debian-11-cross-mipsel.sh | 1 +
ci/buildenv/debian-11-cross-ppc64le.sh | 1 +
ci/buildenv/debian-11-cross-s390x.sh | 1 +
ci/buildenv/debian-11.sh | 1 +
ci/buildenv/opensuse-leap-15.sh | 1 +
ci/buildenv/opensuse-tumbleweed.sh | 1 +
ci/buildenv/ubuntu-2204.sh | 1 +
ci/containers/almalinux-9.Dockerfile | 2 +-
ci/containers/debian-11-cross-aarch64.Dockerfile | 1 +
ci/containers/debian-11-cross-armv6l.Dockerfile | 1 +
ci/containers/debian-11-cross-armv7l.Dockerfile | 1 +
ci/containers/debian-11-cross-i686.Dockerfile | 1 +
ci/containers/debian-11-cross-mips64el.Dockerfile | 1 +
ci/containers/debian-11-cross-mipsel.Dockerfile | 1 +
ci/containers/debian-11-cross-ppc64le.Dockerfile | 1 +
ci/containers/debian-11-cross-s390x.Dockerfile | 1 +
ci/containers/debian-11.Dockerfile | 1 +
ci/containers/opensuse-leap-15.Dockerfile | 1 +
ci/containers/opensuse-tumbleweed.Dockerfile | 1 +
ci/containers/ubuntu-2204.Dockerfile | 1 +
ci/lcitool/projects/libvirt.yml | 2 +-
27 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/ci/buildenv/almalinux-9.sh b/ci/buildenv/almalinux-9.sh
index f0826e1313..5791a73d23 100644
--- a/ci/buildenv/almalinux-9.sh
+++ b/ci/buildenv/almalinux-9.sh
@@ -16,7 +16,7 @@ function install_buildenv() {
ca-certificates \
ccache \
clang \
- clang-devel \
+ compiler-rt \
cpp \
cyrus-sasl-devel \
device-mapper-devel \
diff --git a/ci/buildenv/debian-11-cross-aarch64.sh b/ci/buildenv/debian-11-cross-aarch64.sh
index 3afb09aee5..8540fb8d74 100644
--- a/ci/buildenv/debian-11-cross-aarch64.sh
+++ b/ci/buildenv/debian-11-cross-aarch64.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-armv6l.sh b/ci/buildenv/debian-11-cross-armv6l.sh
index ff78ec0b86..131a7019c0 100644
--- a/ci/buildenv/debian-11-cross-armv6l.sh
+++ b/ci/buildenv/debian-11-cross-armv6l.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-armv7l.sh b/ci/buildenv/debian-11-cross-armv7l.sh
index ff3ef03463..ba78ffcfac 100644
--- a/ci/buildenv/debian-11-cross-armv7l.sh
+++ b/ci/buildenv/debian-11-cross-armv7l.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-i686.sh b/ci/buildenv/debian-11-cross-i686.sh
index e68e2ffcbe..104eb20805 100644
--- a/ci/buildenv/debian-11-cross-i686.sh
+++ b/ci/buildenv/debian-11-cross-i686.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-mips64el.sh b/ci/buildenv/debian-11-cross-mips64el.sh
index 0653223a3d..7b1830453c 100644
--- a/ci/buildenv/debian-11-cross-mips64el.sh
+++ b/ci/buildenv/debian-11-cross-mips64el.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-mipsel.sh b/ci/buildenv/debian-11-cross-mipsel.sh
index cee2feff59..eef5cdbfab 100644
--- a/ci/buildenv/debian-11-cross-mipsel.sh
+++ b/ci/buildenv/debian-11-cross-mipsel.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-ppc64le.sh b/ci/buildenv/debian-11-cross-ppc64le.sh
index 7193d4acd0..f2c2f60623 100644
--- a/ci/buildenv/debian-11-cross-ppc64le.sh
+++ b/ci/buildenv/debian-11-cross-ppc64le.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11-cross-s390x.sh b/ci/buildenv/debian-11-cross-s390x.sh
index ca0fb54839..519d9c8b31 100644
--- a/ci/buildenv/debian-11-cross-s390x.sh
+++ b/ci/buildenv/debian-11-cross-s390x.sh
@@ -27,6 +27,7 @@ function install_buildenv() {
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/buildenv/debian-11.sh b/ci/buildenv/debian-11.sh
index 18350321b0..5986682af8 100644
--- a/ci/buildenv/debian-11.sh
+++ b/ci/buildenv/debian-11.sh
@@ -36,6 +36,7 @@ function install_buildenv() {
libblkid-dev \
libc6-dev \
libcap-ng-dev \
+ libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
diff --git a/ci/buildenv/opensuse-leap-15.sh b/ci/buildenv/opensuse-leap-15.sh
index bc7394839b..a59af136ca 100644
--- a/ci/buildenv/opensuse-leap-15.sh
+++ b/ci/buildenv/opensuse-leap-15.sh
@@ -14,6 +14,7 @@ function install_buildenv() {
ca-certificates \
ccache \
clang \
+ clang-devel \
codespell \
cpp \
cppi \
diff --git a/ci/buildenv/opensuse-tumbleweed.sh b/ci/buildenv/opensuse-tumbleweed.sh
index 88ccff99c6..ac566d349f 100644
--- a/ci/buildenv/opensuse-tumbleweed.sh
+++ b/ci/buildenv/opensuse-tumbleweed.sh
@@ -14,6 +14,7 @@ function install_buildenv() {
ca-certificates \
ccache \
clang \
+ clang-devel \
codespell \
cpp \
cppi \
diff --git a/ci/buildenv/ubuntu-2204.sh b/ci/buildenv/ubuntu-2204.sh
index 6bd67ba777..c71a0b5f47 100644
--- a/ci/buildenv/ubuntu-2204.sh
+++ b/ci/buildenv/ubuntu-2204.sh
@@ -36,6 +36,7 @@ function install_buildenv() {
libblkid-dev \
libc6-dev \
libcap-ng-dev \
+ libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
diff --git a/ci/containers/almalinux-9.Dockerfile b/ci/containers/almalinux-9.Dockerfile
index 68608b12a9..27ac990b22 100644
--- a/ci/containers/almalinux-9.Dockerfile
+++ b/ci/containers/almalinux-9.Dockerfile
@@ -17,7 +17,7 @@ RUN dnf update -y && \
ca-certificates \
ccache \
clang \
- clang-devel \
+ compiler-rt \
cpp \
cyrus-sasl-devel \
device-mapper-devel \
diff --git a/ci/containers/debian-11-cross-aarch64.Dockerfile b/ci/containers/debian-11-cross-aarch64.Dockerfile
index 0f971ff9cb..1cb573821f 100644
--- a/ci/containers/debian-11-cross-aarch64.Dockerfile
+++ b/ci/containers/debian-11-cross-aarch64.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-armv6l.Dockerfile b/ci/containers/debian-11-cross-armv6l.Dockerfile
index cfed7a7fc9..6989546ebf 100644
--- a/ci/containers/debian-11-cross-armv6l.Dockerfile
+++ b/ci/containers/debian-11-cross-armv6l.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-armv7l.Dockerfile b/ci/containers/debian-11-cross-armv7l.Dockerfile
index f703be3423..fcd6a6383b 100644
--- a/ci/containers/debian-11-cross-armv7l.Dockerfile
+++ b/ci/containers/debian-11-cross-armv7l.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-i686.Dockerfile b/ci/containers/debian-11-cross-i686.Dockerfile
index 58be733459..8d79934a52 100644
--- a/ci/containers/debian-11-cross-i686.Dockerfile
+++ b/ci/containers/debian-11-cross-i686.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-mips64el.Dockerfile b/ci/containers/debian-11-cross-mips64el.Dockerfile
index c3198e0470..d80f741311 100644
--- a/ci/containers/debian-11-cross-mips64el.Dockerfile
+++ b/ci/containers/debian-11-cross-mips64el.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-mipsel.Dockerfile b/ci/containers/debian-11-cross-mipsel.Dockerfile
index 21e9b0c7f9..dc674150f5 100644
--- a/ci/containers/debian-11-cross-mipsel.Dockerfile
+++ b/ci/containers/debian-11-cross-mipsel.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-ppc64le.Dockerfile b/ci/containers/debian-11-cross-ppc64le.Dockerfile
index 29be7997f8..fc3a9ee157 100644
--- a/ci/containers/debian-11-cross-ppc64le.Dockerfile
+++ b/ci/containers/debian-11-cross-ppc64le.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11-cross-s390x.Dockerfile b/ci/containers/debian-11-cross-s390x.Dockerfile
index fd1507b294..336694b2d3 100644
--- a/ci/containers/debian-11-cross-s390x.Dockerfile
+++ b/ci/containers/debian-11-cross-s390x.Dockerfile
@@ -29,6 +29,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
iproute2 \
iptables \
kmod \
+ libclang-dev \
libxml2-utils \
locales \
lvm2 \
diff --git a/ci/containers/debian-11.Dockerfile b/ci/containers/debian-11.Dockerfile
index c16c43d407..6f08eb7448 100644
--- a/ci/containers/debian-11.Dockerfile
+++ b/ci/containers/debian-11.Dockerfile
@@ -38,6 +38,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libblkid-dev \
libc6-dev \
libcap-ng-dev \
+ libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
diff --git a/ci/containers/opensuse-leap-15.Dockerfile b/ci/containers/opensuse-leap-15.Dockerfile
index 6deaea0904..bf794d6929 100644
--- a/ci/containers/opensuse-leap-15.Dockerfile
+++ b/ci/containers/opensuse-leap-15.Dockerfile
@@ -15,6 +15,7 @@ RUN zypper update -y && \
ca-certificates \
ccache \
clang \
+ clang-devel \
codespell \
cpp \
cppi \
diff --git a/ci/containers/opensuse-tumbleweed.Dockerfile b/ci/containers/opensuse-tumbleweed.Dockerfile
index d4ebcd7176..2b7cdb4af5 100644
--- a/ci/containers/opensuse-tumbleweed.Dockerfile
+++ b/ci/containers/opensuse-tumbleweed.Dockerfile
@@ -15,6 +15,7 @@ RUN zypper dist-upgrade -y && \
ca-certificates \
ccache \
clang \
+ clang-devel \
codespell \
cpp \
cppi \
diff --git a/ci/containers/ubuntu-2204.Dockerfile b/ci/containers/ubuntu-2204.Dockerfile
index 8e32d992f3..5e8829bc2b 100644
--- a/ci/containers/ubuntu-2204.Dockerfile
+++ b/ci/containers/ubuntu-2204.Dockerfile
@@ -38,6 +38,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
libblkid-dev \
libc6-dev \
libcap-ng-dev \
+ libclang-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
diff --git a/ci/lcitool/projects/libvirt.yml b/ci/lcitool/projects/libvirt.yml
index a5d2248437..5e0bd66958 100644
--- a/ci/lcitool/projects/libvirt.yml
+++ b/ci/lcitool/projects/libvirt.yml
@@ -36,7 +36,7 @@ packages:
- libblkid
- libc
- libcap-ng
- - libclang-rt-dev
+ - libclang-rt
- libcurl
- libiscsi
- libnbd
--
2.45.1
10 months
[PATCH v2 0/4] qemu: Use TPM 2.0 in most scenarios
by Andrea Bolognani
Changes from [v1]
* use TPM 2.0 more;
* reject TPM 1.2 more;
* add better comments to loongarch64 and s390x test cases.
[v1] https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/YZ...
Andrea Bolognani (4):
tests: Add TPM coverage to default-models tests
tests: Delete some redundant test cases
qemu: Default to TPM 2.0 in most scenarios
qemu: Reject TPM 1.2 in most scenarios
src/qemu/qemu_domain.c | 13 ++--
src/qemu/qemu_validate.c | 22 +++---
...aarch64-tpm-wrong-model.aarch64-latest.err | 2 +-
.../aarch64-tpm.aarch64-latest.args | 34 ---------
.../aarch64-tpm.aarch64-latest.xml | 29 --------
tests/qemuxmlconfdata/aarch64-tpm.xml | 15 ----
...ault-models.aarch64-latest.abi-update.args | 3 +
...fault-models.aarch64-latest.abi-update.xml | 3 +
...64-virt-default-models.aarch64-latest.args | 3 +
...h64-virt-default-models.aarch64-latest.xml | 3 +
.../aarch64-virt-default-models.xml | 3 +
.../loongarch64-virt-default-models.xml | 3 +
...efault-models.ppc64-latest.abi-update.args | 3 +
...default-models.ppc64-latest.abi-update.xml | 4 ++
...4-pseries-default-models.ppc64-latest.args | 3 +
...64-pseries-default-models.ppc64-latest.xml | 4 ++
.../ppc64-pseries-default-models.xml | 3 +
...ault-models.riscv64-latest.abi-update.args | 3 +
...fault-models.riscv64-latest.abi-update.xml | 3 +
...64-virt-default-models.riscv64-latest.args | 3 +
...v64-virt-default-models.riscv64-latest.xml | 3 +
.../riscv64-virt-default-models.xml | 3 +
.../s390x-ccw-default-models.xml | 2 +
.../tpm-emulator-spapr.ppc64-latest.args | 45 ------------
.../tpm-emulator-spapr.ppc64-latest.xml | 1 -
tests/qemuxmlconfdata/tpm-emulator-spapr.xml | 70 -------------------
...fault-models.x86_64-latest.abi-update.args | 3 +
...efault-models.x86_64-latest.abi-update.xml | 3 +
...86_64-pc-default-models.x86_64-latest.args | 3 +
...x86_64-pc-default-models.x86_64-latest.xml | 3 +
.../x86_64-pc-default-models.xml | 3 +
...fault-models.x86_64-latest.abi-update.args | 3 +
...efault-models.x86_64-latest.abi-update.xml | 3 +
...6_64-q35-default-models.x86_64-latest.args | 3 +
...86_64-q35-default-models.x86_64-latest.xml | 3 +
.../x86_64-q35-default-models.xml | 3 +
tests/qemuxmlconftest.c | 2 -
37 files changed, 100 insertions(+), 215 deletions(-)
delete mode 100644 tests/qemuxmlconfdata/aarch64-tpm.aarch64-latest.args
delete mode 100644 tests/qemuxmlconfdata/aarch64-tpm.aarch64-latest.xml
delete mode 100644 tests/qemuxmlconfdata/aarch64-tpm.xml
delete mode 100644 tests/qemuxmlconfdata/tpm-emulator-spapr.ppc64-latest.args
delete mode 120000 tests/qemuxmlconfdata/tpm-emulator-spapr.ppc64-latest.xml
delete mode 100644 tests/qemuxmlconfdata/tpm-emulator-spapr.xml
--
2.45.1
10 months
[PATCH 2/2] qemu: implement iommu coldplug/unplug
by Adam Julis
Resolves: https://issues.redhat.com/browse/RHEL-23833
Signed-off-by: Adam Julis <ajulis(a)redhat.com>
---
src/qemu/qemu_driver.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 67b9778c67..74d5e3bb86 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6847,6 +6847,15 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
vmdef->vsock = g_steal_pointer(&dev->data.vsock);
break;
+ case VIR_DOMAIN_DEVICE_IOMMU:
+ if (vmdef->iommu) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("domain already has an iommu configuration"));
+ return -1;
+ }
+ vmdef->iommu = g_steal_pointer(&dev->data.iommu);
+ break;
+
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
@@ -6856,7 +6865,6 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
case VIR_DOMAIN_DEVICE_NONE:
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
- case VIR_DOMAIN_DEVICE_IOMMU:
case VIR_DOMAIN_DEVICE_AUDIO:
case VIR_DOMAIN_DEVICE_CRYPTO:
case VIR_DOMAIN_DEVICE_LAST:
@@ -7057,6 +7065,15 @@ qemuDomainDetachDeviceConfig(virDomainDef *vmdef,
g_clear_pointer(&vmdef->vsock, virDomainVsockDefFree);
break;
+ case VIR_DOMAIN_DEVICE_IOMMU:
+ if (!vmdef->iommu) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("matching iommu config not found"));
+ return -1;
+ }
+ g_clear_pointer(&vmdef->iommu, virDomainIOMMUDefFree);
+ break;
+
case VIR_DOMAIN_DEVICE_VIDEO:
case VIR_DOMAIN_DEVICE_GRAPHICS:
case VIR_DOMAIN_DEVICE_HUB:
@@ -7066,7 +7083,6 @@ qemuDomainDetachDeviceConfig(virDomainDef *vmdef,
case VIR_DOMAIN_DEVICE_NONE:
case VIR_DOMAIN_DEVICE_TPM:
case VIR_DOMAIN_DEVICE_PANIC:
- case VIR_DOMAIN_DEVICE_IOMMU:
case VIR_DOMAIN_DEVICE_AUDIO:
case VIR_DOMAIN_DEVICE_CRYPTO:
case VIR_DOMAIN_DEVICE_LAST:
--
2.44.0
10 months
[PATCH] conf: add validation of potential dependencies
by Adam Julis
Although existing virDomainDefPostParse is called after modifying
the XML and it contains validating process for changed device,
the virDomainDefValidate function performs a more comprehensive
check. It should detect errors resulting from dependencies
between devices. Therefore, the virDomainDefValidate is added at
the end.
Signed-off-by: Adam Julis <ajulis(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 e2698c7924..67b9778c67 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6869,6 +6869,9 @@ qemuDomainAttachDeviceConfig(virDomainDef *vmdef,
if (virDomainDefPostParse(vmdef, parse_flags, xmlopt, qemuCaps) < 0)
return -1;
+ if (virDomainDefValidate(vmdef, parse_flags, xmlopt, qemuCaps) < 0)
+ return -1;
+
return 0;
}
--
2.44.0
10 months