On Wed, Mar 12, 2025 at 17:17:59 +0000, Daniel P. Berrangé wrote: > The preserving of state (ie running VMs) requires a fully functional > daemon and hypervisor driver. If any part has started shutting down > then saving state may fail, or worse, hang. > > The current shutdown sequence does not guarantee safe ordering, as > we synchronize with the state saving thread only after the hypervisor > driver has had its 'shutdownPrepare' callback invoked. In the case of > QEMU this means that worker threads processing monitor events may well > have been stopped. > > This implements a full state machine that has a well defined ordering > that an earlier commit documented as the desired semantics. > > With this change, nothing will start shutting down if the state saving > thread is still running. > > Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx> > --- > src/rpc/virnetdaemon.c | 107 ++++++++++++++++++++++++++++++----------- > 1 file changed, 80 insertions(+), 27 deletions(-) Reviewed-by: Peter Krempa <pkrempa@xxxxxxxxxx>