34 changed files with 34 additions and 8044 deletions
@ -1,3 +0,0 @@ |
|||||
version https://git-lfs.github.com/spec/v1 |
|
||||
oid sha256:4fff62f08fdf938fe7fd21e260a908a44193cc6d34c42d3b1afdcadd34120357 |
|
||||
size 10659480 |
|
||||
@ -0,0 +1,3 @@ |
|||||
|
version https://git-lfs.github.com/spec/v1 |
||||
|
oid sha256:0cd46a8f3a2b9b63c35c6e6f42a6c2989183ef3b3d1499ee92b4876db35e6fe9 |
||||
|
size 10806364 |
||||
@ -1,134 +0,0 @@ |
|||||
From fa8e0a8220b8b29c97a77a9d564e68e6a2ddaee1 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <fa8e0a8220b8b29c97a77a9d564e68e6a2ddaee1.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Date: Wed, 12 Aug 2026 15:11:12 +0200 |
|
||||
Subject: [PATCH] Add guest device info to virDomainGetGuestInfo |
|
||||
|
|
||||
QEMU guest agent has 'guest-get-devices` command, which returns |
|
||||
information on guest devices (driver name, version, release date, |
|
||||
and so on). In this commit the public API part is introduced. |
|
||||
|
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
(cherry picked from commit 3033dae6989083fde1d06427ee2840242cfd8dca) |
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-235731 |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
---
|
|
||||
include/libvirt/libvirt-domain.h | 78 ++++++++++++++++++++++++++++++++ |
|
||||
src/libvirt-domain.c | 5 ++ |
|
||||
2 files changed, 83 insertions(+) |
|
||||
|
|
||||
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
|
|
||||
index f4dfe9fb1a..f9cc06b6e9 100644
|
|
||||
--- a/include/libvirt/libvirt-domain.h
|
|
||||
+++ b/include/libvirt/libvirt-domain.h
|
|
||||
@@ -8867,6 +8867,83 @@ int virDomainSetLaunchSecurityState(virDomainPtr domain,
|
|
||||
*/ |
|
||||
# define VIR_DOMAIN_GUEST_INFO_LOAD_15M "load.15m" |
|
||||
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_COUNT:
|
|
||||
+ *
|
|
||||
+ * The number of guest devices that detailed information is fetched for as
|
|
||||
+ * unsigned int.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_COUNT "device.count"
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX:
|
|
||||
+ *
|
|
||||
+ * The parameter name prefix to access each device entry. Concatenate the
|
|
||||
+ * prefix, the entry number formatted as an unsigned integer and one of the
|
|
||||
+ * device suffix parameters to form a complete parameter name.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "device."
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_NAME:
|
|
||||
+ *
|
|
||||
+ * Name of the device driver (e.g. ``VirtIO Balloon Driver``) as a string.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_NAME ".driverName"
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_DATE:
|
|
||||
+ *
|
|
||||
+ * Driver release date in seconds since the epoch (e.g. 1736726400) as long long.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_DATE ".driverDate"
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_VERSION:
|
|
||||
+ *
|
|
||||
+ * Driver version (e.g. ``100.100.104.27100``) as a string.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_VERSION ".driverVersion"
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE:
|
|
||||
+ *
|
|
||||
+ * Device identification (e.g. ``pci``) as a string.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE ".idType"
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_VENDOR:
|
|
||||
+ *
|
|
||||
+ * PCI device (a device with VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE equal
|
|
||||
+ * to ``pci``) vendor id (e.g. 6900) as a unsigned int.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_VENDOR ".pciVendor"
|
|
||||
+
|
|
||||
+/**
|
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_DEVICE:
|
|
||||
+ *
|
|
||||
+ * PCI device (a device with VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE equal
|
|
||||
+ * to ``pci``) device id (e.g. 4165) as a unsigned int.
|
|
||||
+ *
|
|
||||
+ * Since: 12.7.0
|
|
||||
+ */
|
|
||||
+# define VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_DEVICE ".pciDevice"
|
|
||||
+
|
|
||||
/** |
|
||||
* virDomainGuestInfoTypes: |
|
||||
* |
|
||||
@@ -8881,6 +8958,7 @@ typedef enum {
|
|
||||
VIR_DOMAIN_GUEST_INFO_DISKS = (1 << 5), /* return disks information (Since: 7.0.0) */ |
|
||||
VIR_DOMAIN_GUEST_INFO_INTERFACES = (1 << 6), /* return interfaces information (Since: 7.10.0) */ |
|
||||
VIR_DOMAIN_GUEST_INFO_LOAD = (1 << 7), /* return load averages (Since: 11.2.0) */ |
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICES = (1 << 8), /* return devices information (Since: 12.7.0) */
|
|
||||
} virDomainGuestInfoTypes; |
|
||||
|
|
||||
int virDomainGetGuestInfo(virDomainPtr domain, |
|
||||
diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
|
|
||||
index 4cf1d996b8..396d3727bd 100644
|
|
||||
--- a/src/libvirt-domain.c
|
|
||||
+++ b/src/libvirt-domain.c
|
|
||||
@@ -13260,6 +13260,11 @@ virDomainSetVcpu(virDomainPtr domain,
|
|
||||
* The VIR_DOMAIN_GUEST_INFO_LOAD_* constants define the known typed parameter |
|
||||
* keys. |
|
||||
* |
|
||||
+ * VIR_DOMAIN_GUEST_INFO_DEVICES:
|
|
||||
+ * Returns information on guest devices.
|
|
||||
+ * The VIR_DOMAIN_GUEST_INFO_DEVICE_* constants define the known typed
|
|
||||
+ * parameter keys.
|
|
||||
+ *
|
|
||||
* Using 0 for @types returns all information groups supported by the given |
|
||||
* hypervisor. |
|
||||
* |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,306 +0,0 @@ |
|||||
From f43463c7010e0b92c48d510be217abf191655754 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <f43463c7010e0b92c48d510be217abf191655754.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Wed, 22 Jul 2026 17:13:15 +0200 |
|
||||
Subject: [PATCH] Add support for keeping VM running when panic notifier is |
|
||||
used |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Some guest OSes (e.g. windows) can do an internal crash dump and reboot |
|
||||
after a crash. They unfortunately notify the OS before doing the crash |
|
||||
dump though so we need a new possibility for the <on_crash> action to |
|
||||
keep the VM as is. |
|
||||
|
|
||||
This patch introduces 'preserve-running' mode for on_crash and wires it |
|
||||
up into the qemu driver. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit cdea89dd87a10cd94deb3b067bae483d98c558ed) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
docs/formatdomain.rst | 3 ++ |
|
||||
include/libvirt/libvirt-domain.h | 1 + |
|
||||
src/conf/domain_conf.c | 2 ++ |
|
||||
src/conf/schemas/domaincommon.rng | 2 ++ |
|
||||
src/libxl/libxl_conf.c | 1 + |
|
||||
src/libxl/libxl_domain.c | 3 ++ |
|
||||
src/qemu/qemu_driver.c | 34 ++++++++++++++++++- |
|
||||
src/qemu/qemu_process.c | 18 ++++++++++ |
|
||||
.../async-teardown.x86_64-latest.xml | 2 +- |
|
||||
tests/qemuxmlconfdata/async-teardown.xml | 2 +- |
|
||||
tests/qemuxmlconftest.c | 1 + |
|
||||
tools/virsh-domain.c | 3 +- |
|
||||
12 files changed, 68 insertions(+), 4 deletions(-) |
|
||||
|
|
||||
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
|
|
||||
index 1e8c81c3a5..89665f8ab8 100644
|
|
||||
--- a/docs/formatdomain.rst
|
|
||||
+++ b/docs/formatdomain.rst
|
|
||||
@@ -2044,6 +2044,9 @@ The ``on_crash`` event supports these additional actions :since:`since 0.8.4`.
|
|
||||
``coredump-restart`` |
|
||||
The crashed domain's core will be dumped, and then the domain will be |
|
||||
restarted with the same configuration |
|
||||
+``preserve-running``
|
|
||||
+ The crashed domain will continue to run. This is useful if the guest OS can
|
|
||||
+ do an internal crash dump and reboot itself. :since:`Since 12.6.0`
|
|
||||
|
|
||||
:since:`Since 3.9.0`, the lifecycle events can be configured via the |
|
||||
`virDomainSetLifecycleAction <html/libvirt-libvirt-domain.html#virDomainSetLifecycleAction>`__ |
|
||||
diff --git a/include/libvirt/libvirt-domain.h b/include/libvirt/libvirt-domain.h
|
|
||||
index 5b67f8f897..f4dfe9fb1a 100644
|
|
||||
--- a/include/libvirt/libvirt-domain.h
|
|
||||
+++ b/include/libvirt/libvirt-domain.h
|
|
||||
@@ -8228,6 +8228,7 @@ typedef enum {
|
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE = 3, /* (Since: 3.9.0) */ |
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY = 4, /* (Since: 3.9.0) */ |
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART = 5, /* (Since: 3.9.0) */ |
|
||||
+ VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING = 6, /* (Since: 12.6.0) */
|
|
||||
|
|
||||
# ifdef VIR_ENUM_SENTINELS |
|
||||
VIR_DOMAIN_LIFECYCLE_ACTION_LAST /* (Since: 3.9.0) */ |
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
||||
index d43b8bdd5b..9880339e42 100644
|
|
||||
--- a/src/conf/domain_conf.c
|
|
||||
+++ b/src/conf/domain_conf.c
|
|
||||
@@ -303,6 +303,7 @@ VIR_ENUM_IMPL(virDomainLifecycleAction,
|
|
||||
"preserve", |
|
||||
"coredump-destroy", |
|
||||
"coredump-restart", |
|
||||
+ "preserve-running",
|
|
||||
); |
|
||||
|
|
||||
VIR_ENUM_IMPL(virDomainLockFailure, |
|
||||
@@ -5538,6 +5539,7 @@ virDomainDefLifecycleActionAllowed(virDomainLifecycle type,
|
|
||||
return true; |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
break; |
|
||||
} |
|
||||
break; |
|
||||
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
|
|
||||
index c7d7ebc876..c8f1fe5547 100644
|
|
||||
--- a/src/conf/schemas/domaincommon.rng
|
|
||||
+++ b/src/conf/schemas/domaincommon.rng
|
|
||||
@@ -5035,6 +5035,7 @@
|
|
||||
destroy: The domain is cleaned up |
|
||||
restart: A new domain is started in place of the old one |
|
||||
preserve: The domain will remain in memory until it is destroyed manually |
|
||||
+ preserve-running: Keep the domain as is, let the guest handle the crash.
|
|
||||
rename-restart: a variant of the previous one but where the old domain is |
|
||||
renamed before being saved to allow a restart |
|
||||
coredump-destroy: The crashed domain's core will be dumped, and then the |
|
||||
@@ -5051,6 +5052,7 @@
|
|
||||
<value>rename-restart</value> |
|
||||
<value>coredump-destroy</value> |
|
||||
<value>coredump-restart</value> |
|
||||
+ <value>preserve-running</value>
|
|
||||
</choice> |
|
||||
</define> |
|
||||
<!-- |
|
||||
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
|
|
||||
index d25b92b4de..3bb5c1e591 100644
|
|
||||
--- a/src/libxl/libxl_conf.c
|
|
||||
+++ b/src/libxl/libxl_conf.c
|
|
||||
@@ -111,6 +111,7 @@ libxlActionFromVirLifecycle(virDomainLifecycleAction action)
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: |
|
||||
return LIBXL_ACTION_ON_SHUTDOWN_COREDUMP_RESTART; |
|
||||
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
break; |
|
||||
} |
|
||||
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
|
|
||||
index c6717e31cf..51dc3edcc2 100644
|
|
||||
--- a/src/libxl/libxl_domain.c
|
|
||||
+++ b/src/libxl/libxl_domain.c
|
|
||||
@@ -509,6 +509,7 @@ libxlDomainShutdownThread(void *opaque)
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
goto endjob; |
|
||||
} |
|
||||
@@ -529,6 +530,7 @@ libxlDomainShutdownThread(void *opaque)
|
|
||||
goto endjob; |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
goto endjob; |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
libxlDomainAutoCoreDump(driver, vm); |
|
||||
@@ -557,6 +559,7 @@ libxlDomainShutdownThread(void *opaque)
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
goto endjob; |
|
||||
} |
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index c6ef5684b5..b90a7b07d4 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -3644,6 +3644,11 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
qemuDomainSaveStatus(vm); |
|
||||
break; |
|
||||
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
+ virDomainObjSetState(vm, VIR_DOMAIN_RUNNING, VIR_DOMAIN_RUNNING_CRASHED);
|
|
||||
+ qemuDomainSaveStatus(vm);
|
|
||||
+ break;
|
|
||||
+
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
break; |
|
||||
} |
|
||||
@@ -3661,6 +3666,8 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState)); |
|
||||
break; |
|
||||
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
+ /* we need to keep resources locked */
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
break; |
|
||||
} |
|
||||
@@ -3678,6 +3685,7 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
break; |
|
||||
} |
|
||||
@@ -3704,6 +3712,7 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
break; |
|
||||
} |
|
||||
@@ -19594,13 +19603,36 @@ qemuDomainModifyLifecycleActionLive(virDomainObj *vm,
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_CRASH:
|
|
||||
+ if (vm->def->onCrash == action)
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ switch (vm->def->onCrash) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
+ panic = QEMU_MONITOR_ACTION_PANIC_NONE;
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
+ panic = QEMU_MONITOR_ACTION_PANIC_PAUSE;
|
|
||||
+ break;
|
|
||||
+
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
break; |
|
||||
} |
|
||||
break; |
|
||||
|
|
||||
case VIR_DOMAIN_LIFECYCLE_POWEROFF: |
|
||||
- case VIR_DOMAIN_LIFECYCLE_CRASH:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_LAST: |
|
||||
break; |
|
||||
} |
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
||||
index 8389819ee4..b2506edce0 100644
|
|
||||
--- a/src/qemu/qemu_process.c
|
|
||||
+++ b/src/qemu/qemu_process.c
|
|
||||
@@ -8186,6 +8186,24 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm,
|
|
||||
if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY) |
|
||||
reboot = QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN; |
|
||||
|
|
||||
+ switch (vm->def->onCrash) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE_RUNNING:
|
|
||||
+ panic = QEMU_MONITOR_ACTION_PANIC_NONE;
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
+ panic = QEMU_MONITOR_ACTION_PANIC_PAUSE;
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+
|
|
||||
if (shutdown == QEMU_MONITOR_ACTION_SHUTDOWN_KEEP && |
|
||||
reboot == QEMU_MONITOR_ACTION_REBOOT_KEEP && |
|
||||
watchdog == QEMU_MONITOR_ACTION_WATCHDOG_KEEP && |
|
||||
diff --git a/tests/qemuxmlconfdata/async-teardown.x86_64-latest.xml b/tests/qemuxmlconfdata/async-teardown.x86_64-latest.xml
|
|
||||
index e98308a9b1..1c7c80ae8a 100644
|
|
||||
--- a/tests/qemuxmlconfdata/async-teardown.x86_64-latest.xml
|
|
||||
+++ b/tests/qemuxmlconfdata/async-teardown.x86_64-latest.xml
|
|
||||
@@ -17,7 +17,7 @@
|
|
||||
<clock offset='utc'/> |
|
||||
<on_poweroff>destroy</on_poweroff> |
|
||||
<on_reboot>restart</on_reboot> |
|
||||
- <on_crash>destroy</on_crash>
|
|
||||
+ <on_crash>preserve-running</on_crash>
|
|
||||
<devices> |
|
||||
<emulator>/usr/bin/qemu-system-x86_64</emulator> |
|
||||
<disk type='block' device='disk'> |
|
||||
diff --git a/tests/qemuxmlconfdata/async-teardown.xml b/tests/qemuxmlconfdata/async-teardown.xml
|
|
||||
index 70c1eccc55..149b9ed16d 100644
|
|
||||
--- a/tests/qemuxmlconfdata/async-teardown.xml
|
|
||||
+++ b/tests/qemuxmlconfdata/async-teardown.xml
|
|
||||
@@ -11,7 +11,7 @@
|
|
||||
<clock offset='utc'/> |
|
||||
<on_poweroff>destroy</on_poweroff> |
|
||||
<on_reboot>restart</on_reboot> |
|
||||
- <on_crash>destroy</on_crash>
|
|
||||
+ <on_crash>preserve-running</on_crash>
|
|
||||
<features> |
|
||||
<async-teardown enabled='yes'/> |
|
||||
</features> |
|
||||
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
|
|
||||
index 99925e6241..7ab25f4cf7 100644
|
|
||||
--- a/tests/qemuxmlconftest.c
|
|
||||
+++ b/tests/qemuxmlconftest.c
|
|
||||
@@ -3191,6 +3191,7 @@ mymain(void)
|
|
||||
|
|
||||
DO_TEST_CAPS_LATEST("crypto-builtin"); |
|
||||
|
|
||||
+ /* this test case also tests 'preserve-running' onCrash action */
|
|
||||
DO_TEST_CAPS_LATEST("async-teardown"); |
|
||||
DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown", "s390x"); |
|
||||
DO_TEST_CAPS_ARCH_LATEST("s390-async-teardown-no-attrib", "s390x"); |
|
||||
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
|
|
||||
index aa4f2a7a48..0f177fb69a 100644
|
|
||||
--- a/tools/virsh-domain.c
|
|
||||
+++ b/tools/virsh-domain.c
|
|
||||
@@ -6242,7 +6242,8 @@ VIR_ENUM_IMPL(virshDomainLifecycleAction,
|
|
||||
"rename-restart", |
|
||||
"preserve", |
|
||||
"coredump-destroy", |
|
||||
- "coredump-restart");
|
|
||||
+ "coredump-restart",
|
|
||||
+ "none");
|
|
||||
|
|
||||
static bool |
|
||||
cmdSetLifecycleAction(vshControl *ctl, const vshCmd *cmd) |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,33 +0,0 @@ |
|||||
From 1191669a769e280a77107804c6cdbab08e972a1e Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <1191669a769e280a77107804c6cdbab08e972a1e.1786713643.git.jdenemar@redhat.com> |
|
||||
From: Nathan Chen <nathanc@nvidia.com> |
|
||||
Date: Wed, 5 Aug 2026 15:12:55 -0700 |
|
||||
Subject: [PATCH] conf: Include check for pci_bus in virDomainIOMMUDefEquals() |
|
||||
|
|
||||
virDomainIOMMUDefEquals() should check for pci_bus being equal |
|
||||
across two virDomainIOMMUDef being compared. |
|
||||
|
|
||||
Fixes: 4d6419b286af ("qemu: Implement pluggable-device smmuv3") |
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> |
|
||||
Signed-off-by: Nathan Chen <nathanc@nvidia.com> |
|
||||
(cherry picked from commit b2bfc6b4c8b7243840750e1e95514a8646482cd4) |
|
||||
|
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-138901 |
|
||||
---
|
|
||||
src/conf/domain_conf.c | 1 + |
|
||||
1 file changed, 1 insertion(+) |
|
||||
|
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
||||
index 17c4a57cd8..94cfb27c1d 100644
|
|
||||
--- a/src/conf/domain_conf.c
|
|
||||
+++ b/src/conf/domain_conf.c
|
|
||||
@@ -16849,6 +16849,7 @@ virDomainIOMMUDefEquals(const virDomainIOMMUDef *a,
|
|
||||
a->iotlb != b->iotlb || |
|
||||
a->aw_bits != b->aw_bits || |
|
||||
a->dma_translation != b->dma_translation || |
|
||||
+ a->pci_bus != b->pci_bus ||
|
|
||||
a->xtsup != b->xtsup || |
|
||||
a->pt != b->pt || |
|
||||
a->granule != b->granule) |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,137 +0,0 @@ |
|||||
From c85c8ecd53bf4d67b14d7f022813ec7b2801181c Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <c85c8ecd53bf4d67b14d7f022813ec7b2801181c.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Tue, 21 Jul 2026 10:21:50 +0200 |
|
||||
Subject: [PATCH] conf: Use proper enum types for 'onReboot', 'onPoweroff', |
|
||||
'onCrash', and 'onLockFailure' |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
This ensures that 'switch' statements work correctly. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 997b9816dcaef7ed0d7fdbfe4f1b2354b1b82c58) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/conf/domain_conf.c | 10 ++++++---- |
|
||||
src/conf/domain_conf.h | 9 ++++----- |
|
||||
src/libxl/xen_common.c | 10 +++++++--- |
|
||||
src/qemu/qemu_driver.c | 2 ++ |
|
||||
4 files changed, 19 insertions(+), 12 deletions(-) |
|
||||
|
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
||||
index db44ba9a72..d43b8bdd5b 100644
|
|
||||
--- a/src/conf/domain_conf.c
|
|
||||
+++ b/src/conf/domain_conf.c
|
|
||||
@@ -14172,21 +14172,23 @@ static int
|
|
||||
virDomainEventActionParseXML(xmlXPathContextPtr ctxt, |
|
||||
const char *name, |
|
||||
const char *xpath, |
|
||||
- int *val,
|
|
||||
- int defaultVal,
|
|
||||
+ unsigned int *val,
|
|
||||
+ unsigned int defaultVal,
|
|
||||
virEventActionFromStringFunc convFunc) |
|
||||
{ |
|
||||
g_autofree char *tmp = virXPathString(xpath, ctxt); |
|
||||
+ int tmpval;
|
|
||||
|
|
||||
if (tmp == NULL) { |
|
||||
*val = defaultVal; |
|
||||
} else { |
|
||||
- *val = convFunc(tmp);
|
|
||||
- if (*val < 0) {
|
|
||||
+ tmpval = convFunc(tmp);
|
|
||||
+ if (tmpval < 0) {
|
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, |
|
||||
_("unknown %1$s action: %2$s"), name, tmp); |
|
||||
return -1; |
|
||||
} |
|
||||
+ *val = tmpval;
|
|
||||
} |
|
||||
return 0; |
|
||||
} |
|
||||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
|
||||
index 40ea6090f8..2c017738e3 100644
|
|
||||
--- a/src/conf/domain_conf.h
|
|
||||
+++ b/src/conf/domain_conf.h
|
|
||||
@@ -3255,12 +3255,11 @@ struct _virDomainDef {
|
|
||||
virDomainResourceDef *resource; |
|
||||
virDomainIdMapDef idmap; |
|
||||
|
|
||||
- /* These 3 are based on virDomainLifecycleAction enum flags */
|
|
||||
- int onReboot;
|
|
||||
- int onPoweroff;
|
|
||||
- int onCrash;
|
|
||||
+ virDomainLifecycleAction onReboot;
|
|
||||
+ virDomainLifecycleAction onPoweroff;
|
|
||||
+ virDomainLifecycleAction onCrash;
|
|
||||
|
|
||||
- int onLockFailure; /* enum virDomainLockFailureAction */
|
|
||||
+ virDomainLockFailureAction onLockFailure;
|
|
||||
|
|
||||
virDomainPowerManagement pm; |
|
||||
|
|
||||
diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c
|
|
||||
index e6a372e078..4b2e47006a 100644
|
|
||||
--- a/src/libxl/xen_common.c
|
|
||||
+++ b/src/libxl/xen_common.c
|
|
||||
@@ -336,33 +336,37 @@ xenParseEventsActions(virConf *conf, virDomainDef *def)
|
|
||||
g_autofree char *on_poweroff = NULL; |
|
||||
g_autofree char *on_reboot = NULL; |
|
||||
g_autofree char *on_crash = NULL; |
|
||||
+ int tmp;
|
|
||||
|
|
||||
if (xenConfigGetString(conf, "on_poweroff", &on_poweroff, "destroy") < 0) |
|
||||
return -1; |
|
||||
|
|
||||
- if ((def->onPoweroff = virDomainLifecycleActionTypeFromString(on_poweroff)) < 0) {
|
|
||||
+ if ((tmp = virDomainLifecycleActionTypeFromString(on_poweroff)) < 0) {
|
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, |
|
||||
_("unexpected value %1$s for on_poweroff"), on_poweroff); |
|
||||
return -1; |
|
||||
} |
|
||||
+ def->onPoweroff = tmp;
|
|
||||
|
|
||||
if (xenConfigGetString(conf, "on_reboot", &on_reboot, "restart") < 0) |
|
||||
return -1; |
|
||||
|
|
||||
- if ((def->onReboot = virDomainLifecycleActionTypeFromString(on_reboot)) < 0) {
|
|
||||
+ if ((tmp = virDomainLifecycleActionTypeFromString(on_reboot)) < 0) {
|
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, |
|
||||
_("unexpected value %1$s for on_reboot"), on_reboot); |
|
||||
return -1; |
|
||||
} |
|
||||
+ def->onReboot = tmp;
|
|
||||
|
|
||||
if (xenConfigGetString(conf, "on_crash", &on_crash, "restart") < 0) |
|
||||
return -1; |
|
||||
|
|
||||
- if ((def->onCrash = virDomainLifecycleActionTypeFromString(on_crash)) < 0) {
|
|
||||
+ if ((tmp = virDomainLifecycleActionTypeFromString(on_crash)) < 0) {
|
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, |
|
||||
_("unexpected value %1$s for on_crash"), on_crash); |
|
||||
return -1; |
|
||||
} |
|
||||
+ def->onCrash = tmp;
|
|
||||
|
|
||||
return 0; |
|
||||
} |
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index b7c1a28d5f..cb9f6fb7bf 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -3680,6 +3680,8 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
/* the VM is kept around for debugging */ |
|
||||
break; |
|
||||
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
default: |
|
||||
break; |
|
||||
} |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,38 +0,0 @@ |
|||||
From 9cf23fdd0cf7d5b39a1f51cfc61826b4da431db2 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <9cf23fdd0cf7d5b39a1f51cfc61826b4da431db2.1786713644.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 3 Aug 2026 14:53:25 +0200 |
|
||||
Subject: [PATCH] conf: schemas: Allow '.' in schema for CPU flag name |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Allow '.' so that CPU features such as: |
|
||||
|
|
||||
<feature name='sse4.1'/> |
|
||||
|
|
||||
pass schema validation. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 5225c1cb688170bb2748f2f23455da4a7cb8a1bf) |
|
||||
https://redhat.atlassian.net/browse/RHEL-222549 |
|
||||
---
|
|
||||
src/conf/schemas/cputypes.rng | 2 +- |
|
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
|
||||
|
|
||||
diff --git a/src/conf/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng
|
|
||||
index 8edf1d14e3..eef3807f1a 100644
|
|
||||
--- a/src/conf/schemas/cputypes.rng
|
|
||||
+++ b/src/conf/schemas/cputypes.rng
|
|
||||
@@ -406,7 +406,7 @@
|
|
||||
<element name="feature"> |
|
||||
<attribute name="name"> |
|
||||
<data type="string"> |
|
||||
- <param name="pattern">[a-zA-Z0-9\-_]+</param>
|
|
||||
+ <param name="pattern">[a-zA-Z0-9\-_.]+</param>
|
|
||||
</data> |
|
||||
</attribute> |
|
||||
<empty/> |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,69 +0,0 @@ |
|||||
From 59314b58539370ba53ed27d2efb1d62a78c56fee Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <59314b58539370ba53ed27d2efb1d62a78c56fee.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:58:55 +0200 |
|
||||
Subject: [PATCH] processGuestPanicEvent: Don't pass panic action via parameter |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
'processGuestPanicEvent' gets the full domain object; there's no point |
|
||||
passing it via 'struct qemuProcessEvent'. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 0f18f6813cbd53cab8ccdb00fab098b66b90c0fb) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_driver.c | 6 ++---- |
|
||||
src/qemu/qemu_process.c | 3 +-- |
|
||||
2 files changed, 3 insertions(+), 6 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index 269694fac5..b7c1a28d5f 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -3615,7 +3615,6 @@ qemuProcessGuestPanicEventInfo(virQEMUDriver *driver,
|
|
||||
static void |
|
||||
processGuestPanicEvent(virQEMUDriver *driver, |
|
||||
virDomainObj *vm, |
|
||||
- int action,
|
|
||||
qemuMonitorEventPanicInfo *info) |
|
||||
{ |
|
||||
qemuDomainObjPrivate *priv = vm->privateData; |
|
||||
@@ -3650,7 +3649,7 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
VIR_WARN("Unable to release lease on %s", vm->def->name); |
|
||||
VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState)); |
|
||||
|
|
||||
- switch (action) {
|
|
||||
+ switch (vm->def->onCrash) {
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
if (doCoreDumpToAutoDumpPath(driver, vm, flags) < 0) |
|
||||
goto endjob; |
|
||||
@@ -4208,8 +4207,7 @@ qemuProcessEventHandler(void *data,
|
|
||||
processWatchdogEvent(driver, vm, processEvent->action); |
|
||||
break; |
|
||||
case QEMU_PROCESS_EVENT_GUESTPANIC: |
|
||||
- processGuestPanicEvent(driver, vm, processEvent->action,
|
|
||||
- processEvent->data);
|
|
||||
+ processGuestPanicEvent(driver, vm, processEvent->data);
|
|
||||
break; |
|
||||
case QEMU_PROCESS_EVENT_DEVICE_DELETED: |
|
||||
processDeviceDeletedEvent(driver, vm, processEvent->data); |
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
||||
index 397082ef04..8389819ee4 100644
|
|
||||
--- a/src/qemu/qemu_process.c
|
|
||||
+++ b/src/qemu/qemu_process.c
|
|
||||
@@ -1359,8 +1359,7 @@ qemuProcessHandleGuestPanic(qemuMonitor *mon G_GNUC_UNUSED,
|
|
||||
{ |
|
||||
virObjectLock(vm); |
|
||||
|
|
||||
- qemuProcessEventSubmit(vm, QEMU_PROCESS_EVENT_GUESTPANIC,
|
|
||||
- vm->def->onCrash, 0, info);
|
|
||||
+ qemuProcessEventSubmit(vm, QEMU_PROCESS_EVENT_GUESTPANIC, 0, 0, info);
|
|
||||
|
|
||||
virObjectUnlock(vm); |
|
||||
} |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,371 +0,0 @@ |
|||||
From 311945c34f1188283be6c71b5c2ddd9e967977ff Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <311945c34f1188283be6c71b5c2ddd9e967977ff.1786713644.git.jdenemar@redhat.com> |
|
||||
From: Nathan Chen <nathanc@nvidia.com> |
|
||||
Date: Wed, 5 Aug 2026 15:13:00 -0700 |
|
||||
Subject: [PATCH] qemu: Add support for HW-accelerated nested SMMUv3 |
|
||||
|
|
||||
Add support for enabling HW-accelerated nested SMMUv3 via <accel> |
|
||||
attribute and its additional attributes for ATS, SSID, RIL, and OAS |
|
||||
configuration. |
|
||||
|
|
||||
Validate the domain iommu accel attribute in qemu_validate.c when |
|
||||
QEMU lacks this capability. Checking accel is sufficient because ats, |
|
||||
ril, ssidsize, and oas were introduced in the same QEMU release, and |
|
||||
it only makes sense to backport accel, ats, ril, ssidsize, and oas |
|
||||
all together. |
|
||||
|
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> |
|
||||
Signed-off-by: Nathan Chen <nathanc@nvidia.com> |
|
||||
(cherry picked from commit d4605d8279d73bf8d2b8031d49f453529738ef34) |
|
||||
|
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-138901 |
|
||||
---
|
|
||||
docs/formatdomain.rst | 38 +++++++++++++++ |
|
||||
src/conf/domain_conf.c | 79 +++++++++++++++++++++++++++++++ |
|
||||
src/conf/domain_conf.h | 5 ++ |
|
||||
src/conf/domain_validate.c | 27 ++++++++++- |
|
||||
src/conf/schemas/domaincommon.rng | 25 ++++++++++ |
|
||||
src/qemu/qemu_command.c | 15 ++++++ |
|
||||
src/qemu/qemu_validate.c | 12 +++++ |
|
||||
7 files changed, 200 insertions(+), 1 deletion(-) |
|
||||
|
|
||||
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
|
|
||||
index a861f9f177..1e8c81c3a5 100644
|
|
||||
--- a/docs/formatdomain.rst
|
|
||||
+++ b/docs/formatdomain.rst
|
|
||||
@@ -9426,6 +9426,44 @@ Examples:
|
|
||||
The ``pciBus`` attribute notes the index of the controller that an |
|
||||
IOMMU device is attached to. (QEMU/KVM and ``smmuv3`` model only) |
|
||||
|
|
||||
+ ``accel``
|
|
||||
+ The ``accel`` attribute with possible values ``on`` and ``off`` can
|
|
||||
+ be used to enable hardware acceleration support for smmuv3 IOMMU
|
|
||||
+ devices.
|
|
||||
+ :since:`Since 12.7.0` (QEMU/KVM and ``smmuv3`` model only)
|
|
||||
+
|
|
||||
+ ``ats``
|
|
||||
+ The ``ats`` attribute with possible values ``on`` and ``off`` can be
|
|
||||
+ used to enable reporting Address Translation Services capability to
|
|
||||
+ the guest for smmuv3 IOMMU devices with ``accel`` set to ``on``, if
|
|
||||
+ the host SMMUv3 supports ATS and the associated passthrough device
|
|
||||
+ supports ATS. If ``accel`` is enabled and ``ats`` is not configured,
|
|
||||
+ the hypervisor default value is used.
|
|
||||
+ :since:`Since 12.7.0` (QEMU/KVM and ``smmuv3`` model only)
|
|
||||
+
|
|
||||
+ ``ril``
|
|
||||
+ The ``ril`` attribute with possible values ``on`` and ``off`` can be
|
|
||||
+ used to report whether Range Invalidation for IOMMU devices with
|
|
||||
+ ``accel`` set to ``on`` is compatible with host SMMUv3 support. If
|
|
||||
+ ``accel`` is enabled and ``ril`` is not configured, the hypervisor
|
|
||||
+ default value is used.
|
|
||||
+ :since:`Since 12.7.0` (QEMU/KVM and ``smmuv3`` model only)
|
|
||||
+
|
|
||||
+ ``ssidsize``
|
|
||||
+ The ``ssidsize`` attribute sets the number of bits used to
|
|
||||
+ represent SubstreamIDs. A value of N allows SSIDs in the range
|
|
||||
+ [0 .. 2^N - 1]. The valid range is 0-20, and a value greater than 0
|
|
||||
+ is required for enabling PASID support, as doing so advertises PASID
|
|
||||
+ capability to the vIOMMU. If ``accel`` is enabled and ``ssidsize`` is
|
|
||||
+ not configured, the hypervisor default value is used.
|
|
||||
+ :since:`Since 12.7.0` (QEMU/KVM and ``smmuv3`` model only)
|
|
||||
+
|
|
||||
+ ``oas``
|
|
||||
+ The ``oas`` attribute sets the output address size in units of bits.
|
|
||||
+ If ``accel`` is enabled and ``oas`` is not configured, the hypervisor
|
|
||||
+ default value is used.
|
|
||||
+ :since:`Since 12.7.0` (QEMU/KVM and ``smmuv3`` model only)
|
|
||||
+
|
|
||||
In case of ``virtio`` IOMMU device, the ``driver`` element can optionally |
|
||||
contain ``granule`` subelement that allows to choose which granule will be |
|
||||
used by default. It is useful when running guests with different page size |
|
||||
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
|
|
||||
index 94cfb27c1d..db44ba9a72 100644
|
|
||||
--- a/src/conf/domain_conf.c
|
|
||||
+++ b/src/conf/domain_conf.c
|
|
||||
@@ -2863,6 +2863,10 @@ virDomainIOMMUDefNew(void)
|
|
||||
|
|
||||
iommu->pci_bus = -1; |
|
||||
|
|
||||
+ iommu->ssid_size = -1;
|
|
||||
+
|
|
||||
+ iommu->oas = -1;
|
|
||||
+
|
|
||||
return g_steal_pointer(&iommu); |
|
||||
} |
|
||||
|
|
||||
@@ -14746,6 +14750,26 @@ virDomainIOMMUDefParseXML(virDomainXMLOption *xmlopt,
|
|
||||
&iommu->pci_bus, -1) < 0) |
|
||||
return NULL; |
|
||||
|
|
||||
+ if (virXMLPropTristateSwitch(driver, "accel", VIR_XML_PROP_NONE,
|
|
||||
+ &iommu->accel) < 0)
|
|
||||
+ return NULL;
|
|
||||
+
|
|
||||
+ if (virXMLPropTristateSwitch(driver, "ats", VIR_XML_PROP_NONE,
|
|
||||
+ &iommu->ats) < 0)
|
|
||||
+ return NULL;
|
|
||||
+
|
|
||||
+ if (virXMLPropTristateSwitch(driver, "ril", VIR_XML_PROP_NONE,
|
|
||||
+ &iommu->ril) < 0)
|
|
||||
+ return NULL;
|
|
||||
+
|
|
||||
+ if (virXMLPropInt(driver, "ssidsize", 10, VIR_XML_PROP_NONE,
|
|
||||
+ &iommu->ssid_size, -1) < 0)
|
|
||||
+ return NULL;
|
|
||||
+
|
|
||||
+ if (virXMLPropInt(driver, "oas", 10, VIR_XML_PROP_NONE,
|
|
||||
+ &iommu->oas, -1) < 0)
|
|
||||
+ return NULL;
|
|
||||
+
|
|
||||
if ((granule = virXPathNode("./driver/granule", ctxt))) { |
|
||||
g_autofree char *mode = virXMLPropString(granule, "mode"); |
|
||||
unsigned long long size; |
|
||||
@@ -16850,6 +16874,11 @@ virDomainIOMMUDefEquals(const virDomainIOMMUDef *a,
|
|
||||
a->aw_bits != b->aw_bits || |
|
||||
a->dma_translation != b->dma_translation || |
|
||||
a->pci_bus != b->pci_bus || |
|
||||
+ a->accel != b->accel ||
|
|
||||
+ a->ats != b->ats ||
|
|
||||
+ a->ril != b->ril ||
|
|
||||
+ a->ssid_size != b->ssid_size ||
|
|
||||
+ a->oas != b->oas ||
|
|
||||
a->xtsup != b->xtsup || |
|
||||
a->pt != b->pt || |
|
||||
a->granule != b->granule) |
|
||||
@@ -22734,6 +22763,36 @@ virDomainIOMMUDefCheckABIStability(virDomainIOMMUDef *src,
|
|
||||
dst->pci_bus, src->pci_bus); |
|
||||
return false; |
|
||||
} |
|
||||
+ if (src->accel != dst->accel) {
|
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||
+ _("Target domain IOMMU device accel value '%1$d' does not match source '%2$d'"),
|
|
||||
+ dst->accel, src->accel);
|
|
||||
+ return false;
|
|
||||
+ }
|
|
||||
+ if (src->ats != dst->ats) {
|
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||
+ _("Target domain IOMMU device ATS value '%1$d' does not match source '%2$d'"),
|
|
||||
+ dst->ats, src->ats);
|
|
||||
+ return false;
|
|
||||
+ }
|
|
||||
+ if (src->ril != dst->ril) {
|
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||
+ _("Target domain IOMMU device ril value '%1$d' does not match source '%2$d'"),
|
|
||||
+ dst->ril, src->ril);
|
|
||||
+ return false;
|
|
||||
+ }
|
|
||||
+ if (src->ssid_size != dst->ssid_size) {
|
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||
+ _("Target domain IOMMU device ssid_size value '%1$d' does not match source '%2$d'"),
|
|
||||
+ dst->ssid_size, src->ssid_size);
|
|
||||
+ return false;
|
|
||||
+ }
|
|
||||
+ if (src->oas != dst->oas) {
|
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||
+ _("Target domain IOMMU device oas value '%1$d' does not match source '%2$d'"),
|
|
||||
+ dst->oas, src->oas);
|
|
||||
+ return false;
|
|
||||
+ }
|
|
||||
if (src->dma_translation != dst->dma_translation) { |
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, |
|
||||
_("Target domain IOMMU device dma translation '%1$s' does not match source '%2$s'"), |
|
||||
@@ -29204,6 +29263,26 @@ virDomainIOMMUDefFormat(virBuffer *buf,
|
|
||||
virBufferAsprintf(&driverAttrBuf, " pciBus='%d'", |
|
||||
iommu->pci_bus); |
|
||||
} |
|
||||
+ if (iommu->accel != VIR_TRISTATE_SWITCH_ABSENT) {
|
|
||||
+ virBufferAsprintf(&driverAttrBuf, " accel='%s'",
|
|
||||
+ virTristateSwitchTypeToString(iommu->accel));
|
|
||||
+ }
|
|
||||
+ if (iommu->ats != VIR_TRISTATE_SWITCH_ABSENT) {
|
|
||||
+ virBufferAsprintf(&driverAttrBuf, " ats='%s'",
|
|
||||
+ virTristateSwitchTypeToString(iommu->ats));
|
|
||||
+ }
|
|
||||
+ if (iommu->ril != VIR_TRISTATE_SWITCH_ABSENT) {
|
|
||||
+ virBufferAsprintf(&driverAttrBuf, " ril='%s'",
|
|
||||
+ virTristateSwitchTypeToString(iommu->ril));
|
|
||||
+ }
|
|
||||
+ if (iommu->ssid_size >= 0) {
|
|
||||
+ virBufferAsprintf(&driverAttrBuf, " ssidsize='%d'",
|
|
||||
+ iommu->ssid_size);
|
|
||||
+ }
|
|
||||
+ if (iommu->oas >= 0) {
|
|
||||
+ virBufferAsprintf(&driverAttrBuf, " oas='%d'",
|
|
||||
+ iommu->oas);
|
|
||||
+ }
|
|
||||
if (iommu->granule != 0) { |
|
||||
if (iommu->granule == -1) { |
|
||||
virBufferAddLit(&driverChildBuf, "<granule mode='host'/>\n"); |
|
||||
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
|
|
||||
index 0c6c79c413..40ea6090f8 100644
|
|
||||
--- a/src/conf/domain_conf.h
|
|
||||
+++ b/src/conf/domain_conf.h
|
|
||||
@@ -3105,6 +3105,11 @@ struct _virDomainIOMMUDef {
|
|
||||
virTristateSwitch xtsup; |
|
||||
virTristateSwitch pt; |
|
||||
int granule; /* -1 means 'host', 0 unset, page size in KiB otherwise */ |
|
||||
+ virTristateSwitch accel;
|
|
||||
+ virTristateSwitch ats;
|
|
||||
+ virTristateSwitch ril;
|
|
||||
+ int ssid_size;
|
|
||||
+ int oas;
|
|
||||
}; |
|
||||
|
|
||||
typedef enum { |
|
||||
diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c
|
|
||||
index 3946f92182..710a891904 100644
|
|
||||
--- a/src/conf/domain_validate.c
|
|
||||
+++ b/src/conf/domain_validate.c
|
|
||||
@@ -3203,6 +3203,16 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
|
|
||||
virDomainIOMMUModelTypeToString(iommu->model)); |
|
||||
return -1; |
|
||||
} |
|
||||
+ if (iommu->accel != VIR_TRISTATE_SWITCH_ON &&
|
|
||||
+ (iommu->ats != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ril != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ssid_size >= 0 ||
|
|
||||
+ iommu->oas >= 0)) {
|
|
||||
+ virReportError(VIR_ERR_XML_ERROR,
|
|
||||
+ _("accel must be enabled for iommu model '%1$s' when setting ats, ril, ssidsize, or oas"),
|
|
||||
+ virDomainIOMMUModelTypeToString(iommu->model));
|
|
||||
+ return -1;
|
|
||||
+ }
|
|
||||
break; |
|
||||
case VIR_DOMAIN_IOMMU_MODEL_VIRTIO: |
|
||||
if (iommu->intremap != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
@@ -3210,7 +3220,12 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
|
|
||||
iommu->eim != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
iommu->iotlb != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
iommu->dma_translation != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
- iommu->pci_bus >= 0) {
|
|
||||
+ iommu->pci_bus >= 0 ||
|
|
||||
+ iommu->accel != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ats != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ril != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ssid_size >= 0 ||
|
|
||||
+ iommu->oas >= 0) {
|
|
||||
virReportError(VIR_ERR_XML_ERROR, |
|
||||
_("iommu model '%1$s' doesn't support some additional attributes"), |
|
||||
virDomainIOMMUModelTypeToString(iommu->model)); |
|
||||
@@ -3233,6 +3248,11 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
|
|
||||
iommu->aw_bits != 0 || |
|
||||
iommu->dma_translation != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
iommu->pci_bus >= 0 || |
|
||||
+ iommu->accel != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ats != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ril != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ssid_size >= 0 ||
|
|
||||
+ iommu->oas >= 0 ||
|
|
||||
iommu->granule != 0) { |
|
||||
virReportError(VIR_ERR_XML_ERROR, |
|
||||
_("iommu model '%1$s' doesn't support some additional attributes"), |
|
||||
@@ -3245,6 +3265,11 @@ virDomainIOMMUDefValidate(const virDomainIOMMUDef *iommu)
|
|
||||
if (iommu->pt != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
iommu->xtsup != VIR_TRISTATE_SWITCH_ABSENT || |
|
||||
iommu->pci_bus >= 0 || |
|
||||
+ iommu->accel != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ats != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ril != VIR_TRISTATE_SWITCH_ABSENT ||
|
|
||||
+ iommu->ssid_size >= 0 ||
|
|
||||
+ iommu->oas >= 0 ||
|
|
||||
iommu->granule != 0) { |
|
||||
virReportError(VIR_ERR_XML_ERROR, |
|
||||
_("iommu model '%1$s' doesn't support some additional attributes"), |
|
||||
diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng
|
|
||||
index 121e4e06a6..c7d7ebc876 100644
|
|
||||
--- a/src/conf/schemas/domaincommon.rng
|
|
||||
+++ b/src/conf/schemas/domaincommon.rng
|
|
||||
@@ -6454,6 +6454,31 @@
|
|
||||
<empty/> |
|
||||
</element> |
|
||||
</optional> |
|
||||
+ <optional>
|
|
||||
+ <attribute name="accel">
|
|
||||
+ <ref name="virOnOff"/>
|
|
||||
+ </attribute>
|
|
||||
+ </optional>
|
|
||||
+ <optional>
|
|
||||
+ <attribute name="ats">
|
|
||||
+ <ref name="virOnOff"/>
|
|
||||
+ </attribute>
|
|
||||
+ </optional>
|
|
||||
+ <optional>
|
|
||||
+ <attribute name="ril">
|
|
||||
+ <ref name="virOnOff"/>
|
|
||||
+ </attribute>
|
|
||||
+ </optional>
|
|
||||
+ <optional>
|
|
||||
+ <attribute name="ssidsize">
|
|
||||
+ <data type="int"/>
|
|
||||
+ </attribute>
|
|
||||
+ </optional>
|
|
||||
+ <optional>
|
|
||||
+ <attribute name="oas">
|
|
||||
+ <data type="int"/>
|
|
||||
+ </attribute>
|
|
||||
+ </optional>
|
|
||||
</element> |
|
||||
</optional> |
|
||||
<optional> |
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
||||
index e726dc661c..2d5eaa1e80 100644
|
|
||||
--- a/src/qemu/qemu_command.c
|
|
||||
+++ b/src/qemu/qemu_command.c
|
|
||||
@@ -6276,6 +6276,8 @@ qemuBuildPCINestedSmmuv3DevProps(const virDomainDef *def,
|
|
||||
{ |
|
||||
g_autoptr(virJSONValue) props = NULL; |
|
||||
g_autofree char *bus = NULL; |
|
||||
+ g_autofree char *ssidsizeStr = NULL;
|
|
||||
+ g_autofree char *oasStr = NULL;
|
|
||||
virPCIDeviceAddress addr = { .bus = iommu->pci_bus }; |
|
||||
|
|
||||
bus = qemuBuildDeviceAddressPCIGetBus(def, &addr); |
|
||||
@@ -6286,10 +6288,23 @@ qemuBuildPCINestedSmmuv3DevProps(const virDomainDef *def,
|
|
||||
return NULL; |
|
||||
} |
|
||||
|
|
||||
+ if (iommu->ssid_size >= 0) {
|
|
||||
+ ssidsizeStr = g_strdup_printf("%u", iommu->ssid_size);
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (iommu->oas >= 0) {
|
|
||||
+ oasStr = g_strdup_printf("%u", iommu->oas);
|
|
||||
+ }
|
|
||||
+
|
|
||||
if (virJSONValueObjectAdd(&props, |
|
||||
"s:driver", "arm-smmuv3", |
|
||||
"s:primary-bus", bus, |
|
||||
"s:id", iommu->info.alias, |
|
||||
+ "T:accel", iommu->accel,
|
|
||||
+ "S:ats", qemuOnOffAuto(iommu->ats),
|
|
||||
+ "S:ril", qemuOnOffAuto(iommu->ril),
|
|
||||
+ "S:ssidsize", ssidsizeStr,
|
|
||||
+ "S:oas", oasStr,
|
|
||||
NULL) < 0) |
|
||||
return NULL; |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
|
|
||||
index 2da99329c5..1093eb8363 100644
|
|
||||
--- a/src/qemu/qemu_validate.c
|
|
||||
+++ b/src/qemu/qemu_validate.c
|
|
||||
@@ -5827,6 +5827,18 @@ qemuValidateDomainDeviceDefIOMMU(const virDomainIOMMUDef *iommu,
|
|
||||
return -1; |
|
||||
} |
|
||||
|
|
||||
+ /* While QEMU_CAPS_ARM_SMMUV3_ACCEL tracks the .accel attribute of
|
|
||||
+ * arm-smmuv3 it is also a good indicator of .ats, .ril, .ssidsize, and
|
|
||||
+ * .oas attributes as all of them were introduced in the same release,
|
|
||||
+ * and these features are meant to be backported all together. */
|
|
||||
+ if (iommu->model == VIR_DOMAIN_IOMMU_MODEL_SMMUV3 &&
|
|
||||
+ iommu->accel != VIR_TRISTATE_SWITCH_ABSENT &&
|
|
||||
+ !virQEMUCapsGet(qemuCaps, QEMU_CAPS_ARM_SMMUV3_ACCEL)) {
|
|
||||
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||
+ _("iommu: accel is not supported with this QEMU binary"));
|
|
||||
+ return -1;
|
|
||||
+ }
|
|
||||
+
|
|
||||
if (iommu->granule > 0) { |
|
||||
/* QEMU supports only 4KiB, 8KiB, 16KiB and 64KiB granule size */ |
|
||||
if (!(iommu->granule == 4 || |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,239 +0,0 @@ |
|||||
From e21a75730bd8cdd57b595222ff1af64d012431f8 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <e21a75730bd8cdd57b595222ff1af64d012431f8.1787144196.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:27:20 +0200 |
|
||||
Subject: [PATCH] qemu: Always assume support for 'QEMU_CAPS_SET_ACTION' |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
The 'set-action' QMP command was introduced in qemu-6.0 and can't be |
|
||||
disabled in any way. Oldest qemu we support is qemu-7.2 so all versions |
|
||||
now have it. |
|
||||
|
|
||||
Remove all conditional code which depends on the 'set-action' command. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 771f17c9072c6aacc7bc10e01afc14421512c913) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_command.c | 13 +++---------- |
|
||||
src/qemu/qemu_driver.c | 16 ---------------- |
|
||||
src/qemu/qemu_hotplug.c | 10 +--------- |
|
||||
src/qemu/qemu_process.c | 31 +------------------------------ |
|
||||
src/qemu/qemu_validate.c | 14 ++------------ |
|
||||
5 files changed, 7 insertions(+), 77 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
|
|
||||
index 2d5eaa1e80..346a7905c5 100644
|
|
||||
--- a/src/qemu/qemu_command.c
|
|
||||
+++ b/src/qemu/qemu_command.c
|
|
||||
@@ -6171,16 +6171,9 @@ qemuBuildPMCommandLine(virCommand *cmd,
|
|
||||
{ |
|
||||
virQEMUCaps *qemuCaps = priv->qemuCaps; |
|
||||
|
|
||||
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) {
|
|
||||
- /* with new qemu we always want '-no-shutdown' on startup and we set
|
|
||||
- * all the other behaviour later during startup */
|
|
||||
- virCommandAddArg(cmd, "-no-shutdown");
|
|
||||
- } else {
|
|
||||
- if (priv->allowReboot == VIR_TRISTATE_BOOL_NO)
|
|
||||
- virCommandAddArg(cmd, "-no-reboot");
|
|
||||
- else
|
|
||||
- virCommandAddArg(cmd, "-no-shutdown");
|
|
||||
- }
|
|
||||
+ /* with new qemu we always want '-no-shutdown' on startup and we set
|
|
||||
+ * all the other behaviour later during startup */
|
|
||||
+ virCommandAddArg(cmd, "-no-shutdown");
|
|
||||
|
|
||||
/* Use old syntax of -no-acpi only if qemu didn't report that it supports the |
|
||||
* new syntax */ |
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index 8ec9e1f9c4..b3b853b4c8 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -19551,9 +19551,6 @@ qemuDomainModifyLifecycleActionLive(virDomainObj *vm,
|
|
||||
qemuDomainObjPrivate *priv = vm->privateData; |
|
||||
int rc; |
|
||||
|
|
||||
- if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION))
|
|
||||
- return 0;
|
|
||||
-
|
|
||||
/* For now we only update 'reboot' action here as we want to keep the |
|
||||
* shutdown action as is (we're emulating the outcome anyways)) */ |
|
||||
if (type != VIR_DOMAIN_LIFECYCLE_REBOOT || |
|
||||
@@ -19603,7 +19600,6 @@ qemuDomainSetLifecycleAction(virDomainPtr dom,
|
|
||||
{ |
|
||||
virQEMUDriver *driver = dom->conn->privateData; |
|
||||
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver); |
|
||||
- qemuDomainObjPrivate *priv;
|
|
||||
virDomainObj *vm = NULL; |
|
||||
virDomainDef *def = NULL; |
|
||||
virDomainDef *persistentDef = NULL; |
|
||||
@@ -19620,8 +19616,6 @@ qemuDomainSetLifecycleAction(virDomainPtr dom,
|
|
||||
if (!(vm = qemuDomainObjFromDomain(dom))) |
|
||||
goto cleanup; |
|
||||
|
|
||||
- priv = vm->privateData;
|
|
||||
-
|
|
||||
if (virDomainSetLifecycleActionEnsureACL(dom->conn, vm->def) < 0) |
|
||||
goto cleanup; |
|
||||
|
|
||||
@@ -19636,16 +19630,6 @@ qemuDomainSetLifecycleAction(virDomainPtr dom,
|
|
||||
goto endjob; |
|
||||
|
|
||||
if (def) { |
|
||||
- if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) {
|
|
||||
- if (priv->allowReboot == VIR_TRISTATE_BOOL_NO ||
|
|
||||
- (type == VIR_DOMAIN_LIFECYCLE_REBOOT &&
|
|
||||
- def->onReboot != action)) {
|
|
||||
- virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
|
|
||||
- _("cannot update lifecycle action because QEMU was started with incompatible -no-reboot setting"));
|
|
||||
- goto endjob;
|
|
||||
- }
|
|
||||
- }
|
|
||||
-
|
|
||||
if (qemuDomainModifyLifecycleActionLive(vm, type, action) < 0) |
|
||||
goto endjob; |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
|
|
||||
index 5be567b510..8990a716fa 100644
|
|
||||
--- a/src/qemu/qemu_hotplug.c
|
|
||||
+++ b/src/qemu/qemu_hotplug.c
|
|
||||
@@ -3061,7 +3061,7 @@ qemuDomainAttachWatchdog(virDomainObj *vm,
|
|
||||
if (vm->def->nwatchdogs) { |
|
||||
/* Domain already has a watchdog and all must have the same action. */ |
|
||||
rv = 0; |
|
||||
- } else if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)) {
|
|
||||
+ } else {
|
|
||||
/* QEMU doesn't have a 'dump' action; we tell qemu to 'pause', then |
|
||||
libvirt listens for the watchdog event, and we perform the dump |
|
||||
ourselves. so convert 'dump' to 'pause' for the qemu cli */ |
|
||||
@@ -3103,14 +3103,6 @@ qemuDomainAttachWatchdog(virDomainObj *vm,
|
|
||||
QEMU_MONITOR_ACTION_REBOOT_KEEP, |
|
||||
watchdogaction, |
|
||||
QEMU_MONITOR_ACTION_PANIC_KEEP); |
|
||||
- } else {
|
|
||||
- virDomainWatchdogAction actualAction = watchdog->action;
|
|
||||
-
|
|
||||
- if (actualAction == VIR_DOMAIN_WATCHDOG_ACTION_DUMP)
|
|
||||
- actualAction = VIR_DOMAIN_WATCHDOG_ACTION_PAUSE;
|
|
||||
-
|
|
||||
- rv = qemuMonitorSetWatchdogAction(priv->mon,
|
|
||||
- virDomainWatchdogActionTypeToString(actualAction));
|
|
||||
} |
|
||||
|
|
||||
if (rv >= 0) |
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
||||
index 4c94ff3c91..646ddda7e9 100644
|
|
||||
--- a/src/qemu/qemu_process.c
|
|
||||
+++ b/src/qemu/qemu_process.c
|
|
||||
@@ -6898,24 +6898,6 @@ qemuProcessRebootAllowed(const virDomainDef *def)
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-static void
|
|
||||
-qemuProcessPrepareAllowReboot(virDomainObj *vm)
|
|
||||
-{
|
|
||||
- virDomainDef *def = vm->def;
|
|
||||
- qemuDomainObjPrivate *priv = vm->privateData;
|
|
||||
-
|
|
||||
- /* with 'set-action' QMP command we don't need to keep this around as
|
|
||||
- * we always update qemu with the proper state */
|
|
||||
- if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION))
|
|
||||
- return;
|
|
||||
-
|
|
||||
- if (priv->allowReboot != VIR_TRISTATE_BOOL_ABSENT)
|
|
||||
- return;
|
|
||||
-
|
|
||||
- priv->allowReboot = virTristateBoolFromBool(qemuProcessRebootAllowed(def));
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
static int |
|
||||
qemuProcessUpdateSEVInfo(virDomainObj *vm) |
|
||||
{ |
|
||||
@@ -7087,8 +7069,6 @@ qemuProcessPrepareDomain(virQEMUDriver *driver,
|
|
||||
/* Track if this domain remembers original owner */ |
|
||||
priv->rememberOwner = cfg->rememberOwner; |
|
||||
|
|
||||
- qemuProcessPrepareAllowReboot(vm);
|
|
||||
-
|
|
||||
/* |
|
||||
* Normally PCI addresses are assigned in the virDomainCreate |
|
||||
* or virDomainDefine methods. We might still need to assign |
|
||||
@@ -8216,9 +8196,6 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm,
|
|
||||
qemuDomainObjPrivate *priv = vm->privateData; |
|
||||
int rc; |
|
||||
|
|
||||
- if (!(virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)))
|
|
||||
- return 0;
|
|
||||
-
|
|
||||
/* for now we handle only onReboot->destroy here as an alternative to |
|
||||
* '-no-reboot' on the commandline */ |
|
||||
if (vm->def->onReboot != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY) |
|
||||
@@ -9909,10 +9886,6 @@ qemuProcessReconnect(void *opaque)
|
|
||||
if (qemuExtDevicesInitPaths(cfg, obj->def) < 0) |
|
||||
goto error; |
|
||||
|
|
||||
- /* If we are connecting to a guest started by old libvirt there is no
|
|
||||
- * allowReboot in status XML and we need to initialize it. */
|
|
||||
- qemuProcessPrepareAllowReboot(obj);
|
|
||||
-
|
|
||||
if (qemuHostdevUpdateActiveDomainDevices(driver, obj->def) < 0) |
|
||||
goto error; |
|
||||
|
|
||||
@@ -10147,9 +10120,7 @@ qemuProcessReconnect(void *opaque)
|
|
||||
* domain crashed; otherwise, if the monitor was started, |
|
||||
* then we can blame ourselves, else we failed before the |
|
||||
* monitor started so we don't really know. */ |
|
||||
- if (!priv->mon && tryMonReconn &&
|
|
||||
- (priv->allowReboot == VIR_TRISTATE_BOOL_YES ||
|
|
||||
- virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_SET_ACTION)))
|
|
||||
+ if (!priv->mon && tryMonReconn)
|
|
||||
state = VIR_DOMAIN_SHUTOFF_CRASHED; |
|
||||
else if (priv->mon) |
|
||||
state = VIR_DOMAIN_SHUTOFF_DAEMON; |
|
||||
diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c
|
|
||||
index 1093eb8363..61f3bd3278 100644
|
|
||||
--- a/src/qemu/qemu_validate.c
|
|
||||
+++ b/src/qemu/qemu_validate.c
|
|
||||
@@ -3658,10 +3658,7 @@ qemuValidateDomainDeviceDefDiskBlkdeviotune(const virDomainDiskDef *disk,
|
|
||||
|
|
||||
|
|
||||
static int |
|
||||
-qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk,
|
|
||||
- const virDomainDef *def,
|
|
||||
- virQEMUCaps *qemuCaps)
|
|
||||
-
|
|
||||
+qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk)
|
|
||||
{ |
|
||||
virStorageType actualType = virStorageSourceGetActualType(disk->src); |
|
||||
|
|
||||
@@ -3695,13 +3692,6 @@ qemuValidateDomainDeviceDefDiskTransient(const virDomainDiskDef *disk,
|
|
||||
} |
|
||||
|
|
||||
if (disk->transientShareBacking == VIR_TRISTATE_BOOL_YES) { |
|
||||
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SET_ACTION) &&
|
|
||||
- !qemuProcessRebootAllowed(def)) {
|
|
||||
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
|
||||
- _("transient disk backing image sharing with destroy action of lifecycle isn't supported by this QEMU binary"));
|
|
||||
- return -1;
|
|
||||
- }
|
|
||||
-
|
|
||||
/* sharing the backing file requires hotplug of the disk in the qemu driver */ |
|
||||
switch (disk->bus) { |
|
||||
case VIR_DOMAIN_DISK_BUS_USB: |
|
||||
@@ -3747,7 +3737,7 @@ qemuValidateDomainDeviceDefDisk(const virDomainDiskDef *disk,
|
|
||||
if (qemuValidateDomainDeviceDefDiskBlkdeviotune(disk, def) < 0) |
|
||||
return -1; |
|
||||
|
|
||||
- if (qemuValidateDomainDeviceDefDiskTransient(disk, def, qemuCaps) < 0)
|
|
||||
+ if (qemuValidateDomainDeviceDefDiskTransient(disk) < 0)
|
|
||||
return -1; |
|
||||
|
|
||||
if (disk->src->shared && !disk->src->readonly && |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,50 +0,0 @@ |
|||||
From 5c17de983248cecad3d35c5afae30c6ce4ddc6d2 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <5c17de983248cecad3d35c5afae30c6ce4ddc6d2.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Tue, 18 Aug 2026 10:09:06 +0200 |
|
||||
Subject: [PATCH] qemu: Fix proper ordering of 'virtlockd' shutdown |
|
||||
|
|
||||
In commit aa1bf13b9caa4ef893cd4fdbaa111d5da73aa120 I attempted to fix |
|
||||
the ordering of virtlockd and virtlogd during shutdown but I made a typo |
|
||||
in the name of 'virtlockd.service' (missing 'd'). |
|
||||
|
|
||||
Fixes: aa1bf13b9caa4ef893cd4fdbaa111d5da73aa120 |
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> |
|
||||
Reviewed-by: Martin Kletzander <mkletzan@redhat.com> |
|
||||
(cherry picked from commit 82b39d0580ecb6aa4a6c88eabb85cc6d6bafd559) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-185108 |
|
||||
---
|
|
||||
src/qemu/virtqemud.service.extra.in | 2 +- |
|
||||
src/remote/libvirtd.service.in | 2 +- |
|
||||
2 files changed, 2 insertions(+), 2 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/virtqemud.service.extra.in b/src/qemu/virtqemud.service.extra.in
|
|
||||
index 3cc2edcfd0..df36890704 100644
|
|
||||
--- a/src/qemu/virtqemud.service.extra.in
|
|
||||
+++ b/src/qemu/virtqemud.service.extra.in
|
|
||||
@@ -9,7 +9,7 @@ After=virtlockd.socket
|
|
||||
# To ensure that our helper daemons are not shut down before the main daemon |
|
||||
# shuts down we need also explicit ordering with the .service unit |
|
||||
After=virtlogd.service |
|
||||
-After=virtlock.service
|
|
||||
+After=virtlockd.service
|
|
||||
Wants=systemd-machined.service |
|
||||
After=systemd-machined.service |
|
||||
After=remote-fs.target |
|
||||
diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
|
|
||||
index f26494d646..ccdb8379f3 100644
|
|
||||
--- a/src/remote/libvirtd.service.in
|
|
||||
+++ b/src/remote/libvirtd.service.in
|
|
||||
@@ -18,7 +18,7 @@ After=virtlockd.socket
|
|
||||
# To ensure that our helper daemons are not shut down before the main daemon |
|
||||
# shuts down we need also explicit ordering with the .service unit |
|
||||
After=virtlogd.service |
|
||||
-After=virtlock.service
|
|
||||
+After=virtlockd.service
|
|
||||
Wants=systemd-machined.service |
|
||||
After=network.target |
|
||||
After=dbus.service |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,155 +0,0 @@ |
|||||
From ecf217dd9ca44b05970ca04085c156d46fa9e513 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <ecf217dd9ca44b05970ca04085c156d46fa9e513.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Date: Wed, 12 Aug 2026 13:44:48 +0200 |
|
||||
Subject: [PATCH] qemu: Implement device info for virDomainGetGuestInfo() API |
|
||||
|
|
||||
Use freshly introduced qemuAgentGetGuestDeviceInfo() to implement |
|
||||
support of VIR_DOMAIN_GUEST_INFO_DEVICES type of |
|
||||
virDomainGetGuestInfo() API in the QEMU driver. |
|
||||
|
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-235731 |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
(cherry picked from commit 21a3c6f27cd60e8c00d4c0f6825f9b96e13a7a34) |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
---
|
|
||||
src/hypervisor/qemu_agent.c | 36 ++++++++++++++++++++++++++++++++++++ |
|
||||
src/hypervisor/qemu_agent.h | 5 +++++ |
|
||||
src/libvirt_private.syms | 1 + |
|
||||
src/qemu/qemu_driver.c | 23 ++++++++++++++++++++++- |
|
||||
4 files changed, 64 insertions(+), 1 deletion(-) |
|
||||
|
|
||||
diff --git a/src/hypervisor/qemu_agent.c b/src/hypervisor/qemu_agent.c
|
|
||||
index fbfaafc1bb..f5f50e3c92 100644
|
|
||||
--- a/src/hypervisor/qemu_agent.c
|
|
||||
+++ b/src/hypervisor/qemu_agent.c
|
|
||||
@@ -2962,3 +2962,39 @@ qemuAgentGetGuestDeviceInfo(qemuAgent *agent,
|
|
||||
g_clear_pointer(info, g_free); |
|
||||
return -1; |
|
||||
} |
|
||||
+
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentGuestDeviceInfoFormatParams(qemuAgentGuestDeviceInfo **devices,
|
|
||||
+ size_t ndevices,
|
|
||||
+ virTypedParamList *list)
|
|
||||
+{
|
|
||||
+ size_t i;
|
|
||||
+
|
|
||||
+ virTypedParamListAddUInt(list, ndevices, VIR_DOMAIN_GUEST_INFO_DEVICE_COUNT);
|
|
||||
+
|
|
||||
+ for (i = 0; i < ndevices; i++) {
|
|
||||
+ virTypedParamListAddString(list, devices[i]->driverName,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_NAME, i);
|
|
||||
+
|
|
||||
+ if (devices[i]->driverDate != -1) {
|
|
||||
+ /* Guest agent reports this in nanoseconds, our API in seconds. */
|
|
||||
+ virTypedParamListAddLLong(list, devices[i]->driverDate / 1000000000,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_DATE, i);
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (devices[i]->driverVersion) {
|
|
||||
+ virTypedParamListAddString(list, devices[i]->driverVersion,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_DRIVER_VERSION, i);
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (devices[i]->pci) {
|
|
||||
+ virTypedParamListAddString(list, "pci",
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_ID_TYPE, i);
|
|
||||
+ virTypedParamListAddUInt(list, devices[i]->pci->vendorID,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_VENDOR, i);
|
|
||||
+ virTypedParamListAddUInt(list, devices[i]->pci->deviceID,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICE_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DEVICE_SUFFIX_PCI_DEVICE, i);
|
|
||||
+ }
|
|
||||
+ }
|
|
||||
+}
|
|
||||
diff --git a/src/hypervisor/qemu_agent.h b/src/hypervisor/qemu_agent.h
|
|
||||
index def4194ab7..ea69524950 100644
|
|
||||
--- a/src/hypervisor/qemu_agent.h
|
|
||||
+++ b/src/hypervisor/qemu_agent.h
|
|
||||
@@ -239,3 +239,8 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuAgentGuestDeviceInfo, qemuAgentGuestDeviceInfo
|
|
||||
int qemuAgentGetGuestDeviceInfo(qemuAgent *agent, |
|
||||
qemuAgentGuestDeviceInfo ***info, |
|
||||
bool report_unsupported); |
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentGuestDeviceInfoFormatParams(qemuAgentGuestDeviceInfo **devices,
|
|
||||
+ size_t ndevices,
|
|
||||
+ virTypedParamList *list);
|
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
|
||||
index 0bd8c6f781..6c6cc7b4ff 100644
|
|
||||
--- a/src/libvirt_private.syms
|
|
||||
+++ b/src/libvirt_private.syms
|
|
||||
@@ -1735,6 +1735,7 @@ qemuAgentGetTime;
|
|
||||
qemuAgentGetTimezone; |
|
||||
qemuAgentGetUsers; |
|
||||
qemuAgentGetVCPUs; |
|
||||
+qemuAgentGuestDeviceInfoFormatParams;
|
|
||||
qemuAgentGuestDeviceInfoFree; |
|
||||
qemuAgentInterfaceFormatParams; |
|
||||
qemuAgentNotifyClose; |
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index c7892161e3..596c5dda67 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -19990,7 +19990,8 @@ static const unsigned int qemuDomainGetGuestInfoSupportedTypes =
|
|
||||
VIR_DOMAIN_GUEST_INFO_FILESYSTEM | |
|
||||
VIR_DOMAIN_GUEST_INFO_DISKS | |
|
||||
VIR_DOMAIN_GUEST_INFO_INTERFACES | |
|
||||
- VIR_DOMAIN_GUEST_INFO_LOAD;
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_LOAD |
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DEVICES;
|
|
||||
|
|
||||
static int |
|
||||
qemuDomainGetGuestInfoCheckSupport(unsigned int types, |
|
||||
@@ -20038,6 +20039,8 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
|
|
||||
double load5m = 0; |
|
||||
double load15m = 0; |
|
||||
bool format_load = false; |
|
||||
+ qemuAgentGuestDeviceInfo **devices = NULL;
|
|
||||
+ size_t ndevices = 0;
|
|
||||
size_t i; |
|
||||
g_autoptr(virTypedParamList) list = virTypedParamListNew(); |
|
||||
|
|
||||
@@ -20117,6 +20120,14 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
|
|
||||
format_load = true; |
|
||||
} |
|
||||
|
|
||||
+ if (supportedTypes & VIR_DOMAIN_GUEST_INFO_DEVICES) {
|
|
||||
+ rc = qemuAgentGetGuestDeviceInfo(agent, &devices, report_unsupported);
|
|
||||
+ if (rc == -1)
|
|
||||
+ goto exitagent;
|
|
||||
+ if (rc >= 0)
|
|
||||
+ ndevices = rc;
|
|
||||
+ }
|
|
||||
+
|
|
||||
qemuDomainObjExitAgent(vm, agent); |
|
||||
virDomainObjEndAgentJob(vm); |
|
||||
|
|
||||
@@ -20149,6 +20160,10 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
|
|
||||
virTypedParamListAddDouble(list, load15m, VIR_DOMAIN_GUEST_INFO_LOAD_15M); |
|
||||
} |
|
||||
|
|
||||
+ if (ndevices > 0) {
|
|
||||
+ qemuAgentGuestDeviceInfoFormatParams(devices, ndevices, list);
|
|
||||
+ }
|
|
||||
+
|
|
||||
if (virTypedParamListSteal(list, params, nparams) < 0) |
|
||||
goto cleanup; |
|
||||
|
|
||||
@@ -20166,6 +20181,12 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
|
|
||||
virDomainInterfaceFree(ifaces[i]); |
|
||||
} |
|
||||
g_free(ifaces); |
|
||||
+ if (devices && ndevices > 0) {
|
|
||||
+ for (i = 0; i < ndevices; i++) {
|
|
||||
+ qemuAgentGuestDeviceInfoFree(devices[i]);
|
|
||||
+ }
|
|
||||
+ g_free(devices);
|
|
||||
+ }
|
|
||||
|
|
||||
virDomainObjEndAPI(&vm); |
|
||||
return ret; |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,313 +0,0 @@ |
|||||
From 0b63c24aa265be78e55210ab5d985e24bdb13499 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <0b63c24aa265be78e55210ab5d985e24bdb13499.1787144196.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:35:07 +0200 |
|
||||
Subject: [PATCH] qemu: Remove 'allowReboot' field |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
The value is no longer used. Remove it including the status XML |
|
||||
handling. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 94bd5174d20fafafc2fa67fae101b78b46ec6196) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_domain.c | 33 ------------------- |
|
||||
src/qemu/qemu_domain.h | 17 ---------- |
|
||||
.../qemustatusxml2xmldata/backup-pull-in.xml | 1 - |
|
||||
.../blockjob-blockdev-in.xml | 1 - |
|
||||
.../blockjob-mirror-in.xml | 1 - |
|
||||
.../memory-backing-dir-in.xml | 1 - |
|
||||
.../migration-in-params-in.xml | 1 - |
|
||||
.../migration-out-nbd-bitmaps-in.xml | 1 - |
|
||||
.../migration-out-nbd-out.xml | 1 - |
|
||||
.../migration-out-nbd-tls-out.xml | 1 - |
|
||||
.../migration-out-params-in.xml | 1 - |
|
||||
tests/qemustatusxml2xmldata/modern-in.xml | 1 - |
|
||||
.../qcow2-data-file-in.xml | 1 - |
|
||||
.../throttlefilter-out.xml | 1 - |
|
||||
tests/qemustatusxml2xmldata/upgrade-out.xml | 1 - |
|
||||
.../qemustatusxml2xmldata/vcpus-multi-in.xml | 1 - |
|
||||
16 files changed, 64 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
|
|
||||
index e1b805d906..a4e5f92840 100644
|
|
||||
--- a/src/qemu/qemu_domain.c
|
|
||||
+++ b/src/qemu/qemu_domain.c
|
|
||||
@@ -1946,8 +1946,6 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivate *priv)
|
|
||||
|
|
||||
priv->rememberOwner = false; |
|
||||
|
|
||||
- priv->allowReboot = VIR_TRISTATE_BOOL_ABSENT;
|
|
||||
-
|
|
||||
g_clear_pointer(&priv->migrationCaps, virBitmapFree); |
|
||||
|
|
||||
virHashRemoveAll(priv->blockjobs); |
|
||||
@@ -2621,17 +2619,6 @@ qemuDomainObjPrivateXMLFormatBackups(virBuffer *buf,
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-void
|
|
||||
-qemuDomainObjPrivateXMLFormatAllowReboot(virBuffer *buf,
|
|
||||
- virTristateBool allowReboot)
|
|
||||
-{
|
|
||||
- if (allowReboot) {
|
|
||||
- virBufferAsprintf(buf, "<allowReboot value='%s'/>\n",
|
|
||||
- virTristateBoolTypeToString(allowReboot));
|
|
||||
- }
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
static void |
|
||||
qemuDomainObjPrivateXMLFormatPR(virBuffer *buf, |
|
||||
qemuDomainObjPrivate *priv) |
|
||||
@@ -2812,8 +2799,6 @@ qemuDomainObjPrivateXMLFormat(virBuffer *buf,
|
|
||||
if (priv->rememberOwner) |
|
||||
virBufferAddLit(buf, "<rememberOwner/>\n"); |
|
||||
|
|
||||
- qemuDomainObjPrivateXMLFormatAllowReboot(buf, priv->allowReboot);
|
|
||||
-
|
|
||||
qemuDomainObjPrivateXMLFormatPR(buf, priv); |
|
||||
|
|
||||
virBufferAsprintf(buf, "<nodename index='%llu'/>\n", priv->nodenameindex); |
|
||||
@@ -3302,21 +3287,6 @@ qemuDomainObjPrivateXMLParseBackups(qemuDomainObjPrivate *priv,
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-int
|
|
||||
-qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
|
|
||||
- virTristateBool *allowReboot)
|
|
||||
-{
|
|
||||
- xmlNodePtr node = virXPathNode("./allowReboot", ctxt);
|
|
||||
-
|
|
||||
- /* Allow value='default' as the input here, because old versions
|
|
||||
- * of libvirt produced that output and we need to be able to read
|
|
||||
- * it back to correctly handle running guests on daemon upgrade */
|
|
||||
- return virXMLPropTristateBoolAllowDefault(node, "value",
|
|
||||
- VIR_XML_PROP_NONE,
|
|
||||
- allowReboot);
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
static void |
|
||||
qemuDomainObjPrivateXMLParsePR(xmlXPathContextPtr ctxt, |
|
||||
bool *prDaemonRunning) |
|
||||
@@ -3548,9 +3518,6 @@ qemuDomainObjPrivateXMLParse(xmlXPathContextPtr ctxt,
|
|
||||
priv->chardevStdioLogd = virXPathBoolean("boolean(./chardevStdioLogd)", |
|
||||
ctxt) == 1; |
|
||||
|
|
||||
- if (qemuDomainObjPrivateXMLParseAllowReboot(ctxt, &priv->allowReboot) < 0)
|
|
||||
- return -1;
|
|
||||
-
|
|
||||
qemuDomainObjPrivateXMLParsePR(ctxt, &priv->prDaemonRunning); |
|
||||
|
|
||||
if (qemuDomainObjPrivateXMLParseBlockjobs(vm, priv, ctxt) < 0) |
|
||||
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
|
|
||||
index 50ab492023..23e99dc68c 100644
|
|
||||
--- a/src/qemu/qemu_domain.h
|
|
||||
+++ b/src/qemu/qemu_domain.h
|
|
||||
@@ -134,15 +134,6 @@ struct _qemuDomainObjPrivate {
|
|
||||
bool fakeReboot; |
|
||||
bool fakeReset; |
|
||||
bool pausedShutdown; |
|
||||
- /* allowReboot:
|
|
||||
- *
|
|
||||
- * Unused with new QEMU versions which have QEMU_CAPS_SET_ACTION.
|
|
||||
- *
|
|
||||
- * Otherwise if it's set to VIR_TRISTATE_BOOL_YES, QEMU was started with
|
|
||||
- * -no-shutdown, and if set to VIR_TRISTATE_BOOL_NO qemu was started with
|
|
||||
- * -no-reboot instead.
|
|
||||
- */
|
|
||||
- virTristateBool allowReboot;
|
|
||||
|
|
||||
unsigned long migMaxBandwidth; |
|
||||
char *origname; |
|
||||
@@ -1010,14 +1001,6 @@ qemuDomainFixupCPUs(virDomainObj *vm,
|
|
||||
char * |
|
||||
qemuDomainGetMachineName(virDomainObj *vm); |
|
||||
|
|
||||
-void
|
|
||||
-qemuDomainObjPrivateXMLFormatAllowReboot(virBuffer *buf,
|
|
||||
- virTristateBool allowReboot);
|
|
||||
-
|
|
||||
-int
|
|
||||
-qemuDomainObjPrivateXMLParseAllowReboot(xmlXPathContextPtr ctxt,
|
|
||||
- virTristateBool *allowReboot);
|
|
||||
-
|
|
||||
void |
|
||||
qemuDomainPrepareDiskSourceData(virDomainDiskDef *disk, |
|
||||
virStorageSource *src); |
|
||||
diff --git a/tests/qemustatusxml2xmldata/backup-pull-in.xml b/tests/qemustatusxml2xmldata/backup-pull-in.xml
|
|
||||
index 2cedcc3cf2..fcaff2e38a 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/backup-pull-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/backup-pull-in.xml
|
|
||||
@@ -233,7 +233,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-4-copy'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/4-copy'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='yes'> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
|
|
||||
index 1c45fad370..58afae4168 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml
|
|
||||
@@ -232,7 +232,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-4-copy'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/4-copy'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='yes'> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml b/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml
|
|
||||
index df11e83ced..be85202c02 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/blockjob-mirror-in.xml
|
|
||||
@@ -22,7 +22,6 @@
|
|
||||
<libDir path='/tmp'/> |
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1-QEMUGuest1'/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='yes'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml b/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml
|
|
||||
index eea671a41c..a1a1845495 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/memory-backing-dir-in.xml
|
|
||||
@@ -22,7 +22,6 @@
|
|
||||
<libDir path='/tmp'/> |
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target'/> |
|
||||
<memoryBackingDir path='/some/random/path/1-QEMUGuest1'/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/migration-in-params-in.xml b/tests/qemustatusxml2xmldata/migration-in-params-in.xml
|
|
||||
index 861d8eeadb..986e5455aa 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/migration-in-params-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/migration-in-params-in.xml
|
|
||||
@@ -256,7 +256,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-nest'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1-nest'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-bitmaps-in.xml b/tests/qemustatusxml2xmldata/migration-out-nbd-bitmaps-in.xml
|
|
||||
index 5d76545513..4f1fb07c1b 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/migration-out-nbd-bitmaps-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/migration-out-nbd-bitmaps-in.xml
|
|
||||
@@ -342,7 +342,6 @@
|
|
||||
</cpu> |
|
||||
<chardevStdioLogd/> |
|
||||
<rememberOwner/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='3'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='yes'> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
|
|
||||
index 581cf28286..a69d1c4590 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/migration-out-nbd-out.xml
|
|
||||
@@ -259,7 +259,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-4-upstream'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/4-upstream'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml b/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml
|
|
||||
index dacaa3e42f..86a7fbc187 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/migration-out-nbd-tls-out.xml
|
|
||||
@@ -288,7 +288,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-3-upstream'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/3-upstream'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/migration-out-params-in.xml b/tests/qemustatusxml2xmldata/migration-out-params-in.xml
|
|
||||
index b914236b62..f4e921ab38 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/migration-out-params-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/migration-out-params-in.xml
|
|
||||
@@ -270,7 +270,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-7-nest'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/7-nest'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/modern-in.xml b/tests/qemustatusxml2xmldata/modern-in.xml
|
|
||||
index 050669f554..422a04f3ca 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/modern-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/modern-in.xml
|
|
||||
@@ -260,7 +260,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-upstream'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1-upstream'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='123'/> |
|
||||
<fdset index='321'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/qcow2-data-file-in.xml b/tests/qemustatusxml2xmldata/qcow2-data-file-in.xml
|
|
||||
index 2675214417..951b4abfbe 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/qcow2-data-file-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/qcow2-data-file-in.xml
|
|
||||
@@ -22,7 +22,6 @@
|
|
||||
<libDir path='/tmp'/> |
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1-QEMUGuest1'/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/throttlefilter-out.xml b/tests/qemustatusxml2xmldata/throttlefilter-out.xml
|
|
||||
index 8751a42cce..eee01c79b1 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/throttlefilter-out.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/throttlefilter-out.xml
|
|
||||
@@ -233,7 +233,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-4-copy'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/4-copy'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/upgrade-out.xml b/tests/qemustatusxml2xmldata/upgrade-out.xml
|
|
||||
index c7bc7128df..fd1c174200 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/upgrade-out.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/upgrade-out.xml
|
|
||||
@@ -258,7 +258,6 @@
|
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target/domain-1-upstream'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1-upstream'/> |
|
||||
<chardevStdioLogd/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
diff --git a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml b/tests/qemustatusxml2xmldata/vcpus-multi-in.xml
|
|
||||
index 6ee688ce03..1d5b34c2b6 100644
|
|
||||
--- a/tests/qemustatusxml2xmldata/vcpus-multi-in.xml
|
|
||||
+++ b/tests/qemustatusxml2xmldata/vcpus-multi-in.xml
|
|
||||
@@ -308,7 +308,6 @@
|
|
||||
<libDir path='/tmp'/> |
|
||||
<channelTargetDir path='/var/lib/libvirt/qemu/channel/target'/> |
|
||||
<memoryBackingDir path='/var/lib/libvirt/qemu/ram/1729-QEMUGuest1'/> |
|
||||
- <allowReboot value='yes'/>
|
|
||||
<nodename index='0'/> |
|
||||
<fdset index='0'/> |
|
||||
<blockjobs active='no'/> |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,63 +0,0 @@ |
|||||
From 4f5111e3d80b98ce455074f89fea42c4e311bad0 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <4f5111e3d80b98ce455074f89fea42c4e311bad0.1787144196.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:29:50 +0200 |
|
||||
Subject: [PATCH] qemu: Remove unused 'qemuProcessRebootAllowed' |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 8effae01b918f91933a6bd3b5721cb243c50248a) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_process.c | 18 ------------------ |
|
||||
src/qemu/qemu_process.h | 2 -- |
|
||||
2 files changed, 20 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
||||
index 646ddda7e9..a1cdce6d17 100644
|
|
||||
--- a/src/qemu/qemu_process.c
|
|
||||
+++ b/src/qemu/qemu_process.c
|
|
||||
@@ -6880,24 +6880,6 @@ qemuProcessPrepareDomainHostdevs(virDomainObj *vm,
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-/**
|
|
||||
- * qemuProcessRebootAllowed:
|
|
||||
- * @def: domain definition
|
|
||||
- *
|
|
||||
- * This function encapsulates the logic which dictated whether '-no-reboot' was
|
|
||||
- * used instead of '-no-shutdown' which is used QEMU versions which don't
|
|
||||
- * support the 'set-action' QMP command.
|
|
||||
- */
|
|
||||
-bool
|
|
||||
-qemuProcessRebootAllowed(const virDomainDef *def)
|
|
||||
-{
|
|
||||
- return def->onReboot != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
|
||||
- def->onPoweroff != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY ||
|
|
||||
- (def->onCrash != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY &&
|
|
||||
- def->onCrash != VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY);
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
static int |
|
||||
qemuProcessUpdateSEVInfo(virDomainObj *vm) |
|
||||
{ |
|
||||
diff --git a/src/qemu/qemu_process.h b/src/qemu/qemu_process.h
|
|
||||
index 5874214596..2db5186e08 100644
|
|
||||
--- a/src/qemu/qemu_process.h
|
|
||||
+++ b/src/qemu/qemu_process.h
|
|
||||
@@ -258,8 +258,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuProcessQMP, qemuProcessQMPFree);
|
|
||||
|
|
||||
int qemuProcessQMPStart(qemuProcessQMP *proc); |
|
||||
|
|
||||
-bool qemuProcessRebootAllowed(const virDomainDef *def);
|
|
||||
-
|
|
||||
void qemuProcessCleanupMigrationJob(virQEMUDriver *driver, |
|
||||
virDomainObj *vm); |
|
||||
|
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,539 +0,0 @@ |
|||||
From 3eba80300859ed86f6f23cc2b60ef9426b57a0cf Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <3eba80300859ed86f6f23cc2b60ef9426b57a0cf.1787144196.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:43:26 +0200 |
|
||||
Subject: [PATCH] qemu: capabilities: Retire QEMU_CAPS_SET_ACTION |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
The capability is no longer used because all qemu versions we support do |
|
||||
have the 'set-action' command. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 01cb769a183e40a3f820ed9f949cf2d8b8cc3498) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_capabilities.c | 3 +-- |
|
||||
src/qemu/qemu_capabilities.h | 2 +- |
|
||||
tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.1.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.2.0_x86_64+mshv.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_11.0.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_11.0.0_x86_64+sgx.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_11.0.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml | 1 - |
|
||||
tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml | 1 - |
|
||||
39 files changed, 2 insertions(+), 40 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
|
||||
index c60ca02d97..f46c3b2759 100644
|
|
||||
--- a/src/qemu/qemu_capabilities.c
|
|
||||
+++ b/src/qemu/qemu_capabilities.c
|
|
||||
@@ -643,7 +643,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
|
||||
"confidential-guest-support", /* QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT */ |
|
||||
"query-display-options", /* X_QEMU_CAPS_QUERY_DISPLAY_OPTIONS */ |
|
||||
"s390-pv-guest", /* QEMU_CAPS_S390_PV_GUEST */ |
|
||||
- "set-action", /* QEMU_CAPS_SET_ACTION */
|
|
||||
+ "set-action", /* X_QEMU_CAPS_SET_ACTION */
|
|
||||
"virtio-blk.queue-size", /* QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE */ |
|
||||
|
|
||||
/* 410 */ |
|
||||
@@ -1291,7 +1291,6 @@ struct virQEMUCapsStringFlags virQEMUCapsCommands[] = {
|
|
||||
{ "query-cpu-definitions", QEMU_CAPS_QUERY_CPU_DEFINITIONS }, |
|
||||
{ "query-cpu-model-baseline", QEMU_CAPS_QUERY_CPU_MODEL_BASELINE }, |
|
||||
{ "query-cpu-model-comparison", QEMU_CAPS_QUERY_CPU_MODEL_COMPARISON }, |
|
||||
- { "set-action", QEMU_CAPS_SET_ACTION },
|
|
||||
{ "query-dirty-rate", QEMU_CAPS_QUERY_DIRTY_RATE }, |
|
||||
{ "sev-inject-launch-secret", QEMU_CAPS_SEV_INJECT_LAUNCH_SECRET }, |
|
||||
{ "calc-dirty-rate", QEMU_CAPS_CALC_DIRTY_RATE }, |
|
||||
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
|
||||
index 28085144a2..3fcee1dbe2 100644
|
|
||||
--- a/src/qemu/qemu_capabilities.h
|
|
||||
+++ b/src/qemu/qemu_capabilities.h
|
|
||||
@@ -617,7 +617,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
|
||||
QEMU_CAPS_MACHINE_CONFIDENTAL_GUEST_SUPPORT, /* -machine confidential-guest-support */ |
|
||||
X_QEMU_CAPS_QUERY_DISPLAY_OPTIONS, /* 'query-display-options' qmp command present */ |
|
||||
QEMU_CAPS_S390_PV_GUEST, /* -object s390-pv-guest,... */ |
|
||||
- QEMU_CAPS_SET_ACTION, /* 'set-action' QMP command */
|
|
||||
+ X_QEMU_CAPS_SET_ACTION, /* 'set-action' QMP command */
|
|
||||
QEMU_CAPS_VIRTIO_BLK_QUEUE_SIZE, /* virtio-blk-*.queue-size */ |
|
||||
|
|
||||
/* 410 */ |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
|
|
||||
index b2a0872853..48629e494d 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
|
|
||||
@@ -109,7 +109,6 @@
|
|
||||
<flag name='acpi-index'/> |
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
|
|
||||
index 0b9613b921..70bf98c404 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_ppc64.xml
|
|
||||
@@ -117,7 +117,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
|
|
||||
index 96eadffcec..25d73b6e1d 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml
|
|
||||
@@ -81,7 +81,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml
|
|
||||
index 945f7364db..53fd51122c 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64+amdsev.xml
|
|
||||
@@ -145,7 +145,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
|
|
||||
index 5cd3828f52..ad3fe67638 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_x86_64.xml
|
|
||||
@@ -145,7 +145,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_10.1.0_s390x.xml
|
|
||||
index 584a1b304c..0d46b3b20e 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.1.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.1.0_s390x.xml
|
|
||||
@@ -82,7 +82,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml
|
|
||||
index 6dd00c360f..242215f7a8 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64+inteltdx.xml
|
|
||||
@@ -128,7 +128,6 @@
|
|
||||
<flag name='acpi-index'/> |
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml
|
|
||||
index e7a0818697..a2faddcced 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.1.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml
|
|
||||
index f3d06927f6..3bbba5ddb1 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml
|
|
||||
@@ -122,7 +122,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64+mshv.xml b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64+mshv.xml
|
|
||||
index 54018639ad..530c0366ea 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64+mshv.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64+mshv.xml
|
|
||||
@@ -135,7 +135,6 @@
|
|
||||
<flag name='acpi-index'/> |
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml
|
|
||||
index d5cc279e13..b2cd261b99 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
index ca6def23dc..d77884f401 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
@@ -122,7 +122,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.0.0_s390x.xml b/tests/qemucapabilitiesdata/caps_11.0.0_s390x.xml
|
|
||||
index 99fccc9739..07ee859318 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.0.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.0.0_s390x.xml
|
|
||||
@@ -82,7 +82,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.0.0_x86_64+sgx.xml b/tests/qemucapabilitiesdata/caps_11.0.0_x86_64+sgx.xml
|
|
||||
index bac7951f73..108f4b0b86 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.0.0_x86_64+sgx.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.0.0_x86_64+sgx.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_11.0.0_x86_64.xml
|
|
||||
index 8724ce5b56..29fdaf20d8 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.0.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.0.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
index 306f2981c1..56fbb80028 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
@@ -122,7 +122,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml
|
|
||||
index 0c020702b4..1d1eef21ff 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.1.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml
|
|
||||
index bc5953f43e..bf67b3d295 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_ppc.xml
|
|
||||
@@ -109,7 +109,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='piix4.acpi-root-pci-hotplug'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
|
|
||||
index 425c608863..f40d77baa5 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64+hvf.xml
|
|
||||
@@ -146,7 +146,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
|
|
||||
index 93fe36f48c..8d44ed71e0 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_7.2.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
|
|
||||
index 592df7049b..fcbb68e415 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.0.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
|
|
||||
index 2c540f7f30..65f73d1af8 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_s390x.xml
|
|
||||
@@ -77,7 +77,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
|
|
||||
index b29325a465..c730dd7174 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.1.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
|
||||
index e026abfd96..1f0f68092d 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
|
||||
@@ -115,7 +115,6 @@
|
|
||||
<flag name='acpi-index'/> |
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml b/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
|
|
||||
index d3af74bcb3..254ec27545 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
|
|
||||
@@ -120,7 +120,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml
|
|
||||
index 640438623a..95eb2dfa21 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_loongarch64.xml
|
|
||||
@@ -108,7 +108,6 @@
|
|
||||
<flag name='acpi-index'/> |
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml
|
|
||||
index a254e16741..45ab66ec29 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_s390x.xml
|
|
||||
@@ -77,7 +77,6 @@
|
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
|
||||
index 57aa43adab..b46505d24b 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml b/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml
|
|
||||
index c2710ecab1..44ddfb0f76 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.0.0_sparc.xml
|
|
||||
@@ -37,7 +37,6 @@
|
|
||||
<flag name='rotation-rate'/> |
|
||||
<flag name='input-linux'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
<flag name='query-dirty-rate'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
|
||||
index 3b4aaa202c..2f361bd1c8 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.0.0_x86_64.xml
|
|
||||
@@ -147,7 +147,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml
|
|
||||
index b5ca67b445..f04b2fd302 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_riscv64.xml
|
|
||||
@@ -113,7 +113,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
|
|
||||
index 02c8e6f641..990fe255f6 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml
|
|
||||
@@ -81,7 +81,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml
|
|
||||
index 65d279f5ea..07d7562c84 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.1.0_x86_64.xml
|
|
||||
@@ -145,7 +145,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml b/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml
|
|
||||
index 8c777c121e..c9e85ff9b3 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml
|
|
||||
@@ -87,7 +87,6 @@
|
|
||||
<flag name='rotation-rate'/> |
|
||||
<flag name='acpi-index'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
<flag name='query-dirty-rate'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
|
|
||||
index 135812b527..a8f830076e 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml
|
|
||||
@@ -81,7 +81,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
<flag name='s390-pv-guest'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
<flag name='netdev.json'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml
|
|
||||
index af4b8bbc3e..f67222578d 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64+amdsev.xml
|
|
||||
@@ -146,7 +146,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml
|
|
||||
index 933698d99f..efd3eeb9c7 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_x86_64.xml
|
|
||||
@@ -145,7 +145,6 @@
|
|
||||
<flag name='virtio-gpu-gl-pci'/> |
|
||||
<flag name='virtio-vga-gl'/> |
|
||||
<flag name='confidential-guest-support'/> |
|
||||
- <flag name='set-action'/>
|
|
||||
<flag name='virtio-blk.queue-size'/> |
|
||||
<flag name='virtio-mem-pci'/> |
|
||||
<flag name='memory-backend-file.reserve'/> |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,81 +0,0 @@ |
|||||
From 613935cded2347bf61e0461ac8f72f2f99ceb18f Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <613935cded2347bf61e0461ac8f72f2f99ceb18f.1786713644.git.jdenemar@redhat.com> |
|
||||
From: Nathan Chen <nathanc@nvidia.com> |
|
||||
Date: Wed, 5 Aug 2026 15:12:59 -0700 |
|
||||
Subject: [PATCH] qemu: introduce QEMU_CAPS_ARM_SMMUV3_ACCEL |
|
||||
|
|
||||
The arm-smmuv3 accel device property, used for HW-accelerated nested |
|
||||
SMMUv3, was added in QEMU 11.0.0 on top of the pluggable device |
|
||||
introduced in 10.2. Probe it alongside smmu_per_bus via |
|
||||
device-list-properties. |
|
||||
|
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> |
|
||||
Signed-off-by: Nathan Chen <nathanc@nvidia.com> |
|
||||
(cherry picked from commit 90b01b9d3e3b684837190e92257eba15511515b0) |
|
||||
|
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-138901 |
|
||||
---
|
|
||||
src/qemu/qemu_capabilities.c | 2 ++ |
|
||||
src/qemu/qemu_capabilities.h | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml | 1 + |
|
||||
4 files changed, 5 insertions(+) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
|
||||
index a7d121f917..c60ca02d97 100644
|
|
||||
--- a/src/qemu/qemu_capabilities.c
|
|
||||
+++ b/src/qemu/qemu_capabilities.c
|
|
||||
@@ -769,6 +769,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
|
||||
"blockdev-mirror.target-is-zero", /* QEMU_CAPS_BLOCKDEV_MIRROR_TARGET_IS_ZERO */ |
|
||||
"arm-smmuv3", /* QEMU_CAPS_DEVICE_ARM_SMMUV3 */ |
|
||||
"arm-smmuv3.smmu_per_bus", /* QEMU_CAPS_ARM_SMMUV3_SMMU_PER_BUS */ |
|
||||
+ "arm-smmuv3.accel", /* QEMU_CAPS_ARM_SMMUV3_ACCEL */
|
|
||||
); |
|
||||
|
|
||||
|
|
||||
@@ -1648,6 +1649,7 @@ static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsAMDIOMMU[] = {
|
|
||||
|
|
||||
static struct virQEMUCapsDevicePropsFlags virQEMUCapsDevicePropsArmSmmuv3[] = { |
|
||||
{ "smmu_per_bus", QEMU_CAPS_ARM_SMMUV3_SMMU_PER_BUS, NULL }, |
|
||||
+ { "accel", QEMU_CAPS_ARM_SMMUV3_ACCEL, NULL },
|
|
||||
}; |
|
||||
|
|
||||
/* see documentation for virQEMUQAPISchemaPathGet for the query format */ |
|
||||
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
|
||||
index 0dc9836ca9..28085144a2 100644
|
|
||||
--- a/src/qemu/qemu_capabilities.h
|
|
||||
+++ b/src/qemu/qemu_capabilities.h
|
|
||||
@@ -743,6 +743,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
|
||||
QEMU_CAPS_BLOCKDEV_MIRROR_TARGET_IS_ZERO, /* 'blockdev-mirror' supports 'target-is-zero' */ |
|
||||
QEMU_CAPS_DEVICE_ARM_SMMUV3, /* -device arm-smmuv3 */ |
|
||||
QEMU_CAPS_ARM_SMMUV3_SMMU_PER_BUS, /* arm-smmuv3.smmu_per_bus */ |
|
||||
+ QEMU_CAPS_ARM_SMMUV3_ACCEL, /* arm-smmuv3.accel */
|
|
||||
|
|
||||
QEMU_CAPS_LAST /* this must always be the last item */ |
|
||||
} virQEMUCapsFlags; |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
index 2280800fca..ca6def23dc 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
@@ -190,6 +190,7 @@
|
|
||||
<flag name='blockdev-mirror.target-is-zero'/> |
|
||||
<flag name='arm-smmuv3'/> |
|
||||
<flag name='arm-smmuv3.smmu_per_bus'/> |
|
||||
+ <flag name='arm-smmuv3.accel'/>
|
|
||||
<version>11000000</version> |
|
||||
<microcodeVersion>61700286</microcodeVersion> |
|
||||
<package>v11.0.0</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
index b4200f35bb..306f2981c1 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
@@ -190,6 +190,7 @@
|
|
||||
<flag name='blockdev-mirror.target-is-zero'/> |
|
||||
<flag name='arm-smmuv3'/> |
|
||||
<flag name='arm-smmuv3.smmu_per_bus'/> |
|
||||
+ <flag name='arm-smmuv3.accel'/>
|
|
||||
<version>11000050</version> |
|
||||
<microcodeVersion>61700287</microcodeVersion> |
|
||||
<package>v11.0.0-1600-g5611a9268d</package> |
|
||||
--
|
|
||||
2.55.0 |
|
||||
File diff suppressed because it is too large
@ -1,152 +0,0 @@ |
|||||
From 59f9683dd189584af437b03fec40006c03be581e Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <59f9683dd189584af437b03fec40006c03be581e.1786713643.git.jdenemar@redhat.com> |
|
||||
From: Nathan Chen <nathanc@nvidia.com> |
|
||||
Date: Wed, 5 Aug 2026 15:12:57 -0700 |
|
||||
Subject: [PATCH] qemu: introduce QEMU_CAPS_DEVICE_ARM_SMMUV3 |
|
||||
|
|
||||
The arm-smmuv3 QOM type is reported by qom-list-types on ARM QEMU. |
|
||||
Register it as QEMU_CAPS_DEVICE_ARM_SMMUV3 so later device-list-properties |
|
||||
probing for arm-smmuv3 properties can be gated on this capability |
|
||||
instead of an architecture check. |
|
||||
|
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> |
|
||||
Signed-off-by: Nathan Chen <nathanc@nvidia.com> |
|
||||
(cherry picked from commit 93e0d7845585fd42fc770991e5eb9f365c96d6bb) |
|
||||
|
|
||||
Conflicts: |
|
||||
src/qemu/qemu_capabilities.c |
|
||||
src/qemu/qemu_capabilities.h |
|
||||
tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml |
|
||||
- missing upstream commit 248981ff51116e06d3b7be7dbd33559a45261e24 |
|
||||
|
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-138901 |
|
||||
---
|
|
||||
src/qemu/qemu_capabilities.c | 2 ++ |
|
||||
src/qemu/qemu_capabilities.h | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml | 1 + |
|
||||
tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml | 1 + |
|
||||
9 files changed, 10 insertions(+) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
|
|
||||
index be57dcad8e..33efc6651b 100644
|
|
||||
--- a/src/qemu/qemu_capabilities.c
|
|
||||
+++ b/src/qemu/qemu_capabilities.c
|
|
||||
@@ -767,6 +767,7 @@ VIR_ENUM_IMPL(virQEMUCaps,
|
|
||||
|
|
||||
/* 495 */ |
|
||||
"blockdev-mirror.target-is-zero", /* QEMU_CAPS_BLOCKDEV_MIRROR_TARGET_IS_ZERO */ |
|
||||
+ "arm-smmuv3", /* QEMU_CAPS_DEVICE_ARM_SMMUV3 */
|
|
||||
); |
|
||||
|
|
||||
|
|
||||
@@ -1480,6 +1481,7 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = {
|
|
||||
{ "iommufd", QEMU_CAPS_OBJECT_IOMMUFD }, |
|
||||
{ "uefi-vars-x64", QEMU_CAPS_DEVICE_UEFI_VARS }, |
|
||||
{ "uefi-vars-sysbus", QEMU_CAPS_DEVICE_UEFI_VARS }, |
|
||||
+ { "arm-smmuv3", QEMU_CAPS_DEVICE_ARM_SMMUV3 },
|
|
||||
}; |
|
||||
|
|
||||
|
|
||||
diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h
|
|
||||
index 3014f3dc5e..e5d589b0c4 100644
|
|
||||
--- a/src/qemu/qemu_capabilities.h
|
|
||||
+++ b/src/qemu/qemu_capabilities.h
|
|
||||
@@ -741,6 +741,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
|
|
||||
|
|
||||
/* 495 */ |
|
||||
QEMU_CAPS_BLOCKDEV_MIRROR_TARGET_IS_ZERO, /* 'blockdev-mirror' supports 'target-is-zero' */ |
|
||||
+ QEMU_CAPS_DEVICE_ARM_SMMUV3, /* -device arm-smmuv3 */
|
|
||||
|
|
||||
QEMU_CAPS_LAST /* this must always be the last item */ |
|
||||
} virQEMUCapsFlags; |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
|
|
||||
index b6434e6019..b2a0872853 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.0.0_aarch64.xml
|
|
||||
@@ -166,6 +166,7 @@
|
|
||||
<flag name='virtio-iommu.aw-bits'/> |
|
||||
<flag name='iommufd'/> |
|
||||
<flag name='uefi-vars'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>10000000</version> |
|
||||
<microcodeVersion>61700285</microcodeVersion> |
|
||||
<package>v10.0.0</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml
|
|
||||
index df3e2a8275..449f2f65c7 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_10.2.0_aarch64.xml
|
|
||||
@@ -186,6 +186,7 @@
|
|
||||
<flag name='iommufd'/> |
|
||||
<flag name='uefi-vars'/> |
|
||||
<flag name='blockdev-mirror.target-is-zero'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>10002000</version> |
|
||||
<microcodeVersion>61700287</microcodeVersion> |
|
||||
<package>v10.2.0</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
index 3fdc0d6621..b9acf8ac67 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.0.0_aarch64.xml
|
|
||||
@@ -188,6 +188,7 @@
|
|
||||
<flag name='uefi-vars'/> |
|
||||
<flag name='query-block-flat'/> |
|
||||
<flag name='blockdev-mirror.target-is-zero'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>11000000</version> |
|
||||
<microcodeVersion>61700286</microcodeVersion> |
|
||||
<package>v11.0.0</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
index f7dd14a1ad..0595e5f88c 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_11.1.0_aarch64.xml
|
|
||||
@@ -188,6 +188,7 @@
|
|
||||
<flag name='uefi-vars'/> |
|
||||
<flag name='query-block-flat'/> |
|
||||
<flag name='blockdev-mirror.target-is-zero'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>11000050</version> |
|
||||
<microcodeVersion>61700287</microcodeVersion> |
|
||||
<package>v11.0.0-1600-g5611a9268d</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
|
||||
index bb70bcaf1f..e026abfd96 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_aarch64.xml
|
|
||||
@@ -161,6 +161,7 @@
|
|
||||
<flag name='nvme'/> |
|
||||
<flag name='nvme-ns'/> |
|
||||
<flag name='usb-bot'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>8002000</version> |
|
||||
<microcodeVersion>61700246</microcodeVersion> |
|
||||
<package>v8.2.0</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml b/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
|
|
||||
index 9590bc464a..d3af74bcb3 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_8.2.0_armv7l.xml
|
|
||||
@@ -168,6 +168,7 @@
|
|
||||
<flag name='nvme'/> |
|
||||
<flag name='nvme-ns'/> |
|
||||
<flag name='usb-bot'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>8002000</version> |
|
||||
<microcodeVersion>0</microcodeVersion> |
|
||||
<package>qemu-8.2.0-7.fc39</package> |
|
||||
diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml b/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml
|
|
||||
index 9c843f9e5c..8c777c121e 100644
|
|
||||
--- a/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml
|
|
||||
+++ b/tests/qemucapabilitiesdata/caps_9.2.0_aarch64+hvf.xml
|
|
||||
@@ -136,6 +136,7 @@
|
|
||||
<flag name='usb-bot'/> |
|
||||
<flag name='acpi-generic-initiator'/> |
|
||||
<flag name='virtio-iommu.aw-bits'/> |
|
||||
+ <flag name='arm-smmuv3'/>
|
|
||||
<version>9002002</version> |
|
||||
<microcodeVersion>61700247</microcodeVersion> |
|
||||
<package></package> |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,112 +0,0 @@ |
|||||
From a29e30928c9892e9a550af0b8d4df398606fc013 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <a29e30928c9892e9a550af0b8d4df398606fc013.1787144196.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:31:39 +0200 |
|
||||
Subject: [PATCH] qemu: monitor: Remove support for 'watchdog-set-action' |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
We now use 'set-action' instead. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 8365c6679fa65b66b85da2773547515a40ae1a8f) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_monitor.c | 12 ------------ |
|
||||
src/qemu/qemu_monitor.h | 4 ---- |
|
||||
src/qemu/qemu_monitor_json.c | 22 ---------------------- |
|
||||
src/qemu/qemu_monitor_json.h | 5 ----- |
|
||||
4 files changed, 43 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
|
|
||||
index baa78dd6fe..85e97562ad 100644
|
|
||||
--- a/src/qemu/qemu_monitor.c
|
|
||||
+++ b/src/qemu/qemu_monitor.c
|
|
||||
@@ -3965,18 +3965,6 @@ qemuMonitorMemoryDeviceSizeChangeFree(qemuMonitorMemoryDeviceSizeChangePtr info)
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-int
|
|
||||
-qemuMonitorSetWatchdogAction(qemuMonitor *mon,
|
|
||||
- const char *action)
|
|
||||
-{
|
|
||||
- VIR_DEBUG("watchdogAction=%s", action);
|
|
||||
-
|
|
||||
- QEMU_CHECK_MONITOR(mon);
|
|
||||
-
|
|
||||
- return qemuMonitorJSONSetWatchdogAction(mon, action);
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
/** |
|
||||
* qemuMonitorBlockdevCreate: |
|
||||
* @mon: monitor object |
|
||||
diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h
|
|
||||
index c2afb580e4..3298095e9c 100644
|
|
||||
--- a/src/qemu/qemu_monitor.h
|
|
||||
+++ b/src/qemu/qemu_monitor.h
|
|
||||
@@ -1640,10 +1640,6 @@ qemuMonitorSetBlockThreshold(qemuMonitor *mon,
|
|
||||
const char *nodename, |
|
||||
unsigned long long threshold); |
|
||||
|
|
||||
-int
|
|
||||
-qemuMonitorSetWatchdogAction(qemuMonitor *mon,
|
|
||||
- const char *action);
|
|
||||
-
|
|
||||
int |
|
||||
qemuMonitorBlockdevCreate(qemuMonitor *mon, |
|
||||
const char *jobname, |
|
||||
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
|
|
||||
index 28f7d93834..57e4b91874 100644
|
|
||||
--- a/src/qemu/qemu_monitor_json.c
|
|
||||
+++ b/src/qemu/qemu_monitor_json.c
|
|
||||
@@ -7873,28 +7873,6 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitor *mon,
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-int
|
|
||||
-qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon,
|
|
||||
- const char *action)
|
|
||||
-{
|
|
||||
- g_autoptr(virJSONValue) cmd = NULL;
|
|
||||
- g_autoptr(virJSONValue) reply = NULL;
|
|
||||
-
|
|
||||
- if (!(cmd = qemuMonitorJSONMakeCommand("watchdog-set-action",
|
|
||||
- "s:action", action,
|
|
||||
- NULL)))
|
|
||||
- return -1;
|
|
||||
-
|
|
||||
- if (qemuMonitorJSONCommand(mon, cmd, &reply) < 0)
|
|
||||
- return -1;
|
|
||||
-
|
|
||||
- if (qemuMonitorJSONCheckError(cmd, reply) < 0)
|
|
||||
- return -1;
|
|
||||
-
|
|
||||
- return 0;
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
int |
|
||||
qemuMonitorJSONBlockdevCreate(qemuMonitor *mon, |
|
||||
const char *jobname, |
|
||||
diff --git a/src/qemu/qemu_monitor_json.h b/src/qemu/qemu_monitor_json.h
|
|
||||
index f4c093d717..3b7b04a11d 100644
|
|
||||
--- a/src/qemu/qemu_monitor_json.h
|
|
||||
+++ b/src/qemu/qemu_monitor_json.h
|
|
||||
@@ -633,11 +633,6 @@ qemuMonitorJSONSetBlockThreshold(qemuMonitor *mon,
|
|
||||
unsigned long long threshold) |
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2); |
|
||||
|
|
||||
-int
|
|
||||
-qemuMonitorJSONSetWatchdogAction(qemuMonitor *mon,
|
|
||||
- const char *action)
|
|
||||
- ATTRIBUTE_NONNULL(1);
|
|
||||
-
|
|
||||
int |
|
||||
qemuMonitorJSONBlockdevCreate(qemuMonitor *mon, |
|
||||
const char *jobname, |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,434 +0,0 @@ |
|||||
From 49497c4111df88d3fc4a4f0c115cc7fa0d60a8ee Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <49497c4111df88d3fc4a4f0c115cc7fa0d60a8ee.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Roman Bogorodskiy <bogorodskiy@gmail.com> |
|
||||
Date: Sat, 18 Jul 2026 12:58:33 +0200 |
|
||||
Subject: [PATCH] qemu: move qemuAgent*InfoFormatParams to |
|
||||
hypervisor/qemu_agent.c |
|
||||
|
|
||||
Move: |
|
||||
|
|
||||
* qemuAgentDiskInfoFormatParams |
|
||||
* qemuAgentFSInfoFormatParams |
|
||||
* virDomainInterfaceFormatParams |
|
||||
|
|
||||
from the qemu driver to hypervisor/qemu_agent.c so they could be reused |
|
||||
by the other drivers implementing virDomainGetGuestInfo() using the qemu |
|
||||
agent. |
|
||||
|
|
||||
Also, rename virDomainInterfaceFormatParams() to |
|
||||
qemuAgentInterfaceFormatParams() to follow the common naming schema as |
|
||||
it's not really used outside of the qemu agent related code. |
|
||||
|
|
||||
Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> |
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
(cherry picked from commit c2b1b9f7454e2f23b8e1bdfc9005c9e4dcdbccb5) |
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-235731 |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
---
|
|
||||
src/hypervisor/qemu_agent.c | 162 ++++++++++++++++++++++++++++++++++++ |
|
||||
src/hypervisor/qemu_agent.h | 17 ++++ |
|
||||
src/libvirt_private.syms | 3 + |
|
||||
src/qemu/qemu_driver.c | 162 +----------------------------------- |
|
||||
4 files changed, 183 insertions(+), 161 deletions(-) |
|
||||
|
|
||||
diff --git a/src/hypervisor/qemu_agent.c b/src/hypervisor/qemu_agent.c
|
|
||||
index e549947fbf..418386317d 100644
|
|
||||
--- a/src/hypervisor/qemu_agent.c
|
|
||||
+++ b/src/hypervisor/qemu_agent.c
|
|
||||
@@ -2681,3 +2681,165 @@ qemuAgentFSInfoFormat(qemuAgentFSInfo **agentinfo,
|
|
||||
} |
|
||||
return ret; |
|
||||
} |
|
||||
+
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentDiskInfoFormatParams(qemuAgentDiskInfo **info,
|
|
||||
+ int ndisks,
|
|
||||
+ virDomainDef *vmdef,
|
|
||||
+ virTypedParamList *list)
|
|
||||
+{
|
|
||||
+ size_t i;
|
|
||||
+
|
|
||||
+ virTypedParamListAddUInt(list, ndisks, VIR_DOMAIN_GUEST_INFO_DISK_COUNT);
|
|
||||
+
|
|
||||
+ for (i = 0; i < ndisks; i++) {
|
|
||||
+ virTypedParamListAddString(list, info[i]->name,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_NAME, i);
|
|
||||
+ virTypedParamListAddBoolean(list, info[i]->partition,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_PARTITION, i);
|
|
||||
+
|
|
||||
+ if (info[i]->dependencies) {
|
|
||||
+ size_t ndeps = g_strv_length(info[i]->dependencies);
|
|
||||
+ size_t j;
|
|
||||
+
|
|
||||
+ if (ndeps > 0)
|
|
||||
+ virTypedParamListAddUInt(list, ndeps,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_DEPENDENCY_COUNT, i);
|
|
||||
+
|
|
||||
+ for (j = 0; j < ndeps; j++) {
|
|
||||
+ virTypedParamListAddString(list, info[i]->dependencies[j],
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_DEPENDENCY_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_DEPENDENCY_SUFFIX_NAME, i, j);
|
|
||||
+ }
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (info[i]->address) {
|
|
||||
+ qemuAgentDiskAddress *address = info[i]->address;
|
|
||||
+ virDomainDiskDef *diskdef = NULL;
|
|
||||
+
|
|
||||
+ if (address->serial)
|
|
||||
+ virTypedParamListAddString(list, address->serial,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_SERIAL, i);
|
|
||||
+
|
|
||||
+ /* match the disk to the target in the vm definition */
|
|
||||
+ diskdef = virDomainDiskByAddress(vmdef,
|
|
||||
+ &address->pci_controller,
|
|
||||
+ address->ccw_addr,
|
|
||||
+ address->bus,
|
|
||||
+ address->target,
|
|
||||
+ address->unit);
|
|
||||
+
|
|
||||
+ if (diskdef && diskdef->dst)
|
|
||||
+ virTypedParamListAddString(list, diskdef->dst,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_ALIAS, i);
|
|
||||
+
|
|
||||
+ if (address->bus_type)
|
|
||||
+ virTypedParamListAddString(list, address->bus_type,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_GUEST_BUS, i);
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (info[i]->alias)
|
|
||||
+ virTypedParamListAddString(list, info[i]->alias,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_GUEST_ALIAS, i);
|
|
||||
+ }
|
|
||||
+}
|
|
||||
+
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentFSInfoFormatParams(qemuAgentFSInfo **fsinfo,
|
|
||||
+ int nfs,
|
|
||||
+ virDomainDef *vmdef,
|
|
||||
+ virTypedParamList *list)
|
|
||||
+{
|
|
||||
+ size_t i;
|
|
||||
+
|
|
||||
+ virTypedParamListAddUInt(list, nfs, VIR_DOMAIN_GUEST_INFO_FS_COUNT);
|
|
||||
+
|
|
||||
+ for (i = 0; i < nfs; i++) {
|
|
||||
+ size_t j;
|
|
||||
+
|
|
||||
+ virTypedParamListAddString(list, fsinfo[i]->name,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_NAME, i);
|
|
||||
+ virTypedParamListAddString(list, fsinfo[i]->mountpoint,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_MOUNTPOINT, i);
|
|
||||
+ virTypedParamListAddString(list, fsinfo[i]->fstype,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_FSTYPE, i);
|
|
||||
+
|
|
||||
+ /* disk usage values are not returned by older guest agents, so
|
|
||||
+ * only add the params if the value is set */
|
|
||||
+ if (fsinfo[i]->total_bytes != -1)
|
|
||||
+ virTypedParamListAddULLong(list, fsinfo[i]->total_bytes,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_TOTAL_BYTES, i);
|
|
||||
+ if (fsinfo[i]->used_bytes != -1)
|
|
||||
+ virTypedParamListAddULLong(list, fsinfo[i]->used_bytes,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_USED_BYTES, i);
|
|
||||
+
|
|
||||
+ virTypedParamListAddUInt(list, fsinfo[i]->ndisks,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_COUNT, i);
|
|
||||
+
|
|
||||
+ for (j = 0; j < fsinfo[i]->ndisks; j++) {
|
|
||||
+ virDomainDiskDef *diskdef = NULL;
|
|
||||
+ qemuAgentDiskAddress *d = fsinfo[i]->disks[j];
|
|
||||
+
|
|
||||
+ /* match the disk to the target in the vm definition */
|
|
||||
+ diskdef = virDomainDiskByAddress(vmdef,
|
|
||||
+ &d->pci_controller,
|
|
||||
+ d->ccw_addr,
|
|
||||
+ d->bus,
|
|
||||
+ d->target,
|
|
||||
+ d->unit);
|
|
||||
+ if (diskdef && diskdef->dst)
|
|
||||
+ virTypedParamListAddString(list, diskdef->dst,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_ALIAS, i, j);
|
|
||||
+
|
|
||||
+ if (d->serial)
|
|
||||
+ virTypedParamListAddString(list, d->serial,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_SERIAL, i, j);
|
|
||||
+
|
|
||||
+ if (d->devnode)
|
|
||||
+ virTypedParamListAddString(list, d->devnode,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_DEVICE, i, j);
|
|
||||
+ }
|
|
||||
+ }
|
|
||||
+}
|
|
||||
+
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentInterfaceFormatParams(virDomainInterfacePtr *ifaces,
|
|
||||
+ int nifaces,
|
|
||||
+ virTypedParamList *list)
|
|
||||
+{
|
|
||||
+ size_t i;
|
|
||||
+
|
|
||||
+ virTypedParamListAddUInt(list, nifaces, VIR_DOMAIN_GUEST_INFO_IF_COUNT);
|
|
||||
+
|
|
||||
+ for (i = 0; i < nifaces; i++) {
|
|
||||
+ size_t j;
|
|
||||
+
|
|
||||
+ virTypedParamListAddString(list, ifaces[i]->name,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_NAME, i);
|
|
||||
+ virTypedParamListAddString(list, ifaces[i]->hwaddr,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_HWADDR, i);
|
|
||||
+ virTypedParamListAddUInt(list, ifaces[i]->naddrs,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_COUNT, i);
|
|
||||
+
|
|
||||
+ for (j = 0; j < ifaces[i]->naddrs; j++) {
|
|
||||
+ switch (ifaces[i]->addrs[j].type) {
|
|
||||
+ case VIR_IP_ADDR_TYPE_IPV4:
|
|
||||
+ virTypedParamListAddString(list, "ipv4",
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_TYPE, i, j);
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_IP_ADDR_TYPE_IPV6:
|
|
||||
+ virTypedParamListAddString(list, "ipv6",
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_TYPE, i, j);
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ virTypedParamListAddString(list, ifaces[i]->addrs[j].addr,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_ADDR, i, j);
|
|
||||
+ virTypedParamListAddUInt(list, ifaces[i]->addrs[j].prefix,
|
|
||||
+ VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_PREFIX, i, j);
|
|
||||
+ }
|
|
||||
+ }
|
|
||||
+}
|
|
||||
diff --git a/src/hypervisor/qemu_agent.h b/src/hypervisor/qemu_agent.h
|
|
||||
index 3dbc3baec1..def6f983d4 100644
|
|
||||
--- a/src/hypervisor/qemu_agent.h
|
|
||||
+++ b/src/hypervisor/qemu_agent.h
|
|
||||
@@ -201,3 +201,20 @@ int qemuAgentFSInfoFormat(qemuAgentFSInfo **agentinfo,
|
|
||||
int nagentinfo, |
|
||||
virDomainDef *vmdef, |
|
||||
virDomainFSInfoPtr **info); |
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentDiskInfoFormatParams(qemuAgentDiskInfo **info,
|
|
||||
+ int ndisks,
|
|
||||
+ virDomainDef *vmdef,
|
|
||||
+ virTypedParamList *list);
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentFSInfoFormatParams(qemuAgentFSInfo **fsinfo,
|
|
||||
+ int nfs,
|
|
||||
+ virDomainDef *vmdef,
|
|
||||
+ virTypedParamList *list);
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentInterfaceFormatParams(virDomainInterfacePtr *ifaces,
|
|
||||
+ int nifaces,
|
|
||||
+ virTypedParamList *list);
|
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
|
||||
index c76e5cb08a..02bd505749 100644
|
|
||||
--- a/src/libvirt_private.syms
|
|
||||
+++ b/src/libvirt_private.syms
|
|
||||
@@ -1716,9 +1716,11 @@ virDomainInterfaceVportRemove;
|
|
||||
# hypervisor/qemu_agent.h |
|
||||
qemuAgentArbitraryCommand; |
|
||||
qemuAgentClose; |
|
||||
+qemuAgentDiskInfoFormatParams;
|
|
||||
qemuAgentDiskInfoFree; |
|
||||
qemuAgentFSFreeze; |
|
||||
qemuAgentFSInfoFormat; |
|
||||
+qemuAgentFSInfoFormatParams;
|
|
||||
qemuAgentFSInfoFree; |
|
||||
qemuAgentFSThaw; |
|
||||
qemuAgentFSTrim; |
|
||||
@@ -1732,6 +1734,7 @@ qemuAgentGetTime;
|
|
||||
qemuAgentGetTimezone; |
|
||||
qemuAgentGetUsers; |
|
||||
qemuAgentGetVCPUs; |
|
||||
+qemuAgentInterfaceFormatParams;
|
|
||||
qemuAgentNotifyClose; |
|
||||
qemuAgentNotifyEvent; |
|
||||
qemuAgentOpen; |
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index b90a7b07d4..c7892161e3 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -20014,166 +20014,6 @@ qemuDomainGetGuestInfoCheckSupport(unsigned int types,
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-static void
|
|
||||
-qemuAgentDiskInfoFormatParams(qemuAgentDiskInfo **info,
|
|
||||
- int ndisks,
|
|
||||
- virDomainDef *vmdef,
|
|
||||
- virTypedParamList *list)
|
|
||||
-{
|
|
||||
- size_t i;
|
|
||||
-
|
|
||||
- virTypedParamListAddUInt(list, ndisks, VIR_DOMAIN_GUEST_INFO_DISK_COUNT);
|
|
||||
-
|
|
||||
- for (i = 0; i < ndisks; i++) {
|
|
||||
- virTypedParamListAddString(list, info[i]->name,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_NAME, i);
|
|
||||
- virTypedParamListAddBoolean(list, info[i]->partition,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_PARTITION, i);
|
|
||||
-
|
|
||||
- if (info[i]->dependencies) {
|
|
||||
- size_t ndeps = g_strv_length(info[i]->dependencies);
|
|
||||
- size_t j;
|
|
||||
-
|
|
||||
- if (ndeps > 0)
|
|
||||
- virTypedParamListAddUInt(list, ndeps,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_DEPENDENCY_COUNT, i);
|
|
||||
-
|
|
||||
- for (j = 0; j < ndeps; j++) {
|
|
||||
- virTypedParamListAddString(list, info[i]->dependencies[j],
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_DEPENDENCY_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_DEPENDENCY_SUFFIX_NAME, i, j);
|
|
||||
- }
|
|
||||
- }
|
|
||||
-
|
|
||||
- if (info[i]->address) {
|
|
||||
- qemuAgentDiskAddress *address = info[i]->address;
|
|
||||
- virDomainDiskDef *diskdef = NULL;
|
|
||||
-
|
|
||||
- if (address->serial)
|
|
||||
- virTypedParamListAddString(list, address->serial,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_SERIAL, i);
|
|
||||
-
|
|
||||
- /* match the disk to the target in the vm definition */
|
|
||||
- diskdef = virDomainDiskByAddress(vmdef,
|
|
||||
- &address->pci_controller,
|
|
||||
- address->ccw_addr,
|
|
||||
- address->bus,
|
|
||||
- address->target,
|
|
||||
- address->unit);
|
|
||||
-
|
|
||||
- if (diskdef && diskdef->dst)
|
|
||||
- virTypedParamListAddString(list, diskdef->dst,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_ALIAS, i);
|
|
||||
-
|
|
||||
- if (address->bus_type)
|
|
||||
- virTypedParamListAddString(list, address->bus_type,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_GUEST_BUS, i);
|
|
||||
- }
|
|
||||
-
|
|
||||
- if (info[i]->alias)
|
|
||||
- virTypedParamListAddString(list, info[i]->alias,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_DISK_SUFFIX_GUEST_ALIAS, i);
|
|
||||
- }
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
-static void
|
|
||||
-qemuAgentFSInfoFormatParams(qemuAgentFSInfo **fsinfo,
|
|
||||
- int nfs,
|
|
||||
- virDomainDef *vmdef,
|
|
||||
- virTypedParamList *list)
|
|
||||
-{
|
|
||||
- size_t i;
|
|
||||
-
|
|
||||
- virTypedParamListAddUInt(list, nfs, VIR_DOMAIN_GUEST_INFO_FS_COUNT);
|
|
||||
-
|
|
||||
- for (i = 0; i < nfs; i++) {
|
|
||||
- size_t j;
|
|
||||
-
|
|
||||
- virTypedParamListAddString(list, fsinfo[i]->name,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_NAME, i);
|
|
||||
- virTypedParamListAddString(list, fsinfo[i]->mountpoint,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_MOUNTPOINT, i);
|
|
||||
- virTypedParamListAddString(list, fsinfo[i]->fstype,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_FSTYPE, i);
|
|
||||
-
|
|
||||
- /* disk usage values are not returned by older guest agents, so
|
|
||||
- * only add the params if the value is set */
|
|
||||
- if (fsinfo[i]->total_bytes != -1)
|
|
||||
- virTypedParamListAddULLong(list, fsinfo[i]->total_bytes,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_TOTAL_BYTES, i);
|
|
||||
- if (fsinfo[i]->used_bytes != -1)
|
|
||||
- virTypedParamListAddULLong(list, fsinfo[i]->used_bytes,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_USED_BYTES, i);
|
|
||||
-
|
|
||||
- virTypedParamListAddUInt(list, fsinfo[i]->ndisks,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_COUNT, i);
|
|
||||
-
|
|
||||
- for (j = 0; j < fsinfo[i]->ndisks; j++) {
|
|
||||
- virDomainDiskDef *diskdef = NULL;
|
|
||||
- qemuAgentDiskAddress *d = fsinfo[i]->disks[j];
|
|
||||
-
|
|
||||
- /* match the disk to the target in the vm definition */
|
|
||||
- diskdef = virDomainDiskByAddress(vmdef,
|
|
||||
- &d->pci_controller,
|
|
||||
- d->ccw_addr,
|
|
||||
- d->bus,
|
|
||||
- d->target,
|
|
||||
- d->unit);
|
|
||||
- if (diskdef && diskdef->dst)
|
|
||||
- virTypedParamListAddString(list, diskdef->dst,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_ALIAS, i, j);
|
|
||||
-
|
|
||||
- if (d->serial)
|
|
||||
- virTypedParamListAddString(list, d->serial,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_SERIAL, i, j);
|
|
||||
-
|
|
||||
- if (d->devnode)
|
|
||||
- virTypedParamListAddString(list, d->devnode,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_FS_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_FS_SUFFIX_DISK_SUFFIX_DEVICE, i, j);
|
|
||||
- }
|
|
||||
- }
|
|
||||
-}
|
|
||||
-
|
|
||||
-static void
|
|
||||
-virDomainInterfaceFormatParams(virDomainInterfacePtr *ifaces,
|
|
||||
- int nifaces,
|
|
||||
- virTypedParamList *list)
|
|
||||
-{
|
|
||||
- size_t i;
|
|
||||
-
|
|
||||
- virTypedParamListAddUInt(list, nifaces, VIR_DOMAIN_GUEST_INFO_IF_COUNT);
|
|
||||
-
|
|
||||
- for (i = 0; i < nifaces; i++) {
|
|
||||
- size_t j;
|
|
||||
-
|
|
||||
- virTypedParamListAddString(list, ifaces[i]->name,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_NAME, i);
|
|
||||
- virTypedParamListAddString(list, ifaces[i]->hwaddr,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_HWADDR, i);
|
|
||||
- virTypedParamListAddUInt(list, ifaces[i]->naddrs,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_COUNT, i);
|
|
||||
-
|
|
||||
- for (j = 0; j < ifaces[i]->naddrs; j++) {
|
|
||||
- switch (ifaces[i]->addrs[j].type) {
|
|
||||
- case VIR_IP_ADDR_TYPE_IPV4:
|
|
||||
- virTypedParamListAddString(list, "ipv4",
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_TYPE, i, j);
|
|
||||
- break;
|
|
||||
-
|
|
||||
- case VIR_IP_ADDR_TYPE_IPV6:
|
|
||||
- virTypedParamListAddString(list, "ipv6",
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_TYPE, i, j);
|
|
||||
- break;
|
|
||||
- }
|
|
||||
-
|
|
||||
- virTypedParamListAddString(list, ifaces[i]->addrs[j].addr,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_ADDR, i, j);
|
|
||||
- virTypedParamListAddUInt(list, ifaces[i]->addrs[j].prefix,
|
|
||||
- VIR_DOMAIN_GUEST_INFO_IF_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_PREFIX "%zu" VIR_DOMAIN_GUEST_INFO_IF_SUFFIX_ADDR_SUFFIX_PREFIX, i, j);
|
|
||||
- }
|
|
||||
- }
|
|
||||
-}
|
|
||||
-
|
|
||||
static int |
|
||||
qemuDomainGetGuestInfo(virDomainPtr dom, |
|
||||
unsigned int types, |
|
||||
@@ -20300,7 +20140,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom,
|
|
||||
} |
|
||||
|
|
||||
if (nifaces > 0) { |
|
||||
- virDomainInterfaceFormatParams(ifaces, nifaces, list);
|
|
||||
+ qemuAgentInterfaceFormatParams(ifaces, nifaces, list);
|
|
||||
} |
|
||||
|
|
||||
if (format_load) { |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,127 +0,0 @@ |
|||||
From ce57f5151847c8152673ebeafc7a39039c3d85d2 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <ce57f5151847c8152673ebeafc7a39039c3d85d2.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Tue, 21 Jul 2026 15:08:01 +0200 |
|
||||
Subject: [PATCH] qemu: processGuestPanicEvent: Split individual steps under |
|
||||
separate conditions |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Separate the individual steps (setting of VM state, dumping, unlocking, |
|
||||
final state transition) under individual switch statements for future |
|
||||
extension. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit ce97710da27fa005841c5f38baa2edcdc82f5d30) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_driver.c | 66 ++++++++++++++++++++++++++++++------------ |
|
||||
1 file changed, 48 insertions(+), 18 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index 391394485e..c6ef5684b5 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -3627,26 +3627,64 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
qemuDomainLogAppendMessage(driver, vm, "%s: panic %s\n", timestamp, msg); |
|
||||
} |
|
||||
|
|
||||
- virDomainObjSetState(vm, VIR_DOMAIN_CRASHED, VIR_DOMAIN_CRASHED_PANICKED);
|
|
||||
-
|
|
||||
event = virDomainEventLifecycleNewFromObj(vm, |
|
||||
VIR_DOMAIN_EVENT_CRASHED, |
|
||||
VIR_DOMAIN_EVENT_CRASHED_PANICKED); |
|
||||
-
|
|
||||
virObjectEventStateQueue(driver->domainEventState, event); |
|
||||
|
|
||||
- qemuDomainSaveStatus(vm);
|
|
||||
-
|
|
||||
- if (virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState) < 0)
|
|
||||
- VIR_WARN("Unable to release lease on %s", vm->def->name);
|
|
||||
- VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
|
||||
-
|
|
||||
+ /* Update VM state */
|
|
||||
switch (vm->def->onCrash) { |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY: |
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ virDomainObjSetState(vm, VIR_DOMAIN_CRASHED, VIR_DOMAIN_CRASHED_PANICKED);
|
|
||||
+ qemuDomainSaveStatus(vm);
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ /* Handle state of leases/locks */
|
|
||||
+ switch (vm->def->onCrash) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ if (virDomainLockProcessPause(driver->lockManager, vm, &priv->lockState) < 0)
|
|
||||
+ VIR_WARN("Unable to release lease on %s", vm->def->name);
|
|
||||
+ VIR_DEBUG("Preserving lock state '%s'", NULLSTR(priv->lockState));
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ /* create core dump */
|
|
||||
+ switch (vm->def->onCrash) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
if (doCoreDumpToAutoDumpPath(driver, vm, flags) < 0) |
|
||||
goto endjob; |
|
||||
- G_GNUC_FALLTHROUGH;
|
|
||||
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ /* final state update */
|
|
||||
+ switch (vm->def->onCrash) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY: |
|
||||
qemuProcessStop(vm, VIR_DOMAIN_SHUTOFF_CRASHED, VIR_ASYNC_JOB_DUMP, 0); |
|
||||
event = virDomainEventLifecycleNewFromObj(vm, |
|
||||
@@ -3659,22 +3697,14 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
break; |
|
||||
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART: |
|
||||
- if (doCoreDumpToAutoDumpPath(driver, vm, flags) < 0)
|
|
||||
- goto endjob;
|
|
||||
- G_GNUC_FALLTHROUGH;
|
|
||||
-
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART: |
|
||||
qemuDomainSetFakeReboot(vm, true); |
|
||||
ignore_value(qemuProcessShutdownOrReboot(vm)); |
|
||||
break; |
|
||||
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE: |
|
||||
- /* the VM is kept around for debugging */
|
|
||||
- break;
|
|
||||
-
|
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME: |
|
||||
case VIR_DOMAIN_LIFECYCLE_ACTION_LAST: |
|
||||
- default:
|
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,103 +0,0 @@ |
|||||
From 68aef452471aa40f8f09730fe1aca9b7d4fdcdbb Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <68aef452471aa40f8f09730fe1aca9b7d4fdcdbb.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Wed, 22 Jul 2026 17:05:00 +0200 |
|
||||
Subject: [PATCH] qemuDomainModifyLifecycleActionLive: Prepare to handle other |
|
||||
actions |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Rework the code so that it'll be possible to easily extend it to set |
|
||||
other lifecycle actions in qemu. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 79b6d701c7719fbe5e5db8531ff6460edfbed171) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_driver.c | 55 ++++++++++++++++++++++++------------------ |
|
||||
1 file changed, 32 insertions(+), 23 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index b3b853b4c8..269694fac5 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -19547,42 +19547,51 @@ qemuDomainModifyLifecycleActionLive(virDomainObj *vm,
|
|
||||
virDomainLifecycle type, |
|
||||
virDomainLifecycleAction action) |
|
||||
{ |
|
||||
- qemuMonitorActionReboot monReboot = QEMU_MONITOR_ACTION_REBOOT_KEEP;
|
|
||||
+ qemuMonitorActionShutdown shutdown = QEMU_MONITOR_ACTION_SHUTDOWN_KEEP;
|
|
||||
+ qemuMonitorActionReboot reboot = QEMU_MONITOR_ACTION_REBOOT_KEEP;
|
|
||||
+ qemuMonitorActionWatchdog watchdog = QEMU_MONITOR_ACTION_WATCHDOG_KEEP;
|
|
||||
+ qemuMonitorActionPanic panic = QEMU_MONITOR_ACTION_PANIC_KEEP;
|
|
||||
qemuDomainObjPrivate *priv = vm->privateData; |
|
||||
int rc; |
|
||||
|
|
||||
- /* For now we only update 'reboot' action here as we want to keep the
|
|
||||
- * shutdown action as is (we're emulating the outcome anyways)) */
|
|
||||
- if (type != VIR_DOMAIN_LIFECYCLE_REBOOT ||
|
|
||||
- vm->def->onReboot == action)
|
|
||||
- return 0;
|
|
||||
+ switch (type) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_REBOOT:
|
|
||||
+ if (vm->def->onReboot == action)
|
|
||||
+ break;
|
|
||||
|
|
||||
+ switch (action) {
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
+ reboot = QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN;
|
|
||||
+ break;
|
|
||||
|
|
||||
- switch (action) {
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY:
|
|
||||
- monReboot = QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN;
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
+ reboot = QEMU_MONITOR_ACTION_REBOOT_RESET;
|
|
||||
+ break;
|
|
||||
+
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
+ break;
|
|
||||
+ }
|
|
||||
break; |
|
||||
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART:
|
|
||||
- monReboot = QEMU_MONITOR_ACTION_REBOOT_RESET;
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_POWEROFF:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_CRASH:
|
|
||||
+ case VIR_DOMAIN_LIFECYCLE_LAST:
|
|
||||
break; |
|
||||
-
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_PRESERVE:
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_RESTART_RENAME:
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_DESTROY:
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_COREDUMP_RESTART:
|
|
||||
- case VIR_DOMAIN_LIFECYCLE_ACTION_LAST:
|
|
||||
- return 0;
|
|
||||
} |
|
||||
|
|
||||
+ if (shutdown == QEMU_MONITOR_ACTION_SHUTDOWN_KEEP &&
|
|
||||
+ reboot == QEMU_MONITOR_ACTION_REBOOT_KEEP &&
|
|
||||
+ watchdog == QEMU_MONITOR_ACTION_WATCHDOG_KEEP &&
|
|
||||
+ panic == QEMU_MONITOR_ACTION_PANIC_KEEP)
|
|
||||
+ return 0;
|
|
||||
|
|
||||
qemuDomainObjEnterMonitor(vm); |
|
||||
|
|
||||
- rc = qemuMonitorSetAction(priv->mon,
|
|
||||
- QEMU_MONITOR_ACTION_SHUTDOWN_KEEP,
|
|
||||
- monReboot,
|
|
||||
- QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
|
|
||||
- QEMU_MONITOR_ACTION_PANIC_KEEP);
|
|
||||
+ rc = qemuMonitorSetAction(priv->mon, shutdown, reboot, watchdog, panic);
|
|
||||
|
|
||||
qemuDomainObjExitMonitor(vm); |
|
||||
if (rc < 0) |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,88 +0,0 @@ |
|||||
From 434a60c4f126958b0969f0523bf580311af2a786 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <434a60c4f126958b0969f0523bf580311af2a786.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Tue, 21 Jul 2026 14:54:50 +0200 |
|
||||
Subject: [PATCH] qemuMonitorGuestPanicEventInfoFormatMsg: Directly return |
|
||||
message |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Remove the 'ret' variable and format the panic string on a single line. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 3f41645e3d8bf7b589de58d2d5052123a4d6fe9c) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_monitor.c | 40 +++++++++++++++++----------------------- |
|
||||
1 file changed, 17 insertions(+), 23 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c
|
|
||||
index 85e97562ad..13a6b1ed98 100644
|
|
||||
--- a/src/qemu/qemu_monitor.c
|
|
||||
+++ b/src/qemu/qemu_monitor.c
|
|
||||
@@ -3881,43 +3881,37 @@ qemuMonitorSetBlockThreshold(qemuMonitor *mon,
|
|
||||
char * |
|
||||
qemuMonitorGuestPanicEventInfoFormatMsg(qemuMonitorEventPanicInfo *info) |
|
||||
{ |
|
||||
- char *ret = NULL;
|
|
||||
-
|
|
||||
switch (info->type) { |
|
||||
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_HYPERV: |
|
||||
- ret = g_strdup_printf("hyper-v: arg1='0x%llx', arg2='0x%llx', "
|
|
||||
- "arg3='0x%llx', arg4='0x%llx', arg5='0x%llx'",
|
|
||||
- info->data.hyperv.arg1, info->data.hyperv.arg2,
|
|
||||
- info->data.hyperv.arg3, info->data.hyperv.arg4,
|
|
||||
- info->data.hyperv.arg5);
|
|
||||
+ return g_strdup_printf("hyper-v: arg1='0x%llx', arg2='0x%llx', arg3='0x%llx', arg4='0x%llx', arg5='0x%llx'",
|
|
||||
+ info->data.hyperv.arg1, info->data.hyperv.arg2,
|
|
||||
+ info->data.hyperv.arg3, info->data.hyperv.arg4,
|
|
||||
+ info->data.hyperv.arg5);
|
|
||||
break; |
|
||||
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_S390: |
|
||||
- ret = g_strdup_printf("s390: core='%d' psw-mask='0x%016llx' "
|
|
||||
- "psw-addr='0x%016llx' reason='%s'",
|
|
||||
- info->data.s390.core,
|
|
||||
- info->data.s390.psw_mask,
|
|
||||
- info->data.s390.psw_addr,
|
|
||||
- info->data.s390.reason);
|
|
||||
+ return g_strdup_printf("s390: core='%d' psw-mask='0x%016llx' psw-addr='0x%016llx' reason='%s'",
|
|
||||
+ info->data.s390.core,
|
|
||||
+ info->data.s390.psw_mask,
|
|
||||
+ info->data.s390.psw_addr,
|
|
||||
+ info->data.s390.reason);
|
|
||||
break; |
|
||||
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_TDX: |
|
||||
if (info->data.tdx.has_gpa) |
|
||||
- ret = g_strdup_printf("tdx: error_code='0x%x' message='%s' "
|
|
||||
- "additional error information can be found "
|
|
||||
- "at gpa page: '0x%016llx'",
|
|
||||
- info->data.tdx.error_code,
|
|
||||
- info->data.tdx.message,
|
|
||||
- info->data.tdx.gpa);
|
|
||||
+ return g_strdup_printf("tdx: error_code='0x%x' message='%s' additional error information can be found at gpa page: '0x%016llx'",
|
|
||||
+ info->data.tdx.error_code,
|
|
||||
+ info->data.tdx.message,
|
|
||||
+ info->data.tdx.gpa);
|
|
||||
else |
|
||||
- ret = g_strdup_printf("tdx: error_code='0x%x' message='%s'",
|
|
||||
- info->data.tdx.error_code,
|
|
||||
- info->data.tdx.message);
|
|
||||
+ return g_strdup_printf("tdx: error_code='0x%x' message='%s'",
|
|
||||
+ info->data.tdx.error_code,
|
|
||||
+ info->data.tdx.message);
|
|
||||
break; |
|
||||
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_NONE: |
|
||||
case QEMU_MONITOR_EVENT_PANIC_INFO_TYPE_LAST: |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
- return ret;
|
|
||||
+ return NULL;
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,62 +0,0 @@ |
|||||
From 09be2b6c34897411dfaf321aa2f0cb5cb8802005 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <09be2b6c34897411dfaf321aa2f0cb5cb8802005.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Tue, 21 Jul 2026 14:55:38 +0200 |
|
||||
Subject: [PATCH] qemuProcessGuestPanicEventInfo: Fold into only caller |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Move the code directly to the only place that calls this function. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit bf4ace1bca464fe8432c2eb08f5261d6f9bdaf29) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_driver.c | 22 +++++++--------------- |
|
||||
1 file changed, 7 insertions(+), 15 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
|
|
||||
index cb9f6fb7bf..391394485e 100644
|
|
||||
--- a/src/qemu/qemu_driver.c
|
|
||||
+++ b/src/qemu/qemu_driver.c
|
|
||||
@@ -3599,19 +3599,6 @@ doCoreDumpToAutoDumpPath(virQEMUDriver *driver,
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
-static void
|
|
||||
-qemuProcessGuestPanicEventInfo(virQEMUDriver *driver,
|
|
||||
- virDomainObj *vm,
|
|
||||
- qemuMonitorEventPanicInfo *info)
|
|
||||
-{
|
|
||||
- g_autofree char *msg = qemuMonitorGuestPanicEventInfoFormatMsg(info);
|
|
||||
- g_autofree char *timestamp = virTimeStringNow();
|
|
||||
-
|
|
||||
- if (msg && timestamp)
|
|
||||
- qemuDomainLogAppendMessage(driver, vm, "%s: panic %s\n", timestamp, msg);
|
|
||||
-}
|
|
||||
-
|
|
||||
-
|
|
||||
static void |
|
||||
processGuestPanicEvent(virQEMUDriver *driver, |
|
||||
virDomainObj *vm, |
|
||||
@@ -3632,8 +3619,13 @@ processGuestPanicEvent(virQEMUDriver *driver,
|
|
||||
goto endjob; |
|
||||
} |
|
||||
|
|
||||
- if (info)
|
|
||||
- qemuProcessGuestPanicEventInfo(driver, vm, info);
|
|
||||
+ if (info) {
|
|
||||
+ g_autofree char *msg = qemuMonitorGuestPanicEventInfoFormatMsg(info);
|
|
||||
+ g_autofree char *timestamp = virTimeStringNow();
|
|
||||
+
|
|
||||
+ if (msg && timestamp)
|
|
||||
+ qemuDomainLogAppendMessage(driver, vm, "%s: panic %s\n", timestamp, msg);
|
|
||||
+ }
|
|
||||
|
|
||||
virDomainObjSetState(vm, VIR_DOMAIN_CRASHED, VIR_DOMAIN_CRASHED_PANICKED); |
|
||||
|
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,62 +0,0 @@ |
|||||
From bd4a2bf8b7bd25adfdcf693f84a8df15e4473261 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <bd4a2bf8b7bd25adfdcf693f84a8df15e4473261.1787144196.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Mon, 20 Jul 2026 13:48:51 +0200 |
|
||||
Subject: [PATCH] qemuProcessSetupLifecycleActions: Prepare to handle other |
|
||||
actions |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Rework the code so that it'll be possible to easily extend it to set |
|
||||
other lifecycle actions in qemu. |
|
||||
|
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
(cherry picked from commit 30a548c894dc2f5787d7004d68b266caa404f6af) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-242545 |
|
||||
---
|
|
||||
src/qemu/qemu_process.c | 18 ++++++++++++------ |
|
||||
1 file changed, 12 insertions(+), 6 deletions(-) |
|
||||
|
|
||||
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
|
|
||||
index a1cdce6d17..397082ef04 100644
|
|
||||
--- a/src/qemu/qemu_process.c
|
|
||||
+++ b/src/qemu/qemu_process.c
|
|
||||
@@ -8176,21 +8176,27 @@ qemuProcessSetupLifecycleActions(virDomainObj *vm,
|
|
||||
virDomainAsyncJob asyncJob) |
|
||||
{ |
|
||||
qemuDomainObjPrivate *priv = vm->privateData; |
|
||||
+ qemuMonitorActionShutdown shutdown = QEMU_MONITOR_ACTION_SHUTDOWN_KEEP;
|
|
||||
+ qemuMonitorActionReboot reboot = QEMU_MONITOR_ACTION_REBOOT_KEEP;
|
|
||||
+ qemuMonitorActionWatchdog watchdog = QEMU_MONITOR_ACTION_WATCHDOG_KEEP;
|
|
||||
+ qemuMonitorActionPanic panic = QEMU_MONITOR_ACTION_PANIC_KEEP;
|
|
||||
int rc; |
|
||||
|
|
||||
/* for now we handle only onReboot->destroy here as an alternative to |
|
||||
* '-no-reboot' on the commandline */ |
|
||||
- if (vm->def->onReboot != VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY)
|
|
||||
+ if (vm->def->onReboot == VIR_DOMAIN_LIFECYCLE_ACTION_DESTROY)
|
|
||||
+ reboot = QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN;
|
|
||||
+
|
|
||||
+ if (shutdown == QEMU_MONITOR_ACTION_SHUTDOWN_KEEP &&
|
|
||||
+ reboot == QEMU_MONITOR_ACTION_REBOOT_KEEP &&
|
|
||||
+ watchdog == QEMU_MONITOR_ACTION_WATCHDOG_KEEP &&
|
|
||||
+ panic == QEMU_MONITOR_ACTION_PANIC_KEEP)
|
|
||||
return 0; |
|
||||
|
|
||||
if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) |
|
||||
return -1; |
|
||||
|
|
||||
- rc = qemuMonitorSetAction(priv->mon,
|
|
||||
- QEMU_MONITOR_ACTION_SHUTDOWN_KEEP,
|
|
||||
- QEMU_MONITOR_ACTION_REBOOT_SHUTDOWN,
|
|
||||
- QEMU_MONITOR_ACTION_WATCHDOG_KEEP,
|
|
||||
- QEMU_MONITOR_ACTION_PANIC_KEEP);
|
|
||||
+ rc = qemuMonitorSetAction(priv->mon, shutdown, reboot, watchdog, panic);
|
|
||||
|
|
||||
qemuDomainObjExitMonitor(vm); |
|
||||
if (rc < 0) |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,211 +0,0 @@ |
|||||
From 97cc433df8d7eebda4985b76e4b38b0597c6ddc6 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <97cc433df8d7eebda4985b76e4b38b0597c6ddc6.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Date: Tue, 11 Aug 2026 17:08:05 +0200 |
|
||||
Subject: [PATCH] qemu_agent: Introduce guest-get-devices |
|
||||
|
|
||||
QEMU agent has 'guest-get-devices` command. Even though it's |
|
||||
currently implemented only for Windows, it shows some interesting |
|
||||
information from inside the guest, like device drivers, their |
|
||||
versions, and so on. |
|
||||
|
|
||||
Looking at the command definition in qga/qapi-schema.json the |
|
||||
only non-optional field in returned data is 'driver-name'. The |
|
||||
rest is optional. Although looking at the current implementation |
|
||||
either all fields are set or device is ignored completely. |
|
||||
Nevertheless, our code should follow QMP schema. |
|
||||
|
|
||||
New qemuAgentGuestDeviceInfo structure is introduced among with |
|
||||
qemuAgentGetGuestDeviceInfo() function which parses reply from |
|
||||
agent and fills the structure. Optional fields are either set to |
|
||||
NULL or -1, if missing. |
|
||||
|
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
(cherry picked from commit 7dea038439aa025d18c716e3343d3f0e9ccd672a) |
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-235731 |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
---
|
|
||||
src/hypervisor/qemu_agent.c | 119 ++++++++++++++++++++++++++++++++++++ |
|
||||
src/hypervisor/qemu_agent.h | 21 +++++++ |
|
||||
src/libvirt_private.syms | 2 + |
|
||||
3 files changed, 142 insertions(+) |
|
||||
|
|
||||
diff --git a/src/hypervisor/qemu_agent.c b/src/hypervisor/qemu_agent.c
|
|
||||
index 418386317d..fbfaafc1bb 100644
|
|
||||
--- a/src/hypervisor/qemu_agent.c
|
|
||||
+++ b/src/hypervisor/qemu_agent.c
|
|
||||
@@ -2843,3 +2843,122 @@ qemuAgentInterfaceFormatParams(virDomainInterfacePtr *ifaces,
|
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
+
|
|
||||
+
|
|
||||
+void
|
|
||||
+qemuAgentGuestDeviceInfoFree(qemuAgentGuestDeviceInfo *info)
|
|
||||
+{
|
|
||||
+ if (!info)
|
|
||||
+ return;
|
|
||||
+
|
|
||||
+ g_free(info->driverName);
|
|
||||
+ g_free(info->driverVersion);
|
|
||||
+ g_free(info->pci);
|
|
||||
+ g_free(info);
|
|
||||
+}
|
|
||||
+
|
|
||||
+
|
|
||||
+int
|
|
||||
+qemuAgentGetGuestDeviceInfo(qemuAgent *agent,
|
|
||||
+ qemuAgentGuestDeviceInfo ***info,
|
|
||||
+ bool report_unsupported)
|
|
||||
+{
|
|
||||
+ g_autoptr(virJSONValue) cmd = NULL;
|
|
||||
+ g_autoptr(virJSONValue) reply = NULL;
|
|
||||
+ virJSONValue *data = NULL;
|
|
||||
+ size_t ndata;
|
|
||||
+ size_t i;
|
|
||||
+ int rc;
|
|
||||
+
|
|
||||
+ if (!(cmd = qemuAgentMakeCommand("guest-get-devices", NULL)))
|
|
||||
+ return -1;
|
|
||||
+
|
|
||||
+ if ((rc = qemuAgentCommandFull(agent, cmd, &reply, agent->timeout,
|
|
||||
+ report_unsupported)) < 0)
|
|
||||
+ return rc;
|
|
||||
+
|
|
||||
+ if (!(data = virJSONValueObjectGetArray(reply, "return"))) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("qemu agent didn't return an array of devices"));
|
|
||||
+ return -1;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ ndata = virJSONValueArraySize(data);
|
|
||||
+
|
|
||||
+ *info = g_new0(qemuAgentGuestDeviceInfo *, ndata);
|
|
||||
+
|
|
||||
+ for (i = 0; i < ndata; i++) {
|
|
||||
+ g_autoptr(qemuAgentGuestDeviceInfo) oneInfo = NULL;
|
|
||||
+ virJSONValue *entry = virJSONValueArrayGet(data, i);
|
|
||||
+ virJSONValue *dDate = NULL;
|
|
||||
+ virJSONValue *idObj = NULL;
|
|
||||
+
|
|
||||
+ if (!entry) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("array element missing in guest-get-devices return value"));
|
|
||||
+ goto error;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ oneInfo = g_new0(qemuAgentGuestDeviceInfo, 1);
|
|
||||
+
|
|
||||
+ oneInfo->driverName = g_strdup(virJSONValueObjectGetString(entry, "driver-name"));
|
|
||||
+ if (!oneInfo->driverName) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("'driver-name' missing in reply of guest-get-devices"));
|
|
||||
+ goto error;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if ((dDate = virJSONValueObjectGet(entry, "driver-date"))) {
|
|
||||
+ if (virJSONValueGetNumberLong(dDate, &oneInfo->driverDate) < 0) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("malformed 'driver-date' in reply of guest-get-devices"));
|
|
||||
+ goto error;
|
|
||||
+ }
|
|
||||
+ } else {
|
|
||||
+ oneInfo->driverDate = -1;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ oneInfo->driverVersion = g_strdup(virJSONValueObjectGetString(entry, "driver-version"));
|
|
||||
+
|
|
||||
+ if ((idObj = virJSONValueObjectGet(entry, "id"))) {
|
|
||||
+ const char *type = NULL;
|
|
||||
+
|
|
||||
+ if (!(type = virJSONValueObjectGetString(idObj, "type"))) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("missing 'type' in reply of guest-get-devices"));
|
|
||||
+ goto error;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (STREQ("pci", type)) {
|
|
||||
+ g_autofree qemuAgentGuestDeviceInfoPCI *pci = NULL;
|
|
||||
+
|
|
||||
+ pci = g_new0(qemuAgentGuestDeviceInfoPCI, 1);
|
|
||||
+
|
|
||||
+ if (virJSONValueObjectGetNumberUint(idObj, "vendor-id", &pci->vendorID) < 0) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("missing or malformed 'vendor-id' in reply of guest-get-devices"));
|
|
||||
+ goto error;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (virJSONValueObjectGetNumberUint(idObj, "device-id", &pci->deviceID) < 0) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ _("missing or malformed 'device-id' in reply of guest-get-devices"));
|
|
||||
+ goto error;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ oneInfo->pci = g_steal_pointer(&pci);
|
|
||||
+ }
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ (*info)[i] = g_steal_pointer(&oneInfo);
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ return ndata;
|
|
||||
+
|
|
||||
+ error:
|
|
||||
+ for (i = 0; i < ndata; i++) {
|
|
||||
+ qemuAgentGuestDeviceInfoFree((*info)[i]);
|
|
||||
+ }
|
|
||||
+ g_clear_pointer(info, g_free);
|
|
||||
+ return -1;
|
|
||||
+}
|
|
||||
diff --git a/src/hypervisor/qemu_agent.h b/src/hypervisor/qemu_agent.h
|
|
||||
index def6f983d4..def4194ab7 100644
|
|
||||
--- a/src/hypervisor/qemu_agent.h
|
|
||||
+++ b/src/hypervisor/qemu_agent.h
|
|
||||
@@ -218,3 +218,24 @@ void
|
|
||||
qemuAgentInterfaceFormatParams(virDomainInterfacePtr *ifaces, |
|
||||
int nifaces, |
|
||||
virTypedParamList *list); |
|
||||
+
|
|
||||
+typedef struct _qemuAgentGuestDeviceInfoPCI qemuAgentGuestDeviceInfoPCI;
|
|
||||
+struct _qemuAgentGuestDeviceInfoPCI {
|
|
||||
+ unsigned int vendorID;
|
|
||||
+ unsigned int deviceID;
|
|
||||
+};
|
|
||||
+
|
|
||||
+typedef struct _qemuAgentGuestDeviceInfo qemuAgentGuestDeviceInfo;
|
|
||||
+struct _qemuAgentGuestDeviceInfo {
|
|
||||
+ char *driverName;
|
|
||||
+ long long driverDate; /* In nanoseconds since the epoch */
|
|
||||
+ char *driverVersion;
|
|
||||
+ qemuAgentGuestDeviceInfoPCI *pci;
|
|
||||
+};
|
|
||||
+
|
|
||||
+void qemuAgentGuestDeviceInfoFree(qemuAgentGuestDeviceInfo *info);
|
|
||||
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(qemuAgentGuestDeviceInfo, qemuAgentGuestDeviceInfoFree);
|
|
||||
+
|
|
||||
+int qemuAgentGetGuestDeviceInfo(qemuAgent *agent,
|
|
||||
+ qemuAgentGuestDeviceInfo ***info,
|
|
||||
+ bool report_unsupported);
|
|
||||
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
|
|
||||
index 02bd505749..0bd8c6f781 100644
|
|
||||
--- a/src/libvirt_private.syms
|
|
||||
+++ b/src/libvirt_private.syms
|
|
||||
@@ -1726,6 +1726,7 @@ qemuAgentFSThaw;
|
|
||||
qemuAgentFSTrim; |
|
||||
qemuAgentGetDisks; |
|
||||
qemuAgentGetFSInfo; |
|
||||
+qemuAgentGetGuestDeviceInfo;
|
|
||||
qemuAgentGetHostname; |
|
||||
qemuAgentGetInterfaces; |
|
||||
qemuAgentGetLoadAvg; |
|
||||
@@ -1734,6 +1735,7 @@ qemuAgentGetTime;
|
|
||||
qemuAgentGetTimezone; |
|
||||
qemuAgentGetUsers; |
|
||||
qemuAgentGetVCPUs; |
|
||||
+qemuAgentGuestDeviceInfoFree;
|
|
||||
qemuAgentInterfaceFormatParams; |
|
||||
qemuAgentNotifyClose; |
|
||||
qemuAgentNotifyEvent; |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,164 +0,0 @@ |
|||||
From 59f656a08ba5557f3bbd6f617248b585b8e911a9 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <59f656a08ba5557f3bbd6f617248b585b8e911a9.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Date: Wed, 12 Aug 2026 14:08:37 +0200 |
|
||||
Subject: [PATCH] qemuagenttest: Introduce GetGuestDeviceInfo test case |
|
||||
|
|
||||
Introduce a test case for newly introduced |
|
||||
qemuAgentGetGuestDeviceInfo(). The expected data started as a |
|
||||
genuine reply from a qemu-ga running inside a Windows VM. But |
|
||||
then was modified to cover more cases (like an optional key |
|
||||
missing). |
|
||||
|
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
(cherry picked from commit c56a2479ab59167af6cc9094981ef6e1c0a83a01) |
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-235731 |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
---
|
|
||||
tests/qemuagenttest.c | 123 ++++++++++++++++++++++++++++++++++++++++++ |
|
||||
1 file changed, 123 insertions(+) |
|
||||
|
|
||||
diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
|
|
||||
index 74cd317e74..7c726a6b85 100644
|
|
||||
--- a/tests/qemuagenttest.c
|
|
||||
+++ b/tests/qemuagenttest.c
|
|
||||
@@ -1394,6 +1394,128 @@ testQemuAgentGetLoadAvg(const void *data)
|
|
||||
} |
|
||||
|
|
||||
|
|
||||
+static const char *testQemuAgentGetGuestDeviceInfoResponse =
|
|
||||
+"{"
|
|
||||
+" \"return\": ["
|
|
||||
+" {"
|
|
||||
+" \"driver-date\": 1736726400000000000,"
|
|
||||
+" \"driver-name\": \"Red Hat VirtIO Ethernet Adapter\","
|
|
||||
+" \"driver-version\": \"100.100.104.27100\","
|
|
||||
+" \"id\": {"
|
|
||||
+" \"device-id\": 4161,"
|
|
||||
+" \"vendor-id\": 6900,"
|
|
||||
+" \"type\": \"pci\""
|
|
||||
+" }"
|
|
||||
+" },"
|
|
||||
+" {"
|
|
||||
+" \"driver-name\": \"VirtIO Serial Driver\","
|
|
||||
+" \"driver-version\": \"100.100.104.27100\","
|
|
||||
+" \"id\": {"
|
|
||||
+" \"device-id\": 4163,"
|
|
||||
+" \"vendor-id\": 6900,"
|
|
||||
+" \"type\": \"pci\""
|
|
||||
+" }"
|
|
||||
+" },"
|
|
||||
+" {"
|
|
||||
+" \"driver-date\": 1736726400000000000,"
|
|
||||
+" \"driver-name\": \"VirtIO Balloon Driver\","
|
|
||||
+" \"id\": {"
|
|
||||
+" \"device-id\": 4165,"
|
|
||||
+" \"vendor-id\": 6900,"
|
|
||||
+" \"type\": \"pci\""
|
|
||||
+" }"
|
|
||||
+" },"
|
|
||||
+" {"
|
|
||||
+" \"driver-date\": 1736726400000000000,"
|
|
||||
+" \"driver-name\": \"Red Hat VirtIO GPU DOD controller\","
|
|
||||
+" \"driver-version\": \"100.100.104.27100\""
|
|
||||
+" }"
|
|
||||
+" ]"
|
|
||||
+"}";
|
|
||||
+
|
|
||||
+
|
|
||||
+static int
|
|
||||
+testQemuAgentGetGuestDeviceInfo(const void *data)
|
|
||||
+{
|
|
||||
+ virDomainXMLOption *xmlopt = (virDomainXMLOption *)data;
|
|
||||
+ g_autoptr(qemuMonitorTest) test = qemuMonitorTestNewAgent(xmlopt);
|
|
||||
+ qemuAgentGuestDeviceInfo **devices = NULL;
|
|
||||
+ int ret = -1;
|
|
||||
+ size_t i;
|
|
||||
+ int ndevices;
|
|
||||
+
|
|
||||
+ if (!test)
|
|
||||
+ return -1;
|
|
||||
+
|
|
||||
+ if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
|
|
||||
+ return -1;
|
|
||||
+
|
|
||||
+ if (qemuMonitorTestAddItem(test, "guest-get-devices",
|
|
||||
+ testQemuAgentGetGuestDeviceInfoResponse) < 0)
|
|
||||
+ return -1;
|
|
||||
+
|
|
||||
+ ndevices = qemuAgentGetGuestDeviceInfo(qemuMonitorTestGetAgent(test),
|
|
||||
+ &devices, true);
|
|
||||
+
|
|
||||
+ if (ndevices < 0)
|
|
||||
+ return -1;
|
|
||||
+
|
|
||||
+ if (ndevices != 4) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||
+ "unexpected number of guest devices returned (%d), expected 4",
|
|
||||
+ ndevices);
|
|
||||
+ goto cleanup;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (STRNEQ(devices[0]->driverName, "Red Hat VirtIO Ethernet Adapter") ||
|
|
||||
+ STRNEQ(devices[0]->driverVersion, "100.100.104.27100") ||
|
|
||||
+ devices[0]->driverDate != 1736726400000000000LL ||
|
|
||||
+ devices[0]->pci->vendorID != 6900 ||
|
|
||||
+ devices[0]->pci->deviceID != 4161) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ "unexpected device info returned for device #0");
|
|
||||
+ goto cleanup;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (STRNEQ(devices[1]->driverName, "VirtIO Serial Driver") ||
|
|
||||
+ STRNEQ(devices[1]->driverVersion, "100.100.104.27100") ||
|
|
||||
+ devices[1]->driverDate != -1LL ||
|
|
||||
+ devices[1]->pci->vendorID != 6900 ||
|
|
||||
+ devices[1]->pci->deviceID != 4163) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ "unexpected device info returned for device #1");
|
|
||||
+ goto cleanup;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (STRNEQ(devices[2]->driverName, "VirtIO Balloon Driver") ||
|
|
||||
+ devices[2]->driverVersion ||
|
|
||||
+ devices[2]->driverDate != 1736726400000000000LL ||
|
|
||||
+ devices[2]->pci->vendorID != 6900 ||
|
|
||||
+ devices[2]->pci->deviceID != 4165) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ "unexpected device info returned for device #2");
|
|
||||
+ goto cleanup;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (STRNEQ(devices[3]->driverName, "Red Hat VirtIO GPU DOD controller") ||
|
|
||||
+ STRNEQ(devices[3]->driverVersion, "100.100.104.27100") ||
|
|
||||
+ devices[3]->driverDate != 1736726400000000000LL ||
|
|
||||
+ devices[3]->pci) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
+ "unexpected device info returned for device #3");
|
|
||||
+ goto cleanup;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ ret = 0;
|
|
||||
+ cleanup:
|
|
||||
+ for (i = 0; i < ndevices; i++) {
|
|
||||
+ qemuAgentGuestDeviceInfoFree(devices[i]);
|
|
||||
+ }
|
|
||||
+ g_free(devices);
|
|
||||
+ return ret;
|
|
||||
+}
|
|
||||
+
|
|
||||
+
|
|
||||
static int |
|
||||
mymain(void) |
|
||||
{ |
|
||||
@@ -1431,6 +1553,7 @@ mymain(void)
|
|
||||
DO_TEST(SSHKeys); |
|
||||
DO_TEST(GetDisks); |
|
||||
DO_TEST(GetLoadAvg); |
|
||||
+ DO_TEST(GetGuestDeviceInfo);
|
|
||||
|
|
||||
DO_TEST(Timeout); /* Timeout should always be called last */ |
|
||||
|
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,68 +0,0 @@ |
|||||
From 5a1b3e1c63239d346d481c27f3624f66397a0a0b Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <5a1b3e1c63239d346d481c27f3624f66397a0a0b.1787836581.git.jdenemar@redhat.com> |
|
||||
From: Peter Krempa <pkrempa@redhat.com> |
|
||||
Date: Wed, 12 Aug 2026 16:51:58 +0200 |
|
||||
Subject: [PATCH] remote: Fix integer overflow in RPC handler for |
|
||||
virNodeGetFreePages (CVE-2026-18917) |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
CVE-2026-18917 |
|
||||
|
|
||||
The RPC handler 'remoteDispatchNodeGetFreePages' multiplies the 'npages' |
|
||||
argument with the 'cellcount' argument passed to 'virNodeGetFreePages', |
|
||||
both of which are declared as 'unsigned int' to both do an RPC limit |
|
||||
check against the 'REMOTE_NODE_MAX_CELLS' constant and then to allocate |
|
||||
the memory to hold the result from the actual hypervisor driver. |
|
||||
|
|
||||
Since both the values are 'unsigned int' the product is also unsigned |
|
||||
int so big enough numbers can overflow, both passing the check and also |
|
||||
allocating not enough memory for the result. The hypervisor driver |
|
||||
assumes that the passed buffer is large enough and overwrites memory. |
|
||||
|
|
||||
When this happens the the hypervisor daemon crashes. |
|
||||
|
|
||||
This can be triggered e.g. by passing 1023 and 4198405 as values which |
|
||||
multiply to 1019 after wrapping to 32 bit unsigned value. |
|
||||
|
|
||||
Use the VIR_INT_MULTIPLY_OVERFLOW macro in the check to avoid the issue |
|
||||
the same way as we do for other APIs doing multiplication of arguments |
|
||||
to determine amount of required memory. |
|
||||
|
|
||||
Fixes: 34f2d0319d2098c77c8cc27d8350616029125a2b (v1.2.5-164-g34f2d0319d) |
|
||||
Closes: https://gitlab.com/libvirt/libvirt/-/work_items/903 |
|
||||
Signed-off-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> |
|
||||
(cherry picked from commit 5a62cbf2907d4590283597b46da9c0f41e7b4d4f) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-245273 |
|
||||
---
|
|
||||
src/remote/remote_daemon_dispatch.c | 9 +++++---- |
|
||||
1 file changed, 5 insertions(+), 4 deletions(-) |
|
||||
|
|
||||
diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c
|
|
||||
index 329853b6da..7e2b76a7ce 100644
|
|
||||
--- a/src/remote/remote_daemon_dispatch.c
|
|
||||
+++ b/src/remote/remote_daemon_dispatch.c
|
|
||||
@@ -6723,13 +6723,14 @@ remoteDispatchNodeGetFreePages(virNetServer *server G_GNUC_UNUSED,
|
|
||||
if (!conn) |
|
||||
goto cleanup; |
|
||||
|
|
||||
- if (args->pages.pages_len * args->cellCount > REMOTE_NODE_MAX_CELLS) {
|
|
||||
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
|
||||
- _("the result won't fit into REMOTE_NODE_MAX_CELLS"));
|
|
||||
+ if (VIR_INT_MULTIPLY_OVERFLOW(args->pages.pages_len, args->cellCount) ||
|
|
||||
+ args->pages.pages_len * args->cellCount > REMOTE_NODE_MAX_CELLS) {
|
|
||||
+ virReportError(VIR_ERR_INTERNAL_ERROR,
|
|
||||
+ _("npages * cellcount > REMOTE_NODE_MAX_CELLS (%1$u)"),
|
|
||||
+ REMOTE_NODE_MAX_CELLS);
|
|
||||
goto cleanup; |
|
||||
} |
|
||||
|
|
||||
- /* Allocate return buffer. */
|
|
||||
ret->counts.counts_val = g_new0(uint64_t, |
|
||||
args->pages.pages_len * args->cellCount); |
|
||||
|
|
||||
--
|
|
||||
2.55.0 |
|
||||
File diff suppressed because it is too large
@ -1,395 +0,0 @@ |
|||||
From d07415461c5105075aca563fdc4595df8443a9e1 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <d07415461c5105075aca563fdc4595df8443a9e1.1786713644.git.jdenemar@redhat.com> |
|
||||
From: Nathan Chen <nathanc@nvidia.com> |
|
||||
Date: Wed, 5 Aug 2026 15:13:01 -0700 |
|
||||
Subject: [PATCH] tests: qemuxmlconfdata: provide HW-accel smmuv3 sample XML |
|
||||
and CLI args |
|
||||
|
|
||||
Provide sample XML and CLI args for the HW-accel smmuv3 XML schema |
|
||||
for virt machine types. |
|
||||
|
|
||||
Reviewed-by: Pavel Hrdina <phrdina@redhat.com> |
|
||||
Signed-off-by: Nathan Chen <nathanc@nvidia.com> |
|
||||
(cherry picked from commit 6fcebd5bbbc7c31b732b8fe4c8019ced78fce0de) |
|
||||
|
|
||||
Conflicts: |
|
||||
tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.args |
|
||||
tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.args |
|
||||
- missing upstream commit d071782577a83fcd5a8c6730838e853699439f1a |
|
||||
|
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-138901 |
|
||||
---
|
|
||||
...uv3-pci-bus-accel-auto.aarch64-latest.args | 38 +++++++++++ |
|
||||
...muv3-pci-bus-accel-auto.aarch64-latest.xml | 63 +++++++++++++++++++ |
|
||||
.../iommu-smmuv3-pci-bus-accel-auto.xml | 53 ++++++++++++++++ |
|
||||
...u-smmuv3-pci-bus-accel.aarch64-latest.args | 38 +++++++++++ |
|
||||
...mu-smmuv3-pci-bus-accel.aarch64-latest.xml | 63 +++++++++++++++++++ |
|
||||
.../iommu-smmuv3-pci-bus-accel.xml | 53 ++++++++++++++++ |
|
||||
tests/qemuxmlconftest.c | 2 + |
|
||||
7 files changed, 310 insertions(+) |
|
||||
create mode 100644 tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.args |
|
||||
create mode 100644 tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.xml |
|
||||
create mode 100644 tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.xml |
|
||||
create mode 100644 tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.args |
|
||||
create mode 100644 tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.xml |
|
||||
create mode 100644 tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.xml |
|
||||
|
|
||||
diff --git a/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.args b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.args
|
|
||||
new file mode 100644 |
|
||||
index 0000000000..40423e505d
|
|
||||
--- /dev/null
|
|
||||
+++ b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.args
|
|
||||
@@ -0,0 +1,38 @@
|
|
||||
+LC_ALL=C \
|
|
||||
+PATH=/bin \
|
|
||||
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
|
|
||||
+USER=test \
|
|
||||
+LOGNAME=test \
|
|
||||
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
|
|
||||
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
|
|
||||
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
|
|
||||
+/usr/bin/qemu-system-aarch64 \
|
|
||||
+-name guest=guest,debug-threads=on \
|
|
||||
+-S \
|
|
||||
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
|
|
||||
+-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \
|
|
||||
+-accel tcg \
|
|
||||
+-m size=1048576k \
|
|
||||
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
|
|
||||
+-overcommit mem-lock=off \
|
|
||||
+-smp 1,sockets=1,cores=1,threads=1 \
|
|
||||
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
|
|
||||
+-display none \
|
|
||||
+-no-user-config \
|
|
||||
+-nodefaults \
|
|
||||
+-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \
|
|
||||
+-mon chardev=charmonitor,id=monitor,mode=control \
|
|
||||
+-rtc base=utc \
|
|
||||
+-no-shutdown \
|
|
||||
+-boot strict=on \
|
|
||||
+-device '{"driver":"pxb-pcie","bus_nr":252,"id":"pci.1","bus":"pcie.0","addr":"0x1"}' \
|
|
||||
+-device '{"driver":"pxb-pcie","bus_nr":248,"id":"pci.2","bus":"pcie.0","addr":"0x2"}' \
|
|
||||
+-device '{"driver":"pcie-root-port","port":0,"chassis":21,"id":"pci.3","bus":"pci.1","addr":"0x0"}' \
|
|
||||
+-device '{"driver":"pcie-root-port","port":168,"chassis":22,"id":"pci.4","bus":"pci.2","addr":"0x0"}' \
|
|
||||
+-device '{"driver":"arm-smmuv3","primary-bus":"pci.1","id":"iommu0","accel":true}' \
|
|
||||
+-device '{"driver":"arm-smmuv3","primary-bus":"pci.2","id":"iommu1","accel":true}' \
|
|
||||
+-audiodev '{"id":"audio1","driver":"none"}' \
|
|
||||
+-device '{"driver":"vfio-pci","host":"0000:06:00.0","id":"hostdev0","bus":"pci.3","addr":"0x0"}' \
|
|
||||
+-device '{"driver":"vfio-pci","host":"0000:06:01.0","id":"hostdev1","bus":"pci.4","addr":"0x0"}' \
|
|
||||
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
|
||||
+-msg timestamp=on
|
|
||||
diff --git a/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.xml b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.xml
|
|
||||
new file mode 100644 |
|
||||
index 0000000000..08fb17fb6f
|
|
||||
--- /dev/null
|
|
||||
+++ b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.aarch64-latest.xml
|
|
||||
@@ -0,0 +1,63 @@
|
|
||||
+<domain type='qemu'>
|
|
||||
+ <name>guest</name>
|
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
|
||||
+ <memory unit='KiB'>1048576</memory>
|
|
||||
+ <currentMemory unit='KiB'>1048576</currentMemory>
|
|
||||
+ <vcpu placement='static'>1</vcpu>
|
|
||||
+ <os>
|
|
||||
+ <type arch='aarch64' machine='virt'>hvm</type>
|
|
||||
+ <boot dev='hd'/>
|
|
||||
+ </os>
|
|
||||
+ <features>
|
|
||||
+ <gic version='2'/>
|
|
||||
+ </features>
|
|
||||
+ <clock offset='utc'/>
|
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
|
||||
+ <on_reboot>restart</on_reboot>
|
|
||||
+ <on_crash>destroy</on_crash>
|
|
||||
+ <devices>
|
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
|
||||
+ <controller type='usb' index='0' model='none'/>
|
|
||||
+ <controller type='pci' index='0' model='pcie-root'/>
|
|
||||
+ <controller type='pci' index='1' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='252'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='2' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='248'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='3' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='21' port='0x0'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='4' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='22' port='0xa8'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <audio id='1' type='none'/>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x01' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <memballoon model='none'/>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='1' accel='on'/>
|
|
||||
+ </iommu>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='2' accel='on'/>
|
|
||||
+ </iommu>
|
|
||||
+ </devices>
|
|
||||
+</domain>
|
|
||||
diff --git a/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.xml b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.xml
|
|
||||
new file mode 100644 |
|
||||
index 0000000000..abbc22e291
|
|
||||
--- /dev/null
|
|
||||
+++ b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel-auto.xml
|
|
||||
@@ -0,0 +1,53 @@
|
|
||||
+<domain type='qemu'>
|
|
||||
+ <name>guest</name>
|
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
|
||||
+ <memory unit='KiB'>1048576</memory>
|
|
||||
+ <vcpu placement='static'>1</vcpu>
|
|
||||
+ <os>
|
|
||||
+ <type arch='aarch64' machine='virt'>hvm</type>
|
|
||||
+ </os>
|
|
||||
+ <devices>
|
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
|
||||
+ <controller type='usb' model='none'/>
|
|
||||
+ <memballoon model='none'/>
|
|
||||
+ <controller type='pci' index='0' model='pcie-root'/>
|
|
||||
+ <controller type='pci' index='1' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='252'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='2' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='248'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='3' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='21' port='0x0'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='4' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='22' port='0xa8'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x01' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='1' accel='on'/>
|
|
||||
+ </iommu>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='2' accel='on'/>
|
|
||||
+ </iommu>
|
|
||||
+ </devices>
|
|
||||
+</domain>
|
|
||||
diff --git a/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.args b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.args
|
|
||||
new file mode 100644 |
|
||||
index 0000000000..69ec53784e
|
|
||||
--- /dev/null
|
|
||||
+++ b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.args
|
|
||||
@@ -0,0 +1,38 @@
|
|
||||
+LC_ALL=C \
|
|
||||
+PATH=/bin \
|
|
||||
+HOME=/var/lib/libvirt/qemu/domain--1-guest \
|
|
||||
+USER=test \
|
|
||||
+LOGNAME=test \
|
|
||||
+XDG_DATA_HOME=/var/lib/libvirt/qemu/domain--1-guest/.local/share \
|
|
||||
+XDG_CACHE_HOME=/var/lib/libvirt/qemu/domain--1-guest/.cache \
|
|
||||
+XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-guest/.config \
|
|
||||
+/usr/bin/qemu-system-aarch64 \
|
|
||||
+-name guest=guest,debug-threads=on \
|
|
||||
+-S \
|
|
||||
+-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/var/lib/libvirt/qemu/domain--1-guest/master-key.aes"}' \
|
|
||||
+-machine virt,usb=off,gic-version=2,dump-guest-core=off,memory-backend=mach-virt.ram,acpi=off \
|
|
||||
+-accel tcg \
|
|
||||
+-m size=1048576k \
|
|
||||
+-object '{"qom-type":"memory-backend-ram","id":"mach-virt.ram","size":1073741824}' \
|
|
||||
+-overcommit mem-lock=off \
|
|
||||
+-smp 1,sockets=1,cores=1,threads=1 \
|
|
||||
+-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
|
|
||||
+-display none \
|
|
||||
+-no-user-config \
|
|
||||
+-nodefaults \
|
|
||||
+-chardev socket,id=charmonitor,fd=@mon-fd@,server=on,wait=off \
|
|
||||
+-mon chardev=charmonitor,id=monitor,mode=control \
|
|
||||
+-rtc base=utc \
|
|
||||
+-no-shutdown \
|
|
||||
+-boot strict=on \
|
|
||||
+-device '{"driver":"pxb-pcie","bus_nr":252,"id":"pci.1","bus":"pcie.0","addr":"0x1"}' \
|
|
||||
+-device '{"driver":"pxb-pcie","bus_nr":248,"id":"pci.2","bus":"pcie.0","addr":"0x2"}' \
|
|
||||
+-device '{"driver":"pcie-root-port","port":0,"chassis":21,"id":"pci.3","bus":"pci.1","addr":"0x0"}' \
|
|
||||
+-device '{"driver":"pcie-root-port","port":168,"chassis":22,"id":"pci.4","bus":"pci.2","addr":"0x0"}' \
|
|
||||
+-device '{"driver":"arm-smmuv3","primary-bus":"pci.1","id":"iommu0","accel":true,"ats":"on","ril":"off","ssidsize":"20","oas":"44"}' \
|
|
||||
+-device '{"driver":"arm-smmuv3","primary-bus":"pci.2","id":"iommu1","accel":true,"ats":"on","ril":"off","ssidsize":"20","oas":"44"}' \
|
|
||||
+-audiodev '{"id":"audio1","driver":"none"}' \
|
|
||||
+-device '{"driver":"vfio-pci","host":"0000:06:00.0","id":"hostdev0","bus":"pci.3","addr":"0x0"}' \
|
|
||||
+-device '{"driver":"vfio-pci","host":"0000:06:01.0","id":"hostdev1","bus":"pci.4","addr":"0x0"}' \
|
|
||||
+-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \
|
|
||||
+-msg timestamp=on
|
|
||||
diff --git a/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.xml b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.xml
|
|
||||
new file mode 100644 |
|
||||
index 0000000000..221a4185e5
|
|
||||
--- /dev/null
|
|
||||
+++ b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.aarch64-latest.xml
|
|
||||
@@ -0,0 +1,63 @@
|
|
||||
+<domain type='qemu'>
|
|
||||
+ <name>guest</name>
|
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
|
||||
+ <memory unit='KiB'>1048576</memory>
|
|
||||
+ <currentMemory unit='KiB'>1048576</currentMemory>
|
|
||||
+ <vcpu placement='static'>1</vcpu>
|
|
||||
+ <os>
|
|
||||
+ <type arch='aarch64' machine='virt'>hvm</type>
|
|
||||
+ <boot dev='hd'/>
|
|
||||
+ </os>
|
|
||||
+ <features>
|
|
||||
+ <gic version='2'/>
|
|
||||
+ </features>
|
|
||||
+ <clock offset='utc'/>
|
|
||||
+ <on_poweroff>destroy</on_poweroff>
|
|
||||
+ <on_reboot>restart</on_reboot>
|
|
||||
+ <on_crash>destroy</on_crash>
|
|
||||
+ <devices>
|
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
|
||||
+ <controller type='usb' index='0' model='none'/>
|
|
||||
+ <controller type='pci' index='0' model='pcie-root'/>
|
|
||||
+ <controller type='pci' index='1' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='252'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='2' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='248'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='3' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='21' port='0x0'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='4' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='22' port='0xa8'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <audio id='1' type='none'/>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x01' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <memballoon model='none'/>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='1' accel='on' ats='on' ril='off' ssidsize='20' oas='44'/>
|
|
||||
+ </iommu>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='2' accel='on' ats='on' ril='off' ssidsize='20' oas='44'/>
|
|
||||
+ </iommu>
|
|
||||
+ </devices>
|
|
||||
+</domain>
|
|
||||
diff --git a/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.xml b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.xml
|
|
||||
new file mode 100644 |
|
||||
index 0000000000..8dbae00540
|
|
||||
--- /dev/null
|
|
||||
+++ b/tests/qemuxmlconfdata/iommu-smmuv3-pci-bus-accel.xml
|
|
||||
@@ -0,0 +1,53 @@
|
|
||||
+<domain type='qemu'>
|
|
||||
+ <name>guest</name>
|
|
||||
+ <uuid>1ccfd97d-5eb4-478a-bbe6-88d254c16db7</uuid>
|
|
||||
+ <memory unit='KiB'>1048576</memory>
|
|
||||
+ <vcpu placement='static'>1</vcpu>
|
|
||||
+ <os>
|
|
||||
+ <type arch='aarch64' machine='virt'>hvm</type>
|
|
||||
+ </os>
|
|
||||
+ <devices>
|
|
||||
+ <emulator>/usr/bin/qemu-system-aarch64</emulator>
|
|
||||
+ <controller type='usb' model='none'/>
|
|
||||
+ <memballoon model='none'/>
|
|
||||
+ <controller type='pci' index='0' model='pcie-root'/>
|
|
||||
+ <controller type='pci' index='1' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='252'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='2' model='pcie-expander-bus'>
|
|
||||
+ <model name='pxb-pcie'/>
|
|
||||
+ <target busNr='248'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='3' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='21' port='0x0'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <controller type='pci' index='4' model='pcie-root-port'>
|
|
||||
+ <model name='pcie-root-port'/>
|
|
||||
+ <target chassis='22' port='0xa8'/>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x02' slot='0x00' function='0x0'/>
|
|
||||
+ </controller>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x03' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <hostdev mode='subsystem' type='pci' managed='no'>
|
|
||||
+ <source>
|
|
||||
+ <address domain='0x0000' bus='0x06' slot='0x01' function='0x0'/>
|
|
||||
+ </source>
|
|
||||
+ <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
|
|
||||
+ </hostdev>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='1' accel='on' ats='on' ril='off' ssidsize='20' oas='44'/>
|
|
||||
+ </iommu>
|
|
||||
+ <iommu model='smmuv3'>
|
|
||||
+ <driver pciBus='2' accel='on' ats='on' ril='off' ssidsize='20' oas='44'/>
|
|
||||
+ </iommu>
|
|
||||
+ </devices>
|
|
||||
+</domain>
|
|
||||
diff --git a/tests/qemuxmlconftest.c b/tests/qemuxmlconftest.c
|
|
||||
index a1389775b9..99925e6241 100644
|
|
||||
--- a/tests/qemuxmlconftest.c
|
|
||||
+++ b/tests/qemuxmlconftest.c
|
|
||||
@@ -2988,6 +2988,8 @@ mymain(void)
|
|
||||
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3", "aarch64"); |
|
||||
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3-pci-bus", "aarch64"); |
|
||||
DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3-pci-bus-single", "aarch64"); |
|
||||
+ DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3-pci-bus-accel", "aarch64");
|
|
||||
+ DO_TEST_CAPS_ARCH_LATEST("iommu-smmuv3-pci-bus-accel-auto", "aarch64");
|
|
||||
DO_TEST_CAPS_LATEST("virtio-iommu-x86_64"); |
|
||||
DO_TEST_CAPS_ARCH_LATEST("virtio-iommu-aarch64", "aarch64"); |
|
||||
DO_TEST_CAPS_LATEST_PARSE_ERROR("virtio-iommu-wrong-machine"); |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,50 +0,0 @@ |
|||||
From 90450dd1485b7c9412492d375d92bb578dc5a7f9 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <90450dd1485b7c9412492d375d92bb578dc5a7f9.1786713643.git.jdenemar@redhat.com> |
|
||||
From: Jim Fehlig <jfehlig@suse.com> |
|
||||
Date: Tue, 4 Aug 2026 11:27:59 -0600 |
|
||||
Subject: [PATCH] tools: virsh: fix crash on error |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
Commit 9899c91515 introduced the potential for a NULL pointer dereference |
|
||||
crash when the 'ctl' parameter to vshPrintStderr() is NULL. Below is an |
|
||||
example backtrace of the crash when attempting to detach a non-existent |
|
||||
disk with 'virsh detach-disk test vdz' |
|
||||
|
|
||||
#0 vshPrintStderr (ctl=0x0, level=4, format=<optimized out>, ap=<optimized out>) at ../tools/vsh.c:2148 |
|
||||
#1 0x00005555555e6b2c in vshError (ctl=ctl@entry=0x0, format=<optimized out>) at ../tools/vsh.c:2170 |
|
||||
#2 0x00005555555afec7 in virshFindDisk |
|
||||
(doc=doc@entry=0x555555696ee0 "<domain type='kvm' id='1'>\n <name>test</name>\n <uuid>9b27a21e-dfa2-4c1e-9d11-2de275aefb03</uuid>\n <metadata>\n <libosinfo:libosinfo xmlns:libosinfo=\"http://libosinfo.org/xmlns/libvirt/domain/1."..., path=0x555555651240 "vdz", type=type@entry=0) at ../tools/virsh-domain.c:13055 |
|
||||
#3 0x00005555555b0151 in cmdDetachDisk (ctl=0x7fffffffdac0, cmd=0x5555556914c0) at ../tools/virsh-domain.c:13231 |
|
||||
#4 0x00005555555e6ddb in vshCommandRun (ctl=ctl@entry=0x7fffffffdac0, cmd=0x5555556914c0) at ../tools/vsh.c:1383 |
|
||||
#5 0x000055555559347a in main (argc=<optimized out>, argv=0x7fffffffdeb8) at ../tools/virsh.c:908 |
|
||||
|
|
||||
Ensure 'ctl' is valid before dereferencing it. |
|
||||
|
|
||||
Fixes: 9899c91515d79595d19800ccc895df18eb7bb3f7 |
|
||||
Signed-off-by: Jim Fehlig <jfehlig@suse.com> |
|
||||
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> |
|
||||
(cherry picked from commit c6560a7223927e1e5fa249572750bc376bba67fa) |
|
||||
|
|
||||
https://redhat.atlassian.net/browse/RHEL-234911 |
|
||||
Signed-off-by: Ján Tomko <jtomko@redhat.com> |
|
||||
---
|
|
||||
tools/vsh.c | 2 +- |
|
||||
1 file changed, 1 insertion(+), 1 deletion(-) |
|
||||
|
|
||||
diff --git a/tools/vsh.c b/tools/vsh.c
|
|
||||
index ccf2f21d64..667cc1a0d2 100644
|
|
||||
--- a/tools/vsh.c
|
|
||||
+++ b/tools/vsh.c
|
|
||||
@@ -2145,7 +2145,7 @@ vshPrintStderr(vshControl *ctl,
|
|
||||
if (ctl) |
|
||||
vshOutputLogFile(ctl, level, str); |
|
||||
|
|
||||
- if (ctl->stderr_closed)
|
|
||||
+ if (ctl && ctl->stderr_closed)
|
|
||||
return; |
|
||||
|
|
||||
/* Most output is to stdout, but if someone ran virsh 2>&1, then |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,71 +0,0 @@ |
|||||
From d8f7346b329f6594eeb32318c37fadde391c19b2 Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <d8f7346b329f6594eeb32318c37fadde391c19b2.1786713644.git.jdenemar@redhat.com> |
|
||||
From: =?UTF-8?q?HE=20WEI=EF=BC=88=E3=82=AE=E3=82=AB=E3=82=AF=EF=BC=89?= |
|
||||
<skyexpoc@gmail.com> |
|
||||
Date: Tue, 28 Jul 2026 17:49:02 +0100 |
|
||||
Subject: [PATCH] util: virFileChownFiles: do not follow symlinks |
|
||||
MIME-Version: 1.0 |
|
||||
Content-Type: text/plain; charset=UTF-8 |
|
||||
Content-Transfer-Encoding: 8bit |
|
||||
|
|
||||
virFileChownFiles() selected entries with virFileIsRegular() (stat(), follows |
|
||||
symlinks) and changed ownership with chown() (follows symlinks). A component |
|
||||
that owns the target directory at a lower privilege (e.g. the swtpm/tss state |
|
||||
directory) can plant a symlink to an arbitrary regular file and have the root |
|
||||
caller chown that file. Use lstat() to skip non-regular entries and |
|
||||
fchownat(..., AT_SYMLINK_NOFOLLOW) so a symlink final component is never |
|
||||
followed. |
|
||||
|
|
||||
Fixes: CVE-2026-63622 |
|
||||
Signed-off-by: HE WEI(ギカク) <skyexpoc@gmail.com> |
|
||||
[DB: use g_lstat instead of stat; use lchown instead of |
|
||||
fchownat for portability; added comment] |
|
||||
Reviewed-by: Ján Tomko <jtomko@redhat.com> |
|
||||
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> |
|
||||
(cherry picked from commit 801160fd414ca2cc402bc01ead09b7ed4c3b8f5b) |
|
||||
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> |
|
||||
---
|
|
||||
src/util/virfile.c | 16 ++++++++++++++-- |
|
||||
1 file changed, 14 insertions(+), 2 deletions(-) |
|
||||
|
|
||||
diff --git a/src/util/virfile.c b/src/util/virfile.c
|
|
||||
index a0c6cb8048..c9d838eeeb 100644
|
|
||||
--- a/src/util/virfile.c
|
|
||||
+++ b/src/util/virfile.c
|
|
||||
@@ -3306,6 +3306,12 @@ int virDirIsEmpty(const char *path,
|
|
||||
* |
|
||||
* Change ownership of all regular files in a directory. |
|
||||
* |
|
||||
+ * This will NOT follow any symlinks, to avoid security risks.
|
|
||||
+ * It is assumed the process using content under @name will
|
|
||||
+ * be unprivileged, thus less trusted than libvirt. If it is
|
|
||||
+ * compromised it might attempt to create symlinks in @name to
|
|
||||
+ * escalate privileges on a subsequent call to virFileChownFiles.
|
|
||||
+ *
|
|
||||
* Returns -1 on error, with error already reported, 0 on success. |
|
||||
*/ |
|
||||
#ifndef WIN32 |
|
||||
@@ -3322,13 +3328,19 @@ int virFileChownFiles(const char *name,
|
|
||||
|
|
||||
while ((direrr = virDirRead(dir, &ent, name)) > 0) { |
|
||||
g_autofree char *path = NULL; |
|
||||
+ struct stat sb;
|
|
||||
|
|
||||
path = g_build_filename(name, ent->d_name, NULL); |
|
||||
|
|
||||
- if (!virFileIsRegular(path))
|
|
||||
+ if (g_lstat(path, &sb) < 0) {
|
|
||||
+ virReportSystemError(errno, _("cannot stat '%1$s'"), path);
|
|
||||
+ return -1;
|
|
||||
+ }
|
|
||||
+
|
|
||||
+ if (!S_ISREG(sb.st_mode))
|
|
||||
continue; |
|
||||
|
|
||||
- if (chown(path, uid, gid) < 0) {
|
|
||||
+ if (lchown(path, uid, gid) < 0) {
|
|
||||
virReportSystemError(errno, |
|
||||
_("cannot chown '%1$s' to (%2$u, %3$u)"), |
|
||||
ent->d_name, (unsigned int) uid, |
|
||||
--
|
|
||||
2.55.0 |
|
||||
@ -1,88 +0,0 @@ |
|||||
From 3f0bb5923811b9f04929a2c0c2debc046ef57a5a Mon Sep 17 00:00:00 2001 |
|
||||
Message-ID: <3f0bb5923811b9f04929a2c0c2debc046ef57a5a.1787144197.git.jdenemar@redhat.com> |
|
||||
From: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Date: Wed, 12 Aug 2026 15:11:20 +0200 |
|
||||
Subject: [PATCH] virsh: Add support for VIR_DOMAIN_GUEST_INFO_DEVICES |
|
||||
|
|
||||
The virDomainGetGuestInfo() API is exposed as 'guestinfo' |
|
||||
command. Introduce new --devices option for it to reflect |
|
||||
introduction of VIR_DOMAIN_GUEST_INFO_DEVICES type. |
|
||||
|
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
Reviewed-by: Peter Krempa <pkrempa@redhat.com> |
|
||||
(cherry picked from commit a634a99a07cf510658939164b6982297789025b8) |
|
||||
Resolves: https://redhat.atlassian.net/browse/RHEL-235731 |
|
||||
Signed-off-by: Michal Privoznik <mprivozn@redhat.com> |
|
||||
---
|
|
||||
docs/manpages/virsh.rst | 17 +++++++++++++---- |
|
||||
tools/virsh-domain.c | 6 ++++++ |
|
||||
2 files changed, 19 insertions(+), 4 deletions(-) |
|
||||
|
|
||||
diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst
|
|
||||
index a10d29e0ea..e9f4a6f851 100644
|
|
||||
--- a/docs/manpages/virsh.rst
|
|
||||
+++ b/docs/manpages/virsh.rst
|
|
||||
@@ -3277,7 +3277,7 @@ guestinfo
|
|
||||
:: |
|
||||
|
|
||||
guestinfo domain [--user] [--os] [--timezone] [--hostname] [--filesystem] |
|
||||
- [--disk] [--interface]
|
|
||||
+ [--disk] [--interface] [--devices]
|
|
||||
|
|
||||
Print information about the guest from the point of view of the guest agent. |
|
||||
Note that this command requires a guest agent to be configured and running in |
|
||||
@@ -3289,9 +3289,9 @@ Success is always reported in this case.
|
|
||||
|
|
||||
You can limit the types of information that are returned by specifying one or |
|
||||
more flags. Available information types flags are *--user*, *--os*, |
|
||||
-*--timezone*, *--hostname*, *--filesystem*, *--disk*, *--interface* and *--load*.
|
|
||||
-If an explicitly requested information type is not supported by the guest agent
|
|
||||
-at that point, the processes will provide an exit code of 1.
|
|
||||
+*--timezone*, *--hostname*, *--filesystem*, *--disk*, *--interface*, *--load*
|
|
||||
+and *--devices*. If an explicitly requested information type is not supported
|
|
||||
+by the guest agent at that point, the processes will provide an exit code of 1.
|
|
||||
|
|
||||
Note that depending on the hypervisor type and the version of the guest agent |
|
||||
running within the domain, not all of the following information may be |
|
||||
@@ -3374,6 +3374,15 @@ returned:
|
|
||||
* ``load.5m`` - average load in guest for last 5 minutes |
|
||||
* ``load.15m`` - average load in guest for last 15 minutes |
|
||||
|
|
||||
+*--devices* returns:
|
|
||||
+* ``device.count`` - the number of devices that info is returned for
|
|
||||
+* ``device.<num>.driverName`` - name of the driver associated with device
|
|
||||
+* ``device.<num>.driverDate`` - driver release date in seconds since the epoch
|
|
||||
+* ``device.<num>.driverVersion`` - version of the driver associated with the device
|
|
||||
+* ``device.<num>.idType`` - device identification type (e.g. pci)
|
|
||||
+* ``device.<num>.pciVendor`` - vendor ID for PCI device (in decimal)
|
|
||||
+* ``device.<num>.pciDevice`` - device ID for PCI device (in decimal)
|
|
||||
+
|
|
||||
|
|
||||
guestvcpus |
|
||||
---------- |
|
||||
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
|
|
||||
index 0f177fb69a..563f69c939 100644
|
|
||||
--- a/tools/virsh-domain.c
|
|
||||
+++ b/tools/virsh-domain.c
|
|
||||
@@ -13749,6 +13749,10 @@ static const vshCmdOptDef opts_guestinfo[] = {
|
|
||||
.type = VSH_OT_BOOL, |
|
||||
.help = N_("report load averages information"), |
|
||||
}, |
|
||||
+ {.name = "devices",
|
|
||||
+ .type = VSH_OT_BOOL,
|
|
||||
+ .help = N_("report devices information"),
|
|
||||
+ },
|
|
||||
{.name = NULL} |
|
||||
}; |
|
||||
|
|
||||
@@ -13778,6 +13782,8 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd)
|
|
||||
types |= VIR_DOMAIN_GUEST_INFO_INTERFACES; |
|
||||
if (vshCommandOptBool(cmd, "load")) |
|
||||
types |= VIR_DOMAIN_GUEST_INFO_LOAD; |
|
||||
+ if (vshCommandOptBool(cmd, "devices"))
|
|
||||
+ types |= VIR_DOMAIN_GUEST_INFO_DEVICES;
|
|
||||
|
|
||||
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL))) |
|
||||
return false; |
|
||||
--
|
|
||||
2.55.0 |
|
||||
Loading…
Reference in new issue