qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] xen-block: Fix removal of backend instance via xenstore


From: Paolo Bonzini
Subject: Re: [PATCH] xen-block: Fix removal of backend instance via xenstore
Date: Mon, 8 Mar 2021 19:23:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0

On 08/03/21 19:14, Anthony PERARD wrote:
On Mon, Mar 08, 2021 at 06:37:38PM +0100, Paolo Bonzini wrote:
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.

There is no legacy_dinfo, so blockdev_mark_auto_del doesn't work.

Then I guess it's okay. Perhaps you can rename the function to xen_block_blockdev_destroy so that it's clear it's a blockdev and no drive. Thanks,

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]