qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Cc: lina.lulina@huawei.com, arei.gonglei@huawei.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH] vhost/scsi: call vhost_dev_cleanup() at unrealize() time
Date: Thu, 30 Jul 2015 15:51:13 +0200	[thread overview]
Message-ID: <55BA2BD1.8050401@redhat.com> (raw)
In-Reply-To: <1438262999-287627-1-git-send-email-imammedo@redhat.com>



On 30/07/2015 15:29, Igor Mammedov wrote:
> vhost-scsi calls vhost_dev_init() at realize() time
> but forgets to call it's counterpart vhost_dev_cleanup()
> at unrealize() time.
> 
> Calling it should fix leaking of memory table and
> mem_sections table in vhost device. And also unregister
> vhost's memory listerner to prevent access from
> memory core to freed memory.
> 
> Signed-off-by: Igor Mammedov <imammedo@redhat.com>
> ---
>  hw/scsi/vhost-scsi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/scsi/vhost-scsi.c b/hw/scsi/vhost-scsi.c
> index a69918b..0dd57ff 100644
> --- a/hw/scsi/vhost-scsi.c
> +++ b/hw/scsi/vhost-scsi.c
> @@ -277,6 +277,7 @@ static void vhost_scsi_unrealize(DeviceState *dev, Error **errp)
>      /* This will stop vhost backend. */
>      vhost_scsi_set_status(vdev, 0);
>  
> +    vhost_dev_cleanup(&s->dev);
>      g_free(s->dev.vqs);
>  
>      virtio_scsi_common_unrealize(dev, errp);
> 

Applied to scsi-next, thanks.

Paolo

      reply	other threads:[~2015-07-30 13:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 13:29 [Qemu-devel] [PATCH] vhost/scsi: call vhost_dev_cleanup() at unrealize() time Igor Mammedov
2015-07-30 13:51 ` Paolo Bonzini [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=55BA2BD1.8050401@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=imammedo@redhat.com \
    --cc=lina.lulina@huawei.com \
    --cc=mst@redhat.com \
    --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).