diff mbox

[4/5] vhost-user-test: fix features mask

Message ID 20171221170716.10709-5-maxime.coquelin@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maxime Coquelin Dec. 21, 2017, 5:07 p.m. UTC
VIRTIO_NET_F_MAC is a bit position, not a bit mask.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 tests/vhost-user-test.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Marc-André Lureau Dec. 21, 2017, 5:18 p.m. UTC | #1
Hi

----- Original Message -----
> VIRTIO_NET_F_MAC is a bit position, not a bit mask.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Fixing this before patch 3 would make sense.

> ---
>  tests/vhost-user-test.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
> index be7a401789..6a144e8d7e 100644
> --- a/tests/vhost-user-test.c
> +++ b/tests/vhost-user-test.c
> @@ -652,7 +652,7 @@ static void test_read_guest_mem(void)
>      s = qtest_start(qemu_cmd);
>      g_free(qemu_cmd);
>  
> -    init_virtio_dev(server, VIRTIO_NET_F_MAC);
> +    init_virtio_dev(server, 1u << 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, VIRTIO_NET_F_MAC);
> +    init_virtio_dev(s, 1u << 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, VIRTIO_NET_F_MAC);
> +    init_virtio_dev(s, 1u << 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, VIRTIO_NET_F_MAC);
> +    init_virtio_dev(s, 1u << 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, VIRTIO_NET_F_MAC);
> +    init_virtio_dev(s, 1u << VIRTIO_NET_F_MAC);
>      wait_for_fds(s);
>      wait_for_rings_started(s, 2);
>  
> --
> 2.14.3
> 
>
Maxime Coquelin Dec. 21, 2017, 5:29 p.m. UTC | #2
On 12/21/2017 06:18 PM, Marc-André Lureau wrote:
> Hi
> 
> ----- Original Message -----
>> VIRTIO_NET_F_MAC is a bit position, not a bit mask.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> Fixing this before patch 3 would make sense.

Yes, you're right.
I'll make it patch #1 in v2.

Thanks,
Maxime
diff mbox

Patch

diff --git a/tests/vhost-user-test.c b/tests/vhost-user-test.c
index be7a401789..6a144e8d7e 100644
--- a/tests/vhost-user-test.c
+++ b/tests/vhost-user-test.c
@@ -652,7 +652,7 @@  static void test_read_guest_mem(void)
     s = qtest_start(qemu_cmd);
     g_free(qemu_cmd);
 
-    init_virtio_dev(server, VIRTIO_NET_F_MAC);
+    init_virtio_dev(server, 1u << 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, VIRTIO_NET_F_MAC);
+    init_virtio_dev(s, 1u << 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, VIRTIO_NET_F_MAC);
+    init_virtio_dev(s, 1u << 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, VIRTIO_NET_F_MAC);
+    init_virtio_dev(s, 1u << 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, VIRTIO_NET_F_MAC);
+    init_virtio_dev(s, 1u << VIRTIO_NET_F_MAC);
     wait_for_fds(s);
     wait_for_rings_started(s, 2);