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

[Xen-changelog] [xen-unstable] libxl: remove redundant info from dm info.



# HG changeset patch
# User Ian Campbell <ian.campbell@xxxxxxxxxx>
# Date 1328023311 0
# Node ID 6cf421073cabaa219a70ae4f04b517e99a90f7d4
# Parent  05435cdb21d323c2865cdd883fa0a7c2cdcdec0b
libxl: remove redundant info from dm info.

Remove "target_ram", "acpi", "vcpus" and "vcpu_avail" from device model info
and use domain_build_info instead. These must all be consistently specified to
both the domain and the device model, there is no need (and a great deal of
danger) in exposing a way for a user of libxl to set them differently.

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


diff -r 05435cdb21d3 -r 6cf421073cab 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:51 2012 +0000
@@ -122,11 +122,7 @@
     dm_info->device_model_version = 
LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
     dm_info->device_model_stubdomain = false;
     dm_info->device_model = NULL;
-    dm_info->target_ram = libxl__sizekb_to_mb(b_info->target_memkb);
     dm_info->videoram = libxl__sizekb_to_mb(b_info->video_memkb);
-    dm_info->acpi = b_info->u.hvm.acpi;
-    dm_info->vcpus = b_info->max_vcpus;
-    dm_info->vcpu_avail = b_info->cur_vcpus;
 
     dm_info->stdvga = 0;
     dm_info->vnc.enable = 1;
diff -r 05435cdb21d3 -r 6cf421073cab 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:51 2012 +0000
@@ -78,6 +78,7 @@
                                         const libxl_domain_config 
*guest_config,
                                         const libxl_device_model_info *info)
 {
+    const libxl_domain_build_info *b_info = &guest_config->b_info;
     const libxl_device_nic *vifs = guest_config->vifs;
     const int num_vifs = guest_config->num_vifs;
     int i;
@@ -159,14 +160,18 @@
         if (info->soundhw) {
             flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL);
         }
-        if (info->acpi) {
+        if (b_info->u.hvm.acpi) {
             flexarray_append(dm_args, "-acpi");
         }
-        if (info->vcpus > 1) {
-            flexarray_vappend(dm_args, "-vcpus", libxl__sprintf(gc, "%d", 
info->vcpus), NULL);
+        if (b_info->max_vcpus > 1) {
+            flexarray_vappend(dm_args, "-vcpus",
+                              libxl__sprintf(gc, "%d", b_info->max_vcpus),
+                              NULL);
         }
-        if (info->vcpu_avail) {
-            flexarray_vappend(dm_args, "-vcpu_avail", libxl__sprintf(gc, 
"0x%x", info->vcpu_avail), NULL);
+        if (b_info->cur_vcpus) {
+            flexarray_vappend(dm_args, "-vcpu_avail",
+                              libxl__sprintf(gc, "0x%x", b_info->cur_vcpus),
+                              NULL);
         }
         for (i = 0; i < num_vifs; i++) {
             if (vifs[i].nictype == LIBXL_NIC_TYPE_IOEMU) {
@@ -234,6 +239,7 @@
                                         const libxl_device_model_info *info)
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
+    const libxl_domain_build_info *b_info = &guest_config->b_info;
     const libxl_device_disk *disks = guest_config->disks;
     const libxl_device_nic *vifs = guest_config->vifs;
     const int num_disks = guest_config->num_disks;
@@ -366,15 +372,18 @@
         if (info->soundhw) {
             flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL);
         }
-        if (!info->acpi) {
+        if (!b_info->u.hvm.acpi) {
             flexarray_append(dm_args, "-no-acpi");
         }
-        if (info->vcpus > 1) {
+        if (b_info->max_vcpus > 1) {
             flexarray_append(dm_args, "-smp");
-            if (info->vcpu_avail)
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d", 
info->vcpus, info->vcpu_avail));
+            if (b_info->cur_vcpus)
+                flexarray_append(dm_args, libxl__sprintf(gc, "%d,maxcpus=%d",
+                                                         b_info->max_vcpus,
+                                                         b_info->cur_vcpus));
             else
-                flexarray_append(dm_args, libxl__sprintf(gc, "%d", 
info->vcpus));
+                flexarray_append(dm_args, libxl__sprintf(gc, "%d",
+                                                         b_info->max_vcpus));
         }
         for (i = 0; i < num_vifs; i++) {
             if (vifs[i].nictype == LIBXL_NIC_TYPE_IOEMU) {
@@ -432,7 +441,9 @@
 
     /* RAM Size */
     flexarray_append(dm_args, "-m");
-    flexarray_append(dm_args, libxl__sprintf(gc, "%d", info->target_ram));
+    flexarray_append(dm_args,
+                     libxl__sprintf(gc, "%d",
+                                    
libxl__sizekb_to_mb(b_info->target_memkb)));
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         for (i = 0; i < num_disks; i++) {
diff -r 05435cdb21d3 -r 6cf421073cab 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:51 2012 +0000
@@ -244,7 +244,6 @@
     ("device_model",     string),
     ("saved_state",      string),
     ("type",             libxl_domain_type),
-    ("target_ram",       uint32),
     # size of the videoram in MB
     ("videoram",         integer), 
     ("stdvga",           bool),
@@ -261,9 +260,6 @@
     # usbdevice: "tablet" for absolute mouse, "mouse" for PS/2 protocol 
relative mouse
     ("usbdevice",        string),
     ("soundhw",          string),
-    ("acpi",             bool),
-    ("vcpus",            integer), # max number of vcpus
-    ("vcpu_avail",       integer), # vcpus actually available
     ("xen_platform_pci", bool),
     # extra parameters pass directly to qemu, NULL terminated
     ("extra",            libxl_string_list),
diff -r 05435cdb21d3 -r 6cf421073cab 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:51 2012 +0000
@@ -380,7 +380,6 @@
         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(acpi %d)\n", dm_info->acpi);
         printf("\t\t\t(spice %d)\n", dm_info->spice.enable);
         printf("\t\t\t(spiceport %d)\n", dm_info->spice.port);
         printf("\t\t\t(spicetls_port %d)\n", dm_info->spice.tls_port);

_______________________________________________
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®.