]> git.ipfire.org Git - thirdparty/libvirt.git/commit
blockjob: allow finer bandwidth tuning for set speed
authorEric Blake <eblake@redhat.com>
Sun, 31 Aug 2014 03:56:19 +0000 (21:56 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 12 Sep 2014 14:11:11 +0000 (08:11 -0600)
commit0a6a6b1ae73af5b66814f8161dddfa6563c17b4e
treec14d915d47951fb5d05de412ef0d738f2f7f2978
parenteef91f9470e5dcc8afa80efe2816f84afef361fe
blockjob: allow finer bandwidth tuning for set speed

We stupidly modeled block job bandwidth after migration
bandwidth, which in turn was an 'unsigned long' and therefore
subject to 32-bit vs. 64-bit interpretations.  To work around
the fact that 10-gigabit interfaces are possible but don't fit
within 32 bits, the original interface took the number scaled
as MiB/sec.  But this scaling is rather coarse, and it might
be nice to tune bandwidth finer than in megabyte chunks.

Several of the block job calls that can set speed are fed
through a common interface, so it was easier to adjust them all
at once.  Note that there is intentionally no flag for the new
virDomainBlockCopy; there, since the API already uses a 64-bit
type always, instead of a possible 32-bit type, and is brand
new, it was easier to just avoid scaling issues.  As with the
previous patch that adjusted the query side (commit db33cc24),
omitting the new flag preserves old behavior, and the
documentation now mentions limits of what happens when a 32-bit
machine is on either client or server side.

* include/libvirt/libvirt.h.in (virDomainBlockJobSetSpeedFlags)
(virDomainBlockPullFlags)
(VIR_DOMAIN_BLOCK_REBASE_BANDWIDTH_BYTES)
(VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES): New enums.
* src/libvirt.c (virDomainBlockJobSetSpeed, virDomainBlockPull)
(virDomainBlockRebase, virDomainBlockCommit): Document them.
* src/qemu/qemu_driver.c (qemuDomainBlockJobSetSpeed)
(qemuDomainBlockPull, qemuDomainBlockRebase)
(qemuDomainBlockCommit, qemuDomainBlockJobImpl): Support new flag.

Signed-off-by: Eric Blake <eblake@redhat.com>
include/libvirt/libvirt.h.in
src/libvirt.c
src/qemu/qemu_driver.c