mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
The current output of 'blockjob [--info]' is a single line designed for human consumption; it's not very nice for machine parsing. Furthermore, I have plans to modify the line in response to the new flag for controlling bandwidth units. Solve that by adding a --raw parameter, which outputs information closer to the C struct. $ virsh blockjob testvm1 vda --raw type=Block Copy bandwidth=1 cur=197120 end=197120 The information is indented, because I'd like for a later patch to add a mode that iterates over all the vm's disks with status for each; in that mode, each block name would be listed unindented before information (if any) about that block. Now that we have a raw mode, we can guarantee that it won't change format over time. Any app that cares about parsing the output can try --raw, and if it fails, know that it was talking to an older virsh and fall back to parsing the human-readable format which had not changed until now; meanwhile, when not using --raw, we have freed future virsh to change the output to whatever makes sense. My first change to human mode: this command now guarantees a line is printed on successful use of the API, even when the API did not find a current block job (consistent with the rest of virsh). Bonus: https://bugzilla.redhat.com/show_bug.cgi?id=1135441 complained that this message was confusing: $ virsh blockjob test1 hda --async --bandwidth 10 error: conflict between --abort, --info, and --bandwidth modes even though the man page already documents that --async implies abort mode, all because '--abort' wasn't present in the command line. Since I'm adding another case where options are tied to or imply a mode, I changed that error to: error: conflict between abort, info, and bandwidth modes * tools/virsh-domain.c (cmdBlockJob): Add --raw parameter; tweak error wording. * tools/virsh.pod (blockjob): Document it. Signed-off-by: Eric Blake <eblake@redhat.com>
LibVirt : simple API for virtualization Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed. Daniel Veillard <veillard@redhat.com>
Description
Libvirt provides a portable, long term stable C API for managing the
virtualization technologies provided by many operating systems. It
includes support for QEMU, KVM, Xen, LXC, bhyve, Virtuozzo, VMware
vCenter and ESX, VMware Desktop, Hyper-V, VirtualBox and the POWER
Hypervisor.
Languages
C
94.8%
Python
2%
Meson
0.9%
Shell
0.8%
Dockerfile
0.6%
Other
0.8%