X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=generator%2Fgenerator_actions.ml;h=c5bd44b67f31680b2fb0e3a8d2b623325a4570e3;hp=4fadd17b94709d5188dfb2aa218ab0fd354ceb7e;hb=692f127447d399db21c2e93026d4d2b0ac1839d1;hpb=233530d3541dd67ce8fec7d9677cdf659c9d2900 diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 4fadd17..c5bd44b 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -738,6 +738,10 @@ Any Linux-based operating system. Any Microsoft Windows operating system. +=item \"freebsd\" + +FreeBSD. + =item \"unknown\" The operating system type could not be determined. @@ -779,6 +783,10 @@ Currently defined distros are: =over 4 +=item \"archlinux\" + +Arch Linux. + =item \"debian\" Debian or a Debian-derived distro such as Ubuntu. @@ -787,6 +795,14 @@ Debian or a Debian-derived distro such as Ubuntu. Fedora. +=item \"gentoo\" + +Gentoo. + +=item \"meego\" + +MeeGo. + =item \"pardus\" Pardus. @@ -804,6 +820,10 @@ Red Hat Enterprise Linux and some derivatives. Windows does not have distributions. This string is returned if the OS type is Windows. +=item \"ubuntu\" + +Ubuntu. + =item \"unknown\" The distro could not be determined. @@ -1022,6 +1042,133 @@ the case then an error is returned. Please read L for more details."); + ("inspect_get_roots", (RStringList "roots", [], []), -1, [], + [], + "return list of operating systems found by last inspection", + "\ +This function is a convenient way to get the list of root +devices, as returned from a previous call to C, +but without redoing the whole inspection process. + +This returns an empty list if either no root devices were +found or the caller has not called C. + +Please read L for more details."); + + ("debug_cmdline", (RStringList "cmdline", [], []), -1, [NotInDocs], + [], + "debug the QEMU command line (internal use only)", + "\ +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 the disk(s) from a named libvirt domain", + "\ +This function adds the disk(s) attached to the named libvirt +domain C. It works by connecting to libvirt, requesting +the domain and domain XML from libvirt, parsing it for disks, +and calling C on each one. + +The number of disks added is returned. This operation is atomic: +if an error is returned, then no disks are added. + +This function does some minimal checks to make sure the libvirt +domain is not running (unless C is true). In a future +version we will try to acquire the libvirt lock on each disk. + +Disks must be accessible locally. This often means that adding disks +from a remote libvirt connection (see L) +will fail unless those disks are accessible via the same device path +locally too. + +The optional C parameter sets the libvirt URI +(see L). If this is not set then +we connect to the default libvirt URI (or one set through an +environment variable, see the libvirt documentation for full +details). If you are using the C API directly then it is more +flexible to create the libvirt connection object yourself, get +the domain object, and call C. + +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 the disk(s) from a libvirt domain", + "\ +This function adds the disk(s) attached to the libvirt domain C. +It works by requesting the domain XML from libvirt, parsing it for +disks, and calling C on each one. + +In the C API we declare C, but really it has type +C. This is so we don't need Elibvirt.hE. + +The number of disks added is returned. This operation is atomic: +if an error is returned, then no disks are added. + +This function does some minimal checks to make sure the libvirt +domain is not running (unless C is true). In a future +version we will try to acquire the libvirt lock on each disk. + +Disks must be accessible locally. This often means that adding disks +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 +C."); +*) + + ("inspect_get_package_format", (RString "packageformat", [Device "root"], []), -1, [], + [], + "get package format used by the operating system", + "\ +This function should only be called with a root device string +as returned by C. + +This function and C return +the package format and package management tool used by the +inspected operating system. For example for Fedora these +functions would return C (package format) and +C (package management). + +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. +Future versions of libguestfs may return other strings. + +Please read L for more details."); + + ("inspect_get_package_management", (RString "packagemanagement", [Device "root"], []), -1, [], + [], + "get package management tool used by the operating system", + "\ +This function should only be called with a root device string +as returned by C. + +C and this function return +the package format and package management tool used by the +inspected operating system. For example for Fedora these +functions would return C (package format) and +C (package management). + +This returns the string C if we could not determine the +package management tool I if the operating system does not have +a real packaging system (eg. Windows). + +Possible strings include: C, C, +C (for all Debian derivatives), +C, C, C. +Future versions of libguestfs may return other strings. + +Please read L for more details."); + ] (* daemon_functions are any functions which cause some action @@ -1139,7 +1286,10 @@ See also C."); [InitBasicFS, Always, TestOutputListOfDevices ( [["list_partitions"]], ["/dev/sda1"]); InitEmpty, Always, TestOutputListOfDevices ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["list_partitions"]], ["/dev/sda1"; "/dev/sda2"; "/dev/sda3"])], "list the partitions", "\ @@ -1156,7 +1306,10 @@ See also C."); [InitBasicFSonLVM, Always, TestOutputListOfDevices ( [["pvs"]], ["/dev/sda1"]); InitEmpty, Always, TestOutputListOfDevices ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["pvcreate"; "/dev/sda1"]; ["pvcreate"; "/dev/sda2"]; ["pvcreate"; "/dev/sda3"]; @@ -1175,7 +1328,10 @@ See also C."); [InitBasicFSonLVM, Always, TestOutputList ( [["vgs"]], ["VG"]); InitEmpty, Always, TestOutputList ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["pvcreate"; "/dev/sda1"]; ["pvcreate"; "/dev/sda2"]; ["pvcreate"; "/dev/sda3"]; @@ -1196,7 +1352,10 @@ See also C."); [InitBasicFSonLVM, Always, TestOutputList ( [["lvs"]], ["/dev/VG/LV"]); InitEmpty, Always, TestOutputList ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["pvcreate"; "/dev/sda1"]; ["pvcreate"; "/dev/sda2"]; ["pvcreate"; "/dev/sda3"]; @@ -1552,7 +1711,10 @@ See also C."); ("pvcreate", (RErr, [Device "device"], []), 39, [Optional "lvm2"], [InitEmpty, Always, TestOutputListOfDevices ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["pvcreate"; "/dev/sda1"]; ["pvcreate"; "/dev/sda2"]; ["pvcreate"; "/dev/sda3"]; @@ -1565,7 +1727,10 @@ as C."); ("vgcreate", (RErr, [String "volgroup"; DeviceList "physvols"], []), 40, [Optional "lvm2"], [InitEmpty, Always, TestOutputList ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["pvcreate"; "/dev/sda1"]; ["pvcreate"; "/dev/sda2"]; ["pvcreate"; "/dev/sda3"]; @@ -1579,7 +1744,10 @@ from the non-empty list of physical volumes C."); ("lvcreate", (RErr, [String "logvol"; String "volgroup"; Int "mbytes"], []), 41, [Optional "lvm2"], [InitEmpty, Always, TestOutputList ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["pvcreate"; "/dev/sda1"]; ["pvcreate"; "/dev/sda2"]; ["pvcreate"; "/dev/sda3"]; @@ -1693,7 +1861,10 @@ See also: C"); ["mounts"]], []); (* check that umount_all can unmount nested mounts correctly: *) InitEmpty, Always, TestOutputList ( - [["sfdiskM"; "/dev/sda"; ",100 ,200 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "409599"]; + ["part_add"; "/dev/sda"; "p"; "409600"; "-64"]; ["mkfs"; "ext2"; "/dev/sda1"]; ["mkfs"; "ext2"; "/dev/sda2"]; ["mkfs"; "ext2"; "/dev/sda3"]; @@ -2216,7 +2387,7 @@ This is the same as the C command, but it allows you to set both the mount options and the vfstype as for the L I<-o> and I<-t> flags."); - ("debug", (RString "result", [String "subcmd"; StringList "extraargs"], []), 76, [], + ("debug", (RString "result", [String "subcmd"; StringList "extraargs"], []), 76, [NotInDocs], [], "debugging and internals", "\ @@ -3880,7 +4051,9 @@ the requested cluster size."); ("mke2journal", (RErr, [Int "blocksize"; Device "device"], []), 188, [], [InitEmpty, Always, TestOutput ( - [["sfdiskM"; "/dev/sda"; ",100 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "-64"]; ["mke2journal"; "4096"; "/dev/sda1"]; ["mke2fs_J"; "ext2"; "4096"; "/dev/sda2"; "/dev/sda1"]; ["mount_options"; ""; "/dev/sda2"; "/"]; @@ -3895,7 +4068,9 @@ to the command: ("mke2journal_L", (RErr, [Int "blocksize"; String "label"; Device "device"], []), 189, [], [InitEmpty, Always, TestOutput ( - [["sfdiskM"; "/dev/sda"; ",100 ,"]; + [["part_init"; "/dev/sda"; "mbr"]; + ["part_add"; "/dev/sda"; "p"; "64"; "204799"]; + ["part_add"; "/dev/sda"; "p"; "204800"; "-64"]; ["mke2journal_L"; "4096"; "JOURNAL"; "/dev/sda1"]; ["mke2fs_JL"; "ext2"; "4096"; "/dev/sda2"; "JOURNAL"]; ["mount_options"; ""; "/dev/sda2"; "/"]; @@ -3908,7 +4083,9 @@ This creates an ext2 external journal on C with label C