qemu-e2k/hw
Markus Armbruster 193227f9e5 error: Use error_report_err() instead of monitor_printf()
Both error_report_err() and monitor_printf() print to the same
destination when monitor_printf() is used correctly, i.e. within an
HMP monitor.  Elsewhere, monitor_printf() does nothing, while
error_report_err() reports to stderr.

Most changed functions are HMP command handlers.  These should only
run within an HMP monitor.  The one exception is bdrv_password_cb(),
which should also only run within an HMP monitor.

Four command handlers prefix the error message with the command name:
balloon, migrate_set_capability, migrate_set_parameter, migrate.
Pointless, drop.

Unlike monitor_printf(), error_report_err() uses the error whole
instead of just its message obtained with error_get_pretty().  This
avoids suppressing its hint (see commit 50b7b00).  Example:

    (qemu) device_add ivshmem,id=666
    Parameter 'id' expects an identifier
    Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.
    Try "help device_add" for more information

The "Identifiers consist of..." line is new with this patch.

Coccinelle semantic patch:

    @@
    expression M, E;
    @@
    -    monitor_printf(M, "%s\n", error_get_pretty(E));
    -    error_free(E);
    +    error_report_err(E);
    @r1@
    expression M, E;
    format F;
    position p;
    @@
    -    monitor_printf(M, "...%@F@\n", error_get_pretty(E));@p
    -    error_free(E);
    +    error_report_err(E);
    @script:python@
	p << r1.p;
    @@
    print "%s:%s:%s: prefix dropped" % (p[0].file, p[0].line, p[0].column)

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1450452927-8346-4-git-send-email-armbru@redhat.com>
2016-01-13 15:16:16 +01:00
..
9pfs 9pfs: introduce V9fsVirtioState 2016-01-12 11:04:14 +05:30
acpi trivial patches for 2016-01-11 2016-01-11 12:56:58 +00:00
alpha isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
arm error: Use error_report_err() where appropriate (again) 2016-01-13 15:16:16 +01:00
audio Remove macros IO_READ_PROTO and IO_WRITE_PROTO 2015-10-19 09:03:53 +02:00
block hw: Inline the qdev_prop_set_drive_nofail() wrapper 2016-01-13 11:58:58 +01:00
bt bt: avoid unintended sign extension 2015-12-04 09:39:55 +03:00
char hw: Don't use hw_error() for machine initialization errors 2016-01-13 11:58:58 +01:00
core sysbus: Don't use hw_error() in machine_init_done_notifiers 2016-01-13 11:58:58 +01:00
cpu icc_bus: drop the unused files 2015-10-02 16:22:02 -03:00
cris cris: Remove ELF_MACHINE from cpu.h 2015-09-25 12:04:43 +02:00
display ui/curses: Fix color attribute of monitor for curses 2016-01-08 12:20:07 +01:00
dma hw/dma/xilinx_axidma: remove dead code 2016-01-11 15:52:18 +00:00
gpio omap: Don't use hw_error() in device init() methods 2016-01-13 11:58:58 +01:00
i2c omap: Don't use hw_error() in device init() methods 2016-01-13 11:58:58 +01:00
i386 isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
ide hw: Inline the qdev_prop_set_drive_nofail() wrapper 2016-01-13 11:58:58 +01:00
input qapi: Change munging of CamelCase enum values 2015-12-17 08:21:28 +01:00
intc omap: Don't use hw_error() in device init() methods 2016-01-13 11:58:58 +01:00
ipack pci: Trivial device model conversions to realize 2015-02-26 12:42:16 +01:00
ipmi ipmi: Add a force off function 2015-12-22 18:39:19 +02:00
isa isa: Clean up inappropriate hw_error() 2016-01-13 15:15:57 +01:00
lm32 ui/opengl: Reduce build required libraries for opengl 2015-11-03 10:13:42 +01:00
m68k hw: Don't use hw_error() for machine initialization errors 2016-01-13 11:58:58 +01:00
mem nvdimm: implement NVDIMM device abstract 2015-12-22 18:39:20 +02:00
microblaze petalogix-ml605: Set the MicroBlaze CPU version to 8.10.a 2016-01-07 14:57:26 +01:00
mips isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
misc i.MX: move i.MX31 CCM object to register array 2016-01-11 15:52:18 +00:00
moxie moxie: Remove ELF_MACHINE from cpu.h 2015-09-25 12:04:43 +02:00
net etraxfs_eth: Don't use hw_error() in init() method 2016-01-13 11:58:58 +01:00
nvram fw_cfg: replace ioport data read with generic method 2015-12-15 11:46:13 +01:00
openrisc * First batch of MAINTAINERS updates 2015-09-25 21:52:30 +01:00
pci fix bad indentation in pcie_cap_slot_write_config() 2015-11-06 15:42:38 +03:00
pci-bridge hw/pxb: introduce pxb-pcie expander for PCIe machines 2015-12-22 17:45:13 +02:00
pci-host isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
pcmcia hw: do not pass NULL to memory_region_init from instance_init 2015-10-09 15:25:56 +02:00
ppc error: Use error_report_err() where appropriate (again) 2016-01-13 15:16:16 +01:00
s390x error: Use error_report_err() instead of monitor_printf() 2016-01-13 15:16:16 +01:00
scsi scsi: always call notifier on async cancellation 2015-12-17 17:33:49 +01:00
sd sdhci: add optional quirk property to disable card insertion/removal interrupts 2015-12-22 16:34:26 +08:00
sh4 SH PCI Host: convert to realize() 2016-01-11 11:39:28 +03:00
smbios Use error_fatal to simplify obvious fatal errors 2016-01-13 11:58:58 +01:00
sparc sparc: Remove ELF_MACHINE from cpu.h 2015-09-25 12:04:44 +02:00
sparc64 isa: Clean up error handling around isa_bus_new() 2016-01-13 11:58:59 +01:00
ssi arm: Use g_new() & friends where that makes obvious sense 2015-09-07 10:39:27 +01:00
timer arm_mptimer: Don't use hw_error() in realize() method 2016-01-13 11:58:58 +01:00
tpm tpm: avoid clang shifting negative signed warning 2015-11-17 18:35:56 +08:00
tricore tricore: Remove ELF_MACHINE from cpu.h 2015-09-25 12:04:44 +02:00
unicore32 hw: Don't use hw_error() for machine initialization errors 2016-01-13 11:58:58 +01:00
usb ohci: clear pending SOF on suspend 2016-01-08 09:29:24 +01:00
vfio vfio: Use g_new() & friends where that makes obvious sense 2015-11-10 12:11:08 -07:00
virtio VirtFS update: 2016-01-12 17:37:22 +00:00
watchdog i6300esb: remove muldiv64() 2015-09-25 14:52:17 +02:00
xen xen/Makefile.objs: simplify 2016-01-11 11:39:28 +03:00
xenpv xen: fix usage of xc_domain_create in domain builder 2015-11-13 17:38:06 +00:00
xtensa target-xtensa: xtfpga: attach FLASH to system IO 2015-10-21 21:28:33 +03:00
Makefile.objs Add a base IPMI interface 2015-12-22 18:39:19 +02:00