virt-manager: Drop remnants of read-only connection support

Haven't supported it for a while
This commit is contained in:
Cole Robinson 2013-07-03 13:56:43 -04:00
parent ea2a1331cf
commit 255ba11079
4 changed files with 4 additions and 30 deletions

View File

@ -77,14 +77,13 @@ class vmmConnection(vmmGObject):
STATE_ACTIVE = 2
STATE_INACTIVE = 3
def __init__(self, uri, readOnly=False):
def __init__(self, uri):
vmmGObject.__init__(self)
self._uri = uri
if self._uri is None or self._uri.lower() == "xen":
self._uri = "xen:///"
self.readOnly = readOnly
self.state = self.STATE_DISCONNECTED
self.connectThread = None
self.connectError = None
@ -185,9 +184,6 @@ class vmmConnection(vmmGObject):
# General data getters #
########################
def is_read_only(self):
return self.readOnly
def get_uri(self):
return self._uri
@ -602,9 +598,6 @@ class vmmConnection(vmmGObject):
elif self.state == self.STATE_CONNECTING:
return _("Connecting")
elif self.state == self.STATE_ACTIVE:
if self.is_read_only():
return _("Active (RO)")
else:
return _("Active")
elif self.state == self.STATE_INACTIVE:
return _("Inactive")
@ -965,16 +958,10 @@ class vmmConnection(vmmGObject):
return -1
def _try_open(self):
flags = 0
vmm = self._open_dev_conn(self.get_uri())
if vmm:
return vmm
if self.readOnly:
logging.info("Caller requested read only connection")
flags = libvirt.VIR_CONNECT_RO
if virtinst.support.support_openauth():
vmm = libvirt.openAuth(self.get_uri(),
[[libvirt.VIR_CRED_AUTHNAME,
@ -982,9 +969,6 @@ class vmmConnection(vmmGObject):
libvirt.VIR_CRED_EXTERNAL],
self._do_creds, None],
flags)
else:
if flags:
vmm = libvirt.openReadOnly(self.get_uri())
else:
vmm = libvirt.open(self.get_uri())

View File

@ -415,12 +415,8 @@ class vmmCreate(vmmGObjectUI):
def set_conn_state(self):
# Update all state that has some dependency on the current connection
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():
error = _("No hypervisor options were found for this "
"connection.")

View File

@ -318,8 +318,6 @@ class vmmDomain(vmmLibvirtObject):
return self.conn.rhel6_defaults(self.get_emulator())
def is_read_only(self):
if self.conn.is_read_only():
return True
if self.is_management_domain():
return True
return False

View File

@ -267,16 +267,12 @@ def dup_conn(conn):
def _dup_all_conn(conn, libconn):
is_readonly = False
if libconn:
uri = libconn.getURI()
is_test = uri.startswith("test")
vmm = libconn
else:
is_test = conn.is_test_conn()
is_readonly = conn.is_read_only()
uri = conn.get_uri()
vmm = conn.vmm
@ -291,7 +287,7 @@ def _dup_all_conn(conn, libconn):
return conn or vmm
logging.debug("Duplicating connection for async operation.")
newconn = virtManager.connection.vmmConnection(uri, readOnly=is_readonly)
newconn = virtManager.connection.vmmConnection(uri)
newconn.open(sync=True)
return newconn