qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 02/14] qerror: add new errors
Date: Thu, 31 May 2012 12:42:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Il 30/05/2012 16:14, Luiz Capitulino ha scritto:
> New errors for write() and open() failures. Will be used by the
> next commits.

Ouch.  We have already these errors:

#define QERR_OPEN_FILE_FAILED \
    "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }"

#define QERR_SOCKET_CONNECT_FAILED \
    "{ 'class': 'SockConnectFailed', 'data': {} }"

#define QERR_SOCKET_LISTEN_FAILED \
    "{ 'class': 'SockListenFailed', 'data': {} }"

#define QERR_SOCKET_BIND_FAILED \
    "{ 'class': 'SockBindFailed', 'data': {} }"

#define QERR_SOCKET_CREATE_FAILED \
    "{ 'class': 'SockCreateFailed', 'data': {} }"


So let's just add QERR_FILE_WRITE_FAILED.

What about errno values?  Let's add an enum QemuErrno and convert host
errnos to that enum.  Enums are sent as strings, so they are neutral to
the OS of the host and client.  And the client (if it desires) can
convert back to an errno value and use strerror to provide a
human-readable, easily internationalizable error message.

Errors are not QAPI-ized yet, so we can add errno values to the above
five errors too.

What more can you ask for?

Paolo



reply via email to

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