X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=python%2Fguestfs.py;h=1596bcdb002a7b41ab81a6a01b501e3a38161eec;hp=37dce2bf02838593afa76213a3ad7bdd258b698a;hb=8c3b820c2b687345448e3d74a7101b07ff32688e;hpb=0703248d233744047515418893dac05ce013a642 diff --git a/python/guestfs.py b/python/guestfs.py index 37dce2b..1596bcd 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1154,12 +1154,91 @@ class GuestFS: which should have filesystem type "fstype". The returned integer is the status. See fsck(8) for the - list of status codes from "fsck", and note that multiple - status codes can be summed together. + list of status codes from "fsck". - It is entirely equivalent to running "fsck -a -t fstype - device". Note that checking or repairing NTFS volumes is - not supported (by linux-ntfs). + Notes: + + * Multiple status codes can be summed together. + + * A non-zero return code can mean "success", for + example if errors have been corrected on the + filesystem. + + * Checking or repairing NTFS volumes is not supported + (by linux-ntfs). + + This command is entirely equivalent to running "fsck -a + -t fstype device". """ return libguestfsmod.fsck (self._o, fstype, device) + def zero (self, device): + u"""This command writes zeroes over the first few blocks of + "device". + + How many blocks are zeroed isn't specified (but it's + *not* enough to securely wipe the device). It should be + sufficient to remove any partition tables, filesystem + superblocks and so on. + """ + return libguestfsmod.zero (self._o, device) + + def grub_install (self, root, device): + u"""This command installs GRUB (the Grand Unified + Bootloader) on "device", with the root directory being + "root". + """ + return libguestfsmod.grub_install (self._o, root, device) + + def cp (self, src, dest): + u"""This copies a file from "src" to "dest" where "dest" is + either a destination filename or destination directory. + """ + return libguestfsmod.cp (self._o, src, dest) + + def cp_a (self, src, dest): + u"""This copies a file or directory from "src" to "dest" + recursively using the "cp -a" command. + """ + return libguestfsmod.cp_a (self._o, src, dest) + + def mv (self, src, dest): + u"""This moves a file from "src" to "dest" where "dest" is + either a destination filename or destination directory. + """ + return libguestfsmod.mv (self._o, src, dest) + + def drop_caches (self, whattodrop): + u"""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. + """ + return libguestfsmod.drop_caches (self._o, whattodrop) + + def dmesg (self): + u"""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. + """ + return libguestfsmod.dmesg (self._o) + + def ping_daemon (self): + u"""This is a test probe into the guestfs daemon running + inside the qemu subprocess. Calling this function checks + that the daemon responds to the ping message, without + affecting the daemon or attached block device(s) in any + other way. + """ + return libguestfsmod.ping_daemon (self._o) +