: Monitor: improve handlers error handling
Status from this message: Applied all. Thanks!
Get series with b4
b4 am [email protected]Versions newest first
Patches in v0 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/21 | Monitor: Introduce cmd_new_ret()monitor.c | +6 | 1 reply | |
| 2/21 | Monitor: Convert simple handlers to cmd_new_ret()migration.c migration.h monitor.c +1 more | +36 | 0 replies | |
| 3/21 | Monitor: Convert do_cont() to cmd_new_ret()monitor.c qemu-monitor.hx | +7 | 0 replies | |
| 4/21 | Monitor: Convert do_eject() to cmd_new_ret()monitor.c qemu-monitor.hx | +4 | 0 replies | |
| 5/21 | Monitor: Convert do_cpu_set() to cmd_new_ret()monitor.c qemu-monitor.hx | +6 | 0 replies | |
| 6/21 | Monitor: Convert do_block_set_passwd() to cmd_new_ret()monitor.c qemu-monitor.hx | +6 | 0 replies | |
| 7/21 | Monitor: Convert do_getfd() to cmd_new_ret()monitor.c qemu-monitor.hx | +7 | 0 replies | |
| 8/21 | Monitor: Convert do_closefd() to cmd_new_ret()monitor.c qemu-monitor.hx | +4 | 0 replies | |
| 9/21 | Monitor: Convert pci_device_hot_add() to cmd_new_ret()hw/ qemu-monitor.hx sysemu.h | +13 | 0 replies | |
| 10/21 | Monitor: Convert pci_device_hot_remove() to cmd_new_ret()hw/ qemu-monitor.hx sysemu.h | +11 | 0 replies | |
| 11/21 | Monitor: Convert do_migrate() to cmd_new_ret()migration.c migration.h qemu-monitor.hx | +19 | 0 replies | |
| 12/21 | Monitor: Convert do_memory_save() to cmd_new_ret()monitor.c qemu-monitor.hx | +8 | 0 replies | |
| 13/21 | Monitor: Convert do_physical_memory_save() to cmd_new_ret()monitor.c qemu-monitor.hx | +8 | 0 replies | |
| 14/21 | Monitor: Convert do_info() to cmd_new_ret()monitor.c qemu-monitor.hx | +6 | 0 replies | |
| 15/21 | Monitor: Convert do_change() to cmd_new_ret()monitor.c monitor.h qemu-monitor.hx | +42 | 0 replies | |
| 16/21 | Monitor: Rename cmd_new_ret()monitor.c qemu-monitor.hx | +23 | 0 replies | |
| 17/21 | Monitor: Debugging supportconfigure monitor.c | +18 | 0 replies | |
| 18/21 | Monitor: Drop the print disabling mechanismmonitor.c | +9 | 0 replies | |
| 19/21 | Monitor: Audit handler returnmonitor.c | +31 | 0 replies | |
| 20/21 | Monitor: Debug stray prints the right waymonitor.c | +41 | 0 replies | |
| 21/21 | Monitor: Report more than one error in handlersmonitor.c | +2 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v0 yet.
Cover letter [Qemu-devel] [PATCH v0 00/21]: Monitor: improve handlers error handling
Hi there,
When I started converting handlers to the QObject style, I thought that
returning an error code wouldn't be needed. That is, we have an error object already, so if the handler returns the error object it has failed, otherwise it has succeeded.
This was also very convenient, because handlers have never returned an error
code, and thus it would be easier to add a call to qemu_error_new() in the right place instead of returning error codes.
Turns out we need both. Actually, I should not have abused the error object
this way because (as Markus says) this is too fragile and we can end up reporting bogus errors to clients (among other problems).
The good news is that it's easy to fix.
All we have to do is to change cmd_new() (the handler callback) to return an
error code and convert existing QObject handlers to it. This series does that and most of the patches are really straightforward conversions.
Additionally, Markus has designed an excellent debug mechanism for QMP, which
is implemented by the last patches in this series, and will allow us to catch important QObject conversion and error handling bugs in handlers.
Thanks.