* [Qemu-devel] [PATCH] KVM: Fix compiles when KVM_CAP_IRQ_ROUTING is not defined
@ 2012-06-05 18:08 Ben Collins
2012-06-05 18:15 ` Jan Kiszka
0 siblings, 1 reply; 3+ messages in thread
From: Ben Collins @ 2012-06-05 18:08 UTC (permalink / raw)
To: qemu-devel; +Cc: Marcelo Tosatti, Avi Kivity
Things like kroute and direct_msi were not protected by ifdef's for when
this feature is not enabled. Also, virtio-pci was referencing
kvm_irqchip_release_virq() which was not defined without KVM_CAP_IRQ_ROUTING
but when KVM was enabled.
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Cc: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
---
kvm-all.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kvm-all.c b/kvm-all.c
index 489ee53..b0f6e06 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -63,7 +63,9 @@ typedef struct KVMSlot
typedef struct kvm_dirty_log KVMDirtyLog;
typedef struct KVMMSIRoute {
+#ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_entry kroute;
+#endif
QTAILQ_ENTRY(KVMMSIRoute) entry;
} KVMMSIRoute;
@@ -1143,6 +1145,10 @@ static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int virq, bool assign)
{
abort();
}
+
+void kvm_irqchip_release_virq(KVMState *s, int virq)
+{
+}
#endif /* !KVM_CAP_IRQ_ROUTING */
int kvm_irqchip_add_irqfd(KVMState *s, int fd, int virq)
@@ -1286,7 +1292,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.9.5
--
Bluecherry: http://www.bluecherrydvr.com/
SwissDisk : http://www.swissdisk.com/
Ubuntu : http://www.ubuntu.com/
My Blog : http://ben-collins.blogspot.com/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] KVM: Fix compiles when KVM_CAP_IRQ_ROUTING is not defined
2012-06-05 18:08 [Qemu-devel] [PATCH] KVM: Fix compiles when KVM_CAP_IRQ_ROUTING is not defined Ben Collins
@ 2012-06-05 18:15 ` Jan Kiszka
2012-06-05 19:02 ` Ben Collins
0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2012-06-05 18:15 UTC (permalink / raw)
To: Ben Collins; +Cc: Marcelo Tosatti, qemu-devel, Avi Kivity
On 2012-06-05 20:08, Ben Collins wrote:
> Things like kroute and direct_msi were not protected by ifdef's for when
> this feature is not enabled. Also, virtio-pci was referencing
> kvm_irqchip_release_virq() which was not defined without KVM_CAP_IRQ_ROUTING
> but when KVM was enabled.
There is [1] already which I prefer for the first two issues. Would you
like to adjust your patch, or should I adopt the
kvm_irqchip_release_virq fix?
Thanks,
Jan
[1] http://thread.gmane.org/gmane.comp.emulators.qemu/153940
>
> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
> Cc: Avi Kivity <avi@redhat.com>
> Cc: Marcelo Tosatti <mtosatti@redhat.com>
> ---
> kvm-all.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/kvm-all.c b/kvm-all.c
> index 489ee53..b0f6e06 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -63,7 +63,9 @@ typedef struct KVMSlot
> typedef struct kvm_dirty_log KVMDirtyLog;
>
> typedef struct KVMMSIRoute {
> +#ifdef KVM_CAP_IRQ_ROUTING
> struct kvm_irq_routing_entry kroute;
> +#endif
> QTAILQ_ENTRY(KVMMSIRoute) entry;
> } KVMMSIRoute;
>
> @@ -1143,6 +1145,10 @@ static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int virq, bool assign)
> {
> abort();
> }
> +
> +void kvm_irqchip_release_virq(KVMState *s, int virq)
> +{
> +}
> #endif /* !KVM_CAP_IRQ_ROUTING */
>
> int kvm_irqchip_add_irqfd(KVMState *s, int fd, int virq)
> @@ -1286,7 +1292,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) {
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] KVM: Fix compiles when KVM_CAP_IRQ_ROUTING is not defined
2012-06-05 18:15 ` Jan Kiszka
@ 2012-06-05 19:02 ` Ben Collins
0 siblings, 0 replies; 3+ messages in thread
From: Ben Collins @ 2012-06-05 19:02 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, qemu-devel, Avi Kivity
Please just adopt the remaining portion. Perhaps just merge it with your patch for one complete fix.
Thanks
On Jun 5, 2012, at 2:15 PM, Jan Kiszka wrote:
> On 2012-06-05 20:08, Ben Collins wrote:
>> Things like kroute and direct_msi were not protected by ifdef's for when
>> this feature is not enabled. Also, virtio-pci was referencing
>> kvm_irqchip_release_virq() which was not defined without KVM_CAP_IRQ_ROUTING
>> but when KVM was enabled.
>
> There is [1] already which I prefer for the first two issues. Would you
> like to adjust your patch, or should I adopt the
> kvm_irqchip_release_virq fix?
>
> Thanks,
> Jan
>
> [1] http://thread.gmane.org/gmane.comp.emulators.qemu/153940
>
>>
>> Signed-off-by: Ben Collins <bcollins@ubuntu.com>
>> Cc: Avi Kivity <avi@redhat.com>
>> Cc: Marcelo Tosatti <mtosatti@redhat.com>
>> ---
>> kvm-all.c | 8 ++++++++
>> 1 file changed, 8 insertions(+)
>>
>> diff --git a/kvm-all.c b/kvm-all.c
>> index 489ee53..b0f6e06 100644
>> --- a/kvm-all.c
>> +++ b/kvm-all.c
>> @@ -63,7 +63,9 @@ typedef struct KVMSlot
>> typedef struct kvm_dirty_log KVMDirtyLog;
>>
>> typedef struct KVMMSIRoute {
>> +#ifdef KVM_CAP_IRQ_ROUTING
>> struct kvm_irq_routing_entry kroute;
>> +#endif
>> QTAILQ_ENTRY(KVMMSIRoute) entry;
>> } KVMMSIRoute;
>>
>> @@ -1143,6 +1145,10 @@ static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int virq, bool assign)
>> {
>> abort();
>> }
>> +
>> +void kvm_irqchip_release_virq(KVMState *s, int virq)
>> +{
>> +}
>> #endif /* !KVM_CAP_IRQ_ROUTING */
>>
>> int kvm_irqchip_add_irqfd(KVMState *s, int fd, int virq)
>> @@ -1286,7 +1292,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) {
>
> --
> Siemens AG, Corporate Technology, CT T DE IT 1
> Corporate Competence Center Embedded Linux
--
Bluecherry: http://www.bluecherrydvr.com/
SwissDisk : http://www.swissdisk.com/
Ubuntu : http://www.ubuntu.com/
My Blog : http://ben-collins.blogspot.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-05 19:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-05 18:08 [Qemu-devel] [PATCH] KVM: Fix compiles when KVM_CAP_IRQ_ROUTING is not defined Ben Collins
2012-06-05 18:15 ` Jan Kiszka
2012-06-05 19:02 ` Ben Collins
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).