1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.10.2\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-04-24 09:52+0200\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3 ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35 ../tools/virt-list-filesystems.pl:30 ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
26 #: ../src/guestfs.pod:5
27 msgid "guestfs - Library for accessing and modifying virtual machine images"
31 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7 ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39 ../tools/virt-list-filesystems.pl:34 ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
36 #: ../src/guestfs.pod:9
39 " #include <guestfs.h>\n"
44 #: ../src/guestfs.pod:11
47 " guestfs_h *g = guestfs_create ();\n"
48 " guestfs_add_drive (g, \"guest.img\");\n"
49 " guestfs_launch (g);\n"
50 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
51 " guestfs_touch (g, \"/hello\");\n"
52 " guestfs_umount (g, \"/\");\n"
53 " guestfs_close (g);\n"
58 #: ../src/guestfs.pod:19
61 " cc prog.c -o prog -lguestfs\n"
63 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
68 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30 ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20 ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63 ../tools/virt-list-filesystems.pl:40 ../tools/virt-tar.pl:77 ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
73 #: ../src/guestfs.pod:25
75 "Libguestfs is a library for accessing and modifying guest disk images. "
76 "Amongst the things this is good for: making batch configuration changes to "
77 "guests, getting disk used/free statistics (see also: virt-df), migrating "
78 "between virtualization systems (see also: virt-p2v), performing partial "
79 "backups, performing partial guest clones, cloning guests and changing "
80 "registry/UUID/hostname info, and much else besides."
84 #: ../src/guestfs.pod:33
86 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
87 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
88 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
93 #: ../src/guestfs.pod:38
95 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
96 "what filesystem is in each LV, etc.). It can also run commands in the "
97 "context of the guest. Also you can access filesystems over FUSE."
101 #: ../src/guestfs.pod:43
103 "Libguestfs is a library that can be linked with C and C++ management "
104 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
105 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
110 #: ../src/guestfs.pod:48
112 "You don't need to be root to use libguestfs, although obviously you do need "
113 "enough permissions to access the disk images."
117 #: ../src/guestfs.pod:51
119 "Libguestfs is a large API because it can do many things. For a gentle "
120 "introduction, please read the L</API OVERVIEW> section next."
124 #: ../src/guestfs.pod:54
126 "There are also some example programs in the L<guestfs-examples(3)> manual "
131 #: ../src/guestfs.pod:57
136 #: ../src/guestfs.pod:59
138 "This section provides a gentler overview of the libguestfs API. We also try "
139 "to group API calls together, where that may not be obvious from reading "
140 "about the individual calls in the main section of this manual."
144 #: ../src/guestfs.pod:64
149 #: ../src/guestfs.pod:66
151 "Before you can use libguestfs calls, you have to create a handle. Then you "
152 "must add at least one disk image to the handle, followed by launching the "
153 "handle, then performing whatever operations you want, and finally closing "
154 "the handle. By convention we use the single letter C<g> for the name of the "
155 "handle variable, although of course you can use any name you want."
159 #: ../src/guestfs.pod:73
160 msgid "The general structure of all libguestfs-using programs looks like this:"
164 #: ../src/guestfs.pod:76
167 " guestfs_h *g = guestfs_create ();\n"
172 #: ../src/guestfs.pod:78
175 " /* Call guestfs_add_drive additional times if there are\n"
176 " * multiple disk images.\n"
178 " guestfs_add_drive (g, \"guest.img\");\n"
183 #: ../src/guestfs.pod:83
186 " /* Most manipulation calls won't work until you've launched\n"
187 " * the handle 'g'. You have to do this _after_ adding drives\n"
188 " * and _before_ other commands.\n"
190 " guestfs_launch (g);\n"
195 #: ../src/guestfs.pod:89
198 " /* Now you can examine what partitions, LVs etc are available.\n"
200 " char **partitions = guestfs_list_partitions (g);\n"
201 " char **logvols = guestfs_lvs (g);\n"
206 #: ../src/guestfs.pod:94
209 " /* To access a filesystem in the image, you must mount it.\n"
211 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
216 #: ../src/guestfs.pod:98
219 " /* Now you can perform filesystem actions on the guest\n"
222 " guestfs_touch (g, \"/hello\");\n"
227 #: ../src/guestfs.pod:103
230 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
231 " * it is done automatically when you close the handle. See\n"
232 " * discussion of autosync in this page.\n"
234 " guestfs_sync (g);\n"
239 #: ../src/guestfs.pod:109
242 " /* Close the handle 'g'. */\n"
243 " guestfs_close (g);\n"
248 #: ../src/guestfs.pod:112
250 "The code above doesn't include any error checking. In real code you should "
251 "check return values carefully for errors. In general all functions that "
252 "return integers return C<-1> on error, and all functions that return "
253 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
254 "how to handle errors, and consult the documentation for each function call "
255 "below to see precisely how they return error indications. See "
256 "L<guestfs-examples(3)> for fully worked examples."
260 #: ../src/guestfs.pod:121
265 #: ../src/guestfs.pod:123
267 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
268 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
269 "actual block device, or simply an empty file of zeroes that you have created "
270 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
275 #: ../src/guestfs.pod:129
277 "The call you should use in modern code for adding drives is "
278 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
279 "specifying that the format is raw, do:"
283 #: ../src/guestfs.pod:133
286 " guestfs_add_drive_opts (g, filename,\n"
287 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
293 #: ../src/guestfs.pod:137
294 msgid "You can add a disk read-only using:"
298 #: ../src/guestfs.pod:139
301 " guestfs_add_drive_opts (g, filename,\n"
302 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
303 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
309 #: ../src/guestfs.pod:144
311 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
312 "libguestfs won't modify the file."
316 #: ../src/guestfs.pod:147
318 "Be extremely cautious if the disk image is in use, eg. if it is being used "
319 "by a virtual machine. Adding it read-write will almost certainly cause disk "
320 "corruption, but adding it read-only is safe."
324 #: ../src/guestfs.pod:151
326 "You must add at least one disk image, and you may add multiple disk images. "
327 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
328 "first one you added), C</dev/sdb> (for the second one you added), etc."
332 #: ../src/guestfs.pod:156
334 "Once L</guestfs_launch> has been called you cannot add any more images. You "
335 "can call L</guestfs_list_devices> to get a list of the device names, in the "
336 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
340 #: ../src/guestfs.pod:161
345 #: ../src/guestfs.pod:163
347 "Before you can read or write files, create directories and so on in a disk "
348 "image that contains filesystems, you have to mount those filesystems using "
349 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
350 "a disk image contains (for example) one partition with a filesystem on that "
351 "partition, then you can mount it directly:"
355 #: ../src/guestfs.pod:170
358 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
363 #: ../src/guestfs.pod:172
365 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
366 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
367 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
368 "that these are libguestfs virtual devices, and are nothing to do with host "
373 #: ../src/guestfs.pod:178
375 "If you are given a disk image and you don't know what it contains then you "
376 "have to find out. Libguestfs can do that too: use "
377 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
378 "and LVs, and either try mounting each to see what is mountable, or else "
379 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
380 "filesystems, use L</guestfs_list_filesystems>."
384 #: ../src/guestfs.pod:186
386 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
387 "L</INSPECTION> below). But you might find it easier to look at higher level "
388 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
392 #: ../src/guestfs.pod:191
394 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
395 "several other variations of the C<guestfs_mount_*> call."
399 #: ../src/guestfs.pod:194
400 msgid "FILESYSTEM ACCESS AND MODIFICATION"
404 #: ../src/guestfs.pod:196
406 "The majority of the libguestfs API consists of fairly low-level calls for "
407 "accessing and modifying the files, directories, symlinks etc on mounted "
408 "filesystems. There are over a hundred such calls which you can find listed "
409 "in detail below in this man page, and we don't even pretend to cover them "
410 "all in this overview."
414 #: ../src/guestfs.pod:202
416 "Specify filenames as full paths, starting with C<\"/\"> and including the "
421 #: ../src/guestfs.pod:205
423 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
424 "the file called C<\"etc/passwd\"> then you could do:"
428 #: ../src/guestfs.pod:208
431 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
436 #: ../src/guestfs.pod:210
438 "This would return C<data> as a newly allocated buffer containing the full "
439 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
440 "or C<NULL> if there was an error."
444 #: ../src/guestfs.pod:214
446 "As another example, to create a top-level directory on that filesystem "
447 "called C<\"var\"> you would do:"
451 #: ../src/guestfs.pod:217
454 " guestfs_mkdir (g, \"/var\");\n"
459 #: ../src/guestfs.pod:219
460 msgid "To create a symlink you could do:"
464 #: ../src/guestfs.pod:221
467 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
468 " \"/etc/rc3.d/S30portmap\");\n"
473 #: ../src/guestfs.pod:224
475 "Libguestfs will reject attempts to use relative paths and there is no "
476 "concept of a current working directory."
480 #: ../src/guestfs.pod:227
482 "Libguestfs can return errors in many situations: for example if the "
483 "filesystem isn't writable, or if a file or directory that you requested "
484 "doesn't exist. If you are using the C API (documented here) you have to "
485 "check for those error conditions after each call. (Other language bindings "
486 "turn these errors into exceptions)."
490 #: ../src/guestfs.pod:233
492 "File writes are affected by the per-handle umask, set by calling "
493 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
497 #: ../src/guestfs.pod:236
502 #: ../src/guestfs.pod:238
504 "Libguestfs contains API calls to read, create and modify partition tables on "
509 #: ../src/guestfs.pod:241
511 "In the common case where you want to create a single partition covering the "
512 "whole disk, you should use the L</guestfs_part_disk> call:"
516 #: ../src/guestfs.pod:245
519 " const char *parttype = \"mbr\";\n"
520 " if (disk_is_larger_than_2TB)\n"
521 " parttype = \"gpt\";\n"
522 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
527 #: ../src/guestfs.pod:250
529 "Obviously this effectively wipes anything that was on that disk image "
534 #: ../src/guestfs.pod:253
539 #: ../src/guestfs.pod:255
541 "Libguestfs provides access to a large part of the LVM2 API, such as "
542 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
543 "unless you familiarize yourself with the concepts of physical volumes, "
544 "volume groups and logical volumes."
548 #: ../src/guestfs.pod:260
550 "This author strongly recommends reading the LVM HOWTO, online at "
551 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
555 #: ../src/guestfs.pod:263
560 #: ../src/guestfs.pod:265
562 "Use L</guestfs_cat> to download small, text only files. This call is "
563 "limited to files which are less than 2 MB and which cannot contain any ASCII "
564 "NUL (C<\\0>) characters. However the API is very simple to use."
568 #: ../src/guestfs.pod:269
570 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
571 "bit data, since it returns a (pointer, size) pair. However it is still "
572 "limited to \"small\" files, less than 2 MB."
576 #: ../src/guestfs.pod:273
578 "L</guestfs_download> can be used to download any file, with no limits on "
579 "content or size (even files larger than 4 GB)."
583 #: ../src/guestfs.pod:276
584 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
588 #: ../src/guestfs.pod:279
593 #: ../src/guestfs.pod:281
595 "It's often the case that you want to write a file or files to the disk "
600 #: ../src/guestfs.pod:284
602 "To write a small file with fixed content, use L</guestfs_write>. To create "
603 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
604 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
605 "variety of other functions for creating test files, for example "
606 "L</guestfs_fill> and L</guestfs_fill_pattern>."
610 #: ../src/guestfs.pod:290
612 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
613 "file content or size (even files larger than 4 GB)."
617 #: ../src/guestfs.pod:293
618 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
622 #: ../src/guestfs.pod:295
624 "However the fastest way to upload I<large numbers of arbitrary files> is to "
625 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
626 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
627 "the drive in a predictable way (eg. adding it last after all other drives) "
628 "then you can get the device name from L</guestfs_list_devices> and mount it "
629 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
630 "sometimes non-portable between kernel versions, and they don't support "
631 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
632 "using a label or UUID, use an ISO image instead."
636 #: ../src/guestfs.pod:306
641 #: ../src/guestfs.pod:308
643 "There are various different commands for copying between files and devices "
644 "and in and out of the guest filesystem. These are summarised in the table "
649 #: ../src/guestfs.pod:314
650 msgid "B<file> to B<file>"
654 #: ../src/guestfs.pod:316
656 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
657 "directories recursively."
661 #: ../src/guestfs.pod:319
662 msgid "B<file or device> to B<file or device>"
666 #: ../src/guestfs.pod:321
668 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
669 "devices in the guest."
673 #: ../src/guestfs.pod:324
674 msgid "Example: duplicate the contents of an LV:"
678 #: ../src/guestfs.pod:326
681 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
686 #: ../src/guestfs.pod:328
688 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
689 "(C</dev/VG/Original>). To copy less than the whole source device, use "
690 "L</guestfs_copy_size>."
694 #: ../src/guestfs.pod:332
695 msgid "B<file on the host> to B<file or device>"
699 #: ../src/guestfs.pod:334
700 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
704 #: ../src/guestfs.pod:336
705 msgid "B<file or device> to B<file on the host>"
709 #: ../src/guestfs.pod:338
710 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
714 #: ../src/guestfs.pod:342
715 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
719 #: ../src/guestfs.pod:344
721 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
722 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
723 "appears you can only upload and download to files. However many Un*x-like "
724 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
725 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
726 "stderr, and arbitrary file descriptor N."
730 #: ../src/guestfs.pod:352
731 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
735 #: ../src/guestfs.pod:355
738 " guestfs_download (g, filename, \"/dev/stdout\");\n"
743 #: ../src/guestfs.pod:357
744 msgid "and you can write tar output to a pipe C<fd> by doing:"
748 #: ../src/guestfs.pod:359
752 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
753 " guestfs_tar_out (g, \"/\", devfd);\n"
758 #: ../src/guestfs.pod:363
759 msgid "LISTING FILES"
763 #: ../src/guestfs.pod:365
765 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
766 "L<guestfish(1)>-equivalent command C<ll>)."
770 #: ../src/guestfs.pod:368
772 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
773 "programs, as a flat list of strings."
777 #: ../src/guestfs.pod:371
779 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
780 "directory, plus additional information about each one. It is more "
781 "equivalent to using the L<readdir(3)> call on a local filesystem."
785 #: ../src/guestfs.pod:375
787 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
792 #: ../src/guestfs.pod:378
793 msgid "RUNNING COMMANDS"
797 #: ../src/guestfs.pod:380
799 "Although libguestfs is primarily an API for manipulating files inside guest "
800 "images, we also provide some limited facilities for running commands inside "
805 #: ../src/guestfs.pod:384
806 msgid "There are many limitations to this:"
810 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1087 ../src/guestfs.pod:1091 ../src/guestfs.pod:1095 ../src/guestfs.pod:1100 ../src/guestfs.pod:1108 ../src/guestfs.pod:1127 ../src/guestfs.pod:1135 ../src/guestfs.pod:1157 ../src/guestfs.pod:1161 ../src/guestfs.pod:1165 ../src/guestfs.pod:1169 ../src/guestfs.pod:1173 ../src/guestfs.pod:1177 ../src/guestfs.pod:1659 ../src/guestfs.pod:1664 ../src/guestfs.pod:1668 ../src/guestfs.pod:1769 ../src/guestfs.pod:1774 ../src/guestfs.pod:1778 ../src/guestfs.pod:1788 ../src/guestfs.pod:2022 ../src/guestfs.pod:2027 ../src/guestfs.pod:2033 ../src/guestfs.pod:2041 ../src/guestfs.pod:2395 ../src/guestfs.pod:2401 ../src/guestfs.pod:2406 ../src/guestfs.pod:2412 ../src/guestfs.pod:2877 ../src/guestfs.pod:2881 ../src/guestfs.pod:2885 ../src/guestfs.pod:2889 ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:577 ../src/guestfs-actions.pod:585 ../src/guestfs-actions.pod:592 ../src/guestfs-actions.pod:599 ../src/guestfs-actions.pod:1600 ../src/guestfs-actions.pod:1604 ../src/guestfs-actions.pod:1608 ../src/guestfs-actions.pod:1612 ../src/guestfs-actions.pod:1620 ../src/guestfs-actions.pod:1624 ../src/guestfs-actions.pod:1628 ../src/guestfs-actions.pod:1638 ../src/guestfs-actions.pod:1642 ../src/guestfs-actions.pod:1646 ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1788 ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:1859 ../src/guestfs-actions.pod:1863 ../src/guestfs-actions.pod:1868 ../fish/guestfish.pod:443 ../fish/guestfish.pod:447 ../fish/guestfish.pod:451 ../fish/guestfish.pod:455 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:380 ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:402 ../fish/guestfish-actions.pod:1072 ../fish/guestfish-actions.pod:1076 ../fish/guestfish-actions.pod:1080 ../fish/guestfish-actions.pod:1084 ../fish/guestfish-actions.pod:1092 ../fish/guestfish-actions.pod:1096 ../fish/guestfish-actions.pod:1100 ../fish/guestfish-actions.pod:1110 ../fish/guestfish-actions.pod:1114 ../fish/guestfish-actions.pod:1118 ../fish/guestfish-actions.pod:1208 ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1222 ../fish/guestfish-actions.pod:1264 ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1273 ../tools/virt-edit.pl:351 ../tools/virt-edit.pl:356 ../tools/virt-edit.pl:361 ../tools/virt-edit.pl:372 ../tools/virt-edit.pl:376 ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542 ../tools/virt-win-reg.pl:548
815 #: ../src/guestfs.pod:390
817 "The kernel version that the command runs under will be different from what "
822 #: ../src/guestfs.pod:395
824 "If the command needs to communicate with daemons, then most likely they "
829 #: ../src/guestfs.pod:400
830 msgid "The command will be running in limited memory."
834 #: ../src/guestfs.pod:404
836 "The network may not be available unless you enable it (see "
837 "L</guestfs_set_network>)."
841 #: ../src/guestfs.pod:409
842 msgid "Only supports Linux guests (not Windows, BSD, etc)."
846 #: ../src/guestfs.pod:413
847 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
851 #: ../src/guestfs.pod:418
853 "For SELinux guests, you may need to enable SELinux and load policy first. "
854 "See L</SELINUX> in this manpage."
858 #: ../src/guestfs.pod:423
860 "I<Security:> It is not safe to run commands from untrusted, possibly "
861 "malicious guests. These commands may attempt to exploit your program by "
862 "sending unexpected output. They could also try to exploit the Linux kernel "
863 "or qemu provided by the libguestfs appliance. They could use the network "
864 "provided by the libguestfs appliance to bypass ordinary network partitions "
865 "and firewalls. They could use the elevated privileges or different SELinux "
866 "context of your program to their advantage."
870 #: ../src/guestfs.pod:432
872 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
873 "(a script which runs when the guest next boots normally), and to have this "
874 "script run the commands you want in the normal context of the running guest, "
875 "network security and so on. For information about other security issues, "
880 #: ../src/guestfs.pod:440
882 "The two main API calls to run commands are L</guestfs_command> and "
883 "L</guestfs_sh> (there are also variations)."
887 #: ../src/guestfs.pod:443
889 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
890 "shell globs, redirections, etc will work."
894 #: ../src/guestfs.pod:446
895 msgid "CONFIGURATION FILES"
899 #: ../src/guestfs.pod:448
901 "To read and write configuration files in Linux guest filesystems, we "
902 "strongly recommend using Augeas. For example, Augeas understands how to "
903 "read and write, say, a Linux shadow password file or X.org configuration "
904 "file, and so avoids you having to write that code."
908 #: ../src/guestfs.pod:453
910 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
911 "document Augeas itself here because there is excellent documentation on the "
912 "L<http://augeas.net/> website."
916 #: ../src/guestfs.pod:457
918 "If you don't want to use Augeas (you fool!) then try calling "
919 "L</guestfs_read_lines> to get the file as a list of lines which you can "
924 #: ../src/guestfs.pod:461
929 #: ../src/guestfs.pod:463
931 "We support SELinux guests. To ensure that labeling happens correctly in "
932 "SELinux guests, you need to enable SELinux and load the guest's policy:"
936 #: ../src/guestfs.pod:469 ../src/guestfs.pod:1280 ../src/guestfs.pod:1411 ../src/guestfs.pod:2440
941 #: ../src/guestfs.pod:471
942 msgid "Before launching, do:"
946 #: ../src/guestfs.pod:473
949 " guestfs_set_selinux (g, 1);\n"
954 #: ../src/guestfs.pod:475 ../src/guestfs.pod:1284 ../src/guestfs.pod:1415 ../src/guestfs.pod:2465
959 #: ../src/guestfs.pod:477
961 "After mounting the guest's filesystem(s), load the policy. This is best "
962 "done by running the L<load_policy(8)> command in the guest itself:"
966 #: ../src/guestfs.pod:481
969 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
974 #: ../src/guestfs.pod:483
976 "(Older versions of C<load_policy> require you to specify the name of the "
981 #: ../src/guestfs.pod:486 ../src/guestfs.pod:1421
986 #: ../src/guestfs.pod:488
988 "Optionally, set the security context for the API. The correct security "
989 "context to use can only be known by inspecting the guest. As an example:"
993 #: ../src/guestfs.pod:492
996 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1001 #: ../src/guestfs.pod:496
1002 msgid "This will work for running commands and editing existing files."
1006 #: ../src/guestfs.pod:498
1008 "When new files are created, you may need to label them explicitly, for "
1009 "example by running the external command C<restorecon pathname>."
1013 #: ../src/guestfs.pod:502
1018 #: ../src/guestfs.pod:504
1020 "Certain calls are affected by the current file mode creation mask (the "
1021 "\"umask\"). In particular ones which create files or directories, such as "
1022 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1023 "either the default mode that the file is created with or modifies the mode "
1028 #: ../src/guestfs.pod:510
1030 "The default umask is C<022>, so files are created with modes such as C<0644> "
1031 "and directories with C<0755>."
1035 #: ../src/guestfs.pod:513
1037 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1038 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
1039 "L</guestfs_chmod> after creating each file or directory."
1043 #: ../src/guestfs.pod:517
1044 msgid "For more information about umask, see L<umask(2)>."
1048 #: ../src/guestfs.pod:519 ../fish/guestfish.pod:765
1049 msgid "ENCRYPTED DISKS"
1053 #: ../src/guestfs.pod:521
1055 "Libguestfs allows you to access Linux guests which have been encrypted using "
1056 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1057 "standard. This includes nearly all whole disk encryption systems used by "
1058 "modern Linux guests."
1062 #: ../src/guestfs.pod:527
1064 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1065 "returns the string C<crypto_LUKS>)."
1069 #: ../src/guestfs.pod:530
1071 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1072 "will require the passphrase!"
1076 #: ../src/guestfs.pod:533
1078 "Opening a LUKS device creates a new device mapper device called "
1079 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
1080 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
1081 "decrypted from and encrypted to the underlying block device respectively."
1085 #: ../src/guestfs.pod:539
1087 "LVM volume groups on the device can be made visible by calling "
1088 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
1089 "volume(s) can now be mounted in the usual way."
1093 #: ../src/guestfs.pod:543
1095 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1096 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1097 "[\"/dev/VG\"])>. Then close the mapper device by calling "
1098 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1099 "underlying encrypted block device)."
1103 #: ../src/guestfs.pod:550
1108 #: ../src/guestfs.pod:552
1110 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1111 "contains operating systems, an install CD or a live CD. (These APIs used to "
1112 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
1113 "version 1.5.3 the most frequently used part of this library has been "
1114 "rewritten in C and moved into the core code)."
1118 #: ../src/guestfs.pod:559
1120 "Add all disks belonging to the unknown virtual machine and call "
1121 "L</guestfs_launch> in the usual way."
1125 #: ../src/guestfs.pod:562
1127 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1128 "and certain heuristics, and returns a list of operating systems that were "
1129 "found. An empty list means none were found. A single element is the root "
1130 "filesystem of the operating system. For dual- or multi-boot guests, "
1131 "multiple roots can be returned, each one corresponding to a separate "
1132 "operating system. (Multi-boot virtual machines are extremely rare in the "
1133 "world of virtualization, but since this scenario can happen, we have built "
1134 "libguestfs to deal with it.)"
1138 #: ../src/guestfs.pod:571
1140 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1141 "to get additional details about that operating system. For example, call "
1142 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1143 "Windows and Linux-based operating systems respectively."
1147 #: ../src/guestfs.pod:577
1149 "Un*x-like and Linux-based operating systems usually consist of several "
1150 "filesystems which are mounted at boot time (for example, a separate boot "
1151 "partition mounted on C</boot>). The inspection rules are able to detect how "
1152 "filesystems correspond to mount points. Call "
1153 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1154 "hash table like this example:"
1158 #: ../src/guestfs.pod:584
1161 " /boot => /dev/sda1\n"
1162 " / => /dev/vg_guest/lv_root\n"
1163 " /usr => /dev/vg_guest/lv_usr\n"
1168 #: ../src/guestfs.pod:588
1170 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1171 "filesystems as suggested."
1175 #: ../src/guestfs.pod:591
1177 "Be careful to mount filesystems in the right order (eg. C</> before "
1178 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
1183 #: ../src/guestfs.pod:595
1185 "Inspection currently only works for some common operating systems. "
1186 "Contributors are welcome to send patches for other operating systems that we "
1187 "currently cannot detect."
1191 #: ../src/guestfs.pod:599
1193 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1194 "for more details. The L</guestfs_inspect_os> function just ignores any "
1195 "encrypted devices."
1199 #: ../src/guestfs.pod:603
1201 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1202 "inspection and caches the results in the guest handle. Subsequent calls to "
1203 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
1204 "re-read the disks. If you change the content of the guest disks, you can "
1205 "redo inspection by calling L</guestfs_inspect_os> again. "
1206 "(L</guestfs_inspect_list_applications> works a little differently from the "
1207 "other calls and does read the disks. See documentation for that function "
1212 #: ../src/guestfs.pod:612
1213 msgid "INSPECTING INSTALL DISKS"
1217 #: ../src/guestfs.pod:614
1219 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
1224 #: ../src/guestfs.pod:617
1226 "Call L</guestfs_inspect_get_format> to return the format of the operating "
1227 "system, which currently can be C<installed> (a regular operating system) or "
1228 "C<installer> (some sort of install disk)."
1232 #: ../src/guestfs.pod:621
1234 "Further information is available about the operating system that can be "
1235 "installed using the regular inspection APIs like "
1236 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
1241 #: ../src/guestfs.pod:626
1243 "Some additional information specific to installer disks is also available "
1244 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
1245 "L</guestfs_inspect_is_multipart> calls."
1249 #: ../src/guestfs.pod:631
1250 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1254 #: ../src/guestfs.pod:633
1256 "Libguestfs can mount NTFS partitions. It does this using the "
1257 "L<http://www.ntfs-3g.org/> driver."
1261 #: ../src/guestfs.pod:636
1262 msgid "DRIVE LETTERS AND PATHS"
1266 #: ../src/guestfs.pod:638
1268 "DOS and Windows still use drive letters, and the filesystems are always "
1269 "treated as case insensitive by Windows itself, and therefore you might find "
1270 "a Windows configuration file referring to a path like "
1271 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
1272 "that directory might be referred to as C</WINDOWS/System32>."
1276 #: ../src/guestfs.pod:644
1278 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
1279 "L</guestfs_inspect_get_drive_mappings>)"
1283 #: ../src/guestfs.pod:647
1285 "Dealing with separator characters (backslash vs forward slash) is outside "
1286 "the scope of libguestfs, but usually a simple character replacement will "
1291 #: ../src/guestfs.pod:651
1293 "To resolve the case insensitivity of paths, call "
1294 "L</guestfs_case_sensitive_path>."
1298 #: ../src/guestfs.pod:654
1299 msgid "ACCESSING THE WINDOWS REGISTRY"
1303 #: ../src/guestfs.pod:656
1305 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1306 "files, through the library C<hivex> which is part of the libguestfs project "
1307 "although ships as a separate tarball. You have to locate and download the "
1308 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1309 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
1310 "L<virt-win-reg(1)> for more help on this issue."
1314 #: ../src/guestfs.pod:664
1315 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1319 #: ../src/guestfs.pod:666
1321 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1322 "provide something which looks like a Linux symlink. The way it tries to do "
1323 "the rewriting is described here:"
1327 #: ../src/guestfs.pod:670
1328 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
1332 #: ../src/guestfs.pod:672
1334 "The essential problem is that ntfs-3g simply does not have enough "
1335 "information to do a correct job. NTFS links can contain drive letters and "
1336 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1337 "It is almost certainly the case that libguestfs callers should ignore what "
1338 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1342 #: ../src/guestfs.pod:679
1344 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
1345 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1346 "attribute, and read the raw reparse data from that (you can find the format "
1347 "documented in various places around the web)."
1351 #: ../src/guestfs.pod:684
1352 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1356 #: ../src/guestfs.pod:686
1358 "There are other useful extended attributes that can be read from ntfs-3g "
1359 "filesystems (using L</guestfs_getxattr>). See:"
1363 #: ../src/guestfs.pod:689
1364 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1368 #: ../src/guestfs.pod:691
1369 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1373 #: ../src/guestfs.pod:693
1375 "Although we don't want to discourage you from using the C API, we will "
1376 "mention here that the same API is also available in other languages."
1380 #: ../src/guestfs.pod:696
1382 "The API is broadly identical in all supported languages. This means that "
1383 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
1384 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
1385 "OCaml. In other words, a straightforward, predictable isomorphism between "
1390 #: ../src/guestfs.pod:702
1392 "Error messages are automatically transformed into exceptions if the language "
1397 #: ../src/guestfs.pod:705
1399 "We don't try to \"object orientify\" parts of the API in OO languages, "
1400 "although contributors are welcome to write higher level APIs above what we "
1401 "provide in their favourite languages if they wish."
1405 #: ../src/guestfs.pod:711
1410 #: ../src/guestfs.pod:713
1412 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1413 "identical to the C API. C++ classes and exceptions are not used."
1417 #: ../src/guestfs.pod:717
1422 #: ../src/guestfs.pod:719
1424 "The C# bindings are highly experimental. Please read the warnings at the "
1425 "top of C<csharp/Libguestfs.cs>."
1429 #: ../src/guestfs.pod:722
1434 #: ../src/guestfs.pod:724
1436 "This is the only language binding that is working but incomplete. Only "
1437 "calls which return simple integers have been bound in Haskell, and we are "
1438 "looking for help to complete this binding."
1442 #: ../src/guestfs.pod:728
1447 #: ../src/guestfs.pod:730
1449 "Full documentation is contained in the Javadoc which is distributed with "
1454 #: ../src/guestfs.pod:733
1459 #: ../src/guestfs.pod:735
1460 msgid "See L<guestfs-ocaml(3)>."
1464 #: ../src/guestfs.pod:737
1469 #: ../src/guestfs.pod:739
1470 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
1474 #: ../src/guestfs.pod:741
1479 #: ../src/guestfs.pod:743
1481 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1482 "the php-libguestfs package for your distribution."
1486 #: ../src/guestfs.pod:746
1487 msgid "The PHP binding only works correctly on 64 bit machines."
1491 #: ../src/guestfs.pod:748
1496 #: ../src/guestfs.pod:750
1497 msgid "See L<guestfs-python(3)>."
1501 #: ../src/guestfs.pod:752
1506 #: ../src/guestfs.pod:754
1507 msgid "See L<guestfs-ruby(3)>."
1511 #: ../src/guestfs.pod:756
1512 msgid "B<shell scripts>"
1516 #: ../src/guestfs.pod:758
1517 msgid "See L<guestfish(1)>."
1521 #: ../src/guestfs.pod:762
1522 msgid "LIBGUESTFS GOTCHAS"
1526 #: ../src/guestfs.pod:764
1528 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1529 "system [...] that works in the way it is documented but is counterintuitive "
1530 "and almost invites mistakes.\""
1534 #: ../src/guestfs.pod:768
1536 "Since we developed libguestfs and the associated tools, there are several "
1537 "things we would have designed differently, but are now stuck with for "
1538 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1539 "release, you can expect these to change. Beware of them."
1543 #: ../src/guestfs.pod:776
1544 msgid "Autosync / forgetting to sync."
1548 #: ../src/guestfs.pod:778
1550 "When modifying a filesystem from C or another language, you B<must> unmount "
1551 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1552 "libguestfs handle. You can also call:"
1556 #: ../src/guestfs.pod:782
1559 " guestfs_set_autosync (g, 1);\n"
1564 #: ../src/guestfs.pod:784
1566 "to have the unmount/sync done automatically for you when the handle 'g' is "
1567 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
1572 #: ../src/guestfs.pod:788
1574 "If you forget to do this, then it is entirely possible that your changes "
1575 "won't be written out, or will be partially written, or (very rarely) that "
1576 "you'll get disk corruption."
1580 #: ../src/guestfs.pod:792
1582 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1583 "guestfish scripts that forget to sync will work just fine, which can make "
1584 "this very puzzling if you are trying to debug a problem."
1588 #: ../src/guestfs.pod:796
1590 "Update: Autosync is enabled by default for all API users starting from "
1591 "libguestfs 1.5.24."
1595 #: ../src/guestfs.pod:799
1596 msgid "Mount option C<-o sync> should not be the default."
1600 #: ../src/guestfs.pod:801
1602 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1603 "However C<-o sync> does not add any reliability benefit, but does have a "
1604 "very large performance impact."
1608 #: ../src/guestfs.pod:805
1610 "The work around is to use L</guestfs_mount_options> and set the mount "
1611 "options that you actually want to use."
1615 #: ../src/guestfs.pod:808
1616 msgid "Read-only should be the default."
1620 #: ../src/guestfs.pod:810
1622 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1623 "specify I<--rw> if you want to make changes to the image."
1627 #: ../src/guestfs.pod:813
1628 msgid "This would reduce the potential to corrupt live VM images."
1632 #: ../src/guestfs.pod:815
1634 "Note that many filesystems change the disk when you just mount and unmount, "
1635 "even if you didn't perform any writes. You need to use "
1636 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
1640 #: ../src/guestfs.pod:819
1641 msgid "guestfish command line is hard to use."
1645 #: ../src/guestfs.pod:821
1647 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1648 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1649 "exist, so it fails. In earlier versions of guestfish the error message was "
1650 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1651 "we should have used C<guestfish -c command> to run commands."
1655 #: ../src/guestfs.pod:828
1656 msgid "guestfish megabyte modifiers don't work right on all commands"
1660 #: ../src/guestfs.pod:830
1662 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1663 "other modifiers). What guestfish actually does is to multiply the number "
1664 "part by the modifier part and pass the result to the C API. However this "
1665 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1666 "expecting some other unit (eg. megabytes)."
1670 #: ../src/guestfs.pod:837
1671 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1675 #: ../src/guestfs.pod:839
1678 " lvcreate LV VG 100M\n"
1683 #: ../src/guestfs.pod:841
1685 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1686 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1687 "megabytes * megabytes) logical volume. The error message you get from this "
1688 "is also a little obscure."
1692 #: ../src/guestfs.pod:846
1694 "This could be fixed in the generator by specially marking parameters and "
1695 "return values which take bytes or other units."
1699 #: ../src/guestfs.pod:849
1700 msgid "Ambiguity between devices and paths"
1704 #: ../src/guestfs.pod:851
1706 "There is a subtle ambiguity in the API between a device name "
1707 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
1708 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1712 #: ../src/guestfs.pod:856
1714 "In the current API we usually resolve this ambiguity by having two separate "
1715 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1716 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1717 "detecting if the path supplied begins with C</dev/>."
1721 #: ../src/guestfs.pod:862
1723 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1724 "make paths/devices into structured names. One way to do this would be to "
1725 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1726 "aspect of grub. Another way would be to use a structured type, equivalent "
1727 "to this OCaml type:"
1731 #: ../src/guestfs.pod:868
1734 " type path = Path of string | Device of int | Partition of int * int\n"
1739 #: ../src/guestfs.pod:870
1740 msgid "which would allow you to pass arguments like:"
1744 #: ../src/guestfs.pod:872
1747 " Path \"/foo/bar\"\n"
1748 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1749 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1750 " Path \"/dev/sdb2\" (* not a device *)\n"
1755 #: ../src/guestfs.pod:877
1757 "As you can see there are still problems to resolve even with this "
1758 "representation. Also consider how it might work in guestfish."
1762 #: ../src/guestfs.pod:882
1763 msgid "PROTOCOL LIMITS"
1767 #: ../src/guestfs.pod:884
1769 "Internally libguestfs uses a message-based protocol to pass API calls and "
1770 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1771 "plenty more detail about this). The maximum message size used by the "
1772 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1773 "aware of this limit. The API calls which may be affected are individually "
1774 "documented, with a link back to this section of the documentation."
1778 #: ../src/guestfs.pod:892
1780 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1781 "a simple string. Because this string is at some point internally encoded as "
1782 "a message, the maximum size that it can return is slightly under 4 MB. If "
1783 "the requested file is larger than this then you will get an error."
1787 #: ../src/guestfs.pod:898
1789 "In order to transfer large files into and out of the guest filesystem, you "
1790 "need to use particular calls that support this. The sections L</UPLOADING> "
1791 "and L</DOWNLOADING> document how to do this."
1795 #: ../src/guestfs.pod:902
1797 "You might also consider mounting the disk image using our FUSE filesystem "
1798 "support (L<guestmount(1)>)."
1802 #: ../src/guestfs.pod:905
1803 msgid "KEYS AND PASSPHRASES"
1807 #: ../src/guestfs.pod:907
1809 "Certain libguestfs calls take a parameter that contains sensitive key "
1810 "material, passed in as a C string."
1814 #: ../src/guestfs.pod:910
1816 "In the future we would hope to change the libguestfs implementation so that "
1817 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1818 "swap. However this is I<not> done at the moment, because of the complexity "
1819 "of such an implementation."
1823 #: ../src/guestfs.pod:915
1825 "Therefore you should be aware that any key parameter you pass to libguestfs "
1826 "might end up being written out to the swap partition. If this is a concern, "
1827 "scrub the swap partition or don't use libguestfs on encrypted devices."
1831 #: ../src/guestfs.pod:920
1832 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1836 #: ../src/guestfs.pod:922
1838 "All high-level libguestfs actions are synchronous. If you want to use "
1839 "libguestfs asynchronously then you must create a thread."
1843 #: ../src/guestfs.pod:925
1845 "Only use the handle from a single thread. Either use the handle exclusively "
1846 "from one thread, or provide your own mutex so that two threads cannot issue "
1847 "calls on the same handle at the same time."
1851 #: ../src/guestfs.pod:929
1853 "See the graphical program guestfs-browser for one possible architecture for "
1854 "multithreaded programs using libvirt and libguestfs."
1858 #: ../src/guestfs.pod:932
1863 #: ../src/guestfs.pod:934
1865 "Libguestfs needs a supermin appliance, which it finds by looking along an "
1870 #: ../src/guestfs.pod:937
1872 "By default it looks for these in the directory C<$libdir/guestfs> "
1873 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1877 #: ../src/guestfs.pod:940
1879 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1880 "to change the directories that libguestfs will search in. The value is a "
1881 "colon-separated list of paths. The current directory is I<not> searched "
1882 "unless the path contains an empty element or C<.>. For example "
1883 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1884 "then C</usr/lib/guestfs>."
1888 #: ../src/guestfs.pod:947
1889 msgid "QEMU WRAPPERS"
1893 #: ../src/guestfs.pod:949
1895 "If you want to compile your own qemu, run qemu from a non-standard location, "
1896 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1901 #: ../src/guestfs.pod:953
1903 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1904 "last command in the shell script (so that qemu replaces the shell and "
1905 "becomes the direct child of the libguestfs-using program). If you don't do "
1906 "this, then the qemu process won't be cleaned up correctly."
1910 #: ../src/guestfs.pod:958
1912 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1917 #: ../src/guestfs.pod:961
1921 " qemudir=/home/rjones/d/qemu\n"
1922 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
1928 #: ../src/guestfs.pod:965
1930 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1931 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1936 #: ../src/guestfs.pod:969
1939 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1944 #: ../src/guestfs.pod:971
1946 "Note that libguestfs also calls qemu with the -help and -version options in "
1947 "order to determine features."
1951 #: ../src/guestfs.pod:974
1952 msgid "ATTACHING TO RUNNING DAEMONS"
1956 #: ../src/guestfs.pod:976
1958 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
1959 "babies. Use with caution."
1963 #: ../src/guestfs.pod:979
1965 "I<Note (2):> This section explains how to attach to a running daemon from a "
1966 "low level perspective. For most users, simply using virt tools such as "
1967 "L<guestfish(1)> with the I<--live> option will \"just work\"."
1971 #: ../src/guestfs.pod:983
1972 msgid "Using guestfs_set_attach_method"
1976 #: ../src/guestfs.pod:985
1978 "By calling L</guestfs_set_attach_method> you can change how the library "
1979 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
1980 "L</ARCHITECTURE> for some background)."
1984 #: ../src/guestfs.pod:989
1986 "The normal attach method is C<appliance>, where a small appliance is created "
1987 "containing the daemon, and then the library connects to this."
1991 #: ../src/guestfs.pod:992
1993 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
1994 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
1995 "daemon over the Unix domain socket."
1999 #: ../src/guestfs.pod:996
2001 "The normal use for this is to connect to a running virtual machine that "
2002 "contains a C<guestfsd> daemon, and send commands so you can read and write "
2003 "files inside the live virtual machine."
2007 #: ../src/guestfs.pod:1000
2008 msgid "Using guestfs_add_domain with live flag"
2012 #: ../src/guestfs.pod:1002
2014 "L</guestfs_add_domain> provides some help for getting the correct attach "
2015 "method. If you pass the C<live> option to this function, then (if the "
2016 "virtual machine is running) it will examine the libvirt XML looking for a "
2017 "virtio-serial channel to connect to:"
2021 #: ../src/guestfs.pod:1008
2028 " <channel type='unix'>\n"
2029 " <source mode='bind' path='/path/to/socket'/>\n"
2030 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
2039 #: ../src/guestfs.pod:1020
2041 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
2042 "method to C<unix:/path/to/socket>."
2046 #: ../src/guestfs.pod:1023
2048 "Some of the libguestfs tools (including guestfish) support a I<--live> "
2049 "option which is passed through to L</guestfs_add_domain> thus allowing you "
2050 "to attach to and modify live virtual machines."
2054 #: ../src/guestfs.pod:1027
2056 "The virtual machine needs to have been set up beforehand so that it has the "
2057 "virtio-serial channel and so that guestfsd is running inside it."
2061 #: ../src/guestfs.pod:1031
2062 msgid "ABI GUARANTEE"
2066 #: ../src/guestfs.pod:1033
2068 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2069 "actions as outlined in this section. Although we will deprecate some "
2070 "actions, for example if they get replaced by newer calls, we will keep the "
2071 "old actions forever. This allows you the developer to program in confidence "
2072 "against the libguestfs API."
2076 #: ../src/guestfs.pod:1039
2077 msgid "BLOCK DEVICE NAMING"
2081 #: ../src/guestfs.pod:1041
2083 "In the kernel there is now quite a profusion of schemata for naming block "
2084 "devices (in this context, by I<block device> I mean a physical or virtual "
2085 "hard drive). The original Linux IDE driver used names starting with "
2086 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
2087 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
2088 "replacement for the old IDE driver (particularly for SATA devices) those "
2089 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
2090 "machines with paravirtualized drivers. This has created several different "
2091 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
2096 #: ../src/guestfs.pod:1053
2098 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2099 "Linux kernel to access block devices. We can run a variety of appliances "
2100 "based on a variety of Linux kernels."
2104 #: ../src/guestfs.pod:1057
2106 "This causes a problem for libguestfs because many API calls use device or "
2107 "partition names. Working scripts and the recipe (example) scripts that we "
2108 "make available over the internet could fail if the naming scheme changes."
2112 #: ../src/guestfs.pod:1062
2114 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2115 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2116 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2117 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2121 #: ../src/guestfs.pod:1068
2123 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2124 "L</guestfs_list_partitions> and similar calls return the true names of the "
2125 "devices and partitions as known to the appliance."
2129 #: ../src/guestfs.pod:1073
2130 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2134 #: ../src/guestfs.pod:1075
2136 "Usually this translation is transparent. However in some (very rare) cases "
2137 "you may need to know the exact algorithm. Such cases include where you use "
2138 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
2139 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
2144 #: ../src/guestfs.pod:1081
2146 "The algorithm is applied only to I<parameters> which are known to be either "
2147 "device or partition names. Return values from functions such as "
2148 "L</guestfs_list_devices> are never changed."
2152 #: ../src/guestfs.pod:1089
2153 msgid "Is the string a parameter which is a device or partition name?"
2157 #: ../src/guestfs.pod:1093
2158 msgid "Does the string begin with C</dev/sd>?"
2162 #: ../src/guestfs.pod:1097
2164 "Does the named device exist? If so, we use that device. However if I<not> "
2165 "then we continue with this algorithm."
2169 #: ../src/guestfs.pod:1102
2170 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2174 #: ../src/guestfs.pod:1104
2175 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2179 #: ../src/guestfs.pod:1106
2180 msgid "If that named device exists, use it. If not, continue."
2184 #: ../src/guestfs.pod:1110
2185 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2189 #: ../src/guestfs.pod:1112
2190 msgid "If that named device exists, use it. If not, return an error."
2194 #: ../src/guestfs.pod:1116
2195 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2199 #: ../src/guestfs.pod:1118
2201 "Although the standard naming scheme and automatic translation is useful for "
2202 "simple programs and guestfish scripts, for larger programs it is best not to "
2203 "rely on this mechanism."
2207 #: ../src/guestfs.pod:1122
2209 "Where possible for maximum future portability programs using libguestfs "
2210 "should use these future-proof techniques:"
2214 #: ../src/guestfs.pod:1129
2216 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2217 "device names, and then use those names directly."
2221 #: ../src/guestfs.pod:1132
2222 msgid "Since those device names exist by definition, they will never be translated."
2226 #: ../src/guestfs.pod:1137
2228 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2229 "filesystem labels."
2233 #: ../src/guestfs.pod:1142
2238 #: ../src/guestfs.pod:1144
2240 "This section discusses security implications of using libguestfs, "
2241 "particularly with untrusted or malicious guests or disk images."
2245 #: ../src/guestfs.pod:1147
2246 msgid "GENERAL SECURITY CONSIDERATIONS"
2250 #: ../src/guestfs.pod:1149
2252 "Be careful with any files or data that you download from a guest (by "
2253 "\"download\" we mean not just the L</guestfs_download> command but any "
2254 "command that reads files, filenames, directories or anything else from a "
2255 "disk image). An attacker could manipulate the data to fool your program "
2256 "into doing the wrong thing. Consider cases such as:"
2260 #: ../src/guestfs.pod:1159
2261 msgid "the data (file etc) not being present"
2265 #: ../src/guestfs.pod:1163
2266 msgid "being present but empty"
2270 #: ../src/guestfs.pod:1167
2271 msgid "being much larger than normal"
2275 #: ../src/guestfs.pod:1171
2276 msgid "containing arbitrary 8 bit data"
2280 #: ../src/guestfs.pod:1175
2281 msgid "being in an unexpected character encoding"
2285 #: ../src/guestfs.pod:1179
2286 msgid "containing homoglyphs."
2290 #: ../src/guestfs.pod:1183
2291 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2295 #: ../src/guestfs.pod:1185
2297 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2298 "(VFS) module can sometimes be escalated into exploits by deliberately "
2299 "creating a malicious, malformed filesystem. These exploits are very severe "
2300 "for two reasons. Firstly there are very many filesystem drivers in the "
2301 "kernel, and many of them are infrequently used and not much developer "
2302 "attention has been paid to the code. Linux userspace helps potential "
2303 "crackers by detecting the filesystem type and automatically choosing the "
2304 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2305 "the administrator. Secondly, a kernel-level exploit is like a local root "
2306 "exploit (worse in some ways), giving immediate and total access to the "
2307 "system right down to the hardware level."
2311 #: ../src/guestfs.pod:1198
2313 "That explains why you should never mount a filesystem from an untrusted "
2314 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2315 "inside a qemu virtual machine, usually running as a non-root user. The "
2316 "attacker would need to write a filesystem which first exploited the kernel, "
2317 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2318 "the libguestfs protocol, and finally to be as serious as the host kernel "
2319 "exploit it would need to escalate its privileges to root. This multi-step "
2320 "escalation, performed by a static piece of data, is thought to be extremely "
2321 "hard to do, although we never say 'never' about security issues."
2325 #: ../src/guestfs.pod:1209
2327 "In any case callers can reduce the attack surface by forcing the filesystem "
2328 "type when mounting (use L</guestfs_mount_vfs>)."
2332 #: ../src/guestfs.pod:1212
2333 msgid "PROTOCOL SECURITY"
2337 #: ../src/guestfs.pod:1214
2339 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2340 "defined upper message size. However a program that uses libguestfs must "
2341 "also take care - for example you can write a program that downloads a binary "
2342 "from a disk image and executes it locally, and no amount of protocol "
2343 "security will save you from the consequences."
2347 #: ../src/guestfs.pod:1220
2348 msgid "INSPECTION SECURITY"
2352 #: ../src/guestfs.pod:1222
2354 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2355 "directly from the guest, and these could contain any 8 bit data. Callers "
2356 "should be careful to escape these before printing them to a structured file "
2357 "(for example, use HTML escaping if creating a web page)."
2361 #: ../src/guestfs.pod:1228
2363 "Guest configuration may be altered in unusual ways by the administrator of "
2364 "the virtual machine, and may not reflect reality (particularly for untrusted "
2365 "or actively malicious guests). For example we parse the hostname from "
2366 "configuration files like C</etc/sysconfig/network> that we find in the "
2367 "guest, but the guest administrator can easily manipulate these files to "
2368 "provide the wrong hostname."
2372 #: ../src/guestfs.pod:1236
2374 "The inspection API parses guest configuration using two external libraries: "
2375 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2376 "designed to be robust in the face of malicious data, although denial of "
2377 "service attacks are still possible, for example with oversized configuration "
2382 #: ../src/guestfs.pod:1242
2383 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2387 #: ../src/guestfs.pod:1244
2389 "Be very cautious about running commands from the guest. By running a "
2390 "command in the guest, you are giving CPU time to a binary that you do not "
2391 "control, under the same user account as the library, albeit wrapped in qemu "
2392 "virtualization. More information and alternatives can be found in the "
2393 "section L</RUNNING COMMANDS>."
2397 #: ../src/guestfs.pod:1250
2398 msgid "CVE-2010-3851"
2402 #: ../src/guestfs.pod:1252
2403 msgid "https://bugzilla.redhat.com/642934"
2407 #: ../src/guestfs.pod:1254
2409 "This security bug concerns the automatic disk format detection that qemu "
2410 "does on disk images."
2414 #: ../src/guestfs.pod:1257
2416 "A raw disk image is just the raw bytes, there is no header. Other disk "
2417 "images like qcow2 contain a special header. Qemu deals with this by looking "
2418 "for one of the known headers, and if none is found then assuming the disk "
2419 "image must be raw."
2423 #: ../src/guestfs.pod:1262
2425 "This allows a guest which has been given a raw disk image to write some "
2426 "other header. At next boot (or when the disk image is accessed by "
2427 "libguestfs) qemu would do autodetection and think the disk image format was, "
2428 "say, qcow2 based on the header written by the guest."
2432 #: ../src/guestfs.pod:1267
2434 "This in itself would not be a problem, but qcow2 offers many features, one "
2435 "of which is to allow a disk image to refer to another image (called the "
2436 "\"backing disk\"). It does this by placing the path to the backing disk "
2437 "into the qcow2 header. This path is not validated and could point to any "
2438 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2439 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2440 "control of the attacker."
2444 #: ../src/guestfs.pod:1275
2445 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
2449 #: ../src/guestfs.pod:1282
2450 msgid "You have enabled the network or have opened the disk in write mode."
2454 #: ../src/guestfs.pod:1286
2456 "You are also running untrusted code from the guest (see L</RUNNING "
2461 #: ../src/guestfs.pod:1291
2463 "The way to avoid this is to specify the expected disk format when adding "
2464 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2465 "should always do this if the disk is raw format, and it's a good idea for "
2470 #: ../src/guestfs.pod:1296
2472 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2473 "format is fetched from libvirt and passed through."
2477 #: ../src/guestfs.pod:1299
2479 "For libguestfs tools, use the I<--format> command line parameter as "
2484 #: ../src/guestfs.pod:1302
2485 msgid "CONNECTION MANAGEMENT"
2489 #: ../src/guestfs.pod:1304
2494 #: ../src/guestfs.pod:1306
2496 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2497 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2498 "handle and release all resources used."
2502 #: ../src/guestfs.pod:1310
2504 "For information on using multiple handles and threads, see the section "
2505 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2509 #: ../src/guestfs.pod:1313
2510 msgid "guestfs_create"
2514 #: ../src/guestfs.pod:1315
2517 " guestfs_h *guestfs_create (void);\n"
2522 #: ../src/guestfs.pod:1317
2523 msgid "Create a connection handle."
2527 #: ../src/guestfs.pod:1319
2529 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2530 "on the handle at least once."
2534 #: ../src/guestfs.pod:1322
2536 "This function returns a non-NULL pointer to a handle on success or NULL on "
2541 #: ../src/guestfs.pod:1325
2542 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2546 #: ../src/guestfs.pod:1327
2548 "You may also want to configure error handling for the handle. See L</ERROR "
2549 "HANDLING> section below."
2553 #: ../src/guestfs.pod:1330
2554 msgid "guestfs_close"
2558 #: ../src/guestfs.pod:1332
2561 " void guestfs_close (guestfs_h *g);\n"
2566 #: ../src/guestfs.pod:1334
2567 msgid "This closes the connection handle and frees up all resources used."
2571 #: ../src/guestfs.pod:1336
2572 msgid "ERROR HANDLING"
2576 #: ../src/guestfs.pod:1338
2578 "API functions can return errors. For example, almost all functions that "
2579 "return C<int> will return C<-1> to indicate an error."
2583 #: ../src/guestfs.pod:1341
2585 "Additional information is available for errors: an error message string and "
2586 "optionally an error number (errno) if the thing that failed was a system "
2591 #: ../src/guestfs.pod:1345
2593 "You can get at the additional information about the last error on the handle "
2594 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2595 "up an error handler with L</guestfs_set_error_handler>."
2599 #: ../src/guestfs.pod:1350
2601 "When the handle is created, a default error handler is installed which "
2602 "prints the error message string to C<stderr>. For small short-running "
2603 "command line programs it is sufficient to do:"
2607 #: ../src/guestfs.pod:1354
2610 " if (guestfs_launch (g) == -1)\n"
2611 " exit (EXIT_FAILURE);\n"
2616 #: ../src/guestfs.pod:1357
2618 "since the default error handler will ensure that an error message has been "
2619 "printed to C<stderr> before the program exits."
2623 #: ../src/guestfs.pod:1360
2625 "For other programs the caller will almost certainly want to install an "
2626 "alternate error handler or do error handling in-line like this:"
2630 #: ../src/guestfs.pod:1363
2633 " g = guestfs_create ();\n"
2638 #: ../src/guestfs.pod:1365
2641 " /* This disables the default behaviour of printing errors\n"
2643 " guestfs_set_error_handler (g, NULL, NULL);\n"
2648 #: ../src/guestfs.pod:1369
2651 " if (guestfs_launch (g) == -1) {\n"
2652 " /* Examine the error message and print it etc. */\n"
2653 " char *msg = guestfs_last_error (g);\n"
2654 " int errnum = guestfs_last_errno (g);\n"
2655 " fprintf (stderr, \"%s\\n\", msg);\n"
2662 #: ../src/guestfs.pod:1377
2664 "Out of memory errors are handled differently. The default action is to call "
2665 "L<abort(3)>. If this is undesirable, then you can set a handler using "
2666 "L</guestfs_set_out_of_memory_handler>."
2670 #: ../src/guestfs.pod:1381
2672 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2673 "because there is no handle if this happens there is no way to get additional "
2674 "error information. However L</guestfs_create> is supposed to be a "
2675 "lightweight operation which can only fail because of insufficient memory (it "
2676 "returns NULL in this case)."
2680 #: ../src/guestfs.pod:1387
2681 msgid "guestfs_last_error"
2685 #: ../src/guestfs.pod:1389
2688 " const char *guestfs_last_error (guestfs_h *g);\n"
2693 #: ../src/guestfs.pod:1391
2695 "This returns the last error message that happened on C<g>. If there has not "
2696 "been an error since the handle was created, then this returns C<NULL>."
2700 #: ../src/guestfs.pod:1395
2702 "The lifetime of the returned string is until the next error occurs, or "
2703 "L</guestfs_close> is called."
2707 #: ../src/guestfs.pod:1398
2708 msgid "guestfs_last_errno"
2712 #: ../src/guestfs.pod:1400
2715 " int guestfs_last_errno (guestfs_h *g);\n"
2720 #: ../src/guestfs.pod:1402
2721 msgid "This returns the last error number (errno) that happened on C<g>."
2725 #: ../src/guestfs.pod:1404
2726 msgid "If successful, an errno integer not equal to zero is returned."
2730 #: ../src/guestfs.pod:1406
2731 msgid "If no error, this returns 0. This call can return 0 in three situations:"
2735 #: ../src/guestfs.pod:1413
2736 msgid "There has not been any error on the handle."
2740 #: ../src/guestfs.pod:1417
2742 "There has been an error but the errno was meaningless. This corresponds to "
2743 "the case where the error did not come from a failed system call, but for "
2744 "some other reason."
2748 #: ../src/guestfs.pod:1423
2750 "There was an error from a failed system call, but for some reason the errno "
2751 "was not captured and returned. This usually indicates a bug in libguestfs."
2755 #: ../src/guestfs.pod:1429
2757 "Libguestfs tries to convert the errno from inside the applicance into a "
2758 "corresponding errno for the caller (not entirely trivial: the appliance "
2759 "might be running a completely different operating system from the library "
2760 "and error numbers are not standardized across Un*xen). If this could not be "
2761 "done, then the error is translated to C<EINVAL>. In practice this should "
2762 "only happen in very rare circumstances."
2766 #: ../src/guestfs.pod:1437
2767 msgid "guestfs_set_error_handler"
2771 #: ../src/guestfs.pod:1439
2774 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2776 " const char *msg);\n"
2777 " void guestfs_set_error_handler (guestfs_h *g,\n"
2778 " guestfs_error_handler_cb cb,\n"
2784 #: ../src/guestfs.pod:1446
2786 "The callback C<cb> will be called if there is an error. The parameters "
2787 "passed to the callback are an opaque data pointer and the error message "
2792 #: ../src/guestfs.pod:1450
2794 "C<errno> is not passed to the callback. To get that the callback must call "
2795 "L</guestfs_last_errno>."
2799 #: ../src/guestfs.pod:1453
2801 "Note that the message string C<msg> is freed as soon as the callback "
2802 "function returns, so if you want to stash it somewhere you must make your "
2807 #: ../src/guestfs.pod:1457
2808 msgid "The default handler prints messages on C<stderr>."
2812 #: ../src/guestfs.pod:1459
2813 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2817 #: ../src/guestfs.pod:1461
2818 msgid "guestfs_get_error_handler"
2822 #: ../src/guestfs.pod:1463
2825 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2826 " void **opaque_rtn);\n"
2831 #: ../src/guestfs.pod:1466
2832 msgid "Returns the current error handler callback."
2836 #: ../src/guestfs.pod:1468
2837 msgid "guestfs_set_out_of_memory_handler"
2841 #: ../src/guestfs.pod:1470
2844 " typedef void (*guestfs_abort_cb) (void);\n"
2845 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2846 " guestfs_abort_cb);\n"
2851 #: ../src/guestfs.pod:1474
2853 "The callback C<cb> will be called if there is an out of memory situation. "
2854 "I<Note this callback must not return>."
2858 #: ../src/guestfs.pod:1477
2859 msgid "The default is to call L<abort(3)>."
2863 #: ../src/guestfs.pod:1479
2864 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2868 #: ../src/guestfs.pod:1482
2869 msgid "guestfs_get_out_of_memory_handler"
2873 #: ../src/guestfs.pod:1484
2876 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2881 #: ../src/guestfs.pod:1486
2882 msgid "This returns the current out of memory handler."
2886 #: ../src/guestfs.pod:1488
2891 #: ../src/guestfs.pod:1490 ../fish/guestfish.pod:1008
2896 #: ../src/guestfs.pod:1492
2901 #: ../src/guestfs.pod:1494
2906 #: ../src/guestfs.pod:1496
2907 msgid "AVAILABILITY"
2911 #: ../src/guestfs.pod:1498
2912 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2916 #: ../src/guestfs.pod:1500
2918 "Using L</guestfs_available> you can test availability of the following "
2919 "groups of functions. This test queries the appliance to see if the "
2920 "appliance you are currently using supports the functionality."
2924 #: ../src/guestfs.pod:1505
2925 msgid "@AVAILABILITY@"
2929 #: ../src/guestfs.pod:1507
2930 msgid "GUESTFISH supported COMMAND"
2934 #: ../src/guestfs.pod:1509
2936 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2937 "prints out the available groups and whether they are supported by this build "
2938 "of libguestfs. Note however that you have to do C<run> first."
2942 #: ../src/guestfs.pod:1514
2943 msgid "SINGLE CALLS AT COMPILE TIME"
2947 #: ../src/guestfs.pod:1516
2949 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2950 "function, such as:"
2954 #: ../src/guestfs.pod:1519
2957 " #define LIBGUESTFS_HAVE_DD 1\n"
2962 #: ../src/guestfs.pod:1521
2963 msgid "if L</guestfs_dd> is available."
2967 #: ../src/guestfs.pod:1523
2969 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2970 "function is available at compile time, we recommended using build tools such "
2971 "as autoconf or cmake. For example in autotools you could use:"
2975 #: ../src/guestfs.pod:1528
2978 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2979 " AC_CHECK_FUNCS([guestfs_dd])\n"
2984 #: ../src/guestfs.pod:1531
2986 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2991 #: ../src/guestfs.pod:1534
2992 msgid "SINGLE CALLS AT RUN TIME"
2996 #: ../src/guestfs.pod:1536
2998 "Testing at compile time doesn't guarantee that a function really exists in "
2999 "the library. The reason is that you might be dynamically linked against a "
3000 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
3001 "This situation unfortunately results in a segmentation fault, which is a "
3002 "shortcoming of the C dynamic linking system itself."
3006 #: ../src/guestfs.pod:1543
3008 "You can use L<dlopen(3)> to test if a function is available at run time, as "
3009 "in this example program (note that you still need the compile time check as "
3014 #: ../src/guestfs.pod:1547
3017 " #include <stdio.h>\n"
3018 " #include <stdlib.h>\n"
3019 " #include <unistd.h>\n"
3020 " #include <dlfcn.h>\n"
3021 " #include <guestfs.h>\n"
3026 #: ../src/guestfs.pod:1553
3031 " #ifdef LIBGUESTFS_HAVE_DD\n"
3033 " int has_function;\n"
3038 #: ../src/guestfs.pod:1559
3041 " /* Test if the function guestfs_dd is really available. */\n"
3042 " dl = dlopen (NULL, RTLD_LAZY);\n"
3044 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
3045 " exit (EXIT_FAILURE);\n"
3047 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
3053 #: ../src/guestfs.pod:1568
3056 " if (!has_function)\n"
3057 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
3059 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
3060 " /* Now it's safe to call\n"
3061 " guestfs_dd (g, \"foo\", \"bar\");\n"
3065 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
3072 #: ../src/guestfs.pod:1581
3074 "You may think the above is an awful lot of hassle, and it is. There are "
3075 "other ways outside of the C linking system to ensure that this kind of "
3076 "incompatibility never arises, such as using package versioning:"
3080 #: ../src/guestfs.pod:1586
3083 " Requires: libguestfs >= 1.0.80\n"
3088 #: ../src/guestfs.pod:1588
3089 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3093 #: ../src/guestfs.pod:1590
3095 "A recent feature of the API is the introduction of calls which take optional "
3096 "arguments. In C these are declared 3 ways. The main way is as a call which "
3097 "takes variable arguments (ie. C<...>), as in this example:"
3101 #: ../src/guestfs.pod:1595
3104 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3109 #: ../src/guestfs.pod:1597
3111 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3112 "call with no optional arguments specified:"
3116 #: ../src/guestfs.pod:1600
3119 " guestfs_add_drive_opts (g, filename, -1);\n"
3124 #: ../src/guestfs.pod:1602
3125 msgid "With a single optional argument:"
3129 #: ../src/guestfs.pod:1604
3132 " guestfs_add_drive_opts (g, filename,\n"
3133 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3139 #: ../src/guestfs.pod:1608
3144 #: ../src/guestfs.pod:1610
3147 " guestfs_add_drive_opts (g, filename,\n"
3148 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3149 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3155 #: ../src/guestfs.pod:1615
3157 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3162 #: ../src/guestfs.pod:1618
3163 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3167 #: ../src/guestfs.pod:1620
3169 "The second variant has the same name with the suffix C<_va>, which works the "
3170 "same way but takes a C<va_list>. See the C manual for details. For the "
3171 "example function, this is declared:"
3175 #: ../src/guestfs.pod:1624
3178 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3184 #: ../src/guestfs.pod:1627
3185 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3189 #: ../src/guestfs.pod:1629
3191 "The third variant is useful where you need to construct these calls. You "
3192 "pass in a structure where you fill in the optional fields. The structure "
3193 "has a bitmask as the first element which you must set to indicate which "
3194 "fields you have filled in. For our example function the structure and call "
3199 #: ../src/guestfs.pod:1635
3202 " struct guestfs_add_drive_opts_argv {\n"
3203 " uint64_t bitmask;\n"
3205 " const char *format;\n"
3208 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3209 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3214 #: ../src/guestfs.pod:1644
3215 msgid "You could call it like this:"
3219 #: ../src/guestfs.pod:1646
3222 " struct guestfs_add_drive_opts_argv optargs = {\n"
3223 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3224 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3226 " .format = \"qcow2\"\n"
3232 #: ../src/guestfs.pod:1653
3235 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3240 #: ../src/guestfs.pod:1655 ../src/guestfs-actions.pod:11 ../src/guestfs-actions.pod:1855 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1260 ../tools/virt-win-reg.pl:532
3245 #: ../src/guestfs.pod:1661
3246 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3250 #: ../src/guestfs.pod:1666
3251 msgid "You do not need to fill in all fields of the structure."
3255 #: ../src/guestfs.pod:1670
3257 "There must be a one-to-one correspondence between fields of the structure "
3258 "that are filled in, and bits set in the bitmask."
3262 #: ../src/guestfs.pod:1675
3263 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3267 #: ../src/guestfs.pod:1677
3269 "In other languages, optional arguments are expressed in the way that is "
3270 "natural for that language. We refer you to the language-specific "
3271 "documentation for more details on that."
3275 #: ../src/guestfs.pod:1681
3276 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3280 #: ../src/guestfs.pod:1683
3281 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3285 #: ../src/guestfs.pod:1685
3287 "B<Note:> This section documents the generic event mechanism introduced in "
3288 "libguestfs 1.10, which you should use in new code if possible. The old "
3289 "functions C<guestfs_set_log_message_callback>, "
3290 "C<guestfs_set_subprocess_quit_callback>, "
3291 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
3292 "C<guestfs_set_progress_callback> are no longer documented in this manual "
3297 #: ../src/guestfs.pod:1693
3299 "Handles generate events when certain things happen, such as log messages "
3300 "being generated, progress messages during long-running operations, or the "
3301 "handle being closed. The API calls described below let you register a "
3302 "callback to be called when events happen. You can register multiple "
3303 "callbacks (for the same, different or overlapping sets of events), and "
3304 "individually remove callbacks. If callbacks are not removed, then they "
3305 "remain in force until the handle is closed."
3309 #: ../src/guestfs.pod:1701
3311 "In the current implementation, events are only generated synchronously: that "
3312 "means that events (and hence callbacks) can only happen while you are in the "
3313 "middle of making another libguestfs call. The callback is called in the "
3318 #: ../src/guestfs.pod:1706
3320 "Events may contain a payload, usually nothing (void), an array of 64 bit "
3321 "unsigned integers, or a message buffer. Payloads are discussed later on."
3325 #: ../src/guestfs.pod:1710
3326 msgid "CLASSES OF EVENTS"
3330 #: ../src/guestfs.pod:1714
3331 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
3335 #: ../src/guestfs.pod:1717
3337 "The callback function will be called while the handle is being closed "
3338 "(synchronously from L</guestfs_close>)."
3342 #: ../src/guestfs.pod:1720
3344 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3345 "handles that are open when the program exits. This means that this callback "
3346 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3347 "problems in higher-level languages (eg. if your HLL interpreter has already "
3348 "been cleaned up by the time this is called, and if your callback then jumps "
3349 "into some HLL function)."
3353 #: ../src/guestfs.pod:1727
3355 "If no callback is registered: the handle is closed without any callback "
3360 #: ../src/guestfs.pod:1730
3361 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
3365 #: ../src/guestfs.pod:1733
3367 "The callback function will be called when the child process quits, either "
3368 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3369 "corresponds to a transition from any state to the CONFIG state)."
3373 #: ../src/guestfs.pod:1737 ../src/guestfs.pod:1746
3374 msgid "If no callback is registered: the event is ignored."
3378 #: ../src/guestfs.pod:1739
3379 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
3383 #: ../src/guestfs.pod:1742
3385 "The callback function will be called when the child process becomes ready "
3386 "first time after it has been launched. (This corresponds to a transition "
3387 "from LAUNCHING to the READY state)."
3391 #: ../src/guestfs.pod:1748
3392 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
3396 #: ../src/guestfs.pod:1751
3398 "Some long-running operations can generate progress messages. If this "
3399 "callback is registered, then it will be called each time a progress message "
3400 "is generated (usually two seconds after the operation started, and three "
3401 "times per second thereafter until it completes, although the frequency may "
3402 "change in future versions)."
3406 #: ../src/guestfs.pod:1757
3408 "The callback receives in the payload four unsigned 64 bit numbers which are "
3409 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
3413 #: ../src/guestfs.pod:1760
3415 "The units of C<total> are not defined, although for some operations C<total> "
3416 "may relate in some way to the amount of data to be transferred (eg. in bytes "
3417 "or megabytes), and C<position> may be the portion which has been "
3422 #: ../src/guestfs.pod:1765
3423 msgid "The only defined and stable parts of the API are:"
3427 #: ../src/guestfs.pod:1771
3429 "The callback can display to the user some type of progress bar or indicator "
3430 "which shows the ratio of C<position>:C<total>."
3434 #: ../src/guestfs.pod:1776
3435 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3439 #: ../src/guestfs.pod:1780
3441 "If any progress notification is sent during a call, then a final progress "
3442 "notification is always sent when C<position> = C<total> (I<unless> the call "
3443 "fails with an error)."
3447 #: ../src/guestfs.pod:1784
3449 "This is to simplify caller code, so callers can easily set the progress "
3450 "indicator to \"100%\" at the end of the operation, without requiring special "
3451 "code to detect this case."
3455 #: ../src/guestfs.pod:1790
3457 "For some calls we are unable to estimate the progress of the call, but we "
3458 "can still generate progress messages to indicate activity. This is known as "
3459 "\"pulse mode\", and is directly supported by certain progress bar "
3460 "implementations (eg. GtkProgressBar)."
3464 #: ../src/guestfs.pod:1795
3466 "For these calls, zero or more progress messages are generated with "
3467 "C<position = 0> and C<total = 1>, followed by a final message with "
3468 "C<position = total = 1>."
3472 #: ../src/guestfs.pod:1799
3474 "As noted above, if the call fails with an error then the final message may "
3479 #: ../src/guestfs.pod:1804
3481 "The callback also receives the procedure number (C<proc_nr>) and serial "
3482 "number (C<serial>) of the call. These are only useful for debugging "
3483 "protocol issues, and the callback can normally ignore them. The callback "
3484 "may want to print these numbers in error messages or debugging messages."
3488 #: ../src/guestfs.pod:1810
3489 msgid "If no callback is registered: progress messages are discarded."
3493 #: ../src/guestfs.pod:1812
3494 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
3498 #: ../src/guestfs.pod:1815
3500 "The callback function is called whenever a log message is generated by qemu, "
3501 "the appliance kernel, guestfsd (daemon), or utility programs."
3505 #: ../src/guestfs.pod:1818
3507 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
3508 "(L</guestfs_launch>) then additional debug messages are generated."
3512 #: ../src/guestfs.pod:1821 ../src/guestfs.pod:1835
3514 "If no callback is registered: the messages are discarded unless the verbose "
3515 "flag is set in which case they are sent to stderr. You can override the "
3516 "printing of verbose messages to stderr by setting up a callback."
3520 #: ../src/guestfs.pod:1826
3521 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
3525 #: ../src/guestfs.pod:1829
3527 "The callback function is called whenever a log message is generated by the "
3528 "library part of libguestfs."
3532 #: ../src/guestfs.pod:1832
3534 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
3535 "messages are generated."
3539 #: ../src/guestfs.pod:1840
3540 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
3544 #: ../src/guestfs.pod:1843
3546 "The callback function is called whenever a trace message is generated. This "
3547 "only applies if the trace flag (L</guestfs_set_trace>) is set."
3551 #: ../src/guestfs.pod:1846
3553 "If no callback is registered: the messages are sent to stderr. You can "
3554 "override the printing of trace messages to stderr by setting up a callback."
3558 #: ../src/guestfs.pod:1852
3559 msgid "guestfs_set_event_callback"
3563 #: ../src/guestfs.pod:1854
3566 " int guestfs_set_event_callback (guestfs_h *g,\n"
3567 " guestfs_event_callback cb,\n"
3568 " uint64_t event_bitmask,\n"
3575 #: ../src/guestfs.pod:1860
3577 "This function registers a callback (C<cb>) for all event classes in the "
3582 #: ../src/guestfs.pod:1863
3584 "For example, to register for all log message events, you could call this "
3585 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
3586 "To register a single callback for all possible classes of events, use "
3587 "C<GUESTFS_EVENT_ALL>."
3591 #: ../src/guestfs.pod:1869
3592 msgid "C<flags> should always be passed as 0."
3596 #: ../src/guestfs.pod:1871
3598 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
3599 "it for any purpose."
3603 #: ../src/guestfs.pod:1874
3605 "The return value is the event handle (an integer) which you can use to "
3606 "delete the callback (see below)."
3610 #: ../src/guestfs.pod:1877
3612 "If there is an error, this function returns C<-1>, and sets the error in the "
3613 "handle in the usual way (see L</guestfs_last_error> etc.)"
3617 #: ../src/guestfs.pod:1880
3619 "Callbacks remain in effect until they are deleted, or until the handle is "
3624 #: ../src/guestfs.pod:1883
3626 "In the case where multiple callbacks are registered for a particular event "
3627 "class, all of the callbacks are called. The order in which multiple "
3628 "callbacks are called is not defined."
3632 #: ../src/guestfs.pod:1887
3633 msgid "guestfs_delete_event_callback"
3637 #: ../src/guestfs.pod:1889
3640 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
3645 #: ../src/guestfs.pod:1891
3647 "Delete a callback that was previously registered. C<event_handle> should be "
3648 "the integer that was returned by a previous call to "
3649 "C<guestfs_set_event_callback> on the same handle."
3653 #: ../src/guestfs.pod:1895
3654 msgid "guestfs_event_callback"
3658 #: ../src/guestfs.pod:1897
3661 " typedef void (*guestfs_event_callback) (\n"
3664 " uint64_t event,\n"
3665 " int event_handle,\n"
3667 " const char *buf, size_t buf_len,\n"
3668 " const uint64_t *array, size_t array_len);\n"
3673 #: ../src/guestfs.pod:1906
3674 msgid "This is the type of the event callback function that you have to provide."
3678 #: ../src/guestfs.pod:1909
3680 "The basic parameters are: the handle (C<g>), the opaque user pointer "
3681 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
3682 "handle, and C<flags> which in the current API you should ignore."
3686 #: ../src/guestfs.pod:1913
3688 "The remaining parameters contain the event payload (if any). Each event may "
3689 "contain a payload, which usually relates to the event class, but for future "
3690 "proofing your code should be written to handle any payload for any event "
3695 #: ../src/guestfs.pod:1918
3697 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
3698 "there is no message buffer). Note that this message buffer can contain "
3699 "arbitrary 8 bit data, including NUL bytes."
3703 #: ../src/guestfs.pod:1922
3705 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
3706 "moment this is only used for progress messages."
3710 #: ../src/guestfs.pod:1925
3711 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
3715 #: ../src/guestfs.pod:1927
3717 "One motivation for the generic event API was to allow GUI programs to "
3718 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
3719 "unconditionally to C<stderr>."
3723 #: ../src/guestfs.pod:1931
3725 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
3726 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
3727 "messages are not events; you must capture error messages separately)."
3731 #: ../src/guestfs.pod:1936
3733 "Programs have to set up a callback to capture the classes of events of "
3738 #: ../src/guestfs.pod:1939
3742 " guestfs_set_event_callback\n"
3743 " (g, message_callback,\n"
3744 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
3745 " GUESTFS_EVENT_TRACE,\n"
3746 " 0, NULL) == -1)\n"
3747 " if (eh == -1) {\n"
3748 " // handle error in the usual way\n"
3754 #: ../src/guestfs.pod:1949
3756 "The callback can then direct messages to the appropriate place. In this "
3757 "example, messages are directed to syslog:"
3761 #: ../src/guestfs.pod:1952
3765 " message_callback (\n"
3768 " uint64_t event,\n"
3769 " int event_handle,\n"
3771 " const char *buf, size_t buf_len,\n"
3772 " const uint64_t *array, size_t array_len)\n"
3774 " const int priority = LOG_USER|LOG_INFO;\n"
3775 " if (buf_len > 0)\n"
3776 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
3782 #: ../src/guestfs.pod:1967
3783 msgid "PRIVATE DATA AREA"
3787 #: ../src/guestfs.pod:1969
3789 "You can attach named pieces of private data to the libguestfs handle, fetch "
3790 "them by name, and walk over them, for the lifetime of the handle. This is "
3791 "called the private data area and is only available from the C API."
3795 #: ../src/guestfs.pod:1974
3796 msgid "To attach a named piece of data, use the following call:"
3800 #: ../src/guestfs.pod:1976
3803 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3808 #: ../src/guestfs.pod:1978
3810 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3811 "pointer (which can be C<NULL>). Any previous item with the same name is "
3816 #: ../src/guestfs.pod:1982
3818 "You can use any C<key> you want, but names beginning with an underscore "
3819 "character are reserved for internal libguestfs purposes (for implementing "
3820 "language bindings). It is recommended to prefix the name with some unique "
3821 "string to avoid collisions with other users."
3825 #: ../src/guestfs.pod:1987
3826 msgid "To retrieve the pointer, use:"
3830 #: ../src/guestfs.pod:1989
3833 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3838 #: ../src/guestfs.pod:1991
3840 "This function returns C<NULL> if either no data is found associated with "
3841 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3846 #: ../src/guestfs.pod:1995
3848 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3849 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3850 "all. In particular, libguestfs does I<not> try to free the data when the "
3851 "handle is closed. If the data must be freed, then the caller must either "
3852 "free it before calling L</guestfs_close> or must set up a close callback to "
3853 "do it (see L</GUESTFS_EVENT_CLOSE>)."
3857 #: ../src/guestfs.pod:2002
3858 msgid "To walk over all entries, use these two functions:"
3862 #: ../src/guestfs.pod:2004
3865 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
3870 #: ../src/guestfs.pod:2006
3873 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
3878 #: ../src/guestfs.pod:2008
3880 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
3881 "not have any particular meaning -- keys are not returned in any defined "
3882 "order). A pointer to the key is returned in C<*key_rtn> and the "
3883 "corresponding data pointer is returned from the function. C<NULL> is "
3884 "returned if there are no keys stored in the handle."
3888 #: ../src/guestfs.pod:2014
3890 "C<guestfs_next_private> returns the next key, pointer pair. The return "
3891 "value of this function is also C<NULL> is there are no further entries to "
3896 #: ../src/guestfs.pod:2018
3897 msgid "Notes about walking over entries:"
3901 #: ../src/guestfs.pod:2024
3902 msgid "You must not call C<guestfs_set_private> while walking over the entries."
3906 #: ../src/guestfs.pod:2029
3908 "The handle maintains an internal iterator which is reset when you call "
3909 "C<guestfs_first_private>. This internal iterator is invalidated when you "
3910 "call C<guestfs_set_private>."
3914 #: ../src/guestfs.pod:2035
3915 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
3919 #: ../src/guestfs.pod:2037
3922 " guestfs_set_private (g, key, NULL);\n"
3927 #: ../src/guestfs.pod:2039
3928 msgid "then that C<key> is not returned when walking."
3932 #: ../src/guestfs.pod:2043
3934 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
3935 "C<guestfs_next_private> or C<guestfs_set_private>."
3939 #: ../src/guestfs.pod:2049
3941 "The following example code shows how to print all keys and data pointers "
3942 "that are associated with the handle C<g>:"
3946 #: ../src/guestfs.pod:2052
3949 " const char *key;\n"
3950 " void *data = guestfs_first_private (g, &key);\n"
3951 " while (data != NULL)\n"
3953 " printf (\"key = %s, data = %p\\n\", key, data);\n"
3954 " data = guestfs_next_private (g, &key);\n"
3960 #: ../src/guestfs.pod:2060
3962 "More commonly you are only interested in keys that begin with an "
3963 "application-specific prefix C<foo_>. Modify the loop like so:"
3967 #: ../src/guestfs.pod:2063
3970 " const char *key;\n"
3971 " void *data = guestfs_first_private (g, &key);\n"
3972 " while (data != NULL)\n"
3974 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
3975 " printf (\"key = %s, data = %p\\n\", key, data);\n"
3976 " data = guestfs_next_private (g, &key);\n"
3982 #: ../src/guestfs.pod:2072
3984 "If you need to modify keys while walking, then you have to jump back to the "
3985 "beginning of the loop. For example, to delete all keys prefixed with "
3990 #: ../src/guestfs.pod:2076
3993 " const char *key;\n"
3996 " data = guestfs_first_private (g, &key);\n"
3997 " while (data != NULL)\n"
3999 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
4001 " guestfs_set_private (g, key, NULL);\n"
4002 " /* note that 'key' pointer is now invalid, and so is\n"
4003 " the internal iterator */\n"
4006 " data = guestfs_next_private (g, &key);\n"
4012 #: ../src/guestfs.pod:2092
4014 "Note that the above loop is guaranteed to terminate because the keys are "
4015 "being deleted, but other manipulations of keys within the loop might not "
4016 "terminate unless you also maintain an indication of which keys have been "
4021 #: ../src/guestfs.pod:2097 ../src/guestfs.pod:2102
4026 #: ../src/guestfs.pod:2099
4028 "<!-- old anchor for the next section --> <a "
4029 "name=\"state_machine_and_low_level_event_api\"/>"
4033 #: ../src/guestfs.pod:2104
4034 msgid "ARCHITECTURE"
4038 #: ../src/guestfs.pod:2106
4040 "Internally, libguestfs is implemented by running an appliance (a special "
4041 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
4042 "process of the main program."
4046 #: ../src/guestfs.pod:2110
4049 " ___________________\n"
4051 " | main program |\n"
4053 " | | child process / appliance\n"
4054 " | | __________________________\n"
4056 " +-------------------+ RPC | +-----------------+ |\n"
4057 " | libguestfs <--------------------> guestfsd | |\n"
4058 " | | | +-----------------+ |\n"
4059 " \\___________________/ | | Linux kernel | |\n"
4060 " | +--^--------------+ |\n"
4061 " \\_________|________________/\n"
4067 " \\______________/\n"
4072 #: ../src/guestfs.pod:2130
4074 "The library, linked to the main program, creates the child process and hence "
4075 "the appliance in the L</guestfs_launch> function."
4079 #: ../src/guestfs.pod:2133
4081 "Inside the appliance is a Linux kernel and a complete stack of userspace "
4082 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
4083 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
4084 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
4085 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
4086 "attached to the qemu process which translates device access by the "
4087 "appliance's Linux kernel into accesses to the image."
4091 #: ../src/guestfs.pod:2142
4093 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
4094 "Although the disk image you are attached to might also be used by some "
4095 "virtual machine, libguestfs doesn't know or care about this. (But you will "
4096 "care if both libguestfs's qemu process and your virtual machine are trying "
4097 "to update the disk image at the same time, since these usually results in "
4098 "massive disk corruption)."
4102 #: ../src/guestfs.pod:2149
4103 msgid "STATE MACHINE"
4107 #: ../src/guestfs.pod:2151
4108 msgid "libguestfs uses a state machine to model the child process:"
4112 #: ../src/guestfs.pod:2153
4124 " / | \\ \\ guestfs_launch\n"
4125 " / | _\\__V______\n"
4127 " / | | LAUNCHING |\n"
4128 " / | \\___________/\n"
4130 " / | guestfs_launch\n"
4132 " ______ / __|____V\n"
4133 " / \\ ------> / \\\n"
4134 " | BUSY | | READY |\n"
4135 " \\______/ <------ \\________/\n"
4140 #: ../src/guestfs.pod:2175
4142 "The normal transitions are (1) CONFIG (when the handle is created, but there "
4143 "is no child process), (2) LAUNCHING (when the child process is booting up), "
4144 "(3) alternating between READY and BUSY as commands are issued to, and "
4145 "carried out by, the child process."
4149 #: ../src/guestfs.pod:2180
4151 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
4152 "asynchronously at any time (eg. due to some internal error), and that causes "
4153 "the state to transition back to CONFIG."
4157 #: ../src/guestfs.pod:2184
4159 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
4160 "issued when in the CONFIG state."
4164 #: ../src/guestfs.pod:2187
4166 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
4167 "L</guestfs_launch> blocks until the child process is READY to accept "
4168 "commands (or until some failure or timeout). L</guestfs_launch> internally "
4169 "moves the state from CONFIG to LAUNCHING while it is running."
4173 #: ../src/guestfs.pod:2193
4175 "API actions such as L</guestfs_mount> can only be issued when in the READY "
4176 "state. These API calls block waiting for the command to be carried out "
4177 "(ie. the state to transition to BUSY and then back to READY). There are no "
4178 "non-blocking versions, and no way to issue more than one command per handle "
4183 #: ../src/guestfs.pod:2199
4185 "Finally, the child process sends asynchronous messages back to the main "
4186 "program, such as kernel log messages. You can register a callback to "
4187 "receive these messages."
4191 #: ../src/guestfs.pod:2203
4196 #: ../src/guestfs.pod:2205
4197 msgid "COMMUNICATION PROTOCOL"
4201 #: ../src/guestfs.pod:2207
4203 "Don't rely on using this protocol directly. This section documents how it "
4204 "currently works, but it may change at any time."
4208 #: ../src/guestfs.pod:2210
4210 "The protocol used to talk between the library and the daemon running inside "
4211 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
4212 "1014, RFC 1832, RFC 4506)."
4216 #: ../src/guestfs.pod:2214
4218 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
4219 "this file is automatically generated)."
4223 #: ../src/guestfs.pod:2217
4225 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
4226 "and C<FileOut> parameters, which are handled with very simple request/reply "
4227 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
4228 "parameters, which use the same request and reply messages, but they may also "
4229 "be followed by files sent using a chunked encoding."
4233 #: ../src/guestfs.pod:2224
4234 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
4238 #: ../src/guestfs.pod:2226
4239 msgid "For ordinary functions, the request message is:"
4243 #: ../src/guestfs.pod:2228
4246 " total length (header + arguments,\n"
4247 " but not including the length word itself)\n"
4248 " struct guestfs_message_header (encoded as XDR)\n"
4249 " struct guestfs_<foo>_args (encoded as XDR)\n"
4254 #: ../src/guestfs.pod:2233
4256 "The total length field allows the daemon to allocate a fixed size buffer "
4257 "into which it slurps the rest of the message. As a result, the total length "
4258 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
4259 "effective size of any request is limited to somewhere under this size."
4263 #: ../src/guestfs.pod:2239
4265 "Note also that many functions don't take any arguments, in which case the "
4266 "C<guestfs_I<foo>_args> is completely omitted."
4270 #: ../src/guestfs.pod:2242
4272 "The header contains the procedure number (C<guestfs_proc>) which is how the "
4273 "receiver knows what type of args structure to expect, or none at all."
4277 #: ../src/guestfs.pod:2246
4279 "For functions that take optional arguments, the optional arguments are "
4280 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
4281 "arguments. A bitmask in the header indicates which optional arguments are "
4282 "meaningful. The bitmask is also checked to see if it contains bits set "
4283 "which the daemon does not know about (eg. if more optional arguments were "
4284 "added in a later version of the library), and this causes the call to be "
4289 #: ../src/guestfs.pod:2254
4290 msgid "The reply message for ordinary functions is:"
4294 #: ../src/guestfs.pod:2256
4297 " total length (header + ret,\n"
4298 " but not including the length word itself)\n"
4299 " struct guestfs_message_header (encoded as XDR)\n"
4300 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4305 #: ../src/guestfs.pod:2261
4307 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
4308 "functions that return no formal return values."
4312 #: ../src/guestfs.pod:2264
4313 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
4317 #: ../src/guestfs.pod:2267
4319 "In the case of an error, a flag is set in the header, and the reply message "
4320 "is slightly changed:"
4324 #: ../src/guestfs.pod:2270
4327 " total length (header + error,\n"
4328 " but not including the length word itself)\n"
4329 " struct guestfs_message_header (encoded as XDR)\n"
4330 " struct guestfs_message_error (encoded as XDR)\n"
4335 #: ../src/guestfs.pod:2275
4337 "The C<guestfs_message_error> structure contains the error message as a "
4342 #: ../src/guestfs.pod:2278
4343 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
4347 #: ../src/guestfs.pod:2280
4349 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
4350 "The normal request message is sent (see above). However this is followed by "
4351 "a sequence of file chunks."
4355 #: ../src/guestfs.pod:2284
4358 " total length (header + arguments,\n"
4359 " but not including the length word itself,\n"
4360 " and not including the chunks)\n"
4361 " struct guestfs_message_header (encoded as XDR)\n"
4362 " struct guestfs_<foo>_args (encoded as XDR)\n"
4363 " sequence of chunks for FileIn param #0\n"
4364 " sequence of chunks for FileIn param #1 etc.\n"
4369 #: ../src/guestfs.pod:2292
4370 msgid "The \"sequence of chunks\" is:"
4374 #: ../src/guestfs.pod:2294
4377 " length of chunk (not including length word itself)\n"
4378 " struct guestfs_chunk (encoded as XDR)\n"
4379 " length of chunk\n"
4380 " struct guestfs_chunk (encoded as XDR)\n"
4382 " length of chunk\n"
4383 " struct guestfs_chunk (with data.data_len == 0)\n"
4388 #: ../src/guestfs.pod:2302
4390 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
4391 "is set in the final chunk to indicate either successful completion or early "
4396 #: ../src/guestfs.pod:2306
4398 "At time of writing there are no functions that have more than one FileIn "
4399 "parameter. However this is (theoretically) supported, by sending the "
4400 "sequence of chunks for each FileIn parameter one after another (from left to "
4405 #: ../src/guestfs.pod:2311
4407 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
4408 "transfer. The library does this by sending a chunk with a special flag set "
4409 "to indicate cancellation. When the daemon sees this, it cancels the whole "
4410 "RPC, does I<not> send any reply, and goes back to reading the next request."
4414 #: ../src/guestfs.pod:2317
4416 "The daemon may also cancel. It does this by writing a special word "
4417 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
4418 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
4419 "cancel chunk). The special word is chosen so that even if cancellation "
4420 "happens right at the end of the transfer (after the library has finished "
4421 "writing and has started listening for the reply), the \"spurious\" cancel "
4422 "flag will not be confused with the reply message."
4426 #: ../src/guestfs.pod:2326
4428 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
4429 "limit), and also files where the size is not known in advance (eg. from "
4430 "pipes or sockets). However the chunks are rather small "
4431 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
4432 "to keep much in memory."
4436 #: ../src/guestfs.pod:2332
4437 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
4441 #: ../src/guestfs.pod:2334
4443 "The protocol for FileOut parameters is exactly the same as for FileIn "
4444 "parameters, but with the roles of daemon and library reversed."
4448 #: ../src/guestfs.pod:2337
4451 " total length (header + ret,\n"
4452 " but not including the length word itself,\n"
4453 " and not including the chunks)\n"
4454 " struct guestfs_message_header (encoded as XDR)\n"
4455 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4456 " sequence of chunks for FileOut param #0\n"
4457 " sequence of chunks for FileOut param #1 etc.\n"
4462 #: ../src/guestfs.pod:2345
4463 msgid "INITIAL MESSAGE"
4467 #: ../src/guestfs.pod:2347
4469 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
4470 "which indicates that the guest and daemon is alive. This is what "
4471 "L</guestfs_launch> waits for."
4475 #: ../src/guestfs.pod:2351
4476 msgid "PROGRESS NOTIFICATION MESSAGES"
4480 #: ../src/guestfs.pod:2353
4482 "The daemon may send progress notification messages at any time. These are "
4483 "distinguished by the normal length word being replaced by "
4484 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
4488 #: ../src/guestfs.pod:2357
4490 "The library turns them into progress callbacks (see "
4491 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
4496 #: ../src/guestfs.pod:2361
4498 "The daemon self-limits the frequency of progress messages it sends (see "
4499 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
4504 #: ../src/guestfs.pod:2365
4505 msgid "LIBGUESTFS VERSION NUMBERS"
4509 #: ../src/guestfs.pod:2367
4511 "Since April 2010, libguestfs has started to make separate development and "
4512 "stable releases, along with corresponding branches in our git repository. "
4513 "These separate releases can be identified by version number:"
4517 #: ../src/guestfs.pod:2372
4520 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
4521 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
4527 " | `-------- sub-version\n"
4529 " `------ always '1' because we don't change the ABI\n"
4534 #: ../src/guestfs.pod:2383
4535 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
4539 #: ../src/guestfs.pod:2385
4541 "As time passes we cherry pick fixes from the development branch and backport "
4542 "those into the stable branch, the effect being that the stable branch should "
4543 "get more stable and less buggy over time. So the stable releases are ideal "
4544 "for people who don't need new features but would just like the software to "
4549 #: ../src/guestfs.pod:2391
4550 msgid "Our criteria for backporting changes are:"
4554 #: ../src/guestfs.pod:2397
4556 "Documentation changes which don't affect any code are backported unless the "
4557 "documentation refers to a future feature which is not in stable."
4561 #: ../src/guestfs.pod:2403
4563 "Bug fixes which are not controversial, fix obvious problems, and have been "
4564 "well tested are backported."
4568 #: ../src/guestfs.pod:2408
4570 "Simple rearrangements of code which shouldn't affect how it works get "
4571 "backported. This is so that the code in the two branches doesn't get too "
4572 "far out of step, allowing us to backport future fixes more easily."
4576 #: ../src/guestfs.pod:2414
4578 "We I<don't> backport new features, new APIs, new tools etc, except in one "
4579 "exceptional case: the new feature is required in order to implement an "
4580 "important bug fix."
4584 #: ../src/guestfs.pod:2420
4586 "A new stable branch starts when we think the new features in development are "
4587 "substantial and compelling enough over the current stable branch to warrant "
4588 "it. When that happens we create new stable and development versions 1.N.0 "
4589 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4590 "stable at this point, but by backporting fixes from development, that branch "
4591 "will stabilize over time."
4595 #: ../src/guestfs.pod:2428
4596 msgid "EXTENDING LIBGUESTFS"
4600 #: ../src/guestfs.pod:2430
4601 msgid "ADDING A NEW API ACTION"
4605 #: ../src/guestfs.pod:2432
4607 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
4608 "documentation) are generated, and this makes it easy to extend the "
4613 #: ../src/guestfs.pod:2436
4614 msgid "To add a new API action there are two changes:"
4618 #: ../src/guestfs.pod:2442
4620 "You need to add a description of the call (name, parameters, return type, "
4621 "tests, documentation) to C<generator/generator_actions.ml>."
4625 #: ../src/guestfs.pod:2445
4627 "There are two sorts of API action, depending on whether the call goes "
4628 "through to the daemon in the appliance, or is serviced entirely by the "
4629 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
4630 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
4631 "an example of the latter, since a trace flag is maintained in the handle and "
4632 "all tracing is done on the library side."
4636 #: ../src/guestfs.pod:2453
4638 "Most new actions are of the first type, and get added to the "
4639 "C<daemon_functions> list. Each function has a unique procedure number used "
4640 "in the RPC protocol which is assigned to that action when we publish "
4641 "libguestfs and cannot be reused. Take the latest procedure number and "
4646 #: ../src/guestfs.pod:2459
4648 "For library-only actions of the second type, add to the "
4649 "C<non_daemon_functions> list. Since these functions are serviced by the "
4650 "library and do not travel over the RPC mechanism to the daemon, these "
4651 "functions do not need a procedure number, and so the procedure number is set "
4656 #: ../src/guestfs.pod:2467
4657 msgid "Implement the action (in C):"
4661 #: ../src/guestfs.pod:2469
4663 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
4664 "C<daemon/> directory."
4668 #: ../src/guestfs.pod:2472
4670 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
4671 "(note: double underscore) in the C<src/> directory."
4675 #: ../src/guestfs.pod:2475
4676 msgid "In either case, use another function as an example of what to do."
4680 #: ../src/guestfs.pod:2479
4681 msgid "After making these changes, use C<make> to compile."
4685 #: ../src/guestfs.pod:2481
4687 "Note that you don't need to implement the RPC, language bindings, manual "
4688 "pages or anything else. It's all automatically generated from the OCaml "
4693 #: ../src/guestfs.pod:2485
4694 msgid "ADDING TESTS FOR AN API ACTION"
4698 #: ../src/guestfs.pod:2487
4700 "You can supply zero or as many tests as you want per API call. The tests "
4701 "can either be added as part of the API description "
4702 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
4703 "drop a script into C<regressions/>. Note that adding a script to "
4704 "C<regressions/> is slower, so if possible use the first method."
4708 #: ../src/guestfs.pod:2493
4710 "The following describes the test environment used when you add an API test "
4711 "in C<generator_actions.ml>."
4715 #: ../src/guestfs.pod:2496
4716 msgid "The test environment has 4 block devices:"
4720 #: ../src/guestfs.pod:2500
4721 msgid "C</dev/sda> 500MB"
4725 #: ../src/guestfs.pod:2502
4726 msgid "General block device for testing."
4730 #: ../src/guestfs.pod:2504
4731 msgid "C</dev/sdb> 50MB"
4735 #: ../src/guestfs.pod:2506
4737 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
4742 #: ../src/guestfs.pod:2509
4743 msgid "C</dev/sdc> 10MB"
4747 #: ../src/guestfs.pod:2511
4748 msgid "Used in a few tests where two block devices are needed."
4752 #: ../src/guestfs.pod:2513
4757 #: ../src/guestfs.pod:2515
4758 msgid "ISO with fixed content (see C<images/test.iso>)."
4762 #: ../src/guestfs.pod:2519
4764 "To be able to run the tests in a reasonable amount of time, the libguestfs "
4765 "appliance and block devices are reused between tests. So don't try testing "
4766 "L</guestfs_kill_subprocess> :-x"
4770 #: ../src/guestfs.pod:2523
4772 "Each test starts with an initial scenario, selected using one of the "
4773 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
4774 "initialize the disks mentioned above in a particular way as documented in "
4775 "C<generator_types.ml>. You should not assume anything about the previous "
4776 "contents of other disks that are not initialized."
4780 #: ../src/guestfs.pod:2529
4782 "You can add a prerequisite clause to any individual test. This is a "
4783 "run-time check, which, if it fails, causes the test to be skipped. Useful "
4784 "if testing a command which might not work on all variations of libguestfs "
4785 "builds. A test that has prerequisite of C<Always> means to run "
4790 #: ../src/guestfs.pod:2535
4792 "In addition, packagers can skip individual tests by setting environment "
4793 "variables before running C<make check>."
4797 #: ../src/guestfs.pod:2538
4800 " SKIP_TEST_<CMD>_<NUM>=1\n"
4805 #: ../src/guestfs.pod:2540
4806 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
4810 #: ../src/guestfs.pod:2542
4815 #: ../src/guestfs.pod:2544
4818 " SKIP_TEST_<CMD>=1\n"
4823 #: ../src/guestfs.pod:2546
4824 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
4828 #: ../src/guestfs.pod:2548
4829 msgid "Packagers can run only certain tests by setting for example:"
4833 #: ../src/guestfs.pod:2550
4836 " TEST_ONLY=\"vfs_type zerofree\"\n"
4841 #: ../src/guestfs.pod:2552
4843 "See C<capitests/tests.c> for more details of how these environment variables "
4848 #: ../src/guestfs.pod:2555
4849 msgid "DEBUGGING NEW API ACTIONS"
4853 #: ../src/guestfs.pod:2557
4854 msgid "Test new actions work before submitting them."
4858 #: ../src/guestfs.pod:2559
4859 msgid "You can use guestfish to try out new commands."
4863 #: ../src/guestfs.pod:2561
4865 "Debugging the daemon is a problem because it runs inside a minimal "
4866 "environment. However you can fprintf messages in the daemon to stderr, and "
4867 "they will show up if you use C<guestfish -v>."
4871 #: ../src/guestfs.pod:2565
4872 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
4876 #: ../src/guestfs.pod:2567
4878 "Our C source code generally adheres to some basic code-formatting "
4879 "conventions. The existing code base is not totally consistent on this "
4880 "front, but we do prefer that contributed code be formatted similarly. In "
4881 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
4882 "indentation level, and other than that, follow the K&R style."
4886 #: ../src/guestfs.pod:2573
4888 "If you use Emacs, add the following to one of one of your start-up files "
4889 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
4893 #: ../src/guestfs.pod:2576
4896 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
4897 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
4898 " (add-hook 'find-file-hook\n"
4899 " '(lambda () (if (and buffer-file-name\n"
4900 " (string-match \"/libguestfs\\\\>\"\n"
4901 " (buffer-file-name))\n"
4902 " (not (string-equal mode-name \"Change Log\"))\n"
4903 " (not (string-equal mode-name \"Makefile\")))\n"
4904 " (setq indent-tabs-mode nil))))\n"
4909 #: ../src/guestfs.pod:2586
4912 " ;;; When editing C sources in libguestfs, use this style.\n"
4913 " (defun libguestfs-c-mode ()\n"
4914 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
4916 " (c-set-style \"K&R\")\n"
4917 " (setq c-indent-level 2)\n"
4918 " (setq c-basic-offset 2))\n"
4919 " (add-hook 'c-mode-hook\n"
4920 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
4921 " (buffer-file-name))\n"
4922 " (libguestfs-c-mode))))\n"
4927 #: ../src/guestfs.pod:2598
4928 msgid "Enable warnings when compiling (and fix any problems this finds):"
4932 #: ../src/guestfs.pod:2601
4935 " ./configure --enable-gcc-warnings\n"
4940 #: ../src/guestfs.pod:2603
4941 msgid "Useful targets are:"
4945 #: ../src/guestfs.pod:2605
4948 " make syntax-check # checks the syntax of the C code\n"
4949 " make check # runs the test suite\n"
4954 #: ../src/guestfs.pod:2608
4955 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
4959 #: ../src/guestfs.pod:2610
4961 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
4962 "which are used to do shell quoting."
4966 #: ../src/guestfs.pod:2615
4971 #: ../src/guestfs.pod:2617
4973 "Simple shell quoted string. Any spaces or other shell characters are "
4978 #: ../src/guestfs.pod:2620
4983 #: ../src/guestfs.pod:2622
4985 "Same as C<%Q> except the string is treated as a path which is prefixed by "
4990 #: ../src/guestfs.pod:2627 ../fish/guestfish.pod:240 ../fish/guestfish.pod:613
4991 msgid "For example:"
4995 #: ../src/guestfs.pod:2629
4998 " asprintf (&cmd, \"cat %R\", path);\n"
5003 #: ../src/guestfs.pod:2631
5004 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
5008 #: ../src/guestfs.pod:2633
5010 "I<Note:> Do I<not> use these when you are passing parameters to the "
5011 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
5012 "because they are not passed via the shell (instead, straight to exec). You "
5013 "probably want to use the C<sysroot_path()> function however."
5017 #: ../src/guestfs.pod:2639
5018 msgid "SUBMITTING YOUR NEW API ACTIONS"
5022 #: ../src/guestfs.pod:2641
5024 "Submit patches to the mailing list: "
5025 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
5026 "L<rjones@redhat.com>."
5030 #: ../src/guestfs.pod:2645
5031 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
5035 #: ../src/guestfs.pod:2647
5036 msgid "We support i18n (gettext anyhow) in the library."
5040 #: ../src/guestfs.pod:2649
5042 "However many messages come from the daemon, and we don't translate those at "
5043 "the moment. One reason is that the appliance generally has all locale files "
5044 "removed from it, because they take up a lot of space. So we'd have to readd "
5045 "some of those, as well as copying our PO files into the appliance."
5049 #: ../src/guestfs.pod:2655
5051 "Debugging messages are never translated, since they are intended for the "
5056 #: ../src/guestfs.pod:2658
5057 msgid "SOURCE CODE SUBDIRECTORIES"
5061 #: ../src/guestfs.pod:2662 ../src/guestfs-actions.pod:5814 ../fish/guestfish-actions.pod:3908
5062 msgid "C<appliance>"
5066 #: ../src/guestfs.pod:2664
5067 msgid "The libguestfs appliance, build scripts and so on."
5071 #: ../src/guestfs.pod:2666
5072 msgid "C<capitests>"
5076 #: ../src/guestfs.pod:2668
5077 msgid "Automated tests of the C API."
5081 #: ../src/guestfs.pod:2670
5086 #: ../src/guestfs.pod:2672
5088 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
5093 #: ../src/guestfs.pod:2675
5098 #: ../src/guestfs.pod:2677
5099 msgid "Outside contributions, experimental parts."
5103 #: ../src/guestfs.pod:2679
5108 #: ../src/guestfs.pod:2681
5110 "The daemon that runs inside the libguestfs appliance and carries out "
5115 #: ../src/guestfs.pod:2684
5120 #: ../src/guestfs.pod:2686
5121 msgid "L<virt-df(1)> command and documentation."
5125 #: ../src/guestfs.pod:2688
5130 #: ../src/guestfs.pod:2690
5131 msgid "C API example code."
5135 #: ../src/guestfs.pod:2692
5140 #: ../src/guestfs.pod:2694
5142 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
5143 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
5144 "L<virt-tar-out(1)>."
5148 #: ../src/guestfs.pod:2698
5153 #: ../src/guestfs.pod:2700
5154 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
5158 #: ../src/guestfs.pod:2702
5159 msgid "C<generator>"
5163 #: ../src/guestfs.pod:2704
5165 "The crucially important generator, used to automatically generate large "
5166 "amounts of boilerplate C code for things like RPC and bindings."
5170 #: ../src/guestfs.pod:2707
5175 #: ../src/guestfs.pod:2709
5176 msgid "Files used by the test suite."
5180 #: ../src/guestfs.pod:2711
5181 msgid "Some \"phony\" guest images which we test against."
5185 #: ../src/guestfs.pod:2713
5186 msgid "C<inspector>"
5190 #: ../src/guestfs.pod:2715
5191 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
5195 #: ../src/guestfs.pod:2717
5200 #: ../src/guestfs.pod:2719
5201 msgid "Logo used on the website. The fish is called Arthur by the way."
5205 #: ../src/guestfs.pod:2721
5210 #: ../src/guestfs.pod:2723
5211 msgid "M4 macros used by autoconf."
5215 #: ../src/guestfs.pod:2725
5220 #: ../src/guestfs.pod:2727
5221 msgid "Translations of simple gettext strings."
5225 #: ../src/guestfs.pod:2729
5230 #: ../src/guestfs.pod:2731
5232 "The build infrastructure and PO files for translations of manpages and POD "
5233 "files. Eventually this will be combined with the C<po> directory, but that "
5234 "is rather complicated."
5238 #: ../src/guestfs.pod:2735
5239 msgid "C<regressions>"
5243 #: ../src/guestfs.pod:2737
5244 msgid "Regression tests."
5248 #: ../src/guestfs.pod:2739
5253 #: ../src/guestfs.pod:2741
5254 msgid "L<virt-rescue(1)> command and documentation."
5258 #: ../src/guestfs.pod:2743
5263 #: ../src/guestfs.pod:2745
5264 msgid "Source code to the C library."
5268 #: ../src/guestfs.pod:2747
5273 #: ../src/guestfs.pod:2749
5274 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
5278 #: ../src/guestfs.pod:2751
5279 msgid "C<test-tool>"
5283 #: ../src/guestfs.pod:2753
5285 "Test tool for end users to test if their qemu/kernel combination will work "
5290 #: ../src/guestfs.pod:2756
5295 #: ../src/guestfs.pod:2758
5300 #: ../src/guestfs.pod:2760
5305 #: ../src/guestfs.pod:2762
5310 #: ../src/guestfs.pod:2764
5315 #: ../src/guestfs.pod:2766
5320 #: ../src/guestfs.pod:2768
5325 #: ../src/guestfs.pod:2770
5330 #: ../src/guestfs.pod:2772
5331 msgid "Language bindings."
5335 #: ../src/guestfs.pod:2776 ../fish/guestfish.pod:1015 ../test-tool/libguestfs-test-tool.pod:82 ../tools/virt-edit.pl:476
5336 msgid "ENVIRONMENT VARIABLES"
5340 #: ../src/guestfs.pod:2780 ../fish/guestfish.pod:1041
5341 msgid "LIBGUESTFS_APPEND"
5345 #: ../src/guestfs.pod:2782 ../fish/guestfish.pod:1043
5346 msgid "Pass additional options to the guest kernel."
5350 #: ../src/guestfs.pod:2784 ../fish/guestfish.pod:1045
5351 msgid "LIBGUESTFS_DEBUG"
5355 #: ../src/guestfs.pod:2786
5357 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
5358 "effect as calling C<guestfs_set_verbose (g, 1)>."
5362 #: ../src/guestfs.pod:2789 ../fish/guestfish.pod:1050
5363 msgid "LIBGUESTFS_MEMSIZE"
5367 #: ../src/guestfs.pod:2791 ../fish/guestfish.pod:1052
5368 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
5372 #: ../src/guestfs.pod:2794 ../fish/guestfish.pod:1055
5375 " LIBGUESTFS_MEMSIZE=700\n"
5380 #: ../src/guestfs.pod:2796 ../fish/guestfish.pod:1057
5381 msgid "LIBGUESTFS_PATH"
5385 #: ../src/guestfs.pod:2798
5387 "Set the path that libguestfs uses to search for a supermin appliance. See "
5388 "the discussion of paths in section L</PATH> above."
5392 #: ../src/guestfs.pod:2801 ../fish/guestfish.pod:1062
5393 msgid "LIBGUESTFS_QEMU"
5397 #: ../src/guestfs.pod:2803 ../fish/guestfish.pod:1064
5399 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
5400 "which was found at compile time by the configure script is used."
5404 #: ../src/guestfs.pod:2807
5405 msgid "See also L</QEMU WRAPPERS> above."
5409 #: ../src/guestfs.pod:2809 ../fish/guestfish.pod:1068
5410 msgid "LIBGUESTFS_TRACE"
5414 #: ../src/guestfs.pod:2811
5416 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
5417 "effect as calling C<guestfs_set_trace (g, 1)>."
5421 #: ../src/guestfs.pod:2814 ../fish/guestfish.pod:1077
5426 #: ../src/guestfs.pod:2816 ../fish/guestfish.pod:1079
5428 "Location of temporary directory, defaults to C</tmp> except for the cached "
5429 "supermin appliance which defaults to C</var/tmp>."
5433 #: ../src/guestfs.pod:2819 ../fish/guestfish.pod:1082
5435 "If libguestfs was compiled to use the supermin appliance then the real "
5436 "appliance is cached in this directory, shared between all handles belonging "
5437 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
5438 "use in case C</var/tmp> is not large enough."
5442 #: ../src/guestfs.pod:2827 ../fish/guestfish.pod:1149 ../test-tool/libguestfs-test-tool.pod:87 ../fuse/guestmount.pod:267 ../tools/virt-edit.pl:496 ../tools/virt-win-reg.pl:572 ../tools/virt-list-filesystems.pl:189 ../tools/virt-tar.pl:286 ../tools/virt-make-fs.pl:539 ../tools/virt-list-partitions.pl:257
5447 #: ../src/guestfs.pod:2829
5449 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, "
5450 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, "
5451 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
5452 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
5453 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
5454 "L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
5455 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, "
5456 "L<http://libguestfs.org/>."
5460 #: ../src/guestfs.pod:2856
5462 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
5463 "L<lvm(8)>, L<disktype(1)>."
5467 #: ../src/guestfs.pod:2863 ../tools/virt-win-reg.pl:587 ../tools/virt-make-fs.pl:553
5472 #: ../src/guestfs.pod:2865
5473 msgid "To get a list of bugs against libguestfs use this link:"
5477 #: ../src/guestfs.pod:2867
5478 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
5482 #: ../src/guestfs.pod:2869
5483 msgid "To report a new bug against libguestfs use this link:"
5487 #: ../src/guestfs.pod:2871
5488 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
5492 #: ../src/guestfs.pod:2873
5493 msgid "When reporting a bug, please check:"
5497 #: ../src/guestfs.pod:2879
5498 msgid "That the bug hasn't been reported already."
5502 #: ../src/guestfs.pod:2883
5503 msgid "That you are testing a recent version."
5507 #: ../src/guestfs.pod:2887
5508 msgid "Describe the bug accurately, and give a way to reproduce it."
5512 #: ../src/guestfs.pod:2891
5514 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
5519 #: ../src/guestfs.pod:2896 ../fish/guestfish.pod:1172 ../test-tool/libguestfs-test-tool.pod:93 ../fuse/guestmount.pod:278
5524 #: ../src/guestfs.pod:2898 ../fish/guestfish.pod:1174 ../test-tool/libguestfs-test-tool.pod:95 ../fuse/guestmount.pod:280
5525 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
5529 #: ../src/guestfs.pod:2900 ../fish/guestfish.pod:1176 ../test-tool/libguestfs-test-tool.pod:97 ../fuse/guestmount.pod:282 ../tools/virt-edit.pl:514 ../tools/virt-win-reg.pl:602 ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:568 ../tools/virt-list-partitions.pl:273
5534 #: ../src/guestfs.pod:2902 ../fish/guestfish.pod:1178 ../test-tool/libguestfs-test-tool.pod:99
5535 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5539 #: ../src/guestfs.pod:2905
5541 "This library is free software; you can redistribute it and/or modify it "
5542 "under the terms of the GNU Lesser General Public License as published by the "
5543 "Free Software Foundation; either version 2 of the License, or (at your "
5544 "option) any later version."
5548 #: ../src/guestfs.pod:2910
5550 "This library is distributed in the hope that it will be useful, but WITHOUT "
5551 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
5552 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
5557 #: ../src/guestfs.pod:2915
5559 "You should have received a copy of the GNU Lesser General Public License "
5560 "along with this library; if not, write to the Free Software Foundation, "
5561 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
5565 #: ../src/guestfs-actions.pod:1
5566 msgid "guestfs_add_cdrom"
5570 #: ../src/guestfs-actions.pod:3
5574 " guestfs_add_cdrom (guestfs_h *g,\n"
5575 " const char *filename);\n"
5580 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
5581 msgid "This function adds a virtual CD-ROM disk image to the guest."
5585 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
5586 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
5590 #: ../src/guestfs-actions.pod:17
5592 "This call checks for the existence of C<filename>. This stops you from "
5593 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5594 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
5599 #: ../src/guestfs-actions.pod:24
5601 "If you just want to add an ISO file (often you use this as an efficient way "
5602 "to transfer large files into the guest), then you should probably use "
5603 "C<guestfs_add_drive_ro> instead."
5607 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:134 ../src/guestfs-actions.pod:195 ../src/guestfs-actions.pod:232 ../src/guestfs-actions.pod:246 ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:287 ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:436 ../src/guestfs-actions.pod:450 ../src/guestfs-actions.pod:495 ../src/guestfs-actions.pod:523 ../src/guestfs-actions.pod:541 ../src/guestfs-actions.pod:608 ../src/guestfs-actions.pod:641 ../src/guestfs-actions.pod:655 ../src/guestfs-actions.pod:670 ../src/guestfs-actions.pod:769 ../src/guestfs-actions.pod:787 ../src/guestfs-actions.pod:801 ../src/guestfs-actions.pod:815 ../src/guestfs-actions.pod:976 ../src/guestfs-actions.pod:996 ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1098 ../src/guestfs-actions.pod:1116 ../src/guestfs-actions.pod:1135 ../src/guestfs-actions.pod:1149 ../src/guestfs-actions.pod:1169 ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1270 ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1337 ../src/guestfs-actions.pod:1443 ../src/guestfs-actions.pod:1477 ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:2266 ../src/guestfs-actions.pod:2410 ../src/guestfs-actions.pod:2471 ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:3459 ../src/guestfs-actions.pod:3474 ../src/guestfs-actions.pod:3499 ../src/guestfs-actions.pod:3654 ../src/guestfs-actions.pod:3668 ../src/guestfs-actions.pod:3681 ../src/guestfs-actions.pod:3695 ../src/guestfs-actions.pod:3710 ../src/guestfs-actions.pod:3746 ../src/guestfs-actions.pod:3818 ../src/guestfs-actions.pod:3838 ../src/guestfs-actions.pod:3855 ../src/guestfs-actions.pod:3878 ../src/guestfs-actions.pod:3901 ../src/guestfs-actions.pod:3933 ../src/guestfs-actions.pod:3952 ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:4006 ../src/guestfs-actions.pod:4018 ../src/guestfs-actions.pod:4054 ../src/guestfs-actions.pod:4070 ../src/guestfs-actions.pod:4083 ../src/guestfs-actions.pod:4098 ../src/guestfs-actions.pod:4115 ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:4228 ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4292 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4328 ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:4372 ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:4404 ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:4482 ../src/guestfs-actions.pod:4555 ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:4624 ../src/guestfs-actions.pod:4636 ../src/guestfs-actions.pod:4653 ../src/guestfs-actions.pod:4666 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:4731 ../src/guestfs-actions.pod:4746 ../src/guestfs-actions.pod:4766 ../src/guestfs-actions.pod:4780 ../src/guestfs-actions.pod:4797 ../src/guestfs-actions.pod:4846 ../src/guestfs-actions.pod:4883 ../src/guestfs-actions.pod:4897 ../src/guestfs-actions.pod:4925 ../src/guestfs-actions.pod:4942 ../src/guestfs-actions.pod:4960 ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:5151 ../src/guestfs-actions.pod:5173 ../src/guestfs-actions.pod:5191 ../src/guestfs-actions.pod:5223 ../src/guestfs-actions.pod:5289 ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:5319 ../src/guestfs-actions.pod:5333 ../src/guestfs-actions.pod:5622 ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5672 ../src/guestfs-actions.pod:5684 ../src/guestfs-actions.pod:5698 ../src/guestfs-actions.pod:5710 ../src/guestfs-actions.pod:5724 ../src/guestfs-actions.pod:5740 ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:5780 ../src/guestfs-actions.pod:5799 ../src/guestfs-actions.pod:5829 ../src/guestfs-actions.pod:5845 ../src/guestfs-actions.pod:5868 ../src/guestfs-actions.pod:5886 ../src/guestfs-actions.pod:5905 ../src/guestfs-actions.pod:5926 ../src/guestfs-actions.pod:5945 ../src/guestfs-actions.pod:5962 ../src/guestfs-actions.pod:5990 ../src/guestfs-actions.pod:6014 ../src/guestfs-actions.pod:6033 ../src/guestfs-actions.pod:6057 ../src/guestfs-actions.pod:6076 ../src/guestfs-actions.pod:6091 ../src/guestfs-actions.pod:6110 ../src/guestfs-actions.pod:6147 ../src/guestfs-actions.pod:6170 ../src/guestfs-actions.pod:6196 ../src/guestfs-actions.pod:6304 ../src/guestfs-actions.pod:6425 ../src/guestfs-actions.pod:6437 ../src/guestfs-actions.pod:6450 ../src/guestfs-actions.pod:6463 ../src/guestfs-actions.pod:6485 ../src/guestfs-actions.pod:6498 ../src/guestfs-actions.pod:6511 ../src/guestfs-actions.pod:6524 ../src/guestfs-actions.pod:6539 ../src/guestfs-actions.pod:6598 ../src/guestfs-actions.pod:6615 ../src/guestfs-actions.pod:6631 ../src/guestfs-actions.pod:6647 ../src/guestfs-actions.pod:6664 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6697 ../src/guestfs-actions.pod:6733 ../src/guestfs-actions.pod:6747 ../src/guestfs-actions.pod:6788 ../src/guestfs-actions.pod:6801 ../src/guestfs-actions.pod:6819 ../src/guestfs-actions.pod:6853 ../src/guestfs-actions.pod:6889 ../src/guestfs-actions.pod:7008 ../src/guestfs-actions.pod:7026 ../src/guestfs-actions.pod:7040 ../src/guestfs-actions.pod:7095 ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7153 ../src/guestfs-actions.pod:7186 ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7266 ../src/guestfs-actions.pod:7332 ../src/guestfs-actions.pod:7351 ../src/guestfs-actions.pod:7380
5608 msgid "This function returns 0 on success or -1 on error."
5612 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:248 ../src/guestfs-actions.pod:269 ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:158 ../fish/guestfish-actions.pod:172
5614 "This function is deprecated. In new code, use the C<add_drive_opts> call "
5619 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:251 ../src/guestfs-actions.pod:272 ../src/guestfs-actions.pod:1448 ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:4429 ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7443 ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:175 ../fish/guestfish-actions.pod:956 ../fish/guestfish-actions.pod:1319 ../fish/guestfish-actions.pod:1333 ../fish/guestfish-actions.pod:3008 ../fish/guestfish-actions.pod:4866 ../fish/guestfish-actions.pod:4963
5621 "Deprecated functions will not be removed from the API, but the fact that "
5622 "they are deprecated indicates that there are problems with correct use of "
5627 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:136 ../src/guestfs-actions.pod:1100 ../src/guestfs-actions.pod:1916 ../src/guestfs-actions.pod:2014 ../src/guestfs-actions.pod:2117 ../src/guestfs-actions.pod:3461 ../src/guestfs-actions.pod:3481 ../src/guestfs-actions.pod:4733 ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:6078 ../src/guestfs-actions.pod:6541 ../src/guestfs-actions.pod:6666 ../src/guestfs-actions.pod:7188
5628 msgid "(Added in 0.3)"
5632 #: ../src/guestfs-actions.pod:41
5633 msgid "guestfs_add_domain"
5637 #: ../src/guestfs-actions.pod:43
5641 " guestfs_add_domain (guestfs_h *g,\n"
5642 " const char *dom,\n"
5648 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:145 ../src/guestfs-actions.pod:4443
5650 "You may supply a list of optional arguments to this call. Use zero or more "
5651 "of the following pairs of parameters, and terminate the list with C<-1> on "
5652 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
5656 #: ../src/guestfs-actions.pod:53
5659 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
5660 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
5661 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
5662 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
5667 #: ../src/guestfs-actions.pod:58
5669 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5670 "It works by connecting to libvirt, requesting the domain and domain XML from "
5671 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
5676 #: ../src/guestfs-actions.pod:63 ../fish/guestfish-actions.pod:46
5678 "The number of disks added is returned. This operation is atomic: if an "
5679 "error is returned, then no disks are added."
5683 #: ../src/guestfs-actions.pod:66 ../fish/guestfish-actions.pod:49
5685 "This function does some minimal checks to make sure the libvirt domain is "
5686 "not running (unless C<readonly> is true). In a future version we will try "
5687 "to acquire the libvirt lock on each disk."
5691 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:53
5693 "Disks must be accessible locally. This often means that adding disks from a "
5694 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5695 "unless those disks are accessible via the same device path locally too."
5699 #: ../src/guestfs-actions.pod:75 ../fish/guestfish-actions.pod:58
5701 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5702 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5703 "default libvirt URI (or one set through an environment variable, see the "
5704 "libvirt documentation for full details)."
5708 #: ../src/guestfs-actions.pod:81 ../fish/guestfish-actions.pod:64
5710 "The optional C<live> flag controls whether this call will try to connect to "
5711 "a running virtual machine C<guestfsd> process if it sees a suitable "
5712 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5713 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5714 "DAEMONS> for more information."
5718 #: ../src/guestfs-actions.pod:88
5720 "The other optional parameters are passed directly through to "
5721 "C<guestfs_add_drive_opts>."
5725 #: ../src/guestfs-actions.pod:91 ../src/guestfs-actions.pod:344 ../src/guestfs-actions.pod:509 ../src/guestfs-actions.pod:687 ../src/guestfs-actions.pod:718 ../src/guestfs-actions.pod:736 ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:1315 ../src/guestfs-actions.pod:1674 ../src/guestfs-actions.pod:1877 ../src/guestfs-actions.pod:1986 ../src/guestfs-actions.pod:2026 ../src/guestfs-actions.pod:2081 ../src/guestfs-actions.pod:2104 ../src/guestfs-actions.pod:2397 ../src/guestfs-actions.pod:2780 ../src/guestfs-actions.pod:2801 ../src/guestfs-actions.pod:4869 ../src/guestfs-actions.pod:4997 ../src/guestfs-actions.pod:5403 ../src/guestfs-actions.pod:5429 ../src/guestfs-actions.pod:6774 ../src/guestfs-actions.pod:7199 ../src/guestfs-actions.pod:7212 ../src/guestfs-actions.pod:7225
5726 msgid "On error this function returns -1."
5730 #: ../src/guestfs-actions.pod:93
5731 msgid "(Added in 1.7.4)"
5735 #: ../src/guestfs-actions.pod:95
5736 msgid "guestfs_add_domain_va"
5740 #: ../src/guestfs-actions.pod:97
5744 " guestfs_add_domain_va (guestfs_h *g,\n"
5745 " const char *dom,\n"
5751 #: ../src/guestfs-actions.pod:102
5752 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
5756 #: ../src/guestfs-actions.pod:104 ../src/guestfs-actions.pod:115 ../src/guestfs-actions.pod:208 ../src/guestfs-actions.pod:219 ../src/guestfs-actions.pod:4496 ../src/guestfs-actions.pod:4508
5757 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
5761 #: ../src/guestfs-actions.pod:106
5762 msgid "guestfs_add_domain_argv"
5766 #: ../src/guestfs-actions.pod:108
5770 " guestfs_add_domain_argv (guestfs_h *g,\n"
5771 " const char *dom,\n"
5772 " const struct guestfs_add_domain_argv *optargs);\n"
5777 #: ../src/guestfs-actions.pod:113
5778 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
5782 #: ../src/guestfs-actions.pod:117
5783 msgid "guestfs_add_drive"
5787 #: ../src/guestfs-actions.pod:119
5791 " guestfs_add_drive (guestfs_h *g,\n"
5792 " const char *filename);\n"
5797 #: ../src/guestfs-actions.pod:123
5799 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
5800 "optional parameters, so the disk is added writable, with the format being "
5801 "detected automatically."
5805 #: ../src/guestfs-actions.pod:127
5807 "Automatic detection of the format opens you up to a potential security hole "
5808 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5809 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5810 "you should think about replacing calls to this function with calls to "
5811 "C<guestfs_add_drive_opts>, and specifying the format."
5815 #: ../src/guestfs-actions.pod:138
5816 msgid "guestfs_add_drive_opts"
5820 #: ../src/guestfs-actions.pod:140
5824 " guestfs_add_drive_opts (guestfs_h *g,\n"
5825 " const char *filename,\n"
5831 #: ../src/guestfs-actions.pod:150
5834 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
5835 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
5836 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
5841 #: ../src/guestfs-actions.pod:154 ../fish/guestfish-actions.pod:97
5843 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5844 "The first time you call this function, the disk appears as C</dev/sda>, the "
5845 "second time as C</dev/sdb>, and so on."
5849 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:102
5851 "You don't necessarily need to be root when using libguestfs. However you "
5852 "obviously do need sufficient permissions to access the filename for whatever "
5853 "operations you want to perform (ie. read access if you just want to read the "
5854 "image or write access if you want to modify the image)."
5858 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:108
5859 msgid "This call checks that C<filename> exists."
5863 #: ../src/guestfs-actions.pod:167 ../src/guestfs-actions.pod:4454 ../fish/guestfish-actions.pod:110 ../fish/guestfish-actions.pod:3019
5864 msgid "The optional arguments are:"
5868 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:114
5873 #: ../src/guestfs-actions.pod:173 ../fish/guestfish-actions.pod:116
5875 "If true then the image is treated as read-only. Writes are still allowed, "
5876 "but they are stored in a temporary snapshot overlay which is discarded at "
5877 "the end. The disk that you add is not modified."
5881 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:120
5886 #: ../src/guestfs-actions.pod:179
5888 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
5889 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
5890 "Possible formats include C<raw> and C<qcow2>."
5894 #: ../src/guestfs-actions.pod:183 ../fish/guestfish-actions.pod:126
5896 "Automatic detection of the format opens you up to a potential security hole "
5897 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5898 "RHBZ#642934. Specifying the format closes this security hole."
5902 #: ../src/guestfs-actions.pod:188 ../fish/guestfish-actions.pod:131
5907 #: ../src/guestfs-actions.pod:190
5909 "This rarely-used option lets you emulate the behaviour of the deprecated "
5910 "C<guestfs_add_drive_with_if> call (q.v.)"
5914 #: ../src/guestfs-actions.pod:197
5915 msgid "(Added in 1.5.23)"
5919 #: ../src/guestfs-actions.pod:199
5920 msgid "guestfs_add_drive_opts_va"
5924 #: ../src/guestfs-actions.pod:201
5928 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
5929 " const char *filename,\n"
5935 #: ../src/guestfs-actions.pod:206
5936 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
5940 #: ../src/guestfs-actions.pod:210
5941 msgid "guestfs_add_drive_opts_argv"
5945 #: ../src/guestfs-actions.pod:212
5949 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
5950 " const char *filename,\n"
5951 " const struct guestfs_add_drive_opts_argv "
5957 #: ../src/guestfs-actions.pod:217
5958 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
5962 #: ../src/guestfs-actions.pod:221
5963 msgid "guestfs_add_drive_ro"
5967 #: ../src/guestfs-actions.pod:223
5971 " guestfs_add_drive_ro (guestfs_h *g,\n"
5972 " const char *filename);\n"
5977 #: ../src/guestfs-actions.pod:227
5979 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
5980 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
5981 "disk is added read-only, with the format being detected automatically."
5985 #: ../src/guestfs-actions.pod:234
5986 msgid "(Added in 1.0.38)"
5990 #: ../src/guestfs-actions.pod:236
5991 msgid "guestfs_add_drive_ro_with_if"
5995 #: ../src/guestfs-actions.pod:238
5999 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
6000 " const char *filename,\n"
6001 " const char *iface);\n"
6006 #: ../src/guestfs-actions.pod:243
6008 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
6009 "QEMU interface emulation to use at run time."
6013 #: ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276 ../src/guestfs-actions.pod:2356
6014 msgid "(Added in 1.0.84)"
6018 #: ../src/guestfs-actions.pod:257
6019 msgid "guestfs_add_drive_with_if"
6023 #: ../src/guestfs-actions.pod:259
6027 " guestfs_add_drive_with_if (guestfs_h *g,\n"
6028 " const char *filename,\n"
6029 " const char *iface);\n"
6034 #: ../src/guestfs-actions.pod:264
6036 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
6037 "QEMU interface emulation to use at run time."
6041 #: ../src/guestfs-actions.pod:278
6042 msgid "guestfs_aug_clear"
6046 #: ../src/guestfs-actions.pod:280
6050 " guestfs_aug_clear (guestfs_h *g,\n"
6051 " const char *augpath);\n"
6056 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:183
6058 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6059 "L<augtool(1)> C<clear> command."
6063 #: ../src/guestfs-actions.pod:289 ../src/guestfs-actions.pod:2106
6064 msgid "(Added in 1.3.4)"
6068 #: ../src/guestfs-actions.pod:291
6069 msgid "guestfs_aug_close"
6073 #: ../src/guestfs-actions.pod:293
6077 " guestfs_aug_close (guestfs_h *g);\n"
6082 #: ../src/guestfs-actions.pod:296
6084 "Close the current Augeas handle and free up any resources used by it. After "
6085 "calling this, you have to call C<guestfs_aug_init> again before you can use "
6086 "any other Augeas functions."
6090 #: ../src/guestfs-actions.pod:303 ../src/guestfs-actions.pod:328 ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360 ../src/guestfs-actions.pod:418 ../src/guestfs-actions.pod:438 ../src/guestfs-actions.pod:452 ../src/guestfs-actions.pod:483 ../src/guestfs-actions.pod:497 ../src/guestfs-actions.pod:511 ../src/guestfs-actions.pod:525 ../src/guestfs-actions.pod:543 ../src/guestfs-actions.pod:5480
6091 msgid "(Added in 0.7)"
6095 #: ../src/guestfs-actions.pod:305
6096 msgid "guestfs_aug_defnode"
6100 #: ../src/guestfs-actions.pod:307
6103 " struct guestfs_int_bool *\n"
6104 " guestfs_aug_defnode (guestfs_h *g,\n"
6105 " const char *name,\n"
6106 " const char *expr,\n"
6107 " const char *val);\n"
6112 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:199
6113 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6117 #: ../src/guestfs-actions.pod:316
6119 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6120 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
6121 "containing that single node."
6125 #: ../src/guestfs-actions.pod:320 ../fish/guestfish-actions.pod:206
6127 "On success this returns a pair containing the number of nodes in the "
6128 "nodeset, and a boolean flag if a node was created."
6132 #: ../src/guestfs-actions.pod:324
6134 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
6135 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
6139 #: ../src/guestfs-actions.pod:330
6140 msgid "guestfs_aug_defvar"
6144 #: ../src/guestfs-actions.pod:332
6148 " guestfs_aug_defvar (guestfs_h *g,\n"
6149 " const char *name,\n"
6150 " const char *expr);\n"
6155 #: ../src/guestfs-actions.pod:337 ../fish/guestfish-actions.pod:214
6157 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6158 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6162 #: ../src/guestfs-actions.pod:341 ../fish/guestfish-actions.pod:218
6164 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6165 "evaluates to something which is not a nodeset."
6169 #: ../src/guestfs-actions.pod:348
6170 msgid "guestfs_aug_get"
6174 #: ../src/guestfs-actions.pod:350
6178 " guestfs_aug_get (guestfs_h *g,\n"
6179 " const char *augpath);\n"
6184 #: ../src/guestfs-actions.pod:354 ../fish/guestfish-actions.pod:225
6186 "Look up the value associated with C<path>. If C<path> matches exactly one "
6187 "node, the C<value> is returned."
6191 #: ../src/guestfs-actions.pod:357 ../src/guestfs-actions.pod:857 ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:935 ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1054 ../src/guestfs-actions.pod:1184 ../src/guestfs-actions.pod:1201 ../src/guestfs-actions.pod:1220 ../src/guestfs-actions.pod:1354 ../src/guestfs-actions.pod:1545 ../src/guestfs-actions.pod:1657 ../src/guestfs-actions.pod:1820 ../src/guestfs-actions.pod:1837 ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1938 ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:2129 ../src/guestfs-actions.pod:2321 ../src/guestfs-actions.pod:2528 ../src/guestfs-actions.pod:2621 ../src/guestfs-actions.pod:2732 ../src/guestfs-actions.pod:2752 ../src/guestfs-actions.pod:2872 ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:2927 ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3024 ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3068 ../src/guestfs-actions.pod:3640 ../src/guestfs-actions.pod:3990 ../src/guestfs-actions.pod:4160 ../src/guestfs-actions.pod:4270 ../src/guestfs-actions.pod:5015 ../src/guestfs-actions.pod:5208 ../src/guestfs-actions.pod:5378 ../src/guestfs-actions.pod:5556 ../src/guestfs-actions.pod:5605 ../src/guestfs-actions.pod:6217 ../src/guestfs-actions.pod:6233 ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6274 ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:6967 ../src/guestfs-actions.pod:6985 ../src/guestfs-actions.pod:7165 ../src/guestfs-actions.pod:7437
6193 "This function returns a string, or NULL on error. I<The caller must free "
6194 "the returned string after use>."
6198 #: ../src/guestfs-actions.pod:362
6199 msgid "guestfs_aug_init"
6203 #: ../src/guestfs-actions.pod:364
6207 " guestfs_aug_init (guestfs_h *g,\n"
6208 " const char *root,\n"
6214 #: ../src/guestfs-actions.pod:369 ../fish/guestfish-actions.pod:232
6216 "Create a new Augeas handle for editing configuration files. If there was "
6217 "any previous Augeas handle associated with this guestfs session, then it is "
6222 #: ../src/guestfs-actions.pod:373
6223 msgid "You must call this before using any other C<guestfs_aug_*> commands."
6227 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:239
6228 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6232 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:242
6234 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6235 "logical I<or> of the following integers:"
6239 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:248
6240 msgid "C<AUG_SAVE_BACKUP> = 1"
6244 #: ../src/guestfs-actions.pod:387 ../fish/guestfish-actions.pod:250
6245 msgid "Keep the original file with a C<.augsave> extension."
6249 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:252
6250 msgid "C<AUG_SAVE_NEWFILE> = 2"
6254 #: ../src/guestfs-actions.pod:391 ../fish/guestfish-actions.pod:254
6256 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6257 "original. Overrides C<AUG_SAVE_BACKUP>."
6261 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:257
6262 msgid "C<AUG_TYPE_CHECK> = 4"
6266 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:259
6267 msgid "Typecheck lenses (can be expensive)."
6271 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:261
6272 msgid "C<AUG_NO_STDINC> = 8"
6276 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:263
6277 msgid "Do not use standard load path for modules."
6281 #: ../src/guestfs-actions.pod:402 ../fish/guestfish-actions.pod:265
6282 msgid "C<AUG_SAVE_NOOP> = 16"
6286 #: ../src/guestfs-actions.pod:404 ../fish/guestfish-actions.pod:267
6287 msgid "Make save a no-op, just record what would have been changed."
6291 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:269
6292 msgid "C<AUG_NO_LOAD> = 32"
6296 #: ../src/guestfs-actions.pod:408
6297 msgid "Do not load the tree in C<guestfs_aug_init>."
6301 #: ../src/guestfs-actions.pod:412
6302 msgid "To close the handle, you can call C<guestfs_aug_close>."
6306 #: ../src/guestfs-actions.pod:414 ../fish/guestfish-actions.pod:277
6307 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6311 #: ../src/guestfs-actions.pod:420
6312 msgid "guestfs_aug_insert"
6316 #: ../src/guestfs-actions.pod:422
6320 " guestfs_aug_insert (guestfs_h *g,\n"
6321 " const char *augpath,\n"
6322 " const char *label,\n"
6328 #: ../src/guestfs-actions.pod:428 ../fish/guestfish-actions.pod:283
6330 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6331 "or after C<path> (depending on the boolean flag C<before>)."
6335 #: ../src/guestfs-actions.pod:432 ../fish/guestfish-actions.pod:287
6337 "C<path> must match exactly one existing node in the tree, and C<label> must "
6338 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6342 #: ../src/guestfs-actions.pod:440
6343 msgid "guestfs_aug_load"
6347 #: ../src/guestfs-actions.pod:442
6351 " guestfs_aug_load (guestfs_h *g);\n"
6356 #: ../src/guestfs-actions.pod:445 ../fish/guestfish-actions.pod:295
6357 msgid "Load files into the tree."
6361 #: ../src/guestfs-actions.pod:447 ../fish/guestfish-actions.pod:297
6362 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6366 #: ../src/guestfs-actions.pod:454
6367 msgid "guestfs_aug_ls"
6371 #: ../src/guestfs-actions.pod:456
6375 " guestfs_aug_ls (guestfs_h *g,\n"
6376 " const char *augpath);\n"
6381 #: ../src/guestfs-actions.pod:460
6383 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
6384 "sorting the resulting nodes into alphabetical order."
6388 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:479 ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:1073 ../src/guestfs-actions.pod:1369 ../src/guestfs-actions.pod:1388 ../src/guestfs-actions.pod:1491 ../src/guestfs-actions.pod:1510 ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:2201 ../src/guestfs-actions.pod:2217 ../src/guestfs-actions.pod:2236 ../src/guestfs-actions.pod:2279 ../src/guestfs-actions.pod:2303 ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2981 ../src/guestfs-actions.pod:3270 ../src/guestfs-actions.pod:3560 ../src/guestfs-actions.pod:3622 ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:4830 ../src/guestfs-actions.pod:5350 ../src/guestfs-actions.pod:5476 ../src/guestfs-actions.pod:5590 ../src/guestfs-actions.pod:6290 ../src/guestfs-actions.pod:6351 ../src/guestfs-actions.pod:6406 ../src/guestfs-actions.pod:6552 ../src/guestfs-actions.pod:6576 ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7078 ../src/guestfs-actions.pod:7125 ../src/guestfs-actions.pod:7290 ../src/guestfs-actions.pod:7309 ../src/guestfs-actions.pod:7394 ../src/guestfs-actions.pod:7413 ../src/guestfs-actions.pod:7459 ../src/guestfs-actions.pod:7478
6390 "This function returns a NULL-terminated array of strings (like "
6391 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
6392 "strings and the array after use>."
6396 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:998 ../src/guestfs-actions.pod:1016 ../src/guestfs-actions.pod:1426 ../src/guestfs-actions.pod:3348 ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:4023 ../src/guestfs-actions.pod:4210 ../src/guestfs-actions.pod:4243 ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4834 ../src/guestfs-actions.pod:5291 ../src/guestfs-actions.pod:5686 ../src/guestfs-actions.pod:5700 ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6790 ../src/guestfs-actions.pod:6803 ../src/guestfs-actions.pod:7042 ../src/guestfs-actions.pod:7278
6397 msgid "(Added in 0.8)"
6401 #: ../src/guestfs-actions.pod:469
6402 msgid "guestfs_aug_match"
6406 #: ../src/guestfs-actions.pod:471
6410 " guestfs_aug_match (guestfs_h *g,\n"
6411 " const char *augpath);\n"
6416 #: ../src/guestfs-actions.pod:475 ../fish/guestfish-actions.pod:311
6418 "Returns a list of paths which match the path expression C<path>. The "
6419 "returned paths are sufficiently qualified so that they match exactly one "
6420 "node in the current tree."
6424 #: ../src/guestfs-actions.pod:485
6425 msgid "guestfs_aug_mv"
6429 #: ../src/guestfs-actions.pod:487
6433 " guestfs_aug_mv (guestfs_h *g,\n"
6434 " const char *src,\n"
6435 " const char *dest);\n"
6440 #: ../src/guestfs-actions.pod:492 ../fish/guestfish-actions.pod:319
6442 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6443 "C<dest> is overwritten if it exists."
6447 #: ../src/guestfs-actions.pod:499
6448 msgid "guestfs_aug_rm"
6452 #: ../src/guestfs-actions.pod:501
6456 " guestfs_aug_rm (guestfs_h *g,\n"
6457 " const char *augpath);\n"
6462 #: ../src/guestfs-actions.pod:505 ../fish/guestfish-actions.pod:326
6463 msgid "Remove C<path> and all of its children."
6467 #: ../src/guestfs-actions.pod:507 ../fish/guestfish-actions.pod:328
6468 msgid "On success this returns the number of entries which were removed."
6472 #: ../src/guestfs-actions.pod:513
6473 msgid "guestfs_aug_save"
6477 #: ../src/guestfs-actions.pod:515
6481 " guestfs_aug_save (guestfs_h *g);\n"
6486 #: ../src/guestfs-actions.pod:518 ../fish/guestfish-actions.pod:334
6487 msgid "This writes all pending changes to disk."
6491 #: ../src/guestfs-actions.pod:520
6493 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
6498 #: ../src/guestfs-actions.pod:527
6499 msgid "guestfs_aug_set"
6503 #: ../src/guestfs-actions.pod:529
6507 " guestfs_aug_set (guestfs_h *g,\n"
6508 " const char *augpath,\n"
6509 " const char *val);\n"
6514 #: ../src/guestfs-actions.pod:534 ../fish/guestfish-actions.pod:343
6515 msgid "Set the value associated with C<path> to C<val>."
6519 #: ../src/guestfs-actions.pod:536
6521 "In the Augeas API, it is possible to clear a node by setting the value to "
6522 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6523 "this call. Instead you must use the C<guestfs_aug_clear> call."
6527 #: ../src/guestfs-actions.pod:545
6528 msgid "guestfs_available"
6532 #: ../src/guestfs-actions.pod:547
6536 " guestfs_available (guestfs_h *g,\n"
6537 " char *const *groups);\n"
6542 #: ../src/guestfs-actions.pod:551 ../fish/guestfish-actions.pod:354
6544 "This command is used to check the availability of some groups of "
6545 "functionality in the appliance, which not all builds of the libguestfs "
6546 "appliance will be able to provide."
6550 #: ../src/guestfs-actions.pod:555
6552 "The libguestfs groups, and the functions that those groups correspond to, "
6553 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6554 "runtime by calling C<guestfs_available_all_groups>."
6558 #: ../src/guestfs-actions.pod:560 ../fish/guestfish-actions.pod:363
6560 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6561 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6562 "and Augeas (configuration file editing) functions."
6566 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:368
6567 msgid "The command returns no error if I<all> requested groups are available."
6571 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:370
6573 "It fails with an error if one or more of the requested groups is unavailable "
6578 #: ../src/guestfs-actions.pod:570 ../fish/guestfish-actions.pod:373
6580 "If an unknown group name is included in the list of groups then an error is "
6585 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:376
6590 #: ../src/guestfs-actions.pod:579
6591 msgid "You must call C<guestfs_launch> before calling this function."
6595 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:384
6597 "The reason is because we don't know what groups are supported by the "
6598 "appliance/daemon until it is running and can be queried."
6602 #: ../src/guestfs-actions.pod:587 ../fish/guestfish-actions.pod:390
6604 "If a group of functions is available, this does not necessarily mean that "
6605 "they will work. You still have to check for errors when calling individual "
6606 "API functions even if they are available."
6610 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:397
6612 "It is usually the job of distro packagers to build complete functionality "
6613 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6614 "with all requirements satisfied, will support everything."
6618 #: ../src/guestfs-actions.pod:601
6620 "This call was added in version C<1.0.80>. In previous versions of "
6621 "libguestfs all you could do would be to speculatively execute a command to "
6622 "find out if the daemon implemented it. See also C<guestfs_version>."
6626 #: ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1171
6627 msgid "(Added in 1.0.80)"
6631 #: ../src/guestfs-actions.pod:612
6632 msgid "guestfs_available_all_groups"
6636 #: ../src/guestfs-actions.pod:614
6640 " guestfs_available_all_groups (guestfs_h *g);\n"
6645 #: ../src/guestfs-actions.pod:617
6647 "This command returns a list of all optional groups that this daemon knows "
6648 "about. Note this returns both supported and unsupported groups. To find "
6649 "out which ones the daemon can actually support you have to call "
6650 "C<guestfs_available> on each member of the returned list."
6654 #: ../src/guestfs-actions.pod:623
6655 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
6659 #: ../src/guestfs-actions.pod:629
6660 msgid "(Added in 1.3.15)"
6664 #: ../src/guestfs-actions.pod:631
6665 msgid "guestfs_base64_in"
6669 #: ../src/guestfs-actions.pod:633
6673 " guestfs_base64_in (guestfs_h *g,\n"
6674 " const char *base64file,\n"
6675 " const char *filename);\n"
6680 #: ../src/guestfs-actions.pod:638 ../fish/guestfish-actions.pod:427
6681 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6685 #: ../src/guestfs-actions.pod:643 ../src/guestfs-actions.pod:657
6686 msgid "(Added in 1.3.5)"
6690 #: ../src/guestfs-actions.pod:645
6691 msgid "guestfs_base64_out"
6695 #: ../src/guestfs-actions.pod:647
6699 " guestfs_base64_out (guestfs_h *g,\n"
6700 " const char *filename,\n"
6701 " const char *base64file);\n"
6706 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:436
6708 "This command downloads the contents of C<filename>, writing it out to local "
6709 "file C<base64file> encoded as base64."
6713 #: ../src/guestfs-actions.pod:659
6714 msgid "guestfs_blockdev_flushbufs"
6718 #: ../src/guestfs-actions.pod:661
6722 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
6723 " const char *device);\n"
6728 #: ../src/guestfs-actions.pod:665 ../fish/guestfish-actions.pod:445
6729 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6733 #: ../src/guestfs-actions.pod:668 ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:700 ../src/guestfs-actions.pod:716 ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:753 ../src/guestfs-actions.pod:767 ../src/guestfs-actions.pod:785 ../src/guestfs-actions.pod:799 ../src/guestfs-actions.pod:813 ../fish/guestfish-actions.pod:448 ../fish/guestfish-actions.pod:459 ../fish/guestfish-actions.pod:468 ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:490 ../fish/guestfish-actions.pod:503 ../fish/guestfish-actions.pod:511 ../fish/guestfish-actions.pod:522 ../fish/guestfish-actions.pod:530 ../fish/guestfish-actions.pod:538
6734 msgid "This uses the L<blockdev(8)> command."
6738 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:704 ../src/guestfs-actions.pod:720 ../src/guestfs-actions.pod:738 ../src/guestfs-actions.pod:757 ../src/guestfs-actions.pod:771 ../src/guestfs-actions.pod:789 ../src/guestfs-actions.pod:803 ../src/guestfs-actions.pod:817
6739 msgid "(Added in 0.9.3)"
6743 #: ../src/guestfs-actions.pod:674
6744 msgid "guestfs_blockdev_getbsz"
6748 #: ../src/guestfs-actions.pod:676
6752 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
6753 " const char *device);\n"
6758 #: ../src/guestfs-actions.pod:680 ../fish/guestfish-actions.pod:454
6759 msgid "This returns the block size of a device."
6763 #: ../src/guestfs-actions.pod:682 ../src/guestfs-actions.pod:782 ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:519
6765 "(Note this is different from both I<size in blocks> and I<filesystem block "
6770 #: ../src/guestfs-actions.pod:691
6771 msgid "guestfs_blockdev_getro"
6775 #: ../src/guestfs-actions.pod:693
6779 " guestfs_blockdev_getro (guestfs_h *g,\n"
6780 " const char *device);\n"
6785 #: ../src/guestfs-actions.pod:697 ../fish/guestfish-actions.pod:465
6787 "Returns a boolean indicating if the block device is read-only (true if "
6788 "read-only, false if not)."
6792 #: ../src/guestfs-actions.pod:702 ../src/guestfs-actions.pod:1409 ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1914 ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1997 ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2067 ../src/guestfs-actions.pod:2092 ../src/guestfs-actions.pod:2115 ../src/guestfs-actions.pod:3088 ../src/guestfs-actions.pod:3105 ../src/guestfs-actions.pod:3124 ../src/guestfs-actions.pod:3287 ../src/guestfs-actions.pod:3301 ../src/guestfs-actions.pod:3316 ../src/guestfs-actions.pod:3330 ../src/guestfs-actions.pod:3346 ../src/guestfs-actions.pod:3361 ../src/guestfs-actions.pod:3377 ../src/guestfs-actions.pod:3391 ../src/guestfs-actions.pod:3404 ../src/guestfs-actions.pod:3418 ../src/guestfs-actions.pod:3433 ../src/guestfs-actions.pod:3448 ../src/guestfs-actions.pod:4979
6793 msgid "This function returns a C truth value on success or -1 on error."
6797 #: ../src/guestfs-actions.pod:706
6798 msgid "guestfs_blockdev_getsize64"
6802 #: ../src/guestfs-actions.pod:708
6806 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
6807 " const char *device);\n"
6812 #: ../src/guestfs-actions.pod:712 ../fish/guestfish-actions.pod:474
6813 msgid "This returns the size of the device in bytes."
6817 #: ../src/guestfs-actions.pod:714
6818 msgid "See also C<guestfs_blockdev_getsz>."
6822 #: ../src/guestfs-actions.pod:722
6823 msgid "guestfs_blockdev_getss"
6827 #: ../src/guestfs-actions.pod:724
6831 " guestfs_blockdev_getss (guestfs_h *g,\n"
6832 " const char *device);\n"
6837 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:484
6839 "This returns the size of sectors on a block device. Usually 512, but can be "
6840 "larger for modern devices."
6844 #: ../src/guestfs-actions.pod:731
6846 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
6851 #: ../src/guestfs-actions.pod:740
6852 msgid "guestfs_blockdev_getsz"
6856 #: ../src/guestfs-actions.pod:742
6860 " guestfs_blockdev_getsz (guestfs_h *g,\n"
6861 " const char *device);\n"
6866 #: ../src/guestfs-actions.pod:746 ../fish/guestfish-actions.pod:496
6868 "This returns the size of the device in units of 512-byte sectors (even if "
6869 "the sectorsize isn't 512 bytes ... weird)."
6873 #: ../src/guestfs-actions.pod:749
6875 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
6876 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
6880 #: ../src/guestfs-actions.pod:759
6881 msgid "guestfs_blockdev_rereadpt"
6885 #: ../src/guestfs-actions.pod:761
6889 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
6890 " const char *device);\n"
6895 #: ../src/guestfs-actions.pod:765 ../fish/guestfish-actions.pod:509
6896 msgid "Reread the partition table on C<device>."
6900 #: ../src/guestfs-actions.pod:773
6901 msgid "guestfs_blockdev_setbsz"
6905 #: ../src/guestfs-actions.pod:775
6909 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
6910 " const char *device,\n"
6911 " int blocksize);\n"
6916 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:517
6917 msgid "This sets the block size of a device."
6921 #: ../src/guestfs-actions.pod:791
6922 msgid "guestfs_blockdev_setro"
6926 #: ../src/guestfs-actions.pod:793
6930 " guestfs_blockdev_setro (guestfs_h *g,\n"
6931 " const char *device);\n"
6936 #: ../src/guestfs-actions.pod:797 ../fish/guestfish-actions.pod:528
6937 msgid "Sets the block device named C<device> to read-only."
6941 #: ../src/guestfs-actions.pod:805
6942 msgid "guestfs_blockdev_setrw"
6946 #: ../src/guestfs-actions.pod:807
6950 " guestfs_blockdev_setrw (guestfs_h *g,\n"
6951 " const char *device);\n"
6956 #: ../src/guestfs-actions.pod:811 ../fish/guestfish-actions.pod:536
6957 msgid "Sets the block device named C<device> to read-write."
6961 #: ../src/guestfs-actions.pod:819
6962 msgid "guestfs_case_sensitive_path"
6966 #: ../src/guestfs-actions.pod:821
6970 " guestfs_case_sensitive_path (guestfs_h *g,\n"
6971 " const char *path);\n"
6976 #: ../src/guestfs-actions.pod:825 ../fish/guestfish-actions.pod:544
6978 "This can be used to resolve case insensitive paths on a filesystem which is "
6979 "case sensitive. The use case is to resolve paths which you have read from "
6980 "Windows configuration files or the Windows Registry, to the true path."
6984 #: ../src/guestfs-actions.pod:830 ../fish/guestfish-actions.pod:549
6986 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6987 "(and probably others), which is that although the underlying filesystem is "
6988 "case-insensitive, the driver exports the filesystem to Linux as "
6993 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:554
6995 "One consequence of this is that special directories such as C<c:\\windows> "
6996 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6997 "precise details of how they were created. In Windows itself this would not "
7002 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:560
7004 "Bug or feature? You decide: "
7005 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
7009 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:563
7011 "This function resolves the true case of each element in the path and returns "
7012 "the case-sensitive path."
7016 #: ../src/guestfs-actions.pod:847
7018 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
7019 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
7020 "how the directories were originally created under Windows)."
7024 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:571
7025 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7029 #: ../src/guestfs-actions.pod:855
7030 msgid "See also C<guestfs_realpath>."
7034 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:6970
7035 msgid "(Added in 1.0.75)"
7039 #: ../src/guestfs-actions.pod:862
7044 #: ../src/guestfs-actions.pod:864
7048 " guestfs_cat (guestfs_h *g,\n"
7049 " const char *path);\n"
7054 #: ../src/guestfs-actions.pod:868 ../src/guestfs-actions.pod:5466 ../fish/guestfish-actions.pod:580 ../fish/guestfish-actions.pod:3667
7055 msgid "Return the contents of the file named C<path>."
7059 #: ../src/guestfs-actions.pod:870
7061 "Note that this function cannot correctly handle binary files (specifically, "
7062 "files containing C<\\0> character which is treated as end of string). For "
7063 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
7064 "functions which have a more complex interface."
7068 #: ../src/guestfs-actions.pod:878 ../src/guestfs-actions.pod:1057 ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:1373 ../src/guestfs-actions.pod:1392 ../src/guestfs-actions.pod:1495 ../src/guestfs-actions.pod:1514 ../src/guestfs-actions.pod:1763 ../src/guestfs-actions.pod:2221 ../src/guestfs-actions.pod:2240 ../src/guestfs-actions.pod:2283 ../src/guestfs-actions.pod:2307 ../src/guestfs-actions.pod:2324 ../src/guestfs-actions.pod:2353 ../src/guestfs-actions.pod:5248 ../src/guestfs-actions.pod:5274 ../src/guestfs-actions.pod:5405 ../src/guestfs-actions.pod:5431 ../src/guestfs-actions.pod:5455 ../src/guestfs-actions.pod:6355 ../src/guestfs-actions.pod:6410 ../src/guestfs-actions.pod:6556 ../src/guestfs-actions.pod:6580 ../src/guestfs-actions.pod:7242 ../src/guestfs-actions.pod:7268 ../src/guestfs-actions.pod:7294 ../src/guestfs-actions.pod:7313 ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7417 ../src/guestfs-actions.pod:7463 ../src/guestfs-actions.pod:7482 ../fish/guestfish-actions.pod:587 ../fish/guestfish-actions.pod:722 ../fish/guestfish-actions.pod:734 ../fish/guestfish-actions.pod:910 ../fish/guestfish-actions.pod:920 ../fish/guestfish-actions.pod:987 ../fish/guestfish-actions.pod:997 ../fish/guestfish-actions.pod:1192 ../fish/guestfish-actions.pod:1493 ../fish/guestfish-actions.pod:1503 ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:1546 ../fish/guestfish-actions.pod:1556 ../fish/guestfish-actions.pod:1575 ../fish/guestfish-actions.pod:3537 ../fish/guestfish-actions.pod:3552 ../fish/guestfish-actions.pod:3628 ../fish/guestfish-actions.pod:3645 ../fish/guestfish-actions.pod:3660 ../fish/guestfish-actions.pod:4286 ../fish/guestfish-actions.pod:4332 ../fish/guestfish-actions.pod:4417 ../fish/guestfish-actions.pod:4432 ../fish/guestfish-actions.pod:4842 ../fish/guestfish-actions.pod:4860 ../fish/guestfish-actions.pod:4877 ../fish/guestfish-actions.pod:4887 ../fish/guestfish-actions.pod:4935 ../fish/guestfish-actions.pod:4945 ../fish/guestfish-actions.pod:4974 ../fish/guestfish-actions.pod:4984
7070 "Because of the message protocol, there is a transfer limit of somewhere "
7071 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7075 #: ../src/guestfs-actions.pod:881 ../src/guestfs-actions.pod:3564 ../src/guestfs-actions.pod:3626 ../src/guestfs-actions.pod:3643 ../src/guestfs-actions.pod:3731 ../src/guestfs-actions.pod:4136 ../src/guestfs-actions.pod:4150 ../src/guestfs-actions.pod:5354 ../src/guestfs-actions.pod:5368 ../src/guestfs-actions.pod:7129 ../src/guestfs-actions.pod:7143
7076 msgid "(Added in 0.4)"
7080 #: ../src/guestfs-actions.pod:883
7081 msgid "guestfs_checksum"
7085 #: ../src/guestfs-actions.pod:885
7089 " guestfs_checksum (guestfs_h *g,\n"
7090 " const char *csumtype,\n"
7091 " const char *path);\n"
7096 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:594
7097 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7101 #: ../src/guestfs-actions.pod:893 ../fish/guestfish-actions.pod:597
7103 "The type of checksum to compute is given by the C<csumtype> parameter which "
7104 "must have one of the following values:"
7108 #: ../src/guestfs-actions.pod:898 ../fish/guestfish-actions.pod:602
7113 #: ../src/guestfs-actions.pod:900 ../fish/guestfish-actions.pod:604
7115 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7120 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:607
7125 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:609
7126 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7130 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:611
7135 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:613
7136 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7140 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:615
7145 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:617
7146 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7150 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:619
7155 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:621
7156 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7160 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:623
7165 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:625
7166 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7170 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:627
7175 #: ../src/guestfs-actions.pod:925 ../fish/guestfish-actions.pod:629
7176 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7180 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:633
7181 msgid "The checksum is returned as a printable string."
7185 #: ../src/guestfs-actions.pod:931
7186 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
7190 #: ../src/guestfs-actions.pod:933
7191 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
7195 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:1246 ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:3303 ../src/guestfs-actions.pod:3332 ../src/guestfs-actions.pod:3393 ../src/guestfs-actions.pod:3420 ../src/guestfs-actions.pod:6826
7196 msgid "(Added in 1.0.2)"
7200 #: ../src/guestfs-actions.pod:940
7201 msgid "guestfs_checksum_device"
7205 #: ../src/guestfs-actions.pod:942
7209 " guestfs_checksum_device (guestfs_h *g,\n"
7210 " const char *csumtype,\n"
7211 " const char *device);\n"
7216 #: ../src/guestfs-actions.pod:947
7218 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7219 "device named C<device>. For the types of checksums supported see the "
7220 "C<guestfs_checksum> command."
7224 #: ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:4885 ../src/guestfs-actions.pod:4944 ../src/guestfs-actions.pod:4981 ../src/guestfs-actions.pod:4999 ../src/guestfs-actions.pod:5175 ../src/guestfs-actions.pod:6735 ../src/guestfs-actions.pod:6749 ../src/guestfs-actions.pod:7155
7225 msgid "(Added in 1.3.2)"
7229 #: ../src/guestfs-actions.pod:956
7230 msgid "guestfs_checksums_out"
7234 #: ../src/guestfs-actions.pod:958
7238 " guestfs_checksums_out (guestfs_h *g,\n"
7239 " const char *csumtype,\n"
7240 " const char *directory,\n"
7241 " const char *sumsfile);\n"
7246 #: ../src/guestfs-actions.pod:964 ../fish/guestfish-actions.pod:651
7248 "This command computes the checksums of all regular files in C<directory> and "
7249 "then emits a list of those checksums to the local output file C<sumsfile>."
7253 #: ../src/guestfs-actions.pod:968 ../fish/guestfish-actions.pod:655
7255 "This can be used for verifying the integrity of a virtual machine. However "
7256 "to be properly secure you should pay attention to the output of the checksum "
7257 "command (it uses the ones from GNU coreutils). In particular when the "
7258 "filename is not printable, coreutils uses a special backslash syntax. For "
7259 "more information, see the GNU coreutils info file."
7263 #: ../src/guestfs-actions.pod:978
7264 msgid "(Added in 1.3.7)"
7268 #: ../src/guestfs-actions.pod:980
7269 msgid "guestfs_chmod"
7273 #: ../src/guestfs-actions.pod:982
7277 " guestfs_chmod (guestfs_h *g,\n"
7279 " const char *path);\n"
7284 #: ../src/guestfs-actions.pod:987 ../fish/guestfish-actions.pod:669
7286 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7291 #: ../src/guestfs-actions.pod:990 ../fish/guestfish-actions.pod:672
7293 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7294 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7299 #: ../src/guestfs-actions.pod:994 ../src/guestfs-actions.pod:4387 ../src/guestfs-actions.pod:4584 ../src/guestfs-actions.pod:4603 ../src/guestfs-actions.pod:4622 ../fish/guestfish-actions.pod:676 ../fish/guestfish-actions.pod:2983 ../fish/guestfish-actions.pod:3112 ../fish/guestfish-actions.pod:3122 ../fish/guestfish-actions.pod:3132
7300 msgid "The mode actually set is affected by the umask."
7304 #: ../src/guestfs-actions.pod:1000
7305 msgid "guestfs_chown"
7309 #: ../src/guestfs-actions.pod:1002
7313 " guestfs_chown (guestfs_h *g,\n"
7316 " const char *path);\n"
7321 #: ../src/guestfs-actions.pod:1008 ../fish/guestfish-actions.pod:682
7322 msgid "Change the file owner to C<owner> and group to C<group>."
7326 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:3495 ../fish/guestfish-actions.pod:684 ../fish/guestfish-actions.pod:2441
7328 "Only numeric uid and gid are supported. If you want to use names, you will "
7329 "need to locate and parse the password file yourself (Augeas support makes "
7330 "this relatively easy)."
7334 #: ../src/guestfs-actions.pod:1018
7335 msgid "guestfs_command"
7339 #: ../src/guestfs-actions.pod:1020
7343 " guestfs_command (guestfs_h *g,\n"
7344 " char *const *arguments);\n"
7349 #: ../src/guestfs-actions.pod:1024 ../fish/guestfish-actions.pod:692
7351 "This call runs a command from the guest filesystem. The filesystem must be "
7352 "mounted, and must contain a compatible operating system (ie. something "
7353 "Linux, with the same or compatible processor architecture)."
7357 #: ../src/guestfs-actions.pod:1029
7359 "The single parameter is an argv-style list of arguments. The first element "
7360 "is the name of the program to run. Subsequent elements are parameters. The "
7361 "list must be non-empty (ie. must contain a program name). Note that the "
7362 "command runs directly, and is I<not> invoked via the shell (see "
7367 #: ../src/guestfs-actions.pod:1036 ../fish/guestfish-actions.pod:704
7368 msgid "The return value is anything printed to I<stdout> by the command."
7372 #: ../src/guestfs-actions.pod:1039 ../fish/guestfish-actions.pod:707
7374 "If the command returns a non-zero exit status, then this function returns an "
7375 "error message. The error message string is the content of I<stderr> from "
7380 #: ../src/guestfs-actions.pod:1043 ../fish/guestfish-actions.pod:711
7382 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
7383 "C</bin>. If you require a program from another location, you should provide "
7384 "the full path in the first parameter."
7388 #: ../src/guestfs-actions.pod:1048 ../fish/guestfish-actions.pod:716
7390 "Shared libraries and data files required by the program must be available on "
7391 "filesystems which are mounted in the correct places. It is the caller's "
7392 "responsibility to ensure all filesystems that are needed are mounted at the "
7397 #: ../src/guestfs-actions.pod:1060 ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:1548
7398 msgid "(Added in 0.9.1)"
7402 #: ../src/guestfs-actions.pod:1062
7403 msgid "guestfs_command_lines"
7407 #: ../src/guestfs-actions.pod:1064
7411 " guestfs_command_lines (guestfs_h *g,\n"
7412 " char *const *arguments);\n"
7417 #: ../src/guestfs-actions.pod:1068
7419 "This is the same as C<guestfs_command>, but splits the result into a list of "
7424 #: ../src/guestfs-actions.pod:1071
7425 msgid "See also: C<guestfs_sh_lines>"
7429 #: ../src/guestfs-actions.pod:1082
7430 msgid "guestfs_config"
7434 #: ../src/guestfs-actions.pod:1084
7438 " guestfs_config (guestfs_h *g,\n"
7439 " const char *qemuparam,\n"
7440 " const char *qemuvalue);\n"
7445 #: ../src/guestfs-actions.pod:1089 ../fish/guestfish-actions.pod:741
7447 "This can be used to add arbitrary qemu command line parameters of the form "
7448 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
7449 "setting some parameters which would interfere with parameters that we use."
7453 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:746
7454 msgid "The first character of C<param> string must be a C<-> (dash)."
7458 #: ../src/guestfs-actions.pod:1096 ../fish/guestfish-actions.pod:748
7459 msgid "C<value> can be NULL."
7463 #: ../src/guestfs-actions.pod:1102
7464 msgid "guestfs_copy_size"
7468 #: ../src/guestfs-actions.pod:1104
7472 " guestfs_copy_size (guestfs_h *g,\n"
7473 " const char *src,\n"
7474 " const char *dest,\n"
7480 #: ../src/guestfs-actions.pod:1110 ../fish/guestfish-actions.pod:754
7482 "This command copies exactly C<size> bytes from one source device or file "
7483 "C<src> to another destination device or file C<dest>."
7487 #: ../src/guestfs-actions.pod:1113 ../fish/guestfish-actions.pod:757
7489 "Note this will fail if the source is too short or if the destination is not "
7494 #: ../src/guestfs-actions.pod:1118 ../src/guestfs-actions.pod:1241 ../src/guestfs-actions.pod:1272 ../src/guestfs-actions.pod:1317 ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1719 ../src/guestfs-actions.pod:3476 ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6855 ../src/guestfs-actions.pod:7334 ../src/guestfs-actions.pod:7353
7496 "This long-running command can generate progress notification messages so "
7497 "that the caller can display a progress bar or indicator. To receive these "
7498 "messages, the caller must register a progress event callback. See "
7499 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
7503 #: ../src/guestfs-actions.pod:1123 ../src/guestfs-actions.pod:4163 ../src/guestfs-actions.pod:5381 ../src/guestfs-actions.pod:7062 ../src/guestfs-actions.pod:7082 ../src/guestfs-actions.pod:7168
7504 msgid "(Added in 1.0.87)"
7508 #: ../src/guestfs-actions.pod:1125
7513 #: ../src/guestfs-actions.pod:1127
7517 " guestfs_cp (guestfs_h *g,\n"
7518 " const char *src,\n"
7519 " const char *dest);\n"
7524 #: ../src/guestfs-actions.pod:1132 ../fish/guestfish-actions.pod:764
7526 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7527 "destination filename or destination directory."
7531 #: ../src/guestfs-actions.pod:1137 ../src/guestfs-actions.pod:1151 ../src/guestfs-actions.pod:1223 ../src/guestfs-actions.pod:1297 ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:4848 ../src/guestfs-actions.pod:5225
7532 msgid "(Added in 1.0.18)"
7536 #: ../src/guestfs-actions.pod:1139
7537 msgid "guestfs_cp_a"
7541 #: ../src/guestfs-actions.pod:1141
7545 " guestfs_cp_a (guestfs_h *g,\n"
7546 " const char *src,\n"
7547 " const char *dest);\n"
7552 #: ../src/guestfs-actions.pod:1146 ../fish/guestfish-actions.pod:771
7554 "This copies a file or directory from C<src> to C<dest> recursively using the "
7559 #: ../src/guestfs-actions.pod:1153
7564 #: ../src/guestfs-actions.pod:1155
7568 " guestfs_dd (guestfs_h *g,\n"
7569 " const char *src,\n"
7570 " const char *dest);\n"
7575 #: ../src/guestfs-actions.pod:1160 ../fish/guestfish-actions.pod:778
7577 "This command copies from one source device or file C<src> to another "
7578 "destination device or file C<dest>. Normally you would use this to copy to "
7579 "or from a device or partition, for example to duplicate a filesystem."
7583 #: ../src/guestfs-actions.pod:1165
7585 "If the destination is a device, it must be as large or larger than the "
7586 "source file or device, otherwise the copy will fail. This command cannot do "
7587 "partial copies (see C<guestfs_copy_size>)."
7591 #: ../src/guestfs-actions.pod:1173
7596 #: ../src/guestfs-actions.pod:1175
7600 " guestfs_df (guestfs_h *g);\n"
7605 #: ../src/guestfs-actions.pod:1178 ../fish/guestfish-actions.pod:791
7606 msgid "This command runs the C<df> command to report disk space used."
7610 #: ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1197
7612 "This command is mostly useful for interactive sessions. It is I<not> "
7613 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
7618 #: ../src/guestfs-actions.pod:1187 ../src/guestfs-actions.pod:1204 ../src/guestfs-actions.pod:1322 ../src/guestfs-actions.pod:2286 ../src/guestfs-actions.pod:2310 ../src/guestfs-actions.pod:2378 ../src/guestfs-actions.pod:4273 ../src/guestfs-actions.pod:4748 ../src/guestfs-actions.pod:6559 ../src/guestfs-actions.pod:6583 ../src/guestfs-actions.pod:7201 ../src/guestfs-actions.pod:7214 ../src/guestfs-actions.pod:7227
7619 msgid "(Added in 1.0.54)"
7623 #: ../src/guestfs-actions.pod:1189
7624 msgid "guestfs_df_h"
7628 #: ../src/guestfs-actions.pod:1191
7632 " guestfs_df_h (guestfs_h *g);\n"
7637 #: ../src/guestfs-actions.pod:1194 ../fish/guestfish-actions.pod:801
7639 "This command runs the C<df -h> command to report disk space used in "
7640 "human-readable format."
7644 #: ../src/guestfs-actions.pod:1206
7645 msgid "guestfs_dmesg"
7649 #: ../src/guestfs-actions.pod:1208
7653 " guestfs_dmesg (guestfs_h *g);\n"
7658 #: ../src/guestfs-actions.pod:1211 ../fish/guestfish-actions.pod:812
7660 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7661 "This is sometimes useful for extended debugging of problems."
7665 #: ../src/guestfs-actions.pod:1215
7667 "Another way to get the same information is to enable verbose messages with "
7668 "C<guestfs_set_verbose> or by setting the environment variable "
7669 "C<LIBGUESTFS_DEBUG=1> before running the program."
7673 #: ../src/guestfs-actions.pod:1225
7674 msgid "guestfs_download"
7678 #: ../src/guestfs-actions.pod:1227
7682 " guestfs_download (guestfs_h *g,\n"
7683 " const char *remotefilename,\n"
7684 " const char *filename);\n"
7689 #: ../src/guestfs-actions.pod:1232 ../src/guestfs-actions.pod:1257 ../fish/guestfish-actions.pod:825 ../fish/guestfish-actions.pod:838
7691 "Download file C<remotefilename> and save it as C<filename> on the local "
7696 #: ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:6815 ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:4590
7697 msgid "C<filename> can also be a named pipe."
7701 #: ../src/guestfs-actions.pod:1237
7702 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
7706 #: ../src/guestfs-actions.pod:1248
7707 msgid "guestfs_download_offset"
7711 #: ../src/guestfs-actions.pod:1250
7715 " guestfs_download_offset (guestfs_h *g,\n"
7716 " const char *remotefilename,\n"
7717 " const char *filename,\n"
7718 " int64_t offset,\n"
7724 #: ../src/guestfs-actions.pod:1260 ../fish/guestfish-actions.pod:841
7726 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7727 "region must be within the file or device)."
7731 #: ../src/guestfs-actions.pod:1263
7733 "Note that there is no limit on the amount of data that can be downloaded "
7734 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
7735 "full amount unless an error occurs."
7739 #: ../src/guestfs-actions.pod:1268
7740 msgid "See also C<guestfs_download>, C<guestfs_pread>."
7744 #: ../src/guestfs-actions.pod:1277 ../src/guestfs-actions.pod:6860
7745 msgid "(Added in 1.5.17)"
7749 #: ../src/guestfs-actions.pod:1279
7750 msgid "guestfs_drop_caches"
7754 #: ../src/guestfs-actions.pod:1281
7758 " guestfs_drop_caches (guestfs_h *g,\n"
7759 " int whattodrop);\n"
7764 #: ../src/guestfs-actions.pod:1285 ../fish/guestfish-actions.pod:857
7766 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7767 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7768 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7772 #: ../src/guestfs-actions.pod:1290 ../fish/guestfish-actions.pod:862
7773 msgid "Setting C<whattodrop> to 3 should drop everything."
7777 #: ../src/guestfs-actions.pod:1292 ../fish/guestfish-actions.pod:864
7779 "This automatically calls L<sync(2)> before the operation, so that the "
7780 "maximum guest memory is freed."
7784 #: ../src/guestfs-actions.pod:1299
7789 #: ../src/guestfs-actions.pod:1301
7793 " guestfs_du (guestfs_h *g,\n"
7794 " const char *path);\n"
7799 #: ../src/guestfs-actions.pod:1305 ../fish/guestfish-actions.pod:871
7801 "This command runs the C<du -s> command to estimate file space usage for "
7806 #: ../src/guestfs-actions.pod:1308 ../fish/guestfish-actions.pod:874
7808 "C<path> can be a file or a directory. If C<path> is a directory then the "
7809 "estimate includes the contents of the directory and all subdirectories "
7814 #: ../src/guestfs-actions.pod:1312 ../fish/guestfish-actions.pod:878
7815 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7819 #: ../src/guestfs-actions.pod:1324
7820 msgid "guestfs_e2fsck_f"
7824 #: ../src/guestfs-actions.pod:1326
7828 " guestfs_e2fsck_f (guestfs_h *g,\n"
7829 " const char *device);\n"
7834 #: ../src/guestfs-actions.pod:1330 ../fish/guestfish-actions.pod:885
7836 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7837 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
7842 #: ../src/guestfs-actions.pod:1334
7844 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
7845 "Normally you should use C<guestfs_fsck>."
7849 #: ../src/guestfs-actions.pod:1339
7850 msgid "(Added in 1.0.29)"
7854 #: ../src/guestfs-actions.pod:1341
7855 msgid "guestfs_echo_daemon"
7859 #: ../src/guestfs-actions.pod:1343
7863 " guestfs_echo_daemon (guestfs_h *g,\n"
7864 " char *const *words);\n"
7869 #: ../src/guestfs-actions.pod:1347 ../fish/guestfish-actions.pod:896
7871 "This command concatenates the list of C<words> passed with single spaces "
7872 "between them and returns the resulting string."
7876 #: ../src/guestfs-actions.pod:1350 ../fish/guestfish-actions.pod:899
7877 msgid "You can use this command to test the connection through to the daemon."
7881 #: ../src/guestfs-actions.pod:1352
7882 msgid "See also C<guestfs_ping_daemon>."
7886 #: ../src/guestfs-actions.pod:1357 ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:6059
7887 msgid "(Added in 1.0.69)"
7891 #: ../src/guestfs-actions.pod:1359
7892 msgid "guestfs_egrep"
7896 #: ../src/guestfs-actions.pod:1361
7900 " guestfs_egrep (guestfs_h *g,\n"
7901 " const char *regex,\n"
7902 " const char *path);\n"
7907 #: ../src/guestfs-actions.pod:1366 ../fish/guestfish-actions.pod:907
7908 msgid "This calls the external C<egrep> program and returns the matching lines."
7912 #: ../src/guestfs-actions.pod:1376 ../src/guestfs-actions.pod:1395 ../src/guestfs-actions.pod:1452 ../src/guestfs-actions.pod:1498 ../src/guestfs-actions.pod:1517 ../src/guestfs-actions.pod:2224 ../src/guestfs-actions.pod:2243 ../src/guestfs-actions.pod:2399 ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2427 ../src/guestfs-actions.pod:2473 ../src/guestfs-actions.pod:2495 ../src/guestfs-actions.pod:2508 ../src/guestfs-actions.pod:3656 ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3683 ../src/guestfs-actions.pod:3697 ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:5559 ../src/guestfs-actions.pod:5608 ../src/guestfs-actions.pod:6427 ../src/guestfs-actions.pod:6439 ../src/guestfs-actions.pod:6452 ../src/guestfs-actions.pod:6465 ../src/guestfs-actions.pod:6487 ../src/guestfs-actions.pod:6500 ../src/guestfs-actions.pod:6513 ../src/guestfs-actions.pod:6526 ../src/guestfs-actions.pod:7297 ../src/guestfs-actions.pod:7316 ../src/guestfs-actions.pod:7401 ../src/guestfs-actions.pod:7420 ../src/guestfs-actions.pod:7466 ../src/guestfs-actions.pod:7485
7913 msgid "(Added in 1.0.66)"
7917 #: ../src/guestfs-actions.pod:1378
7918 msgid "guestfs_egrepi"
7922 #: ../src/guestfs-actions.pod:1380
7926 " guestfs_egrepi (guestfs_h *g,\n"
7927 " const char *regex,\n"
7928 " const char *path);\n"
7933 #: ../src/guestfs-actions.pod:1385 ../fish/guestfish-actions.pod:917
7934 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7938 #: ../src/guestfs-actions.pod:1397
7939 msgid "guestfs_equal"
7943 #: ../src/guestfs-actions.pod:1399
7947 " guestfs_equal (guestfs_h *g,\n"
7948 " const char *file1,\n"
7949 " const char *file2);\n"
7954 #: ../src/guestfs-actions.pod:1404 ../fish/guestfish-actions.pod:927
7956 "This compares the two files C<file1> and C<file2> and returns true if their "
7957 "content is exactly equal, or false otherwise."
7961 #: ../src/guestfs-actions.pod:1407 ../fish/guestfish-actions.pod:930
7962 msgid "The external L<cmp(1)> program is used for the comparison."
7966 #: ../src/guestfs-actions.pod:1413
7967 msgid "guestfs_exists"
7971 #: ../src/guestfs-actions.pod:1415
7975 " guestfs_exists (guestfs_h *g,\n"
7976 " const char *path);\n"
7981 #: ../src/guestfs-actions.pod:1419 ../fish/guestfish-actions.pod:936
7983 "This returns C<true> if and only if there is a file, directory (or anything) "
7984 "with the given C<path> name."
7988 #: ../src/guestfs-actions.pod:1422
7989 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
7993 #: ../src/guestfs-actions.pod:1428
7994 msgid "guestfs_fallocate"
7998 #: ../src/guestfs-actions.pod:1430
8002 " guestfs_fallocate (guestfs_h *g,\n"
8003 " const char *path,\n"
8009 #: ../src/guestfs-actions.pod:1435 ../src/guestfs-actions.pod:1461 ../fish/guestfish-actions.pod:945 ../fish/guestfish-actions.pod:964
8011 "This command preallocates a file (containing zero bytes) named C<path> of "
8012 "size C<len> bytes. If the file exists already, it is overwritten."
8016 #: ../src/guestfs-actions.pod:1439 ../fish/guestfish-actions.pod:949
8018 "Do not confuse this with the guestfish-specific C<alloc> command which "
8019 "allocates a file in the host and attaches it as a device."
8023 #: ../src/guestfs-actions.pod:1445 ../fish/guestfish-actions.pod:953
8025 "This function is deprecated. In new code, use the C<fallocate64> call "
8030 #: ../src/guestfs-actions.pod:1454
8031 msgid "guestfs_fallocate64"
8035 #: ../src/guestfs-actions.pod:1456
8039 " guestfs_fallocate64 (guestfs_h *g,\n"
8040 " const char *path,\n"
8046 #: ../src/guestfs-actions.pod:1465
8048 "Note that this call allocates disk blocks for the file. To create a sparse "
8049 "file use C<guestfs_truncate_size> instead."
8053 #: ../src/guestfs-actions.pod:1468
8055 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
8056 "oversight it only allowed 30 bit lengths to be specified, effectively "
8057 "limiting the maximum size of files created through that call to 1GB."
8061 #: ../src/guestfs-actions.pod:1473 ../fish/guestfish-actions.pod:976
8063 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8064 "commands which create a file in the host and attach it as a device."
8068 #: ../src/guestfs-actions.pod:1479
8069 msgid "(Added in 1.3.17)"
8073 #: ../src/guestfs-actions.pod:1481
8074 msgid "guestfs_fgrep"
8078 #: ../src/guestfs-actions.pod:1483
8082 " guestfs_fgrep (guestfs_h *g,\n"
8083 " const char *pattern,\n"
8084 " const char *path);\n"
8089 #: ../src/guestfs-actions.pod:1488 ../fish/guestfish-actions.pod:984
8090 msgid "This calls the external C<fgrep> program and returns the matching lines."
8094 #: ../src/guestfs-actions.pod:1500
8095 msgid "guestfs_fgrepi"
8099 #: ../src/guestfs-actions.pod:1502
8103 " guestfs_fgrepi (guestfs_h *g,\n"
8104 " const char *pattern,\n"
8105 " const char *path);\n"
8110 #: ../src/guestfs-actions.pod:1507 ../fish/guestfish-actions.pod:994
8111 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
8115 #: ../src/guestfs-actions.pod:1519
8116 msgid "guestfs_file"
8120 #: ../src/guestfs-actions.pod:1521
8124 " guestfs_file (guestfs_h *g,\n"
8125 " const char *path);\n"
8130 #: ../src/guestfs-actions.pod:1525 ../fish/guestfish-actions.pod:1004
8132 "This call uses the standard L<file(1)> command to determine the type or "
8133 "contents of the file."
8137 #: ../src/guestfs-actions.pod:1528 ../fish/guestfish-actions.pod:1007
8139 "This call will also transparently look inside various types of compressed "
8144 #: ../src/guestfs-actions.pod:1531 ../fish/guestfish-actions.pod:1010
8146 "The exact command which runs is C<file -zb path>. Note in particular that "
8147 "the filename is not prepended to the output (the C<-b> option)."
8151 #: ../src/guestfs-actions.pod:1535
8153 "This command can also be used on C</dev/> devices (and partitions, LV "
8154 "names). You can for example use this to determine if a device contains a "
8155 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
8159 #: ../src/guestfs-actions.pod:1540 ../fish/guestfish-actions.pod:1019
8161 "If the C<path> does not begin with C</dev/> then this command only works for "
8162 "the content of regular files. For other file types (directory, symbolic "
8163 "link etc) it will just return the string C<directory> etc."
8167 #: ../src/guestfs-actions.pod:1550
8168 msgid "guestfs_file_architecture"
8172 #: ../src/guestfs-actions.pod:1552
8176 " guestfs_file_architecture (guestfs_h *g,\n"
8177 " const char *filename);\n"
8182 #: ../src/guestfs-actions.pod:1556 ../fish/guestfish-actions.pod:1028
8184 "This detects the architecture of the binary C<filename>, and returns it if "
8189 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1031
8190 msgid "Currently defined architectures are:"
8194 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1035
8199 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1037
8201 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8202 "irrespective of the precise processor requirements of the binary."
8206 #: ../src/guestfs-actions.pod:1568 ../fish/guestfish-actions.pod:1040
8211 #: ../src/guestfs-actions.pod:1570 ../fish/guestfish-actions.pod:1042
8212 msgid "64 bit x86-64."
8216 #: ../src/guestfs-actions.pod:1572 ../fish/guestfish-actions.pod:1044
8221 #: ../src/guestfs-actions.pod:1574 ../fish/guestfish-actions.pod:1046
8222 msgid "32 bit SPARC."
8226 #: ../src/guestfs-actions.pod:1576 ../fish/guestfish-actions.pod:1048
8231 #: ../src/guestfs-actions.pod:1578 ../fish/guestfish-actions.pod:1050
8232 msgid "64 bit SPARC V9 and above."
8236 #: ../src/guestfs-actions.pod:1580 ../fish/guestfish-actions.pod:1052
8241 #: ../src/guestfs-actions.pod:1582 ../fish/guestfish-actions.pod:1054
8242 msgid "Intel Itanium."
8246 #: ../src/guestfs-actions.pod:1584 ../fish/guestfish-actions.pod:1056
8251 #: ../src/guestfs-actions.pod:1586 ../fish/guestfish-actions.pod:1058
8252 msgid "32 bit Power PC."
8256 #: ../src/guestfs-actions.pod:1588 ../fish/guestfish-actions.pod:1060
8261 #: ../src/guestfs-actions.pod:1590 ../fish/guestfish-actions.pod:1062
8262 msgid "64 bit Power PC."
8266 #: ../src/guestfs-actions.pod:1594 ../fish/guestfish-actions.pod:1066
8267 msgid "Libguestfs may return other architecture strings in future."
8271 #: ../src/guestfs-actions.pod:1596 ../fish/guestfish-actions.pod:1068
8272 msgid "The function works on at least the following types of files:"
8276 #: ../src/guestfs-actions.pod:1602 ../fish/guestfish-actions.pod:1074
8277 msgid "many types of Un*x and Linux binary"
8281 #: ../src/guestfs-actions.pod:1606 ../fish/guestfish-actions.pod:1078
8282 msgid "many types of Un*x and Linux shared library"
8286 #: ../src/guestfs-actions.pod:1610 ../fish/guestfish-actions.pod:1082
8287 msgid "Windows Win32 and Win64 binaries"
8291 #: ../src/guestfs-actions.pod:1614 ../fish/guestfish-actions.pod:1086
8292 msgid "Windows Win32 and Win64 DLLs"
8296 #: ../src/guestfs-actions.pod:1616 ../fish/guestfish-actions.pod:1088
8297 msgid "Win32 binaries and DLLs return C<i386>."
8301 #: ../src/guestfs-actions.pod:1618 ../fish/guestfish-actions.pod:1090
8302 msgid "Win64 binaries and DLLs return C<x86_64>."
8306 #: ../src/guestfs-actions.pod:1622 ../fish/guestfish-actions.pod:1094
8307 msgid "Linux kernel modules"
8311 #: ../src/guestfs-actions.pod:1626 ../fish/guestfish-actions.pod:1098
8312 msgid "Linux new-style initrd images"
8316 #: ../src/guestfs-actions.pod:1630 ../fish/guestfish-actions.pod:1102
8317 msgid "some non-x86 Linux vmlinuz kernels"
8321 #: ../src/guestfs-actions.pod:1634 ../fish/guestfish-actions.pod:1106
8322 msgid "What it can't do currently:"
8326 #: ../src/guestfs-actions.pod:1640 ../fish/guestfish-actions.pod:1112
8327 msgid "static libraries (libfoo.a)"
8331 #: ../src/guestfs-actions.pod:1644 ../fish/guestfish-actions.pod:1116
8332 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8336 #: ../src/guestfs-actions.pod:1648 ../fish/guestfish-actions.pod:1120
8337 msgid "x86 Linux vmlinuz kernels"
8341 #: ../src/guestfs-actions.pod:1650 ../fish/guestfish-actions.pod:1122
8343 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8344 "compressed code, and are horribly hard to unpack. If you want to find the "
8345 "architecture of a kernel, use the architecture of the associated initrd or "
8346 "kernel module(s) instead."
8350 #: ../src/guestfs-actions.pod:1660 ../src/guestfs-actions.pod:1823 ../src/guestfs-actions.pod:1840 ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:2624 ../src/guestfs-actions.pod:2694 ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:2803 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2930 ../src/guestfs-actions.pod:3027 ../src/guestfs-actions.pod:3274 ../src/guestfs-actions.pod:3406
8351 msgid "(Added in 1.5.3)"
8355 #: ../src/guestfs-actions.pod:1662
8356 msgid "guestfs_filesize"
8360 #: ../src/guestfs-actions.pod:1664
8364 " guestfs_filesize (guestfs_h *g,\n"
8365 " const char *file);\n"
8370 #: ../src/guestfs-actions.pod:1668 ../fish/guestfish-actions.pod:1133
8371 msgid "This command returns the size of C<file> in bytes."
8375 #: ../src/guestfs-actions.pod:1670
8377 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
8378 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
8379 "devices, use C<guestfs_blockdev_getsize64>."
8383 #: ../src/guestfs-actions.pod:1676
8384 msgid "(Added in 1.0.82)"
8388 #: ../src/guestfs-actions.pod:1678
8389 msgid "guestfs_fill"
8393 #: ../src/guestfs-actions.pod:1680
8397 " guestfs_fill (guestfs_h *g,\n"
8400 " const char *path);\n"
8405 #: ../src/guestfs-actions.pod:1686 ../fish/guestfish-actions.pod:1143
8407 "This command creates a new file called C<path>. The initial content of the "
8408 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
8413 #: ../src/guestfs-actions.pod:1690
8415 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8416 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
8417 "bytes use C<guestfs_fill_pattern>."
8421 #: ../src/guestfs-actions.pod:1702
8422 msgid "(Added in 1.0.79)"
8426 #: ../src/guestfs-actions.pod:1704
8427 msgid "guestfs_fill_pattern"
8431 #: ../src/guestfs-actions.pod:1706
8435 " guestfs_fill_pattern (guestfs_h *g,\n"
8436 " const char *pattern,\n"
8438 " const char *path);\n"
8443 #: ../src/guestfs-actions.pod:1712
8445 "This function is like C<guestfs_fill> except that it creates a new file of "
8446 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
8447 "pattern is truncated if necessary to ensure the length of the file is "
8448 "exactly C<len> bytes."
8452 #: ../src/guestfs-actions.pod:1724
8453 msgid "(Added in 1.3.12)"
8457 #: ../src/guestfs-actions.pod:1726
8458 msgid "guestfs_find"
8462 #: ../src/guestfs-actions.pod:1728
8466 " guestfs_find (guestfs_h *g,\n"
8467 " const char *directory);\n"
8472 #: ../src/guestfs-actions.pod:1732 ../fish/guestfish-actions.pod:1165
8474 "This command lists out all files and directories, recursively, starting at "
8475 "C<directory>. It is essentially equivalent to running the shell command "
8476 "C<find directory -print> but some post-processing happens on the output, "
8481 #: ../src/guestfs-actions.pod:1737 ../fish/guestfish-actions.pod:1170
8483 "This returns a list of strings I<without any prefix>. Thus if the directory "
8488 #: ../src/guestfs-actions.pod:1740 ../fish/guestfish-actions.pod:1173
8498 #: ../src/guestfs-actions.pod:1744
8499 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
8503 #: ../src/guestfs-actions.pod:1747 ../fish/guestfish-actions.pod:1180
8514 #: ../src/guestfs-actions.pod:1752 ../fish/guestfish-actions.pod:1185
8515 msgid "If C<directory> is not a directory, then this command returns an error."
8519 #: ../src/guestfs-actions.pod:1755 ../fish/guestfish-actions.pod:1188
8520 msgid "The returned list is sorted."
8524 #: ../src/guestfs-actions.pod:1757
8525 msgid "See also C<guestfs_find0>."
8529 #: ../src/guestfs-actions.pod:1766 ../src/guestfs-actions.pod:4100 ../src/guestfs-actions.pod:5643
8530 msgid "(Added in 1.0.27)"
8534 #: ../src/guestfs-actions.pod:1768
8535 msgid "guestfs_find0"
8539 #: ../src/guestfs-actions.pod:1770
8543 " guestfs_find0 (guestfs_h *g,\n"
8544 " const char *directory,\n"
8545 " const char *files);\n"
8550 #: ../src/guestfs-actions.pod:1775 ../fish/guestfish-actions.pod:1199
8552 "This command lists out all files and directories, recursively, starting at "
8553 "C<directory>, placing the resulting list in the external file called "
8558 #: ../src/guestfs-actions.pod:1779
8560 "This command works the same way as C<guestfs_find> with the following "
8565 #: ../src/guestfs-actions.pod:1786 ../fish/guestfish-actions.pod:1210
8566 msgid "The resulting list is written to an external file."
8570 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1214
8572 "Items (filenames) in the result are separated by C<\\0> characters. See "
8573 "L<find(1)> option I<-print0>."
8577 #: ../src/guestfs-actions.pod:1795 ../fish/guestfish-actions.pod:1219
8578 msgid "This command is not limited in the number of names that it can return."
8582 #: ../src/guestfs-actions.pod:1800 ../fish/guestfish-actions.pod:1224
8583 msgid "The result list is not sorted."
8587 #: ../src/guestfs-actions.pod:1806
8588 msgid "(Added in 1.0.74)"
8592 #: ../src/guestfs-actions.pod:1808
8593 msgid "guestfs_findfs_label"
8597 #: ../src/guestfs-actions.pod:1810
8601 " guestfs_findfs_label (guestfs_h *g,\n"
8602 " const char *label);\n"
8607 #: ../src/guestfs-actions.pod:1814 ../fish/guestfish-actions.pod:1234
8609 "This command searches the filesystems and returns the one which has the "
8610 "given label. An error is returned if no such filesystem can be found."
8614 #: ../src/guestfs-actions.pod:1818
8615 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
8619 #: ../src/guestfs-actions.pod:1825
8620 msgid "guestfs_findfs_uuid"
8624 #: ../src/guestfs-actions.pod:1827
8628 " guestfs_findfs_uuid (guestfs_h *g,\n"
8629 " const char *uuid);\n"
8634 #: ../src/guestfs-actions.pod:1831 ../fish/guestfish-actions.pod:1244
8636 "This command searches the filesystems and returns the one which has the "
8637 "given UUID. An error is returned if no such filesystem can be found."
8641 #: ../src/guestfs-actions.pod:1835
8642 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
8646 #: ../src/guestfs-actions.pod:1842
8647 msgid "guestfs_fsck"
8651 #: ../src/guestfs-actions.pod:1844
8655 " guestfs_fsck (guestfs_h *g,\n"
8656 " const char *fstype,\n"
8657 " const char *device);\n"
8662 #: ../src/guestfs-actions.pod:1849 ../fish/guestfish-actions.pod:1254
8664 "This runs the filesystem checker (fsck) on C<device> which should have "
8665 "filesystem type C<fstype>."
8669 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1257
8671 "The returned integer is the status. See L<fsck(8)> for the list of status "
8672 "codes from C<fsck>."
8676 #: ../src/guestfs-actions.pod:1861 ../fish/guestfish-actions.pod:1266
8677 msgid "Multiple status codes can be summed together."
8681 #: ../src/guestfs-actions.pod:1865 ../fish/guestfish-actions.pod:1270
8683 "A non-zero return code can mean \"success\", for example if errors have been "
8684 "corrected on the filesystem."
8688 #: ../src/guestfs-actions.pod:1870 ../fish/guestfish-actions.pod:1275
8689 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8693 #: ../src/guestfs-actions.pod:1875 ../fish/guestfish-actions.pod:1280
8694 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8698 #: ../src/guestfs-actions.pod:1879 ../src/guestfs-actions.pod:7339
8699 msgid "(Added in 1.0.16)"
8703 #: ../src/guestfs-actions.pod:1881
8704 msgid "guestfs_get_append"
8708 #: ../src/guestfs-actions.pod:1883
8712 " guestfs_get_append (guestfs_h *g);\n"
8717 #: ../src/guestfs-actions.pod:1886 ../fish/guestfish-actions.pod:1286
8719 "Return the additional kernel options which are added to the guest kernel "
8724 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1289
8725 msgid "If C<NULL> then no options are added."
8729 #: ../src/guestfs-actions.pod:1891
8731 "This function returns a string which may be NULL. There is no way to return "
8732 "an error from this function. The string is owned by the guest handle and "
8733 "must I<not> be freed."
8737 #: ../src/guestfs-actions.pod:1895 ../src/guestfs-actions.pod:5321 ../src/guestfs-actions.pod:5801 ../src/guestfs-actions.pod:6201 ../src/guestfs-actions.pod:6220 ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6253 ../src/guestfs-actions.pod:7010 ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7382
8738 msgid "(Added in 1.0.26)"
8742 #: ../src/guestfs-actions.pod:1897
8743 msgid "guestfs_get_attach_method"
8747 #: ../src/guestfs-actions.pod:1899
8751 " guestfs_get_attach_method (guestfs_h *g);\n"
8756 #: ../src/guestfs-actions.pod:1902
8757 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
8761 #: ../src/guestfs-actions.pod:1907
8762 msgid "guestfs_get_autosync"
8766 #: ../src/guestfs-actions.pod:1909
8770 " guestfs_get_autosync (guestfs_h *g);\n"
8775 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1301
8776 msgid "Get the autosync flag."
8780 #: ../src/guestfs-actions.pod:1918
8781 msgid "guestfs_get_direct"
8785 #: ../src/guestfs-actions.pod:1920
8789 " guestfs_get_direct (guestfs_h *g);\n"
8794 #: ../src/guestfs-actions.pod:1923 ../fish/guestfish-actions.pod:1307
8795 msgid "Return the direct appliance mode flag."
8799 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:5870
8800 msgid "(Added in 1.0.72)"
8804 #: ../src/guestfs-actions.pod:1929
8805 msgid "guestfs_get_e2label"
8809 #: ../src/guestfs-actions.pod:1931
8813 " guestfs_get_e2label (guestfs_h *g,\n"
8814 " const char *device);\n"
8819 #: ../src/guestfs-actions.pod:1935 ../fish/guestfish-actions.pod:1313
8820 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8824 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1316
8826 "This function is deprecated. In new code, use the C<vfs_label> call "
8831 #: ../src/guestfs-actions.pod:1948 ../src/guestfs-actions.pod:1969 ../src/guestfs-actions.pod:5888 ../src/guestfs-actions.pod:5907
8832 msgid "(Added in 1.0.15)"
8836 #: ../src/guestfs-actions.pod:1950
8837 msgid "guestfs_get_e2uuid"
8841 #: ../src/guestfs-actions.pod:1952
8845 " guestfs_get_e2uuid (guestfs_h *g,\n"
8846 " const char *device);\n"
8851 #: ../src/guestfs-actions.pod:1956 ../fish/guestfish-actions.pod:1327
8852 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8856 #: ../src/guestfs-actions.pod:1962 ../fish/guestfish-actions.pod:1330
8857 msgid "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
8861 #: ../src/guestfs-actions.pod:1971
8862 msgid "guestfs_get_memsize"
8866 #: ../src/guestfs-actions.pod:1973
8870 " guestfs_get_memsize (guestfs_h *g);\n"
8875 #: ../src/guestfs-actions.pod:1976 ../fish/guestfish-actions.pod:1341
8876 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8880 #: ../src/guestfs-actions.pod:1979
8882 "If C<guestfs_set_memsize> was not called on this handle, and if "
8883 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8884 "value for memsize."
8888 #: ../src/guestfs-actions.pod:1983 ../src/guestfs-actions.pod:2064 ../src/guestfs-actions.pod:5923 ../src/guestfs-actions.pod:6030 ../fish/guestfish-actions.pod:1348 ../fish/guestfish-actions.pod:1399 ../fish/guestfish-actions.pod:3993 ../fish/guestfish-actions.pod:4080
8889 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8893 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:4391 ../src/guestfs-actions.pod:4588 ../src/guestfs-actions.pod:4607 ../src/guestfs-actions.pod:4626 ../src/guestfs-actions.pod:4638 ../src/guestfs-actions.pod:4655 ../src/guestfs-actions.pod:4668 ../src/guestfs-actions.pod:5546 ../src/guestfs-actions.pod:5928 ../src/guestfs-actions.pod:6175 ../src/guestfs-actions.pod:6776
8894 msgid "(Added in 1.0.55)"
8898 #: ../src/guestfs-actions.pod:1990
8899 msgid "guestfs_get_network"
8903 #: ../src/guestfs-actions.pod:1992
8907 " guestfs_get_network (guestfs_h *g);\n"
8912 #: ../src/guestfs-actions.pod:1995 ../fish/guestfish-actions.pod:1355
8913 msgid "This returns the enable network flag."
8917 #: ../src/guestfs-actions.pod:1999 ../src/guestfs-actions.pod:5947
8918 msgid "(Added in 1.5.4)"
8922 #: ../src/guestfs-actions.pod:2001
8923 msgid "guestfs_get_path"
8927 #: ../src/guestfs-actions.pod:2003
8931 " guestfs_get_path (guestfs_h *g);\n"
8936 #: ../src/guestfs-actions.pod:2006 ../fish/guestfish-actions.pod:1361
8937 msgid "Return the current search path."
8941 #: ../src/guestfs-actions.pod:2008 ../fish/guestfish-actions.pod:1363
8943 "This is always non-NULL. If it wasn't set already, then this will return "
8948 #: ../src/guestfs-actions.pod:2011 ../src/guestfs-actions.pod:2040
8950 "This function returns a string, or NULL on error. The string is owned by "
8951 "the guest handle and must I<not> be freed."
8955 #: ../src/guestfs-actions.pod:2016
8956 msgid "guestfs_get_pid"
8960 #: ../src/guestfs-actions.pod:2018
8964 " guestfs_get_pid (guestfs_h *g);\n"
8969 #: ../src/guestfs-actions.pod:2021 ../fish/guestfish-actions.pod:1372
8971 "Return the process ID of the qemu subprocess. If there is no qemu "
8972 "subprocess, then this will return an error."
8976 #: ../src/guestfs-actions.pod:2024 ../fish/guestfish-actions.pod:1375
8977 msgid "This is an internal call used for debugging and testing."
8981 #: ../src/guestfs-actions.pod:2028
8982 msgid "(Added in 1.0.56)"
8986 #: ../src/guestfs-actions.pod:2030
8987 msgid "guestfs_get_qemu"
8991 #: ../src/guestfs-actions.pod:2032
8995 " guestfs_get_qemu (guestfs_h *g);\n"
9000 #: ../src/guestfs-actions.pod:2035 ../fish/guestfish-actions.pod:1381
9001 msgid "Return the current qemu binary."
9005 #: ../src/guestfs-actions.pod:2037 ../fish/guestfish-actions.pod:1383
9007 "This is always non-NULL. If it wasn't set already, then this will return "
9008 "the default qemu binary name."
9012 #: ../src/guestfs-actions.pod:2043 ../src/guestfs-actions.pod:5992
9013 msgid "(Added in 1.0.6)"
9017 #: ../src/guestfs-actions.pod:2045
9018 msgid "guestfs_get_recovery_proc"
9022 #: ../src/guestfs-actions.pod:2047
9026 " guestfs_get_recovery_proc (guestfs_h *g);\n"
9031 #: ../src/guestfs-actions.pod:2050 ../fish/guestfish-actions.pod:1390
9032 msgid "Return the recovery process enabled flag."
9036 #: ../src/guestfs-actions.pod:2054 ../src/guestfs-actions.pod:3501 ../src/guestfs-actions.pod:3798 ../src/guestfs-actions.pod:4198 ../src/guestfs-actions.pod:4230 ../src/guestfs-actions.pod:5251 ../src/guestfs-actions.pod:5594 ../src/guestfs-actions.pod:6016 ../src/guestfs-actions.pod:6679 ../src/guestfs-actions.pod:6699 ../src/guestfs-actions.pod:6891
9037 msgid "(Added in 1.0.77)"
9041 #: ../src/guestfs-actions.pod:2056
9042 msgid "guestfs_get_selinux"
9046 #: ../src/guestfs-actions.pod:2058
9050 " guestfs_get_selinux (guestfs_h *g);\n"
9055 #: ../src/guestfs-actions.pod:2061
9057 "This returns the current setting of the selinux flag which is passed to the "
9058 "appliance at boot time. See C<guestfs_set_selinux>."
9062 #: ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2132 ../src/guestfs-actions.pod:6035 ../src/guestfs-actions.pod:6093
9063 msgid "(Added in 1.0.67)"
9067 #: ../src/guestfs-actions.pod:2071
9068 msgid "guestfs_get_state"
9072 #: ../src/guestfs-actions.pod:2073
9076 " guestfs_get_state (guestfs_h *g);\n"
9081 #: ../src/guestfs-actions.pod:2076 ../fish/guestfish-actions.pod:1406
9083 "This returns the current state as an opaque integer. This is only useful "
9084 "for printing debug and internal error messages."
9088 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:3299 ../src/guestfs-actions.pod:3328 ../src/guestfs-actions.pod:3389 ../src/guestfs-actions.pod:3416 ../fish/guestfish-actions.pod:1409 ../fish/guestfish-actions.pod:2323 ../fish/guestfish-actions.pod:2341 ../fish/guestfish-actions.pod:2379 ../fish/guestfish-actions.pod:2395
9089 msgid "For more information on states, see L<guestfs(3)>."
9093 #: ../src/guestfs-actions.pod:2085
9094 msgid "guestfs_get_trace"
9098 #: ../src/guestfs-actions.pod:2087
9102 " guestfs_get_trace (guestfs_h *g);\n"
9107 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1415
9108 msgid "Return the command trace flag."
9112 #: ../src/guestfs-actions.pod:2096
9113 msgid "guestfs_get_umask"
9117 #: ../src/guestfs-actions.pod:2098
9121 " guestfs_get_umask (guestfs_h *g);\n"
9126 #: ../src/guestfs-actions.pod:2101
9128 "Return the current umask. By default the umask is C<022> unless it has been "
9129 "set by calling C<guestfs_umask>."
9133 #: ../src/guestfs-actions.pod:2108
9134 msgid "guestfs_get_verbose"
9138 #: ../src/guestfs-actions.pod:2110
9142 " guestfs_get_verbose (guestfs_h *g);\n"
9147 #: ../src/guestfs-actions.pod:2113 ../fish/guestfish-actions.pod:1428
9148 msgid "This returns the verbose messages flag."
9152 #: ../src/guestfs-actions.pod:2119
9153 msgid "guestfs_getcon"
9157 #: ../src/guestfs-actions.pod:2121
9161 " guestfs_getcon (guestfs_h *g);\n"
9166 #: ../src/guestfs-actions.pod:2124 ../fish/guestfish-actions.pod:1434
9167 msgid "This gets the SELinux security context of the daemon."
9171 #: ../src/guestfs-actions.pod:2126
9172 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
9176 #: ../src/guestfs-actions.pod:2134
9177 msgid "guestfs_getxattr"
9181 #: ../src/guestfs-actions.pod:2136
9185 " guestfs_getxattr (guestfs_h *g,\n"
9186 " const char *path,\n"
9187 " const char *name,\n"
9188 " size_t *size_r);\n"
9193 #: ../src/guestfs-actions.pod:2142
9195 "Get a single extended attribute from file C<path> named C<name>. This call "
9196 "follows symlinks. If you want to lookup an extended attribute for the "
9197 "symlink itself, use C<guestfs_lgetxattr>."
9201 #: ../src/guestfs-actions.pod:2146 ../src/guestfs-actions.pod:3515
9203 "Normally it is better to get all extended attributes from a file in one go "
9204 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
9205 "implementations are buggy and do not provide a way to list out attributes. "
9206 "For these filesystems (notably ntfs-3g) you have to know the names of the "
9207 "extended attributes you want in advance and call this function."
9211 #: ../src/guestfs-actions.pod:2153 ../src/guestfs-actions.pod:3522 ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:2460
9213 "Extended attribute values are blobs of binary data. If there is no extended "
9214 "attribute named C<name>, this returns an error."
9218 #: ../src/guestfs-actions.pod:2156
9219 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
9223 #: ../src/guestfs-actions.pod:2158 ../src/guestfs-actions.pod:2349 ../src/guestfs-actions.pod:3527 ../src/guestfs-actions.pod:5244 ../src/guestfs-actions.pod:5270 ../src/guestfs-actions.pod:5451
9225 "This function returns a buffer, or NULL on error. The size of the returned "
9226 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
9231 #: ../src/guestfs-actions.pod:2162 ../src/guestfs-actions.pod:3531
9232 msgid "(Added in 1.7.24)"
9236 #: ../src/guestfs-actions.pod:2164
9237 msgid "guestfs_getxattrs"
9241 #: ../src/guestfs-actions.pod:2166
9244 " struct guestfs_xattr_list *\n"
9245 " guestfs_getxattrs (guestfs_h *g,\n"
9246 " const char *path);\n"
9251 #: ../src/guestfs-actions.pod:2170 ../fish/guestfish-actions.pod:1463
9252 msgid "This call lists the extended attributes of the file or directory C<path>."
9256 #: ../src/guestfs-actions.pod:2173 ../fish/guestfish-actions.pod:1466
9258 "At the system call level, this is a combination of the L<listxattr(2)> and "
9259 "L<getxattr(2)> calls."
9263 #: ../src/guestfs-actions.pod:2176
9264 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
9268 #: ../src/guestfs-actions.pod:2178 ../src/guestfs-actions.pod:3543 ../src/guestfs-actions.pod:4194
9270 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
9271 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
9275 #: ../src/guestfs-actions.pod:2182 ../src/guestfs-actions.pod:3547 ../src/guestfs-actions.pod:3712 ../src/guestfs-actions.pod:3748 ../src/guestfs-actions.pod:5624 ../src/guestfs-actions.pod:6112 ../src/guestfs-actions.pod:7447
9276 msgid "(Added in 1.0.59)"
9280 #: ../src/guestfs-actions.pod:2184
9281 msgid "guestfs_glob_expand"
9285 #: ../src/guestfs-actions.pod:2186
9289 " guestfs_glob_expand (guestfs_h *g,\n"
9290 " const char *pattern);\n"
9295 #: ../src/guestfs-actions.pod:2190 ../fish/guestfish-actions.pod:1475
9297 "This command searches for all the pathnames matching C<pattern> according to "
9298 "the wildcard expansion rules used by the shell."
9302 #: ../src/guestfs-actions.pod:2194 ../fish/guestfish-actions.pod:1479
9303 msgid "If no paths match, then this returns an empty list (note: not an error)."
9307 #: ../src/guestfs-actions.pod:2197 ../fish/guestfish-actions.pod:1482
9309 "It is just a wrapper around the C L<glob(3)> function with flags "
9310 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
9314 #: ../src/guestfs-actions.pod:2205 ../src/guestfs-actions.pod:6277 ../src/guestfs-actions.pod:6294
9315 msgid "(Added in 1.0.50)"
9319 #: ../src/guestfs-actions.pod:2207
9320 msgid "guestfs_grep"
9324 #: ../src/guestfs-actions.pod:2209
9328 " guestfs_grep (guestfs_h *g,\n"
9329 " const char *regex,\n"
9330 " const char *path);\n"
9335 #: ../src/guestfs-actions.pod:2214 ../fish/guestfish-actions.pod:1490
9336 msgid "This calls the external C<grep> program and returns the matching lines."
9340 #: ../src/guestfs-actions.pod:2226
9341 msgid "guestfs_grepi"
9345 #: ../src/guestfs-actions.pod:2228
9349 " guestfs_grepi (guestfs_h *g,\n"
9350 " const char *regex,\n"
9351 " const char *path);\n"
9356 #: ../src/guestfs-actions.pod:2233 ../fish/guestfish-actions.pod:1500
9357 msgid "This calls the external C<grep -i> program and returns the matching lines."
9361 #: ../src/guestfs-actions.pod:2245
9362 msgid "guestfs_grub_install"
9366 #: ../src/guestfs-actions.pod:2247
9370 " guestfs_grub_install (guestfs_h *g,\n"
9371 " const char *root,\n"
9372 " const char *device);\n"
9377 #: ../src/guestfs-actions.pod:2252 ../fish/guestfish-actions.pod:1510
9379 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
9380 "the root directory being C<root>."
9384 #: ../src/guestfs-actions.pod:2255 ../fish/guestfish-actions.pod:1513
9386 "Note: If grub-install reports the error \"No suitable drive was found in the "
9387 "generated device map.\" it may be that you need to create a "
9388 "C</boot/grub/device.map> file first that contains the mapping between grub "
9389 "device names and Linux device names. It is usually sufficient to create a "
9394 #: ../src/guestfs-actions.pod:2262 ../fish/guestfish-actions.pod:1520
9402 #: ../src/guestfs-actions.pod:2264 ../fish/guestfish-actions.pod:1522
9403 msgid "replacing C</dev/vda> with the name of the installation device."
9407 #: ../src/guestfs-actions.pod:2268
9408 msgid "(Added in 1.0.17)"
9412 #: ../src/guestfs-actions.pod:2270
9413 msgid "guestfs_head"
9417 #: ../src/guestfs-actions.pod:2272
9421 " guestfs_head (guestfs_h *g,\n"
9422 " const char *path);\n"
9427 #: ../src/guestfs-actions.pod:2276 ../fish/guestfish-actions.pod:1528
9429 "This command returns up to the first 10 lines of a file as a list of "
9434 #: ../src/guestfs-actions.pod:2288
9435 msgid "guestfs_head_n"
9439 #: ../src/guestfs-actions.pod:2290
9443 " guestfs_head_n (guestfs_h *g,\n"
9445 " const char *path);\n"
9450 #: ../src/guestfs-actions.pod:2295 ../fish/guestfish-actions.pod:1538
9452 "If the parameter C<nrlines> is a positive number, this returns the first "
9453 "C<nrlines> lines of the file C<path>."
9457 #: ../src/guestfs-actions.pod:2298 ../fish/guestfish-actions.pod:1541
9459 "If the parameter C<nrlines> is a negative number, this returns lines from "
9460 "the file C<path>, excluding the last C<nrlines> lines."
9464 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:6574 ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:4430
9465 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9469 #: ../src/guestfs-actions.pod:2312
9470 msgid "guestfs_hexdump"
9474 #: ../src/guestfs-actions.pod:2314
9478 " guestfs_hexdump (guestfs_h *g,\n"
9479 " const char *path);\n"
9484 #: ../src/guestfs-actions.pod:2318 ../fish/guestfish-actions.pod:1553
9486 "This runs C<hexdump -C> on the given C<path>. The result is the "
9487 "human-readable, canonical hex dump of the file."
9491 #: ../src/guestfs-actions.pod:2327 ../src/guestfs-actions.pod:6358 ../src/guestfs-actions.pod:6413
9492 msgid "(Added in 1.0.22)"
9496 #: ../src/guestfs-actions.pod:2329
9497 msgid "guestfs_initrd_cat"
9501 #: ../src/guestfs-actions.pod:2331
9505 " guestfs_initrd_cat (guestfs_h *g,\n"
9506 " const char *initrdpath,\n"
9507 " const char *filename,\n"
9508 " size_t *size_r);\n"
9513 #: ../src/guestfs-actions.pod:2337 ../fish/guestfish-actions.pod:1563
9515 "This command unpacks the file C<filename> from the initrd file called "
9516 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9521 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1567
9523 "For example, in guestfish you could use the following command to examine the "
9524 "boot script (usually called C</init>) contained in a Linux initrd or "
9529 #: ../src/guestfs-actions.pod:2345 ../fish/guestfish-actions.pod:1571
9532 " initrd-cat /boot/initrd-<version>.img init\n"
9537 #: ../src/guestfs-actions.pod:2347
9538 msgid "See also C<guestfs_initrd_list>."
9542 #: ../src/guestfs-actions.pod:2358
9543 msgid "guestfs_initrd_list"
9547 #: ../src/guestfs-actions.pod:2360
9551 " guestfs_initrd_list (guestfs_h *g,\n"
9552 " const char *path);\n"
9557 #: ../src/guestfs-actions.pod:2364 ../fish/guestfish-actions.pod:1582
9558 msgid "This command lists out files contained in an initrd."
9562 #: ../src/guestfs-actions.pod:2366 ../fish/guestfish-actions.pod:1584
9564 "The files are listed without any initial C</> character. The files are "
9565 "listed in the order they appear (not necessarily alphabetical). Directory "
9566 "names are listed as separate items."
9570 #: ../src/guestfs-actions.pod:2370 ../fish/guestfish-actions.pod:1588
9572 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9573 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9578 #: ../src/guestfs-actions.pod:2380
9579 msgid "guestfs_inotify_add_watch"
9583 #: ../src/guestfs-actions.pod:2382
9587 " guestfs_inotify_add_watch (guestfs_h *g,\n"
9588 " const char *path,\n"
9594 #: ../src/guestfs-actions.pod:2387 ../fish/guestfish-actions.pod:1596
9595 msgid "Watch C<path> for the events listed in C<mask>."
9599 #: ../src/guestfs-actions.pod:2389 ../fish/guestfish-actions.pod:1598
9601 "Note that if C<path> is a directory then events within that directory are "
9602 "watched, but this does I<not> happen recursively (in subdirectories)."
9606 #: ../src/guestfs-actions.pod:2393 ../fish/guestfish-actions.pod:1602
9608 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9609 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9613 #: ../src/guestfs-actions.pod:2401
9614 msgid "guestfs_inotify_close"
9618 #: ../src/guestfs-actions.pod:2403
9622 " guestfs_inotify_close (guestfs_h *g);\n"
9627 #: ../src/guestfs-actions.pod:2406 ../fish/guestfish-actions.pod:1610
9629 "This closes the inotify handle which was previously opened by inotify_init. "
9630 "It removes all watches, throws away any pending events, and deallocates all "
9635 #: ../src/guestfs-actions.pod:2414
9636 msgid "guestfs_inotify_files"
9640 #: ../src/guestfs-actions.pod:2416
9644 " guestfs_inotify_files (guestfs_h *g);\n"
9649 #: ../src/guestfs-actions.pod:2419
9651 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
9652 "returns a list of pathnames of objects that were touched. The returned "
9653 "pathnames are sorted and deduplicated."
9657 #: ../src/guestfs-actions.pod:2429
9658 msgid "guestfs_inotify_init"
9662 #: ../src/guestfs-actions.pod:2431
9666 " guestfs_inotify_init (guestfs_h *g,\n"
9667 " int maxevents);\n"
9672 #: ../src/guestfs-actions.pod:2435 ../fish/guestfish-actions.pod:1626
9674 "This command creates a new inotify handle. The inotify subsystem can be "
9675 "used to notify events which happen to objects in the guest filesystem."
9679 #: ../src/guestfs-actions.pod:2439
9681 "C<maxevents> is the maximum number of events which will be queued up between "
9682 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
9683 "passed as C<0>, then the kernel (or previously set) default is used. For "
9684 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
9685 "throws away events, but records the fact that it threw them away by setting "
9686 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
9687 "C<guestfs_inotify_read>)."
9691 #: ../src/guestfs-actions.pod:2449
9693 "Before any events are generated, you have to add some watches to the "
9694 "internal watch list. See: C<guestfs_inotify_add_watch>, "
9695 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
9699 #: ../src/guestfs-actions.pod:2455
9701 "Queued up events should be read periodically by calling "
9702 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
9703 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
9704 "often enough then you risk the internal queue overflowing."
9708 #: ../src/guestfs-actions.pod:2462
9710 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
9711 "This also removes any watches automatically."
9715 #: ../src/guestfs-actions.pod:2466 ../fish/guestfish-actions.pod:1657
9717 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9718 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9719 "that there is one global inotify handle per libguestfs instance."
9723 #: ../src/guestfs-actions.pod:2475
9724 msgid "guestfs_inotify_read"
9728 #: ../src/guestfs-actions.pod:2477
9731 " struct guestfs_inotify_event_list *\n"
9732 " guestfs_inotify_read (guestfs_h *g);\n"
9737 #: ../src/guestfs-actions.pod:2480 ../fish/guestfish-actions.pod:1666
9739 "Return the complete queue of events that have happened since the previous "
9744 #: ../src/guestfs-actions.pod:2483 ../fish/guestfish-actions.pod:1669
9745 msgid "If no events have happened, this returns an empty list."
9749 #: ../src/guestfs-actions.pod:2485 ../fish/guestfish-actions.pod:1671
9751 "I<Note>: In order to make sure that all events have been read, you must call "
9752 "this function repeatedly until it returns an empty list. The reason is that "
9753 "the call will read events up to the maximum appliance-to-host message size "
9754 "and leave remaining events in the queue."
9758 #: ../src/guestfs-actions.pod:2491
9760 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
9761 "there was an error. I<The caller must call "
9762 "C<guestfs_free_inotify_event_list> after use>."
9766 #: ../src/guestfs-actions.pod:2497
9767 msgid "guestfs_inotify_rm_watch"
9771 #: ../src/guestfs-actions.pod:2499
9775 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
9781 #: ../src/guestfs-actions.pod:2503
9783 "Remove a previously defined inotify watch. See "
9784 "C<guestfs_inotify_add_watch>."
9788 #: ../src/guestfs-actions.pod:2510
9789 msgid "guestfs_inspect_get_arch"
9793 #: ../src/guestfs-actions.pod:2512
9797 " guestfs_inspect_get_arch (guestfs_h *g,\n"
9798 " const char *root);\n"
9803 #: ../src/guestfs-actions.pod:2516 ../src/guestfs-actions.pod:2539 ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2676 ../src/guestfs-actions.pod:2702 ../src/guestfs-actions.pod:2741 ../src/guestfs-actions.pod:2763 ../src/guestfs-actions.pod:2790 ../src/guestfs-actions.pod:2811 ../src/guestfs-actions.pod:2854 ../src/guestfs-actions.pod:2883 ../src/guestfs-actions.pod:2914 ../src/guestfs-actions.pod:2938 ../src/guestfs-actions.pod:2993 ../src/guestfs-actions.pod:3035 ../src/guestfs-actions.pod:3056 ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3096 ../src/guestfs-actions.pod:3113 ../src/guestfs-actions.pod:3132
9805 "This function should only be called with a root device string as returned by "
9806 "C<guestfs_inspect_os>."
9810 #: ../src/guestfs-actions.pod:2519
9812 "This returns the architecture of the inspected operating system. The "
9813 "possible return values are listed under C<guestfs_file_architecture>."
9817 #: ../src/guestfs-actions.pod:2523 ../fish/guestfish-actions.pod:1695
9819 "If the architecture could not be determined, then the string C<unknown> is "
9824 #: ../src/guestfs-actions.pod:2526 ../src/guestfs-actions.pod:2619 ../src/guestfs-actions.pod:2730 ../src/guestfs-actions.pod:2750 ../src/guestfs-actions.pod:2778 ../src/guestfs-actions.pod:2870 ../src/guestfs-actions.pod:2901 ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:2979 ../src/guestfs-actions.pod:3022 ../src/guestfs-actions.pod:3045 ../src/guestfs-actions.pod:3066 ../src/guestfs-actions.pod:3086 ../src/guestfs-actions.pod:3103 ../src/guestfs-actions.pod:3122 ../src/guestfs-actions.pod:3225 ../src/guestfs-actions.pod:3266 ../fish/guestfish-actions.pod:1698 ../fish/guestfish-actions.pod:1784 ../fish/guestfish-actions.pod:1872 ../fish/guestfish-actions.pod:1887 ../fish/guestfish-actions.pod:1908 ../fish/guestfish-actions.pod:1978 ../fish/guestfish-actions.pod:2002 ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2062 ../fish/guestfish-actions.pod:2097 ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2129 ../fish/guestfish-actions.pod:2142 ../fish/guestfish-actions.pod:2155 ../fish/guestfish-actions.pod:2170 ../fish/guestfish-actions.pod:2269 ../fish/guestfish-actions.pod:2303
9825 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9829 #: ../src/guestfs-actions.pod:2533
9830 msgid "guestfs_inspect_get_distro"
9834 #: ../src/guestfs-actions.pod:2535
9838 " guestfs_inspect_get_distro (guestfs_h *g,\n"
9839 " const char *root);\n"
9844 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1707
9845 msgid "This returns the distro (distribution) of the inspected operating system."
9849 #: ../src/guestfs-actions.pod:2545 ../fish/guestfish-actions.pod:1710
9850 msgid "Currently defined distros are:"
9854 #: ../src/guestfs-actions.pod:2549 ../fish/guestfish-actions.pod:1714
9855 msgid "\"archlinux\""
9859 #: ../src/guestfs-actions.pod:2551 ../fish/guestfish-actions.pod:1716
9864 #: ../src/guestfs-actions.pod:2553 ../fish/guestfish-actions.pod:1718
9869 #: ../src/guestfs-actions.pod:2555 ../fish/guestfish-actions.pod:1720
9874 #: ../src/guestfs-actions.pod:2557 ../fish/guestfish-actions.pod:1722
9879 #: ../src/guestfs-actions.pod:2559 ../fish/guestfish-actions.pod:1724
9884 #: ../src/guestfs-actions.pod:2561 ../fish/guestfish-actions.pod:1726
9889 #: ../src/guestfs-actions.pod:2563 ../fish/guestfish-actions.pod:1728
9894 #: ../src/guestfs-actions.pod:2565 ../fish/guestfish-actions.pod:1730
9899 #: ../src/guestfs-actions.pod:2567 ../fish/guestfish-actions.pod:1732
9904 #: ../src/guestfs-actions.pod:2569 ../fish/guestfish-actions.pod:1734
9905 msgid "\"linuxmint\""
9909 #: ../src/guestfs-actions.pod:2571 ../fish/guestfish-actions.pod:1736
9914 #: ../src/guestfs-actions.pod:2573 ../fish/guestfish-actions.pod:1738
9915 msgid "\"mandriva\""
9919 #: ../src/guestfs-actions.pod:2575 ../fish/guestfish-actions.pod:1740
9924 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:1742
9929 #: ../src/guestfs-actions.pod:2579 ../fish/guestfish-actions.pod:1744
9934 #: ../src/guestfs-actions.pod:2581 ../fish/guestfish-actions.pod:1746
9939 #: ../src/guestfs-actions.pod:2583 ../fish/guestfish-actions.pod:1748
9944 #: ../src/guestfs-actions.pod:2585 ../fish/guestfish-actions.pod:1750
9945 msgid "\"redhat-based\""
9949 #: ../src/guestfs-actions.pod:2587 ../fish/guestfish-actions.pod:1752
9950 msgid "Some Red Hat-derived distro."
9954 #: ../src/guestfs-actions.pod:2589 ../fish/guestfish-actions.pod:1754
9959 #: ../src/guestfs-actions.pod:2591 ../fish/guestfish-actions.pod:1756
9960 msgid "Red Hat Enterprise Linux."
9964 #: ../src/guestfs-actions.pod:2593 ../fish/guestfish-actions.pod:1758
9965 msgid "\"scientificlinux\""
9969 #: ../src/guestfs-actions.pod:2595 ../fish/guestfish-actions.pod:1760
9970 msgid "Scientific Linux."
9974 #: ../src/guestfs-actions.pod:2597 ../fish/guestfish-actions.pod:1762
9975 msgid "\"slackware\""
9979 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:1764
9984 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:1766
9989 #: ../src/guestfs-actions.pod:2603 ../fish/guestfish-actions.pod:1768
9994 #: ../src/guestfs-actions.pod:2605 ../src/guestfs-actions.pod:2721 ../src/guestfs-actions.pod:3013 ../fish/guestfish-actions.pod:1770 ../fish/guestfish-actions.pod:1863 ../fish/guestfish-actions.pod:2088
9999 #: ../src/guestfs-actions.pod:2607 ../fish/guestfish-actions.pod:1772
10000 msgid "The distro could not be determined."
10004 #: ../src/guestfs-actions.pod:2609 ../src/guestfs-actions.pod:3005 ../fish/guestfish-actions.pod:1774 ../fish/guestfish-actions.pod:2080
10005 msgid "\"windows\""
10009 #: ../src/guestfs-actions.pod:2611 ../fish/guestfish-actions.pod:1776
10011 "Windows does not have distributions. This string is returned if the OS type "
10016 #: ../src/guestfs-actions.pod:2616 ../src/guestfs-actions.pod:2727 ../src/guestfs-actions.pod:3019 ../fish/guestfish-actions.pod:1781 ../fish/guestfish-actions.pod:1869 ../fish/guestfish-actions.pod:2094
10018 "Future versions of libguestfs may return other strings here. The caller "
10019 "should be prepared to handle any string."
10023 #: ../src/guestfs-actions.pod:2626
10024 msgid "guestfs_inspect_get_drive_mappings"
10028 #: ../src/guestfs-actions.pod:2628
10032 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
10033 " const char *root);\n"
10038 #: ../src/guestfs-actions.pod:2635 ../fish/guestfish-actions.pod:1793
10040 "This call is useful for Windows which uses a primitive system of assigning "
10041 "drive letters (like \"C:\") to partitions. This inspection API examines the "
10042 "Windows Registry to find out how disks/partitions are mapped to drive "
10043 "letters, and returns a hash table as in the example below:"
10047 #: ../src/guestfs-actions.pod:2641 ../fish/guestfish-actions.pod:1799
10050 " C => /dev/vda2\n"
10051 " E => /dev/vdb1\n"
10052 " F => /dev/vdc1\n"
10057 #: ../src/guestfs-actions.pod:2645 ../fish/guestfish-actions.pod:1803
10059 "Note that keys are drive letters. For Windows, the key is case insensitive "
10060 "and just contains the drive letter, without the customary colon separator "
10065 #: ../src/guestfs-actions.pod:2649 ../fish/guestfish-actions.pod:1807
10067 "In future we may support other operating systems that also used drive "
10068 "letters, but the keys for those might not be case insensitive and might be "
10069 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
10074 #: ../src/guestfs-actions.pod:2654 ../fish/guestfish-actions.pod:1812
10076 "For Windows guests, currently only hard drive mappings are returned. "
10077 "Removable disks (eg. DVD-ROMs) are ignored."
10081 #: ../src/guestfs-actions.pod:2657 ../fish/guestfish-actions.pod:1815
10083 "For guests that do not use drive mappings, or if the drive mappings could "
10084 "not be determined, this returns an empty hash table."
10088 #: ../src/guestfs-actions.pod:2660
10090 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10091 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
10095 #: ../src/guestfs-actions.pod:2664 ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:3600 ../src/guestfs-actions.pod:4810 ../src/guestfs-actions.pod:6715
10097 "This function returns a NULL-terminated array of strings, or NULL if there "
10098 "was an error. The array of strings will always have length C<2n+1>, where "
10099 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
10100 "caller must free the strings and the array after use>."
10104 #: ../src/guestfs-actions.pod:2670
10105 msgid "guestfs_inspect_get_filesystems"
10109 #: ../src/guestfs-actions.pod:2672
10113 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
10114 " const char *root);\n"
10119 #: ../src/guestfs-actions.pod:2679 ../fish/guestfish-actions.pod:1829
10121 "This returns a list of all the filesystems that we think are associated with "
10122 "this operating system. This includes the root filesystem, other ordinary "
10123 "filesystems, and non-mounted devices like swap partitions."
10127 #: ../src/guestfs-actions.pod:2684 ../fish/guestfish-actions.pod:1834
10129 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
10130 "to be shared between operating systems."
10134 #: ../src/guestfs-actions.pod:2687
10136 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10137 "C<guestfs_inspect_get_mountpoints>."
10141 #: ../src/guestfs-actions.pod:2696
10142 msgid "guestfs_inspect_get_format"
10146 #: ../src/guestfs-actions.pod:2698
10150 " guestfs_inspect_get_format (guestfs_h *g,\n"
10151 " const char *root);\n"
10156 #: ../src/guestfs-actions.pod:2705 ../fish/guestfish-actions.pod:1847
10158 "This returns the format of the inspected operating system. You can use it "
10159 "to detect install images, live CDs and similar."
10163 #: ../src/guestfs-actions.pod:2708 ../fish/guestfish-actions.pod:1850
10164 msgid "Currently defined formats are:"
10168 #: ../src/guestfs-actions.pod:2712 ../fish/guestfish-actions.pod:1854
10169 msgid "\"installed\""
10173 #: ../src/guestfs-actions.pod:2714 ../fish/guestfish-actions.pod:1856
10174 msgid "This is an installed operating system."
10178 #: ../src/guestfs-actions.pod:2716 ../fish/guestfish-actions.pod:1858
10179 msgid "\"installer\""
10183 #: ../src/guestfs-actions.pod:2718 ../fish/guestfish-actions.pod:1860
10185 "The disk image being inspected is not an installed operating system, but a "
10186 "I<bootable> install disk, live CD, or similar."
10190 #: ../src/guestfs-actions.pod:2723 ../fish/guestfish-actions.pod:1865
10191 msgid "The format of this disk image is not known."
10195 #: ../src/guestfs-actions.pod:2735
10196 msgid "guestfs_inspect_get_hostname"
10200 #: ../src/guestfs-actions.pod:2737
10204 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
10205 " const char *root);\n"
10210 #: ../src/guestfs-actions.pod:2744 ../fish/guestfish-actions.pod:1881
10212 "This function returns the hostname of the operating system as found by "
10213 "inspection of the guest's configuration files."
10217 #: ../src/guestfs-actions.pod:2747 ../fish/guestfish-actions.pod:1884
10219 "If the hostname could not be determined, then the string C<unknown> is "
10224 #: ../src/guestfs-actions.pod:2755
10225 msgid "(Added in 1.7.9)"
10229 #: ../src/guestfs-actions.pod:2757
10230 msgid "guestfs_inspect_get_major_version"
10234 #: ../src/guestfs-actions.pod:2759
10238 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
10239 " const char *root);\n"
10244 #: ../src/guestfs-actions.pod:2766 ../fish/guestfish-actions.pod:1896
10245 msgid "This returns the major version number of the inspected operating system."
10249 #: ../src/guestfs-actions.pod:2769 ../fish/guestfish-actions.pod:1899
10251 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10252 "popular public names used by the operating system. Notably the operating "
10253 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10254 "1). You can find out the real versions corresponding to releases of Windows "
10255 "by consulting Wikipedia or MSDN."
10259 #: ../src/guestfs-actions.pod:2776 ../src/guestfs-actions.pod:2796 ../fish/guestfish-actions.pod:1906 ../fish/guestfish-actions.pod:1920
10260 msgid "If the version could not be determined, then C<0> is returned."
10264 #: ../src/guestfs-actions.pod:2784
10265 msgid "guestfs_inspect_get_minor_version"
10269 #: ../src/guestfs-actions.pod:2786
10273 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
10274 " const char *root);\n"
10279 #: ../src/guestfs-actions.pod:2793 ../fish/guestfish-actions.pod:1917
10280 msgid "This returns the minor version number of the inspected operating system."
10284 #: ../src/guestfs-actions.pod:2798
10286 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10287 "C<guestfs_inspect_get_major_version>."
10291 #: ../src/guestfs-actions.pod:2805
10292 msgid "guestfs_inspect_get_mountpoints"
10296 #: ../src/guestfs-actions.pod:2807
10300 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
10301 " const char *root);\n"
10306 #: ../src/guestfs-actions.pod:2814 ../fish/guestfish-actions.pod:1932
10308 "This returns a hash of where we think the filesystems associated with this "
10309 "operating system should be mounted. Callers should note that this is at "
10310 "best an educated guess made by reading configuration files such as "
10311 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
10312 "are non-existent or not mountable and callers should be prepared to handle "
10313 "or ignore failures if they try to mount them."
10317 #: ../src/guestfs-actions.pod:2823 ../fish/guestfish-actions.pod:1941
10319 "Each element in the returned hashtable has a key which is the path of the "
10320 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10321 "mounted there (eg. C</dev/sda1>)."
10325 #: ../src/guestfs-actions.pod:2828 ../fish/guestfish-actions.pod:1946
10326 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
10330 #: ../src/guestfs-actions.pod:2831
10332 "For operating systems like Windows which still use drive letters, this call "
10333 "will only return an entry for the first drive \"mounted on\" C</>. For "
10334 "information about the mapping of drive letters to partitions, see "
10335 "C<guestfs_inspect_get_drive_mappings>."
10339 #: ../src/guestfs-actions.pod:2837
10341 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10342 "C<guestfs_inspect_get_filesystems>."
10346 #: ../src/guestfs-actions.pod:2848
10347 msgid "guestfs_inspect_get_package_format"
10351 #: ../src/guestfs-actions.pod:2850
10355 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
10356 " const char *root);\n"
10361 #: ../src/guestfs-actions.pod:2857
10363 "This function and C<guestfs_inspect_get_package_management> return the "
10364 "package format and package management tool used by the inspected operating "
10365 "system. For example for Fedora these functions would return C<rpm> (package "
10366 "format) and C<yum> (package management)."
10370 #: ../src/guestfs-actions.pod:2863 ../fish/guestfish-actions.pod:1971
10372 "This returns the string C<unknown> if we could not determine the package "
10373 "format I<or> if the operating system does not have a real packaging system "
10378 #: ../src/guestfs-actions.pod:2867 ../fish/guestfish-actions.pod:1975
10380 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
10381 "Future versions of libguestfs may return other strings."
10385 #: ../src/guestfs-actions.pod:2875 ../src/guestfs-actions.pod:2906
10386 msgid "(Added in 1.7.5)"
10390 #: ../src/guestfs-actions.pod:2877
10391 msgid "guestfs_inspect_get_package_management"
10395 #: ../src/guestfs-actions.pod:2879
10399 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
10400 " const char *root);\n"
10405 #: ../src/guestfs-actions.pod:2886
10407 "C<guestfs_inspect_get_package_format> and this function return the package "
10408 "format and package management tool used by the inspected operating system. "
10409 "For example for Fedora these functions would return C<rpm> (package format) "
10410 "and C<yum> (package management)."
10414 #: ../src/guestfs-actions.pod:2892 ../fish/guestfish-actions.pod:1993
10416 "This returns the string C<unknown> if we could not determine the package "
10417 "management tool I<or> if the operating system does not have a real packaging "
10418 "system (eg. Windows)."
10422 #: ../src/guestfs-actions.pod:2896 ../fish/guestfish-actions.pod:1997
10424 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10425 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
10426 "libguestfs may return other strings."
10430 #: ../src/guestfs-actions.pod:2908
10431 msgid "guestfs_inspect_get_product_name"
10435 #: ../src/guestfs-actions.pod:2910
10439 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
10440 " const char *root);\n"
10445 #: ../src/guestfs-actions.pod:2917 ../fish/guestfish-actions.pod:2011
10447 "This returns the product name of the inspected operating system. The "
10448 "product name is generally some freeform string which can be displayed to the "
10449 "user, but should not be parsed by programs."
10453 #: ../src/guestfs-actions.pod:2922 ../fish/guestfish-actions.pod:2016
10455 "If the product name could not be determined, then the string C<unknown> is "
10460 #: ../src/guestfs-actions.pod:2932
10461 msgid "guestfs_inspect_get_product_variant"
10465 #: ../src/guestfs-actions.pod:2934
10469 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
10470 " const char *root);\n"
10475 #: ../src/guestfs-actions.pod:2941 ../fish/guestfish-actions.pod:2028
10476 msgid "This returns the product variant of the inspected operating system."
10480 #: ../src/guestfs-actions.pod:2944 ../fish/guestfish-actions.pod:2031
10482 "For Windows guests, this returns the contents of the Registry key "
10483 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
10484 "which is usually a string such as C<Client> or C<Server> (other values are "
10485 "possible). This can be used to distinguish consumer and enterprise versions "
10486 "of Windows that have the same version number (for example, Windows 7 and "
10487 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10488 "the latter is C<Server>)."
10492 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2040
10494 "For enterprise Linux guests, in future we intend this to return the product "
10495 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10496 "implemented at present."
10500 #: ../src/guestfs-actions.pod:2957 ../fish/guestfish-actions.pod:2044
10502 "If the product variant could not be determined, then the string C<unknown> "
10507 #: ../src/guestfs-actions.pod:2960
10509 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10510 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
10514 #: ../src/guestfs-actions.pod:2967
10515 msgid "guestfs_inspect_get_roots"
10519 #: ../src/guestfs-actions.pod:2969
10523 " guestfs_inspect_get_roots (guestfs_h *g);\n"
10528 #: ../src/guestfs-actions.pod:2972
10530 "This function is a convenient way to get the list of root devices, as "
10531 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
10532 "the whole inspection process."
10536 #: ../src/guestfs-actions.pod:2976
10538 "This returns an empty list if either no root devices were found or the "
10539 "caller has not called C<guestfs_inspect_os>."
10543 #: ../src/guestfs-actions.pod:2985
10544 msgid "(Added in 1.7.3)"
10548 #: ../src/guestfs-actions.pod:2987
10549 msgid "guestfs_inspect_get_type"
10553 #: ../src/guestfs-actions.pod:2989
10557 " guestfs_inspect_get_type (guestfs_h *g,\n"
10558 " const char *root);\n"
10563 #: ../src/guestfs-actions.pod:2996 ../fish/guestfish-actions.pod:2071
10565 "This returns the type of the inspected operating system. Currently defined "
10570 #: ../src/guestfs-actions.pod:3001 ../fish/guestfish-actions.pod:2076
10575 #: ../src/guestfs-actions.pod:3003 ../fish/guestfish-actions.pod:2078
10576 msgid "Any Linux-based operating system."
10580 #: ../src/guestfs-actions.pod:3007 ../fish/guestfish-actions.pod:2082
10581 msgid "Any Microsoft Windows operating system."
10585 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2084
10586 msgid "\"freebsd\""
10590 #: ../src/guestfs-actions.pod:3011 ../fish/guestfish-actions.pod:2086
10595 #: ../src/guestfs-actions.pod:3015 ../fish/guestfish-actions.pod:2090
10596 msgid "The operating system type could not be determined."
10600 #: ../src/guestfs-actions.pod:3029
10601 msgid "guestfs_inspect_get_windows_current_control_set"
10605 #: ../src/guestfs-actions.pod:3031
10609 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
10610 " const char *root);\n"
10615 #: ../src/guestfs-actions.pod:3038 ../fish/guestfish-actions.pod:2106
10617 "This returns the Windows CurrentControlSet of the inspected guest. The "
10618 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10622 #: ../src/guestfs-actions.pod:3041 ../fish/guestfish-actions.pod:2109
10624 "This call assumes that the guest is Windows and that the Registry could be "
10625 "examined by inspection. If this is not the case then an error is returned."
10629 #: ../src/guestfs-actions.pod:3050
10630 msgid "guestfs_inspect_get_windows_systemroot"
10634 #: ../src/guestfs-actions.pod:3052
10638 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
10639 " const char *root);\n"
10644 #: ../src/guestfs-actions.pod:3059 ../fish/guestfish-actions.pod:2122
10646 "This returns the Windows systemroot of the inspected guest. The systemroot "
10647 "is a directory path such as C</WINDOWS>."
10651 #: ../src/guestfs-actions.pod:3062 ../fish/guestfish-actions.pod:2125
10653 "This call assumes that the guest is Windows and that the systemroot could be "
10654 "determined by inspection. If this is not the case then an error is "
10659 #: ../src/guestfs-actions.pod:3071
10660 msgid "(Added in 1.5.25)"
10664 #: ../src/guestfs-actions.pod:3073
10665 msgid "guestfs_inspect_is_live"
10669 #: ../src/guestfs-actions.pod:3075
10673 " guestfs_inspect_is_live (guestfs_h *g,\n"
10674 " const char *root);\n"
10679 #: ../src/guestfs-actions.pod:3082
10681 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
10682 "disk), then this returns true if a live image was detected on the disk."
10686 #: ../src/guestfs-actions.pod:3090
10687 msgid "guestfs_inspect_is_multipart"
10691 #: ../src/guestfs-actions.pod:3092
10695 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
10696 " const char *root);\n"
10701 #: ../src/guestfs-actions.pod:3099
10703 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
10704 "disk), then this returns true if the disk is part of a set."
10708 #: ../src/guestfs-actions.pod:3107
10709 msgid "guestfs_inspect_is_netinst"
10713 #: ../src/guestfs-actions.pod:3109
10717 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
10718 " const char *root);\n"
10723 #: ../src/guestfs-actions.pod:3116
10725 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
10726 "disk), then this returns true if the disk is a network installer, ie. not a "
10727 "self-contained install CD but one which is likely to require network access "
10728 "to complete the install."
10732 #: ../src/guestfs-actions.pod:3126
10733 msgid "guestfs_inspect_list_applications"
10737 #: ../src/guestfs-actions.pod:3128
10740 " struct guestfs_application_list *\n"
10741 " guestfs_inspect_list_applications (guestfs_h *g,\n"
10742 " const char *root);\n"
10747 #: ../src/guestfs-actions.pod:3135 ../fish/guestfish-actions.pod:2179
10748 msgid "Return the list of applications installed in the operating system."
10752 #: ../src/guestfs-actions.pod:3137
10754 "I<Note:> This call works differently from other parts of the inspection "
10755 "API. You have to call C<guestfs_inspect_os>, then "
10756 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
10757 "this. Listing applications is a significantly more difficult operation "
10758 "which requires access to the full filesystem. Also note that unlike the "
10759 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
10760 "the libguestfs handle, this call actually reads parts of the mounted "
10761 "filesystems during the call."
10765 #: ../src/guestfs-actions.pod:3147 ../fish/guestfish-actions.pod:2191
10767 "This returns an empty list if the inspection code was not able to determine "
10768 "the list of applications."
10772 #: ../src/guestfs-actions.pod:3150 ../fish/guestfish-actions.pod:2194
10773 msgid "The application structure contains the following fields:"
10777 #: ../src/guestfs-actions.pod:3154 ../fish/guestfish-actions.pod:2198
10778 msgid "C<app_name>"
10782 #: ../src/guestfs-actions.pod:3156 ../fish/guestfish-actions.pod:2200
10784 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10785 "guests, this is the package name."
10789 #: ../src/guestfs-actions.pod:3159 ../fish/guestfish-actions.pod:2203
10790 msgid "C<app_display_name>"
10794 #: ../src/guestfs-actions.pod:3161 ../fish/guestfish-actions.pod:2205
10796 "The display name of the application, sometimes localized to the install "
10797 "language of the guest operating system."
10801 #: ../src/guestfs-actions.pod:3164 ../fish/guestfish-actions.pod:2208
10803 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10804 "to display something can use C<app_name> instead."
10808 #: ../src/guestfs-actions.pod:3167 ../fish/guestfish-actions.pod:2211
10809 msgid "C<app_epoch>"
10813 #: ../src/guestfs-actions.pod:3169 ../fish/guestfish-actions.pod:2213
10815 "For package managers which use epochs, this contains the epoch of the "
10816 "package (an integer). If unavailable, this is returned as C<0>."
10820 #: ../src/guestfs-actions.pod:3172 ../fish/guestfish-actions.pod:2216
10821 msgid "C<app_version>"
10825 #: ../src/guestfs-actions.pod:3174 ../fish/guestfish-actions.pod:2218
10827 "The version string of the application or package. If unavailable this is "
10828 "returned as an empty string C<\"\">."
10832 #: ../src/guestfs-actions.pod:3177 ../fish/guestfish-actions.pod:2221
10833 msgid "C<app_release>"
10837 #: ../src/guestfs-actions.pod:3179 ../fish/guestfish-actions.pod:2223
10839 "The release string of the application or package, for package managers that "
10840 "use this. If unavailable this is returned as an empty string C<\"\">."
10844 #: ../src/guestfs-actions.pod:3183 ../fish/guestfish-actions.pod:2227
10845 msgid "C<app_install_path>"
10849 #: ../src/guestfs-actions.pod:3185 ../fish/guestfish-actions.pod:2229
10851 "The installation path of the application (on operating systems such as "
10852 "Windows which use installation paths). This path is in the format used by "
10853 "the guest operating system, it is not a libguestfs path."
10857 #: ../src/guestfs-actions.pod:3190 ../fish/guestfish-actions.pod:2234
10858 msgid "If unavailable this is returned as an empty string C<\"\">."
10862 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2236
10863 msgid "C<app_trans_path>"
10867 #: ../src/guestfs-actions.pod:3194 ../fish/guestfish-actions.pod:2238
10869 "The install path translated into a libguestfs path. If unavailable this is "
10870 "returned as an empty string C<\"\">."
10874 #: ../src/guestfs-actions.pod:3197 ../fish/guestfish-actions.pod:2241
10875 msgid "C<app_publisher>"
10879 #: ../src/guestfs-actions.pod:3199 ../fish/guestfish-actions.pod:2243
10881 "The name of the publisher of the application, for package managers that use "
10882 "this. If unavailable this is returned as an empty string C<\"\">."
10886 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2247
10891 #: ../src/guestfs-actions.pod:3205 ../fish/guestfish-actions.pod:2249
10893 "The URL (eg. upstream URL) of the application. If unavailable this is "
10894 "returned as an empty string C<\"\">."
10898 #: ../src/guestfs-actions.pod:3208 ../fish/guestfish-actions.pod:2252
10899 msgid "C<app_source_package>"
10903 #: ../src/guestfs-actions.pod:3210 ../fish/guestfish-actions.pod:2254
10905 "For packaging systems which support this, the name of the source package. "
10906 "If unavailable this is returned as an empty string C<\"\">."
10910 #: ../src/guestfs-actions.pod:3213 ../fish/guestfish-actions.pod:2257
10911 msgid "C<app_summary>"
10915 #: ../src/guestfs-actions.pod:3215 ../fish/guestfish-actions.pod:2259
10917 "A short (usually one line) description of the application or package. If "
10918 "unavailable this is returned as an empty string C<\"\">."
10922 #: ../src/guestfs-actions.pod:3218 ../fish/guestfish-actions.pod:2262
10923 msgid "C<app_description>"
10927 #: ../src/guestfs-actions.pod:3220 ../fish/guestfish-actions.pod:2264
10929 "A longer description of the application or package. If unavailable this is "
10930 "returned as an empty string C<\"\">."
10934 #: ../src/guestfs-actions.pod:3227
10936 "This function returns a C<struct guestfs_application_list *>, or NULL if "
10937 "there was an error. I<The caller must call C<guestfs_free_application_list> "
10942 #: ../src/guestfs-actions.pod:3231
10943 msgid "(Added in 1.7.8)"
10947 #: ../src/guestfs-actions.pod:3233
10948 msgid "guestfs_inspect_os"
10952 #: ../src/guestfs-actions.pod:3235
10956 " guestfs_inspect_os (guestfs_h *g);\n"
10961 #: ../src/guestfs-actions.pod:3238 ../fish/guestfish-actions.pod:2275
10963 "This function uses other libguestfs functions and certain heuristics to "
10964 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10965 "for operating systems."
10969 #: ../src/guestfs-actions.pod:3242 ../fish/guestfish-actions.pod:2279
10970 msgid "The list returned is empty if no operating systems were found."
10974 #: ../src/guestfs-actions.pod:3244 ../fish/guestfish-actions.pod:2281
10976 "If one operating system was found, then this returns a list with a single "
10977 "element, which is the name of the root filesystem of this operating system. "
10978 "It is also possible for this function to return a list containing more than "
10979 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10980 "element being the root filesystem of one of the operating systems."
10984 #: ../src/guestfs-actions.pod:3251
10986 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
10987 "functions in order to query further information about each operating system, "
10988 "such as the name and version."
10992 #: ../src/guestfs-actions.pod:3256
10994 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
10995 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
10996 "the contents. This should be called with no disks currently mounted. The "
10997 "function may also use Augeas, so any existing Augeas handle will be closed."
11001 #: ../src/guestfs-actions.pod:3262 ../fish/guestfish-actions.pod:2299
11003 "This function cannot decrypt encrypted disks. The caller must do that first "
11004 "(supplying the necessary keys) if the disk is encrypted."
11008 #: ../src/guestfs-actions.pod:3268 ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3620
11009 msgid "See also C<guestfs_list_filesystems>."
11013 #: ../src/guestfs-actions.pod:3276
11014 msgid "guestfs_is_blockdev"
11018 #: ../src/guestfs-actions.pod:3278
11022 " guestfs_is_blockdev (guestfs_h *g,\n"
11023 " const char *path);\n"
11028 #: ../src/guestfs-actions.pod:3282 ../fish/guestfish-actions.pod:2311
11030 "This returns C<true> if and only if there is a block device with the given "
11035 #: ../src/guestfs-actions.pod:3285 ../src/guestfs-actions.pod:3314 ../src/guestfs-actions.pod:3344 ../src/guestfs-actions.pod:3359 ../src/guestfs-actions.pod:3375 ../src/guestfs-actions.pod:3431 ../src/guestfs-actions.pod:3446
11036 msgid "See also C<guestfs_stat>."
11040 #: ../src/guestfs-actions.pod:3289 ../src/guestfs-actions.pod:3318 ../src/guestfs-actions.pod:3363 ../src/guestfs-actions.pod:3435 ../src/guestfs-actions.pod:3450
11041 msgid "(Added in 1.5.10)"
11045 #: ../src/guestfs-actions.pod:3291
11046 msgid "guestfs_is_busy"
11050 #: ../src/guestfs-actions.pod:3293
11054 " guestfs_is_busy (guestfs_h *g);\n"
11059 #: ../src/guestfs-actions.pod:3296 ../fish/guestfish-actions.pod:2320
11061 "This returns true iff this handle is busy processing a command (in the "
11066 #: ../src/guestfs-actions.pod:3305
11067 msgid "guestfs_is_chardev"
11071 #: ../src/guestfs-actions.pod:3307
11075 " guestfs_is_chardev (guestfs_h *g,\n"
11076 " const char *path);\n"
11081 #: ../src/guestfs-actions.pod:3311 ../fish/guestfish-actions.pod:2329
11083 "This returns C<true> if and only if there is a character device with the "
11084 "given C<path> name."
11088 #: ../src/guestfs-actions.pod:3320
11089 msgid "guestfs_is_config"
11093 #: ../src/guestfs-actions.pod:3322
11097 " guestfs_is_config (guestfs_h *g);\n"
11102 #: ../src/guestfs-actions.pod:3325 ../fish/guestfish-actions.pod:2338
11104 "This returns true iff this handle is being configured (in the C<CONFIG> "
11109 #: ../src/guestfs-actions.pod:3334
11110 msgid "guestfs_is_dir"
11114 #: ../src/guestfs-actions.pod:3336
11118 " guestfs_is_dir (guestfs_h *g,\n"
11119 " const char *path);\n"
11124 #: ../src/guestfs-actions.pod:3340 ../fish/guestfish-actions.pod:2347
11126 "This returns C<true> if and only if there is a directory with the given "
11127 "C<path> name. Note that it returns false for other objects like files."
11131 #: ../src/guestfs-actions.pod:3350
11132 msgid "guestfs_is_fifo"
11136 #: ../src/guestfs-actions.pod:3352
11140 " guestfs_is_fifo (guestfs_h *g,\n"
11141 " const char *path);\n"
11146 #: ../src/guestfs-actions.pod:3356 ../fish/guestfish-actions.pod:2357
11148 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
11149 "given C<path> name."
11153 #: ../src/guestfs-actions.pod:3365
11154 msgid "guestfs_is_file"
11158 #: ../src/guestfs-actions.pod:3367
11162 " guestfs_is_file (guestfs_h *g,\n"
11163 " const char *path);\n"
11168 #: ../src/guestfs-actions.pod:3371 ../fish/guestfish-actions.pod:2366
11170 "This returns C<true> if and only if there is a regular file with the given "
11171 "C<path> name. Note that it returns false for other objects like "
11176 #: ../src/guestfs-actions.pod:3381
11177 msgid "guestfs_is_launching"
11181 #: ../src/guestfs-actions.pod:3383
11185 " guestfs_is_launching (guestfs_h *g);\n"
11190 #: ../src/guestfs-actions.pod:3386 ../fish/guestfish-actions.pod:2376
11192 "This returns true iff this handle is launching the subprocess (in the "
11193 "C<LAUNCHING> state)."
11197 #: ../src/guestfs-actions.pod:3395
11198 msgid "guestfs_is_lv"
11202 #: ../src/guestfs-actions.pod:3397
11206 " guestfs_is_lv (guestfs_h *g,\n"
11207 " const char *device);\n"
11212 #: ../src/guestfs-actions.pod:3401 ../fish/guestfish-actions.pod:2385
11214 "This command tests whether C<device> is a logical volume, and returns true "
11215 "iff this is the case."
11219 #: ../src/guestfs-actions.pod:3408
11220 msgid "guestfs_is_ready"
11224 #: ../src/guestfs-actions.pod:3410
11228 " guestfs_is_ready (guestfs_h *g);\n"
11233 #: ../src/guestfs-actions.pod:3413 ../fish/guestfish-actions.pod:2392
11235 "This returns true iff this handle is ready to accept commands (in the "
11240 #: ../src/guestfs-actions.pod:3422
11241 msgid "guestfs_is_socket"
11245 #: ../src/guestfs-actions.pod:3424
11249 " guestfs_is_socket (guestfs_h *g,\n"
11250 " const char *path);\n"
11255 #: ../src/guestfs-actions.pod:3428 ../fish/guestfish-actions.pod:2401
11257 "This returns C<true> if and only if there is a Unix domain socket with the "
11258 "given C<path> name."
11262 #: ../src/guestfs-actions.pod:3437
11263 msgid "guestfs_is_symlink"
11267 #: ../src/guestfs-actions.pod:3439
11271 " guestfs_is_symlink (guestfs_h *g,\n"
11272 " const char *path);\n"
11277 #: ../src/guestfs-actions.pod:3443 ../fish/guestfish-actions.pod:2410
11279 "This returns C<true> if and only if there is a symbolic link with the given "
11284 #: ../src/guestfs-actions.pod:3452
11285 msgid "guestfs_kill_subprocess"
11289 #: ../src/guestfs-actions.pod:3454
11293 " guestfs_kill_subprocess (guestfs_h *g);\n"
11298 #: ../src/guestfs-actions.pod:3457 ../fish/guestfish-actions.pod:2419
11299 msgid "This kills the qemu subprocess. You should never need to call this."
11303 #: ../src/guestfs-actions.pod:3463
11304 msgid "guestfs_launch"
11308 #: ../src/guestfs-actions.pod:3465
11312 " guestfs_launch (guestfs_h *g);\n"
11317 #: ../src/guestfs-actions.pod:3468 ../fish/guestfish-actions.pod:2427
11319 "Internally libguestfs is implemented by running a virtual machine using "
11324 #: ../src/guestfs-actions.pod:3471 ../fish/guestfish-actions.pod:2430
11326 "You should call this after configuring the handle (eg. adding drives) but "
11327 "before performing any actions."
11331 #: ../src/guestfs-actions.pod:3483
11332 msgid "guestfs_lchown"
11336 #: ../src/guestfs-actions.pod:3485
11340 " guestfs_lchown (guestfs_h *g,\n"
11343 " const char *path);\n"
11348 #: ../src/guestfs-actions.pod:3491
11350 "Change the file owner to C<owner> and group to C<group>. This is like "
11351 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
11352 "changed, not the target."
11356 #: ../src/guestfs-actions.pod:3503
11357 msgid "guestfs_lgetxattr"
11361 #: ../src/guestfs-actions.pod:3505
11365 " guestfs_lgetxattr (guestfs_h *g,\n"
11366 " const char *path,\n"
11367 " const char *name,\n"
11368 " size_t *size_r);\n"
11373 #: ../src/guestfs-actions.pod:3511 ../fish/guestfish-actions.pod:2449
11375 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11376 "is a symlink, then this call returns an extended attribute from the symlink."
11380 #: ../src/guestfs-actions.pod:3525
11381 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
11385 #: ../src/guestfs-actions.pod:3533
11386 msgid "guestfs_lgetxattrs"
11390 #: ../src/guestfs-actions.pod:3535
11393 " struct guestfs_xattr_list *\n"
11394 " guestfs_lgetxattrs (guestfs_h *g,\n"
11395 " const char *path);\n"
11400 #: ../src/guestfs-actions.pod:3539
11402 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
11403 "then it returns the extended attributes of the link itself."
11407 #: ../src/guestfs-actions.pod:3549
11408 msgid "guestfs_list_devices"
11412 #: ../src/guestfs-actions.pod:3551
11416 " guestfs_list_devices (guestfs_h *g);\n"
11421 #: ../src/guestfs-actions.pod:3554 ../fish/guestfish-actions.pod:2477
11422 msgid "List all the block devices."
11426 #: ../src/guestfs-actions.pod:3556 ../fish/guestfish-actions.pod:2479
11427 msgid "The full block device names are returned, eg. C</dev/sda>."
11431 #: ../src/guestfs-actions.pod:3566
11432 msgid "guestfs_list_filesystems"
11436 #: ../src/guestfs-actions.pod:3568
11440 " guestfs_list_filesystems (guestfs_h *g);\n"
11445 #: ../src/guestfs-actions.pod:3571 ../fish/guestfish-actions.pod:2487
11447 "This inspection command looks for filesystems on partitions, block devices "
11448 "and logical volumes, returning a list of devices containing filesystems and "
11453 #: ../src/guestfs-actions.pod:3575 ../fish/guestfish-actions.pod:2491
11455 "The return value is a hash, where the keys are the devices containing "
11456 "filesystems, and the values are the filesystem types. For example:"
11460 #: ../src/guestfs-actions.pod:3579 ../fish/guestfish-actions.pod:2495
11463 " \"/dev/sda1\" => \"ntfs\"\n"
11464 " \"/dev/sda2\" => \"ext2\"\n"
11465 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11466 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11471 #: ../src/guestfs-actions.pod:3584 ../fish/guestfish-actions.pod:2500
11473 "The value can have the special value \"unknown\", meaning the content of the "
11474 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11478 #: ../src/guestfs-actions.pod:3588
11480 "This command runs other libguestfs commands, which might include "
11481 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
11482 "soon after launch and only when nothing is mounted."
11486 #: ../src/guestfs-actions.pod:3592
11488 "Not all of the filesystems returned will be mountable. In particular, swap "
11489 "partitions are returned in the list. Also this command does not check that "
11490 "each filesystem found is valid and mountable, and some filesystems might be "
11491 "mountable but require special options. Filesystems may not all belong to a "
11492 "single logical operating system (use C<guestfs_inspect_os> to look for "
11497 #: ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:5211
11498 msgid "(Added in 1.5.15)"
11502 #: ../src/guestfs-actions.pod:3608
11503 msgid "guestfs_list_partitions"
11507 #: ../src/guestfs-actions.pod:3610
11511 " guestfs_list_partitions (guestfs_h *g);\n"
11516 #: ../src/guestfs-actions.pod:3613 ../fish/guestfish-actions.pod:2520
11517 msgid "List all the partitions detected on all block devices."
11521 #: ../src/guestfs-actions.pod:3615 ../fish/guestfish-actions.pod:2522
11522 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11526 #: ../src/guestfs-actions.pod:3617
11528 "This does not return logical volumes. For that you will need to call "
11533 #: ../src/guestfs-actions.pod:3628
11538 #: ../src/guestfs-actions.pod:3630
11542 " guestfs_ll (guestfs_h *g,\n"
11543 " const char *directory);\n"
11548 #: ../src/guestfs-actions.pod:3634 ../fish/guestfish-actions.pod:2533
11550 "List the files in C<directory> (relative to the root directory, there is no "
11551 "cwd) in the format of 'ls -la'."
11555 #: ../src/guestfs-actions.pod:3637 ../fish/guestfish-actions.pod:2536
11557 "This command is mostly useful for interactive sessions. It is I<not> "
11558 "intended that you try to parse the output string."
11562 #: ../src/guestfs-actions.pod:3645
11567 #: ../src/guestfs-actions.pod:3647
11571 " guestfs_ln (guestfs_h *g,\n"
11572 " const char *target,\n"
11573 " const char *linkname);\n"
11578 #: ../src/guestfs-actions.pod:3652 ../fish/guestfish-actions.pod:2543
11579 msgid "This command creates a hard link using the C<ln> command."
11583 #: ../src/guestfs-actions.pod:3658
11584 msgid "guestfs_ln_f"
11588 #: ../src/guestfs-actions.pod:3660
11592 " guestfs_ln_f (guestfs_h *g,\n"
11593 " const char *target,\n"
11594 " const char *linkname);\n"
11599 #: ../src/guestfs-actions.pod:3665 ../fish/guestfish-actions.pod:2549
11601 "This command creates a hard link using the C<ln -f> command. The C<-f> "
11602 "option removes the link (C<linkname>) if it exists already."
11606 #: ../src/guestfs-actions.pod:3672
11607 msgid "guestfs_ln_s"
11611 #: ../src/guestfs-actions.pod:3674
11615 " guestfs_ln_s (guestfs_h *g,\n"
11616 " const char *target,\n"
11617 " const char *linkname);\n"
11622 #: ../src/guestfs-actions.pod:3679 ../fish/guestfish-actions.pod:2556
11623 msgid "This command creates a symbolic link using the C<ln -s> command."
11627 #: ../src/guestfs-actions.pod:3685
11628 msgid "guestfs_ln_sf"
11632 #: ../src/guestfs-actions.pod:3687
11636 " guestfs_ln_sf (guestfs_h *g,\n"
11637 " const char *target,\n"
11638 " const char *linkname);\n"
11643 #: ../src/guestfs-actions.pod:3692 ../fish/guestfish-actions.pod:2562
11645 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
11646 "option removes the link (C<linkname>) if it exists already."
11650 #: ../src/guestfs-actions.pod:3699
11651 msgid "guestfs_lremovexattr"
11655 #: ../src/guestfs-actions.pod:3701
11659 " guestfs_lremovexattr (guestfs_h *g,\n"
11660 " const char *xattr,\n"
11661 " const char *path);\n"
11666 #: ../src/guestfs-actions.pod:3706
11668 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
11669 "link, then it removes an extended attribute of the link itself."
11673 #: ../src/guestfs-actions.pod:3714
11678 #: ../src/guestfs-actions.pod:3716
11682 " guestfs_ls (guestfs_h *g,\n"
11683 " const char *directory);\n"
11688 #: ../src/guestfs-actions.pod:3720 ../fish/guestfish-actions.pod:2577
11690 "List the files in C<directory> (relative to the root directory, there is no "
11691 "cwd). The '.' and '..' entries are not returned, but hidden files are "
11696 #: ../src/guestfs-actions.pod:3724
11698 "This command is mostly useful for interactive sessions. Programs should "
11699 "probably use C<guestfs_readdir> instead."
11703 #: ../src/guestfs-actions.pod:3733
11704 msgid "guestfs_lsetxattr"
11708 #: ../src/guestfs-actions.pod:3735
11712 " guestfs_lsetxattr (guestfs_h *g,\n"
11713 " const char *xattr,\n"
11714 " const char *val,\n"
11716 " const char *path);\n"
11721 #: ../src/guestfs-actions.pod:3742
11723 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
11724 "then it sets an extended attribute of the link itself."
11728 #: ../src/guestfs-actions.pod:3750
11729 msgid "guestfs_lstat"
11733 #: ../src/guestfs-actions.pod:3752
11736 " struct guestfs_stat *\n"
11737 " guestfs_lstat (guestfs_h *g,\n"
11738 " const char *path);\n"
11743 #: ../src/guestfs-actions.pod:3756 ../src/guestfs-actions.pod:6314 ../fish/guestfish-actions.pod:2596 ../fish/guestfish-actions.pod:4265
11744 msgid "Returns file information for the given C<path>."
11748 #: ../src/guestfs-actions.pod:3758
11750 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
11751 "link, then the link is stat-ed, not the file it refers to."
11755 #: ../src/guestfs-actions.pod:3762 ../fish/guestfish-actions.pod:2602
11756 msgid "This is the same as the C<lstat(2)> system call."
11760 #: ../src/guestfs-actions.pod:3764 ../src/guestfs-actions.pod:6318
11762 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
11763 "error. I<The caller must call C<guestfs_free_stat> after use>."
11767 #: ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:6322 ../src/guestfs-actions.pod:6340 ../src/guestfs-actions.pod:6721
11768 msgid "(Added in 0.9.2)"
11772 #: ../src/guestfs-actions.pod:3770
11773 msgid "guestfs_lstatlist"
11777 #: ../src/guestfs-actions.pod:3772
11780 " struct guestfs_stat_list *\n"
11781 " guestfs_lstatlist (guestfs_h *g,\n"
11782 " const char *path,\n"
11783 " char *const *names);\n"
11788 #: ../src/guestfs-actions.pod:3777
11790 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
11791 "files, where all files are in the directory C<path>. C<names> is the list "
11792 "of files from this directory."
11796 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2612
11798 "On return you get a list of stat structs, with a one-to-one correspondence "
11799 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11800 "then the C<ino> field of that structure is set to C<-1>."
11804 #: ../src/guestfs-actions.pod:3786
11806 "This call is intended for programs that want to efficiently list a directory "
11807 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
11808 "for a similarly efficient call for getting extended attributes. Very long "
11809 "directory listings might cause the protocol message size to be exceeded, "
11810 "causing this call to fail. The caller must split up such requests into "
11811 "smaller groups of names."
11815 #: ../src/guestfs-actions.pod:3794
11817 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
11818 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
11822 #: ../src/guestfs-actions.pod:3800
11823 msgid "guestfs_luks_add_key"
11827 #: ../src/guestfs-actions.pod:3802
11831 " guestfs_luks_add_key (guestfs_h *g,\n"
11832 " const char *device,\n"
11833 " const char *key,\n"
11834 " const char *newkey,\n"
11840 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2629
11842 "This command adds a new key on LUKS device C<device>. C<key> is any "
11843 "existing key, and is used to access the device. C<newkey> is the new key to "
11844 "add. C<keyslot> is the key slot that will be replaced."
11848 #: ../src/guestfs-actions.pod:3814
11850 "Note that if C<keyslot> already contains a key, then this command will "
11851 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
11855 #: ../src/guestfs-actions.pod:3820 ../src/guestfs-actions.pod:3860 ../src/guestfs-actions.pod:3883 ../src/guestfs-actions.pod:3903 ../src/guestfs-actions.pod:3935 ../src/guestfs-actions.pod:3954
11857 "This function takes a key or passphrase parameter which could contain "
11858 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
11863 #: ../src/guestfs-actions.pod:3824 ../src/guestfs-actions.pod:3864 ../src/guestfs-actions.pod:3887 ../src/guestfs-actions.pod:3907
11864 msgid "(Added in 1.5.2)"
11868 #: ../src/guestfs-actions.pod:3826
11869 msgid "guestfs_luks_close"
11873 #: ../src/guestfs-actions.pod:3828
11877 " guestfs_luks_close (guestfs_h *g,\n"
11878 " const char *device);\n"
11883 #: ../src/guestfs-actions.pod:3832
11885 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
11886 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
11887 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11888 "underlying block device."
11892 #: ../src/guestfs-actions.pod:3840 ../src/guestfs-actions.pod:3939 ../src/guestfs-actions.pod:3958 ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4056
11893 msgid "(Added in 1.5.1)"
11897 #: ../src/guestfs-actions.pod:3842
11898 msgid "guestfs_luks_format"
11902 #: ../src/guestfs-actions.pod:3844
11906 " guestfs_luks_format (guestfs_h *g,\n"
11907 " const char *device,\n"
11908 " const char *key,\n"
11914 #: ../src/guestfs-actions.pod:3850 ../fish/guestfish-actions.pod:2655
11916 "This command erases existing data on C<device> and formats the device as a "
11917 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11918 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11922 #: ../src/guestfs-actions.pod:3857 ../src/guestfs-actions.pod:3880 ../src/guestfs-actions.pod:4020 ../src/guestfs-actions.pod:4962 ../src/guestfs-actions.pod:5742 ../src/guestfs-actions.pod:6149 ../src/guestfs-actions.pod:6172 ../src/guestfs-actions.pod:6198 ../src/guestfs-actions.pod:7358 ../fish/guestfish-actions.pod:2663 ../fish/guestfish-actions.pod:2676 ../fish/guestfish-actions.pod:2760 ../fish/guestfish-actions.pod:3334 ../fish/guestfish-actions.pod:3854 ../fish/guestfish-actions.pod:4164 ../fish/guestfish-actions.pod:4180 ../fish/guestfish-actions.pod:4195 ../fish/guestfish-actions.pod:4910
11924 "B<This command is dangerous. Without careful use you can easily destroy all "
11929 #: ../src/guestfs-actions.pod:3866
11930 msgid "guestfs_luks_format_cipher"
11934 #: ../src/guestfs-actions.pod:3868
11938 " guestfs_luks_format_cipher (guestfs_h *g,\n"
11939 " const char *device,\n"
11940 " const char *key,\n"
11942 " const char *cipher);\n"
11947 #: ../src/guestfs-actions.pod:3875
11949 "This command is the same as C<guestfs_luks_format> but it also allows you to "
11950 "set the C<cipher> used."
11954 #: ../src/guestfs-actions.pod:3889
11955 msgid "guestfs_luks_kill_slot"
11959 #: ../src/guestfs-actions.pod:3891
11963 " guestfs_luks_kill_slot (guestfs_h *g,\n"
11964 " const char *device,\n"
11965 " const char *key,\n"
11971 #: ../src/guestfs-actions.pod:3897 ../fish/guestfish-actions.pod:2683
11973 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11974 "device C<device>. C<key> must be one of the I<other> keys."
11978 #: ../src/guestfs-actions.pod:3909
11979 msgid "guestfs_luks_open"
11983 #: ../src/guestfs-actions.pod:3911
11987 " guestfs_luks_open (guestfs_h *g,\n"
11988 " const char *device,\n"
11989 " const char *key,\n"
11990 " const char *mapname);\n"
11995 #: ../src/guestfs-actions.pod:3917 ../fish/guestfish-actions.pod:2694
11997 "This command opens a block device which has been encrypted according to the "
11998 "Linux Unified Key Setup (LUKS) standard."
12002 #: ../src/guestfs-actions.pod:3920 ../fish/guestfish-actions.pod:2697
12003 msgid "C<device> is the encrypted block device or partition."
12007 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:2699
12009 "The caller must supply one of the keys associated with the LUKS block "
12010 "device, in the C<key> parameter."
12014 #: ../src/guestfs-actions.pod:3925 ../fish/guestfish-actions.pod:2702
12016 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
12017 "writes to this block device are decrypted from and encrypted to the "
12018 "underlying C<device> respectively."
12022 #: ../src/guestfs-actions.pod:3929
12024 "If this block device contains LVM volume groups, then calling "
12025 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
12030 #: ../src/guestfs-actions.pod:3941
12031 msgid "guestfs_luks_open_ro"
12035 #: ../src/guestfs-actions.pod:3943
12039 " guestfs_luks_open_ro (guestfs_h *g,\n"
12040 " const char *device,\n"
12041 " const char *key,\n"
12042 " const char *mapname);\n"
12047 #: ../src/guestfs-actions.pod:3949
12049 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
12054 #: ../src/guestfs-actions.pod:3960
12055 msgid "guestfs_lvcreate"
12059 #: ../src/guestfs-actions.pod:3962
12063 " guestfs_lvcreate (guestfs_h *g,\n"
12064 " const char *logvol,\n"
12065 " const char *volgroup,\n"
12071 #: ../src/guestfs-actions.pod:3968 ../fish/guestfish-actions.pod:2727
12073 "This creates an LVM logical volume called C<logvol> on the volume group "
12074 "C<volgroup>, with C<size> megabytes."
12078 #: ../src/guestfs-actions.pod:3975
12079 msgid "guestfs_lvm_canonical_lv_name"
12083 #: ../src/guestfs-actions.pod:3977
12087 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
12088 " const char *lvname);\n"
12093 #: ../src/guestfs-actions.pod:3981 ../fish/guestfish-actions.pod:2734
12095 "This converts alternative naming schemes for LVs that you might find to the "
12096 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
12101 #: ../src/guestfs-actions.pod:3985 ../fish/guestfish-actions.pod:2738
12103 "This command returns an error if the C<lvname> parameter does not refer to a "
12108 #: ../src/guestfs-actions.pod:3988
12109 msgid "See also C<guestfs_is_lv>."
12113 #: ../src/guestfs-actions.pod:3993
12114 msgid "(Added in 1.5.24)"
12118 #: ../src/guestfs-actions.pod:3995
12119 msgid "guestfs_lvm_clear_filter"
12123 #: ../src/guestfs-actions.pod:3997
12127 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
12132 #: ../src/guestfs-actions.pod:4000
12134 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
12135 "see every block device."
12139 #: ../src/guestfs-actions.pod:4003 ../src/guestfs-actions.pod:4045 ../fish/guestfish-actions.pod:2750 ../fish/guestfish-actions.pod:2781
12140 msgid "This command also clears the LVM cache and performs a volume group scan."
12144 #: ../src/guestfs-actions.pod:4010
12145 msgid "guestfs_lvm_remove_all"
12149 #: ../src/guestfs-actions.pod:4012
12153 " guestfs_lvm_remove_all (guestfs_h *g);\n"
12158 #: ../src/guestfs-actions.pod:4015 ../fish/guestfish-actions.pod:2757
12160 "This command removes all LVM logical volumes, volume groups and physical "
12165 #: ../src/guestfs-actions.pod:4025
12166 msgid "guestfs_lvm_set_filter"
12170 #: ../src/guestfs-actions.pod:4027
12174 " guestfs_lvm_set_filter (guestfs_h *g,\n"
12175 " char *const *devices);\n"
12180 #: ../src/guestfs-actions.pod:4031 ../fish/guestfish-actions.pod:2767
12182 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12183 "block devices in the list C<devices>, and will ignore all other attached "
12188 #: ../src/guestfs-actions.pod:4035 ../fish/guestfish-actions.pod:2771
12190 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12191 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12192 "there are two types of duplication possible: either cloned PVs/VGs which "
12193 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12194 "same name. In normal operation you cannot create this situation, but you "
12195 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12196 "inside the LVM metadata."
12200 #: ../src/guestfs-actions.pod:4048 ../fish/guestfish-actions.pod:2784
12201 msgid "You can filter whole block devices or individual partitions."
12205 #: ../src/guestfs-actions.pod:4050 ../fish/guestfish-actions.pod:2786
12207 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12208 "filesystem), even if you are not filtering out that VG."
12212 #: ../src/guestfs-actions.pod:4058
12213 msgid "guestfs_lvremove"
12217 #: ../src/guestfs-actions.pod:4060
12221 " guestfs_lvremove (guestfs_h *g,\n"
12222 " const char *device);\n"
12227 #: ../src/guestfs-actions.pod:4064 ../fish/guestfish-actions.pod:2794
12229 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12230 "LV, such as C</dev/VG/LV>."
12234 #: ../src/guestfs-actions.pod:4067 ../fish/guestfish-actions.pod:2797
12236 "You can also remove all LVs in a volume group by specifying the VG name, "
12241 #: ../src/guestfs-actions.pod:4072 ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:7097
12242 msgid "(Added in 1.0.13)"
12246 #: ../src/guestfs-actions.pod:4074
12247 msgid "guestfs_lvrename"
12251 #: ../src/guestfs-actions.pod:4076
12255 " guestfs_lvrename (guestfs_h *g,\n"
12256 " const char *logvol,\n"
12257 " const char *newlogvol);\n"
12262 #: ../src/guestfs-actions.pod:4081 ../fish/guestfish-actions.pod:2804
12263 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12267 #: ../src/guestfs-actions.pod:4085 ../src/guestfs-actions.pod:7110
12268 msgid "(Added in 1.0.83)"
12272 #: ../src/guestfs-actions.pod:4087
12273 msgid "guestfs_lvresize"
12277 #: ../src/guestfs-actions.pod:4089
12281 " guestfs_lvresize (guestfs_h *g,\n"
12282 " const char *device,\n"
12288 #: ../src/guestfs-actions.pod:4094 ../fish/guestfish-actions.pod:2810
12290 "This resizes (expands or shrinks) an existing LVM logical volume to "
12291 "C<mbytes>. When reducing, data in the reduced part is lost."
12295 #: ../src/guestfs-actions.pod:4102
12296 msgid "guestfs_lvresize_free"
12300 #: ../src/guestfs-actions.pod:4104
12304 " guestfs_lvresize_free (guestfs_h *g,\n"
12305 " const char *lv,\n"
12311 #: ../src/guestfs-actions.pod:4109 ../fish/guestfish-actions.pod:2818
12313 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12314 "remaining free space in the volume group. Commonly you would call this with "
12315 "pc = 100 which expands the logical volume as much as possible, using all "
12316 "remaining free space in the volume group."
12320 #: ../src/guestfs-actions.pod:4117
12321 msgid "(Added in 1.3.3)"
12325 #: ../src/guestfs-actions.pod:4119
12326 msgid "guestfs_lvs"
12330 #: ../src/guestfs-actions.pod:4121
12334 " guestfs_lvs (guestfs_h *g);\n"
12339 #: ../src/guestfs-actions.pod:4124 ../fish/guestfish-actions.pod:2828
12341 "List all the logical volumes detected. This is the equivalent of the "
12342 "L<lvs(8)> command."
12346 #: ../src/guestfs-actions.pod:4127 ../fish/guestfish-actions.pod:2831
12348 "This returns a list of the logical volume device names "
12349 "(eg. C</dev/VolGroup00/LogVol00>)."
12353 #: ../src/guestfs-actions.pod:4130
12354 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
12358 #: ../src/guestfs-actions.pod:4138
12359 msgid "guestfs_lvs_full"
12363 #: ../src/guestfs-actions.pod:4140
12366 " struct guestfs_lvm_lv_list *\n"
12367 " guestfs_lvs_full (guestfs_h *g);\n"
12372 #: ../src/guestfs-actions.pod:4143 ../fish/guestfish-actions.pod:2840
12374 "List all the logical volumes detected. This is the equivalent of the "
12375 "L<lvs(8)> command. The \"full\" version includes all fields."
12379 #: ../src/guestfs-actions.pod:4146
12381 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
12382 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
12387 #: ../src/guestfs-actions.pod:4152
12388 msgid "guestfs_lvuuid"
12392 #: ../src/guestfs-actions.pod:4154
12396 " guestfs_lvuuid (guestfs_h *g,\n"
12397 " const char *device);\n"
12402 #: ../src/guestfs-actions.pod:4158 ../fish/guestfish-actions.pod:2847
12403 msgid "This command returns the UUID of the LVM LV C<device>."
12407 #: ../src/guestfs-actions.pod:4165
12408 msgid "guestfs_lxattrlist"
12412 #: ../src/guestfs-actions.pod:4167
12415 " struct guestfs_xattr_list *\n"
12416 " guestfs_lxattrlist (guestfs_h *g,\n"
12417 " const char *path,\n"
12418 " char *const *names);\n"
12423 #: ../src/guestfs-actions.pod:4172 ../fish/guestfish-actions.pod:2853
12425 "This call allows you to get the extended attributes of multiple files, where "
12426 "all files are in the directory C<path>. C<names> is the list of files from "
12431 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:2857
12433 "On return you get a flat list of xattr structs which must be interpreted "
12434 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12435 "C<attrval> in this struct is zero-length to indicate there was an error "
12436 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12437 "number (the number of following attributes for this file, which could be "
12438 "C<\"0\">). Then after the first xattr struct are the zero or more "
12439 "attributes for the first named file. This repeats for the second and "
12440 "subsequent files."
12444 #: ../src/guestfs-actions.pod:4186
12446 "This call is intended for programs that want to efficiently list a directory "
12447 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
12448 "a similarly efficient call for getting standard stats. Very long directory "
12449 "listings might cause the protocol message size to be exceeded, causing this "
12450 "call to fail. The caller must split up such requests into smaller groups of "
12455 #: ../src/guestfs-actions.pod:4200
12456 msgid "guestfs_mkdir"
12460 #: ../src/guestfs-actions.pod:4202
12464 " guestfs_mkdir (guestfs_h *g,\n"
12465 " const char *path);\n"
12470 #: ../src/guestfs-actions.pod:4206 ../fish/guestfish-actions.pod:2879
12471 msgid "Create a directory named C<path>."
12475 #: ../src/guestfs-actions.pod:4212
12476 msgid "guestfs_mkdir_mode"
12480 #: ../src/guestfs-actions.pod:4214
12484 " guestfs_mkdir_mode (guestfs_h *g,\n"
12485 " const char *path,\n"
12491 #: ../src/guestfs-actions.pod:4219 ../fish/guestfish-actions.pod:2885
12493 "This command creates a directory, setting the initial permissions of the "
12494 "directory to C<mode>."
12498 #: ../src/guestfs-actions.pod:4222 ../fish/guestfish-actions.pod:2888
12500 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12501 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12506 #: ../src/guestfs-actions.pod:4226
12507 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
12511 #: ../src/guestfs-actions.pod:4232
12512 msgid "guestfs_mkdir_p"
12516 #: ../src/guestfs-actions.pod:4234
12520 " guestfs_mkdir_p (guestfs_h *g,\n"
12521 " const char *path);\n"
12526 #: ../src/guestfs-actions.pod:4238 ../fish/guestfish-actions.pod:2898
12528 "Create a directory named C<path>, creating any parent directories as "
12529 "necessary. This is like the C<mkdir -p> shell command."
12533 #: ../src/guestfs-actions.pod:4245
12534 msgid "guestfs_mkdtemp"
12538 #: ../src/guestfs-actions.pod:4247
12542 " guestfs_mkdtemp (guestfs_h *g,\n"
12543 " const char *template);\n"
12548 #: ../src/guestfs-actions.pod:4251 ../fish/guestfish-actions.pod:2905
12550 "This command creates a temporary directory. The C<template> parameter "
12551 "should be a full pathname for the temporary directory name with the final "
12552 "six characters being \"XXXXXX\"."
12556 #: ../src/guestfs-actions.pod:4256 ../fish/guestfish-actions.pod:2910
12558 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12559 "being suitable for Windows filesystems."
12563 #: ../src/guestfs-actions.pod:4259 ../fish/guestfish-actions.pod:2913
12564 msgid "The name of the temporary directory that was created is returned."
12568 #: ../src/guestfs-actions.pod:4262 ../fish/guestfish-actions.pod:2916
12569 msgid "The temporary directory is created with mode 0700 and is owned by root."
12573 #: ../src/guestfs-actions.pod:4265 ../fish/guestfish-actions.pod:2919
12575 "The caller is responsible for deleting the temporary directory and its "
12576 "contents after use."
12580 #: ../src/guestfs-actions.pod:4268 ../fish/guestfish-actions.pod:2922
12581 msgid "See also: L<mkdtemp(3)>"
12585 #: ../src/guestfs-actions.pod:4275
12586 msgid "guestfs_mke2fs_J"
12590 #: ../src/guestfs-actions.pod:4277
12594 " guestfs_mke2fs_J (guestfs_h *g,\n"
12595 " const char *fstype,\n"
12596 " int blocksize,\n"
12597 " const char *device,\n"
12598 " const char *journal);\n"
12603 #: ../src/guestfs-actions.pod:4284 ../fish/guestfish-actions.pod:2928
12605 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12606 "C<journal>. It is equivalent to the command:"
12610 #: ../src/guestfs-actions.pod:4288 ../fish/guestfish-actions.pod:2932
12613 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12618 #: ../src/guestfs-actions.pod:4290
12619 msgid "See also C<guestfs_mke2journal>."
12623 #: ../src/guestfs-actions.pod:4294 ../src/guestfs-actions.pod:4312 ../src/guestfs-actions.pod:4330 ../src/guestfs-actions.pod:4346 ../src/guestfs-actions.pod:4360 ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4433 ../src/guestfs-actions.pod:4698
12624 msgid "(Added in 1.0.68)"
12628 #: ../src/guestfs-actions.pod:4296
12629 msgid "guestfs_mke2fs_JL"
12633 #: ../src/guestfs-actions.pod:4298
12637 " guestfs_mke2fs_JL (guestfs_h *g,\n"
12638 " const char *fstype,\n"
12639 " int blocksize,\n"
12640 " const char *device,\n"
12641 " const char *label);\n"
12646 #: ../src/guestfs-actions.pod:4305 ../fish/guestfish-actions.pod:2940
12648 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12649 "the journal labeled C<label>."
12653 #: ../src/guestfs-actions.pod:4308
12654 msgid "See also C<guestfs_mke2journal_L>."
12658 #: ../src/guestfs-actions.pod:4314
12659 msgid "guestfs_mke2fs_JU"
12663 #: ../src/guestfs-actions.pod:4316
12667 " guestfs_mke2fs_JU (guestfs_h *g,\n"
12668 " const char *fstype,\n"
12669 " int blocksize,\n"
12670 " const char *device,\n"
12671 " const char *uuid);\n"
12676 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:2949
12678 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12679 "the journal with UUID C<uuid>."
12683 #: ../src/guestfs-actions.pod:4326
12684 msgid "See also C<guestfs_mke2journal_U>."
12688 #: ../src/guestfs-actions.pod:4332
12689 msgid "guestfs_mke2journal"
12693 #: ../src/guestfs-actions.pod:4334
12697 " guestfs_mke2journal (guestfs_h *g,\n"
12698 " int blocksize,\n"
12699 " const char *device);\n"
12704 #: ../src/guestfs-actions.pod:4339 ../fish/guestfish-actions.pod:2958
12706 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12711 #: ../src/guestfs-actions.pod:4342 ../fish/guestfish-actions.pod:2961
12714 " mke2fs -O journal_dev -b blocksize device\n"
12719 #: ../src/guestfs-actions.pod:4348
12720 msgid "guestfs_mke2journal_L"
12724 #: ../src/guestfs-actions.pod:4350
12728 " guestfs_mke2journal_L (guestfs_h *g,\n"
12729 " int blocksize,\n"
12730 " const char *label,\n"
12731 " const char *device);\n"
12736 #: ../src/guestfs-actions.pod:4356 ../fish/guestfish-actions.pod:2967
12737 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12741 #: ../src/guestfs-actions.pod:4362
12742 msgid "guestfs_mke2journal_U"
12746 #: ../src/guestfs-actions.pod:4364
12750 " guestfs_mke2journal_U (guestfs_h *g,\n"
12751 " int blocksize,\n"
12752 " const char *uuid,\n"
12753 " const char *device);\n"
12758 #: ../src/guestfs-actions.pod:4370 ../fish/guestfish-actions.pod:2973
12759 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12763 #: ../src/guestfs-actions.pod:4376
12764 msgid "guestfs_mkfifo"
12768 #: ../src/guestfs-actions.pod:4378
12772 " guestfs_mkfifo (guestfs_h *g,\n"
12774 " const char *path);\n"
12779 #: ../src/guestfs-actions.pod:4383
12781 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12782 "is just a convenient wrapper around C<guestfs_mknod>."
12786 #: ../src/guestfs-actions.pod:4393
12787 msgid "guestfs_mkfs"
12791 #: ../src/guestfs-actions.pod:4395
12795 " guestfs_mkfs (guestfs_h *g,\n"
12796 " const char *fstype,\n"
12797 " const char *device);\n"
12802 #: ../src/guestfs-actions.pod:4400 ../fish/guestfish-actions.pod:2989
12804 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12805 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12809 #: ../src/guestfs-actions.pod:4408
12810 msgid "guestfs_mkfs_b"
12814 #: ../src/guestfs-actions.pod:4410
12818 " guestfs_mkfs_b (guestfs_h *g,\n"
12819 " const char *fstype,\n"
12820 " int blocksize,\n"
12821 " const char *device);\n"
12826 #: ../src/guestfs-actions.pod:4416
12828 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
12829 "block size of the resulting filesystem. Supported block sizes depend on the "
12830 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12834 #: ../src/guestfs-actions.pod:4421 ../src/guestfs-actions.pod:4464 ../fish/guestfish-actions.pod:3002 ../fish/guestfish-actions.pod:3029
12836 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12841 #: ../src/guestfs-actions.pod:4426 ../fish/guestfish-actions.pod:3005
12843 "This function is deprecated. In new code, use the C<mkfs_opts> call "
12848 #: ../src/guestfs-actions.pod:4435
12849 msgid "guestfs_mkfs_opts"
12853 #: ../src/guestfs-actions.pod:4437
12857 " guestfs_mkfs_opts (guestfs_h *g,\n"
12858 " const char *fstype,\n"
12859 " const char *device,\n"
12865 #: ../src/guestfs-actions.pod:4448
12868 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
12869 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
12874 #: ../src/guestfs-actions.pod:4451 ../fish/guestfish-actions.pod:3016
12876 "This function creates a filesystem on C<device>. The filesystem type is "
12877 "C<fstype>, for example C<ext3>."
12881 #: ../src/guestfs-actions.pod:4458 ../fish/guestfish-actions.pod:3023
12882 msgid "C<blocksize>"
12886 #: ../src/guestfs-actions.pod:4460 ../fish/guestfish-actions.pod:3025
12888 "The filesystem block size. Supported block sizes depend on the filesystem "
12889 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12894 #: ../src/guestfs-actions.pod:4467 ../fish/guestfish-actions.pod:3032
12895 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12899 #: ../src/guestfs-actions.pod:4469 ../fish/guestfish-actions.pod:3034
12900 msgid "C<features>"
12904 #: ../src/guestfs-actions.pod:4471 ../fish/guestfish-actions.pod:3036
12905 msgid "This passes the C<-O> parameter to the external mkfs program."
12909 #: ../src/guestfs-actions.pod:4473 ../fish/guestfish-actions.pod:3038
12911 "For certain filesystem types, this allows extra filesystem features to be "
12912 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12916 #: ../src/guestfs-actions.pod:4477 ../fish/guestfish-actions.pod:3042
12918 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12923 #: ../src/guestfs-actions.pod:4484
12924 msgid "(Added in 1.7.19)"
12928 #: ../src/guestfs-actions.pod:4486
12929 msgid "guestfs_mkfs_opts_va"
12933 #: ../src/guestfs-actions.pod:4488
12937 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
12938 " const char *fstype,\n"
12939 " const char *device,\n"
12940 " va_list args);\n"
12945 #: ../src/guestfs-actions.pod:4494
12946 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
12950 #: ../src/guestfs-actions.pod:4498
12951 msgid "guestfs_mkfs_opts_argv"
12955 #: ../src/guestfs-actions.pod:4500
12959 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
12960 " const char *fstype,\n"
12961 " const char *device,\n"
12962 " const struct guestfs_mkfs_opts_argv *optargs);\n"
12967 #: ../src/guestfs-actions.pod:4506
12968 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
12972 #: ../src/guestfs-actions.pod:4510
12973 msgid "guestfs_mkmountpoint"
12977 #: ../src/guestfs-actions.pod:4512
12981 " guestfs_mkmountpoint (guestfs_h *g,\n"
12982 " const char *exemptpath);\n"
12987 #: ../src/guestfs-actions.pod:4516
12989 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
12990 "that can be used to create extra mountpoints before mounting the first "
12995 #: ../src/guestfs-actions.pod:4520 ../fish/guestfish-actions.pod:3057
12997 "These calls are I<only> necessary in some very limited circumstances, mainly "
12998 "the case where you want to mount a mix of unrelated and/or read-only "
12999 "filesystems together."
13003 #: ../src/guestfs-actions.pod:4524 ../fish/guestfish-actions.pod:3061
13005 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
13006 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
13007 "inside that. You can unpack this as follows in guestfish:"
13011 #: ../src/guestfs-actions.pod:4529 ../fish/guestfish-actions.pod:3066
13014 " add-ro Fedora-11-i686-Live.iso\n"
13016 " mkmountpoint /cd\n"
13017 " mkmountpoint /sqsh\n"
13018 " mkmountpoint /ext3fs\n"
13019 " mount /dev/sda /cd\n"
13020 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
13021 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
13026 #: ../src/guestfs-actions.pod:4538 ../fish/guestfish-actions.pod:3075
13027 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
13031 #: ../src/guestfs-actions.pod:4540
13033 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
13034 "may get unexpected errors if you try to mix these calls. It is safest to "
13035 "manually unmount filesystems and remove mountpoints after use."
13039 #: ../src/guestfs-actions.pod:4544
13041 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
13042 "first, so for this to work for manual mountpoints, you must ensure that the "
13043 "innermost mountpoints have the longest pathnames, as in the example code "
13048 #: ../src/guestfs-actions.pod:4549 ../fish/guestfish-actions.pod:3086
13049 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
13053 #: ../src/guestfs-actions.pod:4551
13055 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
13056 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
13057 "can also trigger these issues."
13061 #: ../src/guestfs-actions.pod:4557 ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:5726
13062 msgid "(Added in 1.0.62)"
13066 #: ../src/guestfs-actions.pod:4559
13067 msgid "guestfs_mknod"
13071 #: ../src/guestfs-actions.pod:4561
13075 " guestfs_mknod (guestfs_h *g,\n"
13079 " const char *path);\n"
13084 #: ../src/guestfs-actions.pod:4568 ../fish/guestfish-actions.pod:3096
13086 "This call creates block or character special devices, or named pipes "
13091 #: ../src/guestfs-actions.pod:4571 ../fish/guestfish-actions.pod:3099
13093 "The C<mode> parameter should be the mode, using the standard constants. "
13094 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
13095 "used when creating block and character special devices."
13099 #: ../src/guestfs-actions.pod:4576
13101 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
13102 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
13103 "regular file). These constants are available in the standard Linux header "
13104 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
13105 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
13106 "the appropriate constant for you."
13110 #: ../src/guestfs-actions.pod:4590
13111 msgid "guestfs_mknod_b"
13115 #: ../src/guestfs-actions.pod:4592
13119 " guestfs_mknod_b (guestfs_h *g,\n"
13123 " const char *path);\n"
13128 #: ../src/guestfs-actions.pod:4599
13130 "This call creates a block device node called C<path> with mode C<mode> and "
13131 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13132 "wrapper around C<guestfs_mknod>."
13136 #: ../src/guestfs-actions.pod:4609
13137 msgid "guestfs_mknod_c"
13141 #: ../src/guestfs-actions.pod:4611
13145 " guestfs_mknod_c (guestfs_h *g,\n"
13149 " const char *path);\n"
13154 #: ../src/guestfs-actions.pod:4618
13156 "This call creates a char device node called C<path> with mode C<mode> and "
13157 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13158 "wrapper around C<guestfs_mknod>."
13162 #: ../src/guestfs-actions.pod:4628
13163 msgid "guestfs_mkswap"
13167 #: ../src/guestfs-actions.pod:4630
13171 " guestfs_mkswap (guestfs_h *g,\n"
13172 " const char *device);\n"
13177 #: ../src/guestfs-actions.pod:4634 ../fish/guestfish-actions.pod:3138
13178 msgid "Create a swap partition on C<device>."
13182 #: ../src/guestfs-actions.pod:4640
13183 msgid "guestfs_mkswap_L"
13187 #: ../src/guestfs-actions.pod:4642
13191 " guestfs_mkswap_L (guestfs_h *g,\n"
13192 " const char *label,\n"
13193 " const char *device);\n"
13198 #: ../src/guestfs-actions.pod:4647 ../fish/guestfish-actions.pod:3144
13199 msgid "Create a swap partition on C<device> with label C<label>."
13203 #: ../src/guestfs-actions.pod:4649 ../fish/guestfish-actions.pod:3146
13205 "Note that you cannot attach a swap label to a block device "
13206 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
13207 "the kernel or swap tools."
13211 #: ../src/guestfs-actions.pod:4657
13212 msgid "guestfs_mkswap_U"
13216 #: ../src/guestfs-actions.pod:4659
13220 " guestfs_mkswap_U (guestfs_h *g,\n"
13221 " const char *uuid,\n"
13222 " const char *device);\n"
13227 #: ../src/guestfs-actions.pod:4664 ../fish/guestfish-actions.pod:3154
13228 msgid "Create a swap partition on C<device> with UUID C<uuid>."
13232 #: ../src/guestfs-actions.pod:4670
13233 msgid "guestfs_mkswap_file"
13237 #: ../src/guestfs-actions.pod:4672
13241 " guestfs_mkswap_file (guestfs_h *g,\n"
13242 " const char *path);\n"
13247 #: ../src/guestfs-actions.pod:4676 ../fish/guestfish-actions.pod:3160
13248 msgid "Create a swap file."
13252 #: ../src/guestfs-actions.pod:4678
13254 "This command just writes a swap file signature to an existing file. To "
13255 "create the file itself, use something like C<guestfs_fallocate>."
13259 #: ../src/guestfs-actions.pod:4685
13260 msgid "guestfs_modprobe"
13264 #: ../src/guestfs-actions.pod:4687
13268 " guestfs_modprobe (guestfs_h *g,\n"
13269 " const char *modulename);\n"
13274 #: ../src/guestfs-actions.pod:4691 ../fish/guestfish-actions.pod:3169
13275 msgid "This loads a kernel module in the appliance."
13279 #: ../src/guestfs-actions.pod:4693 ../fish/guestfish-actions.pod:3171
13281 "The kernel module must have been whitelisted when libguestfs was built (see "
13282 "C<appliance/kmod.whitelist.in> in the source)."
13286 #: ../src/guestfs-actions.pod:4700
13287 msgid "guestfs_mount"
13291 #: ../src/guestfs-actions.pod:4702
13295 " guestfs_mount (guestfs_h *g,\n"
13296 " const char *device,\n"
13297 " const char *mountpoint);\n"
13302 #: ../src/guestfs-actions.pod:4707 ../fish/guestfish-actions.pod:3178
13304 "Mount a guest disk at a position in the filesystem. Block devices are named "
13305 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
13306 "those block devices contain partitions, they will have the usual names "
13307 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
13311 #: ../src/guestfs-actions.pod:4713 ../fish/guestfish-actions.pod:3184
13313 "The rules are the same as for L<mount(2)>: A filesystem must first be "
13314 "mounted on C</> before others can be mounted. Other filesystems can only be "
13315 "mounted on directories which already exist."
13319 #: ../src/guestfs-actions.pod:4718 ../fish/guestfish-actions.pod:3189
13321 "The mounted filesystem is writable, if we have sufficient permissions on the "
13322 "underlying device."
13326 #: ../src/guestfs-actions.pod:4721
13328 "B<Important note:> When you use this call, the filesystem options C<sync> "
13329 "and C<noatime> are set implicitly. This was originally done because we "
13330 "thought it would improve reliability, but it turns out that I<-o sync> has a "
13331 "very large negative performance impact and negligible effect on "
13332 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
13333 "in any code that needs performance, and instead use C<guestfs_mount_options> "
13334 "(use an empty string for the first parameter if you don't want any options)."
13338 #: ../src/guestfs-actions.pod:4735
13339 msgid "guestfs_mount_loop"
13343 #: ../src/guestfs-actions.pod:4737
13347 " guestfs_mount_loop (guestfs_h *g,\n"
13348 " const char *file,\n"
13349 " const char *mountpoint);\n"
13354 #: ../src/guestfs-actions.pod:4742 ../fish/guestfish-actions.pod:3206
13356 "This command lets you mount C<file> (a filesystem image in a file) on a "
13357 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13362 #: ../src/guestfs-actions.pod:4750
13363 msgid "guestfs_mount_options"
13367 #: ../src/guestfs-actions.pod:4752
13371 " guestfs_mount_options (guestfs_h *g,\n"
13372 " const char *options,\n"
13373 " const char *device,\n"
13374 " const char *mountpoint);\n"
13379 #: ../src/guestfs-actions.pod:4758
13381 "This is the same as the C<guestfs_mount> command, but it allows you to set "
13382 "the mount options as for the L<mount(8)> I<-o> flag."
13386 #: ../src/guestfs-actions.pod:4762 ../fish/guestfish-actions.pod:3218
13388 "If the C<options> parameter is an empty string, then no options are passed "
13389 "(all options default to whatever the filesystem uses)."
13393 #: ../src/guestfs-actions.pod:4768 ../src/guestfs-actions.pod:4782 ../src/guestfs-actions.pod:4799
13394 msgid "(Added in 1.0.10)"
13398 #: ../src/guestfs-actions.pod:4770
13399 msgid "guestfs_mount_ro"
13403 #: ../src/guestfs-actions.pod:4772
13407 " guestfs_mount_ro (guestfs_h *g,\n"
13408 " const char *device,\n"
13409 " const char *mountpoint);\n"
13414 #: ../src/guestfs-actions.pod:4777
13416 "This is the same as the C<guestfs_mount> command, but it mounts the "
13417 "filesystem with the read-only (I<-o ro>) flag."
13421 #: ../src/guestfs-actions.pod:4784
13422 msgid "guestfs_mount_vfs"
13426 #: ../src/guestfs-actions.pod:4786
13430 " guestfs_mount_vfs (guestfs_h *g,\n"
13431 " const char *options,\n"
13432 " const char *vfstype,\n"
13433 " const char *device,\n"
13434 " const char *mountpoint);\n"
13439 #: ../src/guestfs-actions.pod:4793
13441 "This is the same as the C<guestfs_mount> command, but it allows you to set "
13442 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
13447 #: ../src/guestfs-actions.pod:4801
13448 msgid "guestfs_mountpoints"
13452 #: ../src/guestfs-actions.pod:4803
13456 " guestfs_mountpoints (guestfs_h *g);\n"
13461 #: ../src/guestfs-actions.pod:4806
13463 "This call is similar to C<guestfs_mounts>. That call returns a list of "
13464 "devices. This one returns a hash table (map) of device name to directory "
13465 "where the device is mounted."
13469 #: ../src/guestfs-actions.pod:4818
13470 msgid "guestfs_mounts"
13474 #: ../src/guestfs-actions.pod:4820
13478 " guestfs_mounts (guestfs_h *g);\n"
13483 #: ../src/guestfs-actions.pod:4823 ../fish/guestfish-actions.pod:3249
13485 "This returns the list of currently mounted filesystems. It returns the list "
13486 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13490 #: ../src/guestfs-actions.pod:4826 ../fish/guestfish-actions.pod:3252
13491 msgid "Some internal mounts are not shown."
13495 #: ../src/guestfs-actions.pod:4828
13496 msgid "See also: C<guestfs_mountpoints>"
13500 #: ../src/guestfs-actions.pod:4836
13505 #: ../src/guestfs-actions.pod:4838
13509 " guestfs_mv (guestfs_h *g,\n"
13510 " const char *src,\n"
13511 " const char *dest);\n"
13516 #: ../src/guestfs-actions.pod:4843 ../fish/guestfish-actions.pod:3260
13518 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13519 "destination filename or destination directory."
13523 #: ../src/guestfs-actions.pod:4850
13524 msgid "guestfs_ntfs_3g_probe"
13528 #: ../src/guestfs-actions.pod:4852
13532 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
13534 " const char *device);\n"
13539 #: ../src/guestfs-actions.pod:4857 ../fish/guestfish-actions.pod:3267
13541 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13542 "C<device> for mountability. (Not all NTFS volumes can be mounted "
13543 "read-write, and some cannot be mounted at all)."
13547 #: ../src/guestfs-actions.pod:4861 ../fish/guestfish-actions.pod:3271
13549 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13550 "can be mounted read-write. Set it to false if you want to test if the "
13551 "volume can be mounted read-only."
13555 #: ../src/guestfs-actions.pod:4865 ../fish/guestfish-actions.pod:3275
13557 "The return value is an integer which C<0> if the operation would succeed, or "
13558 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13562 #: ../src/guestfs-actions.pod:4871
13563 msgid "(Added in 1.0.43)"
13567 #: ../src/guestfs-actions.pod:4873
13568 msgid "guestfs_ntfsresize"
13572 #: ../src/guestfs-actions.pod:4875
13576 " guestfs_ntfsresize (guestfs_h *g,\n"
13577 " const char *device);\n"
13582 #: ../src/guestfs-actions.pod:4879 ../fish/guestfish-actions.pod:3283
13584 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13585 "size of the underlying device. See also L<ntfsresize(8)>."
13589 #: ../src/guestfs-actions.pod:4887
13590 msgid "guestfs_ntfsresize_size"
13594 #: ../src/guestfs-actions.pod:4889
13598 " guestfs_ntfsresize_size (guestfs_h *g,\n"
13599 " const char *device,\n"
13600 " int64_t size);\n"
13605 #: ../src/guestfs-actions.pod:4894
13607 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
13608 "to specify the new size (in bytes) explicitly."
13612 #: ../src/guestfs-actions.pod:4899 ../src/guestfs-actions.pod:5335 ../src/guestfs-actions.pod:5408 ../src/guestfs-actions.pod:5674 ../src/guestfs-actions.pod:7245
13613 msgid "(Added in 1.3.14)"
13617 #: ../src/guestfs-actions.pod:4901
13618 msgid "guestfs_part_add"
13622 #: ../src/guestfs-actions.pod:4903
13626 " guestfs_part_add (guestfs_h *g,\n"
13627 " const char *device,\n"
13628 " const char *prlogex,\n"
13629 " int64_t startsect,\n"
13630 " int64_t endsect);\n"
13635 #: ../src/guestfs-actions.pod:4910
13637 "This command adds a partition to C<device>. If there is no partition table "
13638 "on the device, call C<guestfs_part_init> first."
13642 #: ../src/guestfs-actions.pod:4913 ../fish/guestfish-actions.pod:3301
13644 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13645 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13646 "C<logical>) and C<e> (or C<extended>) partition types."
13650 #: ../src/guestfs-actions.pod:4918 ../fish/guestfish-actions.pod:3306
13652 "C<startsect> and C<endsect> are the start and end of the partition in "
13653 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13654 "from the end of the disk (C<-1> is the last sector)."
13658 #: ../src/guestfs-actions.pod:4922
13660 "Creating a partition which covers the whole disk is not so easy. Use "
13661 "C<guestfs_part_disk> to do that."
13665 #: ../src/guestfs-actions.pod:4927 ../src/guestfs-actions.pod:4965 ../src/guestfs-actions.pod:5018 ../src/guestfs-actions.pod:5096 ../src/guestfs-actions.pod:5134 ../src/guestfs-actions.pod:5153 ../src/guestfs-actions.pod:5193
13666 msgid "(Added in 1.0.78)"
13670 #: ../src/guestfs-actions.pod:4929
13671 msgid "guestfs_part_del"
13675 #: ../src/guestfs-actions.pod:4931
13679 " guestfs_part_del (guestfs_h *g,\n"
13680 " const char *device,\n"
13686 #: ../src/guestfs-actions.pod:4936 ../fish/guestfish-actions.pod:3317
13687 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13691 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3319
13693 "Note that in the case of MBR partitioning, deleting an extended partition "
13694 "also deletes any logical partitions it contains."
13698 #: ../src/guestfs-actions.pod:4946
13699 msgid "guestfs_part_disk"
13703 #: ../src/guestfs-actions.pod:4948
13707 " guestfs_part_disk (guestfs_h *g,\n"
13708 " const char *device,\n"
13709 " const char *parttype);\n"
13714 #: ../src/guestfs-actions.pod:4953
13716 "This command is simply a combination of C<guestfs_part_init> followed by "
13717 "C<guestfs_part_add> to create a single primary partition covering the whole "
13722 #: ../src/guestfs-actions.pod:4957
13724 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13725 "possible values are described in C<guestfs_part_init>."
13729 #: ../src/guestfs-actions.pod:4967
13730 msgid "guestfs_part_get_bootable"
13734 #: ../src/guestfs-actions.pod:4969
13738 " guestfs_part_get_bootable (guestfs_h *g,\n"
13739 " const char *device,\n"
13745 #: ../src/guestfs-actions.pod:4974 ../fish/guestfish-actions.pod:3341
13747 "This command returns true if the partition C<partnum> on C<device> has the "
13748 "bootable flag set."
13752 #: ../src/guestfs-actions.pod:4977
13753 msgid "See also C<guestfs_part_set_bootable>."
13757 #: ../src/guestfs-actions.pod:4983
13758 msgid "guestfs_part_get_mbr_id"
13762 #: ../src/guestfs-actions.pod:4985
13766 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
13767 " const char *device,\n"
13773 #: ../src/guestfs-actions.pod:4990 ../fish/guestfish-actions.pod:3350
13775 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13776 "partition C<partnum>."
13780 #: ../src/guestfs-actions.pod:4993 ../src/guestfs-actions.pod:5169
13782 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13783 "undefined results for other partition table types (see "
13784 "C<guestfs_part_get_parttype>)."
13788 #: ../src/guestfs-actions.pod:5001
13789 msgid "guestfs_part_get_parttype"
13793 #: ../src/guestfs-actions.pod:5003
13797 " guestfs_part_get_parttype (guestfs_h *g,\n"
13798 " const char *device);\n"
13803 #: ../src/guestfs-actions.pod:5007 ../fish/guestfish-actions.pod:3361
13805 "This command examines the partition table on C<device> and returns the "
13806 "partition table type (format) being used."
13810 #: ../src/guestfs-actions.pod:5010
13812 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13813 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13814 "possible, although unusual. See C<guestfs_part_init> for a full list."
13818 #: ../src/guestfs-actions.pod:5020
13819 msgid "guestfs_part_init"
13823 #: ../src/guestfs-actions.pod:5022
13827 " guestfs_part_init (guestfs_h *g,\n"
13828 " const char *device,\n"
13829 " const char *parttype);\n"
13834 #: ../src/guestfs-actions.pod:5027 ../fish/guestfish-actions.pod:3373
13836 "This creates an empty partition table on C<device> of one of the partition "
13837 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13838 "(for large disks)."
13842 #: ../src/guestfs-actions.pod:5031
13844 "Initially there are no partitions. Following this, you should call "
13845 "C<guestfs_part_add> for each partition required."
13849 #: ../src/guestfs-actions.pod:5034 ../fish/guestfish-actions.pod:3380
13850 msgid "Possible values for C<parttype> are:"
13854 #: ../src/guestfs-actions.pod:5038 ../fish/guestfish-actions.pod:3384
13855 msgid "B<efi> | B<gpt>"
13859 #: ../src/guestfs-actions.pod:5040 ../fish/guestfish-actions.pod:3386
13860 msgid "Intel EFI / GPT partition table."
13864 #: ../src/guestfs-actions.pod:5042 ../fish/guestfish-actions.pod:3388
13866 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13867 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13868 "the C<mbr> format."
13872 #: ../src/guestfs-actions.pod:5046 ../fish/guestfish-actions.pod:3392
13873 msgid "B<mbr> | B<msdos>"
13877 #: ../src/guestfs-actions.pod:5048 ../fish/guestfish-actions.pod:3394
13879 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13880 "Windows. This partition type will B<only> work for device sizes up to 2 "
13881 "TB. For large disks we recommend using C<gpt>."
13885 #: ../src/guestfs-actions.pod:5055 ../fish/guestfish-actions.pod:3401
13886 msgid "Other partition table types that may work but are not supported include:"
13890 #: ../src/guestfs-actions.pod:5060 ../fish/guestfish-actions.pod:3406
13895 #: ../src/guestfs-actions.pod:5062 ../fish/guestfish-actions.pod:3408
13896 msgid "AIX disk labels."
13900 #: ../src/guestfs-actions.pod:5064 ../fish/guestfish-actions.pod:3410
13901 msgid "B<amiga> | B<rdb>"
13905 #: ../src/guestfs-actions.pod:5066 ../fish/guestfish-actions.pod:3412
13906 msgid "Amiga \"Rigid Disk Block\" format."
13910 #: ../src/guestfs-actions.pod:5068 ../fish/guestfish-actions.pod:3414
13915 #: ../src/guestfs-actions.pod:5070 ../fish/guestfish-actions.pod:3416
13916 msgid "BSD disk labels."
13920 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3418
13925 #: ../src/guestfs-actions.pod:5074 ../fish/guestfish-actions.pod:3420
13926 msgid "DASD, used on IBM mainframes."
13930 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3422
13935 #: ../src/guestfs-actions.pod:5078 ../fish/guestfish-actions.pod:3424
13936 msgid "MIPS/SGI volumes."
13940 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3426
13945 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3428
13946 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13950 #: ../src/guestfs-actions.pod:5084 ../fish/guestfish-actions.pod:3430
13955 #: ../src/guestfs-actions.pod:5086 ../fish/guestfish-actions.pod:3432
13956 msgid "NEC PC-98 format, common in Japan apparently."
13960 #: ../src/guestfs-actions.pod:5088 ../fish/guestfish-actions.pod:3434
13965 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3436
13966 msgid "Sun disk labels."
13970 #: ../src/guestfs-actions.pod:5098
13971 msgid "guestfs_part_list"
13975 #: ../src/guestfs-actions.pod:5100
13978 " struct guestfs_partition_list *\n"
13979 " guestfs_part_list (guestfs_h *g,\n"
13980 " const char *device);\n"
13985 #: ../src/guestfs-actions.pod:5104 ../fish/guestfish-actions.pod:3444
13987 "This command parses the partition table on C<device> and returns the list of "
13988 "partitions found."
13992 #: ../src/guestfs-actions.pod:5107 ../fish/guestfish-actions.pod:3447
13993 msgid "The fields in the returned structure are:"
13997 #: ../src/guestfs-actions.pod:5111 ../fish/guestfish-actions.pod:3451
13998 msgid "B<part_num>"
14002 #: ../src/guestfs-actions.pod:5113 ../fish/guestfish-actions.pod:3453
14003 msgid "Partition number, counting from 1."
14007 #: ../src/guestfs-actions.pod:5115 ../fish/guestfish-actions.pod:3455
14008 msgid "B<part_start>"
14012 #: ../src/guestfs-actions.pod:5117
14014 "Start of the partition I<in bytes>. To get sectors you have to divide by "
14015 "the device's sector size, see C<guestfs_blockdev_getss>."
14019 #: ../src/guestfs-actions.pod:5120 ../fish/guestfish-actions.pod:3460
14020 msgid "B<part_end>"
14024 #: ../src/guestfs-actions.pod:5122 ../fish/guestfish-actions.pod:3462
14025 msgid "End of the partition in bytes."
14029 #: ../src/guestfs-actions.pod:5124 ../fish/guestfish-actions.pod:3464
14030 msgid "B<part_size>"
14034 #: ../src/guestfs-actions.pod:5126 ../fish/guestfish-actions.pod:3466
14035 msgid "Size of the partition in bytes."
14039 #: ../src/guestfs-actions.pod:5130
14041 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
14042 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
14047 #: ../src/guestfs-actions.pod:5136
14048 msgid "guestfs_part_set_bootable"
14052 #: ../src/guestfs-actions.pod:5138
14056 " guestfs_part_set_bootable (guestfs_h *g,\n"
14057 " const char *device,\n"
14059 " int bootable);\n"
14064 #: ../src/guestfs-actions.pod:5144 ../fish/guestfish-actions.pod:3474
14066 "This sets the bootable flag on partition numbered C<partnum> on device "
14067 "C<device>. Note that partitions are numbered from 1."
14071 #: ../src/guestfs-actions.pod:5147 ../fish/guestfish-actions.pod:3477
14073 "The bootable flag is used by some operating systems (notably Windows) to "
14074 "determine which partition to boot from. It is by no means universally "
14079 #: ../src/guestfs-actions.pod:5155
14080 msgid "guestfs_part_set_mbr_id"
14084 #: ../src/guestfs-actions.pod:5157
14088 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
14089 " const char *device,\n"
14096 #: ../src/guestfs-actions.pod:5163 ../fish/guestfish-actions.pod:3485
14098 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
14099 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
14100 "documentation are in fact hexadecimal numbers, but usually documented "
14101 "without any leading \"0x\" which might be confusing."
14105 #: ../src/guestfs-actions.pod:5177
14106 msgid "guestfs_part_set_name"
14110 #: ../src/guestfs-actions.pod:5179
14114 " guestfs_part_set_name (guestfs_h *g,\n"
14115 " const char *device,\n"
14117 " const char *name);\n"
14122 #: ../src/guestfs-actions.pod:5185 ../fish/guestfish-actions.pod:3499
14124 "This sets the partition name on partition numbered C<partnum> on device "
14125 "C<device>. Note that partitions are numbered from 1."
14129 #: ../src/guestfs-actions.pod:5188 ../fish/guestfish-actions.pod:3502
14131 "The partition name can only be set on certain types of partition table. "
14132 "This works on C<gpt> but not on C<mbr> partitions."
14136 #: ../src/guestfs-actions.pod:5195
14137 msgid "guestfs_part_to_dev"
14141 #: ../src/guestfs-actions.pod:5197
14145 " guestfs_part_to_dev (guestfs_h *g,\n"
14146 " const char *partition);\n"
14151 #: ../src/guestfs-actions.pod:5201 ../fish/guestfish-actions.pod:3509
14153 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
14154 "partition number, returning the device name (eg. \"/dev/sdb\")."
14158 #: ../src/guestfs-actions.pod:5205
14160 "The named partition must exist, for example as a string returned from "
14161 "C<guestfs_list_partitions>."
14165 #: ../src/guestfs-actions.pod:5213
14166 msgid "guestfs_ping_daemon"
14170 #: ../src/guestfs-actions.pod:5215
14174 " guestfs_ping_daemon (guestfs_h *g);\n"
14179 #: ../src/guestfs-actions.pod:5218 ../fish/guestfish-actions.pod:3520
14181 "This is a test probe into the guestfs daemon running inside the qemu "
14182 "subprocess. Calling this function checks that the daemon responds to the "
14183 "ping message, without affecting the daemon or attached block device(s) in "
14188 #: ../src/guestfs-actions.pod:5227
14189 msgid "guestfs_pread"
14193 #: ../src/guestfs-actions.pod:5229
14197 " guestfs_pread (guestfs_h *g,\n"
14198 " const char *path,\n"
14200 " int64_t offset,\n"
14201 " size_t *size_r);\n"
14206 #: ../src/guestfs-actions.pod:5236 ../fish/guestfish-actions.pod:3529
14208 "This command lets you read part of a file. It reads C<count> bytes of the "
14209 "file, starting at C<offset>, from file C<path>."
14213 #: ../src/guestfs-actions.pod:5239 ../src/guestfs-actions.pod:5265 ../fish/guestfish-actions.pod:3532 ../fish/guestfish-actions.pod:3547
14215 "This may read fewer bytes than requested. For further details see the "
14216 "L<pread(2)> system call."
14220 #: ../src/guestfs-actions.pod:5242
14221 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
14225 #: ../src/guestfs-actions.pod:5253
14226 msgid "guestfs_pread_device"
14230 #: ../src/guestfs-actions.pod:5255
14234 " guestfs_pread_device (guestfs_h *g,\n"
14235 " const char *device,\n"
14237 " int64_t offset,\n"
14238 " size_t *size_r);\n"
14243 #: ../src/guestfs-actions.pod:5262 ../fish/guestfish-actions.pod:3544
14245 "This command lets you read part of a file. It reads C<count> bytes of "
14246 "C<device>, starting at C<offset>."
14250 #: ../src/guestfs-actions.pod:5268
14251 msgid "See also C<guestfs_pread>."
14255 #: ../src/guestfs-actions.pod:5277
14256 msgid "(Added in 1.5.21)"
14260 #: ../src/guestfs-actions.pod:5279
14261 msgid "guestfs_pvcreate"
14265 #: ../src/guestfs-actions.pod:5281
14269 " guestfs_pvcreate (guestfs_h *g,\n"
14270 " const char *device);\n"
14275 #: ../src/guestfs-actions.pod:5285 ../fish/guestfish-actions.pod:3559
14277 "This creates an LVM physical volume on the named C<device>, where C<device> "
14278 "should usually be a partition name such as C</dev/sda1>."
14282 #: ../src/guestfs-actions.pod:5293
14283 msgid "guestfs_pvremove"
14287 #: ../src/guestfs-actions.pod:5295
14291 " guestfs_pvremove (guestfs_h *g,\n"
14292 " const char *device);\n"
14297 #: ../src/guestfs-actions.pod:5299 ../fish/guestfish-actions.pod:3567
14299 "This wipes a physical volume C<device> so that LVM will no longer recognise "
14304 #: ../src/guestfs-actions.pod:5302 ../fish/guestfish-actions.pod:3570
14306 "The implementation uses the C<pvremove> command which refuses to wipe "
14307 "physical volumes that contain any volume groups, so you have to remove those "
14312 #: ../src/guestfs-actions.pod:5310
14313 msgid "guestfs_pvresize"
14317 #: ../src/guestfs-actions.pod:5312
14321 " guestfs_pvresize (guestfs_h *g,\n"
14322 " const char *device);\n"
14327 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3578
14329 "This resizes (expands or shrinks) an existing LVM physical volume to match "
14330 "the new size of the underlying device."
14334 #: ../src/guestfs-actions.pod:5323
14335 msgid "guestfs_pvresize_size"
14339 #: ../src/guestfs-actions.pod:5325
14343 " guestfs_pvresize_size (guestfs_h *g,\n"
14344 " const char *device,\n"
14345 " int64_t size);\n"
14350 #: ../src/guestfs-actions.pod:5330
14352 "This command is the same as C<guestfs_pvresize> except that it allows you to "
14353 "specify the new size (in bytes) explicitly."
14357 #: ../src/guestfs-actions.pod:5337
14358 msgid "guestfs_pvs"
14362 #: ../src/guestfs-actions.pod:5339
14366 " guestfs_pvs (guestfs_h *g);\n"
14371 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3592
14373 "List all the physical volumes detected. This is the equivalent of the "
14374 "L<pvs(8)> command."
14378 #: ../src/guestfs-actions.pod:5345 ../fish/guestfish-actions.pod:3595
14380 "This returns a list of just the device names that contain PVs "
14381 "(eg. C</dev/sda2>)."
14385 #: ../src/guestfs-actions.pod:5348
14386 msgid "See also C<guestfs_pvs_full>."
14390 #: ../src/guestfs-actions.pod:5356
14391 msgid "guestfs_pvs_full"
14395 #: ../src/guestfs-actions.pod:5358
14398 " struct guestfs_lvm_pv_list *\n"
14399 " guestfs_pvs_full (guestfs_h *g);\n"
14404 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3604
14406 "List all the physical volumes detected. This is the equivalent of the "
14407 "L<pvs(8)> command. The \"full\" version includes all fields."
14411 #: ../src/guestfs-actions.pod:5364
14413 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
14414 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
14419 #: ../src/guestfs-actions.pod:5370
14420 msgid "guestfs_pvuuid"
14424 #: ../src/guestfs-actions.pod:5372
14428 " guestfs_pvuuid (guestfs_h *g,\n"
14429 " const char *device);\n"
14434 #: ../src/guestfs-actions.pod:5376 ../fish/guestfish-actions.pod:3611
14435 msgid "This command returns the UUID of the LVM PV C<device>."
14439 #: ../src/guestfs-actions.pod:5383
14440 msgid "guestfs_pwrite"
14444 #: ../src/guestfs-actions.pod:5385
14448 " guestfs_pwrite (guestfs_h *g,\n"
14449 " const char *path,\n"
14450 " const char *content,\n"
14451 " size_t content_size,\n"
14452 " int64_t offset);\n"
14457 #: ../src/guestfs-actions.pod:5392 ../fish/guestfish-actions.pod:3617
14459 "This command writes to part of a file. It writes the data buffer C<content> "
14460 "to the file C<path> starting at offset C<offset>."
14464 #: ../src/guestfs-actions.pod:5395 ../fish/guestfish-actions.pod:3620
14466 "This command implements the L<pwrite(2)> system call, and like that system "
14467 "call it may not write the full data requested. The return value is the "
14468 "number of bytes that were actually written to the file. This could even be "
14469 "0, although short writes are unlikely for regular files in ordinary "
14474 #: ../src/guestfs-actions.pod:5401
14475 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
14479 #: ../src/guestfs-actions.pod:5410
14480 msgid "guestfs_pwrite_device"
14484 #: ../src/guestfs-actions.pod:5412
14488 " guestfs_pwrite_device (guestfs_h *g,\n"
14489 " const char *device,\n"
14490 " const char *content,\n"
14491 " size_t content_size,\n"
14492 " int64_t offset);\n"
14497 #: ../src/guestfs-actions.pod:5419 ../fish/guestfish-actions.pod:3635
14499 "This command writes to part of a device. It writes the data buffer "
14500 "C<content> to C<device> starting at offset C<offset>."
14504 #: ../src/guestfs-actions.pod:5422 ../fish/guestfish-actions.pod:3638
14506 "This command implements the L<pwrite(2)> system call, and like that system "
14507 "call it may not write the full data requested (although short writes to disk "
14508 "devices and partitions are probably impossible with standard Linux kernels)."
14512 #: ../src/guestfs-actions.pod:5427
14513 msgid "See also C<guestfs_pwrite>."
14517 #: ../src/guestfs-actions.pod:5434
14518 msgid "(Added in 1.5.20)"
14522 #: ../src/guestfs-actions.pod:5436
14523 msgid "guestfs_read_file"
14527 #: ../src/guestfs-actions.pod:5438
14531 " guestfs_read_file (guestfs_h *g,\n"
14532 " const char *path,\n"
14533 " size_t *size_r);\n"
14538 #: ../src/guestfs-actions.pod:5443 ../fish/guestfish-actions.pod:3652
14539 msgid "This calls returns the contents of the file C<path> as a buffer."
14543 #: ../src/guestfs-actions.pod:5446
14545 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
14546 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
14547 "function is limited in the total size of file that can be handled."
14551 #: ../src/guestfs-actions.pod:5458
14552 msgid "(Added in 1.0.63)"
14556 #: ../src/guestfs-actions.pod:5460
14557 msgid "guestfs_read_lines"
14561 #: ../src/guestfs-actions.pod:5462
14565 " guestfs_read_lines (guestfs_h *g,\n"
14566 " const char *path);\n"
14571 #: ../src/guestfs-actions.pod:5468 ../fish/guestfish-actions.pod:3669
14573 "The file contents are returned as a list of lines. Trailing C<LF> and "
14574 "C<CRLF> character sequences are I<not> returned."
14578 #: ../src/guestfs-actions.pod:5471
14580 "Note that this function cannot correctly handle binary files (specifically, "
14581 "files containing C<\\0> character which is treated as end of line). For "
14582 "those you need to use the C<guestfs_read_file> function which has a more "
14583 "complex interface."
14587 #: ../src/guestfs-actions.pod:5482
14588 msgid "guestfs_readdir"
14592 #: ../src/guestfs-actions.pod:5484
14595 " struct guestfs_dirent_list *\n"
14596 " guestfs_readdir (guestfs_h *g,\n"
14597 " const char *dir);\n"
14602 #: ../src/guestfs-actions.pod:5488 ../fish/guestfish-actions.pod:3681
14603 msgid "This returns the list of directory entries in directory C<dir>."
14607 #: ../src/guestfs-actions.pod:5490 ../fish/guestfish-actions.pod:3683
14609 "All entries in the directory are returned, including C<.> and C<..>. The "
14610 "entries are I<not> sorted, but returned in the same order as the underlying "
14615 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:3687
14617 "Also this call returns basic file type information about each file. The "
14618 "C<ftyp> field will contain one of the following characters:"
14622 #: ../src/guestfs-actions.pod:5499 ../fish/guestfish-actions.pod:3692
14627 #: ../src/guestfs-actions.pod:5501 ../fish/guestfish-actions.pod:3694
14628 msgid "Block special"
14632 #: ../src/guestfs-actions.pod:5503 ../fish/guestfish-actions.pod:3696
14637 #: ../src/guestfs-actions.pod:5505 ../fish/guestfish-actions.pod:3698
14638 msgid "Char special"
14642 #: ../src/guestfs-actions.pod:5507 ../fish/guestfish-actions.pod:3700
14647 #: ../src/guestfs-actions.pod:5509 ../fish/guestfish-actions.pod:3702
14652 #: ../src/guestfs-actions.pod:5511 ../fish/guestfish-actions.pod:3704
14657 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3706
14658 msgid "FIFO (named pipe)"
14662 #: ../src/guestfs-actions.pod:5515 ../fish/guestfish-actions.pod:3708
14667 #: ../src/guestfs-actions.pod:5517 ../fish/guestfish-actions.pod:3710
14668 msgid "Symbolic link"
14672 #: ../src/guestfs-actions.pod:5519 ../fish/guestfish-actions.pod:3712
14677 #: ../src/guestfs-actions.pod:5521 ../fish/guestfish-actions.pod:3714
14678 msgid "Regular file"
14682 #: ../src/guestfs-actions.pod:5523 ../fish/guestfish-actions.pod:3716
14687 #: ../src/guestfs-actions.pod:5525 ../fish/guestfish-actions.pod:3718
14692 #: ../src/guestfs-actions.pod:5527 ../fish/guestfish-actions.pod:3720
14697 #: ../src/guestfs-actions.pod:5529 ../fish/guestfish-actions.pod:3722
14698 msgid "Unknown file type"
14702 #: ../src/guestfs-actions.pod:5531 ../fish/guestfish-actions.pod:3724
14707 #: ../src/guestfs-actions.pod:5533 ../fish/guestfish-actions.pod:3726
14708 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14712 #: ../src/guestfs-actions.pod:5538
14714 "This function is primarily intended for use by programs. To get a simple "
14715 "list of names, use C<guestfs_ls>. To get a printable directory for human "
14716 "consumption, use C<guestfs_ll>."
14720 #: ../src/guestfs-actions.pod:5542
14722 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
14723 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
14728 #: ../src/guestfs-actions.pod:5548
14729 msgid "guestfs_readlink"
14733 #: ../src/guestfs-actions.pod:5550
14737 " guestfs_readlink (guestfs_h *g,\n"
14738 " const char *path);\n"
14743 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:3739
14744 msgid "This command reads the target of a symbolic link."
14748 #: ../src/guestfs-actions.pod:5561
14749 msgid "guestfs_readlinklist"
14753 #: ../src/guestfs-actions.pod:5563
14757 " guestfs_readlinklist (guestfs_h *g,\n"
14758 " const char *path,\n"
14759 " char *const *names);\n"
14764 #: ../src/guestfs-actions.pod:5568 ../fish/guestfish-actions.pod:3745
14766 "This call allows you to do a C<readlink> operation on multiple files, where "
14767 "all files are in the directory C<path>. C<names> is the list of files from "
14772 #: ../src/guestfs-actions.pod:5572 ../fish/guestfish-actions.pod:3749
14774 "On return you get a list of strings, with a one-to-one correspondence to the "
14775 "C<names> list. Each string is the value of the symbolic link."
14779 #: ../src/guestfs-actions.pod:5576 ../fish/guestfish-actions.pod:3753
14781 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14782 "result string is the empty string C<\"\">. However the whole operation is "
14783 "completed even if there were C<readlink(2)> errors, and so you can call this "
14784 "function with names where you don't know if they are symbolic links already "
14785 "(albeit slightly less efficient)."
14789 #: ../src/guestfs-actions.pod:5583 ../fish/guestfish-actions.pod:3760
14791 "This call is intended for programs that want to efficiently list a directory "
14792 "contents without making many round-trips. Very long directory listings "
14793 "might cause the protocol message size to be exceeded, causing this call to "
14794 "fail. The caller must split up such requests into smaller groups of names."
14798 #: ../src/guestfs-actions.pod:5596
14799 msgid "guestfs_realpath"
14803 #: ../src/guestfs-actions.pod:5598
14807 " guestfs_realpath (guestfs_h *g,\n"
14808 " const char *path);\n"
14813 #: ../src/guestfs-actions.pod:5602 ../fish/guestfish-actions.pod:3771
14815 "Return the canonicalized absolute pathname of C<path>. The returned path "
14816 "has no C<.>, C<..> or symbolic link path elements."
14820 #: ../src/guestfs-actions.pod:5610
14821 msgid "guestfs_removexattr"
14825 #: ../src/guestfs-actions.pod:5612
14829 " guestfs_removexattr (guestfs_h *g,\n"
14830 " const char *xattr,\n"
14831 " const char *path);\n"
14836 #: ../src/guestfs-actions.pod:5617 ../fish/guestfish-actions.pod:3778
14837 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
14841 #: ../src/guestfs-actions.pod:5620
14842 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
14846 #: ../src/guestfs-actions.pod:5626
14847 msgid "guestfs_resize2fs"
14851 #: ../src/guestfs-actions.pod:5628
14855 " guestfs_resize2fs (guestfs_h *g,\n"
14856 " const char *device);\n"
14861 #: ../src/guestfs-actions.pod:5632 ../fish/guestfish-actions.pod:3787
14863 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14864 "underlying device."
14868 #: ../src/guestfs-actions.pod:5635
14870 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
14871 "C<device> before calling this command. For unknown reasons C<resize2fs> "
14872 "sometimes gives an error about this and sometimes not. In any case, it is "
14873 "always safe to call C<guestfs_e2fsck_f> before calling this function."
14877 #: ../src/guestfs-actions.pod:5645
14878 msgid "guestfs_resize2fs_M"
14882 #: ../src/guestfs-actions.pod:5647
14886 " guestfs_resize2fs_M (guestfs_h *g,\n"
14887 " const char *device);\n"
14892 #: ../src/guestfs-actions.pod:5651
14894 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
14895 "resized to its minimum size. This works like the C<-M> option to the "
14896 "C<resize2fs> command."
14900 #: ../src/guestfs-actions.pod:5655
14902 "To get the resulting size of the filesystem you should call "
14903 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
14904 "These two numbers, multiplied together, give the resulting size of the "
14905 "minimal filesystem in bytes."
14909 #: ../src/guestfs-actions.pod:5662
14910 msgid "guestfs_resize2fs_size"
14914 #: ../src/guestfs-actions.pod:5664
14918 " guestfs_resize2fs_size (guestfs_h *g,\n"
14919 " const char *device,\n"
14920 " int64_t size);\n"
14925 #: ../src/guestfs-actions.pod:5669
14927 "This command is the same as C<guestfs_resize2fs> except that it allows you "
14928 "to specify the new size (in bytes) explicitly."
14932 #: ../src/guestfs-actions.pod:5676
14937 #: ../src/guestfs-actions.pod:5678
14941 " guestfs_rm (guestfs_h *g,\n"
14942 " const char *path);\n"
14947 #: ../src/guestfs-actions.pod:5682 ../fish/guestfish-actions.pod:3820
14948 msgid "Remove the single file C<path>."
14952 #: ../src/guestfs-actions.pod:5688
14953 msgid "guestfs_rm_rf"
14957 #: ../src/guestfs-actions.pod:5690
14961 " guestfs_rm_rf (guestfs_h *g,\n"
14962 " const char *path);\n"
14967 #: ../src/guestfs-actions.pod:5694 ../fish/guestfish-actions.pod:3826
14969 "Remove the file or directory C<path>, recursively removing the contents if "
14970 "its a directory. This is like the C<rm -rf> shell command."
14974 #: ../src/guestfs-actions.pod:5702
14975 msgid "guestfs_rmdir"
14979 #: ../src/guestfs-actions.pod:5704
14983 " guestfs_rmdir (guestfs_h *g,\n"
14984 " const char *path);\n"
14989 #: ../src/guestfs-actions.pod:5708 ../fish/guestfish-actions.pod:3834
14990 msgid "Remove the single directory C<path>."
14994 #: ../src/guestfs-actions.pod:5714
14995 msgid "guestfs_rmmountpoint"
14999 #: ../src/guestfs-actions.pod:5716
15003 " guestfs_rmmountpoint (guestfs_h *g,\n"
15004 " const char *exemptpath);\n"
15009 #: ../src/guestfs-actions.pod:5720
15011 "This calls removes a mountpoint that was previously created with "
15012 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
15016 #: ../src/guestfs-actions.pod:5728
15017 msgid "guestfs_scrub_device"
15021 #: ../src/guestfs-actions.pod:5730
15025 " guestfs_scrub_device (guestfs_h *g,\n"
15026 " const char *device);\n"
15031 #: ../src/guestfs-actions.pod:5734 ../fish/guestfish-actions.pod:3848
15033 "This command writes patterns over C<device> to make data retrieval more "
15038 #: ../src/guestfs-actions.pod:5737 ../src/guestfs-actions.pod:5758 ../src/guestfs-actions.pod:5777 ../fish/guestfish-actions.pod:3851 ../fish/guestfish-actions.pod:3866 ../fish/guestfish-actions.pod:3879
15040 "It is an interface to the L<scrub(1)> program. See that manual page for "
15045 #: ../src/guestfs-actions.pod:5745 ../src/guestfs-actions.pod:5763 ../src/guestfs-actions.pod:5782
15046 msgid "(Added in 1.0.52)"
15050 #: ../src/guestfs-actions.pod:5747
15051 msgid "guestfs_scrub_file"
15055 #: ../src/guestfs-actions.pod:5749
15059 " guestfs_scrub_file (guestfs_h *g,\n"
15060 " const char *file);\n"
15065 #: ../src/guestfs-actions.pod:5753 ../fish/guestfish-actions.pod:3861
15067 "This command writes patterns over a file to make data retrieval more "
15072 #: ../src/guestfs-actions.pod:5756 ../fish/guestfish-actions.pod:3864
15073 msgid "The file is I<removed> after scrubbing."
15077 #: ../src/guestfs-actions.pod:5765
15078 msgid "guestfs_scrub_freespace"
15082 #: ../src/guestfs-actions.pod:5767
15086 " guestfs_scrub_freespace (guestfs_h *g,\n"
15087 " const char *dir);\n"
15092 #: ../src/guestfs-actions.pod:5771
15094 "This command creates the directory C<dir> and then fills it with files until "
15095 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
15096 "and deletes them. The intention is to scrub any free space on the partition "
15097 "containing C<dir>."
15101 #: ../src/guestfs-actions.pod:5784
15102 msgid "guestfs_set_append"
15106 #: ../src/guestfs-actions.pod:5786
15110 " guestfs_set_append (guestfs_h *g,\n"
15111 " const char *append);\n"
15116 #: ../src/guestfs-actions.pod:5790 ../fish/guestfish-actions.pod:3888
15118 "This function is used to add additional options to the guest kernel command "
15123 #: ../src/guestfs-actions.pod:5793 ../fish/guestfish-actions.pod:3891
15125 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
15126 "environment variable."
15130 #: ../src/guestfs-actions.pod:5796 ../fish/guestfish-actions.pod:3894
15132 "Setting C<append> to C<NULL> means I<no> additional options are passed "
15133 "(libguestfs always adds a few of its own)."
15137 #: ../src/guestfs-actions.pod:5803
15138 msgid "guestfs_set_attach_method"
15142 #: ../src/guestfs-actions.pod:5805
15146 " guestfs_set_attach_method (guestfs_h *g,\n"
15147 " const char *attachmethod);\n"
15152 #: ../src/guestfs-actions.pod:5809 ../fish/guestfish-actions.pod:3903
15154 "Set the method that libguestfs uses to connect to the back end guestfsd "
15155 "daemon. Possible methods are:"
15159 #: ../src/guestfs-actions.pod:5816 ../fish/guestfish-actions.pod:3910
15161 "Launch an appliance and connect to it. This is the ordinary method and the "
15166 #: ../src/guestfs-actions.pod:5819 ../fish/guestfish-actions.pod:3913
15167 msgid "C<unix:I<path>>"
15171 #: ../src/guestfs-actions.pod:5821 ../fish/guestfish-actions.pod:3915
15172 msgid "Connect to the Unix domain socket I<path>."
15176 #: ../src/guestfs-actions.pod:5823 ../fish/guestfish-actions.pod:3917
15178 "This method lets you connect to an existing daemon or (using virtio-serial) "
15179 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
15180 "RUNNING DAEMONS>."
15184 #: ../src/guestfs-actions.pod:5831
15185 msgid "guestfs_set_autosync"
15189 #: ../src/guestfs-actions.pod:5833
15193 " guestfs_set_autosync (guestfs_h *g,\n"
15194 " int autosync);\n"
15199 #: ../src/guestfs-actions.pod:5837 ../fish/guestfish-actions.pod:3929
15201 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
15202 "effort attempt to make filesystems consistent and synchronized when the "
15203 "handle is closed (also if the program exits without closing handles)."
15207 #: ../src/guestfs-actions.pod:5842 ../fish/guestfish-actions.pod:3934
15209 "This is enabled by default (since libguestfs 1.5.24, previously it was "
15210 "disabled by default)."
15214 #: ../src/guestfs-actions.pod:5849
15215 msgid "guestfs_set_direct"
15219 #: ../src/guestfs-actions.pod:5851
15223 " guestfs_set_direct (guestfs_h *g,\n"
15229 #: ../src/guestfs-actions.pod:5855 ../fish/guestfish-actions.pod:3943
15231 "If the direct appliance mode flag is enabled, then stdin and stdout are "
15232 "passed directly through to the appliance once it is launched."
15236 #: ../src/guestfs-actions.pod:5859
15238 "One consequence of this is that log messages aren't caught by the library "
15239 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
15244 #: ../src/guestfs-actions.pod:5863 ../fish/guestfish-actions.pod:3951
15245 msgid "You probably don't want to use this unless you know what you are doing."
15249 #: ../src/guestfs-actions.pod:5866 ../fish/guestfish-actions.pod:3954
15250 msgid "The default is disabled."
15254 #: ../src/guestfs-actions.pod:5872
15255 msgid "guestfs_set_e2label"
15259 #: ../src/guestfs-actions.pod:5874
15263 " guestfs_set_e2label (guestfs_h *g,\n"
15264 " const char *device,\n"
15265 " const char *label);\n"
15270 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3960
15272 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
15273 "C<label>. Filesystem labels are limited to 16 characters."
15277 #: ../src/guestfs-actions.pod:5883
15279 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
15280 "the existing label on a filesystem."
15284 #: ../src/guestfs-actions.pod:5890
15285 msgid "guestfs_set_e2uuid"
15289 #: ../src/guestfs-actions.pod:5892
15293 " guestfs_set_e2uuid (guestfs_h *g,\n"
15294 " const char *device,\n"
15295 " const char *uuid);\n"
15300 #: ../src/guestfs-actions.pod:5897 ../fish/guestfish-actions.pod:3971
15302 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
15303 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
15304 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
15308 #: ../src/guestfs-actions.pod:5902
15310 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
15311 "the existing UUID of a filesystem."
15315 #: ../src/guestfs-actions.pod:5909
15316 msgid "guestfs_set_memsize"
15320 #: ../src/guestfs-actions.pod:5911
15324 " guestfs_set_memsize (guestfs_h *g,\n"
15330 #: ../src/guestfs-actions.pod:5915
15332 "This sets the memory size in megabytes allocated to the qemu subprocess. "
15333 "This only has any effect if called before C<guestfs_launch>."
15337 #: ../src/guestfs-actions.pod:5919 ../fish/guestfish-actions.pod:3989
15339 "You can also change this by setting the environment variable "
15340 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
15344 #: ../src/guestfs-actions.pod:5930
15345 msgid "guestfs_set_network"
15349 #: ../src/guestfs-actions.pod:5932
15353 " guestfs_set_network (guestfs_h *g,\n"
15359 #: ../src/guestfs-actions.pod:5936 ../fish/guestfish-actions.pod:4002
15361 "If C<network> is true, then the network is enabled in the libguestfs "
15362 "appliance. The default is false."
15366 #: ../src/guestfs-actions.pod:5939 ../fish/guestfish-actions.pod:4005
15368 "This affects whether commands are able to access the network (see "
15369 "L<guestfs(3)/RUNNING COMMANDS>)."
15373 #: ../src/guestfs-actions.pod:5942
15375 "You must call this before calling C<guestfs_launch>, otherwise it has no "
15380 #: ../src/guestfs-actions.pod:5949
15381 msgid "guestfs_set_path"
15385 #: ../src/guestfs-actions.pod:5951
15389 " guestfs_set_path (guestfs_h *g,\n"
15390 " const char *searchpath);\n"
15395 #: ../src/guestfs-actions.pod:5955 ../fish/guestfish-actions.pod:4017
15396 msgid "Set the path that libguestfs searches for kernel and initrd.img."
15400 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:4019
15402 "The default is C<$libdir/guestfs> unless overridden by setting "
15403 "C<LIBGUESTFS_PATH> environment variable."
15407 #: ../src/guestfs-actions.pod:5960 ../fish/guestfish-actions.pod:4022
15408 msgid "Setting C<path> to C<NULL> restores the default path."
15412 #: ../src/guestfs-actions.pod:5966
15413 msgid "guestfs_set_qemu"
15417 #: ../src/guestfs-actions.pod:5968
15421 " guestfs_set_qemu (guestfs_h *g,\n"
15422 " const char *qemu);\n"
15427 #: ../src/guestfs-actions.pod:5972 ../fish/guestfish-actions.pod:4030
15428 msgid "Set the qemu binary that we will use."
15432 #: ../src/guestfs-actions.pod:5974 ../fish/guestfish-actions.pod:4032
15433 msgid "The default is chosen when the library was compiled by the configure script."
15437 #: ../src/guestfs-actions.pod:5977 ../fish/guestfish-actions.pod:4035
15439 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15444 #: ../src/guestfs-actions.pod:5980 ../fish/guestfish-actions.pod:4038
15445 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15449 #: ../src/guestfs-actions.pod:5982 ../fish/guestfish-actions.pod:4040
15451 "Note that you should call this function as early as possible after creating "
15452 "the handle. This is because some pre-launch operations depend on testing "
15453 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15454 "don't retest features, and so you might see inconsistent results. Using the "
15455 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15456 "the qemu binary at the same time as the handle is created."
15460 #: ../src/guestfs-actions.pod:5994
15461 msgid "guestfs_set_recovery_proc"
15465 #: ../src/guestfs-actions.pod:5996
15469 " guestfs_set_recovery_proc (guestfs_h *g,\n"
15470 " int recoveryproc);\n"
15475 #: ../src/guestfs-actions.pod:6000
15477 "If this is called with the parameter C<false> then C<guestfs_launch> does "
15478 "not create a recovery process. The purpose of the recovery process is to "
15479 "stop runaway qemu processes in the case where the main program aborts "
15484 #: ../src/guestfs-actions.pod:6005
15486 "This only has any effect if called before C<guestfs_launch>, and the default "
15491 #: ../src/guestfs-actions.pod:6008 ../fish/guestfish-actions.pod:4062
15493 "About the only time when you would want to disable this is if the main "
15494 "process will fork itself into the background (\"daemonize\" itself). In "
15495 "this case the recovery process thinks that the main program has disappeared "
15496 "and so kills qemu, which is not very helpful."
15500 #: ../src/guestfs-actions.pod:6018
15501 msgid "guestfs_set_selinux"
15505 #: ../src/guestfs-actions.pod:6020
15509 " guestfs_set_selinux (guestfs_h *g,\n"
15515 #: ../src/guestfs-actions.pod:6024 ../fish/guestfish-actions.pod:4074
15517 "This sets the selinux flag that is passed to the appliance at boot time. "
15518 "The default is C<selinux=0> (disabled)."
15522 #: ../src/guestfs-actions.pod:6027 ../fish/guestfish-actions.pod:4077
15524 "Note that if SELinux is enabled, it is always in Permissive mode "
15525 "(C<enforcing=0>)."
15529 #: ../src/guestfs-actions.pod:6037
15530 msgid "guestfs_set_trace"
15534 #: ../src/guestfs-actions.pod:6039
15538 " guestfs_set_trace (guestfs_h *g,\n"
15544 #: ../src/guestfs-actions.pod:6043 ../fish/guestfish-actions.pod:4089
15546 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15547 "return values are traced."
15551 #: ../src/guestfs-actions.pod:6046 ../fish/guestfish-actions.pod:4092
15553 "If you want to trace C API calls into libguestfs (and other libraries) then "
15554 "possibly a better way is to use the external ltrace(1) command."
15558 #: ../src/guestfs-actions.pod:6050 ../fish/guestfish-actions.pod:4096
15560 "Command traces are disabled unless the environment variable "
15561 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15565 #: ../src/guestfs-actions.pod:6053
15567 "Trace messages are normally sent to C<stderr>, unless you register a "
15568 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
15572 #: ../src/guestfs-actions.pod:6061
15573 msgid "guestfs_set_verbose"
15577 #: ../src/guestfs-actions.pod:6063
15581 " guestfs_set_verbose (guestfs_h *g,\n"
15587 #: ../src/guestfs-actions.pod:6067 ../fish/guestfish-actions.pod:4109
15588 msgid "If C<verbose> is true, this turns on verbose messages."
15592 #: ../src/guestfs-actions.pod:6069 ../fish/guestfish-actions.pod:4111
15594 "Verbose messages are disabled unless the environment variable "
15595 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15599 #: ../src/guestfs-actions.pod:6072
15601 "Verbose messages are normally sent to C<stderr>, unless you register a "
15602 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
15606 #: ../src/guestfs-actions.pod:6080
15607 msgid "guestfs_setcon"
15611 #: ../src/guestfs-actions.pod:6082
15615 " guestfs_setcon (guestfs_h *g,\n"
15616 " const char *context);\n"
15621 #: ../src/guestfs-actions.pod:6086 ../fish/guestfish-actions.pod:4122
15623 "This sets the SELinux security context of the daemon to the string "
15628 #: ../src/guestfs-actions.pod:6089 ../fish/guestfish-actions.pod:4125
15629 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15633 #: ../src/guestfs-actions.pod:6095
15634 msgid "guestfs_setxattr"
15638 #: ../src/guestfs-actions.pod:6097
15642 " guestfs_setxattr (guestfs_h *g,\n"
15643 " const char *xattr,\n"
15644 " const char *val,\n"
15646 " const char *path);\n"
15651 #: ../src/guestfs-actions.pod:6104 ../fish/guestfish-actions.pod:4131
15653 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15654 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15658 #: ../src/guestfs-actions.pod:6108
15659 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
15663 #: ../src/guestfs-actions.pod:6114
15664 msgid "guestfs_sfdisk"
15668 #: ../src/guestfs-actions.pod:6116
15672 " guestfs_sfdisk (guestfs_h *g,\n"
15673 " const char *device,\n"
15677 " char *const *lines);\n"
15682 #: ../src/guestfs-actions.pod:6124 ../fish/guestfish-actions.pod:4141
15684 "This is a direct interface to the L<sfdisk(8)> program for creating "
15685 "partitions on block devices."
15689 #: ../src/guestfs-actions.pod:6127 ../fish/guestfish-actions.pod:4144
15690 msgid "C<device> should be a block device, for example C</dev/sda>."
15694 #: ../src/guestfs-actions.pod:6129 ../fish/guestfish-actions.pod:4146
15696 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15697 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
15698 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15699 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15700 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15701 "the kernel) cannot work out the right geometry and you will need to tell it."
15705 #: ../src/guestfs-actions.pod:6137 ../fish/guestfish-actions.pod:4154
15707 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15708 "refer to the L<sfdisk(8)> manpage."
15712 #: ../src/guestfs-actions.pod:6140 ../fish/guestfish-actions.pod:4157
15714 "To create a single partition occupying the whole disk, you would pass "
15715 "C<lines> as a single element list, when the single element being the string "
15720 #: ../src/guestfs-actions.pod:6144
15721 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
15725 #: ../src/guestfs-actions.pod:6154
15726 msgid "guestfs_sfdiskM"
15730 #: ../src/guestfs-actions.pod:6156
15734 " guestfs_sfdiskM (guestfs_h *g,\n"
15735 " const char *device,\n"
15736 " char *const *lines);\n"
15741 #: ../src/guestfs-actions.pod:6161
15743 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
15744 "partition sizes are specified in megabytes only (rounded to the nearest "
15745 "cylinder) and you don't need to specify the cyls, heads and sectors "
15746 "parameters which were rarely if ever used anyway."
15750 #: ../src/guestfs-actions.pod:6167
15752 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
15753 "C<guestfs_part_disk>"
15757 #: ../src/guestfs-actions.pod:6177
15758 msgid "guestfs_sfdisk_N"
15762 #: ../src/guestfs-actions.pod:6179
15766 " guestfs_sfdisk_N (guestfs_h *g,\n"
15767 " const char *device,\n"
15772 " const char *line);\n"
15777 #: ../src/guestfs-actions.pod:6188 ../fish/guestfish-actions.pod:4187
15779 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15780 "(note: C<n> counts from 1)."
15784 #: ../src/guestfs-actions.pod:6191
15786 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
15787 "for the cyls/heads/sectors parameters."
15791 #: ../src/guestfs-actions.pod:6194
15792 msgid "See also: C<guestfs_part_add>"
15796 #: ../src/guestfs-actions.pod:6203
15797 msgid "guestfs_sfdisk_disk_geometry"
15801 #: ../src/guestfs-actions.pod:6205
15805 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
15806 " const char *device);\n"
15811 #: ../src/guestfs-actions.pod:6209
15813 "This displays the disk geometry of C<device> read from the partition table. "
15814 "Especially in the case where the underlying block device has been resized, "
15815 "this can be different from the kernel's idea of the geometry (see "
15816 "C<guestfs_sfdisk_kernel_geometry>)."
15820 #: ../src/guestfs-actions.pod:6214 ../src/guestfs-actions.pod:6230 ../fish/guestfish-actions.pod:4207 ../fish/guestfish-actions.pod:4216
15821 msgid "The result is in human-readable format, and not designed to be parsed."
15825 #: ../src/guestfs-actions.pod:6222
15826 msgid "guestfs_sfdisk_kernel_geometry"
15830 #: ../src/guestfs-actions.pod:6224
15834 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
15835 " const char *device);\n"
15840 #: ../src/guestfs-actions.pod:6228 ../fish/guestfish-actions.pod:4214
15841 msgid "This displays the kernel's idea of the geometry of C<device>."
15845 #: ../src/guestfs-actions.pod:6238
15846 msgid "guestfs_sfdisk_l"
15850 #: ../src/guestfs-actions.pod:6240
15854 " guestfs_sfdisk_l (guestfs_h *g,\n"
15855 " const char *device);\n"
15860 #: ../src/guestfs-actions.pod:6244 ../fish/guestfish-actions.pod:4223
15862 "This displays the partition table on C<device>, in the human-readable output "
15863 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15867 #: ../src/guestfs-actions.pod:6248
15868 msgid "See also: C<guestfs_part_list>"
15872 #: ../src/guestfs-actions.pod:6255
15877 #: ../src/guestfs-actions.pod:6257
15881 " guestfs_sh (guestfs_h *g,\n"
15882 " const char *command);\n"
15887 #: ../src/guestfs-actions.pod:6261 ../fish/guestfish-actions.pod:4233
15889 "This call runs a command from the guest filesystem via the guest's "
15894 #: ../src/guestfs-actions.pod:6264
15895 msgid "This is like C<guestfs_command>, but passes the command to:"
15899 #: ../src/guestfs-actions.pod:6266 ../fish/guestfish-actions.pod:4238
15902 " /bin/sh -c \"command\"\n"
15907 #: ../src/guestfs-actions.pod:6268 ../fish/guestfish-actions.pod:4240
15909 "Depending on the guest's shell, this usually results in wildcards being "
15910 "expanded, shell expressions being interpolated and so on."
15914 #: ../src/guestfs-actions.pod:6272
15915 msgid "All the provisos about C<guestfs_command> apply to this call."
15919 #: ../src/guestfs-actions.pod:6279
15920 msgid "guestfs_sh_lines"
15924 #: ../src/guestfs-actions.pod:6281
15928 " guestfs_sh_lines (guestfs_h *g,\n"
15929 " const char *command);\n"
15934 #: ../src/guestfs-actions.pod:6285
15936 "This is the same as C<guestfs_sh>, but splits the result into a list of "
15941 #: ../src/guestfs-actions.pod:6288
15942 msgid "See also: C<guestfs_command_lines>"
15946 #: ../src/guestfs-actions.pod:6296
15947 msgid "guestfs_sleep"
15951 #: ../src/guestfs-actions.pod:6298
15955 " guestfs_sleep (guestfs_h *g,\n"
15961 #: ../src/guestfs-actions.pod:6302 ../fish/guestfish-actions.pod:4259
15962 msgid "Sleep for C<secs> seconds."
15966 #: ../src/guestfs-actions.pod:6306
15967 msgid "(Added in 1.0.41)"
15971 #: ../src/guestfs-actions.pod:6308 ../src/guestfs-structs.pod:109
15972 msgid "guestfs_stat"
15976 #: ../src/guestfs-actions.pod:6310
15979 " struct guestfs_stat *\n"
15980 " guestfs_stat (guestfs_h *g,\n"
15981 " const char *path);\n"
15986 #: ../src/guestfs-actions.pod:6316 ../fish/guestfish-actions.pod:4267
15987 msgid "This is the same as the C<stat(2)> system call."
15991 #: ../src/guestfs-actions.pod:6324 ../src/guestfs-structs.pod:135
15992 msgid "guestfs_statvfs"
15996 #: ../src/guestfs-actions.pod:6326
15999 " struct guestfs_statvfs *\n"
16000 " guestfs_statvfs (guestfs_h *g,\n"
16001 " const char *path);\n"
16006 #: ../src/guestfs-actions.pod:6330 ../fish/guestfish-actions.pod:4273
16008 "Returns file system statistics for any mounted file system. C<path> should "
16009 "be a file or directory in the mounted file system (typically it is the mount "
16010 "point itself, but it doesn't need to be)."
16014 #: ../src/guestfs-actions.pod:6334 ../fish/guestfish-actions.pod:4277
16015 msgid "This is the same as the C<statvfs(2)> system call."
16019 #: ../src/guestfs-actions.pod:6336
16021 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
16022 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
16026 #: ../src/guestfs-actions.pod:6342
16027 msgid "guestfs_strings"
16031 #: ../src/guestfs-actions.pod:6344
16035 " guestfs_strings (guestfs_h *g,\n"
16036 " const char *path);\n"
16041 #: ../src/guestfs-actions.pod:6348 ../fish/guestfish-actions.pod:4283
16043 "This runs the L<strings(1)> command on a file and returns the list of "
16044 "printable strings found."
16048 #: ../src/guestfs-actions.pod:6360
16049 msgid "guestfs_strings_e"
16053 #: ../src/guestfs-actions.pod:6362
16057 " guestfs_strings_e (guestfs_h *g,\n"
16058 " const char *encoding,\n"
16059 " const char *path);\n"
16064 #: ../src/guestfs-actions.pod:6367
16066 "This is like the C<guestfs_strings> command, but allows you to specify the "
16067 "encoding of strings that are looked for in the source file C<path>."
16071 #: ../src/guestfs-actions.pod:6371 ../fish/guestfish-actions.pod:4297
16072 msgid "Allowed encodings are:"
16076 #: ../src/guestfs-actions.pod:6375 ../fish/guestfish-actions.pod:4301
16081 #: ../src/guestfs-actions.pod:6377
16083 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
16084 "ISO-8859-X (this is what C<guestfs_strings> uses)."
16088 #: ../src/guestfs-actions.pod:6380 ../fish/guestfish-actions.pod:4306
16093 #: ../src/guestfs-actions.pod:6382 ../fish/guestfish-actions.pod:4308
16094 msgid "Single 8-bit-byte characters."
16098 #: ../src/guestfs-actions.pod:6384 ../fish/guestfish-actions.pod:4310
16103 #: ../src/guestfs-actions.pod:6386 ../fish/guestfish-actions.pod:4312
16104 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
16108 #: ../src/guestfs-actions.pod:6389 ../fish/guestfish-actions.pod:4315
16109 msgid "l (lower case letter L)"
16113 #: ../src/guestfs-actions.pod:6391 ../fish/guestfish-actions.pod:4317
16115 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
16116 "examining binaries in Windows guests."
16120 #: ../src/guestfs-actions.pod:6394 ../fish/guestfish-actions.pod:4320
16125 #: ../src/guestfs-actions.pod:6396 ../fish/guestfish-actions.pod:4322
16126 msgid "32-bit big endian such as UCS-4BE."
16130 #: ../src/guestfs-actions.pod:6398 ../fish/guestfish-actions.pod:4324
16135 #: ../src/guestfs-actions.pod:6400 ../fish/guestfish-actions.pod:4326
16136 msgid "32-bit little endian such as UCS-4LE."
16140 #: ../src/guestfs-actions.pod:6404 ../fish/guestfish-actions.pod:4330
16141 msgid "The returned strings are transcoded to UTF-8."
16145 #: ../src/guestfs-actions.pod:6415
16146 msgid "guestfs_swapoff_device"
16150 #: ../src/guestfs-actions.pod:6417
16154 " guestfs_swapoff_device (guestfs_h *g,\n"
16155 " const char *device);\n"
16160 #: ../src/guestfs-actions.pod:6421
16162 "This command disables the libguestfs appliance swap device or partition "
16163 "named C<device>. See C<guestfs_swapon_device>."
16167 #: ../src/guestfs-actions.pod:6429
16168 msgid "guestfs_swapoff_file"
16172 #: ../src/guestfs-actions.pod:6431
16176 " guestfs_swapoff_file (guestfs_h *g,\n"
16177 " const char *file);\n"
16182 #: ../src/guestfs-actions.pod:6435 ../fish/guestfish-actions.pod:4347
16183 msgid "This command disables the libguestfs appliance swap on file."
16187 #: ../src/guestfs-actions.pod:6441
16188 msgid "guestfs_swapoff_label"
16192 #: ../src/guestfs-actions.pod:6443
16196 " guestfs_swapoff_label (guestfs_h *g,\n"
16197 " const char *label);\n"
16202 #: ../src/guestfs-actions.pod:6447 ../fish/guestfish-actions.pod:4353
16204 "This command disables the libguestfs appliance swap on labeled swap "
16209 #: ../src/guestfs-actions.pod:6454
16210 msgid "guestfs_swapoff_uuid"
16214 #: ../src/guestfs-actions.pod:6456
16218 " guestfs_swapoff_uuid (guestfs_h *g,\n"
16219 " const char *uuid);\n"
16224 #: ../src/guestfs-actions.pod:6460 ../fish/guestfish-actions.pod:4360
16226 "This command disables the libguestfs appliance swap partition with the given "
16231 #: ../src/guestfs-actions.pod:6467
16232 msgid "guestfs_swapon_device"
16236 #: ../src/guestfs-actions.pod:6469
16240 " guestfs_swapon_device (guestfs_h *g,\n"
16241 " const char *device);\n"
16246 #: ../src/guestfs-actions.pod:6473
16248 "This command enables the libguestfs appliance to use the swap device or "
16249 "partition named C<device>. The increased memory is made available for all "
16250 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
16254 #: ../src/guestfs-actions.pod:6478 ../fish/guestfish-actions.pod:4372
16256 "Note that you should not swap to existing guest swap partitions unless you "
16257 "know what you are doing. They may contain hibernation information, or other "
16258 "information that the guest doesn't want you to trash. You also risk leaking "
16259 "information about the host to the guest this way. Instead, attach a new "
16260 "host device to the guest and swap on that."
16264 #: ../src/guestfs-actions.pod:6489
16265 msgid "guestfs_swapon_file"
16269 #: ../src/guestfs-actions.pod:6491
16273 " guestfs_swapon_file (guestfs_h *g,\n"
16274 " const char *file);\n"
16279 #: ../src/guestfs-actions.pod:6495
16281 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
16286 #: ../src/guestfs-actions.pod:6502
16287 msgid "guestfs_swapon_label"
16291 #: ../src/guestfs-actions.pod:6504
16295 " guestfs_swapon_label (guestfs_h *g,\n"
16296 " const char *label);\n"
16301 #: ../src/guestfs-actions.pod:6508
16303 "This command enables swap to a labeled swap partition. See "
16304 "C<guestfs_swapon_device> for other notes."
16308 #: ../src/guestfs-actions.pod:6515
16309 msgid "guestfs_swapon_uuid"
16313 #: ../src/guestfs-actions.pod:6517
16317 " guestfs_swapon_uuid (guestfs_h *g,\n"
16318 " const char *uuid);\n"
16323 #: ../src/guestfs-actions.pod:6521
16325 "This command enables swap to a swap partition with the given UUID. See "
16326 "C<guestfs_swapon_device> for other notes."
16330 #: ../src/guestfs-actions.pod:6528
16331 msgid "guestfs_sync"
16335 #: ../src/guestfs-actions.pod:6530
16339 " guestfs_sync (guestfs_h *g);\n"
16344 #: ../src/guestfs-actions.pod:6533 ../fish/guestfish-actions.pod:4404
16346 "This syncs the disk, so that any writes are flushed through to the "
16347 "underlying disk image."
16351 #: ../src/guestfs-actions.pod:6536 ../fish/guestfish-actions.pod:4407
16353 "You should always call this if you have modified a disk image, before "
16354 "closing the handle."
16358 #: ../src/guestfs-actions.pod:6543
16359 msgid "guestfs_tail"
16363 #: ../src/guestfs-actions.pod:6545
16367 " guestfs_tail (guestfs_h *g,\n"
16368 " const char *path);\n"
16373 #: ../src/guestfs-actions.pod:6549 ../fish/guestfish-actions.pod:4414
16374 msgid "This command returns up to the last 10 lines of a file as a list of strings."
16378 #: ../src/guestfs-actions.pod:6561
16379 msgid "guestfs_tail_n"
16383 #: ../src/guestfs-actions.pod:6563
16387 " guestfs_tail_n (guestfs_h *g,\n"
16389 " const char *path);\n"
16394 #: ../src/guestfs-actions.pod:6568 ../fish/guestfish-actions.pod:4424
16396 "If the parameter C<nrlines> is a positive number, this returns the last "
16397 "C<nrlines> lines of the file C<path>."
16401 #: ../src/guestfs-actions.pod:6571 ../fish/guestfish-actions.pod:4427
16403 "If the parameter C<nrlines> is a negative number, this returns lines from "
16404 "the file C<path>, starting with the C<-nrlines>th line."
16408 #: ../src/guestfs-actions.pod:6585
16409 msgid "guestfs_tar_in"
16413 #: ../src/guestfs-actions.pod:6587
16417 " guestfs_tar_in (guestfs_h *g,\n"
16418 " const char *tarfile,\n"
16419 " const char *directory);\n"
16424 #: ../src/guestfs-actions.pod:6592 ../fish/guestfish-actions.pod:4439
16426 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16427 "tar file) into C<directory>."
16431 #: ../src/guestfs-actions.pod:6595
16432 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
16436 #: ../src/guestfs-actions.pod:6600 ../src/guestfs-actions.pod:6617 ../src/guestfs-actions.pod:6633 ../src/guestfs-actions.pod:6649
16437 msgid "(Added in 1.0.3)"
16441 #: ../src/guestfs-actions.pod:6602
16442 msgid "guestfs_tar_out"
16446 #: ../src/guestfs-actions.pod:6604
16450 " guestfs_tar_out (guestfs_h *g,\n"
16451 " const char *directory,\n"
16452 " const char *tarfile);\n"
16457 #: ../src/guestfs-actions.pod:6609 ../fish/guestfish-actions.pod:4451
16459 "This command packs the contents of C<directory> and downloads it to local "
16464 #: ../src/guestfs-actions.pod:6612
16466 "To download a compressed tarball, use C<guestfs_tgz_out> or "
16467 "C<guestfs_txz_out>."
16471 #: ../src/guestfs-actions.pod:6619
16472 msgid "guestfs_tgz_in"
16476 #: ../src/guestfs-actions.pod:6621
16480 " guestfs_tgz_in (guestfs_h *g,\n"
16481 " const char *tarball,\n"
16482 " const char *directory);\n"
16487 #: ../src/guestfs-actions.pod:6626 ../fish/guestfish-actions.pod:4463
16489 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16490 "tar file) into C<directory>."
16494 #: ../src/guestfs-actions.pod:6629
16495 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
16499 #: ../src/guestfs-actions.pod:6635
16500 msgid "guestfs_tgz_out"
16504 #: ../src/guestfs-actions.pod:6637
16508 " guestfs_tgz_out (guestfs_h *g,\n"
16509 " const char *directory,\n"
16510 " const char *tarball);\n"
16515 #: ../src/guestfs-actions.pod:6642 ../fish/guestfish-actions.pod:4474
16517 "This command packs the contents of C<directory> and downloads it to local "
16522 #: ../src/guestfs-actions.pod:6645
16523 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
16527 #: ../src/guestfs-actions.pod:6651
16528 msgid "guestfs_touch"
16532 #: ../src/guestfs-actions.pod:6653
16536 " guestfs_touch (guestfs_h *g,\n"
16537 " const char *path);\n"
16542 #: ../src/guestfs-actions.pod:6657 ../fish/guestfish-actions.pod:4485
16544 "Touch acts like the L<touch(1)> command. It can be used to update the "
16545 "timestamps on a file, or, if the file does not exist, to create a new "
16546 "zero-length file."
16550 #: ../src/guestfs-actions.pod:6661 ../fish/guestfish-actions.pod:4489
16552 "This command only works on regular files, and will fail on other file types "
16553 "such as directories, symbolic links, block special etc."
16557 #: ../src/guestfs-actions.pod:6668
16558 msgid "guestfs_truncate"
16562 #: ../src/guestfs-actions.pod:6670
16566 " guestfs_truncate (guestfs_h *g,\n"
16567 " const char *path);\n"
16572 #: ../src/guestfs-actions.pod:6674 ../fish/guestfish-actions.pod:4496
16574 "This command truncates C<path> to a zero-length file. The file must exist "
16579 #: ../src/guestfs-actions.pod:6681
16580 msgid "guestfs_truncate_size"
16584 #: ../src/guestfs-actions.pod:6683
16588 " guestfs_truncate_size (guestfs_h *g,\n"
16589 " const char *path,\n"
16590 " int64_t size);\n"
16595 #: ../src/guestfs-actions.pod:6688 ../fish/guestfish-actions.pod:4503
16597 "This command truncates C<path> to size C<size> bytes. The file must exist "
16602 #: ../src/guestfs-actions.pod:6691
16604 "If the current file size is less than C<size> then the file is extended to "
16605 "the required size with zero bytes. This creates a sparse file (ie. disk "
16606 "blocks are not allocated for the file until you write to it). To create a "
16607 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
16611 #: ../src/guestfs-actions.pod:6701
16612 msgid "guestfs_tune2fs_l"
16616 #: ../src/guestfs-actions.pod:6703
16620 " guestfs_tune2fs_l (guestfs_h *g,\n"
16621 " const char *device);\n"
16626 #: ../src/guestfs-actions.pod:6707 ../fish/guestfish-actions.pod:4516
16628 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16633 #: ../src/guestfs-actions.pod:6710 ../fish/guestfish-actions.pod:4519
16635 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16636 "for more details. The list of fields returned isn't clearly defined, and "
16637 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16638 "and the filesystem itself."
16642 #: ../src/guestfs-actions.pod:6723
16643 msgid "guestfs_txz_in"
16647 #: ../src/guestfs-actions.pod:6725
16651 " guestfs_txz_in (guestfs_h *g,\n"
16652 " const char *tarball,\n"
16653 " const char *directory);\n"
16658 #: ../src/guestfs-actions.pod:6730 ../fish/guestfish-actions.pod:4528
16660 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
16661 "tar file) into C<directory>."
16665 #: ../src/guestfs-actions.pod:6737
16666 msgid "guestfs_txz_out"
16670 #: ../src/guestfs-actions.pod:6739
16674 " guestfs_txz_out (guestfs_h *g,\n"
16675 " const char *directory,\n"
16676 " const char *tarball);\n"
16681 #: ../src/guestfs-actions.pod:6744 ../fish/guestfish-actions.pod:4537
16683 "This command packs the contents of C<directory> and downloads it to local "
16684 "file C<tarball> (as an xz compressed tar archive)."
16688 #: ../src/guestfs-actions.pod:6751
16689 msgid "guestfs_umask"
16693 #: ../src/guestfs-actions.pod:6753
16697 " guestfs_umask (guestfs_h *g,\n"
16703 #: ../src/guestfs-actions.pod:6757 ../fish/guestfish-actions.pod:4546
16705 "This function sets the mask used for creating new files and device nodes to "
16710 #: ../src/guestfs-actions.pod:6760 ../fish/guestfish-actions.pod:4549
16712 "Typical umask values would be C<022> which creates new files with "
16713 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
16714 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
16718 #: ../src/guestfs-actions.pod:6765 ../fish/guestfish-actions.pod:4554
16720 "The default umask is C<022>. This is important because it means that "
16721 "directories and device nodes will be created with C<0644> or C<0755> mode "
16722 "even if you specify C<0777>."
16726 #: ../src/guestfs-actions.pod:6769
16728 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
16729 "C<guestfs_mkdir>."
16733 #: ../src/guestfs-actions.pod:6772 ../fish/guestfish-actions.pod:4561
16734 msgid "This call returns the previous umask."
16738 #: ../src/guestfs-actions.pod:6778
16739 msgid "guestfs_umount"
16743 #: ../src/guestfs-actions.pod:6780
16747 " guestfs_umount (guestfs_h *g,\n"
16748 " const char *pathordevice);\n"
16753 #: ../src/guestfs-actions.pod:6784 ../fish/guestfish-actions.pod:4569
16755 "This unmounts the given filesystem. The filesystem may be specified either "
16756 "by its mountpoint (path) or the device which contains the filesystem."
16760 #: ../src/guestfs-actions.pod:6792
16761 msgid "guestfs_umount_all"
16765 #: ../src/guestfs-actions.pod:6794
16769 " guestfs_umount_all (guestfs_h *g);\n"
16774 #: ../src/guestfs-actions.pod:6797 ../fish/guestfish-actions.pod:4579
16775 msgid "This unmounts all mounted filesystems."
16779 #: ../src/guestfs-actions.pod:6799 ../fish/guestfish-actions.pod:4581
16780 msgid "Some internal mounts are not unmounted by this call."
16784 #: ../src/guestfs-actions.pod:6805
16785 msgid "guestfs_upload"
16789 #: ../src/guestfs-actions.pod:6807
16793 " guestfs_upload (guestfs_h *g,\n"
16794 " const char *filename,\n"
16795 " const char *remotefilename);\n"
16800 #: ../src/guestfs-actions.pod:6812 ../src/guestfs-actions.pod:6836 ../fish/guestfish-actions.pod:4587 ../fish/guestfish-actions.pod:4600
16801 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
16805 #: ../src/guestfs-actions.pod:6817
16806 msgid "See also C<guestfs_download>."
16810 #: ../src/guestfs-actions.pod:6828
16811 msgid "guestfs_upload_offset"
16815 #: ../src/guestfs-actions.pod:6830
16819 " guestfs_upload_offset (guestfs_h *g,\n"
16820 " const char *filename,\n"
16821 " const char *remotefilename,\n"
16822 " int64_t offset);\n"
16827 #: ../src/guestfs-actions.pod:6839 ../fish/guestfish-actions.pod:4603
16829 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
16830 "The intention is to overwrite parts of existing files or devices, although "
16831 "if a non-existant file is specified then it is created with a \"hole\" "
16832 "before C<offset>. The size of the data written is implicit in the size of "
16833 "the source C<filename>."
16837 #: ../src/guestfs-actions.pod:6846
16839 "Note that there is no limit on the amount of data that can be uploaded with "
16840 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
16841 "full amount unless an error occurs."
16845 #: ../src/guestfs-actions.pod:6851
16846 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
16850 #: ../src/guestfs-actions.pod:6862
16851 msgid "guestfs_utimens"
16855 #: ../src/guestfs-actions.pod:6864
16859 " guestfs_utimens (guestfs_h *g,\n"
16860 " const char *path,\n"
16861 " int64_t atsecs,\n"
16862 " int64_t atnsecs,\n"
16863 " int64_t mtsecs,\n"
16864 " int64_t mtnsecs);\n"
16869 #: ../src/guestfs-actions.pod:6872 ../fish/guestfish-actions.pod:4623
16870 msgid "This command sets the timestamps of a file with nanosecond precision."
16874 #: ../src/guestfs-actions.pod:6875 ../fish/guestfish-actions.pod:4626
16876 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
16881 #: ../src/guestfs-actions.pod:6878 ../fish/guestfish-actions.pod:4629
16883 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16884 "nanoseconds from the epoch."
16888 #: ../src/guestfs-actions.pod:6881 ../fish/guestfish-actions.pod:4632
16890 "If the C<*nsecs> field contains the special value C<-1> then the "
16891 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16892 "ignored in this case)."
16896 #: ../src/guestfs-actions.pod:6885 ../fish/guestfish-actions.pod:4636
16898 "If the C<*nsecs> field contains the special value C<-2> then the "
16899 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16904 #: ../src/guestfs-actions.pod:6893 ../src/guestfs-structs.pod:175
16905 msgid "guestfs_version"
16909 #: ../src/guestfs-actions.pod:6895
16912 " struct guestfs_version *\n"
16913 " guestfs_version (guestfs_h *g);\n"
16918 #: ../src/guestfs-actions.pod:6898 ../fish/guestfish-actions.pod:4644
16919 msgid "Return the libguestfs version number that the program is linked against."
16923 #: ../src/guestfs-actions.pod:6901 ../fish/guestfish-actions.pod:4647
16925 "Note that because of dynamic linking this is not necessarily the version of "
16926 "libguestfs that you compiled against. You can compile the program, and then "
16927 "at runtime dynamically link against a completely different C<libguestfs.so> "
16932 #: ../src/guestfs-actions.pod:6906 ../fish/guestfish-actions.pod:4652
16934 "This call was added in version C<1.0.58>. In previous versions of "
16935 "libguestfs there was no way to get the version number. From C code you can "
16936 "use dynamic linker functions to find out if this symbol exists (if it "
16937 "doesn't, then it's an earlier version)."
16941 #: ../src/guestfs-actions.pod:6912 ../fish/guestfish-actions.pod:4658
16943 "The call returns a structure with four elements. The first three (C<major>, "
16944 "C<minor> and C<release>) are numbers and correspond to the usual version "
16945 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16946 "but may be used for distro-specific information."
16950 #: ../src/guestfs-actions.pod:6918 ../fish/guestfish-actions.pod:4664
16951 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
16955 #: ../src/guestfs-actions.pod:6921 ../fish/guestfish-actions.pod:4667
16956 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16960 #: ../src/guestfs-actions.pod:6923
16962 "I<Note:> Don't use this call to test for availability of features. In "
16963 "enterprise distributions we backport features from later versions into "
16964 "earlier versions, making this an unreliable way to test for features. Use "
16965 "C<guestfs_available> instead."
16969 #: ../src/guestfs-actions.pod:6929
16971 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
16972 "error. I<The caller must call C<guestfs_free_version> after use>."
16976 #: ../src/guestfs-actions.pod:6933
16977 msgid "(Added in 1.0.58)"
16981 #: ../src/guestfs-actions.pod:6935
16982 msgid "guestfs_vfs_label"
16986 #: ../src/guestfs-actions.pod:6937
16990 " guestfs_vfs_label (guestfs_h *g,\n"
16991 " const char *device);\n"
16996 #: ../src/guestfs-actions.pod:6941 ../fish/guestfish-actions.pod:4679
16997 msgid "This returns the filesystem label of the filesystem on C<device>."
17001 #: ../src/guestfs-actions.pod:6944 ../fish/guestfish-actions.pod:4682
17002 msgid "If the filesystem is unlabeled, this returns the empty string."
17006 #: ../src/guestfs-actions.pod:6946
17007 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
17011 #: ../src/guestfs-actions.pod:6951 ../src/guestfs-actions.pod:6988
17012 msgid "(Added in 1.3.18)"
17016 #: ../src/guestfs-actions.pod:6953
17017 msgid "guestfs_vfs_type"
17021 #: ../src/guestfs-actions.pod:6955
17025 " guestfs_vfs_type (guestfs_h *g,\n"
17026 " const char *device);\n"
17031 #: ../src/guestfs-actions.pod:6959 ../fish/guestfish-actions.pod:4690
17033 "This command gets the filesystem type corresponding to the filesystem on "
17038 #: ../src/guestfs-actions.pod:6962 ../fish/guestfish-actions.pod:4693
17040 "For most filesystems, the result is the name of the Linux VFS module which "
17041 "would be used to mount this filesystem if you mounted it without specifying "
17042 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
17046 #: ../src/guestfs-actions.pod:6972
17047 msgid "guestfs_vfs_uuid"
17051 #: ../src/guestfs-actions.pod:6974
17055 " guestfs_vfs_uuid (guestfs_h *g,\n"
17056 " const char *device);\n"
17061 #: ../src/guestfs-actions.pod:6978 ../fish/guestfish-actions.pod:4702
17062 msgid "This returns the filesystem UUID of the filesystem on C<device>."
17066 #: ../src/guestfs-actions.pod:6981 ../fish/guestfish-actions.pod:4705
17067 msgid "If the filesystem does not have a UUID, this returns the empty string."
17071 #: ../src/guestfs-actions.pod:6983
17072 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
17076 #: ../src/guestfs-actions.pod:6990
17077 msgid "guestfs_vg_activate"
17081 #: ../src/guestfs-actions.pod:6992
17085 " guestfs_vg_activate (guestfs_h *g,\n"
17087 " char *const *volgroups);\n"
17092 #: ../src/guestfs-actions.pod:6997 ../fish/guestfish-actions.pod:4713
17094 "This command activates or (if C<activate> is false) deactivates all logical "
17095 "volumes in the listed volume groups C<volgroups>. If activated, then they "
17096 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
17097 "deactivated, then those devices disappear."
17101 #: ../src/guestfs-actions.pod:7003 ../fish/guestfish-actions.pod:4719
17102 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
17106 #: ../src/guestfs-actions.pod:7005 ../fish/guestfish-actions.pod:4721
17108 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
17109 "activated or deactivated."
17113 #: ../src/guestfs-actions.pod:7012
17114 msgid "guestfs_vg_activate_all"
17118 #: ../src/guestfs-actions.pod:7014
17122 " guestfs_vg_activate_all (guestfs_h *g,\n"
17123 " int activate);\n"
17128 #: ../src/guestfs-actions.pod:7018 ../fish/guestfish-actions.pod:4728
17130 "This command activates or (if C<activate> is false) deactivates all logical "
17131 "volumes in all volume groups. If activated, then they are made known to the "
17132 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
17133 "those devices disappear."
17137 #: ../src/guestfs-actions.pod:7024 ../fish/guestfish-actions.pod:4734
17138 msgid "This command is the same as running C<vgchange -a y|n>"
17142 #: ../src/guestfs-actions.pod:7030
17143 msgid "guestfs_vgcreate"
17147 #: ../src/guestfs-actions.pod:7032
17151 " guestfs_vgcreate (guestfs_h *g,\n"
17152 " const char *volgroup,\n"
17153 " char *const *physvols);\n"
17158 #: ../src/guestfs-actions.pod:7037 ../fish/guestfish-actions.pod:4740
17160 "This creates an LVM volume group called C<volgroup> from the non-empty list "
17161 "of physical volumes C<physvols>."
17165 #: ../src/guestfs-actions.pod:7044
17166 msgid "guestfs_vglvuuids"
17170 #: ../src/guestfs-actions.pod:7046
17174 " guestfs_vglvuuids (guestfs_h *g,\n"
17175 " const char *vgname);\n"
17180 #: ../src/guestfs-actions.pod:7050 ../fish/guestfish-actions.pod:4747
17182 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
17183 "volumes created in this volume group."
17187 #: ../src/guestfs-actions.pod:7053
17189 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
17190 "associate logical volumes and volume groups."
17194 #: ../src/guestfs-actions.pod:7056
17195 msgid "See also C<guestfs_vgpvuuids>."
17199 #: ../src/guestfs-actions.pod:7064
17200 msgid "guestfs_vgpvuuids"
17204 #: ../src/guestfs-actions.pod:7066
17208 " guestfs_vgpvuuids (guestfs_h *g,\n"
17209 " const char *vgname);\n"
17214 #: ../src/guestfs-actions.pod:7070 ../fish/guestfish-actions.pod:4759
17216 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
17217 "volumes that this volume group resides on."
17221 #: ../src/guestfs-actions.pod:7073
17223 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
17224 "associate physical volumes and volume groups."
17228 #: ../src/guestfs-actions.pod:7076
17229 msgid "See also C<guestfs_vglvuuids>."
17233 #: ../src/guestfs-actions.pod:7084
17234 msgid "guestfs_vgremove"
17238 #: ../src/guestfs-actions.pod:7086
17242 " guestfs_vgremove (guestfs_h *g,\n"
17243 " const char *vgname);\n"
17248 #: ../src/guestfs-actions.pod:7090 ../fish/guestfish-actions.pod:4771
17249 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
17253 #: ../src/guestfs-actions.pod:7092 ../fish/guestfish-actions.pod:4773
17254 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
17258 #: ../src/guestfs-actions.pod:7099
17259 msgid "guestfs_vgrename"
17263 #: ../src/guestfs-actions.pod:7101
17267 " guestfs_vgrename (guestfs_h *g,\n"
17268 " const char *volgroup,\n"
17269 " const char *newvolgroup);\n"
17274 #: ../src/guestfs-actions.pod:7106 ../fish/guestfish-actions.pod:4780
17275 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
17279 #: ../src/guestfs-actions.pod:7112
17280 msgid "guestfs_vgs"
17284 #: ../src/guestfs-actions.pod:7114
17288 " guestfs_vgs (guestfs_h *g);\n"
17293 #: ../src/guestfs-actions.pod:7117 ../fish/guestfish-actions.pod:4786
17295 "List all the volumes groups detected. This is the equivalent of the "
17296 "L<vgs(8)> command."
17300 #: ../src/guestfs-actions.pod:7120 ../fish/guestfish-actions.pod:4789
17302 "This returns a list of just the volume group names that were detected "
17303 "(eg. C<VolGroup00>)."
17307 #: ../src/guestfs-actions.pod:7123
17308 msgid "See also C<guestfs_vgs_full>."
17312 #: ../src/guestfs-actions.pod:7131
17313 msgid "guestfs_vgs_full"
17317 #: ../src/guestfs-actions.pod:7133
17320 " struct guestfs_lvm_vg_list *\n"
17321 " guestfs_vgs_full (guestfs_h *g);\n"
17326 #: ../src/guestfs-actions.pod:7136 ../fish/guestfish-actions.pod:4798
17328 "List all the volumes groups detected. This is the equivalent of the "
17329 "L<vgs(8)> command. The \"full\" version includes all fields."
17333 #: ../src/guestfs-actions.pod:7139
17335 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
17336 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
17341 #: ../src/guestfs-actions.pod:7145
17342 msgid "guestfs_vgscan"
17346 #: ../src/guestfs-actions.pod:7147
17350 " guestfs_vgscan (guestfs_h *g);\n"
17355 #: ../src/guestfs-actions.pod:7150 ../fish/guestfish-actions.pod:4805
17357 "This rescans all block devices and rebuilds the list of LVM physical "
17358 "volumes, volume groups and logical volumes."
17362 #: ../src/guestfs-actions.pod:7157
17363 msgid "guestfs_vguuid"
17367 #: ../src/guestfs-actions.pod:7159
17371 " guestfs_vguuid (guestfs_h *g,\n"
17372 " const char *vgname);\n"
17377 #: ../src/guestfs-actions.pod:7163 ../fish/guestfish-actions.pod:4812
17378 msgid "This command returns the UUID of the LVM VG named C<vgname>."
17382 #: ../src/guestfs-actions.pod:7170
17383 msgid "guestfs_wait_ready"
17387 #: ../src/guestfs-actions.pod:7172
17391 " guestfs_wait_ready (guestfs_h *g);\n"
17396 #: ../src/guestfs-actions.pod:7175
17397 msgid "This function is a no op."
17401 #: ../src/guestfs-actions.pod:7177
17403 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
17404 "calling C<guestfs_launch> to wait for the launch to complete. However this "
17405 "is no longer necessary because C<guestfs_launch> now does the waiting."
17409 #: ../src/guestfs-actions.pod:7182
17411 "If you see any calls to this function in code then you can just remove them, "
17412 "unless you want to retain compatibility with older versions of the API."
17416 #: ../src/guestfs-actions.pod:7190
17417 msgid "guestfs_wc_c"
17421 #: ../src/guestfs-actions.pod:7192
17425 " guestfs_wc_c (guestfs_h *g,\n"
17426 " const char *path);\n"
17431 #: ../src/guestfs-actions.pod:7196 ../fish/guestfish-actions.pod:4818
17433 "This command counts the characters in a file, using the C<wc -c> external "
17438 #: ../src/guestfs-actions.pod:7203
17439 msgid "guestfs_wc_l"
17443 #: ../src/guestfs-actions.pod:7205
17447 " guestfs_wc_l (guestfs_h *g,\n"
17448 " const char *path);\n"
17453 #: ../src/guestfs-actions.pod:7209 ../fish/guestfish-actions.pod:4825
17455 "This command counts the lines in a file, using the C<wc -l> external "
17460 #: ../src/guestfs-actions.pod:7216
17461 msgid "guestfs_wc_w"
17465 #: ../src/guestfs-actions.pod:7218
17469 " guestfs_wc_w (guestfs_h *g,\n"
17470 " const char *path);\n"
17475 #: ../src/guestfs-actions.pod:7222 ../fish/guestfish-actions.pod:4832
17477 "This command counts the words in a file, using the C<wc -w> external "
17482 #: ../src/guestfs-actions.pod:7229
17483 msgid "guestfs_write"
17487 #: ../src/guestfs-actions.pod:7231
17491 " guestfs_write (guestfs_h *g,\n"
17492 " const char *path,\n"
17493 " const char *content,\n"
17494 " size_t content_size);\n"
17499 #: ../src/guestfs-actions.pod:7237 ../fish/guestfish-actions.pod:4839
17501 "This call creates a file called C<path>. The content of the file is the "
17502 "string C<content> (which can contain any 8 bit data)."
17506 #: ../src/guestfs-actions.pod:7247
17507 msgid "guestfs_write_file"
17511 #: ../src/guestfs-actions.pod:7249
17515 " guestfs_write_file (guestfs_h *g,\n"
17516 " const char *path,\n"
17517 " const char *content,\n"
17523 #: ../src/guestfs-actions.pod:7255 ../fish/guestfish-actions.pod:4849
17525 "This call creates a file called C<path>. The contents of the file is the "
17526 "string C<content> (which can contain any 8 bit data), with length C<size>."
17530 #: ../src/guestfs-actions.pod:7259 ../fish/guestfish-actions.pod:4853
17532 "As a special case, if C<size> is C<0> then the length is calculated using "
17533 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17537 #: ../src/guestfs-actions.pod:7263 ../fish/guestfish-actions.pod:4857
17539 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17540 "I<not> work, even if the length is specified."
17544 #: ../src/guestfs-actions.pod:7271 ../fish/guestfish-actions.pod:4863
17545 msgid "This function is deprecated. In new code, use the C<write> call instead."
17549 #: ../src/guestfs-actions.pod:7280
17550 msgid "guestfs_zegrep"
17554 #: ../src/guestfs-actions.pod:7282
17558 " guestfs_zegrep (guestfs_h *g,\n"
17559 " const char *regex,\n"
17560 " const char *path);\n"
17565 #: ../src/guestfs-actions.pod:7287 ../fish/guestfish-actions.pod:4874
17566 msgid "This calls the external C<zegrep> program and returns the matching lines."
17570 #: ../src/guestfs-actions.pod:7299
17571 msgid "guestfs_zegrepi"
17575 #: ../src/guestfs-actions.pod:7301
17579 " guestfs_zegrepi (guestfs_h *g,\n"
17580 " const char *regex,\n"
17581 " const char *path);\n"
17586 #: ../src/guestfs-actions.pod:7306 ../fish/guestfish-actions.pod:4884
17587 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
17591 #: ../src/guestfs-actions.pod:7318
17592 msgid "guestfs_zero"
17596 #: ../src/guestfs-actions.pod:7320
17600 " guestfs_zero (guestfs_h *g,\n"
17601 " const char *device);\n"
17606 #: ../src/guestfs-actions.pod:7324 ../fish/guestfish-actions.pod:4894
17607 msgid "This command writes zeroes over the first few blocks of C<device>."
17611 #: ../src/guestfs-actions.pod:7326 ../fish/guestfish-actions.pod:4896
17613 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17614 "securely wipe the device). It should be sufficient to remove any partition "
17615 "tables, filesystem superblocks and so on."
17619 #: ../src/guestfs-actions.pod:7330
17620 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
17624 #: ../src/guestfs-actions.pod:7341
17625 msgid "guestfs_zero_device"
17629 #: ../src/guestfs-actions.pod:7343
17633 " guestfs_zero_device (guestfs_h *g,\n"
17634 " const char *device);\n"
17639 #: ../src/guestfs-actions.pod:7347
17641 "This command writes zeroes over the entire C<device>. Compare with "
17642 "C<guestfs_zero> which just zeroes the first few blocks of a device."
17646 #: ../src/guestfs-actions.pod:7361
17647 msgid "(Added in 1.3.1)"
17651 #: ../src/guestfs-actions.pod:7363
17652 msgid "guestfs_zerofree"
17656 #: ../src/guestfs-actions.pod:7365
17660 " guestfs_zerofree (guestfs_h *g,\n"
17661 " const char *device);\n"
17666 #: ../src/guestfs-actions.pod:7369 ../fish/guestfish-actions.pod:4917
17668 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17669 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17670 "possible to compress the filesystem more effectively."
17674 #: ../src/guestfs-actions.pod:7374 ../fish/guestfish-actions.pod:4922
17675 msgid "You should B<not> run this program if the filesystem is mounted."
17679 #: ../src/guestfs-actions.pod:7377 ../fish/guestfish-actions.pod:4925
17681 "It is possible that using this program can damage the filesystem or data on "
17686 #: ../src/guestfs-actions.pod:7384
17687 msgid "guestfs_zfgrep"
17691 #: ../src/guestfs-actions.pod:7386
17695 " guestfs_zfgrep (guestfs_h *g,\n"
17696 " const char *pattern,\n"
17697 " const char *path);\n"
17702 #: ../src/guestfs-actions.pod:7391 ../fish/guestfish-actions.pod:4932
17703 msgid "This calls the external C<zfgrep> program and returns the matching lines."
17707 #: ../src/guestfs-actions.pod:7403
17708 msgid "guestfs_zfgrepi"
17712 #: ../src/guestfs-actions.pod:7405
17716 " guestfs_zfgrepi (guestfs_h *g,\n"
17717 " const char *pattern,\n"
17718 " const char *path);\n"
17723 #: ../src/guestfs-actions.pod:7410 ../fish/guestfish-actions.pod:4942
17724 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
17728 #: ../src/guestfs-actions.pod:7422
17729 msgid "guestfs_zfile"
17733 #: ../src/guestfs-actions.pod:7424
17737 " guestfs_zfile (guestfs_h *g,\n"
17738 " const char *meth,\n"
17739 " const char *path);\n"
17744 #: ../src/guestfs-actions.pod:7429 ../fish/guestfish-actions.pod:4952
17745 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
17749 #: ../src/guestfs-actions.pod:7432 ../fish/guestfish-actions.pod:4955
17750 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
17754 #: ../src/guestfs-actions.pod:7434
17756 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
17761 #: ../src/guestfs-actions.pod:7440 ../fish/guestfish-actions.pod:4960
17762 msgid "This function is deprecated. In new code, use the C<file> call instead."
17766 #: ../src/guestfs-actions.pod:7449
17767 msgid "guestfs_zgrep"
17771 #: ../src/guestfs-actions.pod:7451
17775 " guestfs_zgrep (guestfs_h *g,\n"
17776 " const char *regex,\n"
17777 " const char *path);\n"
17782 #: ../src/guestfs-actions.pod:7456 ../fish/guestfish-actions.pod:4971
17783 msgid "This calls the external C<zgrep> program and returns the matching lines."
17787 #: ../src/guestfs-actions.pod:7468
17788 msgid "guestfs_zgrepi"
17792 #: ../src/guestfs-actions.pod:7470
17796 " guestfs_zgrepi (guestfs_h *g,\n"
17797 " const char *regex,\n"
17798 " const char *path);\n"
17803 #: ../src/guestfs-actions.pod:7475 ../fish/guestfish-actions.pod:4981
17804 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
17808 #: ../src/guestfs-availability.pod:3
17813 #: ../src/guestfs-availability.pod:5
17815 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
17816 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
17817 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
17818 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
17819 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
17823 #: ../src/guestfs-availability.pod:21
17828 #: ../src/guestfs-availability.pod:23
17830 "The following functions: L</guestfs_inotify_add_watch> "
17831 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
17832 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
17836 #: ../src/guestfs-availability.pod:31
17837 msgid "B<linuxfsuuid>"
17841 #: ../src/guestfs-availability.pod:33
17843 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
17844 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
17848 #: ../src/guestfs-availability.pod:40
17849 msgid "B<linuxmodules>"
17853 #: ../src/guestfs-availability.pod:42
17854 msgid "The following functions: L</guestfs_modprobe>"
17858 #: ../src/guestfs-availability.pod:45
17859 msgid "B<linuxxattrs>"
17863 #: ../src/guestfs-availability.pod:47
17865 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
17866 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
17867 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
17868 "L</guestfs_setxattr>"
17872 #: ../src/guestfs-availability.pod:58
17877 #: ../src/guestfs-availability.pod:60
17879 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
17880 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
17881 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
17885 #: ../src/guestfs-availability.pod:69
17890 #: ../src/guestfs-availability.pod:71
17892 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
17893 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
17894 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
17895 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
17896 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
17897 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
17898 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
17899 "L</guestfs_vgs_full>"
17903 #: ../src/guestfs-availability.pod:94
17908 #: ../src/guestfs-availability.pod:96
17910 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
17911 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
17915 #: ../src/guestfs-availability.pod:102
17920 #: ../src/guestfs-availability.pod:104
17921 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
17925 #: ../src/guestfs-availability.pod:107
17926 msgid "B<ntfsprogs>"
17930 #: ../src/guestfs-availability.pod:109
17931 msgid "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
17935 #: ../src/guestfs-availability.pod:113
17936 msgid "B<realpath>"
17940 #: ../src/guestfs-availability.pod:115
17941 msgid "The following functions: L</guestfs_realpath>"
17945 #: ../src/guestfs-availability.pod:118
17950 #: ../src/guestfs-availability.pod:120
17952 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
17953 "L</guestfs_scrub_freespace>"
17957 #: ../src/guestfs-availability.pod:125
17962 #: ../src/guestfs-availability.pod:127
17963 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
17967 #: ../src/guestfs-availability.pod:131
17972 #: ../src/guestfs-availability.pod:133
17973 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
17977 #: ../src/guestfs-availability.pod:137
17978 msgid "B<zerofree>"
17982 #: ../src/guestfs-availability.pod:139
17983 msgid "The following functions: L</guestfs_zerofree>"
17987 #: ../src/guestfs-structs.pod:1
17988 msgid "guestfs_int_bool"
17992 #: ../src/guestfs-structs.pod:3
17995 " struct guestfs_int_bool {\n"
18003 #: ../src/guestfs-structs.pod:8
18006 " struct guestfs_int_bool_list {\n"
18007 " uint32_t len; /* Number of elements in list. */\n"
18008 " struct guestfs_int_bool *val; /* Elements. */\n"
18014 #: ../src/guestfs-structs.pod:13
18017 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
18018 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
18023 #: ../src/guestfs-structs.pod:16
18024 msgid "guestfs_lvm_pv"
18028 #: ../src/guestfs-structs.pod:18
18031 " struct guestfs_lvm_pv {\n"
18032 " char *pv_name;\n"
18033 " /* The next field is NOT nul-terminated, be careful when printing it: "
18035 " char pv_uuid[32];\n"
18037 " uint64_t pv_size;\n"
18038 " uint64_t dev_size;\n"
18039 " uint64_t pv_free;\n"
18040 " uint64_t pv_used;\n"
18041 " char *pv_attr;\n"
18042 " int64_t pv_pe_count;\n"
18043 " int64_t pv_pe_alloc_count;\n"
18044 " char *pv_tags;\n"
18045 " uint64_t pe_start;\n"
18046 " int64_t pv_mda_count;\n"
18047 " uint64_t pv_mda_free;\n"
18053 #: ../src/guestfs-structs.pod:36
18056 " struct guestfs_lvm_pv_list {\n"
18057 " uint32_t len; /* Number of elements in list. */\n"
18058 " struct guestfs_lvm_pv *val; /* Elements. */\n"
18064 #: ../src/guestfs-structs.pod:41
18067 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
18068 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
18073 #: ../src/guestfs-structs.pod:44
18074 msgid "guestfs_lvm_vg"
18078 #: ../src/guestfs-structs.pod:46
18081 " struct guestfs_lvm_vg {\n"
18082 " char *vg_name;\n"
18083 " /* The next field is NOT nul-terminated, be careful when printing it: "
18085 " char vg_uuid[32];\n"
18087 " char *vg_attr;\n"
18088 " uint64_t vg_size;\n"
18089 " uint64_t vg_free;\n"
18090 " char *vg_sysid;\n"
18091 " uint64_t vg_extent_size;\n"
18092 " int64_t vg_extent_count;\n"
18093 " int64_t vg_free_count;\n"
18094 " int64_t max_lv;\n"
18095 " int64_t max_pv;\n"
18096 " int64_t pv_count;\n"
18097 " int64_t lv_count;\n"
18098 " int64_t snap_count;\n"
18099 " int64_t vg_seqno;\n"
18100 " char *vg_tags;\n"
18101 " int64_t vg_mda_count;\n"
18102 " uint64_t vg_mda_free;\n"
18108 #: ../src/guestfs-structs.pod:69
18111 " struct guestfs_lvm_vg_list {\n"
18112 " uint32_t len; /* Number of elements in list. */\n"
18113 " struct guestfs_lvm_vg *val; /* Elements. */\n"
18119 #: ../src/guestfs-structs.pod:74
18122 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
18123 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
18128 #: ../src/guestfs-structs.pod:77
18129 msgid "guestfs_lvm_lv"
18133 #: ../src/guestfs-structs.pod:79
18136 " struct guestfs_lvm_lv {\n"
18137 " char *lv_name;\n"
18138 " /* The next field is NOT nul-terminated, be careful when printing it: "
18140 " char lv_uuid[32];\n"
18141 " char *lv_attr;\n"
18142 " int64_t lv_major;\n"
18143 " int64_t lv_minor;\n"
18144 " int64_t lv_kernel_major;\n"
18145 " int64_t lv_kernel_minor;\n"
18146 " uint64_t lv_size;\n"
18147 " int64_t seg_count;\n"
18149 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
18150 " float snap_percent;\n"
18151 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
18152 " float copy_percent;\n"
18153 " char *move_pv;\n"
18154 " char *lv_tags;\n"
18155 " char *mirror_log;\n"
18156 " char *modules;\n"
18162 #: ../src/guestfs-structs.pod:101
18165 " struct guestfs_lvm_lv_list {\n"
18166 " uint32_t len; /* Number of elements in list. */\n"
18167 " struct guestfs_lvm_lv *val; /* Elements. */\n"
18173 #: ../src/guestfs-structs.pod:106
18176 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
18177 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
18182 #: ../src/guestfs-structs.pod:111
18185 " struct guestfs_stat {\n"
18189 " int64_t nlink;\n"
18194 " int64_t blksize;\n"
18195 " int64_t blocks;\n"
18196 " int64_t atime;\n"
18197 " int64_t mtime;\n"
18198 " int64_t ctime;\n"
18204 #: ../src/guestfs-structs.pod:127
18207 " struct guestfs_stat_list {\n"
18208 " uint32_t len; /* Number of elements in list. */\n"
18209 " struct guestfs_stat *val; /* Elements. */\n"
18215 #: ../src/guestfs-structs.pod:132
18218 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
18219 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
18224 #: ../src/guestfs-structs.pod:137
18227 " struct guestfs_statvfs {\n"
18228 " int64_t bsize;\n"
18229 " int64_t frsize;\n"
18230 " int64_t blocks;\n"
18231 " int64_t bfree;\n"
18232 " int64_t bavail;\n"
18233 " int64_t files;\n"
18234 " int64_t ffree;\n"
18235 " int64_t favail;\n"
18238 " int64_t namemax;\n"
18244 #: ../src/guestfs-structs.pod:151
18247 " struct guestfs_statvfs_list {\n"
18248 " uint32_t len; /* Number of elements in list. */\n"
18249 " struct guestfs_statvfs *val; /* Elements. */\n"
18255 #: ../src/guestfs-structs.pod:156
18258 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
18259 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
18264 #: ../src/guestfs-structs.pod:159
18265 msgid "guestfs_dirent"
18269 #: ../src/guestfs-structs.pod:161
18272 " struct guestfs_dirent {\n"
18281 #: ../src/guestfs-structs.pod:167
18284 " struct guestfs_dirent_list {\n"
18285 " uint32_t len; /* Number of elements in list. */\n"
18286 " struct guestfs_dirent *val; /* Elements. */\n"
18292 #: ../src/guestfs-structs.pod:172
18295 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
18296 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
18301 #: ../src/guestfs-structs.pod:177
18304 " struct guestfs_version {\n"
18305 " int64_t major;\n"
18306 " int64_t minor;\n"
18307 " int64_t release;\n"
18314 #: ../src/guestfs-structs.pod:184
18317 " struct guestfs_version_list {\n"
18318 " uint32_t len; /* Number of elements in list. */\n"
18319 " struct guestfs_version *val; /* Elements. */\n"
18325 #: ../src/guestfs-structs.pod:189
18328 " void guestfs_free_version (struct guestfs_free_version *);\n"
18329 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
18334 #: ../src/guestfs-structs.pod:192
18335 msgid "guestfs_xattr"
18339 #: ../src/guestfs-structs.pod:194
18342 " struct guestfs_xattr {\n"
18343 " char *attrname;\n"
18344 " /* The next two fields describe a byte array. */\n"
18345 " uint32_t attrval_len;\n"
18346 " char *attrval;\n"
18352 #: ../src/guestfs-structs.pod:201
18355 " struct guestfs_xattr_list {\n"
18356 " uint32_t len; /* Number of elements in list. */\n"
18357 " struct guestfs_xattr *val; /* Elements. */\n"
18363 #: ../src/guestfs-structs.pod:206
18366 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
18367 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
18372 #: ../src/guestfs-structs.pod:209
18373 msgid "guestfs_inotify_event"
18377 #: ../src/guestfs-structs.pod:211
18380 " struct guestfs_inotify_event {\n"
18381 " int64_t in_wd;\n"
18382 " uint32_t in_mask;\n"
18383 " uint32_t in_cookie;\n"
18384 " char *in_name;\n"
18390 #: ../src/guestfs-structs.pod:218
18393 " struct guestfs_inotify_event_list {\n"
18394 " uint32_t len; /* Number of elements in list. */\n"
18395 " struct guestfs_inotify_event *val; /* Elements. */\n"
18401 #: ../src/guestfs-structs.pod:223
18404 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
18405 " void guestfs_free_inotify_event_list (struct "
18406 "guestfs_free_inotify_event_list *);\n"
18411 #: ../src/guestfs-structs.pod:226
18412 msgid "guestfs_partition"
18416 #: ../src/guestfs-structs.pod:228
18419 " struct guestfs_partition {\n"
18420 " int32_t part_num;\n"
18421 " uint64_t part_start;\n"
18422 " uint64_t part_end;\n"
18423 " uint64_t part_size;\n"
18429 #: ../src/guestfs-structs.pod:235
18432 " struct guestfs_partition_list {\n"
18433 " uint32_t len; /* Number of elements in list. */\n"
18434 " struct guestfs_partition *val; /* Elements. */\n"
18440 #: ../src/guestfs-structs.pod:240
18443 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
18444 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
18449 #: ../src/guestfs-structs.pod:243
18450 msgid "guestfs_application"
18454 #: ../src/guestfs-structs.pod:245
18457 " struct guestfs_application {\n"
18458 " char *app_name;\n"
18459 " char *app_display_name;\n"
18460 " int32_t app_epoch;\n"
18461 " char *app_version;\n"
18462 " char *app_release;\n"
18463 " char *app_install_path;\n"
18464 " char *app_trans_path;\n"
18465 " char *app_publisher;\n"
18466 " char *app_url;\n"
18467 " char *app_source_package;\n"
18468 " char *app_summary;\n"
18469 " char *app_description;\n"
18475 #: ../src/guestfs-structs.pod:260
18478 " struct guestfs_application_list {\n"
18479 " uint32_t len; /* Number of elements in list. */\n"
18480 " struct guestfs_application *val; /* Elements. */\n"
18486 #: ../src/guestfs-structs.pod:265
18489 " void guestfs_free_application (struct guestfs_free_application *);\n"
18490 " void guestfs_free_application_list (struct guestfs_free_application_list "
18496 #: ../fish/guestfish.pod:5
18497 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
18501 #: ../fish/guestfish.pod:9
18504 " guestfish [--options] [commands]\n"
18509 #: ../fish/guestfish.pod:11
18517 #: ../fish/guestfish.pod:13
18520 " guestfish [--ro|--rw] -a disk.img\n"
18525 #: ../fish/guestfish.pod:15
18528 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
18533 #: ../fish/guestfish.pod:17
18536 " guestfish -d libvirt-domain\n"
18541 #: ../fish/guestfish.pod:19
18544 " guestfish [--ro|--rw] -a disk.img -i\n"
18549 #: ../fish/guestfish.pod:21
18552 " guestfish -d libvirt-domain -i\n"
18557 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44 ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
18562 #: ../fish/guestfish.pod:25
18564 "Using guestfish in read/write mode on live virtual machines can be "
18565 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
18566 "option to use guestfish safely if the disk image or virtual machine might be "
18571 #: ../fish/guestfish.pod:32
18573 "Guestfish is a shell and command-line tool for examining and modifying "
18574 "virtual machine filesystems. It uses libguestfs and exposes all of the "
18575 "functionality of the guestfs API, see L<guestfs(3)>."
18579 #: ../fish/guestfish.pod:36
18581 "Guestfish gives you structured access to the libguestfs API, from shell "
18582 "scripts or the command line or interactively. If you want to rescue a "
18583 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
18588 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:947 ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:63 ../tools/virt-tar.pl:50
18593 #: ../fish/guestfish.pod:43
18594 msgid "As an interactive shell"
18598 #: ../fish/guestfish.pod:45
18606 #: ../fish/guestfish.pod:47
18609 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
18610 " editing virtual machine filesystems.\n"
18615 #: ../fish/guestfish.pod:50
18618 " Type: 'help' for a list of commands\n"
18619 " 'man' to read the manual\n"
18620 " 'quit' to quit the shell\n"
18625 #: ../fish/guestfish.pod:54
18628 " ><fs> add-ro disk.img\n"
18630 " ><fs> list-filesystems\n"
18631 " /dev/sda1: ext4\n"
18632 " /dev/vg_guest/lv_root: ext4\n"
18633 " /dev/vg_guest/lv_swap: swap\n"
18634 " ><fs> mount /dev/vg_guest/lv_root /\n"
18635 " ><fs> cat /etc/fstab\n"
18637 " # Created by anaconda\n"
18644 #: ../fish/guestfish.pod:67
18645 msgid "From shell scripts"
18649 #: ../fish/guestfish.pod:69
18650 msgid "Create a new C</etc/motd> file in a guest or disk image:"
18654 #: ../fish/guestfish.pod:71
18657 " guestfish <<_EOF_\n"
18660 " mount /dev/vg_guest/lv_root /\n"
18661 " write /etc/motd \"Welcome, new users\"\n"
18667 #: ../fish/guestfish.pod:78
18668 msgid "List the LVM logical volumes in a disk image:"
18672 #: ../fish/guestfish.pod:80
18675 " guestfish -a disk.img --ro <<_EOF_\n"
18683 #: ../fish/guestfish.pod:85
18684 msgid "List all the filesystems in a disk image:"
18688 #: ../fish/guestfish.pod:87
18691 " guestfish -a disk.img --ro <<_EOF_\n"
18693 " list-filesystems\n"
18699 #: ../fish/guestfish.pod:92
18700 msgid "On one command line"
18704 #: ../fish/guestfish.pod:94
18705 msgid "Update C</etc/resolv.conf> in a guest:"
18709 #: ../fish/guestfish.pod:96
18713 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18714 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18719 #: ../fish/guestfish.pod:100
18720 msgid "Edit C</boot/grub/grub.conf> interactively:"
18724 #: ../fish/guestfish.pod:102
18727 " guestfish --rw --add disk.img \\\n"
18728 " --mount /dev/vg_guest/lv_root \\\n"
18729 " --mount /dev/sda1:/boot \\\n"
18730 " edit /boot/grub/grub.conf\n"
18735 #: ../fish/guestfish.pod:107
18736 msgid "Mount disks automatically"
18740 #: ../fish/guestfish.pod:109
18742 "Use the I<-i> option to automatically mount the disks from a virtual "
18747 #: ../fish/guestfish.pod:112
18750 " guestfish --ro -a disk.img -i cat /etc/group\n"
18755 #: ../fish/guestfish.pod:114
18758 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18763 #: ../fish/guestfish.pod:116
18764 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18768 #: ../fish/guestfish.pod:118
18771 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18776 #: ../fish/guestfish.pod:120
18777 msgid "As a script interpreter"
18781 #: ../fish/guestfish.pod:122
18782 msgid "Create a 100MB disk containing an ext2-formatted partition:"
18786 #: ../fish/guestfish.pod:124
18789 " #!/usr/bin/guestfish -f\n"
18790 " sparse test1.img 100M\n"
18792 " part-disk /dev/sda mbr\n"
18793 " mkfs ext2 /dev/sda1\n"
18798 #: ../fish/guestfish.pod:130
18799 msgid "Start with a prepared disk"
18803 #: ../fish/guestfish.pod:132
18805 "An alternate way to create a 100MB disk called C<test1.img> containing a "
18806 "single ext2-formatted partition:"
18810 #: ../fish/guestfish.pod:135
18813 " guestfish -N fs\n"
18818 #: ../fish/guestfish.pod:137
18819 msgid "To list what is available do:"
18823 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:938
18826 " guestfish -N help | less\n"
18831 #: ../fish/guestfish.pod:141
18832 msgid "Remote control"
18836 #: ../fish/guestfish.pod:143
18839 " eval \"`guestfish --listen`\"\n"
18840 " guestfish --remote add-ro disk.img\n"
18841 " guestfish --remote run\n"
18842 " guestfish --remote lvs\n"
18847 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37 ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:81 ../tools/virt-win-reg.pl:96 ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103 ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
18852 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131 ../tools/virt-edit.pl:89 ../tools/virt-win-reg.pl:104 ../tools/virt-list-filesystems.pl:61 ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:62
18857 #: ../fish/guestfish.pod:154
18858 msgid "Displays general help on options."
18862 #: ../fish/guestfish.pod:156
18867 #: ../fish/guestfish.pod:158
18868 msgid "B<--cmd-help>"
18872 #: ../fish/guestfish.pod:160
18873 msgid "Lists all available guestfish commands."
18877 #: ../fish/guestfish.pod:162
18882 #: ../fish/guestfish.pod:164
18883 msgid "B<--cmd-help cmd>"
18887 #: ../fish/guestfish.pod:166
18888 msgid "Displays detailed help on a single command C<cmd>."
18892 #: ../fish/guestfish.pod:168
18893 msgid "B<-a image>"
18897 #: ../fish/guestfish.pod:170
18898 msgid "B<--add image>"
18902 #: ../fish/guestfish.pod:172
18903 msgid "Add a block device or virtual machine image to the shell."
18907 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
18909 "The format of the disk image is auto-detected. To override this and force a "
18910 "particular format use the I<--format=..> option."
18914 #: ../fish/guestfish.pod:177
18916 "Using this flag is mostly equivalent to using the C<add> command, with "
18917 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
18918 "the I<--format=...> flag was given."
18922 #: ../fish/guestfish.pod:181
18927 #: ../fish/guestfish.pod:183
18928 msgid "B<--connect URI>"
18932 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
18934 "When used in conjunction with the I<-d> option, this specifies the libvirt "
18935 "URI to use. The default is to use the default libvirt connection."
18939 #: ../fish/guestfish.pod:189
18944 #: ../fish/guestfish.pod:191
18946 "If using the I<--listen> option and a csh-like shell, use this option. See "
18947 "section L</REMOTE CONTROL AND CSH> below."
18951 #: ../fish/guestfish.pod:194
18952 msgid "B<-d libvirt-domain>"
18956 #: ../fish/guestfish.pod:196
18957 msgid "B<--domain libvirt-domain>"
18961 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
18963 "Add disks from the named libvirt domain. If the I<--ro> option is also "
18964 "used, then any libvirt domain can be used. However in write mode, only "
18965 "libvirt domains which are shut down can be named here."
18969 #: ../fish/guestfish.pod:202
18971 "Using this flag is mostly equivalent to using the C<add-domain> command, "
18972 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
18973 "if the I<--format:...> flag was given."
18977 #: ../fish/guestfish.pod:206
18982 #: ../fish/guestfish.pod:208
18983 msgid "B<--no-dest-paths>"
18987 #: ../fish/guestfish.pod:210
18989 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
18990 "to hit the tab key to complete paths on the guest filesystem, but this "
18991 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
18992 "allow this feature to be disabled."
18996 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
18997 msgid "B<--echo-keys>"
19001 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
19003 "When prompting for keys and passphrases, guestfish normally turns echoing "
19004 "off so you cannot see what you are typing. If you are not worried about "
19005 "Tempest attacks and there is no one else in the room you can specify this "
19006 "flag to see what you are typing."
19010 #: ../fish/guestfish.pod:222
19015 #: ../fish/guestfish.pod:224
19016 msgid "B<--file file>"
19020 #: ../fish/guestfish.pod:226
19021 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
19025 #: ../fish/guestfish.pod:229
19028 " #!/usr/bin/guestfish -f\n"
19033 #: ../fish/guestfish.pod:231
19034 msgid "B<--format=raw|qcow2|..>"
19038 #: ../fish/guestfish.pod:233
19039 msgid "B<--format>"
19043 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
19045 "The default for the I<-a> option is to auto-detect the format of the disk "
19046 "image. Using this forces the disk format for I<-a> options which follow on "
19047 "the command line. Using I<--format> with no argument switches back to "
19048 "auto-detection for subsequent I<-a> options."
19052 #: ../fish/guestfish.pod:242
19055 " guestfish --format=raw -a disk.img\n"
19060 #: ../fish/guestfish.pod:244
19061 msgid "forces raw format (no auto-detection) for C<disk.img>."
19065 #: ../fish/guestfish.pod:246
19068 " guestfish --format=raw -a disk.img --format -a another.img\n"
19073 #: ../fish/guestfish.pod:248
19075 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
19076 "auto-detection for C<another.img>."
19080 #: ../fish/guestfish.pod:251
19082 "If you have untrusted raw-format guest disk images, you should use this "
19083 "option to specify the disk format. This avoids a possible security problem "
19084 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
19088 #: ../fish/guestfish.pod:256
19093 #: ../fish/guestfish.pod:258
19094 msgid "B<--inspector>"
19098 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
19100 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
19101 "system and mount filesystems as they would be mounted on the real virtual "
19106 #: ../fish/guestfish.pod:264
19107 msgid "Typical usage is either:"
19111 #: ../fish/guestfish.pod:266
19114 " guestfish -d myguest -i\n"
19119 #: ../fish/guestfish.pod:268
19120 msgid "(for an inactive libvirt domain called I<myguest>), or:"
19124 #: ../fish/guestfish.pod:270
19127 " guestfish --ro -d myguest -i\n"
19132 #: ../fish/guestfish.pod:272
19133 msgid "(for active domains, readonly), or specify the block device directly:"
19137 #: ../fish/guestfish.pod:274
19140 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
19145 #: ../fish/guestfish.pod:276
19147 "Note that the command line syntax changed slightly over older versions of "
19148 "guestfish. You can still use the old syntax:"
19152 #: ../fish/guestfish.pod:279
19155 " guestfish [--ro] -i disk.img\n"
19160 #: ../fish/guestfish.pod:281
19163 " guestfish [--ro] -i libvirt-domain\n"
19168 #: ../fish/guestfish.pod:283
19170 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
19171 "then using other commands to mount the filesystems that were found."
19175 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
19176 msgid "B<--keys-from-stdin>"
19180 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
19182 "Read key or passphrase parameters from stdin. The default is to try to read "
19183 "passphrases from the user by opening C</dev/tty>."
19187 #: ../fish/guestfish.pod:292
19188 msgid "B<--listen>"
19192 #: ../fish/guestfish.pod:294
19194 "Fork into the background and listen for remote commands. See section "
19195 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
19199 #: ../fish/guestfish.pod:297 ../fuse/guestmount.pod:146
19204 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:148
19206 "Connect to a live virtual machine. (Experimental, see "
19207 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
19211 #: ../fish/guestfish.pod:302 ../fuse/guestmount.pod:151
19212 msgid "B<-m dev[:mountpoint[:options]]>"
19216 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:153
19217 msgid "B<--mount dev[:mountpoint[:options]]>"
19221 #: ../fish/guestfish.pod:306
19222 msgid "Mount the named partition or logical volume on the given mountpoint."
19226 #: ../fish/guestfish.pod:308
19227 msgid "If the mountpoint is omitted, it defaults to C</>."
19231 #: ../fish/guestfish.pod:310
19232 msgid "You have to mount something on C</> before most commands will work."
19236 #: ../fish/guestfish.pod:312
19238 "If any I<-m> or I<--mount> options are given, the guest is automatically "
19243 #: ../fish/guestfish.pod:315
19245 "If you don't know what filesystems a disk image contains, you can either run "
19246 "guestfish without this option, then list the partitions, filesystems and LVs "
19247 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
19248 "commands), or you can use the L<virt-filesystems(1)> program."
19252 #: ../fish/guestfish.pod:321 ../fuse/guestmount.pod:161
19254 "The third (and rarely used) part of the mount parameter is the list of mount "
19255 "options used to mount the underlying filesystem. If this is not given, then "
19256 "the mount options are either the empty string or C<ro> (the latter if the "
19257 "I<--ro> flag is used). By specifying the mount options, you override this "
19258 "default choice. Probably the only time you would use this is to enable ACLs "
19259 "and/or extended attributes if the filesystem can support them:"
19263 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:169
19266 " -m /dev/sda1:/:acl,user_xattr\n"
19271 #: ../fish/guestfish.pod:331
19272 msgid "Using this flag is equivalent to using the C<mount-options> command."
19276 #: ../fish/guestfish.pod:333
19281 #: ../fish/guestfish.pod:335
19282 msgid "B<--no-sync>"
19286 #: ../fish/guestfish.pod:337
19288 "Disable autosync. This is enabled by default. See the discussion of "
19289 "autosync in the L<guestfs(3)> manpage."
19293 #: ../fish/guestfish.pod:340
19298 #: ../fish/guestfish.pod:342
19299 msgid "B<--new type>"
19303 #: ../fish/guestfish.pod:344
19308 #: ../fish/guestfish.pod:346
19310 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
19311 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
19312 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
19317 #: ../fish/guestfish.pod:351
19318 msgid "B<--progress-bars>"
19322 #: ../fish/guestfish.pod:353
19323 msgid "Enable progress bars, even when guestfish is used non-interactively."
19327 #: ../fish/guestfish.pod:355
19329 "Progress bars are enabled by default when guestfish is used as an "
19330 "interactive shell."
19334 #: ../fish/guestfish.pod:358
19335 msgid "B<--no-progress-bars>"
19339 #: ../fish/guestfish.pod:360
19340 msgid "Disable progress bars."
19344 #: ../fish/guestfish.pod:362
19345 msgid "B<--remote[=pid]>"
19349 #: ../fish/guestfish.pod:364
19351 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
19352 "CONTROL GUESTFISH OVER A SOCKET> below."
19356 #: ../fish/guestfish.pod:367
19361 #: ../fish/guestfish.pod:369
19366 #: ../fish/guestfish.pod:371
19368 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19369 "mounts are done read-only."
19373 #: ../fish/guestfish.pod:374
19375 "The option must always be used if the disk image or virtual machine might be "
19376 "running, and is generally recommended in cases where you don't need write "
19377 "access to the disk."
19381 #: ../fish/guestfish.pod:378
19383 "Note that prepared disk images created with I<-N> are not affected by this "
19384 "option. Also commands like C<add> are not affected - you have to specify "
19385 "the C<readonly:true> option explicitly if you need it."
19389 #: ../fish/guestfish.pod:382
19390 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
19394 #: ../fish/guestfish.pod:384 ../fuse/guestmount.pod:225
19395 msgid "B<--selinux>"
19399 #: ../fish/guestfish.pod:386
19400 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
19404 #: ../fish/guestfish.pod:388
19409 #: ../fish/guestfish.pod:390
19410 msgid "B<--verbose>"
19414 #: ../fish/guestfish.pod:392
19416 "Enable very verbose messages. This is particularly useful if you find a "
19421 #: ../fish/guestfish.pod:395
19426 #: ../fish/guestfish.pod:397 ../tools/virt-edit.pl:97 ../tools/virt-win-reg.pl:112 ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119 ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
19427 msgid "B<--version>"
19431 #: ../fish/guestfish.pod:399
19432 msgid "Display the guestfish / libguestfs version number and exit."
19436 #: ../fish/guestfish.pod:401
19441 #: ../fish/guestfish.pod:403
19446 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:239
19448 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19449 "mounts are done read-write."
19453 #: ../fish/guestfish.pod:408
19454 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
19458 #: ../fish/guestfish.pod:410
19463 #: ../fish/guestfish.pod:412
19464 msgid "Echo each command before executing it."
19468 #: ../fish/guestfish.pod:416
19469 msgid "COMMANDS ON COMMAND LINE"
19473 #: ../fish/guestfish.pod:418
19474 msgid "Any additional (non-option) arguments are treated as commands to execute."
19478 #: ../fish/guestfish.pod:421
19480 "Commands to execute should be separated by a colon (C<:>), where the colon "
19481 "is a separate parameter. Thus:"
19485 #: ../fish/guestfish.pod:424
19488 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
19493 #: ../fish/guestfish.pod:426
19495 "If there are no additional arguments, then we enter a shell, either an "
19496 "interactive shell with a prompt (if the input is a terminal) or a "
19497 "non-interactive shell."
19501 #: ../fish/guestfish.pod:430
19503 "In either command line mode or non-interactive shell, the first command that "
19504 "gives an error causes the whole shell to exit. In interactive mode (with a "
19505 "prompt) if a command fails, you can continue to enter commands."
19509 #: ../fish/guestfish.pod:435
19510 msgid "USING launch (OR run)"
19514 #: ../fish/guestfish.pod:437
19516 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
19517 "then launch it, then mount any disks you need, and finally issue "
19518 "actions/commands. So the general order of the day is:"
19522 #: ../fish/guestfish.pod:445
19523 msgid "add or -a/--add"
19527 #: ../fish/guestfish.pod:449
19528 msgid "launch (aka run)"
19532 #: ../fish/guestfish.pod:453
19533 msgid "mount or -m/--mount"
19537 #: ../fish/guestfish.pod:457
19538 msgid "any other commands"
19542 #: ../fish/guestfish.pod:461
19544 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
19545 "guest before mounting or performing any other commands."
19549 #: ../fish/guestfish.pod:464
19551 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
19552 "I<--new> options were given then C<run> is done automatically, simply "
19553 "because guestfish can't perform the action you asked for without doing this."
19557 #: ../fish/guestfish.pod:469
19558 msgid "OPENING DISKS FOR READ AND WRITE"
19562 #: ../fish/guestfish.pod:471
19564 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
19565 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
19566 "I<-i> and I<-m> open disk images read-only or for writing."
19570 #: ../fish/guestfish.pod:476
19572 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
19573 "opening disk images supplied on the command line for write. To open a disk "
19574 "image read-only you have to do I<-a image --ro>."
19578 #: ../fish/guestfish.pod:480
19580 "This matters: If you accidentally open a live VM disk image writable then "
19581 "you will cause irreversible disk corruption."
19585 #: ../fish/guestfish.pod:483
19587 "By libguestfs 1.12 we intend to change the default the other way. Disk "
19588 "images will be opened read-only. You will have to either specify "
19589 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
19590 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
19591 "access for disk images specified by those other command line options."
19595 #: ../fish/guestfish.pod:490
19597 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
19598 "which does nothing (it is already the default). However it is highly "
19599 "recommended that you use this option to indicate that you need write access, "
19600 "and prepare your scripts for the day when this option will be required for "
19605 #: ../fish/guestfish.pod:496
19607 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
19608 "other libguestfs program apart from guestfish and guestmount."
19612 #: ../fish/guestfish.pod:499
19617 #: ../fish/guestfish.pod:501
19619 "You can quote ordinary parameters using either single or double quotes. For "
19624 #: ../fish/guestfish.pod:504
19627 " add \"file with a space.img\"\n"
19632 #: ../fish/guestfish.pod:506
19635 " rm '/file name'\n"
19640 #: ../fish/guestfish.pod:508
19648 #: ../fish/guestfish.pod:510
19650 "A few commands require a list of strings to be passed. For these, use a "
19651 "whitespace-separated list, enclosed in quotes. Strings containing "
19652 "whitespace to be passed through must be enclosed in single quotes. A "
19653 "literal single quote must be escaped with a backslash."
19657 #: ../fish/guestfish.pod:515
19660 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
19661 " command \"/bin/echo 'foo bar'\"\n"
19662 " command \"/bin/echo \\'foo\\'\"\n"
19667 #: ../fish/guestfish.pod:519
19668 msgid "OPTIONAL ARGUMENTS"
19672 #: ../fish/guestfish.pod:521
19674 "Some commands take optional arguments. These arguments appear in this "
19675 "documentation as C<[argname:..]>. You can use them as in these examples:"
19679 #: ../fish/guestfish.pod:525
19682 " add-drive-opts filename\n"
19687 #: ../fish/guestfish.pod:527
19690 " add-drive-opts filename readonly:true\n"
19695 #: ../fish/guestfish.pod:529
19698 " add-drive-opts filename format:qcow2 readonly:false\n"
19703 #: ../fish/guestfish.pod:531
19705 "Each optional argument can appear at most once. All optional arguments must "
19706 "appear after the required ones."
19710 #: ../fish/guestfish.pod:534
19715 #: ../fish/guestfish.pod:536
19716 msgid "This section applies to all commands which can take integers as parameters."
19720 #: ../fish/guestfish.pod:539
19721 msgid "SIZE SUFFIX"
19725 #: ../fish/guestfish.pod:541
19727 "When the command takes a parameter measured in bytes, you can use one of the "
19728 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19732 #: ../fish/guestfish.pod:547
19733 msgid "B<k> or B<K> or B<KiB>"
19737 #: ../fish/guestfish.pod:549
19738 msgid "The size in kilobytes (multiplied by 1024)."
19742 #: ../fish/guestfish.pod:551
19747 #: ../fish/guestfish.pod:553
19748 msgid "The size in SI 1000 byte units."
19752 #: ../fish/guestfish.pod:555
19753 msgid "B<M> or B<MiB>"
19757 #: ../fish/guestfish.pod:557
19758 msgid "The size in megabytes (multiplied by 1048576)."
19762 #: ../fish/guestfish.pod:559
19767 #: ../fish/guestfish.pod:561
19768 msgid "The size in SI 1000000 byte units."
19772 #: ../fish/guestfish.pod:563
19773 msgid "B<G> or B<GiB>"
19777 #: ../fish/guestfish.pod:565
19778 msgid "The size in gigabytes (multiplied by 2**30)."
19782 #: ../fish/guestfish.pod:567
19787 #: ../fish/guestfish.pod:569
19788 msgid "The size in SI 10**9 byte units."
19792 #: ../fish/guestfish.pod:571
19793 msgid "B<T> or B<TiB>"
19797 #: ../fish/guestfish.pod:573
19798 msgid "The size in terabytes (multiplied by 2**40)."
19802 #: ../fish/guestfish.pod:575
19807 #: ../fish/guestfish.pod:577
19808 msgid "The size in SI 10**12 byte units."
19812 #: ../fish/guestfish.pod:579
19813 msgid "B<P> or B<PiB>"
19817 #: ../fish/guestfish.pod:581
19818 msgid "The size in petabytes (multiplied by 2**50)."
19822 #: ../fish/guestfish.pod:583
19827 #: ../fish/guestfish.pod:585
19828 msgid "The size in SI 10**15 byte units."
19832 #: ../fish/guestfish.pod:587
19833 msgid "B<E> or B<EiB>"
19837 #: ../fish/guestfish.pod:589
19838 msgid "The size in exabytes (multiplied by 2**60)."
19842 #: ../fish/guestfish.pod:591
19847 #: ../fish/guestfish.pod:593
19848 msgid "The size in SI 10**18 byte units."
19852 #: ../fish/guestfish.pod:595
19853 msgid "B<Z> or B<ZiB>"
19857 #: ../fish/guestfish.pod:597
19858 msgid "The size in zettabytes (multiplied by 2**70)."
19862 #: ../fish/guestfish.pod:599
19867 #: ../fish/guestfish.pod:601
19868 msgid "The size in SI 10**21 byte units."
19872 #: ../fish/guestfish.pod:603
19873 msgid "B<Y> or B<YiB>"
19877 #: ../fish/guestfish.pod:605
19878 msgid "The size in yottabytes (multiplied by 2**80)."
19882 #: ../fish/guestfish.pod:607
19887 #: ../fish/guestfish.pod:609
19888 msgid "The size in SI 10**24 byte units."
19892 #: ../fish/guestfish.pod:615
19895 " truncate-size /file 1G\n"
19900 #: ../fish/guestfish.pod:617
19901 msgid "would truncate the file to 1 gigabyte."
19905 #: ../fish/guestfish.pod:619
19907 "Be careful because a few commands take sizes in kilobytes or megabytes "
19908 "(eg. the parameter to L</memsize> is specified in megabytes already). "
19909 "Adding a suffix will probably not do what you expect."
19913 #: ../fish/guestfish.pod:623
19914 msgid "OCTAL AND HEXADECIMAL NUMBERS"
19918 #: ../fish/guestfish.pod:625
19920 "For specifying the radix (base) use the C convention: C<0> to prefix an "
19921 "octal number or C<0x> to prefix a hexadecimal number. For example:"
19925 #: ../fish/guestfish.pod:628
19928 " 1234 decimal number 1234\n"
19929 " 02322 octal number, equivalent to decimal 1234\n"
19930 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
19935 #: ../fish/guestfish.pod:632
19937 "When using the C<chmod> command, you almost always want to specify an octal "
19938 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
19939 "L<chmod(1)> program):"
19943 #: ../fish/guestfish.pod:636
19946 " chmod 0777 /public # OK\n"
19947 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
19952 #: ../fish/guestfish.pod:639
19954 "Commands that return numbers usually print them in decimal, but some "
19955 "commands print numbers in other radices (eg. C<umask> prints the mode in "
19956 "octal, preceeded by C<0>)."
19960 #: ../fish/guestfish.pod:643
19961 msgid "WILDCARDS AND GLOBBING"
19965 #: ../fish/guestfish.pod:645
19967 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
19968 "(globbing) by default. So for example the following will not do what you "
19973 #: ../fish/guestfish.pod:649
19981 #: ../fish/guestfish.pod:651
19983 "Assuming you don't have a directory called literally C</home/*> then the "
19984 "above command will return an error."
19988 #: ../fish/guestfish.pod:654
19989 msgid "To perform wildcard expansion, use the C<glob> command."
19993 #: ../fish/guestfish.pod:656
19996 " glob rm-rf /home/*\n"
20001 #: ../fish/guestfish.pod:658
20003 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
20004 "many times), equivalent to:"
20008 #: ../fish/guestfish.pod:661
20011 " rm-rf /home/jim\n"
20012 " rm-rf /home/joe\n"
20013 " rm-rf /home/mary\n"
20018 #: ../fish/guestfish.pod:665
20019 msgid "C<glob> only works on simple guest paths and not on device names."
20023 #: ../fish/guestfish.pod:667
20025 "If you have several parameters, each containing a wildcard, then glob will "
20026 "perform a Cartesian product."
20030 #: ../fish/guestfish.pod:670
20035 #: ../fish/guestfish.pod:672
20037 "Any line which starts with a I<#> character is treated as a comment and "
20038 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
20039 "a command. For example:"
20043 #: ../fish/guestfish.pod:676
20046 " # this is a comment\n"
20047 " # this is a comment\n"
20048 " foo # NOT a comment\n"
20053 #: ../fish/guestfish.pod:680
20054 msgid "Blank lines are also ignored."
20058 #: ../fish/guestfish.pod:682
20059 msgid "RUNNING COMMANDS LOCALLY"
20063 #: ../fish/guestfish.pod:684
20065 "Any line which starts with a I<!> character is treated as a command sent to "
20066 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
20070 #: ../fish/guestfish.pod:688
20074 " tgz-out /remote local/remote-data.tar.gz\n"
20079 #: ../fish/guestfish.pod:691
20081 "will create a directory C<local> on the host, and then export the contents "
20082 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
20083 "(See C<tgz-out>)."
20087 #: ../fish/guestfish.pod:695
20089 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
20090 "effect, due to the way that subprocesses work in Unix."
20094 #: ../fish/guestfish.pod:698
20095 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
20099 #: ../fish/guestfish.pod:700
20101 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
20102 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
20103 "and executed as guestfish commands."
20107 #: ../fish/guestfish.pod:704
20109 "Thus you can use shell script to construct arbitrary guestfish commands "
20110 "which are then parsed by guestfish."
20114 #: ../fish/guestfish.pod:707
20116 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
20117 "through C</foo.100>) using guestfish commands alone. However this is simple "
20118 "if we use a shell script to create the guestfish commands for us:"
20122 #: ../fish/guestfish.pod:712
20125 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
20130 #: ../fish/guestfish.pod:714
20131 msgid "or with names like C</foo.001>:"
20135 #: ../fish/guestfish.pod:716
20138 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
20143 #: ../fish/guestfish.pod:718
20145 "When using guestfish interactively it can be helpful to just run the shell "
20146 "script first (ie. remove the initial C<E<lt>> character so it is just an "
20147 "ordinary I<!> local command), see what guestfish commands it would run, and "
20148 "when you are happy with those prepend the C<E<lt>> character to run the "
20149 "guestfish commands for real."
20153 #: ../fish/guestfish.pod:724
20158 #: ../fish/guestfish.pod:726
20160 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
20161 "command (a guestfish command) to the second command (any host command). For "
20166 #: ../fish/guestfish.pod:730
20169 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
20174 #: ../fish/guestfish.pod:732
20176 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
20177 "program). The above command would list all accounts in the guest filesystem "
20178 "which have UID 0, ie. root accounts including backdoors. Other examples:"
20182 #: ../fish/guestfish.pod:737
20185 " hexdump /bin/ls | head\n"
20186 " list-devices | tail -1\n"
20187 " tgz-out / - | tar ztf -\n"
20192 #: ../fish/guestfish.pod:741
20194 "The space before the pipe symbol is required, any space after the pipe "
20195 "symbol is optional. Everything after the pipe symbol is just passed "
20196 "straight to the host shell, so it can contain redirections, globs and "
20197 "anything else that makes sense on the host side."
20201 #: ../fish/guestfish.pod:746
20203 "To use a literal argument which begins with a pipe symbol, you have to quote "
20208 #: ../fish/guestfish.pod:749
20216 #: ../fish/guestfish.pod:751
20217 msgid "HOME DIRECTORIES"
20221 #: ../fish/guestfish.pod:753
20223 "If a parameter starts with the character C<~> then the tilde may be expanded "
20224 "as a home directory path (either C<~> for the current user's home directory, "
20225 "or C<~user> for another user)."
20229 #: ../fish/guestfish.pod:757
20231 "Note that home directory expansion happens for users known I<on the host>, "
20232 "not in the guest filesystem."
20236 #: ../fish/guestfish.pod:760
20238 "To use a literal argument which begins with a tilde, you have to quote it, "
20243 #: ../fish/guestfish.pod:763
20251 #: ../fish/guestfish.pod:767
20253 "Libguestfs has some support for Linux guests encrypted according to the "
20254 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
20255 "disk encryption systems used by modern Linux guests. Currently only "
20256 "LVM-on-LUKS is supported."
20260 #: ../fish/guestfish.pod:772
20261 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
20265 #: ../fish/guestfish.pod:774
20268 " ><fs> vfs-type /dev/sda2\n"
20274 #: ../fish/guestfish.pod:777
20276 "Then open those devices using L</luks-open>. This creates a device-mapper "
20277 "device called C</dev/mapper/luksdev>."
20281 #: ../fish/guestfish.pod:780
20284 " ><fs> luks-open /dev/sda2 luksdev\n"
20285 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
20290 #: ../fish/guestfish.pod:783
20292 "Finally you have to tell LVM to scan for volume groups on the newly created "
20297 #: ../fish/guestfish.pod:786
20301 " vg-activate-all true\n"
20306 #: ../fish/guestfish.pod:789
20307 msgid "The logical volume(s) can now be mounted in the usual way."
20311 #: ../fish/guestfish.pod:791
20313 "Before closing a LUKS device you must unmount any logical volumes on it and "
20314 "deactivate the volume groups by calling C<vg-activate false VG> on each "
20315 "one. Then you can close the mapper device:"
20319 #: ../fish/guestfish.pod:795
20322 " vg-activate false /dev/VG\n"
20323 " luks-close /dev/mapper/luksdev\n"
20328 #: ../fish/guestfish.pod:798 ../tools/virt-edit.pl:342
20329 msgid "WINDOWS PATHS"
20333 #: ../fish/guestfish.pod:800
20335 "If a path is prefixed with C<win:> then you can use Windows-style drive "
20336 "letters and paths (with some limitations). The following commands are "
20341 #: ../fish/guestfish.pod:804
20344 " file /WINDOWS/system32/config/system.LOG\n"
20349 #: ../fish/guestfish.pod:806
20352 " file win:\\windows\\system32\\config\\system.log\n"
20357 #: ../fish/guestfish.pod:808
20360 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
20365 #: ../fish/guestfish.pod:810
20367 "The parameter is rewritten \"behind the scenes\" by looking up the position "
20368 "where the drive is mounted, prepending that to the path, changing all "
20369 "backslash characters to forward slash, then resolving the result using "
20370 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
20371 "then the parameter might be rewritten like this:"
20375 #: ../fish/guestfish.pod:816
20378 " win:e:\\foo\\bar => /e/FOO/bar\n"
20383 #: ../fish/guestfish.pod:818
20384 msgid "This only works in argument positions that expect a path."
20388 #: ../fish/guestfish.pod:820
20389 msgid "UPLOADING AND DOWNLOADING FILES"
20393 #: ../fish/guestfish.pod:822
20395 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
20396 "others which upload from or download to a local file, you can use the "
20397 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
20401 #: ../fish/guestfish.pod:826
20409 #: ../fish/guestfish.pod:828
20410 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
20414 #: ../fish/guestfish.pod:831
20417 " tar-out /etc - | tar tf -\n"
20422 #: ../fish/guestfish.pod:833
20424 "writes the tarball to stdout and then pipes that into the external \"tar\" "
20425 "command (see L</PIPES>)."
20429 #: ../fish/guestfish.pod:836
20431 "When using C<-> to read from stdin, the input is read up to the end of "
20432 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
20433 "some arbitrary end marker:"
20437 #: ../fish/guestfish.pod:840
20440 " upload -<<END /foo\n"
20449 #: ../fish/guestfish.pod:846
20451 "Any string of characters can be used instead of C<END>. The end marker must "
20452 "appear on a line of its own, without any preceeding or following characters "
20453 "(not even spaces)."
20457 #: ../fish/guestfish.pod:850
20459 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
20460 "upload local files (so-called \"FileIn\" parameters in the generator)."
20464 #: ../fish/guestfish.pod:853
20465 msgid "EXIT ON ERROR BEHAVIOUR"
20469 #: ../fish/guestfish.pod:855
20471 "By default, guestfish will ignore any errors when in interactive mode "
20472 "(ie. taking commands from a human over a tty), and will exit on the first "
20473 "error in non-interactive mode (scripts, commands given on the command line)."
20477 #: ../fish/guestfish.pod:860
20479 "If you prefix a command with a I<-> character, then that command will not "
20480 "cause guestfish to exit, even if that (one) command returns an error."
20484 #: ../fish/guestfish.pod:864
20485 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
20489 #: ../fish/guestfish.pod:866
20491 "Guestfish can be remote-controlled over a socket. This is useful "
20492 "particularly in shell scripts where you want to make several different "
20493 "changes to a filesystem, but you don't want the overhead of starting up a "
20494 "guestfish process each time."
20498 #: ../fish/guestfish.pod:871
20499 msgid "Start a guestfish server process using:"
20503 #: ../fish/guestfish.pod:873
20506 " eval \"`guestfish --listen`\"\n"
20511 #: ../fish/guestfish.pod:875
20512 msgid "and then send it commands by doing:"
20516 #: ../fish/guestfish.pod:877
20519 " guestfish --remote cmd [...]\n"
20524 #: ../fish/guestfish.pod:879
20525 msgid "To cause the server to exit, send it the exit command:"
20529 #: ../fish/guestfish.pod:881
20532 " guestfish --remote exit\n"
20537 #: ../fish/guestfish.pod:883
20539 "Note that the server will normally exit if there is an error in a command. "
20540 "You can change this in the usual way. See section L</EXIT ON ERROR "
20545 #: ../fish/guestfish.pod:887
20546 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
20550 #: ../fish/guestfish.pod:889
20552 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
20553 "is how the I<--remote> option knows where to send the commands. You can "
20554 "have several guestfish listener processes running using:"
20558 #: ../fish/guestfish.pod:893
20561 " eval \"`guestfish --listen`\"\n"
20562 " pid1=$GUESTFISH_PID\n"
20563 " eval \"`guestfish --listen`\"\n"
20564 " pid2=$GUESTFISH_PID\n"
20566 " guestfish --remote=$pid1 cmd\n"
20567 " guestfish --remote=$pid2 cmd\n"
20572 #: ../fish/guestfish.pod:901
20573 msgid "REMOTE CONTROL AND CSH"
20577 #: ../fish/guestfish.pod:903
20579 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
20584 #: ../fish/guestfish.pod:906
20587 " eval \"`guestfish --listen --csh`\"\n"
20592 #: ../fish/guestfish.pod:908
20593 msgid "REMOTE CONTROL DETAILS"
20597 #: ../fish/guestfish.pod:910
20599 "Remote control happens over a Unix domain socket called "
20600 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
20601 "of the process, and C<$PID> is the process ID of the server."
20605 #: ../fish/guestfish.pod:914
20606 msgid "Guestfish client and server versions must match exactly."
20610 #: ../fish/guestfish.pod:916
20611 msgid "PREPARED DISK IMAGES"
20615 #: ../fish/guestfish.pod:918
20617 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20618 "preformatted disk images that guestfish can make for you to save typing. "
20619 "This is particularly useful for testing purposes. This option is used "
20620 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20621 "can be mixed with I<-a>)."
20625 #: ../fish/guestfish.pod:924
20627 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20628 "the second and so on. Existing files in the current directory are "
20633 #: ../fish/guestfish.pod:928
20635 "The type briefly describes how the disk should be sized, partitioned, how "
20636 "filesystem(s) should be created, and how content should be added. "
20637 "Optionally the type can be followed by extra parameters, separated by C<:> "
20638 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
20639 "sparsely-allocated disk, containing a single partition, with the partition "
20640 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
20641 "on a 1GB disk instead."
20645 #: ../fish/guestfish.pod:936
20646 msgid "To list the available types and any extra parameters they take, run:"
20650 #: ../fish/guestfish.pod:940
20652 "Note that the prepared filesystem is not mounted. You would usually have to "
20653 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20657 #: ../fish/guestfish.pod:944
20659 "If any I<-N> or I<--new> options are given, the guest is automatically "
20664 #: ../fish/guestfish.pod:949
20665 msgid "Create a 100MB disk with an ext4-formatted partition:"
20669 #: ../fish/guestfish.pod:951
20672 " guestfish -N fs:ext4\n"
20677 #: ../fish/guestfish.pod:953
20678 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
20682 #: ../fish/guestfish.pod:955
20685 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
20690 #: ../fish/guestfish.pod:957
20691 msgid "Create a blank 200MB disk:"
20695 #: ../fish/guestfish.pod:959
20698 " guestfish -N disk:200M\n"
20703 #: ../fish/guestfish.pod:961
20704 msgid "PROGRESS BARS"
20708 #: ../fish/guestfish.pod:963
20710 "Some (not all) long-running commands send progress notification messages as "
20711 "they are running. Guestfish turns these messages into progress bars."
20715 #: ../fish/guestfish.pod:967
20717 "When a command that supports progress bars takes longer than two seconds to "
20718 "run, and if progress bars are enabled, then you will see one appearing below "
20723 #: ../fish/guestfish.pod:971
20726 " ><fs> copy-size /large-file /another-file 2048M\n"
20727 " / 10% [#####-----------------------------------------] 00:30\n"
20732 #: ../fish/guestfish.pod:974
20734 "The spinner on the left hand side moves round once for every progress "
20735 "notification received from the backend. This is a (reasonably) golden "
20736 "assurance that the command is \"doing something\" even if the progress bar "
20737 "is not moving, because the command is able to send the progress "
20738 "notifications. When the bar reaches 100% and the command finishes, the "
20739 "spinner disappears."
20743 #: ../fish/guestfish.pod:981
20745 "Progress bars are enabled by default when guestfish is used interactively. "
20746 "You can enable them even for non-interactive modes using I<--progress-bars>, "
20747 "and you can disable them completely using I<--no-progress-bars>."
20751 #: ../fish/guestfish.pod:986
20752 msgid "GUESTFISH COMMANDS"
20756 #: ../fish/guestfish.pod:988
20758 "The commands in this section are guestfish convenience commands, in other "
20759 "words, they are not part of the L<guestfs(3)> API."
20763 #: ../fish/guestfish.pod:991
20768 #: ../fish/guestfish.pod:993
20777 #: ../fish/guestfish.pod:996
20778 msgid "Without any parameter, this provides general help."
20782 #: ../fish/guestfish.pod:998
20783 msgid "With a C<cmd> parameter, this displays detailed help for that command."
20787 #: ../fish/guestfish.pod:1000
20788 msgid "quit | exit"
20792 #: ../fish/guestfish.pod:1002
20793 msgid "This exits guestfish. You can also use C<^D> key."
20797 #: ../fish/guestfish.pod:1004
20798 msgid "@FISH_COMMANDS@"
20802 #: ../fish/guestfish.pod:1006
20807 #: ../fish/guestfish.pod:1010 ../test-tool/libguestfs-test-tool.pod:77
20812 #: ../fish/guestfish.pod:1012
20814 "guestfish returns 0 if the commands completed without error, or 1 if there "
20819 #: ../fish/guestfish.pod:1019
20824 #: ../fish/guestfish.pod:1021
20826 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
20831 #: ../fish/guestfish.pod:1024
20832 msgid "GUESTFISH_PID"
20836 #: ../fish/guestfish.pod:1026
20838 "Used with the I<--remote> option to specify the remote guestfish process to "
20839 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
20843 #: ../fish/guestfish.pod:1030
20848 #: ../fish/guestfish.pod:1032
20850 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
20851 "not specified, the external L<hexedit(1)> program is used."
20855 #: ../fish/guestfish.pod:1036
20860 #: ../fish/guestfish.pod:1038
20862 "If compiled with GNU readline support, various files in the home directory "
20863 "can be used. See L</FILES>."
20867 #: ../fish/guestfish.pod:1047
20869 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
20870 "effect as using the B<-v> option."
20874 #: ../fish/guestfish.pod:1059
20876 "Set the path that guestfish uses to search for kernel and initrd.img. See "
20877 "the discussion of paths in L<guestfs(3)>."
20881 #: ../fish/guestfish.pod:1070
20882 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
20886 #: ../fish/guestfish.pod:1072
20891 #: ../fish/guestfish.pod:1074
20893 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
20898 #: ../fish/guestfish.pod:1090 ../fuse/guestmount.pod:252
20903 #: ../fish/guestfish.pod:1094 ../fuse/guestmount.pod:256
20904 msgid "$HOME/.libguestfs-tools.rc"
20908 #: ../fish/guestfish.pod:1096 ../fuse/guestmount.pod:258
20909 msgid "/etc/libguestfs-tools.conf"
20913 #: ../fish/guestfish.pod:1098 ../fuse/guestmount.pod:260
20915 "This configuration file controls the default read-only or read-write mode "
20916 "(I<--ro> or I<--rw>)."
20920 #: ../fish/guestfish.pod:1101
20921 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20925 #: ../fish/guestfish.pod:1103
20926 msgid "$HOME/.guestfish"
20930 #: ../fish/guestfish.pod:1105
20932 "If compiled with GNU readline support, then the command history is saved in "
20937 #: ../fish/guestfish.pod:1108
20938 msgid "$HOME/.inputrc"
20942 #: ../fish/guestfish.pod:1110
20943 msgid "/etc/inputrc"
20947 #: ../fish/guestfish.pod:1112
20949 "If compiled with GNU readline support, then these files can be used to "
20950 "configure readline. For further information, please see "
20951 "L<readline(3)/INITIALIZATION FILE>."
20955 #: ../fish/guestfish.pod:1116
20956 msgid "To write rules which only apply to guestfish, use:"
20960 #: ../fish/guestfish.pod:1118
20970 #: ../fish/guestfish.pod:1122
20972 "Variables that you can set in inputrc that change the behaviour of guestfish "
20973 "in useful ways include:"
20977 #: ../fish/guestfish.pod:1127
20978 msgid "completion-ignore-case (default: on)"
20982 #: ../fish/guestfish.pod:1129
20984 "By default, guestfish will ignore case when tab-completing paths on the "
20989 #: ../fish/guestfish.pod:1132
20992 " set completion-ignore-case off\n"
20997 #: ../fish/guestfish.pod:1134
20998 msgid "to make guestfish case sensitive."
21002 #: ../fish/guestfish.pod:1138
21007 #: ../fish/guestfish.pod:1140
21008 msgid "test2.img (etc)"
21012 #: ../fish/guestfish.pod:1142
21014 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
21015 "will be created in the file C<test1.img> in the current directory. The "
21016 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
21017 "the same name will be overwritten."
21021 #: ../fish/guestfish.pod:1151
21023 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, "
21024 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, "
21025 "L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
21026 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
21027 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
21028 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<hexedit(1)>."
21032 #: ../fish/guestfish.pod:1181 ../test-tool/libguestfs-test-tool.pod:102 ../fuse/guestmount.pod:287 ../tools/virt-edit.pl:518 ../tools/virt-win-reg.pl:606 ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309 ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:277
21034 "This program is free software; you can redistribute it and/or modify it "
21035 "under the terms of the GNU General Public License as published by the Free "
21036 "Software Foundation; either version 2 of the License, or (at your option) "
21037 "any later version."
21041 #: ../fish/guestfish.pod:1186 ../test-tool/libguestfs-test-tool.pod:107 ../fuse/guestmount.pod:292 ../tools/virt-edit.pl:523 ../tools/virt-win-reg.pl:611 ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314 ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:282
21043 "This program is distributed in the hope that it will be useful, but WITHOUT "
21044 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
21045 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
21050 #: ../fish/guestfish.pod:1191 ../test-tool/libguestfs-test-tool.pod:112 ../fuse/guestmount.pod:297 ../tools/virt-edit.pl:528 ../tools/virt-win-reg.pl:616 ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319 ../tools/virt-make-fs.pl:582 ../tools/virt-list-partitions.pl:287
21052 "You should have received a copy of the GNU General Public License along with "
21053 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
21054 "Ave, Cambridge, MA 02139, USA."
21058 #: ../fish/guestfish-actions.pod:1
21063 #: ../fish/guestfish-actions.pod:3
21066 " add-cdrom filename\n"
21071 #: ../fish/guestfish-actions.pod:15
21073 "This call checks for the existence of C<filename>. This stops you from "
21074 "specifying other types of drive which are supported by qemu such as C<nbd:> "
21075 "and C<http:> URLs. To specify those, use the general L</config> call "
21080 #: ../fish/guestfish-actions.pod:22
21082 "If you just want to add an ISO file (often you use this as an efficient way "
21083 "to transfer large files into the guest), then you should probably use "
21084 "L</add-drive-ro> instead."
21088 #: ../fish/guestfish-actions.pod:35
21093 #: ../fish/guestfish-actions.pod:37
21098 #: ../fish/guestfish-actions.pod:39
21101 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..]\n"
21106 #: ../fish/guestfish-actions.pod:41
21108 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
21109 "It works by connecting to libvirt, requesting the domain and domain XML from "
21110 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
21114 #: ../fish/guestfish-actions.pod:71
21116 "The other optional parameters are passed directly through to "
21117 "L</add-drive-opts>."
21121 #: ../fish/guestfish-actions.pod:74 ../fish/guestfish-actions.pod:138 ../fish/guestfish-actions.pod:3047
21123 "This command has one or more optional arguments. See L</OPTIONAL "
21128 #: ../fish/guestfish-actions.pod:76
21133 #: ../fish/guestfish-actions.pod:78
21136 " add-drive filename\n"
21141 #: ../fish/guestfish-actions.pod:80
21143 "This function is the equivalent of calling L</add-drive-opts> with no "
21144 "optional parameters, so the disk is added writable, with the format being "
21145 "detected automatically."
21149 #: ../fish/guestfish-actions.pod:84
21151 "Automatic detection of the format opens you up to a potential security hole "
21152 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
21153 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
21154 "you should think about replacing calls to this function with calls to "
21155 "L</add-drive-opts>, and specifying the format."
21159 #: ../fish/guestfish-actions.pod:91
21160 msgid "add-drive-opts"
21164 #: ../fish/guestfish-actions.pod:93
21169 #: ../fish/guestfish-actions.pod:95
21172 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
21177 #: ../fish/guestfish-actions.pod:122
21179 "This forces the image format. If you omit this (or use L</add-drive> or "
21180 "L</add-drive-ro>) then the format is automatically detected. Possible "
21181 "formats include C<raw> and C<qcow2>."
21185 #: ../fish/guestfish-actions.pod:133
21187 "This rarely-used option lets you emulate the behaviour of the deprecated "
21188 "L</add-drive-with-if> call (q.v.)"
21192 #: ../fish/guestfish-actions.pod:140
21193 msgid "add-drive-ro"
21197 #: ../fish/guestfish-actions.pod:142
21202 #: ../fish/guestfish-actions.pod:144
21205 " add-drive-ro filename\n"
21210 #: ../fish/guestfish-actions.pod:146
21212 "This function is the equivalent of calling L</add-drive-opts> with the "
21213 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
21214 "is added read-only, with the format being detected automatically."
21218 #: ../fish/guestfish-actions.pod:151
21219 msgid "add-drive-ro-with-if"
21223 #: ../fish/guestfish-actions.pod:153
21226 " add-drive-ro-with-if filename iface\n"
21231 #: ../fish/guestfish-actions.pod:155
21233 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
21234 "interface emulation to use at run time."
21238 #: ../fish/guestfish-actions.pod:165
21239 msgid "add-drive-with-if"
21243 #: ../fish/guestfish-actions.pod:167
21246 " add-drive-with-if filename iface\n"
21251 #: ../fish/guestfish-actions.pod:169
21253 "This is the same as L</add-drive> but it allows you to specify the QEMU "
21254 "interface emulation to use at run time."
21258 #: ../fish/guestfish-actions.pod:179
21263 #: ../fish/guestfish-actions.pod:181
21266 " aug-clear augpath\n"
21271 #: ../fish/guestfish-actions.pod:186
21276 #: ../fish/guestfish-actions.pod:188
21284 #: ../fish/guestfish-actions.pod:190
21286 "Close the current Augeas handle and free up any resources used by it. After "
21287 "calling this, you have to call L</aug-init> again before you can use any "
21288 "other Augeas functions."
21292 #: ../fish/guestfish-actions.pod:195
21293 msgid "aug-defnode"
21297 #: ../fish/guestfish-actions.pod:197
21300 " aug-defnode name expr val\n"
21305 #: ../fish/guestfish-actions.pod:202
21307 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
21308 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
21309 "containing that single node."
21313 #: ../fish/guestfish-actions.pod:210
21318 #: ../fish/guestfish-actions.pod:212
21321 " aug-defvar name expr\n"
21326 #: ../fish/guestfish-actions.pod:221
21331 #: ../fish/guestfish-actions.pod:223
21334 " aug-get augpath\n"
21339 #: ../fish/guestfish-actions.pod:228
21344 #: ../fish/guestfish-actions.pod:230
21347 " aug-init root flags\n"
21352 #: ../fish/guestfish-actions.pod:236
21353 msgid "You must call this before using any other L</aug-*> commands."
21357 #: ../fish/guestfish-actions.pod:271
21358 msgid "Do not load the tree in L</aug-init>."
21362 #: ../fish/guestfish-actions.pod:275
21363 msgid "To close the handle, you can call L</aug-close>."
21367 #: ../fish/guestfish-actions.pod:279
21372 #: ../fish/guestfish-actions.pod:281
21375 " aug-insert augpath label true|false\n"
21380 #: ../fish/guestfish-actions.pod:291
21385 #: ../fish/guestfish-actions.pod:293
21393 #: ../fish/guestfish-actions.pod:300
21398 #: ../fish/guestfish-actions.pod:302
21401 " aug-ls augpath\n"
21406 #: ../fish/guestfish-actions.pod:304
21408 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
21409 "resulting nodes into alphabetical order."
21413 #: ../fish/guestfish-actions.pod:307
21418 #: ../fish/guestfish-actions.pod:309
21421 " aug-match augpath\n"
21426 #: ../fish/guestfish-actions.pod:315
21431 #: ../fish/guestfish-actions.pod:317
21434 " aug-mv src dest\n"
21439 #: ../fish/guestfish-actions.pod:322
21444 #: ../fish/guestfish-actions.pod:324
21447 " aug-rm augpath\n"
21452 #: ../fish/guestfish-actions.pod:330
21457 #: ../fish/guestfish-actions.pod:332
21465 #: ../fish/guestfish-actions.pod:336
21467 "The flags which were passed to L</aug-init> affect exactly how files are "
21472 #: ../fish/guestfish-actions.pod:339
21477 #: ../fish/guestfish-actions.pod:341
21480 " aug-set augpath val\n"
21485 #: ../fish/guestfish-actions.pod:345
21487 "In the Augeas API, it is possible to clear a node by setting the value to "
21488 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
21489 "this call. Instead you must use the L</aug-clear> call."
21493 #: ../fish/guestfish-actions.pod:350
21498 #: ../fish/guestfish-actions.pod:352
21501 " available 'groups ...'\n"
21506 #: ../fish/guestfish-actions.pod:358
21508 "The libguestfs groups, and the functions that those groups correspond to, "
21509 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
21510 "runtime by calling L</available-all-groups>."
21514 #: ../fish/guestfish-actions.pod:382
21515 msgid "You must call L</launch> before calling this function."
21519 #: ../fish/guestfish-actions.pod:404
21521 "This call was added in version C<1.0.80>. In previous versions of "
21522 "libguestfs all you could do would be to speculatively execute a command to "
21523 "find out if the daemon implemented it. See also L</version>."
21527 #: ../fish/guestfish-actions.pod:411
21528 msgid "available-all-groups"
21532 #: ../fish/guestfish-actions.pod:413
21535 " available-all-groups\n"
21540 #: ../fish/guestfish-actions.pod:415
21542 "This command returns a list of all optional groups that this daemon knows "
21543 "about. Note this returns both supported and unsupported groups. To find "
21544 "out which ones the daemon can actually support you have to call "
21545 "L</available> on each member of the returned list."
21549 #: ../fish/guestfish-actions.pod:421
21550 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
21554 #: ../fish/guestfish-actions.pod:423
21559 #: ../fish/guestfish-actions.pod:425
21562 " base64-in (base64file|-) filename\n"
21567 #: ../fish/guestfish-actions.pod:430 ../fish/guestfish-actions.pod:439 ../fish/guestfish-actions.pod:663 ../fish/guestfish-actions.pod:832 ../fish/guestfish-actions.pod:851 ../fish/guestfish-actions.pod:1228 ../fish/guestfish-actions.pod:4445 ../fish/guestfish-actions.pod:4457 ../fish/guestfish-actions.pod:4468 ../fish/guestfish-actions.pod:4479 ../fish/guestfish-actions.pod:4531 ../fish/guestfish-actions.pod:4540 ../fish/guestfish-actions.pod:4594 ../fish/guestfish-actions.pod:4617
21568 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
21572 #: ../fish/guestfish-actions.pod:432
21577 #: ../fish/guestfish-actions.pod:434
21580 " base64-out filename (base64file|-)\n"
21585 #: ../fish/guestfish-actions.pod:441
21586 msgid "blockdev-flushbufs"
21590 #: ../fish/guestfish-actions.pod:443
21593 " blockdev-flushbufs device\n"
21598 #: ../fish/guestfish-actions.pod:450
21599 msgid "blockdev-getbsz"
21603 #: ../fish/guestfish-actions.pod:452
21606 " blockdev-getbsz device\n"
21611 #: ../fish/guestfish-actions.pod:461
21612 msgid "blockdev-getro"
21616 #: ../fish/guestfish-actions.pod:463
21619 " blockdev-getro device\n"
21624 #: ../fish/guestfish-actions.pod:470
21625 msgid "blockdev-getsize64"
21629 #: ../fish/guestfish-actions.pod:472
21632 " blockdev-getsize64 device\n"
21637 #: ../fish/guestfish-actions.pod:476
21638 msgid "See also L</blockdev-getsz>."
21642 #: ../fish/guestfish-actions.pod:480
21643 msgid "blockdev-getss"
21647 #: ../fish/guestfish-actions.pod:482
21650 " blockdev-getss device\n"
21655 #: ../fish/guestfish-actions.pod:487
21656 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
21660 #: ../fish/guestfish-actions.pod:492
21661 msgid "blockdev-getsz"
21665 #: ../fish/guestfish-actions.pod:494
21668 " blockdev-getsz device\n"
21673 #: ../fish/guestfish-actions.pod:499
21675 "See also L</blockdev-getss> for the real sector size of the device, and "
21676 "L</blockdev-getsize64> for the more useful I<size in bytes>."
21680 #: ../fish/guestfish-actions.pod:505
21681 msgid "blockdev-rereadpt"
21685 #: ../fish/guestfish-actions.pod:507
21688 " blockdev-rereadpt device\n"
21693 #: ../fish/guestfish-actions.pod:513
21694 msgid "blockdev-setbsz"
21698 #: ../fish/guestfish-actions.pod:515
21701 " blockdev-setbsz device blocksize\n"
21706 #: ../fish/guestfish-actions.pod:524
21707 msgid "blockdev-setro"
21711 #: ../fish/guestfish-actions.pod:526
21714 " blockdev-setro device\n"
21719 #: ../fish/guestfish-actions.pod:532
21720 msgid "blockdev-setrw"
21724 #: ../fish/guestfish-actions.pod:534
21727 " blockdev-setrw device\n"
21732 #: ../fish/guestfish-actions.pod:540
21733 msgid "case-sensitive-path"
21737 #: ../fish/guestfish-actions.pod:542
21740 " case-sensitive-path path\n"
21745 #: ../fish/guestfish-actions.pod:566
21747 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
21748 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
21749 "how the directories were originally created under Windows)."
21753 #: ../fish/guestfish-actions.pod:574
21754 msgid "See also L</realpath>."
21758 #: ../fish/guestfish-actions.pod:576
21763 #: ../fish/guestfish-actions.pod:578
21771 #: ../fish/guestfish-actions.pod:582
21773 "Note that this function cannot correctly handle binary files (specifically, "
21774 "files containing C<\\0> character which is treated as end of string). For "
21775 "those you need to use the L</read-file> or L</download> functions which have "
21776 "a more complex interface."
21780 #: ../fish/guestfish-actions.pod:590
21785 #: ../fish/guestfish-actions.pod:592
21788 " checksum csumtype path\n"
21793 #: ../fish/guestfish-actions.pod:635
21794 msgid "To get the checksum for a device, use L</checksum-device>."
21798 #: ../fish/guestfish-actions.pod:637
21799 msgid "To get the checksums for many files, use L</checksums-out>."
21803 #: ../fish/guestfish-actions.pod:639
21804 msgid "checksum-device"
21808 #: ../fish/guestfish-actions.pod:641
21811 " checksum-device csumtype device\n"
21816 #: ../fish/guestfish-actions.pod:643
21818 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
21819 "device named C<device>. For the types of checksums supported see the "
21820 "L</checksum> command."
21824 #: ../fish/guestfish-actions.pod:647
21825 msgid "checksums-out"
21829 #: ../fish/guestfish-actions.pod:649
21832 " checksums-out csumtype directory (sumsfile|-)\n"
21837 #: ../fish/guestfish-actions.pod:665
21842 #: ../fish/guestfish-actions.pod:667
21845 " chmod mode path\n"
21850 #: ../fish/guestfish-actions.pod:678
21855 #: ../fish/guestfish-actions.pod:680
21858 " chown owner group path\n"
21863 #: ../fish/guestfish-actions.pod:688
21868 #: ../fish/guestfish-actions.pod:690
21871 " command 'arguments ...'\n"
21876 #: ../fish/guestfish-actions.pod:697
21878 "The single parameter is an argv-style list of arguments. The first element "
21879 "is the name of the program to run. Subsequent elements are parameters. The "
21880 "list must be non-empty (ie. must contain a program name). Note that the "
21881 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
21885 #: ../fish/guestfish-actions.pod:725
21886 msgid "command-lines"
21890 #: ../fish/guestfish-actions.pod:727
21893 " command-lines 'arguments ...'\n"
21898 #: ../fish/guestfish-actions.pod:729
21899 msgid "This is the same as L</command>, but splits the result into a list of lines."
21903 #: ../fish/guestfish-actions.pod:732
21904 msgid "See also: L</sh-lines>"
21908 #: ../fish/guestfish-actions.pod:737
21913 #: ../fish/guestfish-actions.pod:739
21916 " config qemuparam qemuvalue\n"
21921 #: ../fish/guestfish-actions.pod:750
21926 #: ../fish/guestfish-actions.pod:752
21929 " copy-size src dest size\n"
21934 #: ../fish/guestfish-actions.pod:760
21939 #: ../fish/guestfish-actions.pod:762
21947 #: ../fish/guestfish-actions.pod:767
21952 #: ../fish/guestfish-actions.pod:769
21960 #: ../fish/guestfish-actions.pod:774
21965 #: ../fish/guestfish-actions.pod:776
21973 #: ../fish/guestfish-actions.pod:783
21975 "If the destination is a device, it must be as large or larger than the "
21976 "source file or device, otherwise the copy will fail. This command cannot do "
21977 "partial copies (see L</copy-size>)."
21981 #: ../fish/guestfish-actions.pod:787
21986 #: ../fish/guestfish-actions.pod:789
21994 #: ../fish/guestfish-actions.pod:793 ../fish/guestfish-actions.pod:804
21996 "This command is mostly useful for interactive sessions. It is I<not> "
21997 "intended that you try to parse the output string. Use L</statvfs> from "
22002 #: ../fish/guestfish-actions.pod:797
22007 #: ../fish/guestfish-actions.pod:799
22015 #: ../fish/guestfish-actions.pod:808
22020 #: ../fish/guestfish-actions.pod:810
22028 #: ../fish/guestfish-actions.pod:816
22030 "Another way to get the same information is to enable verbose messages with "
22031 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
22032 "before running the program."
22036 #: ../fish/guestfish-actions.pod:821
22041 #: ../fish/guestfish-actions.pod:823
22044 " download remotefilename (filename|-)\n"
22049 #: ../fish/guestfish-actions.pod:830
22050 msgid "See also L</upload>, L</cat>."
22054 #: ../fish/guestfish-actions.pod:834
22055 msgid "download-offset"
22059 #: ../fish/guestfish-actions.pod:836
22062 " download-offset remotefilename (filename|-) offset size\n"
22067 #: ../fish/guestfish-actions.pod:844
22069 "Note that there is no limit on the amount of data that can be downloaded "
22070 "with this call, unlike with L</pread>, and this call always reads the full "
22071 "amount unless an error occurs."
22075 #: ../fish/guestfish-actions.pod:849
22076 msgid "See also L</download>, L</pread>."
22080 #: ../fish/guestfish-actions.pod:853
22081 msgid "drop-caches"
22085 #: ../fish/guestfish-actions.pod:855
22088 " drop-caches whattodrop\n"
22093 #: ../fish/guestfish-actions.pod:867
22098 #: ../fish/guestfish-actions.pod:869
22106 #: ../fish/guestfish-actions.pod:881
22111 #: ../fish/guestfish-actions.pod:883
22114 " e2fsck-f device\n"
22119 #: ../fish/guestfish-actions.pod:889
22121 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
22122 "should use L</fsck>."
22126 #: ../fish/guestfish-actions.pod:892
22127 msgid "echo-daemon"
22131 #: ../fish/guestfish-actions.pod:894
22134 " echo-daemon 'words ...'\n"
22139 #: ../fish/guestfish-actions.pod:901
22140 msgid "See also L</ping-daemon>."
22144 #: ../fish/guestfish-actions.pod:903
22149 #: ../fish/guestfish-actions.pod:905
22152 " egrep regex path\n"
22157 #: ../fish/guestfish-actions.pod:913
22162 #: ../fish/guestfish-actions.pod:915
22165 " egrepi regex path\n"
22170 #: ../fish/guestfish-actions.pod:923
22175 #: ../fish/guestfish-actions.pod:925
22178 " equal file1 file2\n"
22183 #: ../fish/guestfish-actions.pod:932
22188 #: ../fish/guestfish-actions.pod:934
22196 #: ../fish/guestfish-actions.pod:939
22197 msgid "See also L</is-file>, L</is-dir>, L</stat>."
22201 #: ../fish/guestfish-actions.pod:941
22206 #: ../fish/guestfish-actions.pod:943
22209 " fallocate path len\n"
22214 #: ../fish/guestfish-actions.pod:960
22215 msgid "fallocate64"
22219 #: ../fish/guestfish-actions.pod:962
22222 " fallocate64 path len\n"
22227 #: ../fish/guestfish-actions.pod:968
22229 "Note that this call allocates disk blocks for the file. To create a sparse "
22230 "file use L</truncate-size> instead."
22234 #: ../fish/guestfish-actions.pod:971
22236 "The deprecated call L</fallocate> does the same, but owing to an oversight "
22237 "it only allowed 30 bit lengths to be specified, effectively limiting the "
22238 "maximum size of files created through that call to 1GB."
22242 #: ../fish/guestfish-actions.pod:980
22247 #: ../fish/guestfish-actions.pod:982
22250 " fgrep pattern path\n"
22255 #: ../fish/guestfish-actions.pod:990
22260 #: ../fish/guestfish-actions.pod:992
22263 " fgrepi pattern path\n"
22268 #: ../fish/guestfish-actions.pod:1000
22273 #: ../fish/guestfish-actions.pod:1002
22281 #: ../fish/guestfish-actions.pod:1014
22283 "This command can also be used on C</dev/> devices (and partitions, LV "
22284 "names). You can for example use this to determine if a device contains a "
22285 "filesystem, although it's usually better to use L</vfs-type>."
22289 #: ../fish/guestfish-actions.pod:1024
22290 msgid "file-architecture"
22294 #: ../fish/guestfish-actions.pod:1026
22297 " file-architecture filename\n"
22302 #: ../fish/guestfish-actions.pod:1129
22307 #: ../fish/guestfish-actions.pod:1131
22315 #: ../fish/guestfish-actions.pod:1135
22317 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
22318 "L</is-file> etc. To get the size of block devices, use "
22319 "L</blockdev-getsize64>."
22323 #: ../fish/guestfish-actions.pod:1139
22328 #: ../fish/guestfish-actions.pod:1141
22331 " fill c len path\n"
22336 #: ../fish/guestfish-actions.pod:1147
22338 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
22339 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
22340 "L</fill-pattern>."
22344 #: ../fish/guestfish-actions.pod:1152
22345 msgid "fill-pattern"
22349 #: ../fish/guestfish-actions.pod:1154
22352 " fill-pattern pattern len path\n"
22357 #: ../fish/guestfish-actions.pod:1156
22359 "This function is like L</fill> except that it creates a new file of length "
22360 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
22361 "is truncated if necessary to ensure the length of the file is exactly C<len> "
22366 #: ../fish/guestfish-actions.pod:1161
22371 #: ../fish/guestfish-actions.pod:1163
22374 " find directory\n"
22379 #: ../fish/guestfish-actions.pod:1177
22380 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
22384 #: ../fish/guestfish-actions.pod:1190
22385 msgid "See also L</find0>."
22389 #: ../fish/guestfish-actions.pod:1195
22394 #: ../fish/guestfish-actions.pod:1197
22397 " find0 directory (files|-)\n"
22402 #: ../fish/guestfish-actions.pod:1203
22403 msgid "This command works the same way as L</find> with the following exceptions:"
22407 #: ../fish/guestfish-actions.pod:1230
22408 msgid "findfs-label"
22412 #: ../fish/guestfish-actions.pod:1232
22415 " findfs-label label\n"
22420 #: ../fish/guestfish-actions.pod:1238
22421 msgid "To find the label of a filesystem, use L</vfs-label>."
22425 #: ../fish/guestfish-actions.pod:1240
22426 msgid "findfs-uuid"
22430 #: ../fish/guestfish-actions.pod:1242
22433 " findfs-uuid uuid\n"
22438 #: ../fish/guestfish-actions.pod:1248
22439 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
22443 #: ../fish/guestfish-actions.pod:1250
22448 #: ../fish/guestfish-actions.pod:1252
22451 " fsck fstype device\n"
22456 #: ../fish/guestfish-actions.pod:1282
22461 #: ../fish/guestfish-actions.pod:1284
22469 #: ../fish/guestfish-actions.pod:1291
22470 msgid "get-attach-method"
22474 #: ../fish/guestfish-actions.pod:1293
22477 " get-attach-method\n"
22482 #: ../fish/guestfish-actions.pod:1295
22483 msgid "Return the current attach method. See L</set-attach-method>."
22487 #: ../fish/guestfish-actions.pod:1297
22488 msgid "get-autosync"
22492 #: ../fish/guestfish-actions.pod:1299
22500 #: ../fish/guestfish-actions.pod:1303
22505 #: ../fish/guestfish-actions.pod:1305
22513 #: ../fish/guestfish-actions.pod:1309
22514 msgid "get-e2label"
22518 #: ../fish/guestfish-actions.pod:1311
22521 " get-e2label device\n"
22526 #: ../fish/guestfish-actions.pod:1323
22531 #: ../fish/guestfish-actions.pod:1325
22534 " get-e2uuid device\n"
22539 #: ../fish/guestfish-actions.pod:1337
22540 msgid "get-memsize"
22544 #: ../fish/guestfish-actions.pod:1339
22552 #: ../fish/guestfish-actions.pod:1344
22554 "If L</set-memsize> was not called on this handle, and if "
22555 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
22556 "value for memsize."
22560 #: ../fish/guestfish-actions.pod:1351
22561 msgid "get-network"
22565 #: ../fish/guestfish-actions.pod:1353
22573 #: ../fish/guestfish-actions.pod:1357
22578 #: ../fish/guestfish-actions.pod:1359
22586 #: ../fish/guestfish-actions.pod:1366
22591 #: ../fish/guestfish-actions.pod:1368
22596 #: ../fish/guestfish-actions.pod:1370
22604 #: ../fish/guestfish-actions.pod:1377
22609 #: ../fish/guestfish-actions.pod:1379
22617 #: ../fish/guestfish-actions.pod:1386
22618 msgid "get-recovery-proc"
22622 #: ../fish/guestfish-actions.pod:1388
22625 " get-recovery-proc\n"
22630 #: ../fish/guestfish-actions.pod:1392
22631 msgid "get-selinux"
22635 #: ../fish/guestfish-actions.pod:1394
22643 #: ../fish/guestfish-actions.pod:1396
22645 "This returns the current setting of the selinux flag which is passed to the "
22646 "appliance at boot time. See L</set-selinux>."
22650 #: ../fish/guestfish-actions.pod:1402
22655 #: ../fish/guestfish-actions.pod:1404
22663 #: ../fish/guestfish-actions.pod:1411
22668 #: ../fish/guestfish-actions.pod:1413
22676 #: ../fish/guestfish-actions.pod:1417
22681 #: ../fish/guestfish-actions.pod:1419
22689 #: ../fish/guestfish-actions.pod:1421
22691 "Return the current umask. By default the umask is C<022> unless it has been "
22692 "set by calling L</umask>."
22696 #: ../fish/guestfish-actions.pod:1424
22697 msgid "get-verbose"
22701 #: ../fish/guestfish-actions.pod:1426
22709 #: ../fish/guestfish-actions.pod:1430
22714 #: ../fish/guestfish-actions.pod:1432
22722 #: ../fish/guestfish-actions.pod:1436
22723 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
22727 #: ../fish/guestfish-actions.pod:1439
22732 #: ../fish/guestfish-actions.pod:1441
22735 " getxattr path name\n"
22740 #: ../fish/guestfish-actions.pod:1443
22742 "Get a single extended attribute from file C<path> named C<name>. This call "
22743 "follows symlinks. If you want to lookup an extended attribute for the "
22744 "symlink itself, use L</lgetxattr>."
22748 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2453
22750 "Normally it is better to get all extended attributes from a file in one go "
22751 "by calling L</getxattrs>. However some Linux filesystem implementations are "
22752 "buggy and do not provide a way to list out attributes. For these "
22753 "filesystems (notably ntfs-3g) you have to know the names of the extended "
22754 "attributes you want in advance and call this function."
22758 #: ../fish/guestfish-actions.pod:1457
22759 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
22763 #: ../fish/guestfish-actions.pod:1459
22768 #: ../fish/guestfish-actions.pod:1461
22771 " getxattrs path\n"
22776 #: ../fish/guestfish-actions.pod:1469
22777 msgid "See also: L</lgetxattrs>, L<attr(5)>."
22781 #: ../fish/guestfish-actions.pod:1471
22782 msgid "glob-expand"
22786 #: ../fish/guestfish-actions.pod:1473
22789 " glob-expand pattern\n"
22794 #: ../fish/guestfish-actions.pod:1486
22799 #: ../fish/guestfish-actions.pod:1488
22802 " grep regex path\n"
22807 #: ../fish/guestfish-actions.pod:1496
22812 #: ../fish/guestfish-actions.pod:1498
22815 " grepi regex path\n"
22820 #: ../fish/guestfish-actions.pod:1506
22821 msgid "grub-install"
22825 #: ../fish/guestfish-actions.pod:1508
22828 " grub-install root device\n"
22833 #: ../fish/guestfish-actions.pod:1524
22838 #: ../fish/guestfish-actions.pod:1526
22846 #: ../fish/guestfish-actions.pod:1534
22851 #: ../fish/guestfish-actions.pod:1536
22854 " head-n nrlines path\n"
22859 #: ../fish/guestfish-actions.pod:1549
22864 #: ../fish/guestfish-actions.pod:1551
22872 #: ../fish/guestfish-actions.pod:1559
22877 #: ../fish/guestfish-actions.pod:1561
22880 " initrd-cat initrdpath filename\n"
22885 #: ../fish/guestfish-actions.pod:1573
22886 msgid "See also L</initrd-list>."
22890 #: ../fish/guestfish-actions.pod:1578
22891 msgid "initrd-list"
22895 #: ../fish/guestfish-actions.pod:1580
22898 " initrd-list path\n"
22903 #: ../fish/guestfish-actions.pod:1592
22904 msgid "inotify-add-watch"
22908 #: ../fish/guestfish-actions.pod:1594
22911 " inotify-add-watch path mask\n"
22916 #: ../fish/guestfish-actions.pod:1606
22917 msgid "inotify-close"
22921 #: ../fish/guestfish-actions.pod:1608
22929 #: ../fish/guestfish-actions.pod:1614
22930 msgid "inotify-files"
22934 #: ../fish/guestfish-actions.pod:1616
22942 #: ../fish/guestfish-actions.pod:1618
22944 "This function is a helpful wrapper around L</inotify-read> which just "
22945 "returns a list of pathnames of objects that were touched. The returned "
22946 "pathnames are sorted and deduplicated."
22950 #: ../fish/guestfish-actions.pod:1622
22951 msgid "inotify-init"
22955 #: ../fish/guestfish-actions.pod:1624
22958 " inotify-init maxevents\n"
22963 #: ../fish/guestfish-actions.pod:1630
22965 "C<maxevents> is the maximum number of events which will be queued up between "
22966 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
22967 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
22968 "default was 16384 events. Beyond this limit, the kernel throws away events, "
22969 "but records the fact that it threw them away by setting a flag "
22970 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
22974 #: ../fish/guestfish-actions.pod:1640
22976 "Before any events are generated, you have to add some watches to the "
22977 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
22978 "L</inotify-watch-all>."
22982 #: ../fish/guestfish-actions.pod:1646
22984 "Queued up events should be read periodically by calling L</inotify-read> (or "
22985 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
22986 "If you don't read the events out often enough then you risk the internal "
22987 "queue overflowing."
22991 #: ../fish/guestfish-actions.pod:1653
22993 "The handle should be closed after use by calling L</inotify-close>. This "
22994 "also removes any watches automatically."
22998 #: ../fish/guestfish-actions.pod:1662
22999 msgid "inotify-read"
23003 #: ../fish/guestfish-actions.pod:1664
23011 #: ../fish/guestfish-actions.pod:1677
23012 msgid "inotify-rm-watch"
23016 #: ../fish/guestfish-actions.pod:1679
23019 " inotify-rm-watch wd\n"
23024 #: ../fish/guestfish-actions.pod:1681
23025 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
23029 #: ../fish/guestfish-actions.pod:1684
23030 msgid "inspect-get-arch"
23034 #: ../fish/guestfish-actions.pod:1686
23037 " inspect-get-arch root\n"
23042 #: ../fish/guestfish-actions.pod:1688 ../fish/guestfish-actions.pod:1704 ../fish/guestfish-actions.pod:1790 ../fish/guestfish-actions.pod:1826 ../fish/guestfish-actions.pod:1844 ../fish/guestfish-actions.pod:1878 ../fish/guestfish-actions.pod:1893 ../fish/guestfish-actions.pod:1914 ../fish/guestfish-actions.pod:1929 ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1984 ../fish/guestfish-actions.pod:2008 ../fish/guestfish-actions.pod:2025 ../fish/guestfish-actions.pod:2068 ../fish/guestfish-actions.pod:2103 ../fish/guestfish-actions.pod:2119 ../fish/guestfish-actions.pod:2135 ../fish/guestfish-actions.pod:2148 ../fish/guestfish-actions.pod:2161 ../fish/guestfish-actions.pod:2176
23044 "This function should only be called with a root device string as returned by "
23049 #: ../fish/guestfish-actions.pod:1691
23051 "This returns the architecture of the inspected operating system. The "
23052 "possible return values are listed under L</file-architecture>."
23056 #: ../fish/guestfish-actions.pod:1700
23057 msgid "inspect-get-distro"
23061 #: ../fish/guestfish-actions.pod:1702
23064 " inspect-get-distro root\n"
23069 #: ../fish/guestfish-actions.pod:1786
23070 msgid "inspect-get-drive-mappings"
23074 #: ../fish/guestfish-actions.pod:1788
23077 " inspect-get-drive-mappings root\n"
23082 #: ../fish/guestfish-actions.pod:1818
23084 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23085 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
23089 #: ../fish/guestfish-actions.pod:1822
23090 msgid "inspect-get-filesystems"
23094 #: ../fish/guestfish-actions.pod:1824
23097 " inspect-get-filesystems root\n"
23102 #: ../fish/guestfish-actions.pod:1837
23104 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23105 "L</inspect-get-mountpoints>."
23109 #: ../fish/guestfish-actions.pod:1840
23110 msgid "inspect-get-format"
23114 #: ../fish/guestfish-actions.pod:1842
23117 " inspect-get-format root\n"
23122 #: ../fish/guestfish-actions.pod:1874
23123 msgid "inspect-get-hostname"
23127 #: ../fish/guestfish-actions.pod:1876
23130 " inspect-get-hostname root\n"
23135 #: ../fish/guestfish-actions.pod:1889
23136 msgid "inspect-get-major-version"
23140 #: ../fish/guestfish-actions.pod:1891
23143 " inspect-get-major-version root\n"
23148 #: ../fish/guestfish-actions.pod:1910
23149 msgid "inspect-get-minor-version"
23153 #: ../fish/guestfish-actions.pod:1912
23156 " inspect-get-minor-version root\n"
23161 #: ../fish/guestfish-actions.pod:1922
23163 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23164 "L</inspect-get-major-version>."
23168 #: ../fish/guestfish-actions.pod:1925
23169 msgid "inspect-get-mountpoints"
23173 #: ../fish/guestfish-actions.pod:1927
23176 " inspect-get-mountpoints root\n"
23181 #: ../fish/guestfish-actions.pod:1949
23183 "For operating systems like Windows which still use drive letters, this call "
23184 "will only return an entry for the first drive \"mounted on\" C</>. For "
23185 "information about the mapping of drive letters to partitions, see "
23186 "L</inspect-get-drive-mappings>."
23190 #: ../fish/guestfish-actions.pod:1955
23192 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23193 "L</inspect-get-filesystems>."
23197 #: ../fish/guestfish-actions.pod:1958
23198 msgid "inspect-get-package-format"
23202 #: ../fish/guestfish-actions.pod:1960
23205 " inspect-get-package-format root\n"
23210 #: ../fish/guestfish-actions.pod:1965
23212 "This function and L</inspect-get-package-management> return the package "
23213 "format and package management tool used by the inspected operating system. "
23214 "For example for Fedora these functions would return C<rpm> (package format) "
23215 "and C<yum> (package management)."
23219 #: ../fish/guestfish-actions.pod:1980
23220 msgid "inspect-get-package-management"
23224 #: ../fish/guestfish-actions.pod:1982
23227 " inspect-get-package-management root\n"
23232 #: ../fish/guestfish-actions.pod:1987
23234 "L</inspect-get-package-format> and this function return the package format "
23235 "and package management tool used by the inspected operating system. For "
23236 "example for Fedora these functions would return C<rpm> (package format) and "
23237 "C<yum> (package management)."
23241 #: ../fish/guestfish-actions.pod:2004
23242 msgid "inspect-get-product-name"
23246 #: ../fish/guestfish-actions.pod:2006
23249 " inspect-get-product-name root\n"
23254 #: ../fish/guestfish-actions.pod:2021
23255 msgid "inspect-get-product-variant"
23259 #: ../fish/guestfish-actions.pod:2023
23262 " inspect-get-product-variant root\n"
23267 #: ../fish/guestfish-actions.pod:2047
23269 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
23270 "L</inspect-get-product-name>, L</inspect-get-major-version>."
23274 #: ../fish/guestfish-actions.pod:2051
23275 msgid "inspect-get-roots"
23279 #: ../fish/guestfish-actions.pod:2053
23282 " inspect-get-roots\n"
23287 #: ../fish/guestfish-actions.pod:2055
23289 "This function is a convenient way to get the list of root devices, as "
23290 "returned from a previous call to L</inspect-os>, but without redoing the "
23291 "whole inspection process."
23295 #: ../fish/guestfish-actions.pod:2059
23297 "This returns an empty list if either no root devices were found or the "
23298 "caller has not called L</inspect-os>."
23302 #: ../fish/guestfish-actions.pod:2064
23303 msgid "inspect-get-type"
23307 #: ../fish/guestfish-actions.pod:2066
23310 " inspect-get-type root\n"
23315 #: ../fish/guestfish-actions.pod:2099
23316 msgid "inspect-get-windows-current-control-set"
23320 #: ../fish/guestfish-actions.pod:2101
23323 " inspect-get-windows-current-control-set root\n"
23328 #: ../fish/guestfish-actions.pod:2115
23329 msgid "inspect-get-windows-systemroot"
23333 #: ../fish/guestfish-actions.pod:2117
23336 " inspect-get-windows-systemroot root\n"
23341 #: ../fish/guestfish-actions.pod:2131
23342 msgid "inspect-is-live"
23346 #: ../fish/guestfish-actions.pod:2133
23349 " inspect-is-live root\n"
23354 #: ../fish/guestfish-actions.pod:2138
23356 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
23357 "then this returns true if a live image was detected on the disk."
23361 #: ../fish/guestfish-actions.pod:2144
23362 msgid "inspect-is-multipart"
23366 #: ../fish/guestfish-actions.pod:2146
23369 " inspect-is-multipart root\n"
23374 #: ../fish/guestfish-actions.pod:2151
23376 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
23377 "then this returns true if the disk is part of a set."
23381 #: ../fish/guestfish-actions.pod:2157
23382 msgid "inspect-is-netinst"
23386 #: ../fish/guestfish-actions.pod:2159
23389 " inspect-is-netinst root\n"
23394 #: ../fish/guestfish-actions.pod:2164
23396 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
23397 "then this returns true if the disk is a network installer, ie. not a "
23398 "self-contained install CD but one which is likely to require network access "
23399 "to complete the install."
23403 #: ../fish/guestfish-actions.pod:2172
23404 msgid "inspect-list-applications"
23408 #: ../fish/guestfish-actions.pod:2174
23411 " inspect-list-applications root\n"
23416 #: ../fish/guestfish-actions.pod:2181
23418 "I<Note:> This call works differently from other parts of the inspection "
23419 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
23420 "then mount up the disks, before calling this. Listing applications is a "
23421 "significantly more difficult operation which requires access to the full "
23422 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
23423 "are just returning data cached in the libguestfs handle, this call actually "
23424 "reads parts of the mounted filesystems during the call."
23428 #: ../fish/guestfish-actions.pod:2271
23433 #: ../fish/guestfish-actions.pod:2273
23441 #: ../fish/guestfish-actions.pod:2288
23443 "You can pass the root string(s) returned to other L</inspect-get-*> "
23444 "functions in order to query further information about each operating system, "
23445 "such as the name and version."
23449 #: ../fish/guestfish-actions.pod:2293
23451 "This function uses other libguestfs features such as L</mount-ro> and "
23452 "L</umount-all> in order to mount and unmount filesystems and look at the "
23453 "contents. This should be called with no disks currently mounted. The "
23454 "function may also use Augeas, so any existing Augeas handle will be closed."
23458 #: ../fish/guestfish-actions.pod:2305 ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2527
23459 msgid "See also L</list-filesystems>."
23463 #: ../fish/guestfish-actions.pod:2307
23464 msgid "is-blockdev"
23468 #: ../fish/guestfish-actions.pod:2309
23471 " is-blockdev path\n"
23476 #: ../fish/guestfish-actions.pod:2314 ../fish/guestfish-actions.pod:2332 ../fish/guestfish-actions.pod:2351 ../fish/guestfish-actions.pod:2360 ../fish/guestfish-actions.pod:2370 ../fish/guestfish-actions.pod:2404 ../fish/guestfish-actions.pod:2413
23477 msgid "See also L</stat>."
23481 #: ../fish/guestfish-actions.pod:2316
23486 #: ../fish/guestfish-actions.pod:2318
23494 #: ../fish/guestfish-actions.pod:2325
23499 #: ../fish/guestfish-actions.pod:2327
23502 " is-chardev path\n"
23507 #: ../fish/guestfish-actions.pod:2334
23512 #: ../fish/guestfish-actions.pod:2336
23520 #: ../fish/guestfish-actions.pod:2343
23525 #: ../fish/guestfish-actions.pod:2345
23533 #: ../fish/guestfish-actions.pod:2353
23538 #: ../fish/guestfish-actions.pod:2355
23546 #: ../fish/guestfish-actions.pod:2362
23551 #: ../fish/guestfish-actions.pod:2364
23559 #: ../fish/guestfish-actions.pod:2372
23560 msgid "is-launching"
23564 #: ../fish/guestfish-actions.pod:2374
23572 #: ../fish/guestfish-actions.pod:2381
23577 #: ../fish/guestfish-actions.pod:2383
23585 #: ../fish/guestfish-actions.pod:2388
23590 #: ../fish/guestfish-actions.pod:2390
23598 #: ../fish/guestfish-actions.pod:2397
23603 #: ../fish/guestfish-actions.pod:2399
23606 " is-socket path\n"
23611 #: ../fish/guestfish-actions.pod:2406
23616 #: ../fish/guestfish-actions.pod:2408
23619 " is-symlink path\n"
23624 #: ../fish/guestfish-actions.pod:2415
23625 msgid "kill-subprocess"
23629 #: ../fish/guestfish-actions.pod:2417
23632 " kill-subprocess\n"
23637 #: ../fish/guestfish-actions.pod:2421
23642 #: ../fish/guestfish-actions.pod:2423
23647 #: ../fish/guestfish-actions.pod:2425
23655 #: ../fish/guestfish-actions.pod:2433
23660 #: ../fish/guestfish-actions.pod:2435
23663 " lchown owner group path\n"
23668 #: ../fish/guestfish-actions.pod:2437
23670 "Change the file owner to C<owner> and group to C<group>. This is like "
23671 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
23676 #: ../fish/guestfish-actions.pod:2445
23681 #: ../fish/guestfish-actions.pod:2447
23684 " lgetxattr path name\n"
23689 #: ../fish/guestfish-actions.pod:2463
23690 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
23694 #: ../fish/guestfish-actions.pod:2465
23699 #: ../fish/guestfish-actions.pod:2467
23702 " lgetxattrs path\n"
23707 #: ../fish/guestfish-actions.pod:2469
23709 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
23710 "it returns the extended attributes of the link itself."
23714 #: ../fish/guestfish-actions.pod:2473
23715 msgid "list-devices"
23719 #: ../fish/guestfish-actions.pod:2475
23727 #: ../fish/guestfish-actions.pod:2483
23728 msgid "list-filesystems"
23732 #: ../fish/guestfish-actions.pod:2485
23735 " list-filesystems\n"
23740 #: ../fish/guestfish-actions.pod:2504
23742 "This command runs other libguestfs commands, which might include L</mount> "
23743 "and L</umount>, and therefore you should use this soon after launch and only "
23744 "when nothing is mounted."
23748 #: ../fish/guestfish-actions.pod:2508
23750 "Not all of the filesystems returned will be mountable. In particular, swap "
23751 "partitions are returned in the list. Also this command does not check that "
23752 "each filesystem found is valid and mountable, and some filesystems might be "
23753 "mountable but require special options. Filesystems may not all belong to a "
23754 "single logical operating system (use L</inspect-os> to look for OSes)."
23758 #: ../fish/guestfish-actions.pod:2516
23759 msgid "list-partitions"
23763 #: ../fish/guestfish-actions.pod:2518
23766 " list-partitions\n"
23771 #: ../fish/guestfish-actions.pod:2524
23773 "This does not return logical volumes. For that you will need to call "
23778 #: ../fish/guestfish-actions.pod:2529
23783 #: ../fish/guestfish-actions.pod:2531
23791 #: ../fish/guestfish-actions.pod:2539
23796 #: ../fish/guestfish-actions.pod:2541
23799 " ln target linkname\n"
23804 #: ../fish/guestfish-actions.pod:2545
23809 #: ../fish/guestfish-actions.pod:2547
23812 " ln-f target linkname\n"
23817 #: ../fish/guestfish-actions.pod:2552
23822 #: ../fish/guestfish-actions.pod:2554
23825 " ln-s target linkname\n"
23830 #: ../fish/guestfish-actions.pod:2558
23835 #: ../fish/guestfish-actions.pod:2560
23838 " ln-sf target linkname\n"
23843 #: ../fish/guestfish-actions.pod:2565
23844 msgid "lremovexattr"
23848 #: ../fish/guestfish-actions.pod:2567
23851 " lremovexattr xattr path\n"
23856 #: ../fish/guestfish-actions.pod:2569
23858 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
23859 "it removes an extended attribute of the link itself."
23863 #: ../fish/guestfish-actions.pod:2573
23868 #: ../fish/guestfish-actions.pod:2575
23876 #: ../fish/guestfish-actions.pod:2581
23878 "This command is mostly useful for interactive sessions. Programs should "
23879 "probably use L</readdir> instead."
23883 #: ../fish/guestfish-actions.pod:2584
23888 #: ../fish/guestfish-actions.pod:2586
23891 " lsetxattr xattr val vallen path\n"
23896 #: ../fish/guestfish-actions.pod:2588
23898 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
23899 "sets an extended attribute of the link itself."
23903 #: ../fish/guestfish-actions.pod:2592
23908 #: ../fish/guestfish-actions.pod:2594
23916 #: ../fish/guestfish-actions.pod:2598
23918 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
23919 "the link is stat-ed, not the file it refers to."
23923 #: ../fish/guestfish-actions.pod:2604
23928 #: ../fish/guestfish-actions.pod:2606
23931 " lstatlist path 'names ...'\n"
23936 #: ../fish/guestfish-actions.pod:2608
23938 "This call allows you to perform the L</lstat> operation on multiple files, "
23939 "where all files are in the directory C<path>. C<names> is the list of files "
23940 "from this directory."
23944 #: ../fish/guestfish-actions.pod:2617
23946 "This call is intended for programs that want to efficiently list a directory "
23947 "contents without making many round-trips. See also L</lxattrlist> for a "
23948 "similarly efficient call for getting extended attributes. Very long "
23949 "directory listings might cause the protocol message size to be exceeded, "
23950 "causing this call to fail. The caller must split up such requests into "
23951 "smaller groups of names."
23955 #: ../fish/guestfish-actions.pod:2625
23956 msgid "luks-add-key"
23960 #: ../fish/guestfish-actions.pod:2627
23963 " luks-add-key device keyslot\n"
23968 #: ../fish/guestfish-actions.pod:2634
23970 "Note that if C<keyslot> already contains a key, then this command will "
23971 "fail. You have to use L</luks-kill-slot> first to remove that key."
23975 #: ../fish/guestfish-actions.pod:2638 ../fish/guestfish-actions.pod:2660 ../fish/guestfish-actions.pod:2673 ../fish/guestfish-actions.pod:2687 ../fish/guestfish-actions.pod:2710 ../fish/guestfish-actions.pod:2720
23977 "This command has one or more key or passphrase parameters. Guestfish will "
23978 "prompt for these separately."
23982 #: ../fish/guestfish-actions.pod:2641
23987 #: ../fish/guestfish-actions.pod:2643
23990 " luks-close device\n"
23995 #: ../fish/guestfish-actions.pod:2645
23997 "This closes a LUKS device that was created earlier by L</luks-open> or "
23998 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
23999 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
24000 "underlying block device."
24004 #: ../fish/guestfish-actions.pod:2651
24005 msgid "luks-format"
24009 #: ../fish/guestfish-actions.pod:2653
24012 " luks-format device keyslot\n"
24017 #: ../fish/guestfish-actions.pod:2666
24018 msgid "luks-format-cipher"
24022 #: ../fish/guestfish-actions.pod:2668
24025 " luks-format-cipher device keyslot cipher\n"
24030 #: ../fish/guestfish-actions.pod:2670
24032 "This command is the same as L</luks-format> but it also allows you to set "
24033 "the C<cipher> used."
24037 #: ../fish/guestfish-actions.pod:2679
24038 msgid "luks-kill-slot"
24042 #: ../fish/guestfish-actions.pod:2681
24045 " luks-kill-slot device keyslot\n"
24050 #: ../fish/guestfish-actions.pod:2690
24055 #: ../fish/guestfish-actions.pod:2692
24058 " luks-open device mapname\n"
24063 #: ../fish/guestfish-actions.pod:2706
24065 "If this block device contains LVM volume groups, then calling L</vgscan> "
24066 "followed by L</vg-activate-all> will make them visible."
24070 #: ../fish/guestfish-actions.pod:2713
24071 msgid "luks-open-ro"
24075 #: ../fish/guestfish-actions.pod:2715
24078 " luks-open-ro device mapname\n"
24083 #: ../fish/guestfish-actions.pod:2717
24085 "This is the same as L</luks-open> except that a read-only mapping is "
24090 #: ../fish/guestfish-actions.pod:2723
24095 #: ../fish/guestfish-actions.pod:2725
24098 " lvcreate logvol volgroup mbytes\n"
24103 #: ../fish/guestfish-actions.pod:2730
24104 msgid "lvm-canonical-lv-name"
24108 #: ../fish/guestfish-actions.pod:2732
24111 " lvm-canonical-lv-name lvname\n"
24116 #: ../fish/guestfish-actions.pod:2741
24117 msgid "See also L</is-lv>."
24121 #: ../fish/guestfish-actions.pod:2743
24122 msgid "lvm-clear-filter"
24126 #: ../fish/guestfish-actions.pod:2745
24129 " lvm-clear-filter\n"
24134 #: ../fish/guestfish-actions.pod:2747
24136 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
24141 #: ../fish/guestfish-actions.pod:2753
24142 msgid "lvm-remove-all"
24146 #: ../fish/guestfish-actions.pod:2755
24149 " lvm-remove-all\n"
24154 #: ../fish/guestfish-actions.pod:2763
24155 msgid "lvm-set-filter"
24159 #: ../fish/guestfish-actions.pod:2765
24162 " lvm-set-filter 'devices ...'\n"
24167 #: ../fish/guestfish-actions.pod:2790
24172 #: ../fish/guestfish-actions.pod:2792
24175 " lvremove device\n"
24180 #: ../fish/guestfish-actions.pod:2800
24185 #: ../fish/guestfish-actions.pod:2802
24188 " lvrename logvol newlogvol\n"
24193 #: ../fish/guestfish-actions.pod:2806
24198 #: ../fish/guestfish-actions.pod:2808
24201 " lvresize device mbytes\n"
24206 #: ../fish/guestfish-actions.pod:2814
24207 msgid "lvresize-free"
24211 #: ../fish/guestfish-actions.pod:2816
24214 " lvresize-free lv percent\n"
24219 #: ../fish/guestfish-actions.pod:2824
24224 #: ../fish/guestfish-actions.pod:2826
24232 #: ../fish/guestfish-actions.pod:2834
24233 msgid "See also L</lvs-full>, L</list-filesystems>."
24237 #: ../fish/guestfish-actions.pod:2836
24242 #: ../fish/guestfish-actions.pod:2838
24250 #: ../fish/guestfish-actions.pod:2843
24255 #: ../fish/guestfish-actions.pod:2845
24263 #: ../fish/guestfish-actions.pod:2849
24268 #: ../fish/guestfish-actions.pod:2851
24271 " lxattrlist path 'names ...'\n"
24276 #: ../fish/guestfish-actions.pod:2867
24278 "This call is intended for programs that want to efficiently list a directory "
24279 "contents without making many round-trips. See also L</lstatlist> for a "
24280 "similarly efficient call for getting standard stats. Very long directory "
24281 "listings might cause the protocol message size to be exceeded, causing this "
24282 "call to fail. The caller must split up such requests into smaller groups of "
24287 #: ../fish/guestfish-actions.pod:2875
24292 #: ../fish/guestfish-actions.pod:2877
24300 #: ../fish/guestfish-actions.pod:2881
24305 #: ../fish/guestfish-actions.pod:2883
24308 " mkdir-mode path mode\n"
24313 #: ../fish/guestfish-actions.pod:2892
24314 msgid "See also L</mkdir>, L</umask>"
24318 #: ../fish/guestfish-actions.pod:2894
24323 #: ../fish/guestfish-actions.pod:2896
24331 #: ../fish/guestfish-actions.pod:2901
24336 #: ../fish/guestfish-actions.pod:2903
24339 " mkdtemp template\n"
24344 #: ../fish/guestfish-actions.pod:2924
24349 #: ../fish/guestfish-actions.pod:2926
24352 " mke2fs-J fstype blocksize device journal\n"
24357 #: ../fish/guestfish-actions.pod:2934
24358 msgid "See also L</mke2journal>."
24362 #: ../fish/guestfish-actions.pod:2936
24367 #: ../fish/guestfish-actions.pod:2938
24370 " mke2fs-JL fstype blocksize device label\n"
24375 #: ../fish/guestfish-actions.pod:2943
24376 msgid "See also L</mke2journal-L>."
24380 #: ../fish/guestfish-actions.pod:2945
24385 #: ../fish/guestfish-actions.pod:2947
24388 " mke2fs-JU fstype blocksize device uuid\n"
24393 #: ../fish/guestfish-actions.pod:2952
24394 msgid "See also L</mke2journal-U>."
24398 #: ../fish/guestfish-actions.pod:2954
24399 msgid "mke2journal"
24403 #: ../fish/guestfish-actions.pod:2956
24406 " mke2journal blocksize device\n"
24411 #: ../fish/guestfish-actions.pod:2963
24412 msgid "mke2journal-L"
24416 #: ../fish/guestfish-actions.pod:2965
24419 " mke2journal-L blocksize label device\n"
24424 #: ../fish/guestfish-actions.pod:2969
24425 msgid "mke2journal-U"
24429 #: ../fish/guestfish-actions.pod:2971
24432 " mke2journal-U blocksize uuid device\n"
24437 #: ../fish/guestfish-actions.pod:2975
24442 #: ../fish/guestfish-actions.pod:2977
24445 " mkfifo mode path\n"
24450 #: ../fish/guestfish-actions.pod:2979
24452 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
24453 "is just a convenient wrapper around L</mknod>."
24457 #: ../fish/guestfish-actions.pod:2985
24462 #: ../fish/guestfish-actions.pod:2987
24465 " mkfs fstype device\n"
24470 #: ../fish/guestfish-actions.pod:2993
24475 #: ../fish/guestfish-actions.pod:2995
24478 " mkfs-b fstype blocksize device\n"
24483 #: ../fish/guestfish-actions.pod:2997
24485 "This call is similar to L</mkfs>, but it allows you to control the block "
24486 "size of the resulting filesystem. Supported block sizes depend on the "
24487 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
24491 #: ../fish/guestfish-actions.pod:3012
24496 #: ../fish/guestfish-actions.pod:3014
24499 " mkfs-opts fstype device [blocksize:..] [features:..]\n"
24504 #: ../fish/guestfish-actions.pod:3049
24505 msgid "mkmountpoint"
24509 #: ../fish/guestfish-actions.pod:3051
24512 " mkmountpoint exemptpath\n"
24517 #: ../fish/guestfish-actions.pod:3053
24519 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
24520 "to create extra mountpoints before mounting the first filesystem."
24524 #: ../fish/guestfish-actions.pod:3077
24526 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
24527 "unexpected errors if you try to mix these calls. It is safest to manually "
24528 "unmount filesystems and remove mountpoints after use."
24532 #: ../fish/guestfish-actions.pod:3081
24534 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
24535 "for this to work for manual mountpoints, you must ensure that the innermost "
24536 "mountpoints have the longest pathnames, as in the example code above."
24540 #: ../fish/guestfish-actions.pod:3088
24542 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
24543 "L</umount-all> to be called when the handle is closed which can also trigger "
24548 #: ../fish/guestfish-actions.pod:3092
24553 #: ../fish/guestfish-actions.pod:3094
24556 " mknod mode devmajor devminor path\n"
24561 #: ../fish/guestfish-actions.pod:3104
24563 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
24564 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
24565 "regular file). These constants are available in the standard Linux header "
24566 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
24567 "wrappers around this command which bitwise OR in the appropriate constant "
24572 #: ../fish/guestfish-actions.pod:3114
24577 #: ../fish/guestfish-actions.pod:3116
24580 " mknod-b mode devmajor devminor path\n"
24585 #: ../fish/guestfish-actions.pod:3118
24587 "This call creates a block device node called C<path> with mode C<mode> and "
24588 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
24589 "wrapper around L</mknod>."
24593 #: ../fish/guestfish-actions.pod:3124
24598 #: ../fish/guestfish-actions.pod:3126
24601 " mknod-c mode devmajor devminor path\n"
24606 #: ../fish/guestfish-actions.pod:3128
24608 "This call creates a char device node called C<path> with mode C<mode> and "
24609 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
24610 "wrapper around L</mknod>."
24614 #: ../fish/guestfish-actions.pod:3134
24619 #: ../fish/guestfish-actions.pod:3136
24627 #: ../fish/guestfish-actions.pod:3140
24632 #: ../fish/guestfish-actions.pod:3142
24635 " mkswap-L label device\n"
24640 #: ../fish/guestfish-actions.pod:3150
24645 #: ../fish/guestfish-actions.pod:3152
24648 " mkswap-U uuid device\n"
24653 #: ../fish/guestfish-actions.pod:3156
24654 msgid "mkswap-file"
24658 #: ../fish/guestfish-actions.pod:3158
24661 " mkswap-file path\n"
24666 #: ../fish/guestfish-actions.pod:3162
24668 "This command just writes a swap file signature to an existing file. To "
24669 "create the file itself, use something like L</fallocate>."
24673 #: ../fish/guestfish-actions.pod:3165
24678 #: ../fish/guestfish-actions.pod:3167
24681 " modprobe modulename\n"
24686 #: ../fish/guestfish-actions.pod:3174
24691 #: ../fish/guestfish-actions.pod:3176
24694 " mount device mountpoint\n"
24699 #: ../fish/guestfish-actions.pod:3192
24701 "B<Important note:> When you use this call, the filesystem options C<sync> "
24702 "and C<noatime> are set implicitly. This was originally done because we "
24703 "thought it would improve reliability, but it turns out that I<-o sync> has a "
24704 "very large negative performance impact and negligible effect on "
24705 "reliability. Therefore we recommend that you avoid using L</mount> in any "
24706 "code that needs performance, and instead use L</mount-options> (use an empty "
24707 "string for the first parameter if you don't want any options)."
24711 #: ../fish/guestfish-actions.pod:3202
24716 #: ../fish/guestfish-actions.pod:3204
24719 " mount-loop file mountpoint\n"
24724 #: ../fish/guestfish-actions.pod:3210
24725 msgid "mount-options"
24729 #: ../fish/guestfish-actions.pod:3212
24732 " mount-options options device mountpoint\n"
24737 #: ../fish/guestfish-actions.pod:3214
24739 "This is the same as the L</mount> command, but it allows you to set the "
24740 "mount options as for the L<mount(8)> I<-o> flag."
24744 #: ../fish/guestfish-actions.pod:3222
24749 #: ../fish/guestfish-actions.pod:3224
24752 " mount-ro device mountpoint\n"
24757 #: ../fish/guestfish-actions.pod:3226
24759 "This is the same as the L</mount> command, but it mounts the filesystem with "
24760 "the read-only (I<-o ro>) flag."
24764 #: ../fish/guestfish-actions.pod:3229
24769 #: ../fish/guestfish-actions.pod:3231
24772 " mount-vfs options vfstype device mountpoint\n"
24777 #: ../fish/guestfish-actions.pod:3233
24779 "This is the same as the L</mount> command, but it allows you to set both the "
24780 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
24784 #: ../fish/guestfish-actions.pod:3237
24785 msgid "mountpoints"
24789 #: ../fish/guestfish-actions.pod:3239
24797 #: ../fish/guestfish-actions.pod:3241
24799 "This call is similar to L</mounts>. That call returns a list of devices. "
24800 "This one returns a hash table (map) of device name to directory where the "
24801 "device is mounted."
24805 #: ../fish/guestfish-actions.pod:3245
24810 #: ../fish/guestfish-actions.pod:3247
24818 #: ../fish/guestfish-actions.pod:3254
24819 msgid "See also: L</mountpoints>"
24823 #: ../fish/guestfish-actions.pod:3256
24828 #: ../fish/guestfish-actions.pod:3258
24836 #: ../fish/guestfish-actions.pod:3263
24837 msgid "ntfs-3g-probe"
24841 #: ../fish/guestfish-actions.pod:3265
24844 " ntfs-3g-probe true|false device\n"
24849 #: ../fish/guestfish-actions.pod:3279
24854 #: ../fish/guestfish-actions.pod:3281
24857 " ntfsresize device\n"
24862 #: ../fish/guestfish-actions.pod:3287
24863 msgid "ntfsresize-size"
24867 #: ../fish/guestfish-actions.pod:3289
24870 " ntfsresize-size device size\n"
24875 #: ../fish/guestfish-actions.pod:3291
24877 "This command is the same as L</ntfsresize> except that it allows you to "
24878 "specify the new size (in bytes) explicitly."
24882 #: ../fish/guestfish-actions.pod:3294
24887 #: ../fish/guestfish-actions.pod:3296
24890 " part-add device prlogex startsect endsect\n"
24895 #: ../fish/guestfish-actions.pod:3298
24897 "This command adds a partition to C<device>. If there is no partition table "
24898 "on the device, call L</part-init> first."
24902 #: ../fish/guestfish-actions.pod:3310
24904 "Creating a partition which covers the whole disk is not so easy. Use "
24905 "L</part-disk> to do that."
24909 #: ../fish/guestfish-actions.pod:3313
24914 #: ../fish/guestfish-actions.pod:3315
24917 " part-del device partnum\n"
24922 #: ../fish/guestfish-actions.pod:3323
24927 #: ../fish/guestfish-actions.pod:3325
24930 " part-disk device parttype\n"
24935 #: ../fish/guestfish-actions.pod:3327
24937 "This command is simply a combination of L</part-init> followed by "
24938 "L</part-add> to create a single primary partition covering the whole disk."
24942 #: ../fish/guestfish-actions.pod:3331
24944 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
24945 "possible values are described in L</part-init>."
24949 #: ../fish/guestfish-actions.pod:3337
24950 msgid "part-get-bootable"
24954 #: ../fish/guestfish-actions.pod:3339
24957 " part-get-bootable device partnum\n"
24962 #: ../fish/guestfish-actions.pod:3344
24963 msgid "See also L</part-set-bootable>."
24967 #: ../fish/guestfish-actions.pod:3346
24968 msgid "part-get-mbr-id"
24972 #: ../fish/guestfish-actions.pod:3348
24975 " part-get-mbr-id device partnum\n"
24980 #: ../fish/guestfish-actions.pod:3353 ../fish/guestfish-actions.pod:3491
24982 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
24983 "undefined results for other partition table types (see "
24984 "L</part-get-parttype>)."
24988 #: ../fish/guestfish-actions.pod:3357
24989 msgid "part-get-parttype"
24993 #: ../fish/guestfish-actions.pod:3359
24996 " part-get-parttype device\n"
25001 #: ../fish/guestfish-actions.pod:3364
25003 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
25004 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
25005 "possible, although unusual. See L</part-init> for a full list."
25009 #: ../fish/guestfish-actions.pod:3369
25014 #: ../fish/guestfish-actions.pod:3371
25017 " part-init device parttype\n"
25022 #: ../fish/guestfish-actions.pod:3377
25024 "Initially there are no partitions. Following this, you should call "
25025 "L</part-add> for each partition required."
25029 #: ../fish/guestfish-actions.pod:3440
25034 #: ../fish/guestfish-actions.pod:3442
25037 " part-list device\n"
25042 #: ../fish/guestfish-actions.pod:3457
25044 "Start of the partition I<in bytes>. To get sectors you have to divide by "
25045 "the device's sector size, see L</blockdev-getss>."
25049 #: ../fish/guestfish-actions.pod:3470
25050 msgid "part-set-bootable"
25054 #: ../fish/guestfish-actions.pod:3472
25057 " part-set-bootable device partnum true|false\n"
25062 #: ../fish/guestfish-actions.pod:3481
25063 msgid "part-set-mbr-id"
25067 #: ../fish/guestfish-actions.pod:3483
25070 " part-set-mbr-id device partnum idbyte\n"
25075 #: ../fish/guestfish-actions.pod:3495
25076 msgid "part-set-name"
25080 #: ../fish/guestfish-actions.pod:3497
25083 " part-set-name device partnum name\n"
25088 #: ../fish/guestfish-actions.pod:3505
25089 msgid "part-to-dev"
25093 #: ../fish/guestfish-actions.pod:3507
25096 " part-to-dev partition\n"
25101 #: ../fish/guestfish-actions.pod:3513
25103 "The named partition must exist, for example as a string returned from "
25104 "L</list-partitions>."
25108 #: ../fish/guestfish-actions.pod:3516
25109 msgid "ping-daemon"
25113 #: ../fish/guestfish-actions.pod:3518
25121 #: ../fish/guestfish-actions.pod:3525
25126 #: ../fish/guestfish-actions.pod:3527
25129 " pread path count offset\n"
25134 #: ../fish/guestfish-actions.pod:3535
25135 msgid "See also L</pwrite>, L</pread-device>."
25139 #: ../fish/guestfish-actions.pod:3540
25140 msgid "pread-device"
25144 #: ../fish/guestfish-actions.pod:3542
25147 " pread-device device count offset\n"
25152 #: ../fish/guestfish-actions.pod:3550
25153 msgid "See also L</pread>."
25157 #: ../fish/guestfish-actions.pod:3555
25162 #: ../fish/guestfish-actions.pod:3557
25165 " pvcreate device\n"
25170 #: ../fish/guestfish-actions.pod:3563
25175 #: ../fish/guestfish-actions.pod:3565
25178 " pvremove device\n"
25183 #: ../fish/guestfish-actions.pod:3574
25188 #: ../fish/guestfish-actions.pod:3576
25191 " pvresize device\n"
25196 #: ../fish/guestfish-actions.pod:3581
25197 msgid "pvresize-size"
25201 #: ../fish/guestfish-actions.pod:3583
25204 " pvresize-size device size\n"
25209 #: ../fish/guestfish-actions.pod:3585
25211 "This command is the same as L</pvresize> except that it allows you to "
25212 "specify the new size (in bytes) explicitly."
25216 #: ../fish/guestfish-actions.pod:3588
25221 #: ../fish/guestfish-actions.pod:3590
25229 #: ../fish/guestfish-actions.pod:3598
25230 msgid "See also L</pvs-full>."
25234 #: ../fish/guestfish-actions.pod:3600
25239 #: ../fish/guestfish-actions.pod:3602
25247 #: ../fish/guestfish-actions.pod:3607
25252 #: ../fish/guestfish-actions.pod:3609
25260 #: ../fish/guestfish-actions.pod:3613
25265 #: ../fish/guestfish-actions.pod:3615
25268 " pwrite path content offset\n"
25273 #: ../fish/guestfish-actions.pod:3626
25274 msgid "See also L</pread>, L</pwrite-device>."
25278 #: ../fish/guestfish-actions.pod:3631
25279 msgid "pwrite-device"
25283 #: ../fish/guestfish-actions.pod:3633
25286 " pwrite-device device content offset\n"
25291 #: ../fish/guestfish-actions.pod:3643
25292 msgid "See also L</pwrite>."
25296 #: ../fish/guestfish-actions.pod:3648
25301 #: ../fish/guestfish-actions.pod:3650
25304 " read-file path\n"
25309 #: ../fish/guestfish-actions.pod:3655
25311 "Unlike L</cat>, this function can correctly handle files that contain "
25312 "embedded ASCII NUL characters. However unlike L</download>, this function "
25313 "is limited in the total size of file that can be handled."
25317 #: ../fish/guestfish-actions.pod:3663
25322 #: ../fish/guestfish-actions.pod:3665
25325 " read-lines path\n"
25330 #: ../fish/guestfish-actions.pod:3672
25332 "Note that this function cannot correctly handle binary files (specifically, "
25333 "files containing C<\\0> character which is treated as end of line). For "
25334 "those you need to use the L</read-file> function which has a more complex "
25339 #: ../fish/guestfish-actions.pod:3677
25344 #: ../fish/guestfish-actions.pod:3679
25352 #: ../fish/guestfish-actions.pod:3731
25354 "This function is primarily intended for use by programs. To get a simple "
25355 "list of names, use L</ls>. To get a printable directory for human "
25356 "consumption, use L</ll>."
25360 #: ../fish/guestfish-actions.pod:3735
25365 #: ../fish/guestfish-actions.pod:3737
25373 #: ../fish/guestfish-actions.pod:3741
25374 msgid "readlinklist"
25378 #: ../fish/guestfish-actions.pod:3743
25381 " readlinklist path 'names ...'\n"
25386 #: ../fish/guestfish-actions.pod:3767
25391 #: ../fish/guestfish-actions.pod:3769
25399 #: ../fish/guestfish-actions.pod:3774
25400 msgid "removexattr"
25404 #: ../fish/guestfish-actions.pod:3776
25407 " removexattr xattr path\n"
25412 #: ../fish/guestfish-actions.pod:3781
25413 msgid "See also: L</lremovexattr>, L<attr(5)>."
25417 #: ../fish/guestfish-actions.pod:3783
25422 #: ../fish/guestfish-actions.pod:3785
25425 " resize2fs device\n"
25430 #: ../fish/guestfish-actions.pod:3790
25432 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
25433 "before calling this command. For unknown reasons C<resize2fs> sometimes "
25434 "gives an error about this and sometimes not. In any case, it is always safe "
25435 "to call L</e2fsck-f> before calling this function."
25439 #: ../fish/guestfish-actions.pod:3796
25440 msgid "resize2fs-M"
25444 #: ../fish/guestfish-actions.pod:3798
25447 " resize2fs-M device\n"
25452 #: ../fish/guestfish-actions.pod:3800
25454 "This command is the same as L</resize2fs>, but the filesystem is resized to "
25455 "its minimum size. This works like the C<-M> option to the C<resize2fs> "
25460 #: ../fish/guestfish-actions.pod:3804
25462 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
25463 "and read the C<Block size> and C<Block count> values. These two numbers, "
25464 "multiplied together, give the resulting size of the minimal filesystem in "
25469 #: ../fish/guestfish-actions.pod:3809
25470 msgid "resize2fs-size"
25474 #: ../fish/guestfish-actions.pod:3811
25477 " resize2fs-size device size\n"
25482 #: ../fish/guestfish-actions.pod:3813
25484 "This command is the same as L</resize2fs> except that it allows you to "
25485 "specify the new size (in bytes) explicitly."
25489 #: ../fish/guestfish-actions.pod:3816
25494 #: ../fish/guestfish-actions.pod:3818
25502 #: ../fish/guestfish-actions.pod:3822
25507 #: ../fish/guestfish-actions.pod:3824
25515 #: ../fish/guestfish-actions.pod:3830
25520 #: ../fish/guestfish-actions.pod:3832
25528 #: ../fish/guestfish-actions.pod:3836
25529 msgid "rmmountpoint"
25533 #: ../fish/guestfish-actions.pod:3838
25536 " rmmountpoint exemptpath\n"
25541 #: ../fish/guestfish-actions.pod:3840
25543 "This calls removes a mountpoint that was previously created with "
25544 "L</mkmountpoint>. See L</mkmountpoint> for full details."
25548 #: ../fish/guestfish-actions.pod:3844
25549 msgid "scrub-device"
25553 #: ../fish/guestfish-actions.pod:3846
25556 " scrub-device device\n"
25561 #: ../fish/guestfish-actions.pod:3857
25566 #: ../fish/guestfish-actions.pod:3859
25569 " scrub-file file\n"
25574 #: ../fish/guestfish-actions.pod:3869
25575 msgid "scrub-freespace"
25579 #: ../fish/guestfish-actions.pod:3871
25582 " scrub-freespace dir\n"
25587 #: ../fish/guestfish-actions.pod:3873
25589 "This command creates the directory C<dir> and then fills it with files until "
25590 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
25591 "deletes them. The intention is to scrub any free space on the partition "
25592 "containing C<dir>."
25596 #: ../fish/guestfish-actions.pod:3882
25601 #: ../fish/guestfish-actions.pod:3884
25606 #: ../fish/guestfish-actions.pod:3886
25609 " set-append append\n"
25614 #: ../fish/guestfish-actions.pod:3897
25615 msgid "set-attach-method"
25619 #: ../fish/guestfish-actions.pod:3899
25620 msgid "attach-method"
25624 #: ../fish/guestfish-actions.pod:3901
25627 " set-attach-method attachmethod\n"
25632 #: ../fish/guestfish-actions.pod:3923
25633 msgid "set-autosync"
25637 #: ../fish/guestfish-actions.pod:3925
25642 #: ../fish/guestfish-actions.pod:3927
25645 " set-autosync true|false\n"
25650 #: ../fish/guestfish-actions.pod:3937
25655 #: ../fish/guestfish-actions.pod:3939
25660 #: ../fish/guestfish-actions.pod:3941
25663 " set-direct true|false\n"
25668 #: ../fish/guestfish-actions.pod:3947
25670 "One consequence of this is that log messages aren't caught by the library "
25671 "and handled by L</set-log-message-callback>, but go straight to stdout."
25675 #: ../fish/guestfish-actions.pod:3956
25676 msgid "set-e2label"
25680 #: ../fish/guestfish-actions.pod:3958
25683 " set-e2label device label\n"
25688 #: ../fish/guestfish-actions.pod:3964
25690 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
25691 "label on a filesystem."
25695 #: ../fish/guestfish-actions.pod:3967
25700 #: ../fish/guestfish-actions.pod:3969
25703 " set-e2uuid device uuid\n"
25708 #: ../fish/guestfish-actions.pod:3976
25710 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
25711 "UUID of a filesystem."
25715 #: ../fish/guestfish-actions.pod:3979
25716 msgid "set-memsize"
25720 #: ../fish/guestfish-actions.pod:3981
25725 #: ../fish/guestfish-actions.pod:3983
25728 " set-memsize memsize\n"
25733 #: ../fish/guestfish-actions.pod:3985
25735 "This sets the memory size in megabytes allocated to the qemu subprocess. "
25736 "This only has any effect if called before L</launch>."
25740 #: ../fish/guestfish-actions.pod:3996
25741 msgid "set-network"
25745 #: ../fish/guestfish-actions.pod:3998
25750 #: ../fish/guestfish-actions.pod:4000
25753 " set-network true|false\n"
25758 #: ../fish/guestfish-actions.pod:4008
25759 msgid "You must call this before calling L</launch>, otherwise it has no effect."
25763 #: ../fish/guestfish-actions.pod:4011
25768 #: ../fish/guestfish-actions.pod:4013
25773 #: ../fish/guestfish-actions.pod:4015
25776 " set-path searchpath\n"
25781 #: ../fish/guestfish-actions.pod:4024
25786 #: ../fish/guestfish-actions.pod:4026
25791 #: ../fish/guestfish-actions.pod:4028
25799 #: ../fish/guestfish-actions.pod:4048
25800 msgid "set-recovery-proc"
25804 #: ../fish/guestfish-actions.pod:4050
25805 msgid "recovery-proc"
25809 #: ../fish/guestfish-actions.pod:4052
25812 " set-recovery-proc true|false\n"
25817 #: ../fish/guestfish-actions.pod:4054
25819 "If this is called with the parameter C<false> then L</launch> does not "
25820 "create a recovery process. The purpose of the recovery process is to stop "
25821 "runaway qemu processes in the case where the main program aborts abruptly."
25825 #: ../fish/guestfish-actions.pod:4059
25827 "This only has any effect if called before L</launch>, and the default is "
25832 #: ../fish/guestfish-actions.pod:4068
25833 msgid "set-selinux"
25837 #: ../fish/guestfish-actions.pod:4070
25842 #: ../fish/guestfish-actions.pod:4072
25845 " set-selinux true|false\n"
25850 #: ../fish/guestfish-actions.pod:4083
25855 #: ../fish/guestfish-actions.pod:4085
25860 #: ../fish/guestfish-actions.pod:4087
25863 " set-trace true|false\n"
25868 #: ../fish/guestfish-actions.pod:4099
25870 "Trace messages are normally sent to C<stderr>, unless you register a "
25871 "callback to send them somewhere else (see L</set-event-callback>)."
25875 #: ../fish/guestfish-actions.pod:4103
25876 msgid "set-verbose"
25880 #: ../fish/guestfish-actions.pod:4105
25885 #: ../fish/guestfish-actions.pod:4107
25888 " set-verbose true|false\n"
25893 #: ../fish/guestfish-actions.pod:4114
25895 "Verbose messages are normally sent to C<stderr>, unless you register a "
25896 "callback to send them somewhere else (see L</set-event-callback>)."
25900 #: ../fish/guestfish-actions.pod:4118
25905 #: ../fish/guestfish-actions.pod:4120
25908 " setcon context\n"
25913 #: ../fish/guestfish-actions.pod:4127
25918 #: ../fish/guestfish-actions.pod:4129
25921 " setxattr xattr val vallen path\n"
25926 #: ../fish/guestfish-actions.pod:4135
25927 msgid "See also: L</lsetxattr>, L<attr(5)>."
25931 #: ../fish/guestfish-actions.pod:4137
25936 #: ../fish/guestfish-actions.pod:4139
25939 " sfdisk device cyls heads sectors 'lines ...'\n"
25944 #: ../fish/guestfish-actions.pod:4161
25945 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
25949 #: ../fish/guestfish-actions.pod:4167
25954 #: ../fish/guestfish-actions.pod:4169
25957 " sfdiskM device 'lines ...'\n"
25962 #: ../fish/guestfish-actions.pod:4171
25964 "This is a simplified interface to the L</sfdisk> command, where partition "
25965 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
25966 "you don't need to specify the cyls, heads and sectors parameters which were "
25967 "rarely if ever used anyway."
25971 #: ../fish/guestfish-actions.pod:4177
25972 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
25976 #: ../fish/guestfish-actions.pod:4183
25981 #: ../fish/guestfish-actions.pod:4185
25984 " sfdisk-N device partnum cyls heads sectors line\n"
25989 #: ../fish/guestfish-actions.pod:4190
25991 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
25992 "cyls/heads/sectors parameters."
25996 #: ../fish/guestfish-actions.pod:4193
25997 msgid "See also: L</part-add>"
26001 #: ../fish/guestfish-actions.pod:4198
26002 msgid "sfdisk-disk-geometry"
26006 #: ../fish/guestfish-actions.pod:4200
26009 " sfdisk-disk-geometry device\n"
26014 #: ../fish/guestfish-actions.pod:4202
26016 "This displays the disk geometry of C<device> read from the partition table. "
26017 "Especially in the case where the underlying block device has been resized, "
26018 "this can be different from the kernel's idea of the geometry (see "
26019 "L</sfdisk-kernel-geometry>)."
26023 #: ../fish/guestfish-actions.pod:4210
26024 msgid "sfdisk-kernel-geometry"
26028 #: ../fish/guestfish-actions.pod:4212
26031 " sfdisk-kernel-geometry device\n"
26036 #: ../fish/guestfish-actions.pod:4219
26041 #: ../fish/guestfish-actions.pod:4221
26044 " sfdisk-l device\n"
26049 #: ../fish/guestfish-actions.pod:4227
26050 msgid "See also: L</part-list>"
26054 #: ../fish/guestfish-actions.pod:4229
26059 #: ../fish/guestfish-actions.pod:4231
26067 #: ../fish/guestfish-actions.pod:4236
26068 msgid "This is like L</command>, but passes the command to:"
26072 #: ../fish/guestfish-actions.pod:4244
26073 msgid "All the provisos about L</command> apply to this call."
26077 #: ../fish/guestfish-actions.pod:4246
26082 #: ../fish/guestfish-actions.pod:4248
26085 " sh-lines command\n"
26090 #: ../fish/guestfish-actions.pod:4250
26091 msgid "This is the same as L</sh>, but splits the result into a list of lines."
26095 #: ../fish/guestfish-actions.pod:4253
26096 msgid "See also: L</command-lines>"
26100 #: ../fish/guestfish-actions.pod:4255
26105 #: ../fish/guestfish-actions.pod:4257
26113 #: ../fish/guestfish-actions.pod:4261
26118 #: ../fish/guestfish-actions.pod:4263
26126 #: ../fish/guestfish-actions.pod:4269
26131 #: ../fish/guestfish-actions.pod:4271
26139 #: ../fish/guestfish-actions.pod:4279
26144 #: ../fish/guestfish-actions.pod:4281
26152 #: ../fish/guestfish-actions.pod:4289
26157 #: ../fish/guestfish-actions.pod:4291
26160 " strings-e encoding path\n"
26165 #: ../fish/guestfish-actions.pod:4293
26167 "This is like the L</strings> command, but allows you to specify the encoding "
26168 "of strings that are looked for in the source file C<path>."
26172 #: ../fish/guestfish-actions.pod:4303
26174 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
26175 "ISO-8859-X (this is what L</strings> uses)."
26179 #: ../fish/guestfish-actions.pod:4335
26180 msgid "swapoff-device"
26184 #: ../fish/guestfish-actions.pod:4337
26187 " swapoff-device device\n"
26192 #: ../fish/guestfish-actions.pod:4339
26194 "This command disables the libguestfs appliance swap device or partition "
26195 "named C<device>. See L</swapon-device>."
26199 #: ../fish/guestfish-actions.pod:4343
26200 msgid "swapoff-file"
26204 #: ../fish/guestfish-actions.pod:4345
26207 " swapoff-file file\n"
26212 #: ../fish/guestfish-actions.pod:4349
26213 msgid "swapoff-label"
26217 #: ../fish/guestfish-actions.pod:4351
26220 " swapoff-label label\n"
26225 #: ../fish/guestfish-actions.pod:4356
26226 msgid "swapoff-uuid"
26230 #: ../fish/guestfish-actions.pod:4358
26233 " swapoff-uuid uuid\n"
26238 #: ../fish/guestfish-actions.pod:4363
26239 msgid "swapon-device"
26243 #: ../fish/guestfish-actions.pod:4365
26246 " swapon-device device\n"
26251 #: ../fish/guestfish-actions.pod:4367
26253 "This command enables the libguestfs appliance to use the swap device or "
26254 "partition named C<device>. The increased memory is made available for all "
26255 "commands, for example those run using L</command> or L</sh>."
26259 #: ../fish/guestfish-actions.pod:4379
26260 msgid "swapon-file"
26264 #: ../fish/guestfish-actions.pod:4381
26267 " swapon-file file\n"
26272 #: ../fish/guestfish-actions.pod:4383
26273 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
26277 #: ../fish/guestfish-actions.pod:4386
26278 msgid "swapon-label"
26282 #: ../fish/guestfish-actions.pod:4388
26285 " swapon-label label\n"
26290 #: ../fish/guestfish-actions.pod:4390
26292 "This command enables swap to a labeled swap partition. See "
26293 "L</swapon-device> for other notes."
26297 #: ../fish/guestfish-actions.pod:4393
26298 msgid "swapon-uuid"
26302 #: ../fish/guestfish-actions.pod:4395
26305 " swapon-uuid uuid\n"
26310 #: ../fish/guestfish-actions.pod:4397
26312 "This command enables swap to a swap partition with the given UUID. See "
26313 "L</swapon-device> for other notes."
26317 #: ../fish/guestfish-actions.pod:4400
26322 #: ../fish/guestfish-actions.pod:4402
26330 #: ../fish/guestfish-actions.pod:4410
26335 #: ../fish/guestfish-actions.pod:4412
26343 #: ../fish/guestfish-actions.pod:4420
26348 #: ../fish/guestfish-actions.pod:4422
26351 " tail-n nrlines path\n"
26356 #: ../fish/guestfish-actions.pod:4435
26361 #: ../fish/guestfish-actions.pod:4437
26364 " tar-in (tarfile|-) directory\n"
26369 #: ../fish/guestfish-actions.pod:4442
26370 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
26374 #: ../fish/guestfish-actions.pod:4447
26379 #: ../fish/guestfish-actions.pod:4449
26382 " tar-out directory (tarfile|-)\n"
26387 #: ../fish/guestfish-actions.pod:4454
26388 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
26392 #: ../fish/guestfish-actions.pod:4459
26397 #: ../fish/guestfish-actions.pod:4461
26400 " tgz-in (tarball|-) directory\n"
26405 #: ../fish/guestfish-actions.pod:4466
26406 msgid "To upload an uncompressed tarball, use L</tar-in>."
26410 #: ../fish/guestfish-actions.pod:4470
26415 #: ../fish/guestfish-actions.pod:4472
26418 " tgz-out directory (tarball|-)\n"
26423 #: ../fish/guestfish-actions.pod:4477
26424 msgid "To download an uncompressed tarball, use L</tar-out>."
26428 #: ../fish/guestfish-actions.pod:4481
26433 #: ../fish/guestfish-actions.pod:4483
26441 #: ../fish/guestfish-actions.pod:4492
26446 #: ../fish/guestfish-actions.pod:4494
26454 #: ../fish/guestfish-actions.pod:4499
26455 msgid "truncate-size"
26459 #: ../fish/guestfish-actions.pod:4501
26462 " truncate-size path size\n"
26467 #: ../fish/guestfish-actions.pod:4506
26469 "If the current file size is less than C<size> then the file is extended to "
26470 "the required size with zero bytes. This creates a sparse file (ie. disk "
26471 "blocks are not allocated for the file until you write to it). To create a "
26472 "non-sparse file of zeroes, use L</fallocate64> instead."
26476 #: ../fish/guestfish-actions.pod:4512
26481 #: ../fish/guestfish-actions.pod:4514
26484 " tune2fs-l device\n"
26489 #: ../fish/guestfish-actions.pod:4524
26494 #: ../fish/guestfish-actions.pod:4526
26497 " txz-in (tarball|-) directory\n"
26502 #: ../fish/guestfish-actions.pod:4533
26507 #: ../fish/guestfish-actions.pod:4535
26510 " txz-out directory (tarball|-)\n"
26515 #: ../fish/guestfish-actions.pod:4542
26520 #: ../fish/guestfish-actions.pod:4544
26528 #: ../fish/guestfish-actions.pod:4558
26529 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
26533 #: ../fish/guestfish-actions.pod:4563
26538 #: ../fish/guestfish-actions.pod:4565
26543 #: ../fish/guestfish-actions.pod:4567
26546 " umount pathordevice\n"
26551 #: ../fish/guestfish-actions.pod:4573
26556 #: ../fish/guestfish-actions.pod:4575
26557 msgid "unmount-all"
26561 #: ../fish/guestfish-actions.pod:4577
26569 #: ../fish/guestfish-actions.pod:4583
26574 #: ../fish/guestfish-actions.pod:4585
26577 " upload (filename|-) remotefilename\n"
26582 #: ../fish/guestfish-actions.pod:4592
26583 msgid "See also L</download>."
26587 #: ../fish/guestfish-actions.pod:4596
26588 msgid "upload-offset"
26592 #: ../fish/guestfish-actions.pod:4598
26595 " upload-offset (filename|-) remotefilename offset\n"
26600 #: ../fish/guestfish-actions.pod:4610
26602 "Note that there is no limit on the amount of data that can be uploaded with "
26603 "this call, unlike with L</pwrite>, and this call always writes the full "
26604 "amount unless an error occurs."
26608 #: ../fish/guestfish-actions.pod:4615
26609 msgid "See also L</upload>, L</pwrite>."
26613 #: ../fish/guestfish-actions.pod:4619
26618 #: ../fish/guestfish-actions.pod:4621
26621 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
26626 #: ../fish/guestfish-actions.pod:4640
26631 #: ../fish/guestfish-actions.pod:4642
26639 #: ../fish/guestfish-actions.pod:4669
26641 "I<Note:> Don't use this call to test for availability of features. In "
26642 "enterprise distributions we backport features from later versions into "
26643 "earlier versions, making this an unreliable way to test for features. Use "
26644 "L</available> instead."
26648 #: ../fish/guestfish-actions.pod:4675
26653 #: ../fish/guestfish-actions.pod:4677
26656 " vfs-label device\n"
26661 #: ../fish/guestfish-actions.pod:4684
26662 msgid "To find a filesystem from the label, use L</findfs-label>."
26666 #: ../fish/guestfish-actions.pod:4686
26671 #: ../fish/guestfish-actions.pod:4688
26674 " vfs-type device\n"
26679 #: ../fish/guestfish-actions.pod:4698
26684 #: ../fish/guestfish-actions.pod:4700
26687 " vfs-uuid device\n"
26692 #: ../fish/guestfish-actions.pod:4707
26693 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
26697 #: ../fish/guestfish-actions.pod:4709
26698 msgid "vg-activate"
26702 #: ../fish/guestfish-actions.pod:4711
26705 " vg-activate true|false 'volgroups ...'\n"
26710 #: ../fish/guestfish-actions.pod:4724
26711 msgid "vg-activate-all"
26715 #: ../fish/guestfish-actions.pod:4726
26718 " vg-activate-all true|false\n"
26723 #: ../fish/guestfish-actions.pod:4736
26728 #: ../fish/guestfish-actions.pod:4738
26731 " vgcreate volgroup 'physvols ...'\n"
26736 #: ../fish/guestfish-actions.pod:4743
26741 #: ../fish/guestfish-actions.pod:4745
26744 " vglvuuids vgname\n"
26749 #: ../fish/guestfish-actions.pod:4750
26751 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
26752 "logical volumes and volume groups."
26756 #: ../fish/guestfish-actions.pod:4753
26757 msgid "See also L</vgpvuuids>."
26761 #: ../fish/guestfish-actions.pod:4755
26766 #: ../fish/guestfish-actions.pod:4757
26769 " vgpvuuids vgname\n"
26774 #: ../fish/guestfish-actions.pod:4762
26776 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
26777 "physical volumes and volume groups."
26781 #: ../fish/guestfish-actions.pod:4765
26782 msgid "See also L</vglvuuids>."
26786 #: ../fish/guestfish-actions.pod:4767
26791 #: ../fish/guestfish-actions.pod:4769
26794 " vgremove vgname\n"
26799 #: ../fish/guestfish-actions.pod:4776
26804 #: ../fish/guestfish-actions.pod:4778
26807 " vgrename volgroup newvolgroup\n"
26812 #: ../fish/guestfish-actions.pod:4782
26817 #: ../fish/guestfish-actions.pod:4784
26825 #: ../fish/guestfish-actions.pod:4792
26826 msgid "See also L</vgs-full>."
26830 #: ../fish/guestfish-actions.pod:4794
26835 #: ../fish/guestfish-actions.pod:4796
26843 #: ../fish/guestfish-actions.pod:4801
26848 #: ../fish/guestfish-actions.pod:4803
26856 #: ../fish/guestfish-actions.pod:4808
26861 #: ../fish/guestfish-actions.pod:4810
26869 #: ../fish/guestfish-actions.pod:4814
26874 #: ../fish/guestfish-actions.pod:4816
26882 #: ../fish/guestfish-actions.pod:4821
26887 #: ../fish/guestfish-actions.pod:4823
26895 #: ../fish/guestfish-actions.pod:4828
26900 #: ../fish/guestfish-actions.pod:4830
26908 #: ../fish/guestfish-actions.pod:4835
26913 #: ../fish/guestfish-actions.pod:4837
26916 " write path content\n"
26921 #: ../fish/guestfish-actions.pod:4845
26926 #: ../fish/guestfish-actions.pod:4847
26929 " write-file path content size\n"
26934 #: ../fish/guestfish-actions.pod:4870
26939 #: ../fish/guestfish-actions.pod:4872
26942 " zegrep regex path\n"
26947 #: ../fish/guestfish-actions.pod:4880
26952 #: ../fish/guestfish-actions.pod:4882
26955 " zegrepi regex path\n"
26960 #: ../fish/guestfish-actions.pod:4890
26965 #: ../fish/guestfish-actions.pod:4892
26973 #: ../fish/guestfish-actions.pod:4900
26974 msgid "See also: L</zero-device>, L</scrub-device>."
26978 #: ../fish/guestfish-actions.pod:4902
26979 msgid "zero-device"
26983 #: ../fish/guestfish-actions.pod:4904
26986 " zero-device device\n"
26991 #: ../fish/guestfish-actions.pod:4906
26993 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
26994 "which just zeroes the first few blocks of a device."
26998 #: ../fish/guestfish-actions.pod:4913
27003 #: ../fish/guestfish-actions.pod:4915
27006 " zerofree device\n"
27011 #: ../fish/guestfish-actions.pod:4928
27016 #: ../fish/guestfish-actions.pod:4930
27019 " zfgrep pattern path\n"
27024 #: ../fish/guestfish-actions.pod:4938
27029 #: ../fish/guestfish-actions.pod:4940
27032 " zfgrepi pattern path\n"
27037 #: ../fish/guestfish-actions.pod:4948
27042 #: ../fish/guestfish-actions.pod:4950
27045 " zfile meth path\n"
27050 #: ../fish/guestfish-actions.pod:4957
27051 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
27055 #: ../fish/guestfish-actions.pod:4967
27060 #: ../fish/guestfish-actions.pod:4969
27063 " zgrep regex path\n"
27068 #: ../fish/guestfish-actions.pod:4977
27073 #: ../fish/guestfish-actions.pod:4979
27076 " zgrepi regex path\n"
27081 #: ../fish/guestfish-commands.pod:1
27086 #: ../fish/guestfish-commands.pod:3
27091 #: ../fish/guestfish-commands.pod:5
27094 " alloc filename size\n"
27099 #: ../fish/guestfish-commands.pod:7
27101 "This creates an empty (zeroed) file of the given size, and then adds so it "
27102 "can be further examined."
27106 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
27107 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
27111 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
27112 msgid "Size can be specified using standard suffixes, eg. C<1M>."
27116 #: ../fish/guestfish-commands.pod:14
27118 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
27119 "image, see L</PREPARED DISK IMAGES>."
27123 #: ../fish/guestfish-commands.pod:17
27128 #: ../fish/guestfish-commands.pod:19
27131 " copy-in local [local ...] /remotedir\n"
27136 #: ../fish/guestfish-commands.pod:21
27138 "C<copy-in> copies local files or directories recursively into the disk "
27139 "image, placing them in the directory called C</remotedir> (which must "
27140 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
27141 "other commands as necessary."
27145 #: ../fish/guestfish-commands.pod:26
27147 "Multiple local files and directories can be specified, but the last "
27148 "parameter must always be a remote directory. Wildcards cannot be used."
27152 #: ../fish/guestfish-commands.pod:30
27157 #: ../fish/guestfish-commands.pod:32
27160 " copy-out remote [remote ...] localdir\n"
27165 #: ../fish/guestfish-commands.pod:34
27167 "C<copy-out> copies remote files or directories recursively out of the disk "
27168 "image, placing them on the host disk in a local directory called C<localdir> "
27169 "(which must exist). This guestfish meta-command turns into a sequence of "
27170 "L</download>, L</tar-out> and other commands as necessary."
27174 #: ../fish/guestfish-commands.pod:40
27176 "Multiple remote files and directories can be specified, but the last "
27177 "parameter must always be a local directory. To download to the current "
27178 "directory, use C<.> as in:"
27182 #: ../fish/guestfish-commands.pod:44
27185 " copy-out /home .\n"
27190 #: ../fish/guestfish-commands.pod:46
27192 "Wildcards cannot be used in the ordinary command, but you can use them with "
27193 "the help of L</glob> like this:"
27197 #: ../fish/guestfish-commands.pod:49
27200 " glob copy-out /home/* .\n"
27205 #: ../fish/guestfish-commands.pod:51
27210 #: ../fish/guestfish-commands.pod:53
27213 " echo [params ...]\n"
27218 #: ../fish/guestfish-commands.pod:55
27219 msgid "This echos the parameters to the terminal."
27223 #: ../fish/guestfish-commands.pod:57
27228 #: ../fish/guestfish-commands.pod:59
27233 #: ../fish/guestfish-commands.pod:61
27238 #: ../fish/guestfish-commands.pod:63
27246 #: ../fish/guestfish-commands.pod:65
27248 "This is used to edit a file. It downloads the file, edits it locally using "
27249 "your editor, then uploads the result."
27253 #: ../fish/guestfish-commands.pod:68
27255 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
27256 "or C<emacs> you will get those corresponding editors."
27260 #: ../fish/guestfish-commands.pod:72
27265 #: ../fish/guestfish-commands.pod:74
27268 " glob command args...\n"
27273 #: ../fish/guestfish-commands.pod:76
27275 "Expand wildcards in any paths in the args list, and run C<command> "
27276 "repeatedly on each matching path."
27280 #: ../fish/guestfish-commands.pod:79
27281 msgid "See L</WILDCARDS AND GLOBBING>."
27285 #: ../fish/guestfish-commands.pod:81
27290 #: ../fish/guestfish-commands.pod:83
27293 " hexedit <filename|device>\n"
27294 " hexedit <filename|device> <max>\n"
27295 " hexedit <filename|device> <start> <max>\n"
27300 #: ../fish/guestfish-commands.pod:87
27302 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
27307 #: ../fish/guestfish-commands.pod:90
27309 "This command works by downloading potentially the whole file or device, "
27310 "editing it locally, then uploading it. If the file or device is large, you "
27311 "have to specify which part you wish to edit by using C<max> and/or C<start> "
27312 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
27313 "usual modifiers allowed such as C<1M> (1 megabyte)."
27317 #: ../fish/guestfish-commands.pod:97
27318 msgid "For example to edit the first few sectors of a disk you might do:"
27322 #: ../fish/guestfish-commands.pod:100
27325 " hexedit /dev/sda 1M\n"
27330 #: ../fish/guestfish-commands.pod:102
27332 "which would allow you to edit anywhere within the first megabyte of the "
27337 #: ../fish/guestfish-commands.pod:105
27338 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
27342 #: ../fish/guestfish-commands.pod:107
27345 " hexedit /dev/sda1 0x400 0x400\n"
27350 #: ../fish/guestfish-commands.pod:109
27351 msgid "(assuming the superblock is in the standard location)."
27355 #: ../fish/guestfish-commands.pod:111
27357 "This command requires the external L<hexedit(1)> program. You can specify "
27358 "another program to use by setting the C<HEXEDITOR> environment variable."
27362 #: ../fish/guestfish-commands.pod:115
27363 msgid "See also L</hexdump>."
27367 #: ../fish/guestfish-commands.pod:117
27372 #: ../fish/guestfish-commands.pod:119
27380 #: ../fish/guestfish-commands.pod:121
27381 msgid "Change the local directory, ie. the current directory of guestfish itself."
27385 #: ../fish/guestfish-commands.pod:124
27386 msgid "Note that C<!cd> won't do what you might expect."
27390 #: ../fish/guestfish-commands.pod:126
27395 #: ../fish/guestfish-commands.pod:128
27400 #: ../fish/guestfish-commands.pod:130
27408 #: ../fish/guestfish-commands.pod:132
27409 msgid "Opens the manual page for guestfish."
27413 #: ../fish/guestfish-commands.pod:134
27418 #: ../fish/guestfish-commands.pod:136
27423 #: ../fish/guestfish-commands.pod:138
27431 #: ../fish/guestfish-commands.pod:140
27439 #: ../fish/guestfish-commands.pod:142
27440 msgid "This is used to view a file."
27444 #: ../fish/guestfish-commands.pod:144
27446 "The default viewer is C<$PAGER>. However if you use the alternate command "
27447 "C<less> you will get the C<less> command specifically."
27451 #: ../fish/guestfish-commands.pod:147
27456 #: ../fish/guestfish-commands.pod:149
27464 #: ../fish/guestfish-commands.pod:151
27466 "Close and reopen the libguestfs handle. It is not necessary to use this "
27467 "normally, because the handle is closed properly when guestfish exits. "
27468 "However this is occasionally useful for testing."
27472 #: ../fish/guestfish-commands.pod:155
27477 #: ../fish/guestfish-commands.pod:157
27480 " sparse filename size\n"
27485 #: ../fish/guestfish-commands.pod:159
27487 "This creates an empty sparse file of the given size, and then adds so it can "
27488 "be further examined."
27492 #: ../fish/guestfish-commands.pod:162
27494 "In all respects it works the same as the L</alloc> command, except that the "
27495 "image file is allocated sparsely, which means that disk blocks are not "
27496 "assigned to the file until they are needed. Sparse disk files only use "
27497 "space when written to, but they are slower and there is a danger you could "
27498 "run out of real disk space during a write operation."
27502 #: ../fish/guestfish-commands.pod:172
27507 #: ../fish/guestfish-commands.pod:174
27515 #: ../fish/guestfish-commands.pod:176
27517 "This command returns a list of the optional groups known to the daemon, and "
27518 "indicates which ones are supported by this build of the libguestfs "
27523 #: ../fish/guestfish-commands.pod:180
27524 msgid "See also L<guestfs(3)/AVAILABILITY>."
27528 #: ../fish/guestfish-commands.pod:182
27533 #: ../fish/guestfish-commands.pod:184
27536 " time command args...\n"
27541 #: ../fish/guestfish-commands.pod:186
27543 "Run the command as usual, but print the elapsed time afterwards. This can "
27544 "be useful for benchmarking operations."
27548 #: ../test-tool/libguestfs-test-tool.pod:5
27549 msgid "libguestfs-test-tool - End user tests for libguestfs"
27553 #: ../test-tool/libguestfs-test-tool.pod:9
27556 " libguestfs-test-tool [--options]\n"
27561 #: ../test-tool/libguestfs-test-tool.pod:13
27563 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
27564 "and developers, to allow them to check basic libguestfs functionality is "
27565 "working. This is needed because libguestfs occasionally breaks for reasons "
27566 "beyond our control: usually because of changes in the underlying qemu or "
27567 "kernel packages, or the host environment."
27571 #: ../test-tool/libguestfs-test-tool.pod:20
27572 msgid "If you suspect a problem in libguestfs, then just run:"
27576 #: ../test-tool/libguestfs-test-tool.pod:22
27579 " libguestfs-test-tool\n"
27584 #: ../test-tool/libguestfs-test-tool.pod:24
27585 msgid "It will print lots of diagnostic messages."
27589 #: ../test-tool/libguestfs-test-tool.pod:26
27590 msgid "If it runs to completion successfully, you will see this near the end:"
27594 #: ../test-tool/libguestfs-test-tool.pod:28
27597 " ===== TEST FINISHED OK =====\n"
27602 #: ../test-tool/libguestfs-test-tool.pod:30
27603 msgid "and the test tool will exit with code 0."
27607 #: ../test-tool/libguestfs-test-tool.pod:32
27609 "If it fails (and/or exits with non-zero error code), please paste the "
27610 "B<complete, unedited> output of the test tool into a bug report. More "
27611 "information about reporting bugs can be found on the "
27612 "L<http://libguestfs.org/> website."
27616 #: ../test-tool/libguestfs-test-tool.pod:41
27621 #: ../test-tool/libguestfs-test-tool.pod:43
27622 msgid "Display short usage information and exit."
27626 #: ../test-tool/libguestfs-test-tool.pod:45
27627 msgid "I<--qemu qemu_binary>"
27631 #: ../test-tool/libguestfs-test-tool.pod:47
27633 "If you have downloaded another qemu binary, point this option at the full "
27634 "path of the binary to try it."
27638 #: ../test-tool/libguestfs-test-tool.pod:50
27639 msgid "I<--qemudir qemu_source_dir>"
27643 #: ../test-tool/libguestfs-test-tool.pod:52
27645 "If you have compiled qemu from source, point this option at the source "
27646 "directory to try it."
27650 #: ../test-tool/libguestfs-test-tool.pod:55
27651 msgid "I<--timeout N>"
27655 #: ../test-tool/libguestfs-test-tool.pod:57
27657 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
27658 "does not usually need to be adjusted unless your machine is very slow."
27662 #: ../test-tool/libguestfs-test-tool.pod:63
27663 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
27667 #: ../test-tool/libguestfs-test-tool.pod:65
27669 "If you have compiled another version of qemu from source and would like to "
27670 "try that, then you can use the I<--qemudir> option to point to the qemu "
27671 "source directory."
27675 #: ../test-tool/libguestfs-test-tool.pod:69
27677 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
27678 "option to point to the binary."
27682 #: ../test-tool/libguestfs-test-tool.pod:72
27684 "When using an alternate qemu with libguestfs, usually you would need to "
27685 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in "
27686 "L<guestfs(3)>). libguestfs-test-tool writes a temporary qemu wrapper script "
27687 "when you use either of the I<--qemudir> or I<--qemu> options."
27691 #: ../test-tool/libguestfs-test-tool.pod:79
27693 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
27694 "I<1> if there was an error."
27698 #: ../test-tool/libguestfs-test-tool.pod:84
27700 "For the full list of environment variables which may affect libguestfs, "
27701 "please see the L<guestfs(3)> manual page."
27705 #: ../test-tool/libguestfs-test-tool.pod:89
27706 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
27710 #: ../fuse/guestmount.pod:5
27711 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
27715 #: ../fuse/guestmount.pod:9
27718 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
27723 #: ../fuse/guestmount.pod:11
27726 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
27731 #: ../fuse/guestmount.pod:13
27734 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
27739 #: ../fuse/guestmount.pod:17
27741 "You must I<not> use C<guestmount> in read-write mode on live virtual "
27742 "machines. If you do this, you risk disk corruption in the VM."
27746 #: ../fuse/guestmount.pod:22
27748 "The guestmount program can be used to mount virtual machine filesystems and "
27749 "other disk images on the host. It uses libguestfs for access to the guest "
27750 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
27751 "a mountable device."
27755 #: ../fuse/guestmount.pod:27
27757 "Along with other options, you have to give at least one device (I<-a> "
27758 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
27759 "option) or use the I<-i> inspection option. How this works is better "
27760 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
27765 #: ../fuse/guestmount.pod:33
27767 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
27768 "by you, and the filesystem will not be visible to any other users unless you "
27769 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
27770 "the filesystem, use the C<fusermount -u> command."
27774 #: ../fuse/guestmount.pod:41
27776 "For a typical Windows guest which has its main filesystem on the first "
27781 #: ../fuse/guestmount.pod:44
27784 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
27789 #: ../fuse/guestmount.pod:46
27791 "For a typical Linux guest which has a /boot filesystem on the first "
27792 "partition, and the root filesystem on a logical volume:"
27796 #: ../fuse/guestmount.pod:49
27799 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
27804 #: ../fuse/guestmount.pod:51
27805 msgid "To get libguestfs to detect guest mountpoints for you:"
27809 #: ../fuse/guestmount.pod:53
27812 " guestmount -a guest.img -i --ro /mnt\n"
27817 #: ../fuse/guestmount.pod:55
27818 msgid "For a libvirt guest called \"Guest\" you could do:"
27822 #: ../fuse/guestmount.pod:57
27825 " guestmount -d Guest -i --ro /mnt\n"
27830 #: ../fuse/guestmount.pod:59
27832 "If you don't know what filesystems are contained in a guest or disk image, "
27833 "use L<virt-filesystems(1)> first:"
27837 #: ../fuse/guestmount.pod:62
27840 " virt-filesystems MyGuest\n"
27845 #: ../fuse/guestmount.pod:64
27847 "If you want to trace the libguestfs calls but without excessive debugging "
27848 "information, we recommend:"
27852 #: ../fuse/guestmount.pod:67
27855 " guestmount [...] --trace /mnt\n"
27860 #: ../fuse/guestmount.pod:69
27861 msgid "If you want to debug the program, we recommend:"
27865 #: ../fuse/guestmount.pod:71
27868 " guestmount [...] --trace --verbose /mnt\n"
27873 #: ../fuse/guestmount.pod:77
27874 msgid "B<-a image> | B<--add image>"
27878 #: ../fuse/guestmount.pod:79
27879 msgid "Add a block device or virtual machine image."
27883 #: ../fuse/guestmount.pod:84
27884 msgid "B<-c URI> | B<--connect URI>"
27888 #: ../fuse/guestmount.pod:90
27889 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
27893 #: ../fuse/guestmount.pod:96
27894 msgid "B<--dir-cache-timeout N>"
27898 #: ../fuse/guestmount.pod:98
27900 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
27901 "seconds. The readdir cache [actually, there are several semi-independent "
27902 "caches] is populated after a readdir(2) call with the stat and extended "
27903 "attributes of the files in the directory, in anticipation that they will be "
27904 "requested soon after."
27908 #: ../fuse/guestmount.pod:104
27910 "There is also a different attribute cache implemented by FUSE (see the FUSE "
27911 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
27912 "requests, only cache existing ones."
27916 #: ../fuse/guestmount.pod:115
27917 msgid "B<--format=raw|qcow2|..> | B<--format>"
27921 #: ../fuse/guestmount.pod:122
27923 "If you have untrusted raw-format guest disk images, you should use this "
27924 "option to specify the disk format. This avoids a possible security problem "
27925 "with malicious guests (CVE-2010-3851). See also "
27926 "L<guestfs(3)/guestfs_add_drive_opts>."
27930 #: ../fuse/guestmount.pod:127
27931 msgid "B<--fuse-help>"
27935 #: ../fuse/guestmount.pod:129
27936 msgid "Display help on special FUSE options (see I<-o> below)."
27940 #: ../fuse/guestmount.pod:133
27941 msgid "Display brief help and exit."
27945 #: ../fuse/guestmount.pod:135
27946 msgid "B<-i> | B<--inspector>"
27950 #: ../fuse/guestmount.pod:155
27952 "Mount the named partition or logical volume on the given mountpoint B<in the "
27953 "guest> (this has nothing to do with mountpoints in the host)."
27957 #: ../fuse/guestmount.pod:158
27959 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
27960 "something on C</>."
27964 #: ../fuse/guestmount.pod:171
27965 msgid "B<-n> | B<--no-sync>"
27969 #: ../fuse/guestmount.pod:173
27971 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
27972 "unmounted. If you specify this option, then we don't attempt to sync the "
27973 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
27977 #: ../fuse/guestmount.pod:178
27978 msgid "B<-o option> | B<--option option>"
27982 #: ../fuse/guestmount.pod:180
27983 msgid "Pass extra options to FUSE."
27987 #: ../fuse/guestmount.pod:182
27989 "To get a list of all the extra options supported by FUSE, use the command "
27990 "below. Note that only the FUSE I<-o> options can be passed, and only some "
27991 "of them are a good idea."
27995 #: ../fuse/guestmount.pod:186
27998 " guestmount --fuse-help\n"
28003 #: ../fuse/guestmount.pod:188
28004 msgid "Some potentially useful FUSE options:"
28008 #: ../fuse/guestmount.pod:192
28009 msgid "B<-o allow_other>"
28013 #: ../fuse/guestmount.pod:194
28014 msgid "Allow other users to see the filesystem."
28018 #: ../fuse/guestmount.pod:196
28019 msgid "B<-o attr_timeout=N>"
28023 #: ../fuse/guestmount.pod:198
28024 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
28028 #: ../fuse/guestmount.pod:200
28029 msgid "B<-o kernel_cache>"
28033 #: ../fuse/guestmount.pod:202
28035 "Allow the kernel to cache files (reduces the number of reads that have to go "
28036 "through the L<guestfs(3)> API). This is generally a good idea if you can "
28037 "afford the extra memory usage."
28041 #: ../fuse/guestmount.pod:206
28042 msgid "B<-o uid=N> B<-o gid=N>"
28046 #: ../fuse/guestmount.pod:208
28048 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
28049 "the chosen values."
28053 #: ../fuse/guestmount.pod:213
28054 msgid "B<-r> | B<--ro>"
28058 #: ../fuse/guestmount.pod:215
28060 "Add devices and mount everything read-only. Also disallow writes and make "
28061 "the disk appear read-only to FUSE."
28065 #: ../fuse/guestmount.pod:218
28067 "This is highly recommended if you are not going to edit the guest disk. If "
28068 "the guest is running and this option is I<not> supplied, then there is a "
28069 "strong risk of disk corruption in the guest. We try to prevent this from "
28070 "happening, but it is not always possible."
28074 #: ../fuse/guestmount.pod:223
28075 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
28079 #: ../fuse/guestmount.pod:227
28080 msgid "Enable SELinux support for the guest."
28084 #: ../fuse/guestmount.pod:229
28085 msgid "B<-v> | B<--verbose>"
28089 #: ../fuse/guestmount.pod:231
28090 msgid "Enable verbose messages from underlying libguestfs."
28094 #: ../fuse/guestmount.pod:233
28095 msgid "B<-V> | B<--version>"
28099 #: ../fuse/guestmount.pod:235
28100 msgid "Display the program version and exit."
28104 #: ../fuse/guestmount.pod:237
28105 msgid "B<-w> | B<--rw>"
28109 #: ../fuse/guestmount.pod:242 ../fuse/guestmount.pod:263
28110 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
28114 #: ../fuse/guestmount.pod:244
28115 msgid "B<-x> | B<--trace>"
28119 #: ../fuse/guestmount.pod:246
28120 msgid "Trace libguestfs calls and entry into each FUSE function."
28124 #: ../fuse/guestmount.pod:248
28125 msgid "This also stops the daemon from forking into the background."
28129 #: ../fuse/guestmount.pod:269
28131 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
28132 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
28133 "L<http://fuse.sf.net/>."
28137 #: ../fuse/guestmount.pod:284
28138 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
28142 #: ../tools/virt-edit.pl:34
28143 msgid "virt-edit - Edit a file in a virtual machine"
28147 #: ../tools/virt-edit.pl:38
28150 " virt-edit [--options] domname file\n"
28155 #: ../tools/virt-edit.pl:40
28158 " virt-edit [--options] disk.img [disk.img ...] file\n"
28163 #: ../tools/virt-edit.pl:42
28166 " virt-edit [domname|disk.img] file -e 'expr'\n"
28171 #: ../tools/virt-edit.pl:46
28173 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
28174 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
28175 "doing this, but doesn't catch all cases."
28179 #: ../tools/virt-edit.pl:52
28181 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
28182 "the named virtual machine (or disk image)."
28186 #: ../tools/virt-edit.pl:55
28187 msgid "If you want to just view a file, use L<virt-cat(1)>."
28191 #: ../tools/virt-edit.pl:57
28193 "For more complex cases you should look at the L<guestfish(1)> tool (see "
28194 "L</USING GUESTFISH> below)."
28198 #: ../tools/virt-edit.pl:60
28200 "C<virt-edit> cannot be used to create a new file, nor to edit multiple "
28201 "files. L<guestfish(1)> can do that and much more."
28205 #: ../tools/virt-edit.pl:65
28206 msgid "Edit the named files interactively:"
28210 #: ../tools/virt-edit.pl:67
28213 " virt-edit mydomain /boot/grub/grub.conf\n"
28218 #: ../tools/virt-edit.pl:69
28221 " virt-edit mydomain /etc/passwd\n"
28226 #: ../tools/virt-edit.pl:71
28227 msgid "For Windows guests, some Windows paths are understood:"
28231 #: ../tools/virt-edit.pl:73
28234 " virt-edit mywindomain 'c:\\autoexec.bat'\n"
28239 #: ../tools/virt-edit.pl:75
28241 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
28242 "below). To change the init default level to 5:"
28246 #: ../tools/virt-edit.pl:79
28249 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
28254 #: ../tools/virt-edit.pl:91 ../tools/virt-win-reg.pl:106 ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113 ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
28255 msgid "Display brief help."
28259 #: ../tools/virt-edit.pl:99 ../tools/virt-win-reg.pl:114 ../tools/virt-list-filesystems.pl:71 ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:72
28260 msgid "Display version number and exit."
28264 #: ../tools/virt-edit.pl:105
28265 msgid "B<--backup extension> | B<-b extension>"
28269 #: ../tools/virt-edit.pl:107
28271 "Create a backup of the original file I<in the guest disk image>. The backup "
28272 "has the original filename with C<extension> added."
28276 #: ../tools/virt-edit.pl:110
28278 "Usually the first character of C<extension> would be a dot C<.> so you would "
28283 #: ../tools/virt-edit.pl:113
28286 " virt-edit -b .orig [etc]\n"
28291 #: ../tools/virt-edit.pl:115
28292 msgid "By default, no backup file is made."
28296 #: ../tools/virt-edit.pl:121 ../tools/virt-win-reg.pl:128 ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127 ../tools/virt-list-partitions.pl:78
28297 msgid "B<--connect URI> | B<-c URI>"
28301 #: ../tools/virt-edit.pl:123 ../tools/virt-win-reg.pl:130 ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129 ../tools/virt-list-partitions.pl:80
28303 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
28304 "to the default libvirt hypervisor."
28308 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:133 ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132 ../tools/virt-list-partitions.pl:83
28310 "If you specify guest block devices directly, then libvirt is not used at "
28315 #: ../tools/virt-edit.pl:133 ../tools/virt-win-reg.pl:140 ../tools/virt-list-filesystems.pl:89 ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
28316 msgid "B<--format> raw"
28320 #: ../tools/virt-edit.pl:135 ../tools/virt-win-reg.pl:142 ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141 ../tools/virt-list-partitions.pl:92
28322 "Specify the format of disk images given on the command line. If this is "
28323 "omitted then the format is autodetected from the content of the disk image."
28327 #: ../tools/virt-edit.pl:139 ../tools/virt-win-reg.pl:146 ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145 ../tools/virt-list-partitions.pl:96
28329 "If disk images are requested from libvirt, then this program asks libvirt "
28330 "for this information. In this case, the value of the format parameter is "
28335 #: ../tools/virt-edit.pl:143 ../tools/virt-win-reg.pl:150 ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149 ../tools/virt-list-partitions.pl:100
28337 "If working with untrusted raw-format guest disk images, you should ensure "
28338 "the format is always specified."
28342 #: ../tools/virt-edit.pl:150
28343 msgid "B<--expr EXPR> | B<-e EXPR>"
28347 #: ../tools/virt-edit.pl:152
28349 "Instead of launching the external editor, non-interactively apply the Perl "
28350 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
28355 #: ../tools/virt-edit.pl:156
28357 "Be careful to properly quote the expression to prevent it from being altered "
28362 #: ../tools/virt-edit.pl:280
28363 msgid "NON-INTERACTIVE EDITING"
28367 #: ../tools/virt-edit.pl:282
28369 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
28370 "administrator can interactively edit the file."
28374 #: ../tools/virt-edit.pl:285
28376 "There are two ways also to use C<virt-edit> from scripts in order to make "
28377 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
28378 "like this, it's less error-prone to write scripts directly using the "
28379 "libguestfs API and Augeas for configuration file editing.)"
28383 #: ../tools/virt-edit.pl:291
28385 "The first method is to temporarily set C<$EDITOR> to any script or program "
28386 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
28387 "update C<tmpfile> in place however it likes."
28391 #: ../tools/virt-edit.pl:295
28393 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
28394 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
28395 "instances of C<foo> with C<bar> in a file:"
28399 #: ../tools/virt-edit.pl:299
28402 " virt-edit domname filename -e 's/foo/bar/'\n"
28407 #: ../tools/virt-edit.pl:301
28409 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
28410 "For example to delete root's password you could do:"
28414 #: ../tools/virt-edit.pl:304
28417 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
28422 #: ../tools/virt-edit.pl:306
28424 "What really happens is that the snippet is evaluated as a Perl expression "
28425 "for each line of the file. The line, including the final C<\\n>, is passed "
28426 "in C<$_> and the expression should update C<$_> or leave it unchanged."
28430 #: ../tools/virt-edit.pl:311
28432 "To delete a line, set C<$_> to the empty string. For example, to delete the "
28433 "C<apache> user account from the password file you can do:"
28437 #: ../tools/virt-edit.pl:314
28440 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
28445 #: ../tools/virt-edit.pl:316
28447 "To insert a line, prepend or append it to C<$_>. However appending lines to "
28448 "the end of the file is rather difficult this way since there is no concept "
28449 "of \"last line of the file\" - your expression just doesn't get called "
28450 "again. You might want to use the first method (setting C<$EDITOR>) if you "
28455 #: ../tools/virt-edit.pl:322
28457 "The variable C<$lineno> contains the current line number. As is "
28458 "traditional, the first line in the file is number C<1>."
28462 #: ../tools/virt-edit.pl:325
28464 "The return value from the expression is ignored, but the expression may call "
28465 "C<die> in order to abort the whole program, leaving the original file "
28470 #: ../tools/virt-edit.pl:329
28472 "Remember when matching the end of a line that C<$_> may contain the final "
28473 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
28474 "newline then neither of these. Thus to match or substitute some text at the "
28475 "end of a line, use this regular expression:"
28479 #: ../tools/virt-edit.pl:334
28482 " /some text(\\r?\\n)?$/\n"
28487 #: ../tools/virt-edit.pl:336
28489 "Alternately, use the perl C<chomp> function, being careful not to chomp "
28490 "C<$_> itself (since that would remove all newlines from the file):"
28494 #: ../tools/virt-edit.pl:340
28497 " my $m = $_; chomp $m; $m =~ /some text$/\n"
28502 #: ../tools/virt-edit.pl:344
28504 "C<virt-edit> has a limited ability to understand Windows drive letters and "
28505 "paths (eg. C<E:\\foo\\bar.txt>)."
28509 #: ../tools/virt-edit.pl:347
28510 msgid "If and only if the guest is running Windows then:"
28514 #: ../tools/virt-edit.pl:353
28516 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
28517 "to the correct filesystem."
28521 #: ../tools/virt-edit.pl:358
28523 "Any backslash (C<\\>) characters in the path are replaced with forward "
28524 "slashes so that libguestfs can process it."
28528 #: ../tools/virt-edit.pl:363
28530 "The path is resolved case insensitively to locate the file that should be "
28535 #: ../tools/virt-edit.pl:368
28536 msgid "There are some known shortcomings:"
28540 #: ../tools/virt-edit.pl:374
28541 msgid "Some NTFS symbolic links may not be followed correctly."
28545 #: ../tools/virt-edit.pl:378
28546 msgid "NTFS junction points that cross filesystems are not followed."
28550 #: ../tools/virt-edit.pl:435
28551 msgid "USING GUESTFISH"
28555 #: ../tools/virt-edit.pl:437
28557 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
28558 "C<virt-edit> doesn't work."
28562 #: ../tools/virt-edit.pl:440
28563 msgid "Using C<virt-edit> is approximately equivalent to doing:"
28567 #: ../tools/virt-edit.pl:442
28570 " guestfish --rw -i -d domname edit /file\n"
28575 #: ../tools/virt-edit.pl:444
28577 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
28578 "path to the file."
28582 #: ../tools/virt-edit.pl:447
28584 "The command above uses libguestfs's guest inspection feature and so does not "
28585 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
28586 "disk images that don't contain guests. To edit a file on a disk image "
28591 #: ../tools/virt-edit.pl:452
28594 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
28599 #: ../tools/virt-edit.pl:454
28601 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
28602 "the disk image to edit, and C</file> is the full path to the file."
28606 #: ../tools/virt-edit.pl:458
28608 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
28609 "C<write> or C<upload> instead:"
28613 #: ../tools/virt-edit.pl:461
28616 " guestfish --rw -i -d domname touch /newfile\n"
28621 #: ../tools/virt-edit.pl:463
28624 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
28629 #: ../tools/virt-edit.pl:465
28632 " guestfish --rw -i -d domname upload localfile /newfile\n"
28637 #: ../tools/virt-edit.pl:467
28638 msgid "C<virt-edit> cannot edit multiple files, but guestfish can do it like this:"
28642 #: ../tools/virt-edit.pl:470
28645 " guestfish --rw -i -d domname edit /file1 : edit /file2\n"
28650 #: ../tools/virt-edit.pl:480
28655 #: ../tools/virt-edit.pl:482
28657 "If set, this string is used as the editor. It may contain arguments, "
28658 "eg. C<\"emacs -nw\">"
28662 #: ../tools/virt-edit.pl:485
28663 msgid "If not set, C<vi> is used."
28667 #: ../tools/virt-edit.pl:489 ../tools/virt-win-reg.pl:559 ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:532 ../tools/virt-list-partitions.pl:250
28668 msgid "SHELL QUOTING"
28672 #: ../tools/virt-edit.pl:491 ../tools/virt-win-reg.pl:567 ../tools/virt-list-filesystems.pl:184 ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:252
28674 "Libvirt guest names can contain arbitrary characters, some of which have "
28675 "meaning to the shell such as C<#> and space. You may need to quote or "
28676 "escape these characters on the command line. See the shell manual page "
28677 "L<sh(1)> for details."
28681 #: ../tools/virt-edit.pl:498
28683 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
28684 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
28685 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
28689 #: ../tools/virt-edit.pl:510 ../tools/virt-win-reg.pl:598 ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:564 ../tools/virt-list-partitions.pl:269
28694 #: ../tools/virt-edit.pl:512 ../tools/virt-win-reg.pl:600 ../tools/virt-list-filesystems.pl:204 ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:566 ../tools/virt-list-partitions.pl:271
28695 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
28699 #: ../tools/virt-edit.pl:516
28700 msgid "Copyright (C) 2009-2011 Red Hat Inc."
28704 #: ../tools/virt-win-reg.pl:37
28706 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
28711 #: ../tools/virt-win-reg.pl:41
28714 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
28719 #: ../tools/virt-win-reg.pl:43
28722 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
28727 #: ../tools/virt-win-reg.pl:45
28730 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
28735 #: ../tools/virt-win-reg.pl:47
28738 " virt-win-reg --merge domname [input.reg ...]\n"
28743 #: ../tools/virt-win-reg.pl:49
28746 " virt-win-reg [--options] disk.img ... # instead of domname\n"
28751 #: ../tools/virt-win-reg.pl:53
28753 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
28754 "virtual machines. If you do this, you I<will> get irreversible disk "
28755 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
28756 "but doesn't catch all cases."
28760 #: ../tools/virt-win-reg.pl:58
28762 "Modifying the Windows Registry is an inherently risky operation. The format "
28763 "is deliberately obscure and undocumented, and Registry changes can leave the "
28764 "system unbootable. Therefore when using the C<--merge> option, make sure "
28765 "you have a reliable backup first."
28769 #: ../tools/virt-win-reg.pl:65
28771 "This program can export and merge Windows Registry entries from a Windows "
28776 #: ../tools/virt-win-reg.pl:68
28778 "The first parameter is the libvirt guest name or the raw disk image of a "
28783 #: ../tools/virt-win-reg.pl:71
28785 "If C<--merge> is I<not> specified, then the chosen registry key is "
28786 "displayed/exported (recursively). For example:"
28790 #: ../tools/virt-win-reg.pl:74
28793 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
28798 #: ../tools/virt-win-reg.pl:76
28799 msgid "You can also display single values from within registry keys, for example:"
28803 #: ../tools/virt-win-reg.pl:79
28806 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
28807 " $ virt-win-reg Windows7 $cvkey ProductName\n"
28808 " Windows 7 Enterprise\n"
28813 #: ../tools/virt-win-reg.pl:83
28815 "With C<--merge>, you can merge a textual regedit file into the Windows "
28820 #: ../tools/virt-win-reg.pl:86
28823 " $ virt-win-reg --merge Windows7 changes.reg\n"
28828 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
28833 #: ../tools/virt-win-reg.pl:90
28835 "This program is only meant for simple access to the registry. If you want "
28836 "to do complicated things with the registry, we suggest you download the "
28837 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
28838 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
28839 "L<hivexregedit(1)>."
28843 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
28848 #: ../tools/virt-win-reg.pl:122
28849 msgid "Enable debugging messages."
28853 #: ../tools/virt-win-reg.pl:157
28858 #: ../tools/virt-win-reg.pl:159
28860 "In merge mode, this merges a textual regedit file into the Windows Registry "
28861 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
28862 "displays or exports Registry entries instead."
28866 #: ../tools/virt-win-reg.pl:163
28868 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
28869 "result in disk corruption. However exporting (without this flag) is always "
28874 #: ../tools/virt-win-reg.pl:171
28875 msgid "B<--encoding> UTF-16LE|ASCII"
28879 #: ../tools/virt-win-reg.pl:173
28881 "When merging (only), you may need to specify the encoding for strings to be "
28882 "used in the hive file. This is explained in detail in "
28883 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
28887 #: ../tools/virt-win-reg.pl:177
28889 "The default is to use UTF-16LE, which should work with recent versions of "
28894 #: ../tools/virt-win-reg.pl:402
28895 msgid "SUPPORTED SYSTEMS"
28899 #: ../tools/virt-win-reg.pl:404
28901 "The program currently supports Windows NT-derived guests starting with "
28902 "Windows XP through to at least Windows 7."
28906 #: ../tools/virt-win-reg.pl:407
28908 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, "
28909 "C<HKEY_LOCAL_MACHINE\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, "
28910 "C<HKEY_LOCAL_MACHINE\\SYSTEM> and C<HKEY_USERS\\.DEFAULT>."
28914 #: ../tools/virt-win-reg.pl:411
28916 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
28921 #: ../tools/virt-win-reg.pl:414
28923 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
28928 #: ../tools/virt-win-reg.pl:417
28933 #: ../tools/virt-win-reg.pl:419
28935 "C<virt-win-reg> expects that regedit files have already been reencoded in "
28936 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
28937 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
28938 "with Windows-style line endings, you may need to reencode the whole file "
28939 "before or after processing."
28943 #: ../tools/virt-win-reg.pl:425
28945 "To reencode a file from Windows format to Linux (before processing it with "
28946 "the C<--merge> option), you would do something like this:"
28950 #: ../tools/virt-win-reg.pl:428
28953 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
28958 #: ../tools/virt-win-reg.pl:430
28960 "To go in the opposite direction, after exporting and before sending the file "
28961 "to a Windows user, do something like this:"
28965 #: ../tools/virt-win-reg.pl:433
28968 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
28973 #: ../tools/virt-win-reg.pl:435
28974 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
28978 #: ../tools/virt-win-reg.pl:437
28980 "If you are unsure about the current encoding, use the L<file(1)> command. "
28981 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
28982 "Windows-style (CRLF) line endings, like this:"
28986 #: ../tools/virt-win-reg.pl:441
28989 " $ file software.reg\n"
28990 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
28991 " with CRLF line terminators\n"
28996 #: ../tools/virt-win-reg.pl:445
28997 msgid "This file would need conversion before you could C<--merge> it."
29001 #: ../tools/virt-win-reg.pl:447
29002 msgid "CurrentControlSet etc."
29006 #: ../tools/virt-win-reg.pl:449
29008 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
29009 "Registry at the level of the hive file, and therefore you cannot modify "
29014 #: ../tools/virt-win-reg.pl:453
29016 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
29017 "circumstances it might refer to another control set. The way to find out is "
29018 "to look at the C<HKLM\\SYSTEM\\Select> key:"
29022 #: ../tools/virt-win-reg.pl:457
29025 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
29026 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
29027 " \"Current\"=dword:00000001\n"
29028 " \"Default\"=dword:00000001\n"
29029 " \"Failed\"=dword:00000000\n"
29030 " \"LastKnownGood\"=dword:00000002\n"
29035 #: ../tools/virt-win-reg.pl:464
29036 msgid "\"Current\" is the one which Windows will choose when it boots."
29040 #: ../tools/virt-win-reg.pl:466
29041 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
29045 #: ../tools/virt-win-reg.pl:469
29046 msgid "WINDOWS TIPS"
29050 #: ../tools/virt-win-reg.pl:471
29052 "Note that some of these tips modify the guest disk image. The guest I<must> "
29053 "be shut off, else you will get disk corruption."
29057 #: ../tools/virt-win-reg.pl:474
29058 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
29062 #: ../tools/virt-win-reg.pl:476
29064 "Prepare a DOS batch script, VBScript or executable. Upload this using "
29065 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
29066 "is uploaded into C<C:\\>:"
29070 #: ../tools/virt-win-reg.pl:480
29073 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
29078 #: ../tools/virt-win-reg.pl:482
29079 msgid "Prepare a regedit file containing the registry change:"
29083 #: ../tools/virt-win-reg.pl:484
29086 " cat > test.reg <<'EOF'\n"
29087 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
29088 " \"Test\"=\"c:\\\\test.bat\"\n"
29094 #: ../tools/virt-win-reg.pl:489
29096 "In this example we use the key C<RunOnce> which means that the script will "
29097 "run precisely once when the first user logs in. If you want it to run every "
29098 "time a user logs in, replace C<RunOnce> with C<Run>."
29102 #: ../tools/virt-win-reg.pl:493
29103 msgid "Now update the registry:"
29107 #: ../tools/virt-win-reg.pl:495
29110 " virt-win-reg --merge WindowsGuest test.reg\n"
29115 #: ../tools/virt-win-reg.pl:497
29116 msgid "INSTALLING A SERVICE"
29120 #: ../tools/virt-win-reg.pl:499
29122 "This section assumes you are familiar with Windows services, and you either "
29123 "have a program which handles the Windows Service Control Protocol directly "
29124 "or you want to run any program using a service wrapper like SrvAny or the "
29129 #: ../tools/virt-win-reg.pl:504
29131 "First upload the program and optionally the service wrapper. In this case "
29132 "the test program is called C<test.exe> and we are using the RHSrvAny "
29137 #: ../tools/virt-win-reg.pl:508
29140 " guestfish -i -d WindowsGuest <<EOF\n"
29141 " upload rhsrvany.exe /rhsrvany.exe\n"
29142 " upload test.exe /test.exe\n"
29148 #: ../tools/virt-win-reg.pl:513
29150 "Prepare a regedit file containing the registry changes. In this example, "
29151 "the first registry change is needed for the service itself or the service "
29152 "wrapper (if used). The second registry change is only needed because I am "
29153 "using the RHSrvAny service wrapper."
29157 #: ../tools/virt-win-reg.pl:518
29160 " cat > service.reg <<'EOF'\n"
29161 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
29162 " \"Type\"=dword:00000010\n"
29163 " \"Start\"=dword:00000002\n"
29164 " \"ErrorControl\"=dword:00000001\n"
29165 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
29166 " \"DisplayName\"=\"RHSrvAny\"\n"
29167 " \"ObjectName\"=\"NetworkService\"\n"
29172 #: ../tools/virt-win-reg.pl:527
29175 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
29176 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
29177 " \"PWD\"=\"c:\\\\Temp\"\n"
29183 #: ../tools/virt-win-reg.pl:538
29185 "For use of C<ControlSet001> see the section above in this manual page. You "
29186 "may need to adjust this according to the control set that is in use by the "
29191 #: ../tools/virt-win-reg.pl:544
29193 "C<\"ObjectName\"> controls the privileges that the service will have. An "
29194 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
29195 "privileged account."
29199 #: ../tools/virt-win-reg.pl:550
29201 "For the meaning of the magic numbers, see this Microsoft KB article: "
29202 "L<http://support.microsoft.com/kb/103000>."
29206 #: ../tools/virt-win-reg.pl:555
29207 msgid "Update the registry:"
29211 #: ../tools/virt-win-reg.pl:557
29214 " virt-win-reg --merge WindowsGuest service.reg\n"
29219 #: ../tools/virt-win-reg.pl:561
29221 "Be careful when passing parameters containing C<\\> (backslash) in the "
29222 "shell. Usually you will have to use 'single quotes' or double backslashes "
29223 "(but not both) to protect them from the shell."
29227 #: ../tools/virt-win-reg.pl:565
29228 msgid "Paths and value names are case-insensitive."
29232 #: ../tools/virt-win-reg.pl:574
29234 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
29235 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
29236 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
29237 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29241 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:555
29243 "When reporting bugs, please enable debugging and capture the I<complete> "
29248 #: ../tools/virt-win-reg.pl:592
29251 " export LIBGUESTFS_DEBUG=1\n"
29252 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
29257 #: ../tools/virt-win-reg.pl:595
29259 "Attach /tmp/virt-win-reg.log to a new bug report at "
29260 "L<https://bugzilla.redhat.com/>"
29264 #: ../tools/virt-win-reg.pl:604 ../tools/virt-make-fs.pl:570
29265 msgid "Copyright (C) 2010 Red Hat Inc."
29269 #: ../tools/virt-list-filesystems.pl:32
29270 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
29274 #: ../tools/virt-list-filesystems.pl:36
29277 " virt-list-filesystems [--options] domname\n"
29282 #: ../tools/virt-list-filesystems.pl:38
29285 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
29290 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
29292 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
29297 #: ../tools/virt-list-filesystems.pl:45
29299 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
29300 "are contained in a virtual machine or disk image."
29304 #: ../tools/virt-list-filesystems.pl:49
29306 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
29307 "functionality. For more complex cases you should look at the "
29308 "L<guestfish(1)> tool."
29312 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
29313 msgid "B<-l> | B<--long>"
29317 #: ../tools/virt-list-filesystems.pl:108
29319 "With this option, C<virt-list-filesystems> displays the type of each "
29320 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
29324 #: ../tools/virt-list-filesystems.pl:115
29325 msgid "B<-a> | B<--all>"
29329 #: ../tools/virt-list-filesystems.pl:117
29331 "Normally we only show mountable filesystems. If this option is given then "
29332 "swap devices are shown too."
29336 #: ../tools/virt-list-filesystems.pl:191
29338 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
29339 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
29340 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29344 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
29345 msgid "Copyright (C) 2009 Red Hat Inc."
29349 #: ../tools/virt-tar.pl:33
29350 msgid "virt-tar - Extract or upload files to a virtual machine"
29354 #: ../tools/virt-tar.pl:37
29357 " virt-tar [--options] -x domname directory tarball\n"
29362 #: ../tools/virt-tar.pl:39
29365 " virt-tar [--options] -u domname tarball directory\n"
29370 #: ../tools/virt-tar.pl:41
29373 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
29378 #: ../tools/virt-tar.pl:43
29381 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
29386 #: ../tools/virt-tar.pl:47
29388 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
29389 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
29393 #: ../tools/virt-tar.pl:52
29394 msgid "Download C</home> from the VM into a local tarball:"
29398 #: ../tools/virt-tar.pl:54
29401 " virt-tar -x domname /home home.tar\n"
29406 #: ../tools/virt-tar.pl:56
29409 " virt-tar -zx domname /home home.tar.gz\n"
29414 #: ../tools/virt-tar.pl:58
29415 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
29419 #: ../tools/virt-tar.pl:60
29422 " virt-tar -u domname uploadstuff.tar /tmp\n"
29427 #: ../tools/virt-tar.pl:62
29430 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
29435 #: ../tools/virt-tar.pl:66
29437 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
29438 "virtual machines. If you do this, you risk disk corruption in the VM. "
29439 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
29443 #: ../tools/virt-tar.pl:71
29445 "You can use C<-x> (extract) on live virtual machines, but you might get "
29446 "inconsistent results or errors if there is filesystem activity inside the "
29447 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
29448 "work, but the only way to guarantee consistent results is if the virtual "
29449 "machine is shut down."
29453 #: ../tools/virt-tar.pl:79
29455 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
29456 "parts of a guest filesystem. There are many possibilities: making backups, "
29457 "uploading data files, snooping on guest activity, fixing or customizing "
29462 #: ../tools/virt-tar.pl:84
29464 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
29465 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
29466 "should look at the L<guestfish(1)> tool."
29470 #: ../tools/virt-tar.pl:88
29472 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
29473 "its contents (recursively) from the virtual machine into a local tarball. "
29474 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
29475 "virtual machine. You cannot use these two options together."
29479 #: ../tools/virt-tar.pl:94
29481 "In addition, you may need to use the C<-z> (gZip) option to enable "
29482 "compression. When uploading, you have to specify C<-z> if the upload file "
29483 "is compressed because virt-tar won't detect this on its own."
29487 #: ../tools/virt-tar.pl:98
29489 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
29490 "example it cannot do PKZip files or bzip2 compression. If you want that "
29491 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
29492 "the L<libguestfs(3)> API)."
29496 #: ../tools/virt-tar.pl:156
29497 msgid "B<-x> | B<--extract> | B<--download>"
29501 #: ../tools/virt-tar.pl:158
29502 msgid "B<-u> | B<--upload>"
29506 #: ../tools/virt-tar.pl:160
29508 "Use C<-x> to extract (download) a directory from a virtual machine to a "
29513 #: ../tools/virt-tar.pl:163
29515 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
29516 "Please read the L</WARNING> section above before using this option."
29520 #: ../tools/virt-tar.pl:167
29521 msgid "You must specify exactly one of these options."
29525 #: ../tools/virt-tar.pl:173
29526 msgid "B<-z> | B<--gzip>"
29530 #: ../tools/virt-tar.pl:175
29531 msgid "Specify that the input or output tarball is gzip-compressed."
29535 #: ../tools/virt-tar.pl:288
29537 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
29538 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
29539 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
29540 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
29544 #: ../tools/virt-make-fs.pl:37
29545 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
29549 #: ../tools/virt-make-fs.pl:41
29552 " virt-make-fs [--options] input.tar output.img\n"
29557 #: ../tools/virt-make-fs.pl:43
29560 " virt-make-fs [--options] input.tar.gz output.img\n"
29565 #: ../tools/virt-make-fs.pl:45
29568 " virt-make-fs [--options] directory output.img\n"
29573 #: ../tools/virt-make-fs.pl:49
29575 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
29576 "archive or some files in a directory. It is similar to tools like "
29577 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
29578 "it can create common filesystem types like ext2/3 or NTFS, which can be "
29579 "useful if you want to attach these filesystems to existing virtual machines "
29580 "(eg. to import large amounts of read-only data to a VM)."
29584 #: ../tools/virt-make-fs.pl:57
29585 msgid "Basic usage is:"
29589 #: ../tools/virt-make-fs.pl:59
29592 " virt-make-fs input output\n"
29597 #: ../tools/virt-make-fs.pl:61
29599 "where C<input> is either a directory containing files that you want to add, "
29600 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
29601 "C<output> is a disk image. The input type is detected automatically. The "
29602 "output disk image defaults to a raw ext2 image unless you specify extra "
29603 "flags (see L</OPTIONS> below)."
29607 #: ../tools/virt-make-fs.pl:67
29608 msgid "EXTRA SPACE"
29612 #: ../tools/virt-make-fs.pl:69
29614 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
29615 "the files that it contains, but might have extra space. Depending on how "
29616 "you are going to use the output, you might think this extra space is wasted "
29617 "and want to minimize it, or you might want to leave space so that more files "
29618 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
29619 "but you can use the C<--size> flag to leave space in the filesystem if you "
29624 #: ../tools/virt-make-fs.pl:77
29626 "An alternative way to leave extra space but not make the output image any "
29627 "bigger is to use an alternative disk image format (instead of the default "
29628 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
29629 "image format (check your hypervisor supports this before using it). This "
29630 "allows you to choose a large C<--size> but the extra space won't actually be "
29631 "allocated in the image until you try to store something in it."
29635 #: ../tools/virt-make-fs.pl:85
29637 "Don't forget that you can also use local commands including L<resize2fs(8)> "
29638 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
29639 "to build another image from scratch."
29643 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
29648 #: ../tools/virt-make-fs.pl:91
29651 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
29656 #: ../tools/virt-make-fs.pl:93
29657 msgid "FILESYSTEM TYPE"
29661 #: ../tools/virt-make-fs.pl:95
29663 "The default filesystem type is C<ext2>. Just about any filesystem type that "
29664 "libguestfs supports can be used (but I<not> read-only formats like "
29665 "ISO9660). Here are some of the more common choices:"
29669 #: ../tools/virt-make-fs.pl:101
29674 #: ../tools/virt-make-fs.pl:103
29676 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
29677 "you are not going to use the filesystem in a way that requires the journal, "
29678 "then this is just wasted overhead."
29682 #: ../tools/virt-make-fs.pl:107
29683 msgid "I<ntfs> or I<vfat>"
29687 #: ../tools/virt-make-fs.pl:109
29688 msgid "Useful if exporting data to a Windows guest."
29692 #: ../tools/virt-make-fs.pl:111
29694 "I<Note for vfat>: The tar archive or local directory must only contain files "
29695 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
29696 "program running within libguestfs is unable to change the ownership of "
29697 "non-root files, since vfat itself does not support this."
29701 #: ../tools/virt-make-fs.pl:116
29706 #: ../tools/virt-make-fs.pl:118
29708 "Lower overhead than C<ext2>, but certain limitations on filename length and "
29709 "total filesystem size."
29713 #: ../tools/virt-make-fs.pl:125
29716 " virt-make-fs --type=minix input minixfs.img\n"
29721 #: ../tools/virt-make-fs.pl:127
29722 msgid "TO PARTITION OR NOT TO PARTITION"
29726 #: ../tools/virt-make-fs.pl:129
29727 msgid "Optionally virt-make-fs can add a partition table to the output disk."
29731 #: ../tools/virt-make-fs.pl:131
29733 "Adding a partition can make the disk image more compatible with certain "
29734 "virtualized operating systems which don't expect to see a filesystem "
29735 "directly located on a block device (Linux doesn't care and will happily "
29736 "handle both types)."
29740 #: ../tools/virt-make-fs.pl:136
29742 "On the other hand, if you have a partition table then the output image is no "
29743 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
29744 "directly on a partitioned disk image. (However libguestfs tools such as "
29745 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
29749 #: ../tools/virt-make-fs.pl:144
29750 msgid "Add an MBR partition:"
29754 #: ../tools/virt-make-fs.pl:146
29757 " virt-make-fs --partition -- input disk.img\n"
29762 #: ../tools/virt-make-fs.pl:148
29764 "If the output disk image could be terabyte-sized or larger, it's better to "
29765 "use an EFI/GPT-compatible partition table:"
29769 #: ../tools/virt-make-fs.pl:151
29772 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
29777 #: ../tools/virt-make-fs.pl:179
29778 msgid "Enable debugging information."
29782 #: ../tools/virt-make-fs.pl:185
29783 msgid "B<--size=E<lt>NE<gt>>"
29787 #: ../tools/virt-make-fs.pl:187
29788 msgid "B<--size=+E<lt>NE<gt>>"
29792 #: ../tools/virt-make-fs.pl:189
29793 msgid "B<-s E<lt>NE<gt>>"
29797 #: ../tools/virt-make-fs.pl:191
29798 msgid "B<-s +E<lt>NE<gt>>"
29802 #: ../tools/virt-make-fs.pl:193
29803 msgid "Use the C<--size> (or C<-s>) option to choose the size of the output image."
29807 #: ../tools/virt-make-fs.pl:196
29809 "If this option is I<not> given, then the output image will be just large "
29810 "enough to contain all the files, with not much wasted space."
29814 #: ../tools/virt-make-fs.pl:199
29816 "To choose a fixed size output disk, specify an absolute number followed by "
29817 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29818 "Petabytes or Exabytes. This must be large enough to contain all the input "
29819 "files, else you will get an error."
29823 #: ../tools/virt-make-fs.pl:204
29825 "To leave extra space, specify C<+> (plus sign) and a number followed by "
29826 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
29827 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
29828 "the input files, and (approximately) an extra 200 MB free space."
29832 #: ../tools/virt-make-fs.pl:210
29834 "Note that virt-make-fs estimates free space, and therefore will not produce "
29835 "filesystems containing precisely the free space requested. (It is much more "
29836 "expensive and time-consuming to produce a filesystem which has precisely the "
29837 "desired free space)."
29841 #: ../tools/virt-make-fs.pl:219
29842 msgid "B<--format=E<lt>fmtE<gt>>"
29846 #: ../tools/virt-make-fs.pl:221
29847 msgid "B<-F E<lt>fmtE<gt>>"
29851 #: ../tools/virt-make-fs.pl:223
29852 msgid "Choose the output disk image format."
29856 #: ../tools/virt-make-fs.pl:225
29857 msgid "The default is C<raw> (raw disk image)."
29861 #: ../tools/virt-make-fs.pl:227
29863 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
29864 "that would really make sense here is C<qcow2>."
29868 #: ../tools/virt-make-fs.pl:234
29869 msgid "B<--type=E<lt>fsE<gt>>"
29873 #: ../tools/virt-make-fs.pl:236
29874 msgid "B<-t E<lt>fsE<gt>>"
29878 #: ../tools/virt-make-fs.pl:238
29879 msgid "Choose the output filesystem type."
29883 #: ../tools/virt-make-fs.pl:240
29884 msgid "The default is C<ext2>."
29888 #: ../tools/virt-make-fs.pl:242
29889 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
29893 #: ../tools/virt-make-fs.pl:249
29894 msgid "B<--partition>"
29898 #: ../tools/virt-make-fs.pl:251
29899 msgid "B<--partition=E<lt>parttypeE<gt>>"
29903 #: ../tools/virt-make-fs.pl:253
29905 "If specified, this flag adds an MBR partition table to the output disk "
29910 #: ../tools/virt-make-fs.pl:256
29912 "You can change the partition table type, eg. C<--partition=gpt> for large "
29917 #: ../tools/virt-make-fs.pl:259
29919 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
29920 "might consider the next parameter to be the partition type. For example:"
29924 #: ../tools/virt-make-fs.pl:263
29927 " virt-make-fs --partition input.tar ...\n"
29932 #: ../tools/virt-make-fs.pl:265
29934 "would cause virt-make-fs to think you wanted to use a partition type of "
29935 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
29936 "dash) between options and the input file argument:"
29940 #: ../tools/virt-make-fs.pl:269
29943 " virt-make-fs --partition -- input.tar ...\n"
29948 #: ../tools/virt-make-fs.pl:541
29950 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
29951 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
29952 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
29956 #: ../tools/virt-make-fs.pl:558
29959 " export LIBGUESTFS_DEBUG=1\n"
29960 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
29965 #: ../tools/virt-make-fs.pl:561
29967 "Attach /tmp/virt-make-fs.log to a new bug report at "
29968 "L<https://bugzilla.redhat.com/>"
29972 #: ../tools/virt-list-partitions.pl:32
29973 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
29977 #: ../tools/virt-list-partitions.pl:36
29980 " virt-list-partitions [--options] domname\n"
29985 #: ../tools/virt-list-partitions.pl:38
29988 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
29993 #: ../tools/virt-list-partitions.pl:45
29995 "C<virt-list-partitions> is a command line tool to list the partitions that "
29996 "are contained in a virtual machine or disk image. It is mainly useful as a "
29997 "first step to using L<virt-resize(1)>."
30001 #: ../tools/virt-list-partitions.pl:50
30003 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
30004 "functionality. For more complex cases you should look at the "
30005 "L<guestfish(1)> tool."
30009 #: ../tools/virt-list-partitions.pl:107
30010 msgid "B<-h> | B<--human-readable>"
30014 #: ../tools/virt-list-partitions.pl:109
30015 msgid "Show sizes in human-readable form (eg. \"1G\")."
30019 #: ../tools/virt-list-partitions.pl:117
30021 "With this option, C<virt-list-partitions> displays the type and size of each "
30022 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
30026 #: ../tools/virt-list-partitions.pl:124
30027 msgid "B<-t> | B<--total>"
30031 #: ../tools/virt-list-partitions.pl:126
30032 msgid "Display the total size of each block device (as a separate row or rows)."
30036 #: ../tools/virt-list-partitions.pl:259
30038 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
30039 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
30040 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
30044 #: ../tools/virt-list-partitions.pl:275
30045 msgid "Copyright (C) 2009-2010 Red Hat Inc."