X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=src%2Fgenerator.ml;h=39faffec705ef63ec0cfaeaa423c049ae7a77a70;hp=3a35fa2c5be3f30e0add582445fa4c2128fcacee;hb=d082a76d679b019784bc0b131028ee74e381f4a2;hpb=7c3a90f94cd6b8fec9cdd1c052b91a14c0ee0e0e diff --git a/src/generator.ml b/src/generator.ml index 3a35fa2..39faffe 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -90,7 +90,7 @@ and ret = (* "RStruct" is a function which returns a single named structure * or an error indication (in C, a struct, and in other languages * with varying representations, but usually very efficient). See - * after the function list below for the structures. + * after the function list below for the structures. *) | RStruct of string * string (* name of retval, name of struct *) @@ -301,6 +301,12 @@ and test_init = (* Block devices are empty and no filesystems are mounted. *) | InitEmpty + (* /dev/sda contains a single partition /dev/sda1, with random + * content. /dev/sdb and /dev/sdc may have random content. + * No LVM. + *) + | InitPartition + (* /dev/sda contains a single partition /dev/sda1, which is formatted * as ext2, empty [except for lost+found] and mounted on /. * /dev/sdb and /dev/sdc may have random content. @@ -375,9 +381,9 @@ You probably don't want to call this function."); List.map ( fun (name, ret) -> [(name, (ret, [String "val"]), -1, [NotInFish; NotInDocs], - [], - "internal test function - do not use", - "\ + [], + "internal test function - do not use", + "\ This is an internal test function which is used to test whether the automatically generated bindings can handle every possible return type correctly. @@ -386,9 +392,9 @@ It converts string C to the return type. You probably don't want to call this function."); (name ^ "err", (ret, []), -1, [NotInFish; NotInDocs], - [], - "internal test function - do not use", - "\ + [], + "internal test function - do not use", + "\ This is an internal test function which is used to test whether the automatically generated bindings can handle every possible return type correctly. @@ -448,6 +454,8 @@ image). This is equivalent to the qemu parameter C<-drive file=filename,cache=off,if=...>. +C is omitted in cases where it is not supported by +the underlying filesystem. Note that this call checks for the existence of C. This stops you from specifying other types of drive which are supported @@ -755,6 +763,31 @@ C<$major.$minor.$release$extra> I Don't use this call to test for availability of features. Distro backports makes this unreliable."); + ("set_selinux", (RErr, [Bool "selinux"]), -1, [FishAlias "selinux"], + [InitNone, Always, TestOutputTrue ( + [["set_selinux"; "true"]; + ["get_selinux"]])], + "set SELinux enabled or disabled at appliance boot", + "\ +This sets the selinux flag that is passed to the appliance +at boot time. The default is C (disabled). + +Note that if SELinux is enabled, it is always in +Permissive mode (C). + +For more information on the architecture of libguestfs, +see L."); + + ("get_selinux", (RBool "selinux", []), -1, [], + [], + "get SELinux enabled flag", + "\ +This returns the current setting of the selinux flag which +is passed to the appliance at boot time. See C. + +For more information on the architecture of libguestfs, +see L."); + ] (* daemon_functions are any functions which cause some action @@ -822,8 +855,8 @@ or C functions which have a more complex interface."); ("ll", (RString "listing", [String "directory"]), 5, [], [], (* XXX Tricky to test because it depends on the exact format - * of the 'ls -l' command, which changes between F10 and F11. - *) + * of the 'ls -l' command, which changes between F10 and F11. + *) "list the files in a directory (long format)", "\ List the files in C (relative to the root directory, @@ -1320,8 +1353,8 @@ or LVM logical volume). The filesystem type is C, for example C."); ("sfdisk", (RErr, [String "device"; - Int "cyls"; Int "heads"; Int "sectors"; - StringList "lines"]), 43, [DangerWillRobinson], + Int "cyls"; Int "heads"; Int "sectors"; + StringList "lines"]), 43, [DangerWillRobinson], [], "create partitions on a block device", "\ @@ -1619,8 +1652,7 @@ This is the same as the C system call."); ("statvfs", (RStruct ("statbuf", "statvfs"), [String "path"]), 54, [], [InitSquashFS, Always, TestOutputStruct ( - [["statvfs"; "/"]], [CompareWithInt ("namemax", 256); - CompareWithInt ("bsize", 131072)])], + [["statvfs"; "/"]], [CompareWithInt ("namemax", 256)])], "get file system statistics", "\ Returns file system statistics for any mounted file system. @@ -1756,7 +1788,8 @@ This uses the L command."); [InitBasicFS, Always, TestOutput ( (* Pick a file from cwd which isn't likely to change. *) [["upload"; "../COPYING.LIB"; "/COPYING.LIB"]; - ["checksum"; "md5"; "/COPYING.LIB"]], "e3eda01d9815f8d24aae2dbd89b68b06")], + ["checksum"; "md5"; "/COPYING.LIB"]], + Digest.to_hex (Digest.file "COPYING.LIB"))], "upload a file from the local machine", "\ Upload local file C to C on the @@ -1772,7 +1805,8 @@ See also C."); [["upload"; "../COPYING.LIB"; "/COPYING.LIB"]; ["download"; "/COPYING.LIB"; "testdownload.tmp"]; ["upload"; "testdownload.tmp"; "/upload"]; - ["checksum"; "md5"; "/upload"]], "e3eda01d9815f8d24aae2dbd89b68b06")], + ["checksum"; "md5"; "/upload"]], + Digest.to_hex (Digest.file "COPYING.LIB"))], "download a file to the local machine", "\ Download file C and save it as C @@ -2307,8 +2341,8 @@ This resizes (expands or shrinks) an existing LVM physical volume to match the new size of the underlying device."); ("sfdisk_N", (RErr, [String "device"; Int "partnum"; - Int "cyls"; Int "heads"; Int "sectors"; - String "line"]), 99, [DangerWillRobinson], + Int "cyls"; Int "heads"; Int "sectors"; + String "line"]), 99, [DangerWillRobinson], [], "modify a single partition on a block device", "\ @@ -2682,8 +2716,8 @@ If the parameter C is zero, this returns an empty list."); ("df", (RString "output", []), 125, [], [], (* XXX Tricky to test because it depends on the exact format - * of the 'df' command and other imponderables. - *) + * of the 'df' command and other imponderables. + *) "report file system disk space usage", "\ This command runs the C command to report disk space used. @@ -2694,8 +2728,8 @@ Use C from programs."); ("df_h", (RString "output", []), 126, [], [], (* XXX Tricky to test because it depends on the exact format - * of the 'df' command and other imponderables. - *) + * of the 'df' command and other imponderables. + *) "report file system disk space usage (human readable)", "\ This command runs the C command to report disk space used @@ -2757,7 +2791,11 @@ Create a swap partition on C."); ["mkswap_L"; "hello"; "/dev/sda1"]])], "create a swap partition with a label", "\ -Create a swap partition on C with label C