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

[Xen-devel] [PATCH 15 of 20] libxl: Remove libxl_device_model_info.type



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1327336698 0
# Node ID e5f62c6ec77ce933d4f5f92758e7d4aa5a7a6369
# Parent  b8a133e35c9100d301a19c217ee275b0a01ae55c
libxl: Remove libxl_device_model_info.type.

This is the type of the target guest which is part of the guest config.

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

diff -r b8a133e35c91 -r e5f62c6ec77c tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c        Mon Jan 23 16:38:18 2012 +0000
+++ b/tools/libxl/libxl_create.c        Mon Jan 23 16:38:18 2012 +0000
@@ -602,7 +602,6 @@ static int do_domain_create(libxl__gc *g
             memset((void*)&xenpv_dm_info, 0, sizeof(libxl_device_model_info));
             xenpv_dm_info.device_model_version =
                 d_config->dm_info.device_model_version;
-            xenpv_dm_info.type = d_config->dm_info.type;
             xenpv_dm_info.device_model = d_config->dm_info.device_model;
             xenpv_dm_info.extra = d_config->dm_info.extra;
             xenpv_dm_info.extra_pv = d_config->dm_info.extra_pv;
diff -r b8a133e35c91 -r e5f62c6ec77c tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c    Mon Jan 23 16:38:18 2012 +0000
+++ b/tools/libxl/libxl_dm.c    Mon Jan 23 16:38:18 2012 +0000
@@ -77,7 +77,7 @@ static const libxl_vnc_info *dm_vnc(cons
                                     const libxl_device_model_info *info)
 {
     const libxl_vnc_info *vnc = NULL;
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (guest_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) {
         vnc = &guest_config->b_info.u.hvm.vnc;
     } else if (guest_config->num_vfbs > 0) {
         vnc = &guest_config->vfbs[0].vnc;
@@ -89,7 +89,7 @@ static const libxl_sdl_info *dm_sdl(cons
                                     const libxl_device_model_info *info)
 {
     const libxl_sdl_info *sdl = NULL;
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (guest_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) {
         sdl = &guest_config->b_info.u.hvm.sdl;
     } else if (guest_config->num_vfbs > 0) {
         sdl = &guest_config->vfbs[0].sdl;
@@ -100,7 +100,7 @@ static const libxl_sdl_info *dm_sdl(cons
 static const char *dm_keymap(const libxl_domain_config *guest_config,
                              const libxl_device_model_info *info)
 {
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (guest_config->b_info.type == LIBXL_DOMAIN_TYPE_HVM) {
         return guest_config->b_info.u.hvm.keymap;
     } else if (guest_config->num_vfbs > 0) {
         return guest_config->vfbs[0].keymap;
@@ -171,7 +171,7 @@ static char ** libxl__build_device_model
     if (keymap) {
         flexarray_vappend(dm_args, "-k", keymap, NULL);
     }
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         int ioemu_vifs = 0;
 
         if (b_info->u.hvm.serial) {
@@ -254,7 +254,7 @@ static char ** libxl__build_device_model
     for (i = 0; info->extra && info->extra[i] != NULL; i++)
         flexarray_append(dm_args, info->extra[i]);
     flexarray_append(dm_args, "-M");
-    switch (info->type) {
+    switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_PV:
         flexarray_append(dm_args, "xenpv");
         for (i = 0; info->extra_pv && info->extra_pv[i] != NULL; i++)
@@ -353,7 +353,7 @@ static char ** libxl__build_device_model
     flexarray_append(dm_args, "-mon");
     flexarray_append(dm_args, "chardev=libxl-cmd,mode=control");
 
-    if (info->type == LIBXL_DOMAIN_TYPE_PV) {
+    if (b_info->type == LIBXL_DOMAIN_TYPE_PV) {
         flexarray_append(dm_args, "-xen-attach");
     }
 
@@ -400,7 +400,7 @@ static char ** libxl__build_device_model
         flexarray_vappend(dm_args, "-k", keymap, NULL);
     }
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         int ioemu_vifs = 0;
 
         if (b_info->u.hvm.serial) {
@@ -498,7 +498,7 @@ static char ** libxl__build_device_model
     for (i = 0; info->extra && info->extra[i] != NULL; i++)
         flexarray_append(dm_args, info->extra[i]);
     flexarray_append(dm_args, "-M");
-    switch (info->type) {
+    switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_PV:
         flexarray_append(dm_args, "xenpv");
         for (i = 0; info->extra_pv && info->extra_pv[i] != NULL; i++)
@@ -517,7 +517,7 @@ static char ** libxl__build_device_model
                      libxl__sprintf(gc, "%d",
                                     
libxl__sizekb_to_mb(b_info->target_memkb)));
 
-    if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         for (i = 0; i < num_disks; i++) {
             int disk, part;
             int dev_number =
@@ -700,6 +700,7 @@ static int libxl__create_stubdom(libxl__
     libxl_uuid_copy(&dm_config.c_info.uuid, &info->uuid);
 
     memset(&dm_config.b_info, 0x00, sizeof(libxl_domain_build_info));
+    dm_config.b_info.type = dm_config.c_info.type;
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
     dm_config.b_info.target_memkb = dm_config.b_info.max_memkb;
@@ -828,7 +829,6 @@ retry_transaction:
 
     memset((void*)&xenpv_dm_info, 0, sizeof(libxl_device_model_info));
     xenpv_dm_info.device_model_version = info->device_model_version;
-    xenpv_dm_info.type = LIBXL_DOMAIN_TYPE_PV;
     xenpv_dm_info.device_model = info->device_model;
     xenpv_dm_info.extra = info->extra;
     xenpv_dm_info.extra_pv = info->extra_pv;
diff -r b8a133e35c91 -r e5f62c6ec77c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl       Mon Jan 23 16:38:18 2012 +0000
+++ b/tools/libxl/libxl_types.idl       Mon Jan 23 16:38:18 2012 +0000
@@ -265,7 +265,6 @@ libxl_device_model_info = Struct("device
     # you set device_model you must set device_model_version too
     ("device_model",     string),
     ("saved_state",      string),
-    ("type",             libxl_domain_type),
     # 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 b8a133e35c91 -r e5f62c6ec77c tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Mon Jan 23 16:38:18 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Mon Jan 23 16:38:18 2012 +0000
@@ -1216,8 +1216,6 @@ skip_vfb:
             b_info->u.hvm.xen_platform_pci = l;
     }
 
-    dm_info->type = c_info->type;
-
     xlu_cfg_destroy(config);
 }
 

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


 


Rackspace

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