From nobody Tue Nov 11 17:32:03 2025 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=1564413931; cv=none; d=zoho.com; s=zohoarc; b=Daz2ZGRO2gGtaLRy9NC0oy61vEPlWfv+58Zczc6395kraTtww40stfEP/2rQT5SwjKcDI6MkGd4IlQ8XiLLdrB2N3/OqUQjH5RTbsuZVY339KT5VCqFNs4qxLExBUxNiqENb4THO8VqLqKFhkJbyj6EvPg+iDkQTVH/CIDZ6DTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564413931; 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=8Jsn3Ev/tFZXw6IbvpTxlQm6I+B/bXy4T/ob5FeHHf8=; b=OgtVk+TvgS8Q2i+tqRHDn3s3N89bTXfqpo0wfnBZwQqGuMuH0hwXCij6KpmEbbGJOZQxNkAhhlbNlV5FKA8l5DgBzBlVJPgDkcKLdHm5yXx3inx93dQIMrr+HAgtl7saGD6H6cCJ0/+m6E3467A5WUcqGr/35DCVH7ZUsD0AWAI= 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 1564413931092289.39900885988993; Mon, 29 Jul 2019 08:25:31 -0700 (PDT) Received: from localhost ([::1]:53842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7Wk-00059X-2f for importer@patchew.org; Mon, 29 Jul 2019 11:25:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44112) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7QY-00009e-8Q for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:19:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs7QX-0001sZ-8Z for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:19:06 -0400 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:44276) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hs7QX-0001rg-2P; Mon, 29 Jul 2019 11:19:05 -0400 Received: by mail-pf1-x444.google.com with SMTP id t16so28171466pfe.11; Mon, 29 Jul 2019 08:19:04 -0700 (PDT) Received: from localhost.localdomain ([136.233.9.97]) by smtp.gmail.com with ESMTPSA id h129sm58693941pfb.110.2019.07.29.08.18.55 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 08:19:03 -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=8Jsn3Ev/tFZXw6IbvpTxlQm6I+B/bXy4T/ob5FeHHf8=; b=egrjgr0iDOvJRKZRixvkypwwDcc53Q7eYsPq6wbYfsYxVqfPUxvtKl8aIojdsgUR8N qvfPk+omRIqb9roKtvjgdAQn3myZy2PxrdrZF91tsfnY5TxSUgL3JUqqVBBvxxlSFphx iZEOTLNmyveLOgNWab93mhdn084p+1Rx2/Xenkl6/ZaGN6Zn56ZfegLH62zhKsjxUGl8 RWM8yOoxt3p9qaj4bVsROS/669/PfQFGGxss2jma41QYHdlvQzI4gu+4E91doWBkJ/Rl tq9bGNv4kBi7uLxKyTNgp28og6UdDna+9sFpDgOHZFYRbocregGTirj/ebsmF0Ik/O9L bQ2A== 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=8Jsn3Ev/tFZXw6IbvpTxlQm6I+B/bXy4T/ob5FeHHf8=; b=iAP6f2WDpywpptDUCabAth+Y10fhj5bea5GtZveeB1qIlHMYa1FNXVIiUuDapoWKW8 rCz/MdbSJSZTtR3mEACu3YUTmvyXaKVbY3EtBZsYHlnNJtwiwmrInZ5BO8f07BfTngwB imt14OwG6jGmDIV8uwYDwdkftzI4/jD2avWKuDGYlJ1XkiuOE40AWKpRJvuekcHsbL8o j+tn1iVgUg8N+ub4qLD5CmCNvK4WHVjxfnB6jWFqsMzR3BI5mlM7DAhU5aN67ZMeTAop zhvchDdiLpsKEMXbBIQIq6gh0AwhoDd/2wzzZXr4wPwg1XZDMUJr8C2hQygRUcnDwD37 zFaw== X-Gm-Message-State: APjAAAU03RAiqzxPWho/T1AWoOhLh/nJ7w7apaytG1DkCbO2I9Nrpgfh 3vPWuaaJT2QYOPc6ZAGzlzDg8vXOA3bfmA== X-Google-Smtp-Source: APXvYqzw1zxSJIG8qHfV3GudlgKWwfpeXuKYVZME47vZFv2LMyHfZb/C73jrB/dFIVMfJVBD5J6buw== X-Received: by 2002:a17:90a:bd0b:: with SMTP id y11mr107350588pjr.141.1564413543789; Mon, 29 Jul 2019 08:19:03 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 20:46:49 +0530 Message-Id: <20190729151651.21306-14-mehta.aaru20@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190729151651.21306-1-mehta.aaru20@gmail.com> References: <20190729151651.21306-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::444 Subject: [Qemu-devel] [PATCH v7 13/15] 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: 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" Signed-off-by: Aarushi Mehta Acked-by: Eric Blake Reviewed-by: Stefan Hajnoczi --- 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