diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 9ef6b68422..aa54bc21ef 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -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..disk..serial`` - the serial number of disk * ``fs..disk..device`` - the device node of disk -*--disks* returns: +*--disk* returns: -* ``disks.count`` - the number of disks defined on this domain -* ``disks..name`` - device node (Linux) or device UNC (Windows) -* ``disks..partition`` - whether this is a partition or disk -* ``disks..dependencies.count`` - the number of device dependencies -* ``disks..dependencies..name`` - a dependency name -* ``disks..alias`` - the device alias of the disk (e.g. sda) -* ``disks..guest_alias`` - optional alias assigned to the disk +* ``disk.count`` - the number of disks defined on this domain +* ``disk..name`` - device node (Linux) or device UNC (Windows) +* ``disk..partition`` - whether this is a partition or disk +* ``disk..dependency.count`` - the number of device dependencies +* ``disk..dependency..name`` - a dependency name +* ``disk..alias`` - the device alias of the disk (e.g. sda) +* ``disk..guest_alias`` - optional alias assigned to the disk guestvcpus diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c index 35e95e5395..f5cd43ecea 100644 --- a/src/libvirt-domain.c +++ b/src/libvirt-domain.c @@ -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..name" - device node (Linux) or device UNC (Windows) - * "disks..partition" - whether this is a partition or disk - * "disks..dependencies.count" - the number of device dependencies + * "disk..name" - device node (Linux) or device UNC (Windows) + * "disk..partition" - whether this is a partition or disk + * "disk..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..dependencies..name" - a dependency - * "disks..alias" - the device alias of the disk (e.g. sda) - * "disks..guest_alias" - optional alias assigned to the disk, on Linux + * "disk..dependency..name" - a dependency + * "disk..alias" - the device alias of the disk (e.g. sda) + * "disk..guest_alias" - optional alias assigned to the disk, on Linux * this is a name assigned by device mapper * * VIR_DOMAIN_GUEST_INFO_HOSTNAME: diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index bca1c84630..ae15d177f2 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -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; diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 51a9fd90d1..1fb4189b4b 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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)))