1 #ifndef _QEMU_VIRTIO_9P_H
2 #define _QEMU_VIRTIO_9P_H
9 #include "file-op-9p.h"
11 /* The feature bitmap for virtio 9P */
12 /* The mount point is specified in a config variable */
13 #define VIRTIO_9P_MOUNT_TAG 0
60 #define P9_NOTAG (u16)(~0)
61 #define P9_NOFID (u32)(~0)
62 #define P9_MAXWELEM 16
64 typedef struct V9fsPDU V9fsPDU
;
71 VirtQueueElement elem
;
72 QLIST_ENTRY(V9fsPDU
) next
;
77 * 1) change user needs to set groups and stuff
80 /* from Linux's linux/virtio_9p.h */
82 /* The ID for virtio console */
83 #define VIRTIO_ID_9P 9
85 #define MAX_TAG_LEN 32
87 #define BUG_ON(cond) assert(!(cond))
89 typedef struct V9fsFidState V9fsFidState
;
91 typedef struct V9fsString
97 typedef struct V9fsQID
104 typedef struct V9fsStat
119 V9fsString extension
;
135 typedef struct V9fsState
139 V9fsPDU pdus
[MAX_REQ
];
140 QLIST_HEAD(, V9fsPDU
) free_list
;
141 V9fsFidState
*fid_list
;
149 struct virtio_9p_config
151 /* number of characters in tag */
153 /* Variable size tag name */
155 } __attribute__((packed
));
157 extern size_t pdu_packunpack(void *addr
, struct iovec
*sg
, int sg_count
,
158 size_t offset
, size_t size
, int pack
);
160 static inline size_t do_pdu_unpack(void *dst
, struct iovec
*sg
, int sg_count
,
161 size_t offset
, size_t size
)
163 return pdu_packunpack(dst
, sg
, sg_count
, offset
, size
, 0);