[libvirt] [PATCHv6 1/7] Add new API virDomain{Set, Get}BlockIoTune

Eric Blake eblake at redhat.com
Wed Nov 30 00:27:27 UTC 2011


On 11/23/2011 02:44 PM, Eric Blake wrote:
> From: Lei Li <lilei at linux.vnet.ibm.com>
> 
> This patch add new pulic API virDomainSetBlockIoTune and
> virDomainGetBlockIoTune.
> 
> Signed-off-by: Lei Li <lilei at linux.vnet.ibm.com>
> Signed-off-by: Zhi Yong Wu <wuzhy at linux.vnet.ibm.com>
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  include/libvirt/libvirt.h.in |   63 ++++++++++++++++++
>  python/generator.py          |    3 +
>  src/driver.h                 |   20 ++++++
>  src/libvirt.c                |  149 ++++++++++++++++++++++++++++++++++++++++++
>  src/libvirt_public.syms      |    6 ++
>  5 files changed, 241 insertions(+), 0 deletions(-)

I finally got around to testing this series.  It looks like the errors
with older qemu are decent enough without needing major tweaks in the code:

# tools/virsh blkdeviotune dom vda --total_bytes_sec 10000000
error: Unable to change block I/O throttle
error: Requested operation is not valid: Command 'block_set_io_throttle'
is not found
# tools/virsh blkdeviotune dom vda
error: Unable to get block I/O throttle parameters
error: invalid argument: No info for device 'drive-virtio-disk0'

We may find further things to tweak.  Off-hand, I know of my desire to
fix things so that bytes_sec and iops_sec are independent, where setting
one does not clear the other; also, I did not get around to testing
hot-plug behavior with qemu that supports the new monitor command; my
guess is that we probably forgot to propagate a hotplug with iotuning
into qemu properly.  But what we have in the series so far is good
enough to start pushing, so that we beat the rc1 freeze; touchups can
stretch out past the freeze as needed.

After rebasing this to latest, I'm squashing this in before pushing, to
pick up on the ideas of commit 4199f3de that went in during the meantime:

diff --git i/src/libvirt.c w/src/libvirt.c
index 8a5361e..5c09591 100644
--- i/src/libvirt.c
+++ w/src/libvirt.c
@@ -17574,6 +17574,12 @@ int virDomainGetBlockIoTune(virDomainPtr dom,
                                  VIR_DRV_FEATURE_TYPED_PARAM_STRING))
         flags |= VIR_TYPED_PARAM_STRING_OKAY;

+    /* At most one of these two flags should be set.  */
+    if ((flags & VIR_DOMAIN_AFFECT_LIVE) &&
+        (flags & VIR_DOMAIN_AFFECT_CONFIG)) {
+        virLibDomainError(VIR_ERR_INVALID_ARG, __FUNCTION__);
+        goto error;
+    }
     conn = dom->conn;

     if (conn->driver->domainGetBlockIoTune) {

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111129/3f741a67/attachment-0001.sig>


More information about the libvir-list mailing list