]> xenbits.xensource.com Git - libvirt.git/commit
libxl: rework setting the state of virDomainObj
authorJim Fehlig <jfehlig@suse.com>
Tue, 7 Jul 2015 18:29:24 +0000 (12:29 -0600)
committerJim Fehlig <jfehlig@suse.com>
Wed, 8 Jul 2015 21:24:48 +0000 (15:24 -0600)
commite9c2734441af0065c69fc1317965a6dd6c7f14e3
tree73edbdce0b224a1fbfe29dcc09addb21a6a9c84d
parent45697fe545841af46c95c996439ed59ca3a7ef9d
libxl: rework setting the state of virDomainObj

Set the state of virDomainObj in the functions that
actually change the domain state, instead of the generic
libxlDomainCleanup function. This approach gives functions
calling libxlDomainCleanup more flexibility wrt when and
how they change virDomainObj state via virDomainObjSetState.

The prior approach of calling virDomainObjSetState in
libxlDomainCleanup resulted in the following incorrect
coding pattern in the various functions that change
domain state

 libxlDomain<DoStateTransition>
   call libxl function to do state transition
   emit lifecycle event
   libxlDomainCleanup
     virDomainObjSetState

Once simple manifestation of this bug is seeing a domain
running in virt-manager after selecting the shutdown button,
even after the domain has long shutdown.
src/libxl/libxl_domain.c
src/libxl/libxl_domain.h
src/libxl/libxl_driver.c
src/libxl/libxl_migration.c