From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJQ4l-0003rE-8o for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:37:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJQ4c-0000Cs-Q3 for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:37:27 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:39719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJQ4c-0000Cn-Jg for qemu-devel@nongnu.org; Wed, 03 Oct 2012 10:37:18 -0400 Received: by pbbrp2 with SMTP id rp2so10061642pbb.4 for ; Wed, 03 Oct 2012 07:37:17 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 3 Oct 2012 16:36:47 +0200 Message-Id: <1349275025-5093-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 00/18] qemu-sockets error propagation and related cleanups List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lcapitulino@redhat.com Luiz, here are the patches to improve the quality of qemu-sockets Error objects including the errno. In some cases there is a small regression in that the numeric address disappears, but in general the benefit very much overwhelms the disadvantages. For example: $ qemu-system-x86_64 -monitor tcp:foo.bar:12345 getaddrinfo(foo.bar,12345): Name or service not known chardev: opening backend "socket" failed $ qemu-system-x86_64 -monitor tcp:localhost:443,server=on inet_listen_opts: bind(ipv4,127.0.0.1,443): Permission denied inet_listen_opts: FAILED chardev: opening backend "socket" failed becomes: $ qemu-system-x86_64 -monitor tcp:foo.bar:12345 qemu-system-x86_64: -monitor tcp:foo.bar:12345: address resolution failed for foo.bar:12345: Name or service not known chardev: opening backend "socket" failed $ qemu-system-x86_64 -monitor tcp:localhost:443,server=on qemu-system-x86_64: -monitor tcp:localhost:443,server=on: Failed to bind socket: Permission denied chardev: opening backend "socket" failed It is possible to add back the family/host/port subsequently, and also to perfect TCP migration errors. Those patches should be small and acceptable closer to release. In addition, the patches remove some duplication in the handling of Unix sockets, with the end result that the patches remove more code than they add! Patches 1 and 2 are small preparations. Two new functions are added, error_set_errno and error_setg_errno, which take care of adding a strerror() result to error messages. Then, the new prototypes are introduced for qemu-sockets functions. Patches 3 and 4 port Orit's NonBlockingConnectHandler work to Unix sockets, which is used later for Unix socket migration. Patches 5 to 9 add proper error propagation to migration and remove migration-specific Unix socket code. Patches 10 to 13 teach the other qemu-sockets users to consume Error objects. Patches 14 to 18 then teach Error production and propagation to qemu-sockets. Paolo Bonzini (18): error: add error_set_errno and error_setg_errno qemu-sockets: add Error ** to all functions qemu-sockets: unix_listen and unix_connect are portable qemu-sockets: add nonblocking connect for Unix sockets migration: avoid using error_is_set migration: centralize call to migrate_fd_error() migration: use qemu-sockets to establish Unix sockets migration (outgoing): add error propagation for fd and exec protocols migration (incoming): add error propagation for fd and exec protocols qemu-char: ask and print error information from qemu-sockets nbd: ask and print error information from qemu-sockets qemu-ga: ask and print error information from qemu-sockets vnc: add error propagation to vnc_display_open qemu-sockets: include strerror or gai_strerror output in error messages qemu-sockets: add error propagation to inet_connect_addr qemu-sockets: add error propagation to inet_dgram_opts qemu-sockets: add error propagation to inet_parse qemu-sockets: add error propagation to Unix socket functions console.h | 2 +- error.c | 28 ++++++ error.h | 9 ++ migration-exec.c | 16 ++-- migration-fd.c | 19 ++-- migration-tcp.c | 19 +--- migration-unix.c | 95 +++----------------- migration.c | 34 +++---- migration.h | 19 ++-- nbd.c | 39 ++++++-- qemu-char.c | 24 +++-- qemu-sockets.c | 253 +++++++++++++++++++++++++++------------------------- qemu_socket.h | 14 +-- qga/channel-posix.c | 8 +- qmp.c | 6 +- ui/vnc.c | 67 +++++++------- vl.c | 21 +++-- 17 file modificati, 326 inserzioni(+), 347 rimozioni(-) -- 1.7.12.1