#include "qemu_socket.h"
#include "migration.h"
#include "qemu-char.h"
-#include "sysemu.h"
#include "buffered_file.h"
#include "block.h"
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;
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;
}
{
struct sockaddr_in addr;
socklen_t addrlen = sizeof(addr);
- int s = (unsigned long)opaque;
+ int s = (intptr_t)opaque;
QEMUFile *f;
int c;
goto err;
qemu_set_fd_handler2(s, NULL, tcp_accept_incoming_migration, NULL,
- (void *)(unsigned long)s);
+ (void *)(intptr_t)s);
return 0;