« Previous | Next » 

Revision 6bf00766

ID6bf0076643dac4f37cabb9233dc9170f1c2fdd49

Added by Eduardo Habkost over 11 years ago

libqtest: Wait for the right child PID after killing QEMU

When running "make check" with gcov enabled, we get the following
message:

hw/tmp105.gcda:cannot open data file, assuming not executed

The problem happens because:

  • tmp105-test exits before QEMU exits, because waitpid() at
    qtest_quit() fails;
  • waitpid() fails because there's another process already
    waiting for the QEMU process;
  • The process that is already waiting for QEMU is the child created by
    qtest_init() to run system();
  • qtest_quit() is incorrectly waiting for the QEMU PID directly instead
    of the child created by qtest_init().

This fixes the problem by sending SIGTERM to QEMU, but waiting for the
child process created by qtest_init() (that exits immediately after QEMU
exits).

Reported-by: Andreas Färber <>
Signed-off-by: Eduardo Habkost <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences