Blame SOURCES/virt-manager-vmmCreateVolume-uses-the-correct-connec.patch

343f27
From 677a13814af586c0770916cc31364a5dbaae6d92 Mon Sep 17 00:00:00 2001
343f27
From: Giuseppe Scrivano <gscrivan@redhat.com>
343f27
Date: Sat, 14 Dec 2013 11:57:29 +0100
343f27
Subject: [RHEL-7.0 virt-manager PATCH] virt-manager: vmmCreateVolume uses the
343f27
 correct connection
343f27
343f27
Set the connection used by vmmCreateVolume everytime the window is made
343f27
visible.  This fixes a case where volumes could be added to the wrong
343f27
pool if the same vmmCreateVolume window was already used on a different
343f27
connection.
343f27
343f27
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1043150
343f27
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
343f27
(cherry picked from commit b3457b9d3530a55df23ab7ca135e0ef777bbc53b)
343f27
---
343f27
 virtManager/createvol.py     | 3 ++-
343f27
 virtManager/host.py          | 2 +-
343f27
 virtManager/storagebrowse.py | 2 +-
343f27
 3 files changed, 4 insertions(+), 3 deletions(-)
343f27
343f27
diff --git a/virtManager/createvol.py b/virtManager/createvol.py
343f27
index ec1a14d..d22ece9 100644
343f27
--- a/virtManager/createvol.py
343f27
+++ b/virtManager/createvol.py
343f27
@@ -99,7 +99,8 @@ class vmmCreateVolume(vmmGObjectUI):
343f27
     def set_modal(self, modal):
343f27
         self.topwin.set_modal(bool(modal))
343f27
343f27
-    def set_parent_pool(self, pool):
343f27
+    def set_parent_pool(self, conn, pool):
343f27
+        self.conn = conn
343f27
         self.parent_pool = pool
343f27
         self.vol_class = Storage.StoragePool.get_volume_for_pool(self.parent_pool.get_type())
343f27
343f27
diff --git a/virtManager/host.py b/virtManager/host.py
343f27
index 6d3ca88..092d5d1 100644
343f27
--- a/virtManager/host.py
343f27
+++ b/virtManager/host.py
343f27
@@ -780,7 +780,7 @@ class vmmHost(vmmGObjectUI):
343f27
                 self.addvol = vmmCreateVolume(self.conn, pool)
343f27
                 self.addvol.connect("vol-created", self.refresh_current_pool)
343f27
             else:
343f27
-                self.addvol.set_parent_pool(pool)
343f27
+                self.addvol.set_parent_pool(self.conn, pool)
343f27
             self.addvol.show(self.topwin)
343f27
         except Exception, e:
343f27
             self.err.show_err(_("Error launching volume wizard: %s") % str(e))
343f27
diff --git a/virtManager/storagebrowse.py b/virtManager/storagebrowse.py
343f27
index 6f4d3c0..4c79baa 100644
343f27
--- a/virtManager/storagebrowse.py
343f27
+++ b/virtManager/storagebrowse.py
343f27
@@ -286,7 +286,7 @@ class vmmStorageBrowser(vmmGObjectUI):
343f27
                 self.addvol = vmmCreateVolume(self.conn, pool)
343f27
                 self.addvol.connect("vol-created", self.refresh_current_pool)
343f27
             else:
343f27
-                self.addvol.set_parent_pool(pool)
343f27
+                self.addvol.set_parent_pool(self.conn, pool)
343f27
             self.addvol.set_modal(True)
343f27
             self.addvol.set_name_hint(self.vm_name)
343f27
             self.addvol.show(self.topwin)
343f27
-- 
343f27
1.8.5.2
343f27