Skip to content

migration: capture error reports into Error object

Daniel P. Berrangé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest33 patches 30 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/33migration: push Error **errp into qemu_loadvm_state()migration/migration.c migration/savevm.c migration/savevm.h+23 -194 replies
2/33migration: push Error **errp into qemu_loadvm_state_header()migration/savevm.c+17 -141 reply
3/33migration: push Error **errp into qemu_loadvm_state_setup()migration/savevm.c+3 -42 replies
4/33migration: push Error **errp into qemu_load_device_state()migration/colo.c migration/savevm.c migration/savevm.h+4 -51 reply
5/33migration: push Error **errp into qemu_loadvm_state_main()migration/colo.c migration/savevm.c migration/savevm.h+52 -273 replies
6/33migration: push Error **errp into qemu_loadvm_section_start_full()migration/savevm.c tests/qemu-iotests/tests/internal-snapshots-qapi.out+25 -271 reply
7/33migration: push Error **errp into qemu_loadvm_section_part_end()migration/savevm.c+13 -131 reply
8/33migration: push Error **errp into loadvm_process_command()migration/savevm.c+64 -231 reply
9/33migration: push Error **errp into loadvm_handle_cmd_packaged()migration/savevm.c+8 -160 replies
10/33migration: push Error **errp into loadvm_postcopy_handle_advise()migration/savevm.c+21 -221 reply
11/33migration: push Error **errp into ram_postcopy_incoming_init()migration/postcopy-ram.c migration/postcopy-ram.h migration/ram.c +2 more+12 -90 replies
12/33migration: push Error **errp into loadvm_postcopy_handle_listen()migration/savevm.c+7 -111 reply
13/33migration: push Error **errp into loadvm_postcopy_handle_run()migration/savevm.c+3 -81 reply
14/33migration: push Error **errp into loadvm_postcopy_ram_handle_discard()migration/savevm.c+15 -161 reply
15/33migration: make loadvm_postcopy_handle_resume() voidmigration/savevm.c+4 -100 replies
16/33migration: push Error **errp into loadvm_handle_recv_bitmap()migration/savevm.c+12 -140 replies
17/33migration: push Error **errp into loadvm_process_enable_colo()include/migration/colo.h migration/migration.c migration/savevm.c+15 -180 replies
18/33migration: push Error **errp into colo_init_ram_cache()migration/ram.c migration/ram.h migration/savevm.c+10 -110 replies
19/33migration: push Error **errp into check_section_footer()migration/savevm.c+10 -121 reply
20/33migration: push Error **errp into global_state_store()include/migration/global_state.h migration/global_state.c migration/migration.c +1 more+12 -90 replies
21/33migration: remove error reporting from qemu_fopen_bdrv() callersmigration/savevm.c+1 -80 replies
22/33migration: push Error **errp into qemu_savevm_state_iterate()migration/migration.c migration/savevm.c migration/savevm.h+37 -200 replies
23/33migration: simplify some error reporting in save_snapshot()migration/savevm.c+9 -80 replies
24/33migration: push Error **errp into qemu_savevm_state_setup()migration/migration.c migration/savevm.c migration/savevm.h+21 -80 replies
25/33migration: push Error **errp into qemu_savevm_state_complete_precopy()migration/savevm.c+8 -40 replies
26/33migration: push Error **errp into qemu_savevm_state_complete_precopy_non_iterable()migration/savevm.c+14 -110 replies
27/33migration: push Error **errp into qemu_savevm_state_complete_precopy()migration/migration.c migration/savevm.c migration/savevm.h+24 -110 replies
28/33migration: push Error **errp into qemu_savevm_send_packaged()migration/migration.c migration/savevm.c migration/savevm.h+10 -60 replies
29/33migration: push Error **errp into qemu_savevm_live_state()migration/colo.c migration/savevm.c migration/savevm.h+8 -60 replies
30/33migration: push Error **errp into qemu_save_device_state()migration/colo.c migration/savevm.c migration/savevm.h+33 -220 replies
31/33migration: push Error **errp into qemu_savevm_state_resume_prepare()migration/migration.c migration/savevm.c migration/savevm.h+8 -80 replies
32/33migration: push Error **errp into postcopy_resume_handshake()migration/migration.c+6 -60 replies
33/33migration: push Error **errp into postcopy_do_resume()migration/migration.c+7 -90 replies

Reviews trailers per patch

12 of 33 patches have a Reviewed-by or Acked-by.

PatchPhilippe Mathieu-Daudé
1/33R-b
2/33R-b
3/33R-b
4/33R-b
5/33
6/33R-b
7/33R-b
8/33R-b
9/33
10/33R-b
11/33
12/33R-b
13/33R-b
14/33R-b
15/33
16/33
17/33
18/33
19/33R-b
20/33
21/33
22/33
23/33
24/33
25/33
26/33
27/33
28/33
29/33
30/33
31/33
32/33
33/33

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/33] migration: capture error reports into Error object

Due to its long term heritage most of the migration code just invokes 'error_report' when problems hit. This was fine for HMP, since the messages get redirected from stderr, into the HMP console. It is not OK for QMP because the errors will not be fed back to the QMP client.

This wasn't a terrible real world problem with QMP so far because live migration happens in the background, so at least on the target side there is not a QMP command that needs to capture the incoming migration. It is a problem on the source side but it doesn't hit frequently as the source side has fewer failure scenarios. None the less on both sides it would be desirable if 'query-migrate' can report errors correctly. With the introduction of the load-snapshot QMP commands, the need for error reporting becomes more pressing.

Wiring up good error reporting is a large and difficult job, which this series does NOT complete. The focus here has been on converting all methods in savevm.c which have an 'int' return value capable of reporting errors. This covers most of the infrastructure for controlling the migration state serialization / protocol.

The remaining part that is missing error reporting are the callbacks in the VMStateDescription struct which can return failure codes, but have no "Error **errp" parameter. Thinking about how this might be dealt with in future, a big bang conversion is likely non-viable. We'll probably want to introduce a duplicate set of callbacks with the "Error **errp" parameter and convert impls in batches, eventually removing the original callbacks. I don't intend todo that myself in the immediate future.

IOW, this patch series probably solves 50% of the problem, but we still do need the rest to get ideal error reporting.

In doing this savevm conversion I noticed a bunch of places which see and then ignore errors. I only fixed one or two of them which were clearly dubious. Other places in savevm.c where it seemed it was probably ok to ignore errors, I've left using error_report() on the basis that those are really warnings. Perhaps they could be changed to warn_report() instead.

There are alot of patches here, but I felt it was easier to review for correctness if I converted 1 function at a time. The series does not neccessarily have to be reviewed/appied in 1 go.

Daniel P. Berrangé (33):
migration: push Error **errp into qemu_loadvm_state()
migration: push Error **errp into qemu_loadvm_state_header()
migration: push Error **errp into qemu_loadvm_state_setup()
migration: push Error **errp into qemu_load_device_state()
migration: push Error **errp into qemu_loadvm_state_main()
migration: push Error **errp into qemu_loadvm_section_start_full()
migration: push Error **errp into qemu_loadvm_section_part_end()
migration: push Error **errp into loadvm_process_command()
migration: push Error **errp into loadvm_handle_cmd_packaged()
migration: push Error **errp into loadvm_postcopy_handle_advise()
migration: push Error **errp into ram_postcopy_incoming_init()
migration: push Error **errp into loadvm_postcopy_handle_listen()
migration: push Error **errp into loadvm_postcopy_handle_run()
migration: push Error **errp into loadvm_postcopy_ram_handle_discard()
migration: make loadvm_postcopy_handle_resume() void
migration: push Error **errp into loadvm_handle_recv_bitmap()
migration: push Error **errp into loadvm_process_enable_colo()
migration: push Error **errp into colo_init_ram_cache()
migration: push Error **errp into check_section_footer()
migration: push Error **errp into global_state_store()
migration: remove error reporting from qemu_fopen_bdrv() callers
migration: push Error **errp into qemu_savevm_state_iterate()
migration: simplify some error reporting in save_snapshot()
migration: push Error **errp into qemu_savevm_state_setup()
migration: push Error **errp into qemu_savevm_state_complete_precopy()
migration: push Error **errp into
qemu_savevm_state_complete_precopy_non_iterable()
migration: push Error **errp into qemu_savevm_state_complete_precopy()
migration: push Error **errp into qemu_savevm_send_packaged()
migration: push Error **errp into qemu_savevm_live_state()
migration: push Error **errp into qemu_save_device_state()
migration: push Error **errp into qemu_savevm_state_resume_prepare()
migration: push Error **errp into postcopy_resume_handshake()
migration: push Error **errp into postcopy_do_resume()

 include/migration/colo.h                      |   2 +-
 include/migration/global_state.h              |   2 +-
 migration/colo.c                              |  12 +-
 migration/global_state.c                      |   6 +-
 migration/migration.c                         |  80 ++-
 migration/postcopy-ram.c                      |   8 +-
 migration/postcopy-ram.h                      |   2 +-
 migration/ram.c                               |  17 +-
 migration/ram.h                               |   4 +-
 migration/savevm.c                            | 594 ++++++++++--------
 migration/savevm.h                            |  23 +-
 .../tests/internal-snapshots-qapi.out         |   3 +-
 12 files changed, 427 insertions(+), 326 deletions(-)
Signature · 1 line
2.29.2