|
@@ -1495,6 +1495,9 @@ validate_iothread_vq_mapping_list(IOThreadVirtQueueMappingList *list,
|
|
* Fill in the AioContext for each virtqueue in the @vq_aio_context array given
|
|
* Fill in the AioContext for each virtqueue in the @vq_aio_context array given
|
|
* the iothread-vq-mapping parameter in @iothread_vq_mapping_list.
|
|
* the iothread-vq-mapping parameter in @iothread_vq_mapping_list.
|
|
*
|
|
*
|
|
|
|
+ * cleanup_iothread_vq_mapping() must be called to free IOThread object
|
|
|
|
+ * references after this function returns success.
|
|
|
|
+ *
|
|
* Returns: %true on success, %false on failure.
|
|
* Returns: %true on success, %false on failure.
|
|
**/
|
|
**/
|
|
static bool apply_iothread_vq_mapping(
|
|
static bool apply_iothread_vq_mapping(
|
|
@@ -1545,6 +1548,23 @@ static bool apply_iothread_vq_mapping(
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * cleanup_iothread_vq_mapping:
|
|
|
|
+ * @list: The mapping of virtqueues to IOThreads.
|
|
|
|
+ *
|
|
|
|
+ * Release IOThread object references that were acquired by
|
|
|
|
+ * apply_iothread_vq_mapping().
|
|
|
|
+ */
|
|
|
|
+static void cleanup_iothread_vq_mapping(IOThreadVirtQueueMappingList *list)
|
|
|
|
+{
|
|
|
|
+ IOThreadVirtQueueMappingList *node;
|
|
|
|
+
|
|
|
|
+ for (node = list; node; node = node->next) {
|
|
|
|
+ IOThread *iothread = iothread_by_id(node->value->iothread);
|
|
|
|
+ object_unref(OBJECT(iothread));
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
/* Context: BQL held */
|
|
/* Context: BQL held */
|
|
static bool virtio_blk_vq_aio_context_init(VirtIOBlock *s, Error **errp)
|
|
static bool virtio_blk_vq_aio_context_init(VirtIOBlock *s, Error **errp)
|
|
{
|
|
{
|
|
@@ -1611,12 +1631,7 @@ static void virtio_blk_vq_aio_context_cleanup(VirtIOBlock *s)
|
|
assert(!s->ioeventfd_started);
|
|
assert(!s->ioeventfd_started);
|
|
|
|
|
|
if (conf->iothread_vq_mapping_list) {
|
|
if (conf->iothread_vq_mapping_list) {
|
|
- IOThreadVirtQueueMappingList *node;
|
|
|
|
-
|
|
|
|
- for (node = conf->iothread_vq_mapping_list; node; node = node->next) {
|
|
|
|
- IOThread *iothread = iothread_by_id(node->value->iothread);
|
|
|
|
- object_unref(OBJECT(iothread));
|
|
|
|
- }
|
|
|
|
|
|
+ cleanup_iothread_vq_mapping(conf->iothread_vq_mapping_list);
|
|
}
|
|
}
|
|
|
|
|
|
if (conf->iothread) {
|
|
if (conf->iothread) {
|