diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-06-23 10:38:00 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-06-23 10:38:00 +0100 |
commit | a3206972a9eab65ec8e8f9ae320ad628ba4b58f1 (patch) | |
tree | f5109b0cced9784dde30aa2877aea30651933eee /include | |
parent | 0c8ff723bd29e5c8b2ca989f857ae5c37ec49c4e (diff) | |
parent | a0b1a66ea39bca011108734147a72232a4d08c7a (diff) |
Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-06-22' into staging
Monitor patches
# gpg: Signature made Mon Jun 22 18:56:18 2015 BST using RSA key ID EB918653
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
# gpg: aka "Markus Armbruster <armbru@pond.sub.org>"
* remotes/armbru/tags/pull-monitor-2015-06-22: (24 commits)
Include monitor/monitor.h exactly where needed
Include qapi/qmp/qerror.h exactly where needed
qerror: Move #include out of qerror.h
qerror: Finally unused, clean up
qmp: Wean off qerror_report()
tpm: Avoid qerror_report() outside QMP command handlers
qerror: Clean up QERR_ macros to expand into a single string
qerror: Eliminate QERR_DEVICE_NOT_FOUND
vl: Use error_report() for --display errors
vl: Avoid qerror_report() outside QMP command handlers
QemuOpts: Wean off qerror_report_err()
qdev-monitor: Propagate errors through qdev_device_add()
qdev-monitor: Propagate errors through set_property()
qdev-monitor: Convert qbus_find() to Error
qdev-monitor: Fix check for full bus
qdev-monitor: Stop error avalanche in qbus_find_recursive()
disas: Remove uses of CPU env
monitor: Split mon_get_cpu fn to remove ENV_GET_CPU
monitor: Fix failure path for "S" argument
monitor: Point to "help" command on syntax error
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/block/block_int.h | 2 | ||||
-rw-r--r-- | include/disas/disas.h | 4 | ||||
-rw-r--r-- | include/monitor/monitor.h | 9 | ||||
-rw-r--r-- | include/monitor/qdev.h | 7 | ||||
-rw-r--r-- | include/net/net.h | 2 | ||||
-rw-r--r-- | include/qapi/qmp/qbool.h | 8 | ||||
-rw-r--r-- | include/qapi/qmp/qdict.h | 4 | ||||
-rw-r--r-- | include/qapi/qmp/qerror.h | 88 | ||||
-rw-r--r-- | include/qapi/qmp/qobject.h | 1 | ||||
-rw-r--r-- | include/qemu/log.h | 4 | ||||
-rw-r--r-- | include/qemu/option.h | 5 | ||||
-rw-r--r-- | include/qemu/sockets.h | 1 | ||||
-rw-r--r-- | include/sysemu/balloon.h | 1 | ||||
-rw-r--r-- | include/ui/console.h | 4 | ||||
-rw-r--r-- | include/ui/qemu-spice.h | 2 |
15 files changed, 56 insertions, 86 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h index 888ec09e96..b0476fc36e 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -31,8 +31,6 @@ #include "block/coroutine.h" #include "qemu/timer.h" #include "qapi-types.h" -#include "qapi/qmp/qerror.h" -#include "monitor/monitor.h" #include "qemu/hbitmap.h" #include "block/snapshot.h" #include "qemu/main-loop.h" diff --git a/include/disas/disas.h b/include/disas/disas.h index c13ca9a3a4..2b9293b62a 100644 --- a/include/disas/disas.h +++ b/include/disas/disas.h @@ -6,10 +6,10 @@ #ifdef NEED_CPU_H /* Disassemble this for me please... (debugging). */ void disas(FILE *out, void *code, unsigned long size); -void target_disas(FILE *out, CPUArchState *env, target_ulong code, +void target_disas(FILE *out, CPUState *cpu, target_ulong code, target_ulong size, int flags); -void monitor_disas(Monitor *mon, CPUArchState *env, +void monitor_disas(Monitor *mon, CPUState *cpu, target_ulong pc, int nb_insn, int is_physical, int flags); /* Look up symbol for debugging purpose. Returns "" if unknown. */ diff --git a/include/monitor/monitor.h b/include/monitor/monitor.h index 88644ceda7..9aff47e699 100644 --- a/include/monitor/monitor.h +++ b/include/monitor/monitor.h @@ -2,7 +2,6 @@ #define MONITOR_H #include "qemu-common.h" -#include "qapi/qmp/qerror.h" #include "qapi/qmp/qdict.h" #include "block/block.h" #include "qemu/readline.h" @@ -39,15 +38,13 @@ void monitor_flush(Monitor *mon); int monitor_set_cpu(int cpu_index); int monitor_get_cpu_index(void); -void monitor_set_error(Monitor *mon, QError *qerror); void monitor_read_command(Monitor *mon, int show_prompt); int monitor_read_password(Monitor *mon, ReadLineFunc *readline_func, void *opaque); -int qmp_qom_set(Monitor *mon, const QDict *qdict, QObject **ret); - -int qmp_qom_get(Monitor *mon, const QDict *qdict, QObject **ret); -int qmp_object_add(Monitor *mon, const QDict *qdict, QObject **ret); +void qmp_qom_set(QDict *qdict, QObject **ret, Error **errp); +void qmp_qom_get(QDict *qdict, QObject **ret, Error **errp); +void qmp_object_add(QDict *qdict, QObject **ret, Error **errp); void object_add(const char *type, const char *id, const QDict *qdict, Visitor *v, Error **errp); diff --git a/include/monitor/qdev.h b/include/monitor/qdev.h index 719075283c..50ec2ffc12 100644 --- a/include/monitor/qdev.h +++ b/include/monitor/qdev.h @@ -2,15 +2,16 @@ #define QEMU_QDEV_MONITOR_H #include "hw/qdev-core.h" -#include "monitor/monitor.h" +#include "qemu/typedefs.h" /*** monitor commands ***/ void hmp_info_qtree(Monitor *mon, const QDict *qdict); void hmp_info_qdm(Monitor *mon, const QDict *qdict); void hmp_info_qom_tree(Monitor *mon, const QDict *dict); -int do_device_add(Monitor *mon, const QDict *qdict, QObject **ret_data); +void qmp_device_add(QDict *qdict, QObject **ret_data, Error **errp); + int qdev_device_help(QemuOpts *opts); -DeviceState *qdev_device_add(QemuOpts *opts); +DeviceState *qdev_device_add(QemuOpts *opts, Error **errp); #endif diff --git a/include/net/net.h b/include/net/net.h index 4306252b97..6a6cbef24a 100644 --- a/include/net/net.h +++ b/include/net/net.h @@ -197,7 +197,7 @@ void net_cleanup(void); void hmp_host_net_add(Monitor *mon, const QDict *qdict); void hmp_host_net_remove(Monitor *mon, const QDict *qdict); void netdev_add(QemuOpts *opts, Error **errp); -int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret); +void qmp_netdev_add(QDict *qdict, QObject **ret, Error **errp); int net_hub_id_for_client(NetClientState *nc, int *id); NetClientState *net_hub_port_find(int hub_id); diff --git a/include/qapi/qmp/qbool.h b/include/qapi/qmp/qbool.h index c4eaab9bb9..4aa6be3b33 100644 --- a/include/qapi/qmp/qbool.h +++ b/include/qapi/qmp/qbool.h @@ -14,16 +14,16 @@ #ifndef QBOOL_H #define QBOOL_H -#include <stdint.h> +#include <stdbool.h> #include "qapi/qmp/qobject.h" typedef struct QBool { QObject_HEAD; - int value; + bool value; } QBool; -QBool *qbool_from_int(int value); -int qbool_get_int(const QBool *qb); +QBool *qbool_from_bool(bool value); +bool qbool_get_bool(const QBool *qb); QBool *qobject_to_qbool(const QObject *obj); #endif /* QBOOL_H */ diff --git a/include/qapi/qmp/qdict.h b/include/qapi/qmp/qdict.h index 9fbf68ee0c..a37f4c1567 100644 --- a/include/qapi/qmp/qdict.h +++ b/include/qapi/qmp/qdict.h @@ -56,13 +56,13 @@ const QDictEntry *qdict_next(const QDict *qdict, const QDictEntry *entry); /* High level helpers */ double qdict_get_double(const QDict *qdict, const char *key); int64_t qdict_get_int(const QDict *qdict, const char *key); -int qdict_get_bool(const QDict *qdict, const char *key); +bool qdict_get_bool(const QDict *qdict, const char *key); QList *qdict_get_qlist(const QDict *qdict, const char *key); QDict *qdict_get_qdict(const QDict *qdict, const char *key); const char *qdict_get_str(const QDict *qdict, const char *key); int64_t qdict_get_try_int(const QDict *qdict, const char *key, int64_t def_value); -int qdict_get_try_bool(const QDict *qdict, const char *key, int def_value); +bool qdict_get_try_bool(const QDict *qdict, const char *key, bool def_value); const char *qdict_get_try_str(const QDict *qdict, const char *key); void qdict_copy_default(QDict *dst, QDict *src, const char *key); diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h index e5673394d3..842b27ae11 100644 --- a/include/qapi/qmp/qerror.h +++ b/include/qapi/qmp/qerror.h @@ -12,122 +12,98 @@ #ifndef QERROR_H #define QERROR_H -#include "qapi/qmp/qstring.h" -#include "qemu/error-report.h" -#include "qapi/error.h" -#include "qapi-types.h" -#include <stdarg.h> - -typedef struct QError { - QObject_HEAD; - Location loc; - char *err_msg; - ErrorClass err_class; -} QError; - -QString *qerror_human(const QError *qerror); -void qerror_report(ErrorClass err_class, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -void qerror_report_err(Error *err); - /* - * QError class list - * Please keep the definitions in alphabetical order. - * Use scripts/check-qerror.sh to check. + * These macros will go away, please don't use in new code, and do not + * add new ones! */ #define QERR_BASE_NOT_FOUND \ - ERROR_CLASS_GENERIC_ERROR, "Base '%s' not found" + "Base '%s' not found" #define QERR_BLOCK_JOB_NOT_READY \ - ERROR_CLASS_GENERIC_ERROR, "The active block job for device '%s' cannot be completed" + "The active block job for device '%s' cannot be completed" #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" + "Bus '%s' does not support hotplugging" #define QERR_DEVICE_HAS_NO_MEDIUM \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' has no medium" + "Device '%s' has no medium" #define QERR_DEVICE_INIT_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' could not be initialized" + "Device '%s' could not be initialized" #define QERR_DEVICE_IN_USE \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' is in use" + "Device '%s' is in use" #define QERR_DEVICE_NO_HOTPLUG \ - ERROR_CLASS_GENERIC_ERROR, "Device '%s' does not support hotplugging" - -#define QERR_DEVICE_NOT_FOUND \ - ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found" + "Device '%s' does not support hotplugging" #define QERR_FD_NOT_FOUND \ - ERROR_CLASS_GENERIC_ERROR, "File descriptor named '%s' not found" + "File descriptor named '%s' not found" #define QERR_FD_NOT_SUPPLIED \ - ERROR_CLASS_GENERIC_ERROR, "No file descriptor supplied via SCM_RIGHTS" + "No file descriptor supplied via SCM_RIGHTS" #define QERR_FEATURE_DISABLED \ - ERROR_CLASS_GENERIC_ERROR, "The feature '%s' is not enabled" + "The feature '%s' is not enabled" #define QERR_INVALID_BLOCK_FORMAT \ - ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'" + "Invalid block format '%s'" #define QERR_INVALID_PARAMETER \ - ERROR_CLASS_GENERIC_ERROR, "Invalid parameter '%s'" + "Invalid parameter '%s'" #define QERR_INVALID_PARAMETER_TYPE \ - ERROR_CLASS_GENERIC_ERROR, "Invalid parameter type for '%s', expected: %s" + "Invalid parameter type for '%s', expected: %s" #define QERR_INVALID_PARAMETER_VALUE \ - ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' expects %s" + "Parameter '%s' expects %s" #define QERR_INVALID_PASSWORD \ - ERROR_CLASS_GENERIC_ERROR, "Password incorrect" + "Password incorrect" #define QERR_IO_ERROR \ - ERROR_CLASS_GENERIC_ERROR, "An IO error has occurred" + "An IO error has occurred" #define QERR_JSON_PARSING \ - ERROR_CLASS_GENERIC_ERROR, "Invalid JSON syntax" + "Invalid JSON syntax" #define QERR_MIGRATION_ACTIVE \ - ERROR_CLASS_GENERIC_ERROR, "There's a migration process in progress" + "There's a migration process in progress" #define QERR_MISSING_PARAMETER \ - ERROR_CLASS_GENERIC_ERROR, "Parameter '%s' is missing" + "Parameter '%s' is missing" #define QERR_PERMISSION_DENIED \ - ERROR_CLASS_GENERIC_ERROR, "Insufficient permission to perform this operation" + "Insufficient permission to perform this operation" #define QERR_PROPERTY_VALUE_BAD \ - ERROR_CLASS_GENERIC_ERROR, "Property '%s.%s' doesn't take value '%s'" + "Property '%s.%s' doesn't take value '%s'" #define QERR_PROPERTY_VALUE_OUT_OF_RANGE \ - ERROR_CLASS_GENERIC_ERROR, "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" + "Property %s.%s doesn't take value %" PRId64 " (minimum: %" PRId64 ", maximum: %" PRId64 ")" #define QERR_QGA_COMMAND_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Guest agent command failed, error was '%s'" + "Guest agent command failed, error was '%s'" #define QERR_QMP_BAD_INPUT_OBJECT \ - ERROR_CLASS_GENERIC_ERROR, "Expected '%s' in QMP input" + "Expected '%s' in QMP input" #define QERR_QMP_BAD_INPUT_OBJECT_MEMBER \ - ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' expects '%s'" + "QMP input object member '%s' expects '%s'" #define QERR_QMP_EXTRA_MEMBER \ - ERROR_CLASS_GENERIC_ERROR, "QMP input object member '%s' is unexpected" + "QMP input object member '%s' is unexpected" #define QERR_SET_PASSWD_FAILED \ - ERROR_CLASS_GENERIC_ERROR, "Could not set password" + "Could not set password" #define QERR_UNDEFINED_ERROR \ - ERROR_CLASS_GENERIC_ERROR, "An undefined error has occurred" + "An undefined error has occurred" #define QERR_UNKNOWN_BLOCK_FORMAT_FEATURE \ - ERROR_CLASS_GENERIC_ERROR, "'%s' uses a %s feature which is not supported by this qemu version: %s" + "'%s' uses a %s feature which is not supported by this qemu version: %s" #define QERR_UNSUPPORTED \ - ERROR_CLASS_GENERIC_ERROR, "this feature or command is not currently supported" + "this feature or command is not currently supported" #endif /* QERROR_H */ diff --git a/include/qapi/qmp/qobject.h b/include/qapi/qmp/qobject.h index 84b2d9fef5..260d2ed3cc 100644 --- a/include/qapi/qmp/qobject.h +++ b/include/qapi/qmp/qobject.h @@ -44,7 +44,6 @@ typedef enum { QTYPE_QLIST, QTYPE_QFLOAT, QTYPE_QBOOL, - QTYPE_QERROR, QTYPE_MAX, } qtype_code; diff --git a/include/qemu/log.h b/include/qemu/log.h index 195f665c4b..f880e66dbc 100644 --- a/include/qemu/log.h +++ b/include/qemu/log.h @@ -104,10 +104,10 @@ static inline void log_cpu_state_mask(int mask, CPUState *cpu, int flags) #ifdef NEED_CPU_H /* disas() and target_disas() to qemu_logfile: */ -static inline void log_target_disas(CPUArchState *env, target_ulong start, +static inline void log_target_disas(CPUState *cpu, target_ulong start, target_ulong len, int flags) { - target_disas(qemu_logfile, env, start, len, flags); + target_disas(qemu_logfile, cpu, start, len, flags); } static inline void log_disas(void *code, unsigned long size) diff --git a/include/qemu/option.h b/include/qemu/option.h index ac0e43b7e5..57e51c9628 100644 --- a/include/qemu/option.h +++ b/include/qemu/option.h @@ -119,7 +119,10 @@ void qemu_opts_del(QemuOpts *opts); void qemu_opts_validate(QemuOpts *opts, const QemuOptDesc *desc, Error **errp); void qemu_opts_do_parse(QemuOpts *opts, const char *params, const char *firstname, Error **errp); -QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, int permit_abbrev); +QemuOpts *qemu_opts_parse_noisily(QemuOptsList *list, const char *params, + bool permit_abbrev); +QemuOpts *qemu_opts_parse(QemuOptsList *list, const char *params, + bool permit_abbrev, Error **errp); void qemu_opts_set_defaults(QemuOptsList *list, const char *params, int permit_abbrev); QemuOpts *qemu_opts_from_qdict(QemuOptsList *list, const QDict *qdict, diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 7992ece72a..c174b5cbdd 100644 --- a/include/qemu/sockets.h +++ b/include/qemu/sockets.h @@ -28,7 +28,6 @@ int inet_aton(const char *cp, struct in_addr *ia); #include "qemu/option.h" #include "qapi/error.h" -#include "qapi/qmp/qerror.h" #include "qapi-types.h" extern QemuOptsList socket_optslist; diff --git a/include/sysemu/balloon.h b/include/sysemu/balloon.h index 0345e01efb..17fe30070d 100644 --- a/include/sysemu/balloon.h +++ b/include/sysemu/balloon.h @@ -14,7 +14,6 @@ #ifndef _QEMU_BALLOON_H #define _QEMU_BALLOON_H -#include "monitor/monitor.h" #include "qapi-types.h" typedef void (QEMUBalloonEvent)(void *opaque, ram_addr_t target); diff --git a/include/ui/console.h b/include/ui/console.h index de92523bbb..047a2b4640 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -5,7 +5,7 @@ #include "qom/object.h" #include "qapi/qmp/qdict.h" #include "qemu/notify.h" -#include "monitor/monitor.h" +#include "qemu/typedefs.h" #include "qapi-types.h" #include "qapi/error.h" @@ -369,7 +369,7 @@ char *vnc_display_local_addr(const char *id); #ifdef CONFIG_VNC int vnc_display_password(const char *id, const char *password); int vnc_display_pw_expire(const char *id, time_t expires); -QemuOpts *vnc_parse_func(const char *str); +QemuOpts *vnc_parse(const char *str, Error **errp); int vnc_init_func(void *opaque, QemuOpts *opts, Error **errp); #else static inline int vnc_display_password(const char *id, const char *password) diff --git a/include/ui/qemu-spice.h b/include/ui/qemu-spice.h index 42db3c1645..0dff4229fc 100644 --- a/include/ui/qemu-spice.h +++ b/include/ui/qemu-spice.h @@ -26,7 +26,6 @@ #include "qemu/option.h" #include "qemu/config-file.h" -#include "monitor/monitor.h" extern int using_spice; @@ -54,7 +53,6 @@ static inline CharDriverState *qemu_chr_open_spice_port(const char *name) #endif #else /* CONFIG_SPICE */ -#include "monitor/monitor.h" #define using_spice 0 #define spice_displays 0 |