aboutsummaryrefslogtreecommitdiff
path: root/tests/test-vmstate.c
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2017-09-25 12:29:17 +0100
committerDr. David Alan Gilbert <dgilbert@redhat.com>2017-09-27 11:44:18 +0100
commit2f168d0708581c33baf6c78d75a89e8cd705f9f6 (patch)
treefd78df5cfa57d44091879e6906fd4d5736e35747 /tests/test-vmstate.c
parent687433f61173a9ed80609f16f8bc4b9255bd815c (diff)
downloadqemu-2f168d0708581c33baf6c78d75a89e8cd705f9f6.zip
qemu-2f168d0708581c33baf6c78d75a89e8cd705f9f6.tar.gz
qemu-2f168d0708581c33baf6c78d75a89e8cd705f9f6.tar.bz2
migration: Route more error paths
vmstate_save_state is called in lots of places. Route error returns from the easier cases back up; there are lots of more complex cases where their own error paths need fixing. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Message-Id: <20170925112917.21340-7-dgilbert@redhat.com> Reviewed-by: Peter Xu <peterx@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Commit message fix up as Peter's review
Diffstat (limited to 'tests/test-vmstate.c')
-rw-r--r--tests/test-vmstate.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/test-vmstate.c b/tests/test-vmstate.c
index e643ac6..087844b 100644
--- a/tests/test-vmstate.c
+++ b/tests/test-vmstate.c
@@ -70,7 +70,8 @@ static void save_vmstate(const VMStateDescription *desc, void *obj)
QEMUFile *f = open_test_file(true);
/* Save file with vmstate */
- vmstate_save_state(f, desc, obj, NULL);
+ int ret = vmstate_save_state(f, desc, obj, NULL);
+ g_assert(!ret);
qemu_put_byte(f, QEMU_VM_EOF);
g_assert(!qemu_file_get_error(f));
qemu_fclose(f);
@@ -381,7 +382,8 @@ static void test_save_noskip(void)
QEMUFile *fsave = open_test_file(true);
TestStruct obj = { .a = 1, .b = 2, .c = 3, .d = 4, .e = 5, .f = 6,
.skip_c_e = false };
- vmstate_save_state(fsave, &vmstate_skipping, &obj, NULL);
+ int ret = vmstate_save_state(fsave, &vmstate_skipping, &obj, NULL);
+ g_assert(!ret);
g_assert(!qemu_file_get_error(fsave));
uint8_t expected[] = {
@@ -402,7 +404,8 @@ static void test_save_skip(void)
QEMUFile *fsave = open_test_file(true);
TestStruct obj = { .a = 1, .b = 2, .c = 3, .d = 4, .e = 5, .f = 6,
.skip_c_e = true };
- vmstate_save_state(fsave, &vmstate_skipping, &obj, NULL);
+ int ret = vmstate_save_state(fsave, &vmstate_skipping, &obj, NULL);
+ g_assert(!ret);
g_assert(!qemu_file_get_error(fsave));
uint8_t expected[] = {