]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
src: use singular form instead of plural, for guest disk info
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 2 Dec 2020 12:08:14 +0000 (12:08 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 3 Dec 2020 13:10:29 +0000 (13:10 +0000)
Existing practice with the filesystem fields reported for the
virDomainGetGuestInfo API is to use the singular form for
field names. Ensure the disk info follows this practice.

Fixes

  commit 05a75ca2ce743bc0bb119fb8d532ff84646fafa3
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   Fri Nov 20 22:09:46 2020 +0400

    domain: add disk informations to virDomainGetGuestInfo

  commit 0cb2d9f05d00497a715352f6ea28cf8fb6921731
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   Fri Nov 20 22:09:47 2020 +0400

    qemu_driver: report guest disk informations

  commit 172b8304352b1945e328394e61290a24446280dd
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   Fri Nov 20 22:09:48 2020 +0400

    virsh: add --disk informations to guestinfo command

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
docs/manpages/virsh.rst
src/libvirt-domain.c
src/qemu/qemu_driver.c
tools/virsh-domain.c

index 9ef6b68422487fbb363a49de40c30df7fcea0dc5..aa54bc21ef61044b2a64911ece56f85ecc8cbd7e 100644 (file)
@@ -2679,7 +2679,7 @@ guestinfo
 ::
 
    guestinfo domain [--user] [--os] [--timezone] [--hostname] [--filesystem]
-      [--disks]
+      [--disk]
 
 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
@@ -2690,7 +2690,7 @@ are supported by the guest agent. You can limit the types of information that
 are returned by specifying one or more flags.  If a requested information
 type is not supported, the processes will provide an exit code of 1.
 Available information types flags are *--user*, *--os*,
-*--timezone*, *--hostname*, *--filesystem* and *--disks*.
+*--timezone*, *--hostname*, *--filesystem* and *--disk*.
 
 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
@@ -2747,15 +2747,15 @@ returned:
 * ``fs.<num>.disk.<num>.serial`` - the serial number of disk <num>
 * ``fs.<num>.disk.<num>.device`` - the device node of disk <num>
 
-*--disks* returns:
+*--disk* returns:
 
-* ``disks.count`` - the number of disks defined on this domain
-* ``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
-* ``disks.<num>.dependencies.<num>.name`` - a dependency name
-* ``disks.<num>.alias`` - the device alias of the disk (e.g. sda)
-* ``disks.<num>.guest_alias`` - optional alias assigned to the disk
+* ``disk.count`` - the number of disks defined on this domain
+* ``disk.<num>.name`` - device node (Linux) or device UNC (Windows)
+* ``disk.<num>.partition`` - whether this is a partition or disk
+* ``disk.<num>.dependency.count`` - the number of device dependencies
+* ``disk.<num>.dependency.<num>.name`` - a dependency name
+* ``disk.<num>.alias`` - the device alias of the disk (e.g. sda)
+* ``disk.<num>.guest_alias`` - optional alias assigned to the disk
 
 
 guestvcpus
index 35e95e5395ef6a93eb41f8f578c490b4e9bd9c60..f5cd43ecea3184e9a20eb052782c703ca93ee014 100644 (file)
@@ -12345,17 +12345,17 @@ virDomainSetVcpu(virDomainPtr domain,
  *  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
+ *      "disk.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
+ *      "disk.<num>.name" - device node (Linux) or device UNC (Windows)
+ *      "disk.<num>.partition" - whether this is a partition or disk
+ *      "disk.<num>.dependency.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
+ *      "disk.<num>.dependency.<num>.name" - a dependency
+ *      "disk.<num>.alias" - the device alias of the disk (e.g. sda)
+ *      "disk.<num>.guest_alias" - optional alias assigned to the disk, on Linux
  *                      this is a name assigned by device mapper
  *
  * VIR_DOMAIN_GUEST_INFO_HOSTNAME:
index bca1c84630ea61236bbfa035e73ea128b5e0b4d8..ae15d177f2aa5cb5bb52b0bf16e2f05b136cac78 100644 (file)
@@ -19876,20 +19876,20 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info,
     size_t i, j, ndeps;
 
     if (virTypedParamsAddUInt(params, nparams, maxparams,
-                              "disks.count", ndisks) < 0)
+                              "disk.count", ndisks) < 0)
         return;
 
     for (i = 0; i < ndisks; i++) {
         char param_name[VIR_TYPED_PARAM_FIELD_LENGTH];
 
         g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
-                   "disks.%zu.name", i);
+                   "disk.%zu.name", i);
         if (virTypedParamsAddString(params, nparams, maxparams,
                                     param_name, info[i]->name) < 0)
             return;
 
         g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
-                   "disks.%zu.partition", i);
+                   "disk.%zu.partition", i);
         if (virTypedParamsAddBoolean(params, nparams, maxparams,
                                      param_name, info[i]->partition) < 0)
             return;
@@ -19897,14 +19897,14 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info,
         if (info[i]->dependencies) {
             ndeps = g_strv_length(info[i]->dependencies);
             g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
-                       "disks.%zu.dependencies.count", i);
+                       "disk.%zu.dependency.count", i);
             if (ndeps &&
                 virTypedParamsAddUInt(params, nparams, maxparams,
                                       param_name, ndeps) < 0)
                 return;
             for (j = 0; j < ndeps; j++) {
                 g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
-                           "disks.%zu.dependencies.%zu.name", i, j);
+                           "disk.%zu.dependency.%zu.name", i, j);
                 if (virTypedParamsAddString(params, nparams, maxparams,
                                             param_name, info[i]->dependencies[j]) < 0)
                     return;
@@ -19922,7 +19922,7 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info,
                                              info[i]->address->unit);
             if (diskdef) {
                 g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
-                           "disks.%zu.alias", i);
+                           "disk.%zu.alias", i);
                 if (diskdef->dst &&
                     virTypedParamsAddString(params, nparams, maxparams,
                                             param_name, diskdef->dst) < 0)
@@ -19932,7 +19932,7 @@ qemuAgentDiskInfoFormatParams(qemuAgentDiskInfoPtr *info,
 
         if (info[i]->alias) {
             g_snprintf(param_name, VIR_TYPED_PARAM_FIELD_LENGTH,
-                       "disks.%zu.guest_alias", i);
+                       "disk.%zu.guest_alias", i);
             if (virTypedParamsAddString(params, nparams, maxparams,
                                         param_name, info[i]->alias) < 0)
                 return;
index 51a9fd90d1b4e58d4befff7a82ddde4ce7959bed..1fb4189b4b25efebe68c47543251154a3df3cb74 100644 (file)
@@ -14209,9 +14209,9 @@ static const vshCmdOptDef opts_guestinfo[] = {
      .type = VSH_OT_BOOL,
      .help = N_("report filesystem information"),
     },
-    {.name = "disks",
+    {.name = "disk",
      .type = VSH_OT_BOOL,
-     .help = N_("report disks information"),
+     .help = N_("report disk information"),
     },
     {.name = NULL}
 };
@@ -14236,7 +14236,7 @@ cmdGuestInfo(vshControl *ctl, const vshCmd *cmd)
         types |= VIR_DOMAIN_GUEST_INFO_HOSTNAME;
     if (vshCommandOptBool(cmd, "filesystem"))
         types |= VIR_DOMAIN_GUEST_INFO_FILESYSTEM;
-    if (vshCommandOptBool(cmd, "disks"))
+    if (vshCommandOptBool(cmd, "disk"))
         types |= VIR_DOMAIN_GUEST_INFO_DISKS;
 
     if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))