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'.
This commit is contained in:
Roman Bogorodskiy 2014-04-10 21:54:37 +04:00 committed by Cole Robinson
parent 35c9afad45
commit 05df5a6484
4 changed files with 14 additions and 2 deletions

View File

@ -324,6 +324,8 @@ class configure(Command):
"Hide config bits that are not considered stable (default=no)"), "Hide config bits that are not considered stable (default=no)"),
("default-graphics=", None, ("default-graphics=", None,
"Default graphics type (spice or vnc) (default=spice)"), "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" description = "Configure the build, similar to ./configure"
@ -341,6 +343,7 @@ class configure(Command):
self.preferred_distros = None self.preferred_distros = None
self.stable_defaults = None self.stable_defaults = None
self.default_graphics = None self.default_graphics = None
self.with_bhyve = None
def run(self): def run(self):
@ -364,6 +367,8 @@ class configure(Command):
self.stable_defaults) self.stable_defaults)
if self.default_graphics is not None: if self.default_graphics is not None:
template += "default_graphics = %s\n" % self.default_graphics 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) file(cliconfig.cfgpath, "w").write(template)
print "Generated %s" % cliconfig.cfgpath print "Generated %s" % cliconfig.cfgpath

View File

@ -161,6 +161,7 @@ class vmmConfig(object):
self.libvirt_packages = cliconfig.libvirt_packages self.libvirt_packages = cliconfig.libvirt_packages
self.askpass_package = cliconfig.askpass_package self.askpass_package = cliconfig.askpass_package
self.default_graphics_from_config = cliconfig.default_graphics self.default_graphics_from_config = cliconfig.default_graphics
self.with_bhyve = cliconfig.with_bhyve
self.cli_usbredir = None self.cli_usbredir = None
self.default_storage_format_from_config = "qcow2" self.default_storage_format_from_config = "qcow2"

View File

@ -32,7 +32,8 @@ from virtManager.baseclass import vmmGObjectUI
(HV_QEMU, (HV_QEMU,
HV_XEN, HV_XEN,
HV_LXC, HV_LXC,
HV_QEMU_SESSION) = range(4) HV_QEMU_SESSION,
HV_BHYVE) = range(5)
(CONN_SSH, (CONN_SSH,
CONN_TCP, CONN_TCP,
@ -153,6 +154,8 @@ class vmmConnect(vmmGObjectUI):
model.append(["Xen"]) model.append(["Xen"])
model.append(["LXC (Linux Containers)"]) model.append(["LXC (Linux Containers)"])
model.append(["QEMU/KVM user session"]) model.append(["QEMU/KVM user session"])
if self.config.with_bhyve:
model.append(["Bhyve"])
combo.set_model(model) combo.set_model(model)
uiutil.set_combo_text_column(combo, 0) uiutil.set_combo_text_column(combo, 0)
@ -364,6 +367,8 @@ class vmmConnect(vmmGObjectUI):
hvstr = "xen" hvstr = "xen"
elif hv == HV_QEMU or hv == HV_QEMU_SESSION: elif hv == HV_QEMU or hv == HV_QEMU_SESSION:
hvstr = "qemu" hvstr = "qemu"
elif hv == HV_BHYVE:
hvstr = "bhyve"
else: else:
hvstr = "lxc" hvstr = "lxc"
@ -385,7 +390,7 @@ class vmmConnect(vmmGObjectUI):
hoststr += addrstr + "/" hoststr += addrstr + "/"
uri = hvstr + hoststr uri = hvstr + hoststr
if hv == HV_QEMU: if hv in (HV_QEMU, HV_BHYVE):
uri += "system" uri += "system"
elif hv == HV_QEMU_SESSION: elif hv == HV_QEMU_SESSION:
uri += "session" uri += "session"

View File

@ -88,3 +88,4 @@ hv_packages = _split_list(_get_param("hv_packages", ""))
askpass_package = _split_list(_get_param("askpass_packages", "")) askpass_package = _split_list(_get_param("askpass_packages", ""))
libvirt_packages = _split_list(_get_param("libvirt_packages", "")) libvirt_packages = _split_list(_get_param("libvirt_packages", ""))
default_graphics = _get_param("default_graphics", "spice") default_graphics = _get_param("default_graphics", "spice")
with_bhyve = bool(int(_get_param("with_bhyve", "0")))