Re: [libvirt] [PATCH v10] bhyve: add a basic driver

2014-02-19 Thread Daniel P. Berrange
On Tue, Feb 18, 2014 at 02:08:10PM +0400, Roman Bogorodskiy wrote:
 At this point it has a limited functionality and is highly
 experimental. Supported domain operations are:
 
   * define
   * start
   * destroy
   * dumpxml
   * dominfo
 
 It's only possible to have only one disk device and only one
 network, which should be of type bridge.
 ---
  configure.ac|   7 +
  daemon/libvirtd.c   |   9 +
  include/libvirt/virterror.h |   1 +
  m4/virt-driver-bhyve.m4 |  57 +
  po/POTFILES.in  |   3 +
  src/Makefile.am |  32 +++
  src/bhyve/bhyve_command.c   | 331 
  src/bhyve/bhyve_command.h   |  41 +++
  src/bhyve/bhyve_driver.c| 612 
 
  src/bhyve/bhyve_driver.h|  28 ++
  src/bhyve/bhyve_process.c   | 224 
  src/bhyve/bhyve_process.h   |  36 +++
  src/bhyve/bhyve_utils.h |  48 
  src/conf/domain_conf.c  |   3 +-
  src/conf/domain_conf.h  |   1 +
  src/driver.h|   1 +
  src/libvirt.c   |   3 +
  src/util/virerror.c |   1 +
  18 files changed, 1437 insertions(+), 1 deletion(-)
  create mode 100644 m4/virt-driver-bhyve.m4
  create mode 100644 src/bhyve/bhyve_command.c
  create mode 100644 src/bhyve/bhyve_command.h
  create mode 100644 src/bhyve/bhyve_driver.c
  create mode 100644 src/bhyve/bhyve_driver.h
  create mode 100644 src/bhyve/bhyve_process.c
  create mode 100644 src/bhyve/bhyve_process.h
  create mode 100644 src/bhyve/bhyve_utils.h

ACK, and pushed to GIT.

Great job getting this new driver up  running, and welcome to
the libvirt committers team.

Daniel
-- 
|: http://berrange.com  -o-http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org  -o- http://virt-manager.org :|
|: http://autobuild.org   -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org   -o-   http://live.gnome.org/gtk-vnc :|

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


Re: [libvirt] [PATCH v10] bhyve: add a basic driver

2014-02-19 Thread Roman Bogorodskiy
  Daniel P. Berrange wrote:

 ACK, and pushed to GIT.
 
 Great job getting this new driver up  running, and welcome to
 the libvirt committers team.

Superb! Thanks!

Roman Bogorodskiy

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


[libvirt] [PATCH v10] bhyve: add a basic driver

2014-02-18 Thread Roman Bogorodskiy
Changes from v9:
 - Fix AC_PATH_PROG macro usage for bhyve tools
 - Check for readdir() failures
 - Make sure we go only with disk type 'file'
 - Remove unneeded locking from bhyveConnectGetCapabilities()
 - Don't check for NULL before calling virObjectUnlock()
 - s/INFO/DEBUG/ for low level domain operations
 - Ignore logfd close errors in bhyve_process.c
 - Drop unneeded virReportError for virDomainDefParseString()
 - Indent and style fixes

Changes from v8:
 - Implement domainUndefine and two more functions it depends on:
   domainIsActive and bhyveDomainIsPersistent

Changes from v7:
 - Squashed in ACL support
 - Check for disk and bus type for bhyve and disk type for bhyveload
 - Handle case when URI == NULL in ConnectOpen
 - Call bhyveload only after we've built bhyve command to avoid
   unneeded load/reload for wrong domain configuration
 - Cleanup unload calls on errors
 - Minor style fixes

Changes from v6:
 - Fix typo: s/LIBIVRT_DRIVER_RESULT_BHYVE/LIBVIRT_DRIVER_RESULT_BHYVE/
 - Report domain state in 'dominfo'
 - Add a patch which implements ACL support

Now both 'make check' and 'make syntax-check' pass.

Changes from v5:
 - Obtain version using uname(3)
 - Cleanup driver global objects in StateCleanup instead
   of ConnectClose

Changes from v4:
 - Set acpi and apic flags based on domain definition
 - Add more detailed description about -H and -P flags
   of bhyve to justify theirs usage

Roman Bogorodskiy (1):
  bhyve: add a basic driver

 configure.ac|   7 +
 daemon/libvirtd.c   |   9 +
 include/libvirt/virterror.h |   1 +
 m4/virt-driver-bhyve.m4 |  57 +
 po/POTFILES.in  |   3 +
 src/Makefile.am |  32 +++
 src/bhyve/bhyve_command.c   | 331 
 src/bhyve/bhyve_command.h   |  41 +++
 src/bhyve/bhyve_driver.c| 612 
 src/bhyve/bhyve_driver.h|  28 ++
 src/bhyve/bhyve_process.c   | 224 
 src/bhyve/bhyve_process.h   |  36 +++
 src/bhyve/bhyve_utils.h |  48 
 src/conf/domain_conf.c  |   3 +-
 src/conf/domain_conf.h  |   1 +
 src/driver.h|   1 +
 src/libvirt.c   |   3 +
 src/util/virerror.c |   1 +
 18 files changed, 1437 insertions(+), 1 deletion(-)
 create mode 100644 m4/virt-driver-bhyve.m4
 create mode 100644 src/bhyve/bhyve_command.c
 create mode 100644 src/bhyve/bhyve_command.h
 create mode 100644 src/bhyve/bhyve_driver.c
 create mode 100644 src/bhyve/bhyve_driver.h
 create mode 100644 src/bhyve/bhyve_process.c
 create mode 100644 src/bhyve/bhyve_process.h
 create mode 100644 src/bhyve/bhyve_utils.h

-- 
1.8.4.3

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


[libvirt] [PATCH v10] bhyve: add a basic driver

2014-02-18 Thread Roman Bogorodskiy
At this point it has a limited functionality and is highly
experimental. Supported domain operations are:

  * define
  * start
  * destroy
  * dumpxml
  * dominfo

It's only possible to have only one disk device and only one
network, which should be of type bridge.
---
 configure.ac|   7 +
 daemon/libvirtd.c   |   9 +
 include/libvirt/virterror.h |   1 +
 m4/virt-driver-bhyve.m4 |  57 +
 po/POTFILES.in  |   3 +
 src/Makefile.am |  32 +++
 src/bhyve/bhyve_command.c   | 331 
 src/bhyve/bhyve_command.h   |  41 +++
 src/bhyve/bhyve_driver.c| 612 
 src/bhyve/bhyve_driver.h|  28 ++
 src/bhyve/bhyve_process.c   | 224 
 src/bhyve/bhyve_process.h   |  36 +++
 src/bhyve/bhyve_utils.h |  48 
 src/conf/domain_conf.c  |   3 +-
 src/conf/domain_conf.h  |   1 +
 src/driver.h|   1 +
 src/libvirt.c   |   3 +
 src/util/virerror.c |   1 +
 18 files changed, 1437 insertions(+), 1 deletion(-)
 create mode 100644 m4/virt-driver-bhyve.m4
 create mode 100644 src/bhyve/bhyve_command.c
 create mode 100644 src/bhyve/bhyve_command.h
 create mode 100644 src/bhyve/bhyve_driver.c
 create mode 100644 src/bhyve/bhyve_driver.h
 create mode 100644 src/bhyve/bhyve_process.c
 create mode 100644 src/bhyve/bhyve_process.h
 create mode 100644 src/bhyve/bhyve_utils.h

diff --git a/configure.ac b/configure.ac
index 0d505d3..47bc427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1048,6 +1048,12 @@ fi
 AM_CONDITIONAL([WITH_PARALLELS], [test $with_parallels = yes])
 
 dnl
+dnl Checks for bhyve driver
+dnl
+
+LIBVIRT_DRIVER_CHECK_BHYVE
+
+dnl
 dnl check for shell that understands  redirection without truncation,
 dnl needed by src/qemu/qemu_monitor_{text,json}.c.
 dnl
@@ -2705,6 +2711,7 @@ AC_MSG_NOTICE([ PHYP: $with_phyp])
 AC_MSG_NOTICE([  ESX: $with_esx])
 AC_MSG_NOTICE([  Hyper-V: $with_hyperv])
 AC_MSG_NOTICE([Parallels: $with_parallels])
+LIBVIRT_DRIVER_RESULT_BHYVE
 AC_MSG_NOTICE([ Test: $with_test])
 AC_MSG_NOTICE([   Remote: $with_remote])
 AC_MSG_NOTICE([  Network: $with_network])
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index 49c42ad..b27c6fd 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -77,6 +77,9 @@
 # ifdef WITH_VBOX
 #  include vbox/vbox_driver.h
 # endif
+# ifdef WITH_BHYVE
+#  include bhyve/bhyve_driver.h
+# endif
 # ifdef WITH_NETWORK
 #  include network/bridge_driver.h
 # endif
@@ -405,6 +408,9 @@ static void daemonInitialize(void)
 # ifdef WITH_VBOX
 virDriverLoadModule(vbox);
 # endif
+# ifdef WITH_BHYVE
+virDriverLoadModule(bhyve);
+# endif
 #else
 # ifdef WITH_NETWORK
 networkRegister();
@@ -442,6 +448,9 @@ static void daemonInitialize(void)
 # ifdef WITH_VBOX
 vboxRegister();
 # endif
+# ifdef WITH_BHYVE
+bhyveRegister();
+# endif
 #endif
 }
 
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
index e31e9c4..cc6569d 100644
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -120,6 +120,7 @@ typedef enum {
 
 VIR_FROM_ACCESS = 55,   /* Error from access control manager */
 VIR_FROM_SYSTEMD = 56,  /* Error from systemd code */
+VIR_FROM_BHYVE = 57,/* Error from bhyve driver */
 
 # ifdef VIR_ENUM_SENTINELS
 VIR_ERR_DOMAIN_LAST
diff --git a/m4/virt-driver-bhyve.m4 b/m4/virt-driver-bhyve.m4
new file mode 100644
index 000..9c0030b
--- /dev/null
+++ b/m4/virt-driver-bhyve.m4
@@ -0,0 +1,57 @@
+dnl The bhyve driver
+dnl
+dnl Copyright (C) 2014 Roman Bogorodskiy
+dnl
+dnl This library is free software; you can redistribute it and/or
+dnl modify it under the terms of the GNU Lesser General Public
+dnl License as published by the Free Software Foundation; either
+dnl version 2.1 of the License, or (at your option) any later version.
+dnl
+dnl This library is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl Lesser General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU Lesser General Public
+dnl License along with this library.  If not, see
+dnl http://www.gnu.org/licenses/.
+dnl
+
+AC_DEFUN([LIBVIRT_DRIVER_CHECK_BHYVE],[
+AC_ARG_WITH([bhyve],
+  [AS_HELP_STRING([--with-bhyve],
+[add BHyVe support @:@default=check@:@])])
+m4_divert_text([DEFAULTS], [with_bhyve=check])
+
+if test $with_bhyve != no; then
+AC_PATH_PROG([BHYVE], [bhyve], [], [$PATH:/usr/sbin])
+AC_PATH_PROG([BHYVECTL], [bhyvectl], [], [$PATH:/usr/sbin])
+AC_PATH_PROG([BHYVELOAD], [bhyveload], [], [$PATH:/usr/sbin/])
+
+if test -z $BHYVE || test -z $BHYVECTL \
+test -z $BHYVELOAD || test $with_freebsd = no; then
+if test $with_bhyve = check; then
+with_bhyve=no
+else