From 77e8b9ca64e85d3d309f322410964b7852ec091e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 17 Feb 2014 14:43:49 +0100 Subject: nbd: correctly propagate errors Before: $ ./qemu-io-old qemu-io-old> open -r -o file.driver=nbd one of path and host must be specified. qemu-io-old: can't open device (null): Could not open image: Invalid argument $ ./qemu-io-old qemu-io-old> open -r -o file.driver=nbd,file.host=foo,file.path=bar path and host may not be used at the same time. qemu-io-old: can't open device (null): Could not open image: Invalid argument After: $ ./qemu-io qemu-io> open -r -o file.driver=nbd qemu-io: can't open device (null): one of path and host must be specified. $ ./qemu-io qemu-io> open -r -o file.driver=nbd,file.host=foo,file.path=bar qemu-io: can't open device (null): path and host may not be used at the same time. Signed-off-by: Paolo Bonzini Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- nbd.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'nbd.c') diff --git a/nbd.c b/nbd.c index 030f56b..17ca95b 100644 --- a/nbd.c +++ b/nbd.c @@ -199,18 +199,6 @@ static void combine_addr(char *buf, size_t len, const char* address, } } -int tcp_socket_outgoing_opts(QemuOpts *opts) -{ - Error *local_err = NULL; - 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; -} - int tcp_socket_incoming(const char *address, uint16_t port) { char address_and_port[128]; -- cgit v1.1