mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
blockdev: add refcount to DriveInfo
The host part of a block device can be deleted with in progress block migration. To fix this, add a reference count to DriveInfo, freeing resources on last reference. Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> CC: Markus Armbruster <armbru@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
8f794c557c
commit
84fb392526
3 changed files with 20 additions and 4 deletions
|
@ -147,7 +147,7 @@ void drive_hot_add(Monitor *mon, const QDict *qdict)
|
|||
|
||||
err:
|
||||
if (dinfo)
|
||||
drive_uninit(dinfo);
|
||||
drive_put_ref(dinfo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue