[libvirt] [PATCH] Don't list capabilities entries if emulators can't be accessed

Cole Robinson crobinso at redhat.com
Mon Aug 25 17:16:39 UTC 2008


Daniel P. Berrange wrote:
> On Wed, Aug 20, 2008 at 12:51:05PM -0400, Cole Robinson wrote:
> 
>> diff --git a/src/qemu_conf.c b/src/qemu_conf.c
>> index dc9e42a..0328cc1 100644
>> --- a/src/qemu_conf.c
>> +++ b/src/qemu_conf.c
>> @@ -230,6 +230,10 @@ qemudCapsInitGuest(virCapsPtr caps,
>>      virCapsGuestPtr guest;
>>      int i;
>>  
>> +    /* Check for existance of base emulator */
>> +    if (access(info->binary, X_OK) == -1)
>> +        return 0;
>> +
> 
> This isn't right - this means that if KVM is installed, but QEMU is
> not installed you won't get any capabilities.
> 
> Basically we need todo all the access() checks for QEMU, KVM, /dev/kvm
> up-front. And then generated the capabilites if either QEMU or KVM is
> available.
> 

Okay, I think this patch solves the issues. We check upfront
for the base emulator and potential kvm emulators (qemu-kvm,
and /usr/bin/kvm for ubuntu/upstream .spec). If nothing is
found, just return. If only the base emulator is found, skip
kvm even if /dev/kvm exists. If only kvm bin is found, add
the base emulator capabilities only if emulator and host arch
matches.

Thanks,
Cole

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libvirt-caps-xml-2-patch
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080825/e90143d9/attachment-0001.ksh>


More information about the libvir-list mailing list