diff options
author | Richard Jones <rjones@redhat.com> | 2010-01-28 22:06:27 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2010-01-28 22:06:27 +0000 |
commit | 74fe427460bd2d455d2860c937ae81a8b5a1d1e7 (patch) | |
tree | 7a7931ad3362ead6c56dd786e32340ffb975d8e3 /daemon | |
parent | 3c973b8a960dfde022a7d49b30b8c6d504a182e3 (diff) | |
download | libguestfs-74fe427460bd2d455d2860c937ae81a8b5a1d1e7.tar.gz libguestfs-74fe427460bd2d455d2860c937ae81a8b5a1d1e7.tar.xz libguestfs-74fe427460bd2d455d2860c937ae81a8b5a1d1e7.zip |
Implement 'vgrename' and 'lvrename' APIs.
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; +} |