Hi, when I want to boot a guest from a floppy then this works with ''xm/xend'' but not with ''xl''. An example guest config line is this: fda = ''/data/images/guests/XPmode64/Win764.flp'' Christoph -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2011-03-01 at 09:37 +0000, Christoph Egger wrote:> Hi, > > when I want to boot a guest from a floppy then > this works with ''xm/xend'' but not with ''xl''. > > An example guest config line is this: > > fda = ''/data/images/guests/XPmode64/Win764.flp''Looks like there is no floppy disk support in libxl at all :-/. I guess noone missed it up until now. Adding it probably wouldn''t be too hard, but it is too late for 4.1.0, we should definitely queue this work up for 4.2 and consider for a 4.1.1 backport. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2011-03-01 at 10:38 +0000, Ian Campbell wrote:> On Tue, 2011-03-01 at 09:37 +0000, Christoph Egger wrote: > > Hi, > > > > when I want to boot a guest from a floppy then > > this works with ''xm/xend'' but not with ''xl''. > > > > An example guest config line is this: > > > > fda = ''/data/images/guests/XPmode64/Win764.flp'' > > Looks like there is no floppy disk support in libxl at all :-/. I guess > noone missed it up until now.I just guessed xen didn''t support it at all! Never saw any code for it on my travels. Wow _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2011-03-01 at 12:00 +0000, Gianni Tedesco wrote:> On Tue, 2011-03-01 at 10:38 +0000, Ian Campbell wrote: > > On Tue, 2011-03-01 at 09:37 +0000, Christoph Egger wrote: > > > Hi, > > > > > > when I want to boot a guest from a floppy then > > > this works with ''xm/xend'' but not with ''xl''. > > > > > > An example guest config line is this: > > > > > > fda = ''/data/images/guests/XPmode64/Win764.flp'' > > > > Looks like there is no floppy disk support in libxl at all :-/. I guess > > noone missed it up until now. > > I just guessed xen didn''t support it at all! Never saw any code for it > on my travels.It''s only for HVM guests. I think it''s as simple as passing "-fda /path/to/img" to qemu-dm but of course you still need to plumb that through. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 03/01/2011 12:11 PM, Ian Campbell wrote:> It''s only for HVM guests. I think it''s as simple as passing > "-fda /path/to/img" to qemu-dm but of course you still need to plumb > that through. >xenops support passing arbitrary extra arguments to qemu-dm, so I will suggest someone add the same feature to xl. It''s generally useful for passing new flags (or debugging) without having to modify the toolstack. -- Vincent _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2011-03-01 at 12:31 +0000, Vincent Hanquez wrote:> On 03/01/2011 12:11 PM, Ian Campbell wrote: > > It''s only for HVM guests. I think it''s as simple as passing > > "-fda /path/to/img" to qemu-dm but of course you still need to plumb > > that through. > > > xenops support passing arbitrary extra arguments to qemu-dm, so I will > suggest someone add the same feature to xl.libxl has the support but it''s not plumbed through to xl :-(> It''s generally useful for passing new flags (or debugging) without > having to modify the toolstack.Absolutely. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell writes ("Re: [Xen-devel] xl vs. xm: floppy support"):> On Tue, 2011-03-01 at 12:31 +0000, Vincent Hanquez wrote: > > xenops support passing arbitrary extra arguments to qemu-dm, so I will > > suggest someone add the same feature to xl. > > libxl has the support but it''s not plumbed through to xl :-(This ought to be fixed for 4.1 I think. It''s quite an important escape hatch. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 1 Mar 2011, Ian Jackson wrote:> Ian Campbell writes ("Re: [Xen-devel] xl vs. xm: floppy support"): > > On Tue, 2011-03-01 at 12:31 +0000, Vincent Hanquez wrote: > > > xenops support passing arbitrary extra arguments to qemu-dm, so I will > > > suggest someone add the same feature to xl. > > > > libxl has the support but it''s not plumbed through to xl :-( > > This ought to be fixed for 4.1 I think. It''s quite an important > escape hatch. >I am ok with having this in 4.1. At this point we could have the two lines fix to support dm_args as well (libxenlight already supports optional device model arguments, we just need to parse dm_args in xl). _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2011-03-01 at 18:00 +0000, Stefano Stabellini wrote:> On Tue, 1 Mar 2011, Ian Jackson wrote: > > Ian Campbell writes ("Re: [Xen-devel] xl vs. xm: floppy support"): > > > On Tue, 2011-03-01 at 12:31 +0000, Vincent Hanquez wrote: > > > > xenops support passing arbitrary extra arguments to qemu-dm, so I will > > > > suggest someone add the same feature to xl. > > > > > > libxl has the support but it''s not plumbed through to xl :-( > > > > This ought to be fixed for 4.1 I think. It''s quite an important > > escape hatch. > > > > I am ok with having this in 4.1. > At this point we could have the two lines fix to support dm_args as well > (libxenlight already supports optional device model arguments, we just > need to parse dm_args in xl).I think that''s the "escape hatch" Ian was referring to. I''ll knock up a patch in the morning. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, 2011-03-01 at 20:29 +0000, Ian Campbell wrote:> > I''ll knock up a patch in the morning.... 8<------------------------------ # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1299058136 0 # Node ID 9d024bdd2d876ad0d42a35dfeff6a6ec7dbcb0e3 # Parent 372852e09e8071e1de82b5f5e2a163b751c3d2cc xl: add "device_model_args" to pass arbitrary extra arguments to device model The libxl support was already in place so simply plumb it through. This allows for passing debug options to the device model and provides a method to work around missing toolstack functionality. e.g. xl does not current support floppy disks but adding: device_model_args = [ "-fda", "/scratch/fdboot.img" ] allowed me to boot FreeDOS from a floppy image. I was unable to find any equivalent functionality in xend so this is a new xl feature. Moved xmalloc/xrealloc earlier to allow use from parse_config_data. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r 372852e09e80 -r 9d024bdd2d87 tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Wed Mar 02 08:47:50 2011 +0000 +++ b/tools/libxl/xl_cmdimpl.c Wed Mar 02 09:28:56 2011 +0000 @@ -242,6 +242,26 @@ release_lock: fd_lock = -1; return rc; +} + +static void *xmalloc(size_t sz) { + void *r; + r = malloc(sz); + if (!r) { fprintf(stderr,"xl: Unable to malloc %lu bytes.\n", + (unsigned long)sz); exit(-ERROR_FAIL); } + return r; +} + +static void *xrealloc(void *ptr, size_t sz) { + void *r; + if (!sz) { free(ptr); return 0; } + /* realloc(non-0, 0) has a useless return value; + * but xrealloc(anything, 0) is like free + */ + r = realloc(ptr, sz); + if (!r) { fprintf(stderr,"xl: Unable to realloc to %lu bytes.\n", + (unsigned long)sz); exit(-ERROR_FAIL); } + return r; } #define LOG(_f, _a...) dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a) @@ -1087,6 +1107,9 @@ skip_vfb: } if (c_info->hvm == 1) { + XLU_ConfigList *dmargs; + int nr_dmargs = 0; + /* init dm from c and b */ libxl_init_dm_info(dm_info, c_info, b_info); @@ -1119,31 +1142,22 @@ skip_vfb: xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw); if (!xlu_cfg_get_long (config, "xen_platform_pci", &l)) dm_info->xen_platform_pci = l; + + if (!xlu_cfg_get_list(config, "device_model_args", &dmargs, &nr_dmargs, 0)) + { + int i; + dm_info->extra = xmalloc(sizeof(char *) * (nr_dmargs + 1)); + dm_info->extra[nr_dmargs] = NULL; + for (i=0; i<nr_dmargs; i++) { + const char *a = xlu_cfg_get_listitem(dmargs, i); + dm_info->extra[i] = a ? strdup(a) : NULL; + } + } } dm_info->type = c_info->hvm ? XENFV : XENPV; xlu_cfg_destroy(config); -} - -static void *xmalloc(size_t sz) { - void *r; - r = malloc(sz); - if (!r) { fprintf(stderr,"xl: Unable to malloc %lu bytes.\n", - (unsigned long)sz); exit(-ERROR_FAIL); } - return r; -} - -static void *xrealloc(void *ptr, size_t sz) { - void *r; - if (!sz) { free(ptr); return 0; } - /* realloc(non-0, 0) has a useless return value; - * but xrealloc(anything, 0) is like free - */ - r = realloc(ptr, sz); - if (!r) { fprintf(stderr,"xl: Unable to realloc to %lu bytes.\n", - (unsigned long)sz); exit(-ERROR_FAIL); } - return r; } /* Returns 1 if domain should be restarted, 2 if domain should be renamed then restarted */ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, 2011-03-02 at 09:31 +0000, Ian Campbell wrote:> On Tue, 2011-03-01 at 20:29 +0000, Ian Campbell wrote: > > > > I''ll knock up a patch in the morning. > > ...[...]> e.g. xl does not current support floppy disks but adding: > device_model_args = [ "-fda", "/scratch/fdboot.img" ] > allowed me to boot FreeDOS from a floppy image.We may as well have a patch for direct support for fdb/fdb too so we can evaluate it on its merits for 4.1. I''ve no problem with deferring this to 4.2 at this stage in the release but it is a pretty straightforward patch... This doesn''t support stubdoms, not sure how that works in the xend case either, but I''m pretty certain that patch would be too big for this stage in the release. 8<---------------------------------------------- # HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1299059966 0 # Node ID b91f5ffd1a6a863af6050e65f8d315fdcbceb5d9 # Parent 6c3ee3d7fd98768f17b24fcc96d2fb86914deb7f libxl/xl: support floppy disk images for HVM guests Signed-off-by: Ian Campbell <ian.campbell@citrix.com> diff -r 6c3ee3d7fd98 -r b91f5ffd1a6a tools/libxl/libxl.idl --- a/tools/libxl/libxl.idl Wed Mar 02 09:40:55 2011 +0000 +++ b/tools/libxl/libxl.idl Wed Mar 02 09:59:26 2011 +0000 @@ -164,6 +164,8 @@ libxl_device_model_info = Struct("device ("vcpu_avail", integer, False, "vcpus actually available"), ("xen_platform_pci", integer, False, "enable/disable the xen platform pci device"), ("extra", libxl_string_list, False, "extra parameters pass directly to qemu, NULL terminated"), + ("fda", string, False, "floppy disk image, first drive"), + ("fdb", string, False, "floppy disk image, second drive"), ], comment """Device Model information. diff -r 6c3ee3d7fd98 -r b91f5ffd1a6a tools/libxl/libxl_dm.c --- a/tools/libxl/libxl_dm.c Wed Mar 02 09:40:55 2011 +0000 +++ b/tools/libxl/libxl_dm.c Wed Mar 02 09:59:26 2011 +0000 @@ -119,6 +119,12 @@ static char ** libxl_build_device_model_ } if (info->soundhw) { flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL); + } + if (info->fda) { + flexarray_vappend(dm_args, "-fda", info->fda, NULL); + } + if (info->fdb) { + flexarray_vappend(dm_args, "-fdb", info->fdb, NULL); } if (info->apic) { flexarray_append(dm_args, "-acpi"); @@ -255,6 +261,12 @@ static char ** libxl_build_device_model_ } if (info->soundhw) { flexarray_vappend(dm_args, "-soundhw", info->soundhw, NULL); + } + if (info->fda) { + flexarray_vappend(dm_args, "-fda", info->fda, NULL); + } + if (info->fdb) { + flexarray_vappend(dm_args, "-fdb", info->fdb, NULL); } if (!info->apic) { flexarray_append(dm_args, "-no-acpi"); diff -r 6c3ee3d7fd98 -r b91f5ffd1a6a tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c Wed Mar 02 09:40:55 2011 +0000 +++ b/tools/libxl/xl_cmdimpl.c Wed Mar 02 09:59:26 2011 +0000 @@ -365,6 +365,8 @@ static void printf_info(int domid, printf("\t\t\t(usb %d)\n", dm_info->usb); printf("\t\t\t(usbdevice %s)\n", dm_info->usbdevice); printf("\t\t\t(apic %d)\n", dm_info->apic); + printf("\t\t\t(fda %s)\n", dm_info->fda); + printf("\t\t\t(fdb %s)\n", dm_info->fdb); printf("\t\t)\n"); } else { printf("\t\t(linux %d)\n", b_info->hvm); @@ -1142,7 +1144,8 @@ skip_vfb: xlu_cfg_replace_string (config, "soundhw", &dm_info->soundhw); if (!xlu_cfg_get_long (config, "xen_platform_pci", &l)) dm_info->xen_platform_pci = l; - + xlu_cfg_replace_string (config, "fda", &dm_info->fda); + xlu_cfg_replace_string (config, "fdb", &dm_info->fdb); if (!xlu_cfg_get_list(config, "device_model_args", &dmargs, &nr_dmargs, 0)) { int i; _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Wed, 2 Mar 2011, Ian Campbell wrote:> On Wed, 2011-03-02 at 09:31 +0000, Ian Campbell wrote: > > On Tue, 2011-03-01 at 20:29 +0000, Ian Campbell wrote: > > > > > > I''ll knock up a patch in the morning. > > > > ... > [...] > > e.g. xl does not current support floppy disks but adding: > > device_model_args = [ "-fda", "/scratch/fdboot.img" ] > > allowed me to boot FreeDOS from a floppy image. > > We may as well have a patch for direct support for fdb/fdb too so we can > evaluate it on its merits for 4.1. I''ve no problem with deferring this > to 4.2 at this stage in the release but it is a pretty straightforward > patch... > > This doesn''t support stubdoms, not sure how that works in the xend case > either, but I''m pretty certain that patch would be too big for this > stage in the release.The right way to implement fd* support is probably to create an "fd" disk type, so that we can have frontends and backends for floppies and support stubdoms. However that would be obviously too much for this stage of the release. This patch would solve the simple case but would introduce two fields in the libxl idl that we know are wrong. I would rather implement this kind of simple fd support entirely in xl using the extra field in libxl_device_model_info so that we don''t "corrupt" the idl. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell writes ("Re: [Xen-devel] xl vs. xm: floppy support"):> xl: add "device_model_args" to pass arbitrary extra arguments to device modelThanks, acked and committed. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Stefano Stabellini writes ("Re: [Xen-devel] xl vs. xm: floppy support"):> The right way to implement fd* support is probably to create an "fd" > disk type, so that we can have frontends and backends for floppies and > support stubdoms.Yes.> However that would be obviously too much for this stage of the release. > This patch would solve the simple case but would introduce two fields in > the libxl idl that we know are wrong. > > I would rather implement this kind of simple fd support entirely in xl > using the extra field in libxl_device_model_info so that we don''t > "corrupt" the idl.I think for 4.1 we will should to tell users who want floppy support to use device_model_args. Ian. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, 3 Mar 2011, Ian Jackson wrote:> Stefano Stabellini writes ("Re: [Xen-devel] xl vs. xm: floppy support"): > > The right way to implement fd* support is probably to create an "fd" > > disk type, so that we can have frontends and backends for floppies and > > support stubdoms. > > Yes. > > > However that would be obviously too much for this stage of the release. > > This patch would solve the simple case but would introduce two fields in > > the libxl idl that we know are wrong. > > > > I would rather implement this kind of simple fd support entirely in xl > > using the extra field in libxl_device_model_info so that we don''t > > "corrupt" the idl. > > I think for 4.1 we will should to tell users who want floppy support > to use device_model_args.that would be yet another workaround to document _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel