2010-04-29 20:14:44 +08:00
|
|
|
#ifndef _QEMU_VIRTIO_9P_H
|
|
|
|
#define _QEMU_VIRTIO_9P_H
|
|
|
|
|
2015-02-17 05:35:57 +08:00
|
|
|
#include "standard-headers/linux/virtio_9p.h"
|
2013-02-06 00:06:20 +08:00
|
|
|
#include "hw/virtio/virtio.h"
|
2016-01-08 02:18:02 +08:00
|
|
|
#include "9p.h"
|
2011-08-02 14:06:17 +08:00
|
|
|
|
2016-01-11 17:29:37 +08:00
|
|
|
typedef struct V9fsVirtioState
|
|
|
|
{
|
|
|
|
VirtIODevice parent_obj;
|
|
|
|
VirtQueue *vq;
|
|
|
|
size_t config_size;
|
|
|
|
V9fsPDU pdus[MAX_REQ];
|
|
|
|
VirtQueueElement elems[MAX_REQ];
|
|
|
|
V9fsState state;
|
|
|
|
} V9fsVirtioState;
|
|
|
|
|
2016-01-08 02:30:29 +08:00
|
|
|
extern void virtio_9p_push_and_notify(V9fsPDU *pdu);
|
|
|
|
|
2015-12-03 20:40:28 +08:00
|
|
|
ssize_t virtio_pdu_vmarshal(V9fsPDU *pdu, size_t offset,
|
|
|
|
const char *fmt, va_list ap);
|
|
|
|
ssize_t virtio_pdu_vunmarshal(V9fsPDU *pdu, size_t offset,
|
|
|
|
const char *fmt, va_list ap);
|
2015-12-03 21:21:51 +08:00
|
|
|
void virtio_init_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
|
|
|
|
unsigned int *pniov, bool is_write);
|
2015-12-03 20:40:28 +08:00
|
|
|
|
2013-04-23 17:08:40 +08:00
|
|
|
#define TYPE_VIRTIO_9P "virtio-9p-device"
|
|
|
|
#define VIRTIO_9P(obj) \
|
2016-01-11 17:29:37 +08:00
|
|
|
OBJECT_CHECK(V9fsVirtioState, (obj), TYPE_VIRTIO_9P)
|
2013-04-23 17:08:40 +08:00
|
|
|
|
2010-04-29 20:14:44 +08:00
|
|
|
#endif
|