2013-05-25 18:38:28 +00:00
|
|
|
From bd0d732bc7d23b686f13ab377f58e227c4edc707 Mon Sep 17 00:00:00 2001
|
2013-05-23 01:48:57 +00:00
|
|
|
From: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Date: Fri, 22 Feb 2013 17:36:10 +0100
|
2013-05-25 18:38:28 +00:00
|
|
|
Subject: [PATCH] migration: push qemu_savevm_state_cancel out of
|
2013-05-23 01:48:57 +00:00
|
|
|
qemu_savevm_state_*
|
|
|
|
|
|
|
|
This is useful, because it lets us keep the cancellation callbacks
|
|
|
|
inside the big lock while pushing the others out.
|
|
|
|
|
|
|
|
Reviewed-by: Orit Wasserman <owasserm@redhat.com>
|
|
|
|
Reviewed-by: Juan Quintela <quintela@redhat.com>
|
|
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Signed-off-by: Juan Quintela <quintela@redhat.com>
|
2013-05-25 18:38:28 +00:00
|
|
|
(cherry picked from commit 04943ebaa9e4f5f9ac080198a7b0d25c6d7ac444)
|
2013-05-23 01:48:57 +00:00
|
|
|
---
|
|
|
|
savevm.c | 15 ++++-----------
|
|
|
|
1 file changed, 4 insertions(+), 11 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/savevm.c b/savevm.c
|
|
|
|
index a8a53ef..4302903 100644
|
|
|
|
--- a/savevm.c
|
|
|
|
+++ b/savevm.c
|
|
|
|
@@ -1621,17 +1621,11 @@ int qemu_savevm_state_begin(QEMUFile *f,
|
|
|
|
|
|
|
|
ret = se->ops->save_live_setup(f, se->opaque);
|
|
|
|
if (ret < 0) {
|
|
|
|
- qemu_savevm_state_cancel();
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ret = qemu_file_get_error(f);
|
|
|
|
- if (ret != 0) {
|
|
|
|
- qemu_savevm_state_cancel();
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
return ret;
|
|
|
|
-
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
@@ -1677,9 +1671,6 @@ int qemu_savevm_state_iterate(QEMUFile *f)
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
ret = qemu_file_get_error(f);
|
|
|
|
- if (ret != 0) {
|
|
|
|
- qemu_savevm_state_cancel();
|
|
|
|
- }
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -1778,8 +1769,7 @@ static int qemu_savevm_state(QEMUFile *f)
|
|
|
|
};
|
|
|
|
|
|
|
|
if (qemu_savevm_state_blocked(NULL)) {
|
|
|
|
- ret = -EINVAL;
|
|
|
|
- goto out;
|
|
|
|
+ return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = qemu_savevm_state_begin(f, ¶ms);
|
|
|
|
@@ -1798,6 +1788,9 @@ out:
|
|
|
|
if (ret == 0) {
|
|
|
|
ret = qemu_file_get_error(f);
|
|
|
|
}
|
|
|
|
+ if (ret != 0) {
|
|
|
|
+ qemu_savevm_state_cancel();
|
|
|
|
+ }
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|