copy_device_to_device
Description:
public bool copy_device_to_device (string src, string dest, CopyDeviceToDevice? optargs) throws Error
copy from source device to destination device
The four calls copy_device_to_device, copy_device_to_file, copy_file_to_device, and copy_file_to_file let you copy from a source ( device|file) to a destination (device|file).
Partial copies can be made since you can specify optionally the source offset, destination offset and size to copy. These values are all specified in bytes. If not given, the offsets both default to zero, and the size defaults to copying as much as possible until we hit the end of the source.
The source and destination may be the same object. However overlapping regions may not be copied correctly.
If the destination is a file, it is created if required. If the destination file is not large enough, it is extended.
If the destination is a file and the append
flag is not set, then the destination file is truncated. If the append
flag is set, then the copy appends to the destination file. The append
flag currently cannot be set for devices.
If the sparse
flag is true then the call avoids writing blocks that contain only zeroes, which can help in some situations where
the backing disk is thin-provisioned. Note that unless the target is already zeroed, using this option will result in incorrect copying.
Parameters:
this |
A GuestfsSession object |
optargs |
a GuestfsCopyDeviceToDevice containing optional arguments |
Returns:
true on success, false on error |