From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37929) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKRei-0001qQ-Ce for qemu-devel@nongnu.org; Fri, 13 Sep 2013 07:35:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VKRec-0005Ry-C4 for qemu-devel@nongnu.org; Fri, 13 Sep 2013 07:35:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VKRec-0005Rl-3w for qemu-devel@nongnu.org; Fri, 13 Sep 2013 07:35:14 -0400 Message-ID: <5232F86B.2020201@redhat.com> Date: Fri, 13 Sep 2013 13:35:07 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1379067909-22984-1-git-send-email-pl@kamp.de> <1379067909-22984-9-git-send-email-pl@kamp.de> <5232EA90.7030903@redhat.com> <5232ECFA.5000807@kamp.de> In-Reply-To: <5232ECFA.5000807@kamp.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 08/12] qemu-img: conditionally zero out target on convert List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: kwolf@redhat.com, ronniesahlberg@gmail.com, stefanha@redhat.com, qemu-devel@nongnu.org, anthony@codemonkey.ws Il 13/09/2013 12:46, Peter Lieven ha scritto: >>> >>> - flags = BDRV_O_RDWR; >>> + flags = BDRV_O_RDWR | BDRV_O_UNMAP; >> I think this should be a new command-line flag. > In an earlier version there where no objections. I think it would > make the usage of qemu-img convert more complicated. For > most targets has_zero_init is 1 anyway. If Kevin is okay with having BDRV_O_UNMAP as the default that's fine. However there should be an option to disable it. Perhaps it could be "-S 0" with something like this added: diff --git a/qemu-img.c b/qemu-img.c index 3e5e388..f42c90c 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -769,6 +769,10 @@ int ret; int num_checked, num_used; + if (!min) { + return 1; + } + if (n < min) { min = n; } Paolo