mirror of
https://github.com/qemu/qemu.git
synced 2024-11-24 19:33:39 +08:00
ivshmem: check shm isn't already initialized
The server should not change the shm, and this isn't handled by qemu and we should should verify this in qemu. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
This commit is contained in:
parent
86d471bfa4
commit
945001a1af
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user