From nobody Sun Feb 8 18:29:37 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=1564508591; cv=none; d=zoho.com; s=zohoarc; b=hcuhUxLh8GoWo44/ngjKBnYiMTETAddkLQRAE2ds83VD/JAUqj/d/NcYgECo3PBKKl/kmxmqK6rSQt+WFij8iLzOIAFXt6Qe3xZTqMZiLlAPHAcHZBLdhviHXVrWC4iejc+Gj+whKs6TxpAKCKSGW8IRT3kJdajMOoXpFsXHFTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564508591; 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=g0K4nld1/KlLZhCdPIvk0WNLZIE9E/uK4u0beC76QwY=; b=KVwRAVP8Flbs+qE9TKrvq+6mHfWHEIbtSNq9Yrp1NqnYMbkhk6xlIDGAfVccqbh5jkThl71Q+dJIGz7+llevmC+gJZS733St0LM6UtaHwP3hFMBDoxEoNM5cF0NRp5WxT7JMPyTsmc+xAuQy0hoBY0Dfko3jbK1VVRDbtDcHM18= 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 1564508591442961.4165562455979; Tue, 30 Jul 2019 10:43:11 -0700 (PDT) Received: from localhost ([::1]:35248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsW9W-0002LV-1D for importer@patchew.org; Tue, 30 Jul 2019 13:43:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35957) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsW3C-0006DV-JC for qemu-devel@nongnu.org; Tue, 30 Jul 2019 13:36:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsW3B-0000VD-5z for qemu-devel@nongnu.org; Tue, 30 Jul 2019 13:36:38 -0400 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]:42893) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsW3B-0000Ud-0o; Tue, 30 Jul 2019 13:36:37 -0400 Received: by mail-pg1-x542.google.com with SMTP id t132so30415569pgb.9; Tue, 30 Jul 2019 10:36:36 -0700 (PDT) Received: from localhost.localdomain ([136.233.9.97]) by smtp.gmail.com with ESMTPSA id q24sm59122895pjp.14.2019.07.30.10.36.30 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 10:36:34 -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=g0K4nld1/KlLZhCdPIvk0WNLZIE9E/uK4u0beC76QwY=; b=m+ytI4RJPZBikUfBrRcPS/JoOb6Ntd9Rxy9sd2lGuM3oWF2PFgYWoaLsWVFCuGFtoH tzAy4j77JPFSg8KJAjcYM5+gUM3yBBWxPyvMIso6urPlWnD0Iuxz2EVNfhh6aYlhOh7K iz+akdi9xp7+JFFuqWMCr7HMRK8owwdtTmISZEbpE0bX4PaJQCU9NyTgIuRjy7mBA4Y1 tYCRr8AudHca/1vYi9N/9HBnIaSB0KQmNIKR5npTeA56Ng4CUyr0nGeRNyS43KMqnu0I 4Xny0+JSfJqWhBWEryafq9Fdn5B9dW2k7QiZXjzFs3I9O2WxrESR73UaNH4PPHkbko5w fWoQ== 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=g0K4nld1/KlLZhCdPIvk0WNLZIE9E/uK4u0beC76QwY=; b=I4EY7wHuBqgrtZcYmqit9vpfx+q0Zi1J7VHoYcjK/JQ2zpTj5ftwEIq9IlVuI2ZDch y7Md0m1AzF1NtUprJchEtQ/DlS2OkCX1RcILw4zrd2QWIfccbYLRTLH8WBg2sQLi1rCq sddHwmJl15qgpBZBsdoE57Lpi47NZl6dDFfUj6EoqiirLkkr+jzd7iSV1VCyWOSyLC9u u/hTMKQFi+u0msTMQocxLnz4v536z3+DXuCdNjvVrpI8/1vpS/oJu3tymy3JQfnIJLgX PFS9CH/ZU5ViJVGIp+DHHiU7uzPTaXE3JZOWl93CTJfYkgbmiVsX3CKN6QIUvXdAk08r n5IA== X-Gm-Message-State: APjAAAX3JTyrYGaPlp5gbfPDdMDP/TnQfss6e/G4ejGmJ3IHKtvio1UW c/Yybb0Yi7FmOphPi1SXb8vI/4YRZr905Q== X-Google-Smtp-Source: APXvYqz9EKbjBA0G5zeSoD1utUUwwjD1rCLG06OqHI9J8i003v0u16m6/X+PY4FJ7r0/FrAravmKEQ== X-Received: by 2002:a63:e54:: with SMTP id 20mr107554157pgo.244.1564508195481; Tue, 30 Jul 2019 10:36:35 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Tue, 30 Jul 2019 23:04:38 +0530 Message-Id: <20190730173441.26486-14-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190730173441.26486-1-mehta.aaru20@gmail.com> References: <20190730173441.26486-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::542 Subject: [Qemu-devel] [PATCH v8 13/16] qemu-nbd: adds option for aio engines 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: Kevin Wolf , Fam Zheng , Sergio Lopez , qemu-block@nongnu.org, 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" Signed-off-by: Aarushi Mehta Reviewed-by: Stefan Hajnoczi Acked-by: Eric Blake --- qemu-nbd.c | 12 ++++-------- qemu-nbd.texi | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/qemu-nbd.c b/qemu-nbd.c index a8cb39e510..7bb479f3c0 100644 --- a/qemu-nbd.c +++ b/qemu-nbd.c @@ -135,7 +135,7 @@ static void usage(const char *name) " '[ID_OR_NAME]'\n" " -n, --nocache disable host cache\n" " --cache=3DMODE set cache mode (none, writeback, ...)\n" -" --aio=3DMODE set AIO mode (native or threads)\n" +" --aio=3DMODE set AIO mode (native, io_uring or threads)\= n" " --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" @@ -718,13 +718,9 @@ int main(int argc, char **argv) exit(EXIT_FAILURE); } seen_aio =3D true; - if (!strcmp(optarg, "native")) { - flags |=3D BDRV_O_NATIVE_AIO; - } else if (!strcmp(optarg, "threads")) { - /* this is the default */ - } else { - error_report("invalid aio mode `%s'", optarg); - exit(EXIT_FAILURE); + if (bdrv_parse_aio(optarg, &flags) < 0) { + error_report("Invalid aio mode '%s'", optarg); + exit(EXIT_FAILURE); } break; case QEMU_NBD_OPT_DISCARD: diff --git a/qemu-nbd.texi b/qemu-nbd.texi index 7f55657722..3ee3e4bdee 100644 --- a/qemu-nbd.texi +++ b/qemu-nbd.texi @@ -77,8 +77,8 @@ as an read-only device, @var{snapshot_param} format is The cache mode to be used with the file. See the documentation of the emulator's @code{-drive cache=3D...} option for allowed values. @item --aio=3D@var{aio} -Set the asynchronous I/O mode between @samp{threads} (the default) -and @samp{native} (Linux only). +Set the asynchronous I/O mode between @samp{threads} (the default), +@samp{native} (Linux only) and @samp{io_uring} (Linux 5.1+). @item --discard=3D@var{discard} Control whether @dfn{discard} (also known as @dfn{trim} or @dfn{unmap}) requests are ignored or passed to the filesystem. @var{discard} is one of --=20 2.21.0