diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-17 09:44:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-17 09:44:37 -0500 |
commit | 4a39943bd1fd2ac7e3163f9d9b056394519661f3 (patch) | |
tree | eab01e0258d2344117873952b589bac333bb0ea3 /qerror.h | |
parent | 7d834c7450245335db0a7055ccdc783ccab21935 (diff) | |
parent | 8bc27249f0f62524887ea355a6604722edd276a9 (diff) |
Merge remote branch 'markus/qerror' into staging
Diffstat (limited to 'qerror.h')
-rw-r--r-- | qerror.h | 51 |
1 files changed, 43 insertions, 8 deletions
@@ -14,6 +14,7 @@ #include "qdict.h" #include "qstring.h" +#include "qemu-error.h" #include <stdarg.h> typedef struct QErrorStringTable { @@ -24,6 +25,7 @@ typedef struct QErrorStringTable { typedef struct QError { QObject_HEAD; QDict *error; + Location loc; int linenr; const char *file; const char *func; @@ -34,21 +36,36 @@ QError *qerror_new(void); QError *qerror_from_info(const char *file, int linenr, const char *func, const char *fmt, va_list *va); QString *qerror_human(const QError *qerror); -void qerror_print(const QError *qerror); +void qerror_print(QError *qerror); QError *qobject_to_qerror(const QObject *obj); /* * QError class list */ +#define QERR_BAD_BUS_FOR_DEVICE \ + "{ 'class': 'BadBusForDevice', 'data': { 'device': %s, 'bad_bus_type': %s } }" + +#define QERR_BUS_NOT_FOUND \ + "{ 'class': 'BusNotFound', 'data': { 'bus': %s } }" + +#define QERR_BUS_NO_HOTPLUG \ + "{ 'class': 'BusNoHotplug', 'data': { 'bus': %s } }" + #define QERR_COMMAND_NOT_FOUND \ "{ 'class': 'CommandNotFound', 'data': { 'name': %s } }" #define QERR_DEVICE_ENCRYPTED \ "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }" -#define QERR_DEVICE_LOCKED \ +#define QERR_DEVICE_INIT_FAILED \ + "{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }" + +#define QERR_DEVICE_LOCKED \ "{ 'class': 'DeviceLocked', 'data': { 'device': %s } }" +#define QERR_DEVICE_MULTIPLE_BUSSES \ + "{ 'class': 'DeviceMultipleBusses', 'data': { 'device': %s } }" + #define QERR_DEVICE_NOT_ACTIVE \ "{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }" @@ -58,15 +75,15 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_DEVICE_NOT_REMOVABLE \ "{ 'class': 'DeviceNotRemovable', 'data': { 'device': %s } }" +#define QERR_DEVICE_NO_BUS \ + "{ 'class': 'DeviceNoBus', 'data': { 'device': %s } }" + #define QERR_FD_NOT_FOUND \ "{ 'class': 'FdNotFound', 'data': { 'name': %s } }" #define QERR_FD_NOT_SUPPLIED \ "{ 'class': 'FdNotSupplied', 'data': {} }" -#define QERR_OPEN_FILE_FAILED \ - "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }" - #define QERR_INVALID_BLOCK_FORMAT \ "{ 'class': 'InvalidBlockFormat', 'data': { 'name': %s } }" @@ -88,18 +105,36 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_MISSING_PARAMETER \ "{ 'class': 'MissingParameter', 'data': { 'name': %s } }" +#define QERR_NO_BUS_FOR_DEVICE \ + "{ 'class': 'NoBusForDevice', 'data': { 'device': %s, 'bus': %s } }" + +#define QERR_OPEN_FILE_FAILED \ + "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }" + +#define QERR_PROPERTY_NOT_FOUND \ + "{ 'class': 'PropertyNotFound', 'data': { 'device': %s, 'property': %s } }" + +#define QERR_PROPERTY_VALUE_BAD \ + "{ 'class': 'PropertyValueBad', 'data': { 'device': %s, 'property': %s, 'value': %s } }" + +#define QERR_PROPERTY_VALUE_IN_USE \ + "{ 'class': 'PropertyValueInUse', 'data': { 'device': %s, 'property': %s, 'value': %s } }" + +#define QERR_PROPERTY_VALUE_NOT_FOUND \ + "{ 'class': 'PropertyValueNotFound', 'data': { 'device': %s, 'property': %s, 'value': %s } }" + #define QERR_QMP_BAD_INPUT_OBJECT \ "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }" #define QERR_SET_PASSWD_FAILED \ "{ 'class': 'SetPasswdFailed', 'data': {} }" -#define QERR_UNDEFINED_ERROR \ - "{ 'class': 'UndefinedError', 'data': {} }" - #define QERR_TOO_MANY_FILES \ "{ 'class': 'TooManyFiles', 'data': {} }" +#define QERR_UNDEFINED_ERROR \ + "{ 'class': 'UndefinedError', 'data': {} }" + #define QERR_VNC_SERVER_FAILED \ "{ 'class': 'VNCServerFailed', 'data': { 'target': %s } }" |