From nobody Mon Feb 9 12:51:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1603206878; cv=none; d=zohomail.com; s=zohoarc; b=Dns5viEC9KoeDrWBbFuH8/oQvgbVIaLrUjAPDfpTjXUkn05yk0VEWa08Jbs9KuNqkloAR2J35TzHi8D/DzUpKFJpW/B0MWzmWSnFGyZml1uDaG+aY51y3EDtRsEn+K7N+hdv0JVmrcdRHz984NLQAimZ9eUN+lAKlcVg1uRNE7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603206878; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Tv8Ms82TzT/Cc8LKeByRdnvZ5LTnC9YweLm5zq/hzkg=; b=IeMRHhkhqoQo5Kp7Jk0SxKA080A9i7hUGGK618IaryQR6bvNR1U4w4/aNvsKCW5yE/aL/xZhakvm6W+lOLlcgBAzfGG7Yl1TvwDoiEZZ8zLDNJciQE4VaKYhv85AvQ5LYv67JT97HZfnTW/99p0tcot8B2PLovZo5AtmffdTuRg= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603206878746562.6017263907811; Tue, 20 Oct 2020 08:14:38 -0700 (PDT) Received: from localhost ([::1]:45948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUtLR-0007oR-Lf for importer@patchew.org; Tue, 20 Oct 2020 11:14:37 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUtID-0003fp-Fg for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:17 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:32407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kUtIB-0006UK-SB for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:17 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-IHpPiFsuMi-HzarhZ3qPEw-1; Tue, 20 Oct 2020 11:11:08 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6E4B5ADC23; Tue, 20 Oct 2020 15:11:07 +0000 (UTC) Received: from bahia.lan (ovpn-115-53.ams2.redhat.com [10.36.115.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC1455B4A1; Tue, 20 Oct 2020 15:11:06 +0000 (UTC) X-MC-Unique: IHpPiFsuMi-HzarhZ3qPEw-1 Subject: [PATCH 1/5] tests/9pfs: Factor out do_fs_version() helper From: Greg Kurz To: Christian Schoenebeck Date: Tue, 20 Oct 2020 17:11:05 +0200 Message-ID: <160320666564.255209.11628044710614310582.stgit@bahia.lan> In-Reply-To: <160320655763.255209.3890094487013964615.stgit@bahia.lan> References: <160320655763.255209.3890094487013964615.stgit@bahia.lan> User-Agent: StGit/0.21 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=groug@kaod.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Transfer-Encoding: quoted-printable 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: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 11:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" fs_version() is a top level test function. Factor out the sugar to a separate helper instead of hijacking it in other tests. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index c15908f27b3d..63f91aaf77e6 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -567,10 +567,8 @@ static void v9fs_rflush(P9Req *req) v9fs_req_free(req); } =20 -static void fs_version(void *obj, void *data, QGuestAllocator *t_alloc) +static void do_fs_version(QVirtio9P *v9p) { - QVirtio9P *v9p =3D obj; - alloc =3D t_alloc; const char *version =3D "9P2000.L"; uint16_t server_len; char *server_version; @@ -585,13 +583,19 @@ static void fs_version(void *obj, void *data, QGuestA= llocator *t_alloc) g_free(server_version); } =20 +static void fs_version(void *obj, void *data, QGuestAllocator *t_alloc) +{ + alloc =3D t_alloc; + do_fs_version(obj); +} + static void fs_attach(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtio9P *v9p =3D obj; alloc =3D t_alloc; P9Req *req; =20 - fs_version(v9p, NULL, t_alloc); + do_fs_version(v9p); req =3D v9fs_tattach(v9p, 0, getuid(), 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rattach(req, NULL); @@ -831,7 +835,7 @@ static void fs_walk_dotdot(void *obj, void *data, QGues= tAllocator *t_alloc) v9fs_qid root_qid, *wqid; P9Req *req; =20 - fs_version(v9p, NULL, t_alloc); + do_fs_version(v9p); req =3D v9fs_tattach(v9p, 0, getuid(), 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rattach(req, &root_qid); From nobody Mon Feb 9 12:51:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1603207004; cv=none; d=zohomail.com; s=zohoarc; b=OJ5xkwXi9Qb0qDKYXR9lDYNqDvyFbRrq3rqCC3B3/6XmhhJF/KFBcR7yDG+XXbImEiEjhL8n0jLlbVynwHwCw9hSp73MB/nTAUbSqUoZ5wZMzvP2HDp77K6LgxXBgjjnctsl9dLFNVe4XPtmD88pOIrfXEEbcZ9sCn0MEZbOypw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603207004; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4T118VSs3Snwvzul6Mi75d/2X/lXTB2sdL7YhTouMoE=; b=LPPmiLmK9RAhre90P/gIcYpp7reEI2IY1Pb473YNehjSv1zE+hiC4hFsDkxc/ONfF7B6uYVsBzNi/D5mo+v71gE2FR4fvnxwS2wfKPEATylrBNR+pF/wB2mE2XWyNUhh2vH5A5vLfWSkEVIFjbt5pca3N1IdzAbtfSryru5RweQ= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603207004779316.61765303238633; Tue, 20 Oct 2020 08:16:44 -0700 (PDT) Received: from localhost ([::1]:51546 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUtNT-0001ht-JD for importer@patchew.org; Tue, 20 Oct 2020 11:16:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUtIH-0003ms-BH for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:21 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:38854) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kUtIF-0006Uu-Rq for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:21 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-xeswPDDFPrireYi_UfwXUg-1; Tue, 20 Oct 2020 11:11:15 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 40FEB1006C90; Tue, 20 Oct 2020 15:11:14 +0000 (UTC) Received: from bahia.lan (ovpn-115-53.ams2.redhat.com [10.36.115.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9000D6EF6A; Tue, 20 Oct 2020 15:11:13 +0000 (UTC) X-MC-Unique: xeswPDDFPrireYi_UfwXUg-1 Subject: [PATCH 2/5] tests/9pfs: Turn fs_readdir_split() into a helper From: Greg Kurz To: Christian Schoenebeck Date: Tue, 20 Oct 2020 17:11:12 +0200 Message-ID: <160320667267.255209.16813057225265843854.stgit@bahia.lan> In-Reply-To: <160320655763.255209.3890094487013964615.stgit@bahia.lan> References: <160320655763.255209.3890094487013964615.stgit@bahia.lan> User-Agent: StGit/0.21 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Transfer-Encoding: quoted-printable 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: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 11:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" fs_readdir_split() isn't a top level test function and thus shouldn't take the "void *obj, void *data, QGuestAllocator *t_alloc" arguments. Turn it into a helper to be used by test functions. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 63f91aaf77e6..d0cdc14fee3e 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -727,11 +727,8 @@ static void fs_readdir(void *obj, void *data, QGuestAl= locator *t_alloc) } =20 /* readdir test where overall request is split over several messages */ -static void fs_readdir_split(void *obj, void *data, QGuestAllocator *t_all= oc, - uint32_t count) +static void do_fs_readdir_split(QVirtio9P *v9p, uint32_t count) { - QVirtio9P *v9p =3D obj; - alloc =3D t_alloc; char *const wnames[] =3D { g_strdup(QTEST_V9FS_SYNTH_READDIR_DIR) }; uint16_t nqid; v9fs_qid qid; @@ -998,19 +995,22 @@ static void fs_mkdir(void *obj, void *data, QGuestAll= ocator *t_alloc, static void fs_readdir_split_128(void *obj, void *data, QGuestAllocator *t_alloc) { - fs_readdir_split(obj, data, t_alloc, 128); + alloc =3D t_alloc; + do_fs_readdir_split(obj, 128); } =20 static void fs_readdir_split_256(void *obj, void *data, QGuestAllocator *t_alloc) { - fs_readdir_split(obj, data, t_alloc, 256); + alloc =3D t_alloc; + do_fs_readdir_split(obj, 256); } =20 static void fs_readdir_split_512(void *obj, void *data, QGuestAllocator *t_alloc) { - fs_readdir_split(obj, data, t_alloc, 512); + alloc =3D t_alloc; + do_fs_readdir_split(obj, 512); } =20 =20 From nobody Mon Feb 9 12:51:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1603206813; cv=none; d=zohomail.com; s=zohoarc; b=cJhF27ThOL08l/7WdziVXSsEM39wcmaE8Qi/fiMoVyLG9arNqE0JuJFK5yC/F/Rht7qXCx5VHrjKW5AUM4+fi18NVJhMhdfYTNIp7neBDmdwI4s37rIdx6qiuHH+IOYdR0AviatfPG7C12Jds4hP3+ATYQZ0bXFaRLvB7gMmxx0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603206813; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oRpNOqNB89sWkwV0PHRHs+oC5hPrSarfMfzoKG/XUq0=; b=elNcnfe3L3o8wy3Qu4XoDVonVYWDYosnjRa6cTHpAqthZ0A6BmVk+Vk9Q/e9e/G6DyQ1ARot8GjA0mpREBagibV/9aV8DaIf0XTaCBWVP8qTP2fsGaB8Qp1RgMZDwhThHdlWju/rPf5FzUph6a1Aw1IlRWYp+ro7xj24zHBWQBg= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603206813661420.6697605956481; Tue, 20 Oct 2020 08:13:33 -0700 (PDT) Received: from localhost ([::1]:40314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUtKO-0005US-Hb for importer@patchew.org; Tue, 20 Oct 2020 11:13:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54740) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUtIQ-0003uk-GR for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:30 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:41989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kUtIN-0006Vj-V7 for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:29 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-530-DrCPJKLPPoyPR0O3pUDjSw-1; Tue, 20 Oct 2020 11:11:22 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1164E107AFD1; Tue, 20 Oct 2020 15:11:21 +0000 (UTC) Received: from bahia.lan (ovpn-115-53.ams2.redhat.com [10.36.115.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6132E5C1C2; Tue, 20 Oct 2020 15:11:20 +0000 (UTC) X-MC-Unique: DrCPJKLPPoyPR0O3pUDjSw-1 Subject: [PATCH 3/5] tests/9pfs: Set alloc in fs_create_dir() From: Greg Kurz To: Christian Schoenebeck Date: Tue, 20 Oct 2020 17:11:19 +0200 Message-ID: <160320667949.255209.17461135536728398203.stgit@bahia.lan> In-Reply-To: <160320655763.255209.3890094487013964615.stgit@bahia.lan> References: <160320655763.255209.3890094487013964615.stgit@bahia.lan> User-Agent: StGit/0.21 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Transfer-Encoding: quoted-printable 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: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 11:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" fs_create_dir() is a top level test function. It should set alloc. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index d0cdc14fee3e..95638662e14d 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -1019,6 +1019,7 @@ static void fs_readdir_split_512(void *obj, void *dat= a, static void fs_create_dir(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtio9P *v9p =3D obj; + alloc =3D t_alloc; struct stat st; char *root_path =3D virtio_9p_test_path(""); char *new_dir =3D virtio_9p_test_path("01"); From nobody Mon Feb 9 12:51:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1603206886; cv=none; d=zohomail.com; s=zohoarc; b=k94tSU+dKx+D4jgneUAGlPGIjvjRAZppV/Ceoqw+7AFEICazzG3CUSNyGmuR0AdEHjovJqgh8033xHdNvVHzzEE6nN4VW+byN6Uq3zHR1SnJ5YdpXd9ErEoPwApznzhmNua14j61oZmQ6578MJFrHKYg7rll458cEILHZ1hbXvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603206886; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7+D+qeRvFb8994woz20uAec/x4HFT0gpraXME4PjOmU=; b=KC7OBxryKvY2QMCIlBdv4L9wzUgTeeI9+L5cjp8DuItNxoMa9MNOGuk+hHlPm4ayLxhONtSkr+PLyAyolFIWPldKXtXFHLNjvqwnOH5Vh1gEZ2sGY+TNZWC53txABS0czrmifaWaK1pK6+TCgQtJJwgf5gnZQW4QahxXREfEETY= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603206886383396.61884810188656; Tue, 20 Oct 2020 08:14:46 -0700 (PDT) Received: from localhost ([::1]:46620 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUtLZ-00085m-Ay for importer@patchew.org; Tue, 20 Oct 2020 11:14:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUtIW-0003zU-Gt for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:36 -0400 Received: from us-smtp-delivery-44.mimecast.com ([205.139.111.44]:57263) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kUtIU-0006WB-TR for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:36 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-454-h4eWMekeMWGKlyXWzHtp2w-1; Tue, 20 Oct 2020 11:11:29 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 19DF41074656; Tue, 20 Oct 2020 15:11:28 +0000 (UTC) Received: from bahia.lan (ovpn-115-53.ams2.redhat.com [10.36.115.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4198C6EF69; Tue, 20 Oct 2020 15:11:27 +0000 (UTC) X-MC-Unique: h4eWMekeMWGKlyXWzHtp2w-1 Subject: [PATCH 4/5] tests/9pfs: Factor out do_fs_attach() helper From: Greg Kurz To: Christian Schoenebeck Date: Tue, 20 Oct 2020 17:11:26 +0200 Message-ID: <160320668629.255209.17942580749099373236.stgit@bahia.lan> In-Reply-To: <160320655763.255209.3890094487013964615.stgit@bahia.lan> References: <160320655763.255209.3890094487013964615.stgit@bahia.lan> User-Agent: StGit/0.21 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=groug@kaod.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Transfer-Encoding: quoted-printable 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: softfail client-ip=205.139.111.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 11:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" fs_attach() is a top level test function. Factor out the sugar to a separate helper instead of hijacking it in other tests. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 95638662e14d..1e1b1433014b 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -589,10 +589,8 @@ static void fs_version(void *obj, void *data, QGuestAl= locator *t_alloc) do_fs_version(obj); } =20 -static void fs_attach(void *obj, void *data, QGuestAllocator *t_alloc) +static void do_fs_attach(QVirtio9P *v9p) { - QVirtio9P *v9p =3D obj; - alloc =3D t_alloc; P9Req *req; =20 do_fs_version(v9p); @@ -601,6 +599,12 @@ static void fs_attach(void *obj, void *data, QGuestAll= ocator *t_alloc) v9fs_rattach(req, NULL); } =20 +static void fs_attach(void *obj, void *data, QGuestAllocator *t_alloc) +{ + alloc =3D t_alloc; + do_fs_attach(obj); +} + static void fs_walk(void *obj, void *data, QGuestAllocator *t_alloc) { QVirtio9P *v9p =3D obj; @@ -615,7 +619,7 @@ static void fs_walk(void *obj, void *data, QGuestAlloca= tor *t_alloc) wnames[i] =3D g_strdup_printf(QTEST_V9FS_SYNTH_WALK_FILE, i); } =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, P9_MAXWELEM, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rwalk(req, &nwqid, &wqid); @@ -684,7 +688,7 @@ static void fs_readdir(void *obj, void *data, QGuestAll= ocator *t_alloc) struct V9fsDirent *entries =3D NULL; P9Req *req; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, 1, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rwalk(req, &nqid, NULL); @@ -738,7 +742,7 @@ static void do_fs_readdir_split(QVirtio9P *v9p, uint32_= t count) int fid; uint64_t offset; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); =20 fid =3D 1; offset =3D 0; @@ -814,7 +818,7 @@ static void fs_walk_no_slash(void *obj, void *data, QGu= estAllocator *t_alloc) P9Req *req; uint32_t err; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, 1, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rlerror(req, &err); @@ -854,7 +858,7 @@ static void fs_lopen(void *obj, void *data, QGuestAlloc= ator *t_alloc) char *const wnames[] =3D { g_strdup(QTEST_V9FS_SYNTH_LOPEN_FILE) }; P9Req *req; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, 1, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rwalk(req, NULL, NULL); @@ -876,7 +880,7 @@ static void fs_write(void *obj, void *data, QGuestAlloc= ator *t_alloc) uint32_t count; P9Req *req; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, 1, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rwalk(req, NULL, NULL); @@ -903,7 +907,7 @@ static void fs_flush_success(void *obj, void *data, QGu= estAllocator *t_alloc) uint32_t reply_len; uint8_t should_block; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, 1, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rwalk(req, NULL, NULL); @@ -940,7 +944,7 @@ static void fs_flush_ignored(void *obj, void *data, QGu= estAllocator *t_alloc) uint32_t count; uint8_t should_block; =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); req =3D v9fs_twalk(v9p, 0, 1, 1, wnames, 0); v9fs_req_wait_for_reply(req, NULL); v9fs_rwalk(req, NULL, NULL); @@ -1026,7 +1030,7 @@ static void fs_create_dir(void *obj, void *data, QGue= stAllocator *t_alloc) =20 g_assert(root_path !=3D NULL); =20 - fs_attach(v9p, NULL, t_alloc); + do_fs_attach(v9p); fs_mkdir(v9p, data, t_alloc, "/", "01"); =20 /* check if created directory really exists now ... */ From nobody Mon Feb 9 12:51:36 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; 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 ARC-Seal: i=1; a=rsa-sha256; t=1603207015; cv=none; d=zohomail.com; s=zohoarc; b=SRvUsCCUkfhVpDH37mM84ZrM96NfGl2VLKA2IzKfep68P1ghqCCPaKev3knzFlE83diwkEYg/y1ciZRMKJLdGVqAb1hXJUhiuSdCjUL1j0dJWQaYgh2uVHTkEQwHS8O0iZvtmvES7CWu+tAzObsFgWihhjzhGgGaHB+qphxI54g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603207015; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xxZXaxJH8cn6idlpC60IcOR9yBliAPNCss+MYfya/8k=; b=j9YmaDgd862m81HrH/Iq0EmTEvkCzIrgS3LreRkAruDF80dNJIrc80cInD0qxsHbIhs6hojMCYQXyW6m8ZANQ7FA5ysA1YvhnPbH8dKWdph+dzxq+wMWL1Wmy6sFzPb0JatYOfgmY7nepQsUOMCILFL+3jv+hqpoJ7H1Az7g+S0= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160320701589317.4614735076633; Tue, 20 Oct 2020 08:16:55 -0700 (PDT) Received: from localhost ([::1]:51588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kUtNd-0001l9-PB for importer@patchew.org; Tue, 20 Oct 2020 11:16:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kUtIa-000439-8p for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:40 -0400 Received: from us-smtp-delivery-44.mimecast.com ([207.211.30.44]:42590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kUtIY-0006WT-Q3 for qemu-devel@nongnu.org; Tue, 20 Oct 2020 11:11:39 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-305-svRMrcQqP66xpFx8bgD4rw-1; Tue, 20 Oct 2020 11:11:36 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E82D71074656; Tue, 20 Oct 2020 15:11:34 +0000 (UTC) Received: from bahia.lan (ovpn-115-53.ams2.redhat.com [10.36.115.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id 445C01002C18; Tue, 20 Oct 2020 15:11:34 +0000 (UTC) X-MC-Unique: svRMrcQqP66xpFx8bgD4rw-1 Subject: [PATCH 5/5] tests/9pfs: Turn fs_mkdir() into a helper From: Greg Kurz To: Christian Schoenebeck Date: Tue, 20 Oct 2020 17:11:33 +0200 Message-ID: <160320669332.255209.15848887356639293774.stgit@bahia.lan> In-Reply-To: <160320655763.255209.3890094487013964615.stgit@bahia.lan> References: <160320655763.255209.3890094487013964615.stgit@bahia.lan> User-Agent: StGit/0.21 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=groug@kaod.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: kaod.org Content-Transfer-Encoding: quoted-printable 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: softfail client-ip=207.211.30.44; envelope-from=groug@kaod.org; helo=us-smtp-delivery-44.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/20 11:11:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" fs_mkdir() isn't a top level test function and thus shouldn't take the "void *obj, void *data, QGuestAllocator *t_alloc" arguments. Turn it into a helper to be used by test functions. Signed-off-by: Greg Kurz --- tests/qtest/virtio-9p-test.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index 1e1b1433014b..155d327fd9f5 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -972,11 +972,8 @@ static void fs_flush_ignored(void *obj, void *data, QG= uestAllocator *t_alloc) g_free(wnames[0]); } =20 -static void fs_mkdir(void *obj, void *data, QGuestAllocator *t_alloc, - const char *path, const char *cname) +static void do_fs_mkdir(QVirtio9P *v9p, const char *path, const char *cnam= e) { - QVirtio9P *v9p =3D obj; - alloc =3D t_alloc; char **wnames; char *const name =3D g_strdup(cname); P9Req *req; @@ -1031,7 +1028,7 @@ static void fs_create_dir(void *obj, void *data, QGue= stAllocator *t_alloc) g_assert(root_path !=3D NULL); =20 do_fs_attach(v9p); - fs_mkdir(v9p, data, t_alloc, "/", "01"); + do_fs_mkdir(v9p, "/", "01"); =20 /* check if created directory really exists now ... */ g_assert(stat(new_dir, &st) =3D=3D 0);