From nobody Mon Feb 9 05:29:35 2026 Delivered-To: importer@patchew.org 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; 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=1576682240; cv=none; d=zohomail.com; s=zohoarc; b=SYcax8yVnR9pGZ7LXCY6Rx0MxFALV6Cdo7XAExEx2M2ZAuuiRvRDSgstogQETeH1+Ue08ANsic1AixYjcWQUGQo6DbMsmXqYcn9ZjbuZzTgsEHQ7jVxC/s4F6UTeD9qh3pMxI8PQUIlMtR6hVYT19+nvN/BEcNniwT4xZYViSIo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576682240; 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=hLrT/cei1Ph+HSrT13ZTQqozjrT7hfRJvI7gt4DQDjo=; b=IVuUHX+s+cTaLRjaJaYExq2G42PPBW2EJr4Y3vpaz8jSziVCOxwEbgexkvXmJVqLOL6Ac43FS8ymO2F69AXldVx8NSajbLpejH9hE43MtL3/ZLEqRXE+9gzWav1HgNNx+TIw1WTM9d7thOT56QuuB2LaOvw9z7JGZLBHuhqV/Io= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1576682240127753.9609654983728; Wed, 18 Dec 2019 07:17:20 -0800 (PST) Received: from localhost ([::1]:55614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ihb4g-0005oY-TW for importer@patchew.org; Wed, 18 Dec 2019 10:17:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51702) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <91905ff817851a76d3becaf27208007dfdbf22e1@lizzy.crudebyte.com>) id 1ihb3D-0004Lo-Nq for qemu-devel@nongnu.org; Wed, 18 Dec 2019 10:15:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <91905ff817851a76d3becaf27208007dfdbf22e1@lizzy.crudebyte.com>) id 1ihb3C-0006aN-EG for qemu-devel@nongnu.org; Wed, 18 Dec 2019 10:15:47 -0500 Received: from lizzy.crudebyte.com ([91.194.90.13]:45427) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <91905ff817851a76d3becaf27208007dfdbf22e1@lizzy.crudebyte.com>) id 1ihb3C-0001qy-5G for qemu-devel@nongnu.org; Wed, 18 Dec 2019 10:15:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=crudebyte.com; s=lizzy; h=Subject:Date:Cc:To:From:References:In-Reply-To: Message-Id:Content-Type:Content-Transfer-Encoding:MIME-Version:Content-ID: Content-Description; bh=hLrT/cei1Ph+HSrT13ZTQqozjrT7hfRJvI7gt4DQDjo=; b=M3kdj 1lzwa7L/qwDHY4tJNp69RXnlkjcRy4PyWOAZsAAQShfis4OFwzrrzmPz8auUT1SnnWo0goHg9EXqR RoH6VHzcIF0n4K87bN0QK5Vbkko4+lsVpjotpjxZQZY4wMAbjXGu/7SoCGn1su81h6561zh5gcmKI AWApp01u4oQTgXjkEElCLfHsyO6xliRQBUi9Xx6i59Y4UVU1uIlaR/cMnEP+Y9WW33f2/mBQJt+If eHMzGtE8r4LHEkTThIDQvBNMPKY1nRMm47TVovuO7usvzq3DMxrbiinjV41JEgdas9D8jqfaV6+qq n+QraHt5RAMof1D9eBUVRU0JA5iUQ==; Message-Id: <91905ff817851a76d3becaf27208007dfdbf22e1.1576678644.git.qemu_oss@crudebyte.com> In-Reply-To: References: From: Christian Schoenebeck To: qemu-devel@nongnu.org Cc: Greg Kurz Date: Wed, 18 Dec 2019 14:23:48 +0100 Subject: [PATCH v2 3/9] hw/9pfs/9p-synth: added directory for readdir test X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 91.194.90.13 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @crudebyte.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This will provide the following virtual files by the 9pfs synth driver: - /ReadDirDir/ReadDirFile99 - /ReadDirDir/ReadDirFile98 ... - /ReadDirDir/ReadDirFile1 - /ReadDirDir/ReadDirFile0 This virtual directory and its virtual 100 files will be used by the upcoming 9pfs readdir tests. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz --- hw/9pfs/9p-synth.c | 19 +++++++++++++++++++ hw/9pfs/9p-synth.h | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/hw/9pfs/9p-synth.c b/hw/9pfs/9p-synth.c index 54239c9bbf..7eb210ffa8 100644 --- a/hw/9pfs/9p-synth.c +++ b/hw/9pfs/9p-synth.c @@ -578,6 +578,25 @@ static int synth_init(FsContext *ctx, Error **errp) NULL, v9fs_synth_qtest_flush_write, ctx); assert(!ret); + + /* Directory for READDIR test */ + { + V9fsSynthNode *dir =3D NULL; + ret =3D qemu_v9fs_synth_mkdir( + NULL, 0700, QTEST_V9FS_SYNTH_READDIR_DIR, &dir + ); + assert(!ret); + for (i =3D 0; i < QTEST_V9FS_SYNTH_READDIR_NFILES; ++i) { + char *name =3D g_strdup_printf( + QTEST_V9FS_SYNTH_READDIR_FILE, i + ); + ret =3D qemu_v9fs_synth_add_file( + dir, 0, name, NULL, NULL, ctx + ); + assert(!ret); + g_free(name); + } + } } =20 return 0; diff --git a/hw/9pfs/9p-synth.h b/hw/9pfs/9p-synth.h index af7a993a1e..036d7e4a5b 100644 --- a/hw/9pfs/9p-synth.h +++ b/hw/9pfs/9p-synth.h @@ -55,6 +55,11 @@ int qemu_v9fs_synth_add_file(V9fsSynthNode *parent, int = mode, #define QTEST_V9FS_SYNTH_LOPEN_FILE "LOPEN" #define QTEST_V9FS_SYNTH_WRITE_FILE "WRITE" =20 +/* for READDIR test */ +#define QTEST_V9FS_SYNTH_READDIR_DIR "ReadDirDir" +#define QTEST_V9FS_SYNTH_READDIR_FILE "ReadDirFile%d" +#define QTEST_V9FS_SYNTH_READDIR_NFILES 100 + /* Any write to the "FLUSH" file is handled one byte at a time by the * backend. If the byte is zero, the backend returns success (ie, 1), * otherwise it forces the server to try again forever. Thus allowing --=20 2.20.1