X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fgenerator.ml;h=be63404f8842c995f7fb902bbf1e17c3167501d1;hb=e8795f3e9cc7e60a5ad709c0e3b53f60e37fd6c0;hp=324b131f2436b559a5059dd85c1b89c0a4ac2728;hpb=d58084f387f8e141224d06169959eb0854dd9bc2;p=libguestfs.git diff --git a/src/generator.ml b/src/generator.ml index 324b131..be63404 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 *) @@ -134,6 +134,7 @@ and args = argt list (* Function parameters, guestfs handle is implicit. *) *) and argt = | String of string (* const char *name, cannot be NULL *) + | Device of string (* /dev device name, cannot be NULL *) | OptString of string (* const char *name, may be NULL *) | StringList of string(* list of strings (each string cannot be NULL) *) | Bool of string (* boolean *) @@ -301,6 +302,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 +382,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 +393,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 +455,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 +764,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 +856,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 +1354,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 +1653,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. @@ -1629,7 +1662,7 @@ C should be a file or directory in the mounted file system This is the same as the C system call."); - ("tune2fs_l", (RHashtable "superblock", [String "device"]), 55, [], + ("tune2fs_l", (RHashtable "superblock", [Device "device"]), 55, [], [], (* XXX test *) "get ext2/ext3/ext4 superblock details", "\ @@ -1756,7 +1789,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 +1806,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 +2342,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 +2717,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 +2729,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 +2792,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