From patchwork Thu Jun 20 06:55:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 252758 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 610C02C02AB for ; Thu, 20 Jun 2013 16:56:55 +1000 (EST) Received: from localhost ([::1]:40589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpYnd-0000HU-Bq for incoming@patchwork.ozlabs.org; Thu, 20 Jun 2013 02:56:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60318) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpYmP-00079Y-4c for qemu-devel@nongnu.org; Thu, 20 Jun 2013 02:55:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpYmL-0004ZR-PR for qemu-devel@nongnu.org; Thu, 20 Jun 2013 02:55:37 -0400 Received: from oxygen.pond.sub.org ([2a01:4f8:121:10e4::3]:38841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpYmL-0004Y8-Dk for qemu-devel@nongnu.org; Thu, 20 Jun 2013 02:55:33 -0400 Received: from blackfin.pond.sub.org (p5B32AC8A.dip0.t-ipconnect.de [91.50.172.138]) by oxygen.pond.sub.org (Postfix) with ESMTPA id F097CA5C63; Thu, 20 Jun 2013 08:55:30 +0200 (CEST) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1210F200B5; Thu, 20 Jun 2013 08:55:30 +0200 (CEST) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Thu, 20 Jun 2013 08:55:29 +0200 Message-Id: <1371711329-9144-3-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1371711329-9144-1-git-send-email-armbru@redhat.com> References: <1371711329-9144-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a01:4f8:121:10e4::3 Cc: aliguori@us.ibm.com, afaerber@suse.de Subject: [Qemu-devel] [PATCH v2 2/2] libqtest: New qtest_end() to go with qtest_start() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Markus Armbruster --- tests/fdc-test.c | 2 +- tests/hd-geo-test.c | 8 ++++---- tests/ide-test.c | 2 +- tests/libqtest.h | 12 ++++++++++++ 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/tests/fdc-test.c b/tests/fdc-test.c index 4b0301d..fd198dc 100644 --- a/tests/fdc-test.c +++ b/tests/fdc-test.c @@ -556,7 +556,7 @@ int main(int argc, char **argv) ret = g_test_run(); /* Cleanup */ - qtest_quit(global_qtest); + qtest_end(); unlink(test_image); return ret; diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c index 9a31e85..b72042e 100644 --- a/tests/hd-geo-test.c +++ b/tests/hd-geo-test.c @@ -244,7 +244,7 @@ static void test_ide_none(void) setup_common(argv, ARRAY_SIZE(argv)); qtest_start(g_strjoinv(" ", argv)); test_cmos(); - qtest_quit(global_qtest); + qtest_end(); } static void test_ide_mbr(bool use_device, MBRcontents mbr) @@ -262,7 +262,7 @@ static void test_ide_mbr(bool use_device, MBRcontents mbr) } qtest_start(g_strjoinv(" ", argv)); test_cmos(); - qtest_quit(global_qtest); + qtest_end(); } /* @@ -334,7 +334,7 @@ static void test_ide_drive_user(const char *dev, bool trans) g_free(opts); qtest_start(g_strjoinv(" ", argv)); test_cmos(); - qtest_quit(global_qtest); + qtest_end(); } /* @@ -387,7 +387,7 @@ static void test_ide_drive_cd_0(void) } qtest_start(g_strjoinv(" ", argv)); test_cmos(); - qtest_quit(global_qtest); + qtest_end(); } int main(int argc, char **argv) diff --git a/tests/ide-test.c b/tests/ide-test.c index 7e2eb94..7307f1d 100644 --- a/tests/ide-test.c +++ b/tests/ide-test.c @@ -122,7 +122,7 @@ static void ide_test_start(const char *cmdline_fmt, ...) static void ide_test_quit(void) { - qtest_quit(global_qtest); + qtest_end(); } static QPCIDevice *get_pci_device(uint16_t *bmdma_base) diff --git a/tests/libqtest.h b/tests/libqtest.h index 437bda3..0f6aade 100644 --- a/tests/libqtest.h +++ b/tests/libqtest.h @@ -17,6 +17,7 @@ #ifndef LIBQTEST_H #define LIBQTEST_H +#include #include #include #include @@ -319,6 +320,17 @@ static inline QTestState *qtest_start(const char *args) } /** + * qtest_end: + * + * Shut down the QEMU process started by qtest_start(). + */ +static inline void qtest_end(void) +{ + qtest_quit(global_qtest); + global_qtest = NULL; +} + +/** * qmp: * @fmt...: QMP message to send to qemu *