aboutsummaryrefslogtreecommitdiff
path: root/lib/private.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private.h')
-rw-r--r--lib/private.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/lib/private.h b/lib/private.h
index c463fea..49f9152 100644
--- a/lib/private.h
+++ b/lib/private.h
@@ -122,8 +122,8 @@ struct vfu_ctx {
void *tran_data;
uint64_t flags;
char *uuid;
- vfu_map_dma_cb_t *map_dma;
- vfu_unmap_dma_cb_t *unmap_dma;
+ vfu_dma_register_cb_t *dma_register;
+ vfu_dma_unregister_cb_t *dma_unregister;
int client_max_fds;
@@ -139,26 +139,26 @@ struct vfu_ctx {
void
dump_buffer(const char *prefix, const char *buf, uint32_t count);
+int
+consume_fd(int *fds, size_t nr_fds, size_t index);
+
vfu_reg_info_t *
vfu_get_region_info(vfu_ctx_t *vfu_ctx);
+long
+dev_get_reginfo(vfu_ctx_t *vfu_ctx, uint32_t index, uint32_t argsz,
+ struct vfio_region_info **vfio_reg, int **fds, size_t *nr_fds);
+
int
handle_dma_map_or_unmap(vfu_ctx_t *vfu_ctx, uint32_t size, bool map,
int *fds, size_t nr_fds,
struct vfio_user_dma_region *dma_regions);
int
-consume_fd(int *fds, size_t nr_fds, size_t index);
-
-int
handle_device_get_info(vfu_ctx_t *vfu_ctx, uint32_t size,
struct vfio_device_info *in_dev_info,
struct vfio_device_info *out_dev_info);
-long
-dev_get_reginfo(vfu_ctx_t *vfu_ctx, uint32_t index, uint32_t argsz,
- struct vfio_region_info **vfio_reg, int **fds, size_t *nr_fds);
-
int
handle_device_set_irqs(vfu_ctx_t *vfu_ctx, uint32_t size,
int *fds, size_t nr_fds, struct vfio_irq_set *irq_set);
@@ -181,6 +181,24 @@ MOCK_DECLARE(int, handle_dirty_pages, vfu_ctx_t *vfu_ctx, uint32_t size,
struct iovec **iovecs, size_t *nr_iovecs,
struct vfio_iommu_type1_dirty_bitmap *dirty_bitmap);
+MOCK_DECLARE(bool, should_exec_command, vfu_ctx_t *vfu_ctx, uint16_t cmd);
+
+MOCK_DECLARE(bool, cmd_allowed_when_stopped_and_copying, uint16_t cmd);
+
+MOCK_DECLARE(int, get_next_command, vfu_ctx_t *vfu_ctx,
+ struct vfio_user_header *hdr, int *fds, size_t *nr_fds);
+
+MOCK_DECLARE(int, exec_command, vfu_ctx_t *vfu_ctx,
+ struct vfio_user_header *hdr, size_t size, int *fds, size_t nr_fds,
+ int **fds_out, size_t *nr_fds_out, struct iovec *_iovecs,
+ struct iovec **iovecs, size_t *nr_iovecs, bool *free_iovec_data);
+
+MOCK_DECLARE(int, process_request, vfu_ctx_t *vfu_ctx);
+
+MOCK_DECLARE(int, handle_dirty_pages, vfu_ctx_t *vfu_ctx, uint32_t size,
+ struct iovec **iovecs, size_t *nr_iovecs,
+ struct vfio_iommu_type1_dirty_bitmap *dirty_bitmap);
+
#endif /* LIB_VFIO_USER_PRIVATE_H */
/* ex: set tabstop=4 shiftwidth=4 softtabstop=4 expandtab: */