From: Claudio Fontana <claudio.fontana@suse.com>
To: Jan Kiszka <jan.kiszka@web.de>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] ivshmem-server: Clean up shmem on shutdown
Date: Tue, 6 Aug 2019 15:01:02 +0200 [thread overview]
Message-ID: <2587815f-e4eb-1f44-0b2d-5b77e3337553@suse.de> (raw)
In-Reply-To: <d938a62c-7538-9d2b-cc0a-13b240ab9141@web.de>
On 8/5/19 7:54 AM, Jan Kiszka wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> 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 <jan.kiszka@siemens.com>
> ---
>
> 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 <claudio.fontana@suse.com>
next prev parent reply other threads:[~2019-08-06 13:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-05 5:54 [Qemu-devel] [PATCH v2] ivshmem-server: Clean up shmem on shutdown Jan Kiszka
2019-08-06 13:01 ` Claudio Fontana [this message]
2019-11-08 9:08 ` Jan Kiszka
2019-11-08 15:14 ` Markus Armbruster
2019-11-12 9:36 ` Laurent Vivier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2587815f-e4eb-1f44-0b2d-5b77e3337553@suse.de \
--to=claudio.fontana@suse.com \
--cc=jan.kiszka@web.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).