From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35339) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfB1R-0007Km-9B for qemu-devel@nongnu.org; Thu, 14 Jun 2012 10:27:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfB1H-0002Ns-AU for qemu-devel@nongnu.org; Thu, 14 Jun 2012 10:27:40 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:39933) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfB1H-0002NV-1r for qemu-devel@nongnu.org; Thu, 14 Jun 2012 10:27:31 -0400 Received: by werf3 with SMTP id f3so1481193wer.4 for ; Thu, 14 Jun 2012 07:27:29 -0700 (PDT) MIME-Version: 1.0 Sender: donald.open@gmail.com In-Reply-To: <4FD9F421.9030406@redhat.com> References: <1339598189-17933-1-git-send-email-wdongxu@linux.vnet.ibm.com> <1339598189-17933-4-git-send-email-wdongxu@linux.vnet.ibm.com> <4FD9C24A.70906@redhat.com> <4FD9F104.1010209@redhat.com> <4FD9F421.9030406@redhat.com> From: Dong Xu Wang Date: Thu, 14 Jun 2012 22:26:39 +0800 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/6] qemu-img: add-cow will not support convert List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: Stefan Hajnoczi , qemu-devel@nongnu.org On Thu, Jun 14, 2012 at 10:24 PM, Kevin Wolf wrote: > Am 14.06.2012 16:17, schrieb Dong Xu Wang: >> On Thu, Jun 14, 2012 at 10:11 PM, Kevin Wolf wrote: >>> Am 14.06.2012 16:06, schrieb Dong Xu Wang: >>>> On Thu, Jun 14, 2012 at 6:51 PM, Kevin Wolf wrote: >>>>> Am 13.06.2012 16:36, schrieb Dong Xu Wang: >>>>>> add-cow file can't live alone, must together will image_file and bac= king_file. >>>>>> If we implement qemu-img convert operation for add-cow file format, = we must >>>>>> create image_file and backing_file manually, that will be confused f= or users, >>>>>> so we just ignore add-cow format while doing converting. >>>>>> >>>>>> Signed-off-by: Dong Xu Wang >>>>> >>>>> NACK. >>>>> >>>>> This stupid "let's drop the feature, it might confuse users" attitude= is >>>>> known from Gnome, but not from qemu. >>>>> >>>>> There's no technical reason to forbid it and anyone who manages to >>>>> create a valid add-cow image will also be able to specify the very sa= me >>>>> options to a convert command. Also, having image format specific code= in >>>>> qemu-img is evil. >>>>> >>>> >>>> If I implement add-cow convert command, I am wondering which method sh= ould >>>> I use: >>>> 1) create add-cow, and its backing_file, and its image_file, =A0then w= e >>>> need 3 files. >>>> 2) create add-cow(with all bitmap marked to allocated), and its >>>> image_file, then we >>>> =A0 =A0 need 2 files. >>>> >>>> 2) will be easier, I should let .add-cow file can live only with >>>> image_file, without backing_file. >>>> >>>> I think both 1) and 2) need add code to qemu-img.c. Or I will have to = create >>>> image_file automaticly in add_cow_create function. >>>> >>>> Can you give some comments on how to implement convert? Thanks. >>> >>> Just leave it alone and it will work. >>> >>> qemu-img convert takes the same options as qemu-img create. So like for >>> any other image you specify the backing file with -b or -o backing_file= , >>> and for add-cow images to be successfully created you also need to >>> specify -o image_file. >>> >> "-o image_file", the image_file should be precreated? Or I should create= d it >> manually? > > Yes, it must already exist. Just like with qemu-img create. To convert > an existing qcow2 image that has a backing file 'base.img' to an add-cow > image, you would use something like: > > $ qemu-img create -f raw target.img 4G > $ qemu-img convert -O add-cow -o image_file=3Dtarget.img -B base.img > source.qcow2 target.add-cow > > Kevin > Got it, thanks