diff options
author | Robert Foley <robert.foley@linaro.org> | 2019-11-18 16:15:27 -0500 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2019-12-18 20:18:02 +0000 |
commit | 7606488c0efa8f631d31ab9ff8d33b7cf3e2a4c9 (patch) | |
tree | 7d8c50f162c7cf51b14ddf02377e426e6dae7b83 /tests/test-logging.c | |
parent | fc59d2d870caddf5cd9c85836ee4a8c59ffe7617 (diff) |
Add use of RCU for qemu_logfile.
This now allows changing the logfile while logging is active,
and also solves the issue of a seg fault while changing the logfile.
Any read access to the qemu_logfile handle will use
the rcu_read_lock()/unlock() around the use of the handle.
To fetch the handle we will use atomic_rcu_read().
We also in many cases do a check for validity of the
logfile handle before using it to deal with the case where the
file is closed and set to NULL.
The cases where we write to the qemu_logfile will use atomic_rcu_set().
Writers will also use call_rcu() with a newly added qemu_logfile_free
function for freeing/closing when readers have finished.
Signed-off-by: Robert Foley <robert.foley@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20191118211528.3221-6-robert.foley@linaro.org>
Diffstat (limited to 'tests/test-logging.c')
0 files changed, 0 insertions, 0 deletions