From nobody Tue Nov 11 17:31:52 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=1564414349; cv=none; d=zoho.com; s=zohoarc; b=Lne07uJ+VaUnk/IDgso2/9YwV+Ajow7Zva+BpzZNdPrIA5y9dat7KlZHpnCeFLGpjP4wClR8UFyvWghK3sxB4kvPe6Z2keQRP9a6u4TDMXZ0HJ2IJMkDzbmArD3Syy5/dU/8IroRMawvQXHfXvQbUDgsLy/XXklU8ULA1xqgJmE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1564414349; 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=WSpSTIHXOrvOaCUkGHFuQSPMR43SBs+6E3PxPGPC7o8=; b=fEQwjL6xu8wZSBLPPHxZ4USGE+fmwuftJAy/CCyOg4td3/jeAA0xl4wXx138xiEkNso6xpyuiougAAQ5ncRVZ9fCnh26a2tQgam3SwbTwG21YGBHxMPPp8fXOFvxIYwSYW1sgn2lSp/dKzDCw4UCvHmJYBqYj7r3/ducIinKuhE= 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 1564414349119156.70518158735; Mon, 29 Jul 2019 08:32:29 -0700 (PDT) Received: from localhost ([::1]:54072 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7dU-0001ME-5v for importer@patchew.org; Mon, 29 Jul 2019 11:32:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44053) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hs7QP-0008Eu-EV for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:18:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hs7QO-0001PE-9w for qemu-devel@nongnu.org; Mon, 29 Jul 2019 11:18:57 -0400 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]:46720) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hs7QO-0001O9-2Q; Mon, 29 Jul 2019 11:18:56 -0400 Received: by mail-pg1-x541.google.com with SMTP id k189so9382771pgk.13; Mon, 29 Jul 2019 08:18:56 -0700 (PDT) Received: from localhost.localdomain ([136.233.9.97]) by smtp.gmail.com with ESMTPSA id h129sm58693941pfb.110.2019.07.29.08.18.47 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 29 Jul 2019 08:18:54 -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=WSpSTIHXOrvOaCUkGHFuQSPMR43SBs+6E3PxPGPC7o8=; b=Em/cuWMmFKQc6ZdVMU/a859hLnYCxrqXRu9c/c5uEVt9nQy5Dq5uzXlfC1YXLXhNil m/y+Hvdn0iZ/HgEVYH3jSOfVpPXGG6pTFVKdUUwo4SqBJJDk2++Gj0p2ZPeD5u9hFiAp 4nJkTvTlgusOQqSj/YH1yseHo8g3DvjNYMTm/bfwW0MHUGq96vjzNfxX83B5FcYWPho0 FEeD8Glf3MhUE9E0sFOtdDd3Lcai025kKzkNU+PE7tXWeBcQlfhh6bFBpvhcXfkWdiSa +HBy08W3YuTB9+2M3nd01RwYO79yifgeHAK0ckIzW75bOcA6CVstTPJ4+RlACpSkn+/t ukwA== 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=WSpSTIHXOrvOaCUkGHFuQSPMR43SBs+6E3PxPGPC7o8=; b=DZN3koz8Vk55qnZoXj/1A/gJVWjGr55coXmLD25QqZlE4mt9/ZLsjzB3ft0qRumc4c ww35+hB9FyML7kgOVfyRTlbzjgo4HsUZB8wUQPkYi7x0pYA7rhnjPhw30CInIiRaKgcy PRIm+7d38GnpP83uC5vP+7e2RvDRQRd/YT0Z/J6jarUCVAovKhYloMInQwb1mU549bfI zTUU93zpgaY340c7pxLoYAJ4d436AcBYIwd74G1xcRcknnFiSF6Ll8LDm3Gv5+a8eCXf tMYa+cOc3HT1GhSxRAQmd9nr5IJ1fsCUN5gcDXOY4N4/ALtPg/nQDZTxWYICper6gbp4 rnsw== X-Gm-Message-State: APjAAAXFW2RF7ei5OcAtqcc+LJBkHqWEdxOKIxHLO/Z2nFAdXuc+x/oj X9inJIFqlf0h9U1NtAEguJE2yhVj4wh0cg== X-Google-Smtp-Source: APXvYqx7EaXu3DwiEMu5ofLpR/FxsqgM3Etvw/oGp7nOtyz03NXfz97sumOI3HmqSwCpVMn8zwQ9mw== X-Received: by 2002:a62:1ccd:: with SMTP id c196mr37507676pfc.102.1564413534801; Mon, 29 Jul 2019 08:18:54 -0700 (PDT) From: Aarushi Mehta To: qemu-devel@nongnu.org Date: Mon, 29 Jul 2019 20:46:48 +0530 Message-Id: <20190729151651.21306-13-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::541 Subject: [Qemu-devel] [PATCH v7 12/15] 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: 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 --- qemu-img.c | 10 +++++++++- qemu-img.texi | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 79983772de..3fc8dac0b1 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; } @@ -4234,6 +4235,13 @@ static int img_bench(int argc, char **argv) break; case 'n': flags |=3D BDRV_O_NATIVE_AIO; + 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': { 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