On 19.09.2014 21:23, Jim Fehlig wrote:
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 <jfeh...@suse.com>
---
src/libxl/libxl_conf.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index 09211f8..882dcff 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -705,6 +705,21 @@ 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;
+ }
+
+ 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,
Do we need virFileIsExecutable too?
Michal
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list