diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-25 21:41:09 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-25 21:41:09 +0100 |
commit | aed0fa2c015e56a882fd6d4b759c82df08fc40d7 (patch) | |
tree | acfb96c7b0adbc10ab73236d30c644b85807ffdc /perl | |
parent | 58caa9e5f1dca3916178894876b938a6a45771b0 (diff) | |
download | libguestfs-aed0fa2c015e56a882fd6d4b759c82df08fc40d7.tar.gz libguestfs-aed0fa2c015e56a882fd6d4b759c82df08fc40d7.tar.xz libguestfs-aed0fa2c015e56a882fd6d4b759c82df08fc40d7.zip |
Generated code for lvremove, vgremove, pvremove.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Guestfs.xs | 33 | ||||
-rw-r--r-- | perl/lib/Sys/Guestfs.pm | 28 |
2 files changed, 59 insertions, 2 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index be13fcde..53c589d9 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -1485,3 +1485,36 @@ PREINIT: OUTPUT: RETVAL +void +lvremove (g, device) + guestfs_h *g; + char *device; +PREINIT: + int r; + PPCODE: + r = guestfs_lvremove (g, device); + if (r == -1) + croak ("lvremove: %s", guestfs_last_error (g)); + +void +vgremove (g, vgname) + guestfs_h *g; + char *vgname; +PREINIT: + int r; + PPCODE: + r = guestfs_vgremove (g, vgname); + if (r == -1) + croak ("vgremove: %s", guestfs_last_error (g)); + +void +pvremove (g, device) + guestfs_h *g; + char *device; +PREINIT: + int r; + PPCODE: + r = guestfs_pvremove (g, device); + if (r == -1) + croak ("pvremove: %s", guestfs_last_error (g)); + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 3d1493b5..bd2d9616 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -608,6 +608,14 @@ and physical volumes. B<This command is dangerous. Without careful use you can easily destroy all your data>. +=item $h->lvremove ($device); + +Remove an LVM logical volume C<device>, where C<device> is +the path to the LV, such as C</dev/VG/LV>. + +You can also remove all LVs in a volume group by specifying +the VG name, C</dev/VG>. + =item @logvols = $h->lvs (); List all the logical volumes detected. This is the equivalent @@ -687,6 +695,15 @@ This creates an LVM physical volume on the named C<device>, where C<device> should usually be a partition name such as C</dev/sda1>. +=item $h->pvremove ($device); + +This wipes a physical volume C<device> so that LVM will no longer +recognise it. + +The implementation uses the C<pvremove> command which refuses to +wipe physical volumes that contain any volume groups, so you have +to remove those first. + =item @physvols = $h->pvs (); List all the physical volumes detected. This is the equivalent @@ -865,8 +882,8 @@ to create a new zero-length file. =item %superblock = $h->tune2fs_l ($device); -This returns the contents of the ext2 or ext3 filesystem superblock -on C<device>. +This returns the contents of the ext2, ext3 or ext4 filesystem +superblock on C<device>. It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage for more details. The list of fields returned isn't @@ -899,6 +916,13 @@ See also C<$h-E<gt>download>. This creates an LVM volume group called C<volgroup> from the non-empty list of physical volumes C<physvols>. +=item $h->vgremove ($vgname); + +Remove an LVM volume group C<vgname>, (for example C<VG>). + +This also forcibly removes all logical volumes in the volume +group (if any). + =item @volgroups = $h->vgs (); List all the volumes groups detected. This is the equivalent |