Re: [PATCH 6/7] Introduce qemuDomainMachineIsVirt

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

 



On Tue, 2016-05-03 at 13:05 +0200, Peter Krempa wrote:
> > +bool
> > +qemuDomainMachineIsVirt(const virDomainDef *def)
> > +{
> > +    return STREQ(def->os.machine, "virt") ||
> > +           STRPREFIX(def->os.machine, "virt-");
> 
> This could be transcribed as:
> strcmp(def->os.machine, "virt") ||
> strncmp(def->os.machine, "virt-", strlen("virt-")) so
> "STRPREFIX(def->os.machine, "virt")" should be equivalent.

I think we want to make sure we only accept "virt" and
its versioned variants here - if QEMU introuced a new
machine type called "virtpc" we wouldn't want it to
pass the test.

(Then again, "virt-pc" would pass in any case. I think
 the current check strikes a good balance, YMMV.)

-- 
Andrea Bolognani
Software Engineer - Virtualization Team

--
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]