Patchwork [6/9] migration: close socket QEMUFile from socket_close

login
register
mail settings
Submitter Paolo Bonzini
Date Sept. 21, 2012, 5:05 p.m.
Message ID <1348247106-27936-7-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/185853/
State New
Headers show

Comments

Paolo Bonzini - Sept. 21, 2012, 5:05 p.m.
The common suffix now is process_incoming_migration+qemu_fclose.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 migration-tcp.c  | 2 ++
 migration-unix.c | 2 ++
 savevm.c         | 1 +
 3 file modificati, 5 inserzioni(+)

Patch

diff --git a/migration-tcp.c b/migration-tcp.c
index 3436e84..58d6884 100644
--- a/migration-tcp.c
+++ b/migration-tcp.c
@@ -133,6 +133,8 @@  static void tcp_accept_incoming_migration(void *opaque)
 
     process_incoming_migration(f);
     qemu_fclose(f);
+    return;
+
 out:
     close(c);
 }
diff --git a/migration-unix.c b/migration-unix.c
index a407af2..57aca11 100644
--- a/migration-unix.c
+++ b/migration-unix.c
@@ -147,6 +147,8 @@  static void unix_accept_incoming_migration(void *opaque)
 
     process_incoming_migration(f);
     qemu_fclose(f);
+    return;
+
 out:
     close(c);
 }
diff --git a/savevm.c b/savevm.c
index 040068d..949c38c 100644
--- a/savevm.c
+++ b/savevm.c
@@ -212,6 +212,7 @@  static int socket_get_buffer(void *opaque, uint8_t *buf, int64_t pos, int size)
 static int socket_close(void *opaque)
 {
     QEMUFileSocket *s = opaque;
+    close(s->fd);
     g_free(s);
     return 0;
 }