From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuvGs-0005KP-5N for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:11:22 -0400 Received: from [140.186.70.92] (port=58152 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuvGo-0005Gx-QN for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:11:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuvGi-0000em-Se for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:11:18 -0400 Received: from mail-pz0-f194.google.com ([209.85.222.194]:53001) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuvGi-0000eZ-NL for qemu-devel@nongnu.org; Thu, 25 Mar 2010 18:11:12 -0400 Received: by pzk32 with SMTP id 32so2184505pzk.4 for ; Thu, 25 Mar 2010 15:11:11 -0700 (PDT) Message-ID: <4BABDDF9.2070705@codemonkey.ws> Date: Thu, 25 Mar 2010 17:04:41 -0500 From: Anthony Liguori 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> In-Reply-To: <4BABD9C3.9010309@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel On 03/25/2010 04:46 PM, Jan Kiszka wrote: > Anthony Liguori wrote: > >> On 03/25/2010 12:52 PM, Jan Kiszka wrote: >> >>> 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 can >>> 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 this >>> library is not available, only the disk file is provide. Fortunately, >>> mountlo can do partition scanning as well ("-p n") to work around this. >>> >>> Moreover, libfuse>= 2.8 and a host kernel>= 2.6.29 is required for >>> 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=FileSystems#Mountlo >>> >>> [2] http://sourceforge.net/projects/fuse/files/mountlo/ >>> [3] http://www.saulsbury.org/software/virtualization.html >>> >>> Signed-off-by: Jan Kiszka >>> >>> >> 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 actually >> 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. >> > You don't, see mountlo. > That definitely changes things. I assume it just uses libe2fs et al to display filesystem contents? Does it preserve ownership? You still can't do things as root I take it which is problematic. >> So why did you go the fuse route instead of using qemu-nbd? >> > Mostly usability. It's really straightforward to stack mountlo on top of > the mapped image. And you can run (almost) all the filesystem and > partitioning tools. > > Moreover, blkid_partlist provides a more complete partition parser than > rolling your own version We do in qemu-nbd and in qemu (to guess disk geometry). Regards, Anthony Liguori