Skip Menu |

This queue is for tickets about the Sys-Virt CPAN distribution.

Report information
The Basics
Id: 120506
Status: rejected
Priority: 0/
Queue: Sys-Virt

People
Owner: Nobody in particular
Requestors: sten [...] kokel.net
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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.
On Sat Mar 04 18:48:59 2017, sten@kokel.net wrote: Show quoted text
> 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.
The --pivot arg to virsh ends up calling virDomainBlockJobAbort() passing the VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT flag. This can be accessed via Sys::Virt::Domain objects calling "abort_block_job" with the Sys::Virt::Domain::BLOCK_JOB_ABORT_PIVOT constant.