Received: from eggs.gnu.org ([2001:4830:134:3::10]:48355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvpSt-00032y-Ab for qemu-devel@nongnu.org; Mon, 09 Nov 2015 11:38:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvpSn-0008Ij-Ic for qemu-devel@nongnu.org; Mon, 09 Nov 2015 11:38:43 -0500 From: Alberto Garcia In-Reply-To: <20151109162638.GK3621@noname.redhat.com> References: <1446663467-22485-1-git-send-email-mreitz@redhat.com> <1446663467-22485-13-git-send-email-mreitz@redhat.com> <20151109162638.GK3621@noname.redhat.com> Date: Mon, 09 Nov 2015 17:38:30 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, Markus Armbruster , qemu-devel@nongnu.org, Stefan Hajnoczi , Paolo Bonzini , Max Reitz On Mon 09 Nov 2015 05:26:38 PM CET, Kevin Wolf wrote: >> > if (blk) { >> > blk_unref(blk); >> > } else { >> > + QTAILQ_REMOVE(&monitor_bdrv_states, bs, monitor_list); >> > bdrv_unref(bs); >> > } >> >> blk_unref(blk) will also unref the BDS (if there's any), so you also >> need to update monitor_bdrv_states in that case, don't you? > > No, in that case the BDS referenced wasn't owned by the monitor in the > first place. It was owned by the BB. I see, I hadn't noticed that the BDS is added to monitor_bdrv_states only if it is created without a BB. You're right then, thanks! Berto