tune2fs-l: Add a test.
[libguestfs.git] / daemon / ext2.c
index 725352e..f7889da 100644 (file)
@@ -13,7 +13,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <config.h>
@@ -39,7 +39,7 @@
  * We specify e4fsprogs in the package list to ensure it is loaded
  * if it exists.
  */
-static int
+int
 e2prog (char *name)
 {
   char *p = strstr (name, "e2");
@@ -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;