All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 00/18] qemu-sockets error propagation and related cleanups
@ 2012-10-03 14:36 Paolo Bonzini
  2012-10-03 14:36 ` [Qemu-devel] [PATCH 01/18] error: add error_set_errno and error_setg_errno Paolo Bonzini
                   ` (17 more replies)
  0 siblings, 18 replies; 56+ messages in thread
From: Paolo Bonzini @ 2012-10-03 14:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: lcapitulino

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

^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2012-10-17 13:22 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-03 14:36 [Qemu-devel] [PATCH 00/18] qemu-sockets error propagation and related cleanups Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 01/18] error: add error_set_errno and error_setg_errno Paolo Bonzini
2012-10-04 16:14   ` Luiz Capitulino
2012-10-04 16:16     ` Paolo Bonzini
2012-10-04 16:21       ` Luiz Capitulino
2012-10-17 12:47         ` Markus Armbruster
2012-10-17 12:56   ` Markus Armbruster
2012-10-17 13:03     ` Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 02/18] qemu-sockets: add Error ** to all functions Paolo Bonzini
2012-10-04 16:19   ` Luiz Capitulino
2012-10-04 16:39     ` Paolo Bonzini
2012-10-04 16:41       ` Luiz Capitulino
2012-10-17 13:10       ` Markus Armbruster
2012-10-03 14:36 ` [Qemu-devel] [PATCH 03/18] qemu-sockets: unix_listen and unix_connect are portable Paolo Bonzini
2012-10-04 16:38   ` Luiz Capitulino
2012-10-17 13:17   ` Markus Armbruster
2012-10-17 13:21     ` Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 04/18] qemu-sockets: add nonblocking connect for Unix sockets Paolo Bonzini
2012-10-04 17:38   ` Luiz Capitulino
2012-10-05  8:57     ` Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 05/18] migration: avoid using error_is_set Paolo Bonzini
2012-10-04 18:06   ` Luiz Capitulino
2012-10-05  6:23     ` Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 06/18] migration: centralize call to migrate_fd_error() Paolo Bonzini
2012-10-04 18:11   ` Luiz Capitulino
2012-10-03 14:36 ` [Qemu-devel] [PATCH 07/18] migration: use qemu-sockets to establish Unix sockets Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 08/18] migration (outgoing): add error propagation for fd and exec protocols Paolo Bonzini
2012-10-04 18:24   ` Luiz Capitulino
2012-10-05  6:25     ` Paolo Bonzini
2012-10-05 12:41       ` Luiz Capitulino
2012-10-05 12:44         ` Paolo Bonzini
2012-10-03 14:36 ` [Qemu-devel] [PATCH 09/18] migration (incoming): " Paolo Bonzini
2012-10-04 19:10   ` Luiz Capitulino
2012-10-03 14:36 ` [Qemu-devel] [PATCH 10/18] qemu-char: ask and print error information from qemu-sockets Paolo Bonzini
2012-10-04 19:16   ` Luiz Capitulino
2012-10-03 14:36 ` [Qemu-devel] [PATCH 11/18] nbd: " Paolo Bonzini
2012-10-04 20:08   ` Luiz Capitulino
2012-10-05  6:27     ` Paolo Bonzini
2012-10-05 12:42       ` Luiz Capitulino
2012-10-03 14:36 ` [Qemu-devel] [PATCH 12/18] qemu-ga: " Paolo Bonzini
2012-10-04 20:21   ` Luiz Capitulino
2012-10-03 14:37 ` [Qemu-devel] [PATCH 13/18] vnc: add error propagation to vnc_display_open Paolo Bonzini
2012-10-04 20:29   ` Luiz Capitulino
2012-10-05  6:28     ` Paolo Bonzini
2012-10-05  6:29       ` Paolo Bonzini
2012-10-03 14:37 ` [Qemu-devel] [PATCH 14/18] qemu-sockets: include strerror or gai_strerror output in error messages Paolo Bonzini
2012-10-09 14:50   ` Luiz Capitulino
2012-10-03 14:37 ` [Qemu-devel] [PATCH 15/18] qemu-sockets: add error propagation to inet_connect_addr Paolo Bonzini
2012-10-09 14:58   ` Luiz Capitulino
2012-10-09 15:02     ` Paolo Bonzini
2012-10-09 17:28       ` Luiz Capitulino
2012-10-03 14:37 ` [Qemu-devel] [PATCH 16/18] qemu-sockets: add error propagation to inet_dgram_opts Paolo Bonzini
2012-10-09 17:30   ` Luiz Capitulino
2012-10-03 14:37 ` [Qemu-devel] [PATCH 17/18] qemu-sockets: add error propagation to inet_parse Paolo Bonzini
2012-10-03 14:37 ` [Qemu-devel] [PATCH 18/18] qemu-sockets: add error propagation to Unix socket functions Paolo Bonzini
2012-10-09 17:33   ` Luiz Capitulino

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.