qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 00/18] qemu-sockets error propagation and related cl


From: Paolo Bonzini
Subject: [Qemu-devel] [PATCH 00/18] qemu-sockets error propagation and related cleanups
Date: Wed, 3 Oct 2012 16:36:47 +0200

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]