diff options
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/lvm.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/daemon/lvm.c b/daemon/lvm.c index 564517c5..7a05a540 100644 --- a/daemon/lvm.c +++ b/daemon/lvm.c @@ -468,3 +468,47 @@ do_vg_activate_all (int activate) char *empty[] = { NULL }; return do_vg_activate (activate, empty); } + +int +do_lvrename (const char *logvol, const char *newlogvol) +{ + char *err; + int r; + + r = command (NULL, &err, + "/sbin/lvm", "lvrename", + logvol, newlogvol, NULL); + if (r == -1) { + reply_with_error ("lvrename: %s -> %s: %s", logvol, newlogvol, err); + free (err); + return -1; + } + + free (err); + + udev_settle (); + + return 0; +} + +int +do_vgrename (const char *volgroup, const char *newvolgroup) +{ + char *err; + int r; + + r = command (NULL, &err, + "/sbin/lvm", "vgrename", + volgroup, newvolgroup, NULL); + if (r == -1) { + reply_with_error ("vgrename: %s -> %s: %s", volgroup, newvolgroup, err); + free (err); + return -1; + } + + free (err); + + udev_settle (); + + return 0; +} |