iothread-vq-mapping.h 1.3 KB

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