From d876f60d14d491c27719bafeaed21669e15348a3 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 21 Mar 2014 19:42:22 -0400 Subject: error: Privatize error_print_loc Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Cole Robinson Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- include/qemu/error-report.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/qemu/error-report.h b/include/qemu/error-report.h index 3b098a9..000eae3 100644 --- a/include/qemu/error-report.h +++ b/include/qemu/error-report.h @@ -37,7 +37,6 @@ void loc_set_file(const char *fname, int lno); void error_vprintf(const char *fmt, va_list ap) GCC_FMT_ATTR(1, 0); void error_printf(const char *fmt, ...) GCC_FMT_ATTR(1, 2); void error_printf_unless_qmp(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -void error_print_loc(void); void error_set_progname(const char *argv0); void error_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2); const char *error_get_progname(void); -- cgit v1.1 From 4a66d3bf9ad3d121c32375081dc1379c3478fdb8 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 21 Mar 2014 19:42:23 -0400 Subject: monitor: Remove unused monitor_print_filename Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Cole Robinson Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- include/monitor/monitor.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index a49ea11..42d8671 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -79,7 +79,6 @@ int monitor_handle_fd_param(Monitor *mon, const char *fdname); void monitor_vprintf(Monitor *mon, const char *fmt, va_list ap) GCC_FMT_ATTR(2, 0); void monitor_printf(Monitor *mon, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -void monitor_print_filename(Monitor *mon, const char *filename); void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); int monitor_get_cpu_index(void); -- cgit v1.1 From d73f0beadb57f885e678bffc362864f4401262e0 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 21 Mar 2014 19:42:25 -0400 Subject: qerror.h: Remove unused error classes Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Cole Robinson Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- include/qapi/qmp/qerror.h | 9 --------- 1 file changed, 9 deletions(-) (limited to 'include') diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index da75abf..a72bbc9 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -35,9 +35,6 @@ void qerror_report_err(Error *err); * Please keep the definitions in alphabetical order. * Use scripts/check-qerror.sh to check. */ -#define QERR_ADD_CLIENT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Could not add client" - #define QERR_AMBIGUOUS_PATH \ ERROR_CLASS_GENERIC_ERROR, "Path '%s' does not uniquely identify an object" @@ -200,9 +197,6 @@ void qerror_report_err(Error *err); #define QERR_QGA_COMMAND_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Guest agent command failed, error was '%s'" -#define QERR_QGA_LOGGING_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Guest agent failed to log non-optional log statement" - #define QERR_QMP_BAD_INPUT_OBJECT \ ERROR_CLASS_GENERIC_ERROR, "Expected '%s' in QMP input" @@ -218,9 +212,6 @@ void qerror_report_err(Error *err); #define QERR_SET_PASSWD_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Could not set password" -#define QERR_TOO_MANY_FILES \ - ERROR_CLASS_GENERIC_ERROR, "Too many open files" - #define QERR_UNDEFINED_ERROR \ ERROR_CLASS_GENERIC_ERROR, "An undefined error has occurred" -- cgit v1.1 From f231b88db14f13ee9a41599896f57f3594c1ca8b Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 21 Mar 2014 19:42:26 -0400 Subject: qerror.h: Remove QERR defines that are only used once Just hardcode them in the callers Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Cole Robinson Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- include/qapi/qmp/qerror.h | 66 ----------------------------------------------- 1 file changed, 66 deletions(-) (limited to 'include') diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index a72bbc9..01d1d06 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -35,48 +35,30 @@ void qerror_report_err(Error *err); * Please keep the definitions in alphabetical order. * Use scripts/check-qerror.sh to check. */ -#define QERR_AMBIGUOUS_PATH \ - ERROR_CLASS_GENERIC_ERROR, "Path '%s' does not uniquely identify an object" - -#define QERR_BAD_BUS_FOR_DEVICE \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' can't go on a %s bus" - #define QERR_BASE_NOT_FOUND \ ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found" #define QERR_BLOCK_JOB_NOT_ACTIVE \ ERROR_CLASS_DEVICE_NOT_ACTIVE, "No active block job on device '%s'" -#define QERR_BLOCK_JOB_PAUSED \ - ERROR_CLASS_GENERIC_ERROR, "The block job for device '%s' is currently paused" - #define QERR_BLOCK_JOB_NOT_READY \ ERROR_CLASS_GENERIC_ERROR, "The active block job for device '%s' cannot be completed" #define QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED \ ERROR_CLASS_GENERIC_ERROR, "Block format '%s' used by device '%s' does not support feature '%s'" -#define QERR_BUFFER_OVERRUN \ - ERROR_CLASS_GENERIC_ERROR, "An internal buffer overran" - #define QERR_BUS_NO_HOTPLUG \ ERROR_CLASS_GENERIC_ERROR, "Bus '%s' does not support hotplugging" #define QERR_BUS_NOT_FOUND \ ERROR_CLASS_GENERIC_ERROR, "Bus '%s' not found" -#define QERR_COMMAND_DISABLED \ - ERROR_CLASS_GENERIC_ERROR, "The command %s has been disabled for this instance" - #define QERR_COMMAND_NOT_FOUND \ ERROR_CLASS_COMMAND_NOT_FOUND, "The command %s has not been found" #define QERR_DEVICE_ENCRYPTED \ ERROR_CLASS_DEVICE_ENCRYPTED, "'%s' (%s) is encrypted" -#define QERR_DEVICE_FEATURE_BLOCKS_MIGRATION \ - ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when using feature '%s' in device '%s'" - #define QERR_DEVICE_HAS_NO_MEDIUM \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no medium" @@ -89,15 +71,6 @@ void qerror_report_err(Error *err); #define QERR_DEVICE_IS_READ_ONLY \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' is read only" -#define QERR_DEVICE_LOCKED \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' is locked" - -#define QERR_DEVICE_MULTIPLE_BUSSES \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' has multiple child busses" - -#define QERR_DEVICE_NO_BUS \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no child bus" - #define QERR_DEVICE_NO_HOTPLUG \ ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging" @@ -110,12 +83,6 @@ void qerror_report_err(Error *err); #define QERR_DEVICE_NOT_FOUND \ ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found" -#define QERR_DEVICE_NOT_REMOVABLE \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' is not removable" - -#define QERR_DUPLICATE_ID \ - ERROR_CLASS_GENERIC_ERROR, "Duplicate ID '%s' for %s" - #define QERR_FD_NOT_FOUND \ ERROR_CLASS_GENERIC_ERROR, "File descriptor named '%s' not found" @@ -128,15 +95,9 @@ void qerror_report_err(Error *err); #define QERR_INVALID_BLOCK_FORMAT \ ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'" -#define QERR_INVALID_OPTION_GROUP \ - ERROR_CLASS_GENERIC_ERROR, "There is no option group '%s'" - #define QERR_INVALID_PARAMETER \ ERROR_CLASS_GENERIC_ERROR, "Invalid parameter '%s'" -#define QERR_INVALID_PARAMETER_COMBINATION \ - ERROR_CLASS_GENERIC_ERROR, "Invalid parameter combination" - #define QERR_INVALID_PARAMETER_TYPE \ ERROR_CLASS_GENERIC_ERROR, "Invalid parameter type for '%s', expected: %s" @@ -149,9 +110,6 @@ void qerror_report_err(Error *err); #define QERR_IO_ERROR \ ERROR_CLASS_GENERIC_ERROR, "An IO error has occurred" -#define QERR_JSON_PARSE_ERROR \ - ERROR_CLASS_GENERIC_ERROR, "JSON parse error, %s" - #define QERR_JSON_PARSING \ ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax" @@ -161,36 +119,18 @@ void qerror_report_err(Error *err); #define QERR_MIGRATION_ACTIVE \ ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress" -#define QERR_MIGRATION_NOT_SUPPORTED \ - ERROR_CLASS_GENERIC_ERROR, "State blocked by non-migratable device '%s'" - #define QERR_MISSING_PARAMETER \ ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing" -#define QERR_NO_BUS_FOR_DEVICE \ - ERROR_CLASS_GENERIC_ERROR, "No '%s' bus found for device '%s'" - #define QERR_NOT_SUPPORTED \ ERROR_CLASS_GENERIC_ERROR, "Not supported" #define QERR_PERMISSION_DENIED \ ERROR_CLASS_GENERIC_ERROR, "Insufficient permission to perform this operation" -#define QERR_PROPERTY_NOT_FOUND \ - ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' not found" - #define QERR_PROPERTY_VALUE_BAD \ ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' doesn't take value '%s'" -#define QERR_PROPERTY_VALUE_IN_USE \ - ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't take value '%s', it's in use" - -#define QERR_PROPERTY_VALUE_NOT_FOUND \ - ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' can't find value '%s'" - -#define QERR_PROPERTY_VALUE_NOT_POWER_OF_2 \ - ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value '%" PRId64 "', it's not a power of 2" - #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" @@ -206,9 +146,6 @@ void qerror_report_err(Error *err); #define QERR_QMP_EXTRA_MEMBER \ ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' is unexpected" -#define QERR_RESET_REQUIRED \ - ERROR_CLASS_GENERIC_ERROR, "Resetting the Virtual Machine is required" - #define QERR_SET_PASSWD_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Could not set password" @@ -221,9 +158,6 @@ void qerror_report_err(Error *err); #define QERR_UNSUPPORTED \ ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported" -#define QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION \ - ERROR_CLASS_GENERIC_ERROR, "Migration is disabled when VirtFS export path '%s' is mounted in the guest using mount_tag '%s'" - #define QERR_SOCKET_CONNECT_FAILED \ ERROR_CLASS_GENERIC_ERROR, "Failed to connect to socket" -- cgit v1.1 From 0b15abfcbcb6d4f658bf92d618386f79a7f7e9e8 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 21 Mar 2014 19:42:27 -0400 Subject: qerror.h: Replace QERR_NOT_SUPPORTED with QERR_UNSUPPORTED The former is only used twice, the latter is used over 30 times, and has a nicer error message. Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Cole Robinson Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- include/qapi/qmp/qerror.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include') diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index 01d1d06..f5335e6 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -122,9 +122,6 @@ void qerror_report_err(Error *err); #define QERR_MISSING_PARAMETER \ ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing" -#define QERR_NOT_SUPPORTED \ - ERROR_CLASS_GENERIC_ERROR, "Not supported" - #define QERR_PERMISSION_DENIED \ ERROR_CLASS_GENERIC_ERROR, "Insufficient permission to perform this operation" -- cgit v1.1 From 073a341151ecd02b4d4b7ae01ce7c3ff4e9b71f8 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 21 Mar 2014 19:42:28 -0400 Subject: error: Remove some unused headers Makes it a bit clear how the interdependencies work. Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Cole Robinson Reviewed-by: Paolo Bonzini Signed-off-by: Luiz Capitulino --- include/qapi/qmp/qerror.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index f5335e6..902d1a7 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -12,7 +12,6 @@ #ifndef QERROR_H #define QERROR_H -#include "qapi/qmp/qdict.h" #include "qapi/qmp/qstring.h" #include "qemu/error-report.h" #include "qapi/error.h" -- cgit v1.1