lkml.org 
[lkml]   [2015]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/7] KVM: api: add kvm_irq_routing_extended_msi
From
Date
On 06/07/15 16:54, Paolo Bonzini wrote:
>
>
> On 06/07/2015 17:37, Andre Przywara wrote:
>> Wouldn't:
>> if (kvm_vm_check_extension(s, KVM_CAP_MSI_DEVID)) {
>> kroute.flags = KVM_MSI_VALID_DEVID;
>> kroute.u.msi.devid = (pci_bus_num(dev->bus) << 8) | dev->devfn;
>> }
>>
>> be saner (without a global variable)?
>> That would make the interface more consistent, with a new flag being
>> protected by a new capability.
>
> I agree that your version is niceer, but you still need to cache the
> kvm_vm_check_extension result... in a global variable. :)

I used a static variable in a wrapper function in kvmtool ;-)
TBH my argument wasn't so much about global variables (just saw that
QEMU seems to use them already), but more about a consistent and
architecture agnostic interface.

Ciao!
Andre.


\
 
 \ /
  Last update: 2015-07-06 18:21    [W:0.105 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site