mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-08 15:13:11 -06:00
virtinst: Remove stable_defaults concept
This switch says: if we detect a rhel host, use special version checks that match rhel backports. This pattern sucks. The way forward is to have libvirt advertise the bits that are supported, through domcapabilities. Then virt-manager/virtinst can react as appropriate.
This commit is contained in:
parent
019a33e975
commit
7eaf036acf
6
setup.py
6
setup.py
@ -321,8 +321,6 @@ class configure(distutils.core.Command):
|
||||
"(default=none)"),
|
||||
("askpass-package-names=", None,
|
||||
"name of your distro's askpass package(s) (default=none)"),
|
||||
("stable-defaults", None,
|
||||
"Hide config bits that are not considered stable (default=no)"),
|
||||
("default-graphics=", None,
|
||||
"Default graphics type (spice or vnc) (default=spice)"),
|
||||
("default-hvs=", None,
|
||||
@ -340,7 +338,6 @@ class configure(distutils.core.Command):
|
||||
self.libvirt_package_names = None
|
||||
self.kvm_package_names = None
|
||||
self.askpass_package_names = None
|
||||
self.stable_defaults = None
|
||||
self.default_graphics = None
|
||||
self.default_hvs = None
|
||||
|
||||
@ -355,9 +352,6 @@ class configure(distutils.core.Command):
|
||||
template += "hv_packages = %s\n" % self.kvm_package_names
|
||||
if self.askpass_package_names is not None:
|
||||
template += "askpass_packages = %s\n" % self.askpass_package_names
|
||||
if self.stable_defaults is not None:
|
||||
template += ("stable_defaults = %s\n" %
|
||||
self.stable_defaults)
|
||||
if self.default_graphics is not None:
|
||||
template += "default_graphics = %s\n" % self.default_graphics
|
||||
if self.default_hvs is not None:
|
||||
|
@ -6,16 +6,11 @@
|
||||
|
||||
|
||||
%global with_guestfs 0
|
||||
%global stable_defaults 0
|
||||
%global askpass_package "openssh-askpass"
|
||||
%global libvirt_packages "libvirt-daemon-kvm,libvirt-daemon-config-network"
|
||||
%global kvm_packages ""
|
||||
%global default_hvs "qemu,xen,lxc"
|
||||
|
||||
%if 0%{?rhel}
|
||||
%global stable_defaults 1
|
||||
%endif
|
||||
|
||||
|
||||
# End local config
|
||||
|
||||
@ -119,10 +114,6 @@ machine).
|
||||
%global _askpass_package --askpass-package-names=%{askpass_package}
|
||||
%endif
|
||||
|
||||
%if %{stable_defaults}
|
||||
%global _stable_defaults --stable-defaults
|
||||
%endif
|
||||
|
||||
%if %{default_hvs}
|
||||
%global _default_hvs --default-hvs %{default_hvs}
|
||||
%endif
|
||||
@ -131,7 +122,6 @@ machine).
|
||||
%{?_kvm_packages} \
|
||||
%{?_libvirt_packages} \
|
||||
%{?_askpass_package} \
|
||||
%{?_stable_defaults} \
|
||||
%{?_default_hvs}
|
||||
|
||||
|
||||
|
@ -357,10 +357,6 @@ class vmmConnection(vmmGObject):
|
||||
is_session_uri = property(lambda s: getattr(s, "_backend").is_session_uri)
|
||||
|
||||
|
||||
# Connection capabilities debug helpers
|
||||
def stable_defaults(self, *args, **kwargs):
|
||||
return self._backend.stable_defaults(*args, **kwargs)
|
||||
|
||||
def get_cache_dir(self):
|
||||
uri = self.get_uri().replace("/", "_")
|
||||
ret = os.path.join(util.get_cache_dir(), uri)
|
||||
|
@ -1281,16 +1281,6 @@ class vmmCreate(vmmGObjectUI):
|
||||
# Misc helper routines #
|
||||
########################
|
||||
|
||||
def _stable_defaults(self):
|
||||
emu = None
|
||||
if self._guest:
|
||||
emu = self._guest.emulator
|
||||
elif self._capsinfo:
|
||||
emu = self._capsinfo.emulator
|
||||
|
||||
ret = self.conn.stable_defaults(emu)
|
||||
return ret
|
||||
|
||||
def _browse_file(self, cbwidget, cb=None, is_media=False, is_dir=False):
|
||||
if is_media:
|
||||
reason = self.config.CONFIG_DIR_ISO_MEDIA
|
||||
|
@ -70,8 +70,6 @@ class _CLIConfig(object):
|
||||
self.cfgpath = _cfgpath
|
||||
self.version = __version__
|
||||
|
||||
self.stable_defaults = bool(int(_get_param("stable_defaults", "0")))
|
||||
|
||||
self.hv_packages = _split_list(_get_param("hv_packages", ""))
|
||||
self.askpass_package = _split_list(_get_param("askpass_packages", ""))
|
||||
self.libvirt_packages = _split_list(_get_param("libvirt_packages", ""))
|
||||
|
@ -22,7 +22,6 @@ def _setup_i18n():
|
||||
gettext.bindtextdomain("virt-manager", _CLIConfig.gettext_dir)
|
||||
|
||||
_setup_i18n()
|
||||
stable_defaults = _CLIConfig.stable_defaults
|
||||
|
||||
from virtinst import util
|
||||
from virtinst.uri import URI
|
||||
|
@ -9,8 +9,6 @@ import weakref
|
||||
|
||||
import libvirt
|
||||
|
||||
from virtcli import CLIConfig
|
||||
|
||||
from . import pollhelpers
|
||||
from . import support
|
||||
from . import util
|
||||
@ -323,29 +321,6 @@ class VirtinstConnection(object):
|
||||
logging.debug("Error calling getVersion", exc_info=True)
|
||||
return self._conn_version
|
||||
|
||||
def stable_defaults(self, emulator=None, force=False):
|
||||
"""
|
||||
:param force: Just check if we are running on RHEL, regardless of
|
||||
whether stable defaults are requested by the build. This is needed
|
||||
to ensure we don't enable VM devices that are compiled out on
|
||||
RHEL, like vmvga
|
||||
"""
|
||||
if not CLIConfig.stable_defaults and not force:
|
||||
return False
|
||||
|
||||
if not self.is_qemu():
|
||||
return False
|
||||
|
||||
if emulator:
|
||||
return str(emulator).startswith("/usr/libexec")
|
||||
|
||||
for guest in self.caps.guests:
|
||||
for dom in guest.domains:
|
||||
emulator = dom.emulator or guest.emulator
|
||||
if emulator.startswith("/usr/libexec"):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
###################
|
||||
# Public URI bits #
|
||||
|
@ -299,9 +299,6 @@ class Guest(XMLBuilder):
|
||||
def supports_virtiodisk(self):
|
||||
return self._supports_virtio(self.osinfo.supports_virtiodisk())
|
||||
|
||||
def stable_defaults(self, *args, **kwargs):
|
||||
return self.conn.stable_defaults(self.emulator, *args, **kwargs)
|
||||
|
||||
|
||||
###############################
|
||||
# Public XML APIs and helpers #
|
||||
|
Loading…
Reference in New Issue
Block a user