From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5W0-0001S1-0q for qemu-devel@nongnu.org; Thu, 11 Sep 2014 10:38:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XS5Vt-00064G-SK for qemu-devel@nongnu.org; Thu, 11 Sep 2014 10:38:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XS5Vt-00063r-KD for qemu-devel@nongnu.org; Thu, 11 Sep 2014 10:38:21 -0400 From: Markus Armbruster References: <1410336832-22160-1-git-send-email-armbru@redhat.com> <1410336832-22160-3-git-send-email-armbru@redhat.com> <20140910095624.GC4052@noname.str.redhat.com> <87zje6scc3.fsf@blackfin.pond.sub.org> Date: Thu, 11 Sep 2014 16:38:17 +0200 In-Reply-To: <87zje6scc3.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Thu, 11 Sep 2014 12:03:56 +0200") Message-ID: <87ppf2dxye.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 02/23] block: New BlockBackend List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: benoit.canet@irqsave.net, famz@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Markus Armbruster writes: > Kevin Wolf writes: [...] >>> diff --git a/blockdev.c b/blockdev.c >>> index 9fbd888..86596bc 100644 >>> --- a/blockdev.c >>> +++ b/blockdev.c [...] >>> @@ -1770,7 +1778,7 @@ int do_drive_del(Monitor *mon, const QDict *qdict, QObject **ret_data) >>> */ >>> if (bdrv_get_attached_dev(bs)) { >>> bdrv_make_anon(bs); >>> - >>> + blk_unref(blk_by_name(id)); >>> /* Further I/O must not pause the guest */ >>> bdrv_set_on_error(bs, BLOCKDEV_ON_ERROR_REPORT, >>> BLOCKDEV_ON_ERROR_REPORT); >> >> Won't we unref the BB a second time now when unplugging the device? >> (drive_del() called in blockdev_auto_del()) > > Short answer: you're right, there's a bug, and I'll fix it. > > Long answer: this part is hairy, because the drive_del command is badly > designed. [...] > Simplest possible solution: I hide the BB here, and *leak* it (with a > fat FIXME comment) until it becomes easy enough to find. I guess I can > find it right in the next patch. Nevermind, I found a tolerable way to avoid the temporary leak.