mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
configure: Add --default-hvs, kill --with-bhyve
Takes a comma separated list of HVs, and only shows those as options in the 'Open Connection' wizard. This option can be used to hide the bhyve option as well, so drop --with-bhyve
This commit is contained in:
parent
6ccbec6b30
commit
ef5552d0aa
11
setup.py
11
setup.py
@ -294,8 +294,9 @@ 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)"),
|
||||
("default-hvs=", None,
|
||||
"Comma separated list of hypervisors shown in 'Open Connection' "
|
||||
"wizard. (default=all hvs)"),
|
||||
|
||||
]
|
||||
description = "Configure the build, similar to ./configure"
|
||||
@ -312,7 +313,7 @@ class configure(Command):
|
||||
self.preferred_distros = None
|
||||
self.stable_defaults = None
|
||||
self.default_graphics = None
|
||||
self.with_bhyve = None
|
||||
self.default_hvs = None
|
||||
|
||||
|
||||
def run(self):
|
||||
@ -334,8 +335,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
|
||||
if self.default_hvs is not None:
|
||||
template += "default_hvs = %s\n" % self.default_hvs
|
||||
|
||||
file(CLIConfig.cfgpath, "w").write(template)
|
||||
print "Generated %s" % CLIConfig.cfgpath
|
||||
|
@ -8,6 +8,7 @@
|
||||
%define libvirt_packages "libvirt-daemon-kvm,libvirt-daemon-config-network"
|
||||
%define preferred_distros "fedora,rhel"
|
||||
%define kvm_packages "qemu-system-x86"
|
||||
%define default_hvs "qemu,xen"
|
||||
|
||||
%if 0%{?rhel}
|
||||
%define preferred_distros "rhel,fedora"
|
||||
@ -126,13 +127,18 @@ machine).
|
||||
%define _stable_defaults --stable-defaults
|
||||
%endif
|
||||
|
||||
%if %{default_hvs}
|
||||
%define _default_hvs --default-hvs %{default_hvs}
|
||||
%endif
|
||||
|
||||
python setup.py configure \
|
||||
%{?_qemu_user} \
|
||||
%{?_kvm_packages} \
|
||||
%{?_libvirt_packages} \
|
||||
%{?_askpass_package} \
|
||||
%{?_preferred_distros} \
|
||||
%{?_stable_defaults}
|
||||
%{?_stable_defaults} \
|
||||
%{?_default_hvs}
|
||||
|
||||
|
||||
%install
|
||||
|
@ -160,7 +160,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.default_hvs = CLIConfig.default_hvs
|
||||
self.cli_usbredir = None
|
||||
|
||||
self.default_storage_format_from_config = "qcow2"
|
||||
|
@ -153,15 +153,21 @@ class vmmConnect(vmmGObjectUI):
|
||||
self.widget("connect").grab_default()
|
||||
|
||||
combo = self.widget("hypervisor")
|
||||
model = Gtk.ListStore(str)
|
||||
model.append(["QEMU/KVM"])
|
||||
model.append(["Xen"])
|
||||
model.append(["LXC (Linux Containers)"])
|
||||
model.append(["QEMU/KVM user session"])
|
||||
if self.config.with_bhyve:
|
||||
model.append(["Bhyve"])
|
||||
# [connection ID, label]
|
||||
model = Gtk.ListStore(int, str)
|
||||
|
||||
def _add_hv_row(rowid, config_name, label):
|
||||
if (not self.config.default_hvs or
|
||||
config_name in self.config.default_hvs):
|
||||
model.append([rowid, label])
|
||||
|
||||
_add_hv_row(HV_QEMU, "qemu", "QEMU/KVM")
|
||||
_add_hv_row(HV_QEMU_SESSION, "qemu", "QEMU/KVM user session")
|
||||
_add_hv_row(HV_XEN, "xen", "Xen")
|
||||
_add_hv_row(HV_LXC, "lxc", "LXC (Linux Containers)")
|
||||
_add_hv_row(HV_BHYVE, "bhyve", "Bhyve")
|
||||
combo.set_model(model)
|
||||
uiutil.set_combo_text_column(combo, 0)
|
||||
uiutil.set_combo_text_column(combo, 1)
|
||||
|
||||
combo = self.widget("transport")
|
||||
model = Gtk.ListStore(str)
|
||||
@ -197,9 +203,9 @@ class vmmConnect(vmmGObjectUI):
|
||||
def set_default_hypervisor(self):
|
||||
default = self.default_uri(always_system=True)
|
||||
if not default or default.startswith("qemu"):
|
||||
self.widget("hypervisor").set_active(HV_QEMU)
|
||||
uiutil.set_row_selection(self.widget("hypervisor"), HV_QEMU)
|
||||
elif default.startswith("xen"):
|
||||
self.widget("hypervisor").set_active(HV_XEN)
|
||||
uiutil.set_row_selection(self.widget("hypervisor"), HV_XEN)
|
||||
|
||||
def add_service(self, interface, protocol, name, typ, domain, flags):
|
||||
ignore = flags
|
||||
@ -360,7 +366,7 @@ class vmmConnect(vmmGObjectUI):
|
||||
self.widget("username-entry").set_text(default_user)
|
||||
|
||||
def generate_uri(self):
|
||||
hv = self.widget("hypervisor").get_active()
|
||||
hv = uiutil.get_list_selection(self.widget("hypervisor"), 0)
|
||||
conn = self.widget("transport").get_active()
|
||||
host = self.widget("hostname").get_child().get_text().strip()
|
||||
user = self.widget("username-entry").get_text()
|
||||
|
@ -86,7 +86,7 @@ class _CLIConfig(object):
|
||||
self.askpass_package = _split_list(_get_param("askpass_packages", ""))
|
||||
self.libvirt_packages = _split_list(_get_param("libvirt_packages", ""))
|
||||
self.default_graphics = _get_param("default_graphics", "spice")
|
||||
self.with_bhyve = bool(int(_get_param("with_bhyve", "0")))
|
||||
self.default_hvs = _split_list(_get_param("default_hvs", ""))
|
||||
|
||||
self.prefix = None
|
||||
self.gettext_dir = None
|
||||
|
Loading…
Reference in New Issue
Block a user