1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-23 21:34:54 +03:00
libvirt/tests/commanddata
Michal Privoznik d146105f1e virCommand: Actually acquire pidfile instead of just writing it
Our virCommand module allows us to set a pidfile for commands we
want to spawn. The caller constructs the string of pidfile path
and then uses virCommandSetPidFile() to tell the module to write
the pidfile once the command is ran. This usually works, but has
two flaws:

1) the child process does not hold the pidfile open & locked.
Therefore, the caller (or anybody else) can't use our fancy
virPidFileForceCleanupPath() function to kill the command
afterwards. Also, for everybody else on the system it's
needlessly harder to check if the pid from the pidfile is still
alive or not.

2) if the caller ever makes a mistake and passes the same pidfile
path for two different commands, the start of the second command
will overwrite the pidfile even though the first command might
still be running.

NOTE that this temporarily renders some command spawning
unusable, specifically those code patterns where both
virCommandSetPidFile() is used together with instructing spawned
command to acquire pidfile itself. Fortunately, there is only one
occurrence of such pattern and it is in
qemuProcessStartManagedPRDaemon(). This is fixed in next commit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2020-03-24 15:44:23 +01:00
..
test2.log tests: fix typo 2017-11-20 13:22:48 +01:00
test3.log tests: remove event loop from command test 2020-02-04 14:00:44 +00:00
test4.log virCommand: Actually acquire pidfile instead of just writing it 2020-03-24 15:44:23 +01:00
test5.log tests: fix typo 2017-11-20 13:22:48 +01:00
test6.log
test7.log tests: fix typo 2017-11-20 13:22:48 +01:00
test8.log
test9.log tests: fix typo 2017-11-20 13:22:48 +01:00
test10.log tests: fix typo 2017-11-20 13:22:48 +01:00
test11.log tests: fix typo 2017-11-20 13:22:48 +01:00
test12.log tests: fix typo 2017-11-20 13:22:48 +01:00
test13.log tests: fix typo 2017-11-20 13:22:48 +01:00
test14.log tests: fix typo 2017-11-20 13:22:48 +01:00
test15.log tests: fix typo 2017-11-20 13:22:48 +01:00
test16.log
test20.log tests: fix typo 2017-11-20 13:22:48 +01:00
test21.log tests: fix typo 2017-11-20 13:22:48 +01:00
test26.log qemu: use line breaks in command line args written to log 2018-12-17 15:02:11 +00:00
test27.log tests: remove event loop from command test 2020-02-04 14:00:44 +00:00