Skip to contentSkip to conversation

vhost_net: Print feature masks in hex

PATCH In review Ilya Maximets 2 participants 2 messages Mar 18, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vhost_net: Print feature masks in hex

"0x200000000" is much more readable than "8589934592". The change saves one step (conversion) while debugging.

---
 hw/net/vhost_net.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/vhost_net.c +2 -2
index 30379d2ca4..df0f050548 100644
@@ -201,7 +201,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
             net->dev.features &= ~(1ULL << VIRTIO_NET_F_MRG_RXBUF);
         }
         if (~net->dev.features & net->dev.backend_features) {
-            fprintf(stderr, "vhost lacks feature mask %" PRIu64
+            fprintf(stderr, "vhost lacks feature mask 0x%" PRIx64
                    " for backend\n",
                    (uint64_t)(~net->dev.features & net->dev.backend_features));
             goto fail;
@@ -213,7 +213,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
     if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
         features = vhost_user_get_acked_features(net->nc);
         if (~net->dev.features & features) {
-            fprintf(stderr, "vhost lacks feature mask %" PRIu64
+            fprintf(stderr, "vhost lacks feature mask 0x%" PRIx64
                     " for backend\n",
                     (uint64_t)(~net->dev.features & features));
             goto fail;
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Ilya Maximets

"0x200000000" is much more readable than "8589934592". The change saves one step (conversion) while debugging.

---
  hw/net/vhost_net.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
hw/net/vhost_net.c +1 -1
index 30379d2ca4..df0f050548 100644
@@ -201,7 +201,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
              net->dev.features &= ~(1ULL << VIRTIO_NET_F_MRG_RXBUF);
          }
          if (~net->dev.features & net->dev.backend_features) {
-            fprintf(stderr, "vhost lacks feature mask %" PRIu64
+            fprintf(stderr, "vhost lacks feature mask 0x%" PRIx64
                     " for backend\n",
                     (uint64_t)(~net->dev.features & net->dev.backend_features));
              goto fail;

hw/net/vhost_net.c struct vhost_net *vhost_net_init(VhostNetOptions *options) · line 219

Quoted 8 lines
hw/net/vhost_net.c +1 -1
@@ -213,7 +213,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options)
      if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) {
          features = vhost_user_get_acked_features(net->nc);
          if (~net->dev.features & features) {
-            fprintf(stderr, "vhost lacks feature mask %" PRIu64
+            fprintf(stderr, "vhost lacks feature mask 0x%" PRIx64
                      " for backend\n",
                      (uint64_t)(~net->dev.features & features));
              goto fail;