virsh: Honour -q in domblklist, vcpupin and emulatorpin

If user wants to grep some info from domain, e.g. disk paths:

    # virsh -q domblklist win7 | awk '{print $2}'
    Source

    /var/lib/libvirt/images/windows.qcow2
    /home/zippy/work/tmp/en_windows_7_professional_x64_dvd_X15-65805.iso

while with my change:

    # virsh -q domblklist win7 | awk '{print $2}'
    /var/lib/libvirt/images/windows.qcow2
    /home/zippy/work/tmp/en_windows_7_professional_x64_dvd_X15-65805.iso

We don't print table header in other commands, like list.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2014-02-26 11:54:25 +01:00
parent dea81f40ec
commit e53b06246c
2 changed files with 12 additions and 12 deletions

View File

@ -495,12 +495,12 @@ cmdDomblklist(vshControl *ctl, const vshCmd *cmd)
goto cleanup; goto cleanup;
if (details) if (details)
vshPrint(ctl, "%-10s %-10s %-10s %s\n", _("Type"), vshPrintExtra(ctl, "%-10s %-10s %-10s %s\n", _("Type"),
_("Device"), _("Target"), _("Source")); _("Device"), _("Target"), _("Source"));
else else
vshPrint(ctl, "%-10s %s\n", _("Target"), _("Source")); vshPrintExtra(ctl, "%-10s %s\n", _("Target"), _("Source"));
vshPrint(ctl, "------------------------------------------------\n"); vshPrintExtra(ctl, "------------------------------------------------\n");
for (i = 0; i < ndisks; i++) { for (i = 0; i < ndisks; i++) {
char *type = NULL; char *type = NULL;
@ -609,9 +609,9 @@ cmdDomiflist(vshControl *ctl, const vshCmd *cmd)
if (ninterfaces < 0) if (ninterfaces < 0)
goto cleanup; goto cleanup;
vshPrint(ctl, "%-10s %-10s %-10s %-11s %s\n", _("Interface"), _("Type"), vshPrintExtra(ctl, "%-10s %-10s %-10s %-11s %s\n", _("Interface"),
_("Source"), _("Model"), _("MAC")); _("Type"), _("Source"), _("Model"), _("MAC"));
vshPrint(ctl, "-------------------------------------------------------\n"); vshPrintExtra(ctl, "-------------------------------------------------------\n");
for (i = 0; i < ninterfaces; i++) { for (i = 0; i < ninterfaces; i++) {
char *type = NULL; char *type = NULL;

View File

@ -5815,8 +5815,8 @@ cmdVcpuPin(vshControl *ctl, const vshCmd *cmd)
if ((ncpus = virDomainGetVcpuPinInfo(dom, info.nrVirtCpu, if ((ncpus = virDomainGetVcpuPinInfo(dom, info.nrVirtCpu,
cpumaps, cpumaplen, flags)) >= 0) { cpumaps, cpumaplen, flags)) >= 0) {
vshPrint(ctl, "%s %s\n", _("VCPU:"), _("CPU Affinity")); vshPrintExtra(ctl, "%s %s\n", _("VCPU:"), _("CPU Affinity"));
vshPrint(ctl, "----------------------------------\n"); vshPrintExtra(ctl, "----------------------------------\n");
for (i = 0; i < ncpus; i++) { for (i = 0; i < ncpus; i++) {
if (vcpu != -1 && i != vcpu) if (vcpu != -1 && i != vcpu)
continue; continue;
@ -5944,9 +5944,9 @@ cmdEmulatorPin(vshControl *ctl, const vshCmd *cmd)
cpumaps = vshMalloc(ctl, cpumaplen); cpumaps = vshMalloc(ctl, cpumaplen);
if (virDomainGetEmulatorPinInfo(dom, cpumaps, if (virDomainGetEmulatorPinInfo(dom, cpumaps,
cpumaplen, flags) >= 0) { cpumaplen, flags) >= 0) {
vshPrint(ctl, "%s %s\n", _("emulator:"), _("CPU Affinity")); vshPrintExtra(ctl, "%s %s\n", _("emulator:"), _("CPU Affinity"));
vshPrint(ctl, "----------------------------------\n"); vshPrintExtra(ctl, "----------------------------------\n");
vshPrint(ctl, " *: "); vshPrintExtra(ctl, " *: ");
ret = vshPrintPinInfo(cpumaps, cpumaplen, maxcpu, 0); ret = vshPrintPinInfo(cpumaps, cpumaplen, maxcpu, 0);
vshPrint(ctl, "\n"); vshPrint(ctl, "\n");
} }