Diff for /qemu/migration-tcp.c between versions 1.1.1.1 and 1.1.1.2

version 1.1.1.1, 2018/04/24 16:50:15 version 1.1.1.2, 2018/04/24 17:20:15
Line 16 Line 16
 #include "migration.h"  #include "migration.h"
 #include "qemu-char.h"  #include "qemu-char.h"
 #include "sysemu.h"  #include "sysemu.h"
 #include "console.h"  
 #include "buffered_file.h"  #include "buffered_file.h"
 #include "block.h"  #include "block.h"
   
Line 59  static void tcp_wait_for_connect(void *o Line 58  static void tcp_wait_for_connect(void *o
   
     dprintf("connect completed\n");      dprintf("connect completed\n");
     do {      do {
         ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, &val, &valsize);          ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize);
     } while (ret == -1 && (s->get_error(s)) == EINTR);      } while (ret == -1 && (s->get_error(s)) == EINTR);
   
     if (ret < 0) {      if (ret < 0) {
Line 79  static void tcp_wait_for_connect(void *o Line 78  static void tcp_wait_for_connect(void *o
   
 MigrationState *tcp_start_outgoing_migration(const char *host_port,  MigrationState *tcp_start_outgoing_migration(const char *host_port,
                                              int64_t bandwidth_limit,                                               int64_t bandwidth_limit,
                                              int async)                                               int detach)
 {  {
     struct sockaddr_in addr;      struct sockaddr_in addr;
     FdMigrationState *s;      FdMigrationState *s;
Line 98  MigrationState *tcp_start_outgoing_migra Line 97  MigrationState *tcp_start_outgoing_migra
     s->mig_state.release = migrate_fd_release;      s->mig_state.release = migrate_fd_release;
   
     s->state = MIG_STATE_ACTIVE;      s->state = MIG_STATE_ACTIVE;
     s->detach = !async;      s->mon_resume = NULL;
     s->bandwidth_limit = bandwidth_limit;      s->bandwidth_limit = bandwidth_limit;
     s->fd = socket(PF_INET, SOCK_STREAM, 0);      s->fd = socket(PF_INET, SOCK_STREAM, 0);
     if (s->fd == -1) {      if (s->fd == -1) {
Line 108  MigrationState *tcp_start_outgoing_migra Line 107  MigrationState *tcp_start_outgoing_migra
   
     socket_set_nonblock(s->fd);      socket_set_nonblock(s->fd);
   
     if (s->detach == 1) {      if (!detach)
         dprintf("detaching from monitor\n");          migrate_fd_monitor_suspend(s);
         monitor_suspend();  
         s->detach = 2;  
     }  
   
     do {      do {
         ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr));          ret = connect(s->fd, (struct sockaddr *)&addr, sizeof(addr));
Line 159  static void tcp_accept_incoming_migratio Line 155  static void tcp_accept_incoming_migratio
         goto out;          goto out;
     }      }
   
     vm_stop(0); /* just in case */  
     ret = qemu_loadvm_state(f);      ret = qemu_loadvm_state(f);
     if (ret < 0) {      if (ret < 0) {
         fprintf(stderr, "load of migration failed\n");          fprintf(stderr, "load of migration failed\n");
Line 171  static void tcp_accept_incoming_migratio Line 166  static void tcp_accept_incoming_migratio
     /* we've successfully migrated, close the server socket */      /* we've successfully migrated, close the server socket */
     qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);      qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
     close(s);      close(s);
       if (autostart)
     vm_start();          vm_start();
   
 out_fopen:  out_fopen:
     qemu_fclose(f);      qemu_fclose(f);

Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.2


unix.superglobalmegacorp.com