From nobody Mon Feb 9 21:01:40 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=crudebyte.com ARC-Seal: i=1; a=rsa-sha256; t=1664918838; cv=none; d=zohomail.com; s=zohoarc; b=kGscvJsBlHTqrRj9QcsXL5twpUSgL6PjD8u4HwOyu3nqxsQowoRW5E2hiTU/l3ZV8rQyi3TR+/aYNZeIxzMZJ0isKfmbazWZWiCbSJ5XLpfHJpVkQ1E4tebXaAF6sjEO/QcA8j+VgkTUp1uh9vDtlRLgLM+lwIaxZ7Kcol3zWjI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1664918838; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=4BKsSAzFh4jWfH6Bn/dB18kUVyc8B23ILU+mBIPR2zU=; b=GX1sRFGMsUXxE0pb076t++PXJmwR17I8lb/CmfYYayMsJSdKou03TPFuykl67Ii5Z7IjsjQFGu6emJTfhPHemR2/3wIfydbojjcjXdvKRAPht1w+AsMx7x8bRgMJVLwkq+4F8vm4Wsgz7xiJoCfZS1JPavl1wSndpF90ZGYGjVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1664918838470429.4913860419051; Tue, 4 Oct 2022 14:27:18 -0700 (PDT) Received: from localhost ([::1]:55534 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ofpRc-0007DG-I2 for importer@patchew.org; Tue, 04 Oct 2022 17:27:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51870) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <7cec6f2c7011a481806c34908893b7282702a7a6@lizzy.crudebyte.com>) id 1ofpLj-0006PK-My for qemu-devel@nongnu.org; Tue, 04 Oct 2022 17:21:13 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]:45333) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <7cec6f2c7011a481806c34908893b7282702a7a6@lizzy.crudebyte.com>) id 1ofpLg-0002XL-Vu for qemu-devel@nongnu.org; Tue, 04 Oct 2022 17:21:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Cc:To:Subject:Date:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=4BKsSAzFh4jWfH6Bn/dB18kUVyc8B23ILU+mBIPR2zU=; b=B9wtH 9QvdyxSMG/1tMewZvfuOK/WHCyUSf8Th3gzHQvrhTF69nVq86yxoniNk+l2n48ItVza2ogblykINR pkjXTHtzRM45Pm1/BrIr4oyTAcadYMQETZiPbd69avmDIRrkxuaWSKSRuxXtCfvJ16Fm/BNoaeL28 cOQBQR4VOkGrpolytCvDQGmNLcLMnw7ajxgdbOMyFSLa8JOBzuzG1AbYJ2TtBFlHz7nh9WHKQk1qz lD4KSasAxc9+1i3yNlohHKEEkDKrc+LRYfv1FBNQ8tRCKsx8HR696fBDU3r5HZY9fux/lqDnqEfG7 86cnPguSrr8mFWEM85cG5WPgYcA+Q==; Message-Id: <7cec6f2c7011a481806c34908893b7282702a7a6.1664917004.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck Date: Tue, 4 Oct 2022 22:53:49 +0200 Subject: [PATCH 09/20] tests/9p: simplify callers of treaddir() To: qemu-devel@nongnu.org Cc: Greg Kurz Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: none client-ip=91.194.90.13; envelope-from=7cec6f2c7011a481806c34908893b7282702a7a6@lizzy.crudebyte.com; helo=lizzy.crudebyte.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1664918839729100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now as treaddir() is using a declarative approach, simplify the code of callers of this function. Signed-off-by: Christian Schoenebeck --- tests/qtest/virtio-9p-test.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index e5c174c218..99e24fce0b 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -120,12 +120,12 @@ static void fs_readdir(void *obj, void *data, QGuestA= llocator *t_alloc) /* * submit count =3D msize - 11, because 11 is the header size of Rread= dir */ - req =3D treaddir({ + treaddir({ .client =3D v9p, .fid =3D 1, .offset =3D 0, .count =3D P9_MAX_SIZE= - 11, - .requestOnly =3D true - }).req; - v9fs_req_wait_for_reply(req, NULL); - v9fs_rreaddir(req, &count, &nentries, &entries); + .rreaddir =3D { + .count =3D &count, .nentries =3D &nentries, .entries =3D &entr= ies + } + }); =20 /* * Assuming msize (P9_MAX_SIZE) is large enough so we can retrieve all @@ -190,12 +190,13 @@ static void do_readdir_split(QVirtio9P *v9p, uint32_t= count) npartialentries =3D 0; partialentries =3D NULL; =20 - req =3D treaddir({ + treaddir({ .client =3D v9p, .fid =3D fid, .offset =3D offset, .count =3D = count, - .requestOnly =3D true - }).req; - v9fs_req_wait_for_reply(req, NULL); - v9fs_rreaddir(req, &count, &npartialentries, &partialentries); + .rreaddir =3D { + .count =3D &count, .nentries =3D &npartialentries, + .entries =3D &partialentries + } + }); if (npartialentries > 0 && partialentries) { if (!entries) { entries =3D partialentries; --=20 2.30.2