summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJuan Quintela2017-04-24 13:42:55 +0200
committerJuan Quintela2017-06-13 11:00:44 +0200
commitf2a8f0a6314cad6b1d5b4ac03b71bf7ebebff733 (patch)
treebfdd952e9625505c963efb972eaf5a365e7cbbd9 /include
parentmigration: Move self_announce_delay() to misc.h (diff)
downloadqemu-f2a8f0a6314cad6b1d5b4ac03b71bf7ebebff733.tar.gz
qemu-f2a8f0a6314cad6b1d5b4ac03b71bf7ebebff733.tar.xz
qemu-f2a8f0a6314cad6b1d5b4ac03b71bf7ebebff733.zip
migration: Split registration functions from vmstate.h
They are indpendent, and nowadays almost every device register things with qdev->vmsd. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/migration/register.h56
-rw-r--r--include/migration/vmstate.h38
2 files changed, 56 insertions, 38 deletions
diff --git a/include/migration/register.h b/include/migration/register.h
new file mode 100644
index 0000000000..717c6175b5
--- /dev/null
+++ b/include/migration/register.h
@@ -0,0 +1,56 @@
+/*
+ * QEMU migration vmstate registration
+ *
+ * Copyright IBM, Corp. 2008
+ *
+ * Authors:
+ * Anthony Liguori <aliguori@us.ibm.com>
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2. See
+ * the COPYING file in the top-level directory.
+ *
+ */
+
+#ifndef MIGRATION_REGISTER_H
+#define MIGRATION_REGISTER_H
+
+typedef void SaveStateHandler(QEMUFile *f, void *opaque);
+typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
+
+typedef struct SaveVMHandlers {
+ /* This runs inside the iothread lock. */
+ SaveStateHandler *save_state;
+
+ void (*cleanup)(void *opaque);
+ int (*save_live_complete_postcopy)(QEMUFile *f, void *opaque);
+ int (*save_live_complete_precopy)(QEMUFile *f, void *opaque);
+
+ /* This runs both outside and inside the iothread lock. */
+ bool (*is_active)(void *opaque);
+
+ /* This runs outside the iothread lock in the migration case, and
+ * within the lock in the savevm case. The callback had better only
+ * use data that is local to the migration thread or protected
+ * by other locks.
+ */
+ int (*save_live_iterate)(QEMUFile *f, void *opaque);
+
+ /* This runs outside the iothread lock! */
+ int (*save_live_setup)(QEMUFile *f, void *opaque);
+ void (*save_live_pending)(QEMUFile *f, void *opaque,
+ uint64_t threshold_size,
+ uint64_t *non_postcopiable_pending,
+ uint64_t *postcopiable_pending);
+ LoadStateHandler *load_state;
+} SaveVMHandlers;
+
+int register_savevm_live(DeviceState *dev,
+ const char *idstr,
+ int instance_id,
+ int version_id,
+ SaveVMHandlers *ops,
+ void *opaque);
+
+void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque);
+
+#endif
diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index ee91dff0a1..9ad4ba1a9b 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -29,45 +29,7 @@
#include "migration/qjson.h"
-typedef void SaveStateHandler(QEMUFile *f, void *opaque);
typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id);
-
-typedef struct SaveVMHandlers {
- /* This runs inside the iothread lock. */
- SaveStateHandler *save_state;
-
- void (*cleanup)(void *opaque);
- int (*save_live_complete_postcopy)(QEMUFile *f, void *opaque);
- int (*save_live_complete_precopy)(QEMUFile *f, void *opaque);
-
- /* This runs both outside and inside the iothread lock. */
- bool (*is_active)(void *opaque);
-
- /* This runs outside the iothread lock in the migration case, and
- * within the lock in the savevm case. The callback had better only
- * use data that is local to the migration thread or protected
- * by other locks.
- */
- int (*save_live_iterate)(QEMUFile *f, void *opaque);
-
- /* This runs outside the iothread lock! */
- int (*save_live_setup)(QEMUFile *f, void *opaque);
- void (*save_live_pending)(QEMUFile *f, void *opaque,
- uint64_t threshold_size,
- uint64_t *non_postcopiable_pending,
- uint64_t *postcopiable_pending);
- LoadStateHandler *load_state;
-} SaveVMHandlers;
-
-int register_savevm_live(DeviceState *dev,
- const char *idstr,
- int instance_id,
- int version_id,
- SaveVMHandlers *ops,
- void *opaque);
-
-void unregister_savevm(DeviceState *dev, const char *idstr, void *opaque);
-
typedef struct VMStateInfo VMStateInfo;
typedef struct VMStateDescription VMStateDescription;
typedef struct VMStateField VMStateField;