diff mbox

[kvm-unit-tests,5/6] x86: api: use try_main throughout

Message ID 1418391685-29153-6-git-send-email-pbonzini@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paolo Bonzini Dec. 12, 2014, 1:41 p.m. UTC
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 api/dirty-log-perf.cc | 8 +++++++-
 api/dirty-log.cc      | 8 +++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/api/dirty-log-perf.cc b/api/dirty-log-perf.cc
index af0b27e..16990a6 100644
--- a/api/dirty-log-perf.cc
+++ b/api/dirty-log-perf.cc
@@ -1,4 +1,5 @@ 
 #include "kvmxx.hh"
+#include "exception.hh"
 #include "memmap.hh"
 #include "identity.hh"
 #include <boost/thread/thread.hpp>
@@ -111,7 +112,7 @@  void parse_options(int ac, char **av)
            nr_slot_pages, nr_total_pages);
 }
 
-int main(int ac, char **av)
+int test_main(int ac, char **av)
 {
     kvm::system sys;
     kvm::vm vm(sys);
@@ -142,3 +143,8 @@  int main(int ac, char **av)
     check_dirty_log(vcpu, slot, mem_head);
     return 0;
 }
+
+int main(int ac, char** av)
+{
+    return try_main(test_main, ac, av);
+}
diff --git a/api/dirty-log.cc b/api/dirty-log.cc
index b65bed7..4e4bfc9 100644
--- a/api/dirty-log.cc
+++ b/api/dirty-log.cc
@@ -1,4 +1,5 @@ 
 #include "kvmxx.hh"
+#include "exception.hh"
 #include "memmap.hh"
 #include "identity.hh"
 #include <boost/thread/thread.hpp>
@@ -48,7 +49,7 @@  void check_dirty_log(mem_slot& slot,
 using boost::ref;
 using std::tr1::bind;
 
-int main(int ac, char **av)
+int test_main(int ac, char **av)
 {
     kvm::system sys;
     kvm::vm vm(sys);
@@ -76,3 +77,8 @@  int main(int ac, char **av)
     printf("Dirty bitmap failures: %d\n", nr_fail);
     return nr_fail == 0 ? 0 : 1;
 }
+
+int main(int ac, char** av)
+{
+    return try_main(test_main, ac, av);
+}