提交 97cafa61 编写于 作者: C Cole Robinson

qemu: domain: raise an error when no emulator is found

$ cat f | grep -e arch -e emulator
    <type arch='mipsel'>hvm</type>
$ sudo virsh define f
error: Failed to define domain from f
error: An error occurred, but the cause is unknown

After:
$ sudo virsh define f
error: Failed to define domain from f
error: unsupported configuration: No emulator found for arch 'mipsel'
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
Signed-off-by: NCole Robinson <crobinso@redhat.com>
上级 66d4fd70
...@@ -4687,8 +4687,12 @@ qemuDomainDefPostParseBasic(virDomainDefPtr def, ...@@ -4687,8 +4687,12 @@ qemuDomainDefPostParseBasic(virDomainDefPtr def,
/* check for emulator and create a default one if needed */ /* check for emulator and create a default one if needed */
if (!def->emulator) { if (!def->emulator) {
if (!(def->emulator = virQEMUCapsGetDefaultEmulator( if (!(def->emulator = virQEMUCapsGetDefaultEmulator(
driver->hostarch, def->os.arch))) driver->hostarch, def->os.arch))) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("No emulator found for arch '%s'"),
virArchToString(def->os.arch));
return 1; return 1;
}
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册