On 21/03/2016 18:19, Markus Armbruster wrote: >> > >> > The other possibility is to make blk_detach_dev do nothing if blk->dev >> > == NULL, i.e. make it idempotent. On one hand, who doesn't like >> > idempotency; on the other hand, removing an assertion is also dirty. >> > >> > I chose the easy way here (changing as fewer contracts as possible). > Why can't we keep the work in the property release() method > release_drive()? > > The only reason blockdev_mark_auto_del() isn't there is that the device > decides whether to call it, not the property.
DEVICE_DELETED is currently sent right after setting unrealized to false (see device_unparent), and you cannnot send it later than that. In particular release_drive would mean sending the drive when properties are removed in instance_finalize; by that time you don't have anymore a QOM path to include in the event. Paolo