qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kurz <groug@kaod.org>
To: qemu-devel@nongnu.org
Cc: Eric Blake <eblake@redhat.com>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Stefan Hajnoczi <stefanha@redhat.com>, Greg Kurz <groug@kaod.org>
Subject: [Qemu-devel] [PATCH for-2.8 4/5] 9pfs: drop useless loop in v9fs_reset()
Date: Fri, 25 Nov 2016 12:54:42 +0100	[thread overview]
Message-ID: <148007488286.16557.1346388803157579400.stgit@bahia> (raw)
In-Reply-To: <148007485377.16557.10831635699229968727.stgit@bahia>

We don't need to wait for the PDU active list to be empty: virtfs_reset()
already takes care of that.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
 hw/9pfs/9p.c |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index 75c6645de9ac..6fea68866a5c 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3560,8 +3560,11 @@ typedef struct VirtfsCoResetData {
 static void coroutine_fn virtfs_co_reset(void *opaque)
 {
     VirtfsCoResetData *data = opaque;
+    V9fsPDU *fake_pdu = &data->pdu;
+    V9fsState *s = fake_pdu->s;
 
-    virtfs_reset(&data->pdu);
+    virtfs_reset(fake_pdu);
+    g_assert(QLIST_EMPTY(&s->active_list));
     data->done = true;
 }
 
@@ -3570,10 +3573,6 @@ void v9fs_reset(V9fsState *s)
     VirtfsCoResetData data = { .pdu = { .s = s }, .done = false };
     Coroutine *co;
 
-    while (!QLIST_EMPTY(&s->active_list)) {
-        aio_poll(qemu_get_aio_context(), true);
-    }
-
     co = qemu_coroutine_create(virtfs_co_reset, &data);
     qemu_coroutine_enter(co);
 

  parent reply	other threads:[~2016-11-25 11:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25 11:54 [Qemu-devel] [PATCH for-2.8 0/5] 9pfs: fix session reset Greg Kurz
2016-11-25 11:54 ` [Qemu-devel] [PATCH for-2.8 1/5] 9pfs: add missing coroutine_fn annotations Greg Kurz
2016-11-25 11:54 ` [Qemu-devel] [PATCH for-2.8 2/5] 9pfs: cancel active PDUs in virtfs_reset() Greg Kurz
2016-11-25 11:54 ` [Qemu-devel] [PATCH for-2.8 3/5] 9pfs: always free fids " Greg Kurz
2016-11-25 11:54 ` Greg Kurz [this message]
2016-11-25 11:54 ` [Qemu-devel] [PATCH for-2.8 5/5] 9pfs: clear migration blocker when resetting the device Greg Kurz

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=148007488286.16557.1346388803157579400.stgit@bahia \
    --to=groug@kaod.org \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=eblake@redhat.com \
    --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 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).