You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
qemu/tests/unit
Arun Menon 6f9fc6f501 migration: Remove error variant of vmstate_save_state() function
This commit removes the redundant vmstate_save_state_with_err()
function.

Previously, commit 969298f9d7 introduced vmstate_save_state_with_err()
to handle error propagation, while vmstate_save_state() existed for
non-error scenarios.
This is because there were code paths where vmstate_save_state_v()
(called internally by vmstate_save_state) did not explicitly set
errors on failure.

This change unifies error handling by
 - updating vmstate_save_state() to accept an Error **errp argument.
 - vmstate_save_state_v() ensures errors are set directly within the errp
   object, eliminating the need for two separate functions.

All calls to vmstate_save_state_with_err() are replaced with
vmstate_save_state(). This simplifies the API and improves code
maintainability.

vmstate_save_state() that only calls vmstate_save_state_v(),
by inference, also has errors set in errp in case of failure.
The errors are reported using error_report_err().
If we want the function to exit on error, then &error_fatal is
passed.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Arun Menon <armenon@redhat.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20250918-propagate_tpm_error-v14-24-36f11a6fb9d3@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
3 weeks ago
..
check-block-qdict.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qdict.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qjson.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qlist.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qlit.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qnull.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qnum.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qobject.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
check-qom-interface.c qom: Make InterfaceInfo[] uses const 6 months ago
check-qom-proplist.c qom: Make InterfaceInfo[] uses const 6 months ago
check-qstring.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
crypto-tls-psk-helpers.c crypto: Remove 'crypto-tls-x509-helpers.h' from crypto-tls-psk-helpers.c 1 year ago
crypto-tls-psk-helpers.h tests: add migration tests of TLS with PSK credentials 3 years ago
crypto-tls-x509-helpers.c tests/unit/crypto-tls-x509-helpers: deinit privkey in test_tls_cleanup 1 year ago
crypto-tls-x509-helpers.h tests/qtest/migration-test: Free QCRyptoTLSTestCertReq objects 1 year ago
io-channel-helpers.c treewide: handle result of qio_channel_set_blocking() 1 month ago
io-channel-helpers.h
iothread.c
iothread.h
meson.build tests/unit: remove block layer code from test-nested-aio-poll 1 year ago
pkix_asn1_tab.c.inc crypto: Restrict pkix_asn1_tab[] to crypto-tls-x509-helpers.c 1 year ago
ptimer-test-stubs.c async: Add an optional reentrancy guard to the BH API 3 years ago
ptimer-test.c hw/core/ptimer: fix timer zero period condition for freq > 1GHz 1 year ago
ptimer-test.h
rcutorture.c Updated the FSF address to <https://www.gnu.org/licenses/> 3 years ago
socket-helpers.c util: drop qemu_socket_set_nonblock() 1 month ago
socket-helpers.h tests/unit: Update test-io-channel-socket.c for Windows 3 years ago
test-aio-multithread.c futex: Support Windows 5 months ago
test-aio.c tests: remove aio_context_acquire() tests 2 years ago
test-authz-list.c
test-authz-listfile.c
test-authz-pam.c
test-authz-simple.c
test-base64.c
test-bdrv-drain.c block: drop wrapper for bdrv_set_backing_hd_drained() 3 months ago
test-bdrv-graph-mod.c block: drop wrapper for bdrv_set_backing_hd_drained() 3 months ago
test-bitcnt.c
test-bitmap.c
test-bitops.c
test-block-backend.c include: Rename sysemu/ -> system/ 10 months ago
test-block-iothread.c mirror: Drop redundant zero_target parameter 5 months ago
test-blockjob-txn.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-blockjob.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-bufferiszero.c
test-char.c tests/unit/test-char: Avoid using g_alloca() 5 months ago
test-clone-visitor.c Remove qemu-common.h include from most units 4 years ago
test-coroutine.c tests/coroutine: Clean up global variable shadowing 2 years ago
test-crypto-afsplit.c qapi/crypto: Rename QCryptoHashAlgorithm to *Algo, and drop prefix 1 year ago
test-crypto-akcipher.c qapi/crypto: Rename QCryptoRSAPaddingAlgorithm to *Algo, and drop prefix 1 year ago
test-crypto-block.c tests: skip legacy qcow2 encryption test if AES is not available 5 months ago
test-crypto-cipher.c tests: fix skipping cipher tests when AES is not available 5 months ago
test-crypto-der.c crypto: Support DER encodings 3 years ago
test-crypto-hash.c crypto: Introduce SM3 hash hmac pbkdf algorithm 12 months ago
test-crypto-hmac.c crypto: Introduce SM3 hash hmac pbkdf algorithm 12 months ago
test-crypto-ivgen.c qapi/crypto: Rename QCryptoIVGenAlgorithm to *Algo, and drop prefix 1 year ago
test-crypto-pbkdf.c crypto: Introduce SM3 hash hmac pbkdf algorithm 12 months ago
test-crypto-secret.c tests: skip encrypted secret tests if AES is not available 5 months ago
test-crypto-tlscredsx509.c tests: Use g_mkdir_with_parents() 3 years ago
test-crypto-tlssession.c util: drop qemu_socket_set_nonblock() 1 month ago
test-crypto-xts.c
test-cutils.c cutils: Improve qemu_strtosz handling of fractions 2 years ago
test-div128.c
test-error-report.c error: Kill @error_warn 3 weeks ago
test-fifo.c tests/unit: Comment FIFO8 tests 1 year ago
test-forward-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-hbitmap.c
test-image-locking.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-int128.c qemu/int128: add int128_urshift 4 years ago
test-interval-tree.c util: Add interval-tree.c 3 years ago
test-io-channel-buffer.c
test-io-channel-command.c tests: fix path separator, use g_build_filename() 3 years ago
test-io-channel-file.c tests: replace pipe() with g_unix_open_pipe(CLOEXEC) 4 years ago
test-io-channel-null.c io: add a QIOChannelNull equivalent to /dev/null 3 years ago
test-io-channel-socket.c tests/unit: Add a assert for test_io_channel_unix_listen_cleanup 1 year ago
test-io-channel-tls.c treewide: handle result of qio_channel_set_blocking() 1 month ago
test-io-task.c tests/unit/test-io-task: Rename "qemu:dummy" to avoid colon in the name 2 years ago
test-iov.c treewide: use qemu_set_blocking instead of g_unix_set_fd_nonblocking 1 month ago
test-keyval.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-logging.c util/log: Remove qemu_log_close 4 years ago
test-mul64.c
test-nested-aio-poll.c tests/unit: Remove debug statements in test-nested-aio-poll.c 2 years ago
test-opts-visitor.c
test-qapi-util.c
test-qdev-global-props.c qom: Have class_init() take a const data argument 6 months ago
test-qdist.c
test-qemu-opts.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-qga.c qga: Add tests for guest-get-load command 4 months ago
test-qgraph.c cleanup: Drop pointless return at end of function 6 months ago
test-qht.c
test-qmp-cmds.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-qmp-event.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-qobject-input-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-qobject-output-visitor.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-qtree.c util: import GTree as QTree 3 years ago
test-rcu-list.c replace TABs with spaces 3 years ago
test-rcu-simpleq.c
test-rcu-slist.c
test-rcu-tailq.c
test-replication.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-resv-mem.c include/system: Move exec/memory.h to system/memory.h 6 months ago
test-seccomp.c include: Rename sysemu/ -> system/ 10 months ago
test-shift128.c
test-smp-parse.c qom: Have class_init() take a const data argument 6 months ago
test-string-input-visitor.c Remove qemu-common.h include from most units 4 years ago
test-string-output-visitor.c Remove qemu-common.h include from most units 4 years ago
test-thread-pool.c thread-pool: Remove thread_pool_submit() function 8 months ago
test-throttle.c include: Rename sysemu/ -> system/ 10 months ago
test-timed-average.c include: Rename sysemu/ -> system/ 10 months ago
test-util-filemonitor.c test-util-filemonitor: Adapt to the FreeBSD inotify rename semantics 2 years ago
test-util-sockets.c tests/unit/test-util-sockets: fix mem-leak on error object 5 months ago
test-uuid.c util/uuid: Add UUID_STR_LEN definition 2 years ago
test-virtio-dmabuf.c hw/display: introduce virtio-dmabuf 2 years ago
test-visitor-serialization.c qapi: Move include/qapi/qmp/ to include/qobject/ 9 months ago
test-vmstate.c migration: Remove error variant of vmstate_save_state() function 3 weeks ago
test-write-threshold.c
test-x86-topo.c tests: Add test case of APIC ID for module level parsing 1 year ago
test-xbzrle.c migration/xbzrle: Use i386 host/cpuinfo.h 2 years ago
test-xs-node.c tests/unit: replace assert(0) with g_assert_not_reached() 1 year ago
test-yank.c include: Rename sysemu/ -> system/ 10 months ago