X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_actions.ml;h=243ea9b56b1926c1dd0dcb5d4cfbd66467460fad;hp=f76a404be5cbd12ebfa82a942aee7a6f2fdb07f1;hb=9ba779ea367b2ea7077da7bdd75e813cd06c7eea;hpb=b1f7b5f911dc65f39e0c3297a4dfa566c1d5b8ba diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index f76a404..243ea9b 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -743,6 +743,10 @@ Any Microsoft Windows operating system. FreeBSD. +=item \"netbsd\" + +NetBSD. + =item \"unknown\" The operating system type could not be determined. @@ -802,6 +806,10 @@ Gentoo. Linux Mint. +=item \"mageia\" + +Mageia. + =item \"mandriva\" Mandriva. @@ -810,6 +818,10 @@ Mandriva. MeeGo. +=item \"opensuse\" + +OpenSUSE. + =item \"pardus\" Pardus. @@ -995,7 +1007,7 @@ be mountable but require special options. Filesystems may not all belong to a single logical operating system (use C to look for OSes)."); - ("add_drive_opts", (RErr, [String "filename"], [Bool "readonly"; String "format"; String "iface"]), -1, [FishAlias "add"], + ("add_drive_opts", (RErr, [String "filename"], [Bool "readonly"; String "format"; String "iface"; String "name"]), -1, [FishAlias "add"], [], "add an image to examine or modify", "\ @@ -1038,6 +1050,11 @@ this security hole. This rarely-used option lets you emulate the behaviour of the deprecated C call (q.v.) +=item C + +The name the drive had in the original guest, e.g. /dev/sdb. This is used as a +hint to the guest inspection process if it is available. + =back"); ("inspect_get_windows_systemroot", (RString "systemroot", [Device "root"], []), -1, [], @@ -1073,7 +1090,14 @@ Please read L for more details."); This returns the internal QEMU command line. 'debug' commands are not part of the formal API and can be removed or changed at any time."); - ("add_domain", (RInt "nrdisks", [String "dom"], [String "libvirturi"; Bool "readonly"; String "iface"; Bool "live"; Bool "allowuuid"]), -1, [FishAlias "domain"], + ("debug_drives", (RStringList "cmdline", [], []), -1, [NotInDocs], + [], + "debug the drives (internal use only)", + "\ +This returns the internal list of drives. 'debug' commands are +not part of the formal API and can be removed or changed at any time."); + + ("add_domain", (RInt "nrdisks", [String "dom"], [String "libvirturi"; Bool "readonly"; String "iface"; Bool "live"; Bool "allowuuid"; String "readonlydisk"]), -1, [FishAlias "domain"], [], "add the disk(s) from a named libvirt domain", "\ @@ -1112,12 +1136,58 @@ I be passed instead of the domain name. The C string is treated as a UUID first and looked up, and if that lookup fails then we treat C as a name as usual. +The optional C parameter controls what we do for +disks which are marked Ereadonly/E in the libvirt XML. +Possible values are: + +=over 4 + +=item readonlydisk = \"error\" + +If C is false: + +The whole call is aborted with an error if any disk with +the Ereadonly/E flag is found. + +If C is true: + +Disks with the Ereadonly/E flag are added read-only. + +=item readonlydisk = \"read\" + +If C is false: + +Disks with the Ereadonly/E flag are added read-only. +Other disks are added read/write. + +If C is true: + +Disks with the Ereadonly/E flag are added read-only. + +=item readonlydisk = \"write\" (default) + +If C is false: + +Disks with the Ereadonly/E flag are added read/write. + +If C is true: + +Disks with the Ereadonly/E flag are added read-only. + +=item readonlydisk = \"ignore\" + +If C is true or false: + +Disks with the Ereadonly/E flag are skipped. + +=back + The other optional parameters are passed directly through to C."); (* This interface is not quite baked yet. -- RWMJ 2010-11-11 - ("add_libvirt_dom", (RInt "nrdisks", [Pointer ("virDomainPtr", "dom")], [Bool "readonly"; String "iface"; Bool "live"]), -1, [NotInFish], + ("add_libvirt_dom", (RInt "nrdisks", [Pointer ("virDomainPtr", "dom")], [Bool "readonly"; String "iface"; Bool "live"; String "readonlydisk"]), -1, [NotInFish], [], "add the disk(s) from a libvirt domain", "\ @@ -1147,6 +1217,10 @@ XML definition. The default (if the flag is omitted) is never to try. See L for more information. +The optional C parameter controls what we do for +disks which are marked Ereadonly/E in the libvirt XML. +See C for possible values. + The other optional parameters are passed directly through to C."); *) @@ -1165,7 +1239,8 @@ This returns the string C if we could not determine the package format I if the operating system does not have a real packaging system (eg. Windows). -Possible strings include: C, C, C, C, C. +Possible strings include: +C, C, C, C, C, C. Future versions of libguestfs may return other strings. Please read L for more details."); @@ -1186,7 +1261,7 @@ a real packaging system (eg. Windows). Possible strings include: C, C, C (for all Debian derivatives), -C, C, C, C. +C, C, C, C, C. Future versions of libguestfs may return other strings. Please read L for more details."); @@ -2182,7 +2257,7 @@ example C."); ("sfdisk", (RErr, [Device "device"; Int "cyls"; Int "heads"; Int "sectors"; - StringList "lines"], []), 43, [DangerWillRobinson; DeprecatedBy "part_add"], + StringList "lines"], []), 43, [DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -2283,7 +2358,7 @@ This unmounts all mounted filesystems. Some internal mounts are not unmounted by this call."); - ("lvm_remove_all", (RErr, [], []), 48, [DangerWillRobinson; Optional "lvm2"], + ("lvm_remove_all", (RErr, [], []), 48, [Optional "lvm2"], [], "remove all LVM LVs, VGs and PVs", "\ @@ -2510,7 +2585,10 @@ 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", [Device "device"], []), 55, [], - [], (* XXX test *) + [InitScratchFS, Always, TestOutputHashtable ( + [["tune2fs_l"; "/dev/sdb1"]], + ["Filesystem magic number", "0xEF53"; + "Filesystem OS type", "Linux"])], "get ext2/ext3/ext4 superblock details", "\ This returns the contents of the ext2, ext3 or ext4 filesystem @@ -3296,7 +3374,7 @@ volume to match the new size of the underlying device."); ("sfdisk_N", (RErr, [Device "device"; Int "partnum"; Int "cyls"; Int "heads"; Int "sectors"; - String "line"], []), 99, [DangerWillRobinson; DeprecatedBy "part_add"], + String "line"], []), 99, [DeprecatedBy "part_add"], [], "modify a single partition on a block device", "\ @@ -3542,7 +3620,7 @@ It is just a wrapper around the C L function with flags C. See that manual page for more details."); - ("scrub_device", (RErr, [Device "device"], []), 114, [DangerWillRobinson; Optional "scrub"], + ("scrub_device", (RErr, [Device "device"], []), 114, [Optional "scrub"], [InitNone, Always, TestRun ( (* use /dev/sdc because it's smaller *) [["scrub_device"; "/dev/sdc"]])], "scrub (securely wipe) a device", @@ -3921,7 +3999,7 @@ This function is primarily intended for use by programs. To get a simple list of names, use C. To get a printable directory for human consumption, use C."); - ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DangerWillRobinson; DeprecatedBy "part_add"], + ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -4984,7 +5062,7 @@ backwards from the end of the disk (C<-1> is the last sector). Creating a partition which covers the whole disk is not so easy. Use C to do that."); - ("part_disk", (RErr, [Device "device"; String "parttype"], []), 210, [DangerWillRobinson], + ("part_disk", (RErr, [Device "device"; String "parttype"], []), 210, [], [InitEmpty, Always, TestRun ( [["part_disk"; "/dev/sda"; "mbr"]]); InitEmpty, Always, TestRun ( @@ -5143,7 +5221,7 @@ See also C. =back"); - ("dd", (RErr, [Dev_or_Path "src"; Dev_or_Path "dest"], []), 217, [], + ("dd", (RErr, [Dev_or_Path "src"; Dev_or_Path "dest"], []), 217, [DeprecatedBy "copy_device_to_device"], [InitScratchFS, Always, TestOutputBuffer ( [["mkdir"; "/dd"]; ["write"; "/dd/src"; "hello, world"]; @@ -5158,7 +5236,8 @@ example to duplicate a filesystem. If the destination is a device, it must be as large or larger than the source file or device, otherwise the copy will fail. -This command cannot do partial copies (see C)."); +This command cannot do partial copies +(see C)."); ("filesize", (RInt64 "size", [Pathname "file"], []), 218, [], [InitScratchFS, Always, TestOutputInt ( @@ -5251,7 +5330,7 @@ calls to associate logical volumes and volume groups. See also C."); - ("copy_size", (RErr, [Dev_or_Path "src"; Dev_or_Path "dest"; Int64 "size"], []), 227, [Progress], + ("copy_size", (RErr, [Dev_or_Path "src"; Dev_or_Path "dest"; Int64 "size"], []), 227, [Progress; DeprecatedBy "copy_device_to_device"], [InitScratchFS, Always, TestOutputBuffer ( [["mkdir"; "/copy_size"]; ["write"; "/copy_size/src"; "hello, world"]; @@ -5265,7 +5344,7 @@ or file C to another destination device or file C. Note this will fail if the source is too short or if the destination is not large enough."); - ("zero_device", (RErr, [Device "device"], []), 228, [DangerWillRobinson; Progress], + ("zero_device", (RErr, [Device "device"], []), 228, [Progress], [InitBasicFSonLVM, Always, TestRun ( [["zero_device"; "/dev/VG/LV"]])], "write zeroes to an entire device", @@ -5684,7 +5763,7 @@ C parameter must be the name of the LUKS mapping device (ie. C) and I the name of the underlying block device."); - ("luks_format", (RErr, [Device "device"; Key "key"; Int "keyslot"], []), 260, [Optional "luks"; DangerWillRobinson], + ("luks_format", (RErr, [Device "device"; Key "key"; Int "keyslot"], []), 260, [Optional "luks"], [], "format a block device as a LUKS encrypted device", "\ @@ -5693,7 +5772,7 @@ the device as a LUKS encrypted device. C is the initial key, which is added to key slot C. (LUKS supports 8 key slots, numbered 0-7)."); - ("luks_format_cipher", (RErr, [Device "device"; Key "key"; Int "keyslot"; String "cipher"], []), 261, [Optional "luks"; DangerWillRobinson], + ("luks_format_cipher", (RErr, [Device "device"; Key "key"; Int "keyslot"; String "cipher"], []), 261, [Optional "luks"], [], "format a block device as a LUKS encrypted device", "\ @@ -5825,7 +5904,9 @@ removes the partition number, returning the device name (eg. \"/dev/sdb\"). The named partition must exist, for example as a string returned -from C."); +from C. + +See also C."); ("upload_offset", (RErr, [FileIn "filename"; Dev_or_Path "remotefilename"; Int64 "offset"], []), 273, [Progress], (let md5 = Digest.to_hex (Digest.file "COPYING.LIB") in @@ -6186,6 +6267,74 @@ file C. The C and optional C parameters have the same meaning as in C."); + ("part_to_partnum", (RInt "partnum", [Device "partition"], []), 293, [], + [InitPartition, Always, TestOutputInt ( + [["part_to_partnum"; "/dev/sda1"]], 1); + InitEmpty, Always, TestLastFail ( + [["part_to_partnum"; "/dev/sda"]])], + "convert partition name to partition number", + "\ +This function takes a partition name (eg. \"/dev/sdb1\") and +returns the partition number (eg. C<1>). + +The named partition must exist, for example as a string returned +from C. + +See also C."); + + ("copy_device_to_device", (RErr, [Device "src"; Device "dest"], [Int64 "srcoffset"; Int64 "destoffset"; Int64 "size"]), 294, [Progress], + [], + "copy from source device to destination device", + "\ +The four calls C, +C, +C, and +C +let you copy from a source (device|file) to a destination +(device|file). + +Partial copies can be made since you can specify optionally +the source offset, destination offset and size to copy. These +values are all specified in bytes. If not given, the offsets +both default to zero, and the size defaults to copying as much +as possible until we hit the end of the source. + +The source and destination may be the same object. However +overlapping regions may not be copied correctly. + +If the destination is a file, it is created if required. If +the destination file is not large enough, it is extended."); + + ("copy_device_to_file", (RErr, [Device "src"; Pathname "dest"], [Int64 "srcoffset"; Int64 "destoffset"; Int64 "size"]), 295, [Progress], + [], + "copy from source device to destination file", + "\ +See C for a general overview +of this call."); + + ("copy_file_to_device", (RErr, [Pathname "src"; Device "dest"], [Int64 "srcoffset"; Int64 "destoffset"; Int64 "size"]), 296, [Progress], + [], + "copy from source file to destination device", + "\ +See C for a general overview +of this call."); + + ("copy_file_to_file", (RErr, [Pathname "src"; Pathname "dest"], [Int64 "srcoffset"; Int64 "destoffset"; Int64 "size"]), 297, [Progress], + [InitScratchFS, Always, TestOutputBuffer ( + [["mkdir"; "/copyff"]; + ["write"; "/copyff/src"; "hello, world"]; + ["copy_file_to_file"; "/copyff/src"; "/copyff/dest"; ""; ""; ""]; + ["read_file"; "/copyff/dest"]], "hello, world")], + "copy from source file to destination file", + "\ +See C for a general overview +of this call. + +This is B the function you want for copying files. This +is for copying blocks within existing files. See C, +C and C for general file copying and +moving functions."); + ] let all_functions = non_daemon_functions @ daemon_functions