Re: [PATCH 2/2] fix compilation with kvm disabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 08, 2009 at 03:11:45PM +0300, Avi Kivity wrote:
> On 07/08/2009 10:59 AM, Michael S. Tsirkin wrote:
>>
>>> @@ -337,10 +346,12 @@ int msix_init(struct PCIDevice *dev, unsigned short nentries,
>>>       if (nentries>  MSIX_MAX_ENTRIES)
>>>           return -EINVAL;
>>>
>>> +#ifdef KVM_CAP_IRQCHIP
>>>       if (kvm_enabled()&&  qemu_kvm_irqchip_in_kernel()) {
>>>           dev->msix_irq_entries = qemu_malloc(nentries *
>>>                                               sizeof *dev->msix_irq_entries);
>>>       }
>>> +#endif
>>>       dev->msix_entry_used = qemu_mallocz(MSIX_MAX_ENTRIES *
>>>                                           sizeof *dev->msix_entry_used);
>>>
>>> @@ -454,10 +465,13 @@ void msix_notify(PCIDevice *dev, unsigned vector)
>>>           msix_set_pending(dev, vector);
>>>           return;
>>>       }
>>> +
>>> +#ifdef KVM_CAP_IRQCHIP
>>>       if (kvm_enabled()&&  qemu_kvm_irqchip_in_kernel()) {
>>>           kvm_set_irq(dev->msix_irq_entries[vector].gsi, 1, NULL);
>>>           return;
>>>       }
>>> +#endif
>>>
>>>       address = pci_get_long(table_entry + MSIX_MSG_UPPER_ADDR);
>>>       address = (address<<  32) | pci_get_long(table_entry + MSIX_MSG_ADDR);
>>>      
>>
>> I think it's time we stopped worrying about builds against old kernel
>> headers or without them. What do we gain from it?
>>    
>
> qemu upstream doesn't carry its own headers, so it we want to merge, we  
> need to work against old headers.

Was there ever discussion on this? I think the right thing to do is to
add own headers to qemu upstream.

>> I believe that the right thing to do is to define kvm_enabled as a macro
>> returning 0, and let compiler optimize the code out.
>>    
>
> Doesn't work with -O0 (or if it does, we can't count on it).

With -O0 you get a ton of dead code anyway. Who cares?

-- 
MST
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux