qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: add block_set_io_throttle virtio-blk-pci QMP example
@ 2018-01-17  9:07 Stefan Hajnoczi
  2018-01-17 10:11 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
  2018-01-18 10:38 ` [Qemu-devel] " Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-01-17  9:07 UTC (permalink / raw)
  To: qemu-devel
  Cc: Markus Armbruster, Eric Blake, qemu-block, Kevin Wolf,
	Stefan Hajnoczi

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 <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 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,
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [Qemu-block] [PATCH] block: add block_set_io_throttle virtio-blk-pci QMP example
  2018-01-17  9:07 [Qemu-devel] [PATCH] block: add block_set_io_throttle virtio-blk-pci QMP example Stefan Hajnoczi
@ 2018-01-17 10:11 ` Alberto Garcia
  2018-01-18 10:38 ` [Qemu-devel] " Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Alberto Garcia @ 2018-01-17 10:11 UTC (permalink / raw)
  To: Stefan Hajnoczi, qemu-devel; +Cc: Kevin Wolf, Markus Armbruster, qemu-block

On Wed 17 Jan 2018 10:07:00 AM CET, Stefan Hajnoczi wrote:
> 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 <kwolf@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] block: add block_set_io_throttle virtio-blk-pci QMP example
  2018-01-17  9:07 [Qemu-devel] [PATCH] block: add block_set_io_throttle virtio-blk-pci QMP example Stefan Hajnoczi
  2018-01-17 10:11 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
@ 2018-01-18 10:38 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2018-01-18 10:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Markus Armbruster, Eric Blake, qemu-block, Kevin Wolf

[-- Attachment #1: Type: text/plain, Size: 881 bytes --]

On Wed, Jan 17, 2018 at 09:07:00AM +0000, Stefan Hajnoczi wrote:
> 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 <kwolf@redhat.com>
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> ---
>  qapi/block-core.json | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-01-18 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17  9:07 [Qemu-devel] [PATCH] block: add block_set_io_throttle virtio-blk-pci QMP example Stefan Hajnoczi
2018-01-17 10:11 ` [Qemu-devel] [Qemu-block] " Alberto Garcia
2018-01-18 10:38 ` [Qemu-devel] " Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).