guestmount support for acls/xattrs
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. 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. In the interest of time and to avoid duplicate effort, I'd appreciate if any of you can share your thoughts on this. Thanks, Sumedh
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
On Fri, Mar 25, 2011 at 10:35:04PM +0000, Richard W.M. Jones wrote:
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.
Sorry, the above is actually not going to work. guestmount calls guestfs_mount_options, so you would have to modify fish/options.c:mount_mps instead. 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
On Sat, Mar 26, 2011 at 07:51:16AM +0000, Richard W.M. Jones wrote:
On Fri, Mar 25, 2011 at 10:35:04PM +0000, Richard W.M. Jones wrote:
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.
Sorry, the above is actually not going to work. guestmount calls guestfs_mount_options, so you would have to modify fish/options.c:mount_mps instead.
If it's ever unclear what libguestfs API calls are being made by guestmount (or other programs) you can set export LIBGUESTFS_TRACE=1 before running the program. See http://libguestfs.org/FAQ.html#debug Specifically for guestmount you can also get a lot more other debug by adding the -x or --trace option. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
Thanks Richard! Appreciate your time. I will try this and let you know how it goes. -Sumedh On Sat, Mar 26, 2011 at 4:43 AM, Richard W.M. Jones <rjones@redhat.com>wrote:
On Fri, Mar 25, 2011 at 10:35:04PM +0000, Richard W.M. Jones wrote:
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
On Sat, Mar 26, 2011 at 07:51:16AM +0000, Richard W.M. Jones wrote: 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.
Sorry, the above is actually not going to work. guestmount calls guestfs_mount_options, so you would have to modify fish/options.c:mount_mps instead.
If it's ever unclear what libguestfs API calls are being made by guestmount (or other programs) you can set
export LIBGUESTFS_TRACE=1
before running the program. See http://libguestfs.org/FAQ.html#debug
Specifically for guestmount you can also get a lot more other debug by adding the -x or --trace option.
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
There seem to be one or more bugs in this area, so I have opened a bug report here: https://bugzilla.redhat.com/show_bug.cgi?id=691389 Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
That's great! Thanks for addressing this so fast. I shall try this patch today. Looking at the code, it looks like mount options won't work with the '-i' option, though. Thanks, Sumedh On Mon, Mar 28, 2011 at 8:38 AM, Richard W.M. Jones <rjones@redhat.com>wrote:
There seem to be one or more bugs in this area, so I have opened a bug report here:
https://bugzilla.redhat.com/show_bug.cgi?id=691389
Rich.
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones libguestfs lets you edit virtual machines. Supports shell scripting, bindings from many languages. http://libguestfs.org
On Mon, Mar 28, 2011 at 03:02:45PM -0400, Sumedh Degaonkar wrote:
Looking at the code, it looks like mount options won't work with the '-i' option, though.
It's going to need more work to pass the options through to there. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://et.redhat.com/~rjones/virt-df/
participants (2)
-
Richard W.M. Jones -
Sumedh Degaonkar