6b0eff1a4e
This change introduces a new feature to the vhost-user protocol allowing a backend device to specify the maximum number of ram slots it supports. At this point, the value returned by the backend will be capped at the maximum number of ram slots which can be supported by vhost-user, which is currently set to 8 because of underlying protocol limitations. The returned value will be stored inside the VhostUserState struct so that on device reconnect we can verify that the ram slot limitation has not decreased since the last time the device connected. Signed-off-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Signed-off-by: Peter Turschmid <peter.turschm@nutanix.com> Message-Id: <1588533678-23450-4-git-send-email-raphael.norwitz@nutanix.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
30 lines
695 B
C
30 lines
695 B
C
/*
|
|
* 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"
|
|
#include "hw/virtio/virtio.h"
|
|
|
|
typedef struct VhostUserHostNotifier {
|
|
MemoryRegion mr;
|
|
void *addr;
|
|
bool set;
|
|
} VhostUserHostNotifier;
|
|
|
|
typedef struct VhostUserState {
|
|
CharBackend *chr;
|
|
VhostUserHostNotifier notifier[VIRTIO_QUEUE_MAX];
|
|
int memory_slots;
|
|
} VhostUserState;
|
|
|
|
bool vhost_user_init(VhostUserState *user, CharBackend *chr, Error **errp);
|
|
void vhost_user_cleanup(VhostUserState *user);
|
|
|
|
#endif
|