mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
Inside the generated code between visit_start_struct() and
visit_end_struct(), we were blindly setting the error into
the caller's errp parameter. But a future patch to split
visit_end_struct() will require that we take action based
on whether an error has occurred, which requires us to track
all actions through a local err. Rewrite the visits to be
more in line with the other generated calls.
Generated code changes look like:
| visit_start_struct(v, (void **)obj, "Abort", name, sizeof(Abort), &err);
|- if (!err) {
|- if (*obj) {
|- visit_type_Abort_fields(v, obj, errp);
|- }
|- visit_end_struct(v, &err);
|+ if (err) {
|+ goto out;
| }
|+ if (!*obj) {
|+ goto out_obj;
|+ }
|+ visit_type_Abort_fields(v, obj, &err);
|+ error_propagate(errp, err);
|+ err = NULL;
|+out_obj:
|+ visit_end_struct(v, &err);
|+out:
| error_propagate(errp, err);
| }
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1454075341-13658-12-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
|
||
|---|---|---|
| .. | ||
| kvm | ||
| qemu-guest-agent | ||
| qemugdb | ||
| qmp | ||
| tracetool | ||
| analyse-9p-simpletrace.py | ||
| analyze-migration.py | ||
| check-qerror.sh | ||
| checkpatch.pl | ||
| clean-includes | ||
| cleanup-trace-events.pl | ||
| cocci-macro-file.h | ||
| coverity-model.c | ||
| create_config | ||
| disas-objdump.pl | ||
| dump-guest-memory.py | ||
| extract-vsssdk-headers | ||
| feature_to_c.sh | ||
| get_maintainer.pl | ||
| gtester-cat | ||
| hxtool | ||
| make-release | ||
| make_device_config.sh | ||
| ordereddict.py | ||
| qapi-commands.py | ||
| qapi-event.py | ||
| qapi-introspect.py | ||
| qapi-types.py | ||
| qapi-visit.py | ||
| qapi.py | ||
| qemu-binfmt-conf.sh | ||
| qemu-gdb.py | ||
| qtest.py | ||
| refresh-pxe-roms.sh | ||
| shaderinclude.pl | ||
| signrom.py | ||
| simpletrace.py | ||
| switch-timer-api | ||
| texi2pod.pl | ||
| tracetool.py | ||
| update-linux-headers.sh | ||
| vmstate-static-checker.py | ||