* [PATCH] qemu-kvm: Clean up kvm_set_irqfd build dependencies
@ 2011-06-10 8:07 Jan Kiszka
2011-06-13 8:55 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2011-06-10 8:07 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm, Michael S. Tsirkin, Amos Kong
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.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
hw/virtio-pci.c | 4 ----
kvm-all.c | 6 ++++--
kvm-stub.c | 5 +++++
kvm.h | 8 --------
4 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index 0422484..d1fc433 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -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,
diff --git a/kvm-all.c b/kvm-all.c
index cc2c73d..629f727 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -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)
{
diff --git a/kvm-stub.c b/kvm-stub.c
index 90fed66..6f33e59 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -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;
+}
diff --git a/kvm.h b/kvm.h
index 288a452..c2a850e 100644
--- a/kvm.h
+++ b/kvm.h
@@ -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);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] qemu-kvm: Clean up kvm_set_irqfd build dependencies
2011-06-10 8:07 [PATCH] qemu-kvm: Clean up kvm_set_irqfd build dependencies Jan Kiszka
@ 2011-06-13 8:55 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2011-06-13 8:55 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm, Michael S. Tsirkin, Amos Kong
On 06/10/2011 11:07 AM, Jan Kiszka wrote:
> 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.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-13 8:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 8:07 [PATCH] qemu-kvm: Clean up kvm_set_irqfd build dependencies Jan Kiszka
2011-06-13 8:55 ` Avi Kivity
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox