diff mbox

[v2,2/3] linux-headers: sync vhost.h

Message ID 20150402140407.734.93074.stgit@bahia.lab.toulouse-stg.fr.ibm.com
State New
Headers show

Commit Message

Greg Kurz April 2, 2015, 2:04 p.m. UTC
This patch brings the cross-endian vhost API to QEMU.

Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
 linux-headers/linux/vhost.h |   10 ++++++++++
 1 file changed, 10 insertions(+)
diff mbox

Patch

diff --git a/linux-headers/linux/vhost.h b/linux-headers/linux/vhost.h
index c656f61..e040bcb 100644
--- a/linux-headers/linux/vhost.h
+++ b/linux-headers/linux/vhost.h
@@ -47,6 +47,11 @@  struct vhost_vring_addr {
 	__u64 log_guest_addr;
 };
 
+struct vhost_vring_endian {
+	unsigned int index;
+	bool is_big_endian;
+};
+
 struct vhost_memory_region {
 	__u64 guest_phys_addr;
 	__u64 memory_size; /* bytes */
@@ -103,6 +108,9 @@  struct vhost_memory {
 /* Get accessor: reads index, writes value in num */
 #define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state)
 
+/* Set endianness for the ring (legacy virtio only) */
+#define VHOST_SET_VRING_ENDIAN_LEGACY _IOW(VHOST_VIRTIO, 0x13, struct vhost_vring_endian)
+
 /* The following ioctls use eventfd file descriptors to signal and poll
  * for events. */
 
@@ -126,6 +134,8 @@  struct vhost_memory {
 #define VHOST_F_LOG_ALL 26
 /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */
 #define VHOST_NET_F_VIRTIO_NET_HDR 27
+/* the vring endianness can be explicitely set (legacy virtio only). */
+#define VHOST_F_SET_ENDIAN_LEGACY 28
 
 /* VHOST_SCSI specific definitions */