[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 25/46] ivshmem: check shm isn't already initializ
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v3 25/46] ivshmem: check shm isn't already initialized |
Date: |
Tue, 15 Sep 2015 18:07:42 +0200 |
From: Marc-André Lureau <address@hidden>
The server should not change the shm, and this isn't handled by qemu.
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/misc/ivshmem.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index c80503d..493e3c7 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -533,6 +533,12 @@ static void ivshmem_read(void *opaque, const uint8_t *buf,
int size)
if (incoming_posn == -1) {
void * map_ptr;
+ if (s->shm_fd >= 0) {
+ error_report("shm already initialized");
+ close(incoming_fd);
+ return;
+ }
+
if (check_shm_size(s, incoming_fd, &err) == -1) {
error_report_err(err);
close(incoming_fd);
--
2.4.3
- [Qemu-devel] [PATCH v3 20/46] ivshmem: simplify a bit the code, (continued)
- [Qemu-devel] [PATCH v3 20/46] ivshmem: simplify a bit the code, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 19/46] ivshmem: print error on invalid peer id, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 21/46] ivshmem: use common return, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 22/46] ivshmem: use common is_power_of_2(), marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 23/46] ivshmem: migrate with VMStateDescription, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 25/46] ivshmem: check shm isn't already initialized,
marcandre . lureau <=
- [Qemu-devel] [PATCH v3 24/46] ivshmem: shmfd can be 0, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 27/46] ivshmem: fix pci_ivshmem_exit(), marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 26/46] ivshmem: add device description, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 28/46] ivshmem: replace 'guest' for 'peer' appropriately, marcandre . lureau, 2015/09/15
- [Qemu-devel] [PATCH v3 29/46] ivshmem: error on too many eventfd received, marcandre . lureau, 2015/09/15