]>
git.proxmox.com Git - mirror_qemu.git/blob - qerror.h
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.
17 #include "qemu-error.h"
19 #include "qapi-types.h"
22 typedef struct QError
{
30 QString
*qerror_human(const QError
*qerror
);
31 void qerror_report(ErrorClass err_class
, const char *fmt
, ...) GCC_FMT_ATTR(2, 3);
32 void qerror_report_err(Error
*err
);
33 void assert_no_error(Error
*err
);
37 * Please keep the definitions in alphabetical order.
38 * Use scripts/check-qerror.sh to check.
40 #define QERR_ADD_CLIENT_FAILED \
41 ERROR_CLASS_GENERIC_ERROR, "Could not add client"
43 #define QERR_AMBIGUOUS_PATH \
44 ERROR_CLASS_GENERIC_ERROR, "Path '%s' does not uniquely identify an object"
46 #define QERR_BAD_BUS_FOR_DEVICE \
47 ERROR_CLASS_GENERIC_ERROR, "Device '%s' can't go on a %s bus"
49 #define QERR_BASE_NOT_FOUND \
50 ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found"
52 #define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \
53 ERROR_CLASS_GENERIC_ERROR, "Block format '%s' used by device '%s' does not support feature '%s'"
55 #define QERR_BUFFER_OVERRUN \
56 ERROR_CLASS_GENERIC_ERROR, "An internal buffer overran"
58 #define QERR_BUS_NO_HOTPLUG \
59 ERROR_CLASS_GENERIC_ERROR, "Bus '%s' does not support hotplugging"
61 #define QERR_BUS_NOT_FOUND \
62 ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found"
64 #define QERR_COMMAND_DISABLED \
65 ERROR_CLASS_GENERIC_ERROR, "The command %s has been disabled for this instance"
67 #define QERR_COMMAND_NOT_FOUND \
68 ERROR_CLASS_COMMAND_NOT_FOUND, "The command %s has not been found"
70 #define QERR_DEVICE_ENCRYPTED \
71 ERROR_CLASS_DEVICE_ENCRYPTED, "'%s' (%s) is encrypted"
73 #define QERR_DEVICE_FEATURE_BLOCKS_MIGRATION \
74 ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when using feature '%s' in device '%s'"
76 #define QERR_DEVICE_HAS_NO_MEDIUM \
77 ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no medium"
79 #define QERR_DEVICE_INIT_FAILED \
80 ERROR_CLASS_GENERIC_ERROR, "Device '%s' could not be initialized"
82 #define QERR_DEVICE_IN_USE \
83 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is in use"
85 #define QERR_DEVICE_IS_READ_ONLY \
86 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is read only"
88 #define QERR_DEVICE_LOCKED \
89 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is locked"
91 #define QERR_DEVICE_MULTIPLE_BUSSES \
92 ERROR_CLASS_GENERIC_ERROR, "Device '%s' has multiple child busses"
94 #define QERR_DEVICE_NO_BUS \
95 ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no child bus"
97 #define QERR_DEVICE_NO_HOTPLUG \
98 ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging"
100 #define QERR_DEVICE_NOT_ACTIVE \
101 ERROR_CLASS_DEVICE_NOT_ACTIVE, "Device '%s' has not been activated"
103 #define QERR_DEVICE_NOT_ENCRYPTED \
104 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"
106 #define QERR_DEVICE_NOT_FOUND \
107 ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found"
109 #define QERR_DEVICE_NOT_REMOVABLE \
110 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not removable"
112 #define QERR_DUPLICATE_ID \
113 ERROR_CLASS_GENERIC_ERROR, "Duplicate ID '%s' for %s"
115 #define QERR_FD_NOT_FOUND \
116 ERROR_CLASS_GENERIC_ERROR, "File descriptor named '%s' not found"
118 #define QERR_FD_NOT_SUPPLIED \
119 ERROR_CLASS_GENERIC_ERROR, "No file descriptor supplied via SCM_RIGHTS"
121 #define QERR_FEATURE_DISABLED \
122 ERROR_CLASS_GENERIC_ERROR, "The feature '%s' is not enabled"
124 #define QERR_INVALID_BLOCK_FORMAT \
125 ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'"
127 #define QERR_INVALID_OPTION_GROUP \
128 ERROR_CLASS_GENERIC_ERROR, "There is no option group '%s'"
130 #define QERR_INVALID_PARAMETER \
131 ERROR_CLASS_GENERIC_ERROR, "Invalid parameter '%s'"
133 #define QERR_INVALID_PARAMETER_COMBINATION \
134 ERROR_CLASS_GENERIC_ERROR, "Invalid parameter combination"
136 #define QERR_INVALID_PARAMETER_TYPE \
137 ERROR_CLASS_GENERIC_ERROR, "Invalid parameter type for '%s', expected: %s"
139 #define QERR_INVALID_PARAMETER_VALUE \
140 ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' expects %s"
142 #define QERR_INVALID_PASSWORD \
143 ERROR_CLASS_GENERIC_ERROR, "Password incorrect"
145 #define QERR_IO_ERROR \
146 ERROR_CLASS_GENERIC_ERROR, "An IO error has occurred"
148 #define QERR_JSON_PARSE_ERROR \
149 ERROR_CLASS_GENERIC_ERROR, "JSON parse error, %s"
151 #define QERR_JSON_PARSING \
152 ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax"
154 #define QERR_KVM_MISSING_CAP \
155 ERROR_CLASS_K_V_M_MISSING_CAP, "Using KVM without %s, %s unavailable"
157 #define QERR_MIGRATION_ACTIVE \
158 ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress"
160 #define QERR_MIGRATION_NOT_SUPPORTED \
161 ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'"
163 #define QERR_MIGRATION_EXPECTED \
164 ERROR_CLASS_MIGRATION_EXPECTED, "An incoming migration is expected before this command can be executed"
166 #define QERR_MISSING_PARAMETER \
167 ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing"
169 #define QERR_NO_BUS_FOR_DEVICE \
170 ERROR_CLASS_GENERIC_ERROR, "No '%s' bus found for device '%s'"
172 #define QERR_NOT_SUPPORTED \
173 ERROR_CLASS_GENERIC_ERROR, "Not supported"
175 #define QERR_OPEN_FILE_FAILED \
176 ERROR_CLASS_GENERIC_ERROR, "Could not open '%s'"
178 #define QERR_PERMISSION_DENIED \
179 ERROR_CLASS_GENERIC_ERROR, "Insufficient permission to perform this operation"
181 #define QERR_PROPERTY_NOT_FOUND \
182 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' not found"
184 #define QERR_PROPERTY_VALUE_BAD \
185 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' doesn't take value '%s'"
187 #define QERR_PROPERTY_VALUE_IN_USE \
188 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't take value '%s', it's in use"
190 #define QERR_PROPERTY_VALUE_NOT_FOUND \
191 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't find value '%s'"
193 #define QERR_PROPERTY_VALUE_NOT_POWER_OF_2 \
194 ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value '%" PRId64 "', it's not a power of 2"
196 #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
197 ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")"
199 #define QERR_QGA_COMMAND_FAILED \
200 ERROR_CLASS_GENERIC_ERROR, "Guest agent command failed, error was '%s'"
202 #define QERR_QGA_LOGGING_FAILED \
203 ERROR_CLASS_GENERIC_ERROR, "Guest agent failed to log non-optional log statement"
205 #define QERR_QMP_BAD_INPUT_OBJECT \
206 ERROR_CLASS_GENERIC_ERROR, "Expected '%s' in QMP input"
208 #define QERR_QMP_BAD_INPUT_OBJECT_MEMBER \
209 ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' expects '%s'"
211 #define QERR_QMP_EXTRA_MEMBER \
212 ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' is unexpected"
214 #define QERR_RESET_REQUIRED \
215 ERROR_CLASS_GENERIC_ERROR, "Resetting the Virtual Machine is required"
217 #define QERR_SET_PASSWD_FAILED \
218 ERROR_CLASS_GENERIC_ERROR, "Could not set password"
220 #define QERR_TOO_MANY_FILES \
221 ERROR_CLASS_GENERIC_ERROR, "Too many open files"
223 #define QERR_UNDEFINED_ERROR \
224 ERROR_CLASS_GENERIC_ERROR, "An undefined error has occurred"
226 #define QERR_UNKNOWN_BLOCK_FORMAT_FEATURE \
227 ERROR_CLASS_GENERIC_ERROR, "'%s' uses a %s feature which is not supported by this qemu version: %s"
229 #define QERR_UNSUPPORTED \
230 ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported"
232 #define QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION \
233 ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'"
235 #define QERR_VNC_SERVER_FAILED \
236 ERROR_CLASS_GENERIC_ERROR, "Could not start VNC server on %s"
238 #define QERR_SOCKET_CONNECT_FAILED \
239 ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket"
241 #define QERR_SOCKET_LISTEN_FAILED \
242 ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode"
244 #define QERR_SOCKET_BIND_FAILED \
245 ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"
247 #define QERR_SOCKET_CREATE_FAILED \
248 ERROR_CLASS_GENERIC_ERROR, "Failed to create socket"
250 #endif /* QERROR_H */