2018-05-24 13:33:33 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017-2018 Intel Corporation
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef HW_VIRTIO_VHOST_USER_H
|
|
|
|
#define HW_VIRTIO_VHOST_USER_H
|
|
|
|
|
|
|
|
#include "chardev/char-fe.h"
|
2018-05-24 13:33:34 +03:00
|
|
|
#include "hw/virtio/virtio.h"
|
|
|
|
|
|
|
|
typedef struct VhostUserHostNotifier {
|
|
|
|
MemoryRegion mr;
|
|
|
|
void *addr;
|
|
|
|
} VhostUserHostNotifier;
|
2018-05-24 13:33:33 +03:00
|
|
|
|
|
|
|
typedef struct VhostUserState {
|
|
|
|
CharBackend *chr;
|
2018-05-24 13:33:34 +03:00
|
|
|
VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX];
|
2020-05-21 08:00:32 +03:00
|
|
|
int memory_slots;
|
2018-05-24 13:33:33 +03:00
|
|
|
} VhostUserState;
|
|
|
|
|
2019-03-08 17:04:45 +03:00
|
|
|
bool vhost_user_init(VhostUserState *user, CharBackend *chr, Error **errp);
|
2018-05-24 13:33:33 +03:00
|
|
|
void vhost_user_cleanup(VhostUserState *user);
|
|
|
|
|
|
|
|
#endif
|