X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_actions.ml;h=a324d99726e253d99f137b4ffd0be3b9192c1879;hp=50c33a8fcc193ac2ae71a41a4e6a936923aa176a;hb=371eabfae3790588ed97c0017d2882799c7ea871;hpb=4ffa2d6798f7a2bf0baec8e1084659cf6358bc31;ds=sidebyside diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 50c33a8..a324d99 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -1,5 +1,5 @@ (* libguestfs - * Copyright (C) 2009-2010 Red Hat Inc. + * Copyright (C) 2009-2011 Red Hat Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -103,7 +103,7 @@ You probably don't want to call this function.")] *) let non_daemon_functions = test_functions @ [ - ("launch", (RErr, [], []), -1, [FishAlias "run"], + ("launch", (RErr, [], []), -1, [FishAlias "run"; Progress], [], "launch the qemu subprocess", "\ @@ -282,8 +282,8 @@ If C then no options are added."); "set autosync mode", "\ If C is true, this enables autosync. Libguestfs will make a -best effort attempt to run C followed by -C when the handle is closed +best effort attempt to make filesystems consistent and synchronized +when the handle is closed (also if the program exits without closing handles). This is enabled by default (since libguestfs 1.5.24, previously it was @@ -300,10 +300,14 @@ Get the autosync flag."); [], "set verbose mode", "\ -If C is true, this turns on verbose messages (to C). +If C is true, this turns on verbose messages. Verbose messages are disabled unless the environment variable -C is defined and set to C<1>."); +C is defined and set to C<1>. + +Verbose messages are normally sent to C, unless you +register a callback to send them somewhere else (see +C)."); ("get_verbose", (RBool "verbose", [], []), -1, [], [], @@ -469,19 +473,19 @@ see L."); ["get_trace"]])], "enable or disable command traces", "\ -If the command trace flag is set to 1, then commands are -printed on stderr before they are executed in a format -which is very similar to the one used by guestfish. In -other words, you can run a program with this enabled, and -you will get out a script which you can feed to guestfish -to perform the same set of actions. +If the command trace flag is set to 1, then libguestfs +calls, parameters and return values are traced. If you want to trace C API calls into libguestfs (and other libraries) then possibly a better way is to use the external ltrace(1) command. Command traces are disabled unless the environment variable -C is defined and set to C<1>."); +C is defined and set to C<1>. + +Trace messages are normally sent to C, unless you +register a callback to send them somewhere else (see +C)."); ("get_trace", (RBool "trace", [], []), -1, [], [], @@ -823,6 +827,10 @@ Some Red Hat-derived distro. Red Hat Enterprise Linux and some derivatives. +=item \"slackware\" + +Slackware. + =item \"ubuntu\" Ubuntu. @@ -1074,7 +1082,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"]), -1, [FishAlias "domain"], + ("add_domain", (RInt "nrdisks", [String "dom"], [String "libvirturi"; Bool "readonly"; String "iface"; Bool "live"]), -1, [FishAlias "domain"], [], "add the disk(s) from a named libvirt domain", "\ @@ -1101,12 +1109,19 @@ we connect to the default libvirt URI (or one set through an environment variable, see the libvirt documentation for full details). +The optional C flag controls whether this call will try +to connect to a running virtual machine C process if +it sees a suitable EchannelE element in the libvirt +XML definition. The default (if the flag is omitted) is never +to try. See L for more +information. + 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"]), -1, [NotInFish], + ("add_libvirt_dom", (RInt "nrdisks", [Pointer ("virDomainPtr", "dom")], [Bool "readonly"; String "iface"; Bool "live"]), -1, [NotInFish], [], "add the disk(s) from a libvirt domain", "\ @@ -1129,7 +1144,14 @@ from a remote libvirt connection (see L) will fail unless those disks are accessible via the same device path locally too. -The optional parameters are passed directly through to +The optional C flag controls whether this call will try +to connect to a running virtual machine C process if +it sees a suitable EchannelE element in the libvirt +XML definition. The default (if the flag is omitted) is never +to try. See L for more +information. + +The other optional parameters are passed directly through to C."); *) @@ -1293,6 +1315,142 @@ string C is returned. Please read L for more details."); + ("inspect_get_format", (RString "format", [Device "root"], []), -1, [], + [], + "get format of inspected operating system", + "\ +This function should only be called with a root device string +as returned by C. + +This returns the format of the inspected operating system. You +can use it to detect install images, live CDs and similar. + +Currently defined formats are: + +=over 4 + +=item \"installed\" + +This is an installed operating system. + +=item \"installer\" + +The disk image being inspected is not an installed operating system, +but a I install disk, live CD, or similar. + +=item \"unknown\" + +The format of this disk image is not known. + +=back + +Future versions of libguestfs may return other strings here. +The caller should be prepared to handle any string. + +Please read L for more details."); + + ("inspect_is_live", (RBool "live", [Device "root"], []), -1, [], + [], + "get live flag for install disk", + "\ +This function should only be called with a root device string +as returned by C. + +If C returns C (this +is an install disk), then this returns true if a live image +was detected on the disk. + +Please read L for more details."); + + ("inspect_is_netinst", (RBool "netinst", [Device "root"], []), -1, [], + [], + "get netinst (network installer) flag for install disk", + "\ +This function should only be called with a root device string +as returned by C. + +If C returns C (this +is an install disk), then this returns true if the disk is +a network installer, ie. not a self-contained install CD but +one which is likely to require network access to complete +the install. + +Please read L for more details."); + + ("inspect_is_multipart", (RBool "multipart", [Device "root"], []), -1, [], + [], + "get multipart flag for install disk", + "\ +This function should only be called with a root device string +as returned by C. + +If C returns C (this +is an install disk), then this returns true if the disk is +part of a set. + +Please read L for more details."); + + ("set_attach_method", (RErr, [String "attachmethod"], []), -1, [FishAlias "attach-method"], + [], + "set the attach method", + "\ +Set the method that libguestfs uses to connect to the back end +guestfsd daemon. Possible methods are: + +=over 4 + +=item C + +Launch an appliance and connect to it. This is the ordinary method +and the default. + +=item C> + +Connect to the Unix domain socket I. + +This method lets you connect to an existing daemon or (using +virtio-serial) to a live guest. For more information, see +L. + +=back"); + + ("get_attach_method", (RString "attachmethod", [], []), -1, [], + [InitNone, Always, TestOutput ( + [["get_attach_method"]], "appliance")], + "get the attach method", + "\ +Return the current attach method. See C."); + + ("inspect_get_product_variant", (RString "variant", [Device "root"], []), -1, [], + [], + "get product variant of inspected operating system", + "\ +This function should only be called with a root device string +as returned by C. + +This returns the product variant of the inspected operating +system. + +For Windows guests, this returns the contents of the Registry key +C +C which is usually a string such as +C or C (other values are possible). This +can be used to distinguish consumer and enterprise versions +of Windows that have the same version number (for example, +Windows 7 and Windows 2008 Server are both version 6.1, +but the former is C and the latter is C). + +For enterprise Linux guests, in future we intend this to return +the product variant such as C, C and so on. But +this is not implemented at present. + +If the product variant could not be determined, then the +string C is returned. + +Please read L for more details. +See also C, +C."); + ] (* daemon_functions are any functions which cause some action @@ -3767,7 +3925,7 @@ pathnames, as in the example code above. For more details see L Autosync [see C, this is set by default on -handles] means that C is called when the handle +handles] can cause C to be called when the handle is closed which can also trigger these issues."); ("rmmountpoint", (RErr, [String "exemptpath"], []), 149, [], @@ -5608,10 +5766,10 @@ not refer to a logical volume. See also C."); - ("mkfs_opts", (RErr, [String "fstype"; Device "device"], [Int "blocksize"]), 278, [], + ("mkfs_opts", (RErr, [String "fstype"; Device "device"], [Int "blocksize"; String "features"]), 278, [], [InitEmpty, Always, TestOutput ( [["part_disk"; "/dev/sda"; "mbr"]; - ["mkfs_opts"; "ext2"; "/dev/sda1"; "4096"]; + ["mkfs_opts"; "ext2"; "/dev/sda1"; "4096"; ""]; ["mount_options"; ""; "/dev/sda1"; "/"]; ["write"; "/new"; "new file contents"]; ["cat"; "/new"]], "new file contents")], @@ -5633,6 +5791,19 @@ for Linux ext2/3 filesystems. For VFAT and NTFS the C parameter is treated as the requested cluster size. +For UFS block sizes, please see L. + +=item C + +This passes the C<-O> parameter to the external mkfs program. + +For certain filesystem types, this allows extra filesystem +features to be selected. See L and L +for more details. + +You cannot use this optional parameter with the C or +C filesystem type. + =back"); ("getxattr", (RBufferOut "xattr", [Pathname "path"; String "name"], []), 279, [Optional "linuxxattrs"], @@ -5688,6 +5859,16 @@ C and read the C and C values. These two numbers, multiplied together, give the resulting size of the minimal filesystem in bytes."); + ("internal_autosync", (RErr, [], []), 282, [NotInFish; NotInDocs], + [], + "internal autosync operation", + "\ +This command performs the autosync operation just before the +handle is closed. You should not call this command directly. +Instead, use the autosync flag (C) to +control whether or not this operation is performed when the +handle is closed."); + ] let all_functions = non_daemon_functions @ daemon_functions