1 #ifndef _QEMU_VIRTIO_9P_H 2 #define _QEMU_VIRTIO_9P_H 3 4 #include "standard-headers/linux/virtio_9p.h" 5 #include "hw/virtio/virtio.h" 6 #include "9p.h" 7 8 typedef struct V9fsVirtioState 9 { 10 VirtIODevice parent_obj; 11 VirtQueue *vq; 12 size_t config_size; 13 V9fsPDU pdus[MAX_REQ]; 14 VirtQueueElement *elems[MAX_REQ]; 15 V9fsState state; 16 } V9fsVirtioState; 17 18 extern void virtio_9p_push_and_notify(V9fsPDU *pdu); 19 20 ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset, 21 const char *fmt, va_list ap); 22 ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset, 23 const char *fmt, va_list ap); 24 void virtio_init_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov, 25 unsigned int *pniov, bool is_write); 26 27 #define TYPE_VIRTIO_9P "virtio-9p-device" 28 #define VIRTIO_9P(obj) \ 29 OBJECT_CHECK(V9fsVirtioState, (obj), TYPE_VIRTIO_9P) 30 31 #endif 32