Start removing migration code from sysemu/sysemu.h.
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
#include "qemu/error-report.h"
#include "exec/ramlist.h"
#include "hw/intc/intc.h"
+#include "migration/snapshot.h"
#ifdef CONFIG_SPICE
#include <spice/enums.h>
vm_stop(RUN_STATE_RESTORE_VM);
- if (load_vmstate(name, &err) == 0 && saved_vm_running) {
+ if (load_snapshot(name, &err) == 0 && saved_vm_running) {
vm_start();
}
hmp_handle_error(mon, &err);
{
Error *err = NULL;
- save_vmstate(qdict_get_try_str(qdict, "name"), &err);
+ save_snapshot(qdict_get_try_str(qdict, "name"), &err);
hmp_handle_error(mon, &err);
}
int copy_on_read;
/* If we are reading a disk image, give its size in sectors.
- * Generally read-only; it is written to by load_vmstate and save_vmstate,
- * but the block layer is quiescent during those.
+ * Generally read-only; it is written to by load_snapshot and
+ * save_snaphost, but the block layer is quiescent during those.
*/
int64_t total_sectors;
--- /dev/null
+/*
+ * QEMU snapshots
+ *
+ * Copyright (c) 2004-2008 Fabrice Bellard
+ * Copyright (c) 2009-2015 Red Hat Inc
+ *
+ * Authors:
+ * Juan Quintela <quintela@redhat.com>
+ *
+ *
+ * This work is licensed under the terms of the GNU GPL, version 2 or later.
+ * See the COPYING file in the top-level directory.
+ */
+
+#ifndef QEMU_MIGRATION_SNAPSHOT_H
+#define QEMU_MIGRATION_SNAPSHOT_H
+
+int save_snapshot(const char *name, Error **errp);
+int load_snapshot(const char *name, Error **errp);
+
+#endif
void qemu_add_machine_init_done_notifier(Notifier *notify);
void qemu_remove_machine_init_done_notifier(Notifier *notify);
-int save_vmstate(const char *name, Error **errp);
-int load_vmstate(const char *name, Error **errp);
-
void qemu_announce_self(void);
extern int autostart;
#include "sysemu/sysemu.h"
#include "qemu/timer.h"
#include "migration/migration.h"
+#include "migration/snapshot.h"
#include "qemu-file-channel.h"
#include "qemu-file.h"
#include "savevm.h"
return ret;
}
-int save_vmstate(const char *name, Error **errp)
+int save_snapshot(const char *name, Error **errp)
{
BlockDriverState *bs, *bs1;
QEMUSnapshotInfo sn1, *sn = &sn1, old_sn1, *old_sn = &old_sn1;
migration_incoming_state_destroy();
}
-int load_vmstate(const char *name, Error **errp)
+int load_snapshot(const char *name, Error **errp)
{
BlockDriverState *bs, *bs_vm_state;
QEMUSnapshotInfo sn;
#include "qapi/qmp/qstring.h"
#include "qemu/error-report.h"
#include "migration/vmstate.h"
+#include "migration/snapshot.h"
static void replay_pre_save(void *opaque)
{
if (replay_snapshot) {
if (replay_mode == REPLAY_MODE_RECORD) {
- if (save_vmstate(replay_snapshot, &err) != 0) {
+ if (save_snapshot(replay_snapshot, &err) != 0) {
error_report_err(err);
error_report("Could not create snapshot for icount record");
exit(1);
}
} else if (replay_mode == REPLAY_MODE_PLAY) {
- if (load_vmstate(replay_snapshot, &err) != 0) {
+ if (load_snapshot(replay_snapshot, &err) != 0) {
error_report_err(err);
error_report("Could not load snapshot for icount replay");
exit(1);
#include "sysemu/blockdev.h"
#include "hw/block/block.h"
#include "migration/block.h"
+#include "migration/snapshot.h"
#include "sysemu/tpm.h"
#include "sysemu/dma.h"
#include "hw/audio/soundhw.h"
replay_vmstate_init();
} else if (loadvm) {
Error *local_err = NULL;
- if (load_vmstate(loadvm, &local_err) < 0) {
+ if (load_snapshot(loadvm, &local_err) < 0) {
error_report_err(local_err);
autostart = 0;
}