[PATCH V5 08/13] block/export: Update tracking iothread users with holder name

Zhang Chen posted 13 patches 1 month, 1 week ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Fam Zheng <fam@euphon.net>, John Levon <john.levon@nutanix.com>, Thanos Makatos <thanos.makatos@nutanix.com>, "Cédric Le Goater" <clg@redhat.com>, David Hildenbrand <david@kernel.org>, "Dr. David Alan Gilbert" <dave@treblig.org>, Markus Armbruster <armbru@redhat.com>, Zhang Chen <zhangckid@gmail.com>, Li Zhijian <lizhijian@fujitsu.com>, Jason Wang <jasowang@redhat.com>, Eric Blake <eblake@redhat.com>
There is a newer version of this series
[PATCH V5 08/13] block/export: Update tracking iothread users with holder name
Posted by Zhang Chen 1 month, 1 week ago
It seems we cannot find the corresponding resources
(the iothread and path) when deleting them in qmp_block_export_del.
The original method will be retained for the time being.

Signed-off-by: Zhang Chen <zhangckid@gmail.com>
---
 block/export/export.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/block/export/export.c b/block/export/export.c
index f3bbf11070..98aca7f8c9 100644
--- a/block/export/export.c
+++ b/block/export/export.c
@@ -127,7 +127,12 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)
             goto fail;
         }
 
-        new_ctx = iothread_get_aio_context(iothread);
+        /*
+         * It seems we cannot find the corresponding resources
+         * (the iothread and path) when deleting them in qmp_block_export_del.
+         * The original method will be retained for the time being.
+         */
+        new_ctx = iothread_get_aio_context(iothread, NULL);
 
         /* Ignore errors with fixed-iothread=false */
         set_context_errp = fixed_iothread ? errp : NULL;
-- 
2.49.0
Re: [PATCH V5 08/13] block/export: Update tracking iothread users with holder name
Posted by Stefan Hajnoczi 1 month ago
On Thu, Mar 05, 2026 at 10:24:54PM +0800, Zhang Chen wrote:
> It seems we cannot find the corresponding resources
> (the iothread and path) when deleting them in qmp_block_export_del.
> The original method will be retained for the time being.
> 
> Signed-off-by: Zhang Chen <zhangckid@gmail.com>
> ---
>  block/export/export.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/block/export/export.c b/block/export/export.c
> index f3bbf11070..98aca7f8c9 100644
> --- a/block/export/export.c
> +++ b/block/export/export.c
> @@ -127,7 +127,12 @@ BlockExport *blk_exp_add(BlockExportOptions *export, Error **errp)
>              goto fail;
>          }
>  
> -        new_ctx = iothread_get_aio_context(iothread);
> +        /*
> +         * It seems we cannot find the corresponding resources
> +         * (the iothread and path) when deleting them in qmp_block_export_del.
> +         * The original method will be retained for the time being.
> +         */
> +        new_ctx = iothread_get_aio_context(iothread, NULL);

This needs to be implemented properly in order to be merged.

BlockExport has an AioContext field. It's possible to modify the code to
keep an IOThread pointer too.

Stefan