From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58123) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsYAK-0005v7-RG for qemu-devel@nongnu.org; Fri, 07 Oct 2016 12:38:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsYAE-0006qL-SA for qemu-devel@nongnu.org; Fri, 07 Oct 2016 12:38:31 -0400 Received: from 9.mo6.mail-out.ovh.net ([87.98.171.146]:50648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsYAE-0006pV-Lt for qemu-devel@nongnu.org; Fri, 07 Oct 2016 12:38:26 -0400 Received: from player738.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo6.mail-out.ovh.net (Postfix) with ESMTP id 25E333783C for ; Fri, 7 Oct 2016 18:38:25 +0200 (CEST) Date: Fri, 7 Oct 2016 18:38:17 +0200 From: Greg Kurz Message-ID: <20161007183817.0185305e@bahia> In-Reply-To: <1475348164-8593-4-git-send-email-lvivier@redhat.com> References: <1475348164-8593-1-git-send-email-lvivier@redhat.com> <1475348164-8593-4-git-send-email-lvivier@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 3/5] tests: use qtest_pc_boot()/qtest_shutdown() in virtio tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Vivier Cc: qemu-devel@nongnu.org, dgibson@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org On Sat, 1 Oct 2016 20:56:02 +0200 Laurent Vivier wrote: > This patch replaces calls to qtest_start() and qtest_end() by > calls to qtest_pc_boot() and qtest_shutdown(). > > This allows to initialize memory allocator and PCI interface > functions. This will ease to enable virtio tests on other > architectures by only adding a specific qtest_XXX_boot() (like > qtest_spapr_boot()). > > Signed-off-by: Laurent Vivier > Reviewed-by: Greg Kurz > --- Oops I had missed it during review but I have a single remark for the 9p test. My R-b stands anyway. > tests/virtio-9p-test.c | 51 +++++++--------- > tests/virtio-blk-test.c | 150 ++++++++++++++++++++--------------------------- > tests/virtio-net-test.c | 39 +++++------- > tests/virtio-scsi-test.c | 67 +++++++++------------ > 4 files changed, 129 insertions(+), 178 deletions(-) > > diff --git a/tests/virtio-9p-test.c b/tests/virtio-9p-test.c > index e8b2196..7698014 100644 > --- a/tests/virtio-9p-test.c > +++ b/tests/virtio-9p-test.c > @@ -10,62 +10,56 @@ > #include "qemu/osdep.h" > #include "libqtest.h" > #include "qemu-common.h" > -#include "libqos/pci-pc.h" > +#include "libqos/libqos-pc.h" > #include "libqos/virtio.h" > #include "libqos/virtio-pci.h" > -#include "libqos/malloc.h" > -#include "libqos/malloc-pc.h" > #include "standard-headers/linux/virtio_ids.h" > #include "standard-headers/linux/virtio_pci.h" > > static const char mount_tag[] = "qtest"; > static char *test_share; > > -static void qvirtio_9p_start(void) > -{ > - char *args; > > +static QOSState *qvirtio_9p_start(void) > +{ > test_share = g_strdup("/tmp/qtest.XXXXXX"); > g_assert_nonnull(mkdtemp(test_share)); > + const char *cmd = "-fsdev local,id=fsdev0,security_model=none,path=%s " > + "-device virtio-9p-pci,fsdev=fsdev0,mount_tag=%s"; > Even if C99 supports declarations within the code, I prefer the old school way of declaring variables followed by an empty line, at the top. Cheers. -- Greg