Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-03-10 Thread Richard W.M. Jones
On Sun, Mar 09, 2008 at 09:11:49PM +, Daniel P. Berrange wrote:
 The problem is that the Xen driver expects the OS type to be 'linux'
 but the capabilities XML is advertising the OS type as 'xen'. Technically
 'xen' is the correct value, since its refering to a guest ABI  the ABI
 is xen, not linux. Since we can't break XML semantics we have to stick 
 with 'linux'. Thus I've added a workaround to make virt-install still
 use 'linux' if talking to the Xen driver. 

Can we not make the Xen driver accept either?

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-03-10 Thread Daniel P. Berrange
On Mon, Mar 10, 2008 at 11:33:49AM +, Richard W.M. Jones wrote:
 On Sun, Mar 09, 2008 at 09:11:49PM +, Daniel P. Berrange wrote:
  The problem is that the Xen driver expects the OS type to be 'linux'
  but the capabilities XML is advertising the OS type as 'xen'. Technically
  'xen' is the correct value, since its refering to a guest ABI  the ABI
  is xen, not linux. Since we can't break XML semantics we have to stick 
  with 'linux'. Thus I've added a workaround to make virt-install still
  use 'linux' if talking to the Xen driver. 
 
 Can we not make the Xen driver accept either?

It does accept either now - in fact it accepts anything which isn't 'hvm'
for the paravirt case. I changed virt-install though so that it is compat
with libvirt  0.4.1, and when generating XML it'll still use 'linux'

Dan.
-- 
|: Red Hat, Engineering, Boston   -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 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-03-09 Thread Daniel P. Berrange
On Fri, Mar 07, 2008 at 02:50:03PM +, Mark McLoughlin wrote:
 On Sun, 2008-02-03 at 18:47 +, Daniel P. Berrange wrote:
  -
  -if ((str == NULL) || (strcmp(str, hvm))) {
  -res = virDomainParseXMLOSDescPV(conn, node,
  -buf, ctxt,
  -xendConfigVersion);
  -} else {
  +if ((str != NULL)  STREQ(str, hvm))
   hvm = 1;
  -res = virDomainParseXMLOSDescHVM(conn, node, buf, ctxt,
  - vcpus, xendConfigVersion);
  -}
  +xmlFree(str);
  +str = NULL;
   
  -free(str);
  +if (hvm)
  +virBufferAdd(buf, (image (hvm , 12);
  +else
  +virBufferAdd(buf, (image (linux , 14);
 
 Okay, I was seeing something weird that is at least somewhat related to
 this patch.
 
 This is with libvirt-0.4.0-5.fc9.i386 and python-virtinst cset
 374:507a70e9ed10
 
 Trying to do a paravirt install with virt-install I was seeing it blow
 up with virDomainCreateLinux() failed XML description for domain is not
 well formed or invalid
 
 The problem was ostypexen/type
 
 Changing that to ostypelinux/type made it work fine
 
 Updating to libvirt CVS made it work fine too, since you now don't check
 that the os type is linux
 
 Dunno, haven't looked into this much and I'm not sure if it's of any
 real concern ... just thought I'd mention it.

The problem is that the Xen driver expects the OS type to be 'linux'
but the capabilities XML is advertising the OS type as 'xen'. Technically
'xen' is the correct value, since its refering to a guest ABI  the ABI
is xen, not linux. Since we can't break XML semantics we have to stick 
with 'linux'. Thus I've added a workaround to make virt-install still
use 'linux' if talking to the Xen driver. 

Dan.
-- 
|: Red Hat, Engineering, Boston   -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 :|

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-03-07 Thread Mark McLoughlin
On Sun, 2008-02-03 at 18:47 +, Daniel P. Berrange wrote:
 -
 -if ((str == NULL) || (strcmp(str, hvm))) {
 -res = virDomainParseXMLOSDescPV(conn, node,
 -buf, ctxt,
 -xendConfigVersion);
 -} else {
 +if ((str != NULL)  STREQ(str, hvm))
  hvm = 1;
 -res = virDomainParseXMLOSDescHVM(conn, node, buf, ctxt,
 - vcpus, xendConfigVersion);
 -}
 +xmlFree(str);
 +str = NULL;
  
 -free(str);
 +if (hvm)
 +virBufferAdd(buf, (image (hvm , 12);
 +else
 +virBufferAdd(buf, (image (linux , 14);

Okay, I was seeing something weird that is at least somewhat related to
this patch.

This is with libvirt-0.4.0-5.fc9.i386 and python-virtinst cset
374:507a70e9ed10

Trying to do a paravirt install with virt-install I was seeing it blow
up with virDomainCreateLinux() failed XML description for domain is not
well formed or invalid

The problem was ostypexen/type

Changing that to ostypelinux/type made it work fine

Updating to libvirt CVS made it work fine too, since you now don't check
that the os type is linux

Dunno, haven't looked into this much and I'm not sure if it's of any
real concern ... just thought I'd mention it.

Cheers,
Mark.

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-02-05 Thread Jim Meyering
Daniel P. Berrange [EMAIL PROTECTED] wrote:
 The latest xen-unstable tree has support for booting HVM guests using an
 explicit kernel+initrd+cmdline, as an alternative to the traditional BIOS
 boot from harddisk/cdrom/network.  This gives Xen HVM parity with KVM in
 terms of boot methods. The current libvirt Xen driver though assumes that
 Xen paravirt is always kernel+initrd or bootloader based, while Xen HVM
 is always BIOS based.
...

This patch looks fine to me, too.

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-02-04 Thread Richard W.M. Jones

Daniel P. Berrange wrote:
[...]

Looks good, but needs to update the documentation too.

Rich.

--
Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903


smime.p7s
Description: S/MIME Cryptographic Signature
--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list


Re: [Libvir] PATCH: Allow Xen HVM kernel+initrd booting

2008-02-04 Thread Daniel P. Berrange
On Mon, Feb 04, 2008 at 09:44:12AM -0500, Daniel Veillard wrote:
 
   So basically Xen PV, Xen FV and KVM  os blocks should now share the
 same set of functionalities, sharight the same syntax, right ? And the
 refactoring comes from the 3 being able to share more code, if yes that
 sounds excellent :-)

Almost the same. pv guests won't have use for a boot dev=c/ tag
since they have no BIOS, nor do they have a loader tag, but other
than that they're the same.

  domain type='xen'
namekernel/name
uuid06ed00fe-1162-4fc4-b5d8-11993ee4a8b9/uuid
os
  typehvm/type
  loader/usr/lib/xen/boot/hvmloader/loader
  kernel/root/vmlinuz.f864/kernel
  initrd/root/initrd.img.f864/initrd
  cmdlineconsole=ttyS0 console=tty0/cmdline
/os
memory540672/memory
currentMemory531456/currentMemory
vcpu1/vcpu
on_poweroffpreserve/on_poweroff
on_rebootpreserve/on_reboot
on_crashpreserve/on_crash
features
  acpi/
  apic/
  pae/
/features
devices
  emulator/usr/lib64/xen/bin/qemu-dm/emulator
  interface type='bridge'
source bridge='xenbr0'/
mac address='00:16:3e:0e:e8:b7'/
script path='vif-bridge'/
  /interface
  disk type='file' device='disk'
driver name='file'/
source file='/root/kernel.img'/
target dev='hda'/
  /disk
  input type='mouse' bus='ps2'/
  graphics type='vnc' port='-1' listen='0.0.0.0'/
  console tty='pty'/
/devices
  /domain
 
   If we were to switch that domain to PV, the change would basically
 to remove os/loader and devices/emulator, change os/type to be linux,
 and then get kernel and initrd to point to the PV versions, right ?

No need to get rid of devices/emulator - that's valid for paravirt
guests too now - qemu-dm is used to provide the VNC / SDL framebuffer
and text console in paravirt guests too now. So merely remove loader
and the os/type to linux.

  +/* 
  + * Originally XenD abused the 'kernel' parameter for the HVM
  + * firmware. New XenD allows HVM guests to boot from a kernel
  + * and if this is enabled, the HVM firmware must use the new
  + * 'loader' parameter
  + */
  +if (hasKernel) {
  +virBufferVSprintf(buf, (loader '%s'), (const char *) loader);
   } else {
   virBufferVSprintf(buf, (kernel '%s'), (const char *) loader);
   }
 
   What happen if someone uses libvirt-0.4.1 with an old xend and an HVM
 with kernel XML description is given ? I suppose (kernel) gets ignored
 but it fails because the loader is not proper.

Yep, user error. If they try to use a kernel+initrd on an old XenD there's
nothing we can do to make it work. I don't want to do a Xen version check
in libvirt though, because this kernel+initrd stuff is something I backport
to the Xen currently in Fedora so any version check would be bogus.

Dan.
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-   Perl modules: http://search.cpan.org/~danberr/  -=|
|=-   Projects: http://freshmeat.net/~danielpb/   -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

--
Libvir-list mailing list
Libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list