X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=8a6177cd804f6afdd1d81089f60ebaab8cea84b8;hb=858661ca961a751b0ba3bc64cdcbe7aca8c877a4;hp=fc3dc34c53a47734c9b27d9aa6d23f55c266ab7d;hpb=7c434ceb4bf30703f03befc1b47b95e56ee8bd33;p=libguestfs.git
diff --git a/src/generator.ml b/src/generator.ml
index fc3dc34..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 (
@@ -953,8 +958,15 @@ exist.
The mounted filesystem is writable, if we have sufficient permissions
on the underlying device.
-The filesystem options C and C are set with this
-call, in order to improve reliability.");
+B
+When you use this call, the filesystem options C and C
+are set implicitly. This was originally done because we thought it
+would improve reliability, but it turns out that I<-o sync> has a
+very large negative performance impact and negligible effect on
+reliability. Therefore we recommend that you avoid using
+C in any code that needs performance, and instead
+use C (use an empty string for the first
+parameter if you don't want any options).");
("sync", (RErr, []), 2, [],
[ InitEmpty, Always, TestRun [["sync"]]],
@@ -2079,7 +2091,11 @@ mounts the filesystem with the read-only (I<-o ro>) flag.");
"\
This is the same as the C command, but it
allows you to set the mount options as for the
-L I<-o> flag.");
+L I<-o> flag.
+
+If the C parameter is an empty string, then
+no options are passed (all options default to whatever
+the filesystem uses).");
("mount_vfs", (RErr, [String "options"; String "vfstype"; Device "device"; String "mountpoint"]), 75, [],
[],
@@ -2431,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)
-See the L manpage for the full list of encodings.
+16-bit little endian such as UTF-16LE and UCS-2LE.
+This is useful for examining binaries in Windows guests.
-Commonly useful encodings are C (lower case L) which will
-show strings inside Windows/x86 files.
+=item B
+
+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.");
@@ -3100,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
@@ -3244,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
@@ -3729,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.
@@ -3832,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 (
@@ -3857,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 (
@@ -3968,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<\"\">.
@@ -6552,6 +6616,8 @@ int main (int argc, char *argv[])
iteri (
fun i test_name ->
pr " test_num++;\n";
+ pr " if (guestfs_get_verbose (g))\n";
+ pr " printf (\"-------------------------------------------------------------------------------\\n\");\n";
pr " printf (\"%%3d/%%3d %s\\n\", test_num, nr_tests);\n" test_name;
pr " if (%s () == -1) {\n" test_name;
pr " printf (\"%s FAILED\\n\");\n" test_name;