[Libguestfs] Patch. not working

Richard W.M. Jones rjones at redhat.com
Fri Jan 14 13:41:49 UTC 2011


On Fri, Jan 14, 2011 at 04:07:39PM +0300, Nikita A Menkovich wrote:
[...]

Thanks, I have pushed a modified version of this patch upstream:

http://git.annexia.org/?p=libguestfs.git;a=commitdiff;h=4ffa2d6798f7a2bf0baec8e1084659cf6358bc31

Rich.

> diff --git a/daemon/ext2.c b/daemon/ext2.c
> index 725352e..85ce316 100644
> --- a/daemon/ext2.c
> +++ b/daemon/ext2.c
> @@ -266,6 +266,27 @@ do_resize2fs_size (const char *device, int64_t size)
>  }
>  
>  int
> +do_resize2fs_M (const char *device)
> +{
> +  char *err;
> +  int r;
> +
> +  char prog[] = "resize2fs";
> +  if (e2prog (prog) == -1)
> +    return -1;
> +
> +  r = command (NULL, &err, prog, "-M" , device, NULL);
> +  if (r == -1) {
> +    reply_with_error ("%s", err);
> +    free (err);
> +    return -1;
> +  }
> +
> +  free (err);
> +  return 0;
> +}
> +
> +int
>  do_e2fsck_f (const char *device)
>  {
>    char *err;
> diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
> index ccaf10a..d673ce5 100644
> --- a/generator/generator_actions.ml
> +++ b/generator/generator_actions.ml
> @@ -5675,6 +5675,13 @@ is no extended attribute named C<name>, this returns an error.
>  
>  See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>.");
>  
> +  ("resize2fs_M", (RErr, [Device "device"], []), 281, [],
> +   [],
> +   "resize an ext2, ext3 or ext4 filesystem for their minimal size value",
> +   "\
> +This command is the same as C<guestfs_resize2fs> , but resizes partition
> +to minimal size value.");
> +
>  ]
>  
>  let all_functions = non_daemon_functions @ daemon_functions
> diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
> index 1b1c131..1473a88 100644
> --- a/src/MAX_PROC_NR
> +++ b/src/MAX_PROC_NR
> @@ -1 +1 @@
> -280
> +281


-- 
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