From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpHd5-0001CS-1W for qemu-devel@nongnu.org; Wed, 19 Jun 2013 08:36:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpHd3-0002uG-9M for qemu-devel@nongnu.org; Wed, 19 Jun 2013 08:36:50 -0400 Received: from cantor2.suse.de ([195.135.220.15]:35736 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpHd2-0002u9-Uh for qemu-devel@nongnu.org; Wed, 19 Jun 2013 08:36:49 -0400 Message-ID: <51C1A5DF.109@suse.de> Date: Wed, 19 Jun 2013 14:36:47 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1371627895-27046-1-git-send-email-armbru@redhat.com> <1371627895-27046-3-git-send-email-armbru@redhat.com> In-Reply-To: <1371627895-27046-3-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] libqtest: New qtest_end() to go with qtest_start() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org Am 19.06.2013 09:44, schrieb Markus Armbruster: > Signed-off-by: Markus Armbruster > --- > tests/fdc-test.c | 2 +- > tests/hd-geo-test.c | 8 ++++---- > tests/ide-test.c | 2 +- > tests/libqtest.h | 7 +++++++ > 4 files changed, 13 insertions(+), 6 deletions(-) >=20 > 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 =3D g_test_run(); > =20 > /* Cleanup */ > - qtest_quit(global_qtest); > + qtest_end(); > unlink(test_image); > =20 > 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(); > } > =20 > static void test_ide_mbr(bool use_device, MBRcontents mbr) > @@ -262,7 +262,7 @@ static void test_ide_mbr(bool use_device, MBRconten= ts mbr) > } > qtest_start(g_strjoinv(" ", argv)); > test_cmos(); > - qtest_quit(global_qtest); > + qtest_end(); > } > =20 > /* > @@ -334,7 +334,7 @@ static void test_ide_drive_user(const char *dev, bo= ol trans) > g_free(opts); > qtest_start(g_strjoinv(" ", argv)); > test_cmos(); > - qtest_quit(global_qtest); > + qtest_end(); > } > =20 > /* > @@ -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(); > } > =20 > 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,= ...) > =20 > static void ide_test_quit(void) > { > - qtest_quit(global_qtest); > + qtest_end(); > } > =20 > static QPCIDevice *get_pci_device(uint16_t *bmdma_base) > diff --git a/tests/libqtest.h b/tests/libqtest.h > index 437bda3..329325b 100644 > --- a/tests/libqtest.h > +++ b/tests/libqtest.h > @@ -17,6 +17,7 @@ > #ifndef LIBQTEST_H > #define LIBQTEST_H > =20 > +#include > #include > #include > #include > @@ -318,6 +319,12 @@ static inline QTestState *qtest_start(const char *= args) > return global_qtest; > } > =20 > +static inline void qtest_end(void) > +{ > + qtest_quit(global_qtest); > + global_qtest =3D NULL; > +} > + > /** > * qmp: > * @fmt...: QMP message to send to qemu >=20 Function and usage looks fine, but please add a gtk-doc comment. qtest_start() does have one. Thanks, Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg