X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=8a6177cd804f6afdd1d81089f60ebaab8cea84b8;hb=265e6f8f0495fec03b1eed3abb10c2c423233900;hp=742a88c849287d20ae6629bb306de079a5c1d855;hpb=542452fb83486749edc482bd80a7ac6640a1fd7a;p=libguestfs.git
diff --git a/src/generator.ml b/src/generator.ml
index 742a88c..8a6177c 100755
--- a/src/generator.ml
+++ b/src/generator.ml
@@ -572,7 +572,7 @@ The first character of C string must be a C<-> (dash).
C can be NULL.");
- ("set_qemu", (RErr, [String "qemu"]), -1, [FishAlias "qemu"],
+ ("set_qemu", (RErr, [OptString "qemu"]), -1, [FishAlias "qemu"],
[],
"set the qemu binary",
"\
@@ -604,7 +604,7 @@ Return the current qemu binary.
This is always non-NULL. If it wasn't set already, then this will
return the default qemu binary name.");
- ("set_path", (RErr, [String "searchpath"]), -1, [FishAlias "path"],
+ ("set_path", (RErr, [OptString "searchpath"]), -1, [FishAlias "path"],
[],
"set the search path",
"\
@@ -791,8 +791,9 @@ against a completely different C library.
This call was added in version C<1.0.58>. In previous
versions of libguestfs there was no way to get the version
-number. From C code you can use ELF weak linking tricks to find out if
-this symbol exists (if it doesn't, then it's an earlier version).
+number. From C code you can use dynamic linker functions
+to find out if this symbol exists (if it doesn't, then
+it's an earlier version).
The call returns a structure with four elements. The first
three (C, C and C) are numbers and
@@ -803,9 +804,13 @@ used for distro-specific information.
To construct the original version string:
C<$major.$minor.$release$extra>
+See also: L.
+
I Don't use this call to test for availability
-of features. Distro backports makes this unreliable. Use
-C instead.");
+of features. In enterprise distributions we backport
+features from later versions into earlier versions,
+making this an unreliable way to test for features.
+Use C instead.");
("set_selinux", (RErr, [Bool "selinux"]), -1, [FishAlias "selinux"],
[InitNone, Always, TestOutputTrue (
@@ -2442,12 +2447,41 @@ the list of printable strings found.");
"print the printable strings in a file",
"\
This is like the C command, but allows you to
-specify the encoding.
+specify the encoding of strings that are looked for in
+the source file C.
+
+Allowed encodings are:
+
+=over 4
+
+=item s
+
+Single 7-bit-byte characters like ASCII and the ASCII-compatible
+parts of ISO-8859-X (this is what C uses).
+
+=item S
+
+Single 8-bit-byte characters.
+
+=item b
+
+16-bit big endian strings such as those encoded in
+UTF-16BE or UCS-2BE.
+
+=item l (lower case letter L)
+
+16-bit little endian such as UTF-16LE and UCS-2LE.
+This is useful for examining binaries in Windows guests.
-See the L manpage for the full list of encodings.
+=item B
-Commonly useful encodings are C (lower case L) which will
-show strings inside Windows/x86 files.
+32-bit big endian such as UCS-4BE.
+
+=item L
+
+32-bit little endian such as UCS-4LE.
+
+=back
The returned strings are transcoded to UTF-8.");
@@ -3111,7 +3145,7 @@ Unknown file type
=item '?'
-The L returned a C field with an
+The L call returned a C field with an
unexpected value
=back
@@ -3255,7 +3289,20 @@ for full details.");
("read_file", (RBufferOut "content", [Pathname "path"]), 150, [ProtocolLimitWarning],
[InitISOFS, Always, TestOutputBuffer (
- [["read_file"; "/known-4"]], "abc\ndef\nghi")],
+ [["read_file"; "/known-4"]], "abc\ndef\nghi");
+ (* Test various near large, large and too large files (RHBZ#589039). *)
+ InitBasicFS, Always, TestLastFail (
+ [["touch"; "/a"];
+ ["truncate_size"; "/a"; "4194303"]; (* GUESTFS_MESSAGE_MAX - 1 *)
+ ["read_file"; "/a"]]);
+ InitBasicFS, Always, TestLastFail (
+ [["touch"; "/a"];
+ ["truncate_size"; "/a"; "4194304"]; (* GUESTFS_MESSAGE_MAX *)
+ ["read_file"; "/a"]]);
+ InitBasicFS, Always, TestLastFail (
+ [["touch"; "/a"];
+ ["truncate_size"; "/a"; "41943040"]; (* GUESTFS_MESSAGE_MAX * 10 *)
+ ["read_file"; "/a"]])],
"read a file",
"\
This calls returns the contents of the file C as a
@@ -3740,8 +3787,8 @@ was built (see C in the source).");
)],
"echo arguments back to the client",
"\
-This command concatenate the list of C passed with single spaces between
-them and returns the resulting string.
+This command concatenates the list of C passed with single spaces
+between them and returns the resulting string.
You can use this command to test the connection through to the daemon.
@@ -3843,12 +3890,13 @@ See also C.");
[["vfs_type"; "/dev/sda1"]], "ext2")],
"get the Linux VFS type corresponding to a mounted device",
"\
-This command gets the block device type corresponding to
-a mounted device called C.
+This command gets the filesystem type corresponding to
+the filesystem on C.
-Usually the result is the name of the Linux VFS module that
-is used to mount this device (probably determined automatically
-if you used the C call).");
+For most filesystems, the result is the name of the Linux
+VFS module which would be used to mount this filesystem
+if you mounted it without specifying the filesystem type.
+For example a string such as C or C.");
("truncate", (RErr, [Pathname "path"]), 199, [],
[InitBasicFS, Always, TestOutputStruct (
@@ -3868,8 +3916,13 @@ file must exist already.");
"truncate a file to a particular size",
"\
This command truncates C to size C bytes. The file
-must exist already. If the file is smaller than C then
-the file is extended to the required size with null bytes.");
+must exist already.
+
+If the current file size is less than C then
+the file is extended to the required size with zero bytes.
+This creates a sparse file (ie. disk blocks are not allocated
+for the file until you write to it). To create a non-sparse
+file of zeroes, use C instead.");
("utimens", (RErr, [Pathname "path"; Int64 "atsecs"; Int64 "atnsecs"; Int64 "mtsecs"; Int64 "mtnsecs"]), 201, [],
[InitBasicFS, Always, TestOutputStruct (
@@ -3979,7 +4032,7 @@ C is the list of files from this directory.
On return you get a list of strings, with a one-to-one
correspondence to the C list. Each string is the
-value of the symbol link.
+value of the symbolic link.
If the C operation fails on any name, then
the corresponding result string is the empty string C<\"\">.