]>
git.proxmox.com Git - qemu.git/blob - qerror.h
c9fcf973f3bcc028f3362104dcb703eb093c3457
4 * Copyright (C) 2009 Red Hat Inc.
7 * Luiz Capitulino <lcapitulino@redhat.com>
9 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
10 * See the COPYING.LIB file in the top-level directory.
18 typedef struct QErrorStringTable
{
20 const char *error_fmt
;
23 typedef struct QError
{
29 const QErrorStringTable
*entry
;
32 QError
*qerror_new(void);
33 QError
*qerror_from_info(const char *file
, int linenr
, const char *func
,
34 const char *fmt
, va_list *va
);
35 void qerror_print(const QError
*qerror
);
36 QError
*qobject_to_qerror(const QObject
*obj
);
41 #define QERR_COMMAND_NOT_FOUND \
42 "{ 'class': 'CommandNotFound', 'data': { 'name': %s } }"
44 #define QERR_DEVICE_ENCRYPTED \
45 "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }"
47 #define QERR_DEVICE_NOT_FOUND \
48 "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }"
50 #define QERR_DEVICE_NOT_ACTIVE \
51 "{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }"
53 #define QERR_INVALID_PARAMETER_TYPE \
54 "{ 'class': 'InvalidParameterType', 'data': { 'name': %s,'expected': %s } }"
56 #define QERR_INVALID_PASSWORD \
57 "{ 'class': 'InvalidPassword', 'data': {} }"
59 #define QERR_KVM_MISSING_CAP \
60 "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }"
62 #define QERR_MISSING_PARAMETER \
63 "{ 'class': 'MissingParameter', 'data': { 'name': %s } }"
65 #define QERR_QMP_BAD_INPUT_OBJECT \
66 "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }"
68 #define QERR_JSON_PARSING \
69 "{ 'class': 'JSONParsing', 'data': {} }"
71 #define QERR_UNDEFINED_ERROR \
72 "{ 'class': 'UndefinedError', 'data': {} }"