Re: [PATCH 17/41] cpu: Special case models == NULL in cpuGetModels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 29, 2016 at 17:59:21 -0400, John Ferlan wrote:
...
> > @@ -1127,9 +1127,13 @@ cmdCPUModelNames(vshControl *ctl, const vshCmd *cmd)
> >          return false;
> >      }
> >  
> > -    for (i = 0; i < nmodels; i++) {
> > -        vshPrint(ctl, "%s\n", models[i]);
> > -        VIR_FREE(models[i]);
> > +    if (nmodels == 0) {
> > +        vshPrint(ctl, "%s\n", _("all CPU models are accepted"));
> > +    } else {
> > +        for (i = 0; i < nmodels; i++) {
> > +            vshPrint(ctl, "%s\n", models[i]);
> > +            VIR_FREE(models[i]);
> > +        }
> 
> I seem to recall some recent work around the -q[uiet] switch - is that
> something that this code needs to be concerned with?  (as silly as that
> seems while I'm typing it!)

Not silly at all. I replaced vshPrint with vshPrintExtra.

Jirka

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]