PageRenderTime 62ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/libguestfs-1.19.22/generator/generator_actions.ml

#
OCaml | 9342 lines | 8738 code | 454 blank | 150 comment | 1 complexity | e6a678e96285aaeab3f4f9d219dc8f30 MD5 | raw file
Possible License(s): LGPL-2.0, GPL-3.0, GPL-2.0

Large files files are truncated, but you can click here to view the full file

  1. (* libguestfs
  2. * Copyright (C) 2009-2012 Red Hat Inc.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. *)
  18. (* Please read generator/README first. *)
  19. open Generator_types
  20. open Generator_utils
  21. (* Default settings for all action fields. So we copy and override
  22. * this struct by writing '{ defaults with name = &c }'
  23. *)
  24. let defaults = { name = ""; style = RErr, [], []; proc_nr = None;
  25. tests = []; shortdesc = ""; longdesc = "";
  26. protocol_limit_warning = false; fish_alias = [];
  27. fish_output = None; in_fish = true; in_docs = true;
  28. deprecated_by = None; optional = None;
  29. progress = false; camel_name = "";
  30. cancellable = false; config_only = false;
  31. once_had_no_optargs = false;
  32. c_name = ""; c_function = ""; c_optarg_prefix = "";
  33. non_c_aliases = [] }
  34. (* These test functions are used in the language binding tests. *)
  35. let test_all_args = [
  36. String "str";
  37. OptString "optstr";
  38. StringList "strlist";
  39. Bool "b";
  40. Int "integer";
  41. Int64 "integer64";
  42. FileIn "filein";
  43. FileOut "fileout";
  44. BufferIn "bufferin";
  45. ]
  46. let test_all_optargs = [
  47. OBool "obool";
  48. OInt "oint";
  49. OInt64 "oint64";
  50. OString "ostring"
  51. ]
  52. let test_all_rets = [
  53. (* except for RErr, which is tested thoroughly elsewhere *)
  54. "internal_test_rint", RInt "valout";
  55. "internal_test_rint64", RInt64 "valout";
  56. "internal_test_rbool", RBool "valout";
  57. "internal_test_rconststring", RConstString "valout";
  58. "internal_test_rconstoptstring", RConstOptString "valout";
  59. "internal_test_rstring", RString "valout";
  60. "internal_test_rstringlist", RStringList "valout";
  61. "internal_test_rstruct", RStruct ("valout", "lvm_pv");
  62. "internal_test_rstructlist", RStructList ("valout", "lvm_pv");
  63. "internal_test_rhashtable", RHashtable "valout";
  64. "internal_test_rbufferout", RBufferOut "valout";
  65. ]
  66. let test_functions = [
  67. { defaults with
  68. name = "internal_test";
  69. style = RErr, test_all_args, test_all_optargs;
  70. in_fish = false; in_docs = false; cancellable = true;
  71. shortdesc = "internal test function - do not use";
  72. longdesc = "\
  73. This is an internal test function which is used to test whether
  74. the automatically generated bindings can handle every possible
  75. parameter type correctly.
  76. It echos the contents of each parameter to stdout.
  77. You probably don't want to call this function." }
  78. ] @ List.flatten (
  79. List.map (
  80. fun (name, ret) -> [
  81. { defaults with
  82. name = name;
  83. style = ret, [String "val"], [];
  84. in_fish = false; in_docs = false;
  85. shortdesc = "internal test function - do not use";
  86. longdesc = "\
  87. This is an internal test function which is used to test whether
  88. the automatically generated bindings can handle every possible
  89. return type correctly.
  90. It converts string C<val> to the return type.
  91. You probably don't want to call this function." };
  92. { defaults with
  93. name = name ^ "err";
  94. style = ret, [], [];
  95. in_fish = false; in_docs = false;
  96. shortdesc = "internal test function - do not use";
  97. longdesc = "\
  98. This is an internal test function which is used to test whether
  99. the automatically generated bindings can handle every possible
  100. return type correctly.
  101. This function always returns an error.
  102. You probably don't want to call this function." }
  103. ]
  104. ) test_all_rets
  105. )
  106. (* non_daemon_functions are any functions which don't get processed
  107. * in the daemon, eg. functions for setting and getting local
  108. * configuration values.
  109. *)
  110. let non_daemon_functions = test_functions @ [
  111. { defaults with
  112. name = "launch";
  113. style = RErr, [], [];
  114. fish_alias = ["run"]; progress = true; config_only = true;
  115. shortdesc = "launch the qemu subprocess";
  116. longdesc = "\
  117. Internally libguestfs is implemented by running a virtual machine
  118. using L<qemu(1)>.
  119. You should call this after configuring the handle
  120. (eg. adding drives) but before performing any actions." };
  121. { defaults with
  122. name = "wait_ready";
  123. style = RErr, [], [];
  124. in_fish = false; deprecated_by = Some "launch";
  125. shortdesc = "wait until the qemu subprocess launches (no op)";
  126. longdesc = "\
  127. This function is a no op.
  128. In versions of the API E<lt> 1.0.71 you had to call this function
  129. just after calling C<guestfs_launch> to wait for the launch
  130. to complete. However this is no longer necessary because
  131. C<guestfs_launch> now does the waiting.
  132. If you see any calls to this function in code then you can just
  133. remove them, unless you want to retain compatibility with older
  134. versions of the API." };
  135. { defaults with
  136. name = "kill_subprocess";
  137. style = RErr, [], [];
  138. deprecated_by = Some "shutdown";
  139. shortdesc = "kill the qemu subprocess";
  140. longdesc = "\
  141. This kills the qemu subprocess.
  142. Do not call this. See: C<guestfs_shutdown> instead." };
  143. { defaults with
  144. name = "add_cdrom";
  145. style = RErr, [String "filename"], [];
  146. deprecated_by = Some "add_drive"; config_only = true;
  147. shortdesc = "add a CD-ROM disk image to examine";
  148. longdesc = "\
  149. This function adds a virtual CD-ROM disk image to the guest.
  150. This is equivalent to the qemu parameter I<-cdrom filename>.
  151. Notes:
  152. =over 4
  153. =item *
  154. This call checks for the existence of C<filename>. This
  155. stops you from specifying other types of drive which are supported
  156. by qemu such as C<nbd:> and C<http:> URLs. To specify those, use
  157. the general C<guestfs_config> call instead.
  158. =item *
  159. If you just want to add an ISO file (often you use this as an
  160. efficient way to transfer large files into the guest), then you
  161. should probably use C<guestfs_add_drive_ro> instead.
  162. =back" };
  163. { defaults with
  164. name = "add_drive_ro";
  165. style = RErr, [String "filename"], [];
  166. fish_alias = ["add-ro"]; config_only = true;
  167. shortdesc = "add a drive in snapshot mode (read-only)";
  168. longdesc = "\
  169. This function is the equivalent of calling C<guestfs_add_drive_opts>
  170. with the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1,
  171. so the disk is added read-only, with the format being detected
  172. automatically." };
  173. { defaults with
  174. name = "config";
  175. style = RErr, [String "qemuparam"; OptString "qemuvalue"], [];
  176. config_only = true;
  177. shortdesc = "add qemu parameters";
  178. longdesc = "\
  179. This can be used to add arbitrary qemu command line parameters
  180. of the form I<-param value>. Actually it's not quite arbitrary - we
  181. prevent you from setting some parameters which would interfere with
  182. parameters that we use.
  183. The first character of C<param> string must be a C<-> (dash).
  184. C<value> can be NULL." };
  185. { defaults with
  186. name = "set_qemu";
  187. style = RErr, [OptString "qemu"], [];
  188. fish_alias = ["qemu"]; config_only = true;
  189. shortdesc = "set the qemu binary";
  190. longdesc = "\
  191. Set the qemu binary that we will use.
  192. The default is chosen when the library was compiled by the
  193. configure script.
  194. You can also override this by setting the C<LIBGUESTFS_QEMU>
  195. environment variable.
  196. Setting C<qemu> to C<NULL> restores the default qemu binary.
  197. Note that you should call this function as early as possible
  198. after creating the handle. This is because some pre-launch
  199. operations depend on testing qemu features (by running C<qemu -help>).
  200. If the qemu binary changes, we don't retest features, and
  201. so you might see inconsistent results. Using the environment
  202. variable C<LIBGUESTFS_QEMU> is safest of all since that picks
  203. the qemu binary at the same time as the handle is created." };
  204. { defaults with
  205. name = "get_qemu";
  206. style = RConstString "qemu", [], [];
  207. tests = [
  208. InitNone, Always, TestRun (
  209. [["get_qemu"]])
  210. ];
  211. shortdesc = "get the qemu binary";
  212. longdesc = "\
  213. Return the current qemu binary.
  214. This is always non-NULL. If it wasn't set already, then this will
  215. return the default qemu binary name." };
  216. { defaults with
  217. name = "set_path";
  218. style = RErr, [OptString "searchpath"], [];
  219. fish_alias = ["path"]; config_only = true;
  220. shortdesc = "set the search path";
  221. longdesc = "\
  222. Set the path that libguestfs searches for kernel and initrd.img.
  223. The default is C<$libdir/guestfs> unless overridden by setting
  224. C<LIBGUESTFS_PATH> environment variable.
  225. Setting C<path> to C<NULL> restores the default path." };
  226. { defaults with
  227. name = "get_path";
  228. style = RConstString "path", [], [];
  229. tests = [
  230. InitNone, Always, TestRun (
  231. [["get_path"]])
  232. ];
  233. shortdesc = "get the search path";
  234. longdesc = "\
  235. Return the current search path.
  236. This is always non-NULL. If it wasn't set already, then this will
  237. return the default path." };
  238. { defaults with
  239. name = "set_append";
  240. style = RErr, [OptString "append"], [];
  241. fish_alias = ["append"]; config_only = true;
  242. shortdesc = "add options to kernel command line";
  243. longdesc = "\
  244. This function is used to add additional options to the
  245. guest kernel command line.
  246. The default is C<NULL> unless overridden by setting
  247. C<LIBGUESTFS_APPEND> environment variable.
  248. Setting C<append> to C<NULL> means I<no> additional options
  249. are passed (libguestfs always adds a few of its own)." };
  250. { defaults with
  251. name = "get_append";
  252. style = RConstOptString "append", [], [];
  253. (* This cannot be tested with the current framework. The
  254. * function can return NULL in normal operations, which the
  255. * test framework interprets as an error.
  256. *)
  257. tests = [];
  258. shortdesc = "get the additional kernel options";
  259. longdesc = "\
  260. Return the additional kernel options which are added to the
  261. guest kernel command line.
  262. If C<NULL> then no options are added." };
  263. { defaults with
  264. name = "set_autosync";
  265. style = RErr, [Bool "autosync"], [];
  266. fish_alias = ["autosync"];
  267. shortdesc = "set autosync mode";
  268. longdesc = "\
  269. If C<autosync> is true, this enables autosync. Libguestfs will make a
  270. best effort attempt to make filesystems consistent and synchronized
  271. when the handle is closed
  272. (also if the program exits without closing handles).
  273. This is enabled by default (since libguestfs 1.5.24, previously it was
  274. disabled by default)." };
  275. { defaults with
  276. name = "get_autosync";
  277. style = RBool "autosync", [], [];
  278. tests = [
  279. InitNone, Always, TestOutputTrue (
  280. [["get_autosync"]])
  281. ];
  282. shortdesc = "get autosync mode";
  283. longdesc = "\
  284. Get the autosync flag." };
  285. { defaults with
  286. name = "set_verbose";
  287. style = RErr, [Bool "verbose"], [];
  288. fish_alias = ["verbose"];
  289. shortdesc = "set verbose mode";
  290. longdesc = "\
  291. If C<verbose> is true, this turns on verbose messages.
  292. Verbose messages are disabled unless the environment variable
  293. C<LIBGUESTFS_DEBUG> is defined and set to C<1>.
  294. Verbose messages are normally sent to C<stderr>, unless you
  295. register a callback to send them somewhere else (see
  296. C<guestfs_set_event_callback>)." };
  297. { defaults with
  298. name = "get_verbose";
  299. style = RBool "verbose", [], [];
  300. shortdesc = "get verbose mode";
  301. longdesc = "\
  302. This returns the verbose messages flag." };
  303. { defaults with
  304. name = "is_ready";
  305. style = RBool "ready", [], [];
  306. tests = [
  307. InitNone, Always, TestOutputTrue (
  308. [["is_ready"]])
  309. ];
  310. shortdesc = "is ready to accept commands";
  311. longdesc = "\
  312. This returns true iff this handle is ready to accept commands
  313. (in the C<READY> state).
  314. For more information on states, see L<guestfs(3)>." };
  315. { defaults with
  316. name = "is_config";
  317. style = RBool "config", [], [];
  318. tests = [
  319. InitNone, Always, TestOutputFalse (
  320. [["is_config"]])
  321. ];
  322. shortdesc = "is in configuration state";
  323. longdesc = "\
  324. This returns true iff this handle is being configured
  325. (in the C<CONFIG> state).
  326. For more information on states, see L<guestfs(3)>." };
  327. { defaults with
  328. name = "is_launching";
  329. style = RBool "launching", [], [];
  330. tests = [
  331. InitNone, Always, TestOutputFalse (
  332. [["is_launching"]])
  333. ];
  334. shortdesc = "is launching subprocess";
  335. longdesc = "\
  336. This returns true iff this handle is launching the subprocess
  337. (in the C<LAUNCHING> state).
  338. For more information on states, see L<guestfs(3)>." };
  339. { defaults with
  340. name = "is_busy";
  341. style = RBool "busy", [], [];
  342. in_docs = false;
  343. tests = [
  344. InitNone, Always, TestOutputFalse (
  345. [["is_busy"]])
  346. ];
  347. shortdesc = "is busy processing a command";
  348. longdesc = "\
  349. This always returns false. Do not use this function.
  350. For more information on states, see L<guestfs(3)>." };
  351. { defaults with
  352. name = "get_state";
  353. style = RInt "state", [], [];
  354. shortdesc = "get the current state";
  355. longdesc = "\
  356. This returns the current state as an opaque integer. This is
  357. only useful for printing debug and internal error messages.
  358. For more information on states, see L<guestfs(3)>." };
  359. { defaults with
  360. name = "set_memsize";
  361. style = RErr, [Int "memsize"], [];
  362. fish_alias = ["memsize"]; config_only = true;
  363. shortdesc = "set memory allocated to the qemu subprocess";
  364. longdesc = "\
  365. This sets the memory size in megabytes allocated to the
  366. qemu subprocess. This only has any effect if called before
  367. C<guestfs_launch>.
  368. You can also change this by setting the environment
  369. variable C<LIBGUESTFS_MEMSIZE> before the handle is
  370. created.
  371. For more information on the architecture of libguestfs,
  372. see L<guestfs(3)>." };
  373. { defaults with
  374. name = "get_memsize";
  375. style = RInt "memsize", [], [];
  376. tests = [
  377. InitNone, Always, TestOutputIntOp (
  378. [["get_memsize"]], ">=", 256)
  379. ];
  380. shortdesc = "get memory allocated to the qemu subprocess";
  381. longdesc = "\
  382. This gets the memory size in megabytes allocated to the
  383. qemu subprocess.
  384. If C<guestfs_set_memsize> was not called
  385. on this handle, and if C<LIBGUESTFS_MEMSIZE> was not set,
  386. then this returns the compiled-in default value for memsize.
  387. For more information on the architecture of libguestfs,
  388. see L<guestfs(3)>." };
  389. { defaults with
  390. name = "get_pid";
  391. style = RInt "pid", [], [];
  392. fish_alias = ["pid"];
  393. tests = [
  394. InitNone, Always, TestOutputIntOp (
  395. [["get_pid"]], ">=", 1)
  396. ];
  397. shortdesc = "get PID of qemu subprocess";
  398. longdesc = "\
  399. Return the process ID of the qemu subprocess. If there is no
  400. qemu subprocess, then this will return an error.
  401. This is an internal call used for debugging and testing." };
  402. { defaults with
  403. name = "version";
  404. style = RStruct ("version", "version"), [], [];
  405. tests = [
  406. InitNone, Always, TestOutputStruct (
  407. [["version"]], [CompareWithInt ("major", 1)])
  408. ];
  409. shortdesc = "get the library version number";
  410. longdesc = "\
  411. Return the libguestfs version number that the program is linked
  412. against.
  413. Note that because of dynamic linking this is not necessarily
  414. the version of libguestfs that you compiled against. You can
  415. compile the program, and then at runtime dynamically link
  416. against a completely different C<libguestfs.so> library.
  417. This call was added in version C<1.0.58>. In previous
  418. versions of libguestfs there was no way to get the version
  419. number. From C code you can use dynamic linker functions
  420. to find out if this symbol exists (if it doesn't, then
  421. it's an earlier version).
  422. The call returns a structure with four elements. The first
  423. three (C<major>, C<minor> and C<release>) are numbers and
  424. correspond to the usual version triplet. The fourth element
  425. (C<extra>) is a string and is normally empty, but may be
  426. used for distro-specific information.
  427. To construct the original version string:
  428. C<$major.$minor.$release$extra>
  429. See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>.
  430. I<Note:> Don't use this call to test for availability
  431. of features. In enterprise distributions we backport
  432. features from later versions into earlier versions,
  433. making this an unreliable way to test for features.
  434. Use C<guestfs_available> instead." };
  435. { defaults with
  436. name = "set_selinux";
  437. style = RErr, [Bool "selinux"], [];
  438. fish_alias = ["selinux"]; config_only = true;
  439. shortdesc = "set SELinux enabled or disabled at appliance boot";
  440. longdesc = "\
  441. This sets the selinux flag that is passed to the appliance
  442. at boot time. The default is C<selinux=0> (disabled).
  443. Note that if SELinux is enabled, it is always in
  444. Permissive mode (C<enforcing=0>).
  445. For more information on the architecture of libguestfs,
  446. see L<guestfs(3)>." };
  447. { defaults with
  448. name = "get_selinux";
  449. style = RBool "selinux", [], [];
  450. shortdesc = "get SELinux enabled flag";
  451. longdesc = "\
  452. This returns the current setting of the selinux flag which
  453. is passed to the appliance at boot time. See C<guestfs_set_selinux>.
  454. For more information on the architecture of libguestfs,
  455. see L<guestfs(3)>." };
  456. { defaults with
  457. name = "set_trace";
  458. style = RErr, [Bool "trace"], [];
  459. fish_alias = ["trace"];
  460. tests = [
  461. InitNone, Always, TestOutputFalse (
  462. [["set_trace"; "false"];
  463. ["get_trace"]])
  464. ];
  465. shortdesc = "enable or disable command traces";
  466. longdesc = "\
  467. If the command trace flag is set to 1, then libguestfs
  468. calls, parameters and return values are traced.
  469. If you want to trace C API calls into libguestfs (and
  470. other libraries) then possibly a better way is to use
  471. the external ltrace(1) command.
  472. Command traces are disabled unless the environment variable
  473. C<LIBGUESTFS_TRACE> is defined and set to C<1>.
  474. Trace messages are normally sent to C<stderr>, unless you
  475. register a callback to send them somewhere else (see
  476. C<guestfs_set_event_callback>)." };
  477. { defaults with
  478. name = "get_trace";
  479. style = RBool "trace", [], [];
  480. shortdesc = "get command trace enabled flag";
  481. longdesc = "\
  482. Return the command trace flag." };
  483. { defaults with
  484. name = "set_direct";
  485. style = RErr, [Bool "direct"], [];
  486. fish_alias = ["direct"]; config_only = true;
  487. shortdesc = "enable or disable direct appliance mode";
  488. longdesc = "\
  489. If the direct appliance mode flag is enabled, then stdin and
  490. stdout are passed directly through to the appliance once it
  491. is launched.
  492. One consequence of this is that log messages aren't caught
  493. by the library and handled by C<guestfs_set_log_message_callback>,
  494. but go straight to stdout.
  495. You probably don't want to use this unless you know what you
  496. are doing.
  497. The default is disabled." };
  498. { defaults with
  499. name = "get_direct";
  500. style = RBool "direct", [], [];
  501. shortdesc = "get direct appliance mode flag";
  502. longdesc = "\
  503. Return the direct appliance mode flag." };
  504. { defaults with
  505. name = "set_recovery_proc";
  506. style = RErr, [Bool "recoveryproc"], [];
  507. fish_alias = ["recovery-proc"]; config_only = true;
  508. shortdesc = "enable or disable the recovery process";
  509. longdesc = "\
  510. If this is called with the parameter C<false> then
  511. C<guestfs_launch> does not create a recovery process. The
  512. purpose of the recovery process is to stop runaway qemu
  513. processes in the case where the main program aborts abruptly.
  514. This only has any effect if called before C<guestfs_launch>,
  515. and the default is true.
  516. About the only time when you would want to disable this is
  517. if the main process will fork itself into the background
  518. (\"daemonize\" itself). In this case the recovery process
  519. thinks that the main program has disappeared and so kills
  520. qemu, which is not very helpful." };
  521. { defaults with
  522. name = "get_recovery_proc";
  523. style = RBool "recoveryproc", [], [];
  524. shortdesc = "get recovery process enabled flag";
  525. longdesc = "\
  526. Return the recovery process enabled flag." };
  527. { defaults with
  528. name = "add_drive_with_if";
  529. style = RErr, [String "filename"; String "iface"], [];
  530. deprecated_by = Some "add_drive"; config_only = true;
  531. shortdesc = "add a drive specifying the QEMU block emulation to use";
  532. longdesc = "\
  533. This is the same as C<guestfs_add_drive> but it allows you
  534. to specify the QEMU interface emulation to use at run time." };
  535. { defaults with
  536. name = "add_drive_ro_with_if";
  537. style = RErr, [String "filename"; String "iface"], [];
  538. deprecated_by = Some "add_drive"; config_only = true;
  539. shortdesc = "add a drive read-only specifying the QEMU block emulation to use";
  540. longdesc = "\
  541. This is the same as C<guestfs_add_drive_ro> but it allows you
  542. to specify the QEMU interface emulation to use at run time." };
  543. { defaults with
  544. name = "file_architecture";
  545. style = RString "arch", [Pathname "filename"], [];
  546. tests = [
  547. InitISOFS, Always, TestOutput (
  548. [["file_architecture"; "/bin-i586-dynamic"]], "i386");
  549. InitISOFS, Always, TestOutput (
  550. [["file_architecture"; "/bin-sparc-dynamic"]], "sparc");
  551. InitISOFS, Always, TestOutput (
  552. [["file_architecture"; "/bin-win32.exe"]], "i386");
  553. InitISOFS, Always, TestOutput (
  554. [["file_architecture"; "/bin-win64.exe"]], "x86_64");
  555. InitISOFS, Always, TestOutput (
  556. [["file_architecture"; "/bin-x86_64-dynamic"]], "x86_64");
  557. InitISOFS, Always, TestOutput (
  558. [["file_architecture"; "/lib-i586.so"]], "i386");
  559. InitISOFS, Always, TestOutput (
  560. [["file_architecture"; "/lib-sparc.so"]], "sparc");
  561. InitISOFS, Always, TestOutput (
  562. [["file_architecture"; "/lib-win32.dll"]], "i386");
  563. InitISOFS, Always, TestOutput (
  564. [["file_architecture"; "/lib-win64.dll"]], "x86_64");
  565. InitISOFS, Always, TestOutput (
  566. [["file_architecture"; "/lib-x86_64.so"]], "x86_64");
  567. InitISOFS, Always, TestOutput (
  568. [["file_architecture"; "/initrd-x86_64.img"]], "x86_64");
  569. InitISOFS, Always, TestOutput (
  570. [["file_architecture"; "/initrd-x86_64.img.gz"]], "x86_64");
  571. ];
  572. shortdesc = "detect the architecture of a binary file";
  573. longdesc = "\
  574. This detects the architecture of the binary C<filename>,
  575. and returns it if known.
  576. Currently defined architectures are:
  577. =over 4
  578. =item \"i386\"
  579. This string is returned for all 32 bit i386, i486, i586, i686 binaries
  580. irrespective of the precise processor requirements of the binary.
  581. =item \"x86_64\"
  582. 64 bit x86-64.
  583. =item \"sparc\"
  584. 32 bit SPARC.
  585. =item \"sparc64\"
  586. 64 bit SPARC V9 and above.
  587. =item \"ia64\"
  588. Intel Itanium.
  589. =item \"ppc\"
  590. 32 bit Power PC.
  591. =item \"ppc64\"
  592. 64 bit Power PC.
  593. =back
  594. Libguestfs may return other architecture strings in future.
  595. The function works on at least the following types of files:
  596. =over 4
  597. =item *
  598. many types of Un*x and Linux binary
  599. =item *
  600. many types of Un*x and Linux shared library
  601. =item *
  602. Windows Win32 and Win64 binaries
  603. =item *
  604. Windows Win32 and Win64 DLLs
  605. Win32 binaries and DLLs return C<i386>.
  606. Win64 binaries and DLLs return C<x86_64>.
  607. =item *
  608. Linux kernel modules
  609. =item *
  610. Linux new-style initrd images
  611. =item *
  612. some non-x86 Linux vmlinuz kernels
  613. =back
  614. What it can't do currently:
  615. =over 4
  616. =item *
  617. static libraries (libfoo.a)
  618. =item *
  619. Linux old-style initrd as compressed ext2 filesystem (RHEL 3)
  620. =item *
  621. x86 Linux vmlinuz kernels
  622. x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and
  623. compressed code, and are horribly hard to unpack. If you want to find
  624. the architecture of a kernel, use the architecture of the associated
  625. initrd or kernel module(s) instead.
  626. =back" };
  627. { defaults with
  628. name = "inspect_os";
  629. style = RStringList "roots", [], [];
  630. shortdesc = "inspect disk and return list of operating systems found";
  631. longdesc = "\
  632. This function uses other libguestfs functions and certain
  633. heuristics to inspect the disk(s) (usually disks belonging to
  634. a virtual machine), looking for operating systems.
  635. The list returned is empty if no operating systems were found.
  636. If one operating system was found, then this returns a list with
  637. a single element, which is the name of the root filesystem of
  638. this operating system. It is also possible for this function
  639. to return a list containing more than one element, indicating
  640. a dual-boot or multi-boot virtual machine, with each element being
  641. the root filesystem of one of the operating systems.
  642. You can pass the root string(s) returned to other
  643. C<guestfs_inspect_get_*> functions in order to query further
  644. information about each operating system, such as the name
  645. and version.
  646. This function uses other libguestfs features such as
  647. C<guestfs_mount_ro> and C<guestfs_umount_all> in order to mount
  648. and unmount filesystems and look at the contents. This should
  649. be called with no disks currently mounted. The function may also
  650. use Augeas, so any existing Augeas handle will be closed.
  651. This function cannot decrypt encrypted disks. The caller
  652. must do that first (supplying the necessary keys) if the
  653. disk is encrypted.
  654. Please read L<guestfs(3)/INSPECTION> for more details.
  655. See also C<guestfs_list_filesystems>." };
  656. { defaults with
  657. name = "inspect_get_type";
  658. style = RString "name", [Device "root"], [];
  659. shortdesc = "get type of inspected operating system";
  660. longdesc = "\
  661. This returns the type of the inspected operating system.
  662. Currently defined types are:
  663. =over 4
  664. =item \"linux\"
  665. Any Linux-based operating system.
  666. =item \"windows\"
  667. Any Microsoft Windows operating system.
  668. =item \"freebsd\"
  669. FreeBSD.
  670. =item \"netbsd\"
  671. NetBSD.
  672. =item \"hurd\"
  673. GNU/Hurd.
  674. =item \"dos\"
  675. MS-DOS, FreeDOS and others.
  676. =item \"unknown\"
  677. The operating system type could not be determined.
  678. =back
  679. Future versions of libguestfs may return other strings here.
  680. The caller should be prepared to handle any string.
  681. Please read L<guestfs(3)/INSPECTION> for more details." };
  682. { defaults with
  683. name = "inspect_get_arch";
  684. style = RString "arch", [Device "root"], [];
  685. shortdesc = "get architecture of inspected operating system";
  686. longdesc = "\
  687. This returns the architecture of the inspected operating system.
  688. The possible return values are listed under
  689. C<guestfs_file_architecture>.
  690. If the architecture could not be determined, then the
  691. string C<unknown> is returned.
  692. Please read L<guestfs(3)/INSPECTION> for more details." };
  693. { defaults with
  694. name = "inspect_get_distro";
  695. style = RString "distro", [Device "root"], [];
  696. shortdesc = "get distro of inspected operating system";
  697. longdesc = "\
  698. This returns the distro (distribution) of the inspected operating
  699. system.
  700. Currently defined distros are:
  701. =over 4
  702. =item \"archlinux\"
  703. Arch Linux.
  704. =item \"buildroot\"
  705. Buildroot-derived distro, but not one we specifically recognize.
  706. =item \"centos\"
  707. CentOS.
  708. =item \"cirros\"
  709. Cirros.
  710. =item \"debian\"
  711. Debian.
  712. =item \"fedora\"
  713. Fedora.
  714. =item \"freedos\"
  715. FreeDOS.
  716. =item \"gentoo\"
  717. Gentoo.
  718. =item \"linuxmint\"
  719. Linux Mint.
  720. =item \"mageia\"
  721. Mageia.
  722. =item \"mandriva\"
  723. Mandriva.
  724. =item \"meego\"
  725. MeeGo.
  726. =item \"opensuse\"
  727. OpenSUSE.
  728. =item \"pardus\"
  729. Pardus.
  730. =item \"redhat-based\"
  731. Some Red Hat-derived distro.
  732. =item \"rhel\"
  733. Red Hat Enterprise Linux.
  734. =item \"scientificlinux\"
  735. Scientific Linux.
  736. =item \"slackware\"
  737. Slackware.
  738. =item \"ttylinux\"
  739. ttylinux.
  740. =item \"ubuntu\"
  741. Ubuntu.
  742. =item \"unknown\"
  743. The distro could not be determined.
  744. =item \"windows\"
  745. Windows does not have distributions. This string is
  746. returned if the OS type is Windows.
  747. =back
  748. Future versions of libguestfs may return other strings here.
  749. The caller should be prepared to handle any string.
  750. Please read L<guestfs(3)/INSPECTION> for more details." };
  751. { defaults with
  752. name = "inspect_get_major_version";
  753. style = RInt "major", [Device "root"], [];
  754. shortdesc = "get major version of inspected operating system";
  755. longdesc = "\
  756. This returns the major version number of the inspected operating
  757. system.
  758. Windows uses a consistent versioning scheme which is I<not>
  759. reflected in the popular public names used by the operating system.
  760. Notably the operating system known as \"Windows 7\" is really
  761. version 6.1 (ie. major = 6, minor = 1). You can find out the
  762. real versions corresponding to releases of Windows by consulting
  763. Wikipedia or MSDN.
  764. If the version could not be determined, then C<0> is returned.
  765. Please read L<guestfs(3)/INSPECTION> for more details." };
  766. { defaults with
  767. name = "inspect_get_minor_version";
  768. style = RInt "minor", [Device "root"], [];
  769. shortdesc = "get minor version of inspected operating system";
  770. longdesc = "\
  771. This returns the minor version number of the inspected operating
  772. system.
  773. If the version could not be determined, then C<0> is returned.
  774. Please read L<guestfs(3)/INSPECTION> for more details.
  775. See also C<guestfs_inspect_get_major_version>." };
  776. { defaults with
  777. name = "inspect_get_product_name";
  778. style = RString "product", [Device "root"], [];
  779. shortdesc = "get product name of inspected operating system";
  780. longdesc = "\
  781. This returns the product name of the inspected operating
  782. system. The product name is generally some freeform string
  783. which can be displayed to the user, but should not be
  784. parsed by programs.
  785. If the product name could not be determined, then the
  786. string C<unknown> is returned.
  787. Please read L<guestfs(3)/INSPECTION> for more details." };
  788. { defaults with
  789. name = "inspect_get_mountpoints";
  790. style = RHashtable "mountpoints", [Device "root"], [];
  791. shortdesc = "get mountpoints of inspected operating system";
  792. longdesc = "\
  793. This returns a hash of where we think the filesystems
  794. associated with this operating system should be mounted.
  795. Callers should note that this is at best an educated guess
  796. made by reading configuration files such as C</etc/fstab>.
  797. I<In particular note> that this may return filesystems
  798. which are non-existent or not mountable and callers should
  799. be prepared to handle or ignore failures if they try to
  800. mount them.
  801. Each element in the returned hashtable has a key which
  802. is the path of the mountpoint (eg. C</boot>) and a value
  803. which is the filesystem that would be mounted there
  804. (eg. C</dev/sda1>).
  805. Non-mounted devices such as swap devices are I<not>
  806. returned in this list.
  807. For operating systems like Windows which still use drive
  808. letters, this call will only return an entry for the first
  809. drive \"mounted on\" C</>. For information about the
  810. mapping of drive letters to partitions, see
  811. C<guestfs_inspect_get_drive_mappings>.
  812. Please read L<guestfs(3)/INSPECTION> for more details.
  813. See also C<guestfs_inspect_get_filesystems>." };
  814. { defaults with
  815. name = "inspect_get_filesystems";
  816. style = RStringList "filesystems", [Device "root"], [];
  817. shortdesc = "get filesystems associated with inspected operating system";
  818. longdesc = "\
  819. This returns a list of all the filesystems that we think
  820. are associated with this operating system. This includes
  821. the root filesystem, other ordinary filesystems, and
  822. non-mounted devices like swap partitions.
  823. In the case of a multi-boot virtual machine, it is possible
  824. for a filesystem to be shared between operating systems.
  825. Please read L<guestfs(3)/INSPECTION> for more details.
  826. See also C<guestfs_inspect_get_mountpoints>." };
  827. { defaults with
  828. name = "set_network";
  829. style = RErr, [Bool "network"], [];
  830. fish_alias = ["network"]; config_only = true;
  831. shortdesc = "set enable network flag";
  832. longdesc = "\
  833. If C<network> is true, then the network is enabled in the
  834. libguestfs appliance. The default is false.
  835. This affects whether commands are able to access the network
  836. (see L<guestfs(3)/RUNNING COMMANDS>).
  837. You must call this before calling C<guestfs_launch>, otherwise
  838. it has no effect." };
  839. { defaults with
  840. name = "get_network";
  841. style = RBool "network", [], [];
  842. shortdesc = "get enable network flag";
  843. longdesc = "\
  844. This returns the enable network flag." };
  845. { defaults with
  846. name = "list_filesystems";
  847. style = RHashtable "fses", [], [];
  848. shortdesc = "list filesystems";
  849. longdesc = "\
  850. This inspection command looks for filesystems on partitions,
  851. block devices and logical volumes, returning a list of devices
  852. containing filesystems and their type.
  853. The return value is a hash, where the keys are the devices
  854. containing filesystems, and the values are the filesystem types.
  855. For example:
  856. \"/dev/sda1\" => \"ntfs\"
  857. \"/dev/sda2\" => \"ext2\"
  858. \"/dev/vg_guest/lv_root\" => \"ext4\"
  859. \"/dev/vg_guest/lv_swap\" => \"swap\"
  860. The value can have the special value \"unknown\", meaning the
  861. content of the device is undetermined or empty.
  862. \"swap\" means a Linux swap partition.
  863. This command runs other libguestfs commands, which might include
  864. C<guestfs_mount> and C<guestfs_umount>, and therefore you should
  865. use this soon after launch and only when nothing is mounted.
  866. Not all of the filesystems returned will be mountable. In
  867. particular, swap partitions are returned in the list. Also
  868. this command does not check that each filesystem
  869. found is valid and mountable, and some filesystems might
  870. be mountable but require special options. Filesystems may
  871. not all belong to a single logical operating system
  872. (use C<guestfs_inspect_os> to look for OSes)." };
  873. { defaults with
  874. name = "add_drive";
  875. style = RErr, [String "filename"], [OBool "readonly"; OString "format"; OString "iface"; OString "name"];
  876. once_had_no_optargs = true;
  877. fish_alias = ["add"]; config_only = true;
  878. shortdesc = "add an image to examine or modify";
  879. longdesc = "\
  880. This function adds a virtual machine disk image C<filename> to
  881. libguestfs. The first time you call this function, the disk
  882. appears as C</dev/sda>, the second time as C</dev/sdb>, and
  883. so on.
  884. You don't necessarily need to be root when using libguestfs. However
  885. you obviously do need sufficient permissions to access the filename
  886. for whatever operations you want to perform (ie. read access if you
  887. just want to read the image or write access if you want to modify the
  888. image).
  889. This call checks that C<filename> exists.
  890. The optional arguments are:
  891. =over 4
  892. =item C<readonly>
  893. If true then the image is treated as read-only. Writes are still
  894. allowed, but they are stored in a temporary snapshot overlay which
  895. is discarded at the end. The disk that you add is not modified.
  896. =item C<format>
  897. This forces the image format. If you omit this (or use C<guestfs_add_drive>
  898. or C<guestfs_add_drive_ro>) then the format is automatically detected.
  899. Possible formats include C<raw> and C<qcow2>.
  900. Automatic detection of the format opens you up to a potential
  901. security hole when dealing with untrusted raw-format images.
  902. See CVE-2010-3851 and RHBZ#642934. Specifying the format closes
  903. this security hole.
  904. =item C<iface>
  905. This rarely-used option lets you emulate the behaviour of the
  906. deprecated C<guestfs_add_drive_with_if> call (q.v.)
  907. =item C<name>
  908. The name the drive had in the original guest, e.g. /dev/sdb. This is used as a
  909. hint to the guest inspection process if it is available.
  910. =back
  911. C<filename> can have the special value C</dev/null>, which means
  912. to add a null (zero length) raw format device. You can add C</dev/null>
  913. multiple times." };
  914. { defaults with
  915. name = "inspect_get_windows_systemroot";
  916. style = RString "systemroot", [Device "root"], [];
  917. shortdesc = "get Windows systemroot of inspected operating system";
  918. longdesc = "\
  919. This returns the Windows systemroot of the inspected guest.
  920. The systemroot is a directory path such as C</WINDOWS>.
  921. This call assumes that the guest is Windows and that the
  922. systemroot could be determined by inspection. If this is not
  923. the case then an error is returned.
  924. Please read L<guestfs(3)/INSPECTION> for more details." };
  925. { defaults with
  926. name = "inspect_get_roots";
  927. style = RStringList "roots", [], [];
  928. shortdesc = "return list of operating systems found by last inspection";
  929. longdesc = "\
  930. This function is a convenient way to get the list of root
  931. devices, as returned from a previous call to C<guestfs_inspect_os>,
  932. but without redoing the whole inspection process.
  933. This returns an empty list if either no root devices were
  934. found or the caller has not called C<guestfs_inspect_os>.
  935. Please read L<guestfs(3)/INSPECTION> for more details." };
  936. { defaults with
  937. name = "debug_cmdline";
  938. style = RStringList "cmdline", [], [];
  939. in_docs = false;
  940. shortdesc = "debug the QEMU command line (internal use only)";
  941. longdesc = "\
  942. This returns the internal QEMU command line. 'debug' commands are
  943. not part of the formal API and can be removed or changed at any time." };
  944. { defaults with
  945. name = "debug_drives";
  946. style = RStringList "cmdline", [], [];
  947. in_docs = false;
  948. shortdesc = "debug the drives (internal use only)";
  949. longdesc = "\
  950. This returns the internal list of drives. 'debug' commands are
  951. not part of the formal API and can be removed or changed at any time." };
  952. { defaults with
  953. name = "add_domain";
  954. style = RInt "nrdisks", [String "dom"], [OString "libvirturi"; OBool "readonly"; OString "iface"; OBool "live"; OBool "allowuuid"; OString "readonlydisk"];
  955. fish_alias = ["domain"]; config_only = true;
  956. shortdesc = "add the disk(s) from a named libvirt domain";
  957. longdesc = "\
  958. This function adds the disk(s) attached to the named libvirt
  959. domain C<dom>. It works by connecting to libvirt, requesting
  960. the domain and domain XML from libvirt, parsing it for disks,
  961. and calling C<guestfs_add_drive_opts> on each one.
  962. The number of disks added is returned. This operation is atomic:
  963. if an error is returned, then no disks are added.
  964. This function does some minimal checks to make sure the libvirt
  965. domain is not running (unless C<readonly> is true). In a future
  966. version we will try to acquire the libvirt lock on each disk.
  967. Disks must be accessible locally. This often means that adding disks
  968. from a remote libvirt connection (see L<http://libvirt.org/remote.html>)
  969. will fail unless those disks are accessible via the same device path
  970. locally too.
  971. The optional C<libvirturi> parameter sets the libvirt URI
  972. (see L<http://libvirt.org/uri.html>). If this is not set then
  973. we connect to the default libvirt URI (or one set through an
  974. environment variable, see the libvirt documentation for full
  975. details).
  976. The optional C<live> flag controls whether this call will try
  977. to connect to a running virtual machine C<guestfsd> process if
  978. it sees a suitable E<lt>channelE<gt> element in the libvirt
  979. XML definition. The default (if the flag is omitted) is never
  980. to try. See L<guestfs(3)/ATTACHING TO RUNNING DAEMONS> for more
  981. information.
  982. If the C<allowuuid> flag is true (default is false) then a UUID
  983. I<may> be passed instead of the domain name. The C<dom> string is
  984. treated as a UUID first and looked up, and if that lookup fails
  985. then we treat C<dom> as a name as usual.
  986. The optional C<readonlydisk> parameter controls what we do for
  987. disks which are marked E<lt>readonly/E<gt> in the libvirt XML.
  988. Possible values are:
  989. =over 4
  990. =item readonlydisk = \"error\"
  991. If C<readonly> is false:
  992. The whole call is aborted with an error if any disk with
  993. the E<lt>readonly/E<gt> flag is found.
  994. If C<readonly> is true:
  995. Disks with the E<lt>readonly/E<gt> flag are added read-only.
  996. =item readonlydisk = \"read\"
  997. If C<readonly> is false:
  998. Disks with the E<lt>readonly/E<gt> flag are added read-only.
  999. Other disks are added read/write.
  1000. If C<readonly> is true:
  1001. Disks with the E<lt>readonly/E<gt> flag are added read-only.
  1002. =item readonlydisk = \"write\" (default)
  1003. If C<readonly> is false:
  1004. Disks with the E<lt>readonly/E<gt> flag are added read/write.
  1005. If C<readonly> is true:
  1006. Disks with the E<lt>readonly/E<gt> flag are added read-only.
  1007. =item readonlydisk = \"ignore\"
  1008. If C<readonly> is true or false:
  1009. Disks with the E<lt>readonly/E<gt> flag are skipped.
  1010. =back
  1011. The other optional parameters are passed directly through to
  1012. C<guestfs_add_drive_opts>." };
  1013. (*
  1014. This interface is not quite baked yet. -- RWMJ 2010-11-11
  1015. { defaults with
  1016. name = "add_libvirt_dom";
  1017. style = RInt "nrdisks", [Pointer ("virDomainPtr", "dom")], [Bool "readonly"; String "iface"; Bool "live"; String "readonlydisk"];
  1018. in_fish = false;
  1019. shortdesc = "add the disk(s) from a libvirt domain";
  1020. longdesc = "\
  1021. This function adds the disk(s) attached to the libvirt domain C<dom>.
  1022. It works by requesting the domain XML from libvirt, parsing it for
  1023. disks, and calling C<guestfs_add_drive_opts> on each one.
  1024. In the C API we declare C<void *dom>, but really it has type
  1025. C<virDomainPtr dom>. This is so we don't need E<lt>libvirt.hE<gt>.
  1026. The number of disks added is returned. This operation is atomic:
  1027. if an error is returned, then no disks are added.
  1028. This function does some minimal checks to make sure the libvirt
  1029. domain is not running (unless C<readonly> is true). In a future
  1030. version we will try to acquire the libvirt lock on each disk.
  1031. Disks must be accessible locally. This often means that adding disks
  1032. from a remote libvirt connection (see L<http://libvirt.org/remote.html>)
  1033. will fail unless those disks are accessible via the same device path
  1034. locally too.
  1035. The optional C<live> flag controls whether this call will try
  1036. to connect to a running virtual machine C<guestfsd> process if
  1037. it sees a suitable E<lt>channelE<gt> element in the libvirt
  1038. XML definition. The default (if the flag is omitted) is never
  1039. to try. See L<guestfs(3)/ATTACHING TO RUNNING DAEMONS> for more
  1040. information.
  1041. The optional C<readonlydisk> parameter controls what we do for
  1042. disks which are marked E<lt>readonly/E<gt> in the libvirt XML.
  1043. See C<guestfs_add_domain> for possible values.
  1044. The other optional parameters are passed directly through to
  1045. C<guestfs_add_drive_opts>." };
  1046. *)
  1047. { defaults with
  1048. name = "inspect_get_package_format";
  1049. style = RString "packageformat", [Device "root"], [];
  1050. shortdesc = "get package format used by the operating system";
  1051. longdesc = "\
  1052. This function and C<guestfs_inspect_get_package_management> return
  1053. the package format and package management tool used by the
  1054. inspected operating system. For example for Fedora these
  1055. functions would return C<rpm> (package format) and
  1056. C<yum> (package management).
  1057. This returns the string C<unknown> if we could not determine the
  1058. package format I<or> if the operating system does not have
  1059. a real packaging system (eg. Windows).
  1060. Possible strings include:
  1061. C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, C<pkgsrc>.
  1062. Future versions of libguestfs may return other strings.
  1063. Please read L<guestfs(3)/INSPECTION> for more details." };
  1064. { defaults with
  1065. name = "inspect_get_package_management";
  1066. style = RString "packagemanagement", [Device "root"], [];
  1067. shortdesc = "get package management tool used by the operating system";
  1068. longdesc = "\
  1069. C<guestfs_inspect_get_package_format> and this function return
  1070. the package format and package management tool used by the
  1071. inspected operating system. For example for Fedora these
  1072. functions would return C<rpm> (package format) and
  1073. C<yum> (package management).
  1074. This returns the string C<unknown> if we could not determine the
  1075. package management tool I<or> if the operating system does not have
  1076. a real packaging system (eg. Windows).
  1077. Possible strings include: C<yum>, C<up2date>,
  1078. C<apt> (for all Debian derivatives),
  1079. C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>.
  1080. Future versions of libguestfs may return other strings.
  1081. Please read L<guestfs(3)/INSPECTION> for more details." };
  1082. { defaults with
  1083. name = "inspect_list_applications";
  1084. style = RStructList ("applications", "application"), [Device "root"], [];
  1085. shortdesc = "get list of applications installed in the operating system";
  1086. longdesc = "\
  1087. Return the list of applications installed in the operating system.
  1088. I<Note:> This call works differently from other parts of the
  1089. inspection API. You have to call C<guestfs_inspect_os>, then
  1090. C<guestfs_inspect_get_mountpoints>, then mount up the disks,
  1091. before calling this. Listing applications is a significantly
  1092. more difficult operation which requires access to the full
  1093. filesystem. Also note that unlike the other
  1094. C<guestfs_inspect_get_*> calls which are just returning
  1095. data cached in the libguestfs handle, this call actually reads
  1096. parts of the mounted filesystems during the call.
  1097. This returns an empty list if the inspection code was not able
  1098. to determine the list of applications.
  1099. The application structure contains the following fields:
  1100. =over 4
  1101. =item C<app_name>
  1102. The name of the application. For Red Hat-derived and Debian-derived
  1103. Linux guests, this is the package name.
  1104. =item C<app_display_name>
  1105. The display name of the application, sometimes localized to the
  1106. install language of the guest operating system.
  1107. If unavailable this is returned as an empty string C<\"\">.
  1108. Callers needing to display something can use C<app_name> instead.
  1109. =item C<app_epoch>
  1110. For package managers which use epochs, this contains the epoch of
  1111. the package (an integer). If unavailable, this is returned as C<0>.
  1112. =item C<app_version>
  1113. The version string of the application or package. If unavailable
  1114. this is returned as an empty string C<\"\">.
  1115. =item C<app_release>
  1116. The release string of the application or package, for package
  1117. managers that use this. If unavailable this is returned as an
  1118. empty string C<\"\">.
  1119. =item C<app_install_path>
  1120. The installation path of the application (on operating systems
  1121. such as Windows which use installation paths). This path is
  1122. in the format used by the guest operating system, it is not
  1123. a libguestfs path.
  1124. If unavailable this is returned as an empty string C<\"\">.
  1125. =item C<app_trans_path>
  1126. The install path translated into a libguestfs path.
  1127. If unavailable this is returned as an empty string C<\"\">.
  1128. =item C<app_publisher>
  1129. The name of the publisher of the application, for package
  1130. managers that use this. If unavailable this is returned
  1131. as an empty string C<\"\">.
  1132. =item C<app_url>
  1133. The URL (eg. upstream URL) of the application.
  1134. If unavailable this is returned as an empty string C<\"\">.
  1135. =item C<app_source_package>
  1136. For packaging systems which support this, the name of the source
  1137. package. If unavailable this is returned as an empty string C<\"\">.
  1138. =item C<app_summary>
  1139. A short (usually one line) description of the application or package.
  1140. If unavailable this is returned as an empty string C<\"\">.
  1141. =item C<app_description>
  1142. A longer description of the application or package.
  1143. If unavailable this is returned as an empty string C<\"\">.
  1144. =back
  1145. Please read L<guestfs(3)/INSPECTION> for more details." };
  1146. { defaults with
  1147. name = "inspect_get_hostname";
  1148. style = RString "hostname", [Device "root"], [];
  1149. shortdesc = "get hostname of the operating system";
  1150. longdesc = "\
  1151. This function returns the hostname of the operating system
  1152. as found by inspection of the guest's configuration files.
  1153. If the hostname could not be determined, then the
  1154. string C<unknown> is returned.
  1155. Please read L<guestfs(3)/INSPECTION> for more details." };
  1156. { defaults with
  1157. name = "inspect_get_format";
  1158. style = RString "format", [Device "root"], [];
  1159. shortdesc = "get format of inspected operating system";
  1160. longdesc = "\
  1161. This returns the format of the inspected operating system. You
  1162. can use it to detect install images, live CDs and similar.
  1163. Currently defined formats are:
  1164. =over 4
  1165. =item \"installed\"
  1166. This is an installed operating system.
  1167. =item \"installer\"
  1168. The disk image being inspected is not an installed operating system,
  1169. but a I<bootable> install disk, live CD, or similar.
  1170. =item \"unknown\"
  1171. The format of this disk image is not known.
  1172. =back
  1173. Future versions of libguestfs may return other strings here.
  1174. The caller should be prepared to handle any string.
  1175. Please read L<guestfs(3)/INSPECTION> for more details." };
  1176. { defaults with
  1177. name = "inspect_is_live";
  1178. style = RBool "live", [Device "root"], [];
  1179. shortdesc = "get live flag for install disk";
  1180. longdesc = "\
  1181. If C<guestfs_inspect_get_format> returns C<installer> (this
  1182. is an install disk), then this returns true if a live image
  1183. was detected on the disk.
  1184. Please read L<guestfs(3)/INSPECTION> for more details." };
  1185. { defaults with
  1186. name = "inspect_is_netinst";
  1187. style = RBool "netinst", [Device "root"], [];
  1188. shortdesc = "get netinst (network installer) flag for install disk";
  1189. longdesc = "\
  1190. If C<guestfs_inspect_get_format> returns C<installer> (this
  1191. is an install disk), then this returns true if the disk is
  1192. a network installer, ie. not a self-contained install CD but
  1193. one which is likely to require network access to complete
  1194. the install.
  1195. Please read L<guestfs(3)/INSPECTION> for more details." };
  1196. { defaults with
  1197. name = "inspect_is_multipart";
  1198. style = RBool "multipart", [Device "root"], [];
  1199. shortdesc = "get multipart flag for install disk";
  1200. longdesc = "\
  1201. If C<guestfs_inspect_get_format> returns C<installer> (this
  1202. is an install disk), then this returns true if the disk is
  1203. part of a set.
  1204. Please read L<guestfs(3)/INSPECTION> for more details." };
  1205. { defaults with
  1206. name = "set_attach_method";
  1207. style = RErr, [String "attachmethod"], [];
  1208. fish_alias = ["attach-method"]; config_only = true;
  1209. shortdesc = "set the attach method";
  1210. longdesc = "\
  1211. Set the method that libguestfs uses to connect to the back end
  1212. guestfsd daemon. Possible methods are:
  1213. =over 4
  1214. =item C<appliance>
  1215. Launch an appliance and connect to it. This is the ordinary method
  1216. and the default.
  1217. =item C<unix:I<path>>
  1218. Connect to the Unix domain socket I<path>.
  1219. This method lets you connect to an existing daemon or (using
  1220. virtio-serial) to a live guest. For more information, see
  1221. L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>.
  1222. =back" };
  1223. { def

Large files files are truncated, but you can click here to view the full file