X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fgenerator.ml;h=0b3f263ab5024e995c4b4d92331a0e9803afee79;hp=5c2ffebe12d20454abf63f3f329c56137b468113;hb=21aac863e29eca5552c4ae1645306e966f11c1d8;hpb=574df371a0421b4b83386f43e5095ccea5069e5b diff --git a/src/generator.ml b/src/generator.ml index 5c2ffeb..0b3f263 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -1812,9 +1812,9 @@ See also C, C, C."); [["is_file"; "/known-1"]]); InitISOFS, Always, TestOutputFalse ( [["is_file"; "/directory"]])], - "test if file exists", + "test if a regular file", "\ -This returns C if and only if there is a file +This returns C if and only if there is a regular file with the given C name. Note that it returns false for other objects like directories. @@ -1825,7 +1825,7 @@ See also C."); [["is_dir"; "/known-3"]]); InitISOFS, Always, TestOutputTrue ( [["is_dir"; "/directory"]])], - "test if file exists", + "test if a directory", "\ This returns C if and only if there is a directory with the given C name. Note that it returns false for @@ -5356,6 +5356,68 @@ filesystem can be found. To find the label of a filesystem, use C."); + ("is_chardev", (RBool "flag", [Pathname "path"]), 267, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_chardev"; "/directory"]]); + InitBasicFS, Always, TestOutputTrue ( + [["mknod_c"; "0o777"; "99"; "66"; "/test"]; + ["is_chardev"; "/test"]])], + "test if character device", + "\ +This returns C if and only if there is a character device +with the given C name. + +See also C."); + + ("is_blockdev", (RBool "flag", [Pathname "path"]), 268, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_blockdev"; "/directory"]]); + InitBasicFS, Always, TestOutputTrue ( + [["mknod_b"; "0o777"; "99"; "66"; "/test"]; + ["is_blockdev"; "/test"]])], + "test if block device", + "\ +This returns C if and only if there is a block device +with the given C name. + +See also C."); + + ("is_fifo", (RBool "flag", [Pathname "path"]), 269, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_fifo"; "/directory"]]); + InitBasicFS, Always, TestOutputTrue ( + [["mkfifo"; "0o777"; "/test"]; + ["is_fifo"; "/test"]])], + "test if FIFO (named pipe)", + "\ +This returns C if and only if there is a FIFO (named pipe) +with the given C name. + +See also C."); + + ("is_symlink", (RBool "flag", [Pathname "path"]), 270, [], + [InitISOFS, Always, TestOutputFalse ( + [["is_symlink"; "/directory"]]); + InitISOFS, Always, TestOutputTrue ( + [["is_symlink"; "/abssymlink"]])], + "test if symbolic link", + "\ +This returns C if and only if there is a symbolic link +with the given C name. + +See also C."); + + ("is_socket", (RBool "flag", [Pathname "path"]), 271, [], + (* XXX Need a positive test for sockets. *) + [InitISOFS, Always, TestOutputFalse ( + [["is_socket"; "/directory"]])], + "test if socket", + "\ +This returns C if and only if there is a Unix domain socket +with the given C name. + +See also C."); + ] let all_functions = non_daemon_functions @ daemon_functions @@ -5677,6 +5739,29 @@ let prepopts = [ creating a 100MB disk with the VG and LV called /dev/VG/LV, with an ext2 filesystem."); + ("bootroot", + "create a boot and root filesystem", + [ "bootfs", "ext2", "the type of filesystem to use for boot"; + "rootfs", "ext2", "the type of filesystem to use for root"; + "size", "100M", "the size of the disk image"; + "bootsize", "32M", "the size of the boot filesystem"; + "partition", "mbr", "partition table type" ], + " Create a disk with two partitions, for boot and root filesystem. + Format the two filesystems independently. There are several optional + parameters which control the exact layout and filesystem types."); + + ("bootrootlv", + "create a boot and root filesystem using LVM", + [ "name", "/dev/VG/LV", "the name of the VG and LV for root"; + "bootfs", "ext2", "the type of filesystem to use for boot"; + "rootfs", "ext2", "the type of filesystem to use for root"; + "size", "100M", "the size of the disk image"; + "bootsize", "32M", "the size of the boot filesystem"; + "partition", "mbr", "partition table type" ], + " This is the same as 'bootroot' but the root filesystem (only) is + placed on a logical volume, named by default '/dev/VG/LV'. There are + several optional parameters which control the exact layout."); + ] (* Used to memoize the result of pod2text. *) @@ -12594,12 +12679,12 @@ print_strings (char *const *argv) | FileOut n | Key n -> pr " printf (\"%%s\\n\", %s);\n" n | BufferIn n -> - pr " {\n"; - pr " size_t i;\n"; + pr " {\n"; + pr " size_t i;\n"; pr " for (i = 0; i < %s_size; ++i)\n" n; pr " printf (\"<%%02x>\", %s[i]);\n" n; pr " printf (\"\\n\");\n"; - pr " }\n"; + pr " }\n"; | OptString n -> pr " printf (\"%%s\\n\", %s ? %s : \"null\");\n" n n | StringList n | DeviceList n -> pr " print_strings (%s);\n" n | Bool n -> pr " printf (\"%%s\\n\", %s ? \"true\" : \"false\");\n" n