> point is that the loop device can either create a virtual block device
> based on a device OR a file. As you point out, a possible application
> of basing a vbd on top of a device is to handle wierd partitions in user
> mode. Just read in the BSD disklabel, and then set up the loop device
> with the correct starting offset.
>
> In order to completely use the loop device for this applicaiton, we
> would need to have a method of manually setting the size of the
> partition of the virtual device. Right now, the size is set to the size
> of the parent device or file minus the starting offset. We need to
> create a new ioctl to restrict the size down to the size specified in
> the non-native partition table. This wouldn't be at all difficult,
This would be _great_ for all the people sharing swap between Linux
and Windows. There could be a winswapon command that adds the swap
signiture a few blocks into the file, looks up the block and verifies
that the file really is contiguous, attaches a loopback device to
the disk at the proper offset, and then enables swapping. Putting
this into one command would make swap sharing really easy, yet fast.