From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuvWp-0008Tq-0W for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:27:51 -0400 Received: from [140.186.70.92] (port=53669 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuvWn-0008TF-Ht for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:27:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuvWl-0002Ly-M2 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:27:49 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]:40306) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuvWl-0002Lo-A5 for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:27:47 -0400 Message-ID: <4BABE35D.70909@web.de> Date: Thu, 25 Mar 2010 23:27:41 +0100 From: Jan Kiszka MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] qemu-img: add FUSE-based image access References: <4BABA2FB.8050505@web.de> <4BABCE82.7000105@codemonkey.ws> <4BABD9C3.9010309@web.de> <4BABDDF9.2070705@codemonkey.ws> In-Reply-To: <4BABDDF9.2070705@codemonkey.ws> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF25E316E440E60DB1C7D7266" Sender: jan.kiszka@web.de List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF25E316E440E60DB1C7D7266 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Anthony Liguori wrote: > On 03/25/2010 04:46 PM, Jan Kiszka wrote: >> Anthony Liguori wrote: >> =20 >>> On 03/25/2010 12:52 PM, Jan Kiszka wrote: >>> =20 >>>> This adds the "map" subcommand to qemu-img. It is able to expose the= >>>> raw >>>> content of a disk image via a FUSE filesystem. Both the whole disk c= an >>>> be accessed, e.g. to run partitioning tools against it, as well as >>>> individual partitions. This allows to create new filesystems in the >>>> image or loop-back mount exiting ones. Using the great mountlo tool >>>> from the FUSE collection [1][2], the latter can even be done by >>>> non-root >>>> users (the former anyway). >>>> >>>> There are some dependency to fulfill to gain all features: Partition= >>>> scanning is done via recent libblkid (I used version 2.17.1). If thi= s >>>> library is not available, only the disk file is provide. Fortunately= , >>>> mountlo can do partition scanning as well ("-p n") to work around th= is. >>>> >>>> Moreover, libfuse>=3D 2.8 and a host kernel>=3D 2.6.29 is required f= or >>>> seamless disk access via fdisk. Otherwise, the BLKGETSIZE64 IOCTL >>>> cannot >>>> be provided, and the number of cylinders has to set explicitly (e.g.= >>>> via >>>> "-C n"). >>>> >>>> This work was inspired by Ashley Saulsbury's qemu-diskp [3]. >>>> >>>> [1] >>>> http://sourceforge.net/apps/mediawiki/fuse/index.php?title=3DFileSys= tems#Mountlo >>>> >>>> >>>> [2] http://sourceforge.net/projects/fuse/files/mountlo/ >>>> [3] http://www.saulsbury.org/software/virtualization.html >>>> >>>> Signed-off-by: Jan Kiszka >>>> >>>> =20 >>> This has been proposed quite a few times. >>> >>> In fact, I wrote something like this prior to implementing qemu-nbd. >>> >>> The problem with fuse is that as default configured, you can't actual= ly >>> enter into a fuse filesystem as root and since you need to be root to= >>> loopback mount it, it pretty nasty from a usability perspective. >>> =20 >> You don't, see mountlo. >> =20 >=20 > That definitely changes things. I assume it just uses libe2fs et al to= > display filesystem contents? Nope. It's a bit like libguestfs as it uses Linux to access the filesystems, but that Linux runs in UML mode, thus does not require any qemu/kvm underneath. It simply maps the FUSE requests on corresponding VFS services in the UML kernel. >=20 > Does it preserve ownership? Yep. >=20 > You still can't do things as root I take it which is problematic. At least my default config does not prevent running qemu-img map as root and then performing a classic "mount -o loop" on the partitions it provides. Or what do you mean? What mountlo is lacking (at least so far) are things like LVM or soft-RAID. There were some posts on the fuse lists announcing work on it, but that dates 2 years back without any code traces. But if this path turns out to be useful for us (or libguestfs), I guess that should be easy to add. Jan --------------enigF25E316E440E60DB1C7D7266 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkur42EACgkQitSsb3rl5xT3ZACeNFNQrK5M7bCe2KY5hskQO8Wm xi4An3TBfbfg7kNRvrUGBOW/D+nOFDSv =kcBK -----END PGP SIGNATURE----- --------------enigF25E316E440E60DB1C7D7266--