]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
domain: add disk informations to virDomainGetGuestInfo
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 20 Nov 2020 18:09:46 +0000 (22:09 +0400)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 1 Dec 2020 10:23:46 +0000 (11:23 +0100)
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Han Han <hhan@redhat.com>
include/libvirt/libvirt-domain.h
src/libvirt-domain.c

index b929877643254055af2043126f49c021133a8f5e..de2456812c82dd9ab41cc26757ff0be2104d8b28 100644 (file)
@@ -5070,6 +5070,7 @@ typedef enum {
     VIR_DOMAIN_GUEST_INFO_TIMEZONE = (1 << 2), /* return timezone information */
     VIR_DOMAIN_GUEST_INFO_HOSTNAME = (1 << 3), /* return hostname information */
     VIR_DOMAIN_GUEST_INFO_FILESYSTEM = (1 << 4), /* return filesystem information */
+    VIR_DOMAIN_GUEST_INFO_DISKS = (1 << 5), /* return disks information */
 } virDomainGuestInfoTypes;
 
 int virDomainGetGuestInfo(virDomainPtr domain,
index 0d0041f983886dc428af50c74c7b1052bb50fe46..35e95e5395ef6a93eb41f8f578c490b4e9bd9c60 100644 (file)
@@ -12341,6 +12341,23 @@ virDomainSetVcpu(virDomainPtr domain,
  *      "fs.<num>.disk.<num>.serial" - the serial number of the disk
  *      "fs.<num>.disk.<num>.device" - the device node of the disk
  *
+ * VIR_DOMAIN_GUEST_INFO_DISKS:
+ *  Returns information about the disks within the domain.  The typed
+ *  parameter keys are in this format:
+ *
+ *      "disks.count" - the number of disks defined on this domain
+ *                      as an unsigned int
+ *      "disks.<num>.name" - device node (Linux) or device UNC (Windows)
+ *      "disks.<num>.partition" - whether this is a partition or disk
+ *      "disks.<num>.dependencies.count" - the number of device dependencies
+ *                      e.g. for LVs of the LVM this will
+ *                      hold the list of PVs, for LUKS encrypted volume this will
+ *                      contain the disk where the volume is placed. (Linux)
+ *      "disks.<num>.dependencies.<num>.name" - a dependency
+ *      "disks.<num>.alias" - the device alias of the disk (e.g. sda)
+ *      "disks.<num>.guest_alias" - optional alias assigned to the disk, on Linux
+ *                      this is a name assigned by device mapper
+ *
  * VIR_DOMAIN_GUEST_INFO_HOSTNAME:
  *  Returns information about the hostname of the domain. The typed
  *  parameter keys are in this format: