From: "Michael S. Tsirkin" <mst@redhat.com>
To: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
virtio-fs@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
Date: Mon, 30 Jan 2023 14:09:57 -0500 [thread overview]
Message-ID: <20230130140947-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20230130140225.77964-1-akihiko.odaki@daynix.com>
On Mon, Jan 30, 2023 at 11:02:25PM +0900, Akihiko Odaki wrote:
> vhost_dev_cleanup() clears vhost_dev so back up its vqs member to free
> the memory pointed by the member.
>
> Fixes: 98fc1ada4c ("virtio: add vhost-user-fs base device")
> Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/virtio/vhost-user-fs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/vhost-user-fs.c b/hw/virtio/vhost-user-fs.c
> index f5049735ac..83fc20e49e 100644
> --- a/hw/virtio/vhost-user-fs.c
> +++ b/hw/virtio/vhost-user-fs.c
> @@ -273,6 +273,7 @@ static void vuf_device_unrealize(DeviceState *dev)
> {
> VirtIODevice *vdev = VIRTIO_DEVICE(dev);
> VHostUserFS *fs = VHOST_USER_FS(dev);
> + struct vhost_virtqueue *vhost_vqs = fs->vhost_dev.vqs;
> int i;
>
> /* This will stop vhost backend if appropriate. */
> @@ -288,8 +289,7 @@ static void vuf_device_unrealize(DeviceState *dev)
> }
> g_free(fs->req_vqs);
> virtio_cleanup(vdev);
> - g_free(fs->vhost_dev.vqs);
> - fs->vhost_dev.vqs = NULL;
> + g_free(vhost_vqs);
> }
>
> static struct vhost_dev *vuf_get_vhost(VirtIODevice *vdev)
> --
> 2.39.1
prev parent reply other threads:[~2023-01-30 19:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-30 14:02 [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev Akihiko Odaki
2023-01-30 16:12 ` Stefan Hajnoczi
2023-01-30 19:09 ` Michael S. Tsirkin [this message]
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=20230130140947-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=akihiko.odaki@daynix.com \
--cc=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=virtio-fs@redhat.com \
/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).