From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36063) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8WEg-0004ua-FA for qemu-devel@nongnu.org; Wed, 29 Jan 2014 09:35:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W8WEZ-0002ub-LE for qemu-devel@nongnu.org; Wed, 29 Jan 2014 09:35:26 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59783) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W8WEZ-0002uC-6g for qemu-devel@nongnu.org; Wed, 29 Jan 2014 09:35:19 -0500 Date: Wed, 29 Jan 2014 15:35:16 +0100 From: Kevin Wolf Message-ID: <20140129143516.GK2726@dhcp-200-207.str.redhat.com> References: <20140129092452.GB2726@dhcp-200-207.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] committing qcow2 to raw backing file List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Murali Balcha Cc: jcody@redhat.com, Giri Basava , "qemu-devel@nongnu.org" Am 29.01.2014 um 14:50 hat Murali Balcha geschrieben: > Thanks for the quick reply. The scenario I have is little different. Th= e > backing file is only 40 MB where as the virtual size of qcow2 is 1GB. >=20 > project1@cloudvault3:/tmp/20bcb425-d3c5-4c0f-819c-7c9b1a16fde3$ qemu-im= g > info 2e94bd45-7e4e-4e04-a8b4-74d579cad892_vda.qcow2 > image: 2e94bd45-7e4e-4e04-a8b4-74d579cad892_vda.qcow2 > file format: raw > virtual size: 39M (41126400 bytes) > disk size: 39M > project1@cloudvault3:/tmp/20bcb425-d3c5-4c0f-819c-7c9b1a16fde3$ qemu-im= g > info 2bc87796-60e8-4024-8a40-fae817e094da_vda.qcow2 > image: 2bc87796-60e8-4024-8a40-fae817e094da_vda.qcow2 > file format: qcow2 > virtual size: 1.0G (1073741824 bytes) > disk size: 3.3M > cluster_size: 65536 > backing file:=20 > /tmp/20bcb425-d3c5-4c0f-819c-7c9b1a16fde3/2e94bd45-7e4e-4e04-a8b4-74d57= 9cad > 892_vda.qcow2 > Format specific information: > compat: 0.10 > project1@cloudvault3:/tmp/20bcb425-d3c5-4c0f-819c-7c9b1a16fde3$ qemu-im= g > commit 2bc87796-60e8-4024-8a40-fae817e094da_vda.qcow2 > qemu-img: Error while committing image >=20 > The qemu-img is bailing out when it detected that commit is happening > beyond raw backing image. >=20 >=20 > Is this a valid commit operation. This is how openstack sets up vms. This is completely unrelated to the patch that you mentioned then. The problem is that qemu-img would have to increase the image size of the backing file first before it can commit all the data to it. I believe there was a patch by Jeff (CC'ed) that would do exactly this. Kevin > On 1/29/14, 4:24 AM, "Kevin Wolf" wrote: >=20 > >Am 29.01.2014 um 03:09 hat Murali Balcha geschrieben: > >> Hi, > >> My apologies for reaching out directly on your email. However I am n= ew > >>qemu and > >> don=B9t know the active mailing list for qemu related issues. > > > >The qemu mailing list is qemu-devel@nongnu.org. You should generally > >direct your questions there, though keeping individual persons in the = CC > >list is fine. > > > >> I have seen your > >> name in one of the patches related to this > >>issue.https://github.com/gooselinux/ > >> qemu-kvm/blob/master/kvm-block-Fix-image-re-open-in-bdrv_commit.patc= h > >>=20 > >> We are using 1.6.90 and 1.7 of qemu. the qemu-img errors out with > >>exact same > >> message when we try to commit qcow2 delta to raw image. Looking at t= he > >>code, we > >> realized that that patch you discussed above did not make it 1.6.90 > >>branch we > >> are using. Am I missing something. > > > >I am not sure which error message you mean, but the patch that you > >mentioned has been in qemu since version 0.14.0. You won't see it in t= he > >current code any more because of later changes that switched to using > >bdrv_reopen() instead. > > > >For me, committing to a raw image works fine with current git master: > > > >$ qemu-img create -f raw /tmp/backing.raw 4G > >Formatting '/tmp/backing.raw', fmt=3Draw size=3D4294967296 > >$ qemu-img create -f qcow2 -b /tmp/backing.raw /tmp/overlay.qcow2 > >Formatting '/tmp/overlay.qcow2', fmt=3Dqcow2 size=3D4294967296 > >backing_file=3D'/tmp/backing.raw' encryption=3Doff cluster_size=3D6553= 6 > >lazy_refcounts=3Doff > >$ qemu-io -c 'write 0 4k' /tmp/overlay.qcow2 > >wrote 4096/4096 bytes at offset 0 > >4 KiB, 1 ops; 0.0009 sec (4.090 MiB/sec and 1047.1204 ops/sec) > >$ qemu-img commit /tmp/overlay.qcow2 > >Image committed. > > > >Kevin >=20