Re: [libvirt] [PATCH 1/2] bhyve: Support /domain/bootloader configuration for non-FreeBSD guests.

2014-10-28 Thread Michal Privoznik

On 29.10.2014 02:01, Conrad Meyer wrote:

I don't think it's safe to pass arbitrary arguments from XML. I find this
too critical to ACK the patch, buy maybe further discussion can change my
mind.


Michal,

You're reviewing a 4-revision old version of this patch, see v5 for
the most recent set. However, this bit is still present in v5. What is
 in the XML is for, if not arbitrary arguments?



Oh right. I was getting through a lot of e-mails and I didn't notice 
you've posted v5. And yes, you're right -  is designed 
for that. Okay then. Let me see how v5 went.


Michal
___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: [libvirt] [PATCH 1/2] bhyve: Support /domain/bootloader configuration for non-FreeBSD guests.

2014-10-28 Thread Conrad Meyer
> I don't think it's safe to pass arbitrary arguments from XML. I find this
> too critical to ACK the patch, buy maybe further discussion can change my
> mind.

Michal,

You're reviewing a 4-revision old version of this patch, see v5 for
the most recent set. However, this bit is still present in v5. What is
 in the XML is for, if not arbitrary arguments?


Thanks,
Conrad
___
freebsd-virtualization@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: [libvirt] [PATCH 1/2] bhyve: Support /domain/bootloader configuration for non-FreeBSD guests.

2014-10-28 Thread Michal Privoznik

On 23.10.2014 21:58, Conrad Meyer wrote:

Also, flip Bhyve /domain/os/type support from HVM to Xen. Bhyve only
supports paravirtualized guests, and 'xen' is closest to that. We still
default to bhyveloader(1) if no explicit bootloader configuration is
supplied in the domain.

If the /domain/bootloader looks like grub-bhyve and the user doesn't
supply /domain/bootloader_args, we make an intelligent guess and try
chainloading the first partition on the disk.

Caveats:
   - We can't install from CD without explicit bootloader_args.
   - We leave a device.map file lying around in /tmp. I don't see a good
 way not to do so without reworking the API somewhat.

Sponsored by:   EMC / Isilon storage division

Signed-off-by: Conrad Meyer 
---
  docs/drvbhyve.html.in  |  30 +-
  docs/formatdomain.html.in  |   4 +-
  po/libvirt.pot |   4 +
  src/bhyve/bhyve_capabilities.c |   2 +-
  src/bhyve/bhyve_command.c  | 107 +++--
  tests/bhyvexml2argvdata/bhyvexml2argv-acpiapic.xml |   2 +-
  tests/bhyvexml2argvdata/bhyvexml2argv-base.xml |   2 +-
  tests/bhyvexml2argvdata/bhyvexml2argv-console.xml  |   2 +-
  .../bhyvexml2argvdata/bhyvexml2argv-disk-cdrom.xml |   2 +-
  .../bhyvexml2argv-disk-virtio.xml  |   2 +-
  tests/bhyvexml2argvdata/bhyvexml2argv-macaddr.xml  |   2 +-
  tests/bhyvexml2argvdata/bhyvexml2argv-metadata.xml |   2 +-
  tests/bhyvexml2argvdata/bhyvexml2argv-serial.xml   |   2 +-
  .../bhyvexml2xmlout-metadata.xml   |   2 +-
  14 files changed, 139 insertions(+), 26 deletions(-)

diff --git a/docs/drvbhyve.html.in b/docs/drvbhyve.html.in
index 39afdf5..c6c79d7 100644
--- a/docs/drvbhyve.html.in
+++ b/docs/drvbhyve.html.in
@@ -37,8 +37,7 @@ bhyve+ssh://r...@example.com/system (remote access, SSH 
tunnelled)
  Example config
  
  The bhyve driver in libvirt is in its early stage and under active 
development. So it supports
-only limited number of features bhyve provides. All the supported features 
could be found
-in this sample domain XML.
+only limited number of features bhyve provides.
  

  
@@ -50,13 +49,13 @@ up to 31 PCI devices.

  
  
-  bhyve
-  df3be7e7-a104-11e3-aeb0-50e5492bd3dc
+bhyve
+df3be7e7-a104-11e3-aeb0-50e5492bd3dc
  219136
  219136
  1
  
-   hvm
+   xen
  
  

@@ -157,5 +156,26 @@ An example of domain XML device entry for that will look 
like:
  Please refer to the Storage documentation for 
more details on storage
  management.

+Using grub2-bhyve or Alternative Bootloaders
+
+It's possible to boot non-FreeBSD guests by specifying an explicit
+bootloader, e.g. grub-bhyve(1). Arguments to the bootloader may be
+specified as well. If no arguments are given and bootloader is
+grub-bhyve, libvirt will try and boot from the first partition of
+the disk image.
+
+
+  ...
+/usr/local/sbin/grub-bhyve
+...
+  ...
+
+
+(Of course, to install from a CD a user will have to supply explicit
+arguments to grub-bhyve.)
+
+Caveat: bootloader_args does not support any quoting.
+Filenames, etc, must not have spaces or they will be tokenized incorrectly.
+

  
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 0099ce7..b7b6c46 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -217,7 +217,9 @@
a BIOS, and instead the host is responsible to kicking off the
operating system boot. This may use a pseudo-bootloader in the
host to provide an interface to choose a kernel for the guest.
-  An example is pygrub with Xen.
+  An example is pygrub with Xen. The Bhyve hypervisor
+  also uses a host bootloader, either bhyveload or
+  grub-bhyve.
  

  
diff --git a/po/libvirt.pot b/po/libvirt.pot
index 0b44ad7..d8c9a4d 100644
--- a/po/libvirt.pot
+++ b/po/libvirt.pot
@@ -851,6 +851,10 @@ msgstr ""
  msgid "domain should have at least one disk defined"
  msgstr ""

+#: src/bhyve/bhyve_command.c:407
+msgid "Custom loader requires explicit %s configuration"
+msgstr ""
+
  #: src/bhyve/bhyve_device.c:50
  msgid "PCI bus 0 slot 1 is reserved for the implicit LPC PCI-ISA bridge"
  msgstr ""


There's no need for this. The po/* files are regenerated on the release.


diff --git a/src/bhyve/bhyve_capabilities.c b/src/bhyve/bhyve_capabilities.c
index 132ce91..b37a24f 100644
--- a/src/bhyve/bhyve_capabilities.c
+++ b/src/bhyve/bhyve_capabilities.c
@@ -85,7 +85,7 @@ virBhyveCapsBuild(void)
 false, false)) == NULL)
  return NULL;

-if ((guest = virCapabilitiesAddGuest(caps, "hvm",
+if ((guest = virCapabil