summaryrefslogtreecommitdiffstats
path: root/generator
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2010-09-26 18:00:11 +0100
committerRichard W.M. Jones <rjones@redhat.com>2010-09-26 22:21:36 +0100
commiteeaab2ba84441a96977281a4472b1bccb9ec80a9 (patch)
tree0e0e103b582b957d3d018469843dd49912e8893d /generator
parent5a8c8b8bf6e846b8d2d7e710f814d24d9a0183c3 (diff)
downloadlibguestfs-eeaab2ba84441a96977281a4472b1bccb9ec80a9.tar.gz
libguestfs-eeaab2ba84441a96977281a4472b1bccb9ec80a9.tar.xz
libguestfs-eeaab2ba84441a96977281a4472b1bccb9ec80a9.zip
New API: pwrite-device
This is the same as the existing 'pwrite' API call, but allows you to write to a device.
Diffstat (limited to 'generator')
-rw-r--r--generator/generator_actions.ml19
1 files changed, 18 insertions, 1 deletions
diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml
index ac8dab21..e94fcbde 100644
--- a/generator/generator_actions.ml
+++ b/generator/generator_actions.ml
@@ -4812,7 +4812,7 @@ return value is the number of bytes that were actually written
to the file. This could even be 0, although short writes are
unlikely for regular files in ordinary circumstances.
-See also C<guestfs_pread>.");
+See also C<guestfs_pread>, C<guestfs_pwrite_device>.");
("resize2fs_size", (RErr, [Device "device"; Int64 "size"]), 248, [],
[],
@@ -5166,6 +5166,23 @@ error occurs.
See also C<guestfs_download>, C<guestfs_pread>.");
+ ("pwrite_device", (RInt "nbytes", [Device "device"; BufferIn "content"; Int64 "offset"]), 275, [ProtocolLimitWarning],
+ [InitPartition, Always, TestOutputList (
+ [["pwrite_device"; "/dev/sda"; "\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000"; "446"];
+ ["blockdev_rereadpt"; "/dev/sda"];
+ ["list_partitions"]], [])],
+ "write to part of a device",
+ "\
+This command writes to part of a device. It writes the data
+buffer C<content> to C<device> starting at offset C<offset>.
+
+This command implements the L<pwrite(2)> system call, and like
+that system call it may not write the full data requested
+(although short writes to disk devices and partitions are
+probably impossible with standard Linux kernels).
+
+See also C<guestfs_pwrite>.");
+
]
let all_functions = non_daemon_functions @ daemon_functions