[libvirt] [PATCH] cpu: Add support for CPU vendor

Daniel P. Berrange berrange at redhat.com
Mon Jul 19 19:12:23 UTC 2010


On Mon, Jul 19, 2010 at 09:58:35PM +0300, Dan Kenigsberg wrote:
> On Mon, Jul 19, 2010 at 02:40:40PM +0200, Jiri Denemark wrote:
> > > > By specifying <vendor> element in CPU requirements a guest can be
> > > > restricted to run only on CPUs by a given vendor. Host CPU vendor is
> > > > also specified in capabilities XML.
> > > > 
> > > > The vendor is checked when migrating a guest but it's not forced, i.e.,
> > > > a guest configured without <vendor> element can be freely migrated.
> > ...
> > > >  src/cpu/cpu_map.xml         |    6 +
> > > 
> > > Why did you add <vendor> tags to several of the models there? Does qemu
> > > (-no-kvm) have any problem emulating athlon on an Intel host?
> > 
> > Honestly, I don't know if qemu has any problems emulating them but it doesn't
> > really matter. The <vendor> emelement in cpu_map.xml is used when libvirt
> > decides what model should be used for describing host CPU.
> > 
> > > And how about adding policy='disable' attribute, so that I can ask
> > > virConnectCompareCPU to ignore this particular incompatibility, as I do
> > > with <feature> items?
> > 
> > Just don't use <vendor> tag in your XML.
> > 
> > In other words, if you specify <vendor> in domain XML (or it's cpu fragment
> > used by virConnectCompareCPU) and your host CPU is made by different vendor,
> > the CPUs won't match. If you don't specify <vendor>, you don't care about the
> > vendor and neither does libvirt.
> > 
> > I hope it's more clear now.
> 
> I wanted to (ab)use virConnectCompareCPU to roughly tell a certain cpu
> model (say athlon) can be emulated on my host. I now see that this is not
> going to happen, and I'll have to do my own feature set comparison.

I don't see the problem in virConnectCompareCPU() that prevents you using
it for that ? Checking whether a certain cpu model can be emulated on a
host is exactly what's virConnectCompareCPU is design todo. We explicitly
did not want apps to need to do a manual feature set comparison because
that's just horrible code to get right.

Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|




More information about the libvir-list mailing list