• D
    conf: pass in default architecture via domain XML options · 6430c005
    Daniel P. Berrangé 提交于
    When parsing the guest XML we must fill in the default guest arch if it
    is not already present because later parts of the parsing process need
    this information.
    
    If no arch is specified we lookup the first guest in the capabilities
    data matching the os type and virt type. In most cases this will result
    in picking the host architecture but there are some exceptions...
    
     - The test driver is hardcoded to always use i686 arch
     - The VMWare/ESX drivers will always place i686 guests ahead
       of x86_64 guests in capabilities, so effectively they always
       use i686
     - The QEMU driver can potentially return any arch at all
       depending on what combination of QEMU binaries are installed.
    
    The domain XML hardware configurations are inherently architecture
    specific in many places. As a result whomever/whatever created the
    domain XML will have had a particular architecture in mind when
    specifying the config. In pretty much any sensible case this arch
    will have been the native host architecture. i686 on x86_64 is
    the only sensible divergance because both these archs are
    compatible from a domaain XML config POV.
    
    IOW, although the QEMU driver can pick an almost arbitrary arch as its
    default, in the real world no application or user is likely to be
    relying on this default arch being anything other than native.
    
    With all this in mind, it is reasonable to change the XML parser to
    allow the default architecture to be passed via the domain XML options
    struct. If no info is explicitly given then it is safe & sane to pick
    the host native architecture as the default for the guest.
    Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
    Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
    6430c005
test_driver.c 277.0 KB