Received: from eggs.gnu.org ([2001:4830:134:3::10]:45351) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdu8b-0006XT-S0 for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:59:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zdu8X-0000gq-SC for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:59:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zdu8X-0000gV-N4 for qemu-devel@nongnu.org; Mon, 21 Sep 2015 01:59:37 -0400 From: Markus Armbruster References: <1442577640-11612-1-git-send-email-armbru@redhat.com> <1442577640-11612-3-git-send-email-armbru@redhat.com> <55FC3224.4010904@redhat.com> Date: Mon, 21 Sep 2015 07:59:35 +0200 In-Reply-To: <55FC3224.4010904@redhat.com> (Eric Blake's message of "Fri, 18 Sep 2015 09:47:48 -0600") Message-ID: <874miogvnc.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 2/7] libqtest: New hmp() & friends List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: ehabkost@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, afaerber@suse.de Eric Blake writes: > On 09/18/2015 06:00 AM, Markus Armbruster wrote: >> New convenience function hmp() to facilitate use of >> human-monitor-command in tests. Use it to simplify its existing uses. >> >> To blend into existing libqtest code, also add qtest_hmpv() and >> qtest_hmp(). That, and the egregiously verbose GTK-Doc comment format >> make this patch look bigger than it is. >> >> Signed-off-by: Markus Armbruster >> --- >> tests/drive_del-test.c | 22 ++++++---------------- >> tests/ide-test.c | 8 ++------ >> tests/libqtest.c | 35 +++++++++++++++++++++++++++++++++++ >> tests/libqtest.h | 33 +++++++++++++++++++++++++++++++++ >> 4 files changed, 76 insertions(+), 22 deletions(-) >> > > >> @@ -774,6 +801,14 @@ void qmp_discard_response(const char *fmt, ...) >> qtest_qmpv_discard_response(global_qtest, fmt, ap); >> va_end(ap); >> } >> +char *hmp(const char *fmt, ...) >> +{ >> + va_list ap; >> + >> + va_start(ap, fmt); >> + return qtest_hmpv(global_qtest, fmt, ap); >> + va_end(ap); > > Umm, that isn't quite what you meant :) D'oh! > With the dead code after return fixed, > > Reviewed-by: Eric Blake Thanks!