]> Git Repo - qemu.git/blobdiff - migration-tcp.c
memory: Fix old portio word accesses
[qemu.git] / migration-tcp.c
index b55f419b654f51de8309db59c43020194f632460..c431e03a48a729c05da3a6f0e1df0ab388634b1c 100644 (file)
@@ -15,7 +15,6 @@
 #include "qemu_socket.h"
 #include "migration.h"
 #include "qemu-char.h"
-#include "sysemu.h"
 #include "buffered_file.h"
 #include "block.h"
 
@@ -90,7 +89,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon,
     if (parse_host_port(&addr, host_port) < 0)
         return NULL;
 
-    s = qemu_mallocz(sizeof(*s));
+    s = g_malloc0(sizeof(*s));
 
     s->get_error = socket_errno;
     s->write = socket_write;
@@ -107,7 +106,7 @@ MigrationState *tcp_start_outgoing_migration(Monitor *mon,
     s->bandwidth_limit = bandwidth_limit;
     s->fd = qemu_socket(PF_INET, SOCK_STREAM, 0);
     if (s->fd == -1) {
-        qemu_free(s);
+        g_free(s);
         return NULL;
     }
 
@@ -139,7 +138,7 @@ static void tcp_accept_incoming_migration(void *opaque)
 {
     struct sockaddr_in addr;
     socklen_t addrlen = sizeof(addr);
-    int s = (unsigned long)opaque;
+    int s = (intptr_t)opaque;
     QEMUFile *f;
     int c;
 
@@ -194,7 +193,7 @@ int tcp_start_incoming_migration(const char *host_port)
         goto err;
 
     qemu_set_fd_handler2(s, NULL, tcp_accept_incoming_migration, NULL,
-                         (void *)(unsigned long)s);
+                         (void *)(intptr_t)s);
 
     return 0;
 
This page took 0.023897 seconds and 4 git commands to generate.