Re: [Qemu-devel] [PATCH 02/20] nbd: correctly propagate errors

2014-02-10 Thread Fam Zheng
On Mon, 02/10 09:24, Paolo Bonzini wrote: > Il 10/02/2014 08:38, Fam Zheng ha scritto: > >>> if (s->client.is_unix) { > >>> -sock = unix_socket_outgoing(qemu_opt_get(s->socket_opts, > >>> "path")); > >>> +sock = unix_connect(qemu_opt_get(s->socket_opts, "path"), errp); > >Why

Re: [Qemu-devel] [PATCH 02/20] nbd: correctly propagate errors

2014-02-10 Thread Paolo Bonzini
Il 10/02/2014 08:38, Fam Zheng ha scritto: > if (s->client.is_unix) { > -sock = unix_socket_outgoing(qemu_opt_get(s->socket_opts, "path")); > +sock = unix_connect(qemu_opt_get(s->socket_opts, "path"), errp); Why not use unix_connect_opts like below? Right! > } else

Re: [Qemu-devel] [PATCH 02/20] nbd: correctly propagate errors

2014-02-09 Thread Fam Zheng
On Sun, 02/09 10:48, Paolo Bonzini wrote: > 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

[Qemu-devel] [PATCH 02/20] nbd: correctly propagate errors

2014-02-09 Thread Paolo Bonzini
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