From: Ian Campbell <Ian.Campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: Re: [PATCH v5 5/8] xl/libxl: add a blkdev_start parameter
Date: Fri, 4 May 2012 15:54:54 +0100 [thread overview]
Message-ID: <1336143294.7535.13.camel@zakaz.uk.xensource.com> (raw)
In-Reply-To: <1336130000-27261-5-git-send-email-stefano.stabellini@eu.citrix.com>
On Fri, 2012-05-04 at 12:13 +0100, Stefano Stabellini wrote:
> 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.
>
> Changes in v5:
> - change the type of the blkdev_start parameter to
> libxl__device_disk_local_attach to const char *.
>
> Changes in v4:
> - pass blkdev_start in libxl_domain_build_info.
>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> ---
> tools/examples/xl.conf | 3 +++
> tools/libxl/libxl_bootloader.c | 3 ++-
> tools/libxl/libxl_create.c | 3 +++
> tools/libxl/libxl_internal.c | 3 ++-
> tools/libxl/libxl_internal.h | 3 ++-
> tools/libxl/libxl_types.idl | 1 +
> tools/libxl/xl.c | 3 +++
> tools/libxl/xl.h | 1 +
> tools/libxl/xl_cmdimpl.c | 2 ++
> 9 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/tools/examples/xl.conf b/tools/examples/xl.conf
> index 56d3b3b..ebf057c 100644
> --- a/tools/examples/xl.conf
> +++ b/tools/examples/xl.conf
> @@ -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"
Need a patch to docs/man/xl.conf.pod.5 as well. If you add that then:
Acked-by: Ian Campbell <ian.campbell@citrix.com>
I suppose this is necessarily Linux specific and we'll need a patch from
the BSD folks?
> diff --git a/tools/libxl/libxl_bootloader.c b/tools/libxl/libxl_bootloader.c
> index 83cac78..123b06e 100644
> --- a/tools/libxl/libxl_bootloader.c
> +++ b/tools/libxl/libxl_bootloader.c
> @@ -387,7 +387,8 @@ int libxl_run_bootloader(libxl_ctx *ctx,
> goto out_close;
> }
>
> - diskpath = libxl__device_disk_local_attach(gc, disk, &tmpdisk);
> + diskpath = libxl__device_disk_local_attach(gc, disk, &tmpdisk,
> + info->blkdev_start);
> if (!diskpath) {
> rc = ERROR_FAIL;
> goto out_close;
> diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> index 7ab2f72..f2fcdf0 100644
> --- a/tools/libxl/libxl_create.c
> +++ b/tools/libxl/libxl_create.c
> @@ -107,6 +107,9 @@ int libxl__domain_build_info_setdefault(libxl__gc *gc,
> }
> }
>
> + if (b_info->blkdev_start == NULL)
> + b_info->blkdev_start = strdup("xvda");
> +
> if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
> if (!b_info->u.hvm.bios)
> switch (b_info->device_model_version) {
> diff --git a/tools/libxl/libxl_internal.c b/tools/libxl/libxl_internal.c
> index 1bf5d73..bd5ebb3 100644
> --- a/tools/libxl/libxl_internal.c
> +++ b/tools/libxl/libxl_internal.c
> @@ -482,7 +482,8 @@ out:
>
> 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)
> {
> libxl_ctx *ctx = gc->owner;
> char *dev = NULL;
> diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
> index 096c96d..0074ec4 100644
> --- a/tools/libxl/libxl_internal.h
> +++ b/tools/libxl/libxl_internal.h
> @@ -1015,7 +1015,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);
>
> diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> index 68599cb..7131696 100644
> --- a/tools/libxl/libxl_types.idl
> +++ b/tools/libxl/libxl_types.idl
> @@ -253,6 +253,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),
> diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c
> index a6ffd25..4596c4f 100644
> --- a/tools/libxl/xl.c
> +++ b/tools/libxl/xl.c
> @@ -35,6 +35,7 @@
> xentoollog_logger_stdiostream *logger;
> int dryrun_only;
> int autoballoon = 1;
> +char *blkdev_start;
> char *lockfile;
> char *default_vifscript = NULL;
> char *default_bridge = NULL;
> @@ -91,6 +92,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);
> }
>
> diff --git a/tools/libxl/xl.h b/tools/libxl/xl.h
> index f0d0ec8..3fbe14d 100644
> --- a/tools/libxl/xl.h
> +++ b/tools/libxl/xl.h
> @@ -112,6 +112,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 --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 28f5cab..7338562 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -595,6 +595,8 @@ static void parse_config_data(const char *configfile_filename_report,
> }
>
> 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))
next prev parent reply other threads:[~2012-05-04 14:54 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-04 11:12 [PATCH v5 0/8] qdisk local attach Stefano Stabellini
2012-05-04 11:13 ` [PATCH v5 1/8] libxl: make libxl_device_disk_local_attach/detach internal functions Stefano Stabellini
2012-05-04 11:13 ` [PATCH v5 2/8] libxl: libxl__device_disk_local_attach return a new libxl_device_disk Stefano Stabellini
2012-05-04 14:40 ` Ian Campbell
2012-05-04 16:27 ` Ian Jackson
2012-05-14 13:04 ` Stefano Stabellini
2012-05-14 13:06 ` Ian Campbell
2012-05-14 14:15 ` Ian Jackson
2012-05-04 11:13 ` [PATCH v5 3/8] libxl: add a transaction parameter to libxl__device_generic_add Stefano Stabellini
2012-05-04 14:41 ` Ian Campbell
2012-05-04 11:13 ` [PATCH v5 4/8] libxl: introduce libxl__device_disk_add Stefano Stabellini
2012-04-24 10:45 ` [PATCH v4 0/8] qdisk local attach Stefano Stabellini
2012-04-24 10:45 ` [PATCH v4 1/8] libxl: make libxl_device_disk_local_attach/detach internal functions Stefano Stabellini
2012-04-24 15:16 ` Ian Campbell
2012-04-24 10:45 ` [PATCH v4 2/8] libxl: libxl__device_disk_local_attach return a new libxl_device_disk Stefano Stabellini
2012-04-24 15:02 ` Ian Jackson
2012-04-24 15:25 ` Ian Campbell
2012-04-24 10:45 ` [PATCH v4 3/8] libxl: add a transaction parameter to libxl__device_generic_add Stefano Stabellini
2012-04-24 15:34 ` Ian Jackson
2012-04-24 10:45 ` [PATCH v4 4/8] libxl: introduce libxl__device_disk_add_t Stefano Stabellini
2012-04-24 15:42 ` Ian Jackson
2012-04-24 16:02 ` Ian Jackson
2012-05-04 16:30 ` [PATCH v4 4/8] libxl: introduce libxl__device_disk_add_t [and 1 more messages] Ian Jackson
2012-04-24 10:45 ` [PATCH v4 5/8] xl/libxl: add a blkdev_start parameter Stefano Stabellini
2012-04-24 14:52 ` Ian Jackson
2012-04-24 10:45 ` [PATCH v4 6/8] libxl: introduce libxl__alloc_vdev Stefano Stabellini
2012-04-24 14:58 ` Ian Jackson
2012-04-24 15:04 ` Ian Campbell
2012-04-24 15:16 ` Ian Jackson
2012-04-24 10:45 ` [PATCH v4 7/8] xl/libxl: implement QDISK libxl_device_disk_local_attach Stefano Stabellini
2012-04-24 15:39 ` Ian Jackson
2012-04-24 10:45 ` [PATCH v4 8/8] libxl__device_disk_local_attach: wait for state "connected" Stefano Stabellini
2012-04-24 15:18 ` Ian Jackson
2012-05-04 14:49 ` [PATCH v5 4/8] libxl: introduce libxl__device_disk_add Ian Campbell
2012-05-04 11:13 ` [PATCH v5 5/8] xl/libxl: add a blkdev_start parameter Stefano Stabellini
2012-05-04 14:54 ` Ian Campbell [this message]
2012-05-04 16:32 ` Ian Jackson
2012-05-04 11:13 ` [PATCH v5 6/8] libxl: introduce libxl__alloc_vdev Stefano Stabellini
2012-05-04 14:59 ` Ian Campbell
2012-05-04 16:46 ` Ian Jackson
2012-05-04 17:08 ` Ian Campbell
2012-05-04 17:16 ` Ian Jackson
2012-05-04 17:20 ` Ian Campbell
2012-05-14 13:48 ` Stefano Stabellini
2012-05-14 13:56 ` Ian Campbell
2012-05-04 16:39 ` Ian Jackson
2012-05-14 14:10 ` Stefano Stabellini
2012-05-14 14:22 ` Ian Jackson
2012-05-14 14:43 ` Stefano Stabellini
2012-05-04 11:13 ` [PATCH v5 7/8] xl/libxl: implement QDISK libxl_device_disk_local_attach Stefano Stabellini
2012-05-04 15:11 ` Ian Campbell
2012-05-04 16:42 ` Ian Jackson
2012-05-14 14:13 ` Stefano Stabellini
2012-05-14 14:23 ` Ian Jackson
2012-05-14 14:45 ` Stefano Stabellini
2012-05-14 14:46 ` Ian Jackson
2012-05-14 14:52 ` Stefano Stabellini
2012-05-04 11:13 ` [PATCH v5 8/8] libxl__device_disk_local_attach: wait for state "connected" Stefano Stabellini
2012-05-04 15:13 ` Ian Campbell
2012-05-14 14:16 ` Stefano Stabellini
2012-05-10 13:07 ` [PATCH v5 0/8] qdisk local attach Jan Beulich
2012-05-11 15:57 ` Stefano Stabellini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1336143294.7535.13.camel@zakaz.uk.xensource.com \
--to=ian.campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).