- qemu: Always assume support for 'QEMU_CAPS_SET_ACTION' (RHEL-242545) - qemu: Remove unused 'qemuProcessRebootAllowed' (RHEL-242545) - qemu: monitor: Remove support for 'watchdog-set-action' (RHEL-242545) - qemu: Remove 'allowReboot' field (RHEL-242545) - qemu: capabilities: Retire QEMU_CAPS_SET_ACTION (RHEL-242545) - qemuProcessSetupLifecycleActions: Prepare to handle other actions (RHEL-242545) - qemuDomainModifyLifecycleActionLive: Prepare to handle other actions (RHEL-242545) - processGuestPanicEvent: Don't pass panic action via parameter (RHEL-242545) - conf: Use proper enum types for 'onReboot', 'onPoweroff', 'onCrash', and 'onLockFailure' (RHEL-242545) - qemuMonitorGuestPanicEventInfoFormatMsg: Directly return message (RHEL-242545) - qemuProcessGuestPanicEventInfo: Fold into only caller (RHEL-242545) - qemu: processGuestPanicEvent: Split individual steps under separate conditions (RHEL-242545) - Add support for keeping VM running when panic notifier is used (RHEL-242545) - qemu: Fix proper ordering of 'virtlockd' shutdown (RHEL-185108) - qemu: move qemuAgent*InfoFormatParams to hypervisor/qemu_agent.c (RHEL-235731) - Add guest device info to virDomainGetGuestInfo (RHEL-235731) - qemu_agent: Introduce guest-get-devices (RHEL-235731) - qemuagenttest: Introduce GetGuestDeviceInfo test case (RHEL-235731) - qemu: Implement device info for virDomainGetGuestInfo() API (RHEL-235731) - virsh: Add support for VIR_DOMAIN_GUEST_INFO_DEVICES (RHEL-235731) Resolves: RHEL-185108, RHEL-235731, RHEL-242545
89 lines
3.7 KiB
Diff
89 lines
3.7 KiB
Diff
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
|