summaryrefslogtreecommitdiffstats
path: root/daemon/lvm.c
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/lvm.c')
-rw-r--r--daemon/lvm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/daemon/lvm.c b/daemon/lvm.c
index 63a3e7e5..40377f10 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
@@ -240,6 +240,30 @@ do_lvcreate (const char *logvol, const char *volgroup, int mbytes)
return 0;
}
+int
+do_lvresize (const char *logvol, int mbytes)
+{
+ char *err;
+ int r;
+ char size[64];
+
+ IS_DEVICE (logvol, -1);
+
+ snprintf (size, sizeof size, "%d", mbytes);
+
+ r = command (NULL, &err,
+ "/sbin/lvm", "lvresize",
+ "-L", size, logvol, NULL);
+ if (r == -1) {
+ reply_with_error ("lvresize: %s", err);
+ free (err);
+ return -1;
+ }
+
+ free (err);
+ return 0;
+}
+
/* Super-dangerous command used for testing. It removes all
* LVs, VGs and PVs permanently.
*/