All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
@ 2023-01-30 14:02 ` Akihiko Odaki
  0 siblings, 0 replies; 6+ messages in thread
From: Akihiko Odaki @ 2023-01-30 14:02 UTC (permalink / raw)
  Cc: Dr. David Alan Gilbert, Stefan Hajnoczi, Michael S. Tsirkin,
	virtio-fs, qemu-devel, Akihiko Odaki

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>
---
 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



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Virtio-fs] [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
@ 2023-01-30 14:02 ` Akihiko Odaki
  0 siblings, 0 replies; 6+ messages in thread
From: Akihiko Odaki @ 2023-01-30 14:02 UTC (permalink / raw)
  Cc: Dr. David Alan Gilbert, Stefan Hajnoczi, Michael S. Tsirkin,
	virtio-fs, qemu-devel, Akihiko Odaki

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>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
  2023-01-30 14:02 ` [Virtio-fs] " Akihiko Odaki
@ 2023-01-30 16:12   ` Stefan Hajnoczi
  -1 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2023-01-30 16:12 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Dr. David Alan Gilbert, Stefan Hajnoczi, Michael S. Tsirkin,
	virtio-fs, qemu-devel

On Mon, 30 Jan 2023 at 09:03, Akihiko Odaki <akihiko.odaki@daynix.com> 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>
> ---
>  hw/virtio/vhost-user-fs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Merged into my block tree, thank you!

Stefan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Virtio-fs] [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
@ 2023-01-30 16:12   ` Stefan Hajnoczi
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2023-01-30 16:12 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Dr. David Alan Gilbert, Stefan Hajnoczi, Michael S. Tsirkin,
	virtio-fs, qemu-devel

On Mon, 30 Jan 2023 at 09:03, Akihiko Odaki <akihiko.odaki@daynix.com> 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>
> ---
>  hw/virtio/vhost-user-fs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Merged into my block tree, thank you!

Stefan


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
  2023-01-30 14:02 ` [Virtio-fs] " Akihiko Odaki
@ 2023-01-30 19:09   ` Michael S. Tsirkin
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2023-01-30 19:09 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Dr. David Alan Gilbert, Stefan Hajnoczi, virtio-fs, qemu-devel

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



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Virtio-fs] [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev
@ 2023-01-30 19:09   ` Michael S. Tsirkin
  0 siblings, 0 replies; 6+ messages in thread
From: Michael S. Tsirkin @ 2023-01-30 19:09 UTC (permalink / raw)
  To: Akihiko Odaki
  Cc: Dr. David Alan Gilbert, Stefan Hajnoczi, virtio-fs, qemu-devel

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-01-30 19:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-30 14:02 [PATCH] vhost-user-fs: Back up vqs before cleaning up vhost_dev Akihiko Odaki
2023-01-30 14:02 ` [Virtio-fs] " Akihiko Odaki
2023-01-30 16:12 ` Stefan Hajnoczi
2023-01-30 16:12   ` [Virtio-fs] " Stefan Hajnoczi
2023-01-30 19:09 ` Michael S. Tsirkin
2023-01-30 19:09   ` [Virtio-fs] " Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.