Re: [libvirt] [PATCH] qemu: fix crash in qemuProcessAutoDestroy

2015-03-29 Thread Michael Chapman
On Fri, 27 Mar 2015, Michael Chapman wrote: The destination libvirt daemon in a migration may segfault if the client disconnects immediately after the migration has begun: # virsh -c qemu+tls://remote/system list --all IdName State

[libvirt] [PATCH 2/4] qemu: fix error propagation in qemuMigrationBegin

2015-03-29 Thread Michael Chapman
If virCloseCallbacksSet fails, qemuMigrationBegin must return NULL to indicate an error occurred. Signed-off-by: Michael Chapman m...@very.puzzling.org --- src/qemu/qemu_migration.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_migration.c

[libvirt] [PATCH 1/4] qemu: fix crash in qemuProcessAutoDestroy

2015-03-29 Thread Michael Chapman
The destination libvirt daemon in a migration may segfault if the client disconnects immediately after the migration has begun: # virsh -c qemu+tls://remote/system list --all IdName State ... # timeout

[libvirt] [PATCH 3/4] qemu: fix race between disk mirror fail and cancel

2015-03-29 Thread Michael Chapman
If a VM migration is aborted, a disk mirror may be failed by QEMU before libvirt has a chance to cancel it. The disk-mirrorState remains at _ABORT in this case, and this breaks subsequent mirrorings of that disk. We should instead check the mirrorState directly and transition to _NONE if it is

[libvirt] [PATCH 4/4] util: fix removal of callbacks in virCloseCallbacksRun

2015-03-29 Thread Michael Chapman
The close callbacks hash are keyed by a UUID-string, but virCloseCallbacksRun was attempting to remove them by raw UUID. This patch ensures the callback entries are removed by UUID-string as well. This bug could cause problems when guest migrations were abnormally aborted: # timeout --signal

[libvirt] [PATCH 0/4] Various bugfixes for cancelled VM migrations

2015-03-29 Thread Michael Chapman
This patch series contains fixes for several bugs I encountered while deliberately forcing a VM migration to abort by killing the libvirt client. My VM has storage on local disk, which needs to be mirrored during the migration, and this gives ample time for this abort to take place. The

Re: [libvirt] [PATCH] build: avoid variable named 'interface', for mingw

2015-03-29 Thread Laine Stump
On 03/28/2015 04:26 PM, Eric Blake wrote: Commit 2f36e6944 (re-)introduced a use of an identifier 'interface', which causes this build failure on mingw: ../../tools/virsh-domain-monitor.c: In function 'cmdDomIfAddr': ../../tools/virsh-domain-monitor.c:2233:17: error: expected identifier or

[libvirt] [RFC] Add uptime to API returning Dom Info

2015-03-29 Thread Nehal J Wani
This is an attempt to fix: https://bugzilla.redhat.com/show_bug.cgi?id=812911 Calculate vm uptime by subtracting process starttime from system uptime: Almost equivalent to: echo $(($(($(awk '{print $1}' /proc/uptime)*1e9 - $(($(cut -d -f22 /proc/$PID/stat)*1e7/(1.0 * 1e9))) ---