Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 2967f24

Browse files
committed
VirtualDisk: make sure we can actually read volume file.
If user deletes the file behind libvirt's back, we would end up throwing a confusing error.
1 parent 863161c commit 2967f24

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

virtinst/VirtualDisk.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,10 @@ def __check_if_path_managed(self):
557557

558558
try:
559559
vol = self.conn.storageVolLookupByPath(self.path)
560+
vol.info()
560561
except Exception, e:
562+
vol = None
563+
561564
try:
562565
try:
563566
# Pool may need to be refreshed, but if it errors,
@@ -567,7 +570,9 @@ def __check_if_path_managed(self):
567570
pool = None
568571
raise
569572
vol = self.conn.storageVolLookupByPath(self.path)
573+
vol.info()
570574
except Exception, e:
575+
vol = None
571576
verr = str(e)
572577

573578
if not vol:

0 commit comments

Comments
 (0)