Extract the KVM_TRACE_DISABLE ioctl() call from cleanup_trace(), as
other parts of the code will use it.

Signed-off-by: Eduardo Habkost <[EMAIL PROTECTED]>
---
 user/kvmtrace.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/user/kvmtrace.c b/user/kvmtrace.c
index de3c189..5d154c1 100644
--- a/user/kvmtrace.c
+++ b/user/kvmtrace.c
@@ -460,6 +460,12 @@ static void stop_threads()
        }
 }
 
+static void disable_trace(void)
+{
+       if (ioctl(trace_information.fd, KVM_TRACE_DISABLE) < 0)
+               perror("KVM_TRACE_DISABLE");
+}
+
 static int start_trace(void)
 {
        int fd;
@@ -494,8 +500,7 @@ static void cleanup_trace(void)
 
        if (trace_information.trace_started) {
                trace_information.trace_started = 0;
-               if (ioctl(trace_information.fd, KVM_TRACE_DISABLE) < 0)
-                       perror("KVM_TRACE_DISABLE");
+               disable_trace();
        }
 
        close(trace_information.fd);
-- 
1.5.6.rc3.11.g5f54d

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to