mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-22 22:03:58 +03:00
virt-manager: vmmCreateVolume uses the correct connection
Set the connection used by vmmCreateVolume everytime the window is made visible. This fixes a case where volumes could be added to the wrong pool if the same vmmCreateVolume window was already used on a different connection. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
a8dbebd4ba
commit
b3457b9d35
@ -98,7 +98,8 @@ class vmmCreateVolume(vmmGObjectUI):
|
||||
def set_modal(self, modal):
|
||||
self.topwin.set_modal(bool(modal))
|
||||
|
||||
def set_parent_pool(self, pool):
|
||||
def set_parent_pool(self, conn, pool):
|
||||
self.conn = conn
|
||||
self.parent_pool = pool
|
||||
self.vol_class = Storage.StoragePool.get_volume_for_pool(self.parent_pool.get_type())
|
||||
|
||||
|
@ -799,7 +799,7 @@ class vmmHost(vmmGObjectUI):
|
||||
self.addvol = vmmCreateVolume(self.conn, pool)
|
||||
self.addvol.connect("vol-created", self.refresh_current_pool)
|
||||
else:
|
||||
self.addvol.set_parent_pool(pool)
|
||||
self.addvol.set_parent_pool(self.conn, pool)
|
||||
self.addvol.show(self.topwin)
|
||||
except Exception, e:
|
||||
self.err.show_err(_("Error launching volume wizard: %s") % str(e))
|
||||
|
@ -289,7 +289,7 @@ class vmmStorageBrowser(vmmGObjectUI):
|
||||
self.addvol = vmmCreateVolume(self.conn, pool)
|
||||
self.addvol.connect("vol-created", self.refresh_current_pool)
|
||||
else:
|
||||
self.addvol.set_parent_pool(pool)
|
||||
self.addvol.set_parent_pool(self.conn, pool)
|
||||
self.addvol.set_modal(True)
|
||||
self.addvol.set_name_hint(self.vm_name)
|
||||
self.addvol.show(self.topwin)
|
||||
|
Loading…
x
Reference in New Issue
Block a user