diff options
author | Nikita A Menkovich <menkovich@gmail.com> | 2011-01-14 13:39:38 +0000 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2011-01-14 13:40:17 +0000 |
commit | 4ffa2d6798f7a2bf0baec8e1084659cf6358bc31 (patch) | |
tree | fb9bb3515fc58235af5a78967412eac3e42b13ce /daemon | |
parent | 69f2f6290032e1079dfa1e83fab3559d5d2d690f (diff) | |
download | libguestfs-4ffa2d6798f7a2bf0baec8e1084659cf6358bc31.tar.gz libguestfs-4ffa2d6798f7a2bf0baec8e1084659cf6358bc31.tar.xz libguestfs-4ffa2d6798f7a2bf0baec8e1084659cf6358bc31.zip |
New API: resize2fs-M to resize ext2/3/4 to minimum size.
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/ext2.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/daemon/ext2.c b/daemon/ext2.c index 725352e3..85ce3165 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; |