From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtYbP-0006Dl-Mt for qemu-devel@nongnu.org; Fri, 11 Jan 2013 02:00:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TtYbM-000306-Jz for qemu-devel@nongnu.org; Fri, 11 Jan 2013 02:00:31 -0500 Received: from [222.73.24.84] (port=44882 helo=song.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TtYbM-0002xt-9Z for qemu-devel@nongnu.org; Fri, 11 Jan 2013 02:00:28 -0500 Message-ID: <50EFB107.3040002@cn.fujitsu.com> Date: Fri, 11 Jan 2013 14:28:23 +0800 From: Wanlong Gao MIME-Version: 1.0 References: <20130110122029.GN6021@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] reading files from qcow2-formated image disk for windows system Reply-To: gaowanlong@cn.fujitsu.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?6ams56OK?= Cc: Blue Swirl , aliguori@us.ibm.com, qemu-devel@nongnu.org On 01/11/2013 11:39 AM, =E9=A9=AC=E7=A3=8A wrote: >=20 >=20 > On Thu, Jan 10, 2013 at 8:20 PM, Daniel P. Berrange > wrote: >=20 > On Wed, Jan 09, 2013 at 09:37:54PM +0000, Blue Swirl wrote: > > On Wed, Jan 9, 2013 at 7:31 AM, =E9=A9=AC=E7=A3=8A > wrote: > > > > > > > > >>> Hi, > > >>> The final effect is as follows: > > >>> > > >>> > > >>> [malei@xentest-4-1 Fri Dec 28 ~/honeypot/xen/xen-4.1.2]$ qemu-i= mg-xen cat > > >>> -f /1/boot.ini ~/vm-check.img > > >>> [boot loader] > > >>> timeout=3D30 > > >>> default=3Dmulti(0)disk(0)rdisk(0)partition(1)\WINDOWS > > >>> [operating systems] > > >>> multi(0)disk(0)rdisk(0)partition(1)\WINDOWS=3D"Microsoft Window= s XP > > >>> Professional" /noexecute=3Doptin /fastdetect > > >>> > > >>> [malei@xentest-4-1 Fri Dec 28 ~/honeypot/xen/xen-4.1.2]$ qemu-i= mg-xen ls > > >>> -l -d /1/ ~/vm-check.img > > >>> =E3=80=90name size(bytes) dir? date > > >>> create-time=E3=80=91 > > >>> AUTOEXEC.BAT 0 file 2010-12-22 17:30:37 > > >>> boot.ini 211 file 2010-12-23 = 01:24:41 > > >>> bootfont.bin 322730 file 2004-11-23 20:0= 0:00 > > >>> > > >>> > > >>> > > >>> As you see above, the patch add two sub-commands for qemu-img-x= en=EF=BC=9Acat and > > >>> ls. > > >>> > > >>> For details in the patch, please check the attachment. > > >>> > > >>> > > > > > > Does anyone prefer this feature?! > > > > Nice feature, but this approach would just clutter QEMU and give on= ly > > readonly FAT or NTFS support. I think a more generally useful appro= ach > > would be to use NBD or iSCSI to export the block device data from t= he > > image file (qemu-nbd already exists) and then make a tool that uses > > some combination of NBD/iSCSI client, all GRUB file systems and FUSE > > or other user space methods to access the contents of the filesyste= m. > > Probably also UML with a simple guest agent could provide read/write > > access to any file system that Linux supports. >=20 > The latter is what libguestfs already provides. It boots a Linux kern= el > and mini initrd containing a guest agent, to provide APIs to do arbit= rary > manipulation of guest OS images. >=20 > The reason libguestfs used a linux guest was precisely to avoid having > to re-implement drivers for every filesystem in existance like this > patch is trying todo. >=20 > I don't think QEMU wants to be in the business of maintaining filesys= tem > drivers, so I'd reject this proposed patch. >=20 > Regards, > Daniel > -- > |: http://berrange.com -o- http://www.flickr.com/photos/dberr= ange/ :| > |: http://libvirt.org -o- http://virt-manage= r.org :| > |: http://autobuild.org -o- http://search.cpan.org/~dan= berr/ :| > |: http://entangle-photo.org -o- http://live.gnome.org/gt= k-vnc :| >=20 >=20 >=20 > This feature could be configured to be optional in make file configuratio= n according to individual preference. > =5FIn addition, the fat32 and ntfs filesystem driver will not change for = a long time so it needs no much maintainence once implemented.=5F As Daniel and Stefan said, you can try to use libguestfs [libguestfs.org] a= nd qemu-nbd. In libguestfs, we provide virt-cat, virt-ls, etc. And support all the disk = type which QEMU supported. Thanks, Wanlong Gao =