From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34175) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuG59-0001gs-9w for qemu-devel@nongnu.org; Wed, 03 Jul 2013 01:58:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuG58-0003Lx-1C for qemu-devel@nongnu.org; Wed, 03 Jul 2013 01:58:23 -0400 Received: from mail-bk0-x235.google.com ([2a00:1450:4008:c01::235]:54062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuG57-0003Lm-R8 for qemu-devel@nongnu.org; Wed, 03 Jul 2013 01:58:21 -0400 Received: by mail-bk0-f53.google.com with SMTP id e11so2680827bkh.12 for ; Tue, 02 Jul 2013 22:58:20 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51D3BD75.4030408@redhat.com> Date: Wed, 03 Jul 2013 07:58:13 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1372744789-997-1-git-send-email-famz@redhat.com> <1372744789-997-4-git-send-email-famz@redhat.com> <51D2A890.4060806@redhat.com> <20130703011009.GE1949@t430s.nay.redhat.com> In-Reply-To: <20130703011009.GE1949@t430s.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/7] nbd: use BDS refcount List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: famz@redhat.com Cc: kwolf@redhat.com, rjones@redhat.com, obarenbo@redhat.com, roliveri@redhat.com, hbrock@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org, pmyers@redhat.com, imain@redhat.com, stefanha@redhat.com Il 03/07/2013 03:10, Fam Zheng ha scritto: > > This has the important side effect of marking the exported disk as > > "in_use" (to use the terms before the series). Right now you can serve > > a disk and, at the same time, stream it or mirror it or create a live > > snapshot of it. > > > > Do we really want to block anything for a device being served? Perhaps > > truncation, but maybe not even that. The NBD server is meant to be as > > unobtrusive as possible (in some sense NBD accesses are the same as > > guest accesses). > > OK, it is better to work like that. But I don't quite understand why was > there drive_get_ref() on the device (w/o the series), as there's already > a close notifier? And it just drive_put_ref() when bs is closed? The close notifier runs when the user invokes a drive_del or eject command from the monitor. The drive_get_ref/drive_put_ref delays the bdrv_delete until after nbd.c has cleaned up all the connections. Paolo