]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemuProcessHandleBlockJob: Set disk->mirrorState more often
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 10 Feb 2015 14:32:59 +0000 (15:32 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 19 Feb 2015 13:12:38 +0000 (14:12 +0100)
commitc37943a0687a8fdb08e6eda8ae4b9f4f43f4f2ed
tree77a1d72a340cf5981639e929449c13810833f394
parent0df2f0404fdc87691c940565e42fbde83ce71679
qemuProcessHandleBlockJob: Set disk->mirrorState more often

Currently, upon BLOCK_JOB_* event, disk->mirrorState is not updated
each time. The callback code handling the events checks if a blockjob
was started via our public APIs prior to setting the mirrorState.
However, some block jobs may be started internally (e.g. during
storage migration), in which case we don't bother with setting
disk->mirror (there's nothing we can set it to anyway), or other
fields. But it will come handy if we update the mirrorState in these
cases too. The event wasn't delivered just for fun - we've started the
job after all.

So, in this commit, the mirrorState is set to whatever job status
we've obtained. Of course, there are some actions on some statuses
that we want to perform. But instead of if {} else if {} else {} ...
enumeration, let's move to switch().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
src/qemu/qemu_process.c