summaryrefslogtreecommitdiffstats
path: root/perl
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2009-05-01 11:18:53 +0100
committerRichard W.M. Jones <rjones@redhat.com>2009-05-01 11:18:53 +0100
commit9222136ac9b2e404dba128b1ac74dacaa8bf1038 (patch)
tree84d74f0c966b925c3e22bf3322256df10455d94b /perl
parent2dc9e8a858b62830d15a8186fe575eb7903d2171 (diff)
downloadlibguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.tar.gz
libguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.tar.xz
libguestfs-9222136ac9b2e404dba128b1ac74dacaa8bf1038.zip
Generated code for drop-caches command.
Diffstat (limited to 'perl')
-rw-r--r--perl/Guestfs.xs11
-rw-r--r--perl/lib/Sys/Guestfs.pm12
2 files changed, 23 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs
index 3c5f7138..1a45c796 100644
--- a/perl/Guestfs.xs
+++ b/perl/Guestfs.xs
@@ -1647,3 +1647,14 @@ PREINIT:
if (r == -1)
croak ("mv: %s", guestfs_last_error (g));
+void
+drop_caches (g, whattodrop)
+ guestfs_h *g;
+ int whattodrop;
+PREINIT:
+ int r;
+ PPCODE:
+ r = guestfs_drop_caches (g, whattodrop);
+ if (r == -1)
+ croak ("drop_caches: %s", guestfs_last_error (g));
+
diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm
index 9501a83f..63a49259 100644
--- a/perl/lib/Sys/Guestfs.pm
+++ b/perl/lib/Sys/Guestfs.pm
@@ -461,6 +461,18 @@ C<filename> can also be a named pipe.
See also C<$h-E<gt>upload>, C<$h-E<gt>cat>.
+=item $h->drop_caches ($whattodrop);
+
+This instructs the guest kernel to drop its page cache,
+and/or dentries and inode caches. The parameter C<whattodrop>
+tells the kernel what precisely to drop, see
+L<http://linux-mm.org/Drop_Caches>
+
+Setting C<whattodrop> to 3 should drop everything.
+
+This automatically calls L<sync(2)> before the operation,
+so that the maximum guest memory is freed.
+
=item $existsflag = $h->exists ($path);
This returns C<true> if and only if there is a file, directory