X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=java%2Fcom%2Fredhat%2Fet%2Flibguestfs%2FGuestFS.java;h=f56ae41577cebe63f4746bf7c474d6a57e916274;hb=24bee20ce4196d45891925332a47a05aa5e40938;hp=515fc77b57d907b9cfb93fda4011aed156f70d19;hpb=ac286b26df1aabceca26dac66c325a3676ace4cc;p=libguestfs.git diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 515fc77..f56ae41 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2487,4 +2487,53 @@ public class GuestFS { private native void _mv (long g, String src, String dest) throws LibGuestFSException; + /** + * drop kernel page cache, dentries and inodes + * + * This instructs the guest kernel to drop its page cache, + * and/or dentries and inode caches. The parameter + * "whattodrop" tells the kernel what precisely to drop, + * see + * + * Setting "whattodrop" to 3 should drop everything. + * + * This automatically calls sync(2) before the operation, + * so that the maximum guest memory is freed. + * + * @throws LibGuestFSException + */ + public void drop_caches (int whattodrop) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("drop_caches: handle is closed"); + _drop_caches (g, whattodrop); + } + private native void _drop_caches (long g, int whattodrop) + throws LibGuestFSException; + + /** + * return kernel messages + * + * This returns the kernel messages ("dmesg" output) from + * the guest kernel. This is sometimes useful for extended + * debugging of problems. + * + * Another way to get the same information is to enable + * verbose messages with "g.set_verbose" or by setting the + * environment variable "LIBGUESTFS_DEBUG=1" before running + * the program. + * + * @throws LibGuestFSException + */ + public String dmesg () + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("dmesg: handle is closed"); + return _dmesg (g); + } + private native String _dmesg (long g) + throws LibGuestFSException; + }