mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virt-manager: Drop remnants of read-only connection support
Haven't supported it for a while
This commit is contained in:
parent
ea2a1331cf
commit
255ba11079
@ -77,14 +77,13 @@ class vmmConnection(vmmGObject):
|
|||||||
STATE_ACTIVE = 2
|
STATE_ACTIVE = 2
|
||||||
STATE_INACTIVE = 3
|
STATE_INACTIVE = 3
|
||||||
|
|
||||||
def __init__(self, uri, readOnly=False):
|
def __init__(self, uri):
|
||||||
vmmGObject.__init__(self)
|
vmmGObject.__init__(self)
|
||||||
|
|
||||||
self._uri = uri
|
self._uri = uri
|
||||||
if self._uri is None or self._uri.lower() == "xen":
|
if self._uri is None or self._uri.lower() == "xen":
|
||||||
self._uri = "xen:///"
|
self._uri = "xen:///"
|
||||||
|
|
||||||
self.readOnly = readOnly
|
|
||||||
self.state = self.STATE_DISCONNECTED
|
self.state = self.STATE_DISCONNECTED
|
||||||
self.connectThread = None
|
self.connectThread = None
|
||||||
self.connectError = None
|
self.connectError = None
|
||||||
@ -185,9 +184,6 @@ class vmmConnection(vmmGObject):
|
|||||||
# General data getters #
|
# General data getters #
|
||||||
########################
|
########################
|
||||||
|
|
||||||
def is_read_only(self):
|
|
||||||
return self.readOnly
|
|
||||||
|
|
||||||
def get_uri(self):
|
def get_uri(self):
|
||||||
return self._uri
|
return self._uri
|
||||||
|
|
||||||
@ -602,10 +598,7 @@ class vmmConnection(vmmGObject):
|
|||||||
elif self.state == self.STATE_CONNECTING:
|
elif self.state == self.STATE_CONNECTING:
|
||||||
return _("Connecting")
|
return _("Connecting")
|
||||||
elif self.state == self.STATE_ACTIVE:
|
elif self.state == self.STATE_ACTIVE:
|
||||||
if self.is_read_only():
|
return _("Active")
|
||||||
return _("Active (RO)")
|
|
||||||
else:
|
|
||||||
return _("Active")
|
|
||||||
elif self.state == self.STATE_INACTIVE:
|
elif self.state == self.STATE_INACTIVE:
|
||||||
return _("Inactive")
|
return _("Inactive")
|
||||||
else:
|
else:
|
||||||
@ -965,16 +958,10 @@ class vmmConnection(vmmGObject):
|
|||||||
return -1
|
return -1
|
||||||
|
|
||||||
def _try_open(self):
|
def _try_open(self):
|
||||||
flags = 0
|
|
||||||
|
|
||||||
vmm = self._open_dev_conn(self.get_uri())
|
vmm = self._open_dev_conn(self.get_uri())
|
||||||
if vmm:
|
if vmm:
|
||||||
return vmm
|
return vmm
|
||||||
|
|
||||||
if self.readOnly:
|
|
||||||
logging.info("Caller requested read only connection")
|
|
||||||
flags = libvirt.VIR_CONNECT_RO
|
|
||||||
|
|
||||||
if virtinst.support.support_openauth():
|
if virtinst.support.support_openauth():
|
||||||
vmm = libvirt.openAuth(self.get_uri(),
|
vmm = libvirt.openAuth(self.get_uri(),
|
||||||
[[libvirt.VIR_CRED_AUTHNAME,
|
[[libvirt.VIR_CRED_AUTHNAME,
|
||||||
@ -983,10 +970,7 @@ class vmmConnection(vmmGObject):
|
|||||||
self._do_creds, None],
|
self._do_creds, None],
|
||||||
flags)
|
flags)
|
||||||
else:
|
else:
|
||||||
if flags:
|
vmm = libvirt.open(self.get_uri())
|
||||||
vmm = libvirt.openReadOnly(self.get_uri())
|
|
||||||
else:
|
|
||||||
vmm = libvirt.open(self.get_uri())
|
|
||||||
|
|
||||||
return vmm
|
return vmm
|
||||||
|
|
||||||
|
@ -415,12 +415,8 @@ class vmmCreate(vmmGObjectUI):
|
|||||||
|
|
||||||
def set_conn_state(self):
|
def set_conn_state(self):
|
||||||
# Update all state that has some dependency on the current connection
|
# Update all state that has some dependency on the current connection
|
||||||
|
|
||||||
self.widget("create-forward").set_sensitive(True)
|
self.widget("create-forward").set_sensitive(True)
|
||||||
|
|
||||||
if self.conn.is_read_only():
|
|
||||||
return self.startup_error(_("Connection is read only."))
|
|
||||||
|
|
||||||
if self.conn.no_install_options():
|
if self.conn.no_install_options():
|
||||||
error = _("No hypervisor options were found for this "
|
error = _("No hypervisor options were found for this "
|
||||||
"connection.")
|
"connection.")
|
||||||
|
@ -318,8 +318,6 @@ class vmmDomain(vmmLibvirtObject):
|
|||||||
return self.conn.rhel6_defaults(self.get_emulator())
|
return self.conn.rhel6_defaults(self.get_emulator())
|
||||||
|
|
||||||
def is_read_only(self):
|
def is_read_only(self):
|
||||||
if self.conn.is_read_only():
|
|
||||||
return True
|
|
||||||
if self.is_management_domain():
|
if self.is_management_domain():
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -267,16 +267,12 @@ def dup_conn(conn):
|
|||||||
|
|
||||||
|
|
||||||
def _dup_all_conn(conn, libconn):
|
def _dup_all_conn(conn, libconn):
|
||||||
|
|
||||||
is_readonly = False
|
|
||||||
|
|
||||||
if libconn:
|
if libconn:
|
||||||
uri = libconn.getURI()
|
uri = libconn.getURI()
|
||||||
is_test = uri.startswith("test")
|
is_test = uri.startswith("test")
|
||||||
vmm = libconn
|
vmm = libconn
|
||||||
else:
|
else:
|
||||||
is_test = conn.is_test_conn()
|
is_test = conn.is_test_conn()
|
||||||
is_readonly = conn.is_read_only()
|
|
||||||
uri = conn.get_uri()
|
uri = conn.get_uri()
|
||||||
vmm = conn.vmm
|
vmm = conn.vmm
|
||||||
|
|
||||||
@ -291,7 +287,7 @@ def _dup_all_conn(conn, libconn):
|
|||||||
return conn or vmm
|
return conn or vmm
|
||||||
|
|
||||||
logging.debug("Duplicating connection for async operation.")
|
logging.debug("Duplicating connection for async operation.")
|
||||||
newconn = virtManager.connection.vmmConnection(uri, readOnly=is_readonly)
|
newconn = virtManager.connection.vmmConnection(uri)
|
||||||
newconn.open(sync=True)
|
newconn.open(sync=True)
|
||||||
|
|
||||||
return newconn
|
return newconn
|
||||||
|
Loading…
Reference in New Issue
Block a user