[virt-tools-list] [PATCH virt-manager v4] Add inspection to virt-manager

Cole Robinson crobinso at redhat.com
Tue Jul 19 14:43:42 UTC 2011


On 07/19/2011 03:51 AM, Richard W.M. Jones wrote:
> On Tue, Jul 19, 2011 at 08:49:33AM +0100, Richard W.M. Jones wrote:
>> On Mon, Jul 18, 2011 at 05:41:00PM -0400, Cole Robinson wrote:
>> crobinso> rjones: I'm thinking of adding a disk path access check in
>>                   the inspection thread, to avoid flooding the logs
>>                   with errors if we can't even read the disk
>>                   image. that should be safe to do?
>>
>> AFAICT if there's no access to the disks, then the call to either
>> g.add_drive_opts or g.launch will throw an exception.
> 
> I wanted to add: adding a test in virt-manager is going to be tricky.
> 

A test wouldn't be perfect, but it's pretty easy to do

if not (os.path.exists(path) and os.access(path, os.R_OK)):
    # skip disk

Won't be exhaustive but will catch the default case of disk images in
/var/lib/libvirt/images, and will save some preventable exception spew.

> Because qemu is an external program, SELinux can cause things to fail
> even if the file is apparently readable by the main program.  So I
> think we need to let libguestfs run qemu, and instead concentrate on
> catching/quieting the exception (if that's necessary).
> 

The exception is caught and logged so things are fine there. I just like
to keep the logs as useful as possible, and multiple backtraces from a
largely predictable failure aren't that useful.

- Cole




More information about the virt-tools-list mailing list