From patchwork Mon Oct 24 10:54:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Schoenebeck X-Patchwork-Id: 13017504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A2CABECAAA1 for ; Mon, 24 Oct 2022 12:15:23 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omvN5-0000wk-DO; Mon, 24 Oct 2022 07:11:55 -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 1omvMu-0000o3-UO for qemu-devel@nongnu.org; Mon, 24 Oct 2022 07:11:46 -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 1omvMr-0007PP-SL for qemu-devel@nongnu.org; Mon, 24 Oct 2022 07:11:44 -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=0kFzIHpJ65NpGxpwkyahaB5OiazqJwfq8ejhmsUIJe4=; b=A+adG DB48W6uGp2VDH4x7XeNvWmFjBj7HECbrmhi+U56tbvZgxYLBhIqBcLueDQ0e9ie0FHNdCcoy/2pOt 6PQLQZrtmeh1bXASOD8GmD6bW3J/e5uEG3SmusDArPitO+ikwGyzUpwLgnnxTQeFd9GAw4EyQiCtn ZRYxz6p7DSF41jaTzEx+YBZxfkx4aKsNFytcmc0aa5gP0J7JTkJ6vZuHtH0Ft6GuH0Ij6rqqP0UHX Ng+dNaIhLKabS1vdfJA9kG2XMrk5EUqKywzQiYnrKubQs074HV52PFERjoSy9OWhrakuCb6dAY9Qk Mzn/FT6SgIvuprqsDrHcbgMJux2NQ==; Message-Id: In-Reply-To: References: From: Christian Schoenebeck Date: Mon, 24 Oct 2022 12:54:23 +0200 Subject: [PULL 16/23] tests/9p: simplify callers of twrite() To: qemu-devel@nongnu.org, Stefan Hajnoczi Cc: Greg Kurz Received-SPF: none client-ip=91.194.90.13; envelope-from=bb286ff8e85dcc222c93c9f3a164034561d1f585@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+qemu-devel=archiver.kernel.org@nongnu.org Now as twrite() is using a declarative approach, simplify the code of callers of this function. Signed-off-by: Christian Schoenebeck Message-Id: <7f280ec6a1f9d8afed46567a796562c4dc28afa9.1664917004.git.qemu_oss@crudebyte.com> --- tests/qtest/virtio-9p-test.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/qtest/virtio-9p-test.c b/tests/qtest/virtio-9p-test.c index a5b9284acb..5ad7bebec7 100644 --- a/tests/qtest/virtio-9p-test.c +++ b/tests/qtest/virtio-9p-test.c @@ -377,7 +377,6 @@ static void fs_write(void *obj, void *data, QGuestAllocator *t_alloc) char *wnames[] = { g_strdup(QTEST_V9FS_SYNTH_WRITE_FILE) }; g_autofree char *buf = g_malloc0(write_count); uint32_t count; - P9Req *req; tattach({ .client = v9p }); twalk({ @@ -386,12 +385,10 @@ static void fs_write(void *obj, void *data, QGuestAllocator *t_alloc) tlopen({ .client = v9p, .fid = 1, .flags = O_WRONLY }); - req = twrite({ + count = twrite({ .client = v9p, .fid = 1, .offset = 0, .count = write_count, - .data = buf, .requestOnly = true - }).req; - v9fs_req_wait_for_reply(req, NULL); - v9fs_rwrite(req, &count); + .data = buf + }).count; g_assert_cmpint(count, ==, write_count); g_free(wnames[0]);