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