qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2] ivshmem-server: Clean up shmem on shutdown


From: Claudio Fontana
Subject: Re: [Qemu-devel] [PATCH v2] ivshmem-server: Clean up shmem on shutdown
Date: Tue, 6 Aug 2019 15:01:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2

On 8/5/19 7:54 AM, Jan Kiszka wrote:
> From: Jan Kiszka <address@hidden>
> 
> So far, the server leaves the posix shared memory object behind when
> terminating, requiring the user to explicitly remove it in order to
> start a new instance.
> 
> Signed-off-by: Jan Kiszka <address@hidden>
> ---
> 
> Changes in v2:
>  - respect use_shm_open
>  - also clean up in ivshmem_server_start error path
> 
>  contrib/ivshmem-server/ivshmem-server.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/contrib/ivshmem-server/ivshmem-server.c 
> b/contrib/ivshmem-server/ivshmem-server.c
> index 77f97b209c..88daee812d 100644
> --- a/contrib/ivshmem-server/ivshmem-server.c
> +++ b/contrib/ivshmem-server/ivshmem-server.c
> @@ -353,6 +353,9 @@ ivshmem_server_start(IvshmemServer *server)
>  err_close_sock:
>      close(sock_fd);
>  err_close_shm:
> +    if (server->use_shm_open) {
> +        shm_unlink(server->shm_path);
> +    }
>      close(shm_fd);
>      return -1;
>  }
> @@ -370,6 +373,9 @@ ivshmem_server_close(IvshmemServer *server)
>      }
> 
>      unlink(server->unix_sock_path);
> +    if (server->use_shm_open) {
> +        shm_unlink(server->shm_path);
> +    }
>      close(server->sock_fd);
>      close(server->shm_fd);
>      server->sock_fd = -1;
> --
> 2.16.4
> 
> 

Reviewed-by: Claudio Fontana <address@hidden>




reply via email to

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