[Libguestfs] [PATCH 4/4] New API: btrfstune_x

Chen, Hanxiao chenhanxiao at cn.fujitsu.com
Sun Mar 1 05:55:40 UTC 2015



> -----Original Message-----
> From: Richard W.M. Jones [mailto:rjones at redhat.com]
> Sent: Friday, February 27, 2015 9:43 PM
> To: Chen, Hanxiao/陈 晗霄
> Cc: libguestfs at redhat.com
> Subject: Re: [Libguestfs] [PATCH 4/4] New API: btrfstune_x
> 
> On Sat, Feb 21, 2015 at 08:23:21PM +0800, Chen Hanxiao wrote:
> > Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> > ---
> >  daemon/btrfs.c       | 24 ++++++++++++++++++++++++
> >  generator/actions.ml | 15 +++++++++++++++
> >  src/MAX_PROC_NR      |  2 +-
> >  3 files changed, 40 insertions(+), 1 deletion(-)
> >
> > diff --git a/daemon/btrfs.c b/daemon/btrfs.c
> > index ea2f1f1..cccac9a 100644
> > --- a/daemon/btrfs.c
> > +++ b/daemon/btrfs.c
> > @@ -2165,3 +2165,27 @@ do_btrfstune_r (const char *device)
> >
> >    return 0;
> >  }
> > +
> > +int
> > +do_btrfstune_x (const char *device)
> > +{
> > +  const size_t MAX_ARGS = 64;
> > +  const char *argv[MAX_ARGS];
> > +  size_t i = 0;
> > +  CLEANUP_FREE char *err = NULL;
> > +  CLEANUP_FREE char *out = NULL;
> > +  int r;
> > +
> > +  ADD_ARG (argv, i, str_btrfstune);
> > +  ADD_ARG (argv, i, "-x");
> > +  ADD_ARG (argv, i, device);
> > +  ADD_ARG (argv, i, NULL);
> > +
> > +  r = commandv (&out, &err, argv);
> > +  if (r == -1) {
> > +    reply_with_error ("%s: %s", device, err);
> > +    return -1;
> > +  }
> > +
> > +  return 0;
> > +}
> > diff --git a/generator/actions.ml b/generator/actions.ml
> > index 661ba9a..9888f94 100644
> > --- a/generator/actions.ml
> > +++ b/generator/actions.ml
> > @@ -12580,6 +12580,21 @@ so that you can use it tto build other filesystems." };
> >      longdesc = "\
> >      This will Enable extended inode refs." };
> >
> > +  { defaults with
> > +    name = "btrfstune_x";
> > +    style = RErr, [Device "device"], [];
> > +    proc_nr = Some 457;
> > +    optional = Some "btrfs"; camel_name = "BTRFSTuneX";
> > +    tests = [
> > +      InitPartition, Always, TestRun (
> > +        [["mkfs_btrfs"; "/dev/sda1"; ""; ""; "NOARG"; ""; "NOARG"; "NOARG"; "";
> ""];
> > +         ["btrfstune_x"; "/dev/sda1"]]), []
> > +    ];
> > +
> > +    shortdesc = "enable skinny metadata extent refs";
> > +    longdesc = "\
> > +    This enable skinny metadata extent refs." };
> 
>    ^^^^ Extra spaces again.
> 
> Maybe call this "btrfstune_enable_skinny_metadata_extent_refs"?
> 
> Patches 3/4 look fine apart from the extra spaces and
> possible naming issue.
> 

Thanks for your comments.
V2 will come soon after `make check`.

Regards,
- Chen




More information about the Libguestfs mailing list