From patchwork Thu Dec 21 17:07:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 10128067 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EFC536019C for ; Thu, 21 Dec 2017 17:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D91CA29CBE for ; Thu, 21 Dec 2017 17:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE3DE29D1F; Thu, 21 Dec 2017 17:11:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7CB6A29CBE for ; Thu, 21 Dec 2017 17:11:00 +0000 (UTC) Received: from localhost ([::1]:59913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eS4N1-00067E-Ev for patchwork-qemu-devel@patchwork.kernel.org; Thu, 21 Dec 2017 12:10:59 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eS4Jt-0003JF-B8 for qemu-devel@nongnu.org; Thu, 21 Dec 2017 12:07:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eS4Js-0001AV-Dj for qemu-devel@nongnu.org; Thu, 21 Dec 2017 12:07:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53696) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eS4Js-0001A5-7H for qemu-devel@nongnu.org; Thu, 21 Dec 2017 12:07:44 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6E7F8624BE for ; Thu, 21 Dec 2017 17:07:43 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-35.ams2.redhat.com [10.36.112.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 05BE53819B; Thu, 21 Dec 2017 17:07:39 +0000 (UTC) From: Maxime Coquelin To: qemu-devel@nongnu.org, stefanha@redhat.com, mst@redhat.com Date: Thu, 21 Dec 2017 18:07:14 +0100 Message-Id: <20171221170716.10709-4-maxime.coquelin@redhat.com> In-Reply-To: <20171221170716.10709-1-maxime.coquelin@redhat.com> References: <20171221170716.10709-1-maxime.coquelin@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Thu, 21 Dec 2017 17:07:43 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/5] vhost-user-test: make features mask an init_virtio_dev() argument X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxime Coquelin , mlureau@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The goal is to generalize the use of [un]init_virtio_dev() to all tests, which does not necessarily expose the same features set. Signed-off-by: Maxime Coquelin --- tests/vhost-user-test.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c index be463fe7f2..be7a401789 100644 --- a/tests/vhost-user-test.c +++ b/tests/vhost-user-test.c @@ -164,7 +164,7 @@ typedef struct TestServer { static const char *tmpfs; static const char *root; -static void init_virtio_dev(TestServer *s) +static void init_virtio_dev(TestServer *s, uint32_t features_mask) { uint32_t features; int i; @@ -187,7 +187,7 @@ static void init_virtio_dev(TestServer *s) } features = qvirtio_get_features(&s->dev->vdev); - features = features & VIRTIO_NET_F_MAC; + features = features & features_mask; qvirtio_set_features(&s->dev->vdev, features); qvirtio_set_driver_ok(&s->dev->vdev); @@ -652,7 +652,7 @@ static void test_read_guest_mem(void) s = qtest_start(qemu_cmd); g_free(qemu_cmd); - init_virtio_dev(server); + init_virtio_dev(server, VIRTIO_NET_F_MAC); read_guest_mem(server); @@ -681,7 +681,7 @@ static void test_migrate(void) from = qtest_start(cmd); g_free(cmd); - init_virtio_dev(s); + init_virtio_dev(s, VIRTIO_NET_F_MAC); wait_for_fds(s); size = get_log_size(s); g_assert_cmpint(size, ==, (2 * 1024 * 1024) / (VHOST_LOG_PAGE * 8)); @@ -803,7 +803,7 @@ static void test_reconnect_subprocess(void) qtest_start(cmd); g_free(cmd); - init_virtio_dev(s); + init_virtio_dev(s, VIRTIO_NET_F_MAC); wait_for_fds(s); wait_for_rings_started(s, 2); @@ -841,7 +841,7 @@ static void test_connect_fail_subprocess(void) qtest_start(cmd); g_free(cmd); - init_virtio_dev(s); + init_virtio_dev(s, VIRTIO_NET_F_MAC); wait_for_fds(s); wait_for_rings_started(s, 2); @@ -871,7 +871,7 @@ static void test_flags_mismatch_subprocess(void) qtest_start(cmd); g_free(cmd); - init_virtio_dev(s); + init_virtio_dev(s, VIRTIO_NET_F_MAC); wait_for_fds(s); wait_for_rings_started(s, 2);