All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fam Zheng <famz@redhat.com>
To: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH for-2.0] dataplane: fix implicit IOThread refcount
Date: Wed, 19 Mar 2014 16:21:56 +0800	[thread overview]
Message-ID: <20140319082156.GC2034@T430.redhat.com> (raw)
In-Reply-To: <1395161452-5123-1-git-send-email-stefanha@redhat.com>

On Tue, 03/18 17:50, Stefan Hajnoczi wrote:
> When creating an IOThread implicitly (the user did not specify
> x-iothread=<id>) remember that iothread_find() does not return the
> object with an incremented refcount.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  hw/block/dataplane/virtio-blk.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
> index a5afc21..f558b45 100644
> --- a/hw/block/dataplane/virtio-blk.c
> +++ b/hw/block/dataplane/virtio-blk.c
> @@ -393,7 +393,6 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk,
>      if (blk->iothread) {
>          s->internal_iothread = false;
>          s->iothread = blk->iothread;
> -        object_ref(OBJECT(s->iothread));
>      } else {
>          /* Create per-device IOThread if none specified */
>          Error *local_err = NULL;
> @@ -408,6 +407,7 @@ void virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *blk,
>          s->iothread = iothread_find(vdev->name);
>          assert(s->iothread);
>      }
> +    object_ref(OBJECT(s->iothread));
>      s->ctx = iothread_get_aio_context(s->iothread);
>  
>      /* Prevent block operations that conflict with data plane thread */

Reviewed-by: Fam Zheng <famz@redhat.com>

  reply	other threads:[~2014-03-19  8:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 16:50 [Qemu-devel] [PATCH for-2.0] dataplane: fix implicit IOThread refcount Stefan Hajnoczi
2014-03-19  8:21 ` Fam Zheng [this message]
2014-03-19  8:46 ` Kevin Wolf

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=20140319082156.GC2034@T430.redhat.com \
    --to=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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 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.