From 05df5a64843f2bd4e9a5197d97608d41b2e6dc43 Mon Sep 17 00:00:00 2001 From: Roman Bogorodskiy Date: Thu, 10 Apr 2014 21:54:37 +0400 Subject: [PATCH] Add bhyve support Allow connection to bhyve using bhyve:///system URI. That is disabled by default and could be enabled using the new configure option 'with-bhyve'. --- setup.py | 5 +++++ virtManager/config.py | 1 + virtManager/connect.py | 9 +++++++-- virtcli/cliconfig.py | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e6c51f713..33d2069b6 100755 --- a/setup.py +++ b/setup.py @@ -324,6 +324,8 @@ class configure(Command): "Hide config bits that are not considered stable (default=no)"), ("default-graphics=", None, "Default graphics type (spice or vnc) (default=spice)"), + ("with-bhyve=", None, + "whether enable Bhyve connection support (default=no)"), ] description = "Configure the build, similar to ./configure" @@ -341,6 +343,7 @@ class configure(Command): self.preferred_distros = None self.stable_defaults = None self.default_graphics = None + self.with_bhyve = None def run(self): @@ -364,6 +367,8 @@ class configure(Command): self.stable_defaults) if self.default_graphics is not None: template += "default_graphics = %s\n" % self.default_graphics + if self.with_bhyve is not None: + template += "with_bhyve = %s\n" % self.with_bhyve file(cliconfig.cfgpath, "w").write(template) print "Generated %s" % cliconfig.cfgpath diff --git a/virtManager/config.py b/virtManager/config.py index b451d0ab9..b24fee5b7 100644 --- a/virtManager/config.py +++ b/virtManager/config.py @@ -161,6 +161,7 @@ class vmmConfig(object): self.libvirt_packages = cliconfig.libvirt_packages self.askpass_package = cliconfig.askpass_package self.default_graphics_from_config = cliconfig.default_graphics + self.with_bhyve = cliconfig.with_bhyve self.cli_usbredir = None self.default_storage_format_from_config = "qcow2" diff --git a/virtManager/connect.py b/virtManager/connect.py index b779c75b0..f7f268e25 100644 --- a/virtManager/connect.py +++ b/virtManager/connect.py @@ -32,7 +32,8 @@ from virtManager.baseclass import vmmGObjectUI (HV_QEMU, HV_XEN, HV_LXC, -HV_QEMU_SESSION) = range(4) +HV_QEMU_SESSION, +HV_BHYVE) = range(5) (CONN_SSH, CONN_TCP, @@ -153,6 +154,8 @@ class vmmConnect(vmmGObjectUI): model.append(["Xen"]) model.append(["LXC (Linux Containers)"]) model.append(["QEMU/KVM user session"]) + if self.config.with_bhyve: + model.append(["Bhyve"]) combo.set_model(model) uiutil.set_combo_text_column(combo, 0) @@ -364,6 +367,8 @@ class vmmConnect(vmmGObjectUI): hvstr = "xen" elif hv == HV_QEMU or hv == HV_QEMU_SESSION: hvstr = "qemu" + elif hv == HV_BHYVE: + hvstr = "bhyve" else: hvstr = "lxc" @@ -385,7 +390,7 @@ class vmmConnect(vmmGObjectUI): hoststr += addrstr + "/" uri = hvstr + hoststr - if hv == HV_QEMU: + if hv in (HV_QEMU, HV_BHYVE): uri += "system" elif hv == HV_QEMU_SESSION: uri += "session" diff --git a/virtcli/cliconfig.py b/virtcli/cliconfig.py index a6797ccbe..8aa24b2bb 100644 --- a/virtcli/cliconfig.py +++ b/virtcli/cliconfig.py @@ -88,3 +88,4 @@ hv_packages = _split_list(_get_param("hv_packages", "")) askpass_package = _split_list(_get_param("askpass_packages", "")) libvirt_packages = _split_list(_get_param("libvirt_packages", "")) default_graphics = _get_param("default_graphics", "spice") +with_bhyve = bool(int(_get_param("with_bhyve", "0")))