]> xenbits.xensource.com Git - libvirt.git/commit
Take domain type into account when looking up default machine
authorMark McLoughlin <markmc@redhat.com>
Mon, 12 Oct 2009 09:52:13 +0000 (10:52 +0100)
committerMark McLoughlin <markmc@redhat.com>
Mon, 12 Oct 2009 09:57:35 +0000 (10:57 +0100)
commit73c901a8075c09203545fc81164c1e5f11c67c89
tree299bc7043f7ce3712c0e42e05cc6d8022fe37587
parent33948c6844792e7132d8bdd4bde57cd640bacf2f
Take domain type into account when looking up default machine

If one has e.g.

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-0.11</machine>
      <machine canonical='pc-0.11'>pc</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/kvm</emulator>
        <machine>pc</machine>
        <machine>isapc</machine>
      </domain>
    </arch>
  </guest>

and start a guest with:

  <domain type='kvm'>
    ...
    <os>
      <type arch='x86_64'>hvm</type>
      ...
    </os>
  </domain>

then the default machine type should be 'pc' and not 'pc-0.11'

Issue was reported by Anton Protopopov.

* src/capabilities.[ch]: pass the domain type to
  virCapabilitiesDefaultGuestArch() and use it to look up the default
  machine type from a specific guest domain if needed.

* src/conf/domain_conf.c, src/xen/xm_internal.c: update

* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml: update
  the domain type to 'kvm' and remove the machine type to check
  that the default gets looked up correctly
src/conf/capabilities.c
src/conf/capabilities.h
src/conf/domain_conf.c
src/xen/xm_internal.c
tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml