diff mbox

[v2] kvm: Fix build for non-CAP_IRQ_ROUTING targets

Message ID 4FCE581D.8020309@siemens.com
State New
Headers show

Commit Message

Jan Kiszka June 5, 2012, 7:03 p.m. UTC
A type definition and a KVMState field initialization escaped the
required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
dummy kvm_irqchip_release_virq as virtio-pci references (but does not
use) it.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Changes in v2:
 - include the missing kvm_irqchip_release_virq that Ben Collins found

 kvm-all.c |   16 +++++++++++-----
 1 files changed, 11 insertions(+), 5 deletions(-)

Comments

Benjamin Collins June 5, 2012, 7:53 p.m. UTC | #1
Ack: Ben Collins <bcollins@ubuntu.com>

Confirmed that this patch does indeed fix everything for me.

On Jun 5, 2012, at 3:03 PM, Jan Kiszka wrote:

> A type definition and a KVMState field initialization escaped the
> required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
> dummy kvm_irqchip_release_virq as virtio-pci references (but does not
> use) it.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> 
> Changes in v2:
> - include the missing kvm_irqchip_release_virq that Ben Collins found
> 
> kvm-all.c |   16 +++++++++++-----
> 1 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/kvm-all.c b/kvm-all.c
> index 489ee53..4ea7d85 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -62,11 +62,6 @@ typedef struct KVMSlot
> 
> typedef struct kvm_dirty_log KVMDirtyLog;
> 
> -typedef struct KVMMSIRoute {
> -    struct kvm_irq_routing_entry kroute;
> -    QTAILQ_ENTRY(KVMMSIRoute) entry;
> -} KVMMSIRoute;
> -
> struct KVMState
> {
>     KVMSlot slots[32];
> @@ -867,6 +862,11 @@ int kvm_irqchip_set_irq(KVMState *s, int irq, int level)
> }
> 
> #ifdef KVM_CAP_IRQ_ROUTING
> +typedef struct KVMMSIRoute {
> +    struct kvm_irq_routing_entry kroute;
> +    QTAILQ_ENTRY(KVMMSIRoute) entry;
> +} KVMMSIRoute;
> +
> static void set_gsi(KVMState *s, unsigned int gsi)
> {
>     s->used_gsi_bitmap[gsi / 32] |= 1U << (gsi % 32);
> @@ -1129,6 +1129,10 @@ static void kvm_init_irq_routing(KVMState *s)
> {
> }
> 
> +void kvm_irqchip_release_virq(KVMState *s, int virq)
> +{
> +}
> +
> int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
> {
>     abort();
> @@ -1286,7 +1290,9 @@ int kvm_init(void)
>     s->pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);
> #endif
> 
> +#ifdef KVM_CAP_IRQ_ROUTING
>     s->direct_msi = (kvm_check_extension(s, KVM_CAP_SIGNAL_MSI) > 0);
> +#endif
> 
>     ret = kvm_arch_init(s);
>     if (ret < 0) {
> -- 
> 1.7.3.4

--
Bluecherry: http://www.bluecherrydvr.com/
SwissDisk : http://www.swissdisk.com/
Ubuntu    : http://www.ubuntu.com/
My Blog   : http://ben-collins.blogspot.com/
Andreas Färber June 6, 2012, 12:24 a.m. UTC | #2
Am 05.06.2012 21:03, schrieb Jan Kiszka:
> A type definition and a KVMState field initialization escaped the
> required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
> dummy kvm_irqchip_release_virq as virtio-pci references (but does not
> use) it.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>

Tested-by: Andreas Färber <afaerber@suse.de>

Thanks,
Andreas
Avi Kivity June 6, 2012, 8:41 a.m. UTC | #3
On 06/05/2012 10:03 PM, Jan Kiszka wrote:
> A type definition and a KVMState field initialization escaped the
> required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
> dummy kvm_irqchip_release_virq as virtio-pci references (but does not
> use) it.
> 

Thanks, applied.
Jan Kiszka June 6, 2012, 10:31 a.m. UTC | #4
On 2012-06-06 10:41, Avi Kivity wrote:
> On 06/05/2012 10:03 PM, Jan Kiszka wrote:
>> A type definition and a KVMState field initialization escaped the
>> required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
>> dummy kvm_irqchip_release_virq as virtio-pci references (but does not
>> use) it.
>>
> 
> Thanks, applied.

Please send a pull soon.

Jan
Avi Kivity June 6, 2012, 10:44 a.m. UTC | #5
On 06/06/2012 01:31 PM, Jan Kiszka wrote:
> On 2012-06-06 10:41, Avi Kivity wrote:
>> On 06/05/2012 10:03 PM, Jan Kiszka wrote:
>>> A type definition and a KVMState field initialization escaped the
>>> required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
>>> dummy kvm_irqchip_release_virq as virtio-pci references (but does not
>>> use) it.
>>>
>> 
>> Thanks, applied.
> 
> Please send a pull soon.

It was posted already, I just forgot to copy you.
Anthony Liguori June 6, 2012, 11:06 a.m. UTC | #6
On 06/06/2012 06:44 PM, Avi Kivity wrote:
> On 06/06/2012 01:31 PM, Jan Kiszka wrote:
>> On 2012-06-06 10:41, Avi Kivity wrote:
>>> On 06/05/2012 10:03 PM, Jan Kiszka wrote:
>>>> A type definition and a KVMState field initialization escaped the
>>>> required wrapping with KVM_CAP_IRQ_ROUTING. Also, we need to provide a
>>>> dummy kvm_irqchip_release_virq as virtio-pci references (but does not
>>>> use) it.
>>>>
>>>
>>> Thanks, applied.
>>
>> Please send a pull soon.
>
> It was posted already, I just forgot to copy you.

It's being tested as we type too.

Regards,

Anthony Liguori

>
>
diff mbox

Patch

diff --git a/kvm-all.c b/kvm-all.c
index 489ee53..4ea7d85 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -62,11 +62,6 @@  typedef struct KVMSlot
 
 typedef struct kvm_dirty_log KVMDirtyLog;
 
-typedef struct KVMMSIRoute {
-    struct kvm_irq_routing_entry kroute;
-    QTAILQ_ENTRY(KVMMSIRoute) entry;
-} KVMMSIRoute;
-
 struct KVMState
 {
     KVMSlot slots[32];
@@ -867,6 +862,11 @@  int kvm_irqchip_set_irq(KVMState *s, int irq, int level)
 }
 
 #ifdef KVM_CAP_IRQ_ROUTING
+typedef struct KVMMSIRoute {
+    struct kvm_irq_routing_entry kroute;
+    QTAILQ_ENTRY(KVMMSIRoute) entry;
+} KVMMSIRoute;
+
 static void set_gsi(KVMState *s, unsigned int gsi)
 {
     s->used_gsi_bitmap[gsi / 32] |= 1U << (gsi % 32);
@@ -1129,6 +1129,10 @@  static void kvm_init_irq_routing(KVMState *s)
 {
 }
 
+void kvm_irqchip_release_virq(KVMState *s, int virq)
+{
+}
+
 int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg)
 {
     abort();
@@ -1286,7 +1290,9 @@  int kvm_init(void)
     s->pit_state2 = kvm_check_extension(s, KVM_CAP_PIT_STATE2);
 #endif
 
+#ifdef KVM_CAP_IRQ_ROUTING
     s->direct_msi = (kvm_check_extension(s, KVM_CAP_SIGNAL_MSI) > 0);
+#endif
 
     ret = kvm_arch_init(s);
     if (ret < 0) {