From nobody Fri May 3 19:10:46 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=suse.de Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1650389607372881.402518462608; Tue, 19 Apr 2022 10:33:27 -0700 (PDT) Received: from localhost ([::1]:41812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ngrjB-0003Rh-Hd for importer@patchew.org; Tue, 19 Apr 2022 13:33:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ngrVv-0002tt-7w; Tue, 19 Apr 2022 13:19:44 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:46816) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ngrVt-0006EJ-LW; Tue, 19 Apr 2022 13:19:42 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AF2DD1F746; Tue, 19 Apr 2022 17:19:38 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 92E78139BE; Tue, 19 Apr 2022 17:19:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EhznIirvXmLYZgAAMHmgww (envelope-from ); Tue, 19 Apr 2022 17:19:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1650388778; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+WcqpviF2uafczEsbloBwil9ky/sjFJ4ViC2Q6a99rw=; b=MB2N/OQSBm8G0JI5wQbZ7xw1bcPvJRFt2Bjy5+x3RvmKcdV6RH/yyALyOylDL3H2HM7p2W ahdunl7WTn8JsKy7tNI5z+oBxvh9ko+bCBJGV5EJOZjtp/+aL8bRELczoZo12jzp9pTasG yGFbgSXj9Pen+8b9IbvqzxXpadG27cE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1650388778; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+WcqpviF2uafczEsbloBwil9ky/sjFJ4ViC2Q6a99rw=; b=gAIM0bCm7bH2xGRQhXINsP1W/eoqIzIh/kqR1svmd86RUR48eHzemECyF7ZRgWBU6DOw7y /IoeizePdrWkO/BQ== From: =?UTF-8?q?Dirk=20M=C3=BCller?= To: qemu-block@nongnu.org Subject: [PATCH] Only advertise aio=io_uring if support is actually available Date: Tue, 19 Apr 2022 19:19:31 +0200 Message-Id: <20220419171931.26192-1-dmueller@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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: pass client-ip=195.135.220.29; envelope-from=dmueller@suse.de; helo=smtp-out2.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 19 Apr 2022 13:32:04 -0400 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: , Cc: eblake@redhat.com, qemu-devel@nongnu.org, =?UTF-8?q?Dirk=20M=C3=BCller?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (found 2 invalid signatures) X-ZM-MESSAGEID: 1650389608992100001 This allows $qemu --help runtime configure checks for detecting the host support. Signed-off-by: Dirk M=C3=BCller Reviewed-by: Eric Blake --- block/file-posix.c | 4 ++++ qemu-nbd.c | 4 ++++ qemu-options.hx | 6 +++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/block/file-posix.c b/block/file-posix.c index 39a3d6dbe6..aec4763862 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -544,7 +544,11 @@ static QemuOptsList raw_runtime_opts =3D { { .name =3D "aio", .type =3D QEMU_OPT_STRING, +#ifdef CONFIG_LINUX_IO_URING .help =3D "host AIO implementation (threads, native, io_uring)= ", +#else + .help =3D "host AIO implementation (threads, native)", +#endif }, { .name =3D "aio-max-batch", diff --git a/qemu-nbd.c b/qemu-nbd.c index 713e7557a9..4634a0fc42 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -147,7 +147,11 @@ static void usage(const char *name) " --cache=3DMODE set cache mode used to access the disk imag= e, the\n" " valid options are: 'none', 'writeback' (defau= lt),\n" " 'writethrough', 'directsync' and 'unsafe'\n" +#ifdef CONFIG_LINUX_IO_URING " --aio=3DMODE set AIO mode (native, io_uring or threads)\= n" +#else +" --aio=3DMODE set AIO mode (native or threads)\n" +#endif " --discard=3DMODE set discard mode (ignore, unmap)\n" " --detect-zeroes=3DMODE set detect-zeroes mode (off, on, unmap)\n" " --image-opts treat FILE as a full set of image options\n" diff --git a/qemu-options.hx b/qemu-options.hx index 34e9b32a5c..973125cfca 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1338,7 +1338,11 @@ DEF("drive", HAS_ARG, QEMU_OPTION_drive, " [,cache=3Dwritethrough|writeback|none|directsync|unsafe][,form= at=3Df]\n" " [,snapshot=3Don|off][,rerror=3Dignore|stop|report]\n" " [,werror=3Dignore|stop|report|enospc][,id=3Dname]\n" - " [,aio=3Dthreads|native|io_uring]\n" + " [,aio=3Dthreads|native" +#if defined(CONFIG_LINUX_IO_URING) + "|io_uring" +#endif + "]\n" " [,readonly=3Don|off][,copy-on-read=3Don|off]\n" " [,discard=3Dignore|unmap][,detect-zeroes=3Don|off|unmap]\n" " [[,bps=3Db]|[[,bps_rd=3Dr][,bps_wr=3Dw]]]\n" --=20 2.35.3