mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
connection: Avoid repeated default pool creation attempts
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 <michael.weiser@gmx.de>
This commit is contained in:
parent
ae19d6d6ec
commit
51d84c54cb
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user