summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs54
-rw-r--r--perl/lib/Sys/Guestfs.pm29
2 files changed, 83 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index 53c589d9..12c6cbbc 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -1518,3 +1518,57 @@ PREINIT:
if (r == -1)
croak ("pvremove: %s", guestfs_last_error (g));
+void
+set_e2label (g, device, label)
+ guestfs_h *g;
+ char *device;
+ char *label;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_set_e2label (g, device, label);
+ if (r == -1)
+ croak ("set_e2label: %s", guestfs_last_error (g));
+
+SV *
+get_e2label (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *label;
+ CODE:
+ label = guestfs_get_e2label (g, device);
+ if (label == NULL)
+ croak ("get_e2label: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (label, 0);
+ free (label);
+ OUTPUT:
+ RETVAL
+
+void
+set_e2uuid (g, device, uuid)
+ guestfs_h *g;
+ char *device;
+ char *uuid;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_set_e2uuid (g, device, uuid);
+ if (r == -1)
+ croak ("set_e2uuid: %s", guestfs_last_error (g));
+
+SV *
+get_e2uuid (g, device)
+ guestfs_h *g;
+ char *device;
+PREINIT:
+ char *uuid;
+ CODE:
+ uuid = guestfs_get_e2uuid (g, device);
+ if (uuid == NULL)
+ croak ("get_e2uuid: %s", guestfs_last_error (g));
+ RETVAL = newSVpv (uuid, 0);
+ free (uuid);
+ OUTPUT:
+ RETVAL
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index bd2d9616..90384da8 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -472,6 +472,16 @@ particular that the filename is not prepended to the output
Get the autosync flag.
+=item $label = $h->get_e2label ($device);
+
+This returns the ext2/3/4 filesystem label of the filesystem on
+C<device>.
+
+=item $uuid = $h->get_e2uuid ($device);
+
+This returns the ext2/3/4 filesystem UUID of the filesystem on
+C<device>.
+
=item $path = $h->get_path ();
Return the current search path.
@@ -758,6 +768,25 @@ actions using the low-level API.
For more information on states, see L<guestfs(3)>.
+=item $h->set_e2label ($device, $label);
+
+This sets the ext2/3/4 filesystem label of the filesystem on
+C<device> to C<label>. Filesystem labels are limited to
+16 characters.
+
+You can use either C<$h-E<gt>tune2fs_l> or C<$h-E<gt>get_e2label>
+to return the existing label on a filesystem.
+
+=item $h->set_e2uuid ($device, $uuid);
+
+This sets the ext2/3/4 filesystem UUID of the filesystem on
+C<device> to C<uuid>. The format of the UUID and alternatives
+such as C<clear>, C<random> and C<time> are described in the
+L<tune2fs(8)> manpage.
+
+You can use either C<$h-E<gt>tune2fs_l> or C<$h-E<gt>get_e2uuid>
+to return the existing UUID of a filesystem.
+
=item $h->set_path ($path);
Set the path that libguestfs searches for kernel and initrd.img.