[PATCH v2 5/8] kvm: Add stubs for msix support code

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

 



To allow msix to build without kvm support, add stubs for these functions.
Move the declarations to kvm.h so they are accessible when kvm support is not
built.

Signed-off-by: Avi Kivity <avi@xxxxxxxxxx>
---
 kvm-stub.c |   35 +++++++++++++++++++++++++++++++++++
 kvm.h      |   13 +++++++++++++
 qemu-kvm.h |   34 ----------------------------------
 3 files changed, 48 insertions(+), 34 deletions(-)

diff --git a/kvm-stub.c b/kvm-stub.c
index d45f9fa..3c2deec 100644
--- a/kvm-stub.c
+++ b/kvm-stub.c
@@ -141,3 +141,38 @@ int kvm_set_ioeventfd_mmio_long(int fd, uint32_t adr, uint32_t val, bool assign)
 {
     return -ENOSYS;
 }
+
+int kvm_has_gsi_routing(void)
+{
+    return 0;
+}
+
+int kvm_get_irq_route_gsi(void)
+{
+    return -ENOSYS;
+}
+
+int kvm_add_msix(uint32_t gsi, uint32_t addr_lo,
+                 uint32_t addr_hi, uint32_t data)
+{
+    return -ENOSYS;
+}
+
+int kvm_del_msix(uint32_t gsi, uint32_t addr_lo,
+                 uint32_t addr_hi, uint32_t data)
+{
+    return -ENOSYS;
+}
+
+int kvm_update_msix(uint32_t old_gsi, uint32_t old_addr_lo,
+                    uint32_t old_addr_hi, uint32_t old_data,
+                    uint32_t new_gsi, uint32_t new_addr_lo,
+                    uint32_t new_addr_hi, uint32_t new_data)
+{
+    return -ENOSYS;
+}
+
+int kvm_commit_irq_routes(void)
+{
+    return -ENOSYS;
+}
diff --git a/kvm.h b/kvm.h
index d728836..2f12851 100644
--- a/kvm.h
+++ b/kvm.h
@@ -198,4 +198,17 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t adr, uint16_t val, bool assign);
 
 int kvm_physical_memory_addr_from_ram(KVMState *s, ram_addr_t ram_addr,
                                       target_phys_addr_t *phys_addr);
+
+int kvm_has_gsi_routing(void);
+int kvm_get_irq_route_gsi(void);
+int kvm_add_msix(uint32_t gsi, uint32_t addr_lo,
+                 uint32_t addr_hi, uint32_t data);
+int kvm_del_msix(uint32_t gsi, uint32_t addr_lo,
+                 uint32_t addr_hi, uint32_t data);
+int kvm_update_msix(uint32_t old_gsi, uint32_t old_addr_lo,
+                    uint32_t old_addr_hi, uint32_t old_data,
+                    uint32_t new_gsi, uint32_t new_addr_lo,
+                    uint32_t new_addr_hi, uint32_t new_data);
+int kvm_commit_irq_routes(void);
+
 #endif
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 25f71db..9c08ab4 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -661,14 +661,6 @@ int kvm_deassign_pci_device(kvm_context_t kvm,
 #endif
 
 /*!
- * \brief Checks whether the generic irq routing capability is present
- *
- * Checks whether kvm can reroute interrupts among the various interrupt
- * controllers.
- */
-int kvm_has_gsi_routing(void);
-
-/*!
  * \brief Determines the number of gsis that can be routed
  *
  * Returns the number of distinct gsis that can be routed by kvm.  This is
@@ -704,15 +696,6 @@ int kvm_add_irq_route(int gsi, int irqchip, int pin);
  */
 int kvm_del_irq_route(int gsi, int irqchip, int pin);
 
-int kvm_add_msix(uint32_t gsi, uint32_t addr_lo,
-                 uint32_t addr_hi, uint32_t data);
-int kvm_del_msix(uint32_t gsi, uint32_t addr_lo,
-                 uint32_t addr_hi, uint32_t data);
-int kvm_update_msix(uint32_t old_gsi, uint32_t old_addr_lo,
-                    uint32_t old_addr_hi, uint32_t old_data,
-                    uint32_t new_gsi, uint32_t new_addr_lo,
-                    uint32_t new_addr_hi, uint32_t new_data);
-
 struct kvm_irq_routing_entry;
 /*!
  * \brief Adds a routing entry to the temporary irq routing table
@@ -740,23 +723,6 @@ int kvm_del_routing_entry(struct kvm_irq_routing_entry *entry);
 int kvm_update_routing_entry(struct kvm_irq_routing_entry *entry,
                              struct kvm_irq_routing_entry *newentry);
 
-/*!
- * \brief Commit the temporary irq routing table
- *
- * Commit the temporary irq routing table to the running VM.
- *
- * \param kvm Pointer to the current kvm_context
- */
-int kvm_commit_irq_routes(void);
-
-/*!
- * \brief Get unused GSI number for irq routing table
- *
- * Get unused GSI number for irq routing table
- *
- * \param kvm Pointer to the current kvm_context
- */
-int kvm_get_irq_route_gsi(void);
 
 /*!
  * \brief Create a file descriptor for injecting interrupts
-- 
1.7.3.1

--
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