]> git.proxmox.com Git - qemu.git/blame - qerror.h
Separate inet_connect into inet_connect (blocking) and inet_nonblocking_connect
[qemu.git] / qerror.h
CommitLineData
9f9daf9a 1/*
41836a9f 2 * QError Module
9f9daf9a
LC
3 *
4 * Copyright (C) 2009 Red Hat Inc.
5 *
6 * Authors:
7 * Luiz Capitulino <lcapitulino@redhat.com>
8 *
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.
11 */
12#ifndef QERROR_H
13#define QERROR_H
14
15#include "qdict.h"
77e595e7 16#include "qstring.h"
827b0813 17#include "qemu-error.h"
2a82d936 18#include "error.h"
13f59ae8 19#include "qapi-types.h"
9f9daf9a
LC
20#include <stdarg.h>
21
9f9daf9a
LC
22typedef struct QError {
23 QObject_HEAD;
827b0813 24 Location loc;
18da7c0f 25 char *err_msg;
13f59ae8 26 ErrorClass err_class;
9f9daf9a
LC
27} QError;
28
77e595e7 29QString *qerror_human(const QError *qerror);
13f59ae8 30void qerror_report(ErrorClass err_class, const char *fmt, ...) GCC_FMT_ATTR(2, 3);
2a82d936 31void qerror_report_err(Error *err);
59f971d4 32void assert_no_error(Error *err);
9f9daf9a
LC
33
34/*
35 * QError class list
9d494c4b 36 * Please keep the definitions in alphabetical order.
9737383b 37 * Use scripts/check-qerror.sh to check.
9f9daf9a 38 */
c1303596 39#define QERR_ADD_CLIENT_FAILED \
df1e608a 40 ERROR_CLASS_GENERIC_ERROR, "Could not add client"
c1303596 41
11e35bfd 42#define QERR_AMBIGUOUS_PATH \
df1e608a 43 ERROR_CLASS_GENERIC_ERROR, "Path '%s' does not uniquely identify an object"
11e35bfd 44
56e9f563 45#define QERR_BAD_BUS_FOR_DEVICE \
df1e608a 46 ERROR_CLASS_GENERIC_ERROR, "Device '%s' can't go on a %s bus"
56e9f563 47
019b8cbf 48#define QERR_BASE_NOT_FOUND \
df1e608a 49 ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found"
019b8cbf 50
1ed520c6 51#define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \
df1e608a 52 ERROR_CLASS_GENERIC_ERROR, "Block format '%s' used by device '%s' does not support feature '%s'"
1ed520c6 53
c1303596 54#define QERR_BUFFER_OVERRUN \
df1e608a 55 ERROR_CLASS_GENERIC_ERROR, "An internal buffer overran"
7bbd8237 56
8eae73b5 57#define QERR_BUS_NO_HOTPLUG \
df1e608a 58 ERROR_CLASS_GENERIC_ERROR, "Bus '%s' does not support hotplugging"
8eae73b5 59
c1303596 60#define QERR_BUS_NOT_FOUND \
df1e608a 61 ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found"
4b9d4683 62
abd6cf6d 63#define QERR_COMMAND_DISABLED \
df1e608a 64 ERROR_CLASS_GENERIC_ERROR, "The command %s has been disabled for this instance"
abd6cf6d 65
c1303596 66#define QERR_COMMAND_NOT_FOUND \
df1e608a 67 ERROR_CLASS_COMMAND_NOT_FOUND, "The command %s has not been found"
c1303596 68
0df37c41 69#define QERR_DEVICE_ENCRYPTED \
df1e608a 70 ERROR_CLASS_DEVICE_ENCRYPTED, "'%s' (%s) is encrypted"
9f9daf9a 71
c1303596 72#define QERR_DEVICE_FEATURE_BLOCKS_MIGRATION \
df1e608a 73 ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when using feature '%s' in device '%s'"
c1303596 74
939a1cc3 75#define QERR_DEVICE_HAS_NO_MEDIUM \
df1e608a 76 ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no medium"
939a1cc3 77
4d9a1a15 78#define QERR_DEVICE_INIT_FAILED \
df1e608a 79 ERROR_CLASS_GENERIC_ERROR, "Device '%s' could not be initialized"
4d9a1a15 80
5124eb59 81#define QERR_DEVICE_IN_USE \
df1e608a 82 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is in use"
5124eb59 83
939a1cc3 84#define QERR_DEVICE_IS_READ_ONLY \
df1e608a 85 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is read only"
939a1cc3 86
fc5469d8 87#define QERR_DEVICE_LOCKED \
df1e608a 88 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is locked"
b0868380 89
1ae78718 90#define QERR_DEVICE_MULTIPLE_BUSSES \
df1e608a 91 ERROR_CLASS_GENERIC_ERROR, "Device '%s' has multiple child busses"
1ae78718 92
c1303596 93#define QERR_DEVICE_NO_BUS \
df1e608a 94 ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no child bus"
c1303596
SH
95
96#define QERR_DEVICE_NO_HOTPLUG \
df1e608a 97 ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging"
c1303596 98
055f6122 99#define QERR_DEVICE_NOT_ACTIVE \
df1e608a 100 ERROR_CLASS_DEVICE_NOT_ACTIVE, "Device '%s' has not been activated"
e16a1812 101
9d494c4b 102#define QERR_DEVICE_NOT_ENCRYPTED \
df1e608a 103 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not encrypted"
9d494c4b 104
e16a1812 105#define QERR_DEVICE_NOT_FOUND \
df1e608a 106 ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found"
055f6122 107
5cfe0264 108#define QERR_DEVICE_NOT_REMOVABLE \
df1e608a 109 ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not removable"
5cfe0264 110
7bc84017 111#define QERR_DUPLICATE_ID \
df1e608a 112 ERROR_CLASS_GENERIC_ERROR, "Duplicate ID '%s' for %s"
7bc84017 113
c7c338c4 114#define QERR_FD_NOT_FOUND \
df1e608a 115 ERROR_CLASS_GENERIC_ERROR, "File descriptor named '%s' not found"
c7c338c4 116
41471a23 117#define QERR_FD_NOT_SUPPLIED \
df1e608a 118 ERROR_CLASS_GENERIC_ERROR, "No file descriptor supplied via SCM_RIGHTS"
41471a23 119
c1303596 120#define QERR_FEATURE_DISABLED \
df1e608a 121 ERROR_CLASS_GENERIC_ERROR, "The feature '%s' is not enabled"
c1303596 122
17901e75 123#define QERR_INVALID_BLOCK_FORMAT \
df1e608a 124 ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'"
17901e75 125
8ff15d4a 126#define QERR_INVALID_OPTION_GROUP \
df1e608a 127 ERROR_CLASS_GENERIC_ERROR, "There is no option group '%s'"
8ff15d4a 128
7a046f5f 129#define QERR_INVALID_PARAMETER \
df1e608a 130 ERROR_CLASS_GENERIC_ERROR, "Invalid parameter '%s'"
7a046f5f 131
c1303596 132#define QERR_INVALID_PARAMETER_COMBINATION \
df1e608a 133 ERROR_CLASS_GENERIC_ERROR, "Invalid parameter combination"
c1303596 134
4b9d4683 135#define QERR_INVALID_PARAMETER_TYPE \
df1e608a 136 ERROR_CLASS_GENERIC_ERROR, "Invalid parameter type for '%s', expected: %s"
4b9d4683 137
985a3e52 138#define QERR_INVALID_PARAMETER_VALUE \
df1e608a 139 ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' expects %s"
985a3e52 140
f6d855c5 141#define QERR_INVALID_PASSWORD \
df1e608a 142 ERROR_CLASS_GENERIC_ERROR, "Password incorrect"
e16a1812 143
58898873 144#define QERR_IO_ERROR \
df1e608a 145 ERROR_CLASS_GENERIC_ERROR, "An IO error has occurred"
58898873 146
ef749d07 147#define QERR_JSON_PARSE_ERROR \
df1e608a 148 ERROR_CLASS_GENERIC_ERROR, "JSON parse error, %s"
ef749d07 149
c1303596 150#define QERR_JSON_PARSING \
df1e608a 151 ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax"
c40cc0a0 152
82a60711 153#define QERR_KVM_MISSING_CAP \
df1e608a 154 ERROR_CLASS_K_V_M_MISSING_CAP, "Using KVM without %s, %s unavailable"
82a60711 155
a4acc064 156#define QERR_MIGRATION_ACTIVE \
df1e608a 157 ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress"
a4acc064
LC
158
159#define QERR_MIGRATION_NOT_SUPPORTED \
df1e608a 160 ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'"
a4acc064 161
8e84865e 162#define QERR_MIGRATION_EXPECTED \
df1e608a 163 ERROR_CLASS_MIGRATION_EXPECTED, "An incoming migration is expected before this command can be executed"
8e84865e 164
4b9d4683 165#define QERR_MISSING_PARAMETER \
df1e608a 166 ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing"
4b9d4683 167
fab5767f 168#define QERR_NO_BUS_FOR_DEVICE \
df1e608a 169 ERROR_CLASS_GENERIC_ERROR, "No '%s' bus found for device '%s'"
fab5767f 170
12bd451f 171#define QERR_NOT_SUPPORTED \
df1e608a 172 ERROR_CLASS_GENERIC_ERROR, "Not supported"
12bd451f 173
fc5469d8 174#define QERR_OPEN_FILE_FAILED \
df1e608a 175 ERROR_CLASS_GENERIC_ERROR, "Could not open '%s'"
fc5469d8 176
44677ded 177#define QERR_PERMISSION_DENIED \
df1e608a 178 ERROR_CLASS_GENERIC_ERROR, "Insufficient permission to perform this operation"
44677ded 179
c58a35f8 180#define QERR_PROPERTY_NOT_FOUND \
df1e608a 181 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' not found"
c58a35f8 182
06b4a703 183#define QERR_PROPERTY_VALUE_BAD \
df1e608a 184 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' doesn't take value '%s'"
06b4a703 185
9c5eff95 186#define QERR_PROPERTY_VALUE_IN_USE \
df1e608a 187 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't take value '%s', it's in use"
9c5eff95 188
84745d68 189#define QERR_PROPERTY_VALUE_NOT_FOUND \
df1e608a 190 ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't find value '%s'"
84745d68 191
02fda01c 192#define QERR_PROPERTY_VALUE_NOT_POWER_OF_2 \
df1e608a 193 ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value '%" PRId64 "', it's not a power of 2"
02fda01c 194
6aced82c 195#define QERR_PROPERTY_VALUE_OUT_OF_RANGE \
df1e608a 196 ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")"
6aced82c 197
c1303596 198#define QERR_QGA_COMMAND_FAILED \
df1e608a 199 ERROR_CLASS_GENERIC_ERROR, "Guest agent command failed, error was '%s'"
c1303596
SH
200
201#define QERR_QGA_LOGGING_FAILED \
df1e608a 202 ERROR_CLASS_GENERIC_ERROR, "Guest agent failed to log non-optional log statement"
c1303596 203
4b9d4683 204#define QERR_QMP_BAD_INPUT_OBJECT \
df1e608a 205 ERROR_CLASS_GENERIC_ERROR, "Expected '%s' in QMP input"
4b9d4683 206
7dfb6123 207#define QERR_QMP_BAD_INPUT_OBJECT_MEMBER \
df1e608a 208 ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' expects '%s'"
7dfb6123 209
60d76d7b 210#define QERR_QMP_EXTRA_MEMBER \
df1e608a 211 ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' is unexpected"
60d76d7b 212
6667b23f 213#define QERR_RESET_REQUIRED \
df1e608a 214 ERROR_CLASS_GENERIC_ERROR, "Resetting the Virtual Machine is required"
6667b23f 215
7a84cb23 216#define QERR_SET_PASSWD_FAILED \
df1e608a 217 ERROR_CLASS_GENERIC_ERROR, "Could not set password"
7a84cb23 218
a488be27 219#define QERR_TOO_MANY_FILES \
df1e608a 220 ERROR_CLASS_GENERIC_ERROR, "Too many open files"
a488be27 221
fc5469d8 222#define QERR_UNDEFINED_ERROR \
df1e608a 223 ERROR_CLASS_GENERIC_ERROR, "An undefined error has occurred"
fc5469d8 224
f54e3641 225#define QERR_UNKNOWN_BLOCK_FORMAT_FEATURE \
df1e608a 226 ERROR_CLASS_GENERIC_ERROR, "'%s' uses a %s feature which is not supported by this qemu version: %s"
f54e3641 227
c1303596 228#define QERR_UNSUPPORTED \
df1e608a 229 ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported"
c1303596 230
e9a0152b 231#define QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION \
df1e608a 232 ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'"
e9a0152b 233
a6906e31 234#define QERR_VNC_SERVER_FAILED \
df1e608a 235 ERROR_CLASS_GENERIC_ERROR, "Could not start VNC server on %s"
a6906e31 236
aed3d11d 237#define QERR_SOCKET_CONNECT_FAILED \
df1e608a 238 ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket"
aed3d11d
AK
239
240#define QERR_SOCKET_LISTEN_FAILED \
df1e608a 241 ERROR_CLASS_GENERIC_ERROR, "Failed to set socket to listening mode"
aed3d11d
AK
242
243#define QERR_SOCKET_BIND_FAILED \
df1e608a 244 ERROR_CLASS_GENERIC_ERROR, "Failed to bind socket"
aed3d11d
AK
245
246#define QERR_SOCKET_CREATE_FAILED \
df1e608a 247 ERROR_CLASS_GENERIC_ERROR, "Failed to create socket"
aed3d11d 248
9f9daf9a 249#endif /* QERROR_H */