summaryrefslogtreecommitdiffstats
path: root/src/guestfs.pod
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2011-10-25 22:49:55 +0100
committerRichard W.M. Jones <rjones@redhat.com>2011-10-26 10:07:21 +0100
commitf223dfa29aafeb7b9a07bbedf03d15acddd62e92 (patch)
tree1a4e5d2d62d79f39f224c5efc03316d12fd90a76 /src/guestfs.pod
parent663b99950daeaa2b023520aae756a3a28969c493 (diff)
downloadlibguestfs-f223dfa29aafeb7b9a07bbedf03d15acddd62e92.tar.gz
libguestfs-f223dfa29aafeb7b9a07bbedf03d15acddd62e92.tar.xz
libguestfs-f223dfa29aafeb7b9a07bbedf03d15acddd62e92.zip
New APIs: copy-{file,device}-to-{file,device}.
The four new APIs: guestfs_copy_device_to_device, guestfs_copy_device_to_file, guestfs_copy_file_to_device, and guestfs_copy_file_to_file let you copy from a source to a destination, between files and devices, optionally allowing source and destination offsets and size to be specified.
Diffstat (limited to 'src/guestfs.pod')
-rw-r--r--src/guestfs.pod31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/guestfs.pod b/src/guestfs.pod
index ada9f1e5..e6a16a68 100644
--- a/src/guestfs.pod
+++ b/src/guestfs.pod
@@ -313,21 +313,36 @@ in the table below.
=item B<file> to B<file>
-Use L</guestfs_cp> to copy a single file, or
-L</guestfs_cp_a> to copy directories recursively.
+Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy
+directories recursively.
-=item B<file or device> to B<file or device>
+To copy part of a file (offset and size) use
+L</guestfs_copy_file_to_file>.
-Use L</guestfs_dd> which efficiently uses L<dd(1)>
-to copy between files and devices in the guest.
+=item B<file> to B<device>
+
+=item B<device> to B<file>
+
+=item B<device> to B<device>
+
+Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>,
+or L</guestfs_copy_device_to_device>.
Example: duplicate the contents of an LV:
- guestfs_dd (g, "/dev/VG/Original", "/dev/VG/Copy");
+ guestfs_copy_device_to_device (g,
+ "/dev/VG/Original", "/dev/VG/Copy",
+ /* -1 marks the end of the list of optional parameters */
+ -1);
The destination (C</dev/VG/Copy>) must be at least as large as the
-source (C</dev/VG/Original>). To copy less than the whole
-source device, use L</guestfs_copy_size>.
+source (C</dev/VG/Original>). To copy less than the whole source
+device, use the optional C<size> parameter:
+
+ guestfs_copy_device_to_device (g,
+ "/dev/VG/Original", "/dev/VG/Copy",
+ GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,
+ -1);
=item B<file on the host> to B<file or device>