1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

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.html
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
This commit is contained in:
Jim Fehlig 2014-09-19 13:03:18 -06:00
parent b43e6662df
commit 1c0bf509ef

View File

@ -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,