From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cAF5j-00075q-TV for qemu-devel@nongnu.org; Fri, 25 Nov 2016 06:55:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cAF5e-0007GM-PP for qemu-devel@nongnu.org; Fri, 25 Nov 2016 06:54:55 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41669) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cAF5e-0007Fm-Ew for qemu-devel@nongnu.org; Fri, 25 Nov 2016 06:54:50 -0500 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id uAPBs8GY043836 for ; Fri, 25 Nov 2016 06:54:49 -0500 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0a-001b2d01.pphosted.com with ESMTP id 26xm6a2nmq-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Fri, 25 Nov 2016 06:54:49 -0500 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 25 Nov 2016 06:54:48 -0500 From: Greg Kurz Date: Fri, 25 Nov 2016 12:54:42 +0100 In-Reply-To: <148007485377.16557.10831635699229968727.stgit@bahia> References: <148007485377.16557.10831635699229968727.stgit@bahia> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <148007488286.16557.1346388803157579400.stgit@bahia> Subject: [Qemu-devel] [PATCH for-2.8 4/5] 9pfs: drop useless loop in v9fs_reset() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Eric Blake , "Aneesh Kumar K.V" , Stefan Hajnoczi , Greg Kurz 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 --- 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);