From nobody Mon Feb 9 14:14:12 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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=fail; spf=pass (zoho.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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1563543495; cv=none; d=zoho.com; s=zohoarc; b=dcRRwYyx7ihXSuDdjPYXg1P3seW7+G1UiAJh/db2cuEbUqoGi8U8lZaUr5PUn8Nclh3fJ2A7hcMwufHvx5wDLkpSYKOV1NcbF2J4PwOzhj1j74+HSt41It7P7X/cvTpCfHJ46l4XZ/VP2Qf0CMuD0f1dEhiUlRE5TNoc6V0VmeE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1563543495; h=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:ARC-Authentication-Results; bh=jzhlY8te3PlNHDmc9x8zhHaloKwuy+F9m+jxMy+Rp1s=; b=L22rm9/GL0fQdDrqIlnGIzZ6ZpZp9pndWYU4d9o5+ko0nm62Wyo5Bm5ITUmi5r6AfEdYoVLlk1Q0mIAVMHMh0bRcDBlu32mUBgfQCTDyCFve3GubUsLw2bNUNXW7YbOI+H3e/152uMMgiLk5Pf2ImSyVlGT6cKqnDVcXsgaLBIc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 header.from= (p=none 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 1563543495510635.4920688242179; Fri, 19 Jul 2019 06:38:15 -0700 (PDT) Received: from localhost ([::1]:45492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoT5S-0003CA-8P for importer@patchew.org; Fri, 19 Jul 2019 09:38:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38164) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hoT4Y-0007qy-J1 for qemu-devel@nongnu.org; Fri, 19 Jul 2019 09:37:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hoT4X-0008FB-DS for qemu-devel@nongnu.org; Fri, 19 Jul 2019 09:37:18 -0400 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:45346) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hoT4X-0008EZ-3u; Fri, 19 Jul 2019 09:37:17 -0400 Received: by mail-pl1-x643.google.com with SMTP id y8so15650929plr.12; Fri, 19 Jul 2019 06:37:17 -0700 (PDT) Received: from localhost.localdomain ([2402:3a80:433:31a4:f2fb:dab8:3a89:c056]) by smtp.gmail.com with ESMTPSA id 11sm31895369pfw.33.2019.07.19.06.37.08 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 19 Jul 2019 06:37:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jzhlY8te3PlNHDmc9x8zhHaloKwuy+F9m+jxMy+Rp1s=; b=SOQdnhvHIuhpKDXnQoFTnbkSwQX81px8IoHFjnbtIPVKdeLC5rtwORFlTNwJog6omH T3Ln0de8V9W/T1kijbghNOKqomb/freI10FvwBb49+Dr3SsOavOM1OeI80QwxwSaADsO cFv6dQms6FtY+BWDSCWhg7ENqWY7fPAizB9Nt+bSfj/VJ9JGKbzM/5Q8rUN7nlVX2pdC TSHcqRcpDD3xBHMCOjcU4Ip2NIJRI9q6Fmg7FeJc9wcuJcKzE7gWlR3zrCwxNF6MBYB/ 7hFHjC593RNsqHF4Mzb4DtjZZ36xmYDZZ5Tk1f6SdWZSv/xfNTsHxXcZjfpBdQiSmm3O H/GA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jzhlY8te3PlNHDmc9x8zhHaloKwuy+F9m+jxMy+Rp1s=; b=k8KDpaedlfdnMXpkeYIalU9ofj6OAy33cr8E5hhEjwKT2OAMgUMSCWC5kW6zooH+oS MDJwjWF1dPWIGR6IF7fXUGQiACBU939DrrFV8Cawks/bZnIUlhiesSZUHPhwC/Poth84 KrN4LkxQMxzbV6OdRN8TXumttIIolhEHslUyeuRqq3WJhM5C+lgzu+2627hV7JGVCxLD LwWAEDk6PP8v6ZJPYRoOejf6eU7Wj1NkRZ+Gf5VKEy5XbvChuaXnckgdzu7g98umYIA9 axM7Wi0C5VpfWm34Eg8AHKXM/A/Pojd3f+/0fq3lO1Pqq+CBJWVslQDQ0vlU10gyAfKW 7X4A== X-Gm-Message-State: APjAAAXw1GEd4ZsOxGg521w8+V8XCbIjJqn9saswWr2KUSv/IaElqxy7 Qs+i2juHDlqB1Ol16Fwbk1zsODZB9/8= X-Google-Smtp-Source: APXvYqzFhnF9adiDSbwGQUyWBVF19V7Y77AaR6br4mVELUBX7Q2ufUjZs0vP8KhL1ZE6G6nKcYiWNg== X-Received: by 2002:a17:902:9689:: with SMTP id n9mr57823441plp.241.1563543435867; Fri, 19 Jul 2019 06:37:15 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Fri, 19 Jul 2019 19:05:27 +0530 Message-Id: <20190719133530.28688-12-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190719133530.28688-1-mehta.aaru20@gmail.com> References: <20190719133530.28688-1-mehta.aaru20@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::643 Subject: [Qemu-devel] [PATCH v6 11/14] qemu-io: adds option to use aio engine 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: Fam Zheng , Kevin Wolf , qemu-block@nongnu.org, Sergio Lopez , Markus Armbruster , Maxim Levitsky , saket.sinha89@gmail.com, Max Reitz , Stefan Hajnoczi , Paolo Bonzini , Stefan Hajnoczi , Julia Suvorova , Aarushi Mehta Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Use -i AIOMODE instead of -k. Signed-off-by: Aarushi Mehta --- qemu-io.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/qemu-io.c b/qemu-io.c index f64eca6940..3cee06248e 100644 --- a/qemu-io.c +++ b/qemu-io.c @@ -130,7 +130,7 @@ static void open_help(void) " -C, -- use copy-on-read\n" " -n, -- disable host cache, short for -t none\n" " -U, -- force shared permissions\n" -" -k, -- use kernel AIO implementation (on Linux only)\n" +" -i, -- use AIO mode (threads, native or io_uring)" " -t, -- use the given cache mode for the image\n" " -d, -- use the given discard mode for the image\n" " -o, -- options to be given to the block driver" @@ -187,9 +187,6 @@ static int open_f(BlockBackend *blk, int argc, char **a= rgv) case 'r': readonly =3D 1; break; - case 'k': - flags |=3D BDRV_O_NATIVE_AIO; - break; case 't': if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) < 0) { error_report("Invalid cache option: %s", optarg); @@ -204,6 +201,13 @@ static int open_f(BlockBackend *blk, int argc, char **= argv) return -EINVAL; } break; + case 'i': + if (bdrv_parse_aio(optarg, &flags) < 0) { + error_report("Invalid aio option: %s", optarg); + qemu_opts_reset(&empty_opts); + return -EINVAL; + } + break; case 'o': if (imageOpts) { printf("--image-opts and 'open -o' are mutually exclusive\= n"); @@ -291,7 +295,7 @@ static void usage(const char *name) " -n, --nocache disable host cache, short for -t none\n" " -C, --copy-on-read enable copy-on-read\n" " -m, --misalign misalign allocations for O_DIRECT\n" -" -k, --native-aio use kernel AIO implementation (on Linux only)\n" +" -i, --aio=3DMODE use AIO mode (threads, native or io_uring)\n" " -t, --cache=3DMODE use the given cache mode for the image\n" " -d, --discard=3DMODE use the given discard mode for the image\n" " -T, --trace [[enable=3D]][,events=3D][,file=3D]\n" @@ -489,7 +493,7 @@ static QemuOptsList file_opts =3D { int main(int argc, char **argv) { int readonly =3D 0; - const char *sopt =3D "hVc:d:f:rsnCmkt:T:U"; + const char *sopt =3D "hVc:d:f:rsnCmit:T:U"; const struct option lopt[] =3D { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'V' }, @@ -500,7 +504,7 @@ int main(int argc, char **argv) { "nocache", no_argument, NULL, 'n' }, { "copy-on-read", no_argument, NULL, 'C' }, { "misalign", no_argument, NULL, 'm' }, - { "native-aio", no_argument, NULL, 'k' }, + { "aio", required_argument, NULL, 'i' }, { "discard", required_argument, NULL, 'd' }, { "cache", required_argument, NULL, 't' }, { "trace", required_argument, NULL, 'T' }, @@ -565,8 +569,11 @@ int main(int argc, char **argv) case 'm': qemuio_misalign =3D true; break; - case 'k': - flags |=3D BDRV_O_NATIVE_AIO; + case 'i': + if (bdrv_parse_aio(optarg, &flags) < 0) { + error_report("Invalid aio option: %s", optarg); + exit(1); + } break; case 't': if (bdrv_parse_cache_mode(optarg, &flags, &writethrough) < 0) { --=20 2.21.0