From 877ad144b67573d7d102268958ebedbb318b738c Mon Sep 17 00:00:00 2001 From: Steven Date: Thu, 20 Sep 2018 11:50:35 -0700 Subject: vhost: show vhost may display garbage after the interface name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DBGvpp# show vhost-user Virtio vhost-user interfaces Global: coalesce frames 32 time 1e-3 number of rx virtqueues in interrupt mode: 0 Interface: VirtualEthernet0/0/0�?x�D (ifindex 3) The fix is to use format_vnet_hw_if_index_name rather than hi->name. The former format the name with %v rather than %s Change-Id: If4d275e1eb249cf87b2d6b796b42f24769f9e3e3 Signed-off-by: Steven --- src/vnet/devices/virtio/vhost_user.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/vnet/devices/virtio/vhost_user.c') diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c index 796be4b80a2..6259096830a 100644 --- a/src/vnet/devices/virtio/vhost_user.c +++ b/src/vnet/devices/virtio/vhost_user.c @@ -1777,8 +1777,9 @@ show_vhost_user_command_fn (vlib_main_t * vm, { hi = vnet_get_hw_interface (vnm, hw_if_indices[i]); vui = pool_elt_at_index (vum->vhost_user_interfaces, hi->dev_instance); - vlib_cli_output (vm, "Interface: %s (ifindex %d)", - hi->name, hw_if_indices[i]); + vlib_cli_output (vm, "Interface: %U (ifindex %d)", + format_vnet_hw_if_index_name, vnm, hw_if_indices[i], + hw_if_indices[i]); vlib_cli_output (vm, "virtio_net_hdr_sz %d\n" " features mask (0x%llx): \n" -- cgit 1.2.3-korg