qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: tu bo <tubo@linux.vnet.ibm.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: cornelia.huck@de.ibm.com, borntraeger@de.ibm.com,
	famz@redhat.com, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 3/9] virtio-blk: fix disabled mode
Date: Thu, 31 Mar 2016 16:32:30 +0800	[thread overview]
Message-ID: <56FCE09E.1070807@linux.vnet.ibm.com> (raw)
In-Reply-To: <1459342088-24311-4-git-send-email-pbonzini@redhat.com>

Hi Paolo:

On 03/30/2016 08:48 PM, Paolo Bonzini wrote:
> The missing check on dataplane_disabled caused a segmentation
> fault in notify_guest_bh, because s->guest_notifier was NULL.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>   hw/block/dataplane/virtio-blk.c | 7 +++----
>   hw/block/virtio-blk.c           | 2 +-
>   include/hw/virtio/virtio-blk.h  | 1 +
>   3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
> index 0d76110..378feb3 100644
> --- a/hw/block/dataplane/virtio-blk.c
> +++ b/hw/block/dataplane/virtio-blk.c
> @@ -28,7 +28,6 @@
>   struct VirtIOBlockDataPlane {
>       bool starting;
>       bool stopping;
> -    bool disabled;
>
>       VirtIOBlkConf *conf;
>
> @@ -233,7 +232,7 @@ void virtio_blk_data_plane_start(VirtIOBlockDataPlane *s)
>     fail_host_notifier:
>       k->set_guest_notifiers(qbus->parent, 1, false);
>     fail_guest_notifiers:
> -    s->disabled = true;
> +    vblk->dataplane_disabled = true;
>       s->starting = false;
>       vblk->dataplane_started = true;
>   }
> @@ -250,8 +249,8 @@ void virtio_blk_data_plane_stop(VirtIOBlockDataPlane *s)
>       }
>
>       /* Better luck next time. */
> -    if (s->disabled) {
> -        s->disabled = false;
> +    if (vblk->dataplane_disabled) {
> +        vblk->dataplane_disabled = false;
>           vblk->dataplane_started = false;
>           return;
>       }
> diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
> index d0b8248..77221c1 100644
> --- a/hw/block/virtio-blk.c
> +++ b/hw/block/virtio-blk.c
> @@ -53,7 +53,7 @@ static void virtio_blk_req_complete(VirtIOBlockReq *req, unsigned char status)
>
>       stb_p(&req->in->status, status);
>       virtqueue_push(s->vq, &req->elem, req->in_len);
> -    if (s->dataplane) {
> +    if (s->dataplane_started && !s->dataplane_disabled) {
>           virtio_blk_data_plane_notify(s->dataplane);
>       } else {
>           virtio_notify(vdev, s->vq);
> diff --git a/include/hw/virtio/virtio-blk.h b/include/hw/virtio/virtio-blk.h
> index 5cb66cd..073c632 100644
> --- a/include/hw/virtio/virtio-blk.h
> +++ b/include/hw/virtio/virtio-blk.h
> @@ -53,6 +53,7 @@ typedef struct VirtIOBlock {
>       unsigned short sector_mask;
>       bool original_wce;
>       VMChangeStateEntry *change;
> +    bool dataplane_disabled;
>       bool dataplane_started;
>       int reentrancy_test;

There is no "int reentrancy_test;" in the latest qemu master. thx

>       struct VirtIOBlockDataPlane *dataplane;
>

  parent reply	other threads:[~2016-03-31  8:32 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-30 12:47 [Qemu-devel] [PATCH resend 0/9] virtio: aio handler API Paolo Bonzini
2016-03-30 12:48 ` [Qemu-devel] [PATCH 1/9] virtio-dataplane: pass assign=true to virtio_queue_aio_set_host_notifier_handler Paolo Bonzini
2016-03-30 13:23   ` Cornelia Huck
2016-03-30 13:30     ` Paolo Bonzini
2016-03-30 13:43       ` Cornelia Huck
2016-03-30 13:44   ` Cornelia Huck
2016-03-30 12:48 ` [Qemu-devel] [PATCH 2/9] virtio: make virtio_queue_notify_vq static Paolo Bonzini
2016-03-30 13:39   ` Cornelia Huck
2016-03-30 12:48 ` [Qemu-devel] [PATCH 3/9] virtio-blk: fix disabled mode Paolo Bonzini
2016-03-30 13:57   ` Cornelia Huck
2016-03-31  8:32   ` tu bo [this message]
2016-03-31  8:36     ` Paolo Bonzini
2016-03-30 12:48 ` [Qemu-devel] [PATCH 4/9] virtio-scsi: " Paolo Bonzini
2016-03-30 14:52   ` Cornelia Huck
2016-03-30 12:48 ` [Qemu-devel] [PATCH 5/9] virtio: add aio handler Paolo Bonzini
2016-03-30 14:55   ` Cornelia Huck
2016-03-30 15:09     ` Paolo Bonzini
2016-03-30 12:48 ` [Qemu-devel] [PATCH 6/9] virtio-blk: use aio handler for data plane Paolo Bonzini
2016-03-30 15:25   ` Cornelia Huck
2016-03-30 15:42     ` Paolo Bonzini
2016-03-30 12:48 ` [Qemu-devel] [PATCH 7/9] virtio-scsi: " Paolo Bonzini
2016-03-30 15:31   ` Cornelia Huck
2016-03-30 12:48 ` [Qemu-devel] [PATCH 8/9] virtio: merge virtio_queue_aio_set_host_notifier_handler with virtio_queue_set_aio Paolo Bonzini
2016-03-30 15:33   ` Cornelia Huck
2016-03-30 12:48 ` [Qemu-devel] [PATCH 9/9] virtio: remove starting/stopping checks Paolo Bonzini
2016-03-30 15:36   ` Cornelia Huck
  -- strict thread matches above, loose matches on Subject: below --
2016-04-01 13:19 [Qemu-devel] [PATCH v2 0/9] virtio: aio handler API Paolo Bonzini
2016-04-01 13:19 ` [Qemu-devel] [PATCH 3/9] virtio-blk: fix disabled mode Paolo Bonzini

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=56FCE09E.1070807@linux.vnet.ibm.com \
    --to=tubo@linux.vnet.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=famz@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@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).