mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 12:23:53 -06:00
Do not use dprintf
dprintf is already claimed by POSIX[1], and on at least one system is implemented as a macro [1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html Signed-off-by: malc <av1474@comtv.ru>
This commit is contained in:
parent
bc4347b883
commit
d0f2c4c602
14 changed files with 204 additions and 204 deletions
|
@ -22,10 +22,10 @@
|
|||
//#define DEBUG_MIGRATION_UNIX
|
||||
|
||||
#ifdef DEBUG_MIGRATION_UNIX
|
||||
#define dprintf(fmt, ...) \
|
||||
#define DPRINTF(fmt, ...) \
|
||||
do { printf("migration-unix: " fmt, ## __VA_ARGS__); } while (0)
|
||||
#else
|
||||
#define dprintf(fmt, ...) \
|
||||
#define DPRINTF(fmt, ...) \
|
||||
do { } while (0)
|
||||
#endif
|
||||
|
||||
|
@ -41,7 +41,7 @@ static int unix_write(FdMigrationState *s, const void * buf, size_t size)
|
|||
|
||||
static int unix_close(FdMigrationState *s)
|
||||
{
|
||||
dprintf("unix_close\n");
|
||||
DPRINTF("unix_close\n");
|
||||
if (s->fd != -1) {
|
||||
close(s->fd);
|
||||
s->fd = -1;
|
||||
|
@ -55,7 +55,7 @@ static void unix_wait_for_connect(void *opaque)
|
|||
int val, ret;
|
||||
socklen_t valsize = sizeof(val);
|
||||
|
||||
dprintf("connect completed\n");
|
||||
DPRINTF("connect completed\n");
|
||||
do {
|
||||
ret = getsockopt(s->fd, SOL_SOCKET, SO_ERROR, (void *) &val, &valsize);
|
||||
} while (ret == -1 && (s->get_error(s)) == EINTR);
|
||||
|
@ -70,7 +70,7 @@ static void unix_wait_for_connect(void *opaque)
|
|||
if (val == 0)
|
||||
migrate_fd_connect(s);
|
||||
else {
|
||||
dprintf("error connecting %d\n", val);
|
||||
DPRINTF("error connecting %d\n", val);
|
||||
migrate_fd_error(s);
|
||||
}
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
|
|||
s->bandwidth_limit = bandwidth_limit;
|
||||
s->fd = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
|
||||
if (s->fd < 0) {
|
||||
dprintf("Unable to open socket");
|
||||
DPRINTF("Unable to open socket");
|
||||
goto err_after_alloc;
|
||||
}
|
||||
|
||||
|
@ -122,7 +122,7 @@ MigrationState *unix_start_outgoing_migration(Monitor *mon,
|
|||
} while (ret == -EINTR);
|
||||
|
||||
if (ret < 0 && ret != -EINPROGRESS && ret != -EWOULDBLOCK) {
|
||||
dprintf("connect failed\n");
|
||||
DPRINTF("connect failed\n");
|
||||
goto err_after_open;
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ static void unix_accept_incoming_migration(void *opaque)
|
|||
c = qemu_accept(s, (struct sockaddr *)&addr, &addrlen);
|
||||
} while (c == -1 && socket_error() == EINTR);
|
||||
|
||||
dprintf("accepted migration\n");
|
||||
DPRINTF("accepted migration\n");
|
||||
|
||||
if (c == -1) {
|
||||
fprintf(stderr, "could not accept migration connection\n");
|
||||
|
@ -174,7 +174,7 @@ static void unix_accept_incoming_migration(void *opaque)
|
|||
goto out_fopen;
|
||||
}
|
||||
qemu_announce_self();
|
||||
dprintf("successfully loaded vm state\n");
|
||||
DPRINTF("successfully loaded vm state\n");
|
||||
|
||||
/* we've successfully migrated, close the server socket */
|
||||
qemu_set_fd_handler2(s, NULL, NULL, NULL, NULL);
|
||||
|
@ -191,7 +191,7 @@ int unix_start_incoming_migration(const char *path)
|
|||
struct sockaddr_un un;
|
||||
int sock;
|
||||
|
||||
dprintf("Attempting to start an incoming migration\n");
|
||||
DPRINTF("Attempting to start an incoming migration\n");
|
||||
|
||||
sock = qemu_socket(PF_UNIX, SOCK_STREAM, 0);
|
||||
if (sock < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue