summaryrefslogtreecommitdiffstats
path: root/daemon/lvm.c
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-25 21:40:50 +0100
committerRichard Jones <rjones@redhat.com>2009-04-25 21:40:50 +0100
commit58caa9e5f1dca3916178894876b938a6a45771b0 (patch)
tree3f8cb831757c67915579cfcf9852c081b98f872f /daemon/lvm.c
parentb6d5c9e646d0aa18699a88d02ed9205380553b65 (diff)
downloadlibguestfs-58caa9e5f1dca3916178894876b938a6a45771b0.tar.gz
libguestfs-58caa9e5f1dca3916178894876b938a6a45771b0.tar.xz
libguestfs-58caa9e5f1dca3916178894876b938a6a45771b0.zip
Implement lvremove, vgremove, pvremove.
Diffstat (limited to 'daemon/lvm.c')
-rw-r--r--daemon/lvm.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/daemon/lvm.c b/daemon/lvm.c
index 55b41f02..6946d584 100644
--- a/daemon/lvm.c
+++ b/daemon/lvm.c
@@ -300,3 +300,57 @@ do_lvm_remove_all (void)
/* There, that was easy, sorry about your data. */
return 0;
}
+
+int
+do_lvremove (const char *device)
+{
+ char *err;
+ int r;
+
+ r = command (NULL, &err,
+ "/sbin/lvm", "lvremove", "-f", device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ free (err);
+ return -1;
+ }
+
+ free (err);
+ return 0;
+}
+
+int
+do_vgremove (const char *device)
+{
+ char *err;
+ int r;
+
+ r = command (NULL, &err,
+ "/sbin/lvm", "vgremove", "-f", device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ free (err);
+ return -1;
+ }
+
+ free (err);
+ return 0;
+}
+
+int
+do_pvremove (const char *device)
+{
+ char *err;
+ int r;
+
+ r = command (NULL, &err,
+ "/sbin/lvm", "pvremove", "-ff", device, NULL);
+ if (r == -1) {
+ reply_with_error ("%s", err);
+ free (err);
+ return -1;
+ }
+
+ free (err);
+ return 0;
+}