* [Qemu-devel] [PATCH 1/2] ivshmem: Fix compilation (wrong format specifier)
@ 2010-08-11 7:38 Stefan Weil
2010-08-11 7:38 ` [Qemu-devel] [PATCH 2/2] ivshmem: Fix compilation without kvm Stefan Weil
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2010-08-11 7:38 UTC (permalink / raw)
To: QEMU Developers; +Cc: Anthony Liguori, Cam Macdonell
st_size is an off32_t or off64_t, so %ld does not always work.
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/ivshmem.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index bbb5cba..ec894e9 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -352,8 +352,8 @@ static int check_shm_size(IVShmemState *s, int fd) {
if (s->ivshmem_size > buf.st_size) {
fprintf(stderr, "IVSHMEM ERROR: Requested memory size greater");
- fprintf(stderr, " than shared object size (%" PRIu64 " > %ld)\n",
- s->ivshmem_size, buf.st_size);
+ fprintf(stderr, " than shared object size (%" PRIu64 " > %" PRIu64 ")\n",
+ s->ivshmem_size, (uint64_t)buf.st_size);
return -1;
} else {
return 0;
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] [PATCH 2/2] ivshmem: Fix compilation without kvm
2010-08-11 7:38 [Qemu-devel] [PATCH 1/2] ivshmem: Fix compilation (wrong format specifier) Stefan Weil
@ 2010-08-11 7:38 ` Stefan Weil
2010-08-11 17:05 ` [Qemu-devel] " Paolo Bonzini
0 siblings, 1 reply; 6+ messages in thread
From: Stefan Weil @ 2010-08-11 7:38 UTC (permalink / raw)
To: QEMU Developers; +Cc: Anthony Liguori, Cam Macdonell
kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM.
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/ivshmem.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index ec894e9..63562e1 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -385,8 +385,10 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
guest_curr_max = s->peers[posn].nb_eventfds;
for (i = 0; i < guest_curr_max; i++) {
+#if defined(CONFIG_KVM)
kvm_set_ioeventfd_mmio_long(s->peers[posn].eventfds[i],
s->mmio_addr + DOORBELL, (posn << 16) | i, 0);
+#endif
close(s->peers[posn].eventfds[i]);
}
@@ -395,7 +397,7 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
}
static void setup_ioeventfds(IVShmemState *s) {
-
+#if defined(CONFIG_KVM)
int i, j;
for (i = 0; i <= s->max_peer; i++) {
@@ -404,6 +406,7 @@ static void setup_ioeventfds(IVShmemState *s) {
s->mmio_addr + DOORBELL, (i << 16) | j, 1);
}
}
+#endif
}
/* this function increase the dynamic storage need to store data about other
@@ -530,12 +533,14 @@ static void ivshmem_read(void *opaque, const uint8_t * buf, int flags)
guest_max_eventfd);
}
+#if defined(CONFIG_KVM)
if (ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {
if (kvm_set_ioeventfd_mmio_long(incoming_fd, s->mmio_addr + DOORBELL,
(incoming_posn << 16) | guest_max_eventfd, 1) < 0) {
fprintf(stderr, "ivshmem: ioeventfd not available\n");
}
}
+#endif
return;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Qemu-devel] Re: [PATCH 2/2] ivshmem: Fix compilation without kvm
2010-08-11 7:38 ` [Qemu-devel] [PATCH 2/2] ivshmem: Fix compilation without kvm Stefan Weil
@ 2010-08-11 17:05 ` Paolo Bonzini
2010-08-11 17:18 ` Blue Swirl
2010-08-11 17:58 ` Cam Macdonell
0 siblings, 2 replies; 6+ messages in thread
From: Paolo Bonzini @ 2010-08-11 17:05 UTC (permalink / raw)
To: Stefan Weil; +Cc: Anthony Liguori, Cam Macdonell, QEMU Developers
On 08/11/2010 03:38 AM, Stefan Weil wrote:
> kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM.
We should just disable ivshmem for non-KVM
diff --git a/Makefile.target b/Makefile.target
index b791492..c8281e9 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -191,7 +191,7 @@ obj-y += rtl8139.o
obj-y += e1000.o
# Inter-VM PCI shared memory
-obj-y += ivshmem.o
+obj-$(CONFIG_KVM) += ivshmem.o
# Hardware support
obj-i386-y += vga.o
because it is also breaking Windows builds.
Alternatively, the right way to do what this patch does, is to add
kvm_set_ioeventfd_mmio_long to kvm-stub.c, and to use
"obj-$(CONFIG_POSIX) += ivshmem.o" in the makefile to work around the
Windows build problems.
Paolo
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [Qemu-devel] Re: [PATCH 2/2] ivshmem: Fix compilation without kvm
2010-08-11 17:05 ` [Qemu-devel] " Paolo Bonzini
@ 2010-08-11 17:18 ` Blue Swirl
2010-08-11 18:11 ` Paolo Bonzini
2010-08-11 17:58 ` Cam Macdonell
1 sibling, 1 reply; 6+ messages in thread
From: Blue Swirl @ 2010-08-11 17:18 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Anthony Liguori, Cam Macdonell, QEMU Developers
[-- Attachment #1: Type: text/plain, Size: 909 bytes --]
On Wed, Aug 11, 2010 at 5:05 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 08/11/2010 03:38 AM, Stefan Weil wrote:
>>
>> kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM.
>
> We should just disable ivshmem for non-KVM
>
> diff --git a/Makefile.target b/Makefile.target
> index b791492..c8281e9 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -191,7 +191,7 @@ obj-y += rtl8139.o
> obj-y += e1000.o
>
> # Inter-VM PCI shared memory
> -obj-y += ivshmem.o
> +obj-$(CONFIG_KVM) += ivshmem.o
>
> # Hardware support
> obj-i386-y += vga.o
>
> because it is also breaking Windows builds.
>
> Alternatively, the right way to do what this patch does, is to add
> kvm_set_ioeventfd_mmio_long to kvm-stub.c, and to use "obj-$(CONFIG_POSIX)
> += ivshmem.o" in the makefile to work around the Windows build problems.
This patch fixes mingw32 build for me.
[-- Attachment #2: 0001-Fix-mingw32-build.patch --]
[-- Type: application/mbox, Size: 1731 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] Re: [PATCH 2/2] ivshmem: Fix compilation without kvm
2010-08-11 17:05 ` [Qemu-devel] " Paolo Bonzini
2010-08-11 17:18 ` Blue Swirl
@ 2010-08-11 17:58 ` Cam Macdonell
1 sibling, 0 replies; 6+ messages in thread
From: Cam Macdonell @ 2010-08-11 17:58 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Anthony Liguori, QEMU Developers
On Wed, Aug 11, 2010 at 1:05 PM, Paolo Bonzini <pbonzini@redhat.com> wrote:
> On 08/11/2010 03:38 AM, Stefan Weil wrote:
>>
>> kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM.
>
> We should just disable ivshmem for non-KVM
>
> diff --git a/Makefile.target b/Makefile.target
> index b791492..c8281e9 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -191,7 +191,7 @@ obj-y += rtl8139.o
> obj-y += e1000.o
>
> # Inter-VM PCI shared memory
> -obj-y += ivshmem.o
> +obj-$(CONFIG_KVM) += ivshmem.o
>
> # Hardware support
> obj-i386-y += vga.o
>
> because it is also breaking Windows builds.
>
> Alternatively, the right way to do what this patch does, is to add
> kvm_set_ioeventfd_mmio_long to kvm-stub.c, and to use "obj-$(CONFIG_POSIX)
> += ivshmem.o" in the makefile to work around the Windows build problems.
>
I think we decided to disable it on non-KVM systems to avoid people
stumbling into atomicity issues with emulation.
> Paolo
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Qemu-devel] Re: [PATCH 2/2] ivshmem: Fix compilation without kvm
2010-08-11 17:18 ` Blue Swirl
@ 2010-08-11 18:11 ` Paolo Bonzini
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2010-08-11 18:11 UTC (permalink / raw)
To: Blue Swirl; +Cc: Anthony Liguori, Cam Macdonell, QEMU Developers
On 08/11/2010 01:18 PM, Blue Swirl wrote:
> On Wed, Aug 11, 2010 at 5:05 PM, Paolo Bonzini<pbonzini@redhat.com> wrote:
>> On 08/11/2010 03:38 AM, Stefan Weil wrote:
>>>
>>> kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM.
>>
>> We should just disable ivshmem for non-KVM
>>
>> diff --git a/Makefile.target b/Makefile.target
>> index b791492..c8281e9 100644
>> --- a/Makefile.target
>> +++ b/Makefile.target
>> @@ -191,7 +191,7 @@ obj-y += rtl8139.o
>> obj-y += e1000.o
>>
>> # Inter-VM PCI shared memory
>> -obj-y += ivshmem.o
>> +obj-$(CONFIG_KVM) += ivshmem.o
>>
>> # Hardware support
>> obj-i386-y += vga.o
>>
>> because it is also breaking Windows builds.
>>
>> Alternatively, the right way to do what this patch does, is to add
>> kvm_set_ioeventfd_mmio_long to kvm-stub.c, and to use "obj-$(CONFIG_POSIX)
>> += ivshmem.o" in the makefile to work around the Windows build problems.
>
> This patch fixes mingw32 build for me.
Looks fine.
Paolo
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-08-11 18:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-11 7:38 [Qemu-devel] [PATCH 1/2] ivshmem: Fix compilation (wrong format specifier) Stefan Weil
2010-08-11 7:38 ` [Qemu-devel] [PATCH 2/2] ivshmem: Fix compilation without kvm Stefan Weil
2010-08-11 17:05 ` [Qemu-devel] " Paolo Bonzini
2010-08-11 17:18 ` Blue Swirl
2010-08-11 18:11 ` Paolo Bonzini
2010-08-11 17:58 ` Cam Macdonell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.