virtio: refactor code

Type: refactor

Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Change-Id: I3788cc857023fafcc8eb6d6ff4524425026a75d8
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c
index 0d24ad5..9c58572 100644
--- a/src/vnet/devices/virtio/vhost_user.c
+++ b/src/vnet/devices/virtio/vhost_user.c
@@ -689,9 +689,12 @@
 	  goto close_socket;
 	}
 
-      vring_desc_t *desc = map_user_mem (vui, msg.addr.desc_user_addr);
-      vring_used_t *used = map_user_mem (vui, msg.addr.used_user_addr);
-      vring_avail_t *avail = map_user_mem (vui, msg.addr.avail_user_addr);
+      vnet_virtio_vring_desc_t *desc =
+	map_user_mem (vui, msg.addr.desc_user_addr);
+      vnet_virtio_vring_used_t *used =
+	map_user_mem (vui, msg.addr.used_user_addr);
+      vnet_virtio_vring_avail_t *avail =
+	map_user_mem (vui, msg.addr.avail_user_addr);
 
       if ((desc == NULL) || (used == NULL) || (avail == NULL))
 	{
@@ -1930,7 +1933,8 @@
 {
   char *fmt = va_arg (*args, char *);
   vhost_user_intf_t *vui = va_arg (*args, vhost_user_intf_t *);
-  vring_desc_t *desc_table = va_arg (*args, vring_desc_t *);
+  vnet_virtio_vring_desc_t *desc_table =
+    va_arg (*args, vnet_virtio_vring_desc_t *);
   int idx = va_arg (*args, int);
   u32 *mem_hint = va_arg (*args, u32 *);
 
@@ -1959,7 +1963,7 @@
   u32 mem_hint = 0;
   u32 idx;
   u32 n_entries;
-  vring_desc_t *desc_table;
+  vnet_virtio_vring_desc_t *desc_table;
   vhost_user_vring_t *vq = &vui->vrings[q];
 
   if (vq->avail && vq->used)
@@ -1989,7 +1993,8 @@
 			   desc_table, j, &mem_hint);
 	  if (show_verbose && (desc_table[j].flags & VRING_DESC_F_INDIRECT))
 	    {
-	      n_entries = desc_table[j].len / sizeof (vring_desc_t);
+	      n_entries =
+		desc_table[j].len / sizeof (vnet_virtio_vring_desc_t);
 	      desc_table = map_guest_mem (vui, desc_table[j].addr, &mem_hint);
 	      if (desc_table)
 		{
@@ -2014,7 +2019,8 @@
 {
   char *fmt = va_arg (*args, char *);
   vhost_user_intf_t *vui = va_arg (*args, vhost_user_intf_t *);
-  vring_packed_desc_t *desc_table = va_arg (*args, vring_packed_desc_t *);
+  vnet_virtio_vring_packed_desc_t *desc_table =
+    va_arg (*args, vnet_virtio_vring_packed_desc_t *);
   int idx = va_arg (*args, int);
   u32 *mem_hint = va_arg (*args, u32 *);
 
@@ -2056,7 +2062,7 @@
   u32 mem_hint = 0;
   u32 idx;
   u32 n_entries;
-  vring_packed_desc_t *desc_table;
+  vnet_virtio_vring_packed_desc_t *desc_table;
   vhost_user_vring_t *vq = &vui->vrings[q];
   u16 off_wrap, event_idx;