From nobody Sun Apr 28 06:20:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516625063797423.89974765234433; Mon, 22 Jan 2018 04:44:23 -0800 (PST) Received: from localhost ([::1]:40055 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edbSY-00020R-UV for importer@patchew.org; Mon, 22 Jan 2018 07:44:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edbPF-00087u-7I for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edbPB-0002bD-A3 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38264) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edbPB-0002aZ-3o for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:53 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A5A878EC1; Mon, 22 Jan 2018 12:40:52 +0000 (UTC) Received: from localhost (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F7865C262; Mon, 22 Jan 2018 12:40:37 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 22 Jan 2018 12:40:32 +0000 Message-Id: <20180122124033.21440-2-stefanha@redhat.com> In-Reply-To: <20180122124033.21440-1-stefanha@redhat.com> References: <20180122124033.21440-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 22 Jan 2018 12:40:52 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/2] hw/block: Use errp directly rather than local_err 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: Kevin Wolf , Peter Maydell , Mao Zhongyi , "Michael S. Tsirkin" , Markus Armbruster , Max Reitz , Keith Busch , Gerd Hoffmann , Stefan Hajnoczi , Paolo Bonzini , John Snow Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mao Zhongyi Cc: John Snow Cc: Kevin Wolf Cc: Max Reitz Cc: Keith Busch Cc: Stefan Hajnoczi Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: Gerd Hoffmann Cc: Markus Armbruster Signed-off-by: Mao Zhongyi Reviewed-by: Stefan Hajnoczi Message-id: e77848d3735ba590f23ffbf8094379c646c33d79.1511317952.git.maozy.f= nst@cn.fujitsu.com Signed-off-by: Stefan Hajnoczi --- hw/block/virtio-blk.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index b1532e4e91..58a5def75d 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio-blk.c @@ -913,7 +913,6 @@ static void virtio_blk_device_realize(DeviceState *dev,= Error **errp) VirtIODevice *vdev =3D VIRTIO_DEVICE(dev); VirtIOBlock *s =3D VIRTIO_BLK(dev); VirtIOBlkConf *conf =3D &s->conf; - Error *err =3D NULL; unsigned i; =20 if (!conf->conf.blk) { @@ -966,9 +965,7 @@ static void virtio_blk_device_realize(DeviceState *dev,= Error **errp) for (i =3D 0; i < conf->num_queues; i++) { virtio_add_queue(vdev, conf->queue_size, virtio_blk_handle_output); } - virtio_blk_data_plane_create(vdev, conf, &s->dataplane, &err); - if (err !=3D NULL) { - error_propagate(errp, err); + if (!virtio_blk_data_plane_create(vdev, conf, &s->dataplane, errp)) { virtio_cleanup(vdev); return; } --=20 2.14.3 From nobody Sun Apr 28 06:20:50 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.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 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516625038722837.8698700674017; Mon, 22 Jan 2018 04:43:58 -0800 (PST) Received: from localhost ([::1]:40049 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edbSA-0001iZ-44 for importer@patchew.org; Mon, 22 Jan 2018 07:43:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edbPF-00087s-6c for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edbPC-0002c4-W6 for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1edbPC-0002be-PZ for qemu-devel@nongnu.org; Mon, 22 Jan 2018 07:40:54 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E4545C07015A; Mon, 22 Jan 2018 12:40:53 +0000 (UTC) Received: from localhost (ovpn-116-110.ams2.redhat.com [10.36.116.110]) by smtp.corp.redhat.com (Postfix) with ESMTP id 761C57A2F6; Mon, 22 Jan 2018 12:40:53 +0000 (UTC) From: Stefan Hajnoczi To: Date: Mon, 22 Jan 2018 12:40:33 +0000 Message-Id: <20180122124033.21440-3-stefanha@redhat.com> In-Reply-To: <20180122124033.21440-1-stefanha@redhat.com> References: <20180122124033.21440-1-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 22 Jan 2018 12:40:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/2] block: add block_set_io_throttle virtio-blk-pci QMP example 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: Kevin Wolf , Peter Maydell , Stefan Hajnoczi Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The block_set_io_throttle command can look up BlockBackends by the attached qdev device ID. virtio-blk-pci is a special case because the actual VirtIOBlock device is the "/virtio-backend" child of the PCI adapter device. Add a QMP schema example so clients will know how to use block_set_io_throttle on the virtio-blk-pci device. The alternative is to implement some sort of aliasing for qmp_get_blk() but that is likely to cause confusion and could break future use cases. Let's not go there. Cc: Kevin Wolf Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Message-id: 20180117090700.25811-1-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- qapi/block-core.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/qapi/block-core.json b/qapi/block-core.json index e94a6881b2..4e84cf29db 100644 --- a/qapi/block-core.json +++ b/qapi/block-core.json @@ -1799,6 +1799,24 @@ # Example: # # -> { "execute": "block_set_io_throttle", +# "arguments": { "id": "virtio-blk-pci0/virtio-backend", +# "bps": 0, +# "bps_rd": 0, +# "bps_wr": 0, +# "iops": 512, +# "iops_rd": 0, +# "iops_wr": 0, +# "bps_max": 0, +# "bps_rd_max": 0, +# "bps_wr_max": 0, +# "iops_max": 0, +# "iops_rd_max": 0, +# "iops_wr_max": 0, +# "bps_max_length": 0, +# "iops_size": 0 } } +# <- { "return": {} } +# +# -> { "execute": "block_set_io_throttle", # "arguments": { "id": "ide0-1-0", # "bps": 1000000, # "bps_rd": 0, --=20 2.14.3