[libvirt] [PATCH v3 4/9] virsh: Add 'iothreads' command

Ján Tomko jtomko at redhat.com
Wed Mar 4 17:48:11 UTC 2015


On Tue, Feb 17, 2015 at 04:03:53PM -0500, John Ferlan wrote:
> Add the 'iothreads' command to display IOThread Info data. Allow for
> [--live] or [--config] options in order to display live or config data
> for an active domain.
> 
> An active domain may return:
> 
> $ virsh iothreads $dom
>  IOThread ID     CPU Affinity    Resource(s)
>  -----------------------------------------------------------------
>   1               2              /home/vm-images/f18
>   2               3              /home/vm-images/iothr-vol1
>   3               0
> 
> $ echo $?
> 0
> 
> For domains which don't have IOThreads the following is returned:
> 
> $ virsh iothreads $dom
> error: No IOThreads found for the domain
> 
> $ echo $?
> 0

Printing an error, but not returning one seems strange. Do we do this
somewhere else too?

> +
> +    vshPrintExtra(ctl, " %-15s %-15s %-15s\n",
> +                  _("IOThread ID"), _("CPU Affinity"), _("Resource(s)"));
> +    vshPrintExtra(ctl, "-----------------------------------------------------------------\n");
> +    for (i = 0; i < niothreads; i++) {
> +
> +        vshPrintExtra(ctl, " %-15u ", info[i]->iothread_id);

vshPrint should be used for the actual data, to make the command work
with --quiet.

> +        ignore_value(vshPrintPinInfo(info[i]->cpumap, info[i]->cpumaplen,
> +                                     maxcpu, 0));
> +        for (j = 0; j < info[i]->nresources; j++) {
> +            if (j == 0)
> +                vshPrintExtra(ctl, "\t\t %s", info[i]->resources[j]);
> +            else
> +                vshPrintExtra(ctl, "\n %-15s %s\t\t %s",
> +                              " ", " ", info[i]->resources[j]);
> +        }

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150304/beca748b/attachment-0001.sig>


More information about the libvir-list mailing list