goto cleanup;
}
- if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) {
- if (!(capsdata = virCapabilitiesDomainDataLookup(caps,
- def->os.type, def->os.arch, def->virtType,
- NULL, NULL)))
+ if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type,
+ def->os.arch,
+ def->virtType,
+ NULL, NULL))) {
+ if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS))
goto cleanup;
-
+ virResetLastError();
+ } else {
if (!def->os.arch)
def->os.arch = capsdata->arch;
if ((!def->os.machine &&
- VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0)) {
+ VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0))
goto cleanup;
- }
}
ret = 0;
<currentMemory unit='KiB'>219100</currentMemory>
<vcpu placement='static' cpuset='1'>1</vcpu>
<os>
- <type arch='i686'>hvm</type>
+ <type arch='alpha'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
QEMU_CAPS_OBJECT_GPEX,
QEMU_CAPS_NEC_USB_XHCI);
+ /* VM XML has invalid arch/ostype/virttype combo, but the SKIP flag
+ * will avoid the error. Still, we expect qemu driver to complain about
+ * missing machine error, and not crash */
DO_TEST_PARSE_FLAGS_ERROR("missing-machine",
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS,
NONE);