]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Block info query: Add check for transient domain
authorJohn Ferlan <jferlan@redhat.com>
Tue, 17 Dec 2013 21:47:28 +0000 (16:47 -0500)
committerJohn Ferlan <jferlan@redhat.com>
Fri, 24 Jan 2014 16:37:18 +0000 (11:37 -0500)
commit46a0737e13cec06a6b7cb0afdcdd200c2bec317f
treecb38f636fbb6395a5fcbca69c028e3bd6b18f1cf
parent68b0ff45f521c69a6ffc63eb38d955b3ad7d94c3
Block info query: Add check for transient domain

Currently the qemuDomainGetBlockInfo will return allocation == physical
for most backing stores. For a qcow2 block backed device it's possible
to return the highest lv extent allocated from qemu for an active guest.
That is a value where allocation != physical and one would hope be less.
However, if the guest is not running, then the code falls back to returning
allocation == physical. This turns out to be problematic for rhev which
monitors the size of the backing store. During a migration, before the
VM has been started on the target and while it is deemed inactive on the
source, there's a small window of time where the allocation is returned
as physical triggering the code to extend the file unnecessarily.

Since rhev uses transient domains and this is edge condition for a transient
domain, rather than returning good status and allocation == physical when
this "window of opportunity" exists, this patch will check for a transient
(or non persistent) domain and return a failure to the caller rather than
returning the defaults. For a persistent domain, the defaults will be
returned. The description for the virDomainGetBlockInfo has been updated
to describe the phenomena.
include/libvirt/libvirt.h.in
src/libvirt.c
src/qemu/qemu_driver.c