[libvirt] [PATCH]: Add floppy support to xm_internal

Yes, you read the subject right; add floppy support to xm internal. Let's just say I didn't do this by choice. In any case, there was a cryptic comment in xenXMParseXMLDisks() that said: /* Xend (all versions) put the floppy device config * under the hvm (image (os)) block */ What this actually means is that we shouldn't parse the floppy stuff to put it in the "disks =" section of the /etc/xen configuration file, since it doesn't have meaning there. Instead, floppy disks go at the top-level of a Xen config file, like: fda = '/var/lib/xen/images/floppy.img' fdb = '/var/lib/xen/images/floppy2.img' That's exactly what this patch does. In combination with a couple of other small patches to virt-install (which I will post to the appropriate list), I was able to use a floppy disk to hold the kickstart for a fully virtualized Xen guest install. Signed-off-by: Chris Lalancette <clalance@redhat.com>

On Fri, Jul 18, 2008 at 02:05:06PM +0200, Chris Lalancette wrote:
Yes, you read the subject right; add floppy support to xm internal. Let's just say I didn't do this by choice. In any case, there was a cryptic comment in xenXMParseXMLDisks() that said:
/* Xend (all versions) put the floppy device config * under the hvm (image (os)) block */
What this actually means is that we shouldn't parse the floppy stuff to put it in the "disks =" section of the /etc/xen configuration file, since it doesn't have meaning there. Instead, floppy disks go at the top-level of a Xen config file, like:
fda = '/var/lib/xen/images/floppy.img' fdb = '/var/lib/xen/images/floppy2.img'
That's exactly what this patch does. In combination with a couple of other small patches to virt-install (which I will post to the appropriate list), I was able to use a floppy disk to hold the kickstart for a fully virtualized Xen guest install.
Sorry, this patch is no use - there is a stack of patches pending review which re-write the XM and XenD driver's XML handling from scratch to use the new generic domain XML APIs. The floppy stuff will have to stack on top of that: http://www.redhat.com/archives/libvir-list/2008-July/msg00084.html Regards, Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Daniel P. Berrange wrote:
Sorry, this patch is no use - there is a stack of patches pending review which re-write the XM and XenD driver's XML handling from scratch to use the new generic domain XML APIs. The floppy stuff will have to stack on top of that:
That's OK; the same general idea should apply, and I'll need to backport this to 0.3.3 anyway. I'm just looking to see if the basic idea is sane. Chris Lalancette

On Fri, Jul 18, 2008 at 02:05:06PM +0200, Chris Lalancette wrote:
What this actually means is that we shouldn't parse the floppy stuff to put it in the "disks =" section of the /etc/xen configuration file, since it doesn't have meaning there. Instead, floppy disks go at the top-level of a Xen config file, like:
Hmm, is your patch so complicated just because you have to support /etc/xen .py style output on your old Xen versions? Our version of this patch is just: diff --git a/src/xml.c b/src/xml.c --- libvirt-0.4.0/src/xml.c +++ libvirt-0.4.0/src/xml.c @@ -1292,8 +1292,20 @@ virDomainParseXMLDiskDesc(virConnectPtr /* Xend (all versions) put the floppy device config * under the hvm (image (os)) block + * + * (image + * (hvm + * (fda <file>) + * ) + * ) */ if (hvm && device && !strcmp((const char *) device, "floppy")) { + virBufferAdd(buf, "(image ", 7); + virBufferAdd(buf, "(hvm ", 5); + virBufferVSprintf(buf, "(%s %s)", (const char *) target, + (const char *) source); + virBufferAdd(buf, ")", 1); + virBufferAdd(buf, ")", 1); goto cleanup; }

On Fri, Jul 18, 2008 at 05:31:27PM +0100, John Levon wrote:
On Fri, Jul 18, 2008 at 02:05:06PM +0200, Chris Lalancette wrote:
What this actually means is that we shouldn't parse the floppy stuff to put it in the "disks =" section of the /etc/xen configuration file, since it doesn't have meaning there. Instead, floppy disks go at the top-level of a Xen config file, like:
Hmm, is your patch so complicated just because you have to support /etc/xen .py style output on your old Xen versions?
Yep, we need both cases in fact - the SEXPR stuff you show below for creating live domains, or inactive domains on Xen > 3.0.4. Or the stuff Chris does is just for inactive domains on Xen < 3.0.4 in /etc/xen style format. Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (3)
-
Chris Lalancette
-
Daniel P. Berrange
-
John Levon