Subject: | Missing pivot-flag for dom->block_commit() |
Date: | Sun, 05 Mar 2017 00:42:35 +0100 |
To: | bug-Sys-Virt [...] rt.cpan.org |
From: | "Sten Kokel" <sten [...] kokel.net> |
In virsh you can use
# virsh blockcommit dom vda --active --pivot
to merge the whole backing chain into the base disk image and point the running dom back to the base disk image file. The --pivot options seems to be needed for this operation and Sys::Virt seems to be missing an appropriate Flag like Sys::Virt::Domain::BLOCK_COMMIT_PIVOT.
I call block_commit on Sys::Virt 3.0.0 this way:
my $flags = Sys::Virt::Domain::BLOCK_COMMIT_ACTIVE;
$dom->block_commit('vda', '/mnt/vm/dom_sys.qcow2', '/mnt/vm/dom_sys.BackupSnapshot', 0, $flags);
After this call, backing chain seems to be merged into base disk image but the chain stays in dom's xml-config. After
# virsh blockjob dom vda --abort
further changes are written to the end of the chain and not to the base disk image.