mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Fixed handling of local Xen connects to use 'Xen' rather than None, also fix shutdown tests
This commit is contained in:
@@ -17,6 +17,9 @@ class vmmConnect(gobject.GObject):
|
||||
self.window.get_widget("remote-xen-options").set_sensitive(False)
|
||||
self.window.get_widget("other-hv-options").set_sensitive(False)
|
||||
|
||||
# Not securely implemented yet by XenD, so disable it
|
||||
self.window.get_widget("type-remote-xen").set_sensitive(False)
|
||||
|
||||
self.window.signal_autoconnect({
|
||||
"on_type_local_xen_toggled": self.change_active_type,
|
||||
"on_type_remote_xen_toggled": self.change_active_type,
|
||||
@@ -55,7 +58,7 @@ class vmmConnect(gobject.GObject):
|
||||
uri = None
|
||||
|
||||
if self.window.get_widget("type-local-xen").get_active():
|
||||
uri = None
|
||||
uri = "xen"
|
||||
elif self.window.get_widget("type-remote-xen").get_active():
|
||||
protocol = "http"
|
||||
if self.window.get_widget("remote-xen-secure").get_active():
|
||||
|
||||
@@ -19,14 +19,14 @@ class vmmConnection(gobject.GObject):
|
||||
self.config = config
|
||||
self.uri = uri
|
||||
|
||||
openURI = uri
|
||||
if openURI == "Xen":
|
||||
openURI = None
|
||||
if readOnly:
|
||||
self.vmm = libvirt.openReadOnly(uri)
|
||||
self.vmm = libvirt.openReadOnly(openURI)
|
||||
else:
|
||||
self.vmm = libvirt.open(uri)
|
||||
self.vmm = libvirt.open(openURI)
|
||||
|
||||
self.windowManager = None
|
||||
self.windowDetails = {}
|
||||
self.windowConsole = {}
|
||||
self.vms = {}
|
||||
self.tick()
|
||||
|
||||
@@ -42,16 +42,6 @@ class vmmConnection(gobject.GObject):
|
||||
|
||||
#self.vmm.close()
|
||||
self.vmm = None
|
||||
if self.windowManager != None:
|
||||
self.windowManager.close()
|
||||
self.windowManager = None
|
||||
for uuid in self.windowDetails.keys():
|
||||
self.windowDetails[uuid].close()
|
||||
del self.windowDetails[uuid]
|
||||
for uuid in self.windowConsole.keys():
|
||||
self.windowConsole[uuid].close()
|
||||
del self.windowConsole[uuid]
|
||||
|
||||
self.emit("disconnected", self.uri)
|
||||
|
||||
def get_host_info(self):
|
||||
|
||||
@@ -29,13 +29,13 @@ class vmmEngine:
|
||||
|
||||
|
||||
def _do_connection_disconnected(self, connection, hvuri):
|
||||
del self.connections[connection.get_uri()]
|
||||
del self.connections[hvuri]
|
||||
|
||||
if len(self.connections.keys()) == 0 and self.windowConnect == None:
|
||||
gtk.main_quit()
|
||||
|
||||
def _connect_to_uri(self, connect, uri, readOnly):
|
||||
self.windowOpenConnection = None
|
||||
self.windowConnect = None
|
||||
|
||||
try:
|
||||
conn = self.get_connection(uri, readOnly)
|
||||
@@ -48,7 +48,7 @@ class vmmEngine:
|
||||
gtk.main_quit()
|
||||
|
||||
def _connect_cancelled(self, connect):
|
||||
self.windowOpenConnection = None
|
||||
self.windowConnect = None
|
||||
if len(self.connections.keys()) == 0:
|
||||
gtk.main_quit()
|
||||
|
||||
@@ -154,19 +154,15 @@ class vmmEngine:
|
||||
self.connections[uri]["windowManager"].show()
|
||||
|
||||
def get_connection(self, uri, readOnly=True):
|
||||
key = uri
|
||||
if key == None or key == "":
|
||||
key = "__default__"
|
||||
|
||||
if not(self.connections.has_key(key)):
|
||||
self.connections[key] = {
|
||||
if not(self.connections.has_key(uri)):
|
||||
self.connections[uri] = {
|
||||
"connection": vmmConnection(self.get_config(), uri, readOnly),
|
||||
"windowManager": None,
|
||||
"windowDetails": {},
|
||||
"windowConsole": {}
|
||||
}
|
||||
self.connections[key]["connection"].connect("disconnected", self._do_connection_disconnected)
|
||||
self.connections[key]["connection"].connect("vm-removed", self._do_vm_removed)
|
||||
self.connections[key]["connection"].tick()
|
||||
self.connections[uri]["connection"].connect("disconnected", self._do_connection_disconnected)
|
||||
self.connections[uri]["connection"].connect("vm-removed", self._do_vm_removed)
|
||||
self.connections[uri]["connection"].tick()
|
||||
|
||||
return self.connections[key]["connection"]
|
||||
return self.connections[uri]["connection"]
|
||||
|
||||
@@ -110,7 +110,7 @@ class vmmManager(gobject.GObject):
|
||||
gtk.main_quit()
|
||||
|
||||
def open_connection(self, src=None):
|
||||
self.emit("action-show-connect");
|
||||
self.emit("action-show-connect")
|
||||
|
||||
def vm_added(self, connection, uri, vmuuid):
|
||||
vmlist = self.window.get_widget("vm-list")
|
||||
|
||||
Reference in New Issue
Block a user