]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
qemu: Don't report false error from MigrateFinish
authorJiri Denemark <jdenemar@redhat.com>
Thu, 2 Jul 2015 20:32:54 +0000 (22:32 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 10 Jul 2015 09:47:13 +0000 (11:47 +0200)
commit44c42b564dc61ddc8fdfc5b6ca4ca969bcffc7d8
tree9f5a2fdf328732d2434b3799b27616bc0faf2f85
parente68f395fcbae0267368f9974cc49f582cc83c752
qemu: Don't report false error from MigrateFinish

virDomainMigrateFinish* APIs were unfortunately designed to return the
pointer to the domain on destination and NULL on error. This looks OK in
normal cases but the same API is also called when we know migration
failed and thus we expect Finish to return NULL even if it actually did
all it was supposed to do without any error. The call is defined to
return nonnull domain pointer over RPC, which means returning NULL will
always result in an error being send. If this was not in fact an error,
the API itself wouldn't set anything to the thread local virError, which
makes the RPC layer come up with it's own "Library function returned
error but did not set virError" error.

This is quite confusing and also hard to detect by the caller. This
patch adds a special error code which can be used to check that Finish
successfully aborted migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
include/libvirt/virterror.h
src/qemu/qemu_migration.c
src/util/virerror.c