qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can "throttle-group"(added by "object-add") be lively updated through QM


From: Chun Feng Wu
Subject: Can "throttle-group"(added by "object-add") be lively updated through QMP cmd?
Date: Tue, 16 Jan 2024 09:37:48 +0000

Hi,

I am verifying “The 'throttle' block filter” mentioned at https://github.com/qemu/qemu/blob/master/docs/throttle.txt, and it works well with the following sample, however, it seems that I cannot update throttle lively without disruption(detaching disk, “object-del”, and then “object-add” with new throttle value), for example, I defined throttle “limit0”, and I applied it on disk0, and after “device_add” in the following sample, I want to update “limit0” from iops 200 to 210, but I cannot find appropriate QMP cmd like “object-set”, “object-update” in my ubuntu system to do live update.

so I have the following questions:

  • Is there a way to lively update “throttle-group”(associated with attached disk) without any disruption?
  • Is there any reason QEMU doesn’t provide QMP cmd like “object-set” to update object?

 

Any help or guidance would be appreciated!

 

Sample:


1. Add block device

{"execute": "blockdev-add", "arguments": {"node-name": "disk0", "driver": "qcow2", "file": {"driver": "file", "filename": "/virt/disks/vm1_disk_0.qcow2"}}}

 

{"execute": "blockdev-add", "arguments": {"node-name": "disk1", "driver": "qcow2", "file": {"driver": "file", "filename": "/virt/disks/vm1_disk_1.qcow2"}}}

 

{"execute": "blockdev-add", "arguments": {"node-name": "disk2", "driver": "qcow2", "file": {"driver": "file", "filename": "/virt/disks/vm1_disk_2.qcow2"}}}

 

2. Define throttle groups

{"execute": "object-add", "arguments": {"qom-type": "throttle-group", "id": "limit0", "props": {"limits": {"iops-total": 200}}}}

 

{"execute": "object-add", "arguments": {"qom-type": "throttle-group", "id": "limit1", "props": {"limits": {"iops-total": 250}}}}

 

{"execute": "object-add", "arguments": {"qom-type": "throttle-group", "id": "limit2", "props": {"limits": {"iops-total": 300}}}}

 

{"execute": "object-add", "arguments": {"qom-type": "throttle-group", "id": "limit012", "props": {"limits": {"iops-total": 400}}}}

 

3. Add throttles for disk0

{

  "execute": "blockdev-add",

  "arguments": {

    "driver": "throttle",

    "node-name": "throttle-disk0-limit0",

    "throttle-group": "limit0",

    "file": "disk0"

  }

}

 

{

  "execute": "blockdev-add",

  "arguments": {

    "driver": "throttle",

    "node-name": "throttle-disk0-limit012",

    "throttle-group": "limit012",

    "file": "throttle-disk0-limit0"

  }

}

 

4. Add throttles for disk1

{

  "execute": "blockdev-add",

  "arguments": {

    "driver": "throttle",

    "node-name": "throttle-disk1-limit1",

    "throttle-group": "limit1",

    "file": "disk1"

  }

}

 

{

  "execute": "blockdev-add",

  "arguments": {

    "driver": "throttle",

    "node-name": "throttle-disk1-limit012",

    "throttle-group": "limit012",

    "file": "throttle-disk1-limit1"

  }

}

 

5. Add throttles for disk2

{

  "execute": "blockdev-add",

  "arguments": {

    "driver": "throttle",

    "node-name": "throttle-disk2-limit2",

    "throttle-group": "limit2",

    "file": "disk2"

  }

}

 

{

  "execute": "blockdev-add",

  "arguments": {

    "driver": "throttle",

    "node-name": "throttle-disk2-limit012",

    "throttle-group": "limit012",

    "file": "throttle-disk2-limit2"

  }

}

 

6. attach devices

{"execute": "device_add", "arguments": {"driver": "virtio-blk", "id": "blk0", "drive": "throttle-disk0-limit012"}}

 

{"execute": "device_add", "arguments": {"driver": "virtio-blk", "id": "blk1", "drive": "throttle-disk1-limit012"}}

 

{"execute": "device_add", "arguments": {"driver": "virtio-blk", "id": "blk2", "drive": "throttle-disk2-limit012"}}

 

 

-- 

 

Wu

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]