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

John Ferlan jferlan at redhat.com
Thu Mar 5 12:57:50 UTC 2015



On 03/04/2015 12:48 PM, Ján Tomko wrote:
> 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?
> 

Hmm..  Cannot remember my reference on this... Searched on "No " in
virsh-domain.c and found "No current block job"..

I could change to using vshPrintExtra for the same text if that seems
better.

>> +
>> +    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.
> 

Over aggressive with copy-n-paste...

tks,

John
>> +        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
> 




More information about the libvir-list mailing list