mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-23 19:49:43 +00:00
ivshmem: error on too many eventfd received
The number of eventfd that can be handled per peer is limited by the number of vectors. Return an error when receiving too many of them. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
This commit is contained in:
parent
f456179fae
commit
1ee57de444
@ -571,6 +571,13 @@ static void ivshmem_read(void *opaque, const uint8_t *buf, int size)
|
||||
/* each peer has an associated array of eventfds, and we keep
|
||||
* track of how many eventfds received so far */
|
||||
/* get a new eventfd: */
|
||||
if (peer->nb_eventfds >= s->vectors) {
|
||||
error_report("Too many eventfd received, device has %d vectors",
|
||||
s->vectors);
|
||||
close(incoming_fd);
|
||||
return;
|
||||
}
|
||||
|
||||
new_eventfd = peer->nb_eventfds++;
|
||||
|
||||
/* this is an eventfd for a particular peer VM */
|
||||
|
Loading…
Reference in New Issue
Block a user