From nobody Thu Dec 18 17:53:11 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; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1552413962048283.13509444640374; Tue, 12 Mar 2019 11:06:02 -0700 (PDT) Received: from localhost ([127.0.0.1]:57006 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3lmo-0004kY-LE for importer@patchew.org; Tue, 12 Mar 2019 14:05:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56381) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3lEl-0000qV-G5 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:30:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3lEj-0008QZ-V7 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:30:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49986) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h3lEb-0008GT-KN; Tue, 12 Mar 2019 13:30:37 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A25D83F30D; Tue, 12 Mar 2019 17:30:36 +0000 (UTC) Received: from linux.fritz.box.com (ovpn-117-52.ams2.redhat.com [10.36.117.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94E7360C47; Tue, 12 Mar 2019 17:30:35 +0000 (UTC) From: Kevin Wolf To: qemu-block@nongnu.org Date: Tue, 12 Mar 2019 18:30:00 +0100 Message-Id: <20190312173025.3843-4-kwolf@redhat.com> In-Reply-To: <20190312173025.3843-1-kwolf@redhat.com> References: <20190312173025.3843-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 12 Mar 2019 17:30:36 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 03/28] qapi: move to QOM path for x-block-latency-histogram-set X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy Signed-off-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- qapi/block-core.json | 4 ++-- blockdev.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 919d0530b2..3f0a5cb1e8 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -550,7 +550,7 @@ # If only @device parameter is specified, remove all present latency histo= grams # for the device. Otherwise, add/reset some of (or all) latency histograms. # -# @device: device name to set latency histogram for. +# @id: The name or QOM path of the guest device. # # @boundaries: list of interval boundary values (see description in # BlockLatencyHistogramInfo definition). If specified, all @@ -608,7 +608,7 @@ # <- { "return": {} } ## { 'command': 'x-block-latency-histogram-set', - 'data': {'device': 'str', + 'data': {'id': 'str', '*boundaries': ['uint64'], '*boundaries-read': ['uint64'], '*boundaries-write': ['uint64'], diff --git a/blockdev.c b/blockdev.c index 871966ca13..850fb34c52 100644 --- a/blockdev.c +++ b/blockdev.c @@ -4453,21 +4453,21 @@ void qmp_x_blockdev_set_iothread(const char *node_n= ame, StrOrNull *iothread, } =20 void qmp_x_block_latency_histogram_set( - const char *device, + const char *id, bool has_boundaries, uint64List *boundaries, bool has_boundaries_read, uint64List *boundaries_read, bool has_boundaries_write, uint64List *boundaries_write, bool has_boundaries_flush, uint64List *boundaries_flush, Error **errp) { - BlockBackend *blk =3D blk_by_name(device); + BlockBackend *blk =3D qmp_get_blk(NULL, id, errp); BlockAcctStats *stats; int ret; =20 if (!blk) { - error_setg(errp, "Device '%s' not found", device); return; } + stats =3D blk_get_stats(blk); =20 if (!has_boundaries && !has_boundaries_read && !has_boundaries_write && @@ -4482,7 +4482,7 @@ void qmp_x_block_latency_histogram_set( stats, BLOCK_ACCT_READ, has_boundaries_read ? boundaries_read : boundaries); if (ret) { - error_setg(errp, "Device '%s' set read boundaries fail", devic= e); + error_setg(errp, "Device '%s' set read boundaries fail", id); return; } } @@ -4492,7 +4492,7 @@ void qmp_x_block_latency_histogram_set( stats, BLOCK_ACCT_WRITE, has_boundaries_write ? boundaries_write : boundaries); if (ret) { - error_setg(errp, "Device '%s' set write boundaries fail", devi= ce); + error_setg(errp, "Device '%s' set write boundaries fail", id); return; } } @@ -4502,7 +4502,7 @@ void qmp_x_block_latency_histogram_set( stats, BLOCK_ACCT_FLUSH, has_boundaries_flush ? boundaries_flush : boundaries); if (ret) { - error_setg(errp, "Device '%s' set flush boundaries fail", devi= ce); + error_setg(errp, "Device '%s' set flush boundaries fail", id); return; } } --=20 2.20.1