virtio-9p.h 905 字节
Newer Older
1 2
#ifndef QEMU_VIRTIO_9P_H
#define QEMU_VIRTIO_9P_H
3

4
#include "standard-headers/linux/virtio_9p.h"
P
Paolo Bonzini 已提交
5
#include "hw/virtio/virtio.h"
W
Wei Liu 已提交
6
#include "9p.h"
7

W
Wei Liu 已提交
8 9 10 11 12 13
typedef struct V9fsVirtioState
{
    VirtIODevice parent_obj;
    VirtQueue *vq;
    size_t config_size;
    V9fsPDU pdus[MAX_REQ];
14
    VirtQueueElement *elems[MAX_REQ];
W
Wei Liu 已提交
15 16 17
    V9fsState state;
} V9fsVirtioState;

18
void virtio_9p_push_and_notify(V9fsPDU *pdu);
19

20 21 22 23
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);
24 25
void virtio_init_iov_from_pdu(V9fsPDU *pdu, struct iovec **piov,
                              unsigned int *pniov, bool is_write);
26

27 28
#define TYPE_VIRTIO_9P "virtio-9p-device"
#define VIRTIO_9P(obj) \
W
Wei Liu 已提交
29
        OBJECT_CHECK(V9fsVirtioState, (obj), TYPE_VIRTIO_9P)
30

31
#endif