mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-26 13:22:20 +00:00
conf: Sync caps data even when SKIP_OSTYPE_CHECKS
We should still make an effort to fill in data, just not raise an error if say an ostype/virttype combo disappeared from caps. Acked-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
b251d6ad24
commit
cd9d439a71
@ -19178,18 +19178,19 @@ virDomainDefParseCaps(virDomainDefPtr def,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS)) {
|
if (!(capsdata = virCapabilitiesDomainDataLookup(caps, def->os.type,
|
||||||
if (!(capsdata = virCapabilitiesDomainDataLookup(caps,
|
def->os.arch,
|
||||||
def->os.type, def->os.arch, def->virtType,
|
def->virtType,
|
||||||
NULL, NULL)))
|
NULL, NULL))) {
|
||||||
|
if (!(flags & VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
virResetLastError();
|
||||||
|
} else {
|
||||||
if (!def->os.arch)
|
if (!def->os.arch)
|
||||||
def->os.arch = capsdata->arch;
|
def->os.arch = capsdata->arch;
|
||||||
if ((!def->os.machine &&
|
if ((!def->os.machine &&
|
||||||
VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0)) {
|
VIR_STRDUP(def->os.machine, capsdata->machinetype) < 0))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<currentMemory unit='KiB'>219100</currentMemory>
|
<currentMemory unit='KiB'>219100</currentMemory>
|
||||||
<vcpu placement='static' cpuset='1'>1</vcpu>
|
<vcpu placement='static' cpuset='1'>1</vcpu>
|
||||||
<os>
|
<os>
|
||||||
<type arch='i686'>hvm</type>
|
<type arch='alpha'>hvm</type>
|
||||||
<boot dev='hd'/>
|
<boot dev='hd'/>
|
||||||
</os>
|
</os>
|
||||||
<clock offset='utc'/>
|
<clock offset='utc'/>
|
||||||
|
@ -2773,6 +2773,9 @@ mymain(void)
|
|||||||
QEMU_CAPS_OBJECT_GPEX,
|
QEMU_CAPS_OBJECT_GPEX,
|
||||||
QEMU_CAPS_NEC_USB_XHCI);
|
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",
|
DO_TEST_PARSE_FLAGS_ERROR("missing-machine",
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS,
|
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS,
|
||||||
NONE);
|
NONE);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user