diff options
author | Richard Jones <rjones@redhat.com> | 2009-04-30 19:28:54 +0100 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-04-30 19:28:54 +0100 |
commit | 62df226f26bd6ac3c481a7790eb89d760d2f0386 (patch) | |
tree | 617a5a436598902b2239d67535925520c20a6e6e /java/com | |
parent | 2a42bec2c5ee521f29179a5aab713f5a9ca2c3b8 (diff) | |
download | libguestfs-62df226f26bd6ac3c481a7790eb89d760d2f0386.tar.gz libguestfs-62df226f26bd6ac3c481a7790eb89d760d2f0386.tar.xz libguestfs-62df226f26bd6ac3c481a7790eb89d760d2f0386.zip |
Added 'zero' command to wipe partition tables and superblocks.
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/redhat/et/libguestfs/GuestFS.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/java/com/redhat/et/libguestfs/GuestFS.java b/java/com/redhat/et/libguestfs/GuestFS.java index 844c3b33..293ee23e 100644 --- a/java/com/redhat/et/libguestfs/GuestFS.java +++ b/java/com/redhat/et/libguestfs/GuestFS.java @@ -2382,4 +2382,27 @@ public class GuestFS { private native int _fsck (long g, String fstype, String device) throws LibGuestFSException; + /** + * write zeroes to the device + * + * 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. + * + * @throws LibGuestFSException + */ + public void zero (String device) + throws LibGuestFSException + { + if (g == 0) + throw new LibGuestFSException ("zero: handle is closed"); + _zero (g, device); + } + private native void _zero (long g, String device) + throws LibGuestFSException; + } |