提交 1c0bf509 编写于 作者: J Jim Fehlig

libxl: Support user-specified <emulator>

With the introduction of the libxlDomainGetEmulatorType function,
it is trivial to support a user-specfied <emulator> in the libxl
driver.  This patch is based loosely on David Scott's old patch
to do the same

https://www.redhat.com/archives/libvir-list/2013-April/msg02119.htmlSigned-off-by: NJim Fehlig <jfehlig@suse.com>
上级 b43e6662
......@@ -705,6 +705,28 @@ libxlMakeDomBuildInfo(virDomainDefPtr def,
if (VIR_STRDUP(b_info->u.hvm.boot, bootorder) < 0)
goto error;
if (def->emulator) {
if (!virFileExists(def->emulator)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("emulator '%s' not found"),
def->emulator);
goto error;
}
if (!virFileIsExecutable(def->emulator)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("emulator '%s' is not executable"),
def->emulator);
goto error;
}
VIR_FREE(b_info->device_model);
if (VIR_STRDUP(b_info->device_model, def->emulator) < 0)
goto error;
b_info->device_model_version = libxlDomainGetEmulatorType(def);
}
if (def->nserials) {
if (def->nserials > 1) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册