qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] Make the qemu_logfile handle thread safe.
@ 2019-11-15 13:10 Robert Foley
  2019-11-15 13:10 ` [PATCH v2 1/6] Fix double free issue in qemu_set_log_filename() Robert Foley
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Robert Foley @ 2019-11-15 13:10 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.puhov, alex.bennee, robert.foley

This patch adds thread safety to the qemu_logfile handle.  This now
allows changing the logfile while logging is active, and also solves 
the issue of a seg fault while changing the logfile.

This patch adds use of RCU for handling the swap out of the 
old qemu_logfile file descriptor.

Also added a few tests for logfile including changing the logfile
and closing the logfile.

One change also added for a pre-existing double free issue in 
qemu_set_log_filename() uncovered with the new test.

We also cleaned up the flow of code in qemu_set_log().

---
v2
    - This version of the patch adds some cleanup of code in
      qemu_set_log().
    - Also changed the order of patches to move our fix for the
      double free issue in qemu_set_log_filename() up to the beginning
      of the patch.
---
v1
    - This version of the patch incorporates changes 
      from the first round of review.  
    - It also includes a fix for an issue in
      qemu_set_log_filename().  This issue was uncovered 
      by the test added for this patch.
---
Robert Foley (6):
  Fix double free issue in qemu_set_log_filename().
  Cleaned up flow of code in qemu_set_log(), to simplify and clarify.
  Add a mutex to guarantee single writer to qemu_logfile handle.
  qemu_log_lock/unlock now preserves the qemu_logfile handle.
  Add use of RCU for qemu_logfile.
  Added tests for close and change of logfile.

 accel/tcg/cpu-exec.c          |   4 +-
 accel/tcg/translate-all.c     |   4 +-
 accel/tcg/translator.c        |   4 +-
 exec.c                        |   4 +-
 hw/net/can/can_sja1000.c      |   4 +-
 include/exec/log.h            |  33 +++++++++--
 include/qemu/log.h            |  49 +++++++++++++---
 net/can/can_socketcan.c       |   5 +-
 target/cris/translate.c       |   4 +-
 target/i386/translate.c       |   5 +-
 target/lm32/translate.c       |   4 +-
 target/microblaze/translate.c |   4 +-
 target/nios2/translate.c      |   4 +-
 target/tilegx/translate.c     |   7 ++-
 target/unicore32/translate.c  |   4 +-
 tcg/tcg.c                     |  28 ++++++----
 tests/test-logging.c          |  80 ++++++++++++++++++++++++++
 util/log.c                    | 102 ++++++++++++++++++++++++++--------
 18 files changed, 275 insertions(+), 74 deletions(-)

-- 
2.17.1



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-11-18 17:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 13:10 [PATCH v2 0/6] Make the qemu_logfile handle thread safe Robert Foley
2019-11-15 13:10 ` [PATCH v2 1/6] Fix double free issue in qemu_set_log_filename() Robert Foley
2019-11-15 13:10 ` [PATCH v2 2/6] Cleaned up flow of code in qemu_set_log(), to simplify and clarify Robert Foley
2019-11-18 12:07   ` Alex Bennée
2019-11-15 13:10 ` [PATCH v2 3/6] Add a mutex to guarantee single writer to qemu_logfile handle Robert Foley
2019-11-18 12:16   ` Alex Bennée
2019-11-18 12:50     ` Robert Foley
2019-11-15 13:10 ` [PATCH v2 4/6] qemu_log_lock/unlock now preserves the " Robert Foley
2019-11-15 13:10 ` [PATCH v2 5/6] Add use of RCU for qemu_logfile Robert Foley
2019-11-18 12:22   ` Alex Bennée
2019-11-18 13:01     ` Robert Foley
2019-11-18 13:23       ` Alex Bennée
2019-11-18 14:21         ` Robert Foley
2019-11-18 16:41           ` Alex Bennée
2019-11-18 17:44             ` Robert Foley
2019-11-15 13:10 ` [PATCH v2 6/6] Added tests for close and change of logfile Robert Foley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).