Merge remote-tracking branch 'quintela/migration-pull' into staging
authorAnthony Liguori <aliguori@us.ibm.com>
Thu, 20 Oct 2011 13:46:55 +0000 (08:46 -0500)
committerAnthony Liguori <aliguori@us.ibm.com>
Thu, 20 Oct 2011 13:46:55 +0000 (08:46 -0500)
1  2 
migration.c
savevm.c

diff --cc migration.c
@@@ -375,17 -299,14 +299,14 @@@ static void migrate_fd_put_ready(void *
          int old_vm_running = runstate_is_running();
  
          DPRINTF("done iterating\n");
 -        vm_stop(RUN_STATE_FINISH_MIGRATE);
 +        vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
  
-         if ((qemu_savevm_state_complete(s->mon, s->file)) < 0) {
-             if (old_vm_running) {
-                 vm_start();
-             }
-             state = MIG_STATE_ERROR;
+         if (qemu_savevm_state_complete(s->mon, s->file) < 0) {
+             migrate_fd_error(s);
          } else {
-             state = MIG_STATE_COMPLETED;
+             migrate_fd_completed(s);
          }
-         if (migrate_fd_cleanup(s) < 0) {
+         if (s->state != MIG_STATE_COMPLETED) {
              if (old_vm_running) {
                  vm_start();
              }
diff --cc savevm.c
+++ b/savevm.c
@@@ -1619,9 -1671,13 +1667,10 @@@ static int qemu_savevm_state(Monitor *m
      ret = qemu_savevm_state_complete(mon, f);
  
  out:
-     if (qemu_file_has_error(f))
-         ret = -EIO;
+     if (ret == 0) {
+         ret = qemu_file_get_error(f);
+     }
  
 -    if (!ret && saved_vm_running)
 -        vm_start();
 -
      return ret;
  }