aboutsummaryrefslogtreecommitdiff
path: root/simpletrace.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-03-13 20:14:30 +0000
committerBlue Swirl <blauwirbel@gmail.com>2011-03-15 18:03:26 +0000
commit31d3c9b8c15d7b42f508d5fc2adc4abb7c732b70 (patch)
tree06e4b51f2b49992dac1196d1eb3e6cb62df0f026 /simpletrace.c
parentcc015e9a5dde2f03f123357fa060acbdfcd570a4 (diff)
downloadqemu-31d3c9b8c15d7b42f508d5fc2adc4abb7c732b70.zip
qemu-31d3c9b8c15d7b42f508d5fc2adc4abb7c732b70.tar.gz
qemu-31d3c9b8c15d7b42f508d5fc2adc4abb7c732b70.tar.bz2
simpletrace: Move st_init() error reporting
User emulator builds do not have error_report() so it should not be used by simpletrace.c. In fact, error reporting inside simpletrace.c is inappropriate and should be done by the caller instead. This patch moves st_init() error reporting out to its caller, vl.c:main(). Reported-by: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'simpletrace.c')
-rw-r--r--simpletrace.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/simpletrace.c b/simpletrace.c
index 9926ab3..f1dbb5e 100644
--- a/simpletrace.c
+++ b/simpletrace.c
@@ -14,7 +14,6 @@
#include <time.h>
#include <signal.h>
#include <pthread.h>
-#include "qerror.h"
#include "qemu-timer.h"
#include "trace.h"
@@ -331,7 +330,7 @@ void st_flush_trace_buffer(void)
flush_trace_file(true);
}
-void st_init(const char *file)
+bool st_init(const char *file)
{
pthread_t thread;
pthread_attr_t attr;
@@ -347,10 +346,10 @@ void st_init(const char *file)
pthread_sigmask(SIG_SETMASK, &oldset, NULL);
if (ret != 0) {
- error_report("warning: unable to create trace file thread\n");
- return;
+ return false;
}
atexit(st_flush_trace_buffer);
st_set_trace_file(file);
+ return true;
}