libvirt/tools
Eric Blake 1105c1deff blockjob: add new --bytes flag to virsh blockjob
Expose the new flag just added to virDomainGetBlockJobInfo.
With --raw, the presence or absence of --bytes determines which
flag to use in the single API call.  Without --raw, the use of
--bytes forces an error if the server doesn't support it,
otherwise, the code tries to silently fall back to scaling the
MiB/s value.

My goal is to eventually also support --bytes in bandwidth mode;
but that's a bit further down the road (and needs a new API flag
added in libvirt.h first).

This changes the human output, but the previous patch added
raw output precisely so that we can have flexibility with the
human output.  For this commit, I used qemu-monitor-command to
force an unusual bandwidth, but the same will be possible once
qemu implements virDomainBlockCopy:

Before:
Block Copy: [100 %]    Bandwidth limit: 2 MiB/s
After:
Block Copy: [100 %]    Bandwidth limit: 1048577 bytes/s (1.000 MiB/s)

The cache avoids having to repeatedly checking whether the flag
works when talking to an older server, when multiple blockjob
commands are issued during a batch session and the user is
manually polling for job completion.

* tools/virsh.h (_vshControl): Add a cache.
* tools/virsh.c (cmdConnect, vshReconnect): Initialize the cache.
* tools/virsh-domain.c (opts_block_job): Add --bytes.
* tools/virsh.pod (blockjob): Document this.

Signed-off-by: Eric Blake <eblake@redhat.com>
2014-09-05 13:13:23 -06:00
..
wireshark Fix const correctness 2014-07-16 12:07:24 +02:00
libvirt_win_icon_16x16.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_32x32.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_48x48.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt_win_icon_64x64.ico Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
libvirt-guests.init.in tools: Only install guests init script if --with-init=script=redhat 2012-12-11 19:54:37 -05:00
libvirt-guests.service.in Add Documentation fields to systemd service files 2014-01-09 09:32:55 +01:00
libvirt-guests.sh.in libvirt-guests: fix some typos in a comment 2014-07-25 12:06:07 +02:00
libvirt-guests.sysconf libvirt-guests: Add parallel startup and shutdown of guests 2012-03-05 13:18:24 +01:00
Makefile.am conf: move storage source type to util/ 2014-04-01 10:38:14 -06:00
virsh_win_icon.rc Move virsh into tools/ directory 2009-09-21 14:41:45 +01:00
virsh-console.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-console.h virsh: Rename vshMakeStdinRaw to vshTTYMakeRaw and move it to virsh.c 2013-09-03 14:06:11 +02:00
virsh-domain-monitor.c virsh: Implement command to excercise the bulk stats APIs 2014-08-28 13:28:32 +02:00
virsh-domain-monitor.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-domain.c blockjob: add new --bytes flag to virsh blockjob 2014-09-05 13:13:23 -06:00
virsh-domain.h virsh: domain: Split out code to lookup domain from string 2014-08-26 22:48:05 +02:00
virsh-edit.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-host.c maint: use consistent if-else braces in remaining spots 2014-09-04 14:34:03 -06:00
virsh-host.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-interface.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-interface.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virsh-network.c virsh-network: Resolve Coverity RESOURCE_LEAK 2014-08-28 08:12:16 -04:00
virsh-network.h Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virsh-nodedev.c virsh-nodedev: Avoid spurious errors 2014-06-02 18:09:09 +02:00
virsh-nodedev.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-nwfilter.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-nwfilter.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-pool.c storage: ZFS support 2014-08-12 19:40:20 +04:00
virsh-pool.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-secret.c maint: shorten 'TypeType' function names 2014-05-16 00:22:18 -06:00
virsh-secret.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-snapshot.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virsh-snapshot.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh-volume.c cleanup spaces between parentheses and braces 2014-08-20 14:50:21 +02:00
virsh-volume.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virsh.c blockjob: add new --bytes flag to virsh blockjob 2014-09-05 13:13:23 -06:00
virsh.h blockjob: add new --bytes flag to virsh blockjob 2014-09-05 13:13:23 -06:00
virsh.pod blockjob: add new --bytes flag to virsh blockjob 2014-09-05 13:13:23 -06:00
virt-host-validate-common.c Introduce OOM reporting to virAsprintf 2013-07-10 11:07:31 +02:00
virt-host-validate-common.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-lxc.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-lxc.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-qemu.c maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate-qemu.h maint: fix up copyright notice inconsistencies 2012-09-20 16:30:55 -06:00
virt-host-validate.c Change file names in comments to match the files they are in 2014-03-10 14:26:04 +01:00
virt-login-shell.c Indent top-level labels by one space in tools/ 2014-03-25 14:58:41 +01:00
virt-login-shell.conf Introduce a virt-login-shell binary 2013-08-08 16:36:31 +01:00
virt-login-shell.pod virt-login-shell: saner exit value 2014-03-03 12:40:32 -07:00
virt-pki-validate.in virt-pki-validate: add --help/--version option 2013-08-19 20:25:53 -06:00
virt-sanlock-cleanup.in virt-sanlock-cleanup; Fix augtool usage 2013-08-28 13:50:10 +02:00
virt-xml-validate.in tools: add missing 'interface' type and update man page 2013-09-13 14:57:52 +02:00