]> Git Repo - qemu.git/commitdiff
migration: Split registration functions from vmstate.h
authorJuan Quintela <[email protected]>
Mon, 24 Apr 2017 11:42:55 +0000 (13:42 +0200)
committerJuan Quintela <[email protected]>
Tue, 13 Jun 2017 09:00:44 +0000 (11:00 +0200)
They are indpendent, and nowadays almost every device register things
with qdev->vmsd.

Signed-off-by: Juan Quintela <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Peter Xu <[email protected]>
hw/net/vmxnet3.c
hw/ppc/spapr.c
hw/s390x/s390-skeys.c
hw/s390x/s390-virtio-ccw.c
include/migration/register.h [new file with mode: 0644]
include/migration/vmstate.h
migration/block.c
migration/ram.c
migration/savevm.c
slirp/slirp.c

index 4df31101ec9914e16b720575976b035a6672b58f..a19a7a31dd1680d5090a34908caac0dc8dac6537 100644 (file)
@@ -26,6 +26,7 @@
 #include "qemu/bswap.h"
 #include "hw/pci/msix.h"
 #include "hw/pci/msi.h"
+#include "migration/register.h"
 
 #include "vmxnet3.h"
 #include "vmxnet_debug.h"
index 91b405793393fb7c5940139f43f5506eaf0eae4d..bf2178f11ebf26b03a4bdaa44243077c559fefbb 100644 (file)
@@ -39,6 +39,7 @@
 #include "sysemu/hw_accel.h"
 #include "kvm_ppc.h"
 #include "migration/migration.h"
+#include "migration/register.h"
 #include "mmu-hash64.h"
 #include "mmu-book3s-v3.h"
 #include "qom/cpu.h"
index 35e7f6316f19291ceefa12ce02c46d78b60697ad..c0de3b0c35a19cb11a0f747a054771ba18767c33 100644 (file)
@@ -15,6 +15,7 @@
 #include "hw/s390x/storage-keys.h"
 #include "qemu/error-report.h"
 #include "sysemu/kvm.h"
+#include "migration/register.h"
 
 #define S390_SKEYS_BUFFER_SIZE 131072  /* Room for 128k storage keys */
 #define S390_SKEYS_SAVE_FLAG_EOS 0x01
index a806345276493162b0dcde671422bac9cf5cd277..41ca6668e2a453797478ee19e9603d2409a98d1b 100644 (file)
@@ -28,6 +28,7 @@
 #include "ipl.h"
 #include "hw/s390x/s390-virtio-ccw.h"
 #include "hw/s390x/css-bridge.h"
+#include "migration/register.h"
 
 static const char *const reset_dev_types[] = {
     TYPE_VIRTUAL_CSS_BRIDGE,
diff --git a/include/migration/register.h b/include/migration/register.h
new file mode 100644 (file)
index 0000000..717c617
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * QEMU migration vmstate registration
+ *
+ * Copyright IBM, Corp. 2008
+ *
+ * Authors:
+ *  Anthony Liguori   <[email protected]>
+ *
+ * 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
index ee91dff0a1124f3f8f477bffbb9003aa4db608df..9ad4ba1a9b4ab5ab49cea0b5860d4f947b21fdaa 100644 (file)
 
 #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;
index 114cedbfd0d04754c4d7ff8cff94aebdb9d4e31e..223ecaa20fe0aeed935e5dfbacb72be1721488b1 100644 (file)
@@ -26,6 +26,7 @@
 #include "block.h"
 #include "migration/misc.h"
 #include "migration/migration.h"
+#include "migration/register.h"
 #include "sysemu/blockdev.h"
 #include "qemu-file.h"
 #include "migration/vmstate.h"
index 9ffd0a547964365e76794ceb9d6d29dcea8a2c52..d8b6713c4ad99199a516c53eefded6a3f04e5d75 100644 (file)
@@ -38,6 +38,7 @@
 #include "xbzrle.h"
 #include "ram.h"
 #include "migration/migration.h"
+#include "migration/register.h"
 #include "migration/misc.h"
 #include "qemu-file.h"
 #include "migration/vmstate.h"
index cc8e4e10fe92c99cc48ba8da9d81c970c713e31d..59419ebb1d5a6f6af238f22a32009e44ce02b20a 100644 (file)
@@ -37,6 +37,7 @@
 #include "migration/migration.h"
 #include "migration/snapshot.h"
 #include "migration/misc.h"
+#include "migration/register.h"
 #include "ram.h"
 #include "qemu-file-channel.h"
 #include "qemu-file.h"
index 23864938f7adfe6e0e240a35d03752921226f29e..1d6756821c0ded5ec18b4a52f99f89273b08e78d 100644 (file)
@@ -26,6 +26,7 @@
 #include "qemu/timer.h"
 #include "qemu/error-report.h"
 #include "chardev/char-fe.h"
+#include "migration/register.h"
 #include "slirp.h"
 #include "hw/hw.h"
 #include "qemu/cutils.h"
This page took 0.043646 seconds and 4 git commands to generate.