From 12528d502886f46f2ad656d759ec9fccf4c3aed0 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 22 Jul 2011 19:19:42 -0400 Subject: [PATCH] inspection: Skip guests if we can't read their disk images Not an exhaustive check, but saves us some traceback spew in the logs --- src/virtManager/inspection.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/virtManager/inspection.py b/src/virtManager/inspection.py index 2211af2f2..bb979cce6 100644 --- a/src/virtManager/inspection.py +++ b/src/virtManager/inspection.py @@ -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()