Lines Matching +full:uuid +full:- +full:dev
8 * Marc-André Lureau <mlureau@redhat.com>
11 * later. See the COPYING file in the top-level directory.
23 #include "standard-headers/linux/virtio_ring.h"
25 /* Based on qemu/hw/virtio/vhost-user.c */
36 * limit is sufficient to support many DIMMs and virtio-mem in
37 * "dynamic-memslots" mode.
75 #define VHOST_USER_PROTOCOL_FEATURE_MASK ((1 << VHOST_USER_PROTOCOL_F_MAX) - 1)
186 unsigned char uuid[UUID_LEN]; member
235 typedef uint64_t (*vu_get_features_cb) (VuDev *dev);
236 typedef void (*vu_set_features_cb) (VuDev *dev, uint64_t features);
237 typedef int (*vu_process_msg_cb) (VuDev *dev, VhostUserMsg *vmsg,
239 typedef bool (*vu_read_msg_cb) (VuDev *dev, int sock, VhostUserMsg *vmsg);
240 typedef void (*vu_queue_set_started_cb) (VuDev *dev, int qidx, bool started);
241 typedef bool (*vu_queue_is_processed_in_order_cb) (VuDev *dev, int qidx);
242 typedef int (*vu_get_config_cb) (VuDev *dev, uint8_t *config, uint32_t len);
243 typedef int (*vu_set_config_cb) (VuDev *dev, const uint8_t *data,
246 typedef int (*vu_get_shared_object_cb) (VuDev *dev, const unsigned char *uuid);
258 /* process_msg is called for each vhost-user message received */
259 /* skip libvhost-user processing if return value != 0 */
265 * resumed to vring.used->idx. This can help to support resuming
277 typedef void (*vu_queue_handler_cb) (VuDev *dev, int qidx);
290 * Only available for head-descriptor. */
301 * Only available for head-descriptor. */
384 typedef void (*vu_panic_cb) (VuDev *dev, const char *err);
385 typedef void (*vu_watch_cb) (VuDev *dev, int condition, void *data);
386 typedef void (*vu_set_watch_cb) (VuDev *dev, int fd, int condition,
388 typedef void (*vu_remove_watch_cb) (VuDev *dev, int fd);
414 * @read_msg: custom method to read vhost-user message
422 * For the details, please refer to vu_message_read in libvhost-user.c
426 * Returns: true if vhost-user message successfully received,
442 * @panic: encountered an unrecoverable error, you may try to re-initialize
462 * @dev: a VuDev context
464 * @socket: the socket connected to vhost-user frontend
468 * @iface: a VuDevIface structure with vhost-user device callbacks
470 * Initializes a VuDev vhost-user context.
474 bool vu_init(VuDev *dev,
486 * @dev: a VuDev context
490 void vu_deinit(VuDev *dev);
503 * @dev: a VuDev context
505 * Process one vhost-user message.
509 bool vu_dispatch(VuDev *dev);
513 * @dev: a VuDev context
519 void *vu_gpa_to_va(VuDev *dev, uint64_t *plen, uint64_t guest_addr);
523 * @dev: a VuDev context
528 VuVirtq *vu_get_queue(VuDev *dev, int qidx);
532 * @dev: a VuDev context
540 void vu_set_queue_handler(VuDev *dev, VuVirtq *vq,
545 * @dev: a VuDev context
552 * times for the same queue. If called with -1 @fd, the notifier
555 bool vu_set_queue_host_notifier(VuDev *dev, VuVirtq *vq, int fd,
560 * @dev: a VuDev context
561 * @uuid: UUID of the shared object
562 * @dmabuf_fd: output dma-buf file descriptor
564 * Lookup for a virtio shared object (i.e., dma-buf fd) associated with the
565 * received UUID. Result, if found, is stored in the dmabuf_fd argument.
569 bool vu_lookup_shared_object(VuDev *dev, unsigned char uuid[UUID_LEN],
574 * @dev: a VuDev context
575 * @uuid: UUID of the shared object
577 * Registers this back-end as the exporter for the object associated with
578 * the received UUID.
582 bool vu_add_shared_object(VuDev *dev, unsigned char uuid[UUID_LEN]);
586 * @dev: a VuDev context
587 * @uuid: UUID of the shared object
589 * Removes a shared object entry (i.e., back-end entry) associated with the
590 * received UUID key from the hash table.
594 bool vu_rm_shared_object(VuDev *dev, unsigned char uuid[UUID_LEN]);
598 * @dev: a VuDev context
604 void vu_queue_set_notification(VuDev *dev, VuVirtq *vq, int enable);
608 * @dev: a VuDev context
613 bool vu_queue_enabled(VuDev *dev, VuVirtq *vq);
617 * @dev: a VuDev context
622 bool vu_queue_started(const VuDev *dev, const VuVirtq *vq);
626 * @dev: a VuDev context
631 bool vu_queue_empty(VuDev *dev, VuVirtq *vq);
635 * @dev: a VuDev context
640 void vu_queue_notify(VuDev *dev, VuVirtq *vq);
642 void vu_config_change_msg(VuDev *dev);
646 * @dev: a VuDev context
652 void vu_queue_notify_sync(VuDev *dev, VuVirtq *vq);
656 * @dev: a VuDev context
661 * returned element must be free()-d by the caller.
663 void *vu_queue_pop(VuDev *dev, VuVirtq *vq, size_t sz);
668 * @dev: a VuDev context
676 void vu_queue_unpop(VuDev *dev, VuVirtq *vq, VuVirtqElement *elem,
681 * @dev: a VuDev context
691 bool vu_queue_rewind(VuDev *dev, VuVirtq *vq, unsigned int num);
695 * @dev: a VuDev context
703 void vu_queue_fill(VuDev *dev, VuVirtq *vq,
709 * @dev: a VuDev context
716 void vu_queue_push(VuDev *dev, VuVirtq *vq,
721 * @dev: a VuDev context
728 void vu_queue_flush(VuDev *dev, VuVirtq *vq, unsigned int num);
732 * @dev: a VuDev context
747 * @dev: a VuDev context
754 bool vu_queue_avail_bytes(VuDev *dev, VuVirtq *vq, unsigned int in_bytes,