qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initi


From: Claudio Fontana
Subject: Re: [Qemu-devel] [PATCH v4 25/47] ivshmem: check shm isn't already initialized
Date: Tue, 29 Sep 2015 15:32:49 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:38.0) Gecko/20100101 Thunderbird/38.2.0

On 24.09.2015 13:37, address@hidden wrote:
> From: Marc-André Lureau <address@hidden>
> 
> The server should not change the shm, and this isn't handled by qemu.

"..., and we should verify this in 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);
> 

Reviewed-by: Claudio Fontana <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]