inspection: Skip guests if we can't read their disk images

Not an exhaustive check, but saves us some traceback spew in the logs
This commit is contained in:
Cole Robinson 2011-07-22 19:19:42 -04:00
parent f752d948cd
commit 12528d5028

View File

@ -20,6 +20,7 @@
from Queue import Queue, Empty
from threading import Thread
import logging
import os
import gobject
@ -155,6 +156,12 @@ class vmmInspection(vmmGObject):
for disk in disks:
path = disk.path
driver_type = disk.driver_type
if not (os.path.exists(path) and os.access(path, os.R_OK)):
logging.debug("%s: cannot access '%s', skipping inspection",
prettyvm, path)
return
g.add_drive_opts(path, readonly=1, format=driver_type)
g.launch()