All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, qemu-devel@nongnu.org
Cc: Andrey Korolyov <andrey@xdel.ru>, qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3] vhost_net: cleanup recovery
Date: Wed, 03 Sep 2014 18:52:46 +0800	[thread overview]
Message-ID: <5406F2FE.2090907@redhat.com> (raw)
In-Reply-To: <1409740546-9523-1-git-send-email-mst@redhat.com>

On 09/03/2014 06:35 PM, Michael S. Tsirkin wrote:
> commit aad4dce934649b3a398396fc2a76f215bb194ea4
>     vhost_net: start/stop guest notifiers properly
>
> changed the order of calls for guest notifiers,
> but did not recover in the correct (reverse) order.
> Fix it up.
>
> Cc: qemu-stable@nongnu.org
> Cc: Andrey Korolyov <andrey@xdel.ru>
> Cc: Jason Wang <jasowang@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  hw/net/vhost_net.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c
> index ba5d544..3819044 100644
> --- a/hw/net/vhost_net.c
> +++ b/hw/net/vhost_net.c
> @@ -289,7 +289,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
>      BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(dev)));
>      VirtioBusState *vbus = VIRTIO_BUS(qbus);
>      VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
> -    int r, i = 0;
> +    int r, e, i;
>  
>      if (!vhost_net_device_endian_ok(dev)) {
>          error_report("vhost-net does not support cross-endian");
> @@ -317,16 +317,22 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs,
>          r = vhost_net_start_one(get_vhost_net(ncs[i].peer), dev);
>  
>          if (r < 0) {
> -            goto err;
> +            goto err_start;
>          }
>      }
>  
>      return 0;
>  
> -err:
> +err_start:
>      while (--i >= 0) {
>          vhost_net_stop_one(get_vhost_net(ncs[i].peer), dev);
>      }
> +    e = k->set_guest_notifiers(qbus->parent, total_queues * 2, false);
> +    if (e < 0) {
> +        fprintf(stderr, "vhost guest notifier cleanup failed: %d\n", e);
> +        fflush(stderr);
> +    }
> +err:
>      return r;
>  }
>  

Acked-by: Jason Wang <jasowang@redhat.com>

  parent reply	other threads:[~2014-09-03 10:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-03 10:35 [Qemu-devel] [PATCH v3] vhost_net: cleanup recovery Michael S. Tsirkin
2014-09-03 10:48 ` Andrey Korolyov
2014-09-03 10:52 ` Jason Wang [this message]
2014-09-03 11:26   ` Michael S. Tsirkin

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=5406F2FE.2090907@redhat.com \
    --to=jasowang@redhat.com \
    --cc=andrey@xdel.ru \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 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.