[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen-block: Fix removal of backend instance via xenstore
- To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- From: Paolo Bonzini <pbonzini@xxxxxxxxxx>
- Date: Mon, 8 Mar 2021 18:37:38 +0100
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@xxxxxxxxxx
- Cc: qemu-devel@xxxxxxxxxx, Stefan Hajnoczi <stefanha@xxxxxxxxxx>, Maxim Levitsky <mlevitsk@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Kevin Wolf <kwolf@xxxxxxxxxx>, Max Reitz <mreitz@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, qemu-block@xxxxxxxxxx
- Delivery-date: Mon, 08 Mar 2021 17:37:53 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 08/03/21 18:29, Anthony PERARD wrote:
If nothing else works then I guess it's okay, but why can't you do the
xen_block_drive_destroy from e.g. an unrealize callback?
I'm not sure if that's possible.
xen_block_device_create/xen_block_device_destroy() is supposed to be
equivalent to do those qmp commands:
blockdev-add node-name=xvdz-qcow2 driver=qcow2
file={"driver":"file","filename":"disk.qcow2","locking":"off"}
device_add id=xvdz driver=xen-disk vdev=xvdz drive=xvdz-qcow2
But I tried to add a call xen_block_drive_destroy from
xen_block_unrealize, but that still is called too early, it's called
before object_property_del_all() which would delete "drive" and call
release_drive() which would free the node.
Can you use blockdev_mark_auto_del? Then you don't have to call
xen_block_drive_destroy at all.
Paolo
So, no, I don't think we can use an unrealized callback.
I though of trying to delete the "drive" property ahead of calling
object_unparent() but I didn't figure out how to do so and it's maybe
not possible.
So either drain_call_rcu or adding call_rcu(xen_block_drive_destroy)
seems to be the way, but since xen_block_drive_destroy uses
qmp_blockdev_del, it seems better to drain_call_rcu.
Cheers,
|