summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2009-04-30 18:57:07 +0100
committerRichard Jones <rjones@redhat.com>2009-04-30 18:57:07 +0100
commit0703248d233744047515418893dac05ce013a642 (patch)
treeead0b718136e64b179b9d46f3fc314cdd49f2149 /perl
parentc69c3695303d5a660ad093a076c2e364ae6061de (diff)
downloadlibguestfs-0703248d233744047515418893dac05ce013a642.tar.gz
libguestfs-0703248d233744047515418893dac05ce013a642.tar.xz
libguestfs-0703248d233744047515418893dac05ce013a642.zip
Add generated code for 'fsck' command.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs15
-rw-r--r--perl/lib/Sys/Guestfs.pm13
2 files changed, 28 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index 9d8a49cf..38c60c21 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -1573,3 +1573,18 @@ PREINIT:
OUTPUT:
RETVAL
+SV *
+fsck (g, fstype, device)
+ guestfs_h *g;
+ char *fstype;
+ char *device;
+PREINIT:
+ int status;
+ CODE:
+ status = guestfs_fsck (g, fstype, device);
+ if (status == -1)
+ croak ("fsck: %s", guestfs_last_error (g));
+ RETVAL = newSViv (status);
+ OUTPUT:
+ RETVAL
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index efc28457..5b87b27e 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -468,6 +468,19 @@ The exact command which runs is C<file -bsL path>. Note in
particular that the filename is not prepended to the output
(the C<-b> option).
+=item $status = $h->fsck ($fstype, $device);
+
+This runs the filesystem checker (fsck) on C<device> which
+should have filesystem type C<fstype>.
+
+The returned integer is the status. See L<fsck(8)> for the
+list of status codes from C<fsck>, and note that multiple
+status codes can be summed together.
+
+It is entirely equivalent to running C<fsck -a -t fstype device>.
+Note that checking or repairing NTFS volumes is not supported
+(by linux-ntfs).
+
=item $autosync = $h->get_autosync ();
Get the autosync flag.