|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] xl/libxl: add a blkdev_start parameter
# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1338305809 -3600
# Node ID eae6e5bb90794f62a31ac79347ed64051238cd23
# Parent 00ad5024ed65cb626dd24a9f58aabf231524bcdc
xl/libxl: add a blkdev_start parameter
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@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
diff -r 00ad5024ed65 -r eae6e5bb9079 docs/man/xl.conf.pod.5
--- a/docs/man/xl.conf.pod.5 Tue May 29 16:36:48 2012 +0100
+++ b/docs/man/xl.conf.pod.5 Tue May 29 16:36:49 2012 +0100
@@ -84,6 +84,12 @@ previous C<xm> toolstack this can be con
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
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/examples/xl.conf
--- a/tools/examples/xl.conf Tue May 29 16:36:48 2012 +0100
+++ b/tools/examples/xl.conf Tue May 29 16:36:49 2012 +0100
@@ -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"
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/libxl.c Tue May 29 16:36:49 2012 +0100
@@ -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;
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/libxl_bootloader.c Tue May 29 16:36:49 2012 +0100
@@ -344,7 +344,8 @@ void libxl__bootloader_run(libxl__egc *e
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;
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/libxl_create.c Tue May 29 16:36:49 2012 +0100
@@ -107,6 +107,9 @@ int libxl__domain_build_info_setdefault(
}
}
+ 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) {
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/libxl_internal.h Tue May 29 16:36:49 2012 +0100
@@ -1290,7 +1290,8 @@ _hidden int libxl__device_disk_add(libxl
*/
_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);
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/libxl_types.idl Tue May 29 16:36:49 2012 +0100
@@ -246,6 +246,7 @@ libxl_domain_build_info = Struct("domain
("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),
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/xl.c
--- a/tools/libxl/xl.c Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/xl.c Tue May 29 16:36:49 2012 +0100
@@ -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 ch
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);
}
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/xl.h
--- a/tools/libxl/xl.h Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/xl.h Tue May 29 16:36:49 2012 +0100
@@ -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,
diff -r 00ad5024ed65 -r eae6e5bb9079 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c Tue May 29 16:36:48 2012 +0100
+++ b/tools/libxl/xl_cmdimpl.c Tue May 29 16:36:49 2012 +0100
@@ -627,6 +627,8 @@ static void parse_config_data(const char
}
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))
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |