summaryrefslogtreecommitdiffstats
path: root/daemon
diff options
context:
space:
mode:
authorNikita A Menkovich <menkovich@gmail.com>2011-01-14 13:39:38 +0000
committerRichard W.M. Jones <rjones@redhat.com>2011-01-14 13:40:17 +0000
commit4ffa2d6798f7a2bf0baec8e1084659cf6358bc31 (patch)
treefb9bb3515fc58235af5a78967412eac3e42b13ce /daemon
parent69f2f6290032e1079dfa1e83fab3559d5d2d690f (diff)
downloadlibguestfs-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.c21
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;