On Tue, Dec 05, 2023 at 04:19:03AM -0500, tian...@smartx.com wrote: > From: Tianren Zhang <tian...@smartx.com> > > The stop process is not finished until bdrv_flush_all > is done. Some users (e.g., libvirt) detect the STOP > event and invokes some lock release logic to revoke > the disk lock held by current qemu when such event is > emitted. In such case, if the bdrv_flush_all is after > the stop event, it's possible that the disk lock is > released while the qemu is still waiting for I/O. > Therefore, it's better to have the stop event generated > after the whole stop process is done, so we can > guarantee to users that the stop process is finished > when they get the STOP event. > > Signed-off-by: Tianren Zhang <tian...@smartx.com> > --- > v2: do not call runstate_is_running twice > v3: remove irrelevant info from commit msg > --- > system/cpus.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-)
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|