[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initializ
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initialized |
Date: |
Thu, 24 Sep 2015 13:37:27 +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 ea80548..21ef260 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 v4 13/47] ivshmem: allocate eventfds in resize_peers(), (continued)
- [Qemu-devel] [PATCH v4 13/47] ivshmem: allocate eventfds in resize_peers(), marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 16/47] ivshmem: remove max_peer field, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 15/47] ivshmem: initialize max_peer to -1, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 17/47] ivshmem: improve debug messages, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 18/47] ivshmem: improve error handling, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 19/47] ivshmem: print error on invalid peer id, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 20/47] ivshmem: simplify a bit the code, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 21/47] ivshmem: use common return, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 22/47] ivshmem: use common is_power_of_2(), marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 23/47] ivshmem: migrate with VMStateDescription, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initialized,
marcandre . lureau <=
- [Qemu-devel] [PATCH v4 24/47] ivshmem: shmfd can be 0, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 26/47] ivshmem: add device description, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 27/47] ivshmem: fix pci_ivshmem_exit(), marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 28/47] ivshmem: replace 'guest' for 'peer' appropriately, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 29/47] ivshmem: error on too many eventfd received, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 30/47] ivshmem: reset mask on device reset, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 32/47] ivshmem-client: check the number of vectors, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 33/47] ivshmem-server: use a uint16 for client ID, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 34/47] ivshmem-server: fix hugetlbfs support, marcandre . lureau, 2015/09/24
- [Qemu-devel] [PATCH v4 31/47] contrib: add ivshmem client and server, marcandre . lureau, 2015/09/24