[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: HVM device configuration info build_info->u.hvm



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1328023312 0
# Node ID 304726ed52e61bd6a064541b0e1dcfb7edb3f9ff
# Parent  6ccdda2c9b42ceb01ea995685546ab12a54edffa
libxl: HVM device configuration info build_info->u.hvm

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---


diff -r 6ccdda2c9b42 -r 304726ed52e6 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Tue Jan 31 15:21:51 2012 +0000
+++ b/tools/libxl/libxl_create.c        Tue Jan 31 15:21:52 2012 +0000
@@ -106,6 +106,11 @@
         b_info->u.hvm.sdl.enable = 0;
         b_info->u.hvm.sdl.opengl = 0;
         b_info->u.hvm.nographic = 0;
+        b_info->u.hvm.serial = NULL;
+        b_info->u.hvm.boot = strdup("cda");
+        b_info->u.hvm.usb = 0;
+        b_info->u.hvm.usbdevice = NULL;
+        b_info->u.hvm.xen_platform_pci = 1;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 8 * 1024;
@@ -132,11 +137,6 @@
     dm_info->device_model_stubdomain = false;
     dm_info->device_model = NULL;
 
-    dm_info->serial = NULL;
-    dm_info->boot = strdup("cda");
-    dm_info->usb = 0;
-    dm_info->usbdevice = NULL;
-    dm_info->xen_platform_pci = 1;
     return 0;
 }
 
diff -r 6ccdda2c9b42 -r 304726ed52e6 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Tue Jan 31 15:21:51 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Tue Jan 31 15:21:52 2012 +0000
@@ -171,12 +171,13 @@
     if (keymap) {
         flexarray_vappend(dm_args, "-k", keymap, NULL);
     }
-    if (info->serial) {
-        flexarray_vappend(dm_args, "-serial", info->serial, NULL);
-    }
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         int ioemu_vifs = 0;
 
+        if (b_info->u.hvm.serial) {
+            flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
+        }
+
         if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
@@ -191,17 +192,18 @@
             flexarray_append(dm_args, "-std-vga");
         }
 
-        if (info->boot) {
-            flexarray_vappend(dm_args, "-boot", info->boot, NULL);
+        if (b_info->u.hvm.boot) {
+            flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (info->usb || info->usbdevice) {
+        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
-            if (info->usbdevice) {
-                flexarray_vappend(dm_args, "-usbdevice", info->usbdevice, 
NULL);
+            if (b_info->u.hvm.usbdevice) {
+                flexarray_vappend(dm_args,
+                                  "-usbdevice", b_info->u.hvm.usbdevice, NULL);
             }
         }
-        if (info->soundhw) {
-            flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL);
+        if (b_info->u.hvm.soundhw) {
+            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, 
NULL);
         }
         if (b_info->u.hvm.acpi) {
             flexarray_append(dm_args, "-acpi");
@@ -398,12 +400,13 @@
         flexarray_vappend(dm_args, "-k", keymap, NULL);
     }
 
-    if (info->serial) {
-        flexarray_vappend(dm_args, "-serial", info->serial, NULL);
-    }
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         int ioemu_vifs = 0;
 
+        if (b_info->u.hvm.serial) {
+            flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
+        }
+
         if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
@@ -422,17 +425,19 @@
                 flexarray_vappend(dm_args, "-vga", "std", NULL);
         }
 
-        if (info->boot) {
-            flexarray_vappend(dm_args, "-boot", libxl__sprintf(gc, "order=%s", 
info->boot), NULL);
+        if (b_info->u.hvm.boot) {
+            flexarray_vappend(dm_args, "-boot",
+                    libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (info->usb || info->usbdevice) {
+        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
-            if (info->usbdevice) {
-                flexarray_vappend(dm_args, "-usbdevice", info->usbdevice, 
NULL);
+            if (b_info->u.hvm.usbdevice) {
+                flexarray_vappend(dm_args,
+                                  "-usbdevice", b_info->u.hvm.usbdevice, NULL);
             }
         }
-        if (info->soundhw) {
-            flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL);
+        if (b_info->u.hvm.soundhw) {
+            flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, 
NULL);
         }
         if (!b_info->u.hvm.acpi) {
             flexarray_append(dm_args, "-no-acpi");
@@ -778,7 +783,7 @@
     if (ret)
         goto out_free;
 
-    if (info->serial)
+    if (guest_config->b_info.u.hvm.serial)
         num_console++;
 
     console = libxl__calloc(gc, num_console, sizeof(libxl_device_console));
@@ -906,7 +911,8 @@
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", info->domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path), 
"%d", !info->xen_platform_pci);
+    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
+                    "%d", !guest_config->b_info.u.hvm.xen_platform_pci);
 
     libxl_create_logfile(ctx,
                          libxl__sprintf(gc, "qemu-dm-%s", c_info->name),
diff -r 6ccdda2c9b42 -r 304726ed52e6 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Tue Jan 31 15:21:51 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Tue Jan 31 15:21:52 2012 +0000
@@ -222,6 +222,16 @@
                                        ("keymap",           string),
                                        ("sdl",              libxl_sdl_info),
                                        ("spice",            libxl_spice_info),
+                                       
+                                       ("serial",           string),
+                                       ("boot",             string),
+                                       ("usb",              bool),
+                                       # usbdevice:
+                                       # - "tablet" for absolute mouse,
+                                       # - "mouse" for PS/2 protocol relative 
mouse
+                                       ("usbdevice",        string),
+                                       ("soundhw",          string),
+                                       ("xen_platform_pci", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", uint32),
@@ -251,13 +261,6 @@
     ("saved_state",      string),
     ("type",             libxl_domain_type),
     ("gfx_passthru",     bool),
-    ("serial",           string),
-    ("boot",             string),
-    ("usb",              bool),
-    # usbdevice: "tablet" for absolute mouse, "mouse" for PS/2 protocol 
relative mouse
-    ("usbdevice",        string),
-    ("soundhw",          string),
-    ("xen_platform_pci", bool),
     # extra parameters pass directly to qemu, NULL terminated
     ("extra",            libxl_string_list),
     # extra parameters pass directly to qemu for PV guest, NULL terminated
diff -r 6ccdda2c9b42 -r 304726ed52e6 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Tue Jan 31 15:21:51 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Tue Jan 31 15:21:52 2012 +0000
@@ -383,10 +383,10 @@
 
         printf("\t\t\t(device_model %s)\n", dm_info->device_model ? : 
"default");
         printf("\t\t\t(gfx_passthru %d)\n", dm_info->gfx_passthru);
-        printf("\t\t\t(serial %s)\n", dm_info->serial);
-        printf("\t\t\t(boot %s)\n", dm_info->boot);
-        printf("\t\t\t(usb %d)\n", dm_info->usb);
-        printf("\t\t\t(usbdevice %s)\n", dm_info->usbdevice);
+        printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
+        printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
+        printf("\t\t\t(usb %d)\n", b_info->u.hvm.usb);
+        printf("\t\t\t(usbdevice %s)\n", b_info->u.hvm.usbdevice);
         printf("\t\t)\n");
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -1293,14 +1293,14 @@
             b_info->u.hvm.nographic = l;
         if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
             dm_info->gfx_passthru = l;
-        xlu_cfg_replace_string (config, "serial", &dm_info->serial, 0);
-        xlu_cfg_replace_string (config, "boot", &dm_info->boot, 0);
+        xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
+        xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         if (!xlu_cfg_get_long (config, "usb", &l, 0))
-            dm_info->usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &dm_info->usbdevice, 0);
-        xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw, 0);
+            b_info->u.hvm.usb = l;
+        xlu_cfg_replace_string (config, "usbdevice", &b_info->u.hvm.usbdevice, 
0);
+        xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
         if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
-            dm_info->xen_platform_pci = l;
+            b_info->u.hvm.xen_platform_pci = l;
     }
 
     dm_info->type = c_info->type;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.