提交 f64d67cd 编写于 作者: D Daniel Henrique Barboza 提交者: Cole Robinson

qemu: command: move vmGenID validation to qemu_domain.c

QEMU_CAPS_DEVICE_VMGENID is now being validated by
qemuDomainDefValidate().
Reviewed-by: NCole Robinson <crobinso@redhat.com>
Signed-off-by: NDaniel Henrique Barboza <danielhb413@gmail.com>
上级 3d21545f
...@@ -6048,8 +6048,7 @@ qemuBuildSmbiosCommandLine(virCommandPtr cmd, ...@@ -6048,8 +6048,7 @@ qemuBuildSmbiosCommandLine(virCommandPtr cmd,
static int static int
qemuBuildVMGenIDCommandLine(virCommandPtr cmd, qemuBuildVMGenIDCommandLine(virCommandPtr cmd,
const virDomainDef *def, const virDomainDef *def)
virQEMUCapsPtr qemuCaps)
{ {
g_auto(virBuffer) opts = VIR_BUFFER_INITIALIZER; g_auto(virBuffer) opts = VIR_BUFFER_INITIALIZER;
char guid[VIR_UUID_STRING_BUFLEN]; char guid[VIR_UUID_STRING_BUFLEN];
...@@ -6057,12 +6056,6 @@ qemuBuildVMGenIDCommandLine(virCommandPtr cmd, ...@@ -6057,12 +6056,6 @@ qemuBuildVMGenIDCommandLine(virCommandPtr cmd,
if (!def->genidRequested) if (!def->genidRequested)
return 0; return 0;
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMGENID)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this QEMU does not support the 'genid' capability"));
return -1;
}
virUUIDFormat(def->genid, guid); virUUIDFormat(def->genid, guid);
virBufferAsprintf(&opts, "vmgenid,guid=%s,id=vmgenid0", guid); virBufferAsprintf(&opts, "vmgenid,guid=%s,id=vmgenid0", guid);
...@@ -10070,7 +10063,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver, ...@@ -10070,7 +10063,7 @@ qemuBuildCommandLine(virQEMUDriverPtr driver,
if (qemuBuildSmbiosCommandLine(cmd, driver, def) < 0) if (qemuBuildSmbiosCommandLine(cmd, driver, def) < 0)
return NULL; return NULL;
if (qemuBuildVMGenIDCommandLine(cmd, def, qemuCaps) < 0) if (qemuBuildVMGenIDCommandLine(cmd, def) < 0)
return NULL; return NULL;
/* /*
......
...@@ -5458,6 +5458,13 @@ qemuDomainDefValidate(const virDomainDef *def, ...@@ -5458,6 +5458,13 @@ qemuDomainDefValidate(const virDomainDef *def,
} }
} }
if (def->genidRequested &&
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_VMGENID)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("this QEMU does not support the 'genid' capability"));
goto cleanup;
}
/* QEMU 2.7 (detected via the availability of query-hotpluggable-cpus) /* QEMU 2.7 (detected via the availability of query-hotpluggable-cpus)
* enforces stricter rules than previous versions when it comes to guest * enforces stricter rules than previous versions when it comes to guest
* CPU topology. Verify known constraints are respected */ * CPU topology. Verify known constraints are respected */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册