[Libguestfs] guestmount support for acls/xattrs

Richard W.M. Jones rjones at redhat.com
Fri Mar 25 22:35:04 UTC 2011


On Fri, Mar 25, 2011 at 06:17:46PM -0400, Sumedh Degaonkar wrote:
> Hello,
> 
> I have a vmdk having an LV with an ext3 FS where some files have extended
> attributes and acls set.
> These do not appear set while accessing them when mounted using guestmount.
> I do not know if it is easy or difficult to implement this, so I'd like to
> take your opinion.
> 
> what I did was changed the default mount options in daemon/mount.c from "ro"
> to "ro,acl,user_xattr". I figure that with this change, the filesystem will
> be mounted with these options inside the appliance.

It's better to make guestmount (ie. fuse/guestmount.c ->
fish/options.c:mount_mps) use configurable mount options.  But what
you've done is fine as a hack for testing this.

> What I do not understand yet is the mechanism by which those mountpoints are
> exported to the host and then what options are set when FUSE mount happens.

[I wrote a bit at the end of this email about how the general
architecture works, in case you're not clear on that]

We basically ignore FUSE mount options.  I mean to say, we pass them
through to FUSE, but we don't take any special extra actions in
guestmount.  Probably we should be doing this.

Confusing this a bit more is that the code for command line parsing is
shared between guestfish, guestmount and some of the virt-* tools.
You can find the shared code by looking at fish/Makefile.am:
'SHARED_SOURCE_FILES' macro.

> In the interest of time and to avoid duplicate effort, I'd appreciate if any
> of you can share your thoughts on this.

http://libguestfs.org/guestfs.3.html#architecture

The library talks to the daemon using a remote procedure call
protocol.

The main code (in fuse/guestmount.c) makes libguestfs API calls which
get turned into remote procedure calls which talk to the daemon.

For example:

(1) fuse/guestmount.c: fg_readdir calls guestfs_lxattrlist
(2) src/actions.c: guestfs_lxattrlist makes remote procedure call
(3) daemon/xattr.c: do_lxattrlist is invoked and gets the xattrs
(4) list of xattrs is returned over remote proc reply to src/actions.c
(5) this is returned up to guestmount

We implement xattrs [supposedly .. I've never really tried to see if
it works] in fuse/guestmount.c:fg_getxattr and fuse/guestmount.c:fg_setxattr.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top




More information about the Libguestfs mailing list