]> xenbits.xensource.com Git - libvirt.git/commit
libxl: handle external domain destroy
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Sat, 8 Dec 2018 02:46:00 +0000 (03:46 +0100)
committerJim Fehlig <jfehlig@suse.com>
Mon, 10 Dec 2018 21:06:06 +0000 (14:06 -0700)
commitfa30ee04a2a7205c3d664c67b88dd8df9cb1fb40
tree9693c761319c8e3853b533c3fa071c6e8d363144
parent73dfa2cf74c899ebf5bf1e226eeb2faecaea07e0
libxl: handle external domain destroy

If domain is killed with `xl destroy`, libvirt will not notice it and
still report the domain as running. Also trying to destroy the domain
through libvirt will fail. The only way to recover from such a situation
is to restart libvirt daemon. The problem is that even though libxl
report LIBXL_EVENT_TYPE_DOMAIN_DEATH, libvirt ignore it as all the
domain cleanup is done in a function actually destroying the domain. If
destroy is done outside of libvirt, there is no place where it would be
handled.

Fix this by doing domain cleanup in LIBXL_EVENT_TYPE_DOMAIN_DEATH too.
To avoid doing it twice, add a ignoreDeathEvent flag
libxlDomainObjPrivate, set when the domain death is triggered by libvirt
itself.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_domain.c
src/libxl/libxl_domain.h