14d0cf552STiwei Bie /* 24d0cf552STiwei Bie * Copyright (c) 2017-2018 Intel Corporation 34d0cf552STiwei Bie * 44d0cf552STiwei Bie * This work is licensed under the terms of the GNU GPL, version 2. 54d0cf552STiwei Bie * See the COPYING file in the top-level directory. 64d0cf552STiwei Bie */ 74d0cf552STiwei Bie 84d0cf552STiwei Bie #ifndef HW_VIRTIO_VHOST_USER_H 94d0cf552STiwei Bie #define HW_VIRTIO_VHOST_USER_H 104d0cf552STiwei Bie 114d0cf552STiwei Bie #include "chardev/char-fe.h" 1244866521STiwei Bie #include "hw/virtio/virtio.h" 1344866521STiwei Bie 1444866521STiwei Bie typedef struct VhostUserHostNotifier { 1544866521STiwei Bie MemoryRegion mr; 1644866521STiwei Bie void *addr; 1744866521STiwei Bie bool set; 1844866521STiwei Bie } VhostUserHostNotifier; 194d0cf552STiwei Bie 204d0cf552STiwei Bie typedef struct VhostUserState { 214d0cf552STiwei Bie CharBackend *chr; 2244866521STiwei Bie VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX]; 234d0cf552STiwei Bie } VhostUserState; 244d0cf552STiwei Bie 25*0b99f224SMarc-André Lureau bool vhost_user_init(VhostUserState *user, CharBackend *chr, Error **errp); 264d0cf552STiwei Bie void vhost_user_cleanup(VhostUserState *user); 274d0cf552STiwei Bie 284d0cf552STiwei Bie #endif 29