From nobody Sun Feb 8 19:37:53 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=1564508487; cv=none; d=zoho.com; s=zohoarc; b=hz8YPCc+lBkBr4l3S1NdmIovGXhEFqIoB2bcPY+//xeyQ0cslY4PehV2HLKCJOeHEdAMat5AnGuxVMbA7uThfoO1h3u+yRPn/gVy0paUb1/wBR4jBR7T/6KGCjReL78GZUTLN3DmvdXwCHyCOco8hpolfYnqJevG2PM4FWngHV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564508487; 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=WeED2N/xrRXHqk+R3uuiNy7p3rAfCPFvDRDie7m+ELM=; b=XFYnhjokceESTcSkVNj7KZvRYPMk9CLoJSrDgbJC/0k1CSljYZzW1ntPaDOzW3H9CsgH+mPKIshTA70RRyXwm3+wvt4sqZYHtfp3jhCmVKd0fZAZ0Ky+dAfeYoMa/HLRZNzXpA7ZYXRTkqqqRoIht3kwIAfk2ylDhfs+P8nUIXA= 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 1564508487908264.46968573313154; Tue, 30 Jul 2019 10:41:27 -0700 (PDT) Received: from localhost ([::1]:35218 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsW7q-00070o-Qn for importer@patchew.org; Tue, 30 Jul 2019 13:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35902) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hsW36-00067D-Fs for qemu-devel@nongnu.org; Tue, 30 Jul 2019 13:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hsW35-0000Sn-9k for qemu-devel@nongnu.org; Tue, 30 Jul 2019 13:36:32 -0400 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]:36278) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hsW35-0000SV-4K; Tue, 30 Jul 2019 13:36:31 -0400 Received: by mail-pl1-x641.google.com with SMTP id k8so29190848plt.3; Tue, 30 Jul 2019 10:36:31 -0700 (PDT) Received: from localhost.localdomain ([136.233.9.97]) by smtp.gmail.com with ESMTPSA id q24sm59122895pjp.14.2019.07.30.10.36.24 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 10:36:29 -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=WeED2N/xrRXHqk+R3uuiNy7p3rAfCPFvDRDie7m+ELM=; b=qp3uAKviqkfeBIM9MIhXrztFnkqmqUWbrS8MqIiQ5C4NPufwyt7IVWJSqbqLscOVT5 MWhFTXSdwGzRhbu31GJxJbD5d4I/DKE9OkCzaCVF5ws+eY4B+6xQ9NsB3Cb1l4+SMd7S dDfvWxSFNNaG321fR28pX1SgryqRCc9+H7azrRvC18j+8EJK+Z+8gC4RSt4DkfnBLxWT x9zOhh62PJHaJIsuR9ReWE3wO64nPwnSw/o7f6rXoCxWkkvvQX0oiEmCDacmTLChiV9v XWZgU6JXyn39ElQbB0+X+rX90VdENUbu8k6gCjc93fqEH/Yfk76mYjrD3SuYFxoYfmkI thfA== 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=WeED2N/xrRXHqk+R3uuiNy7p3rAfCPFvDRDie7m+ELM=; b=k0eHI6tKLjN/2gc46IbZhla+Kl6xqNCTzqqKU6v6Fu9HIMeNT0JkMnsw4oz1HgbIg6 B03eJJwAm4sztqOvaFJBag7HG7DrXeXAEAJDlUZQvc/Bvo0AkQXRqxEvg36v5pWtBCQ9 JCarAcStRV7zky+hflRP6dRqGo+D0I12d8g4TscuHS9y6QlCkWD9QEiDoeDHXg4YC8uv /Fhixm31yFAh1HmZvZslh5TzulaqHm8bDvHnEfARsrJ7KVnfuIsBIDtMQTNcqrE9/Q9u kMI0uG5LLISd1XcAGR2kFa5nPjwCPeufWMSPvtDZleLbSmC1OV3mbi9F5jBTW54x89VY bspA== X-Gm-Message-State: APjAAAUWFC34t27l50JsO70DS0AmCQc5B64FN8kOGvgD6N+fOBqqh9Mu RwlM7520hKiDlAou51ezi5Nj3AQaI+mqeQ== X-Google-Smtp-Source: APXvYqz8a57OYeh8SToMuLF1BntaaMs+IP8K8g7VTQwnDBH37gMsD/21FTZhqdSaamVQeyuHW7qrcA== X-Received: by 2002:a17:902:16f:: with SMTP id 102mr112077523plb.94.1564508189898; Tue, 30 Jul 2019 10:36:29 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Tue, 30 Jul 2019 23:04:37 +0530 Message-Id: <20190730173441.26486-13-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::641 Subject: [Qemu-devel] [PATCH v8 12/16] qemu-img: adds option to use aio engine for benchmarking 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 --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 11 ++++++++++- qemu-img.texi | 5 ++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/qemu-img-cmds.hx b/qemu-img-cmds.hx index 1c93e6d185..77b5a8dda8 100644 --- a/qemu-img-cmds.hx +++ b/qemu-img-cmds.hx @@ -20,9 +20,9 @@ STEXI ETEXI =20 DEF("bench", img_bench, - "bench [-c count] [-d depth] [-f fmt] [--flush-interval=3Dflush_interv= al] [-n] [--no-drain] [-o offset] [--pattern=3Dpattern] [-q] [-s buffer_siz= e] [-S step_size] [-t cache] [-w] [-U] filename") + "bench [-c count] [-d depth] [-f fmt] [--flush-interval=3Dflush_interv= al] [-n] [--no-drain] [-o offset] [--pattern=3Dpattern] [-q] [-s buffer_siz= e] [-S step_size] [-t cache] [-i aio] [-w] [-U] filename") STEXI -@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-inte= rval=3D@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern= =3D@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var= {cache}] [-w] [-U] @var{filename} +@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-inte= rval=3D@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern= =3D@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var= {cache}] [-i @var{aio}] [-w] [-U] @var{filename} ETEXI =20 DEF("check", img_check, diff --git a/qemu-img.c b/qemu-img.c index 79983772de..27ac33f7d7 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -4192,7 +4192,8 @@ static int img_bench(int argc, char **argv) {"force-share", no_argument, 0, 'U'}, {0, 0, 0, 0} }; - c =3D getopt_long(argc, argv, ":hc:d:f:no:qs:S:t:wU", long_options= , NULL); + c =3D getopt_long(argc, argv, ":hc:d:f:ni:o:qs:S:t:wU", long_optio= ns, + NULL); if (c =3D=3D -1) { break; } @@ -4235,6 +4236,14 @@ static int img_bench(int argc, char **argv) case 'n': flags |=3D BDRV_O_NATIVE_AIO; break; + case 'i': + ret =3D bdrv_parse_aio(optarg, &flags); + if (ret < 0) { + error_report("Invalid aio option: %s", optarg); + ret =3D -1; + goto out; + } + break; case 'o': { offset =3D cvtnum(optarg); diff --git a/qemu-img.texi b/qemu-img.texi index c8e9bba515..0a2eccea85 100644 --- a/qemu-img.texi +++ b/qemu-img.texi @@ -206,7 +206,7 @@ Command description: Amends the image format specific @var{options} for the image file @var{filename}. Not all file formats support this operation. =20 -@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-inte= rval=3D@var{flush_interval}] [-n] [--no-drain] [-o @var{offset}] [--pattern= =3D@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_size}] [-t @var= {cache}] [-w] [-U] @var{filename} +@item bench [-c @var{count}] [-d @var{depth}] [-f @var{fmt}] [--flush-inte= rval=3D@var{flush_interval}] [-n] [-i @var{aio}][--no-drain] [-o @var{offse= t}] [--pattern=3D@var{pattern}] [-q] [-s @var{buffer_size}] [-S @var{step_s= ize}] [-t @var{cache}] [-w] [-U] @var{filename} =20 Run a simple sequential I/O benchmark on the specified image. If @code{-w}= is specified, a write test is performed, otherwise a read test is performed. @@ -227,6 +227,9 @@ If @code{-n} is specified, the native AIO backend is us= ed if possible. On Linux, this option only works if @code{-t none} or @code{-t directsync} is specified as well. =20 +If @code{-i} is specified, aio option can be used to specify different AIO +backends: @var{threads}, @var{native} or @var{io_uring}. + For write tests, by default a buffer filled with zeros is written. This ca= n be overridden with a pattern byte specified by @var{pattern}. =20 --=20 2.21.0