X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_actions.ml;h=634ceeb4a189412cb986110a3f3c00f62f5727dc;hp=58c5f84cd9a9ab4a29b3b742e2f30b43ce327607;hb=5f10c3350338bbca735a74db26f98da968957bd9;hpb=2b0ca7e7b8d369a42a51b1feec72ae8f17257c78 diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 58c5f84..634ceeb 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -113,7 +113,7 @@ using L. You should call this after configuring the handle (eg. adding drives) but before performing any actions."); - ("wait_ready", (RErr, [], []), -1, [NotInFish], + ("wait_ready", (RErr, [], []), -1, [NotInFish; DeprecatedBy "launch"], [], "wait until the qemu subprocess launches (no op)", "\ @@ -155,7 +155,7 @@ and specifying the format."); "\ This function adds a virtual CD-ROM disk image to the guest. -This is equivalent to the qemu parameter C<-cdrom filename>. +This is equivalent to the qemu parameter I<-cdrom filename>. Notes: @@ -190,7 +190,7 @@ automatically."); "add qemu parameters", "\ This can be used to add arbitrary qemu command line parameters -of the form C<-param value>. Actually it's not quite arbitrary - we +of the form I<-param value>. Actually it's not quite arbitrary - we prevent you from setting some parameters which would interfere with parameters that we use. @@ -1096,7 +1096,7 @@ 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"]), -1, [FishAlias "domain"], + ("add_domain", (RInt "nrdisks", [String "dom"], [String "libvirturi"; Bool "readonly"; String "iface"; Bool "live"; Bool "allowuuid"]), -1, [FishAlias "domain"], [], "add the disk(s) from a named libvirt domain", "\ @@ -1130,6 +1130,11 @@ XML definition. The default (if the flag is omitted) is never to try. See L for more information. +If the C flag is true (default is false) then a UUID +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 other optional parameters are passed directly through to C."); @@ -1524,7 +1529,7 @@ C."); *) let daemon_functions = [ - ("mount", (RErr, [Device "device"; String "mountpoint"], []), 1, [], + ("mount", (RErr, [Device "device"; String "mountpoint"], []), 1, [DeprecatedBy "mount_options"], [InitEmpty, Always, TestOutput ( [["part_disk"; "/dev/sda"; "mbr"]; ["mkfs"; "ext2"; "/dev/sda1"]; @@ -2132,7 +2137,7 @@ example C."); ("sfdisk", (RErr, [Device "device"; Int "cyls"; Int "heads"; Int "sectors"; - StringList "lines"], []), 43, [DangerWillRobinson], + StringList "lines"], []), 43, [DangerWillRobinson; DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -2261,17 +2266,14 @@ of compressed file. The exact command which runs is C. Note in particular that the filename is not prepended to the output -(the C<-b> option). +(the I<-b> option). -This command can also be used on C devices -(and partitions, LV names). You can for example use this -to determine if a device contains a filesystem, although -it's usually better to use C. +The output depends on the output of the underlying L +command and it can change in future in ways beyond our control. +In other words, the output is not guaranteed by the ABI. -If the C does not begin with C then -this command only works for the content of regular files. -For other file types (directory, symbolic link etc) it -will just return the string C etc."); +See also: L, C, C, +C, C (etc), C."); ("command", (RString "output", [StringList "arguments"], []), 50, [ProtocolLimitWarning], [InitScratchFS, Always, TestOutput ( @@ -2965,10 +2967,9 @@ Checking or repairing NTFS volumes is not supported This command is entirely equivalent to running C."); ("zero", (RErr, [Device "device"], []), 85, [Progress], - [InitBasicFS, Always, TestOutput ( + [InitBasicFS, Always, TestRun ( [["umount"; "/dev/sda1"]; - ["zero"; "/dev/sda1"]; - ["file"; "/dev/sda1"]], "data")], + ["zero"; "/dev/sda1"]])], "write zeroes to the device", "\ This command writes zeroes over the first few blocks of C. @@ -2977,7 +2978,8 @@ How many blocks are zeroed isn't specified (but it's I enough to securely wipe the device). It should be sufficient to remove any partition tables, filesystem superblocks and so on. -See also: C, C."); +See also: C, C, +C"); ("grub_install", (RErr, [Pathname "root"; Device "device"], []), 86, [], (* See: @@ -3223,7 +3225,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], + String "line"], []), 99, [DangerWillRobinson; DeprecatedBy "part_add"], [], "modify a single partition on a block device", "\ @@ -3235,7 +3237,7 @@ pass C<0> for the cyls/heads/sectors parameters. See also: C"); - ("sfdisk_l", (RString "partitions", [Device "device"], []), 100, [], + ("sfdisk_l", (RString "partitions", [Device "device"], []), 100, [DeprecatedBy "part_list"], [], "display the partition table", "\ @@ -3380,8 +3382,8 @@ See also C."); "check an ext2/ext3 filesystem", "\ This runs C, ie. runs the ext2/ext3 -filesystem checker on C, noninteractively (C<-p>), -even if the filesystem appears to be clean (C<-f>). +filesystem checker on C, noninteractively (I<-p>), +even if the filesystem appears to be clean (I<-f>). This command is only needed because of C (q.v.). Normally you should use C."); @@ -3854,7 +3856,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], + ("sfdiskM", (RErr, [Device "device"; StringList "lines"], []), 139, [DangerWillRobinson; DeprecatedBy "part_add"], [], "create partitions on a block device", "\ @@ -4157,7 +4159,7 @@ This command creates a hard link using the C command."); "create a hard link", "\ This command creates a hard link using the C command. -The C<-f> option removes the link (C) if it exists already."); +The I<-f> option removes the link (C) if it exists already."); ("ln_s", (RErr, [String "target"; Pathname "linkname"], []), 166, [], [InitScratchFS, Always, TestOutputStruct ( @@ -4178,7 +4180,7 @@ This command creates a symbolic link using the C command."); "create a symbolic link", "\ This command creates a symbolic link using the C command, -The C<-f> option removes the link (C) if it exists already."); +The I<-f> option removes the link (C) if it exists already."); ("readlink", (RString "link", [Pathname "path"], []), 168, [], [] (* XXX tested above *), @@ -5861,7 +5863,7 @@ For UFS block sizes, please see L. =item C -This passes the C<-O> parameter to the external mkfs program. +This passes the I<-O> parameter to the external mkfs program. For certain filesystem types, this allows extra filesystem features to be selected. See L and L @@ -5917,7 +5919,7 @@ See also: C, C, L."); "resize an ext2, ext3 or ext4 filesystem to the minimum size", "\ This command is the same as C, but the filesystem -is resized to its minimum size. This works like the C<-M> option +is resized to its minimum size. This works like the I<-M> option to the C command. To get the resulting size of the filesystem you should call @@ -5935,6 +5937,36 @@ Instead, use the autosync flag (C) to control whether or not this operation is performed when the handle is closed."); + ("is_zero", (RBool "zeroflag", [Pathname "path"], []), 283, [], + [InitISOFS, Always, TestOutputTrue ( + [["is_zero"; "/100kallzeroes"]]); + InitISOFS, Always, TestOutputFalse ( + [["is_zero"; "/100kallspaces"]])], + "test if a file contains all zero bytes", + "\ +This returns true iff the file exists and the file is empty or +it contains all zero bytes."); + + ("is_zero_device", (RBool "zeroflag", [Device "device"], []), 284, [], + [InitBasicFS, Always, TestOutputTrue ( + [["umount"; "/dev/sda1"]; + ["zero_device"; "/dev/sda1"]; + ["is_zero_device"; "/dev/sda1"]]); + InitBasicFS, Always, TestOutputFalse ( + [["is_zero_device"; "/dev/sda1"]])], + "test if a device contains all zero bytes", + "\ +This returns true iff the device exists and contains all zero bytes. + +Note that for large devices this can take a long time to run."); + + ("list_9p", (RStringList "mounttags", [], []), 285, [], + [], + "list 9p filesystems", + "\ +List all 9p filesystems attached to the guest. A list of +mount tags is returned."); + ] let all_functions = non_daemon_functions @ daemon_functions