qemu: Fix crash when defining XML with bogus emulator

We weren't checking for failure of qemuCaps lookup
This commit is contained in:
Cole Robinson 2016-01-08 14:46:48 -05:00
parent 79ba107670
commit 3d92a000ff

View File

@ -1247,7 +1247,9 @@ qemuDomainDefPostParse(virDomainDefPtr def,
!(def->emulator = virDomainDefGetDefaultEmulator(def, caps)))
return ret;
qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache, def->emulator);
if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
def->emulator)))
goto cleanup;
if (qemuDomainDefAddDefaultDevices(def, qemuCaps) < 0)
goto cleanup;