From bcb3fc0c3336c05e9ecbbfb25c7c31b42bd3e32e Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 23 Jun 2009 15:53:44 +0100 Subject: Generated code for 'scrub-*' commands. --- perl/Guestfs.xs | 33 +++++++++++++++++++++++++++++++++ perl/lib/Sys/Guestfs.pm | 36 +++++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 1 deletion(-) (limited to 'perl') diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 5905dc5e..4b059101 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -2602,3 +2602,36 @@ PREINIT: } free (paths); +void +scrub_device (g, device) + guestfs_h *g; + char *device; +PREINIT: + int r; + PPCODE: + r = guestfs_scrub_device (g, device); + if (r == -1) + croak ("scrub_device: %s", guestfs_last_error (g)); + +void +scrub_file (g, file) + guestfs_h *g; + char *file; +PREINIT: + int r; + PPCODE: + r = guestfs_scrub_file (g, file); + if (r == -1) + croak ("scrub_file: %s", guestfs_last_error (g)); + +void +scrub_freespace (g, dir) + guestfs_h *g; + char *dir; +PREINIT: + int r; + PPCODE: + r = guestfs_scrub_freespace (g, dir); + if (r == -1) + croak ("scrub_freespace: %s", guestfs_last_error (g)); + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 436f218c..9c5aa183 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -115,7 +115,7 @@ for whatever operations you want to perform (ie. read access if you just want to read the image or write access if you want to modify the image). -This is equivalent to the qemu parameter C<-drive file=filename>. +This is equivalent to the qemu parameter C<-drive file=filename,cache=off>. Note that this call checks for the existence of C. This stops you from specifying other types of drive which are supported @@ -999,6 +999,38 @@ command. Remove the single directory C. +=item $h->scrub_device ($device); + +This command writes patterns over C to make data retrieval +more difficult. + +It is an interface to the L program. See that +manual page for more details. + +B. + +=item $h->scrub_file ($file); + +This command writes patterns over a file to make data retrieval +more difficult. + +The file is I after scrubbing. + +It is an interface to the L program. See that +manual page for more details. + +=item $h->scrub_freespace ($dir); + +This command creates the directory C and then fills it +with files until the filesystem is full, and scrubs the files +as for C<$h-Escrub_file>, and deletes them. +The intention is to scrub any free space on the partition +containing C. + +It is an interface to the L program. See that +manual page for more details. + =item $h->set_append ($append); This function is used to add additional options to the @@ -1365,6 +1397,8 @@ How many blocks are zeroed isn't specified (but it's I enough to securely wipe the device). It should be sufficient to remove any partition tables, filesystem superblocks and so on. +See also: C<$h-Escrub_device>. + =item $h->zerofree ($device); This runs the I program on C. This program -- cgit