]> git.proxmox.com Git - qemu.git/blobdiff - nbd.c
VMXNET3: initialize rx_ridx to eliminate compile warning
[qemu.git] / nbd.c
diff --git a/nbd.c b/nbd.c
index 0698a023add158d36c9a0935848700790b05217b..d1a67eeaf4a5a00dcdffc39837fa9d266b24d1ae 100644 (file)
--- a/nbd.c
+++ b/nbd.c
@@ -199,22 +199,15 @@ static void combine_addr(char *buf, size_t len, const char* address,
     }
 }
 
-int tcp_socket_outgoing(const char *address, uint16_t port)
-{
-    char address_and_port[128];
-    combine_addr(address_and_port, 128, address, port);
-    return tcp_socket_outgoing_spec(address_and_port);
-}
-
-int tcp_socket_outgoing_spec(const char *address_and_port)
+int tcp_socket_outgoing_opts(QemuOpts *opts)
 {
     Error *local_err = NULL;
-    int fd = inet_connect(address_and_port, &local_err);
-
+    int fd = inet_connect_opts(opts, &local_err, NULL, NULL);
     if (local_err != NULL) {
         qerror_report_err(local_err);
         error_free(local_err);
     }
+
     return fd;
 }