2019-09-30 13:51:34 +03:00
|
|
|
/*
|
|
|
|
* Vhost-user filesystem virtio device
|
|
|
|
*
|
|
|
|
* Copyright 2018-2019 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or
|
|
|
|
* (at your option) any later version. See the COPYING file in the
|
|
|
|
* top-level directory.
|
|
|
|
*/
|
|
|
|
|
2022-05-06 16:49:09 +03:00
|
|
|
#ifndef QEMU_VHOST_USER_FS_H
|
|
|
|
#define QEMU_VHOST_USER_FS_H
|
2019-09-30 13:51:34 +03:00
|
|
|
|
|
|
|
#include "hw/virtio/virtio.h"
|
|
|
|
#include "hw/virtio/vhost.h"
|
|
|
|
#include "hw/virtio/vhost-user.h"
|
|
|
|
#include "chardev/char-fe.h"
|
2020-09-03 23:43:22 +03:00
|
|
|
#include "qom/object.h"
|
2019-09-30 13:51:34 +03:00
|
|
|
|
|
|
|
#define TYPE_VHOST_USER_FS "vhost-user-fs-device"
|
2020-09-16 21:25:19 +03:00
|
|
|
OBJECT_DECLARE_SIMPLE_TYPE(VHostUserFS, VHOST_USER_FS)
|
2019-09-30 13:51:34 +03:00
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
CharBackend chardev;
|
|
|
|
char *tag;
|
|
|
|
uint16_t num_request_queues;
|
|
|
|
uint16_t queue_size;
|
|
|
|
} VHostUserFSConf;
|
|
|
|
|
2020-09-03 23:43:22 +03:00
|
|
|
struct VHostUserFS {
|
2019-09-30 13:51:34 +03:00
|
|
|
/*< private >*/
|
|
|
|
VirtIODevice parent;
|
|
|
|
VHostUserFSConf conf;
|
|
|
|
struct vhost_virtqueue *vhost_vqs;
|
|
|
|
struct vhost_dev vhost_dev;
|
|
|
|
VhostUserState vhost_user;
|
2020-02-25 10:55:52 +03:00
|
|
|
VirtQueue **req_vqs;
|
|
|
|
VirtQueue *hiprio_vq;
|
2021-01-12 16:16:03 +03:00
|
|
|
int32_t bootindex;
|
2019-09-30 13:51:34 +03:00
|
|
|
|
|
|
|
/*< public >*/
|
2020-09-03 23:43:22 +03:00
|
|
|
};
|
2019-09-30 13:51:34 +03:00
|
|
|
|
2022-05-06 16:49:09 +03:00
|
|
|
#endif /* QEMU_VHOST_USER_FS_H */
|