cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-libqtest-New-qtest_end-to-go-with-qtest_start.patch

218e99
From ab193a7368375c73e232f3b64d9c372c70bbf52c Mon Sep 17 00:00:00 2001
218e99
Message-Id: <ab193a7368375c73e232f3b64d9c372c70bbf52c.1383564115.git.minovotn@redhat.com>
218e99
In-Reply-To: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
218e99
References: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
218e99
From: Markus Armbruster <armbru@redhat.com>
218e99
Date: Fri, 27 Sep 2013 13:31:18 +0200
218e99
Subject: [PATCH 08/14] libqtest: New qtest_end() to go with qtest_start()
218e99
MIME-Version: 1.0
218e99
Content-Type: text/plain; charset=UTF-8
218e99
Content-Transfer-Encoding: 8bit
218e99
218e99
RH-Author: Markus Armbruster <armbru@redhat.com>
218e99
Message-id: <1380288680-26645-9-git-send-email-armbru@redhat.com>
218e99
Patchwork-id: 54566
218e99
O-Subject: [PATCH 7.0 qemu-kvm 08/10] libqtest: New qtest_end() to go with qtest_start()
218e99
Bugzilla: 997817
218e99
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
218e99
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
218e99
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
218e99
218e99
From: Markus Armbruster <armbru@redhat.com>
218e99
218e99
Signed-off-by: Markus Armbruster <armbru@redhat.com>
218e99
Reviewed-by: Andreas Färber <afaerber@suse.de>
218e99
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
218e99
Message-id: 1371711329-9144-3-git-send-email-armbru@redhat.com
218e99
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
218e99
(cherry picked from commit 1d9358e686125c125b52529fa68baf36aa2d0d09)
218e99
---
218e99
 tests/fdc-test.c    |  2 +-
218e99
 tests/hd-geo-test.c |  8 ++++----
218e99
 tests/ide-test.c    |  2 +-
218e99
 tests/libqtest.h    | 12 ++++++++++++
218e99
 4 files changed, 18 insertions(+), 6 deletions(-)
218e99
218e99
Signed-off-by: Michal Novotny <minovotn@redhat.com>
218e99
---
218e99
 tests/fdc-test.c    |  2 +-
218e99
 tests/hd-geo-test.c |  8 ++++----
218e99
 tests/ide-test.c    |  2 +-
218e99
 tests/libqtest.h    | 12 ++++++++++++
218e99
 4 files changed, 18 insertions(+), 6 deletions(-)
218e99
218e99
diff --git a/tests/fdc-test.c b/tests/fdc-test.c
218e99
index 4b0301d..fd198dc 100644
218e99
--- a/tests/fdc-test.c
218e99
+++ b/tests/fdc-test.c
218e99
@@ -556,7 +556,7 @@ int main(int argc, char **argv)
218e99
     ret = g_test_run();
218e99
 
218e99
     /* Cleanup */
218e99
-    qtest_quit(global_qtest);
218e99
+    qtest_end();
218e99
     unlink(test_image);
218e99
 
218e99
     return ret;
218e99
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
218e99
index 9a31e85..b72042e 100644
218e99
--- a/tests/hd-geo-test.c
218e99
+++ b/tests/hd-geo-test.c
218e99
@@ -244,7 +244,7 @@ static void test_ide_none(void)
218e99
     setup_common(argv, ARRAY_SIZE(argv));
218e99
     qtest_start(g_strjoinv(" ", argv));
218e99
     test_cmos();
218e99
-    qtest_quit(global_qtest);
218e99
+    qtest_end();
218e99
 }
218e99
 
218e99
 static void test_ide_mbr(bool use_device, MBRcontents mbr)
218e99
@@ -262,7 +262,7 @@ static void test_ide_mbr(bool use_device, MBRcontents mbr)
218e99
     }
218e99
     qtest_start(g_strjoinv(" ", argv));
218e99
     test_cmos();
218e99
-    qtest_quit(global_qtest);
218e99
+    qtest_end();
218e99
 }
218e99
 
218e99
 /*
218e99
@@ -334,7 +334,7 @@ static void test_ide_drive_user(const char *dev, bool trans)
218e99
     g_free(opts);
218e99
     qtest_start(g_strjoinv(" ", argv));
218e99
     test_cmos();
218e99
-    qtest_quit(global_qtest);
218e99
+    qtest_end();
218e99
 }
218e99
 
218e99
 /*
218e99
@@ -387,7 +387,7 @@ static void test_ide_drive_cd_0(void)
218e99
     }
218e99
     qtest_start(g_strjoinv(" ", argv));
218e99
     test_cmos();
218e99
-    qtest_quit(global_qtest);
218e99
+    qtest_end();
218e99
 }
218e99
 
218e99
 int main(int argc, char **argv)
218e99
diff --git a/tests/ide-test.c b/tests/ide-test.c
218e99
index 365e995..177ab00 100644
218e99
--- a/tests/ide-test.c
218e99
+++ b/tests/ide-test.c
218e99
@@ -120,7 +120,7 @@ static void ide_test_start(const char *cmdline_fmt, ...)
218e99
 
218e99
 static void ide_test_quit(void)
218e99
 {
218e99
-    qtest_quit(global_qtest);
218e99
+    qtest_end();
218e99
 }
218e99
 
218e99
 static QPCIDevice *get_pci_device(uint16_t *bmdma_base)
218e99
diff --git a/tests/libqtest.h b/tests/libqtest.h
218e99
index 437bda3..0f6aade 100644
218e99
--- a/tests/libqtest.h
218e99
+++ b/tests/libqtest.h
218e99
@@ -17,6 +17,7 @@
218e99
 #ifndef LIBQTEST_H
218e99
 #define LIBQTEST_H
218e99
 
218e99
+#include <stddef.h>
218e99
 #include <stdint.h>
218e99
 #include <stdbool.h>
218e99
 #include <stdarg.h>
218e99
@@ -319,6 +320,17 @@ static inline QTestState *qtest_start(const char *args)
218e99
 }
218e99
 
218e99
 /**
218e99
+ * qtest_end:
218e99
+ *
218e99
+ * Shut down the QEMU process started by qtest_start().
218e99
+ */
218e99
+static inline void qtest_end(void)
218e99
+{
218e99
+    qtest_quit(global_qtest);
218e99
+    global_qtest = NULL;
218e99
+}
218e99
+
218e99
+/**
218e99
  * qmp:
218e99
  * @fmt...: QMP message to send to qemu
218e99
  *
218e99
-- 
218e99
1.7.11.7
218e99