Subject: connection: Avoid repeated default pool creation attempts From: Michael Weiser michael.weiser@gmx.de Fri Oct 25 21:27:18 2019 +0200 Date: Tue Nov 12 12:28:34 2019 -0500: Git: 51d84c54cb63350145f4ad3a2adba17313e1f227 During startup virtinst.StoragePool.build_default_pool() tries to determine whether the default storage pool already exists. Because events have not yet been processed, the list of existing storage pools is still empty. Therefore it seems as if it does not exist yet and build_default_pool() falls back to creating it which causes an error message from libvirtd in the system log: libvirtd: operation failed: pool 'default' already exists with uuid. Move default pool creation after event processing to avoid these redundant creation attempts. Signed-off-by: Michael Weiser diff --git a/virtManager/connection.py b/virtManager/connection.py index f6dc5f5b..e526d495 100644 --- a/virtManager/connection.py +++ b/virtManager/connection.py @@ -990,13 +990,6 @@ class vmmConnection(vmmGObject): log.debug("%s capabilities:\n%s", self.get_uri(), self.caps.get_xml()) - # Try to create the default storage pool - # We want this before events setup to save some needless polling - try: - virtinst.StoragePool.build_default_pool(self.get_backend()) - except Exception as e: - log.debug("Building default pool failed: %s", str(e)) - self._add_conn_events() try: @@ -1025,6 +1018,14 @@ class vmmConnection(vmmGObject): self._init_object_event = None self._init_object_count = None + # Try to create the default storage pool + # We need this after events setup so we can determine if the default + # pool already exists + try: + virtinst.StoragePool.build_default_pool(self.get_backend()) + except Exception as e: + log.debug("Building default pool failed: %s", str(e)) + def _open_thread(self): ConnectError = None try: