X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=device-hotplug.c;h=126f73c676f4a2e63a4a34bbb3ee7aa4e8b92e01;hb=b4053c64833762f1249b2d704d2da30b5b10c8ff;hp=3e5cdaad109e24daf5a14dac1a2945eb8778b079;hpb=1a8b40816839f71ef2076bbd88c4aecaf5b8d75b;p=mirror_qemu.git diff --git a/device-hotplug.c b/device-hotplug.c index 3e5cdaad10..126f73c676 100644 --- a/device-hotplug.c +++ b/device-hotplug.c @@ -84,6 +84,8 @@ void hmp_drive_add(Monitor *mon, const QDict *qdict) err: if (dinfo) { - blk_unref(blk_by_legacy_dinfo(dinfo)); + BlockBackend *blk = blk_by_legacy_dinfo(dinfo); + monitor_remove_blk(blk); + blk_unref(blk); } }