On 2019-06-10 6:07 p.m., Eric Blake wrote:
On 6/10/19 4:27 PM, Gary Dale wrote:
Trying this against a test VM, I ran into a roadblock. My command line
and the results are:
# virsh blockcommit stretch "/home/secure/virtual/stretch.qcow2" --top
stretchS3 --delete --wait
error: unsupported flags (0x2) in function qemuDomainBlockCommit
I get the same thing when the path to the qcow2 file isn't quoted.
That's a libvirt limitation - the --delete flag is documented from the
generic API standpoint, but not (yet) implemented for the qemu driver
within libvirt. For now, you have to omit --delete from your virsh
command line, and then manually 'rm' the unused external file after the
fact.
Which is not possible since I'm using internal snapshots.
I noted in
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/virtualization_administration_guide/sub-sect-domain_commands-using_blockcommit_to_shorten_a_backing_chain
that the options use a single "-".
Sounds like a bug in that documentation.
Yes, and the man page also seems to be wrong. The section on blockcommit
begins:
blockcommit domain path [bandwidth] [--bytes] [base] [--shallow] [top]
[--delete]
[--keep-relative] [--wait [--async] [--verbose]] [--timeout
seconds] [--active]
[{--pivot | --keep-overlay}]
Reduce the length of a backing image chain, by committing
changes at the top of the
chain (snapshot or delta files) into backing images. By
default, this command
attempts to flatten the entire chain.
In addition to "[base]" actually being "[--base base]" and "[top]" being
"[--top top]", the description of what it does only applies to external
snapshots. Similar things are wrong in the blockpull section.
However the results for that were:
# virsh blockcommit stretch /home/secure/virtual/stretch.qcow2 -top
stretchS3 -delete -wait
error: Scaled numeric value '-top' for <--bandwidth> option is malformed
or out of range
which looks like virsh doesn't like the single dashes and is trying to
interpret them as positional options.
I also did a
# virsh domblklist stretch
Target Source
------------------------------------------------
vda /home/secure/virtual/stretch.qcow2
hda -
and tried using vda instead of the full path in the blockcommit but got
the same error.
Any ideas on what I'm doing wrong?
Do you know for sure whether you have internal or external snapshots?
And at this point, your questions are starting to wander more into
libvirt territory.
Yes. I'm using internal snapshots. From your other e-mail, I gather that
the (only) benefit to blockcommit with internal snapshots would be to
reduce the size of the various tables recording changed blocks. Without
a blockcommit, the L1 tables get progressively larger over time since
they record all changes to the base file. Eventually the snapshots could
become larger than the base image if I don't do a blockcommit.