Skip to contentSkip to conversation

qemu-kvm: Clean up kvm_set_irqfd build dependencies

PATCH Applied Jan Kiszka 2 participants 2 messages Jun 10, 2011 – Jun 13, 2011 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 qemu-kvm: Clean up kvm_set_irqfd build dependencies

Moving virtio-pci into the hwlib in upstream broke qemu-kvm due to some unneeded build dependency on CONFIG_KVM. Stub out kvm_set_irqfd so that we can build against it unconditionally.

---
 hw/virtio-pci.c |    4 ----
 kvm-all.c       |    6 ++++--
 kvm-stub.c      |    5 +++++
 kvm.h           |    8 --------
 4 files changed, 9 insertions(+), 14 deletions(-)
hw/virtio-pci.c +0 -4
index 0422484..d1fc433 100644
@@ -549,7 +549,6 @@ static void virtio_pci_guest_notifier_read(void *opaque)
 static int virtio_pci_mask_vq(PCIDevice *dev, unsigned vector,
                               VirtQueue *vq, int masked)
 {
-#ifdef CONFIG_KVM
     EventNotifier *notifier = virtio_queue_get_guest_notifier(vq);
     int r = kvm_set_irqfd(dev->msix_irq_entries[vector].gsi,
                           event_notifier_get_fd(notifier),
@@ -565,9 +564,6 @@ static int virtio_pci_mask_vq(PCIDevice *dev, unsigned vector,
                             NULL, NULL, NULL);
     }
     return 0;
-#else
-    return -ENOSYS;
-#endif
 }
 
 static int virtio_pci_mask_notifier(PCIDevice *dev, unsigned vector,
kvm-all.c +4 -2
index cc2c73d..629f727 100644
@@ -1429,9 +1429,9 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign)
 #endif
 }
 
-#if defined(KVM_IRQFD)
 int kvm_set_irqfd(int gsi, int fd, bool assigned)
 {
+#if defined(KVM_IRQFD)
     struct kvm_irqfd irqfd = {
         .fd = fd,
         .gsi = gsi,
@@ -1445,8 +1445,10 @@ int kvm_set_irqfd(int gsi, int fd, bool assigned)
     if (r < 0)
         return r;
     return 0;
-}
+#else
+    return -ENOSYS;
 #endif
+}
 
 int kvm_on_sigbus_vcpu(CPUState *env, int code, void *addr)
 {
kvm-stub.c +5 -0
index 90fed66..6f33e59 100644
@@ -196,3 +196,8 @@ int kvm_on_sigbus(int code, void *addr)
 {
     return 1;
 }
+
+int kvm_set_irqfd(int gsi, int fd, bool assigned)
+{
+    return -ENOSYS;
+}
kvm.h +0 -8
index 288a452..c2a850e 100644
@@ -196,15 +196,7 @@ int kvm_physical_memory_addr_from_ram(KVMState *s, ram_addr_t ram_addr,
 #endif
 int kvm_set_ioeventfd_mmio_long(int fd, uint32_t adr, uint32_t val, bool assign);
 
-#if defined(KVM_IRQFD) && defined(CONFIG_KVM)
 int kvm_set_irqfd(int gsi, int fd, bool assigned);
-#else
-static inline
-int kvm_set_irqfd(int gsi, int fd, bool assigned)
-{
-    return -ENOSYS;
-}
-#endif
 
 int kvm_set_ioeventfd_pio_word(int fd, uint16_t adr, uint16_t val, bool assign);
 
Applied
#1 lore raw
Quoted 3 lines · Jan Kiszka

Moving virtio-pci into the hwlib in upstream broke qemu-kvm due to some unneeded build dependency on CONFIG_KVM. Stub out kvm_set_irqfd so that we can build against it unconditionally.

Applied, thanks.

Signature · 1 line
error compiling committee.c: too many arguments to function