1 /* 2 * IOThread Virtqueue Mapping 3 * 4 * Copyright Red Hat, Inc 5 * 6 * SPDX-License-Identifier: GPL-2.0-only 7 */ 8 9 #ifndef HW_VIRTIO_IOTHREAD_VQ_MAPPING_H 10 #define HW_VIRTIO_IOTHREAD_VQ_MAPPING_H 11 12 #include "qapi/error.h" 13 #include "qapi/qapi-types-virtio.h" 14 15 /** 16 * iothread_vq_mapping_apply: 17 * @list: The mapping of virtqueues to IOThreads. 18 * @vq_aio_context: The array of AioContext pointers to fill in. 19 * @num_queues: The length of @vq_aio_context. 20 * @errp: If an error occurs, a pointer to the area to store the error. 21 * 22 * Fill in the AioContext for each virtqueue in the @vq_aio_context array given 23 * the iothread-vq-mapping parameter in @list. 24 * 25 * iothread_vq_mapping_cleanup() must be called to free IOThread object 26 * references after this function returns success. 27 * 28 * Returns: %true on success, %false on failure. 29 **/ 30 bool iothread_vq_mapping_apply( 31 IOThreadVirtQueueMappingList *list, 32 AioContext **vq_aio_context, 33 uint16_t num_queues, 34 Error **errp); 35 36 /** 37 * iothread_vq_mapping_cleanup: 38 * @list: The mapping of virtqueues to IOThreads. 39 * 40 * Release IOThread object references that were acquired by 41 * iothread_vq_mapping_apply(). 42 */ 43 void iothread_vq_mapping_cleanup(IOThreadVirtQueueMappingList *list); 44 45 #endif /* HW_VIRTIO_IOTHREAD_VQ_MAPPING_H */ 46