Re: [Libguestfs] RFC: copy-attributes command

2014-01-13 Thread Pino Toscano
On Friday 10 January 2014 16:53:32 Richard W.M. Jones wrote: On Fri, Jan 10, 2014 at 05:36:39PM +0100, Pino Toscano wrote: [..] This still isn't quite what I meant. My meaning was that mode would be disabled by default (unless all:true). OK. How about: int copy_mode, copy_xattributes,

Re: [Libguestfs] RFC: copy-attributes command

2014-01-13 Thread Richard W.M. Jones
On Mon, Jan 13, 2014 at 12:54:36PM +0100, Pino Toscano wrote: On Friday 10 January 2014 16:53:32 Richard W.M. Jones wrote: On Fri, Jan 10, 2014 at 05:36:39PM +0100, Pino Toscano wrote: [..] This still isn't quite what I meant. My meaning was that mode would be disabled by default

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Pino Toscano
On Tuesday 07 January 2014 21:04:36 Richard W.M. Jones wrote: On Tue, Jan 07, 2014 at 04:06:43PM +0100, Pino Toscano wrote: Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a file to another, so for

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Richard W.M. Jones
On Fri, Jan 10, 2014 at 02:17:48PM +0100, Pino Toscano wrote: This code looks as if it will copy the xattrs, but it won't remove any which don't exist in the source. eg: source xattrs before: user.foo = 1 dest xattrs before: user.bar = 2 dest xattrs after:

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Richard W.M. Jones
On Fri, Jan 10, 2014 at 01:33:38PM +, Richard W.M. Jones wrote: The API is now pretty confusing. Each OBool flag is really a tristate. It can either be true, false or not specified. Therefore I think it should be: xattributes:true# copies only xattrs and nothing else

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Pino Toscano
On Friday 10 January 2014 13:33:38 Richard W.M. Jones wrote: On Fri, Jan 10, 2014 at 02:17:48PM +0100, Pino Toscano wrote: This code looks as if it will copy the xattrs, but it won't remove any which don't exist in the source. eg: source xattrs before: user.foo = 1

Re: [Libguestfs] RFC: copy-attributes command

2014-01-10 Thread Richard W.M. Jones
On Fri, Jan 10, 2014 at 05:36:39PM +0100, Pino Toscano wrote: [..] This still isn't quite what I meant. My meaning was that mode would be disabled by default (unless all:true). How about: int copy_mode, copy_xattributes, copy_ownership; /* Set defaults. */ if (all) copy_mode =

Re: [Libguestfs] RFC: copy-attributes command

2014-01-09 Thread Pino Toscano
On Tuesday 07 January 2014 21:04:36 Richard W.M. Jones wrote: On Tue, Jan 07, 2014 at 04:06:43PM +0100, Pino Toscano wrote: diff --git a/daemon/xattr.c b/daemon/xattr.c index af8bfd4..97a94d5 100644 --- a/daemon/xattr.c +++ b/daemon/xattr.c @@ -545,8 +545,98 @@ do_lgetxattr (const char

Re: [Libguestfs] RFC: copy-attributes command

2014-01-07 Thread Richard W.M. Jones
On Tue, Jan 07, 2014 at 04:06:43PM +0100, Pino Toscano wrote: Hi, attached there is a prototype of patch for adding a new copy-attributes command. Such command would allow copy the attributes of a file to another, so for example in guestfish: copy-attributes foo bar permissions:true

Re: [Libguestfs] RFC: copy-attributes command

2014-01-07 Thread Richard W.M. Jones
On Tue, Jan 07, 2014 at 09:04:36PM +, Richard W.M. Jones wrote: - Should it default to copying attributes? The common use case (for virt-edit) is: I want this other file which is identical to this original file, except in name and content. That is (I think) an argument for copying