[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] ivshmem-server: Clean up shmem on shutdown
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v2] ivshmem-server: Clean up shmem on shutdown |
Date: |
Tue, 12 Nov 2019 10:36:26 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 |
Le 08/11/2019 à 16:14, Markus Armbruster a écrit :
> Jan Kiszka <address@hidden> writes:
>
>> On 06.08.19 15:01, Claudio Fontana wrote:
>>> 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>
>>
>> Markus, would you take this?
>
> ivshmem has no maintainer. I you need me to serve as a pull request
> monkey of last resort, I can do that. However, for this one,
> qemu-trivial (cc'ed) should do.
>
>
Applied to my trivial-patches branch.
Thanks,
Laurent