From nobody Mon Feb 9 23:19:11 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=1666610052; cv=none; d=zohomail.com; s=zohoarc; b=atkcxxDr260jHalduQG0itCA7QWApiEaV51/O4Pg/XWjKRiCcepfOB0qBYJPZWvJ7WFSOEOiJxXoEG8kSet2Ijn5wSeJst9zEuj6Z/kMXlFhtEXDBRYzd7yt0/f91SC3umkOMNcVV/LT/KLdbFlkcBcVggRZj1R90MvcGplVPgg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1666610052; 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=2wzS8k/qPl/+/ZL57BA2KxhB7eOcnLEEIO3NGg9aUtY=; b=jbh6kk1HRmwUtcMuVzEmMsfJgm0vNX18/3Y11+tMabAIZIT3M0LCB+c4/VIvLMLPnA6/sShs6ck/zncaPr3GkmlGMIlnJJbdRWPqCzoSBWc1ORjWS14BECSc2B9w+We7p9CXfpL+ftC03D89wVxE1qeS1l5fOU6j6iy2H8OgXJ0= 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 1666610052031789.3064187743906; Mon, 24 Oct 2022 04:14:12 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omvMn-0000jO-Hn; Mon, 24 Oct 2022 07:11:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omvMW-0000aa-2m for qemu-devel@nongnu.org; Mon, 24 Oct 2022 07:11:23 -0400 Received: from lizzy.crudebyte.com ([91.194.90.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omvMQ-00074M-E0 for qemu-devel@nongnu.org; Mon, 24 Oct 2022 07:11:15 -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=2wzS8k/qPl/+/ZL57BA2KxhB7eOcnLEEIO3NGg9aUtY=; b=ozyXF XUBlzISm87W+ALuaGL7JWntRQSqNYvUPu4UK0AiFi8EAjgwiizSxvLsL9iPLoHuYaEEijJw4ShaE9 HM15BBHKtuwv5FlHAsCsfzdL9P/f4gVAMBeJZbbWnFJ6lzIbNjCMosnEk2zFwjUSaZ+wOA/G1ieI1 uNPq3/YFjz+kEtTaP1kC2f+KHBc8gltZwWL1PzhalQ5A8Hk3sbkba01Wtk6wonbSnt/QYwEJsHrWU k92E+1tN/WSQdokSd+Arwb8kJ8V5obG6HP+9yXfQq1i8IKet1elZbrkOCwTl/9WQOVP0AQJp9fNvc ZMuCFamOpR2zizmmuhZyLg9ofVwlQ==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Mon, 24 Oct 2022 12:54:23 +0200 Subject: [PULL 12/23] tests/9p: simplify callers of treaddir() To: qemu-devel@nongnu.org, Stefan Hajnoczi 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=a9a53769318503c4d8884e642e00603ea6885cb1@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: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @crudebyte.com) X-ZM-MESSAGEID: 1666610052553100001 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 Message-Id: <7cec6f2c7011a481806c34908893b7282702a7a6.1664917004.git.qemu_o= ss@crudebyte.com> --- 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