2014-03-03 05:22:57 +01:00
|
|
|
Index: libvirt-1.2.2/src/libxl/libxl_conf.c
|
2013-10-25 21:29:19 +02:00
|
|
|
===================================================================
|
2014-03-03 05:22:57 +01:00
|
|
|
--- libvirt-1.2.2.orig/src/libxl/libxl_conf.c
|
|
|
|
+++ libvirt-1.2.2/src/libxl/libxl_conf.c
|
|
|
|
@@ -565,6 +565,30 @@ libxlMakeChrdevStr(virDomainChrDefPtr de
|
2013-10-25 21:29:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
+libxlFixupDomBuildInfo(virDomainDefPtr def, libxl_domain_config *d_config)
|
|
|
|
+{
|
|
|
|
+ libxl_domain_build_info *b_info = &d_config->b_info;
|
|
|
|
+ int hvm = STREQ(def->os.type, "hvm");
|
|
|
|
+ libxl_device_vfb vfb;
|
|
|
|
+
|
|
|
|
+ if (!hvm)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ if (d_config->num_vfbs) {
|
|
|
|
+ vfb = d_config->vfbs[0];
|
|
|
|
+ if (libxl_defbool_val(vfb.vnc.enable))
|
|
|
|
+ memcpy(&b_info->u.hvm.vnc, &vfb.vnc, sizeof(libxl_vnc_info));
|
|
|
|
+ else if (libxl_defbool_val(vfb.sdl.enable))
|
|
|
|
+ memcpy(&b_info->u.hvm.sdl, &vfb.sdl, sizeof(libxl_sdl_info));
|
|
|
|
+ else
|
|
|
|
+ return -1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+static int
|
|
|
|
libxlMakeDomBuildInfo(virDomainObjPtr vm, libxl_domain_config *d_config)
|
|
|
|
{
|
|
|
|
virDomainDefPtr def = vm->def;
|
2014-03-03 05:22:57 +01:00
|
|
|
@@ -1195,6 +1219,9 @@ libxlBuildDomainConfig(libxlDriverPrivat
|
2013-10-25 21:29:19 +02:00
|
|
|
if (libxlMakeVfbList(driver, def, d_config) < 0)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
+ if (libxlFixupDomBuildInfo(def, d_config) < 0)
|
|
|
|
+ return -1;
|
|
|
|
+
|
|
|
|
d_config->on_reboot = def->onReboot;
|
|
|
|
d_config->on_poweroff = def->onPoweroff;
|
|
|
|
d_config->on_crash = def->onCrash;
|