From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbX3G-0000OS-Sp for qemu-devel@nongnu.org; Tue, 07 Oct 2014 11:51:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbX3A-0002ab-NY for qemu-devel@nongnu.org; Tue, 07 Oct 2014 11:51:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbX3A-0002aS-GP for qemu-devel@nongnu.org; Tue, 07 Oct 2014 11:51:44 -0400 Message-ID: <54340C06.5080600@redhat.com> Date: Tue, 07 Oct 2014 17:51:34 +0200 From: Max Reitz MIME-Version: 1.0 References: <1412683166-4934-1-git-send-email-armbru@redhat.com> <1412683166-4934-4-git-send-email-armbru@redhat.com> In-Reply-To: <1412683166-4934-4-git-send-email-armbru@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v6 03/24] block: Connect BlockBackend to BlockDriverState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: kwolf@redhat.com, benoit.canet@nodalink.com, stefanha@redhat.com On 07.10.2014 13:59, Markus Armbruster wrote: > Convenience function blk_new_with_bs() creates a BlockBackend with its > BlockDriverState. Callers have to unref both. The commit after next > will relieve them of the need to unref the BlockDriverState. > > Complication: due to the silly way drive_del works, we need a way to > hide a BlockBackend, just like bdrv_make_anon(). To emphasize its > "special" status, give the function a suitably off-putting name: > blk_hide_on_behalf_of_do_drive_del(). Unfortunately, hiding turns the > BlockBackend's name into the empty string. Can't avoid that without > breaking the blk->bs->device_name equals blk->name invariant. > > Signed-off-by: Markus Armbruster > --- > block.c | 12 ++-- > block/block-backend.c | 71 ++++++++++++++++++++++- > blockdev.c | 19 +++---- > hw/block/xen_disk.c | 8 +-- > include/block/block_int.h | 2 + > include/sysemu/block-backend.h | 5 ++ > qemu-img.c | 125 +++++++++++++++++++---------------------- > qemu-io.c | 4 +- > qemu-nbd.c | 4 +- > 9 files changed, 156 insertions(+), 94 deletions(-) Reviewed-by: Max Reitz