tests/libqos: Utilize newer glib spawn check
commitb8e1f74b0a258db394a35272a44d14ec0b6e0be9
authorEric Blake <eblake@redhat.com>
Tue, 21 Aug 2018 19:05:16 +0000 (21 14:05 -0500)
committerThomas Huth <thuth@redhat.com>
Fri, 31 Aug 2018 07:53:09 +0000 (31 09:53 +0200)
treeeb7bec2a87cff4ad05a6362338c6933cb6128cd7
parentd18572dd9a4ee3f66d205912edae4d87a58ec11f
tests/libqos: Utilize newer glib spawn check

During development, I got a 'make check' failure that claimed:

qemu-img returned status code 32512
**
ERROR:tests/libqos/libqos.c:202:mkimg: assertion failed: (!rc)

But 32512 is too big for a normal exit status value, which means we
failed to use WEXITSTATUS() to shift the bits to the desired value
for printing.  However, instead of worrying about how to portably
parse g_spawn()'s rc in the proper platform-dependent manner, it's
better to just rely on the fact that we now require glib 2.40 (since
commit e7b3af815) and can therefore use glib's portable checker
instead, where the message under my same condition improves to:

Child process exited with code 127
**
ERROR:tests/libqos/libqos.c:192:mkimg: assertion failed: (ret && !err)

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
tests/libqos/libqos.c