From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46627) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsvDf-0001SI-3i for qemu-devel@nongnu.org; Fri, 06 Jun 2014 10:34:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsvDX-0001Fd-Lt for qemu-devel@nongnu.org; Fri, 06 Jun 2014 10:34:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:5033) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsvDX-0001FW-DU for qemu-devel@nongnu.org; Fri, 06 Jun 2014 10:34:03 -0400 From: Amos Kong Date: Fri, 6 Jun 2014 22:33:50 +0800 Message-Id: <1402065233-31894-2-git-send-email-akong@redhat.com> In-Reply-To: <1402065233-31894-1-git-send-email-akong@redhat.com> References: <1402065233-31894-1-git-send-email-akong@redhat.com> Subject: [Qemu-devel] [PATCH v4 1/4] virtio-blk-test.c: change pci_nop() to virtblk_init() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: stefanha@gmail.com, arei.gonglei@huawei.com, afaerber@suse.de I want to add a new subtest in virtio-blk-test.c, it will start guest without network. The original pci_init() did nothing, but it's good to reserve a very simple initialization testing. Signed-off-by: Amos Kong Reviewed-by: Stefan Hajnoczi --- tests/virtio-blk-test.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/tests/virtio-blk-test.c b/tests/virtio-blk-test.c index d53f875..0fdec01 100644 --- a/tests/virtio-blk-test.c +++ b/tests/virtio-blk-test.c @@ -12,9 +12,12 @@ #include "libqtest.h" #include "qemu/osdep.h" -/* Tests only initialization so far. TODO: Replace with functional tests */ -static void pci_nop(void) +/* Tests only initialization */ +static void virtblk_init(void) { + qtest_start("-drive id=drv0,if=none,file=/dev/null " + "-device virtio-blk-pci,drive=drv0"); + qtest_end(); } int main(int argc, char **argv) @@ -22,13 +25,9 @@ int main(int argc, char **argv) int ret; g_test_init(&argc, &argv, NULL); - qtest_add_func("/virtio/blk/pci/nop", pci_nop); + qtest_add_func("/virtio/blk/pci/init", virtblk_init); - qtest_start("-drive id=drv0,if=none,file=/dev/null " - "-device virtio-blk-pci,drive=drv0"); ret = g_test_run(); - qtest_end(); - return ret; } -- 1.9.3