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 /net | |
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 'net')
-rw-r--r-- | net/l2tpv3.c | 1 | ||||
-rw-r--r-- | net/net.c | 41 | ||||
-rw-r--r-- | net/slirp.c | 1 |
3 files changed, 22 insertions, 21 deletions
diff --git a/net/l2tpv3.c b/net/l2tpv3.c index 356dae2b72..4f9bceecc9 100644 --- a/net/l2tpv3.c +++ b/net/l2tpv3.c @@ -28,7 +28,6 @@ #include "config-host.h" #include "net/net.h" #include "clients.h" -#include "monitor/monitor.h" #include "qemu-common.h" #include "qemu/error-report.h" #include "qemu/option.h" @@ -32,6 +32,8 @@ #include "monitor/monitor.h" #include "qemu-common.h" +#include "qapi/qmp/qerror.h" +#include "qemu/error-report.h" #include "qemu/sockets.h" #include "qemu/config-file.h" #include "qmp-commands.h" @@ -945,16 +947,16 @@ static int net_client_init1(const void *object, int is_netdev, Error **errp) break; default: - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "type", - "a netdev backend type"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type", + "a netdev backend type"); return -1; } } else { u.net = object; opts = u.net->opts; if (opts->kind == NET_CLIENT_OPTIONS_KIND_HUBPORT) { - error_set(errp, QERR_INVALID_PARAMETER_VALUE, "type", - "a net type"); + error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "type", + "a net type"); return -1; } /* missing optional values have been initialized to "all bits zero" */ @@ -975,8 +977,8 @@ static int net_client_init1(const void *object, int is_netdev, Error **errp) if (net_client_init_fun[opts->kind](opts, name, peer, errp) < 0) { /* FIXME drop when all init functions store an Error */ if (errp && !*errp) { - error_set(errp, QERR_DEVICE_INIT_FAILED, - NetClientOptionsKind_lookup[opts->kind]); + error_setg(errp, QERR_DEVICE_INIT_FAILED, + NetClientOptionsKind_lookup[opts->kind]); } return -1; } @@ -1049,7 +1051,8 @@ void hmp_host_net_add(Monitor *mon, const QDict *qdict) return; } - opts = qemu_opts_parse(qemu_find_opts("net"), opts_str ? opts_str : "", 0); + opts = qemu_opts_parse_noisily(qemu_find_opts("net"), + opts_str ? opts_str : "", false); if (!opts) { return; } @@ -1089,7 +1092,7 @@ void netdev_add(QemuOpts *opts, Error **errp) net_client_init(opts, 1, errp); } -int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret) +void qmp_netdev_add(QDict *qdict, QObject **ret, Error **errp) { Error *local_err = NULL; QemuOptsList *opts_list; @@ -1097,26 +1100,22 @@ int qmp_netdev_add(Monitor *mon, const QDict *qdict, QObject **ret) opts_list = qemu_find_opts_err("netdev", &local_err); if (local_err) { - goto exit_err; + goto out; } opts = qemu_opts_from_qdict(opts_list, qdict, &local_err); if (local_err) { - goto exit_err; + goto out; } netdev_add(opts, &local_err); if (local_err) { qemu_opts_del(opts); - goto exit_err; + goto out; } - return 0; - -exit_err: - qerror_report_err(local_err); - error_free(local_err); - return -1; +out: + error_propagate(errp, local_err); } void qmp_netdev_del(const char *id, Error **errp) @@ -1126,7 +1125,8 @@ void qmp_netdev_del(const char *id, Error **errp) nc = qemu_find_netdev(id); if (!nc) { - error_set(errp, QERR_DEVICE_NOT_FOUND, id); + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Device '%s' not found", id); return; } @@ -1237,7 +1237,8 @@ void qmp_set_link(const char *name, bool up, Error **errp) MAX_QUEUE_NUM); if (queues == 0) { - error_set(errp, QERR_DEVICE_NOT_FOUND, name); + error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, + "Device '%s' not found", name); return; } nc = ncs[0]; @@ -1412,7 +1413,7 @@ int net_client_parse(QemuOptsList *opts_list, const char *optarg) } #endif - if (!qemu_opts_parse(opts_list, optarg, 1)) { + if (!qemu_opts_parse_noisily(opts_list, optarg, true)) { return -1; } diff --git a/net/slirp.c b/net/slirp.c index 35338376f7..7657b38fdf 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -33,6 +33,7 @@ #include "clients.h" #include "hub.h" #include "monitor/monitor.h" +#include "qemu/error-report.h" #include "qemu/sockets.h" #include "slirp/libslirp.h" #include "sysemu/char.h" |