Paolo Bonzini <pbonz...@redhat.com> writes: > On 02/08/19 15:16, Markus Armbruster wrote: >> * VMChangeStateEntry and the three functions using it, obviously, along >> with VMChangeStateHandler. >> >> * vm_state_notify(), because it belongs to the above. >> >> * The runstate_FOO() functions, because they're named like the new >> header? >> >> * vm_stop(), vm_stop_force_state(), vmstop_requested(), >> vmstop_requested, because they use RunState? >> >> * The remaining vm_FOO(), because they're closely related to vm_stop()? >> >> * Everything else from qemu_exit_preconfig_request() to >> qemu_remove_exit_notifier(), along with WakeupReason? > > Yes, that could be an idea, but not qemu_add/remove_exit_notifier.
I did this in v2 this instead of creating sysemu/vmstate-notify.h. Reminder: * PATCH 27 "sysemu: Move the VMChangeStateEntry typedef to qemu/typedefs.h" makes the subsequent patches more effective: it saves ~800 dependencies on whatever header defines the typedef. * PATCH 28 "Include sysemu/sysemu.h a lot less" succeeds almost entirely due to not including it from hw/qdev-core.h. Damage done by recent commit e965ffa70a "qdev: add qdev_add_vm_change_state_handler()". The stupidest way to undo that damage would be moving qdev_add_vm_change_state_handler() to sysemu/sysemu.h. I chose to move it to new sysemu/vmstate-notify.h along with its buddies from sysemu/sysemu.h. The dependency improvement is negligible, just because it makes sysemu/sysemu.h less of a dumping ground. For v2, I flipped PATCH 28 to the stupidest way, and put it *before* PATCH 27. I split off sysemu/runstate.h only in PATCH 29. I hope that way the benefit of each change is more obvious.