diff --git a/virtManager/connection.py b/virtManager/connection.py index 50e992c3..ec6dd2e4 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -502,9 +502,12 @@ class vmmConnection(vmmGObject): return self._get_flags_helper(vm, key, check_func) def get_default_pool(self): - for p in self.list_pools(): - if p.get_name() == "default": - return p + poolxml = virtinst.StoragePool.build_default_pool( + self.get_backend(), build=False) + if poolxml: + for p in self.list_pools(): + if p.get_name() == poolxml.name: + return p return None def get_vol_by_path(self, path): diff --git a/virtinst/storage.py b/virtinst/storage.py index b778369b..ba00d153 100644 --- a/virtinst/storage.py +++ b/virtinst/storage.py @@ -196,7 +196,7 @@ class StoragePool(_StorageObject): return ret @staticmethod - def build_default_pool(conn): + def build_default_pool(conn, build=True): """ Attempt to lookup the 'default' pool, but if it doesn't exist, create it @@ -204,6 +204,8 @@ class StoragePool(_StorageObject): poolxml = _lookup_default_pool(conn) if poolxml: return poolxml + if not build: + return None try: name = "default"