savevm.c: Getting closer to upstream.
This patch refactors savevm.c considerably to get much closer
to upstream. The main benefit is the introduction of savevm_register()
and savevm_unregister() functions, which allow the client to provide
a description of the state through a VMStateDescription structure.
The 'legacy' register_savevm() and unregister_savevm() are still
provided (just like upstream does). Future patches will 'upgrade'
our virtual devices to the new interface.
NOTE: Since DeviceState is not implemented properly yet, qdev_get_path()
is stubbed to always return NULL.
Change-Id: I7bfa201da40a0e470fafde6ccc002a4216ecd9c1
diff --git a/exec.c b/exec.c
index 2f44aa4..4f27734 100644
--- a/exec.c
+++ b/exec.c
@@ -569,10 +569,20 @@
cpu_list_unlock();
#endif
#if defined(CPU_SAVE_VERSION) && !defined(CONFIG_USER_ONLY)
- register_savevm("cpu_common", cpu_index, CPU_COMMON_SAVE_VERSION,
- cpu_common_save, cpu_common_load, env);
- register_savevm("cpu", cpu_index, CPU_SAVE_VERSION,
- cpu_save, cpu_load, env);
+ register_savevm(NULL,
+ "cpu_common",
+ cpu_index,
+ CPU_COMMON_SAVE_VERSION,
+ cpu_common_save,
+ cpu_common_load,
+ env);
+ register_savevm(NULL,
+ "cpu",
+ cpu_index,
+ CPU_SAVE_VERSION,
+ cpu_save,
+ cpu_load,
+ env);
#endif
}