]> xenbits.xensource.com Git - people/vhanquez/xen-unstable.git/commitdiff
xl/libxl: add a blkdev_start parameter
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 29 May 2012 15:36:49 +0000 (16:36 +0100)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 29 May 2012 15:36:49 +0000 (16:36 +0100)
Introduce a blkdev_start in xl.conf and a corresponding string in
libxl_domain_build_info.

Add a blkdev_start parameter to libxl__device_disk_local_attach: it is
going to be used in a following patch.

blkdev_start specifies the first block device to be used for temporary
block device allocations by the toolstack.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
docs/man/xl.conf.pod.5
tools/examples/xl.conf
tools/libxl/libxl.c
tools/libxl/libxl_bootloader.c
tools/libxl/libxl_create.c
tools/libxl/libxl_internal.h
tools/libxl/libxl_types.idl
tools/libxl/xl.c
tools/libxl/xl.h
tools/libxl/xl_cmdimpl.c

index 8bd45ea5737d59e8ec7d68a28c230e620753ee9f..149430c61ed76ad46db4a68896a4e1e617d3bd57 100644 (file)
@@ -84,6 +84,12 @@ previous C<xm> toolstack this can be configured to use the old C<SXP>
 
 Default: C<json>
 
+=item B<blkdev_start="NAME">
+
+Configures the name of the first block device to be used for temporary
+block device allocations by the toolstack.
+The default choice is "xvda".
+
 =back
 
 =head1 SEE ALSO
index 56d3b3b9c1c2422992dd5b78abbfd2653e1126f6..ebf057c37a71fdf9570096c0c3c2abb3ade06c7a 100644 (file)
@@ -12,3 +12,6 @@
 
 # default output format used by "xl list -l"
 #output_format="json"
+
+# first block device to be used for temporary VM disk mounts
+#blkdev_start="xvda"
index de71a66ec60febce03541b89e206e228d0af56d7..84e0950e1435dcdcef678a036f28b8a2d51d7c6d 100644 (file)
@@ -1745,7 +1745,8 @@ out:
 
 char * libxl__device_disk_local_attach(libxl__gc *gc,
         const libxl_device_disk *in_disk,
-        libxl_device_disk *disk)
+        libxl_device_disk *disk,
+        const char *blkdev_start)
 {
     libxl_ctx *ctx = gc->owner;
     char *dev = NULL;
index e7959b9034c8a488895986d1af21033eb3536a5f..7ebc0dfcf36ebf4d4ddf0155f68e69425c867653 100644 (file)
@@ -344,7 +344,8 @@ void libxl__bootloader_run(libxl__egc *egc, libxl__bootloader_state *bl)
         goto out;
     }
 
-    bl->diskpath = libxl__device_disk_local_attach(gc, bl->disk, &bl->localdisk);
+    bl->diskpath = libxl__device_disk_local_attach(gc, bl->disk, &bl->localdisk,
+            info->blkdev_start);
     if (!bl->diskpath) {
         rc = ERROR_FAIL;
         goto out;
index e5999c0a202c6dbe7592237dc743c312e26d1117..77acecca9a6dec8122ae863ba97d95da1240e194 100644 (file)
@@ -107,6 +107,9 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
         }
     }
 
+    if (b_info->blkdev_start == NULL)
+        b_info->blkdev_start = libxl__strdup(0, "xvda");
+
     if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
         if (!b_info->u.hvm.bios)
             switch (b_info->device_model_version) {
index ef23734f10733c4de8fa1eb415985a6c6a7e4ca6..f48f40207200a68f73377af122e90ab9f1e934d6 100644 (file)
@@ -1290,7 +1290,8 @@ _hidden int libxl__device_disk_add(libxl__gc *gc, uint32_t domid,
  */
 _hidden char * libxl__device_disk_local_attach(libxl__gc *gc,
         const libxl_device_disk *in_disk,
-        libxl_device_disk *new_disk);
+        libxl_device_disk *new_disk,
+        const char *blkdev_start);
 _hidden int libxl__device_disk_local_detach(libxl__gc *gc,
         libxl_device_disk *disk);
 
index 5b81ee978d8e8575f272cf84002cbe37eb694922..508194bd121c03ccae20cf13ba7a3ec02b470383 100644 (file)
@@ -246,6 +246,7 @@ libxl_domain_build_info = Struct("domain_build_info",[
     ("localtime",       libxl_defbool),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
+    ("blkdev_start",    string),
     
     ("device_model_version", libxl_device_model_version),
     ("device_model_stubdomain", libxl_defbool),
index 69f8737459cec348c736c0f4deb9904919d7faa9..492153f29f33ae4b1fc966b34561e0ac2d8e6a20 100644 (file)
@@ -38,6 +38,7 @@ xentoollog_logger_stdiostream *logger;
 int dryrun_only;
 int force_execution;
 int autoballoon = 1;
+char *blkdev_start;
 char *lockfile;
 char *default_vifscript = NULL;
 char *default_bridge = NULL;
@@ -94,6 +95,8 @@ static void parse_global_config(const char *configfile,
             fprintf(stderr, "invalid default output format \"%s\"\n", buf);
         }
     }
+    if (!xlu_cfg_get_string (config, "blkdev_start", &buf, 0))
+        blkdev_start = strdup(buf);
     xlu_cfg_destroy(config);
 }
 
index 2af9428124d7ed138178e18776b065a39046a6b1..7169ed0c59df933ce28b3d1767b3bd346e9d384e 100644 (file)
@@ -143,6 +143,7 @@ extern int dryrun_only;
 extern char *lockfile;
 extern char *default_vifscript;
 extern char *default_bridge;
+extern char *blkdev_start;
 
 enum output_format {
     OUTPUT_FORMAT_JSON,
index ca988d697919e1370fe533c171c6310304ca383d..259b06548798fca78831eba31f0147701e2c5217 100644 (file)
@@ -627,6 +627,8 @@ static void parse_config_data(const char *config_source,
     }
 
     libxl_domain_build_info_init_type(b_info, c_info->type);
+    if (blkdev_start)
+        b_info->blkdev_start = strdup(blkdev_start);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "cpu_weight", &l, 0))