[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qemu-img: add FUSE-based image access
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH] qemu-img: add FUSE-based image access |
Date: |
Thu, 25 Mar 2010 22:46:43 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
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<address@hidden>
>>
>
> 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.
>
> 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 - which I briefly considered and then quickly
dropped after looking at some implementations.
Jan
signature.asc
Description: OpenPGP digital signature
Re: [Qemu-devel] [PATCH] qemu-img: add FUSE-based image access, Christoph Hellwig, 2010/03/28