• M
    Take domain type into account when looking up default machine · 73c901a8
    Mark McLoughlin 提交于
    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
    73c901a8
capabilities.c 23.3 KB