Skip to content

Commit

Permalink
Merge tag 'pull-error-2023-11-17' of https://repo.or.cz/qemu/armbru i…
Browse files Browse the repository at this point in the history
…nto staging

Error reporting patches for 2023-11-17

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmVXLq8SHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZTBIsP/3vTjS2QJ2JdjgZV7ARGyfAxsPbG4TS2
# JHqFsF37vY5u+gYjcBJsmDY8YBpYWQFkOYJ8RJtCdedOnW2gML88vc3XKcUrUc7T
# ebN8KnpA8mx5nr0SMGD+/w72xZl917lGFhXRqazvS2i0dbJvuAsacoo300oIZncx
# 5480GiJpNc/QBUdU9ywFWwQOVzJynn32e1OFWLmbL2xH+kcgMbgWgrEMQUb0D99+
# J9PjKCJxVlJFKEjph7iLCahID5V1gjJTzp3iESOWbO7BTFuKJZ8E510oXd1ng86c
# JLOEcu4vhC4JNvMx5R31nVz4LXfQD8Hf1pSVL64gTybVq3bEMhv/wLUuG/AcPIuL
# t1GxRhGqY2yXbnP3GfP9xNhFps0uLmJF7g5Q/ao2sEwOiPmGmNKcK7xV6OkYJdIr
# isbb+bot19NN+B7r1ZWkb7BEhM99PtHZtsrmnPZ7T19CX/cy2k0D0W78nqJE0AJU
# sBhwuntou+DvBbLB3KD33OcE0UI93IxICaqR56q4lwydYOQ4p8VCTRI1aoDrZpPx
# Q+kMs+sy3q7CGMKEScnb+HeA8KuvKFGqw3XKJwYQsTITRd+NdWnQ7dKAC2J2sRvO
# DRGhUEmOiaDv3HdmToV3owfLsH9raK6Oh8KYjxiOoiJ1Tb0+sZvxayemQ97mRVuJ
# r+yle/BX1ODY
# =7QAS
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 17 Nov 2023 04:13:19 EST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* tag 'pull-error-2023-11-17' of https://repo.or.cz/qemu/armbru:
  target/i386/cpu: Improve error message for property "vendor"
  balloon: Fix a misleading error message
  net: Fix a misleading error message
  ui/qmp-cmds: Improve two error messages
  qga: Improve guest-exec-status error message
  hmp: Improve sync-profile error message
  spapr/pci: Correct "does not support hotplugging error messages

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
stefanhaRH committed Nov 20, 2023
2 parents d86f3f5 + 298d8b1 commit b554312
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 2 additions & 2 deletions hw/ppc/spapr_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1555,7 +1555,7 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler,
*/
if (plugged_dev->hotplugged) {
error_setg(errp, QERR_BUS_NO_HOTPLUG,
object_get_typename(OBJECT(phb)));
phb->parent_obj.bus->qbus.name);
return;
}
}
Expand Down Expand Up @@ -1676,7 +1676,7 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler,

if (!phb->dr_enabled) {
error_setg(errp, QERR_BUS_NO_HOTPLUG,
object_get_typename(OBJECT(phb)));
phb->parent_obj.bus->qbus.name);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions monitor/hmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include "qapi/qapi-commands-control.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qemu/cutils.h"
#include "hw/intc/intc.h"
#include "qemu/log.h"
Expand Down Expand Up @@ -138,7 +137,8 @@ void hmp_sync_profile(Monitor *mon, const QDict *qdict)
} else {
Error *err = NULL;

error_setg(&err, QERR_INVALID_PARAMETER, op);
error_setg(&err, "invalid parameter '%s',"
" expecting 'on', 'off', or 'reset'", op);
hmp_handle_error(mon, err);
}
}
Expand Down
6 changes: 3 additions & 3 deletions net/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
int ret = -1;
Visitor *v = opts_visitor_new(opts);

/* Parse convenience option format ip6-net=fec0::0[/64] */
/* Parse convenience option format ipv6-net=fec0::0[/64] */
const char *ip6_net = qemu_opt_get(opts, "ipv6-net");

if (ip6_net) {
Expand All @@ -1247,8 +1247,8 @@ static int net_client_init(QemuOpts *opts, bool is_netdev, Error **errp)
if (substrings[1] &&
qemu_strtoul(substrings[1], NULL, 10, &prefix_len))
{
error_setg(errp, QERR_INVALID_PARAMETER_VALUE,
"ipv6-prefixlen", "a number");
error_setg(errp,
"parameter 'ipv6-net' expects a number after '/'");
goto out;
}

Expand Down
2 changes: 1 addition & 1 deletion qga/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ GuestExecStatus *qmp_guest_exec_status(int64_t pid, Error **errp)

gei = guest_exec_info_find(pid);
if (gei == NULL) {
error_setg(errp, QERR_INVALID_PARAMETER, "pid");
error_setg(errp, "PID " PRId64 " does not exist");
return NULL;
}

Expand Down
10 changes: 5 additions & 5 deletions system/balloon.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,17 @@ BalloonInfo *qmp_query_balloon(Error **errp)
return info;
}

void qmp_balloon(int64_t target, Error **errp)
void qmp_balloon(int64_t value, Error **errp)
{
if (!have_balloon(errp)) {
return;
}

if (target <= 0) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "target", "a size");
if (value <= 0) {
error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "value", "a size");
return;
}

trace_balloon_event(balloon_opaque, target);
balloon_event_fn(balloon_opaque, target);
trace_balloon_event(balloon_opaque, value);
balloon_event_fn(balloon_opaque, value);
}
3 changes: 2 additions & 1 deletion target/i386/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -5192,7 +5192,8 @@ static void x86_cpuid_set_vendor(Object *obj, const char *value,
int i;

if (strlen(value) != CPUID_VENDOR_SZ) {
error_setg(errp, QERR_PROPERTY_VALUE_BAD, "", "vendor", value);
error_setg(errp, "value of property 'vendor' must consist of"
" exactly " stringify(CPUID_VENDOR_SZ) " characters");
return;
}

Expand Down
5 changes: 3 additions & 2 deletions ui/ui-qmp-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ void qmp_set_password(SetPasswordOptions *opts, Error **errp)
assert(opts->protocol == DISPLAY_PROTOCOL_VNC);
if (opts->connected != SET_PASSWORD_ACTION_KEEP) {
/* vnc supports "connected=keep" only */
error_setg(errp, QERR_INVALID_PARAMETER, "connected");
error_setg(errp, "parameter 'connected' must be 'keep'"
" when 'protocol' is 'vnc'");
return;
}
/*
Expand Down Expand Up @@ -195,7 +196,7 @@ void qmp_client_migrate_info(const char *protocol, const char *hostname,
}

if (!has_port && !has_tls_port) {
error_setg(errp, QERR_MISSING_PARAMETER, "port/tls-port");
error_setg(errp, "parameter 'port' or 'tls-port' is required");
return;
}

Expand Down

0 comments on commit b554312

Please sign in to comment.