Error reporting patches patches for 2023-02-23

-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmP3ZogSHGFybWJydUBy
 ZWRoYXQuY29tAAoJEDhwtADrkYZT+PsP/ibioHJkJiR8yMt2/2iSwpkMrphZDmRQ
 5sAgxCARdcp0m7maH4McCFkgtERcROip+j98FV29qI4y2P/mLkt1jyMYC+TH9r4O
 X3G997526gzZBLIJJsnYlVlJ1Gbgn+uCy4AzRLuhaKAHsYoxkP0jygoSs/eIZ9tK
 Wg2tkQ/wY4bXihrlzdOpWqU3Y0ADo2PQ29p7HWheRMDQz6JQxq82hFFs1jgGQ1aq
 4HmcpIMX0+/LshFbDU91dL1pxW17vWT9J3xtzAsWlfBBgAh257LKvJqVD0XojL04
 FxJZ05IqTXZ04gvwgji0dcvNjdmP/dXVoGLfxAYwCFtKxiig700bdNb0+6MjCT6u
 P2tSPyQQzNQ5LYI7AgER4kMyXK22RkBXx+Q7y7QK1YXszWWSmGFZWGLA2FSg4lO6
 5jsCgtEGixsMym/ox3XeoywSh4BgWkNXC+gKMSg/hQXgfriQmndHUOlK0ZU95I43
 7gnPol+pU1HIEy/GDU8oMyieG513Ti1KVPZyv/FbuW75AYUDlHAXH/5OFlsuaLIR
 1QF449xCLR5vIOOLXHbKJ9jbkcAaidhq5pOhLr7oV3yKh4H53iNB7gy8+vJ6XtBf
 tXXcYPVD8LpZxDegKNpIaeT0Nr4pyy6bYfrF+YeisVotD6PDtPALfJ9eSCWjaQsl
 DG2opOfv5xuV
 =VRxu
 -----END PGP SIGNATURE-----

Merge tag 'pull-error-2023-02-23' of https://repo.or.cz/qemu/armbru into staging

Error reporting patches patches for 2023-02-23

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAmP3ZogSHGFybWJydUBy
# ZWRoYXQuY29tAAoJEDhwtADrkYZT+PsP/ibioHJkJiR8yMt2/2iSwpkMrphZDmRQ
# 5sAgxCARdcp0m7maH4McCFkgtERcROip+j98FV29qI4y2P/mLkt1jyMYC+TH9r4O
# X3G997526gzZBLIJJsnYlVlJ1Gbgn+uCy4AzRLuhaKAHsYoxkP0jygoSs/eIZ9tK
# Wg2tkQ/wY4bXihrlzdOpWqU3Y0ADo2PQ29p7HWheRMDQz6JQxq82hFFs1jgGQ1aq
# 4HmcpIMX0+/LshFbDU91dL1pxW17vWT9J3xtzAsWlfBBgAh257LKvJqVD0XojL04
# FxJZ05IqTXZ04gvwgji0dcvNjdmP/dXVoGLfxAYwCFtKxiig700bdNb0+6MjCT6u
# P2tSPyQQzNQ5LYI7AgER4kMyXK22RkBXx+Q7y7QK1YXszWWSmGFZWGLA2FSg4lO6
# 5jsCgtEGixsMym/ox3XeoywSh4BgWkNXC+gKMSg/hQXgfriQmndHUOlK0ZU95I43
# 7gnPol+pU1HIEy/GDU8oMyieG513Ti1KVPZyv/FbuW75AYUDlHAXH/5OFlsuaLIR
# 1QF449xCLR5vIOOLXHbKJ9jbkcAaidhq5pOhLr7oV3yKh4H53iNB7gy8+vJ6XtBf
# tXXcYPVD8LpZxDegKNpIaeT0Nr4pyy6bYfrF+YeisVotD6PDtPALfJ9eSCWjaQsl
# DG2opOfv5xuV
# =VRxu
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 23 Feb 2023 13:13:44 GMT
# 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-02-23' of https://repo.or.cz/qemu/armbru:
  rocker: Tweak stubbed out monitor commands' error messages
  migration/colo: Improve an x-colo-lost-heartbeat error message
  hw/core: Improve the query-hotpluggable-cpus error message
  replay: Simplify setting replay blockers
  qga: Drop dangling reference to QERR_QGA_LOGGING_DISABLED
  hw/acpi: Move QMP command to hw/core/
  hw/acpi: Dumb down acpi_table_add() stub
  hw/smbios: Dumb down smbios_entry_add() stub
  hw/core: Improve error message when machine doesn't provide NMIs
  dump: Assert cpu_get_note_size() can't fail
  dump: Improve error message when target doesn't support memory dump
  error: Drop superfluous #include "qapi/qmp/qerror.h"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2023-02-24 15:08:50 +00:00
commit c259930c2e
38 changed files with 44 additions and 100 deletions

View file

@ -2273,7 +2273,6 @@ F: hw/acpi/vmgenid.c
F: include/hw/acpi/vmgenid.h
F: docs/specs/vmgenid.txt
F: tests/qtest/vmgenid-test.c
F: stubs/vmgenid.c
LED
M: Philippe Mathieu-Daudé <philmd@linaro.org>

View file

@ -30,7 +30,6 @@
#include "qapi/qapi-visit-authz.h"
#include "qapi/qmp/qjson.h"
#include "qapi/qmp/qobject.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qobject-input-visitor.h"

View file

@ -28,7 +28,6 @@
#ifdef CONFIG_VHOST_CRYPTO
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "hw/virtio/virtio-crypto.h"
#include "sysemu/cryptodev-vhost-user.h"

View file

@ -13,7 +13,6 @@
#include "qemu/osdep.h"
#include "sysemu/rng.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/module.h"
#include "qom/object_interfaces.h"

View file

@ -13,7 +13,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "qom/object_interfaces.h"
#include "sysemu/vhost-user-backend.h"

View file

@ -22,7 +22,6 @@
#include "block/block-copy.h"
#include "block/dirty-bitmap.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/cutils.h"
#include "sysemu/block-backend.h"
#include "qemu/bitmap.h"

View file

@ -18,7 +18,6 @@
#include "block/block_int.h"
#include "block/blockjob_int.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h"
#include "qemu/memalign.h"
#include "sysemu/block-backend.h"

View file

@ -21,7 +21,6 @@
#include "block/dirty-bitmap.h"
#include "sysemu/block-backend.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/ratelimit.h"
#include "qemu/bitmap.h"
#include "qemu/memalign.h"

View file

@ -16,7 +16,6 @@
#include "block/block_int.h"
#include "block/blockjob_int.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qdict.h"
#include "qemu/ratelimit.h"
#include "sysemu/block-backend.h"

View file

@ -1854,7 +1854,8 @@ static void dump_init(DumpState *s, int fd, bool has_format,
*/
ret = cpu_get_dump_info(&s->dump_info, &s->guest_phys_blocks);
if (ret < 0) {
error_setg(errp, QERR_UNSUPPORTED);
error_setg(errp,
"dumping guest memory is not supported on this target");
goto cleanup;
}
@ -1864,10 +1865,7 @@ static void dump_init(DumpState *s, int fd, bool has_format,
s->note_size = cpu_get_note_size(s->dump_info.d_class,
s->dump_info.d_machine, nr_cpus);
if (s->note_size < 0) {
error_setg(errp, QERR_UNSUPPORTED);
goto cleanup;
}
assert(s->note_size >= 0);
/*
* The goal of this block is to (a) update the previously guessed

View file

@ -19,11 +19,9 @@
*/
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "hw/acpi/acpi.h"
void acpi_table_add(const QemuOpts *opts, Error **errp)
{
error_setg(errp, QERR_UNSUPPORTED);
g_assert_not_reached();
}

View file

@ -12,7 +12,6 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-machine.h"
#include "qemu/module.h"
#include "hw/acpi/acpi.h"
#include "hw/acpi/aml-build.h"
@ -244,20 +243,3 @@ static void vmgenid_register_types(void)
}
type_init(vmgenid_register_types)
GuidInfo *qmp_query_vm_generation_id(Error **errp)
{
GuidInfo *info;
VmGenIdState *vms;
Object *obj = find_vmgenid_dev();
if (!obj) {
error_setg(errp, "VM Generation ID device not found");
return NULL;
}
vms = VMGENID(obj);
info = g_malloc0(sizeof(*info));
info->guid = qemu_uuid_unparse_strdup(&vms->guid);
return info;
}

View file

@ -8,6 +8,7 @@
*/
#include "qemu/osdep.h"
#include "hw/acpi/vmgenid.h"
#include "hw/boards.h"
#include "hw/intc/intc.h"
#include "hw/mem/memory-device.h"
@ -15,7 +16,6 @@
#include "qapi/error.h"
#include "qapi/qapi-builtin-visit.h"
#include "qapi/qapi-commands-machine.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qobject.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/type-helpers.h"
@ -140,7 +140,7 @@ HotpluggableCPUList *qmp_query_hotpluggable_cpus(Error **errp)
MachineClass *mc = MACHINE_GET_CLASS(ms);
if (!mc->has_hotpluggable_cpus) {
error_setg(errp, QERR_FEATURE_DISABLED, "query-hotpluggable-cpus");
error_setg(errp, "machine does not support hot-plugging CPUs");
return NULL;
}
@ -383,3 +383,20 @@ HumanReadableText *qmp_x_query_irq(Error **errp)
return human_readable_text_from_str(buf);
}
GuidInfo *qmp_query_vm_generation_id(Error **errp)
{
GuidInfo *info;
VmGenIdState *vms;
Object *obj = find_vmgenid_dev();
if (!obj) {
error_setg(errp, "VM Generation ID device not found");
return NULL;
}
vms = VMGENID(obj);
info = g_malloc0(sizeof(*info));
info->guid = qemu_uuid_unparse_strdup(&vms->guid);
return info;
}

View file

@ -13,7 +13,6 @@
#include "qemu/osdep.h"
#include "qemu/option.h"
#include "qemu/accel.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/replay.h"
#include "qemu/units.h"
#include "hw/boards.h"

View file

@ -22,7 +22,6 @@
#include "qemu/osdep.h"
#include "hw/nmi.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qemu/module.h"
#include "monitor/monitor.h"
@ -70,7 +69,7 @@ void nmi_monitor_handle(int cpu_index, Error **errp)
if (ns.handled) {
error_propagate(errp, ns.err);
} else {
error_setg(errp, QERR_UNSUPPORTED);
error_setg(errp, "machine does not provide NMIs");
}
}

View file

@ -92,7 +92,6 @@
#include "hw/mem/memory-device.h"
#include "sysemu/replay.h"
#include "target/i386/cpu.h"
#include "qapi/qmp/qerror.h"
#include "e820_memory_layout.h"
#include "fw_cfg.h"
#include "trace.h"

View file

@ -28,7 +28,6 @@
#include "qemu/datadir.h"
#include "qemu/guest-random.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qapi-visit-common.h"
#include "qapi/clone-visitor.h"
#include "qapi/qapi-visit-machine.h"

View file

@ -18,7 +18,6 @@
#include "hw/register.h"
#include "qemu/bitops.h"
#include "qapi/qmp/qerror.h"
#include "hw/misc/xlnx-zynqmp-apu-ctrl.h"

View file

@ -1,6 +1,5 @@
/*
* QMP Target options - Commands handled based on a target config
* versus a host config
* QMP command stubs
*
* Copyright (c) 2015 David Ahern <dsahern@gmail.com>
*
@ -18,17 +17,16 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-rocker.h"
#include "qapi/qmp/qerror.h"
RockerSwitch *qmp_query_rocker(const char *name, Error **errp)
{
error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
error_setg(errp, "rocker %s not found", name);
return NULL;
};
RockerPortList *qmp_query_rocker_ports(const char *name, Error **errp)
{
error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
error_setg(errp, "rocker %s not found", name);
return NULL;
};
@ -37,7 +35,7 @@ RockerOfDpaFlowList *qmp_query_rocker_of_dpa_flows(const char *name,
uint32_t tbl_id,
Error **errp)
{
error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
error_setg(errp, "rocker %s not found", name);
return NULL;
};
@ -46,6 +44,6 @@ RockerOfDpaGroupList *qmp_query_rocker_of_dpa_groups(const char *name,
uint8_t type,
Error **errp)
{
error_setg(errp, QERR_FEATURE_DISABLED, "rocker");
error_setg(errp, "rocker %s not found", name);
return NULL;
};

View file

@ -21,11 +21,9 @@
*/
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qmp/qerror.h"
#include "hw/firmware/smbios.h"
void smbios_entry_add(QemuOpts *opts, Error **errp)
{
error_setg(errp, QERR_UNSUPPORTED);
g_assert_not_reached();
}

View file

@ -29,9 +29,6 @@
#define QERR_DEVICE_NO_HOTPLUG \
"Device '%s' does not support hotplugging"
#define QERR_FEATURE_DISABLED \
"The feature '%s' is not enabled"
#define QERR_INVALID_PARAMETER \
"Invalid parameter '%s'"
@ -59,9 +56,6 @@
#define QERR_QGA_COMMAND_FAILED \
"Guest agent command failed, error was '%s'"
#define QERR_REPLAY_NOT_SUPPORTED \
"Record/replay feature is not supported for '%s'"
#define QERR_UNSUPPORTED \
"this feature or command is not currently supported"

View file

@ -72,7 +72,7 @@ void replay_start(void);
/*! Closes replay log file and frees other resources. */
void replay_finish(void);
/*! Adds replay blocker with the specified error description */
void replay_add_blocker(Error *reason);
void replay_add_blocker(const char *feature);
/* Returns name of the replay log file */
const char *replay_get_filename(void);
/*

View file

@ -17,7 +17,6 @@
#include "migration.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-migration.h"
#include "qapi/qmp/qerror.h"
#include "qemu/error-report.h"
#include "trace.h"
@ -78,7 +77,7 @@ FailoverStatus failover_get_state(void)
void qmp_x_colo_lost_heartbeat(Error **errp)
{
if (get_colo_mode() == COLO_MODE_NONE) {
error_setg(errp, QERR_FEATURE_DISABLED, "colo");
error_setg(errp, "VM is not in COLO mode");
return;
}

View file

@ -33,7 +33,6 @@
#include "net/colo.h"
#include "block/block.h"
#include "qapi/qapi-events-migration.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/cpus.h"
#include "sysemu/runstate.h"
#include "net/filter.h"

View file

@ -23,7 +23,6 @@
#include "qapi/qapi-commands-migration.h"
#include "qapi/qapi-visit-migration.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "qapi/string-input-visitor.h"
#include "qapi/string-output-visitor.h"
#include "qemu/cutils.h"

View file

@ -32,9 +32,8 @@
#define GUEST_FILE_READ_COUNT_MAX (48 * MiB)
/* Note: in some situations, like with the fsfreeze, logging may be
* temporarilly disabled. if it is necessary that a command be able
* to log for accounting purposes, check ga_logging_enabled() beforehand,
* and use the QERR_QGA_LOGGING_DISABLED to generate an error
* temporarily disabled. if it is necessary that a command be able
* to log for accounting purposes, check ga_logging_enabled() beforehand.
*/
void slog(const gchar *fmt, ...)
{

View file

@ -24,7 +24,6 @@
#include "qapi/qmp/qjson.h"
#include "guest-agent-core.h"
#include "qga-qapi-init-commands.h"
#include "qapi/qmp/qerror.h"
#include "qapi/error.h"
#include "channel.h"
#include "qemu/cutils.h"

View file

@ -376,8 +376,12 @@ void replay_finish(void)
replay_mode = REPLAY_MODE_NONE;
}
void replay_add_blocker(Error *reason)
void replay_add_blocker(const char *feature)
{
Error *reason = NULL;
error_setg(&reason, "Record/replay feature is not supported for '%s'",
feature);
replay_blockers = g_slist_prepend(replay_blockers, reason);
}

View file

@ -12,7 +12,7 @@ void replay_input_sync_event(void)
qemu_input_event_sync_impl();
}
void replay_add_blocker(Error *reason)
void replay_add_blocker(const char *feature)
{
}
void replay_audio_in(size_t *recorded, void *samples, size_t *wpos, size_t size)

View file

@ -28,7 +28,6 @@
#include "qemu/error-report.h"
#include "qemu/module.h"
#include "qemu/cutils.h"
#include "qapi/qmp/qerror.h"
#include "qom/object_interfaces.h"
#include CONFIG_DEVICES
#ifdef CONFIG_PSERIES

View file

@ -152,11 +152,8 @@ void configure_rtc(QemuOpts *opts)
if (!strcmp(value, "utc")) {
rtc_base_type = RTC_BASE_UTC;
} else if (!strcmp(value, "localtime")) {
Error *blocker = NULL;
rtc_base_type = RTC_BASE_LOCALTIME;
error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED,
"-rtc base=localtime");
replay_add_blocker(blocker);
replay_add_blocker("-rtc base=localtime");
} else {
rtc_base_type = RTC_BASE_DATETIME;
configure_rtc_base_datetime(value);

View file

@ -1852,9 +1852,7 @@ static void qemu_apply_machine_options(QDict *qdict)
}
if (current_machine->smp.cpus > 1) {
Error *blocker = NULL;
error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED, "smp");
replay_add_blocker(blocker);
replay_add_blocker("smp");
}
}
@ -2774,13 +2772,8 @@ void qemu_init(int argc, char **argv)
drive_add(IF_PFLASH, -1, optarg, PFLASH_OPTS);
break;
case QEMU_OPTION_snapshot:
{
Error *blocker = NULL;
snapshot = 1;
error_setg(&blocker, QERR_REPLAY_NOT_SUPPORTED,
"-snapshot");
replay_add_blocker(blocker);
}
snapshot = 1;
replay_add_blocker("-snapshot");
break;
case QEMU_OPTION_numa:
opts = qemu_opts_parse_noisily(qemu_find_opts("numa"),

View file

@ -45,7 +45,6 @@ stub_ss.add(files('target-get-monitor-def.c'))
stub_ss.add(files('target-monitor-defs.c'))
stub_ss.add(files('trace-control.c'))
stub_ss.add(files('uuid.c'))
stub_ss.add(files('vmgenid.c'))
stub_ss.add(files('vmstate.c'))
stub_ss.add(files('vm-stop.c'))
stub_ss.add(files('win32-kbd-hook.c'))

View file

@ -1,10 +0,0 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-machine.h"
#include "qapi/qmp/qerror.h"
GuidInfo *qmp_query_vm_generation_id(Error **errp)
{
error_setg(errp, QERR_UNSUPPORTED);
return NULL;
}

View file

@ -28,7 +28,6 @@
#include "monitor/hmp-target.h"
#include "monitor/hmp.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qerror.h"
#include "sysemu/kvm.h"
#include "qapi/error.h"
#include "qapi/qapi-commands-misc-target.h"

View file

@ -15,7 +15,6 @@
#include "monitor/monitor.h"
#include "monitor/hmp-target.h"
#include "qapi/qapi-commands-misc-target.h"
#include "qapi/qmp/qerror.h"
#include "qapi/error.h"
#include "sev.h"

View file

@ -34,7 +34,6 @@
#include "monitor/monitor.h"
#include "monitor/hmp-target.h"
#include "qapi/qapi-commands-misc-target.h"
#include "qapi/qmp/qerror.h"
#include "exec/confidential-guest-support.h"
#include "hw/i386/pc.h"
#include "exec/address-spaces.h"

View file

@ -2,7 +2,6 @@
#include "block/qdict.h" /* for qdict_extract_subqdict() */
#include "qapi/error.h"
#include "qapi/qapi-commands-misc.h"
#include "qapi/qmp/qerror.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qlist.h"
#include "qemu/error-report.h"