1 # SOME DESCRIPTIVE TITLE.
2 # Copyright (C) YEAR Free Software Foundation, Inc.
3 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
8 "Project-Id-Version: PACKAGE VERSION\n"
9 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
10 "POT-Creation-Date: 2011-02-06 17:14+0000\n"
11 "PO-Revision-Date: 2010-09-02 14:46+0100\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
21 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
22 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
23 #: ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35
24 #: ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30
25 #: ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35
26 #: ../tools/virt-list-partitions.pl:30
32 #: ../src/guestfs.pod:5
33 msgid "guestfs - Library for accessing and modifying virtual machine images"
38 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
39 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
40 #: ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39
41 #: ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34
42 #: ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39
43 #: ../tools/virt-list-partitions.pl:34
49 #: ../src/guestfs.pod:9
52 " #include <guestfs.h>\n"
58 #: ../src/guestfs.pod:11
61 " guestfs_h *g = guestfs_create ();\n"
62 " guestfs_add_drive (g, \"guest.img\");\n"
63 " guestfs_launch (g);\n"
64 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
65 " guestfs_touch (g, \"/hello\");\n"
66 " guestfs_umount (g, \"/\");\n"
67 " guestfs_close (g);\n"
73 #: ../src/guestfs.pod:19
76 " cc prog.c -o prog -lguestfs\n"
78 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
84 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30
85 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
86 #: ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63
87 #: ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40
88 #: ../tools/virt-tar.pl:77 ../tools/virt-make-fs.pl:47
89 #: ../tools/virt-list-partitions.pl:40
95 #: ../src/guestfs.pod:25
97 "Libguestfs is a library for accessing and modifying guest disk images. "
98 "Amongst the things this is good for: making batch configuration changes to "
99 "guests, getting disk used/free statistics (see also: virt-df), migrating "
100 "between virtualization systems (see also: virt-p2v), performing partial "
101 "backups, performing partial guest clones, cloning guests and changing "
102 "registry/UUID/hostname info, and much else besides."
107 #: ../src/guestfs.pod:33
109 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
110 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
111 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
117 #: ../src/guestfs.pod:38
119 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
120 "what filesystem is in each LV, etc.). It can also run commands in the "
121 "context of the guest. Also you can access filesystems over FUSE."
126 #: ../src/guestfs.pod:43
128 "Libguestfs is a library that can be linked with C and C++ management "
129 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
130 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
136 #: ../src/guestfs.pod:48
138 "You don't need to be root to use libguestfs, although obviously you do need "
139 "enough permissions to access the disk images."
144 #: ../src/guestfs.pod:51
146 "Libguestfs is a large API because it can do many things. For a gentle "
147 "introduction, please read the L</API OVERVIEW> section next."
152 #: ../src/guestfs.pod:54
154 "There are also some example programs in the L<guestfs-examples(3)> manual "
160 #: ../src/guestfs.pod:57
166 #: ../src/guestfs.pod:59
168 "This section provides a gentler overview of the libguestfs API. We also try "
169 "to group API calls together, where that may not be obvious from reading "
170 "about the individual calls in the main section of this manual."
175 #: ../src/guestfs.pod:64
181 #: ../src/guestfs.pod:66
183 "Before you can use libguestfs calls, you have to create a handle. Then you "
184 "must add at least one disk image to the handle, followed by launching the "
185 "handle, then performing whatever operations you want, and finally closing "
186 "the handle. By convention we use the single letter C<g> for the name of the "
187 "handle variable, although of course you can use any name you want."
192 #: ../src/guestfs.pod:73
193 msgid "The general structure of all libguestfs-using programs looks like this:"
198 #: ../src/guestfs.pod:76
201 " guestfs_h *g = guestfs_create ();\n"
207 #: ../src/guestfs.pod:78
210 " /* Call guestfs_add_drive additional times if there are\n"
211 " * multiple disk images.\n"
213 " guestfs_add_drive (g, \"guest.img\");\n"
219 #: ../src/guestfs.pod:83
222 " /* Most manipulation calls won't work until you've launched\n"
223 " * the handle 'g'. You have to do this _after_ adding drives\n"
224 " * and _before_ other commands.\n"
226 " guestfs_launch (g);\n"
232 #: ../src/guestfs.pod:89
235 " /* Now you can examine what partitions, LVs etc are available.\n"
237 " char **partitions = guestfs_list_partitions (g);\n"
238 " char **logvols = guestfs_lvs (g);\n"
244 #: ../src/guestfs.pod:94
247 " /* To access a filesystem in the image, you must mount it.\n"
249 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
255 #: ../src/guestfs.pod:98
258 " /* Now you can perform filesystem actions on the guest\n"
261 " guestfs_touch (g, \"/hello\");\n"
267 #: ../src/guestfs.pod:103
270 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
271 " * it is done automatically when you close the handle. See\n"
272 " * discussion of autosync in this page.\n"
274 " guestfs_sync (g);\n"
280 #: ../src/guestfs.pod:109
283 " /* Close the handle 'g'. */\n"
284 " guestfs_close (g);\n"
290 #: ../src/guestfs.pod:112
292 "The code above doesn't include any error checking. In real code you should "
293 "check return values carefully for errors. In general all functions that "
294 "return integers return C<-1> on error, and all functions that return "
295 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
296 "how to handle errors, and consult the documentation for each function call "
297 "below to see precisely how they return error indications. See L<guestfs-"
298 "examples(3)> for fully worked examples."
303 #: ../src/guestfs.pod:121
309 #: ../src/guestfs.pod:123
311 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
312 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
313 "actual block device, or simply an empty file of zeroes that you have created "
314 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
320 #: ../src/guestfs.pod:129
322 "The call you should use in modern code for adding drives is L</"
323 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
324 "specifying that the format is raw, do:"
329 #: ../src/guestfs.pod:133
332 " guestfs_add_drive_opts (g, filename,\n"
333 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
340 #: ../src/guestfs.pod:137
341 msgid "You can add a disk read-only using:"
346 #: ../src/guestfs.pod:139
349 " guestfs_add_drive_opts (g, filename,\n"
350 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
351 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
358 #: ../src/guestfs.pod:144
360 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
361 "libguestfs won't modify the file."
366 #: ../src/guestfs.pod:147
368 "Be extremely cautious if the disk image is in use, eg. if it is being used "
369 "by a virtual machine. Adding it read-write will almost certainly cause disk "
370 "corruption, but adding it read-only is safe."
375 #: ../src/guestfs.pod:151
377 "You must add at least one disk image, and you may add multiple disk images. "
378 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
379 "first one you added), C</dev/sdb> (for the second one you added), etc."
384 #: ../src/guestfs.pod:156
386 "Once L</guestfs_launch> has been called you cannot add any more images. You "
387 "can call L</guestfs_list_devices> to get a list of the device names, in the "
388 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
393 #: ../src/guestfs.pod:161
398 #: ../src/guestfs.pod:163
400 "Before you can read or write files, create directories and so on in a disk "
401 "image that contains filesystems, you have to mount those filesystems using "
402 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
403 "a disk image contains (for example) one partition with a filesystem on that "
404 "partition, then you can mount it directly:"
408 #: ../src/guestfs.pod:170
411 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
416 #: ../src/guestfs.pod:172
418 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
419 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
420 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
421 "that these are libguestfs virtual devices, and are nothing to do with host "
426 #: ../src/guestfs.pod:178
428 "If you are given a disk image and you don't know what it contains then you "
429 "have to find out. Libguestfs can do that too: use L</"
430 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
431 "LVs, and either try mounting each to see what is mountable, or else examine "
432 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
433 "filesystems, use L</guestfs_list_filesystems>."
437 #: ../src/guestfs.pod:186
439 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
440 "L</INSPECTION> below). But you might find it easier to look at higher level "
441 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
445 #: ../src/guestfs.pod:191
447 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
448 "several other variations of the C<guestfs_mount_*> call."
453 #: ../src/guestfs.pod:194
454 msgid "FILESYSTEM ACCESS AND MODIFICATION"
459 #: ../src/guestfs.pod:196
461 "The majority of the libguestfs API consists of fairly low-level calls for "
462 "accessing and modifying the files, directories, symlinks etc on mounted "
463 "filesystems. There are over a hundred such calls which you can find listed "
464 "in detail below in this man page, and we don't even pretend to cover them "
465 "all in this overview."
470 #: ../src/guestfs.pod:202
472 "Specify filenames as full paths, starting with C<\"/\"> and including the "
478 #: ../src/guestfs.pod:205
480 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
481 "the file called C<\"etc/passwd\"> then you could do:"
486 #: ../src/guestfs.pod:208
489 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
495 #: ../src/guestfs.pod:210
497 "This would return C<data> as a newly allocated buffer containing the full "
498 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
499 "or C<NULL> if there was an error."
504 #: ../src/guestfs.pod:214
506 "As another example, to create a top-level directory on that filesystem "
507 "called C<\"var\"> you would do:"
512 #: ../src/guestfs.pod:217
515 " guestfs_mkdir (g, \"/var\");\n"
521 #: ../src/guestfs.pod:219
522 msgid "To create a symlink you could do:"
527 #: ../src/guestfs.pod:221
530 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
531 " \"/etc/rc3.d/S30portmap\");\n"
537 #: ../src/guestfs.pod:224
539 "Libguestfs will reject attempts to use relative paths and there is no "
540 "concept of a current working directory."
545 #: ../src/guestfs.pod:227
547 "Libguestfs can return errors in many situations: for example if the "
548 "filesystem isn't writable, or if a file or directory that you requested "
549 "doesn't exist. If you are using the C API (documented here) you have to "
550 "check for those error conditions after each call. (Other language bindings "
551 "turn these errors into exceptions)."
556 #: ../src/guestfs.pod:233
558 "File writes are affected by the per-handle umask, set by calling L</"
559 "guestfs_umask> and defaulting to 022. See L</UMASK>."
564 #: ../src/guestfs.pod:236
570 #: ../src/guestfs.pod:238
572 "Libguestfs contains API calls to read, create and modify partition tables on "
578 #: ../src/guestfs.pod:241
580 "In the common case where you want to create a single partition covering the "
581 "whole disk, you should use the L</guestfs_part_disk> call:"
586 #: ../src/guestfs.pod:245
589 " const char *parttype = \"mbr\";\n"
590 " if (disk_is_larger_than_2TB)\n"
591 " parttype = \"gpt\";\n"
592 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
598 #: ../src/guestfs.pod:250
600 "Obviously this effectively wipes anything that was on that disk image before."
605 #: ../src/guestfs.pod:253
611 #: ../src/guestfs.pod:255
613 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
614 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
615 "you familiarize yourself with the concepts of physical volumes, volume "
616 "groups and logical volumes."
621 #: ../src/guestfs.pod:260
623 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
624 "tldp.org/HOWTO/LVM-HOWTO/>."
629 #: ../src/guestfs.pod:263
634 #: ../src/guestfs.pod:265
636 "Use L</guestfs_cat> to download small, text only files. This call is "
637 "limited to files which are less than 2 MB and which cannot contain any ASCII "
638 "NUL (C<\\0>) characters. However the API is very simple to use."
643 #: ../src/guestfs.pod:269
645 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
646 "bit data, since it returns a (pointer, size) pair. However it is still "
647 "limited to \"small\" files, less than 2 MB."
652 #: ../src/guestfs.pod:273
654 "L</guestfs_download> can be used to download any file, with no limits on "
655 "content or size (even files larger than 4 GB)."
660 #: ../src/guestfs.pod:276
662 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
667 #: ../src/guestfs.pod:279
673 #: ../src/guestfs.pod:281
675 "It's often the case that you want to write a file or files to the disk image."
680 #: ../src/guestfs.pod:284
682 "To write a small file with fixed content, use L</guestfs_write>. To create "
683 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
684 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
685 "of other functions for creating test files, for example L</guestfs_fill> and "
686 "L</guestfs_fill_pattern>."
691 #: ../src/guestfs.pod:290
693 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
694 "file content or size (even files larger than 4 GB)."
699 #: ../src/guestfs.pod:293
701 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
706 #: ../src/guestfs.pod:295
708 "However the fastest way to upload I<large numbers of arbitrary files> is to "
709 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
710 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
711 "in a predictable way (eg. adding it last after all other drives) then you "
712 "can get the device name from L</guestfs_list_devices> and mount it directly "
713 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
714 "portable between kernel versions, and they don't support labels or UUIDs. "
715 "If you want to pre-build an image or you need to mount it using a label or "
716 "UUID, use an ISO image instead."
721 #: ../src/guestfs.pod:306
727 #: ../src/guestfs.pod:308
729 "There are various different commands for copying between files and devices "
730 "and in and out of the guest filesystem. These are summarised in the table "
736 #: ../src/guestfs.pod:314
737 msgid "B<file> to B<file>"
742 #: ../src/guestfs.pod:316
744 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
745 "directories recursively."
750 #: ../src/guestfs.pod:319
751 msgid "B<file or device> to B<file or device>"
756 #: ../src/guestfs.pod:321
758 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
759 "devices in the guest."
764 #: ../src/guestfs.pod:324
765 msgid "Example: duplicate the contents of an LV:"
770 #: ../src/guestfs.pod:326
773 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
779 #: ../src/guestfs.pod:328
781 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
782 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
783 "guestfs_copy_size>."
788 #: ../src/guestfs.pod:332
789 msgid "B<file on the host> to B<file or device>"
794 #: ../src/guestfs.pod:334
795 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
800 #: ../src/guestfs.pod:336
801 msgid "B<file or device> to B<file on the host>"
806 #: ../src/guestfs.pod:338
807 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
812 #: ../src/guestfs.pod:342
813 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
818 #: ../src/guestfs.pod:344
820 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
821 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
822 "appears you can only upload and download to files. However many Un*x-like "
823 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
824 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
825 "and arbitrary file descriptor N."
830 #: ../src/guestfs.pod:352
831 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
835 #: ../src/guestfs.pod:355
838 " guestfs_download (g, filename, \"/dev/stdout\");\n"
844 #: ../src/guestfs.pod:357
845 msgid "and you can write tar output to a pipe C<fd> by doing:"
849 #: ../src/guestfs.pod:359
853 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
854 " guestfs_tar_out (g, \"/\", devfd);\n"
860 #: ../src/guestfs.pod:363
861 msgid "LISTING FILES"
866 #: ../src/guestfs.pod:365
868 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
869 "L<guestfish(1)>-equivalent command C<ll>)."
874 #: ../src/guestfs.pod:368
876 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
877 "programs, as a flat list of strings."
882 #: ../src/guestfs.pod:371
884 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
885 "directory, plus additional information about each one. It is more "
886 "equivalent to using the L<readdir(3)> call on a local filesystem."
891 #: ../src/guestfs.pod:375
893 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
898 #: ../src/guestfs.pod:378
899 msgid "RUNNING COMMANDS"
904 #: ../src/guestfs.pod:380
906 "Although libguestfs is primarily an API for manipulating files inside guest "
907 "images, we also provide some limited facilities for running commands inside "
913 #: ../src/guestfs.pod:384
914 msgid "There are many limitations to this:"
919 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398
920 #: ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411
921 #: ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1088
922 #: ../src/guestfs.pod:1092 ../src/guestfs.pod:1096 ../src/guestfs.pod:1101
923 #: ../src/guestfs.pod:1109 ../src/guestfs.pod:1128 ../src/guestfs.pod:1136
924 #: ../src/guestfs.pod:1158 ../src/guestfs.pod:1162 ../src/guestfs.pod:1166
925 #: ../src/guestfs.pod:1170 ../src/guestfs.pod:1174 ../src/guestfs.pod:1178
926 #: ../src/guestfs.pod:1660 ../src/guestfs.pod:1665 ../src/guestfs.pod:1669
927 #: ../src/guestfs.pod:1779 ../src/guestfs.pod:1784 ../src/guestfs.pod:1788
928 #: ../src/guestfs.pod:2140 ../src/guestfs.pod:2146 ../src/guestfs.pod:2151
929 #: ../src/guestfs.pod:2157 ../src/guestfs.pod:2622 ../src/guestfs.pod:2626
930 #: ../src/guestfs.pod:2630 ../src/guestfs.pod:2634
931 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
932 #: ../src/guestfs-actions.pod:577 ../src/guestfs-actions.pod:585
933 #: ../src/guestfs-actions.pod:592 ../src/guestfs-actions.pod:599
934 #: ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1599
935 #: ../src/guestfs-actions.pod:1603 ../src/guestfs-actions.pod:1607
936 #: ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1619
937 #: ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1633
938 #: ../src/guestfs-actions.pod:1637 ../src/guestfs-actions.pod:1641
939 #: ../src/guestfs-actions.pod:1779 ../src/guestfs-actions.pod:1783
940 #: ../src/guestfs-actions.pod:1788 ../src/guestfs-actions.pod:1793
941 #: ../src/guestfs-actions.pod:1854 ../src/guestfs-actions.pod:1858
942 #: ../src/guestfs-actions.pod:1863 ../fish/guestfish.pod:432
943 #: ../fish/guestfish.pod:436 ../fish/guestfish.pod:440
944 #: ../fish/guestfish.pod:444 ../fish/guestfish-actions.pod:13
945 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:380
946 #: ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:395
947 #: ../fish/guestfish-actions.pod:402 ../fish/guestfish-actions.pod:1072
948 #: ../fish/guestfish-actions.pod:1076 ../fish/guestfish-actions.pod:1080
949 #: ../fish/guestfish-actions.pod:1084 ../fish/guestfish-actions.pod:1092
950 #: ../fish/guestfish-actions.pod:1096 ../fish/guestfish-actions.pod:1100
951 #: ../fish/guestfish-actions.pod:1110 ../fish/guestfish-actions.pod:1114
952 #: ../fish/guestfish-actions.pod:1118 ../fish/guestfish-actions.pod:1208
953 #: ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:1217
954 #: ../fish/guestfish-actions.pod:1222 ../fish/guestfish-actions.pod:1264
955 #: ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1273
956 #: ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542
957 #: ../tools/virt-win-reg.pl:548 ../tools/virt-resize.pl:345
958 #: ../tools/virt-resize.pl:350 ../tools/virt-resize.pl:360
964 #: ../src/guestfs.pod:390
966 "The kernel version that the command runs under will be different from what "
972 #: ../src/guestfs.pod:395
974 "If the command needs to communicate with daemons, then most likely they "
980 #: ../src/guestfs.pod:400
981 msgid "The command will be running in limited memory."
986 #: ../src/guestfs.pod:404
988 "The network may not be available unless you enable it (see L</"
989 "guestfs_set_network>)."
994 #: ../src/guestfs.pod:409
995 msgid "Only supports Linux guests (not Windows, BSD, etc)."
1000 #: ../src/guestfs.pod:413
1002 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
1007 #: ../src/guestfs.pod:418
1009 "For SELinux guests, you may need to enable SELinux and load policy first. "
1010 "See L</SELINUX> in this manpage."
1015 #: ../src/guestfs.pod:423
1017 "I<Security:> It is not safe to run commands from untrusted, possibly "
1018 "malicious guests. These commands may attempt to exploit your program by "
1019 "sending unexpected output. They could also try to exploit the Linux kernel "
1020 "or qemu provided by the libguestfs appliance. They could use the network "
1021 "provided by the libguestfs appliance to bypass ordinary network partitions "
1022 "and firewalls. They could use the elevated privileges or different SELinux "
1023 "context of your program to their advantage."
1028 #: ../src/guestfs.pod:432
1030 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
1031 "(a script which runs when the guest next boots normally), and to have this "
1032 "script run the commands you want in the normal context of the running guest, "
1033 "network security and so on. For information about other security issues, "
1039 #: ../src/guestfs.pod:440
1041 "The two main API calls to run commands are L</guestfs_command> and L</"
1042 "guestfs_sh> (there are also variations)."
1047 #: ../src/guestfs.pod:443
1049 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
1050 "shell globs, redirections, etc will work."
1055 #: ../src/guestfs.pod:446
1056 msgid "CONFIGURATION FILES"
1061 #: ../src/guestfs.pod:448
1063 "To read and write configuration files in Linux guest filesystems, we "
1064 "strongly recommend using Augeas. For example, Augeas understands how to "
1065 "read and write, say, a Linux shadow password file or X.org configuration "
1066 "file, and so avoids you having to write that code."
1071 #: ../src/guestfs.pod:453
1073 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
1074 "document Augeas itself here because there is excellent documentation on the "
1075 "L<http://augeas.net/> website."
1080 #: ../src/guestfs.pod:457
1082 "If you don't want to use Augeas (you fool!) then try calling L</"
1083 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
1089 #: ../src/guestfs.pod:461
1095 #: ../src/guestfs.pod:463
1097 "We support SELinux guests. To ensure that labeling happens correctly in "
1098 "SELinux guests, you need to enable SELinux and load the guest's policy:"
1103 #: ../src/guestfs.pod:469 ../src/guestfs.pod:1281 ../src/guestfs.pod:1412
1104 #: ../src/guestfs.pod:2185
1110 #: ../src/guestfs.pod:471
1111 msgid "Before launching, do:"
1116 #: ../src/guestfs.pod:473
1119 " guestfs_set_selinux (g, 1);\n"
1125 #: ../src/guestfs.pod:475 ../src/guestfs.pod:1285 ../src/guestfs.pod:1416
1126 #: ../src/guestfs.pod:2210
1132 #: ../src/guestfs.pod:477
1134 "After mounting the guest's filesystem(s), load the policy. This is best "
1135 "done by running the L<load_policy(8)> command in the guest itself:"
1140 #: ../src/guestfs.pod:481
1143 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
1149 #: ../src/guestfs.pod:483
1151 "(Older versions of C<load_policy> require you to specify the name of the "
1157 #: ../src/guestfs.pod:486 ../src/guestfs.pod:1422
1163 #: ../src/guestfs.pod:488
1165 "Optionally, set the security context for the API. The correct security "
1166 "context to use can only be known by inspecting the guest. As an example:"
1171 #: ../src/guestfs.pod:492
1174 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1180 #: ../src/guestfs.pod:496
1181 msgid "This will work for running commands and editing existing files."
1186 #: ../src/guestfs.pod:498
1188 "When new files are created, you may need to label them explicitly, for "
1189 "example by running the external command C<restorecon pathname>."
1194 #: ../src/guestfs.pod:502
1200 #: ../src/guestfs.pod:504
1202 "Certain calls are affected by the current file mode creation mask (the "
1203 "\"umask\"). In particular ones which create files or directories, such as "
1204 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1205 "either the default mode that the file is created with or modifies the mode "
1211 #: ../src/guestfs.pod:510
1213 "The default umask is C<022>, so files are created with modes such as C<0644> "
1214 "and directories with C<0755>."
1219 #: ../src/guestfs.pod:513
1221 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1222 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1223 "guestfs_chmod> after creating each file or directory."
1228 #: ../src/guestfs.pod:517
1229 msgid "For more information about umask, see L<umask(2)>."
1234 #: ../src/guestfs.pod:519 ../fish/guestfish.pod:751
1235 msgid "ENCRYPTED DISKS"
1240 #: ../src/guestfs.pod:521
1242 "Libguestfs allows you to access Linux guests which have been encrypted using "
1243 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1244 "standard. This includes nearly all whole disk encryption systems used by "
1245 "modern Linux guests."
1250 #: ../src/guestfs.pod:527
1252 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1253 "returns the string C<crypto_LUKS>)."
1258 #: ../src/guestfs.pod:530
1260 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1261 "will require the passphrase!"
1266 #: ../src/guestfs.pod:533
1268 "Opening a LUKS device creates a new device mapper device called C</dev/"
1269 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1270 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1271 "from and encrypted to the underlying block device respectively."
1276 #: ../src/guestfs.pod:539
1278 "LVM volume groups on the device can be made visible by calling L</"
1279 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1280 "(s) can now be mounted in the usual way."
1285 #: ../src/guestfs.pod:543
1287 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1288 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1289 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1290 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1291 "underlying encrypted block device)."
1296 #: ../src/guestfs.pod:550
1301 #: ../src/guestfs.pod:552
1303 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1304 "contains operating systems, an install CD or a live CD. (These APIs used to "
1305 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
1306 "version 1.5.3 the most frequently used part of this library has been "
1307 "rewritten in C and moved into the core code)."
1312 #: ../src/guestfs.pod:559
1314 "Add all disks belonging to the unknown virtual machine and call L</"
1315 "guestfs_launch> in the usual way."
1320 #: ../src/guestfs.pod:562
1322 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1323 "and certain heuristics, and returns a list of operating systems that were "
1324 "found. An empty list means none were found. A single element is the root "
1325 "filesystem of the operating system. For dual- or multi-boot guests, "
1326 "multiple roots can be returned, each one corresponding to a separate "
1327 "operating system. (Multi-boot virtual machines are extremely rare in the "
1328 "world of virtualization, but since this scenario can happen, we have built "
1329 "libguestfs to deal with it.)"
1334 #: ../src/guestfs.pod:571
1336 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1337 "to get additional details about that operating system. For example, call L</"
1338 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1339 "Windows and Linux-based operating systems respectively."
1344 #: ../src/guestfs.pod:577
1346 "Un*x-like and Linux-based operating systems usually consist of several "
1347 "filesystems which are mounted at boot time (for example, a separate boot "
1348 "partition mounted on C</boot>). The inspection rules are able to detect how "
1349 "filesystems correspond to mount points. Call "
1350 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1351 "hash table like this example:"
1356 #: ../src/guestfs.pod:584
1359 " /boot => /dev/sda1\n"
1360 " / => /dev/vg_guest/lv_root\n"
1361 " /usr => /dev/vg_guest/lv_usr\n"
1367 #: ../src/guestfs.pod:588
1369 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1370 "filesystems as suggested."
1375 #: ../src/guestfs.pod:591
1377 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1378 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1383 #: ../src/guestfs.pod:595
1385 "Inspection currently only works for some common operating systems. "
1386 "Contributors are welcome to send patches for other operating systems that we "
1387 "currently cannot detect."
1392 #: ../src/guestfs.pod:599
1394 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1395 "for more details. The L</guestfs_inspect_os> function just ignores any "
1396 "encrypted devices."
1401 #: ../src/guestfs.pod:603
1403 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1404 "inspection and caches the results in the guest handle. Subsequent calls to "
1405 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1406 "read the disks. If you change the content of the guest disks, you can redo "
1407 "inspection by calling L</guestfs_inspect_os> again. (L</"
1408 "guestfs_inspect_list_applications> works a little differently from the other "
1409 "calls and does read the disks. See documentation for that function for "
1414 #: ../src/guestfs.pod:612
1415 msgid "INSPECTING INSTALL DISKS"
1419 #: ../src/guestfs.pod:614
1421 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
1426 #: ../src/guestfs.pod:617
1428 "Call L</guestfs_inspect_get_format> to return the format of the operating "
1429 "system, which currently can be C<installed> (a regular operating system) or "
1430 "C<installer> (some sort of install disk)."
1434 #: ../src/guestfs.pod:621
1436 "Further information is available about the operating system that can be "
1437 "installed using the regular inspection APIs like L</"
1438 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
1442 #: ../src/guestfs.pod:626
1444 "Some additional information specific to installer disks is also available "
1445 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
1446 "guestfs_inspect_is_multipart> calls."
1451 #: ../src/guestfs.pod:631
1452 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1457 #: ../src/guestfs.pod:633
1459 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1460 "ntfs-3g.org/> driver."
1465 #: ../src/guestfs.pod:636
1466 msgid "DRIVE LETTERS AND PATHS"
1471 #: ../src/guestfs.pod:638
1473 "DOS and Windows still use drive letters, and the filesystems are always "
1474 "treated as case insensitive by Windows itself, and therefore you might find "
1475 "a Windows configuration file referring to a path like C<c:\\windows"
1476 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1477 "might be referred to as C</WINDOWS/System32>."
1482 #: ../src/guestfs.pod:644
1484 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1485 "libguestfs to read the appropriate Windows Registry and configuration files, "
1486 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1492 #: ../src/guestfs.pod:649
1494 "Replacing backslash characters with forward slash characters is also outside "
1495 "the scope of libguestfs, but something that you can easily do."
1500 #: ../src/guestfs.pod:652
1502 "Where we can help is in resolving the case insensitivity of paths. For "
1503 "this, call L</guestfs_case_sensitive_path>."
1508 #: ../src/guestfs.pod:655
1509 msgid "ACCESSING THE WINDOWS REGISTRY"
1514 #: ../src/guestfs.pod:657
1516 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1517 "files, through the library C<hivex> which is part of the libguestfs project "
1518 "although ships as a separate tarball. You have to locate and download the "
1519 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1520 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1521 "reg(1)> for more help on this issue."
1526 #: ../src/guestfs.pod:665
1527 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1532 #: ../src/guestfs.pod:667
1534 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1535 "provide something which looks like a Linux symlink. The way it tries to do "
1536 "the rewriting is described here:"
1541 #: ../src/guestfs.pod:671
1543 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
1549 #: ../src/guestfs.pod:673
1551 "The essential problem is that ntfs-3g simply does not have enough "
1552 "information to do a correct job. NTFS links can contain drive letters and "
1553 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1554 "It is almost certainly the case that libguestfs callers should ignore what "
1555 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1560 #: ../src/guestfs.pod:680
1562 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
1563 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1564 "attribute, and read the raw reparse data from that (you can find the format "
1565 "documented in various places around the web)."
1570 #: ../src/guestfs.pod:685
1571 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1576 #: ../src/guestfs.pod:687
1578 "There are other useful extended attributes that can be read from ntfs-3g "
1579 "filesystems (using L</guestfs_getxattr>). See:"
1584 #: ../src/guestfs.pod:690
1586 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1591 #: ../src/guestfs.pod:692
1592 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1597 #: ../src/guestfs.pod:694
1599 "Although we don't want to discourage you from using the C API, we will "
1600 "mention here that the same API is also available in other languages."
1604 #: ../src/guestfs.pod:697
1606 "The API is broadly identical in all supported languages. This means that "
1607 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
1608 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
1609 "OCaml. In other words, a straightforward, predictable isomorphism between "
1615 #: ../src/guestfs.pod:703
1617 "Error messages are automatically transformed into exceptions if the language "
1623 #: ../src/guestfs.pod:706
1625 "We don't try to \"object orientify\" parts of the API in OO languages, "
1626 "although contributors are welcome to write higher level APIs above what we "
1627 "provide in their favourite languages if they wish."
1632 #: ../src/guestfs.pod:712
1638 #: ../src/guestfs.pod:714
1640 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1641 "identical to the C API. C++ classes and exceptions are not used."
1646 #: ../src/guestfs.pod:718
1652 #: ../src/guestfs.pod:720
1654 "The C# bindings are highly experimental. Please read the warnings at the "
1655 "top of C<csharp/Libguestfs.cs>."
1660 #: ../src/guestfs.pod:723
1666 #: ../src/guestfs.pod:725
1668 "This is the only language binding that is working but incomplete. Only "
1669 "calls which return simple integers have been bound in Haskell, and we are "
1670 "looking for help to complete this binding."
1675 #: ../src/guestfs.pod:729
1681 #: ../src/guestfs.pod:731
1683 "Full documentation is contained in the Javadoc which is distributed with "
1689 #: ../src/guestfs.pod:734
1694 #: ../src/guestfs.pod:736
1695 msgid "See L<guestfs-ocaml(3)>."
1700 #: ../src/guestfs.pod:738
1705 #: ../src/guestfs.pod:740
1706 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
1711 #: ../src/guestfs.pod:742
1717 #: ../src/guestfs.pod:744
1719 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1720 "the php-libguestfs package for your distribution."
1725 #: ../src/guestfs.pod:747
1726 msgid "The PHP binding only works correctly on 64 bit machines."
1731 #: ../src/guestfs.pod:749
1736 #: ../src/guestfs.pod:751
1737 msgid "See L<guestfs-python(3)>."
1742 #: ../src/guestfs.pod:753
1747 #: ../src/guestfs.pod:755
1748 msgid "See L<guestfs-ruby(3)>."
1753 #: ../src/guestfs.pod:757
1754 msgid "B<shell scripts>"
1758 #: ../src/guestfs.pod:759
1759 msgid "See L<guestfish(1)>."
1764 #: ../src/guestfs.pod:763
1765 msgid "LIBGUESTFS GOTCHAS"
1770 #: ../src/guestfs.pod:765
1772 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1773 "system [...] that works in the way it is documented but is counterintuitive "
1774 "and almost invites mistakes.\""
1779 #: ../src/guestfs.pod:769
1781 "Since we developed libguestfs and the associated tools, there are several "
1782 "things we would have designed differently, but are now stuck with for "
1783 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1784 "release, you can expect these to change. Beware of them."
1789 #: ../src/guestfs.pod:777
1790 msgid "Autosync / forgetting to sync."
1795 #: ../src/guestfs.pod:779
1797 "When modifying a filesystem from C or another language, you B<must> unmount "
1798 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1799 "libguestfs handle. You can also call:"
1804 #: ../src/guestfs.pod:783
1807 " guestfs_set_autosync (g, 1);\n"
1813 #: ../src/guestfs.pod:785
1815 "to have the unmount/sync done automatically for you when the handle 'g' is "
1816 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1821 #: ../src/guestfs.pod:789
1823 "If you forget to do this, then it is entirely possible that your changes "
1824 "won't be written out, or will be partially written, or (very rarely) that "
1825 "you'll get disk corruption."
1830 #: ../src/guestfs.pod:793
1832 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1833 "guestfish scripts that forget to sync will work just fine, which can make "
1834 "this very puzzling if you are trying to debug a problem."
1839 #: ../src/guestfs.pod:797
1841 "Update: Autosync is enabled by default for all API users starting from "
1842 "libguestfs 1.5.24."
1847 #: ../src/guestfs.pod:800
1848 msgid "Mount option C<-o sync> should not be the default."
1853 #: ../src/guestfs.pod:802
1855 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1856 "However C<-o sync> does not add any reliability benefit, but does have a "
1857 "very large performance impact."
1862 #: ../src/guestfs.pod:806
1864 "The work around is to use L</guestfs_mount_options> and set the mount "
1865 "options that you actually want to use."
1870 #: ../src/guestfs.pod:809
1871 msgid "Read-only should be the default."
1876 #: ../src/guestfs.pod:811
1878 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1879 "specify I<--rw> if you want to make changes to the image."
1884 #: ../src/guestfs.pod:814
1885 msgid "This would reduce the potential to corrupt live VM images."
1890 #: ../src/guestfs.pod:816
1892 "Note that many filesystems change the disk when you just mount and unmount, "
1893 "even if you didn't perform any writes. You need to use L</"
1894 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1899 #: ../src/guestfs.pod:820
1900 msgid "guestfish command line is hard to use."
1905 #: ../src/guestfs.pod:822
1907 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1908 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1909 "exist, so it fails. In earlier versions of guestfish the error message was "
1910 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1911 "we should have used C<guestfish -c command> to run commands."
1916 #: ../src/guestfs.pod:829
1917 msgid "guestfish megabyte modifiers don't work right on all commands"
1922 #: ../src/guestfs.pod:831
1924 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1925 "other modifiers). What guestfish actually does is to multiply the number "
1926 "part by the modifier part and pass the result to the C API. However this "
1927 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1928 "expecting some other unit (eg. megabytes)."
1933 #: ../src/guestfs.pod:838
1934 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1939 #: ../src/guestfs.pod:840
1942 " lvcreate LV VG 100M\n"
1948 #: ../src/guestfs.pod:842
1950 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1951 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1952 "megabytes * megabytes) logical volume. The error message you get from this "
1953 "is also a little obscure."
1958 #: ../src/guestfs.pod:847
1960 "This could be fixed in the generator by specially marking parameters and "
1961 "return values which take bytes or other units."
1966 #: ../src/guestfs.pod:850
1967 msgid "Ambiguity between devices and paths"
1972 #: ../src/guestfs.pod:852
1974 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1975 "sdb2>) and a similar pathname. A file might just happen to be called "
1976 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1981 #: ../src/guestfs.pod:857
1983 "In the current API we usually resolve this ambiguity by having two separate "
1984 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1985 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1986 "detecting if the path supplied begins with C</dev/>."
1991 #: ../src/guestfs.pod:863
1993 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1994 "make paths/devices into structured names. One way to do this would be to "
1995 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1996 "aspect of grub. Another way would be to use a structured type, equivalent "
1997 "to this OCaml type:"
2002 #: ../src/guestfs.pod:869
2005 " type path = Path of string | Device of int | Partition of int * int\n"
2011 #: ../src/guestfs.pod:871
2012 msgid "which would allow you to pass arguments like:"
2017 #: ../src/guestfs.pod:873
2020 " Path \"/foo/bar\"\n"
2021 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
2022 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
2023 " Path \"/dev/sdb2\" (* not a device *)\n"
2029 #: ../src/guestfs.pod:878
2031 "As you can see there are still problems to resolve even with this "
2032 "representation. Also consider how it might work in guestfish."
2037 #: ../src/guestfs.pod:883
2038 msgid "PROTOCOL LIMITS"
2043 #: ../src/guestfs.pod:885
2045 "Internally libguestfs uses a message-based protocol to pass API calls and "
2046 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
2047 "plenty more detail about this). The maximum message size used by the "
2048 "protocol is slightly less than 4 MB. For some API calls you may need to be "
2049 "aware of this limit. The API calls which may be affected are individually "
2050 "documented, with a link back to this section of the documentation."
2055 #: ../src/guestfs.pod:893
2057 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
2058 "a simple string. Because this string is at some point internally encoded as "
2059 "a message, the maximum size that it can return is slightly under 4 MB. If "
2060 "the requested file is larger than this then you will get an error."
2065 #: ../src/guestfs.pod:899
2067 "In order to transfer large files into and out of the guest filesystem, you "
2068 "need to use particular calls that support this. The sections L</UPLOADING> "
2069 "and L</DOWNLOADING> document how to do this."
2074 #: ../src/guestfs.pod:903
2076 "You might also consider mounting the disk image using our FUSE filesystem "
2077 "support (L<guestmount(1)>)."
2082 #: ../src/guestfs.pod:906
2083 msgid "KEYS AND PASSPHRASES"
2088 #: ../src/guestfs.pod:908
2090 "Certain libguestfs calls take a parameter that contains sensitive key "
2091 "material, passed in as a C string."
2096 #: ../src/guestfs.pod:911
2098 "In the future we would hope to change the libguestfs implementation so that "
2099 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
2100 "swap. However this is I<not> done at the moment, because of the complexity "
2101 "of such an implementation."
2106 #: ../src/guestfs.pod:916
2108 "Therefore you should be aware that any key parameter you pass to libguestfs "
2109 "might end up being written out to the swap partition. If this is a concern, "
2110 "scrub the swap partition or don't use libguestfs on encrypted devices."
2115 #: ../src/guestfs.pod:921
2116 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
2121 #: ../src/guestfs.pod:923
2123 "All high-level libguestfs actions are synchronous. If you want to use "
2124 "libguestfs asynchronously then you must create a thread."
2129 #: ../src/guestfs.pod:926
2131 "Only use the handle from a single thread. Either use the handle exclusively "
2132 "from one thread, or provide your own mutex so that two threads cannot issue "
2133 "calls on the same handle at the same time."
2138 #: ../src/guestfs.pod:930
2140 "See the graphical program guestfs-browser for one possible architecture for "
2141 "multithreaded programs using libvirt and libguestfs."
2146 #: ../src/guestfs.pod:933
2152 #: ../src/guestfs.pod:935
2154 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
2160 #: ../src/guestfs.pod:938
2162 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
2163 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
2168 #: ../src/guestfs.pod:941
2170 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
2171 "to change the directories that libguestfs will search in. The value is a "
2172 "colon-separated list of paths. The current directory is I<not> searched "
2173 "unless the path contains an empty element or C<.>. For example "
2174 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
2175 "then C</usr/lib/guestfs>."
2180 #: ../src/guestfs.pod:948
2181 msgid "QEMU WRAPPERS"
2186 #: ../src/guestfs.pod:950
2188 "If you want to compile your own qemu, run qemu from a non-standard location, "
2189 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
2195 #: ../src/guestfs.pod:954
2197 "There is one important rule to remember: you I<must C<exec qemu>> as the "
2198 "last command in the shell script (so that qemu replaces the shell and "
2199 "becomes the direct child of the libguestfs-using program). If you don't do "
2200 "this, then the qemu process won't be cleaned up correctly."
2205 #: ../src/guestfs.pod:959
2207 "Here is an example of a wrapper, where I have built my own copy of qemu from "
2213 #: ../src/guestfs.pod:962
2217 " qemudir=/home/rjones/d/qemu\n"
2218 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
2224 #: ../src/guestfs.pod:966
2226 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
2227 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
2233 #: ../src/guestfs.pod:970
2236 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
2242 #: ../src/guestfs.pod:972
2244 "Note that libguestfs also calls qemu with the -help and -version options in "
2245 "order to determine features."
2249 #: ../src/guestfs.pod:975
2250 msgid "ATTACHING TO RUNNING DAEMONS"
2254 #: ../src/guestfs.pod:977
2256 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
2257 "babies. Use with caution."
2261 #: ../src/guestfs.pod:980
2263 "I<Note (2):> This section explains how to attach to a running daemon from a "
2264 "low level perspective. For most users, simply using virt tools such as "
2265 "L<guestfish(1)> with the I<--live> option will \"just work\"."
2269 #: ../src/guestfs.pod:984
2270 msgid "Using guestfs_set_attach_method"
2274 #: ../src/guestfs.pod:986
2276 "By calling L</guestfs_set_attach_method> you can change how the library "
2277 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
2278 "ARCHITECTURE> for some background)."
2282 #: ../src/guestfs.pod:990
2284 "The normal attach method is C<appliance>, where a small appliance is created "
2285 "containing the daemon, and then the library connects to this."
2289 #: ../src/guestfs.pod:993
2291 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
2292 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
2293 "daemon over the Unix domain socket."
2297 #: ../src/guestfs.pod:997
2299 "The normal use for this is to connect to a running virtual machine that "
2300 "contains a C<guestfsd> daemon, and send commands so you can read and write "
2301 "files inside the live virtual machine."
2305 #: ../src/guestfs.pod:1001
2306 msgid "Using guestfs_add_domain with live flag"
2310 #: ../src/guestfs.pod:1003
2312 "L</guestfs_add_domain> provides some help for getting the correct attach "
2313 "method. If you pass the C<live> option to this function, then (if the "
2314 "virtual machine is running) it will examine the libvirt XML looking for a "
2315 "virtio-serial channel to connect to:"
2319 #: ../src/guestfs.pod:1009
2326 " <channel type='unix'>\n"
2327 " <source mode='bind' path='/path/to/socket'/>\n"
2328 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
2337 #: ../src/guestfs.pod:1021
2339 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
2340 "method to C<unix:/path/to/socket>."
2344 #: ../src/guestfs.pod:1024
2346 "Some of the libguestfs tools (including guestfish) support a I<--live> "
2347 "option which is passed through to L</guestfs_add_domain> thus allowing you "
2348 "to attach to and modify live virtual machines."
2352 #: ../src/guestfs.pod:1028
2354 "The virtual machine needs to have been set up beforehand so that it has the "
2355 "virtio-serial channel and so that guestfsd is running inside it."
2360 #: ../src/guestfs.pod:1032
2361 msgid "ABI GUARANTEE"
2366 #: ../src/guestfs.pod:1034
2368 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2369 "actions as outlined in this section. Although we will deprecate some "
2370 "actions, for example if they get replaced by newer calls, we will keep the "
2371 "old actions forever. This allows you the developer to program in confidence "
2372 "against the libguestfs API."
2377 #: ../src/guestfs.pod:1040
2378 msgid "BLOCK DEVICE NAMING"
2383 #: ../src/guestfs.pod:1042
2385 "In the kernel there is now quite a profusion of schemata for naming block "
2386 "devices (in this context, by I<block device> I mean a physical or virtual "
2387 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2388 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2389 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2390 "for the old IDE driver (particularly for SATA devices) those devices also "
2391 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2392 "paravirtualized drivers. This has created several different naming systems, "
2393 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2398 #: ../src/guestfs.pod:1054
2400 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2401 "Linux kernel to access block devices. We can run a variety of appliances "
2402 "based on a variety of Linux kernels."
2407 #: ../src/guestfs.pod:1058
2409 "This causes a problem for libguestfs because many API calls use device or "
2410 "partition names. Working scripts and the recipe (example) scripts that we "
2411 "make available over the internet could fail if the naming scheme changes."
2416 #: ../src/guestfs.pod:1063
2418 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2419 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2420 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2421 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2426 #: ../src/guestfs.pod:1069
2428 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2429 "L</guestfs_list_partitions> and similar calls return the true names of the "
2430 "devices and partitions as known to the appliance."
2435 #: ../src/guestfs.pod:1074
2436 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2441 #: ../src/guestfs.pod:1076
2443 "Usually this translation is transparent. However in some (very rare) cases "
2444 "you may need to know the exact algorithm. Such cases include where you use "
2445 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2446 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2451 #: ../src/guestfs.pod:1082
2453 "The algorithm is applied only to I<parameters> which are known to be either "
2454 "device or partition names. Return values from functions such as L</"
2455 "guestfs_list_devices> are never changed."
2460 #: ../src/guestfs.pod:1090
2461 msgid "Is the string a parameter which is a device or partition name?"
2466 #: ../src/guestfs.pod:1094
2467 msgid "Does the string begin with C</dev/sd>?"
2472 #: ../src/guestfs.pod:1098
2474 "Does the named device exist? If so, we use that device. However if I<not> "
2475 "then we continue with this algorithm."
2480 #: ../src/guestfs.pod:1103
2481 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2486 #: ../src/guestfs.pod:1105
2487 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2492 #: ../src/guestfs.pod:1107
2493 msgid "If that named device exists, use it. If not, continue."
2498 #: ../src/guestfs.pod:1111
2499 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2504 #: ../src/guestfs.pod:1113
2505 msgid "If that named device exists, use it. If not, return an error."
2510 #: ../src/guestfs.pod:1117
2511 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2516 #: ../src/guestfs.pod:1119
2518 "Although the standard naming scheme and automatic translation is useful for "
2519 "simple programs and guestfish scripts, for larger programs it is best not to "
2520 "rely on this mechanism."
2525 #: ../src/guestfs.pod:1123
2527 "Where possible for maximum future portability programs using libguestfs "
2528 "should use these future-proof techniques:"
2533 #: ../src/guestfs.pod:1130
2535 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2536 "device names, and then use those names directly."
2541 #: ../src/guestfs.pod:1133
2543 "Since those device names exist by definition, they will never be translated."
2548 #: ../src/guestfs.pod:1138
2550 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2551 "filesystem labels."
2556 #: ../src/guestfs.pod:1143
2562 #: ../src/guestfs.pod:1145
2564 "This section discusses security implications of using libguestfs, "
2565 "particularly with untrusted or malicious guests or disk images."
2570 #: ../src/guestfs.pod:1148
2571 msgid "GENERAL SECURITY CONSIDERATIONS"
2576 #: ../src/guestfs.pod:1150
2578 "Be careful with any files or data that you download from a guest (by "
2579 "\"download\" we mean not just the L</guestfs_download> command but any "
2580 "command that reads files, filenames, directories or anything else from a "
2581 "disk image). An attacker could manipulate the data to fool your program "
2582 "into doing the wrong thing. Consider cases such as:"
2587 #: ../src/guestfs.pod:1160
2588 msgid "the data (file etc) not being present"
2593 #: ../src/guestfs.pod:1164
2594 msgid "being present but empty"
2599 #: ../src/guestfs.pod:1168
2600 msgid "being much larger than normal"
2605 #: ../src/guestfs.pod:1172
2606 msgid "containing arbitrary 8 bit data"
2611 #: ../src/guestfs.pod:1176
2612 msgid "being in an unexpected character encoding"
2617 #: ../src/guestfs.pod:1180
2618 msgid "containing homoglyphs."
2623 #: ../src/guestfs.pod:1184
2624 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2629 #: ../src/guestfs.pod:1186
2631 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2632 "(VFS) module can sometimes be escalated into exploits by deliberately "
2633 "creating a malicious, malformed filesystem. These exploits are very severe "
2634 "for two reasons. Firstly there are very many filesystem drivers in the "
2635 "kernel, and many of them are infrequently used and not much developer "
2636 "attention has been paid to the code. Linux userspace helps potential "
2637 "crackers by detecting the filesystem type and automatically choosing the "
2638 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2639 "the administrator. Secondly, a kernel-level exploit is like a local root "
2640 "exploit (worse in some ways), giving immediate and total access to the "
2641 "system right down to the hardware level."
2646 #: ../src/guestfs.pod:1199
2648 "That explains why you should never mount a filesystem from an untrusted "
2649 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2650 "inside a qemu virtual machine, usually running as a non-root user. The "
2651 "attacker would need to write a filesystem which first exploited the kernel, "
2652 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2653 "the libguestfs protocol, and finally to be as serious as the host kernel "
2654 "exploit it would need to escalate its privileges to root. This multi-step "
2655 "escalation, performed by a static piece of data, is thought to be extremely "
2656 "hard to do, although we never say 'never' about security issues."
2661 #: ../src/guestfs.pod:1210
2663 "In any case callers can reduce the attack surface by forcing the filesystem "
2664 "type when mounting (use L</guestfs_mount_vfs>)."
2669 #: ../src/guestfs.pod:1213
2670 msgid "PROTOCOL SECURITY"
2675 #: ../src/guestfs.pod:1215
2677 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2678 "defined upper message size. However a program that uses libguestfs must "
2679 "also take care - for example you can write a program that downloads a binary "
2680 "from a disk image and executes it locally, and no amount of protocol "
2681 "security will save you from the consequences."
2686 #: ../src/guestfs.pod:1221
2687 msgid "INSPECTION SECURITY"
2692 #: ../src/guestfs.pod:1223
2694 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2695 "directly from the guest, and these could contain any 8 bit data. Callers "
2696 "should be careful to escape these before printing them to a structured file "
2697 "(for example, use HTML escaping if creating a web page)."
2702 #: ../src/guestfs.pod:1229
2704 "Guest configuration may be altered in unusual ways by the administrator of "
2705 "the virtual machine, and may not reflect reality (particularly for untrusted "
2706 "or actively malicious guests). For example we parse the hostname from "
2707 "configuration files like C</etc/sysconfig/network> that we find in the "
2708 "guest, but the guest administrator can easily manipulate these files to "
2709 "provide the wrong hostname."
2714 #: ../src/guestfs.pod:1237
2716 "The inspection API parses guest configuration using two external libraries: "
2717 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2718 "designed to be robust in the face of malicious data, although denial of "
2719 "service attacks are still possible, for example with oversized configuration "
2725 #: ../src/guestfs.pod:1243
2726 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2731 #: ../src/guestfs.pod:1245
2733 "Be very cautious about running commands from the guest. By running a "
2734 "command in the guest, you are giving CPU time to a binary that you do not "
2735 "control, under the same user account as the library, albeit wrapped in qemu "
2736 "virtualization. More information and alternatives can be found in the "
2737 "section L</RUNNING COMMANDS>."
2742 #: ../src/guestfs.pod:1251
2743 msgid "CVE-2010-3851"
2748 #: ../src/guestfs.pod:1253
2749 msgid "https://bugzilla.redhat.com/642934"
2754 #: ../src/guestfs.pod:1255
2756 "This security bug concerns the automatic disk format detection that qemu "
2757 "does on disk images."
2762 #: ../src/guestfs.pod:1258
2764 "A raw disk image is just the raw bytes, there is no header. Other disk "
2765 "images like qcow2 contain a special header. Qemu deals with this by looking "
2766 "for one of the known headers, and if none is found then assuming the disk "
2767 "image must be raw."
2772 #: ../src/guestfs.pod:1263
2774 "This allows a guest which has been given a raw disk image to write some "
2775 "other header. At next boot (or when the disk image is accessed by "
2776 "libguestfs) qemu would do autodetection and think the disk image format was, "
2777 "say, qcow2 based on the header written by the guest."
2782 #: ../src/guestfs.pod:1268
2784 "This in itself would not be a problem, but qcow2 offers many features, one "
2785 "of which is to allow a disk image to refer to another image (called the "
2786 "\"backing disk\"). It does this by placing the path to the backing disk "
2787 "into the qcow2 header. This path is not validated and could point to any "
2788 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2789 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2790 "control of the attacker."
2795 #: ../src/guestfs.pod:1276
2797 "In libguestfs this is rather hard to exploit except under two circumstances:"
2802 #: ../src/guestfs.pod:1283
2803 msgid "You have enabled the network or have opened the disk in write mode."
2808 #: ../src/guestfs.pod:1287
2810 "You are also running untrusted code from the guest (see L</RUNNING "
2816 #: ../src/guestfs.pod:1292
2818 "The way to avoid this is to specify the expected disk format when adding "
2819 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2820 "should always do this if the disk is raw format, and it's a good idea for "
2826 #: ../src/guestfs.pod:1297
2828 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2829 "format is fetched from libvirt and passed through."
2834 #: ../src/guestfs.pod:1300
2836 "For libguestfs tools, use the I<--format> command line parameter as "
2842 #: ../src/guestfs.pod:1303
2843 msgid "CONNECTION MANAGEMENT"
2848 #: ../src/guestfs.pod:1305
2854 #: ../src/guestfs.pod:1307
2856 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2857 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2858 "handle and release all resources used."
2863 #: ../src/guestfs.pod:1311
2865 "For information on using multiple handles and threads, see the section L</"
2866 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2871 #: ../src/guestfs.pod:1314
2872 msgid "guestfs_create"
2877 #: ../src/guestfs.pod:1316
2880 " guestfs_h *guestfs_create (void);\n"
2886 #: ../src/guestfs.pod:1318
2887 msgid "Create a connection handle."
2892 #: ../src/guestfs.pod:1320
2894 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2895 "on the handle at least once."
2900 #: ../src/guestfs.pod:1323
2902 "This function returns a non-NULL pointer to a handle on success or NULL on "
2908 #: ../src/guestfs.pod:1326
2909 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2914 #: ../src/guestfs.pod:1328
2916 "You may also want to configure error handling for the handle. See L</ERROR "
2917 "HANDLING> section below."
2922 #: ../src/guestfs.pod:1331
2923 msgid "guestfs_close"
2928 #: ../src/guestfs.pod:1333
2931 " void guestfs_close (guestfs_h *g);\n"
2937 #: ../src/guestfs.pod:1335
2938 msgid "This closes the connection handle and frees up all resources used."
2943 #: ../src/guestfs.pod:1337
2944 msgid "ERROR HANDLING"
2949 #: ../src/guestfs.pod:1339
2951 "API functions can return errors. For example, almost all functions that "
2952 "return C<int> will return C<-1> to indicate an error."
2957 #: ../src/guestfs.pod:1342
2959 "Additional information is available for errors: an error message string and "
2960 "optionally an error number (errno) if the thing that failed was a system "
2966 #: ../src/guestfs.pod:1346
2968 "You can get at the additional information about the last error on the handle "
2969 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2970 "up an error handler with L</guestfs_set_error_handler>."
2975 #: ../src/guestfs.pod:1351
2977 "When the handle is created, a default error handler is installed which "
2978 "prints the error message string to C<stderr>. For small short-running "
2979 "command line programs it is sufficient to do:"
2984 #: ../src/guestfs.pod:1355
2987 " if (guestfs_launch (g) == -1)\n"
2988 " exit (EXIT_FAILURE);\n"
2994 #: ../src/guestfs.pod:1358
2996 "since the default error handler will ensure that an error message has been "
2997 "printed to C<stderr> before the program exits."
3002 #: ../src/guestfs.pod:1361
3004 "For other programs the caller will almost certainly want to install an "
3005 "alternate error handler or do error handling in-line like this:"
3010 #: ../src/guestfs.pod:1364
3013 " g = guestfs_create ();\n"
3019 #: ../src/guestfs.pod:1366
3022 " /* This disables the default behaviour of printing errors\n"
3024 " guestfs_set_error_handler (g, NULL, NULL);\n"
3030 #: ../src/guestfs.pod:1370
3033 " if (guestfs_launch (g) == -1) {\n"
3034 " /* Examine the error message and print it etc. */\n"
3035 " char *msg = guestfs_last_error (g);\n"
3036 " int errnum = guestfs_last_errno (g);\n"
3037 " fprintf (stderr, \"%s\\n\", msg);\n"
3045 #: ../src/guestfs.pod:1378
3047 "Out of memory errors are handled differently. The default action is to call "
3048 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
3049 "guestfs_set_out_of_memory_handler>."
3054 #: ../src/guestfs.pod:1382
3056 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
3057 "because there is no handle if this happens there is no way to get additional "
3058 "error information. However L</guestfs_create> is supposed to be a "
3059 "lightweight operation which can only fail because of insufficient memory (it "
3060 "returns NULL in this case)."
3065 #: ../src/guestfs.pod:1388
3066 msgid "guestfs_last_error"
3071 #: ../src/guestfs.pod:1390
3074 " const char *guestfs_last_error (guestfs_h *g);\n"
3080 #: ../src/guestfs.pod:1392
3082 "This returns the last error message that happened on C<g>. If there has not "
3083 "been an error since the handle was created, then this returns C<NULL>."
3088 #: ../src/guestfs.pod:1396
3090 "The lifetime of the returned string is until the next error occurs, or L</"
3091 "guestfs_close> is called."
3096 #: ../src/guestfs.pod:1399
3097 msgid "guestfs_last_errno"
3102 #: ../src/guestfs.pod:1401
3105 " int guestfs_last_errno (guestfs_h *g);\n"
3111 #: ../src/guestfs.pod:1403
3112 msgid "This returns the last error number (errno) that happened on C<g>."
3117 #: ../src/guestfs.pod:1405
3118 msgid "If successful, an errno integer not equal to zero is returned."
3123 #: ../src/guestfs.pod:1407
3125 "If no error, this returns 0. This call can return 0 in three situations:"
3130 #: ../src/guestfs.pod:1414
3131 msgid "There has not been any error on the handle."
3136 #: ../src/guestfs.pod:1418
3138 "There has been an error but the errno was meaningless. This corresponds to "
3139 "the case where the error did not come from a failed system call, but for "
3140 "some other reason."
3145 #: ../src/guestfs.pod:1424
3147 "There was an error from a failed system call, but for some reason the errno "
3148 "was not captured and returned. This usually indicates a bug in libguestfs."
3153 #: ../src/guestfs.pod:1430
3155 "Libguestfs tries to convert the errno from inside the applicance into a "
3156 "corresponding errno for the caller (not entirely trivial: the appliance "
3157 "might be running a completely different operating system from the library "
3158 "and error numbers are not standardized across Un*xen). If this could not be "
3159 "done, then the error is translated to C<EINVAL>. In practice this should "
3160 "only happen in very rare circumstances."
3165 #: ../src/guestfs.pod:1438
3166 msgid "guestfs_set_error_handler"
3171 #: ../src/guestfs.pod:1440
3174 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
3176 " const char *msg);\n"
3177 " void guestfs_set_error_handler (guestfs_h *g,\n"
3178 " guestfs_error_handler_cb cb,\n"
3185 #: ../src/guestfs.pod:1447
3187 "The callback C<cb> will be called if there is an error. The parameters "
3188 "passed to the callback are an opaque data pointer and the error message "
3194 #: ../src/guestfs.pod:1451
3196 "C<errno> is not passed to the callback. To get that the callback must call "
3197 "L</guestfs_last_errno>."
3202 #: ../src/guestfs.pod:1454
3204 "Note that the message string C<msg> is freed as soon as the callback "
3205 "function returns, so if you want to stash it somewhere you must make your "
3211 #: ../src/guestfs.pod:1458
3212 msgid "The default handler prints messages on C<stderr>."
3217 #: ../src/guestfs.pod:1460
3218 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
3223 #: ../src/guestfs.pod:1462
3224 msgid "guestfs_get_error_handler"
3229 #: ../src/guestfs.pod:1464
3232 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
3233 " void **opaque_rtn);\n"
3239 #: ../src/guestfs.pod:1467
3240 msgid "Returns the current error handler callback."
3245 #: ../src/guestfs.pod:1469
3246 msgid "guestfs_set_out_of_memory_handler"
3251 #: ../src/guestfs.pod:1471
3254 " typedef void (*guestfs_abort_cb) (void);\n"
3255 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
3256 " guestfs_abort_cb);\n"
3262 #: ../src/guestfs.pod:1475
3264 "The callback C<cb> will be called if there is an out of memory situation. "
3265 "I<Note this callback must not return>."
3270 #: ../src/guestfs.pod:1478
3271 msgid "The default is to call L<abort(3)>."
3276 #: ../src/guestfs.pod:1480
3278 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
3283 #: ../src/guestfs.pod:1483
3284 msgid "guestfs_get_out_of_memory_handler"
3289 #: ../src/guestfs.pod:1485
3292 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
3298 #: ../src/guestfs.pod:1487
3299 msgid "This returns the current out of memory handler."
3304 #: ../src/guestfs.pod:1489
3310 #: ../src/guestfs.pod:1491 ../fish/guestfish.pod:989
3316 #: ../src/guestfs.pod:1493
3322 #: ../src/guestfs.pod:1495
3328 #: ../src/guestfs.pod:1497
3329 msgid "AVAILABILITY"
3334 #: ../src/guestfs.pod:1499
3335 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
3340 #: ../src/guestfs.pod:1501
3342 "Using L</guestfs_available> you can test availability of the following "
3343 "groups of functions. This test queries the appliance to see if the "
3344 "appliance you are currently using supports the functionality."
3349 #: ../src/guestfs.pod:1506
3350 msgid "@AVAILABILITY@"
3355 #: ../src/guestfs.pod:1508
3356 msgid "GUESTFISH supported COMMAND"
3361 #: ../src/guestfs.pod:1510
3363 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
3364 "prints out the available groups and whether they are supported by this build "
3365 "of libguestfs. Note however that you have to do C<run> first."
3370 #: ../src/guestfs.pod:1515
3371 msgid "SINGLE CALLS AT COMPILE TIME"
3376 #: ../src/guestfs.pod:1517
3378 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
3379 "function, such as:"
3384 #: ../src/guestfs.pod:1520
3387 " #define LIBGUESTFS_HAVE_DD 1\n"
3393 #: ../src/guestfs.pod:1522
3394 msgid "if L</guestfs_dd> is available."
3399 #: ../src/guestfs.pod:1524
3401 "Before version 1.5.8, if you needed to test whether a single libguestfs "
3402 "function is available at compile time, we recommended using build tools such "
3403 "as autoconf or cmake. For example in autotools you could use:"
3408 #: ../src/guestfs.pod:1529
3411 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
3412 " AC_CHECK_FUNCS([guestfs_dd])\n"
3418 #: ../src/guestfs.pod:1532
3420 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
3426 #: ../src/guestfs.pod:1535
3427 msgid "SINGLE CALLS AT RUN TIME"
3432 #: ../src/guestfs.pod:1537
3434 "Testing at compile time doesn't guarantee that a function really exists in "
3435 "the library. The reason is that you might be dynamically linked against a "
3436 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
3437 "This situation unfortunately results in a segmentation fault, which is a "
3438 "shortcoming of the C dynamic linking system itself."
3443 #: ../src/guestfs.pod:1544
3445 "You can use L<dlopen(3)> to test if a function is available at run time, as "
3446 "in this example program (note that you still need the compile time check as "
3452 #: ../src/guestfs.pod:1548
3455 " #include <stdio.h>\n"
3456 " #include <stdlib.h>\n"
3457 " #include <unistd.h>\n"
3458 " #include <dlfcn.h>\n"
3459 " #include <guestfs.h>\n"
3465 #: ../src/guestfs.pod:1554
3470 " #ifdef LIBGUESTFS_HAVE_DD\n"
3472 " int has_function;\n"
3478 #: ../src/guestfs.pod:1560
3481 " /* Test if the function guestfs_dd is really available. */\n"
3482 " dl = dlopen (NULL, RTLD_LAZY);\n"
3484 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
3485 " exit (EXIT_FAILURE);\n"
3487 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
3494 #: ../src/guestfs.pod:1569
3497 " if (!has_function)\n"
3498 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
3500 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
3501 " /* Now it's safe to call\n"
3502 " guestfs_dd (g, \"foo\", \"bar\");\n"
3506 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
3514 #: ../src/guestfs.pod:1582
3516 "You may think the above is an awful lot of hassle, and it is. There are "
3517 "other ways outside of the C linking system to ensure that this kind of "
3518 "incompatibility never arises, such as using package versioning:"
3523 #: ../src/guestfs.pod:1587
3526 " Requires: libguestfs >= 1.0.80\n"
3532 #: ../src/guestfs.pod:1589
3533 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3538 #: ../src/guestfs.pod:1591
3540 "A recent feature of the API is the introduction of calls which take optional "
3541 "arguments. In C these are declared 3 ways. The main way is as a call which "
3542 "takes variable arguments (ie. C<...>), as in this example:"
3547 #: ../src/guestfs.pod:1596
3550 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3556 #: ../src/guestfs.pod:1598
3558 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3559 "call with no optional arguments specified:"
3564 #: ../src/guestfs.pod:1601
3567 " guestfs_add_drive_opts (g, filename, -1);\n"
3573 #: ../src/guestfs.pod:1603
3574 msgid "With a single optional argument:"
3579 #: ../src/guestfs.pod:1605
3582 " guestfs_add_drive_opts (g, filename,\n"
3583 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3590 #: ../src/guestfs.pod:1609
3596 #: ../src/guestfs.pod:1611
3599 " guestfs_add_drive_opts (g, filename,\n"
3600 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3601 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3608 #: ../src/guestfs.pod:1616
3610 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3616 #: ../src/guestfs.pod:1619
3617 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3622 #: ../src/guestfs.pod:1621
3624 "The second variant has the same name with the suffix C<_va>, which works the "
3625 "same way but takes a C<va_list>. See the C manual for details. For the "
3626 "example function, this is declared:"
3631 #: ../src/guestfs.pod:1625
3634 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3641 #: ../src/guestfs.pod:1628
3642 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3647 #: ../src/guestfs.pod:1630
3649 "The third variant is useful where you need to construct these calls. You "
3650 "pass in a structure where you fill in the optional fields. The structure "
3651 "has a bitmask as the first element which you must set to indicate which "
3652 "fields you have filled in. For our example function the structure and call "
3658 #: ../src/guestfs.pod:1636
3661 " struct guestfs_add_drive_opts_argv {\n"
3662 " uint64_t bitmask;\n"
3664 " const char *format;\n"
3667 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3668 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3674 #: ../src/guestfs.pod:1645
3675 msgid "You could call it like this:"
3680 #: ../src/guestfs.pod:1647
3683 " struct guestfs_add_drive_opts_argv optargs = {\n"
3684 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3685 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3687 " .format = \"qcow2\"\n"
3694 #: ../src/guestfs.pod:1654
3697 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3703 #: ../src/guestfs.pod:1656 ../src/guestfs-actions.pod:11
3704 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:9
3705 #: ../fish/guestfish-actions.pod:1260 ../tools/virt-win-reg.pl:532
3711 #: ../src/guestfs.pod:1662
3712 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3717 #: ../src/guestfs.pod:1667
3718 msgid "You do not need to fill in all fields of the structure."
3723 #: ../src/guestfs.pod:1671
3725 "There must be a one-to-one correspondence between fields of the structure "
3726 "that are filled in, and bits set in the bitmask."
3731 #: ../src/guestfs.pod:1676
3732 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3737 #: ../src/guestfs.pod:1678
3739 "In other languages, optional arguments are expressed in the way that is "
3740 "natural for that language. We refer you to the language-specific "
3741 "documentation for more details on that."
3746 #: ../src/guestfs.pod:1682
3747 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3752 #: ../src/guestfs.pod:1684
3753 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3758 #: ../src/guestfs.pod:1686
3760 "The child process generates events in some situations. Current events "
3761 "include: receiving a log message, the child process exits."
3766 #: ../src/guestfs.pod:1689
3768 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3774 #: ../src/guestfs.pod:1692
3776 "Only I<one callback of each type> can be registered for each handle. "
3777 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3778 "that type. Cancel all callbacks of this type by calling this function with "
3779 "C<cb> set to C<NULL>."
3784 #: ../src/guestfs.pod:1697
3785 msgid "guestfs_set_log_message_callback"
3790 #: ../src/guestfs.pod:1699
3793 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3794 " char *buf, int len);\n"
3795 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3796 " guestfs_log_message_cb cb,\n"
3803 #: ../src/guestfs.pod:1705
3805 "The callback function C<cb> will be called whenever qemu or the guest writes "
3806 "anything to the console."
3811 #: ../src/guestfs.pod:1708
3812 msgid "Use this function to capture kernel messages and similar."
3817 #: ../src/guestfs.pod:1710
3819 "Normally there is no log message handler, and log messages are just "
3825 #: ../src/guestfs.pod:1713
3826 msgid "guestfs_set_subprocess_quit_callback"
3831 #: ../src/guestfs.pod:1715
3834 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3835 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3836 " guestfs_subprocess_quit_cb cb,\n"
3843 #: ../src/guestfs.pod:1720
3845 "The callback function C<cb> will be called when the child process quits, "
3846 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3847 "corresponds to a transition from any state to the CONFIG state)."
3852 #: ../src/guestfs.pod:1725
3853 msgid "guestfs_set_launch_done_callback"
3858 #: ../src/guestfs.pod:1727
3861 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3862 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3863 " guestfs_launch_done_cb cb,\n"
3870 #: ../src/guestfs.pod:1732
3872 "The callback function C<cb> will be called when the child process becomes "
3873 "ready first time after it has been launched. (This corresponds to a "
3874 "transition from LAUNCHING to the READY state)."
3879 #: ../src/guestfs.pod:1736
3880 msgid "guestfs_set_close_callback"
3885 #: ../src/guestfs.pod:1738
3888 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3889 " void guestfs_set_close_callback (guestfs_h *g,\n"
3890 " guestfs_close_cb cb,\n"
3897 #: ../src/guestfs.pod:1743
3899 "The callback function C<cb> will be called while the handle is being closed "
3900 "(synchronously from L</guestfs_close>)."
3905 #: ../src/guestfs.pod:1746
3907 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3908 "handles that are open when the program exits. This means that this callback "
3909 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3910 "problems in higher-level languages (eg. if your HLL interpreter has already "
3911 "been cleaned up by the time this is called, and if your callback then jumps "
3912 "into some HLL function)."
3917 #: ../src/guestfs.pod:1754
3918 msgid "guestfs_set_progress_callback"
3923 #: ../src/guestfs.pod:1756
3926 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3927 " int proc_nr, int serial,\n"
3928 " uint64_t position, uint64_t total);\n"
3929 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3930 " guestfs_progress_cb cb,\n"
3937 #: ../src/guestfs.pod:1763
3939 "Some long-running operations can generate progress messages. If this "
3940 "callback is registered, then it will be called each time a progress message "
3941 "is generated (usually two seconds after the operation started, and three "
3942 "times per second thereafter until it completes, although the frequency may "
3943 "change in future versions)."
3948 #: ../src/guestfs.pod:1769
3950 "The callback receives two numbers: C<position> and C<total>. The units of "
3951 "C<total> are not defined, although for some operations C<total> may relate "
3952 "in some way to the amount of data to be transferred (eg. in bytes or "
3953 "megabytes), and C<position> may be the portion which has been transferred."
3958 #: ../src/guestfs.pod:1775
3959 msgid "The only defined and stable parts of the API are:"
3964 #: ../src/guestfs.pod:1781
3966 "The callback can display to the user some type of progress bar or indicator "
3967 "which shows the ratio of C<position>:C<total>."
3972 #: ../src/guestfs.pod:1786
3973 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3978 #: ../src/guestfs.pod:1790
3980 "If any progress notification is sent during a call, then a final progress "
3981 "notification is always sent when C<position> = C<total>."
3986 #: ../src/guestfs.pod:1793
3988 "This is to simplify caller code, so callers can easily set the progress "
3989 "indicator to \"100%\" at the end of the operation, without requiring special "
3990 "code to detect this case."
3995 #: ../src/guestfs.pod:1799
3997 "The callback also receives the procedure number and serial number of the "
3998 "call. These are only useful for debugging protocol issues, and the callback "
3999 "can normally ignore them. The callback may want to print these numbers in "
4000 "error messages or debugging messages."
4005 #: ../src/guestfs.pod:1804
4006 msgid "PRIVATE DATA AREA"
4011 #: ../src/guestfs.pod:1806
4013 "You can attach named pieces of private data to the libguestfs handle, and "
4014 "fetch them by name for the lifetime of the handle. This is called the "
4015 "private data area and is only available from the C API."
4020 #: ../src/guestfs.pod:1810
4021 msgid "To attach a named piece of data, use the following call:"
4026 #: ../src/guestfs.pod:1812
4029 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
4035 #: ../src/guestfs.pod:1814
4037 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
4038 "pointer (which can be C<NULL>). Any previous item with the same name is "
4044 #: ../src/guestfs.pod:1818
4046 "You can use any C<key> you want, but names beginning with an underscore "
4047 "character are reserved for internal libguestfs purposes (for implementing "
4048 "language bindings). It is recommended to prefix the name with some unique "
4049 "string to avoid collisions with other users."
4054 #: ../src/guestfs.pod:1823
4055 msgid "To retrieve the pointer, use:"
4060 #: ../src/guestfs.pod:1825
4063 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
4069 #: ../src/guestfs.pod:1827
4071 "This function returns C<NULL> if either no data is found associated with "
4072 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
4078 #: ../src/guestfs.pod:1831
4080 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
4081 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
4082 "all. In particular, libguestfs does I<not> try to free the data when the "
4083 "handle is closed. If the data must be freed, then the caller must either "
4084 "free it before calling L</guestfs_close> or must set up a close callback to "
4085 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
4086 "can be registered for a handle)."
4091 #: ../src/guestfs.pod:1839
4093 "The private data area is implemented using a hash table, and should be "
4094 "reasonably efficient for moderate numbers of keys."
4099 #: ../src/guestfs.pod:1842 ../src/guestfs.pod:1847
4105 #: ../src/guestfs.pod:1844
4107 "<!-- old anchor for the next section --> <a name="
4108 "\"state_machine_and_low_level_event_api\"/>"
4113 #: ../src/guestfs.pod:1849
4114 msgid "ARCHITECTURE"
4119 #: ../src/guestfs.pod:1851
4121 "Internally, libguestfs is implemented by running an appliance (a special "
4122 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
4123 "process of the main program."
4128 #: ../src/guestfs.pod:1855
4131 " ___________________\n"
4133 " | main program |\n"
4135 " | | child process / appliance\n"
4136 " | | __________________________\n"
4138 " +-------------------+ RPC | +-----------------+ |\n"
4139 " | libguestfs <--------------------> guestfsd | |\n"
4140 " | | | +-----------------+ |\n"
4141 " \\___________________/ | | Linux kernel | |\n"
4142 " | +--^--------------+ |\n"
4143 " \\_________|________________/\n"
4149 " \\______________/\n"
4155 #: ../src/guestfs.pod:1875
4157 "The library, linked to the main program, creates the child process and hence "
4158 "the appliance in the L</guestfs_launch> function."
4163 #: ../src/guestfs.pod:1878
4165 "Inside the appliance is a Linux kernel and a complete stack of userspace "
4166 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
4167 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
4168 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
4169 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
4170 "attached to the qemu process which translates device access by the "
4171 "appliance's Linux kernel into accesses to the image."
4176 #: ../src/guestfs.pod:1887
4178 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
4179 "Although the disk image you are attached to might also be used by some "
4180 "virtual machine, libguestfs doesn't know or care about this. (But you will "
4181 "care if both libguestfs's qemu process and your virtual machine are trying "
4182 "to update the disk image at the same time, since these usually results in "
4183 "massive disk corruption)."
4188 #: ../src/guestfs.pod:1894
4189 msgid "STATE MACHINE"
4194 #: ../src/guestfs.pod:1896
4195 msgid "libguestfs uses a state machine to model the child process:"
4200 #: ../src/guestfs.pod:1898
4212 " / | \\ \\ guestfs_launch\n"
4213 " / | _\\__V______\n"
4215 " / | | LAUNCHING |\n"
4216 " / | \\___________/\n"
4218 " / | guestfs_launch\n"
4220 " ______ / __|____V\n"
4221 " / \\ ------> / \\\n"
4222 " | BUSY | | READY |\n"
4223 " \\______/ <------ \\________/\n"
4229 #: ../src/guestfs.pod:1920
4231 "The normal transitions are (1) CONFIG (when the handle is created, but there "
4232 "is no child process), (2) LAUNCHING (when the child process is booting up), "
4233 "(3) alternating between READY and BUSY as commands are issued to, and "
4234 "carried out by, the child process."
4239 #: ../src/guestfs.pod:1925
4241 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
4242 "asynchronously at any time (eg. due to some internal error), and that causes "
4243 "the state to transition back to CONFIG."
4248 #: ../src/guestfs.pod:1929
4250 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
4251 "issued when in the CONFIG state."
4256 #: ../src/guestfs.pod:1932
4258 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
4259 "L</guestfs_launch> blocks until the child process is READY to accept "
4260 "commands (or until some failure or timeout). L</guestfs_launch> internally "
4261 "moves the state from CONFIG to LAUNCHING while it is running."
4266 #: ../src/guestfs.pod:1938
4268 "API actions such as L</guestfs_mount> can only be issued when in the READY "
4269 "state. These API calls block waiting for the command to be carried out (ie. "
4270 "the state to transition to BUSY and then back to READY). There are no non-"
4271 "blocking versions, and no way to issue more than one command per handle at "
4277 #: ../src/guestfs.pod:1944
4279 "Finally, the child process sends asynchronous messages back to the main "
4280 "program, such as kernel log messages. You can register a callback to "
4281 "receive these messages."
4286 #: ../src/guestfs.pod:1948
4292 #: ../src/guestfs.pod:1950
4293 msgid "COMMUNICATION PROTOCOL"
4298 #: ../src/guestfs.pod:1952
4300 "Don't rely on using this protocol directly. This section documents how it "
4301 "currently works, but it may change at any time."
4306 #: ../src/guestfs.pod:1955
4308 "The protocol used to talk between the library and the daemon running inside "
4309 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
4310 "1014, RFC 1832, RFC 4506)."
4315 #: ../src/guestfs.pod:1959
4317 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
4318 "this file is automatically generated)."
4323 #: ../src/guestfs.pod:1962
4325 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
4326 "and C<FileOut> parameters, which are handled with very simple request/reply "
4327 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
4328 "parameters, which use the same request and reply messages, but they may also "
4329 "be followed by files sent using a chunked encoding."
4334 #: ../src/guestfs.pod:1969
4335 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
4340 #: ../src/guestfs.pod:1971
4341 msgid "For ordinary functions, the request message is:"
4346 #: ../src/guestfs.pod:1973
4349 " total length (header + arguments,\n"
4350 " but not including the length word itself)\n"
4351 " struct guestfs_message_header (encoded as XDR)\n"
4352 " struct guestfs_<foo>_args (encoded as XDR)\n"
4358 #: ../src/guestfs.pod:1978
4360 "The total length field allows the daemon to allocate a fixed size buffer "
4361 "into which it slurps the rest of the message. As a result, the total length "
4362 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
4363 "effective size of any request is limited to somewhere under this size."
4368 #: ../src/guestfs.pod:1984
4370 "Note also that many functions don't take any arguments, in which case the "
4371 "C<guestfs_I<foo>_args> is completely omitted."
4376 #: ../src/guestfs.pod:1987
4378 "The header contains the procedure number (C<guestfs_proc>) which is how the "
4379 "receiver knows what type of args structure to expect, or none at all."
4384 #: ../src/guestfs.pod:1991
4386 "For functions that take optional arguments, the optional arguments are "
4387 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
4388 "arguments. A bitmask in the header indicates which optional arguments are "
4389 "meaningful. The bitmask is also checked to see if it contains bits set "
4390 "which the daemon does not know about (eg. if more optional arguments were "
4391 "added in a later version of the library), and this causes the call to be "
4397 #: ../src/guestfs.pod:1999
4398 msgid "The reply message for ordinary functions is:"
4403 #: ../src/guestfs.pod:2001
4406 " total length (header + ret,\n"
4407 " but not including the length word itself)\n"
4408 " struct guestfs_message_header (encoded as XDR)\n"
4409 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4415 #: ../src/guestfs.pod:2006
4417 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
4418 "functions that return no formal return values."
4423 #: ../src/guestfs.pod:2009
4425 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
4430 #: ../src/guestfs.pod:2012
4432 "In the case of an error, a flag is set in the header, and the reply message "
4433 "is slightly changed:"
4438 #: ../src/guestfs.pod:2015
4441 " total length (header + error,\n"
4442 " but not including the length word itself)\n"
4443 " struct guestfs_message_header (encoded as XDR)\n"
4444 " struct guestfs_message_error (encoded as XDR)\n"
4450 #: ../src/guestfs.pod:2020
4452 "The C<guestfs_message_error> structure contains the error message as a "
4458 #: ../src/guestfs.pod:2023
4459 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
4464 #: ../src/guestfs.pod:2025
4466 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
4467 "The normal request message is sent (see above). However this is followed by "
4468 "a sequence of file chunks."
4473 #: ../src/guestfs.pod:2029
4476 " total length (header + arguments,\n"
4477 " but not including the length word itself,\n"
4478 " and not including the chunks)\n"
4479 " struct guestfs_message_header (encoded as XDR)\n"
4480 " struct guestfs_<foo>_args (encoded as XDR)\n"
4481 " sequence of chunks for FileIn param #0\n"
4482 " sequence of chunks for FileIn param #1 etc.\n"
4488 #: ../src/guestfs.pod:2037
4489 msgid "The \"sequence of chunks\" is:"
4494 #: ../src/guestfs.pod:2039
4497 " length of chunk (not including length word itself)\n"
4498 " struct guestfs_chunk (encoded as XDR)\n"
4499 " length of chunk\n"
4500 " struct guestfs_chunk (encoded as XDR)\n"
4502 " length of chunk\n"
4503 " struct guestfs_chunk (with data.data_len == 0)\n"
4509 #: ../src/guestfs.pod:2047
4511 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
4512 "is set in the final chunk to indicate either successful completion or early "
4518 #: ../src/guestfs.pod:2051
4520 "At time of writing there are no functions that have more than one FileIn "
4521 "parameter. However this is (theoretically) supported, by sending the "
4522 "sequence of chunks for each FileIn parameter one after another (from left to "
4528 #: ../src/guestfs.pod:2056
4530 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
4531 "transfer. The library does this by sending a chunk with a special flag set "
4532 "to indicate cancellation. When the daemon sees this, it cancels the whole "
4533 "RPC, does I<not> send any reply, and goes back to reading the next request."
4538 #: ../src/guestfs.pod:2062
4540 "The daemon may also cancel. It does this by writing a special word "
4541 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
4542 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
4543 "cancel chunk). The special word is chosen so that even if cancellation "
4544 "happens right at the end of the transfer (after the library has finished "
4545 "writing and has started listening for the reply), the \"spurious\" cancel "
4546 "flag will not be confused with the reply message."
4551 #: ../src/guestfs.pod:2071
4553 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
4554 "limit), and also files where the size is not known in advance (eg. from "
4555 "pipes or sockets). However the chunks are rather small "
4556 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
4557 "to keep much in memory."
4562 #: ../src/guestfs.pod:2077
4563 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
4568 #: ../src/guestfs.pod:2079
4570 "The protocol for FileOut parameters is exactly the same as for FileIn "
4571 "parameters, but with the roles of daemon and library reversed."
4576 #: ../src/guestfs.pod:2082
4579 " total length (header + ret,\n"
4580 " but not including the length word itself,\n"
4581 " and not including the chunks)\n"
4582 " struct guestfs_message_header (encoded as XDR)\n"
4583 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4584 " sequence of chunks for FileOut param #0\n"
4585 " sequence of chunks for FileOut param #1 etc.\n"
4591 #: ../src/guestfs.pod:2090
4592 msgid "INITIAL MESSAGE"
4597 #: ../src/guestfs.pod:2092
4599 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
4600 "which indicates that the guest and daemon is alive. This is what L</"
4601 "guestfs_launch> waits for."
4606 #: ../src/guestfs.pod:2096
4607 msgid "PROGRESS NOTIFICATION MESSAGES"
4612 #: ../src/guestfs.pod:2098
4614 "The daemon may send progress notification messages at any time. These are "
4615 "distinguished by the normal length word being replaced by "
4616 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
4621 #: ../src/guestfs.pod:2102
4623 "The library turns them into progress callbacks (see "
4624 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
4625 "discards them if not."
4630 #: ../src/guestfs.pod:2106
4632 "The daemon self-limits the frequency of progress messages it sends (see "
4633 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
4639 #: ../src/guestfs.pod:2110
4640 msgid "LIBGUESTFS VERSION NUMBERS"
4645 #: ../src/guestfs.pod:2112
4647 "Since April 2010, libguestfs has started to make separate development and "
4648 "stable releases, along with corresponding branches in our git repository. "
4649 "These separate releases can be identified by version number:"
4654 #: ../src/guestfs.pod:2117
4657 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
4658 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
4664 " | `-------- sub-version\n"
4666 " `------ always '1' because we don't change the ABI\n"
4672 #: ../src/guestfs.pod:2128
4673 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
4678 #: ../src/guestfs.pod:2130
4680 "As time passes we cherry pick fixes from the development branch and backport "
4681 "those into the stable branch, the effect being that the stable branch should "
4682 "get more stable and less buggy over time. So the stable releases are ideal "
4683 "for people who don't need new features but would just like the software to "
4689 #: ../src/guestfs.pod:2136
4690 msgid "Our criteria for backporting changes are:"
4695 #: ../src/guestfs.pod:2142
4697 "Documentation changes which don't affect any code are backported unless the "
4698 "documentation refers to a future feature which is not in stable."
4703 #: ../src/guestfs.pod:2148
4705 "Bug fixes which are not controversial, fix obvious problems, and have been "
4706 "well tested are backported."
4711 #: ../src/guestfs.pod:2153
4713 "Simple rearrangements of code which shouldn't affect how it works get "
4714 "backported. This is so that the code in the two branches doesn't get too "
4715 "far out of step, allowing us to backport future fixes more easily."
4720 #: ../src/guestfs.pod:2159
4722 "We I<don't> backport new features, new APIs, new tools etc, except in one "
4723 "exceptional case: the new feature is required in order to implement an "
4724 "important bug fix."
4729 #: ../src/guestfs.pod:2165
4731 "A new stable branch starts when we think the new features in development are "
4732 "substantial and compelling enough over the current stable branch to warrant "
4733 "it. When that happens we create new stable and development versions 1.N.0 "
4734 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4735 "stable at this point, but by backporting fixes from development, that branch "
4736 "will stabilize over time."
4740 #: ../src/guestfs.pod:2173
4741 msgid "EXTENDING LIBGUESTFS"
4745 #: ../src/guestfs.pod:2175
4746 msgid "ADDING A NEW API ACTION"
4750 #: ../src/guestfs.pod:2177
4752 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
4753 "documentation) are generated, and this makes it easy to extend the "
4758 #: ../src/guestfs.pod:2181
4759 msgid "To add a new API action there are two changes:"
4763 #: ../src/guestfs.pod:2187
4765 "You need to add a description of the call (name, parameters, return type, "
4766 "tests, documentation) to C<generator/generator_actions.ml>."
4770 #: ../src/guestfs.pod:2190
4772 "There are two sorts of API action, depending on whether the call goes "
4773 "through to the daemon in the appliance, or is serviced entirely by the "
4774 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
4775 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
4776 "an example of the latter, since a trace flag is maintained in the handle and "
4777 "all tracing is done on the library side."
4781 #: ../src/guestfs.pod:2198
4783 "Most new actions are of the first type, and get added to the "
4784 "C<daemon_functions> list. Each function has a unique procedure number used "
4785 "in the RPC protocol which is assigned to that action when we publish "
4786 "libguestfs and cannot be reused. Take the latest procedure number and "
4791 #: ../src/guestfs.pod:2204
4793 "For library-only actions of the second type, add to the "
4794 "C<non_daemon_functions> list. Since these functions are serviced by the "
4795 "library and do not travel over the RPC mechanism to the daemon, these "
4796 "functions do not need a procedure number, and so the procedure number is set "
4801 #: ../src/guestfs.pod:2212
4802 msgid "Implement the action (in C):"
4806 #: ../src/guestfs.pod:2214
4808 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
4809 "C<daemon/> directory."
4813 #: ../src/guestfs.pod:2217
4815 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
4816 "(note: double underscore) in the C<src/> directory."
4820 #: ../src/guestfs.pod:2220
4821 msgid "In either case, use another function as an example of what to do."
4825 #: ../src/guestfs.pod:2224
4826 msgid "After making these changes, use C<make> to compile."
4830 #: ../src/guestfs.pod:2226
4832 "Note that you don't need to implement the RPC, language bindings, manual "
4833 "pages or anything else. It's all automatically generated from the OCaml "
4838 #: ../src/guestfs.pod:2230
4839 msgid "ADDING TESTS FOR AN API ACTION"
4843 #: ../src/guestfs.pod:2232
4845 "You can supply zero or as many tests as you want per API call. The tests "
4846 "can either be added as part of the API description (C<generator/"
4847 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
4848 "into C<regressions/>. Note that adding a script to C<regressions/> is "
4849 "slower, so if possible use the first method."
4853 #: ../src/guestfs.pod:2238
4855 "The following describes the test environment used when you add an API test "
4856 "in C<generator_actions.ml>."
4860 #: ../src/guestfs.pod:2241
4861 msgid "The test environment has 4 block devices:"
4865 #: ../src/guestfs.pod:2245
4866 msgid "C</dev/sda> 500MB"
4870 #: ../src/guestfs.pod:2247
4871 msgid "General block device for testing."
4875 #: ../src/guestfs.pod:2249
4876 msgid "C</dev/sdb> 50MB"
4880 #: ../src/guestfs.pod:2251
4882 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
4887 #: ../src/guestfs.pod:2254
4888 msgid "C</dev/sdc> 10MB"
4892 #: ../src/guestfs.pod:2256
4893 msgid "Used in a few tests where two block devices are needed."
4897 #: ../src/guestfs.pod:2258
4902 #: ../src/guestfs.pod:2260
4903 msgid "ISO with fixed content (see C<images/test.iso>)."
4907 #: ../src/guestfs.pod:2264
4909 "To be able to run the tests in a reasonable amount of time, the libguestfs "
4910 "appliance and block devices are reused between tests. So don't try testing "
4911 "L</guestfs_kill_subprocess> :-x"
4915 #: ../src/guestfs.pod:2268
4917 "Each test starts with an initial scenario, selected using one of the "
4918 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
4919 "initialize the disks mentioned above in a particular way as documented in "
4920 "C<generator_types.ml>. You should not assume anything about the previous "
4921 "contents of other disks that are not initialized."
4925 #: ../src/guestfs.pod:2274
4927 "You can add a prerequisite clause to any individual test. This is a run-"
4928 "time check, which, if it fails, causes the test to be skipped. Useful if "
4929 "testing a command which might not work on all variations of libguestfs "
4930 "builds. A test that has prerequisite of C<Always> means to run "
4935 #: ../src/guestfs.pod:2280
4937 "In addition, packagers can skip individual tests by setting environment "
4938 "variables before running C<make check>."
4942 #: ../src/guestfs.pod:2283
4945 " SKIP_TEST_<CMD>_<NUM>=1\n"
4950 #: ../src/guestfs.pod:2285
4951 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
4955 #: ../src/guestfs.pod:2287
4960 #: ../src/guestfs.pod:2289
4963 " SKIP_TEST_<CMD>=1\n"
4968 #: ../src/guestfs.pod:2291
4969 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
4973 #: ../src/guestfs.pod:2293
4974 msgid "Packagers can run only certain tests by setting for example:"
4978 #: ../src/guestfs.pod:2295
4981 " TEST_ONLY=\"vfs_type zerofree\"\n"
4986 #: ../src/guestfs.pod:2297
4988 "See C<capitests/tests.c> for more details of how these environment variables "
4993 #: ../src/guestfs.pod:2300
4994 msgid "DEBUGGING NEW API ACTIONS"
4998 #: ../src/guestfs.pod:2302
4999 msgid "Test new actions work before submitting them."
5003 #: ../src/guestfs.pod:2304
5004 msgid "You can use guestfish to try out new commands."
5008 #: ../src/guestfs.pod:2306
5010 "Debugging the daemon is a problem because it runs inside a minimal "
5011 "environment. However you can fprintf messages in the daemon to stderr, and "
5012 "they will show up if you use C<guestfish -v>."
5016 #: ../src/guestfs.pod:2310
5017 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
5021 #: ../src/guestfs.pod:2312
5023 "Our C source code generally adheres to some basic code-formatting "
5024 "conventions. The existing code base is not totally consistent on this "
5025 "front, but we do prefer that contributed code be formatted similarly. In "
5026 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
5027 "indentation level, and other than that, follow the K&R style."
5031 #: ../src/guestfs.pod:2318
5033 "If you use Emacs, add the following to one of one of your start-up files (e."
5034 "g., ~/.emacs), to help ensure that you get indentation right:"
5038 #: ../src/guestfs.pod:2321
5041 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
5042 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
5043 " (add-hook 'find-file-hook\n"
5044 " '(lambda () (if (and buffer-file-name\n"
5045 " (string-match \"/libguestfs\\\\>\"\n"
5046 " (buffer-file-name))\n"
5047 " (not (string-equal mode-name \"Change Log\"))\n"
5048 " (not (string-equal mode-name \"Makefile\")))\n"
5049 " (setq indent-tabs-mode nil))))\n"
5054 #: ../src/guestfs.pod:2331
5057 " ;;; When editing C sources in libguestfs, use this style.\n"
5058 " (defun libguestfs-c-mode ()\n"
5059 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
5061 " (c-set-style \"K&R\")\n"
5062 " (setq c-indent-level 2)\n"
5063 " (setq c-basic-offset 2))\n"
5064 " (add-hook 'c-mode-hook\n"
5065 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
5066 " (buffer-file-name))\n"
5067 " (libguestfs-c-mode))))\n"
5072 #: ../src/guestfs.pod:2343
5073 msgid "Enable warnings when compiling (and fix any problems this finds):"
5077 #: ../src/guestfs.pod:2346
5080 " ./configure --enable-gcc-warnings\n"
5085 #: ../src/guestfs.pod:2348
5086 msgid "Useful targets are:"
5090 #: ../src/guestfs.pod:2350
5093 " make syntax-check # checks the syntax of the C code\n"
5094 " make check # runs the test suite\n"
5099 #: ../src/guestfs.pod:2353
5100 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
5104 #: ../src/guestfs.pod:2355
5106 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
5107 "which are used to do shell quoting."
5111 #: ../src/guestfs.pod:2360
5116 #: ../src/guestfs.pod:2362
5118 "Simple shell quoted string. Any spaces or other shell characters are "
5123 #: ../src/guestfs.pod:2365
5128 #: ../src/guestfs.pod:2367
5130 "Same as C<%Q> except the string is treated as a path which is prefixed by "
5136 #: ../src/guestfs.pod:2372 ../fish/guestfish.pod:240 ../fish/guestfish.pod:599
5137 msgid "For example:"
5141 #: ../src/guestfs.pod:2374
5144 " asprintf (&cmd, \"cat %R\", path);\n"
5149 #: ../src/guestfs.pod:2376
5150 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
5154 #: ../src/guestfs.pod:2378
5156 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
5157 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
5158 "they are not passed via the shell (instead, straight to exec). You probably "
5159 "want to use the C<sysroot_path()> function however."
5163 #: ../src/guestfs.pod:2384
5164 msgid "SUBMITTING YOUR NEW API ACTIONS"
5168 #: ../src/guestfs.pod:2386
5170 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
5171 "libguestfs> and CC to L<rjones@redhat.com>."
5175 #: ../src/guestfs.pod:2390
5176 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
5180 #: ../src/guestfs.pod:2392
5181 msgid "We support i18n (gettext anyhow) in the library."
5185 #: ../src/guestfs.pod:2394
5187 "However many messages come from the daemon, and we don't translate those at "
5188 "the moment. One reason is that the appliance generally has all locale files "
5189 "removed from it, because they take up a lot of space. So we'd have to readd "
5190 "some of those, as well as copying our PO files into the appliance."
5194 #: ../src/guestfs.pod:2400
5196 "Debugging messages are never translated, since they are intended for the "
5201 #: ../src/guestfs.pod:2403
5202 msgid "SOURCE CODE SUBDIRECTORIES"
5206 #: ../src/guestfs.pod:2407 ../src/guestfs-actions.pod:5686
5207 #: ../fish/guestfish-actions.pod:3808
5208 msgid "C<appliance>"
5212 #: ../src/guestfs.pod:2409
5213 msgid "The libguestfs appliance, build scripts and so on."
5217 #: ../src/guestfs.pod:2411
5218 msgid "C<capitests>"
5222 #: ../src/guestfs.pod:2413
5223 msgid "Automated tests of the C API."
5227 #: ../src/guestfs.pod:2415
5232 #: ../src/guestfs.pod:2417
5234 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
5239 #: ../src/guestfs.pod:2420
5244 #: ../src/guestfs.pod:2422
5245 msgid "Outside contributions, experimental parts."
5249 #: ../src/guestfs.pod:2424
5254 #: ../src/guestfs.pod:2426
5256 "The daemon that runs inside the libguestfs appliance and carries out actions."
5260 #: ../src/guestfs.pod:2429
5265 #: ../src/guestfs.pod:2431
5266 msgid "L<virt-df(1)> command and documentation."
5270 #: ../src/guestfs.pod:2433
5275 #: ../src/guestfs.pod:2435
5276 msgid "C API example code."
5280 #: ../src/guestfs.pod:2437
5285 #: ../src/guestfs.pod:2439
5287 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
5288 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
5289 "L<virt-tar-out(1)>."
5293 #: ../src/guestfs.pod:2443
5298 #: ../src/guestfs.pod:2445
5300 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
5304 #: ../src/guestfs.pod:2447
5305 msgid "C<generator>"
5309 #: ../src/guestfs.pod:2449
5311 "The crucially important generator, used to automatically generate large "
5312 "amounts of boilerplate C code for things like RPC and bindings."
5316 #: ../src/guestfs.pod:2452
5321 #: ../src/guestfs.pod:2454
5322 msgid "Files used by the test suite."
5326 #: ../src/guestfs.pod:2456
5327 msgid "Some \"phony\" guest images which we test against."
5331 #: ../src/guestfs.pod:2458
5332 msgid "C<inspector>"
5336 #: ../src/guestfs.pod:2460
5337 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
5341 #: ../src/guestfs.pod:2462
5346 #: ../src/guestfs.pod:2464
5347 msgid "Logo used on the website. The fish is called Arthur by the way."
5351 #: ../src/guestfs.pod:2466
5356 #: ../src/guestfs.pod:2468
5357 msgid "M4 macros used by autoconf."
5361 #: ../src/guestfs.pod:2470
5366 #: ../src/guestfs.pod:2472
5367 msgid "Translations of simple gettext strings."
5371 #: ../src/guestfs.pod:2474
5376 #: ../src/guestfs.pod:2476
5378 "The build infrastructure and PO files for translations of manpages and POD "
5379 "files. Eventually this will be combined with the C<po> directory, but that "
5380 "is rather complicated."
5384 #: ../src/guestfs.pod:2480
5385 msgid "C<regressions>"
5389 #: ../src/guestfs.pod:2482
5390 msgid "Regression tests."
5394 #: ../src/guestfs.pod:2484
5399 #: ../src/guestfs.pod:2486
5400 msgid "L<virt-rescue(1)> command and documentation."
5404 #: ../src/guestfs.pod:2488
5409 #: ../src/guestfs.pod:2490
5410 msgid "Source code to the C library."
5414 #: ../src/guestfs.pod:2492
5419 #: ../src/guestfs.pod:2494
5420 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
5424 #: ../src/guestfs.pod:2496
5425 msgid "C<test-tool>"
5429 #: ../src/guestfs.pod:2498
5431 "Test tool for end users to test if their qemu/kernel combination will work "
5436 #: ../src/guestfs.pod:2501
5441 #: ../src/guestfs.pod:2503
5446 #: ../src/guestfs.pod:2505
5451 #: ../src/guestfs.pod:2507
5456 #: ../src/guestfs.pod:2509
5461 #: ../src/guestfs.pod:2511
5466 #: ../src/guestfs.pod:2513
5471 #: ../src/guestfs.pod:2515
5476 #: ../src/guestfs.pod:2517
5477 msgid "Language bindings."
5482 #: ../src/guestfs.pod:2521 ../fish/guestfish.pod:996
5483 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
5484 msgid "ENVIRONMENT VARIABLES"
5489 #: ../src/guestfs.pod:2525 ../fish/guestfish.pod:1022
5490 msgid "LIBGUESTFS_APPEND"
5495 #: ../src/guestfs.pod:2527 ../fish/guestfish.pod:1024
5496 msgid "Pass additional options to the guest kernel."
5501 #: ../src/guestfs.pod:2529 ../fish/guestfish.pod:1026
5502 msgid "LIBGUESTFS_DEBUG"
5507 #: ../src/guestfs.pod:2531
5509 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
5510 "effect as calling C<guestfs_set_verbose (g, 1)>."
5515 #: ../src/guestfs.pod:2534 ../fish/guestfish.pod:1031
5516 msgid "LIBGUESTFS_MEMSIZE"
5521 #: ../src/guestfs.pod:2536 ../fish/guestfish.pod:1033
5523 "Set the memory allocated to the qemu process, in megabytes. For example:"
5528 #: ../src/guestfs.pod:2539 ../fish/guestfish.pod:1036
5531 " LIBGUESTFS_MEMSIZE=700\n"
5537 #: ../src/guestfs.pod:2541 ../fish/guestfish.pod:1038
5538 msgid "LIBGUESTFS_PATH"
5543 #: ../src/guestfs.pod:2543
5545 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
5546 "the discussion of paths in section PATH above."
5551 #: ../src/guestfs.pod:2546 ../fish/guestfish.pod:1043
5552 msgid "LIBGUESTFS_QEMU"
5557 #: ../src/guestfs.pod:2548 ../fish/guestfish.pod:1045
5559 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
5560 "which was found at compile time by the configure script is used."
5565 #: ../src/guestfs.pod:2552
5566 msgid "See also L</QEMU WRAPPERS> above."
5571 #: ../src/guestfs.pod:2554 ../fish/guestfish.pod:1049
5572 msgid "LIBGUESTFS_TRACE"
5577 #: ../src/guestfs.pod:2556
5579 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
5580 "effect as calling C<guestfs_set_trace (g, 1)>."
5585 #: ../src/guestfs.pod:2559 ../fish/guestfish.pod:1058
5590 #: ../src/guestfs.pod:2561 ../fish/guestfish.pod:1060
5592 "Location of temporary directory, defaults to C</tmp> except for the cached "
5593 "supermin appliance which defaults to C</var/tmp>."
5597 #: ../src/guestfs.pod:2564 ../fish/guestfish.pod:1063
5599 "If libguestfs was compiled to use the supermin appliance then the real "
5600 "appliance is cached in this directory, shared between all handles belonging "
5601 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
5602 "use in case C</var/tmp> is not large enough."
5607 #: ../src/guestfs.pod:2572 ../fish/guestfish.pod:1121
5608 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:238
5609 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:572
5610 #: ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189
5611 #: ../tools/virt-tar.pl:286 ../tools/virt-make-fs.pl:534
5612 #: ../tools/virt-list-partitions.pl:257
5617 #: ../src/guestfs.pod:2574
5619 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
5620 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in"
5621 "(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems"
5622 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
5623 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
5624 "tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)"
5625 ">, L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
5630 #: ../src/guestfs.pod:2601
5632 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
5633 "(8)>, L<disktype(1)>."
5638 #: ../src/guestfs.pod:2608 ../tools/virt-win-reg.pl:587
5639 #: ../tools/virt-make-fs.pl:548
5645 #: ../src/guestfs.pod:2610
5646 msgid "To get a list of bugs against libguestfs use this link:"
5651 #: ../src/guestfs.pod:2612
5653 "L<https://bugzilla.redhat.com/buglist.cgi?"
5654 "component=libguestfs&product=Virtualization+Tools>"
5659 #: ../src/guestfs.pod:2614
5660 msgid "To report a new bug against libguestfs use this link:"
5665 #: ../src/guestfs.pod:2616
5667 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
5668 "component=libguestfs&product=Virtualization+Tools>"
5673 #: ../src/guestfs.pod:2618
5674 msgid "When reporting a bug, please check:"
5679 #: ../src/guestfs.pod:2624
5680 msgid "That the bug hasn't been reported already."
5685 #: ../src/guestfs.pod:2628
5686 msgid "That you are testing a recent version."
5691 #: ../src/guestfs.pod:2632
5692 msgid "Describe the bug accurately, and give a way to reproduce it."
5697 #: ../src/guestfs.pod:2636
5699 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
5705 #: ../src/guestfs.pod:2641 ../fish/guestfish.pod:1144
5706 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:249
5712 #: ../src/guestfs.pod:2643 ../fish/guestfish.pod:1146
5713 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:251
5714 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
5719 #: ../src/guestfs.pod:2645 ../fish/guestfish.pod:1148
5720 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:253
5721 #: ../tools/virt-edit.pl:368 ../tools/virt-win-reg.pl:602
5722 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206
5723 #: ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:563
5724 #: ../tools/virt-list-partitions.pl:273
5730 #: ../src/guestfs.pod:2647 ../fish/guestfish.pod:1150
5731 #: ../fuse/guestmount.pod:255
5732 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
5737 #: ../src/guestfs.pod:2650
5739 "This library is free software; you can redistribute it and/or modify it "
5740 "under the terms of the GNU Lesser General Public License as published by the "
5741 "Free Software Foundation; either version 2 of the License, or (at your "
5742 "option) any later version."
5747 #: ../src/guestfs.pod:2655
5749 "This library is distributed in the hope that it will be useful, but WITHOUT "
5750 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
5751 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
5757 #: ../src/guestfs.pod:2660
5759 "You should have received a copy of the GNU Lesser General Public License "
5760 "along with this library; if not, write to the Free Software Foundation, "
5761 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
5766 #: ../src/guestfs-actions.pod:1
5767 msgid "guestfs_add_cdrom"
5772 #: ../src/guestfs-actions.pod:3
5776 " guestfs_add_cdrom (guestfs_h *g,\n"
5777 " const char *filename);\n"
5783 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
5784 msgid "This function adds a virtual CD-ROM disk image to the guest."
5789 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
5790 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
5795 #: ../src/guestfs-actions.pod:17
5797 "This call checks for the existence of C<filename>. This stops you from "
5798 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5799 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
5805 #: ../src/guestfs-actions.pod:24
5807 "If you just want to add an ISO file (often you use this as an efficient way "
5808 "to transfer large files into the guest), then you should probably use "
5809 "C<guestfs_add_drive_ro> instead."
5814 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:134
5815 #: ../src/guestfs-actions.pod:195 ../src/guestfs-actions.pod:232
5816 #: ../src/guestfs-actions.pod:246 ../src/guestfs-actions.pod:267
5817 #: ../src/guestfs-actions.pod:287 ../src/guestfs-actions.pod:301
5818 #: ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:436
5819 #: ../src/guestfs-actions.pod:450 ../src/guestfs-actions.pod:495
5820 #: ../src/guestfs-actions.pod:523 ../src/guestfs-actions.pod:541
5821 #: ../src/guestfs-actions.pod:608 ../src/guestfs-actions.pod:641
5822 #: ../src/guestfs-actions.pod:655 ../src/guestfs-actions.pod:670
5823 #: ../src/guestfs-actions.pod:769 ../src/guestfs-actions.pod:787
5824 #: ../src/guestfs-actions.pod:801 ../src/guestfs-actions.pod:815
5825 #: ../src/guestfs-actions.pod:976 ../src/guestfs-actions.pod:996
5826 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1098
5827 #: ../src/guestfs-actions.pod:1116 ../src/guestfs-actions.pod:1135
5828 #: ../src/guestfs-actions.pod:1149 ../src/guestfs-actions.pod:1169
5829 #: ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1270
5830 #: ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1332
5831 #: ../src/guestfs-actions.pod:1438 ../src/guestfs-actions.pod:1472
5832 #: ../src/guestfs-actions.pod:1690 ../src/guestfs-actions.pod:1712
5833 #: ../src/guestfs-actions.pod:1799 ../src/guestfs-actions.pod:2261
5834 #: ../src/guestfs-actions.pod:2405 ../src/guestfs-actions.pod:2466
5835 #: ../src/guestfs-actions.pod:2501 ../src/guestfs-actions.pod:3336
5836 #: ../src/guestfs-actions.pod:3351 ../src/guestfs-actions.pod:3371
5837 #: ../src/guestfs-actions.pod:3526 ../src/guestfs-actions.pod:3540
5838 #: ../src/guestfs-actions.pod:3553 ../src/guestfs-actions.pod:3567
5839 #: ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:3618
5840 #: ../src/guestfs-actions.pod:3690 ../src/guestfs-actions.pod:3710
5841 #: ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:3750
5842 #: ../src/guestfs-actions.pod:3773 ../src/guestfs-actions.pod:3805
5843 #: ../src/guestfs-actions.pod:3824 ../src/guestfs-actions.pod:3843
5844 #: ../src/guestfs-actions.pod:3878 ../src/guestfs-actions.pod:3890
5845 #: ../src/guestfs-actions.pod:3926 ../src/guestfs-actions.pod:3942
5846 #: ../src/guestfs-actions.pod:3955 ../src/guestfs-actions.pod:3970
5847 #: ../src/guestfs-actions.pod:3987 ../src/guestfs-actions.pod:4080
5848 #: ../src/guestfs-actions.pod:4100 ../src/guestfs-actions.pod:4113
5849 #: ../src/guestfs-actions.pod:4164 ../src/guestfs-actions.pod:4182
5850 #: ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4216
5851 #: ../src/guestfs-actions.pod:4230 ../src/guestfs-actions.pod:4244
5852 #: ../src/guestfs-actions.pod:4261 ../src/guestfs-actions.pod:4276
5853 #: ../src/guestfs-actions.pod:4296 ../src/guestfs-actions.pod:4354
5854 #: ../src/guestfs-actions.pod:4427 ../src/guestfs-actions.pod:4458
5855 #: ../src/guestfs-actions.pod:4477 ../src/guestfs-actions.pod:4496
5856 #: ../src/guestfs-actions.pod:4508 ../src/guestfs-actions.pod:4525
5857 #: ../src/guestfs-actions.pod:4538 ../src/guestfs-actions.pod:4553
5858 #: ../src/guestfs-actions.pod:4568 ../src/guestfs-actions.pod:4603
5859 #: ../src/guestfs-actions.pod:4618 ../src/guestfs-actions.pod:4638
5860 #: ../src/guestfs-actions.pod:4652 ../src/guestfs-actions.pod:4669
5861 #: ../src/guestfs-actions.pod:4718 ../src/guestfs-actions.pod:4755
5862 #: ../src/guestfs-actions.pod:4769 ../src/guestfs-actions.pod:4797
5863 #: ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:4832
5864 #: ../src/guestfs-actions.pod:4966 ../src/guestfs-actions.pod:5023
5865 #: ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5063
5866 #: ../src/guestfs-actions.pod:5095 ../src/guestfs-actions.pod:5161
5867 #: ../src/guestfs-actions.pod:5178 ../src/guestfs-actions.pod:5191
5868 #: ../src/guestfs-actions.pod:5205 ../src/guestfs-actions.pod:5494
5869 #: ../src/guestfs-actions.pod:5513 ../src/guestfs-actions.pod:5532
5870 #: ../src/guestfs-actions.pod:5544 ../src/guestfs-actions.pod:5556
5871 #: ../src/guestfs-actions.pod:5570 ../src/guestfs-actions.pod:5582
5872 #: ../src/guestfs-actions.pod:5596 ../src/guestfs-actions.pod:5612
5873 #: ../src/guestfs-actions.pod:5633 ../src/guestfs-actions.pod:5652
5874 #: ../src/guestfs-actions.pod:5671 ../src/guestfs-actions.pod:5701
5875 #: ../src/guestfs-actions.pod:5717 ../src/guestfs-actions.pod:5740
5876 #: ../src/guestfs-actions.pod:5758 ../src/guestfs-actions.pod:5777
5877 #: ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5817
5878 #: ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:5862
5879 #: ../src/guestfs-actions.pod:5886 ../src/guestfs-actions.pod:5905
5880 #: ../src/guestfs-actions.pod:5929 ../src/guestfs-actions.pod:5944
5881 #: ../src/guestfs-actions.pod:5959 ../src/guestfs-actions.pod:5978
5882 #: ../src/guestfs-actions.pod:6015 ../src/guestfs-actions.pod:6038
5883 #: ../src/guestfs-actions.pod:6064 ../src/guestfs-actions.pod:6172
5884 #: ../src/guestfs-actions.pod:6293 ../src/guestfs-actions.pod:6305
5885 #: ../src/guestfs-actions.pod:6318 ../src/guestfs-actions.pod:6331
5886 #: ../src/guestfs-actions.pod:6353 ../src/guestfs-actions.pod:6366
5887 #: ../src/guestfs-actions.pod:6379 ../src/guestfs-actions.pod:6392
5888 #: ../src/guestfs-actions.pod:6407 ../src/guestfs-actions.pod:6466
5889 #: ../src/guestfs-actions.pod:6483 ../src/guestfs-actions.pod:6499
5890 #: ../src/guestfs-actions.pod:6515 ../src/guestfs-actions.pod:6532
5891 #: ../src/guestfs-actions.pod:6545 ../src/guestfs-actions.pod:6565
5892 #: ../src/guestfs-actions.pod:6601 ../src/guestfs-actions.pod:6615
5893 #: ../src/guestfs-actions.pod:6656 ../src/guestfs-actions.pod:6669
5894 #: ../src/guestfs-actions.pod:6687 ../src/guestfs-actions.pod:6721
5895 #: ../src/guestfs-actions.pod:6757 ../src/guestfs-actions.pod:6876
5896 #: ../src/guestfs-actions.pod:6894 ../src/guestfs-actions.pod:6908
5897 #: ../src/guestfs-actions.pod:6963 ../src/guestfs-actions.pod:6976
5898 #: ../src/guestfs-actions.pod:7021 ../src/guestfs-actions.pod:7054
5899 #: ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7134
5900 #: ../src/guestfs-actions.pod:7200 ../src/guestfs-actions.pod:7219
5901 #: ../src/guestfs-actions.pod:7248
5902 msgid "This function returns 0 on success or -1 on error."
5907 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:248
5908 #: ../src/guestfs-actions.pod:269 ../fish/guestfish-actions.pod:28
5909 #: ../fish/guestfish-actions.pod:158 ../fish/guestfish-actions.pod:172
5911 "This function is deprecated. In new code, use the C<add_drive_opts> call "
5917 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:251
5918 #: ../src/guestfs-actions.pod:272 ../src/guestfs-actions.pod:1443
5919 #: ../src/guestfs-actions.pod:1939 ../src/guestfs-actions.pod:1960
5920 #: ../src/guestfs-actions.pod:4301 ../src/guestfs-actions.pod:7142
5921 #: ../src/guestfs-actions.pod:7311 ../fish/guestfish-actions.pod:31
5922 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:175
5923 #: ../fish/guestfish-actions.pod:956 ../fish/guestfish-actions.pod:1319
5924 #: ../fish/guestfish-actions.pod:1333 ../fish/guestfish-actions.pod:2908
5925 #: ../fish/guestfish-actions.pod:4762 ../fish/guestfish-actions.pod:4859
5927 "Deprecated functions will not be removed from the API, but the fact that "
5928 "they are deprecated indicates that there are problems with correct use of "
5934 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:136
5935 #: ../src/guestfs-actions.pod:1100 ../src/guestfs-actions.pod:1911
5936 #: ../src/guestfs-actions.pod:2009 ../src/guestfs-actions.pod:2112
5937 #: ../src/guestfs-actions.pod:3338 ../src/guestfs-actions.pod:3353
5938 #: ../src/guestfs-actions.pod:4605 ../src/guestfs-actions.pod:5719
5939 #: ../src/guestfs-actions.pod:5836 ../src/guestfs-actions.pod:5946
5940 #: ../src/guestfs-actions.pod:6409 ../src/guestfs-actions.pod:6534
5941 #: ../src/guestfs-actions.pod:7056
5942 msgid "(Added in 0.3)"
5947 #: ../src/guestfs-actions.pod:41
5948 msgid "guestfs_add_domain"
5953 #: ../src/guestfs-actions.pod:43
5957 " guestfs_add_domain (guestfs_h *g,\n"
5958 " const char *dom,\n"
5965 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:145
5966 #: ../src/guestfs-actions.pod:4315
5968 "You may supply a list of optional arguments to this call. Use zero or more "
5969 "of the following pairs of parameters, and terminate the list with C<-1> on "
5970 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
5974 #: ../src/guestfs-actions.pod:53
5977 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
5978 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
5979 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
5980 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
5986 #: ../src/guestfs-actions.pod:58
5988 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5989 "It works by connecting to libvirt, requesting the domain and domain XML from "
5990 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
5996 #: ../src/guestfs-actions.pod:63 ../fish/guestfish-actions.pod:46
5998 "The number of disks added is returned. This operation is atomic: if an "
5999 "error is returned, then no disks are added."
6004 #: ../src/guestfs-actions.pod:66 ../fish/guestfish-actions.pod:49
6006 "This function does some minimal checks to make sure the libvirt domain is "
6007 "not running (unless C<readonly> is true). In a future version we will try "
6008 "to acquire the libvirt lock on each disk."
6013 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:53
6015 "Disks must be accessible locally. This often means that adding disks from a "
6016 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
6017 "unless those disks are accessible via the same device path locally too."
6021 #: ../src/guestfs-actions.pod:75 ../fish/guestfish-actions.pod:58
6023 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
6024 "libvirt.org/uri.html>). If this is not set then we connect to the default "
6025 "libvirt URI (or one set through an environment variable, see the libvirt "
6026 "documentation for full details)."
6030 #: ../src/guestfs-actions.pod:81 ../fish/guestfish-actions.pod:64
6032 "The optional C<live> flag controls whether this call will try to connect to "
6033 "a running virtual machine C<guestfsd> process if it sees a suitable "
6034 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
6035 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
6036 "DAEMONS> for more information."
6041 #: ../src/guestfs-actions.pod:88
6043 "The other optional parameters are passed directly through to "
6044 "C<guestfs_add_drive_opts>."
6049 #: ../src/guestfs-actions.pod:91 ../src/guestfs-actions.pod:344
6050 #: ../src/guestfs-actions.pod:509 ../src/guestfs-actions.pod:687
6051 #: ../src/guestfs-actions.pod:718 ../src/guestfs-actions.pod:736
6052 #: ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:1315
6053 #: ../src/guestfs-actions.pod:1669 ../src/guestfs-actions.pod:1872
6054 #: ../src/guestfs-actions.pod:1981 ../src/guestfs-actions.pod:2021
6055 #: ../src/guestfs-actions.pod:2076 ../src/guestfs-actions.pod:2099
6056 #: ../src/guestfs-actions.pod:2392 ../src/guestfs-actions.pod:2719
6057 #: ../src/guestfs-actions.pod:2740 ../src/guestfs-actions.pod:4741
6058 #: ../src/guestfs-actions.pod:4869 ../src/guestfs-actions.pod:5275
6059 #: ../src/guestfs-actions.pod:5301 ../src/guestfs-actions.pod:6642
6060 #: ../src/guestfs-actions.pod:7067 ../src/guestfs-actions.pod:7080
6061 #: ../src/guestfs-actions.pod:7093
6062 msgid "On error this function returns -1."
6067 #: ../src/guestfs-actions.pod:93
6068 msgid "(Added in 1.7.4)"
6073 #: ../src/guestfs-actions.pod:95
6074 msgid "guestfs_add_domain_va"
6079 #: ../src/guestfs-actions.pod:97
6083 " guestfs_add_domain_va (guestfs_h *g,\n"
6084 " const char *dom,\n"
6091 #: ../src/guestfs-actions.pod:102
6092 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
6097 #: ../src/guestfs-actions.pod:104 ../src/guestfs-actions.pod:115
6098 #: ../src/guestfs-actions.pod:208 ../src/guestfs-actions.pod:219
6099 #: ../src/guestfs-actions.pod:4368 ../src/guestfs-actions.pod:4380
6100 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
6105 #: ../src/guestfs-actions.pod:106
6106 msgid "guestfs_add_domain_argv"
6111 #: ../src/guestfs-actions.pod:108
6115 " guestfs_add_domain_argv (guestfs_h *g,\n"
6116 " const char *dom,\n"
6117 " const struct guestfs_add_domain_argv *optargs);\n"
6123 #: ../src/guestfs-actions.pod:113
6124 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
6129 #: ../src/guestfs-actions.pod:117
6130 msgid "guestfs_add_drive"
6135 #: ../src/guestfs-actions.pod:119
6139 " guestfs_add_drive (guestfs_h *g,\n"
6140 " const char *filename);\n"
6146 #: ../src/guestfs-actions.pod:123
6148 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
6149 "optional parameters, so the disk is added writable, with the format being "
6150 "detected automatically."
6155 #: ../src/guestfs-actions.pod:127
6157 "Automatic detection of the format opens you up to a potential security hole "
6158 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6159 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6160 "you should think about replacing calls to this function with calls to "
6161 "C<guestfs_add_drive_opts>, and specifying the format."
6166 #: ../src/guestfs-actions.pod:138
6167 msgid "guestfs_add_drive_opts"
6172 #: ../src/guestfs-actions.pod:140
6176 " guestfs_add_drive_opts (guestfs_h *g,\n"
6177 " const char *filename,\n"
6184 #: ../src/guestfs-actions.pod:150
6187 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
6188 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
6189 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
6195 #: ../src/guestfs-actions.pod:154 ../fish/guestfish-actions.pod:97
6197 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6198 "The first time you call this function, the disk appears as C</dev/sda>, the "
6199 "second time as C</dev/sdb>, and so on."
6204 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:102
6206 "You don't necessarily need to be root when using libguestfs. However you "
6207 "obviously do need sufficient permissions to access the filename for whatever "
6208 "operations you want to perform (ie. read access if you just want to read the "
6209 "image or write access if you want to modify the image)."
6214 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:108
6215 msgid "This call checks that C<filename> exists."
6220 #: ../src/guestfs-actions.pod:167 ../src/guestfs-actions.pod:4326
6221 #: ../fish/guestfish-actions.pod:110 ../fish/guestfish-actions.pod:2919
6222 msgid "The optional arguments are:"
6227 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:114
6233 #: ../src/guestfs-actions.pod:173 ../fish/guestfish-actions.pod:116
6235 "If true then the image is treated as read-only. Writes are still allowed, "
6236 "but they are stored in a temporary snapshot overlay which is discarded at "
6237 "the end. The disk that you add is not modified."
6242 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:120
6248 #: ../src/guestfs-actions.pod:179
6250 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
6251 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
6252 "Possible formats include C<raw> and C<qcow2>."
6257 #: ../src/guestfs-actions.pod:183 ../fish/guestfish-actions.pod:126
6259 "Automatic detection of the format opens you up to a potential security hole "
6260 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6261 "RHBZ#642934. Specifying the format closes this security hole."
6266 #: ../src/guestfs-actions.pod:188 ../fish/guestfish-actions.pod:131
6272 #: ../src/guestfs-actions.pod:190
6274 "This rarely-used option lets you emulate the behaviour of the deprecated "
6275 "C<guestfs_add_drive_with_if> call (q.v.)"
6280 #: ../src/guestfs-actions.pod:197
6281 msgid "(Added in 1.5.23)"
6286 #: ../src/guestfs-actions.pod:199
6287 msgid "guestfs_add_drive_opts_va"
6292 #: ../src/guestfs-actions.pod:201
6296 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
6297 " const char *filename,\n"
6304 #: ../src/guestfs-actions.pod:206
6305 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
6310 #: ../src/guestfs-actions.pod:210
6311 msgid "guestfs_add_drive_opts_argv"
6316 #: ../src/guestfs-actions.pod:212
6320 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
6321 " const char *filename,\n"
6322 " const struct guestfs_add_drive_opts_argv *optargs);\n"
6328 #: ../src/guestfs-actions.pod:217
6329 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
6334 #: ../src/guestfs-actions.pod:221
6335 msgid "guestfs_add_drive_ro"
6340 #: ../src/guestfs-actions.pod:223
6344 " guestfs_add_drive_ro (guestfs_h *g,\n"
6345 " const char *filename);\n"
6351 #: ../src/guestfs-actions.pod:227
6353 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
6354 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
6355 "disk is added read-only, with the format being detected automatically."
6360 #: ../src/guestfs-actions.pod:234
6361 msgid "(Added in 1.0.38)"
6366 #: ../src/guestfs-actions.pod:236
6367 msgid "guestfs_add_drive_ro_with_if"
6372 #: ../src/guestfs-actions.pod:238
6376 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
6377 " const char *filename,\n"
6378 " const char *iface);\n"
6384 #: ../src/guestfs-actions.pod:243
6386 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
6387 "QEMU interface emulation to use at run time."
6392 #: ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276
6393 #: ../src/guestfs-actions.pod:2351
6394 msgid "(Added in 1.0.84)"
6399 #: ../src/guestfs-actions.pod:257
6400 msgid "guestfs_add_drive_with_if"
6405 #: ../src/guestfs-actions.pod:259
6409 " guestfs_add_drive_with_if (guestfs_h *g,\n"
6410 " const char *filename,\n"
6411 " const char *iface);\n"
6417 #: ../src/guestfs-actions.pod:264
6419 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
6420 "QEMU interface emulation to use at run time."
6425 #: ../src/guestfs-actions.pod:278
6426 msgid "guestfs_aug_clear"
6431 #: ../src/guestfs-actions.pod:280
6435 " guestfs_aug_clear (guestfs_h *g,\n"
6436 " const char *augpath);\n"
6442 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:183
6444 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6445 "L<augtool(1)> C<clear> command."
6450 #: ../src/guestfs-actions.pod:289 ../src/guestfs-actions.pod:2101
6451 msgid "(Added in 1.3.4)"
6456 #: ../src/guestfs-actions.pod:291
6457 msgid "guestfs_aug_close"
6462 #: ../src/guestfs-actions.pod:293
6466 " guestfs_aug_close (guestfs_h *g);\n"
6472 #: ../src/guestfs-actions.pod:296
6474 "Close the current Augeas handle and free up any resources used by it. After "
6475 "calling this, you have to call C<guestfs_aug_init> again before you can use "
6476 "any other Augeas functions."
6481 #: ../src/guestfs-actions.pod:303 ../src/guestfs-actions.pod:328
6482 #: ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360
6483 #: ../src/guestfs-actions.pod:418 ../src/guestfs-actions.pod:438
6484 #: ../src/guestfs-actions.pod:452 ../src/guestfs-actions.pod:483
6485 #: ../src/guestfs-actions.pod:497 ../src/guestfs-actions.pod:511
6486 #: ../src/guestfs-actions.pod:525 ../src/guestfs-actions.pod:543
6487 #: ../src/guestfs-actions.pod:5352
6488 msgid "(Added in 0.7)"
6493 #: ../src/guestfs-actions.pod:305
6494 msgid "guestfs_aug_defnode"
6499 #: ../src/guestfs-actions.pod:307
6502 " struct guestfs_int_bool *\n"
6503 " guestfs_aug_defnode (guestfs_h *g,\n"
6504 " const char *name,\n"
6505 " const char *expr,\n"
6506 " const char *val);\n"
6512 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:199
6514 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6519 #: ../src/guestfs-actions.pod:316
6521 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6522 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
6523 "containing that single node."
6528 #: ../src/guestfs-actions.pod:320 ../fish/guestfish-actions.pod:206
6530 "On success this returns a pair containing the number of nodes in the "
6531 "nodeset, and a boolean flag if a node was created."
6536 #: ../src/guestfs-actions.pod:324
6538 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
6539 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
6544 #: ../src/guestfs-actions.pod:330
6545 msgid "guestfs_aug_defvar"
6550 #: ../src/guestfs-actions.pod:332
6554 " guestfs_aug_defvar (guestfs_h *g,\n"
6555 " const char *name,\n"
6556 " const char *expr);\n"
6562 #: ../src/guestfs-actions.pod:337 ../fish/guestfish-actions.pod:214
6564 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6565 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6570 #: ../src/guestfs-actions.pod:341 ../fish/guestfish-actions.pod:218
6572 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6573 "evaluates to something which is not a nodeset."
6578 #: ../src/guestfs-actions.pod:348
6579 msgid "guestfs_aug_get"
6584 #: ../src/guestfs-actions.pod:350
6588 " guestfs_aug_get (guestfs_h *g,\n"
6589 " const char *augpath);\n"
6595 #: ../src/guestfs-actions.pod:354 ../fish/guestfish-actions.pod:225
6597 "Look up the value associated with C<path>. If C<path> matches exactly one "
6598 "node, the C<value> is returned."
6603 #: ../src/guestfs-actions.pod:357 ../src/guestfs-actions.pod:857
6604 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:935
6605 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1054
6606 #: ../src/guestfs-actions.pod:1184 ../src/guestfs-actions.pod:1201
6607 #: ../src/guestfs-actions.pod:1220 ../src/guestfs-actions.pod:1349
6608 #: ../src/guestfs-actions.pod:1540 ../src/guestfs-actions.pod:1652
6609 #: ../src/guestfs-actions.pod:1815 ../src/guestfs-actions.pod:1832
6610 #: ../src/guestfs-actions.pod:1899 ../src/guestfs-actions.pod:1933
6611 #: ../src/guestfs-actions.pod:1954 ../src/guestfs-actions.pod:2124
6612 #: ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2523
6613 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2671
6614 #: ../src/guestfs-actions.pod:2691 ../src/guestfs-actions.pod:2805
6615 #: ../src/guestfs-actions.pod:2836 ../src/guestfs-actions.pod:2860
6616 #: ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:2945
6617 #: ../src/guestfs-actions.pod:3512 ../src/guestfs-actions.pod:3862
6618 #: ../src/guestfs-actions.pod:4032 ../src/guestfs-actions.pod:4142
6619 #: ../src/guestfs-actions.pod:4887 ../src/guestfs-actions.pod:5080
6620 #: ../src/guestfs-actions.pod:5250 ../src/guestfs-actions.pod:5428
6621 #: ../src/guestfs-actions.pod:5477 ../src/guestfs-actions.pod:6085
6622 #: ../src/guestfs-actions.pod:6101 ../src/guestfs-actions.pod:6118
6623 #: ../src/guestfs-actions.pod:6142 ../src/guestfs-actions.pod:6816
6624 #: ../src/guestfs-actions.pod:6835 ../src/guestfs-actions.pod:6853
6625 #: ../src/guestfs-actions.pod:7033 ../src/guestfs-actions.pod:7305
6627 "This function returns a string, or NULL on error. I<The caller must free "
6628 "the returned string after use>."
6633 #: ../src/guestfs-actions.pod:362
6634 msgid "guestfs_aug_init"
6639 #: ../src/guestfs-actions.pod:364
6643 " guestfs_aug_init (guestfs_h *g,\n"
6644 " const char *root,\n"
6651 #: ../src/guestfs-actions.pod:369 ../fish/guestfish-actions.pod:232
6653 "Create a new Augeas handle for editing configuration files. If there was "
6654 "any previous Augeas handle associated with this guestfs session, then it is "
6660 #: ../src/guestfs-actions.pod:373
6661 msgid "You must call this before using any other C<guestfs_aug_*> commands."
6666 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:239
6668 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6673 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:242
6675 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6676 "logical I<or> of the following integers:"
6681 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:248
6682 msgid "C<AUG_SAVE_BACKUP> = 1"
6687 #: ../src/guestfs-actions.pod:387 ../fish/guestfish-actions.pod:250
6688 msgid "Keep the original file with a C<.augsave> extension."
6693 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:252
6694 msgid "C<AUG_SAVE_NEWFILE> = 2"
6699 #: ../src/guestfs-actions.pod:391 ../fish/guestfish-actions.pod:254
6701 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6702 "original. Overrides C<AUG_SAVE_BACKUP>."
6707 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:257
6708 msgid "C<AUG_TYPE_CHECK> = 4"
6713 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:259
6714 msgid "Typecheck lenses (can be expensive)."
6719 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:261
6720 msgid "C<AUG_NO_STDINC> = 8"
6725 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:263
6726 msgid "Do not use standard load path for modules."
6731 #: ../src/guestfs-actions.pod:402 ../fish/guestfish-actions.pod:265
6732 msgid "C<AUG_SAVE_NOOP> = 16"
6737 #: ../src/guestfs-actions.pod:404 ../fish/guestfish-actions.pod:267
6738 msgid "Make save a no-op, just record what would have been changed."
6743 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:269
6744 msgid "C<AUG_NO_LOAD> = 32"
6749 #: ../src/guestfs-actions.pod:408
6750 msgid "Do not load the tree in C<guestfs_aug_init>."
6755 #: ../src/guestfs-actions.pod:412
6756 msgid "To close the handle, you can call C<guestfs_aug_close>."
6761 #: ../src/guestfs-actions.pod:414 ../fish/guestfish-actions.pod:277
6762 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6767 #: ../src/guestfs-actions.pod:420
6768 msgid "guestfs_aug_insert"
6773 #: ../src/guestfs-actions.pod:422
6777 " guestfs_aug_insert (guestfs_h *g,\n"
6778 " const char *augpath,\n"
6779 " const char *label,\n"
6786 #: ../src/guestfs-actions.pod:428 ../fish/guestfish-actions.pod:283
6788 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6789 "or after C<path> (depending on the boolean flag C<before>)."
6794 #: ../src/guestfs-actions.pod:432 ../fish/guestfish-actions.pod:287
6796 "C<path> must match exactly one existing node in the tree, and C<label> must "
6797 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6802 #: ../src/guestfs-actions.pod:440
6803 msgid "guestfs_aug_load"
6808 #: ../src/guestfs-actions.pod:442
6812 " guestfs_aug_load (guestfs_h *g);\n"
6818 #: ../src/guestfs-actions.pod:445 ../fish/guestfish-actions.pod:295
6819 msgid "Load files into the tree."
6824 #: ../src/guestfs-actions.pod:447 ../fish/guestfish-actions.pod:297
6825 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6830 #: ../src/guestfs-actions.pod:454
6831 msgid "guestfs_aug_ls"
6836 #: ../src/guestfs-actions.pod:456
6840 " guestfs_aug_ls (guestfs_h *g,\n"
6841 " const char *augpath);\n"
6847 #: ../src/guestfs-actions.pod:460
6849 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
6850 "sorting the resulting nodes into alphabetical order."
6855 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:479
6856 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:1073
6857 #: ../src/guestfs-actions.pod:1364 ../src/guestfs-actions.pod:1383
6858 #: ../src/guestfs-actions.pod:1486 ../src/guestfs-actions.pod:1505
6859 #: ../src/guestfs-actions.pod:1754 ../src/guestfs-actions.pod:2196
6860 #: ../src/guestfs-actions.pod:2212 ../src/guestfs-actions.pod:2231
6861 #: ../src/guestfs-actions.pod:2274 ../src/guestfs-actions.pod:2298
6862 #: ../src/guestfs-actions.pod:2369 ../src/guestfs-actions.pod:2418
6863 #: ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:2879
6864 #: ../src/guestfs-actions.pod:3147 ../src/guestfs-actions.pod:3432
6865 #: ../src/guestfs-actions.pod:3494 ../src/guestfs-actions.pod:3599
6866 #: ../src/guestfs-actions.pod:4004 ../src/guestfs-actions.pod:4702
6867 #: ../src/guestfs-actions.pod:5222 ../src/guestfs-actions.pod:5348
6868 #: ../src/guestfs-actions.pod:5462 ../src/guestfs-actions.pod:6158
6869 #: ../src/guestfs-actions.pod:6219 ../src/guestfs-actions.pod:6274
6870 #: ../src/guestfs-actions.pod:6420 ../src/guestfs-actions.pod:6444
6871 #: ../src/guestfs-actions.pod:6926 ../src/guestfs-actions.pod:6946
6872 #: ../src/guestfs-actions.pod:6993 ../src/guestfs-actions.pod:7158
6873 #: ../src/guestfs-actions.pod:7177 ../src/guestfs-actions.pod:7262
6874 #: ../src/guestfs-actions.pod:7281 ../src/guestfs-actions.pod:7327
6875 #: ../src/guestfs-actions.pod:7346
6877 "This function returns a NULL-terminated array of strings (like L<environ(3)"
6878 ">), or NULL if there was an error. I<The caller must free the strings and "
6879 "the array after use>."
6884 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:998
6885 #: ../src/guestfs-actions.pod:1016 ../src/guestfs-actions.pod:1421
6886 #: ../src/guestfs-actions.pod:3225 ../src/guestfs-actions.pod:3256
6887 #: ../src/guestfs-actions.pod:3845 ../src/guestfs-actions.pod:3895
6888 #: ../src/guestfs-actions.pod:4082 ../src/guestfs-actions.pod:4115
6889 #: ../src/guestfs-actions.pod:4278 ../src/guestfs-actions.pod:4706
6890 #: ../src/guestfs-actions.pod:5163 ../src/guestfs-actions.pod:5558
6891 #: ../src/guestfs-actions.pod:5572 ../src/guestfs-actions.pod:5584
6892 #: ../src/guestfs-actions.pod:6020 ../src/guestfs-actions.pod:6658
6893 #: ../src/guestfs-actions.pod:6671 ../src/guestfs-actions.pod:6910
6894 #: ../src/guestfs-actions.pod:7146
6895 msgid "(Added in 0.8)"
6900 #: ../src/guestfs-actions.pod:469
6901 msgid "guestfs_aug_match"
6906 #: ../src/guestfs-actions.pod:471
6910 " guestfs_aug_match (guestfs_h *g,\n"
6911 " const char *augpath);\n"
6917 #: ../src/guestfs-actions.pod:475 ../fish/guestfish-actions.pod:311
6919 "Returns a list of paths which match the path expression C<path>. The "
6920 "returned paths are sufficiently qualified so that they match exactly one "
6921 "node in the current tree."
6926 #: ../src/guestfs-actions.pod:485
6927 msgid "guestfs_aug_mv"
6932 #: ../src/guestfs-actions.pod:487
6936 " guestfs_aug_mv (guestfs_h *g,\n"
6937 " const char *src,\n"
6938 " const char *dest);\n"
6944 #: ../src/guestfs-actions.pod:492 ../fish/guestfish-actions.pod:319
6946 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6947 "C<dest> is overwritten if it exists."
6952 #: ../src/guestfs-actions.pod:499
6953 msgid "guestfs_aug_rm"
6958 #: ../src/guestfs-actions.pod:501
6962 " guestfs_aug_rm (guestfs_h *g,\n"
6963 " const char *augpath);\n"
6969 #: ../src/guestfs-actions.pod:505 ../fish/guestfish-actions.pod:326
6970 msgid "Remove C<path> and all of its children."
6975 #: ../src/guestfs-actions.pod:507 ../fish/guestfish-actions.pod:328
6976 msgid "On success this returns the number of entries which were removed."
6981 #: ../src/guestfs-actions.pod:513
6982 msgid "guestfs_aug_save"
6987 #: ../src/guestfs-actions.pod:515
6991 " guestfs_aug_save (guestfs_h *g);\n"
6997 #: ../src/guestfs-actions.pod:518 ../fish/guestfish-actions.pod:334
6998 msgid "This writes all pending changes to disk."
7003 #: ../src/guestfs-actions.pod:520
7005 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
7011 #: ../src/guestfs-actions.pod:527
7012 msgid "guestfs_aug_set"
7017 #: ../src/guestfs-actions.pod:529
7021 " guestfs_aug_set (guestfs_h *g,\n"
7022 " const char *augpath,\n"
7023 " const char *val);\n"
7029 #: ../src/guestfs-actions.pod:534 ../fish/guestfish-actions.pod:343
7030 msgid "Set the value associated with C<path> to C<val>."
7035 #: ../src/guestfs-actions.pod:536
7037 "In the Augeas API, it is possible to clear a node by setting the value to "
7038 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
7039 "this call. Instead you must use the C<guestfs_aug_clear> call."
7044 #: ../src/guestfs-actions.pod:545
7045 msgid "guestfs_available"
7050 #: ../src/guestfs-actions.pod:547
7054 " guestfs_available (guestfs_h *g,\n"
7055 " char *const *groups);\n"
7061 #: ../src/guestfs-actions.pod:551 ../fish/guestfish-actions.pod:354
7063 "This command is used to check the availability of some groups of "
7064 "functionality in the appliance, which not all builds of the libguestfs "
7065 "appliance will be able to provide."
7070 #: ../src/guestfs-actions.pod:555
7072 "The libguestfs groups, and the functions that those groups correspond to, "
7073 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
7074 "runtime by calling C<guestfs_available_all_groups>."
7079 #: ../src/guestfs-actions.pod:560 ../fish/guestfish-actions.pod:363
7081 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
7082 "\"]> would check for the availability of the Linux inotify functions and "
7083 "Augeas (configuration file editing) functions."
7088 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:368
7089 msgid "The command returns no error if I<all> requested groups are available."
7094 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:370
7096 "It fails with an error if one or more of the requested groups is unavailable "
7102 #: ../src/guestfs-actions.pod:570 ../fish/guestfish-actions.pod:373
7104 "If an unknown group name is included in the list of groups then an error is "
7110 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:376
7116 #: ../src/guestfs-actions.pod:579
7117 msgid "You must call C<guestfs_launch> before calling this function."
7122 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:384
7124 "The reason is because we don't know what groups are supported by the "
7125 "appliance/daemon until it is running and can be queried."
7130 #: ../src/guestfs-actions.pod:587 ../fish/guestfish-actions.pod:390
7132 "If a group of functions is available, this does not necessarily mean that "
7133 "they will work. You still have to check for errors when calling individual "
7134 "API functions even if they are available."
7139 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:397
7141 "It is usually the job of distro packagers to build complete functionality "
7142 "into the libguestfs appliance. Upstream libguestfs, if built from source "
7143 "with all requirements satisfied, will support everything."
7148 #: ../src/guestfs-actions.pod:601
7150 "This call was added in version C<1.0.80>. In previous versions of "
7151 "libguestfs all you could do would be to speculatively execute a command to "
7152 "find out if the daemon implemented it. See also C<guestfs_version>."
7157 #: ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1171
7158 msgid "(Added in 1.0.80)"
7163 #: ../src/guestfs-actions.pod:612
7164 msgid "guestfs_available_all_groups"
7169 #: ../src/guestfs-actions.pod:614
7173 " guestfs_available_all_groups (guestfs_h *g);\n"
7179 #: ../src/guestfs-actions.pod:617
7181 "This command returns a list of all optional groups that this daemon knows "
7182 "about. Note this returns both supported and unsupported groups. To find "
7183 "out which ones the daemon can actually support you have to call "
7184 "C<guestfs_available> on each member of the returned list."
7189 #: ../src/guestfs-actions.pod:623
7190 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
7195 #: ../src/guestfs-actions.pod:629
7196 msgid "(Added in 1.3.15)"
7201 #: ../src/guestfs-actions.pod:631
7202 msgid "guestfs_base64_in"
7207 #: ../src/guestfs-actions.pod:633
7211 " guestfs_base64_in (guestfs_h *g,\n"
7212 " const char *base64file,\n"
7213 " const char *filename);\n"
7219 #: ../src/guestfs-actions.pod:638 ../fish/guestfish-actions.pod:427
7221 "This command uploads base64-encoded data from C<base64file> to C<filename>."
7226 #: ../src/guestfs-actions.pod:643 ../src/guestfs-actions.pod:657
7227 msgid "(Added in 1.3.5)"
7232 #: ../src/guestfs-actions.pod:645
7233 msgid "guestfs_base64_out"
7238 #: ../src/guestfs-actions.pod:647
7242 " guestfs_base64_out (guestfs_h *g,\n"
7243 " const char *filename,\n"
7244 " const char *base64file);\n"
7250 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:436
7252 "This command downloads the contents of C<filename>, writing it out to local "
7253 "file C<base64file> encoded as base64."
7258 #: ../src/guestfs-actions.pod:659
7259 msgid "guestfs_blockdev_flushbufs"
7264 #: ../src/guestfs-actions.pod:661
7268 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
7269 " const char *device);\n"
7275 #: ../src/guestfs-actions.pod:665 ../fish/guestfish-actions.pod:445
7277 "This tells the kernel to flush internal buffers associated with C<device>."
7282 #: ../src/guestfs-actions.pod:668 ../src/guestfs-actions.pod:685
7283 #: ../src/guestfs-actions.pod:700 ../src/guestfs-actions.pod:716
7284 #: ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:753
7285 #: ../src/guestfs-actions.pod:767 ../src/guestfs-actions.pod:785
7286 #: ../src/guestfs-actions.pod:799 ../src/guestfs-actions.pod:813
7287 #: ../fish/guestfish-actions.pod:448 ../fish/guestfish-actions.pod:459
7288 #: ../fish/guestfish-actions.pod:468 ../fish/guestfish-actions.pod:478
7289 #: ../fish/guestfish-actions.pod:490 ../fish/guestfish-actions.pod:503
7290 #: ../fish/guestfish-actions.pod:511 ../fish/guestfish-actions.pod:522
7291 #: ../fish/guestfish-actions.pod:530 ../fish/guestfish-actions.pod:538
7292 msgid "This uses the L<blockdev(8)> command."
7297 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:689
7298 #: ../src/guestfs-actions.pod:704 ../src/guestfs-actions.pod:720
7299 #: ../src/guestfs-actions.pod:738 ../src/guestfs-actions.pod:757
7300 #: ../src/guestfs-actions.pod:771 ../src/guestfs-actions.pod:789
7301 #: ../src/guestfs-actions.pod:803 ../src/guestfs-actions.pod:817
7302 msgid "(Added in 0.9.3)"
7307 #: ../src/guestfs-actions.pod:674
7308 msgid "guestfs_blockdev_getbsz"
7313 #: ../src/guestfs-actions.pod:676
7317 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
7318 " const char *device);\n"
7324 #: ../src/guestfs-actions.pod:680 ../fish/guestfish-actions.pod:454
7325 msgid "This returns the block size of a device."
7330 #: ../src/guestfs-actions.pod:682 ../src/guestfs-actions.pod:782
7331 #: ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:519
7333 "(Note this is different from both I<size in blocks> and I<filesystem block "
7339 #: ../src/guestfs-actions.pod:691
7340 msgid "guestfs_blockdev_getro"
7345 #: ../src/guestfs-actions.pod:693
7349 " guestfs_blockdev_getro (guestfs_h *g,\n"
7350 " const char *device);\n"
7356 #: ../src/guestfs-actions.pod:697 ../fish/guestfish-actions.pod:465
7358 "Returns a boolean indicating if the block device is read-only (true if read-"
7359 "only, false if not)."
7364 #: ../src/guestfs-actions.pod:702 ../src/guestfs-actions.pod:1404
7365 #: ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1909
7366 #: ../src/guestfs-actions.pod:1920 ../src/guestfs-actions.pod:1992
7367 #: ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2062
7368 #: ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2110
7369 #: ../src/guestfs-actions.pod:2965 ../src/guestfs-actions.pod:2982
7370 #: ../src/guestfs-actions.pod:3001 ../src/guestfs-actions.pod:3164
7371 #: ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3193
7372 #: ../src/guestfs-actions.pod:3207 ../src/guestfs-actions.pod:3223
7373 #: ../src/guestfs-actions.pod:3238 ../src/guestfs-actions.pod:3254
7374 #: ../src/guestfs-actions.pod:3268 ../src/guestfs-actions.pod:3281
7375 #: ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3310
7376 #: ../src/guestfs-actions.pod:3325 ../src/guestfs-actions.pod:4851
7377 msgid "This function returns a C truth value on success or -1 on error."
7382 #: ../src/guestfs-actions.pod:706
7383 msgid "guestfs_blockdev_getsize64"
7388 #: ../src/guestfs-actions.pod:708
7392 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
7393 " const char *device);\n"
7399 #: ../src/guestfs-actions.pod:712 ../fish/guestfish-actions.pod:474
7400 msgid "This returns the size of the device in bytes."
7405 #: ../src/guestfs-actions.pod:714
7406 msgid "See also C<guestfs_blockdev_getsz>."
7411 #: ../src/guestfs-actions.pod:722
7412 msgid "guestfs_blockdev_getss"
7417 #: ../src/guestfs-actions.pod:724
7421 " guestfs_blockdev_getss (guestfs_h *g,\n"
7422 " const char *device);\n"
7428 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:484
7430 "This returns the size of sectors on a block device. Usually 512, but can be "
7431 "larger for modern devices."
7436 #: ../src/guestfs-actions.pod:731
7438 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
7444 #: ../src/guestfs-actions.pod:740
7445 msgid "guestfs_blockdev_getsz"
7450 #: ../src/guestfs-actions.pod:742
7454 " guestfs_blockdev_getsz (guestfs_h *g,\n"
7455 " const char *device);\n"
7461 #: ../src/guestfs-actions.pod:746 ../fish/guestfish-actions.pod:496
7463 "This returns the size of the device in units of 512-byte sectors (even if "
7464 "the sectorsize isn't 512 bytes ... weird)."
7469 #: ../src/guestfs-actions.pod:749
7471 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
7472 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
7477 #: ../src/guestfs-actions.pod:759
7478 msgid "guestfs_blockdev_rereadpt"
7483 #: ../src/guestfs-actions.pod:761
7487 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
7488 " const char *device);\n"
7494 #: ../src/guestfs-actions.pod:765 ../fish/guestfish-actions.pod:509
7495 msgid "Reread the partition table on C<device>."
7500 #: ../src/guestfs-actions.pod:773
7501 msgid "guestfs_blockdev_setbsz"
7506 #: ../src/guestfs-actions.pod:775
7510 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
7511 " const char *device,\n"
7512 " int blocksize);\n"
7518 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:517
7519 msgid "This sets the block size of a device."
7524 #: ../src/guestfs-actions.pod:791
7525 msgid "guestfs_blockdev_setro"
7530 #: ../src/guestfs-actions.pod:793
7534 " guestfs_blockdev_setro (guestfs_h *g,\n"
7535 " const char *device);\n"
7541 #: ../src/guestfs-actions.pod:797 ../fish/guestfish-actions.pod:528
7542 msgid "Sets the block device named C<device> to read-only."
7547 #: ../src/guestfs-actions.pod:805
7548 msgid "guestfs_blockdev_setrw"
7553 #: ../src/guestfs-actions.pod:807
7557 " guestfs_blockdev_setrw (guestfs_h *g,\n"
7558 " const char *device);\n"
7564 #: ../src/guestfs-actions.pod:811 ../fish/guestfish-actions.pod:536
7565 msgid "Sets the block device named C<device> to read-write."
7570 #: ../src/guestfs-actions.pod:819
7571 msgid "guestfs_case_sensitive_path"
7576 #: ../src/guestfs-actions.pod:821
7580 " guestfs_case_sensitive_path (guestfs_h *g,\n"
7581 " const char *path);\n"
7587 #: ../src/guestfs-actions.pod:825 ../fish/guestfish-actions.pod:544
7589 "This can be used to resolve case insensitive paths on a filesystem which is "
7590 "case sensitive. The use case is to resolve paths which you have read from "
7591 "Windows configuration files or the Windows Registry, to the true path."
7596 #: ../src/guestfs-actions.pod:830 ../fish/guestfish-actions.pod:549
7598 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7599 "(and probably others), which is that although the underlying filesystem is "
7600 "case-insensitive, the driver exports the filesystem to Linux as case-"
7606 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:554
7608 "One consequence of this is that special directories such as C<c:\\windows> "
7609 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7610 "precise details of how they were created. In Windows itself this would not "
7616 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:560
7618 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
7624 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:563
7626 "This function resolves the true case of each element in the path and returns "
7627 "the case-sensitive path."
7632 #: ../src/guestfs-actions.pod:847
7634 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
7635 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
7636 "how the directories were originally created under Windows)."
7641 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:571
7642 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7647 #: ../src/guestfs-actions.pod:855
7648 msgid "See also C<guestfs_realpath>."
7653 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:6838
7654 msgid "(Added in 1.0.75)"
7659 #: ../src/guestfs-actions.pod:862
7665 #: ../src/guestfs-actions.pod:864
7669 " guestfs_cat (guestfs_h *g,\n"
7670 " const char *path);\n"
7676 #: ../src/guestfs-actions.pod:868 ../src/guestfs-actions.pod:5338
7677 #: ../fish/guestfish-actions.pod:580 ../fish/guestfish-actions.pod:3567
7678 msgid "Return the contents of the file named C<path>."
7683 #: ../src/guestfs-actions.pod:870
7685 "Note that this function cannot correctly handle binary files (specifically, "
7686 "files containing C<\\0> character which is treated as end of string). For "
7687 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
7688 "functions which have a more complex interface."
7693 #: ../src/guestfs-actions.pod:878 ../src/guestfs-actions.pod:1057
7694 #: ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:1368
7695 #: ../src/guestfs-actions.pod:1387 ../src/guestfs-actions.pod:1490
7696 #: ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:1758
7697 #: ../src/guestfs-actions.pod:2216 ../src/guestfs-actions.pod:2235
7698 #: ../src/guestfs-actions.pod:2278 ../src/guestfs-actions.pod:2302
7699 #: ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:2348
7700 #: ../src/guestfs-actions.pod:5120 ../src/guestfs-actions.pod:5146
7701 #: ../src/guestfs-actions.pod:5277 ../src/guestfs-actions.pod:5303
7702 #: ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:6223
7703 #: ../src/guestfs-actions.pod:6278 ../src/guestfs-actions.pod:6424
7704 #: ../src/guestfs-actions.pod:6448 ../src/guestfs-actions.pod:7110
7705 #: ../src/guestfs-actions.pod:7136 ../src/guestfs-actions.pod:7162
7706 #: ../src/guestfs-actions.pod:7181 ../src/guestfs-actions.pod:7266
7707 #: ../src/guestfs-actions.pod:7285 ../src/guestfs-actions.pod:7331
7708 #: ../src/guestfs-actions.pod:7350 ../fish/guestfish-actions.pod:587
7709 #: ../fish/guestfish-actions.pod:722 ../fish/guestfish-actions.pod:734
7710 #: ../fish/guestfish-actions.pod:910 ../fish/guestfish-actions.pod:920
7711 #: ../fish/guestfish-actions.pod:987 ../fish/guestfish-actions.pod:997
7712 #: ../fish/guestfish-actions.pod:1192 ../fish/guestfish-actions.pod:1493
7713 #: ../fish/guestfish-actions.pod:1503 ../fish/guestfish-actions.pod:1531
7714 #: ../fish/guestfish-actions.pod:1546 ../fish/guestfish-actions.pod:1556
7715 #: ../fish/guestfish-actions.pod:1575 ../fish/guestfish-actions.pod:3437
7716 #: ../fish/guestfish-actions.pod:3452 ../fish/guestfish-actions.pod:3528
7717 #: ../fish/guestfish-actions.pod:3545 ../fish/guestfish-actions.pod:3560
7718 #: ../fish/guestfish-actions.pod:4182 ../fish/guestfish-actions.pod:4228
7719 #: ../fish/guestfish-actions.pod:4313 ../fish/guestfish-actions.pod:4328
7720 #: ../fish/guestfish-actions.pod:4738 ../fish/guestfish-actions.pod:4756
7721 #: ../fish/guestfish-actions.pod:4773 ../fish/guestfish-actions.pod:4783
7722 #: ../fish/guestfish-actions.pod:4831 ../fish/guestfish-actions.pod:4841
7723 #: ../fish/guestfish-actions.pod:4870 ../fish/guestfish-actions.pod:4880
7725 "Because of the message protocol, there is a transfer limit of somewhere "
7726 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7731 #: ../src/guestfs-actions.pod:881 ../src/guestfs-actions.pod:3436
7732 #: ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3515
7733 #: ../src/guestfs-actions.pod:3603 ../src/guestfs-actions.pod:4008
7734 #: ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:5226
7735 #: ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:6997
7736 #: ../src/guestfs-actions.pod:7011
7737 msgid "(Added in 0.4)"
7742 #: ../src/guestfs-actions.pod:883
7743 msgid "guestfs_checksum"
7748 #: ../src/guestfs-actions.pod:885
7752 " guestfs_checksum (guestfs_h *g,\n"
7753 " const char *csumtype,\n"
7754 " const char *path);\n"
7760 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:594
7762 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7767 #: ../src/guestfs-actions.pod:893 ../fish/guestfish-actions.pod:597
7769 "The type of checksum to compute is given by the C<csumtype> parameter which "
7770 "must have one of the following values:"
7775 #: ../src/guestfs-actions.pod:898 ../fish/guestfish-actions.pod:602
7781 #: ../src/guestfs-actions.pod:900 ../fish/guestfish-actions.pod:604
7783 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7789 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:607
7795 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:609
7796 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7801 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:611
7807 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:613
7808 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7813 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:615
7819 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:617
7820 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7825 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:619
7831 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:621
7832 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7837 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:623
7843 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:625
7844 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7849 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:627
7855 #: ../src/guestfs-actions.pod:925 ../fish/guestfish-actions.pod:629
7856 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7861 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:633
7862 msgid "The checksum is returned as a printable string."
7867 #: ../src/guestfs-actions.pod:931
7868 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
7873 #: ../src/guestfs-actions.pod:933
7874 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
7879 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:1246
7880 #: ../src/guestfs-actions.pod:2078 ../src/guestfs-actions.pod:3180
7881 #: ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3270
7882 #: ../src/guestfs-actions.pod:3297 ../src/guestfs-actions.pod:6694
7883 msgid "(Added in 1.0.2)"
7888 #: ../src/guestfs-actions.pod:940
7889 msgid "guestfs_checksum_device"
7894 #: ../src/guestfs-actions.pod:942
7898 " guestfs_checksum_device (guestfs_h *g,\n"
7899 " const char *csumtype,\n"
7900 " const char *device);\n"
7906 #: ../src/guestfs-actions.pod:947
7908 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7909 "device named C<device>. For the types of checksums supported see the "
7910 "C<guestfs_checksum> command."
7915 #: ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:4757
7916 #: ../src/guestfs-actions.pod:4816 ../src/guestfs-actions.pod:4853
7917 #: ../src/guestfs-actions.pod:4871 ../src/guestfs-actions.pod:5047
7918 #: ../src/guestfs-actions.pod:6603 ../src/guestfs-actions.pod:6617
7919 #: ../src/guestfs-actions.pod:7023
7920 msgid "(Added in 1.3.2)"
7925 #: ../src/guestfs-actions.pod:956
7926 msgid "guestfs_checksums_out"
7931 #: ../src/guestfs-actions.pod:958
7935 " guestfs_checksums_out (guestfs_h *g,\n"
7936 " const char *csumtype,\n"
7937 " const char *directory,\n"
7938 " const char *sumsfile);\n"
7944 #: ../src/guestfs-actions.pod:964 ../fish/guestfish-actions.pod:651
7946 "This command computes the checksums of all regular files in C<directory> and "
7947 "then emits a list of those checksums to the local output file C<sumsfile>."
7952 #: ../src/guestfs-actions.pod:968 ../fish/guestfish-actions.pod:655
7954 "This can be used for verifying the integrity of a virtual machine. However "
7955 "to be properly secure you should pay attention to the output of the checksum "
7956 "command (it uses the ones from GNU coreutils). In particular when the "
7957 "filename is not printable, coreutils uses a special backslash syntax. For "
7958 "more information, see the GNU coreutils info file."
7963 #: ../src/guestfs-actions.pod:978
7964 msgid "(Added in 1.3.7)"
7969 #: ../src/guestfs-actions.pod:980
7970 msgid "guestfs_chmod"
7975 #: ../src/guestfs-actions.pod:982
7979 " guestfs_chmod (guestfs_h *g,\n"
7981 " const char *path);\n"
7987 #: ../src/guestfs-actions.pod:987 ../fish/guestfish-actions.pod:669
7989 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7995 #: ../src/guestfs-actions.pod:990 ../fish/guestfish-actions.pod:672
7997 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7998 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
8004 #: ../src/guestfs-actions.pod:994 ../src/guestfs-actions.pod:4259
8005 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:4475
8006 #: ../src/guestfs-actions.pod:4494 ../fish/guestfish-actions.pod:676
8007 #: ../fish/guestfish-actions.pod:2883 ../fish/guestfish-actions.pod:3012
8008 #: ../fish/guestfish-actions.pod:3022 ../fish/guestfish-actions.pod:3032
8009 msgid "The mode actually set is affected by the umask."
8014 #: ../src/guestfs-actions.pod:1000
8015 msgid "guestfs_chown"
8020 #: ../src/guestfs-actions.pod:1002
8024 " guestfs_chown (guestfs_h *g,\n"
8027 " const char *path);\n"
8033 #: ../src/guestfs-actions.pod:1008 ../fish/guestfish-actions.pod:682
8034 msgid "Change the file owner to C<owner> and group to C<group>."
8039 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:3367
8040 #: ../fish/guestfish-actions.pod:684 ../fish/guestfish-actions.pod:2341
8042 "Only numeric uid and gid are supported. If you want to use names, you will "
8043 "need to locate and parse the password file yourself (Augeas support makes "
8044 "this relatively easy)."
8049 #: ../src/guestfs-actions.pod:1018
8050 msgid "guestfs_command"
8055 #: ../src/guestfs-actions.pod:1020
8059 " guestfs_command (guestfs_h *g,\n"
8060 " char *const *arguments);\n"
8066 #: ../src/guestfs-actions.pod:1024 ../fish/guestfish-actions.pod:692
8068 "This call runs a command from the guest filesystem. The filesystem must be "
8069 "mounted, and must contain a compatible operating system (ie. something "
8070 "Linux, with the same or compatible processor architecture)."
8075 #: ../src/guestfs-actions.pod:1029
8077 "The single parameter is an argv-style list of arguments. The first element "
8078 "is the name of the program to run. Subsequent elements are parameters. The "
8079 "list must be non-empty (ie. must contain a program name). Note that the "
8080 "command runs directly, and is I<not> invoked via the shell (see "
8086 #: ../src/guestfs-actions.pod:1036 ../fish/guestfish-actions.pod:704
8087 msgid "The return value is anything printed to I<stdout> by the command."
8092 #: ../src/guestfs-actions.pod:1039 ../fish/guestfish-actions.pod:707
8094 "If the command returns a non-zero exit status, then this function returns an "
8095 "error message. The error message string is the content of I<stderr> from "
8101 #: ../src/guestfs-actions.pod:1043 ../fish/guestfish-actions.pod:711
8103 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
8104 "bin>. If you require a program from another location, you should provide "
8105 "the full path in the first parameter."
8110 #: ../src/guestfs-actions.pod:1048 ../fish/guestfish-actions.pod:716
8112 "Shared libraries and data files required by the program must be available on "
8113 "filesystems which are mounted in the correct places. It is the caller's "
8114 "responsibility to ensure all filesystems that are needed are mounted at the "
8120 #: ../src/guestfs-actions.pod:1060 ../src/guestfs-actions.pod:1080
8121 #: ../src/guestfs-actions.pod:1543
8122 msgid "(Added in 0.9.1)"
8127 #: ../src/guestfs-actions.pod:1062
8128 msgid "guestfs_command_lines"
8133 #: ../src/guestfs-actions.pod:1064
8137 " guestfs_command_lines (guestfs_h *g,\n"
8138 " char *const *arguments);\n"
8144 #: ../src/guestfs-actions.pod:1068
8146 "This is the same as C<guestfs_command>, but splits the result into a list of "
8152 #: ../src/guestfs-actions.pod:1071
8153 msgid "See also: C<guestfs_sh_lines>"
8158 #: ../src/guestfs-actions.pod:1082
8159 msgid "guestfs_config"
8164 #: ../src/guestfs-actions.pod:1084
8168 " guestfs_config (guestfs_h *g,\n"
8169 " const char *qemuparam,\n"
8170 " const char *qemuvalue);\n"
8176 #: ../src/guestfs-actions.pod:1089 ../fish/guestfish-actions.pod:741
8178 "This can be used to add arbitrary qemu command line parameters of the form "
8179 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
8180 "setting some parameters which would interfere with parameters that we use."
8185 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:746
8186 msgid "The first character of C<param> string must be a C<-> (dash)."
8191 #: ../src/guestfs-actions.pod:1096 ../fish/guestfish-actions.pod:748
8192 msgid "C<value> can be NULL."
8197 #: ../src/guestfs-actions.pod:1102
8198 msgid "guestfs_copy_size"
8203 #: ../src/guestfs-actions.pod:1104
8207 " guestfs_copy_size (guestfs_h *g,\n"
8208 " const char *src,\n"
8209 " const char *dest,\n"
8216 #: ../src/guestfs-actions.pod:1110 ../fish/guestfish-actions.pod:754
8218 "This command copies exactly C<size> bytes from one source device or file "
8219 "C<src> to another destination device or file C<dest>."
8224 #: ../src/guestfs-actions.pod:1113 ../fish/guestfish-actions.pod:757
8226 "Note this will fail if the source is too short or if the destination is not "
8232 #: ../src/guestfs-actions.pod:1118 ../src/guestfs-actions.pod:1241
8233 #: ../src/guestfs-actions.pod:1272 ../src/guestfs-actions.pod:1692
8234 #: ../src/guestfs-actions.pod:1714 ../src/guestfs-actions.pod:6689
8235 #: ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:7202
8236 #: ../src/guestfs-actions.pod:7221
8238 "This long-running command can generate progress notification messages so "
8239 "that the caller can display a progress bar or indicator. To receive these "
8240 "messages, the caller must register a progress callback. See L<guestfs(3)/"
8241 "guestfs_set_progress_callback>."
8246 #: ../src/guestfs-actions.pod:1123 ../src/guestfs-actions.pod:4035
8247 #: ../src/guestfs-actions.pod:5253 ../src/guestfs-actions.pod:6930
8248 #: ../src/guestfs-actions.pod:6950 ../src/guestfs-actions.pod:7036
8249 msgid "(Added in 1.0.87)"
8254 #: ../src/guestfs-actions.pod:1125
8260 #: ../src/guestfs-actions.pod:1127
8264 " guestfs_cp (guestfs_h *g,\n"
8265 " const char *src,\n"
8266 " const char *dest);\n"
8272 #: ../src/guestfs-actions.pod:1132 ../fish/guestfish-actions.pod:764
8274 "This copies a file from C<src> to C<dest> where C<dest> is either a "
8275 "destination filename or destination directory."
8280 #: ../src/guestfs-actions.pod:1137 ../src/guestfs-actions.pod:1151
8281 #: ../src/guestfs-actions.pod:1223 ../src/guestfs-actions.pod:1297
8282 #: ../src/guestfs-actions.pod:1406 ../src/guestfs-actions.pod:4720
8283 #: ../src/guestfs-actions.pod:5097
8284 msgid "(Added in 1.0.18)"
8289 #: ../src/guestfs-actions.pod:1139
8290 msgid "guestfs_cp_a"
8295 #: ../src/guestfs-actions.pod:1141
8299 " guestfs_cp_a (guestfs_h *g,\n"
8300 " const char *src,\n"
8301 " const char *dest);\n"
8307 #: ../src/guestfs-actions.pod:1146 ../fish/guestfish-actions.pod:771
8309 "This copies a file or directory from C<src> to C<dest> recursively using the "
8315 #: ../src/guestfs-actions.pod:1153
8321 #: ../src/guestfs-actions.pod:1155
8325 " guestfs_dd (guestfs_h *g,\n"
8326 " const char *src,\n"
8327 " const char *dest);\n"
8333 #: ../src/guestfs-actions.pod:1160 ../fish/guestfish-actions.pod:778
8335 "This command copies from one source device or file C<src> to another "
8336 "destination device or file C<dest>. Normally you would use this to copy to "
8337 "or from a device or partition, for example to duplicate a filesystem."
8342 #: ../src/guestfs-actions.pod:1165
8344 "If the destination is a device, it must be as large or larger than the "
8345 "source file or device, otherwise the copy will fail. This command cannot do "
8346 "partial copies (see C<guestfs_copy_size>)."
8351 #: ../src/guestfs-actions.pod:1173
8357 #: ../src/guestfs-actions.pod:1175
8361 " guestfs_df (guestfs_h *g);\n"
8367 #: ../src/guestfs-actions.pod:1178 ../fish/guestfish-actions.pod:791
8368 msgid "This command runs the C<df> command to report disk space used."
8373 #: ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1197
8375 "This command is mostly useful for interactive sessions. It is I<not> "
8376 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
8382 #: ../src/guestfs-actions.pod:1187 ../src/guestfs-actions.pod:1204
8383 #: ../src/guestfs-actions.pod:1317 ../src/guestfs-actions.pod:2281
8384 #: ../src/guestfs-actions.pod:2305 ../src/guestfs-actions.pod:2373
8385 #: ../src/guestfs-actions.pod:4145 ../src/guestfs-actions.pod:4620
8386 #: ../src/guestfs-actions.pod:6427 ../src/guestfs-actions.pod:6451
8387 #: ../src/guestfs-actions.pod:7069 ../src/guestfs-actions.pod:7082
8388 #: ../src/guestfs-actions.pod:7095
8389 msgid "(Added in 1.0.54)"
8394 #: ../src/guestfs-actions.pod:1189
8395 msgid "guestfs_df_h"
8400 #: ../src/guestfs-actions.pod:1191
8404 " guestfs_df_h (guestfs_h *g);\n"
8410 #: ../src/guestfs-actions.pod:1194 ../fish/guestfish-actions.pod:801
8412 "This command runs the C<df -h> command to report disk space used in human-"
8418 #: ../src/guestfs-actions.pod:1206
8419 msgid "guestfs_dmesg"
8424 #: ../src/guestfs-actions.pod:1208
8428 " guestfs_dmesg (guestfs_h *g);\n"
8434 #: ../src/guestfs-actions.pod:1211 ../fish/guestfish-actions.pod:812
8436 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
8437 "This is sometimes useful for extended debugging of problems."
8442 #: ../src/guestfs-actions.pod:1215
8444 "Another way to get the same information is to enable verbose messages with "
8445 "C<guestfs_set_verbose> or by setting the environment variable "
8446 "C<LIBGUESTFS_DEBUG=1> before running the program."
8451 #: ../src/guestfs-actions.pod:1225
8452 msgid "guestfs_download"
8457 #: ../src/guestfs-actions.pod:1227
8461 " guestfs_download (guestfs_h *g,\n"
8462 " const char *remotefilename,\n"
8463 " const char *filename);\n"
8469 #: ../src/guestfs-actions.pod:1232 ../src/guestfs-actions.pod:1257
8470 #: ../fish/guestfish-actions.pod:825 ../fish/guestfish-actions.pod:838
8472 "Download file C<remotefilename> and save it as C<filename> on the local "
8478 #: ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:6683
8479 #: ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:4486
8480 msgid "C<filename> can also be a named pipe."
8485 #: ../src/guestfs-actions.pod:1237
8486 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
8491 #: ../src/guestfs-actions.pod:1248
8492 msgid "guestfs_download_offset"
8497 #: ../src/guestfs-actions.pod:1250
8501 " guestfs_download_offset (guestfs_h *g,\n"
8502 " const char *remotefilename,\n"
8503 " const char *filename,\n"
8504 " int64_t offset,\n"
8511 #: ../src/guestfs-actions.pod:1260 ../fish/guestfish-actions.pod:841
8513 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
8514 "region must be within the file or device)."
8519 #: ../src/guestfs-actions.pod:1263
8521 "Note that there is no limit on the amount of data that can be downloaded "
8522 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
8523 "full amount unless an error occurs."
8528 #: ../src/guestfs-actions.pod:1268
8529 msgid "See also C<guestfs_download>, C<guestfs_pread>."
8534 #: ../src/guestfs-actions.pod:1277 ../src/guestfs-actions.pod:6728
8535 msgid "(Added in 1.5.17)"
8540 #: ../src/guestfs-actions.pod:1279
8541 msgid "guestfs_drop_caches"
8546 #: ../src/guestfs-actions.pod:1281
8550 " guestfs_drop_caches (guestfs_h *g,\n"
8551 " int whattodrop);\n"
8557 #: ../src/guestfs-actions.pod:1285 ../fish/guestfish-actions.pod:857
8559 "This instructs the guest kernel to drop its page cache, and/or dentries and "
8560 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
8561 "to drop, see L<http://linux-mm.org/Drop_Caches>"
8566 #: ../src/guestfs-actions.pod:1290 ../fish/guestfish-actions.pod:862
8567 msgid "Setting C<whattodrop> to 3 should drop everything."
8572 #: ../src/guestfs-actions.pod:1292 ../fish/guestfish-actions.pod:864
8574 "This automatically calls L<sync(2)> before the operation, so that the "
8575 "maximum guest memory is freed."
8580 #: ../src/guestfs-actions.pod:1299
8586 #: ../src/guestfs-actions.pod:1301
8590 " guestfs_du (guestfs_h *g,\n"
8591 " const char *path);\n"
8597 #: ../src/guestfs-actions.pod:1305 ../fish/guestfish-actions.pod:871
8599 "This command runs the C<du -s> command to estimate file space usage for "
8605 #: ../src/guestfs-actions.pod:1308 ../fish/guestfish-actions.pod:874
8607 "C<path> can be a file or a directory. If C<path> is a directory then the "
8608 "estimate includes the contents of the directory and all subdirectories "
8614 #: ../src/guestfs-actions.pod:1312 ../fish/guestfish-actions.pod:878
8616 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
8621 #: ../src/guestfs-actions.pod:1319
8622 msgid "guestfs_e2fsck_f"
8627 #: ../src/guestfs-actions.pod:1321
8631 " guestfs_e2fsck_f (guestfs_h *g,\n"
8632 " const char *device);\n"
8638 #: ../src/guestfs-actions.pod:1325 ../fish/guestfish-actions.pod:885
8640 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
8641 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
8647 #: ../src/guestfs-actions.pod:1329
8649 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
8650 "Normally you should use C<guestfs_fsck>."
8655 #: ../src/guestfs-actions.pod:1334
8656 msgid "(Added in 1.0.29)"
8661 #: ../src/guestfs-actions.pod:1336
8662 msgid "guestfs_echo_daemon"
8667 #: ../src/guestfs-actions.pod:1338
8671 " guestfs_echo_daemon (guestfs_h *g,\n"
8672 " char *const *words);\n"
8678 #: ../src/guestfs-actions.pod:1342 ../fish/guestfish-actions.pod:896
8680 "This command concatenates the list of C<words> passed with single spaces "
8681 "between them and returns the resulting string."
8686 #: ../src/guestfs-actions.pod:1345 ../fish/guestfish-actions.pod:899
8687 msgid "You can use this command to test the connection through to the daemon."
8692 #: ../src/guestfs-actions.pod:1347
8693 msgid "See also C<guestfs_ping_daemon>."
8698 #: ../src/guestfs-actions.pod:1352 ../src/guestfs-actions.pod:2089
8699 #: ../src/guestfs-actions.pod:5931
8700 msgid "(Added in 1.0.69)"
8705 #: ../src/guestfs-actions.pod:1354
8706 msgid "guestfs_egrep"
8711 #: ../src/guestfs-actions.pod:1356
8715 " guestfs_egrep (guestfs_h *g,\n"
8716 " const char *regex,\n"
8717 " const char *path);\n"
8723 #: ../src/guestfs-actions.pod:1361 ../fish/guestfish-actions.pod:907
8725 "This calls the external C<egrep> program and returns the matching lines."
8730 #: ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1390
8731 #: ../src/guestfs-actions.pod:1447 ../src/guestfs-actions.pod:1493
8732 #: ../src/guestfs-actions.pod:1512 ../src/guestfs-actions.pod:2219
8733 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2394
8734 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:2422
8735 #: ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2490
8736 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:3528
8737 #: ../src/guestfs-actions.pod:3542 ../src/guestfs-actions.pod:3555
8738 #: ../src/guestfs-actions.pod:3569 ../src/guestfs-actions.pod:4555
8739 #: ../src/guestfs-actions.pod:5431 ../src/guestfs-actions.pod:5480
8740 #: ../src/guestfs-actions.pod:6295 ../src/guestfs-actions.pod:6307
8741 #: ../src/guestfs-actions.pod:6320 ../src/guestfs-actions.pod:6333
8742 #: ../src/guestfs-actions.pod:6355 ../src/guestfs-actions.pod:6368
8743 #: ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6394
8744 #: ../src/guestfs-actions.pod:7165 ../src/guestfs-actions.pod:7184
8745 #: ../src/guestfs-actions.pod:7269 ../src/guestfs-actions.pod:7288
8746 #: ../src/guestfs-actions.pod:7334 ../src/guestfs-actions.pod:7353
8747 msgid "(Added in 1.0.66)"
8752 #: ../src/guestfs-actions.pod:1373
8753 msgid "guestfs_egrepi"
8758 #: ../src/guestfs-actions.pod:1375
8762 " guestfs_egrepi (guestfs_h *g,\n"
8763 " const char *regex,\n"
8764 " const char *path);\n"
8770 #: ../src/guestfs-actions.pod:1380 ../fish/guestfish-actions.pod:917
8772 "This calls the external C<egrep -i> program and returns the matching lines."
8777 #: ../src/guestfs-actions.pod:1392
8778 msgid "guestfs_equal"
8783 #: ../src/guestfs-actions.pod:1394
8787 " guestfs_equal (guestfs_h *g,\n"
8788 " const char *file1,\n"
8789 " const char *file2);\n"
8795 #: ../src/guestfs-actions.pod:1399 ../fish/guestfish-actions.pod:927
8797 "This compares the two files C<file1> and C<file2> and returns true if their "
8798 "content is exactly equal, or false otherwise."
8803 #: ../src/guestfs-actions.pod:1402 ../fish/guestfish-actions.pod:930
8804 msgid "The external L<cmp(1)> program is used for the comparison."
8809 #: ../src/guestfs-actions.pod:1408
8810 msgid "guestfs_exists"
8815 #: ../src/guestfs-actions.pod:1410
8819 " guestfs_exists (guestfs_h *g,\n"
8820 " const char *path);\n"
8826 #: ../src/guestfs-actions.pod:1414 ../fish/guestfish-actions.pod:936
8828 "This returns C<true> if and only if there is a file, directory (or anything) "
8829 "with the given C<path> name."
8834 #: ../src/guestfs-actions.pod:1417
8835 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
8840 #: ../src/guestfs-actions.pod:1423
8841 msgid "guestfs_fallocate"
8846 #: ../src/guestfs-actions.pod:1425
8850 " guestfs_fallocate (guestfs_h *g,\n"
8851 " const char *path,\n"
8858 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1456
8859 #: ../fish/guestfish-actions.pod:945 ../fish/guestfish-actions.pod:964
8861 "This command preallocates a file (containing zero bytes) named C<path> of "
8862 "size C<len> bytes. If the file exists already, it is overwritten."
8867 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:949
8869 "Do not confuse this with the guestfish-specific C<alloc> command which "
8870 "allocates a file in the host and attaches it as a device."
8875 #: ../src/guestfs-actions.pod:1440 ../fish/guestfish-actions.pod:953
8877 "This function is deprecated. In new code, use the C<fallocate64> call "
8883 #: ../src/guestfs-actions.pod:1449
8884 msgid "guestfs_fallocate64"
8889 #: ../src/guestfs-actions.pod:1451
8893 " guestfs_fallocate64 (guestfs_h *g,\n"
8894 " const char *path,\n"
8901 #: ../src/guestfs-actions.pod:1460
8903 "Note that this call allocates disk blocks for the file. To create a sparse "
8904 "file use C<guestfs_truncate_size> instead."
8909 #: ../src/guestfs-actions.pod:1463
8911 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
8912 "oversight it only allowed 30 bit lengths to be specified, effectively "
8913 "limiting the maximum size of files created through that call to 1GB."
8918 #: ../src/guestfs-actions.pod:1468 ../fish/guestfish-actions.pod:976
8920 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8921 "commands which create a file in the host and attach it as a device."
8926 #: ../src/guestfs-actions.pod:1474
8927 msgid "(Added in 1.3.17)"
8932 #: ../src/guestfs-actions.pod:1476
8933 msgid "guestfs_fgrep"
8938 #: ../src/guestfs-actions.pod:1478
8942 " guestfs_fgrep (guestfs_h *g,\n"
8943 " const char *pattern,\n"
8944 " const char *path);\n"
8950 #: ../src/guestfs-actions.pod:1483 ../fish/guestfish-actions.pod:984
8952 "This calls the external C<fgrep> program and returns the matching lines."
8957 #: ../src/guestfs-actions.pod:1495
8958 msgid "guestfs_fgrepi"
8963 #: ../src/guestfs-actions.pod:1497
8967 " guestfs_fgrepi (guestfs_h *g,\n"
8968 " const char *pattern,\n"
8969 " const char *path);\n"
8975 #: ../src/guestfs-actions.pod:1502 ../fish/guestfish-actions.pod:994
8977 "This calls the external C<fgrep -i> program and returns the matching lines."
8982 #: ../src/guestfs-actions.pod:1514
8983 msgid "guestfs_file"
8988 #: ../src/guestfs-actions.pod:1516
8992 " guestfs_file (guestfs_h *g,\n"
8993 " const char *path);\n"
8999 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1004
9001 "This call uses the standard L<file(1)> command to determine the type or "
9002 "contents of the file."
9007 #: ../src/guestfs-actions.pod:1523 ../fish/guestfish-actions.pod:1007
9009 "This call will also transparently look inside various types of compressed "
9015 #: ../src/guestfs-actions.pod:1526 ../fish/guestfish-actions.pod:1010
9017 "The exact command which runs is C<file -zb path>. Note in particular that "
9018 "the filename is not prepended to the output (the C<-b> option)."
9023 #: ../src/guestfs-actions.pod:1530
9025 "This command can also be used on C</dev/> devices (and partitions, LV "
9026 "names). You can for example use this to determine if a device contains a "
9027 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
9032 #: ../src/guestfs-actions.pod:1535 ../fish/guestfish-actions.pod:1019
9034 "If the C<path> does not begin with C</dev/> then this command only works for "
9035 "the content of regular files. For other file types (directory, symbolic "
9036 "link etc) it will just return the string C<directory> etc."
9041 #: ../src/guestfs-actions.pod:1545
9042 msgid "guestfs_file_architecture"
9047 #: ../src/guestfs-actions.pod:1547
9051 " guestfs_file_architecture (guestfs_h *g,\n"
9052 " const char *filename);\n"
9058 #: ../src/guestfs-actions.pod:1551 ../fish/guestfish-actions.pod:1028
9060 "This detects the architecture of the binary C<filename>, and returns it if "
9066 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1031
9067 msgid "Currently defined architectures are:"
9072 #: ../src/guestfs-actions.pod:1558 ../fish/guestfish-actions.pod:1035
9078 #: ../src/guestfs-actions.pod:1560 ../fish/guestfish-actions.pod:1037
9080 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
9081 "irrespective of the precise processor requirements of the binary."
9086 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1040
9092 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1042
9093 msgid "64 bit x86-64."
9098 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1044
9104 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1046
9105 msgid "32 bit SPARC."
9110 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1048
9116 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1050
9117 msgid "64 bit SPARC V9 and above."
9122 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1052
9128 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1054
9129 msgid "Intel Itanium."
9134 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1056
9140 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1058
9141 msgid "32 bit Power PC."
9146 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1060
9152 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1062
9153 msgid "64 bit Power PC."
9158 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1066
9159 msgid "Libguestfs may return other architecture strings in future."
9164 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1068
9165 msgid "The function works on at least the following types of files:"
9170 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1074
9171 msgid "many types of Un*x and Linux binary"
9176 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1078
9177 msgid "many types of Un*x and Linux shared library"
9182 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1082
9183 msgid "Windows Win32 and Win64 binaries"
9188 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1086
9189 msgid "Windows Win32 and Win64 DLLs"
9194 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1088
9195 msgid "Win32 binaries and DLLs return C<i386>."
9200 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1090
9201 msgid "Win64 binaries and DLLs return C<x86_64>."
9206 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1094
9207 msgid "Linux kernel modules"
9212 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1098
9213 msgid "Linux new-style initrd images"
9218 #: ../src/guestfs-actions.pod:1625 ../fish/guestfish-actions.pod:1102
9219 msgid "some non-x86 Linux vmlinuz kernels"
9224 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1106
9225 msgid "What it can't do currently:"
9230 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1112
9231 msgid "static libraries (libfoo.a)"
9236 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1116
9237 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
9242 #: ../src/guestfs-actions.pod:1643 ../fish/guestfish-actions.pod:1120
9243 msgid "x86 Linux vmlinuz kernels"
9248 #: ../src/guestfs-actions.pod:1645 ../fish/guestfish-actions.pod:1122
9250 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
9251 "compressed code, and are horribly hard to unpack. If you want to find the "
9252 "architecture of a kernel, use the architecture of the associated initrd or "
9253 "kernel module(s) instead."
9258 #: ../src/guestfs-actions.pod:1655 ../src/guestfs-actions.pod:1818
9259 #: ../src/guestfs-actions.pod:1835 ../src/guestfs-actions.pod:2526
9260 #: ../src/guestfs-actions.pod:2607 ../src/guestfs-actions.pod:2633
9261 #: ../src/guestfs-actions.pod:2721 ../src/guestfs-actions.pod:2742
9262 #: ../src/guestfs-actions.pod:2779 ../src/guestfs-actions.pod:2863
9263 #: ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:3151
9264 #: ../src/guestfs-actions.pod:3283
9265 msgid "(Added in 1.5.3)"
9270 #: ../src/guestfs-actions.pod:1657
9271 msgid "guestfs_filesize"
9276 #: ../src/guestfs-actions.pod:1659
9280 " guestfs_filesize (guestfs_h *g,\n"
9281 " const char *file);\n"
9287 #: ../src/guestfs-actions.pod:1663 ../fish/guestfish-actions.pod:1133
9288 msgid "This command returns the size of C<file> in bytes."
9293 #: ../src/guestfs-actions.pod:1665
9295 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
9296 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
9297 "devices, use C<guestfs_blockdev_getsize64>."
9302 #: ../src/guestfs-actions.pod:1671
9303 msgid "(Added in 1.0.82)"
9308 #: ../src/guestfs-actions.pod:1673
9309 msgid "guestfs_fill"
9314 #: ../src/guestfs-actions.pod:1675
9318 " guestfs_fill (guestfs_h *g,\n"
9321 " const char *path);\n"
9327 #: ../src/guestfs-actions.pod:1681 ../fish/guestfish-actions.pod:1143
9329 "This command creates a new file called C<path>. The initial content of the "
9330 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
9336 #: ../src/guestfs-actions.pod:1685
9338 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
9339 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
9340 "bytes use C<guestfs_fill_pattern>."
9345 #: ../src/guestfs-actions.pod:1697
9346 msgid "(Added in 1.0.79)"
9351 #: ../src/guestfs-actions.pod:1699
9352 msgid "guestfs_fill_pattern"
9357 #: ../src/guestfs-actions.pod:1701
9361 " guestfs_fill_pattern (guestfs_h *g,\n"
9362 " const char *pattern,\n"
9364 " const char *path);\n"
9370 #: ../src/guestfs-actions.pod:1707
9372 "This function is like C<guestfs_fill> except that it creates a new file of "
9373 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
9374 "pattern is truncated if necessary to ensure the length of the file is "
9375 "exactly C<len> bytes."
9380 #: ../src/guestfs-actions.pod:1719
9381 msgid "(Added in 1.3.12)"
9386 #: ../src/guestfs-actions.pod:1721
9387 msgid "guestfs_find"
9392 #: ../src/guestfs-actions.pod:1723
9396 " guestfs_find (guestfs_h *g,\n"
9397 " const char *directory);\n"
9403 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1165
9405 "This command lists out all files and directories, recursively, starting at "
9406 "C<directory>. It is essentially equivalent to running the shell command "
9407 "C<find directory -print> but some post-processing happens on the output, "
9413 #: ../src/guestfs-actions.pod:1732 ../fish/guestfish-actions.pod:1170
9415 "This returns a list of strings I<without any prefix>. Thus if the directory "
9421 #: ../src/guestfs-actions.pod:1735 ../fish/guestfish-actions.pod:1173
9432 #: ../src/guestfs-actions.pod:1739
9434 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
9439 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1180
9451 #: ../src/guestfs-actions.pod:1747 ../fish/guestfish-actions.pod:1185
9452 msgid "If C<directory> is not a directory, then this command returns an error."
9457 #: ../src/guestfs-actions.pod:1750 ../fish/guestfish-actions.pod:1188
9458 msgid "The returned list is sorted."
9463 #: ../src/guestfs-actions.pod:1752
9464 msgid "See also C<guestfs_find0>."
9469 #: ../src/guestfs-actions.pod:1761 ../src/guestfs-actions.pod:3972
9470 #: ../src/guestfs-actions.pod:5515
9471 msgid "(Added in 1.0.27)"
9476 #: ../src/guestfs-actions.pod:1763
9477 msgid "guestfs_find0"
9482 #: ../src/guestfs-actions.pod:1765
9486 " guestfs_find0 (guestfs_h *g,\n"
9487 " const char *directory,\n"
9488 " const char *files);\n"
9494 #: ../src/guestfs-actions.pod:1770 ../fish/guestfish-actions.pod:1199
9496 "This command lists out all files and directories, recursively, starting at "
9497 "C<directory>, placing the resulting list in the external file called "
9503 #: ../src/guestfs-actions.pod:1774
9505 "This command works the same way as C<guestfs_find> with the following "
9511 #: ../src/guestfs-actions.pod:1781 ../fish/guestfish-actions.pod:1210
9512 msgid "The resulting list is written to an external file."
9517 #: ../src/guestfs-actions.pod:1785 ../fish/guestfish-actions.pod:1214
9519 "Items (filenames) in the result are separated by C<\\0> characters. See "
9520 "L<find(1)> option I<-print0>."
9525 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1219
9526 msgid "This command is not limited in the number of names that it can return."
9531 #: ../src/guestfs-actions.pod:1795 ../fish/guestfish-actions.pod:1224
9532 msgid "The result list is not sorted."
9537 #: ../src/guestfs-actions.pod:1801
9538 msgid "(Added in 1.0.74)"
9543 #: ../src/guestfs-actions.pod:1803
9544 msgid "guestfs_findfs_label"
9549 #: ../src/guestfs-actions.pod:1805
9553 " guestfs_findfs_label (guestfs_h *g,\n"
9554 " const char *label);\n"
9560 #: ../src/guestfs-actions.pod:1809 ../fish/guestfish-actions.pod:1234
9562 "This command searches the filesystems and returns the one which has the "
9563 "given label. An error is returned if no such filesystem can be found."
9568 #: ../src/guestfs-actions.pod:1813
9569 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
9574 #: ../src/guestfs-actions.pod:1820
9575 msgid "guestfs_findfs_uuid"
9580 #: ../src/guestfs-actions.pod:1822
9584 " guestfs_findfs_uuid (guestfs_h *g,\n"
9585 " const char *uuid);\n"
9591 #: ../src/guestfs-actions.pod:1826 ../fish/guestfish-actions.pod:1244
9593 "This command searches the filesystems and returns the one which has the "
9594 "given UUID. An error is returned if no such filesystem can be found."
9599 #: ../src/guestfs-actions.pod:1830
9600 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
9605 #: ../src/guestfs-actions.pod:1837
9606 msgid "guestfs_fsck"
9611 #: ../src/guestfs-actions.pod:1839
9615 " guestfs_fsck (guestfs_h *g,\n"
9616 " const char *fstype,\n"
9617 " const char *device);\n"
9623 #: ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:1254
9625 "This runs the filesystem checker (fsck) on C<device> which should have "
9626 "filesystem type C<fstype>."
9631 #: ../src/guestfs-actions.pod:1847 ../fish/guestfish-actions.pod:1257
9633 "The returned integer is the status. See L<fsck(8)> for the list of status "
9634 "codes from C<fsck>."
9639 #: ../src/guestfs-actions.pod:1856 ../fish/guestfish-actions.pod:1266
9640 msgid "Multiple status codes can be summed together."
9645 #: ../src/guestfs-actions.pod:1860 ../fish/guestfish-actions.pod:1270
9647 "A non-zero return code can mean \"success\", for example if errors have been "
9648 "corrected on the filesystem."
9653 #: ../src/guestfs-actions.pod:1865 ../fish/guestfish-actions.pod:1275
9654 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
9659 #: ../src/guestfs-actions.pod:1870 ../fish/guestfish-actions.pod:1280
9661 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
9666 #: ../src/guestfs-actions.pod:1874 ../src/guestfs-actions.pod:7207
9667 msgid "(Added in 1.0.16)"
9672 #: ../src/guestfs-actions.pod:1876
9673 msgid "guestfs_get_append"
9678 #: ../src/guestfs-actions.pod:1878
9682 " guestfs_get_append (guestfs_h *g);\n"
9688 #: ../src/guestfs-actions.pod:1881 ../fish/guestfish-actions.pod:1286
9690 "Return the additional kernel options which are added to the guest kernel "
9696 #: ../src/guestfs-actions.pod:1884 ../fish/guestfish-actions.pod:1289
9697 msgid "If C<NULL> then no options are added."
9702 #: ../src/guestfs-actions.pod:1886
9704 "This function returns a string which may be NULL. There is no way to return "
9705 "an error from this function. The string is owned by the guest handle and "
9706 "must I<not> be freed."
9711 #: ../src/guestfs-actions.pod:1890 ../src/guestfs-actions.pod:5193
9712 #: ../src/guestfs-actions.pod:5673 ../src/guestfs-actions.pod:6069
9713 #: ../src/guestfs-actions.pod:6088 ../src/guestfs-actions.pod:6104
9714 #: ../src/guestfs-actions.pod:6121 ../src/guestfs-actions.pod:6878
9715 #: ../src/guestfs-actions.pod:6896 ../src/guestfs-actions.pod:7250
9716 msgid "(Added in 1.0.26)"
9720 #: ../src/guestfs-actions.pod:1892
9721 msgid "guestfs_get_attach_method"
9725 #: ../src/guestfs-actions.pod:1894
9729 " guestfs_get_attach_method (guestfs_h *g);\n"
9734 #: ../src/guestfs-actions.pod:1897
9735 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
9740 #: ../src/guestfs-actions.pod:1902
9741 msgid "guestfs_get_autosync"
9746 #: ../src/guestfs-actions.pod:1904
9750 " guestfs_get_autosync (guestfs_h *g);\n"
9756 #: ../src/guestfs-actions.pod:1907 ../fish/guestfish-actions.pod:1301
9757 msgid "Get the autosync flag."
9762 #: ../src/guestfs-actions.pod:1913
9763 msgid "guestfs_get_direct"
9768 #: ../src/guestfs-actions.pod:1915
9772 " guestfs_get_direct (guestfs_h *g);\n"
9778 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1307
9779 msgid "Return the direct appliance mode flag."
9784 #: ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:5742
9785 msgid "(Added in 1.0.72)"
9790 #: ../src/guestfs-actions.pod:1924
9791 msgid "guestfs_get_e2label"
9796 #: ../src/guestfs-actions.pod:1926
9800 " guestfs_get_e2label (guestfs_h *g,\n"
9801 " const char *device);\n"
9807 #: ../src/guestfs-actions.pod:1930 ../fish/guestfish-actions.pod:1313
9809 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
9814 #: ../src/guestfs-actions.pod:1936 ../fish/guestfish-actions.pod:1316
9816 "This function is deprecated. In new code, use the C<vfs_label> call instead."
9821 #: ../src/guestfs-actions.pod:1943 ../src/guestfs-actions.pod:1964
9822 #: ../src/guestfs-actions.pod:5760 ../src/guestfs-actions.pod:5779
9823 msgid "(Added in 1.0.15)"
9828 #: ../src/guestfs-actions.pod:1945
9829 msgid "guestfs_get_e2uuid"
9834 #: ../src/guestfs-actions.pod:1947
9838 " guestfs_get_e2uuid (guestfs_h *g,\n"
9839 " const char *device);\n"
9845 #: ../src/guestfs-actions.pod:1951 ../fish/guestfish-actions.pod:1327
9847 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
9852 #: ../src/guestfs-actions.pod:1957 ../fish/guestfish-actions.pod:1330
9854 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
9859 #: ../src/guestfs-actions.pod:1966
9860 msgid "guestfs_get_memsize"
9865 #: ../src/guestfs-actions.pod:1968
9869 " guestfs_get_memsize (guestfs_h *g);\n"
9875 #: ../src/guestfs-actions.pod:1971 ../fish/guestfish-actions.pod:1341
9877 "This gets the memory size in megabytes allocated to the qemu subprocess."
9882 #: ../src/guestfs-actions.pod:1974
9884 "If C<guestfs_set_memsize> was not called on this handle, and if "
9885 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
9886 "value for memsize."
9891 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:2059
9892 #: ../src/guestfs-actions.pod:5795 ../src/guestfs-actions.pod:5902
9893 #: ../fish/guestfish-actions.pod:1348 ../fish/guestfish-actions.pod:1399
9894 #: ../fish/guestfish-actions.pod:3893 ../fish/guestfish-actions.pod:3980
9896 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
9901 #: ../src/guestfs-actions.pod:1983 ../src/guestfs-actions.pod:4263
9902 #: ../src/guestfs-actions.pod:4460 ../src/guestfs-actions.pod:4479
9903 #: ../src/guestfs-actions.pod:4498 ../src/guestfs-actions.pod:4510
9904 #: ../src/guestfs-actions.pod:4527 ../src/guestfs-actions.pod:4540
9905 #: ../src/guestfs-actions.pod:5418 ../src/guestfs-actions.pod:5800
9906 #: ../src/guestfs-actions.pod:6043 ../src/guestfs-actions.pod:6644
9907 msgid "(Added in 1.0.55)"
9912 #: ../src/guestfs-actions.pod:1985
9913 msgid "guestfs_get_network"
9918 #: ../src/guestfs-actions.pod:1987
9922 " guestfs_get_network (guestfs_h *g);\n"
9928 #: ../src/guestfs-actions.pod:1990 ../fish/guestfish-actions.pod:1355
9929 msgid "This returns the enable network flag."
9934 #: ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:5819
9935 msgid "(Added in 1.5.4)"
9940 #: ../src/guestfs-actions.pod:1996
9941 msgid "guestfs_get_path"
9946 #: ../src/guestfs-actions.pod:1998
9950 " guestfs_get_path (guestfs_h *g);\n"
9956 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1361
9957 msgid "Return the current search path."
9962 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1363
9964 "This is always non-NULL. If it wasn't set already, then this will return "
9970 #: ../src/guestfs-actions.pod:2006 ../src/guestfs-actions.pod:2035
9972 "This function returns a string, or NULL on error. The string is owned by "
9973 "the guest handle and must I<not> be freed."
9978 #: ../src/guestfs-actions.pod:2011
9979 msgid "guestfs_get_pid"
9984 #: ../src/guestfs-actions.pod:2013
9988 " guestfs_get_pid (guestfs_h *g);\n"
9994 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
9996 "Return the process ID of the qemu subprocess. If there is no qemu "
9997 "subprocess, then this will return an error."
10002 #: ../src/guestfs-actions.pod:2019 ../fish/guestfish-actions.pod:1375
10003 msgid "This is an internal call used for debugging and testing."
10008 #: ../src/guestfs-actions.pod:2023
10009 msgid "(Added in 1.0.56)"
10014 #: ../src/guestfs-actions.pod:2025
10015 msgid "guestfs_get_qemu"
10020 #: ../src/guestfs-actions.pod:2027
10024 " guestfs_get_qemu (guestfs_h *g);\n"
10030 #: ../src/guestfs-actions.pod:2030 ../fish/guestfish-actions.pod:1381
10031 msgid "Return the current qemu binary."
10036 #: ../src/guestfs-actions.pod:2032 ../fish/guestfish-actions.pod:1383
10038 "This is always non-NULL. If it wasn't set already, then this will return "
10039 "the default qemu binary name."
10044 #: ../src/guestfs-actions.pod:2038 ../src/guestfs-actions.pod:5864
10045 msgid "(Added in 1.0.6)"
10050 #: ../src/guestfs-actions.pod:2040
10051 msgid "guestfs_get_recovery_proc"
10056 #: ../src/guestfs-actions.pod:2042
10060 " guestfs_get_recovery_proc (guestfs_h *g);\n"
10066 #: ../src/guestfs-actions.pod:2045 ../fish/guestfish-actions.pod:1390
10067 msgid "Return the recovery process enabled flag."
10072 #: ../src/guestfs-actions.pod:2049 ../src/guestfs-actions.pod:3373
10073 #: ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:4070
10074 #: ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:5123
10075 #: ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5888
10076 #: ../src/guestfs-actions.pod:6547 ../src/guestfs-actions.pod:6567
10077 #: ../src/guestfs-actions.pod:6759
10078 msgid "(Added in 1.0.77)"
10083 #: ../src/guestfs-actions.pod:2051
10084 msgid "guestfs_get_selinux"
10089 #: ../src/guestfs-actions.pod:2053
10093 " guestfs_get_selinux (guestfs_h *g);\n"
10099 #: ../src/guestfs-actions.pod:2056
10101 "This returns the current setting of the selinux flag which is passed to the "
10102 "appliance at boot time. See C<guestfs_set_selinux>."
10107 #: ../src/guestfs-actions.pod:2064 ../src/guestfs-actions.pod:2127
10108 #: ../src/guestfs-actions.pod:5907 ../src/guestfs-actions.pod:5961
10109 msgid "(Added in 1.0.67)"
10114 #: ../src/guestfs-actions.pod:2066
10115 msgid "guestfs_get_state"
10120 #: ../src/guestfs-actions.pod:2068
10124 " guestfs_get_state (guestfs_h *g);\n"
10130 #: ../src/guestfs-actions.pod:2071 ../fish/guestfish-actions.pod:1406
10132 "This returns the current state as an opaque integer. This is only useful "
10133 "for printing debug and internal error messages."
10138 #: ../src/guestfs-actions.pod:2074 ../src/guestfs-actions.pod:3176
10139 #: ../src/guestfs-actions.pod:3205 ../src/guestfs-actions.pod:3266
10140 #: ../src/guestfs-actions.pod:3293 ../fish/guestfish-actions.pod:1409
10141 #: ../fish/guestfish-actions.pod:2223 ../fish/guestfish-actions.pod:2241
10142 #: ../fish/guestfish-actions.pod:2279 ../fish/guestfish-actions.pod:2295
10143 msgid "For more information on states, see L<guestfs(3)>."
10148 #: ../src/guestfs-actions.pod:2080
10149 msgid "guestfs_get_trace"
10154 #: ../src/guestfs-actions.pod:2082
10158 " guestfs_get_trace (guestfs_h *g);\n"
10164 #: ../src/guestfs-actions.pod:2085 ../fish/guestfish-actions.pod:1415
10165 msgid "Return the command trace flag."
10170 #: ../src/guestfs-actions.pod:2091
10171 msgid "guestfs_get_umask"
10176 #: ../src/guestfs-actions.pod:2093
10180 " guestfs_get_umask (guestfs_h *g);\n"
10186 #: ../src/guestfs-actions.pod:2096
10188 "Return the current umask. By default the umask is C<022> unless it has been "
10189 "set by calling C<guestfs_umask>."
10194 #: ../src/guestfs-actions.pod:2103
10195 msgid "guestfs_get_verbose"
10200 #: ../src/guestfs-actions.pod:2105
10204 " guestfs_get_verbose (guestfs_h *g);\n"
10210 #: ../src/guestfs-actions.pod:2108 ../fish/guestfish-actions.pod:1428
10211 msgid "This returns the verbose messages flag."
10216 #: ../src/guestfs-actions.pod:2114
10217 msgid "guestfs_getcon"
10222 #: ../src/guestfs-actions.pod:2116
10226 " guestfs_getcon (guestfs_h *g);\n"
10232 #: ../src/guestfs-actions.pod:2119 ../fish/guestfish-actions.pod:1434
10233 msgid "This gets the SELinux security context of the daemon."
10238 #: ../src/guestfs-actions.pod:2121
10240 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
10245 #: ../src/guestfs-actions.pod:2129
10246 msgid "guestfs_getxattr"
10251 #: ../src/guestfs-actions.pod:2131
10255 " guestfs_getxattr (guestfs_h *g,\n"
10256 " const char *path,\n"
10257 " const char *name,\n"
10258 " size_t *size_r);\n"
10264 #: ../src/guestfs-actions.pod:2137
10266 "Get a single extended attribute from file C<path> named C<name>. This call "
10267 "follows symlinks. If you want to lookup an extended attribute for the "
10268 "symlink itself, use C<guestfs_lgetxattr>."
10273 #: ../src/guestfs-actions.pod:2141 ../src/guestfs-actions.pod:3387
10275 "Normally it is better to get all extended attributes from a file in one go "
10276 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
10277 "implementations are buggy and do not provide a way to list out attributes. "
10278 "For these filesystems (notably ntfs-3g) you have to know the names of the "
10279 "extended attributes you want in advance and call this function."
10284 #: ../src/guestfs-actions.pod:2148 ../src/guestfs-actions.pod:3394
10285 #: ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:2360
10287 "Extended attribute values are blobs of binary data. If there is no extended "
10288 "attribute named C<name>, this returns an error."
10293 #: ../src/guestfs-actions.pod:2151
10294 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
10299 #: ../src/guestfs-actions.pod:2153 ../src/guestfs-actions.pod:2344
10300 #: ../src/guestfs-actions.pod:3399 ../src/guestfs-actions.pod:5116
10301 #: ../src/guestfs-actions.pod:5142 ../src/guestfs-actions.pod:5323
10303 "This function returns a buffer, or NULL on error. The size of the returned "
10304 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
10309 #: ../src/guestfs-actions.pod:2157 ../src/guestfs-actions.pod:3403
10310 msgid "(Added in 1.7.24)"
10315 #: ../src/guestfs-actions.pod:2159
10316 msgid "guestfs_getxattrs"
10321 #: ../src/guestfs-actions.pod:2161
10324 " struct guestfs_xattr_list *\n"
10325 " guestfs_getxattrs (guestfs_h *g,\n"
10326 " const char *path);\n"
10332 #: ../src/guestfs-actions.pod:2165 ../fish/guestfish-actions.pod:1463
10334 "This call lists the extended attributes of the file or directory C<path>."
10339 #: ../src/guestfs-actions.pod:2168 ../fish/guestfish-actions.pod:1466
10341 "At the system call level, this is a combination of the L<listxattr(2)> and "
10342 "L<getxattr(2)> calls."
10347 #: ../src/guestfs-actions.pod:2171
10348 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
10353 #: ../src/guestfs-actions.pod:2173 ../src/guestfs-actions.pod:3415
10354 #: ../src/guestfs-actions.pod:4066
10356 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
10357 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
10362 #: ../src/guestfs-actions.pod:2177 ../src/guestfs-actions.pod:3419
10363 #: ../src/guestfs-actions.pod:3584 ../src/guestfs-actions.pod:3620
10364 #: ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5980
10365 #: ../src/guestfs-actions.pod:7315
10366 msgid "(Added in 1.0.59)"
10371 #: ../src/guestfs-actions.pod:2179
10372 msgid "guestfs_glob_expand"
10377 #: ../src/guestfs-actions.pod:2181
10381 " guestfs_glob_expand (guestfs_h *g,\n"
10382 " const char *pattern);\n"
10388 #: ../src/guestfs-actions.pod:2185 ../fish/guestfish-actions.pod:1475
10390 "This command searches for all the pathnames matching C<pattern> according to "
10391 "the wildcard expansion rules used by the shell."
10396 #: ../src/guestfs-actions.pod:2189 ../fish/guestfish-actions.pod:1479
10398 "If no paths match, then this returns an empty list (note: not an error)."
10403 #: ../src/guestfs-actions.pod:2192 ../fish/guestfish-actions.pod:1482
10405 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
10406 "GLOB_BRACE>. See that manual page for more details."
10411 #: ../src/guestfs-actions.pod:2200 ../src/guestfs-actions.pod:6145
10412 #: ../src/guestfs-actions.pod:6162
10413 msgid "(Added in 1.0.50)"
10418 #: ../src/guestfs-actions.pod:2202
10419 msgid "guestfs_grep"
10424 #: ../src/guestfs-actions.pod:2204
10428 " guestfs_grep (guestfs_h *g,\n"
10429 " const char *regex,\n"
10430 " const char *path);\n"
10436 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1490
10437 msgid "This calls the external C<grep> program and returns the matching lines."
10442 #: ../src/guestfs-actions.pod:2221
10443 msgid "guestfs_grepi"
10448 #: ../src/guestfs-actions.pod:2223
10452 " guestfs_grepi (guestfs_h *g,\n"
10453 " const char *regex,\n"
10454 " const char *path);\n"
10460 #: ../src/guestfs-actions.pod:2228 ../fish/guestfish-actions.pod:1500
10462 "This calls the external C<grep -i> program and returns the matching lines."
10467 #: ../src/guestfs-actions.pod:2240
10468 msgid "guestfs_grub_install"
10473 #: ../src/guestfs-actions.pod:2242
10477 " guestfs_grub_install (guestfs_h *g,\n"
10478 " const char *root,\n"
10479 " const char *device);\n"
10485 #: ../src/guestfs-actions.pod:2247 ../fish/guestfish-actions.pod:1510
10487 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
10488 "the root directory being C<root>."
10493 #: ../src/guestfs-actions.pod:2250 ../fish/guestfish-actions.pod:1513
10495 "Note: If grub-install reports the error \"No suitable drive was found in the "
10496 "generated device map.\" it may be that you need to create a C</boot/grub/"
10497 "device.map> file first that contains the mapping between grub device names "
10498 "and Linux device names. It is usually sufficient to create a file "
10504 #: ../src/guestfs-actions.pod:2257 ../fish/guestfish-actions.pod:1520
10507 " (hd0) /dev/vda\n"
10513 #: ../src/guestfs-actions.pod:2259 ../fish/guestfish-actions.pod:1522
10514 msgid "replacing C</dev/vda> with the name of the installation device."
10519 #: ../src/guestfs-actions.pod:2263
10520 msgid "(Added in 1.0.17)"
10525 #: ../src/guestfs-actions.pod:2265
10526 msgid "guestfs_head"
10531 #: ../src/guestfs-actions.pod:2267
10535 " guestfs_head (guestfs_h *g,\n"
10536 " const char *path);\n"
10542 #: ../src/guestfs-actions.pod:2271 ../fish/guestfish-actions.pod:1528
10544 "This command returns up to the first 10 lines of a file as a list of strings."
10549 #: ../src/guestfs-actions.pod:2283
10550 msgid "guestfs_head_n"
10555 #: ../src/guestfs-actions.pod:2285
10559 " guestfs_head_n (guestfs_h *g,\n"
10561 " const char *path);\n"
10567 #: ../src/guestfs-actions.pod:2290 ../fish/guestfish-actions.pod:1538
10569 "If the parameter C<nrlines> is a positive number, this returns the first "
10570 "C<nrlines> lines of the file C<path>."
10575 #: ../src/guestfs-actions.pod:2293 ../fish/guestfish-actions.pod:1541
10577 "If the parameter C<nrlines> is a negative number, this returns lines from "
10578 "the file C<path>, excluding the last C<nrlines> lines."
10583 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:6442
10584 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:4326
10585 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
10590 #: ../src/guestfs-actions.pod:2307
10591 msgid "guestfs_hexdump"
10596 #: ../src/guestfs-actions.pod:2309
10600 " guestfs_hexdump (guestfs_h *g,\n"
10601 " const char *path);\n"
10607 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1553
10609 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
10610 "readable, canonical hex dump of the file."
10615 #: ../src/guestfs-actions.pod:2322 ../src/guestfs-actions.pod:6226
10616 #: ../src/guestfs-actions.pod:6281
10617 msgid "(Added in 1.0.22)"
10622 #: ../src/guestfs-actions.pod:2324
10623 msgid "guestfs_initrd_cat"
10628 #: ../src/guestfs-actions.pod:2326
10632 " guestfs_initrd_cat (guestfs_h *g,\n"
10633 " const char *initrdpath,\n"
10634 " const char *filename,\n"
10635 " size_t *size_r);\n"
10641 #: ../src/guestfs-actions.pod:2332 ../fish/guestfish-actions.pod:1563
10643 "This command unpacks the file C<filename> from the initrd file called "
10644 "C<initrdpath>. The filename must be given I<without> the initial C</> "
10650 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1567
10652 "For example, in guestfish you could use the following command to examine the "
10653 "boot script (usually called C</init>) contained in a Linux initrd or "
10659 #: ../src/guestfs-actions.pod:2340 ../fish/guestfish-actions.pod:1571
10662 " initrd-cat /boot/initrd-<version>.img init\n"
10668 #: ../src/guestfs-actions.pod:2342
10669 msgid "See also C<guestfs_initrd_list>."
10674 #: ../src/guestfs-actions.pod:2353
10675 msgid "guestfs_initrd_list"
10680 #: ../src/guestfs-actions.pod:2355
10684 " guestfs_initrd_list (guestfs_h *g,\n"
10685 " const char *path);\n"
10691 #: ../src/guestfs-actions.pod:2359 ../fish/guestfish-actions.pod:1582
10692 msgid "This command lists out files contained in an initrd."
10697 #: ../src/guestfs-actions.pod:2361 ../fish/guestfish-actions.pod:1584
10699 "The files are listed without any initial C</> character. The files are "
10700 "listed in the order they appear (not necessarily alphabetical). Directory "
10701 "names are listed as separate items."
10706 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1588
10708 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
10709 "initrd. We I<only> support the newer initramfs format (compressed cpio "
10715 #: ../src/guestfs-actions.pod:2375
10716 msgid "guestfs_inotify_add_watch"
10721 #: ../src/guestfs-actions.pod:2377
10725 " guestfs_inotify_add_watch (guestfs_h *g,\n"
10726 " const char *path,\n"
10733 #: ../src/guestfs-actions.pod:2382 ../fish/guestfish-actions.pod:1596
10734 msgid "Watch C<path> for the events listed in C<mask>."
10739 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1598
10741 "Note that if C<path> is a directory then events within that directory are "
10742 "watched, but this does I<not> happen recursively (in subdirectories)."
10747 #: ../src/guestfs-actions.pod:2388 ../fish/guestfish-actions.pod:1602
10749 "Note for non-C or non-Linux callers: the inotify events are defined by the "
10750 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
10755 #: ../src/guestfs-actions.pod:2396
10756 msgid "guestfs_inotify_close"
10761 #: ../src/guestfs-actions.pod:2398
10765 " guestfs_inotify_close (guestfs_h *g);\n"
10771 #: ../src/guestfs-actions.pod:2401 ../fish/guestfish-actions.pod:1610
10773 "This closes the inotify handle which was previously opened by inotify_init. "
10774 "It removes all watches, throws away any pending events, and deallocates all "
10780 #: ../src/guestfs-actions.pod:2409
10781 msgid "guestfs_inotify_files"
10786 #: ../src/guestfs-actions.pod:2411
10790 " guestfs_inotify_files (guestfs_h *g);\n"
10796 #: ../src/guestfs-actions.pod:2414
10798 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
10799 "returns a list of pathnames of objects that were touched. The returned "
10800 "pathnames are sorted and deduplicated."
10805 #: ../src/guestfs-actions.pod:2424
10806 msgid "guestfs_inotify_init"
10811 #: ../src/guestfs-actions.pod:2426
10815 " guestfs_inotify_init (guestfs_h *g,\n"
10816 " int maxevents);\n"
10822 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1626
10824 "This command creates a new inotify handle. The inotify subsystem can be "
10825 "used to notify events which happen to objects in the guest filesystem."
10830 #: ../src/guestfs-actions.pod:2434
10832 "C<maxevents> is the maximum number of events which will be queued up between "
10833 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
10834 "passed as C<0>, then the kernel (or previously set) default is used. For "
10835 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
10836 "throws away events, but records the fact that it threw them away by setting "
10837 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
10838 "C<guestfs_inotify_read>)."
10843 #: ../src/guestfs-actions.pod:2444
10845 "Before any events are generated, you have to add some watches to the "
10846 "internal watch list. See: C<guestfs_inotify_add_watch>, "
10847 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
10852 #: ../src/guestfs-actions.pod:2450
10854 "Queued up events should be read periodically by calling "
10855 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
10856 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
10857 "often enough then you risk the internal queue overflowing."
10862 #: ../src/guestfs-actions.pod:2457
10864 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
10865 "This also removes any watches automatically."
10870 #: ../src/guestfs-actions.pod:2461 ../fish/guestfish-actions.pod:1657
10872 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
10873 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
10874 "that there is one global inotify handle per libguestfs instance."
10879 #: ../src/guestfs-actions.pod:2470
10880 msgid "guestfs_inotify_read"
10885 #: ../src/guestfs-actions.pod:2472
10888 " struct guestfs_inotify_event_list *\n"
10889 " guestfs_inotify_read (guestfs_h *g);\n"
10895 #: ../src/guestfs-actions.pod:2475 ../fish/guestfish-actions.pod:1666
10897 "Return the complete queue of events that have happened since the previous "
10903 #: ../src/guestfs-actions.pod:2478 ../fish/guestfish-actions.pod:1669
10904 msgid "If no events have happened, this returns an empty list."
10909 #: ../src/guestfs-actions.pod:2480 ../fish/guestfish-actions.pod:1671
10911 "I<Note>: In order to make sure that all events have been read, you must call "
10912 "this function repeatedly until it returns an empty list. The reason is that "
10913 "the call will read events up to the maximum appliance-to-host message size "
10914 "and leave remaining events in the queue."
10919 #: ../src/guestfs-actions.pod:2486
10921 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
10922 "there was an error. I<The caller must call "
10923 "C<guestfs_free_inotify_event_list> after use>."
10928 #: ../src/guestfs-actions.pod:2492
10929 msgid "guestfs_inotify_rm_watch"
10934 #: ../src/guestfs-actions.pod:2494
10938 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
10945 #: ../src/guestfs-actions.pod:2498
10947 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
10952 #: ../src/guestfs-actions.pod:2505
10953 msgid "guestfs_inspect_get_arch"
10958 #: ../src/guestfs-actions.pod:2507
10962 " guestfs_inspect_get_arch (guestfs_h *g,\n"
10963 " const char *root);\n"
10969 #: ../src/guestfs-actions.pod:2511 ../src/guestfs-actions.pod:2534
10970 #: ../src/guestfs-actions.pod:2615 ../src/guestfs-actions.pod:2641
10971 #: ../src/guestfs-actions.pod:2680 ../src/guestfs-actions.pod:2702
10972 #: ../src/guestfs-actions.pod:2729 ../src/guestfs-actions.pod:2750
10973 #: ../src/guestfs-actions.pod:2787 ../src/guestfs-actions.pod:2816
10974 #: ../src/guestfs-actions.pod:2847 ../src/guestfs-actions.pod:2891
10975 #: ../src/guestfs-actions.pod:2933 ../src/guestfs-actions.pod:2956
10976 #: ../src/guestfs-actions.pod:2973 ../src/guestfs-actions.pod:2990
10977 #: ../src/guestfs-actions.pod:3009
10979 "This function should only be called with a root device string as returned by "
10980 "C<guestfs_inspect_os>."
10985 #: ../src/guestfs-actions.pod:2514
10987 "This returns the architecture of the inspected operating system. The "
10988 "possible return values are listed under C<guestfs_file_architecture>."
10993 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1695
10995 "If the architecture could not be determined, then the string C<unknown> is "
11001 #: ../src/guestfs-actions.pod:2521 ../src/guestfs-actions.pod:2602
11002 #: ../src/guestfs-actions.pod:2669 ../src/guestfs-actions.pod:2689
11003 #: ../src/guestfs-actions.pod:2717 ../src/guestfs-actions.pod:2803
11004 #: ../src/guestfs-actions.pod:2834 ../src/guestfs-actions.pod:2858
11005 #: ../src/guestfs-actions.pod:2877 ../src/guestfs-actions.pod:2920
11006 #: ../src/guestfs-actions.pod:2943 ../src/guestfs-actions.pod:2963
11007 #: ../src/guestfs-actions.pod:2980 ../src/guestfs-actions.pod:2999
11008 #: ../src/guestfs-actions.pod:3102 ../src/guestfs-actions.pod:3143
11009 #: ../fish/guestfish-actions.pod:1698 ../fish/guestfish-actions.pod:1772
11010 #: ../fish/guestfish-actions.pod:1824 ../fish/guestfish-actions.pod:1839
11011 #: ../fish/guestfish-actions.pod:1860 ../fish/guestfish-actions.pod:1924
11012 #: ../fish/guestfish-actions.pod:1948 ../fish/guestfish-actions.pod:1965
11013 #: ../fish/guestfish-actions.pod:1978 ../fish/guestfish-actions.pod:2013
11014 #: ../fish/guestfish-actions.pod:2029 ../fish/guestfish-actions.pod:2042
11015 #: ../fish/guestfish-actions.pod:2055 ../fish/guestfish-actions.pod:2070
11016 #: ../fish/guestfish-actions.pod:2169 ../fish/guestfish-actions.pod:2203
11017 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
11022 #: ../src/guestfs-actions.pod:2528
11023 msgid "guestfs_inspect_get_distro"
11028 #: ../src/guestfs-actions.pod:2530
11032 " guestfs_inspect_get_distro (guestfs_h *g,\n"
11033 " const char *root);\n"
11039 #: ../src/guestfs-actions.pod:2537 ../fish/guestfish-actions.pod:1707
11041 "This returns the distro (distribution) of the inspected operating system."
11046 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1710
11047 msgid "Currently defined distros are:"
11052 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1714
11053 msgid "\"archlinux\""
11058 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1716
11059 msgid "Arch Linux."
11064 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1718
11070 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:1720
11076 #: ../src/guestfs-actions.pod:2552 ../fish/guestfish-actions.pod:1722
11082 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:1724
11088 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:1726
11094 #: ../src/guestfs-actions.pod:2558 ../fish/guestfish-actions.pod:1728
11100 #: ../src/guestfs-actions.pod:2560 ../fish/guestfish-actions.pod:1730
11101 msgid "\"linuxmint\""
11106 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1732
11107 msgid "Linux Mint."
11112 #: ../src/guestfs-actions.pod:2564 ../fish/guestfish-actions.pod:1734
11113 msgid "\"mandriva\""
11118 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1736
11124 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:1738
11130 #: ../src/guestfs-actions.pod:2570 ../fish/guestfish-actions.pod:1740
11136 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1742
11142 #: ../src/guestfs-actions.pod:2574 ../fish/guestfish-actions.pod:1744
11148 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:1746
11149 msgid "\"redhat-based\""
11154 #: ../src/guestfs-actions.pod:2578 ../fish/guestfish-actions.pod:1748
11155 msgid "Some Red Hat-derived distro."
11160 #: ../src/guestfs-actions.pod:2580 ../fish/guestfish-actions.pod:1750
11166 #: ../src/guestfs-actions.pod:2582 ../fish/guestfish-actions.pod:1752
11167 msgid "Red Hat Enterprise Linux and some derivatives."
11172 #: ../src/guestfs-actions.pod:2584 ../fish/guestfish-actions.pod:1754
11178 #: ../src/guestfs-actions.pod:2586 ../fish/guestfish-actions.pod:1756
11184 #: ../src/guestfs-actions.pod:2588 ../src/guestfs-actions.pod:2660
11185 #: ../src/guestfs-actions.pod:2911 ../fish/guestfish-actions.pod:1758
11186 #: ../fish/guestfish-actions.pod:1815 ../fish/guestfish-actions.pod:2004
11187 msgid "\"unknown\""
11192 #: ../src/guestfs-actions.pod:2590 ../fish/guestfish-actions.pod:1760
11193 msgid "The distro could not be determined."
11198 #: ../src/guestfs-actions.pod:2592 ../src/guestfs-actions.pod:2903
11199 #: ../fish/guestfish-actions.pod:1762 ../fish/guestfish-actions.pod:1996
11200 msgid "\"windows\""
11205 #: ../src/guestfs-actions.pod:2594 ../fish/guestfish-actions.pod:1764
11207 "Windows does not have distributions. This string is returned if the OS type "
11213 #: ../src/guestfs-actions.pod:2599 ../src/guestfs-actions.pod:2666
11214 #: ../src/guestfs-actions.pod:2917 ../fish/guestfish-actions.pod:1769
11215 #: ../fish/guestfish-actions.pod:1821 ../fish/guestfish-actions.pod:2010
11217 "Future versions of libguestfs may return other strings here. The caller "
11218 "should be prepared to handle any string."
11223 #: ../src/guestfs-actions.pod:2609
11224 msgid "guestfs_inspect_get_filesystems"
11229 #: ../src/guestfs-actions.pod:2611
11233 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
11234 " const char *root);\n"
11240 #: ../src/guestfs-actions.pod:2618 ../fish/guestfish-actions.pod:1781
11242 "This returns a list of all the filesystems that we think are associated with "
11243 "this operating system. This includes the root filesystem, other ordinary "
11244 "filesystems, and non-mounted devices like swap partitions."
11249 #: ../src/guestfs-actions.pod:2623 ../fish/guestfish-actions.pod:1786
11251 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
11252 "to be shared between operating systems."
11257 #: ../src/guestfs-actions.pod:2626
11259 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11260 "C<guestfs_inspect_get_mountpoints>."
11264 #: ../src/guestfs-actions.pod:2635
11265 msgid "guestfs_inspect_get_format"
11269 #: ../src/guestfs-actions.pod:2637
11273 " guestfs_inspect_get_format (guestfs_h *g,\n"
11274 " const char *root);\n"
11279 #: ../src/guestfs-actions.pod:2644 ../fish/guestfish-actions.pod:1799
11281 "This returns the format of the inspected operating system. You can use it "
11282 "to detect install images, live CDs and similar."
11286 #: ../src/guestfs-actions.pod:2647 ../fish/guestfish-actions.pod:1802
11287 msgid "Currently defined formats are:"
11291 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:1806
11292 msgid "\"installed\""
11296 #: ../src/guestfs-actions.pod:2653 ../fish/guestfish-actions.pod:1808
11297 msgid "This is an installed operating system."
11301 #: ../src/guestfs-actions.pod:2655 ../fish/guestfish-actions.pod:1810
11302 msgid "\"installer\""
11306 #: ../src/guestfs-actions.pod:2657 ../fish/guestfish-actions.pod:1812
11308 "The disk image being inspected is not an installed operating system, but a "
11309 "I<bootable> install disk, live CD, or similar."
11313 #: ../src/guestfs-actions.pod:2662 ../fish/guestfish-actions.pod:1817
11314 msgid "The format of this disk image is not known."
11319 #: ../src/guestfs-actions.pod:2674
11320 msgid "guestfs_inspect_get_hostname"
11325 #: ../src/guestfs-actions.pod:2676
11329 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
11330 " const char *root);\n"
11336 #: ../src/guestfs-actions.pod:2683 ../fish/guestfish-actions.pod:1833
11338 "This function returns the hostname of the operating system as found by "
11339 "inspection of the guest's configuration files."
11344 #: ../src/guestfs-actions.pod:2686 ../fish/guestfish-actions.pod:1836
11346 "If the hostname could not be determined, then the string C<unknown> is "
11352 #: ../src/guestfs-actions.pod:2694
11353 msgid "(Added in 1.7.9)"
11358 #: ../src/guestfs-actions.pod:2696
11359 msgid "guestfs_inspect_get_major_version"
11364 #: ../src/guestfs-actions.pod:2698
11368 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
11369 " const char *root);\n"
11375 #: ../src/guestfs-actions.pod:2705 ../fish/guestfish-actions.pod:1848
11377 "This returns the major version number of the inspected operating system."
11382 #: ../src/guestfs-actions.pod:2708 ../fish/guestfish-actions.pod:1851
11384 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
11385 "popular public names used by the operating system. Notably the operating "
11386 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
11387 "1). You can find out the real versions corresponding to releases of Windows "
11388 "by consulting Wikipedia or MSDN."
11393 #: ../src/guestfs-actions.pod:2715 ../src/guestfs-actions.pod:2735
11394 #: ../fish/guestfish-actions.pod:1858 ../fish/guestfish-actions.pod:1872
11395 msgid "If the version could not be determined, then C<0> is returned."
11400 #: ../src/guestfs-actions.pod:2723
11401 msgid "guestfs_inspect_get_minor_version"
11406 #: ../src/guestfs-actions.pod:2725
11410 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
11411 " const char *root);\n"
11417 #: ../src/guestfs-actions.pod:2732 ../fish/guestfish-actions.pod:1869
11419 "This returns the minor version number of the inspected operating system."
11424 #: ../src/guestfs-actions.pod:2737
11426 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11427 "C<guestfs_inspect_get_major_version>."
11432 #: ../src/guestfs-actions.pod:2744
11433 msgid "guestfs_inspect_get_mountpoints"
11438 #: ../src/guestfs-actions.pod:2746
11442 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
11443 " const char *root);\n"
11448 #: ../src/guestfs-actions.pod:2753 ../fish/guestfish-actions.pod:1884
11450 "This returns a hash of where we think the filesystems associated with this "
11451 "operating system should be mounted. Callers should note that this is at "
11452 "best an educated guess made by reading configuration files such as C</etc/"
11453 "fstab>. I<In particular note> that this may return filesystems which are "
11454 "non-existent or not mountable and callers should be prepared to handle or "
11455 "ignore failures if they try to mount them."
11460 #: ../src/guestfs-actions.pod:2762 ../fish/guestfish-actions.pod:1893
11462 "Each element in the returned hashtable has a key which is the path of the "
11463 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
11464 "mounted there (eg. C</dev/sda1>)."
11469 #: ../src/guestfs-actions.pod:2767 ../fish/guestfish-actions.pod:1898
11471 "Non-mounted devices such as swap devices are I<not> returned in this list."
11476 #: ../src/guestfs-actions.pod:2770
11478 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11479 "C<guestfs_inspect_get_filesystems>."
11484 #: ../src/guestfs-actions.pod:2773 ../src/guestfs-actions.pod:3472
11485 #: ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:6583
11487 "This function returns a NULL-terminated array of strings, or NULL if there "
11488 "was an error. The array of strings will always have length C<2n+1>, where "
11489 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
11490 "caller must free the strings and the array after use>."
11495 #: ../src/guestfs-actions.pod:2781
11496 msgid "guestfs_inspect_get_package_format"
11501 #: ../src/guestfs-actions.pod:2783
11505 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
11506 " const char *root);\n"
11512 #: ../src/guestfs-actions.pod:2790
11514 "This function and C<guestfs_inspect_get_package_management> return the "
11515 "package format and package management tool used by the inspected operating "
11516 "system. For example for Fedora these functions would return C<rpm> (package "
11517 "format) and C<yum> (package management)."
11522 #: ../src/guestfs-actions.pod:2796 ../fish/guestfish-actions.pod:1917
11524 "This returns the string C<unknown> if we could not determine the package "
11525 "format I<or> if the operating system does not have a real packaging system "
11531 #: ../src/guestfs-actions.pod:2800 ../fish/guestfish-actions.pod:1921
11533 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
11534 "Future versions of libguestfs may return other strings."
11539 #: ../src/guestfs-actions.pod:2808 ../src/guestfs-actions.pod:2839
11540 msgid "(Added in 1.7.5)"
11545 #: ../src/guestfs-actions.pod:2810
11546 msgid "guestfs_inspect_get_package_management"
11551 #: ../src/guestfs-actions.pod:2812
11555 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
11556 " const char *root);\n"
11562 #: ../src/guestfs-actions.pod:2819
11564 "C<guestfs_inspect_get_package_format> and this function return the package "
11565 "format and package management tool used by the inspected operating system. "
11566 "For example for Fedora these functions would return C<rpm> (package format) "
11567 "and C<yum> (package management)."
11572 #: ../src/guestfs-actions.pod:2825 ../fish/guestfish-actions.pod:1939
11574 "This returns the string C<unknown> if we could not determine the package "
11575 "management tool I<or> if the operating system does not have a real packaging "
11576 "system (eg. Windows)."
11581 #: ../src/guestfs-actions.pod:2829 ../fish/guestfish-actions.pod:1943
11583 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
11584 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
11585 "libguestfs may return other strings."
11590 #: ../src/guestfs-actions.pod:2841
11591 msgid "guestfs_inspect_get_product_name"
11596 #: ../src/guestfs-actions.pod:2843
11600 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
11601 " const char *root);\n"
11607 #: ../src/guestfs-actions.pod:2850 ../fish/guestfish-actions.pod:1957
11609 "This returns the product name of the inspected operating system. The "
11610 "product name is generally some freeform string which can be displayed to the "
11611 "user, but should not be parsed by programs."
11616 #: ../src/guestfs-actions.pod:2855 ../fish/guestfish-actions.pod:1962
11618 "If the product name could not be determined, then the string C<unknown> is "
11624 #: ../src/guestfs-actions.pod:2865
11625 msgid "guestfs_inspect_get_roots"
11630 #: ../src/guestfs-actions.pod:2867
11634 " guestfs_inspect_get_roots (guestfs_h *g);\n"
11640 #: ../src/guestfs-actions.pod:2870
11642 "This function is a convenient way to get the list of root devices, as "
11643 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
11644 "the whole inspection process."
11649 #: ../src/guestfs-actions.pod:2874
11651 "This returns an empty list if either no root devices were found or the "
11652 "caller has not called C<guestfs_inspect_os>."
11657 #: ../src/guestfs-actions.pod:2883
11658 msgid "(Added in 1.7.3)"
11663 #: ../src/guestfs-actions.pod:2885
11664 msgid "guestfs_inspect_get_type"
11669 #: ../src/guestfs-actions.pod:2887
11673 " guestfs_inspect_get_type (guestfs_h *g,\n"
11674 " const char *root);\n"
11680 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:1987
11682 "This returns the type of the inspected operating system. Currently defined "
11688 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:1992
11694 #: ../src/guestfs-actions.pod:2901 ../fish/guestfish-actions.pod:1994
11695 msgid "Any Linux-based operating system."
11700 #: ../src/guestfs-actions.pod:2905 ../fish/guestfish-actions.pod:1998
11701 msgid "Any Microsoft Windows operating system."
11706 #: ../src/guestfs-actions.pod:2907 ../fish/guestfish-actions.pod:2000
11707 msgid "\"freebsd\""
11712 #: ../src/guestfs-actions.pod:2909 ../fish/guestfish-actions.pod:2002
11718 #: ../src/guestfs-actions.pod:2913 ../fish/guestfish-actions.pod:2006
11719 msgid "The operating system type could not be determined."
11724 #: ../src/guestfs-actions.pod:2927
11725 msgid "guestfs_inspect_get_windows_systemroot"
11730 #: ../src/guestfs-actions.pod:2929
11734 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
11735 " const char *root);\n"
11741 #: ../src/guestfs-actions.pod:2936 ../fish/guestfish-actions.pod:2022
11743 "This returns the Windows systemroot of the inspected guest. The systemroot "
11744 "is a directory path such as C</WINDOWS>."
11749 #: ../src/guestfs-actions.pod:2939 ../fish/guestfish-actions.pod:2025
11751 "This call assumes that the guest is Windows and that the systemroot could be "
11752 "determined by inspection. If this is not the case then an error is returned."
11757 #: ../src/guestfs-actions.pod:2948
11758 msgid "(Added in 1.5.25)"
11762 #: ../src/guestfs-actions.pod:2950
11763 msgid "guestfs_inspect_is_live"
11767 #: ../src/guestfs-actions.pod:2952
11771 " guestfs_inspect_is_live (guestfs_h *g,\n"
11772 " const char *root);\n"
11777 #: ../src/guestfs-actions.pod:2959
11779 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
11780 "disk), then this returns true if a live image was detected on the disk."
11784 #: ../src/guestfs-actions.pod:2967
11785 msgid "guestfs_inspect_is_multipart"
11789 #: ../src/guestfs-actions.pod:2969
11793 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
11794 " const char *root);\n"
11799 #: ../src/guestfs-actions.pod:2976
11801 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
11802 "disk), then this returns true if the disk is part of a set."
11806 #: ../src/guestfs-actions.pod:2984
11807 msgid "guestfs_inspect_is_netinst"
11811 #: ../src/guestfs-actions.pod:2986
11815 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
11816 " const char *root);\n"
11821 #: ../src/guestfs-actions.pod:2993
11823 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
11824 "disk), then this returns true if the disk is a network installer, ie. not a "
11825 "self-contained install CD but one which is likely to require network access "
11826 "to complete the install."
11831 #: ../src/guestfs-actions.pod:3003
11832 msgid "guestfs_inspect_list_applications"
11837 #: ../src/guestfs-actions.pod:3005
11840 " struct guestfs_application_list *\n"
11841 " guestfs_inspect_list_applications (guestfs_h *g,\n"
11842 " const char *root);\n"
11848 #: ../src/guestfs-actions.pod:3012 ../fish/guestfish-actions.pod:2079
11849 msgid "Return the list of applications installed in the operating system."
11854 #: ../src/guestfs-actions.pod:3014
11856 "I<Note:> This call works differently from other parts of the inspection "
11857 "API. You have to call C<guestfs_inspect_os>, then "
11858 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
11859 "this. Listing applications is a significantly more difficult operation "
11860 "which requires access to the full filesystem. Also note that unlike the "
11861 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
11862 "the libguestfs handle, this call actually reads parts of the mounted "
11863 "filesystems during the call."
11868 #: ../src/guestfs-actions.pod:3024 ../fish/guestfish-actions.pod:2091
11870 "This returns an empty list if the inspection code was not able to determine "
11871 "the list of applications."
11876 #: ../src/guestfs-actions.pod:3027 ../fish/guestfish-actions.pod:2094
11877 msgid "The application structure contains the following fields:"
11882 #: ../src/guestfs-actions.pod:3031 ../fish/guestfish-actions.pod:2098
11883 msgid "C<app_name>"
11888 #: ../src/guestfs-actions.pod:3033 ../fish/guestfish-actions.pod:2100
11890 "The name of the application. For Red Hat-derived and Debian-derived Linux "
11891 "guests, this is the package name."
11896 #: ../src/guestfs-actions.pod:3036 ../fish/guestfish-actions.pod:2103
11897 msgid "C<app_display_name>"
11902 #: ../src/guestfs-actions.pod:3038 ../fish/guestfish-actions.pod:2105
11904 "The display name of the application, sometimes localized to the install "
11905 "language of the guest operating system."
11910 #: ../src/guestfs-actions.pod:3041 ../fish/guestfish-actions.pod:2108
11912 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
11913 "to display something can use C<app_name> instead."
11918 #: ../src/guestfs-actions.pod:3044 ../fish/guestfish-actions.pod:2111
11919 msgid "C<app_epoch>"
11924 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2113
11926 "For package managers which use epochs, this contains the epoch of the "
11927 "package (an integer). If unavailable, this is returned as C<0>."
11932 #: ../src/guestfs-actions.pod:3049 ../fish/guestfish-actions.pod:2116
11933 msgid "C<app_version>"
11938 #: ../src/guestfs-actions.pod:3051 ../fish/guestfish-actions.pod:2118
11940 "The version string of the application or package. If unavailable this is "
11941 "returned as an empty string C<\"\">."
11946 #: ../src/guestfs-actions.pod:3054 ../fish/guestfish-actions.pod:2121
11947 msgid "C<app_release>"
11952 #: ../src/guestfs-actions.pod:3056 ../fish/guestfish-actions.pod:2123
11954 "The release string of the application or package, for package managers that "
11955 "use this. If unavailable this is returned as an empty string C<\"\">."
11960 #: ../src/guestfs-actions.pod:3060 ../fish/guestfish-actions.pod:2127
11961 msgid "C<app_install_path>"
11966 #: ../src/guestfs-actions.pod:3062 ../fish/guestfish-actions.pod:2129
11968 "The installation path of the application (on operating systems such as "
11969 "Windows which use installation paths). This path is in the format used by "
11970 "the guest operating system, it is not a libguestfs path."
11975 #: ../src/guestfs-actions.pod:3067 ../fish/guestfish-actions.pod:2134
11976 msgid "If unavailable this is returned as an empty string C<\"\">."
11981 #: ../src/guestfs-actions.pod:3069 ../fish/guestfish-actions.pod:2136
11982 msgid "C<app_trans_path>"
11987 #: ../src/guestfs-actions.pod:3071 ../fish/guestfish-actions.pod:2138
11989 "The install path translated into a libguestfs path. If unavailable this is "
11990 "returned as an empty string C<\"\">."
11995 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2141
11996 msgid "C<app_publisher>"
12001 #: ../src/guestfs-actions.pod:3076 ../fish/guestfish-actions.pod:2143
12003 "The name of the publisher of the application, for package managers that use "
12004 "this. If unavailable this is returned as an empty string C<\"\">."
12009 #: ../src/guestfs-actions.pod:3080 ../fish/guestfish-actions.pod:2147
12015 #: ../src/guestfs-actions.pod:3082 ../fish/guestfish-actions.pod:2149
12017 "The URL (eg. upstream URL) of the application. If unavailable this is "
12018 "returned as an empty string C<\"\">."
12023 #: ../src/guestfs-actions.pod:3085 ../fish/guestfish-actions.pod:2152
12024 msgid "C<app_source_package>"
12029 #: ../src/guestfs-actions.pod:3087 ../fish/guestfish-actions.pod:2154
12031 "For packaging systems which support this, the name of the source package. "
12032 "If unavailable this is returned as an empty string C<\"\">."
12037 #: ../src/guestfs-actions.pod:3090 ../fish/guestfish-actions.pod:2157
12038 msgid "C<app_summary>"
12043 #: ../src/guestfs-actions.pod:3092 ../fish/guestfish-actions.pod:2159
12045 "A short (usually one line) description of the application or package. If "
12046 "unavailable this is returned as an empty string C<\"\">."
12051 #: ../src/guestfs-actions.pod:3095 ../fish/guestfish-actions.pod:2162
12052 msgid "C<app_description>"
12057 #: ../src/guestfs-actions.pod:3097 ../fish/guestfish-actions.pod:2164
12059 "A longer description of the application or package. If unavailable this is "
12060 "returned as an empty string C<\"\">."
12065 #: ../src/guestfs-actions.pod:3104
12067 "This function returns a C<struct guestfs_application_list *>, or NULL if "
12068 "there was an error. I<The caller must call C<guestfs_free_application_list> "
12074 #: ../src/guestfs-actions.pod:3108
12075 msgid "(Added in 1.7.8)"
12080 #: ../src/guestfs-actions.pod:3110
12081 msgid "guestfs_inspect_os"
12086 #: ../src/guestfs-actions.pod:3112
12090 " guestfs_inspect_os (guestfs_h *g);\n"
12096 #: ../src/guestfs-actions.pod:3115 ../fish/guestfish-actions.pod:2175
12098 "This function uses other libguestfs functions and certain heuristics to "
12099 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
12100 "for operating systems."
12105 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:2179
12106 msgid "The list returned is empty if no operating systems were found."
12111 #: ../src/guestfs-actions.pod:3121 ../fish/guestfish-actions.pod:2181
12113 "If one operating system was found, then this returns a list with a single "
12114 "element, which is the name of the root filesystem of this operating system. "
12115 "It is also possible for this function to return a list containing more than "
12116 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
12117 "element being the root filesystem of one of the operating systems."
12122 #: ../src/guestfs-actions.pod:3128
12124 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
12125 "functions in order to query further information about each operating system, "
12126 "such as the name and version."
12131 #: ../src/guestfs-actions.pod:3133
12133 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
12134 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
12135 "the contents. This should be called with no disks currently mounted. The "
12136 "function may also use Augeas, so any existing Augeas handle will be closed."
12141 #: ../src/guestfs-actions.pod:3139 ../fish/guestfish-actions.pod:2199
12143 "This function cannot decrypt encrypted disks. The caller must do that first "
12144 "(supplying the necessary keys) if the disk is encrypted."
12149 #: ../src/guestfs-actions.pod:3145 ../src/guestfs-actions.pod:3430
12150 #: ../src/guestfs-actions.pod:3492
12151 msgid "See also C<guestfs_list_filesystems>."
12156 #: ../src/guestfs-actions.pod:3153
12157 msgid "guestfs_is_blockdev"
12162 #: ../src/guestfs-actions.pod:3155
12166 " guestfs_is_blockdev (guestfs_h *g,\n"
12167 " const char *path);\n"
12173 #: ../src/guestfs-actions.pod:3159 ../fish/guestfish-actions.pod:2211
12175 "This returns C<true> if and only if there is a block device with the given "
12181 #: ../src/guestfs-actions.pod:3162 ../src/guestfs-actions.pod:3191
12182 #: ../src/guestfs-actions.pod:3221 ../src/guestfs-actions.pod:3236
12183 #: ../src/guestfs-actions.pod:3252 ../src/guestfs-actions.pod:3308
12184 #: ../src/guestfs-actions.pod:3323
12185 msgid "See also C<guestfs_stat>."
12190 #: ../src/guestfs-actions.pod:3166 ../src/guestfs-actions.pod:3195
12191 #: ../src/guestfs-actions.pod:3240 ../src/guestfs-actions.pod:3312
12192 #: ../src/guestfs-actions.pod:3327
12193 msgid "(Added in 1.5.10)"
12198 #: ../src/guestfs-actions.pod:3168
12199 msgid "guestfs_is_busy"
12204 #: ../src/guestfs-actions.pod:3170
12208 " guestfs_is_busy (guestfs_h *g);\n"
12214 #: ../src/guestfs-actions.pod:3173 ../fish/guestfish-actions.pod:2220
12216 "This returns true iff this handle is busy processing a command (in the "
12222 #: ../src/guestfs-actions.pod:3182
12223 msgid "guestfs_is_chardev"
12228 #: ../src/guestfs-actions.pod:3184
12232 " guestfs_is_chardev (guestfs_h *g,\n"
12233 " const char *path);\n"
12239 #: ../src/guestfs-actions.pod:3188 ../fish/guestfish-actions.pod:2229
12241 "This returns C<true> if and only if there is a character device with the "
12242 "given C<path> name."
12247 #: ../src/guestfs-actions.pod:3197
12248 msgid "guestfs_is_config"
12253 #: ../src/guestfs-actions.pod:3199
12257 " guestfs_is_config (guestfs_h *g);\n"
12263 #: ../src/guestfs-actions.pod:3202 ../fish/guestfish-actions.pod:2238
12265 "This returns true iff this handle is being configured (in the C<CONFIG> "
12271 #: ../src/guestfs-actions.pod:3211
12272 msgid "guestfs_is_dir"
12277 #: ../src/guestfs-actions.pod:3213
12281 " guestfs_is_dir (guestfs_h *g,\n"
12282 " const char *path);\n"
12288 #: ../src/guestfs-actions.pod:3217 ../fish/guestfish-actions.pod:2247
12290 "This returns C<true> if and only if there is a directory with the given "
12291 "C<path> name. Note that it returns false for other objects like files."
12296 #: ../src/guestfs-actions.pod:3227
12297 msgid "guestfs_is_fifo"
12302 #: ../src/guestfs-actions.pod:3229
12306 " guestfs_is_fifo (guestfs_h *g,\n"
12307 " const char *path);\n"
12313 #: ../src/guestfs-actions.pod:3233 ../fish/guestfish-actions.pod:2257
12315 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
12316 "given C<path> name."
12321 #: ../src/guestfs-actions.pod:3242
12322 msgid "guestfs_is_file"
12327 #: ../src/guestfs-actions.pod:3244
12331 " guestfs_is_file (guestfs_h *g,\n"
12332 " const char *path);\n"
12338 #: ../src/guestfs-actions.pod:3248 ../fish/guestfish-actions.pod:2266
12340 "This returns C<true> if and only if there is a regular file with the given "
12341 "C<path> name. Note that it returns false for other objects like directories."
12346 #: ../src/guestfs-actions.pod:3258
12347 msgid "guestfs_is_launching"
12352 #: ../src/guestfs-actions.pod:3260
12356 " guestfs_is_launching (guestfs_h *g);\n"
12362 #: ../src/guestfs-actions.pod:3263 ../fish/guestfish-actions.pod:2276
12364 "This returns true iff this handle is launching the subprocess (in the "
12365 "C<LAUNCHING> state)."
12370 #: ../src/guestfs-actions.pod:3272
12371 msgid "guestfs_is_lv"
12376 #: ../src/guestfs-actions.pod:3274
12380 " guestfs_is_lv (guestfs_h *g,\n"
12381 " const char *device);\n"
12387 #: ../src/guestfs-actions.pod:3278 ../fish/guestfish-actions.pod:2285
12389 "This command tests whether C<device> is a logical volume, and returns true "
12390 "iff this is the case."
12395 #: ../src/guestfs-actions.pod:3285
12396 msgid "guestfs_is_ready"
12401 #: ../src/guestfs-actions.pod:3287
12405 " guestfs_is_ready (guestfs_h *g);\n"
12411 #: ../src/guestfs-actions.pod:3290 ../fish/guestfish-actions.pod:2292
12413 "This returns true iff this handle is ready to accept commands (in the "
12419 #: ../src/guestfs-actions.pod:3299
12420 msgid "guestfs_is_socket"
12425 #: ../src/guestfs-actions.pod:3301
12429 " guestfs_is_socket (guestfs_h *g,\n"
12430 " const char *path);\n"
12436 #: ../src/guestfs-actions.pod:3305 ../fish/guestfish-actions.pod:2301
12438 "This returns C<true> if and only if there is a Unix domain socket with the "
12439 "given C<path> name."
12444 #: ../src/guestfs-actions.pod:3314
12445 msgid "guestfs_is_symlink"
12450 #: ../src/guestfs-actions.pod:3316
12454 " guestfs_is_symlink (guestfs_h *g,\n"
12455 " const char *path);\n"
12461 #: ../src/guestfs-actions.pod:3320 ../fish/guestfish-actions.pod:2310
12463 "This returns C<true> if and only if there is a symbolic link with the given "
12469 #: ../src/guestfs-actions.pod:3329
12470 msgid "guestfs_kill_subprocess"
12475 #: ../src/guestfs-actions.pod:3331
12479 " guestfs_kill_subprocess (guestfs_h *g);\n"
12485 #: ../src/guestfs-actions.pod:3334 ../fish/guestfish-actions.pod:2319
12486 msgid "This kills the qemu subprocess. You should never need to call this."
12491 #: ../src/guestfs-actions.pod:3340
12492 msgid "guestfs_launch"
12497 #: ../src/guestfs-actions.pod:3342
12501 " guestfs_launch (guestfs_h *g);\n"
12507 #: ../src/guestfs-actions.pod:3345 ../fish/guestfish-actions.pod:2327
12509 "Internally libguestfs is implemented by running a virtual machine using "
12515 #: ../src/guestfs-actions.pod:3348 ../fish/guestfish-actions.pod:2330
12517 "You should call this after configuring the handle (eg. adding drives) but "
12518 "before performing any actions."
12523 #: ../src/guestfs-actions.pod:3355
12524 msgid "guestfs_lchown"
12529 #: ../src/guestfs-actions.pod:3357
12533 " guestfs_lchown (guestfs_h *g,\n"
12536 " const char *path);\n"
12542 #: ../src/guestfs-actions.pod:3363
12544 "Change the file owner to C<owner> and group to C<group>. This is like "
12545 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
12546 "changed, not the target."
12551 #: ../src/guestfs-actions.pod:3375
12552 msgid "guestfs_lgetxattr"
12557 #: ../src/guestfs-actions.pod:3377
12561 " guestfs_lgetxattr (guestfs_h *g,\n"
12562 " const char *path,\n"
12563 " const char *name,\n"
12564 " size_t *size_r);\n"
12570 #: ../src/guestfs-actions.pod:3383 ../fish/guestfish-actions.pod:2349
12572 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
12573 "is a symlink, then this call returns an extended attribute from the symlink."
12578 #: ../src/guestfs-actions.pod:3397
12579 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
12584 #: ../src/guestfs-actions.pod:3405
12585 msgid "guestfs_lgetxattrs"
12590 #: ../src/guestfs-actions.pod:3407
12593 " struct guestfs_xattr_list *\n"
12594 " guestfs_lgetxattrs (guestfs_h *g,\n"
12595 " const char *path);\n"
12601 #: ../src/guestfs-actions.pod:3411
12603 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
12604 "then it returns the extended attributes of the link itself."
12609 #: ../src/guestfs-actions.pod:3421
12610 msgid "guestfs_list_devices"
12615 #: ../src/guestfs-actions.pod:3423
12619 " guestfs_list_devices (guestfs_h *g);\n"
12625 #: ../src/guestfs-actions.pod:3426 ../fish/guestfish-actions.pod:2377
12626 msgid "List all the block devices."
12631 #: ../src/guestfs-actions.pod:3428 ../fish/guestfish-actions.pod:2379
12632 msgid "The full block device names are returned, eg. C</dev/sda>."
12637 #: ../src/guestfs-actions.pod:3438
12638 msgid "guestfs_list_filesystems"
12643 #: ../src/guestfs-actions.pod:3440
12647 " guestfs_list_filesystems (guestfs_h *g);\n"
12653 #: ../src/guestfs-actions.pod:3443 ../fish/guestfish-actions.pod:2387
12655 "This inspection command looks for filesystems on partitions, block devices "
12656 "and logical volumes, returning a list of devices containing filesystems and "
12662 #: ../src/guestfs-actions.pod:3447 ../fish/guestfish-actions.pod:2391
12664 "The return value is a hash, where the keys are the devices containing "
12665 "filesystems, and the values are the filesystem types. For example:"
12670 #: ../src/guestfs-actions.pod:3451 ../fish/guestfish-actions.pod:2395
12673 " \"/dev/sda1\" => \"ntfs\"\n"
12674 " \"/dev/sda2\" => \"ext2\"\n"
12675 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
12676 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
12682 #: ../src/guestfs-actions.pod:3456 ../fish/guestfish-actions.pod:2400
12684 "The value can have the special value \"unknown\", meaning the content of the "
12685 "device is undetermined or empty. \"swap\" means a Linux swap partition."
12690 #: ../src/guestfs-actions.pod:3460
12692 "This command runs other libguestfs commands, which might include "
12693 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
12694 "soon after launch and only when nothing is mounted."
12699 #: ../src/guestfs-actions.pod:3464
12701 "Not all of the filesystems returned will be mountable. In particular, swap "
12702 "partitions are returned in the list. Also this command does not check that "
12703 "each filesystem found is valid and mountable, and some filesystems might be "
12704 "mountable but require special options. Filesystems may not all belong to a "
12705 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
12710 #: ../src/guestfs-actions.pod:3478 ../src/guestfs-actions.pod:5083
12711 msgid "(Added in 1.5.15)"
12716 #: ../src/guestfs-actions.pod:3480
12717 msgid "guestfs_list_partitions"
12722 #: ../src/guestfs-actions.pod:3482
12726 " guestfs_list_partitions (guestfs_h *g);\n"
12732 #: ../src/guestfs-actions.pod:3485 ../fish/guestfish-actions.pod:2420
12733 msgid "List all the partitions detected on all block devices."
12738 #: ../src/guestfs-actions.pod:3487 ../fish/guestfish-actions.pod:2422
12739 msgid "The full partition device names are returned, eg. C</dev/sda1>"
12744 #: ../src/guestfs-actions.pod:3489
12746 "This does not return logical volumes. For that you will need to call "
12752 #: ../src/guestfs-actions.pod:3500
12758 #: ../src/guestfs-actions.pod:3502
12762 " guestfs_ll (guestfs_h *g,\n"
12763 " const char *directory);\n"
12769 #: ../src/guestfs-actions.pod:3506 ../fish/guestfish-actions.pod:2433
12771 "List the files in C<directory> (relative to the root directory, there is no "
12772 "cwd) in the format of 'ls -la'."
12777 #: ../src/guestfs-actions.pod:3509 ../fish/guestfish-actions.pod:2436
12779 "This command is mostly useful for interactive sessions. It is I<not> "
12780 "intended that you try to parse the output string."
12785 #: ../src/guestfs-actions.pod:3517
12791 #: ../src/guestfs-actions.pod:3519
12795 " guestfs_ln (guestfs_h *g,\n"
12796 " const char *target,\n"
12797 " const char *linkname);\n"
12803 #: ../src/guestfs-actions.pod:3524 ../fish/guestfish-actions.pod:2443
12804 msgid "This command creates a hard link using the C<ln> command."
12809 #: ../src/guestfs-actions.pod:3530
12810 msgid "guestfs_ln_f"
12815 #: ../src/guestfs-actions.pod:3532
12819 " guestfs_ln_f (guestfs_h *g,\n"
12820 " const char *target,\n"
12821 " const char *linkname);\n"
12827 #: ../src/guestfs-actions.pod:3537 ../fish/guestfish-actions.pod:2449
12829 "This command creates a hard link using the C<ln -f> command. The C<-f> "
12830 "option removes the link (C<linkname>) if it exists already."
12835 #: ../src/guestfs-actions.pod:3544
12836 msgid "guestfs_ln_s"
12841 #: ../src/guestfs-actions.pod:3546
12845 " guestfs_ln_s (guestfs_h *g,\n"
12846 " const char *target,\n"
12847 " const char *linkname);\n"
12853 #: ../src/guestfs-actions.pod:3551 ../fish/guestfish-actions.pod:2456
12854 msgid "This command creates a symbolic link using the C<ln -s> command."
12859 #: ../src/guestfs-actions.pod:3557
12860 msgid "guestfs_ln_sf"
12865 #: ../src/guestfs-actions.pod:3559
12869 " guestfs_ln_sf (guestfs_h *g,\n"
12870 " const char *target,\n"
12871 " const char *linkname);\n"
12877 #: ../src/guestfs-actions.pod:3564 ../fish/guestfish-actions.pod:2462
12879 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
12880 "option removes the link (C<linkname>) if it exists already."
12885 #: ../src/guestfs-actions.pod:3571
12886 msgid "guestfs_lremovexattr"
12891 #: ../src/guestfs-actions.pod:3573
12895 " guestfs_lremovexattr (guestfs_h *g,\n"
12896 " const char *xattr,\n"
12897 " const char *path);\n"
12903 #: ../src/guestfs-actions.pod:3578
12905 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
12906 "link, then it removes an extended attribute of the link itself."
12911 #: ../src/guestfs-actions.pod:3586
12917 #: ../src/guestfs-actions.pod:3588
12921 " guestfs_ls (guestfs_h *g,\n"
12922 " const char *directory);\n"
12928 #: ../src/guestfs-actions.pod:3592 ../fish/guestfish-actions.pod:2477
12930 "List the files in C<directory> (relative to the root directory, there is no "
12931 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
12936 #: ../src/guestfs-actions.pod:3596
12938 "This command is mostly useful for interactive sessions. Programs should "
12939 "probably use C<guestfs_readdir> instead."
12944 #: ../src/guestfs-actions.pod:3605
12945 msgid "guestfs_lsetxattr"
12950 #: ../src/guestfs-actions.pod:3607
12954 " guestfs_lsetxattr (guestfs_h *g,\n"
12955 " const char *xattr,\n"
12956 " const char *val,\n"
12958 " const char *path);\n"
12964 #: ../src/guestfs-actions.pod:3614
12966 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
12967 "then it sets an extended attribute of the link itself."
12972 #: ../src/guestfs-actions.pod:3622
12973 msgid "guestfs_lstat"
12978 #: ../src/guestfs-actions.pod:3624
12981 " struct guestfs_stat *\n"
12982 " guestfs_lstat (guestfs_h *g,\n"
12983 " const char *path);\n"
12989 #: ../src/guestfs-actions.pod:3628 ../src/guestfs-actions.pod:6182
12990 #: ../fish/guestfish-actions.pod:2496 ../fish/guestfish-actions.pod:4161
12991 msgid "Returns file information for the given C<path>."
12996 #: ../src/guestfs-actions.pod:3630
12998 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
12999 "link, then the link is stat-ed, not the file it refers to."
13004 #: ../src/guestfs-actions.pod:3634 ../fish/guestfish-actions.pod:2502
13005 msgid "This is the same as the C<lstat(2)> system call."
13010 #: ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:6186
13012 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
13013 "error. I<The caller must call C<guestfs_free_stat> after use>."
13018 #: ../src/guestfs-actions.pod:3640 ../src/guestfs-actions.pod:6190
13019 #: ../src/guestfs-actions.pod:6208 ../src/guestfs-actions.pod:6589
13020 msgid "(Added in 0.9.2)"
13025 #: ../src/guestfs-actions.pod:3642
13026 msgid "guestfs_lstatlist"
13031 #: ../src/guestfs-actions.pod:3644
13034 " struct guestfs_stat_list *\n"
13035 " guestfs_lstatlist (guestfs_h *g,\n"
13036 " const char *path,\n"
13037 " char *const *names);\n"
13043 #: ../src/guestfs-actions.pod:3649
13045 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
13046 "files, where all files are in the directory C<path>. C<names> is the list "
13047 "of files from this directory."
13052 #: ../src/guestfs-actions.pod:3653 ../fish/guestfish-actions.pod:2512
13054 "On return you get a list of stat structs, with a one-to-one correspondence "
13055 "to the C<names> list. If any name did not exist or could not be lstat'd, "
13056 "then the C<ino> field of that structure is set to C<-1>."
13061 #: ../src/guestfs-actions.pod:3658
13063 "This call is intended for programs that want to efficiently list a directory "
13064 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
13065 "for a similarly efficient call for getting extended attributes. Very long "
13066 "directory listings might cause the protocol message size to be exceeded, "
13067 "causing this call to fail. The caller must split up such requests into "
13068 "smaller groups of names."
13073 #: ../src/guestfs-actions.pod:3666
13075 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
13076 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
13081 #: ../src/guestfs-actions.pod:3672
13082 msgid "guestfs_luks_add_key"
13087 #: ../src/guestfs-actions.pod:3674
13091 " guestfs_luks_add_key (guestfs_h *g,\n"
13092 " const char *device,\n"
13093 " const char *key,\n"
13094 " const char *newkey,\n"
13101 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2529
13103 "This command adds a new key on LUKS device C<device>. C<key> is any "
13104 "existing key, and is used to access the device. C<newkey> is the new key to "
13105 "add. C<keyslot> is the key slot that will be replaced."
13110 #: ../src/guestfs-actions.pod:3686
13112 "Note that if C<keyslot> already contains a key, then this command will "
13113 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
13118 #: ../src/guestfs-actions.pod:3692 ../src/guestfs-actions.pod:3732
13119 #: ../src/guestfs-actions.pod:3755 ../src/guestfs-actions.pod:3775
13120 #: ../src/guestfs-actions.pod:3807 ../src/guestfs-actions.pod:3826
13122 "This function takes a key or passphrase parameter which could contain "
13123 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
13129 #: ../src/guestfs-actions.pod:3696 ../src/guestfs-actions.pod:3736
13130 #: ../src/guestfs-actions.pod:3759 ../src/guestfs-actions.pod:3779
13131 msgid "(Added in 1.5.2)"
13136 #: ../src/guestfs-actions.pod:3698
13137 msgid "guestfs_luks_close"
13142 #: ../src/guestfs-actions.pod:3700
13146 " guestfs_luks_close (guestfs_h *g,\n"
13147 " const char *device);\n"
13153 #: ../src/guestfs-actions.pod:3704
13155 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
13156 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
13157 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
13158 "underlying block device."
13163 #: ../src/guestfs-actions.pod:3712 ../src/guestfs-actions.pod:3811
13164 #: ../src/guestfs-actions.pod:3830 ../src/guestfs-actions.pod:3880
13165 #: ../src/guestfs-actions.pod:3928
13166 msgid "(Added in 1.5.1)"
13171 #: ../src/guestfs-actions.pod:3714
13172 msgid "guestfs_luks_format"
13177 #: ../src/guestfs-actions.pod:3716
13181 " guestfs_luks_format (guestfs_h *g,\n"
13182 " const char *device,\n"
13183 " const char *key,\n"
13190 #: ../src/guestfs-actions.pod:3722 ../fish/guestfish-actions.pod:2555
13192 "This command erases existing data on C<device> and formats the device as a "
13193 "LUKS encrypted device. C<key> is the initial key, which is added to key "
13194 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
13199 #: ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:3752
13200 #: ../src/guestfs-actions.pod:3892 ../src/guestfs-actions.pod:4834
13201 #: ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:6017
13202 #: ../src/guestfs-actions.pod:6040 ../src/guestfs-actions.pod:6066
13203 #: ../src/guestfs-actions.pod:7226 ../fish/guestfish-actions.pod:2563
13204 #: ../fish/guestfish-actions.pod:2576 ../fish/guestfish-actions.pod:2660
13205 #: ../fish/guestfish-actions.pod:3234 ../fish/guestfish-actions.pod:3754
13206 #: ../fish/guestfish-actions.pod:4060 ../fish/guestfish-actions.pod:4076
13207 #: ../fish/guestfish-actions.pod:4091 ../fish/guestfish-actions.pod:4806
13209 "B<This command is dangerous. Without careful use you can easily destroy all "
13215 #: ../src/guestfs-actions.pod:3738
13216 msgid "guestfs_luks_format_cipher"
13221 #: ../src/guestfs-actions.pod:3740
13225 " guestfs_luks_format_cipher (guestfs_h *g,\n"
13226 " const char *device,\n"
13227 " const char *key,\n"
13229 " const char *cipher);\n"
13235 #: ../src/guestfs-actions.pod:3747
13237 "This command is the same as C<guestfs_luks_format> but it also allows you to "
13238 "set the C<cipher> used."
13243 #: ../src/guestfs-actions.pod:3761
13244 msgid "guestfs_luks_kill_slot"
13249 #: ../src/guestfs-actions.pod:3763
13253 " guestfs_luks_kill_slot (guestfs_h *g,\n"
13254 " const char *device,\n"
13255 " const char *key,\n"
13262 #: ../src/guestfs-actions.pod:3769 ../fish/guestfish-actions.pod:2583
13264 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
13265 "device C<device>. C<key> must be one of the I<other> keys."
13270 #: ../src/guestfs-actions.pod:3781
13271 msgid "guestfs_luks_open"
13276 #: ../src/guestfs-actions.pod:3783
13280 " guestfs_luks_open (guestfs_h *g,\n"
13281 " const char *device,\n"
13282 " const char *key,\n"
13283 " const char *mapname);\n"
13289 #: ../src/guestfs-actions.pod:3789 ../fish/guestfish-actions.pod:2594
13291 "This command opens a block device which has been encrypted according to the "
13292 "Linux Unified Key Setup (LUKS) standard."
13297 #: ../src/guestfs-actions.pod:3792 ../fish/guestfish-actions.pod:2597
13298 msgid "C<device> is the encrypted block device or partition."
13303 #: ../src/guestfs-actions.pod:3794 ../fish/guestfish-actions.pod:2599
13305 "The caller must supply one of the keys associated with the LUKS block "
13306 "device, in the C<key> parameter."
13311 #: ../src/guestfs-actions.pod:3797 ../fish/guestfish-actions.pod:2602
13313 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
13314 "writes to this block device are decrypted from and encrypted to the "
13315 "underlying C<device> respectively."
13320 #: ../src/guestfs-actions.pod:3801
13322 "If this block device contains LVM volume groups, then calling "
13323 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
13329 #: ../src/guestfs-actions.pod:3813
13330 msgid "guestfs_luks_open_ro"
13335 #: ../src/guestfs-actions.pod:3815
13339 " guestfs_luks_open_ro (guestfs_h *g,\n"
13340 " const char *device,\n"
13341 " const char *key,\n"
13342 " const char *mapname);\n"
13348 #: ../src/guestfs-actions.pod:3821
13350 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
13356 #: ../src/guestfs-actions.pod:3832
13357 msgid "guestfs_lvcreate"
13362 #: ../src/guestfs-actions.pod:3834
13366 " guestfs_lvcreate (guestfs_h *g,\n"
13367 " const char *logvol,\n"
13368 " const char *volgroup,\n"
13375 #: ../src/guestfs-actions.pod:3840 ../fish/guestfish-actions.pod:2627
13377 "This creates an LVM logical volume called C<logvol> on the volume group "
13378 "C<volgroup>, with C<size> megabytes."
13383 #: ../src/guestfs-actions.pod:3847
13384 msgid "guestfs_lvm_canonical_lv_name"
13389 #: ../src/guestfs-actions.pod:3849
13393 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
13394 " const char *lvname);\n"
13400 #: ../src/guestfs-actions.pod:3853 ../fish/guestfish-actions.pod:2634
13402 "This converts alternative naming schemes for LVs that you might find to the "
13403 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
13409 #: ../src/guestfs-actions.pod:3857 ../fish/guestfish-actions.pod:2638
13411 "This command returns an error if the C<lvname> parameter does not refer to a "
13417 #: ../src/guestfs-actions.pod:3860
13418 msgid "See also C<guestfs_is_lv>."
13423 #: ../src/guestfs-actions.pod:3865
13424 msgid "(Added in 1.5.24)"
13429 #: ../src/guestfs-actions.pod:3867
13430 msgid "guestfs_lvm_clear_filter"
13435 #: ../src/guestfs-actions.pod:3869
13439 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
13445 #: ../src/guestfs-actions.pod:3872
13447 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
13448 "see every block device."
13453 #: ../src/guestfs-actions.pod:3875 ../src/guestfs-actions.pod:3917
13454 #: ../fish/guestfish-actions.pod:2650 ../fish/guestfish-actions.pod:2681
13456 "This command also clears the LVM cache and performs a volume group scan."
13461 #: ../src/guestfs-actions.pod:3882
13462 msgid "guestfs_lvm_remove_all"
13467 #: ../src/guestfs-actions.pod:3884
13471 " guestfs_lvm_remove_all (guestfs_h *g);\n"
13477 #: ../src/guestfs-actions.pod:3887 ../fish/guestfish-actions.pod:2657
13479 "This command removes all LVM logical volumes, volume groups and physical "
13485 #: ../src/guestfs-actions.pod:3897
13486 msgid "guestfs_lvm_set_filter"
13491 #: ../src/guestfs-actions.pod:3899
13495 " guestfs_lvm_set_filter (guestfs_h *g,\n"
13496 " char *const *devices);\n"
13502 #: ../src/guestfs-actions.pod:3903 ../fish/guestfish-actions.pod:2667
13504 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
13505 "block devices in the list C<devices>, and will ignore all other attached "
13511 #: ../src/guestfs-actions.pod:3907 ../fish/guestfish-actions.pod:2671
13513 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
13514 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
13515 "there are two types of duplication possible: either cloned PVs/VGs which "
13516 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
13517 "same name. In normal operation you cannot create this situation, but you "
13518 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
13519 "inside the LVM metadata."
13524 #: ../src/guestfs-actions.pod:3920 ../fish/guestfish-actions.pod:2684
13525 msgid "You can filter whole block devices or individual partitions."
13530 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:2686
13532 "You cannot use this if any VG is currently in use (eg. contains a mounted "
13533 "filesystem), even if you are not filtering out that VG."
13538 #: ../src/guestfs-actions.pod:3930
13539 msgid "guestfs_lvremove"
13544 #: ../src/guestfs-actions.pod:3932
13548 " guestfs_lvremove (guestfs_h *g,\n"
13549 " const char *device);\n"
13555 #: ../src/guestfs-actions.pod:3936 ../fish/guestfish-actions.pod:2694
13557 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
13558 "LV, such as C</dev/VG/LV>."
13563 #: ../src/guestfs-actions.pod:3939 ../fish/guestfish-actions.pod:2697
13565 "You can also remove all LVs in a volume group by specifying the VG name, C</"
13571 #: ../src/guestfs-actions.pod:3944 ../src/guestfs-actions.pod:5180
13572 #: ../src/guestfs-actions.pod:6965
13573 msgid "(Added in 1.0.13)"
13578 #: ../src/guestfs-actions.pod:3946
13579 msgid "guestfs_lvrename"
13584 #: ../src/guestfs-actions.pod:3948
13588 " guestfs_lvrename (guestfs_h *g,\n"
13589 " const char *logvol,\n"
13590 " const char *newlogvol);\n"
13596 #: ../src/guestfs-actions.pod:3953 ../fish/guestfish-actions.pod:2704
13597 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
13602 #: ../src/guestfs-actions.pod:3957 ../src/guestfs-actions.pod:6978
13603 msgid "(Added in 1.0.83)"
13608 #: ../src/guestfs-actions.pod:3959
13609 msgid "guestfs_lvresize"
13614 #: ../src/guestfs-actions.pod:3961
13618 " guestfs_lvresize (guestfs_h *g,\n"
13619 " const char *device,\n"
13626 #: ../src/guestfs-actions.pod:3966 ../fish/guestfish-actions.pod:2710
13628 "This resizes (expands or shrinks) an existing LVM logical volume to "
13629 "C<mbytes>. When reducing, data in the reduced part is lost."
13634 #: ../src/guestfs-actions.pod:3974
13635 msgid "guestfs_lvresize_free"
13640 #: ../src/guestfs-actions.pod:3976
13644 " guestfs_lvresize_free (guestfs_h *g,\n"
13645 " const char *lv,\n"
13652 #: ../src/guestfs-actions.pod:3981 ../fish/guestfish-actions.pod:2718
13654 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
13655 "remaining free space in the volume group. Commonly you would call this with "
13656 "pc = 100 which expands the logical volume as much as possible, using all "
13657 "remaining free space in the volume group."
13662 #: ../src/guestfs-actions.pod:3989
13663 msgid "(Added in 1.3.3)"
13668 #: ../src/guestfs-actions.pod:3991
13669 msgid "guestfs_lvs"
13674 #: ../src/guestfs-actions.pod:3993
13678 " guestfs_lvs (guestfs_h *g);\n"
13684 #: ../src/guestfs-actions.pod:3996 ../fish/guestfish-actions.pod:2728
13686 "List all the logical volumes detected. This is the equivalent of the L<lvs"
13692 #: ../src/guestfs-actions.pod:3999 ../fish/guestfish-actions.pod:2731
13694 "This returns a list of the logical volume device names (eg. C</dev/"
13695 "VolGroup00/LogVol00>)."
13700 #: ../src/guestfs-actions.pod:4002
13701 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
13706 #: ../src/guestfs-actions.pod:4010
13707 msgid "guestfs_lvs_full"
13712 #: ../src/guestfs-actions.pod:4012
13715 " struct guestfs_lvm_lv_list *\n"
13716 " guestfs_lvs_full (guestfs_h *g);\n"
13722 #: ../src/guestfs-actions.pod:4015 ../fish/guestfish-actions.pod:2740
13724 "List all the logical volumes detected. This is the equivalent of the L<lvs"
13725 "(8)> command. The \"full\" version includes all fields."
13730 #: ../src/guestfs-actions.pod:4018
13732 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
13733 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
13738 #: ../src/guestfs-actions.pod:4024
13739 msgid "guestfs_lvuuid"
13744 #: ../src/guestfs-actions.pod:4026
13748 " guestfs_lvuuid (guestfs_h *g,\n"
13749 " const char *device);\n"
13755 #: ../src/guestfs-actions.pod:4030 ../fish/guestfish-actions.pod:2747
13756 msgid "This command returns the UUID of the LVM LV C<device>."
13761 #: ../src/guestfs-actions.pod:4037
13762 msgid "guestfs_lxattrlist"
13767 #: ../src/guestfs-actions.pod:4039
13770 " struct guestfs_xattr_list *\n"
13771 " guestfs_lxattrlist (guestfs_h *g,\n"
13772 " const char *path,\n"
13773 " char *const *names);\n"
13779 #: ../src/guestfs-actions.pod:4044 ../fish/guestfish-actions.pod:2753
13781 "This call allows you to get the extended attributes of multiple files, where "
13782 "all files are in the directory C<path>. C<names> is the list of files from "
13788 #: ../src/guestfs-actions.pod:4048 ../fish/guestfish-actions.pod:2757
13790 "On return you get a flat list of xattr structs which must be interpreted "
13791 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
13792 "C<attrval> in this struct is zero-length to indicate there was an error "
13793 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
13794 "number (the number of following attributes for this file, which could be C<"
13795 "\"0\">). Then after the first xattr struct are the zero or more attributes "
13796 "for the first named file. This repeats for the second and subsequent files."
13801 #: ../src/guestfs-actions.pod:4058
13803 "This call is intended for programs that want to efficiently list a directory "
13804 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
13805 "a similarly efficient call for getting standard stats. Very long directory "
13806 "listings might cause the protocol message size to be exceeded, causing this "
13807 "call to fail. The caller must split up such requests into smaller groups of "
13813 #: ../src/guestfs-actions.pod:4072
13814 msgid "guestfs_mkdir"
13819 #: ../src/guestfs-actions.pod:4074
13823 " guestfs_mkdir (guestfs_h *g,\n"
13824 " const char *path);\n"
13830 #: ../src/guestfs-actions.pod:4078 ../fish/guestfish-actions.pod:2779
13831 msgid "Create a directory named C<path>."
13836 #: ../src/guestfs-actions.pod:4084
13837 msgid "guestfs_mkdir_mode"
13842 #: ../src/guestfs-actions.pod:4086
13846 " guestfs_mkdir_mode (guestfs_h *g,\n"
13847 " const char *path,\n"
13854 #: ../src/guestfs-actions.pod:4091 ../fish/guestfish-actions.pod:2785
13856 "This command creates a directory, setting the initial permissions of the "
13857 "directory to C<mode>."
13862 #: ../src/guestfs-actions.pod:4094 ../fish/guestfish-actions.pod:2788
13864 "For common Linux filesystems, the actual mode which is set will be C<mode & "
13865 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
13871 #: ../src/guestfs-actions.pod:4098
13872 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
13877 #: ../src/guestfs-actions.pod:4104
13878 msgid "guestfs_mkdir_p"
13883 #: ../src/guestfs-actions.pod:4106
13887 " guestfs_mkdir_p (guestfs_h *g,\n"
13888 " const char *path);\n"
13894 #: ../src/guestfs-actions.pod:4110 ../fish/guestfish-actions.pod:2798
13896 "Create a directory named C<path>, creating any parent directories as "
13897 "necessary. This is like the C<mkdir -p> shell command."
13902 #: ../src/guestfs-actions.pod:4117
13903 msgid "guestfs_mkdtemp"
13908 #: ../src/guestfs-actions.pod:4119
13912 " guestfs_mkdtemp (guestfs_h *g,\n"
13913 " const char *template);\n"
13919 #: ../src/guestfs-actions.pod:4123 ../fish/guestfish-actions.pod:2805
13921 "This command creates a temporary directory. The C<template> parameter "
13922 "should be a full pathname for the temporary directory name with the final "
13923 "six characters being \"XXXXXX\"."
13928 #: ../src/guestfs-actions.pod:4128 ../fish/guestfish-actions.pod:2810
13930 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
13931 "being suitable for Windows filesystems."
13936 #: ../src/guestfs-actions.pod:4131 ../fish/guestfish-actions.pod:2813
13937 msgid "The name of the temporary directory that was created is returned."
13942 #: ../src/guestfs-actions.pod:4134 ../fish/guestfish-actions.pod:2816
13943 msgid "The temporary directory is created with mode 0700 and is owned by root."
13948 #: ../src/guestfs-actions.pod:4137 ../fish/guestfish-actions.pod:2819
13950 "The caller is responsible for deleting the temporary directory and its "
13951 "contents after use."
13956 #: ../src/guestfs-actions.pod:4140 ../fish/guestfish-actions.pod:2822
13957 msgid "See also: L<mkdtemp(3)>"
13962 #: ../src/guestfs-actions.pod:4147
13963 msgid "guestfs_mke2fs_J"
13968 #: ../src/guestfs-actions.pod:4149
13972 " guestfs_mke2fs_J (guestfs_h *g,\n"
13973 " const char *fstype,\n"
13974 " int blocksize,\n"
13975 " const char *device,\n"
13976 " const char *journal);\n"
13982 #: ../src/guestfs-actions.pod:4156 ../fish/guestfish-actions.pod:2828
13984 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13985 "C<journal>. It is equivalent to the command:"
13990 #: ../src/guestfs-actions.pod:4160 ../fish/guestfish-actions.pod:2832
13993 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
13999 #: ../src/guestfs-actions.pod:4162
14000 msgid "See also C<guestfs_mke2journal>."
14005 #: ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4184
14006 #: ../src/guestfs-actions.pod:4202 ../src/guestfs-actions.pod:4218
14007 #: ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4246
14008 #: ../src/guestfs-actions.pod:4305 ../src/guestfs-actions.pod:4570
14009 msgid "(Added in 1.0.68)"
14014 #: ../src/guestfs-actions.pod:4168
14015 msgid "guestfs_mke2fs_JL"
14020 #: ../src/guestfs-actions.pod:4170
14024 " guestfs_mke2fs_JL (guestfs_h *g,\n"
14025 " const char *fstype,\n"
14026 " int blocksize,\n"
14027 " const char *device,\n"
14028 " const char *label);\n"
14034 #: ../src/guestfs-actions.pod:4177 ../fish/guestfish-actions.pod:2840
14036 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14037 "the journal labeled C<label>."
14042 #: ../src/guestfs-actions.pod:4180
14043 msgid "See also C<guestfs_mke2journal_L>."
14048 #: ../src/guestfs-actions.pod:4186
14049 msgid "guestfs_mke2fs_JU"
14054 #: ../src/guestfs-actions.pod:4188
14058 " guestfs_mke2fs_JU (guestfs_h *g,\n"
14059 " const char *fstype,\n"
14060 " int blocksize,\n"
14061 " const char *device,\n"
14062 " const char *uuid);\n"
14068 #: ../src/guestfs-actions.pod:4195 ../fish/guestfish-actions.pod:2849
14070 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14071 "the journal with UUID C<uuid>."
14076 #: ../src/guestfs-actions.pod:4198
14077 msgid "See also C<guestfs_mke2journal_U>."
14082 #: ../src/guestfs-actions.pod:4204
14083 msgid "guestfs_mke2journal"
14088 #: ../src/guestfs-actions.pod:4206
14092 " guestfs_mke2journal (guestfs_h *g,\n"
14093 " int blocksize,\n"
14094 " const char *device);\n"
14100 #: ../src/guestfs-actions.pod:4211 ../fish/guestfish-actions.pod:2858
14102 "This creates an ext2 external journal on C<device>. It is equivalent to the "
14108 #: ../src/guestfs-actions.pod:4214 ../fish/guestfish-actions.pod:2861
14111 " mke2fs -O journal_dev -b blocksize device\n"
14117 #: ../src/guestfs-actions.pod:4220
14118 msgid "guestfs_mke2journal_L"
14123 #: ../src/guestfs-actions.pod:4222
14127 " guestfs_mke2journal_L (guestfs_h *g,\n"
14128 " int blocksize,\n"
14129 " const char *label,\n"
14130 " const char *device);\n"
14136 #: ../src/guestfs-actions.pod:4228 ../fish/guestfish-actions.pod:2867
14137 msgid "This creates an ext2 external journal on C<device> with label C<label>."
14142 #: ../src/guestfs-actions.pod:4234
14143 msgid "guestfs_mke2journal_U"
14148 #: ../src/guestfs-actions.pod:4236
14152 " guestfs_mke2journal_U (guestfs_h *g,\n"
14153 " int blocksize,\n"
14154 " const char *uuid,\n"
14155 " const char *device);\n"
14161 #: ../src/guestfs-actions.pod:4242 ../fish/guestfish-actions.pod:2873
14162 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
14167 #: ../src/guestfs-actions.pod:4248
14168 msgid "guestfs_mkfifo"
14173 #: ../src/guestfs-actions.pod:4250
14177 " guestfs_mkfifo (guestfs_h *g,\n"
14179 " const char *path);\n"
14185 #: ../src/guestfs-actions.pod:4255
14187 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
14188 "is just a convenient wrapper around C<guestfs_mknod>."
14193 #: ../src/guestfs-actions.pod:4265
14194 msgid "guestfs_mkfs"
14199 #: ../src/guestfs-actions.pod:4267
14203 " guestfs_mkfs (guestfs_h *g,\n"
14204 " const char *fstype,\n"
14205 " const char *device);\n"
14211 #: ../src/guestfs-actions.pod:4272 ../fish/guestfish-actions.pod:2889
14213 "This creates a filesystem on C<device> (usually a partition or LVM logical "
14214 "volume). The filesystem type is C<fstype>, for example C<ext3>."
14219 #: ../src/guestfs-actions.pod:4280
14220 msgid "guestfs_mkfs_b"
14225 #: ../src/guestfs-actions.pod:4282
14229 " guestfs_mkfs_b (guestfs_h *g,\n"
14230 " const char *fstype,\n"
14231 " int blocksize,\n"
14232 " const char *device);\n"
14238 #: ../src/guestfs-actions.pod:4288
14240 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
14241 "block size of the resulting filesystem. Supported block sizes depend on the "
14242 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
14247 #: ../src/guestfs-actions.pod:4293 ../src/guestfs-actions.pod:4336
14248 #: ../fish/guestfish-actions.pod:2902 ../fish/guestfish-actions.pod:2929
14250 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
14256 #: ../src/guestfs-actions.pod:4298 ../fish/guestfish-actions.pod:2905
14258 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
14263 #: ../src/guestfs-actions.pod:4307
14264 msgid "guestfs_mkfs_opts"
14269 #: ../src/guestfs-actions.pod:4309
14273 " guestfs_mkfs_opts (guestfs_h *g,\n"
14274 " const char *fstype,\n"
14275 " const char *device,\n"
14281 #: ../src/guestfs-actions.pod:4320
14284 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
14285 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
14291 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:2916
14293 "This function creates a filesystem on C<device>. The filesystem type is "
14294 "C<fstype>, for example C<ext3>."
14299 #: ../src/guestfs-actions.pod:4330 ../fish/guestfish-actions.pod:2923
14300 msgid "C<blocksize>"
14305 #: ../src/guestfs-actions.pod:4332 ../fish/guestfish-actions.pod:2925
14307 "The filesystem block size. Supported block sizes depend on the filesystem "
14308 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
14313 #: ../src/guestfs-actions.pod:4339 ../fish/guestfish-actions.pod:2932
14314 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
14318 #: ../src/guestfs-actions.pod:4341 ../fish/guestfish-actions.pod:2934
14319 msgid "C<features>"
14323 #: ../src/guestfs-actions.pod:4343 ../fish/guestfish-actions.pod:2936
14324 msgid "This passes the C<-O> parameter to the external mkfs program."
14328 #: ../src/guestfs-actions.pod:4345 ../fish/guestfish-actions.pod:2938
14330 "For certain filesystem types, this allows extra filesystem features to be "
14331 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
14335 #: ../src/guestfs-actions.pod:4349 ../fish/guestfish-actions.pod:2942
14337 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
14342 #: ../src/guestfs-actions.pod:4356
14343 msgid "(Added in 1.7.19)"
14348 #: ../src/guestfs-actions.pod:4358
14349 msgid "guestfs_mkfs_opts_va"
14354 #: ../src/guestfs-actions.pod:4360
14358 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
14359 " const char *fstype,\n"
14360 " const char *device,\n"
14361 " va_list args);\n"
14367 #: ../src/guestfs-actions.pod:4366
14368 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
14373 #: ../src/guestfs-actions.pod:4370
14374 msgid "guestfs_mkfs_opts_argv"
14379 #: ../src/guestfs-actions.pod:4372
14383 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
14384 " const char *fstype,\n"
14385 " const char *device,\n"
14386 " const struct guestfs_mkfs_opts_argv *optargs);\n"
14392 #: ../src/guestfs-actions.pod:4378
14393 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
14398 #: ../src/guestfs-actions.pod:4382
14399 msgid "guestfs_mkmountpoint"
14404 #: ../src/guestfs-actions.pod:4384
14408 " guestfs_mkmountpoint (guestfs_h *g,\n"
14409 " const char *exemptpath);\n"
14415 #: ../src/guestfs-actions.pod:4388
14417 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
14418 "that can be used to create extra mountpoints before mounting the first "
14424 #: ../src/guestfs-actions.pod:4392 ../fish/guestfish-actions.pod:2957
14426 "These calls are I<only> necessary in some very limited circumstances, mainly "
14427 "the case where you want to mount a mix of unrelated and/or read-only "
14428 "filesystems together."
14433 #: ../src/guestfs-actions.pod:4396 ../fish/guestfish-actions.pod:2961
14435 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
14436 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
14437 "inside that. You can unpack this as follows in guestfish:"
14442 #: ../src/guestfs-actions.pod:4401 ../fish/guestfish-actions.pod:2966
14445 " add-ro Fedora-11-i686-Live.iso\n"
14447 " mkmountpoint /cd\n"
14448 " mkmountpoint /sqsh\n"
14449 " mkmountpoint /ext3fs\n"
14450 " mount /dev/sda /cd\n"
14451 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
14452 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
14458 #: ../src/guestfs-actions.pod:4410 ../fish/guestfish-actions.pod:2975
14459 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
14464 #: ../src/guestfs-actions.pod:4412
14466 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
14467 "may get unexpected errors if you try to mix these calls. It is safest to "
14468 "manually unmount filesystems and remove mountpoints after use."
14473 #: ../src/guestfs-actions.pod:4416
14475 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
14476 "first, so for this to work for manual mountpoints, you must ensure that the "
14477 "innermost mountpoints have the longest pathnames, as in the example code "
14483 #: ../src/guestfs-actions.pod:4421 ../fish/guestfish-actions.pod:2986
14485 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
14489 #: ../src/guestfs-actions.pod:4423
14491 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
14492 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
14493 "can also trigger these issues."
14498 #: ../src/guestfs-actions.pod:4429 ../src/guestfs-actions.pod:4688
14499 #: ../src/guestfs-actions.pod:5598
14500 msgid "(Added in 1.0.62)"
14505 #: ../src/guestfs-actions.pod:4431
14506 msgid "guestfs_mknod"
14511 #: ../src/guestfs-actions.pod:4433
14515 " guestfs_mknod (guestfs_h *g,\n"
14519 " const char *path);\n"
14525 #: ../src/guestfs-actions.pod:4440 ../fish/guestfish-actions.pod:2996
14527 "This call creates block or character special devices, or named pipes (FIFOs)."
14532 #: ../src/guestfs-actions.pod:4443 ../fish/guestfish-actions.pod:2999
14534 "The C<mode> parameter should be the mode, using the standard constants. "
14535 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
14536 "used when creating block and character special devices."
14541 #: ../src/guestfs-actions.pod:4448
14543 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
14544 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
14545 "regular file). These constants are available in the standard Linux header "
14546 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
14547 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
14548 "the appropriate constant for you."
14553 #: ../src/guestfs-actions.pod:4462
14554 msgid "guestfs_mknod_b"
14559 #: ../src/guestfs-actions.pod:4464
14563 " guestfs_mknod_b (guestfs_h *g,\n"
14567 " const char *path);\n"
14573 #: ../src/guestfs-actions.pod:4471
14575 "This call creates a block device node called C<path> with mode C<mode> and "
14576 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
14577 "wrapper around C<guestfs_mknod>."
14582 #: ../src/guestfs-actions.pod:4481
14583 msgid "guestfs_mknod_c"
14588 #: ../src/guestfs-actions.pod:4483
14592 " guestfs_mknod_c (guestfs_h *g,\n"
14596 " const char *path);\n"
14602 #: ../src/guestfs-actions.pod:4490
14604 "This call creates a char device node called C<path> with mode C<mode> and "
14605 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
14606 "wrapper around C<guestfs_mknod>."
14611 #: ../src/guestfs-actions.pod:4500
14612 msgid "guestfs_mkswap"
14617 #: ../src/guestfs-actions.pod:4502
14621 " guestfs_mkswap (guestfs_h *g,\n"
14622 " const char *device);\n"
14628 #: ../src/guestfs-actions.pod:4506 ../fish/guestfish-actions.pod:3038
14629 msgid "Create a swap partition on C<device>."
14634 #: ../src/guestfs-actions.pod:4512
14635 msgid "guestfs_mkswap_L"
14640 #: ../src/guestfs-actions.pod:4514
14644 " guestfs_mkswap_L (guestfs_h *g,\n"
14645 " const char *label,\n"
14646 " const char *device);\n"
14652 #: ../src/guestfs-actions.pod:4519 ../fish/guestfish-actions.pod:3044
14653 msgid "Create a swap partition on C<device> with label C<label>."
14658 #: ../src/guestfs-actions.pod:4521 ../fish/guestfish-actions.pod:3046
14660 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
14661 "sda>), just to a partition. This appears to be a limitation of the kernel "
14667 #: ../src/guestfs-actions.pod:4529
14668 msgid "guestfs_mkswap_U"
14673 #: ../src/guestfs-actions.pod:4531
14677 " guestfs_mkswap_U (guestfs_h *g,\n"
14678 " const char *uuid,\n"
14679 " const char *device);\n"
14685 #: ../src/guestfs-actions.pod:4536 ../fish/guestfish-actions.pod:3054
14686 msgid "Create a swap partition on C<device> with UUID C<uuid>."
14691 #: ../src/guestfs-actions.pod:4542
14692 msgid "guestfs_mkswap_file"
14697 #: ../src/guestfs-actions.pod:4544
14701 " guestfs_mkswap_file (guestfs_h *g,\n"
14702 " const char *path);\n"
14708 #: ../src/guestfs-actions.pod:4548 ../fish/guestfish-actions.pod:3060
14709 msgid "Create a swap file."
14714 #: ../src/guestfs-actions.pod:4550
14716 "This command just writes a swap file signature to an existing file. To "
14717 "create the file itself, use something like C<guestfs_fallocate>."
14722 #: ../src/guestfs-actions.pod:4557
14723 msgid "guestfs_modprobe"
14728 #: ../src/guestfs-actions.pod:4559
14732 " guestfs_modprobe (guestfs_h *g,\n"
14733 " const char *modulename);\n"
14739 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3069
14740 msgid "This loads a kernel module in the appliance."
14745 #: ../src/guestfs-actions.pod:4565 ../fish/guestfish-actions.pod:3071
14747 "The kernel module must have been whitelisted when libguestfs was built (see "
14748 "C<appliance/kmod.whitelist.in> in the source)."
14753 #: ../src/guestfs-actions.pod:4572
14754 msgid "guestfs_mount"
14759 #: ../src/guestfs-actions.pod:4574
14763 " guestfs_mount (guestfs_h *g,\n"
14764 " const char *device,\n"
14765 " const char *mountpoint);\n"
14771 #: ../src/guestfs-actions.pod:4579 ../fish/guestfish-actions.pod:3078
14773 "Mount a guest disk at a position in the filesystem. Block devices are named "
14774 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
14775 "those block devices contain partitions, they will have the usual names (eg. "
14776 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
14781 #: ../src/guestfs-actions.pod:4585 ../fish/guestfish-actions.pod:3084
14783 "The rules are the same as for L<mount(2)>: A filesystem must first be "
14784 "mounted on C</> before others can be mounted. Other filesystems can only be "
14785 "mounted on directories which already exist."
14790 #: ../src/guestfs-actions.pod:4590 ../fish/guestfish-actions.pod:3089
14792 "The mounted filesystem is writable, if we have sufficient permissions on the "
14793 "underlying device."
14798 #: ../src/guestfs-actions.pod:4593
14800 "B<Important note:> When you use this call, the filesystem options C<sync> "
14801 "and C<noatime> are set implicitly. This was originally done because we "
14802 "thought it would improve reliability, but it turns out that I<-o sync> has a "
14803 "very large negative performance impact and negligible effect on "
14804 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
14805 "in any code that needs performance, and instead use C<guestfs_mount_options> "
14806 "(use an empty string for the first parameter if you don't want any options)."
14811 #: ../src/guestfs-actions.pod:4607
14812 msgid "guestfs_mount_loop"
14817 #: ../src/guestfs-actions.pod:4609
14821 " guestfs_mount_loop (guestfs_h *g,\n"
14822 " const char *file,\n"
14823 " const char *mountpoint);\n"
14829 #: ../src/guestfs-actions.pod:4614 ../fish/guestfish-actions.pod:3106
14831 "This command lets you mount C<file> (a filesystem image in a file) on a "
14832 "mount point. It is entirely equivalent to the command C<mount -o loop file "
14838 #: ../src/guestfs-actions.pod:4622
14839 msgid "guestfs_mount_options"
14844 #: ../src/guestfs-actions.pod:4624
14848 " guestfs_mount_options (guestfs_h *g,\n"
14849 " const char *options,\n"
14850 " const char *device,\n"
14851 " const char *mountpoint);\n"
14857 #: ../src/guestfs-actions.pod:4630
14859 "This is the same as the C<guestfs_mount> command, but it allows you to set "
14860 "the mount options as for the L<mount(8)> I<-o> flag."
14865 #: ../src/guestfs-actions.pod:4634 ../fish/guestfish-actions.pod:3118
14867 "If the C<options> parameter is an empty string, then no options are passed "
14868 "(all options default to whatever the filesystem uses)."
14873 #: ../src/guestfs-actions.pod:4640 ../src/guestfs-actions.pod:4654
14874 #: ../src/guestfs-actions.pod:4671
14875 msgid "(Added in 1.0.10)"
14880 #: ../src/guestfs-actions.pod:4642
14881 msgid "guestfs_mount_ro"
14886 #: ../src/guestfs-actions.pod:4644
14890 " guestfs_mount_ro (guestfs_h *g,\n"
14891 " const char *device,\n"
14892 " const char *mountpoint);\n"
14898 #: ../src/guestfs-actions.pod:4649
14900 "This is the same as the C<guestfs_mount> command, but it mounts the "
14901 "filesystem with the read-only (I<-o ro>) flag."
14906 #: ../src/guestfs-actions.pod:4656
14907 msgid "guestfs_mount_vfs"
14912 #: ../src/guestfs-actions.pod:4658
14916 " guestfs_mount_vfs (guestfs_h *g,\n"
14917 " const char *options,\n"
14918 " const char *vfstype,\n"
14919 " const char *device,\n"
14920 " const char *mountpoint);\n"
14926 #: ../src/guestfs-actions.pod:4665
14928 "This is the same as the C<guestfs_mount> command, but it allows you to set "
14929 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
14935 #: ../src/guestfs-actions.pod:4673
14936 msgid "guestfs_mountpoints"
14941 #: ../src/guestfs-actions.pod:4675
14945 " guestfs_mountpoints (guestfs_h *g);\n"
14951 #: ../src/guestfs-actions.pod:4678
14953 "This call is similar to C<guestfs_mounts>. That call returns a list of "
14954 "devices. This one returns a hash table (map) of device name to directory "
14955 "where the device is mounted."
14960 #: ../src/guestfs-actions.pod:4690
14961 msgid "guestfs_mounts"
14966 #: ../src/guestfs-actions.pod:4692
14970 " guestfs_mounts (guestfs_h *g);\n"
14976 #: ../src/guestfs-actions.pod:4695 ../fish/guestfish-actions.pod:3149
14978 "This returns the list of currently mounted filesystems. It returns the list "
14979 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
14984 #: ../src/guestfs-actions.pod:4698 ../fish/guestfish-actions.pod:3152
14985 msgid "Some internal mounts are not shown."
14990 #: ../src/guestfs-actions.pod:4700
14991 msgid "See also: C<guestfs_mountpoints>"
14996 #: ../src/guestfs-actions.pod:4708
15002 #: ../src/guestfs-actions.pod:4710
15006 " guestfs_mv (guestfs_h *g,\n"
15007 " const char *src,\n"
15008 " const char *dest);\n"
15014 #: ../src/guestfs-actions.pod:4715 ../fish/guestfish-actions.pod:3160
15016 "This moves a file from C<src> to C<dest> where C<dest> is either a "
15017 "destination filename or destination directory."
15022 #: ../src/guestfs-actions.pod:4722
15023 msgid "guestfs_ntfs_3g_probe"
15028 #: ../src/guestfs-actions.pod:4724
15032 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
15034 " const char *device);\n"
15040 #: ../src/guestfs-actions.pod:4729 ../fish/guestfish-actions.pod:3167
15042 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
15043 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
15044 "write, and some cannot be mounted at all)."
15049 #: ../src/guestfs-actions.pod:4733 ../fish/guestfish-actions.pod:3171
15051 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
15052 "can be mounted read-write. Set it to false if you want to test if the "
15053 "volume can be mounted read-only."
15058 #: ../src/guestfs-actions.pod:4737 ../fish/guestfish-actions.pod:3175
15060 "The return value is an integer which C<0> if the operation would succeed, or "
15061 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
15066 #: ../src/guestfs-actions.pod:4743
15067 msgid "(Added in 1.0.43)"
15072 #: ../src/guestfs-actions.pod:4745
15073 msgid "guestfs_ntfsresize"
15078 #: ../src/guestfs-actions.pod:4747
15082 " guestfs_ntfsresize (guestfs_h *g,\n"
15083 " const char *device);\n"
15089 #: ../src/guestfs-actions.pod:4751 ../fish/guestfish-actions.pod:3183
15091 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
15092 "size of the underlying device. See also L<ntfsresize(8)>."
15097 #: ../src/guestfs-actions.pod:4759
15098 msgid "guestfs_ntfsresize_size"
15103 #: ../src/guestfs-actions.pod:4761
15107 " guestfs_ntfsresize_size (guestfs_h *g,\n"
15108 " const char *device,\n"
15109 " int64_t size);\n"
15115 #: ../src/guestfs-actions.pod:4766
15117 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
15118 "to specify the new size (in bytes) explicitly."
15123 #: ../src/guestfs-actions.pod:4771 ../src/guestfs-actions.pod:5207
15124 #: ../src/guestfs-actions.pod:5280 ../src/guestfs-actions.pod:5546
15125 #: ../src/guestfs-actions.pod:7113
15126 msgid "(Added in 1.3.14)"
15131 #: ../src/guestfs-actions.pod:4773
15132 msgid "guestfs_part_add"
15137 #: ../src/guestfs-actions.pod:4775
15141 " guestfs_part_add (guestfs_h *g,\n"
15142 " const char *device,\n"
15143 " const char *prlogex,\n"
15144 " int64_t startsect,\n"
15145 " int64_t endsect);\n"
15151 #: ../src/guestfs-actions.pod:4782
15153 "This command adds a partition to C<device>. If there is no partition table "
15154 "on the device, call C<guestfs_part_init> first."
15159 #: ../src/guestfs-actions.pod:4785 ../fish/guestfish-actions.pod:3201
15161 "The C<prlogex> parameter is the type of partition. Normally you should pass "
15162 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
15163 "C<logical>) and C<e> (or C<extended>) partition types."
15168 #: ../src/guestfs-actions.pod:4790 ../fish/guestfish-actions.pod:3206
15170 "C<startsect> and C<endsect> are the start and end of the partition in "
15171 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
15172 "from the end of the disk (C<-1> is the last sector)."
15177 #: ../src/guestfs-actions.pod:4794
15179 "Creating a partition which covers the whole disk is not so easy. Use "
15180 "C<guestfs_part_disk> to do that."
15185 #: ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4837
15186 #: ../src/guestfs-actions.pod:4890 ../src/guestfs-actions.pod:4968
15187 #: ../src/guestfs-actions.pod:5006 ../src/guestfs-actions.pod:5025
15188 #: ../src/guestfs-actions.pod:5065
15189 msgid "(Added in 1.0.78)"
15194 #: ../src/guestfs-actions.pod:4801
15195 msgid "guestfs_part_del"
15200 #: ../src/guestfs-actions.pod:4803
15204 " guestfs_part_del (guestfs_h *g,\n"
15205 " const char *device,\n"
15212 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3217
15213 msgid "This command deletes the partition numbered C<partnum> on C<device>."
15218 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3219
15220 "Note that in the case of MBR partitioning, deleting an extended partition "
15221 "also deletes any logical partitions it contains."
15226 #: ../src/guestfs-actions.pod:4818
15227 msgid "guestfs_part_disk"
15232 #: ../src/guestfs-actions.pod:4820
15236 " guestfs_part_disk (guestfs_h *g,\n"
15237 " const char *device,\n"
15238 " const char *parttype);\n"
15244 #: ../src/guestfs-actions.pod:4825
15246 "This command is simply a combination of C<guestfs_part_init> followed by "
15247 "C<guestfs_part_add> to create a single primary partition covering the whole "
15253 #: ../src/guestfs-actions.pod:4829
15255 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
15256 "possible values are described in C<guestfs_part_init>."
15261 #: ../src/guestfs-actions.pod:4839
15262 msgid "guestfs_part_get_bootable"
15267 #: ../src/guestfs-actions.pod:4841
15271 " guestfs_part_get_bootable (guestfs_h *g,\n"
15272 " const char *device,\n"
15279 #: ../src/guestfs-actions.pod:4846 ../fish/guestfish-actions.pod:3241
15281 "This command returns true if the partition C<partnum> on C<device> has the "
15282 "bootable flag set."
15287 #: ../src/guestfs-actions.pod:4849
15288 msgid "See also C<guestfs_part_set_bootable>."
15293 #: ../src/guestfs-actions.pod:4855
15294 msgid "guestfs_part_get_mbr_id"
15299 #: ../src/guestfs-actions.pod:4857
15303 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
15304 " const char *device,\n"
15311 #: ../src/guestfs-actions.pod:4862 ../fish/guestfish-actions.pod:3250
15313 "Returns the MBR type byte (also known as the ID byte) from the numbered "
15314 "partition C<partnum>."
15319 #: ../src/guestfs-actions.pod:4865 ../src/guestfs-actions.pod:5041
15321 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
15322 "undefined results for other partition table types (see "
15323 "C<guestfs_part_get_parttype>)."
15328 #: ../src/guestfs-actions.pod:4873
15329 msgid "guestfs_part_get_parttype"
15334 #: ../src/guestfs-actions.pod:4875
15338 " guestfs_part_get_parttype (guestfs_h *g,\n"
15339 " const char *device);\n"
15345 #: ../src/guestfs-actions.pod:4879 ../fish/guestfish-actions.pod:3261
15347 "This command examines the partition table on C<device> and returns the "
15348 "partition table type (format) being used."
15353 #: ../src/guestfs-actions.pod:4882
15355 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
15356 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
15357 "possible, although unusual. See C<guestfs_part_init> for a full list."
15362 #: ../src/guestfs-actions.pod:4892
15363 msgid "guestfs_part_init"
15368 #: ../src/guestfs-actions.pod:4894
15372 " guestfs_part_init (guestfs_h *g,\n"
15373 " const char *device,\n"
15374 " const char *parttype);\n"
15380 #: ../src/guestfs-actions.pod:4899 ../fish/guestfish-actions.pod:3273
15382 "This creates an empty partition table on C<device> of one of the partition "
15383 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
15384 "(for large disks)."
15389 #: ../src/guestfs-actions.pod:4903
15391 "Initially there are no partitions. Following this, you should call "
15392 "C<guestfs_part_add> for each partition required."
15397 #: ../src/guestfs-actions.pod:4906 ../fish/guestfish-actions.pod:3280
15398 msgid "Possible values for C<parttype> are:"
15403 #: ../src/guestfs-actions.pod:4910 ../fish/guestfish-actions.pod:3284
15404 msgid "B<efi> | B<gpt>"
15409 #: ../src/guestfs-actions.pod:4912 ../fish/guestfish-actions.pod:3286
15410 msgid "Intel EFI / GPT partition table."
15415 #: ../src/guestfs-actions.pod:4914 ../fish/guestfish-actions.pod:3288
15417 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
15418 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
15419 "the C<mbr> format."
15424 #: ../src/guestfs-actions.pod:4918 ../fish/guestfish-actions.pod:3292
15425 msgid "B<mbr> | B<msdos>"
15430 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3294
15432 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
15433 "Windows. This partition type will B<only> work for device sizes up to 2 "
15434 "TB. For large disks we recommend using C<gpt>."
15439 #: ../src/guestfs-actions.pod:4927 ../fish/guestfish-actions.pod:3301
15441 "Other partition table types that may work but are not supported include:"
15446 #: ../src/guestfs-actions.pod:4932 ../fish/guestfish-actions.pod:3306
15452 #: ../src/guestfs-actions.pod:4934 ../fish/guestfish-actions.pod:3308
15453 msgid "AIX disk labels."
15458 #: ../src/guestfs-actions.pod:4936 ../fish/guestfish-actions.pod:3310
15459 msgid "B<amiga> | B<rdb>"
15464 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3312
15465 msgid "Amiga \"Rigid Disk Block\" format."
15470 #: ../src/guestfs-actions.pod:4940 ../fish/guestfish-actions.pod:3314
15476 #: ../src/guestfs-actions.pod:4942 ../fish/guestfish-actions.pod:3316
15477 msgid "BSD disk labels."
15482 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3318
15488 #: ../src/guestfs-actions.pod:4946 ../fish/guestfish-actions.pod:3320
15489 msgid "DASD, used on IBM mainframes."
15494 #: ../src/guestfs-actions.pod:4948 ../fish/guestfish-actions.pod:3322
15500 #: ../src/guestfs-actions.pod:4950 ../fish/guestfish-actions.pod:3324
15501 msgid "MIPS/SGI volumes."
15506 #: ../src/guestfs-actions.pod:4952 ../fish/guestfish-actions.pod:3326
15512 #: ../src/guestfs-actions.pod:4954 ../fish/guestfish-actions.pod:3328
15513 msgid "Old Mac partition format. Modern Macs use C<gpt>."
15518 #: ../src/guestfs-actions.pod:4956 ../fish/guestfish-actions.pod:3330
15524 #: ../src/guestfs-actions.pod:4958 ../fish/guestfish-actions.pod:3332
15525 msgid "NEC PC-98 format, common in Japan apparently."
15530 #: ../src/guestfs-actions.pod:4960 ../fish/guestfish-actions.pod:3334
15536 #: ../src/guestfs-actions.pod:4962 ../fish/guestfish-actions.pod:3336
15537 msgid "Sun disk labels."
15542 #: ../src/guestfs-actions.pod:4970
15543 msgid "guestfs_part_list"
15548 #: ../src/guestfs-actions.pod:4972
15551 " struct guestfs_partition_list *\n"
15552 " guestfs_part_list (guestfs_h *g,\n"
15553 " const char *device);\n"
15559 #: ../src/guestfs-actions.pod:4976 ../fish/guestfish-actions.pod:3344
15561 "This command parses the partition table on C<device> and returns the list of "
15562 "partitions found."
15567 #: ../src/guestfs-actions.pod:4979 ../fish/guestfish-actions.pod:3347
15568 msgid "The fields in the returned structure are:"
15573 #: ../src/guestfs-actions.pod:4983 ../fish/guestfish-actions.pod:3351
15574 msgid "B<part_num>"
15579 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3353
15580 msgid "Partition number, counting from 1."
15585 #: ../src/guestfs-actions.pod:4987 ../fish/guestfish-actions.pod:3355
15586 msgid "B<part_start>"
15591 #: ../src/guestfs-actions.pod:4989
15593 "Start of the partition I<in bytes>. To get sectors you have to divide by "
15594 "the device's sector size, see C<guestfs_blockdev_getss>."
15599 #: ../src/guestfs-actions.pod:4992 ../fish/guestfish-actions.pod:3360
15600 msgid "B<part_end>"
15605 #: ../src/guestfs-actions.pod:4994 ../fish/guestfish-actions.pod:3362
15606 msgid "End of the partition in bytes."
15611 #: ../src/guestfs-actions.pod:4996 ../fish/guestfish-actions.pod:3364
15612 msgid "B<part_size>"
15617 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3366
15618 msgid "Size of the partition in bytes."
15623 #: ../src/guestfs-actions.pod:5002
15625 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
15626 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
15632 #: ../src/guestfs-actions.pod:5008
15633 msgid "guestfs_part_set_bootable"
15638 #: ../src/guestfs-actions.pod:5010
15642 " guestfs_part_set_bootable (guestfs_h *g,\n"
15643 " const char *device,\n"
15645 " int bootable);\n"
15651 #: ../src/guestfs-actions.pod:5016 ../fish/guestfish-actions.pod:3374
15653 "This sets the bootable flag on partition numbered C<partnum> on device "
15654 "C<device>. Note that partitions are numbered from 1."
15659 #: ../src/guestfs-actions.pod:5019 ../fish/guestfish-actions.pod:3377
15661 "The bootable flag is used by some operating systems (notably Windows) to "
15662 "determine which partition to boot from. It is by no means universally "
15668 #: ../src/guestfs-actions.pod:5027
15669 msgid "guestfs_part_set_mbr_id"
15674 #: ../src/guestfs-actions.pod:5029
15678 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
15679 " const char *device,\n"
15687 #: ../src/guestfs-actions.pod:5035 ../fish/guestfish-actions.pod:3385
15689 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
15690 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
15691 "documentation are in fact hexadecimal numbers, but usually documented "
15692 "without any leading \"0x\" which might be confusing."
15697 #: ../src/guestfs-actions.pod:5049
15698 msgid "guestfs_part_set_name"
15703 #: ../src/guestfs-actions.pod:5051
15707 " guestfs_part_set_name (guestfs_h *g,\n"
15708 " const char *device,\n"
15710 " const char *name);\n"
15716 #: ../src/guestfs-actions.pod:5057 ../fish/guestfish-actions.pod:3399
15718 "This sets the partition name on partition numbered C<partnum> on device "
15719 "C<device>. Note that partitions are numbered from 1."
15724 #: ../src/guestfs-actions.pod:5060 ../fish/guestfish-actions.pod:3402
15726 "The partition name can only be set on certain types of partition table. "
15727 "This works on C<gpt> but not on C<mbr> partitions."
15732 #: ../src/guestfs-actions.pod:5067
15733 msgid "guestfs_part_to_dev"
15738 #: ../src/guestfs-actions.pod:5069
15742 " guestfs_part_to_dev (guestfs_h *g,\n"
15743 " const char *partition);\n"
15749 #: ../src/guestfs-actions.pod:5073 ../fish/guestfish-actions.pod:3409
15751 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
15752 "partition number, returning the device name (eg. \"/dev/sdb\")."
15757 #: ../src/guestfs-actions.pod:5077
15759 "The named partition must exist, for example as a string returned from "
15760 "C<guestfs_list_partitions>."
15765 #: ../src/guestfs-actions.pod:5085
15766 msgid "guestfs_ping_daemon"
15771 #: ../src/guestfs-actions.pod:5087
15775 " guestfs_ping_daemon (guestfs_h *g);\n"
15781 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3420
15783 "This is a test probe into the guestfs daemon running inside the qemu "
15784 "subprocess. Calling this function checks that the daemon responds to the "
15785 "ping message, without affecting the daemon or attached block device(s) in "
15791 #: ../src/guestfs-actions.pod:5099
15792 msgid "guestfs_pread"
15797 #: ../src/guestfs-actions.pod:5101
15801 " guestfs_pread (guestfs_h *g,\n"
15802 " const char *path,\n"
15804 " int64_t offset,\n"
15805 " size_t *size_r);\n"
15811 #: ../src/guestfs-actions.pod:5108 ../fish/guestfish-actions.pod:3429
15813 "This command lets you read part of a file. It reads C<count> bytes of the "
15814 "file, starting at C<offset>, from file C<path>."
15819 #: ../src/guestfs-actions.pod:5111 ../src/guestfs-actions.pod:5137
15820 #: ../fish/guestfish-actions.pod:3432 ../fish/guestfish-actions.pod:3447
15822 "This may read fewer bytes than requested. For further details see the "
15823 "L<pread(2)> system call."
15828 #: ../src/guestfs-actions.pod:5114
15829 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
15834 #: ../src/guestfs-actions.pod:5125
15835 msgid "guestfs_pread_device"
15840 #: ../src/guestfs-actions.pod:5127
15844 " guestfs_pread_device (guestfs_h *g,\n"
15845 " const char *device,\n"
15847 " int64_t offset,\n"
15848 " size_t *size_r);\n"
15854 #: ../src/guestfs-actions.pod:5134 ../fish/guestfish-actions.pod:3444
15856 "This command lets you read part of a file. It reads C<count> bytes of "
15857 "C<device>, starting at C<offset>."
15862 #: ../src/guestfs-actions.pod:5140
15863 msgid "See also C<guestfs_pread>."
15868 #: ../src/guestfs-actions.pod:5149
15869 msgid "(Added in 1.5.21)"
15874 #: ../src/guestfs-actions.pod:5151
15875 msgid "guestfs_pvcreate"
15880 #: ../src/guestfs-actions.pod:5153
15884 " guestfs_pvcreate (guestfs_h *g,\n"
15885 " const char *device);\n"
15891 #: ../src/guestfs-actions.pod:5157 ../fish/guestfish-actions.pod:3459
15893 "This creates an LVM physical volume on the named C<device>, where C<device> "
15894 "should usually be a partition name such as C</dev/sda1>."
15899 #: ../src/guestfs-actions.pod:5165
15900 msgid "guestfs_pvremove"
15905 #: ../src/guestfs-actions.pod:5167
15909 " guestfs_pvremove (guestfs_h *g,\n"
15910 " const char *device);\n"
15916 #: ../src/guestfs-actions.pod:5171 ../fish/guestfish-actions.pod:3467
15918 "This wipes a physical volume C<device> so that LVM will no longer recognise "
15924 #: ../src/guestfs-actions.pod:5174 ../fish/guestfish-actions.pod:3470
15926 "The implementation uses the C<pvremove> command which refuses to wipe "
15927 "physical volumes that contain any volume groups, so you have to remove those "
15933 #: ../src/guestfs-actions.pod:5182
15934 msgid "guestfs_pvresize"
15939 #: ../src/guestfs-actions.pod:5184
15943 " guestfs_pvresize (guestfs_h *g,\n"
15944 " const char *device);\n"
15950 #: ../src/guestfs-actions.pod:5188 ../fish/guestfish-actions.pod:3478
15952 "This resizes (expands or shrinks) an existing LVM physical volume to match "
15953 "the new size of the underlying device."
15958 #: ../src/guestfs-actions.pod:5195
15959 msgid "guestfs_pvresize_size"
15964 #: ../src/guestfs-actions.pod:5197
15968 " guestfs_pvresize_size (guestfs_h *g,\n"
15969 " const char *device,\n"
15970 " int64_t size);\n"
15976 #: ../src/guestfs-actions.pod:5202
15978 "This command is the same as C<guestfs_pvresize> except that it allows you to "
15979 "specify the new size (in bytes) explicitly."
15984 #: ../src/guestfs-actions.pod:5209
15985 msgid "guestfs_pvs"
15990 #: ../src/guestfs-actions.pod:5211
15994 " guestfs_pvs (guestfs_h *g);\n"
16000 #: ../src/guestfs-actions.pod:5214 ../fish/guestfish-actions.pod:3492
16002 "List all the physical volumes detected. This is the equivalent of the L<pvs"
16008 #: ../src/guestfs-actions.pod:5217 ../fish/guestfish-actions.pod:3495
16010 "This returns a list of just the device names that contain PVs (eg. C</dev/"
16016 #: ../src/guestfs-actions.pod:5220
16017 msgid "See also C<guestfs_pvs_full>."
16022 #: ../src/guestfs-actions.pod:5228
16023 msgid "guestfs_pvs_full"
16028 #: ../src/guestfs-actions.pod:5230
16031 " struct guestfs_lvm_pv_list *\n"
16032 " guestfs_pvs_full (guestfs_h *g);\n"
16038 #: ../src/guestfs-actions.pod:5233 ../fish/guestfish-actions.pod:3504
16040 "List all the physical volumes detected. This is the equivalent of the L<pvs"
16041 "(8)> command. The \"full\" version includes all fields."
16046 #: ../src/guestfs-actions.pod:5236
16048 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
16049 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
16054 #: ../src/guestfs-actions.pod:5242
16055 msgid "guestfs_pvuuid"
16060 #: ../src/guestfs-actions.pod:5244
16064 " guestfs_pvuuid (guestfs_h *g,\n"
16065 " const char *device);\n"
16071 #: ../src/guestfs-actions.pod:5248 ../fish/guestfish-actions.pod:3511
16072 msgid "This command returns the UUID of the LVM PV C<device>."
16077 #: ../src/guestfs-actions.pod:5255
16078 msgid "guestfs_pwrite"
16083 #: ../src/guestfs-actions.pod:5257
16087 " guestfs_pwrite (guestfs_h *g,\n"
16088 " const char *path,\n"
16089 " const char *content,\n"
16090 " size_t content_size,\n"
16091 " int64_t offset);\n"
16097 #: ../src/guestfs-actions.pod:5264 ../fish/guestfish-actions.pod:3517
16099 "This command writes to part of a file. It writes the data buffer C<content> "
16100 "to the file C<path> starting at offset C<offset>."
16105 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3520
16107 "This command implements the L<pwrite(2)> system call, and like that system "
16108 "call it may not write the full data requested. The return value is the "
16109 "number of bytes that were actually written to the file. This could even be "
16110 "0, although short writes are unlikely for regular files in ordinary "
16116 #: ../src/guestfs-actions.pod:5273
16117 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
16122 #: ../src/guestfs-actions.pod:5282
16123 msgid "guestfs_pwrite_device"
16128 #: ../src/guestfs-actions.pod:5284
16132 " guestfs_pwrite_device (guestfs_h *g,\n"
16133 " const char *device,\n"
16134 " const char *content,\n"
16135 " size_t content_size,\n"
16136 " int64_t offset);\n"
16142 #: ../src/guestfs-actions.pod:5291 ../fish/guestfish-actions.pod:3535
16144 "This command writes to part of a device. It writes the data buffer "
16145 "C<content> to C<device> starting at offset C<offset>."
16150 #: ../src/guestfs-actions.pod:5294 ../fish/guestfish-actions.pod:3538
16152 "This command implements the L<pwrite(2)> system call, and like that system "
16153 "call it may not write the full data requested (although short writes to disk "
16154 "devices and partitions are probably impossible with standard Linux kernels)."
16159 #: ../src/guestfs-actions.pod:5299
16160 msgid "See also C<guestfs_pwrite>."
16165 #: ../src/guestfs-actions.pod:5306
16166 msgid "(Added in 1.5.20)"
16171 #: ../src/guestfs-actions.pod:5308
16172 msgid "guestfs_read_file"
16177 #: ../src/guestfs-actions.pod:5310
16181 " guestfs_read_file (guestfs_h *g,\n"
16182 " const char *path,\n"
16183 " size_t *size_r);\n"
16189 #: ../src/guestfs-actions.pod:5315 ../fish/guestfish-actions.pod:3552
16190 msgid "This calls returns the contents of the file C<path> as a buffer."
16195 #: ../src/guestfs-actions.pod:5318
16197 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
16198 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
16199 "function is limited in the total size of file that can be handled."
16204 #: ../src/guestfs-actions.pod:5330
16205 msgid "(Added in 1.0.63)"
16210 #: ../src/guestfs-actions.pod:5332
16211 msgid "guestfs_read_lines"
16216 #: ../src/guestfs-actions.pod:5334
16220 " guestfs_read_lines (guestfs_h *g,\n"
16221 " const char *path);\n"
16227 #: ../src/guestfs-actions.pod:5340 ../fish/guestfish-actions.pod:3569
16229 "The file contents are returned as a list of lines. Trailing C<LF> and "
16230 "C<CRLF> character sequences are I<not> returned."
16235 #: ../src/guestfs-actions.pod:5343
16237 "Note that this function cannot correctly handle binary files (specifically, "
16238 "files containing C<\\0> character which is treated as end of line). For "
16239 "those you need to use the C<guestfs_read_file> function which has a more "
16240 "complex interface."
16245 #: ../src/guestfs-actions.pod:5354
16246 msgid "guestfs_readdir"
16251 #: ../src/guestfs-actions.pod:5356
16254 " struct guestfs_dirent_list *\n"
16255 " guestfs_readdir (guestfs_h *g,\n"
16256 " const char *dir);\n"
16262 #: ../src/guestfs-actions.pod:5360 ../fish/guestfish-actions.pod:3581
16263 msgid "This returns the list of directory entries in directory C<dir>."
16268 #: ../src/guestfs-actions.pod:5362 ../fish/guestfish-actions.pod:3583
16270 "All entries in the directory are returned, including C<.> and C<..>. The "
16271 "entries are I<not> sorted, but returned in the same order as the underlying "
16277 #: ../src/guestfs-actions.pod:5366 ../fish/guestfish-actions.pod:3587
16279 "Also this call returns basic file type information about each file. The "
16280 "C<ftyp> field will contain one of the following characters:"
16285 #: ../src/guestfs-actions.pod:5371 ../fish/guestfish-actions.pod:3592
16291 #: ../src/guestfs-actions.pod:5373 ../fish/guestfish-actions.pod:3594
16292 msgid "Block special"
16297 #: ../src/guestfs-actions.pod:5375 ../fish/guestfish-actions.pod:3596
16303 #: ../src/guestfs-actions.pod:5377 ../fish/guestfish-actions.pod:3598
16304 msgid "Char special"
16309 #: ../src/guestfs-actions.pod:5379 ../fish/guestfish-actions.pod:3600
16315 #: ../src/guestfs-actions.pod:5381 ../fish/guestfish-actions.pod:3602
16321 #: ../src/guestfs-actions.pod:5383 ../fish/guestfish-actions.pod:3604
16327 #: ../src/guestfs-actions.pod:5385 ../fish/guestfish-actions.pod:3606
16328 msgid "FIFO (named pipe)"
16333 #: ../src/guestfs-actions.pod:5387 ../fish/guestfish-actions.pod:3608
16339 #: ../src/guestfs-actions.pod:5389 ../fish/guestfish-actions.pod:3610
16340 msgid "Symbolic link"
16345 #: ../src/guestfs-actions.pod:5391 ../fish/guestfish-actions.pod:3612
16351 #: ../src/guestfs-actions.pod:5393 ../fish/guestfish-actions.pod:3614
16352 msgid "Regular file"
16357 #: ../src/guestfs-actions.pod:5395 ../fish/guestfish-actions.pod:3616
16363 #: ../src/guestfs-actions.pod:5397 ../fish/guestfish-actions.pod:3618
16369 #: ../src/guestfs-actions.pod:5399 ../fish/guestfish-actions.pod:3620
16375 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3622
16376 msgid "Unknown file type"
16381 #: ../src/guestfs-actions.pod:5403 ../fish/guestfish-actions.pod:3624
16387 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:3626
16389 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
16394 #: ../src/guestfs-actions.pod:5410
16396 "This function is primarily intended for use by programs. To get a simple "
16397 "list of names, use C<guestfs_ls>. To get a printable directory for human "
16398 "consumption, use C<guestfs_ll>."
16403 #: ../src/guestfs-actions.pod:5414
16405 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
16406 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
16411 #: ../src/guestfs-actions.pod:5420
16412 msgid "guestfs_readlink"
16417 #: ../src/guestfs-actions.pod:5422
16421 " guestfs_readlink (guestfs_h *g,\n"
16422 " const char *path);\n"
16428 #: ../src/guestfs-actions.pod:5426 ../fish/guestfish-actions.pod:3639
16429 msgid "This command reads the target of a symbolic link."
16434 #: ../src/guestfs-actions.pod:5433
16435 msgid "guestfs_readlinklist"
16440 #: ../src/guestfs-actions.pod:5435
16444 " guestfs_readlinklist (guestfs_h *g,\n"
16445 " const char *path,\n"
16446 " char *const *names);\n"
16452 #: ../src/guestfs-actions.pod:5440 ../fish/guestfish-actions.pod:3645
16454 "This call allows you to do a C<readlink> operation on multiple files, where "
16455 "all files are in the directory C<path>. C<names> is the list of files from "
16461 #: ../src/guestfs-actions.pod:5444 ../fish/guestfish-actions.pod:3649
16463 "On return you get a list of strings, with a one-to-one correspondence to the "
16464 "C<names> list. Each string is the value of the symbolic link."
16469 #: ../src/guestfs-actions.pod:5448 ../fish/guestfish-actions.pod:3653
16471 "If the C<readlink(2)> operation fails on any name, then the corresponding "
16472 "result string is the empty string C<\"\">. However the whole operation is "
16473 "completed even if there were C<readlink(2)> errors, and so you can call this "
16474 "function with names where you don't know if they are symbolic links already "
16475 "(albeit slightly less efficient)."
16480 #: ../src/guestfs-actions.pod:5455 ../fish/guestfish-actions.pod:3660
16482 "This call is intended for programs that want to efficiently list a directory "
16483 "contents without making many round-trips. Very long directory listings "
16484 "might cause the protocol message size to be exceeded, causing this call to "
16485 "fail. The caller must split up such requests into smaller groups of names."
16490 #: ../src/guestfs-actions.pod:5468
16491 msgid "guestfs_realpath"
16496 #: ../src/guestfs-actions.pod:5470
16500 " guestfs_realpath (guestfs_h *g,\n"
16501 " const char *path);\n"
16507 #: ../src/guestfs-actions.pod:5474 ../fish/guestfish-actions.pod:3671
16509 "Return the canonicalized absolute pathname of C<path>. The returned path "
16510 "has no C<.>, C<..> or symbolic link path elements."
16515 #: ../src/guestfs-actions.pod:5482
16516 msgid "guestfs_removexattr"
16521 #: ../src/guestfs-actions.pod:5484
16525 " guestfs_removexattr (guestfs_h *g,\n"
16526 " const char *xattr,\n"
16527 " const char *path);\n"
16533 #: ../src/guestfs-actions.pod:5489 ../fish/guestfish-actions.pod:3678
16535 "This call removes the extended attribute named C<xattr> of the file C<path>."
16540 #: ../src/guestfs-actions.pod:5492
16541 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
16546 #: ../src/guestfs-actions.pod:5498
16547 msgid "guestfs_resize2fs"
16552 #: ../src/guestfs-actions.pod:5500
16556 " guestfs_resize2fs (guestfs_h *g,\n"
16557 " const char *device);\n"
16563 #: ../src/guestfs-actions.pod:5504 ../fish/guestfish-actions.pod:3687
16565 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
16566 "underlying device."
16571 #: ../src/guestfs-actions.pod:5507
16573 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
16574 "C<device> before calling this command. For unknown reasons C<resize2fs> "
16575 "sometimes gives an error about this and sometimes not. In any case, it is "
16576 "always safe to call C<guestfs_e2fsck_f> before calling this function."
16580 #: ../src/guestfs-actions.pod:5517
16581 msgid "guestfs_resize2fs_M"
16585 #: ../src/guestfs-actions.pod:5519
16589 " guestfs_resize2fs_M (guestfs_h *g,\n"
16590 " const char *device);\n"
16595 #: ../src/guestfs-actions.pod:5523
16597 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
16598 "resized to its minimum size. This works like the C<-M> option to the "
16599 "C<resize2fs> command."
16603 #: ../src/guestfs-actions.pod:5527
16605 "To get the resulting size of the filesystem you should call "
16606 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
16607 "These two numbers, multiplied together, give the resulting size of the "
16608 "minimal filesystem in bytes."
16613 #: ../src/guestfs-actions.pod:5534
16614 msgid "guestfs_resize2fs_size"
16619 #: ../src/guestfs-actions.pod:5536
16623 " guestfs_resize2fs_size (guestfs_h *g,\n"
16624 " const char *device,\n"
16625 " int64_t size);\n"
16631 #: ../src/guestfs-actions.pod:5541
16633 "This command is the same as C<guestfs_resize2fs> except that it allows you "
16634 "to specify the new size (in bytes) explicitly."
16639 #: ../src/guestfs-actions.pod:5548
16645 #: ../src/guestfs-actions.pod:5550
16649 " guestfs_rm (guestfs_h *g,\n"
16650 " const char *path);\n"
16656 #: ../src/guestfs-actions.pod:5554 ../fish/guestfish-actions.pod:3720
16657 msgid "Remove the single file C<path>."
16662 #: ../src/guestfs-actions.pod:5560
16663 msgid "guestfs_rm_rf"
16668 #: ../src/guestfs-actions.pod:5562
16672 " guestfs_rm_rf (guestfs_h *g,\n"
16673 " const char *path);\n"
16679 #: ../src/guestfs-actions.pod:5566 ../fish/guestfish-actions.pod:3726
16681 "Remove the file or directory C<path>, recursively removing the contents if "
16682 "its a directory. This is like the C<rm -rf> shell command."
16687 #: ../src/guestfs-actions.pod:5574
16688 msgid "guestfs_rmdir"
16693 #: ../src/guestfs-actions.pod:5576
16697 " guestfs_rmdir (guestfs_h *g,\n"
16698 " const char *path);\n"
16704 #: ../src/guestfs-actions.pod:5580 ../fish/guestfish-actions.pod:3734
16705 msgid "Remove the single directory C<path>."
16710 #: ../src/guestfs-actions.pod:5586
16711 msgid "guestfs_rmmountpoint"
16716 #: ../src/guestfs-actions.pod:5588
16720 " guestfs_rmmountpoint (guestfs_h *g,\n"
16721 " const char *exemptpath);\n"
16727 #: ../src/guestfs-actions.pod:5592
16729 "This calls removes a mountpoint that was previously created with "
16730 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
16735 #: ../src/guestfs-actions.pod:5600
16736 msgid "guestfs_scrub_device"
16741 #: ../src/guestfs-actions.pod:5602
16745 " guestfs_scrub_device (guestfs_h *g,\n"
16746 " const char *device);\n"
16752 #: ../src/guestfs-actions.pod:5606 ../fish/guestfish-actions.pod:3748
16754 "This command writes patterns over C<device> to make data retrieval more "
16760 #: ../src/guestfs-actions.pod:5609 ../src/guestfs-actions.pod:5630
16761 #: ../src/guestfs-actions.pod:5649 ../fish/guestfish-actions.pod:3751
16762 #: ../fish/guestfish-actions.pod:3766 ../fish/guestfish-actions.pod:3779
16764 "It is an interface to the L<scrub(1)> program. See that manual page for "
16770 #: ../src/guestfs-actions.pod:5617 ../src/guestfs-actions.pod:5635
16771 #: ../src/guestfs-actions.pod:5654
16772 msgid "(Added in 1.0.52)"
16777 #: ../src/guestfs-actions.pod:5619
16778 msgid "guestfs_scrub_file"
16783 #: ../src/guestfs-actions.pod:5621
16787 " guestfs_scrub_file (guestfs_h *g,\n"
16788 " const char *file);\n"
16794 #: ../src/guestfs-actions.pod:5625 ../fish/guestfish-actions.pod:3761
16796 "This command writes patterns over a file to make data retrieval more "
16802 #: ../src/guestfs-actions.pod:5628 ../fish/guestfish-actions.pod:3764
16803 msgid "The file is I<removed> after scrubbing."
16808 #: ../src/guestfs-actions.pod:5637
16809 msgid "guestfs_scrub_freespace"
16814 #: ../src/guestfs-actions.pod:5639
16818 " guestfs_scrub_freespace (guestfs_h *g,\n"
16819 " const char *dir);\n"
16825 #: ../src/guestfs-actions.pod:5643
16827 "This command creates the directory C<dir> and then fills it with files until "
16828 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
16829 "and deletes them. The intention is to scrub any free space on the partition "
16830 "containing C<dir>."
16835 #: ../src/guestfs-actions.pod:5656
16836 msgid "guestfs_set_append"
16841 #: ../src/guestfs-actions.pod:5658
16845 " guestfs_set_append (guestfs_h *g,\n"
16846 " const char *append);\n"
16852 #: ../src/guestfs-actions.pod:5662 ../fish/guestfish-actions.pod:3788
16854 "This function is used to add additional options to the guest kernel command "
16860 #: ../src/guestfs-actions.pod:5665 ../fish/guestfish-actions.pod:3791
16862 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
16863 "environment variable."
16868 #: ../src/guestfs-actions.pod:5668 ../fish/guestfish-actions.pod:3794
16870 "Setting C<append> to C<NULL> means I<no> additional options are passed "
16871 "(libguestfs always adds a few of its own)."
16875 #: ../src/guestfs-actions.pod:5675
16876 msgid "guestfs_set_attach_method"
16880 #: ../src/guestfs-actions.pod:5677
16884 " guestfs_set_attach_method (guestfs_h *g,\n"
16885 " const char *attachmethod);\n"
16890 #: ../src/guestfs-actions.pod:5681 ../fish/guestfish-actions.pod:3803
16892 "Set the method that libguestfs uses to connect to the back end guestfsd "
16893 "daemon. Possible methods are:"
16897 #: ../src/guestfs-actions.pod:5688 ../fish/guestfish-actions.pod:3810
16899 "Launch an appliance and connect to it. This is the ordinary method and the "
16904 #: ../src/guestfs-actions.pod:5691 ../fish/guestfish-actions.pod:3813
16905 msgid "C<unix:I<path>>"
16909 #: ../src/guestfs-actions.pod:5693 ../fish/guestfish-actions.pod:3815
16910 msgid "Connect to the Unix domain socket I<path>."
16914 #: ../src/guestfs-actions.pod:5695 ../fish/guestfish-actions.pod:3817
16916 "This method lets you connect to an existing daemon or (using virtio-serial) "
16917 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
16918 "RUNNING DAEMONS>."
16923 #: ../src/guestfs-actions.pod:5703
16924 msgid "guestfs_set_autosync"
16929 #: ../src/guestfs-actions.pod:5705
16933 " guestfs_set_autosync (guestfs_h *g,\n"
16934 " int autosync);\n"
16939 #: ../src/guestfs-actions.pod:5709 ../fish/guestfish-actions.pod:3829
16941 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
16942 "effort attempt to make filesystems consistent and synchronized when the "
16943 "handle is closed (also if the program exits without closing handles)."
16948 #: ../src/guestfs-actions.pod:5714 ../fish/guestfish-actions.pod:3834
16950 "This is enabled by default (since libguestfs 1.5.24, previously it was "
16951 "disabled by default)."
16956 #: ../src/guestfs-actions.pod:5721
16957 msgid "guestfs_set_direct"
16962 #: ../src/guestfs-actions.pod:5723
16966 " guestfs_set_direct (guestfs_h *g,\n"
16973 #: ../src/guestfs-actions.pod:5727 ../fish/guestfish-actions.pod:3843
16975 "If the direct appliance mode flag is enabled, then stdin and stdout are "
16976 "passed directly through to the appliance once it is launched."
16981 #: ../src/guestfs-actions.pod:5731
16983 "One consequence of this is that log messages aren't caught by the library "
16984 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
16990 #: ../src/guestfs-actions.pod:5735 ../fish/guestfish-actions.pod:3851
16991 msgid "You probably don't want to use this unless you know what you are doing."
16996 #: ../src/guestfs-actions.pod:5738 ../fish/guestfish-actions.pod:3854
16997 msgid "The default is disabled."
17002 #: ../src/guestfs-actions.pod:5744
17003 msgid "guestfs_set_e2label"
17008 #: ../src/guestfs-actions.pod:5746
17012 " guestfs_set_e2label (guestfs_h *g,\n"
17013 " const char *device,\n"
17014 " const char *label);\n"
17020 #: ../src/guestfs-actions.pod:5751 ../fish/guestfish-actions.pod:3860
17022 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
17023 "C<label>. Filesystem labels are limited to 16 characters."
17028 #: ../src/guestfs-actions.pod:5755
17030 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
17031 "the existing label on a filesystem."
17036 #: ../src/guestfs-actions.pod:5762
17037 msgid "guestfs_set_e2uuid"
17042 #: ../src/guestfs-actions.pod:5764
17046 " guestfs_set_e2uuid (guestfs_h *g,\n"
17047 " const char *device,\n"
17048 " const char *uuid);\n"
17054 #: ../src/guestfs-actions.pod:5769 ../fish/guestfish-actions.pod:3871
17056 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
17057 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
17058 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
17063 #: ../src/guestfs-actions.pod:5774
17065 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
17066 "the existing UUID of a filesystem."
17071 #: ../src/guestfs-actions.pod:5781
17072 msgid "guestfs_set_memsize"
17077 #: ../src/guestfs-actions.pod:5783
17081 " guestfs_set_memsize (guestfs_h *g,\n"
17088 #: ../src/guestfs-actions.pod:5787
17090 "This sets the memory size in megabytes allocated to the qemu subprocess. "
17091 "This only has any effect if called before C<guestfs_launch>."
17096 #: ../src/guestfs-actions.pod:5791 ../fish/guestfish-actions.pod:3889
17098 "You can also change this by setting the environment variable "
17099 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
17104 #: ../src/guestfs-actions.pod:5802
17105 msgid "guestfs_set_network"
17110 #: ../src/guestfs-actions.pod:5804
17114 " guestfs_set_network (guestfs_h *g,\n"
17121 #: ../src/guestfs-actions.pod:5808 ../fish/guestfish-actions.pod:3902
17123 "If C<network> is true, then the network is enabled in the libguestfs "
17124 "appliance. The default is false."
17129 #: ../src/guestfs-actions.pod:5811 ../fish/guestfish-actions.pod:3905
17131 "This affects whether commands are able to access the network (see L<guestfs"
17132 "(3)/RUNNING COMMANDS>)."
17137 #: ../src/guestfs-actions.pod:5814
17139 "You must call this before calling C<guestfs_launch>, otherwise it has no "
17145 #: ../src/guestfs-actions.pod:5821
17146 msgid "guestfs_set_path"
17151 #: ../src/guestfs-actions.pod:5823
17155 " guestfs_set_path (guestfs_h *g,\n"
17156 " const char *searchpath);\n"
17162 #: ../src/guestfs-actions.pod:5827 ../fish/guestfish-actions.pod:3917
17163 msgid "Set the path that libguestfs searches for kernel and initrd.img."
17168 #: ../src/guestfs-actions.pod:5829 ../fish/guestfish-actions.pod:3919
17170 "The default is C<$libdir/guestfs> unless overridden by setting "
17171 "C<LIBGUESTFS_PATH> environment variable."
17176 #: ../src/guestfs-actions.pod:5832 ../fish/guestfish-actions.pod:3922
17177 msgid "Setting C<path> to C<NULL> restores the default path."
17182 #: ../src/guestfs-actions.pod:5838
17183 msgid "guestfs_set_qemu"
17188 #: ../src/guestfs-actions.pod:5840
17192 " guestfs_set_qemu (guestfs_h *g,\n"
17193 " const char *qemu);\n"
17199 #: ../src/guestfs-actions.pod:5844 ../fish/guestfish-actions.pod:3930
17200 msgid "Set the qemu binary that we will use."
17205 #: ../src/guestfs-actions.pod:5846 ../fish/guestfish-actions.pod:3932
17207 "The default is chosen when the library was compiled by the configure script."
17212 #: ../src/guestfs-actions.pod:5849 ../fish/guestfish-actions.pod:3935
17214 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
17220 #: ../src/guestfs-actions.pod:5852 ../fish/guestfish-actions.pod:3938
17221 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
17226 #: ../src/guestfs-actions.pod:5854 ../fish/guestfish-actions.pod:3940
17228 "Note that you should call this function as early as possible after creating "
17229 "the handle. This is because some pre-launch operations depend on testing "
17230 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
17231 "don't retest features, and so you might see inconsistent results. Using the "
17232 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
17233 "the qemu binary at the same time as the handle is created."
17238 #: ../src/guestfs-actions.pod:5866
17239 msgid "guestfs_set_recovery_proc"
17244 #: ../src/guestfs-actions.pod:5868
17248 " guestfs_set_recovery_proc (guestfs_h *g,\n"
17249 " int recoveryproc);\n"
17255 #: ../src/guestfs-actions.pod:5872
17257 "If this is called with the parameter C<false> then C<guestfs_launch> does "
17258 "not create a recovery process. The purpose of the recovery process is to "
17259 "stop runaway qemu processes in the case where the main program aborts "
17265 #: ../src/guestfs-actions.pod:5877
17267 "This only has any effect if called before C<guestfs_launch>, and the default "
17273 #: ../src/guestfs-actions.pod:5880 ../fish/guestfish-actions.pod:3962
17275 "About the only time when you would want to disable this is if the main "
17276 "process will fork itself into the background (\"daemonize\" itself). In "
17277 "this case the recovery process thinks that the main program has disappeared "
17278 "and so kills qemu, which is not very helpful."
17283 #: ../src/guestfs-actions.pod:5890
17284 msgid "guestfs_set_selinux"
17289 #: ../src/guestfs-actions.pod:5892
17293 " guestfs_set_selinux (guestfs_h *g,\n"
17300 #: ../src/guestfs-actions.pod:5896 ../fish/guestfish-actions.pod:3974
17302 "This sets the selinux flag that is passed to the appliance at boot time. "
17303 "The default is C<selinux=0> (disabled)."
17308 #: ../src/guestfs-actions.pod:5899 ../fish/guestfish-actions.pod:3977
17310 "Note that if SELinux is enabled, it is always in Permissive mode "
17311 "(C<enforcing=0>)."
17316 #: ../src/guestfs-actions.pod:5909
17317 msgid "guestfs_set_trace"
17322 #: ../src/guestfs-actions.pod:5911
17326 " guestfs_set_trace (guestfs_h *g,\n"
17333 #: ../src/guestfs-actions.pod:5915 ../fish/guestfish-actions.pod:3989
17335 "If the command trace flag is set to 1, then commands are printed on stderr "
17336 "before they are executed in a format which is very similar to the one used "
17337 "by guestfish. In other words, you can run a program with this enabled, and "
17338 "you will get out a script which you can feed to guestfish to perform the "
17339 "same set of actions."
17344 #: ../src/guestfs-actions.pod:5922 ../fish/guestfish-actions.pod:3996
17346 "If you want to trace C API calls into libguestfs (and other libraries) then "
17347 "possibly a better way is to use the external ltrace(1) command."
17352 #: ../src/guestfs-actions.pod:5926 ../fish/guestfish-actions.pod:4000
17354 "Command traces are disabled unless the environment variable "
17355 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
17360 #: ../src/guestfs-actions.pod:5933
17361 msgid "guestfs_set_verbose"
17366 #: ../src/guestfs-actions.pod:5935
17370 " guestfs_set_verbose (guestfs_h *g,\n"
17377 #: ../src/guestfs-actions.pod:5939 ../fish/guestfish-actions.pod:4009
17378 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
17383 #: ../src/guestfs-actions.pod:5941 ../fish/guestfish-actions.pod:4011
17385 "Verbose messages are disabled unless the environment variable "
17386 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
17391 #: ../src/guestfs-actions.pod:5948
17392 msgid "guestfs_setcon"
17397 #: ../src/guestfs-actions.pod:5950
17401 " guestfs_setcon (guestfs_h *g,\n"
17402 " const char *context);\n"
17408 #: ../src/guestfs-actions.pod:5954 ../fish/guestfish-actions.pod:4018
17410 "This sets the SELinux security context of the daemon to the string "
17416 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:4021
17417 msgid "See the documentation about SELINUX in L<guestfs(3)>."
17422 #: ../src/guestfs-actions.pod:5963
17423 msgid "guestfs_setxattr"
17428 #: ../src/guestfs-actions.pod:5965
17432 " guestfs_setxattr (guestfs_h *g,\n"
17433 " const char *xattr,\n"
17434 " const char *val,\n"
17436 " const char *path);\n"
17442 #: ../src/guestfs-actions.pod:5972 ../fish/guestfish-actions.pod:4027
17444 "This call sets the extended attribute named C<xattr> of the file C<path> to "
17445 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
17450 #: ../src/guestfs-actions.pod:5976
17451 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
17456 #: ../src/guestfs-actions.pod:5982
17457 msgid "guestfs_sfdisk"
17462 #: ../src/guestfs-actions.pod:5984
17466 " guestfs_sfdisk (guestfs_h *g,\n"
17467 " const char *device,\n"
17471 " char *const *lines);\n"
17477 #: ../src/guestfs-actions.pod:5992 ../fish/guestfish-actions.pod:4037
17479 "This is a direct interface to the L<sfdisk(8)> program for creating "
17480 "partitions on block devices."
17485 #: ../src/guestfs-actions.pod:5995 ../fish/guestfish-actions.pod:4040
17486 msgid "C<device> should be a block device, for example C</dev/sda>."
17491 #: ../src/guestfs-actions.pod:5997 ../fish/guestfish-actions.pod:4042
17493 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
17494 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
17495 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
17496 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
17497 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
17498 "the kernel) cannot work out the right geometry and you will need to tell it."
17503 #: ../src/guestfs-actions.pod:6005 ../fish/guestfish-actions.pod:4050
17505 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
17506 "refer to the L<sfdisk(8)> manpage."
17511 #: ../src/guestfs-actions.pod:6008 ../fish/guestfish-actions.pod:4053
17513 "To create a single partition occupying the whole disk, you would pass "
17514 "C<lines> as a single element list, when the single element being the string "
17520 #: ../src/guestfs-actions.pod:6012
17522 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
17527 #: ../src/guestfs-actions.pod:6022
17528 msgid "guestfs_sfdiskM"
17533 #: ../src/guestfs-actions.pod:6024
17537 " guestfs_sfdiskM (guestfs_h *g,\n"
17538 " const char *device,\n"
17539 " char *const *lines);\n"
17545 #: ../src/guestfs-actions.pod:6029
17547 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
17548 "partition sizes are specified in megabytes only (rounded to the nearest "
17549 "cylinder) and you don't need to specify the cyls, heads and sectors "
17550 "parameters which were rarely if ever used anyway."
17555 #: ../src/guestfs-actions.pod:6035
17557 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
17558 "C<guestfs_part_disk>"
17563 #: ../src/guestfs-actions.pod:6045
17564 msgid "guestfs_sfdisk_N"
17569 #: ../src/guestfs-actions.pod:6047
17573 " guestfs_sfdisk_N (guestfs_h *g,\n"
17574 " const char *device,\n"
17579 " const char *line);\n"
17585 #: ../src/guestfs-actions.pod:6056 ../fish/guestfish-actions.pod:4083
17587 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
17588 "(note: C<n> counts from 1)."
17593 #: ../src/guestfs-actions.pod:6059
17595 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
17596 "for the cyls/heads/sectors parameters."
17601 #: ../src/guestfs-actions.pod:6062
17602 msgid "See also: C<guestfs_part_add>"
17607 #: ../src/guestfs-actions.pod:6071
17608 msgid "guestfs_sfdisk_disk_geometry"
17613 #: ../src/guestfs-actions.pod:6073
17617 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
17618 " const char *device);\n"
17624 #: ../src/guestfs-actions.pod:6077
17626 "This displays the disk geometry of C<device> read from the partition table. "
17627 "Especially in the case where the underlying block device has been resized, "
17628 "this can be different from the kernel's idea of the geometry (see "
17629 "C<guestfs_sfdisk_kernel_geometry>)."
17634 #: ../src/guestfs-actions.pod:6082 ../src/guestfs-actions.pod:6098
17635 #: ../fish/guestfish-actions.pod:4103 ../fish/guestfish-actions.pod:4112
17636 msgid "The result is in human-readable format, and not designed to be parsed."
17641 #: ../src/guestfs-actions.pod:6090
17642 msgid "guestfs_sfdisk_kernel_geometry"
17647 #: ../src/guestfs-actions.pod:6092
17651 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
17652 " const char *device);\n"
17658 #: ../src/guestfs-actions.pod:6096 ../fish/guestfish-actions.pod:4110
17659 msgid "This displays the kernel's idea of the geometry of C<device>."
17664 #: ../src/guestfs-actions.pod:6106
17665 msgid "guestfs_sfdisk_l"
17670 #: ../src/guestfs-actions.pod:6108
17674 " guestfs_sfdisk_l (guestfs_h *g,\n"
17675 " const char *device);\n"
17681 #: ../src/guestfs-actions.pod:6112 ../fish/guestfish-actions.pod:4119
17683 "This displays the partition table on C<device>, in the human-readable output "
17684 "of the L<sfdisk(8)> command. It is not intended to be parsed."
17689 #: ../src/guestfs-actions.pod:6116
17690 msgid "See also: C<guestfs_part_list>"
17695 #: ../src/guestfs-actions.pod:6123
17701 #: ../src/guestfs-actions.pod:6125
17705 " guestfs_sh (guestfs_h *g,\n"
17706 " const char *command);\n"
17712 #: ../src/guestfs-actions.pod:6129 ../fish/guestfish-actions.pod:4129
17714 "This call runs a command from the guest filesystem via the guest's C</bin/"
17720 #: ../src/guestfs-actions.pod:6132
17721 msgid "This is like C<guestfs_command>, but passes the command to:"
17726 #: ../src/guestfs-actions.pod:6134 ../fish/guestfish-actions.pod:4134
17729 " /bin/sh -c \"command\"\n"
17735 #: ../src/guestfs-actions.pod:6136 ../fish/guestfish-actions.pod:4136
17737 "Depending on the guest's shell, this usually results in wildcards being "
17738 "expanded, shell expressions being interpolated and so on."
17743 #: ../src/guestfs-actions.pod:6140
17744 msgid "All the provisos about C<guestfs_command> apply to this call."
17749 #: ../src/guestfs-actions.pod:6147
17750 msgid "guestfs_sh_lines"
17755 #: ../src/guestfs-actions.pod:6149
17759 " guestfs_sh_lines (guestfs_h *g,\n"
17760 " const char *command);\n"
17766 #: ../src/guestfs-actions.pod:6153
17768 "This is the same as C<guestfs_sh>, but splits the result into a list of "
17774 #: ../src/guestfs-actions.pod:6156
17775 msgid "See also: C<guestfs_command_lines>"
17780 #: ../src/guestfs-actions.pod:6164
17781 msgid "guestfs_sleep"
17786 #: ../src/guestfs-actions.pod:6166
17790 " guestfs_sleep (guestfs_h *g,\n"
17797 #: ../src/guestfs-actions.pod:6170 ../fish/guestfish-actions.pod:4155
17798 msgid "Sleep for C<secs> seconds."
17803 #: ../src/guestfs-actions.pod:6174
17804 msgid "(Added in 1.0.41)"
17809 #: ../src/guestfs-actions.pod:6176 ../src/guestfs-structs.pod:109
17810 msgid "guestfs_stat"
17815 #: ../src/guestfs-actions.pod:6178
17818 " struct guestfs_stat *\n"
17819 " guestfs_stat (guestfs_h *g,\n"
17820 " const char *path);\n"
17826 #: ../src/guestfs-actions.pod:6184 ../fish/guestfish-actions.pod:4163
17827 msgid "This is the same as the C<stat(2)> system call."
17832 #: ../src/guestfs-actions.pod:6192 ../src/guestfs-structs.pod:135
17833 msgid "guestfs_statvfs"
17838 #: ../src/guestfs-actions.pod:6194
17841 " struct guestfs_statvfs *\n"
17842 " guestfs_statvfs (guestfs_h *g,\n"
17843 " const char *path);\n"
17849 #: ../src/guestfs-actions.pod:6198 ../fish/guestfish-actions.pod:4169
17851 "Returns file system statistics for any mounted file system. C<path> should "
17852 "be a file or directory in the mounted file system (typically it is the mount "
17853 "point itself, but it doesn't need to be)."
17858 #: ../src/guestfs-actions.pod:6202 ../fish/guestfish-actions.pod:4173
17859 msgid "This is the same as the C<statvfs(2)> system call."
17864 #: ../src/guestfs-actions.pod:6204
17866 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
17867 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
17872 #: ../src/guestfs-actions.pod:6210
17873 msgid "guestfs_strings"
17878 #: ../src/guestfs-actions.pod:6212
17882 " guestfs_strings (guestfs_h *g,\n"
17883 " const char *path);\n"
17889 #: ../src/guestfs-actions.pod:6216 ../fish/guestfish-actions.pod:4179
17891 "This runs the L<strings(1)> command on a file and returns the list of "
17892 "printable strings found."
17897 #: ../src/guestfs-actions.pod:6228
17898 msgid "guestfs_strings_e"
17903 #: ../src/guestfs-actions.pod:6230
17907 " guestfs_strings_e (guestfs_h *g,\n"
17908 " const char *encoding,\n"
17909 " const char *path);\n"
17915 #: ../src/guestfs-actions.pod:6235
17917 "This is like the C<guestfs_strings> command, but allows you to specify the "
17918 "encoding of strings that are looked for in the source file C<path>."
17923 #: ../src/guestfs-actions.pod:6239 ../fish/guestfish-actions.pod:4193
17924 msgid "Allowed encodings are:"
17929 #: ../src/guestfs-actions.pod:6243 ../fish/guestfish-actions.pod:4197
17935 #: ../src/guestfs-actions.pod:6245
17937 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
17938 "ISO-8859-X (this is what C<guestfs_strings> uses)."
17943 #: ../src/guestfs-actions.pod:6248 ../fish/guestfish-actions.pod:4202
17949 #: ../src/guestfs-actions.pod:6250 ../fish/guestfish-actions.pod:4204
17950 msgid "Single 8-bit-byte characters."
17955 #: ../src/guestfs-actions.pod:6252 ../fish/guestfish-actions.pod:4206
17961 #: ../src/guestfs-actions.pod:6254 ../fish/guestfish-actions.pod:4208
17962 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
17967 #: ../src/guestfs-actions.pod:6257 ../fish/guestfish-actions.pod:4211
17968 msgid "l (lower case letter L)"
17973 #: ../src/guestfs-actions.pod:6259 ../fish/guestfish-actions.pod:4213
17975 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
17976 "examining binaries in Windows guests."
17981 #: ../src/guestfs-actions.pod:6262 ../fish/guestfish-actions.pod:4216
17987 #: ../src/guestfs-actions.pod:6264 ../fish/guestfish-actions.pod:4218
17988 msgid "32-bit big endian such as UCS-4BE."
17993 #: ../src/guestfs-actions.pod:6266 ../fish/guestfish-actions.pod:4220
17999 #: ../src/guestfs-actions.pod:6268 ../fish/guestfish-actions.pod:4222
18000 msgid "32-bit little endian such as UCS-4LE."
18005 #: ../src/guestfs-actions.pod:6272 ../fish/guestfish-actions.pod:4226
18006 msgid "The returned strings are transcoded to UTF-8."
18011 #: ../src/guestfs-actions.pod:6283
18012 msgid "guestfs_swapoff_device"
18017 #: ../src/guestfs-actions.pod:6285
18021 " guestfs_swapoff_device (guestfs_h *g,\n"
18022 " const char *device);\n"
18028 #: ../src/guestfs-actions.pod:6289
18030 "This command disables the libguestfs appliance swap device or partition "
18031 "named C<device>. See C<guestfs_swapon_device>."
18036 #: ../src/guestfs-actions.pod:6297
18037 msgid "guestfs_swapoff_file"
18042 #: ../src/guestfs-actions.pod:6299
18046 " guestfs_swapoff_file (guestfs_h *g,\n"
18047 " const char *file);\n"
18053 #: ../src/guestfs-actions.pod:6303 ../fish/guestfish-actions.pod:4243
18054 msgid "This command disables the libguestfs appliance swap on file."
18059 #: ../src/guestfs-actions.pod:6309
18060 msgid "guestfs_swapoff_label"
18065 #: ../src/guestfs-actions.pod:6311
18069 " guestfs_swapoff_label (guestfs_h *g,\n"
18070 " const char *label);\n"
18076 #: ../src/guestfs-actions.pod:6315 ../fish/guestfish-actions.pod:4249
18078 "This command disables the libguestfs appliance swap on labeled swap "
18084 #: ../src/guestfs-actions.pod:6322
18085 msgid "guestfs_swapoff_uuid"
18090 #: ../src/guestfs-actions.pod:6324
18094 " guestfs_swapoff_uuid (guestfs_h *g,\n"
18095 " const char *uuid);\n"
18101 #: ../src/guestfs-actions.pod:6328 ../fish/guestfish-actions.pod:4256
18103 "This command disables the libguestfs appliance swap partition with the given "
18109 #: ../src/guestfs-actions.pod:6335
18110 msgid "guestfs_swapon_device"
18115 #: ../src/guestfs-actions.pod:6337
18119 " guestfs_swapon_device (guestfs_h *g,\n"
18120 " const char *device);\n"
18126 #: ../src/guestfs-actions.pod:6341
18128 "This command enables the libguestfs appliance to use the swap device or "
18129 "partition named C<device>. The increased memory is made available for all "
18130 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
18135 #: ../src/guestfs-actions.pod:6346 ../fish/guestfish-actions.pod:4268
18137 "Note that you should not swap to existing guest swap partitions unless you "
18138 "know what you are doing. They may contain hibernation information, or other "
18139 "information that the guest doesn't want you to trash. You also risk leaking "
18140 "information about the host to the guest this way. Instead, attach a new "
18141 "host device to the guest and swap on that."
18146 #: ../src/guestfs-actions.pod:6357
18147 msgid "guestfs_swapon_file"
18152 #: ../src/guestfs-actions.pod:6359
18156 " guestfs_swapon_file (guestfs_h *g,\n"
18157 " const char *file);\n"
18163 #: ../src/guestfs-actions.pod:6363
18165 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
18171 #: ../src/guestfs-actions.pod:6370
18172 msgid "guestfs_swapon_label"
18177 #: ../src/guestfs-actions.pod:6372
18181 " guestfs_swapon_label (guestfs_h *g,\n"
18182 " const char *label);\n"
18188 #: ../src/guestfs-actions.pod:6376
18190 "This command enables swap to a labeled swap partition. See "
18191 "C<guestfs_swapon_device> for other notes."
18196 #: ../src/guestfs-actions.pod:6383
18197 msgid "guestfs_swapon_uuid"
18202 #: ../src/guestfs-actions.pod:6385
18206 " guestfs_swapon_uuid (guestfs_h *g,\n"
18207 " const char *uuid);\n"
18213 #: ../src/guestfs-actions.pod:6389
18215 "This command enables swap to a swap partition with the given UUID. See "
18216 "C<guestfs_swapon_device> for other notes."
18221 #: ../src/guestfs-actions.pod:6396
18222 msgid "guestfs_sync"
18227 #: ../src/guestfs-actions.pod:6398
18231 " guestfs_sync (guestfs_h *g);\n"
18237 #: ../src/guestfs-actions.pod:6401 ../fish/guestfish-actions.pod:4300
18239 "This syncs the disk, so that any writes are flushed through to the "
18240 "underlying disk image."
18245 #: ../src/guestfs-actions.pod:6404 ../fish/guestfish-actions.pod:4303
18247 "You should always call this if you have modified a disk image, before "
18248 "closing the handle."
18253 #: ../src/guestfs-actions.pod:6411
18254 msgid "guestfs_tail"
18259 #: ../src/guestfs-actions.pod:6413
18263 " guestfs_tail (guestfs_h *g,\n"
18264 " const char *path);\n"
18270 #: ../src/guestfs-actions.pod:6417 ../fish/guestfish-actions.pod:4310
18272 "This command returns up to the last 10 lines of a file as a list of strings."
18277 #: ../src/guestfs-actions.pod:6429
18278 msgid "guestfs_tail_n"
18283 #: ../src/guestfs-actions.pod:6431
18287 " guestfs_tail_n (guestfs_h *g,\n"
18289 " const char *path);\n"
18295 #: ../src/guestfs-actions.pod:6436 ../fish/guestfish-actions.pod:4320
18297 "If the parameter C<nrlines> is a positive number, this returns the last "
18298 "C<nrlines> lines of the file C<path>."
18303 #: ../src/guestfs-actions.pod:6439 ../fish/guestfish-actions.pod:4323
18305 "If the parameter C<nrlines> is a negative number, this returns lines from "
18306 "the file C<path>, starting with the C<-nrlines>th line."
18311 #: ../src/guestfs-actions.pod:6453
18312 msgid "guestfs_tar_in"
18317 #: ../src/guestfs-actions.pod:6455
18321 " guestfs_tar_in (guestfs_h *g,\n"
18322 " const char *tarfile,\n"
18323 " const char *directory);\n"
18329 #: ../src/guestfs-actions.pod:6460 ../fish/guestfish-actions.pod:4335
18331 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
18332 "tar file) into C<directory>."
18337 #: ../src/guestfs-actions.pod:6463
18339 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
18344 #: ../src/guestfs-actions.pod:6468 ../src/guestfs-actions.pod:6485
18345 #: ../src/guestfs-actions.pod:6501 ../src/guestfs-actions.pod:6517
18346 msgid "(Added in 1.0.3)"
18351 #: ../src/guestfs-actions.pod:6470
18352 msgid "guestfs_tar_out"
18357 #: ../src/guestfs-actions.pod:6472
18361 " guestfs_tar_out (guestfs_h *g,\n"
18362 " const char *directory,\n"
18363 " const char *tarfile);\n"
18369 #: ../src/guestfs-actions.pod:6477 ../fish/guestfish-actions.pod:4347
18371 "This command packs the contents of C<directory> and downloads it to local "
18377 #: ../src/guestfs-actions.pod:6480
18379 "To download a compressed tarball, use C<guestfs_tgz_out> or "
18380 "C<guestfs_txz_out>."
18385 #: ../src/guestfs-actions.pod:6487
18386 msgid "guestfs_tgz_in"
18391 #: ../src/guestfs-actions.pod:6489
18395 " guestfs_tgz_in (guestfs_h *g,\n"
18396 " const char *tarball,\n"
18397 " const char *directory);\n"
18403 #: ../src/guestfs-actions.pod:6494 ../fish/guestfish-actions.pod:4359
18405 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
18406 "tar file) into C<directory>."
18411 #: ../src/guestfs-actions.pod:6497
18412 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
18417 #: ../src/guestfs-actions.pod:6503
18418 msgid "guestfs_tgz_out"
18423 #: ../src/guestfs-actions.pod:6505
18427 " guestfs_tgz_out (guestfs_h *g,\n"
18428 " const char *directory,\n"
18429 " const char *tarball);\n"
18435 #: ../src/guestfs-actions.pod:6510 ../fish/guestfish-actions.pod:4370
18437 "This command packs the contents of C<directory> and downloads it to local "
18443 #: ../src/guestfs-actions.pod:6513
18444 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
18449 #: ../src/guestfs-actions.pod:6519
18450 msgid "guestfs_touch"
18455 #: ../src/guestfs-actions.pod:6521
18459 " guestfs_touch (guestfs_h *g,\n"
18460 " const char *path);\n"
18466 #: ../src/guestfs-actions.pod:6525 ../fish/guestfish-actions.pod:4381
18468 "Touch acts like the L<touch(1)> command. It can be used to update the "
18469 "timestamps on a file, or, if the file does not exist, to create a new zero-"
18475 #: ../src/guestfs-actions.pod:6529 ../fish/guestfish-actions.pod:4385
18477 "This command only works on regular files, and will fail on other file types "
18478 "such as directories, symbolic links, block special etc."
18483 #: ../src/guestfs-actions.pod:6536
18484 msgid "guestfs_truncate"
18489 #: ../src/guestfs-actions.pod:6538
18493 " guestfs_truncate (guestfs_h *g,\n"
18494 " const char *path);\n"
18500 #: ../src/guestfs-actions.pod:6542 ../fish/guestfish-actions.pod:4392
18502 "This command truncates C<path> to a zero-length file. The file must exist "
18508 #: ../src/guestfs-actions.pod:6549
18509 msgid "guestfs_truncate_size"
18514 #: ../src/guestfs-actions.pod:6551
18518 " guestfs_truncate_size (guestfs_h *g,\n"
18519 " const char *path,\n"
18520 " int64_t size);\n"
18526 #: ../src/guestfs-actions.pod:6556 ../fish/guestfish-actions.pod:4399
18528 "This command truncates C<path> to size C<size> bytes. The file must exist "
18534 #: ../src/guestfs-actions.pod:6559
18536 "If the current file size is less than C<size> then the file is extended to "
18537 "the required size with zero bytes. This creates a sparse file (ie. disk "
18538 "blocks are not allocated for the file until you write to it). To create a "
18539 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
18544 #: ../src/guestfs-actions.pod:6569
18545 msgid "guestfs_tune2fs_l"
18550 #: ../src/guestfs-actions.pod:6571
18554 " guestfs_tune2fs_l (guestfs_h *g,\n"
18555 " const char *device);\n"
18561 #: ../src/guestfs-actions.pod:6575 ../fish/guestfish-actions.pod:4412
18563 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
18569 #: ../src/guestfs-actions.pod:6578 ../fish/guestfish-actions.pod:4415
18571 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
18572 "for more details. The list of fields returned isn't clearly defined, and "
18573 "depends on both the version of C<tune2fs> that libguestfs was built against, "
18574 "and the filesystem itself."
18579 #: ../src/guestfs-actions.pod:6591
18580 msgid "guestfs_txz_in"
18585 #: ../src/guestfs-actions.pod:6593
18589 " guestfs_txz_in (guestfs_h *g,\n"
18590 " const char *tarball,\n"
18591 " const char *directory);\n"
18597 #: ../src/guestfs-actions.pod:6598 ../fish/guestfish-actions.pod:4424
18599 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
18600 "tar file) into C<directory>."
18605 #: ../src/guestfs-actions.pod:6605
18606 msgid "guestfs_txz_out"
18611 #: ../src/guestfs-actions.pod:6607
18615 " guestfs_txz_out (guestfs_h *g,\n"
18616 " const char *directory,\n"
18617 " const char *tarball);\n"
18623 #: ../src/guestfs-actions.pod:6612 ../fish/guestfish-actions.pod:4433
18625 "This command packs the contents of C<directory> and downloads it to local "
18626 "file C<tarball> (as an xz compressed tar archive)."
18631 #: ../src/guestfs-actions.pod:6619
18632 msgid "guestfs_umask"
18637 #: ../src/guestfs-actions.pod:6621
18641 " guestfs_umask (guestfs_h *g,\n"
18648 #: ../src/guestfs-actions.pod:6625 ../fish/guestfish-actions.pod:4442
18650 "This function sets the mask used for creating new files and device nodes to "
18656 #: ../src/guestfs-actions.pod:6628 ../fish/guestfish-actions.pod:4445
18658 "Typical umask values would be C<022> which creates new files with "
18659 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
18660 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
18665 #: ../src/guestfs-actions.pod:6633 ../fish/guestfish-actions.pod:4450
18667 "The default umask is C<022>. This is important because it means that "
18668 "directories and device nodes will be created with C<0644> or C<0755> mode "
18669 "even if you specify C<0777>."
18674 #: ../src/guestfs-actions.pod:6637
18676 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
18677 "C<guestfs_mkdir>."
18682 #: ../src/guestfs-actions.pod:6640 ../fish/guestfish-actions.pod:4457
18683 msgid "This call returns the previous umask."
18688 #: ../src/guestfs-actions.pod:6646
18689 msgid "guestfs_umount"
18694 #: ../src/guestfs-actions.pod:6648
18698 " guestfs_umount (guestfs_h *g,\n"
18699 " const char *pathordevice);\n"
18705 #: ../src/guestfs-actions.pod:6652 ../fish/guestfish-actions.pod:4465
18707 "This unmounts the given filesystem. The filesystem may be specified either "
18708 "by its mountpoint (path) or the device which contains the filesystem."
18713 #: ../src/guestfs-actions.pod:6660
18714 msgid "guestfs_umount_all"
18719 #: ../src/guestfs-actions.pod:6662
18723 " guestfs_umount_all (guestfs_h *g);\n"
18729 #: ../src/guestfs-actions.pod:6665 ../fish/guestfish-actions.pod:4475
18730 msgid "This unmounts all mounted filesystems."
18735 #: ../src/guestfs-actions.pod:6667 ../fish/guestfish-actions.pod:4477
18736 msgid "Some internal mounts are not unmounted by this call."
18741 #: ../src/guestfs-actions.pod:6673
18742 msgid "guestfs_upload"
18747 #: ../src/guestfs-actions.pod:6675
18751 " guestfs_upload (guestfs_h *g,\n"
18752 " const char *filename,\n"
18753 " const char *remotefilename);\n"
18759 #: ../src/guestfs-actions.pod:6680 ../src/guestfs-actions.pod:6704
18760 #: ../fish/guestfish-actions.pod:4483 ../fish/guestfish-actions.pod:4496
18761 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
18766 #: ../src/guestfs-actions.pod:6685
18767 msgid "See also C<guestfs_download>."
18772 #: ../src/guestfs-actions.pod:6696
18773 msgid "guestfs_upload_offset"
18778 #: ../src/guestfs-actions.pod:6698
18782 " guestfs_upload_offset (guestfs_h *g,\n"
18783 " const char *filename,\n"
18784 " const char *remotefilename,\n"
18785 " int64_t offset);\n"
18791 #: ../src/guestfs-actions.pod:6707 ../fish/guestfish-actions.pod:4499
18793 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
18794 "The intention is to overwrite parts of existing files or devices, although "
18795 "if a non-existant file is specified then it is created with a \"hole\" "
18796 "before C<offset>. The size of the data written is implicit in the size of "
18797 "the source C<filename>."
18802 #: ../src/guestfs-actions.pod:6714
18804 "Note that there is no limit on the amount of data that can be uploaded with "
18805 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
18806 "full amount unless an error occurs."
18811 #: ../src/guestfs-actions.pod:6719
18812 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
18817 #: ../src/guestfs-actions.pod:6730
18818 msgid "guestfs_utimens"
18823 #: ../src/guestfs-actions.pod:6732
18827 " guestfs_utimens (guestfs_h *g,\n"
18828 " const char *path,\n"
18829 " int64_t atsecs,\n"
18830 " int64_t atnsecs,\n"
18831 " int64_t mtsecs,\n"
18832 " int64_t mtnsecs);\n"
18838 #: ../src/guestfs-actions.pod:6740 ../fish/guestfish-actions.pod:4519
18839 msgid "This command sets the timestamps of a file with nanosecond precision."
18844 #: ../src/guestfs-actions.pod:6743 ../fish/guestfish-actions.pod:4522
18846 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
18852 #: ../src/guestfs-actions.pod:6746 ../fish/guestfish-actions.pod:4525
18854 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
18855 "nanoseconds from the epoch."
18860 #: ../src/guestfs-actions.pod:6749 ../fish/guestfish-actions.pod:4528
18862 "If the C<*nsecs> field contains the special value C<-1> then the "
18863 "corresponding timestamp is set to the current time. (The C<*secs> field is "
18864 "ignored in this case)."
18869 #: ../src/guestfs-actions.pod:6753 ../fish/guestfish-actions.pod:4532
18871 "If the C<*nsecs> field contains the special value C<-2> then the "
18872 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
18878 #: ../src/guestfs-actions.pod:6761 ../src/guestfs-structs.pod:175
18879 msgid "guestfs_version"
18884 #: ../src/guestfs-actions.pod:6763
18887 " struct guestfs_version *\n"
18888 " guestfs_version (guestfs_h *g);\n"
18894 #: ../src/guestfs-actions.pod:6766 ../fish/guestfish-actions.pod:4540
18896 "Return the libguestfs version number that the program is linked against."
18901 #: ../src/guestfs-actions.pod:6769 ../fish/guestfish-actions.pod:4543
18903 "Note that because of dynamic linking this is not necessarily the version of "
18904 "libguestfs that you compiled against. You can compile the program, and then "
18905 "at runtime dynamically link against a completely different C<libguestfs.so> "
18911 #: ../src/guestfs-actions.pod:6774 ../fish/guestfish-actions.pod:4548
18913 "This call was added in version C<1.0.58>. In previous versions of "
18914 "libguestfs there was no way to get the version number. From C code you can "
18915 "use dynamic linker functions to find out if this symbol exists (if it "
18916 "doesn't, then it's an earlier version)."
18921 #: ../src/guestfs-actions.pod:6780 ../fish/guestfish-actions.pod:4554
18923 "The call returns a structure with four elements. The first three (C<major>, "
18924 "C<minor> and C<release>) are numbers and correspond to the usual version "
18925 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
18926 "but may be used for distro-specific information."
18931 #: ../src/guestfs-actions.pod:6786 ../fish/guestfish-actions.pod:4560
18933 "To construct the original version string: C<$major.$minor.$release$extra>"
18938 #: ../src/guestfs-actions.pod:6789 ../fish/guestfish-actions.pod:4563
18939 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
18944 #: ../src/guestfs-actions.pod:6791
18946 "I<Note:> Don't use this call to test for availability of features. In "
18947 "enterprise distributions we backport features from later versions into "
18948 "earlier versions, making this an unreliable way to test for features. Use "
18949 "C<guestfs_available> instead."
18954 #: ../src/guestfs-actions.pod:6797
18956 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
18957 "error. I<The caller must call C<guestfs_free_version> after use>."
18962 #: ../src/guestfs-actions.pod:6801
18963 msgid "(Added in 1.0.58)"
18968 #: ../src/guestfs-actions.pod:6803
18969 msgid "guestfs_vfs_label"
18974 #: ../src/guestfs-actions.pod:6805
18978 " guestfs_vfs_label (guestfs_h *g,\n"
18979 " const char *device);\n"
18985 #: ../src/guestfs-actions.pod:6809 ../fish/guestfish-actions.pod:4575
18986 msgid "This returns the filesystem label of the filesystem on C<device>."
18991 #: ../src/guestfs-actions.pod:6812 ../fish/guestfish-actions.pod:4578
18992 msgid "If the filesystem is unlabeled, this returns the empty string."
18997 #: ../src/guestfs-actions.pod:6814
18998 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
19003 #: ../src/guestfs-actions.pod:6819 ../src/guestfs-actions.pod:6856
19004 msgid "(Added in 1.3.18)"
19009 #: ../src/guestfs-actions.pod:6821
19010 msgid "guestfs_vfs_type"
19015 #: ../src/guestfs-actions.pod:6823
19019 " guestfs_vfs_type (guestfs_h *g,\n"
19020 " const char *device);\n"
19026 #: ../src/guestfs-actions.pod:6827 ../fish/guestfish-actions.pod:4586
19028 "This command gets the filesystem type corresponding to the filesystem on "
19034 #: ../src/guestfs-actions.pod:6830 ../fish/guestfish-actions.pod:4589
19036 "For most filesystems, the result is the name of the Linux VFS module which "
19037 "would be used to mount this filesystem if you mounted it without specifying "
19038 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
19043 #: ../src/guestfs-actions.pod:6840
19044 msgid "guestfs_vfs_uuid"
19049 #: ../src/guestfs-actions.pod:6842
19053 " guestfs_vfs_uuid (guestfs_h *g,\n"
19054 " const char *device);\n"
19060 #: ../src/guestfs-actions.pod:6846 ../fish/guestfish-actions.pod:4598
19061 msgid "This returns the filesystem UUID of the filesystem on C<device>."
19066 #: ../src/guestfs-actions.pod:6849 ../fish/guestfish-actions.pod:4601
19067 msgid "If the filesystem does not have a UUID, this returns the empty string."
19072 #: ../src/guestfs-actions.pod:6851
19073 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
19078 #: ../src/guestfs-actions.pod:6858
19079 msgid "guestfs_vg_activate"
19084 #: ../src/guestfs-actions.pod:6860
19088 " guestfs_vg_activate (guestfs_h *g,\n"
19090 " char *const *volgroups);\n"
19096 #: ../src/guestfs-actions.pod:6865 ../fish/guestfish-actions.pod:4609
19098 "This command activates or (if C<activate> is false) deactivates all logical "
19099 "volumes in the listed volume groups C<volgroups>. If activated, then they "
19100 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
19101 "deactivated, then those devices disappear."
19106 #: ../src/guestfs-actions.pod:6871 ../fish/guestfish-actions.pod:4615
19107 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
19112 #: ../src/guestfs-actions.pod:6873 ../fish/guestfish-actions.pod:4617
19114 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
19115 "activated or deactivated."
19120 #: ../src/guestfs-actions.pod:6880
19121 msgid "guestfs_vg_activate_all"
19126 #: ../src/guestfs-actions.pod:6882
19130 " guestfs_vg_activate_all (guestfs_h *g,\n"
19131 " int activate);\n"
19137 #: ../src/guestfs-actions.pod:6886 ../fish/guestfish-actions.pod:4624
19139 "This command activates or (if C<activate> is false) deactivates all logical "
19140 "volumes in all volume groups. If activated, then they are made known to the "
19141 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
19142 "those devices disappear."
19147 #: ../src/guestfs-actions.pod:6892 ../fish/guestfish-actions.pod:4630
19148 msgid "This command is the same as running C<vgchange -a y|n>"
19153 #: ../src/guestfs-actions.pod:6898
19154 msgid "guestfs_vgcreate"
19159 #: ../src/guestfs-actions.pod:6900
19163 " guestfs_vgcreate (guestfs_h *g,\n"
19164 " const char *volgroup,\n"
19165 " char *const *physvols);\n"
19171 #: ../src/guestfs-actions.pod:6905 ../fish/guestfish-actions.pod:4636
19173 "This creates an LVM volume group called C<volgroup> from the non-empty list "
19174 "of physical volumes C<physvols>."
19179 #: ../src/guestfs-actions.pod:6912
19180 msgid "guestfs_vglvuuids"
19185 #: ../src/guestfs-actions.pod:6914
19189 " guestfs_vglvuuids (guestfs_h *g,\n"
19190 " const char *vgname);\n"
19196 #: ../src/guestfs-actions.pod:6918 ../fish/guestfish-actions.pod:4643
19198 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
19199 "volumes created in this volume group."
19204 #: ../src/guestfs-actions.pod:6921
19206 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
19207 "associate logical volumes and volume groups."
19212 #: ../src/guestfs-actions.pod:6924
19213 msgid "See also C<guestfs_vgpvuuids>."
19218 #: ../src/guestfs-actions.pod:6932
19219 msgid "guestfs_vgpvuuids"
19224 #: ../src/guestfs-actions.pod:6934
19228 " guestfs_vgpvuuids (guestfs_h *g,\n"
19229 " const char *vgname);\n"
19235 #: ../src/guestfs-actions.pod:6938 ../fish/guestfish-actions.pod:4655
19237 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
19238 "volumes that this volume group resides on."
19243 #: ../src/guestfs-actions.pod:6941
19245 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
19246 "associate physical volumes and volume groups."
19251 #: ../src/guestfs-actions.pod:6944
19252 msgid "See also C<guestfs_vglvuuids>."
19257 #: ../src/guestfs-actions.pod:6952
19258 msgid "guestfs_vgremove"
19263 #: ../src/guestfs-actions.pod:6954
19267 " guestfs_vgremove (guestfs_h *g,\n"
19268 " const char *vgname);\n"
19274 #: ../src/guestfs-actions.pod:6958 ../fish/guestfish-actions.pod:4667
19275 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
19280 #: ../src/guestfs-actions.pod:6960 ../fish/guestfish-actions.pod:4669
19282 "This also forcibly removes all logical volumes in the volume group (if any)."
19287 #: ../src/guestfs-actions.pod:6967
19288 msgid "guestfs_vgrename"
19293 #: ../src/guestfs-actions.pod:6969
19297 " guestfs_vgrename (guestfs_h *g,\n"
19298 " const char *volgroup,\n"
19299 " const char *newvolgroup);\n"
19305 #: ../src/guestfs-actions.pod:6974 ../fish/guestfish-actions.pod:4676
19306 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
19311 #: ../src/guestfs-actions.pod:6980
19312 msgid "guestfs_vgs"
19317 #: ../src/guestfs-actions.pod:6982
19321 " guestfs_vgs (guestfs_h *g);\n"
19327 #: ../src/guestfs-actions.pod:6985 ../fish/guestfish-actions.pod:4682
19329 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19335 #: ../src/guestfs-actions.pod:6988 ../fish/guestfish-actions.pod:4685
19337 "This returns a list of just the volume group names that were detected (eg. "
19343 #: ../src/guestfs-actions.pod:6991
19344 msgid "See also C<guestfs_vgs_full>."
19349 #: ../src/guestfs-actions.pod:6999
19350 msgid "guestfs_vgs_full"
19355 #: ../src/guestfs-actions.pod:7001
19358 " struct guestfs_lvm_vg_list *\n"
19359 " guestfs_vgs_full (guestfs_h *g);\n"
19365 #: ../src/guestfs-actions.pod:7004 ../fish/guestfish-actions.pod:4694
19367 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19368 "> command. The \"full\" version includes all fields."
19373 #: ../src/guestfs-actions.pod:7007
19375 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
19376 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
19381 #: ../src/guestfs-actions.pod:7013
19382 msgid "guestfs_vgscan"
19387 #: ../src/guestfs-actions.pod:7015
19391 " guestfs_vgscan (guestfs_h *g);\n"
19397 #: ../src/guestfs-actions.pod:7018 ../fish/guestfish-actions.pod:4701
19399 "This rescans all block devices and rebuilds the list of LVM physical "
19400 "volumes, volume groups and logical volumes."
19405 #: ../src/guestfs-actions.pod:7025
19406 msgid "guestfs_vguuid"
19411 #: ../src/guestfs-actions.pod:7027
19415 " guestfs_vguuid (guestfs_h *g,\n"
19416 " const char *vgname);\n"
19422 #: ../src/guestfs-actions.pod:7031 ../fish/guestfish-actions.pod:4708
19423 msgid "This command returns the UUID of the LVM VG named C<vgname>."
19428 #: ../src/guestfs-actions.pod:7038
19429 msgid "guestfs_wait_ready"
19434 #: ../src/guestfs-actions.pod:7040
19438 " guestfs_wait_ready (guestfs_h *g);\n"
19444 #: ../src/guestfs-actions.pod:7043
19445 msgid "This function is a no op."
19450 #: ../src/guestfs-actions.pod:7045
19452 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
19453 "calling C<guestfs_launch> to wait for the launch to complete. However this "
19454 "is no longer necessary because C<guestfs_launch> now does the waiting."
19459 #: ../src/guestfs-actions.pod:7050
19461 "If you see any calls to this function in code then you can just remove them, "
19462 "unless you want to retain compatibility with older versions of the API."
19467 #: ../src/guestfs-actions.pod:7058
19468 msgid "guestfs_wc_c"
19473 #: ../src/guestfs-actions.pod:7060
19477 " guestfs_wc_c (guestfs_h *g,\n"
19478 " const char *path);\n"
19484 #: ../src/guestfs-actions.pod:7064 ../fish/guestfish-actions.pod:4714
19486 "This command counts the characters in a file, using the C<wc -c> external "
19492 #: ../src/guestfs-actions.pod:7071
19493 msgid "guestfs_wc_l"
19498 #: ../src/guestfs-actions.pod:7073
19502 " guestfs_wc_l (guestfs_h *g,\n"
19503 " const char *path);\n"
19509 #: ../src/guestfs-actions.pod:7077 ../fish/guestfish-actions.pod:4721
19511 "This command counts the lines in a file, using the C<wc -l> external command."
19516 #: ../src/guestfs-actions.pod:7084
19517 msgid "guestfs_wc_w"
19522 #: ../src/guestfs-actions.pod:7086
19526 " guestfs_wc_w (guestfs_h *g,\n"
19527 " const char *path);\n"
19533 #: ../src/guestfs-actions.pod:7090 ../fish/guestfish-actions.pod:4728
19535 "This command counts the words in a file, using the C<wc -w> external command."
19540 #: ../src/guestfs-actions.pod:7097
19541 msgid "guestfs_write"
19546 #: ../src/guestfs-actions.pod:7099
19550 " guestfs_write (guestfs_h *g,\n"
19551 " const char *path,\n"
19552 " const char *content,\n"
19553 " size_t content_size);\n"
19559 #: ../src/guestfs-actions.pod:7105 ../fish/guestfish-actions.pod:4735
19561 "This call creates a file called C<path>. The content of the file is the "
19562 "string C<content> (which can contain any 8 bit data)."
19567 #: ../src/guestfs-actions.pod:7115
19568 msgid "guestfs_write_file"
19573 #: ../src/guestfs-actions.pod:7117
19577 " guestfs_write_file (guestfs_h *g,\n"
19578 " const char *path,\n"
19579 " const char *content,\n"
19586 #: ../src/guestfs-actions.pod:7123 ../fish/guestfish-actions.pod:4745
19588 "This call creates a file called C<path>. The contents of the file is the "
19589 "string C<content> (which can contain any 8 bit data), with length C<size>."
19594 #: ../src/guestfs-actions.pod:7127 ../fish/guestfish-actions.pod:4749
19596 "As a special case, if C<size> is C<0> then the length is calculated using "
19597 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
19602 #: ../src/guestfs-actions.pod:7131 ../fish/guestfish-actions.pod:4753
19604 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
19605 "I<not> work, even if the length is specified."
19610 #: ../src/guestfs-actions.pod:7139 ../fish/guestfish-actions.pod:4759
19612 "This function is deprecated. In new code, use the C<write> call instead."
19617 #: ../src/guestfs-actions.pod:7148
19618 msgid "guestfs_zegrep"
19623 #: ../src/guestfs-actions.pod:7150
19627 " guestfs_zegrep (guestfs_h *g,\n"
19628 " const char *regex,\n"
19629 " const char *path);\n"
19635 #: ../src/guestfs-actions.pod:7155 ../fish/guestfish-actions.pod:4770
19637 "This calls the external C<zegrep> program and returns the matching lines."
19642 #: ../src/guestfs-actions.pod:7167
19643 msgid "guestfs_zegrepi"
19648 #: ../src/guestfs-actions.pod:7169
19652 " guestfs_zegrepi (guestfs_h *g,\n"
19653 " const char *regex,\n"
19654 " const char *path);\n"
19660 #: ../src/guestfs-actions.pod:7174 ../fish/guestfish-actions.pod:4780
19662 "This calls the external C<zegrep -i> program and returns the matching lines."
19667 #: ../src/guestfs-actions.pod:7186
19668 msgid "guestfs_zero"
19673 #: ../src/guestfs-actions.pod:7188
19677 " guestfs_zero (guestfs_h *g,\n"
19678 " const char *device);\n"
19684 #: ../src/guestfs-actions.pod:7192 ../fish/guestfish-actions.pod:4790
19685 msgid "This command writes zeroes over the first few blocks of C<device>."
19690 #: ../src/guestfs-actions.pod:7194 ../fish/guestfish-actions.pod:4792
19692 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
19693 "securely wipe the device). It should be sufficient to remove any partition "
19694 "tables, filesystem superblocks and so on."
19699 #: ../src/guestfs-actions.pod:7198
19700 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
19705 #: ../src/guestfs-actions.pod:7209
19706 msgid "guestfs_zero_device"
19711 #: ../src/guestfs-actions.pod:7211
19715 " guestfs_zero_device (guestfs_h *g,\n"
19716 " const char *device);\n"
19722 #: ../src/guestfs-actions.pod:7215
19724 "This command writes zeroes over the entire C<device>. Compare with "
19725 "C<guestfs_zero> which just zeroes the first few blocks of a device."
19730 #: ../src/guestfs-actions.pod:7229
19731 msgid "(Added in 1.3.1)"
19736 #: ../src/guestfs-actions.pod:7231
19737 msgid "guestfs_zerofree"
19742 #: ../src/guestfs-actions.pod:7233
19746 " guestfs_zerofree (guestfs_h *g,\n"
19747 " const char *device);\n"
19753 #: ../src/guestfs-actions.pod:7237 ../fish/guestfish-actions.pod:4813
19755 "This runs the I<zerofree> program on C<device>. This program claims to zero "
19756 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
19757 "possible to compress the filesystem more effectively."
19762 #: ../src/guestfs-actions.pod:7242 ../fish/guestfish-actions.pod:4818
19763 msgid "You should B<not> run this program if the filesystem is mounted."
19768 #: ../src/guestfs-actions.pod:7245 ../fish/guestfish-actions.pod:4821
19770 "It is possible that using this program can damage the filesystem or data on "
19776 #: ../src/guestfs-actions.pod:7252
19777 msgid "guestfs_zfgrep"
19782 #: ../src/guestfs-actions.pod:7254
19786 " guestfs_zfgrep (guestfs_h *g,\n"
19787 " const char *pattern,\n"
19788 " const char *path);\n"
19794 #: ../src/guestfs-actions.pod:7259 ../fish/guestfish-actions.pod:4828
19796 "This calls the external C<zfgrep> program and returns the matching lines."
19801 #: ../src/guestfs-actions.pod:7271
19802 msgid "guestfs_zfgrepi"
19807 #: ../src/guestfs-actions.pod:7273
19811 " guestfs_zfgrepi (guestfs_h *g,\n"
19812 " const char *pattern,\n"
19813 " const char *path);\n"
19819 #: ../src/guestfs-actions.pod:7278 ../fish/guestfish-actions.pod:4838
19821 "This calls the external C<zfgrep -i> program and returns the matching lines."
19826 #: ../src/guestfs-actions.pod:7290
19827 msgid "guestfs_zfile"
19832 #: ../src/guestfs-actions.pod:7292
19836 " guestfs_zfile (guestfs_h *g,\n"
19837 " const char *meth,\n"
19838 " const char *path);\n"
19844 #: ../src/guestfs-actions.pod:7297 ../fish/guestfish-actions.pod:4848
19846 "This command runs C<file> after first decompressing C<path> using C<method>."
19851 #: ../src/guestfs-actions.pod:7300 ../fish/guestfish-actions.pod:4851
19852 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
19857 #: ../src/guestfs-actions.pod:7302
19859 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
19865 #: ../src/guestfs-actions.pod:7308 ../fish/guestfish-actions.pod:4856
19867 "This function is deprecated. In new code, use the C<file> call instead."
19872 #: ../src/guestfs-actions.pod:7317
19873 msgid "guestfs_zgrep"
19878 #: ../src/guestfs-actions.pod:7319
19882 " guestfs_zgrep (guestfs_h *g,\n"
19883 " const char *regex,\n"
19884 " const char *path);\n"
19890 #: ../src/guestfs-actions.pod:7324 ../fish/guestfish-actions.pod:4867
19892 "This calls the external C<zgrep> program and returns the matching lines."
19897 #: ../src/guestfs-actions.pod:7336
19898 msgid "guestfs_zgrepi"
19903 #: ../src/guestfs-actions.pod:7338
19907 " guestfs_zgrepi (guestfs_h *g,\n"
19908 " const char *regex,\n"
19909 " const char *path);\n"
19915 #: ../src/guestfs-actions.pod:7343 ../fish/guestfish-actions.pod:4877
19917 "This calls the external C<zgrep -i> program and returns the matching lines."
19922 #: ../src/guestfs-availability.pod:3
19928 #: ../src/guestfs-availability.pod:5
19930 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
19931 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
19932 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
19933 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
19934 "L</guestfs_aug_save> L</guestfs_aug_set>"
19939 #: ../src/guestfs-availability.pod:21
19945 #: ../src/guestfs-availability.pod:23
19947 "The following functions: L</guestfs_inotify_add_watch> L</"
19948 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
19949 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
19954 #: ../src/guestfs-availability.pod:31
19955 msgid "B<linuxfsuuid>"
19960 #: ../src/guestfs-availability.pod:33
19962 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
19963 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
19968 #: ../src/guestfs-availability.pod:40
19969 msgid "B<linuxmodules>"
19974 #: ../src/guestfs-availability.pod:42
19975 msgid "The following functions: L</guestfs_modprobe>"
19980 #: ../src/guestfs-availability.pod:45
19981 msgid "B<linuxxattrs>"
19986 #: ../src/guestfs-availability.pod:47
19988 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
19989 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
19990 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
19991 "guestfs_setxattr>"
19996 #: ../src/guestfs-availability.pod:58
20002 #: ../src/guestfs-availability.pod:60
20004 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
20005 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
20006 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
20011 #: ../src/guestfs-availability.pod:69
20017 #: ../src/guestfs-availability.pod:71
20019 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
20020 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
20021 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
20022 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
20023 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
20024 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
20025 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
20030 #: ../src/guestfs-availability.pod:94
20036 #: ../src/guestfs-availability.pod:96
20038 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
20039 "guestfs_mknod_b> L</guestfs_mknod_c>"
20044 #: ../src/guestfs-availability.pod:102
20050 #: ../src/guestfs-availability.pod:104
20051 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
20056 #: ../src/guestfs-availability.pod:107
20057 msgid "B<ntfsprogs>"
20062 #: ../src/guestfs-availability.pod:109
20064 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
20069 #: ../src/guestfs-availability.pod:113
20070 msgid "B<realpath>"
20075 #: ../src/guestfs-availability.pod:115
20076 msgid "The following functions: L</guestfs_realpath>"
20081 #: ../src/guestfs-availability.pod:118
20087 #: ../src/guestfs-availability.pod:120
20089 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
20090 "guestfs_scrub_freespace>"
20095 #: ../src/guestfs-availability.pod:125
20101 #: ../src/guestfs-availability.pod:127
20102 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
20107 #: ../src/guestfs-availability.pod:131
20113 #: ../src/guestfs-availability.pod:133
20114 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
20119 #: ../src/guestfs-availability.pod:137
20120 msgid "B<zerofree>"
20125 #: ../src/guestfs-availability.pod:139
20126 msgid "The following functions: L</guestfs_zerofree>"
20131 #: ../src/guestfs-structs.pod:1
20132 msgid "guestfs_int_bool"
20137 #: ../src/guestfs-structs.pod:3
20140 " struct guestfs_int_bool {\n"
20149 #: ../src/guestfs-structs.pod:8
20152 " struct guestfs_int_bool_list {\n"
20153 " uint32_t len; /* Number of elements in list. */\n"
20154 " struct guestfs_int_bool *val; /* Elements. */\n"
20161 #: ../src/guestfs-structs.pod:13
20164 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
20165 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
20171 #: ../src/guestfs-structs.pod:16
20172 msgid "guestfs_lvm_pv"
20177 #: ../src/guestfs-structs.pod:18
20180 " struct guestfs_lvm_pv {\n"
20181 " char *pv_name;\n"
20182 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20183 " char pv_uuid[32];\n"
20185 " uint64_t pv_size;\n"
20186 " uint64_t dev_size;\n"
20187 " uint64_t pv_free;\n"
20188 " uint64_t pv_used;\n"
20189 " char *pv_attr;\n"
20190 " int64_t pv_pe_count;\n"
20191 " int64_t pv_pe_alloc_count;\n"
20192 " char *pv_tags;\n"
20193 " uint64_t pe_start;\n"
20194 " int64_t pv_mda_count;\n"
20195 " uint64_t pv_mda_free;\n"
20202 #: ../src/guestfs-structs.pod:36
20205 " struct guestfs_lvm_pv_list {\n"
20206 " uint32_t len; /* Number of elements in list. */\n"
20207 " struct guestfs_lvm_pv *val; /* Elements. */\n"
20214 #: ../src/guestfs-structs.pod:41
20217 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
20218 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
20224 #: ../src/guestfs-structs.pod:44
20225 msgid "guestfs_lvm_vg"
20230 #: ../src/guestfs-structs.pod:46
20233 " struct guestfs_lvm_vg {\n"
20234 " char *vg_name;\n"
20235 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20236 " char vg_uuid[32];\n"
20238 " char *vg_attr;\n"
20239 " uint64_t vg_size;\n"
20240 " uint64_t vg_free;\n"
20241 " char *vg_sysid;\n"
20242 " uint64_t vg_extent_size;\n"
20243 " int64_t vg_extent_count;\n"
20244 " int64_t vg_free_count;\n"
20245 " int64_t max_lv;\n"
20246 " int64_t max_pv;\n"
20247 " int64_t pv_count;\n"
20248 " int64_t lv_count;\n"
20249 " int64_t snap_count;\n"
20250 " int64_t vg_seqno;\n"
20251 " char *vg_tags;\n"
20252 " int64_t vg_mda_count;\n"
20253 " uint64_t vg_mda_free;\n"
20260 #: ../src/guestfs-structs.pod:69
20263 " struct guestfs_lvm_vg_list {\n"
20264 " uint32_t len; /* Number of elements in list. */\n"
20265 " struct guestfs_lvm_vg *val; /* Elements. */\n"
20272 #: ../src/guestfs-structs.pod:74
20275 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
20276 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
20282 #: ../src/guestfs-structs.pod:77
20283 msgid "guestfs_lvm_lv"
20288 #: ../src/guestfs-structs.pod:79
20291 " struct guestfs_lvm_lv {\n"
20292 " char *lv_name;\n"
20293 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20294 " char lv_uuid[32];\n"
20295 " char *lv_attr;\n"
20296 " int64_t lv_major;\n"
20297 " int64_t lv_minor;\n"
20298 " int64_t lv_kernel_major;\n"
20299 " int64_t lv_kernel_minor;\n"
20300 " uint64_t lv_size;\n"
20301 " int64_t seg_count;\n"
20303 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20304 " float snap_percent;\n"
20305 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20306 " float copy_percent;\n"
20307 " char *move_pv;\n"
20308 " char *lv_tags;\n"
20309 " char *mirror_log;\n"
20310 " char *modules;\n"
20317 #: ../src/guestfs-structs.pod:101
20320 " struct guestfs_lvm_lv_list {\n"
20321 " uint32_t len; /* Number of elements in list. */\n"
20322 " struct guestfs_lvm_lv *val; /* Elements. */\n"
20329 #: ../src/guestfs-structs.pod:106
20332 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
20333 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
20339 #: ../src/guestfs-structs.pod:111
20342 " struct guestfs_stat {\n"
20346 " int64_t nlink;\n"
20351 " int64_t blksize;\n"
20352 " int64_t blocks;\n"
20353 " int64_t atime;\n"
20354 " int64_t mtime;\n"
20355 " int64_t ctime;\n"
20362 #: ../src/guestfs-structs.pod:127
20365 " struct guestfs_stat_list {\n"
20366 " uint32_t len; /* Number of elements in list. */\n"
20367 " struct guestfs_stat *val; /* Elements. */\n"
20374 #: ../src/guestfs-structs.pod:132
20377 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
20378 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
20384 #: ../src/guestfs-structs.pod:137
20387 " struct guestfs_statvfs {\n"
20388 " int64_t bsize;\n"
20389 " int64_t frsize;\n"
20390 " int64_t blocks;\n"
20391 " int64_t bfree;\n"
20392 " int64_t bavail;\n"
20393 " int64_t files;\n"
20394 " int64_t ffree;\n"
20395 " int64_t favail;\n"
20398 " int64_t namemax;\n"
20405 #: ../src/guestfs-structs.pod:151
20408 " struct guestfs_statvfs_list {\n"
20409 " uint32_t len; /* Number of elements in list. */\n"
20410 " struct guestfs_statvfs *val; /* Elements. */\n"
20417 #: ../src/guestfs-structs.pod:156
20420 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
20421 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
20427 #: ../src/guestfs-structs.pod:159
20428 msgid "guestfs_dirent"
20433 #: ../src/guestfs-structs.pod:161
20436 " struct guestfs_dirent {\n"
20446 #: ../src/guestfs-structs.pod:167
20449 " struct guestfs_dirent_list {\n"
20450 " uint32_t len; /* Number of elements in list. */\n"
20451 " struct guestfs_dirent *val; /* Elements. */\n"
20458 #: ../src/guestfs-structs.pod:172
20461 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
20462 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
20468 #: ../src/guestfs-structs.pod:177
20471 " struct guestfs_version {\n"
20472 " int64_t major;\n"
20473 " int64_t minor;\n"
20474 " int64_t release;\n"
20482 #: ../src/guestfs-structs.pod:184
20485 " struct guestfs_version_list {\n"
20486 " uint32_t len; /* Number of elements in list. */\n"
20487 " struct guestfs_version *val; /* Elements. */\n"
20494 #: ../src/guestfs-structs.pod:189
20497 " void guestfs_free_version (struct guestfs_free_version *);\n"
20498 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
20504 #: ../src/guestfs-structs.pod:192
20505 msgid "guestfs_xattr"
20510 #: ../src/guestfs-structs.pod:194
20513 " struct guestfs_xattr {\n"
20514 " char *attrname;\n"
20515 " /* The next two fields describe a byte array. */\n"
20516 " uint32_t attrval_len;\n"
20517 " char *attrval;\n"
20524 #: ../src/guestfs-structs.pod:201
20527 " struct guestfs_xattr_list {\n"
20528 " uint32_t len; /* Number of elements in list. */\n"
20529 " struct guestfs_xattr *val; /* Elements. */\n"
20536 #: ../src/guestfs-structs.pod:206
20539 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
20540 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
20546 #: ../src/guestfs-structs.pod:209
20547 msgid "guestfs_inotify_event"
20552 #: ../src/guestfs-structs.pod:211
20555 " struct guestfs_inotify_event {\n"
20556 " int64_t in_wd;\n"
20557 " uint32_t in_mask;\n"
20558 " uint32_t in_cookie;\n"
20559 " char *in_name;\n"
20566 #: ../src/guestfs-structs.pod:218
20569 " struct guestfs_inotify_event_list {\n"
20570 " uint32_t len; /* Number of elements in list. */\n"
20571 " struct guestfs_inotify_event *val; /* Elements. */\n"
20578 #: ../src/guestfs-structs.pod:223
20581 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
20582 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
20588 #: ../src/guestfs-structs.pod:226
20589 msgid "guestfs_partition"
20594 #: ../src/guestfs-structs.pod:228
20597 " struct guestfs_partition {\n"
20598 " int32_t part_num;\n"
20599 " uint64_t part_start;\n"
20600 " uint64_t part_end;\n"
20601 " uint64_t part_size;\n"
20608 #: ../src/guestfs-structs.pod:235
20611 " struct guestfs_partition_list {\n"
20612 " uint32_t len; /* Number of elements in list. */\n"
20613 " struct guestfs_partition *val; /* Elements. */\n"
20620 #: ../src/guestfs-structs.pod:240
20623 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
20624 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
20630 #: ../src/guestfs-structs.pod:243
20631 msgid "guestfs_application"
20636 #: ../src/guestfs-structs.pod:245
20639 " struct guestfs_application {\n"
20640 " char *app_name;\n"
20641 " char *app_display_name;\n"
20642 " int32_t app_epoch;\n"
20643 " char *app_version;\n"
20644 " char *app_release;\n"
20645 " char *app_install_path;\n"
20646 " char *app_trans_path;\n"
20647 " char *app_publisher;\n"
20648 " char *app_url;\n"
20649 " char *app_source_package;\n"
20650 " char *app_summary;\n"
20651 " char *app_description;\n"
20658 #: ../src/guestfs-structs.pod:260
20661 " struct guestfs_application_list {\n"
20662 " uint32_t len; /* Number of elements in list. */\n"
20663 " struct guestfs_application *val; /* Elements. */\n"
20670 #: ../src/guestfs-structs.pod:265
20673 " void guestfs_free_application (struct guestfs_free_application *);\n"
20674 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
20680 #: ../fish/guestfish.pod:5
20681 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
20686 #: ../fish/guestfish.pod:9
20689 " guestfish [--options] [commands]\n"
20695 #: ../fish/guestfish.pod:11
20704 #: ../fish/guestfish.pod:13
20707 " guestfish [--ro|--rw] -a disk.img\n"
20713 #: ../fish/guestfish.pod:15
20716 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
20722 #: ../fish/guestfish.pod:17
20725 " guestfish -d libvirt-domain\n"
20731 #: ../fish/guestfish.pod:19
20734 " guestfish [--ro|--rw] -a disk.img -i\n"
20740 #: ../fish/guestfish.pod:21
20743 " guestfish -d libvirt-domain -i\n"
20749 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
20750 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
20756 #: ../fish/guestfish.pod:25
20758 "Using guestfish in read/write mode on live virtual machines can be "
20759 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
20760 "option to use guestfish safely if the disk image or virtual machine might be "
20766 #: ../fish/guestfish.pod:32
20768 "Guestfish is a shell and command-line tool for examining and modifying "
20769 "virtual machine filesystems. It uses libguestfs and exposes all of the "
20770 "functionality of the guestfs API, see L<guestfs(3)>."
20775 #: ../fish/guestfish.pod:36
20777 "Guestfish gives you structured access to the libguestfs API, from shell "
20778 "scripts or the command line or interactively. If you want to rescue a "
20779 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
20785 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:928
20786 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
20787 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:50
20793 #: ../fish/guestfish.pod:43
20794 msgid "As an interactive shell"
20799 #: ../fish/guestfish.pod:45
20808 #: ../fish/guestfish.pod:47
20811 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
20812 " editing virtual machine filesystems.\n"
20818 #: ../fish/guestfish.pod:50
20821 " Type: 'help' for a list of commands\n"
20822 " 'man' to read the manual\n"
20823 " 'quit' to quit the shell\n"
20829 #: ../fish/guestfish.pod:54
20832 " ><fs> add-ro disk.img\n"
20834 " ><fs> list-filesystems\n"
20835 " /dev/sda1: ext4\n"
20836 " /dev/vg_guest/lv_root: ext4\n"
20837 " /dev/vg_guest/lv_swap: swap\n"
20838 " ><fs> mount /dev/vg_guest/lv_root /\n"
20839 " ><fs> cat /etc/fstab\n"
20841 " # Created by anaconda\n"
20849 #: ../fish/guestfish.pod:67
20850 msgid "From shell scripts"
20855 #: ../fish/guestfish.pod:69
20856 msgid "Create a new C</etc/motd> file in a guest or disk image:"
20861 #: ../fish/guestfish.pod:71
20864 " guestfish <<_EOF_\n"
20867 " mount /dev/vg_guest/lv_root /\n"
20868 " write /etc/motd \"Welcome, new users\"\n"
20875 #: ../fish/guestfish.pod:78
20876 msgid "List the LVM logical volumes in a disk image:"
20881 #: ../fish/guestfish.pod:80
20884 " guestfish -a disk.img --ro <<_EOF_\n"
20893 #: ../fish/guestfish.pod:85
20894 msgid "List all the filesystems in a disk image:"
20899 #: ../fish/guestfish.pod:87
20902 " guestfish -a disk.img --ro <<_EOF_\n"
20904 " list-filesystems\n"
20911 #: ../fish/guestfish.pod:92
20912 msgid "On one command line"
20917 #: ../fish/guestfish.pod:94
20918 msgid "Update C</etc/resolv.conf> in a guest:"
20923 #: ../fish/guestfish.pod:96
20927 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
20928 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
20934 #: ../fish/guestfish.pod:100
20935 msgid "Edit C</boot/grub/grub.conf> interactively:"
20940 #: ../fish/guestfish.pod:102
20943 " guestfish --rw --add disk.img \\\n"
20944 " --mount /dev/vg_guest/lv_root \\\n"
20945 " --mount /dev/sda1:/boot \\\n"
20946 " edit /boot/grub/grub.conf\n"
20952 #: ../fish/guestfish.pod:107
20953 msgid "Mount disks automatically"
20958 #: ../fish/guestfish.pod:109
20960 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
20965 #: ../fish/guestfish.pod:112
20968 " guestfish --ro -a disk.img -i cat /etc/group\n"
20974 #: ../fish/guestfish.pod:114
20977 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
20983 #: ../fish/guestfish.pod:116
20984 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
20989 #: ../fish/guestfish.pod:118
20992 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
20998 #: ../fish/guestfish.pod:120
20999 msgid "As a script interpreter"
21004 #: ../fish/guestfish.pod:122
21005 msgid "Create a 100MB disk containing an ext2-formatted partition:"
21010 #: ../fish/guestfish.pod:124
21013 " #!/usr/bin/guestfish -f\n"
21014 " sparse test1.img 100M\n"
21016 " part-disk /dev/sda mbr\n"
21017 " mkfs ext2 /dev/sda1\n"
21023 #: ../fish/guestfish.pod:130
21024 msgid "Start with a prepared disk"
21029 #: ../fish/guestfish.pod:132
21031 "An alternate way to create a 100MB disk called C<test1.img> containing a "
21032 "single ext2-formatted partition:"
21037 #: ../fish/guestfish.pod:135
21040 " guestfish -N fs\n"
21046 #: ../fish/guestfish.pod:137
21047 msgid "To list what is available do:"
21052 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:919
21055 " guestfish -N help | less\n"
21061 #: ../fish/guestfish.pod:141
21062 msgid "Remote control"
21067 #: ../fish/guestfish.pod:143
21070 " eval \"`guestfish --listen`\"\n"
21071 " guestfish --remote add-ro disk.img\n"
21072 " guestfish --remote run\n"
21073 " guestfish --remote lvs\n"
21079 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
21080 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
21081 #: ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254
21082 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103
21083 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
21089 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
21090 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104
21091 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
21092 #: ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161
21093 #: ../tools/virt-list-partitions.pl:62
21099 #: ../fish/guestfish.pod:154
21100 msgid "Displays general help on options."
21105 #: ../fish/guestfish.pod:156
21111 #: ../fish/guestfish.pod:158
21112 msgid "B<--cmd-help>"
21117 #: ../fish/guestfish.pod:160
21118 msgid "Lists all available guestfish commands."
21123 #: ../fish/guestfish.pod:162
21129 #: ../fish/guestfish.pod:164
21130 msgid "B<--cmd-help cmd>"
21135 #: ../fish/guestfish.pod:166
21136 msgid "Displays detailed help on a single command C<cmd>."
21141 #: ../fish/guestfish.pod:168
21142 msgid "B<-a image>"
21147 #: ../fish/guestfish.pod:170
21148 msgid "B<--add image>"
21153 #: ../fish/guestfish.pod:172
21154 msgid "Add a block device or virtual machine image to the shell."
21159 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
21161 "The format of the disk image is auto-detected. To override this and force a "
21162 "particular format use the I<--format=..> option."
21167 #: ../fish/guestfish.pod:177
21169 "Using this flag is mostly equivalent to using the C<add> command, with "
21170 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
21171 "the I<--format:...> flag was given."
21176 #: ../fish/guestfish.pod:181
21182 #: ../fish/guestfish.pod:183
21183 msgid "B<--connect URI>"
21188 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
21190 "When used in conjunction with the I<-d> option, this specifies the libvirt "
21191 "URI to use. The default is to use the default libvirt connection."
21196 #: ../fish/guestfish.pod:189
21202 #: ../fish/guestfish.pod:191
21204 "If using the I<--listen> option and a csh-like shell, use this option. See "
21205 "section L</REMOTE CONTROL AND CSH> below."
21210 #: ../fish/guestfish.pod:194
21211 msgid "B<-d libvirt-domain>"
21216 #: ../fish/guestfish.pod:196
21217 msgid "B<--domain libvirt-domain>"
21222 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
21224 "Add disks from the named libvirt domain. If the I<--ro> option is also "
21225 "used, then any libvirt domain can be used. However in write mode, only "
21226 "libvirt domains which are shut down can be named here."
21231 #: ../fish/guestfish.pod:202
21233 "Using this flag is mostly equivalent to using the C<add-domain> command, "
21234 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
21235 "if the I<--format:...> flag was given."
21240 #: ../fish/guestfish.pod:206
21246 #: ../fish/guestfish.pod:208
21247 msgid "B<--no-dest-paths>"
21252 #: ../fish/guestfish.pod:210
21254 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
21255 "to hit the tab key to complete paths on the guest filesystem, but this "
21256 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
21257 "allow this feature to be disabled."
21262 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
21263 msgid "B<--echo-keys>"
21268 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
21270 "When prompting for keys and passphrases, guestfish normally turns echoing "
21271 "off so you cannot see what you are typing. If you are not worried about "
21272 "Tempest attacks and there is no one else in the room you can specify this "
21273 "flag to see what you are typing."
21278 #: ../fish/guestfish.pod:222
21284 #: ../fish/guestfish.pod:224
21285 msgid "B<--file file>"
21290 #: ../fish/guestfish.pod:226
21291 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
21296 #: ../fish/guestfish.pod:229
21299 " #!/usr/bin/guestfish -f\n"
21305 #: ../fish/guestfish.pod:231
21306 msgid "B<--format=raw|qcow2|..>"
21311 #: ../fish/guestfish.pod:233
21312 msgid "B<--format>"
21317 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
21319 "The default for the I<-a> option is to auto-detect the format of the disk "
21320 "image. Using this forces the disk format for I<-a> options which follow on "
21321 "the command line. Using I<--format> with no argument switches back to auto-"
21322 "detection for subsequent I<-a> options."
21327 #: ../fish/guestfish.pod:242
21330 " guestfish --format=raw -a disk.img\n"
21336 #: ../fish/guestfish.pod:244
21337 msgid "forces raw format (no auto-detection) for C<disk.img>."
21342 #: ../fish/guestfish.pod:246
21345 " guestfish --format=raw -a disk.img --format -a another.img\n"
21351 #: ../fish/guestfish.pod:248
21353 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
21354 "detection for C<another.img>."
21359 #: ../fish/guestfish.pod:251
21361 "If you have untrusted raw-format guest disk images, you should use this "
21362 "option to specify the disk format. This avoids a possible security problem "
21363 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
21368 #: ../fish/guestfish.pod:256
21374 #: ../fish/guestfish.pod:258
21375 msgid "B<--inspector>"
21380 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
21382 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
21383 "system and mount filesystems as they would be mounted on the real virtual "
21389 #: ../fish/guestfish.pod:264
21390 msgid "Typical usage is either:"
21395 #: ../fish/guestfish.pod:266
21398 " guestfish -d myguest -i\n"
21404 #: ../fish/guestfish.pod:268
21405 msgid "(for an inactive libvirt domain called I<myguest>), or:"
21410 #: ../fish/guestfish.pod:270
21413 " guestfish --ro -d myguest -i\n"
21419 #: ../fish/guestfish.pod:272
21420 msgid "(for active domains, readonly), or specify the block device directly:"
21425 #: ../fish/guestfish.pod:274
21428 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
21434 #: ../fish/guestfish.pod:276
21436 "Note that the command line syntax changed slightly over older versions of "
21437 "guestfish. You can still use the old syntax:"
21442 #: ../fish/guestfish.pod:279
21445 " guestfish [--ro] -i disk.img\n"
21451 #: ../fish/guestfish.pod:281
21454 " guestfish [--ro] -i libvirt-domain\n"
21460 #: ../fish/guestfish.pod:283
21462 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
21463 "then using other commands to mount the filesystems that were found."
21468 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
21469 msgid "B<--keys-from-stdin>"
21474 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
21476 "Read key or passphrase parameters from stdin. The default is to try to read "
21477 "passphrases from the user by opening C</dev/tty>."
21482 #: ../fish/guestfish.pod:292
21483 msgid "B<--listen>"
21488 #: ../fish/guestfish.pod:294
21490 "Fork into the background and listen for remote commands. See section L</"
21491 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
21495 #: ../fish/guestfish.pod:297 ../fuse/guestmount.pod:146
21500 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:148
21502 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
21503 "ATTACHING TO RUNNING DAEMONS>)."
21508 #: ../fish/guestfish.pod:302
21509 msgid "B<-m dev[:mountpoint]>"
21514 #: ../fish/guestfish.pod:304
21515 msgid "B<--mount dev[:mountpoint]>"
21520 #: ../fish/guestfish.pod:306
21521 msgid "Mount the named partition or logical volume on the given mountpoint."
21526 #: ../fish/guestfish.pod:308
21527 msgid "If the mountpoint is omitted, it defaults to C</>."
21532 #: ../fish/guestfish.pod:310
21533 msgid "You have to mount something on C</> before most commands will work."
21538 #: ../fish/guestfish.pod:312
21540 "If any I<-m> or I<--mount> options are given, the guest is automatically "
21546 #: ../fish/guestfish.pod:315
21548 "If you don't know what filesystems a disk image contains, you can either run "
21549 "guestfish without this option, then list the partitions, filesystems and LVs "
21550 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
21551 "commands), or you can use the L<virt-filesystems(1)> program."
21556 #: ../fish/guestfish.pod:321
21558 "Using this flag is mostly equivalent to using the C<mount-options> command "
21559 "or the C<mount-ro> command if the I<--ro> flag was given."
21564 #: ../fish/guestfish.pod:324
21570 #: ../fish/guestfish.pod:326
21571 msgid "B<--no-sync>"
21576 #: ../fish/guestfish.pod:328
21578 "Disable autosync. This is enabled by default. See the discussion of "
21579 "autosync in the L<guestfs(3)> manpage."
21584 #: ../fish/guestfish.pod:331
21590 #: ../fish/guestfish.pod:333
21591 msgid "B<--new type>"
21596 #: ../fish/guestfish.pod:335
21602 #: ../fish/guestfish.pod:337
21604 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
21605 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
21606 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
21612 #: ../fish/guestfish.pod:342
21613 msgid "B<--progress-bars>"
21618 #: ../fish/guestfish.pod:344
21619 msgid "Enable progress bars, even when guestfish is used non-interactively."
21624 #: ../fish/guestfish.pod:346
21626 "Progress bars are enabled by default when guestfish is used as an "
21627 "interactive shell."
21632 #: ../fish/guestfish.pod:349
21633 msgid "B<--no-progress-bars>"
21638 #: ../fish/guestfish.pod:351
21639 msgid "Disable progress bars."
21644 #: ../fish/guestfish.pod:353
21645 msgid "B<--remote[=pid]>"
21650 #: ../fish/guestfish.pod:355
21652 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
21653 "CONTROL GUESTFISH OVER A SOCKET> below."
21658 #: ../fish/guestfish.pod:358
21664 #: ../fish/guestfish.pod:360
21670 #: ../fish/guestfish.pod:362
21672 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
21673 "mounts are done read-only."
21678 #: ../fish/guestfish.pod:365
21680 "The option must always be used if the disk image or virtual machine might be "
21681 "running, and is generally recommended in cases where you don't need write "
21682 "access to the disk."
21687 #: ../fish/guestfish.pod:369
21689 "Note that prepared disk images created with I<-N> are not affected by this "
21690 "option. Also commands like C<add> are not affected - you have to specify "
21691 "the C<readonly:true> option explicitly if you need it."
21696 #: ../fish/guestfish.pod:373
21697 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
21702 #: ../fish/guestfish.pod:375 ../fuse/guestmount.pod:213
21703 msgid "B<--selinux>"
21708 #: ../fish/guestfish.pod:377
21709 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
21714 #: ../fish/guestfish.pod:379
21720 #: ../fish/guestfish.pod:381
21721 msgid "B<--verbose>"
21726 #: ../fish/guestfish.pod:383
21728 "Enable very verbose messages. This is particularly useful if you find a bug."
21733 #: ../fish/guestfish.pod:386
21739 #: ../fish/guestfish.pod:388 ../tools/virt-edit.pl:88
21740 #: ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270
21741 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119
21742 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
21743 msgid "B<--version>"
21748 #: ../fish/guestfish.pod:390
21749 msgid "Display the guestfish / libguestfs version number and exit."
21754 #: ../fish/guestfish.pod:392
21760 #: ../fish/guestfish.pod:394
21766 #: ../fish/guestfish.pod:396
21768 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
21774 #: ../fish/guestfish.pod:399
21780 #: ../fish/guestfish.pod:401
21781 msgid "Echo each command before executing it."
21786 #: ../fish/guestfish.pod:405
21787 msgid "COMMANDS ON COMMAND LINE"
21792 #: ../fish/guestfish.pod:407
21794 "Any additional (non-option) arguments are treated as commands to execute."
21799 #: ../fish/guestfish.pod:410
21801 "Commands to execute should be separated by a colon (C<:>), where the colon "
21802 "is a separate parameter. Thus:"
21807 #: ../fish/guestfish.pod:413
21810 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
21816 #: ../fish/guestfish.pod:415
21818 "If there are no additional arguments, then we enter a shell, either an "
21819 "interactive shell with a prompt (if the input is a terminal) or a non-"
21820 "interactive shell."
21825 #: ../fish/guestfish.pod:419
21827 "In either command line mode or non-interactive shell, the first command that "
21828 "gives an error causes the whole shell to exit. In interactive mode (with a "
21829 "prompt) if a command fails, you can continue to enter commands."
21834 #: ../fish/guestfish.pod:424
21835 msgid "USING launch (OR run)"
21840 #: ../fish/guestfish.pod:426
21842 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
21843 "then launch it, then mount any disks you need, and finally issue actions/"
21844 "commands. So the general order of the day is:"
21849 #: ../fish/guestfish.pod:434
21850 msgid "add or -a/--add"
21855 #: ../fish/guestfish.pod:438
21856 msgid "launch (aka run)"
21861 #: ../fish/guestfish.pod:442
21862 msgid "mount or -m/--mount"
21867 #: ../fish/guestfish.pod:446
21868 msgid "any other commands"
21873 #: ../fish/guestfish.pod:450
21875 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
21876 "guest before mounting or performing any other commands."
21881 #: ../fish/guestfish.pod:453
21883 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
21884 "I<--new> options were given then C<run> is done automatically, simply "
21885 "because guestfish can't perform the action you asked for without doing this."
21890 #: ../fish/guestfish.pod:458
21891 msgid "OPENING DISKS FOR READ AND WRITE"
21896 #: ../fish/guestfish.pod:460
21898 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
21899 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
21900 "open disk images read-only or for writing."
21905 #: ../fish/guestfish.pod:464
21907 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
21908 "disk images supplied on the command line for write. To open a disk image "
21909 "read-only you have to do I<-a image --ro>."
21914 #: ../fish/guestfish.pod:468
21916 "This matters: If you accidentally open a live VM disk image writable then "
21917 "you will cause irreversible disk corruption."
21921 #: ../fish/guestfish.pod:471
21923 "By libguestfs 1.10 we intend to change the default the other way. Disk "
21924 "images will be opened read-only. You will have to either specify "
21925 "I<guestfish --rw> or change a configuration file in order to get write "
21926 "access for disk images specified by those other command line options."
21931 #: ../fish/guestfish.pod:476
21933 "This version of guestfish has a I<--rw> option which does nothing (it is "
21934 "already the default). However it is highly recommended that you use this "
21935 "option to indicate that guestfish needs write access, and to prepare your "
21936 "scripts for the day when this option will be required for write access."
21941 #: ../fish/guestfish.pod:482
21943 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
21944 "other libguestfs program apart from guestfish and guestmount."
21949 #: ../fish/guestfish.pod:485
21955 #: ../fish/guestfish.pod:487
21957 "You can quote ordinary parameters using either single or double quotes. For "
21963 #: ../fish/guestfish.pod:490
21966 " add \"file with a space.img\"\n"
21972 #: ../fish/guestfish.pod:492
21975 " rm '/file name'\n"
21981 #: ../fish/guestfish.pod:494
21990 #: ../fish/guestfish.pod:496
21992 "A few commands require a list of strings to be passed. For these, use a "
21993 "whitespace-separated list, enclosed in quotes. Strings containing "
21994 "whitespace to be passed through must be enclosed in single quotes. A "
21995 "literal single quote must be escaped with a backslash."
22000 #: ../fish/guestfish.pod:501
22003 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
22004 " command \"/bin/echo 'foo bar'\"\n"
22005 " command \"/bin/echo \\'foo\\'\"\n"
22011 #: ../fish/guestfish.pod:505
22012 msgid "OPTIONAL ARGUMENTS"
22017 #: ../fish/guestfish.pod:507
22019 "Some commands take optional arguments. These arguments appear in this "
22020 "documentation as C<[argname:..]>. You can use them as in these examples:"
22025 #: ../fish/guestfish.pod:511
22028 " add-drive-opts filename\n"
22034 #: ../fish/guestfish.pod:513
22037 " add-drive-opts filename readonly:true\n"
22043 #: ../fish/guestfish.pod:515
22046 " add-drive-opts filename format:qcow2 readonly:false\n"
22052 #: ../fish/guestfish.pod:517
22054 "Each optional argument can appear at most once. All optional arguments must "
22055 "appear after the required ones."
22060 #: ../fish/guestfish.pod:520
22066 #: ../fish/guestfish.pod:522
22068 "This section applies to all commands which can take integers as parameters."
22073 #: ../fish/guestfish.pod:525
22074 msgid "SIZE SUFFIX"
22079 #: ../fish/guestfish.pod:527
22081 "When the command takes a parameter measured in bytes, you can use one of the "
22082 "following suffixes to specify kilobytes, megabytes and larger sizes:"
22087 #: ../fish/guestfish.pod:533
22088 msgid "B<k> or B<K> or B<KiB>"
22093 #: ../fish/guestfish.pod:535
22094 msgid "The size in kilobytes (multiplied by 1024)."
22099 #: ../fish/guestfish.pod:537
22105 #: ../fish/guestfish.pod:539
22106 msgid "The size in SI 1000 byte units."
22111 #: ../fish/guestfish.pod:541
22112 msgid "B<M> or B<MiB>"
22117 #: ../fish/guestfish.pod:543
22118 msgid "The size in megabytes (multiplied by 1048576)."
22123 #: ../fish/guestfish.pod:545
22129 #: ../fish/guestfish.pod:547
22130 msgid "The size in SI 1000000 byte units."
22135 #: ../fish/guestfish.pod:549
22136 msgid "B<G> or B<GiB>"
22141 #: ../fish/guestfish.pod:551
22142 msgid "The size in gigabytes (multiplied by 2**30)."
22147 #: ../fish/guestfish.pod:553
22153 #: ../fish/guestfish.pod:555
22154 msgid "The size in SI 10**9 byte units."
22159 #: ../fish/guestfish.pod:557
22160 msgid "B<T> or B<TiB>"
22165 #: ../fish/guestfish.pod:559
22166 msgid "The size in terabytes (multiplied by 2**40)."
22171 #: ../fish/guestfish.pod:561
22177 #: ../fish/guestfish.pod:563
22178 msgid "The size in SI 10**12 byte units."
22183 #: ../fish/guestfish.pod:565
22184 msgid "B<P> or B<PiB>"
22189 #: ../fish/guestfish.pod:567
22190 msgid "The size in petabytes (multiplied by 2**50)."
22195 #: ../fish/guestfish.pod:569
22201 #: ../fish/guestfish.pod:571
22202 msgid "The size in SI 10**15 byte units."
22207 #: ../fish/guestfish.pod:573
22208 msgid "B<E> or B<EiB>"
22213 #: ../fish/guestfish.pod:575
22214 msgid "The size in exabytes (multiplied by 2**60)."
22219 #: ../fish/guestfish.pod:577
22225 #: ../fish/guestfish.pod:579
22226 msgid "The size in SI 10**18 byte units."
22231 #: ../fish/guestfish.pod:581
22232 msgid "B<Z> or B<ZiB>"
22237 #: ../fish/guestfish.pod:583
22238 msgid "The size in zettabytes (multiplied by 2**70)."
22243 #: ../fish/guestfish.pod:585
22249 #: ../fish/guestfish.pod:587
22250 msgid "The size in SI 10**21 byte units."
22255 #: ../fish/guestfish.pod:589
22256 msgid "B<Y> or B<YiB>"
22261 #: ../fish/guestfish.pod:591
22262 msgid "The size in yottabytes (multiplied by 2**80)."
22267 #: ../fish/guestfish.pod:593
22273 #: ../fish/guestfish.pod:595
22274 msgid "The size in SI 10**24 byte units."
22279 #: ../fish/guestfish.pod:601
22282 " truncate-size /file 1G\n"
22288 #: ../fish/guestfish.pod:603
22289 msgid "would truncate the file to 1 gigabyte."
22294 #: ../fish/guestfish.pod:605
22296 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
22297 "the parameter to L</memsize> is specified in megabytes already). Adding a "
22298 "suffix will probably not do what you expect."
22303 #: ../fish/guestfish.pod:609
22304 msgid "OCTAL AND HEXADECIMAL NUMBERS"
22309 #: ../fish/guestfish.pod:611
22311 "For specifying the radix (base) use the C convention: C<0> to prefix an "
22312 "octal number or C<0x> to prefix a hexadecimal number. For example:"
22317 #: ../fish/guestfish.pod:614
22320 " 1234 decimal number 1234\n"
22321 " 02322 octal number, equivalent to decimal 1234\n"
22322 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
22328 #: ../fish/guestfish.pod:618
22330 "When using the C<chmod> command, you almost always want to specify an octal "
22331 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
22332 "L<chmod(1)> program):"
22337 #: ../fish/guestfish.pod:622
22340 " chmod 0777 /public # OK\n"
22341 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
22347 #: ../fish/guestfish.pod:625
22349 "Commands that return numbers usually print them in decimal, but some "
22350 "commands print numbers in other radices (eg. C<umask> prints the mode in "
22351 "octal, preceeded by C<0>)."
22356 #: ../fish/guestfish.pod:629
22357 msgid "WILDCARDS AND GLOBBING"
22362 #: ../fish/guestfish.pod:631
22364 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
22365 "(globbing) by default. So for example the following will not do what you "
22371 #: ../fish/guestfish.pod:635
22380 #: ../fish/guestfish.pod:637
22382 "Assuming you don't have a directory called literally C</home/*> then the "
22383 "above command will return an error."
22388 #: ../fish/guestfish.pod:640
22389 msgid "To perform wildcard expansion, use the C<glob> command."
22394 #: ../fish/guestfish.pod:642
22397 " glob rm-rf /home/*\n"
22403 #: ../fish/guestfish.pod:644
22405 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
22406 "many times), equivalent to:"
22411 #: ../fish/guestfish.pod:647
22414 " rm-rf /home/jim\n"
22415 " rm-rf /home/joe\n"
22416 " rm-rf /home/mary\n"
22422 #: ../fish/guestfish.pod:651
22423 msgid "C<glob> only works on simple guest paths and not on device names."
22428 #: ../fish/guestfish.pod:653
22430 "If you have several parameters, each containing a wildcard, then glob will "
22431 "perform a Cartesian product."
22436 #: ../fish/guestfish.pod:656
22442 #: ../fish/guestfish.pod:658
22444 "Any line which starts with a I<#> character is treated as a comment and "
22445 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
22446 "a command. For example:"
22451 #: ../fish/guestfish.pod:662
22454 " # this is a comment\n"
22455 " # this is a comment\n"
22456 " foo # NOT a comment\n"
22462 #: ../fish/guestfish.pod:666
22463 msgid "Blank lines are also ignored."
22468 #: ../fish/guestfish.pod:668
22469 msgid "RUNNING COMMANDS LOCALLY"
22474 #: ../fish/guestfish.pod:670
22476 "Any line which starts with a I<!> character is treated as a command sent to "
22477 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
22482 #: ../fish/guestfish.pod:674
22486 " tgz-out /remote local/remote-data.tar.gz\n"
22492 #: ../fish/guestfish.pod:677
22494 "will create a directory C<local> on the host, and then export the contents "
22495 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
22496 "(See C<tgz-out>)."
22501 #: ../fish/guestfish.pod:681
22503 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
22504 "effect, due to the way that subprocesses work in Unix."
22508 #: ../fish/guestfish.pod:684
22509 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
22513 #: ../fish/guestfish.pod:686
22515 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
22516 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
22517 "and executed as guestfish commands."
22521 #: ../fish/guestfish.pod:690
22523 "Thus you can use shell script to construct arbitrary guestfish commands "
22524 "which are then parsed by guestfish."
22528 #: ../fish/guestfish.pod:693
22530 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
22531 "through C</foo.100>) using guestfish commands alone. However this is simple "
22532 "if we use a shell script to create the guestfish commands for us:"
22536 #: ../fish/guestfish.pod:698
22539 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
22544 #: ../fish/guestfish.pod:700
22545 msgid "or with names like C</foo.001>:"
22549 #: ../fish/guestfish.pod:702
22552 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
22557 #: ../fish/guestfish.pod:704
22559 "When using guestfish interactively it can be helpful to just run the shell "
22560 "script first (ie. remove the initial C<E<lt>> character so it is just an "
22561 "ordinary I<!> local command), see what guestfish commands it would run, and "
22562 "when you are happy with those prepend the C<E<lt>> character to run the "
22563 "guestfish commands for real."
22568 #: ../fish/guestfish.pod:710
22574 #: ../fish/guestfish.pod:712
22576 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
22577 "command (a guestfish command) to the second command (any host command). For "
22583 #: ../fish/guestfish.pod:716
22586 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
22592 #: ../fish/guestfish.pod:718
22594 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
22595 "program). The above command would list all accounts in the guest filesystem "
22596 "which have UID 0, ie. root accounts including backdoors. Other examples:"
22601 #: ../fish/guestfish.pod:723
22604 " hexdump /bin/ls | head\n"
22605 " list-devices | tail -1\n"
22606 " tgz-out / - | tar ztf -\n"
22612 #: ../fish/guestfish.pod:727
22614 "The space before the pipe symbol is required, any space after the pipe "
22615 "symbol is optional. Everything after the pipe symbol is just passed "
22616 "straight to the host shell, so it can contain redirections, globs and "
22617 "anything else that makes sense on the host side."
22622 #: ../fish/guestfish.pod:732
22624 "To use a literal argument which begins with a pipe symbol, you have to quote "
22630 #: ../fish/guestfish.pod:735
22639 #: ../fish/guestfish.pod:737
22640 msgid "HOME DIRECTORIES"
22645 #: ../fish/guestfish.pod:739
22647 "If a parameter starts with the character C<~> then the tilde may be expanded "
22648 "as a home directory path (either C<~> for the current user's home directory, "
22649 "or C<~user> for another user)."
22654 #: ../fish/guestfish.pod:743
22656 "Note that home directory expansion happens for users known I<on the host>, "
22657 "not in the guest filesystem."
22662 #: ../fish/guestfish.pod:746
22664 "To use a literal argument which begins with a tilde, you have to quote it, "
22670 #: ../fish/guestfish.pod:749
22679 #: ../fish/guestfish.pod:753
22681 "Libguestfs has some support for Linux guests encrypted according to the "
22682 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
22683 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
22684 "LUKS is supported."
22689 #: ../fish/guestfish.pod:758
22690 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
22695 #: ../fish/guestfish.pod:760
22698 " ><fs> vfs-type /dev/sda2\n"
22705 #: ../fish/guestfish.pod:763
22707 "Then open those devices using L</luks-open>. This creates a device-mapper "
22708 "device called C</dev/mapper/luksdev>."
22713 #: ../fish/guestfish.pod:766
22716 " ><fs> luks-open /dev/sda2 luksdev\n"
22717 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
22723 #: ../fish/guestfish.pod:769
22725 "Finally you have to tell LVM to scan for volume groups on the newly created "
22731 #: ../fish/guestfish.pod:772
22735 " vg-activate-all true\n"
22741 #: ../fish/guestfish.pod:775
22742 msgid "The logical volume(s) can now be mounted in the usual way."
22747 #: ../fish/guestfish.pod:777
22749 "Before closing a LUKS device you must unmount any logical volumes on it and "
22750 "deactivate the volume groups by calling C<vg-activate false VG> on each "
22751 "one. Then you can close the mapper device:"
22756 #: ../fish/guestfish.pod:781
22759 " vg-activate false /dev/VG\n"
22760 " luks-close /dev/mapper/luksdev\n"
22766 #: ../fish/guestfish.pod:784
22767 msgid "WINDOWS PATHS"
22772 #: ../fish/guestfish.pod:786
22774 "If a path is prefixed with C<win:> then you can use Windows-style paths "
22775 "(with some limitations). The following commands are equivalent:"
22780 #: ../fish/guestfish.pod:789
22783 " file /WINDOWS/system32/config/system.LOG\n"
22789 #: ../fish/guestfish.pod:791
22792 " file win:/windows/system32/config/system.log\n"
22798 #: ../fish/guestfish.pod:793
22801 " file win:\\windows\\system32\\config\\system.log\n"
22807 #: ../fish/guestfish.pod:795
22810 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
22816 #: ../fish/guestfish.pod:797
22818 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
22819 "handles case insensitivity like Windows would. This only works in argument "
22820 "positions that expect a path."
22825 #: ../fish/guestfish.pod:801
22826 msgid "UPLOADING AND DOWNLOADING FILES"
22831 #: ../fish/guestfish.pod:803
22833 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
22834 "others which upload from or download to a local file, you can use the "
22835 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
22840 #: ../fish/guestfish.pod:807
22849 #: ../fish/guestfish.pod:809
22851 "reads stdin and creates from that a file C</foo> in the disk image, and:"
22856 #: ../fish/guestfish.pod:812
22859 " tar-out /etc - | tar tf -\n"
22865 #: ../fish/guestfish.pod:814
22867 "writes the tarball to stdout and then pipes that into the external \"tar\" "
22868 "command (see L</PIPES>)."
22873 #: ../fish/guestfish.pod:817
22875 "When using C<-> to read from stdin, the input is read up to the end of "
22876 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
22877 "some arbitrary end marker:"
22882 #: ../fish/guestfish.pod:821
22885 " upload -<<END /foo\n"
22895 #: ../fish/guestfish.pod:827
22897 "Any string of characters can be used instead of C<END>. The end marker must "
22898 "appear on a line of its own, without any preceeding or following characters "
22899 "(not even spaces)."
22904 #: ../fish/guestfish.pod:831
22906 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
22907 "upload local files (so-called \"FileIn\" parameters in the generator)."
22912 #: ../fish/guestfish.pod:834
22913 msgid "EXIT ON ERROR BEHAVIOUR"
22918 #: ../fish/guestfish.pod:836
22920 "By default, guestfish will ignore any errors when in interactive mode (ie. "
22921 "taking commands from a human over a tty), and will exit on the first error "
22922 "in non-interactive mode (scripts, commands given on the command line)."
22927 #: ../fish/guestfish.pod:841
22929 "If you prefix a command with a I<-> character, then that command will not "
22930 "cause guestfish to exit, even if that (one) command returns an error."
22935 #: ../fish/guestfish.pod:845
22936 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
22941 #: ../fish/guestfish.pod:847
22943 "Guestfish can be remote-controlled over a socket. This is useful "
22944 "particularly in shell scripts where you want to make several different "
22945 "changes to a filesystem, but you don't want the overhead of starting up a "
22946 "guestfish process each time."
22951 #: ../fish/guestfish.pod:852
22952 msgid "Start a guestfish server process using:"
22957 #: ../fish/guestfish.pod:854
22960 " eval \"`guestfish --listen`\"\n"
22966 #: ../fish/guestfish.pod:856
22967 msgid "and then send it commands by doing:"
22972 #: ../fish/guestfish.pod:858
22975 " guestfish --remote cmd [...]\n"
22981 #: ../fish/guestfish.pod:860
22982 msgid "To cause the server to exit, send it the exit command:"
22987 #: ../fish/guestfish.pod:862
22990 " guestfish --remote exit\n"
22996 #: ../fish/guestfish.pod:864
22998 "Note that the server will normally exit if there is an error in a command. "
22999 "You can change this in the usual way. See section L</EXIT ON ERROR "
23005 #: ../fish/guestfish.pod:868
23006 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
23011 #: ../fish/guestfish.pod:870
23013 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
23014 "is how the I<--remote> option knows where to send the commands. You can "
23015 "have several guestfish listener processes running using:"
23020 #: ../fish/guestfish.pod:874
23023 " eval \"`guestfish --listen`\"\n"
23024 " pid1=$GUESTFISH_PID\n"
23025 " eval \"`guestfish --listen`\"\n"
23026 " pid2=$GUESTFISH_PID\n"
23028 " guestfish --remote=$pid1 cmd\n"
23029 " guestfish --remote=$pid2 cmd\n"
23035 #: ../fish/guestfish.pod:882
23036 msgid "REMOTE CONTROL AND CSH"
23041 #: ../fish/guestfish.pod:884
23043 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
23049 #: ../fish/guestfish.pod:887
23052 " eval \"`guestfish --listen --csh`\"\n"
23058 #: ../fish/guestfish.pod:889
23059 msgid "REMOTE CONTROL DETAILS"
23064 #: ../fish/guestfish.pod:891
23066 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
23067 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
23068 "and C<$PID> is the process ID of the server."
23073 #: ../fish/guestfish.pod:895
23074 msgid "Guestfish client and server versions must match exactly."
23079 #: ../fish/guestfish.pod:897
23080 msgid "PREPARED DISK IMAGES"
23085 #: ../fish/guestfish.pod:899
23087 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
23088 "preformatted disk images that guestfish can make for you to save typing. "
23089 "This is particularly useful for testing purposes. This option is used "
23090 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
23091 "can be mixed with I<-a>)."
23096 #: ../fish/guestfish.pod:905
23098 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
23099 "the second and so on. Existing files in the current directory are "
23105 #: ../fish/guestfish.pod:909
23107 "The type briefly describes how the disk should be sized, partitioned, how "
23108 "filesystem(s) should be created, and how content should be added. "
23109 "Optionally the type can be followed by extra parameters, separated by C<:> "
23110 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
23111 "allocated disk, containing a single partition, with the partition formatted "
23112 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
23118 #: ../fish/guestfish.pod:917
23119 msgid "To list the available types and any extra parameters they take, run:"
23124 #: ../fish/guestfish.pod:921
23126 "Note that the prepared filesystem is not mounted. You would usually have to "
23127 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
23132 #: ../fish/guestfish.pod:925
23134 "If any I<-N> or I<--new> options are given, the guest is automatically "
23140 #: ../fish/guestfish.pod:930
23141 msgid "Create a 100MB disk with an ext4-formatted partition:"
23146 #: ../fish/guestfish.pod:932
23149 " guestfish -N fs:ext4\n"
23155 #: ../fish/guestfish.pod:934
23156 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
23161 #: ../fish/guestfish.pod:936
23164 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
23170 #: ../fish/guestfish.pod:938
23171 msgid "Create a blank 200MB disk:"
23176 #: ../fish/guestfish.pod:940
23179 " guestfish -N disk:200M\n"
23185 #: ../fish/guestfish.pod:942
23186 msgid "PROGRESS BARS"
23191 #: ../fish/guestfish.pod:944
23193 "Some (not all) long-running commands send progress notification messages as "
23194 "they are running. Guestfish turns these messages into progress bars."
23199 #: ../fish/guestfish.pod:948
23201 "When a command that supports progress bars takes longer than two seconds to "
23202 "run, and if progress bars are enabled, then you will see one appearing below "
23208 #: ../fish/guestfish.pod:952
23211 " ><fs> copy-size /large-file /another-file 2048M\n"
23212 " / 10% [#####-----------------------------------------] 00:30\n"
23218 #: ../fish/guestfish.pod:955
23220 "The spinner on the left hand side moves round once for every progress "
23221 "notification received from the backend. This is a (reasonably) golden "
23222 "assurance that the command is \"doing something\" even if the progress bar "
23223 "is not moving, because the command is able to send the progress "
23224 "notifications. When the bar reaches 100% and the command finishes, the "
23225 "spinner disappears."
23230 #: ../fish/guestfish.pod:962
23232 "Progress bars are enabled by default when guestfish is used interactively. "
23233 "You can enable them even for non-interactive modes using I<--progress-bars>, "
23234 "and you can disable them completely using I<--no-progress-bars>."
23239 #: ../fish/guestfish.pod:967
23240 msgid "GUESTFISH COMMANDS"
23245 #: ../fish/guestfish.pod:969
23247 "The commands in this section are guestfish convenience commands, in other "
23248 "words, they are not part of the L<guestfs(3)> API."
23253 #: ../fish/guestfish.pod:972
23259 #: ../fish/guestfish.pod:974
23269 #: ../fish/guestfish.pod:977
23270 msgid "Without any parameter, this provides general help."
23275 #: ../fish/guestfish.pod:979
23276 msgid "With a C<cmd> parameter, this displays detailed help for that command."
23281 #: ../fish/guestfish.pod:981
23282 msgid "quit | exit"
23287 #: ../fish/guestfish.pod:983
23288 msgid "This exits guestfish. You can also use C<^D> key."
23293 #: ../fish/guestfish.pod:985
23294 msgid "@FISH_COMMANDS@"
23299 #: ../fish/guestfish.pod:987
23305 #: ../fish/guestfish.pod:991 ../test-tool/libguestfs-test-tool.pod:83
23311 #: ../fish/guestfish.pod:993
23313 "guestfish returns 0 if the commands completed without error, or 1 if there "
23319 #: ../fish/guestfish.pod:1000
23325 #: ../fish/guestfish.pod:1002
23327 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
23333 #: ../fish/guestfish.pod:1005
23334 msgid "GUESTFISH_PID"
23339 #: ../fish/guestfish.pod:1007
23341 "Used with the I<--remote> option to specify the remote guestfish process to "
23342 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
23347 #: ../fish/guestfish.pod:1011
23353 #: ../fish/guestfish.pod:1013
23355 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
23356 "not specified, the external L<hexedit(1)> program is used."
23361 #: ../fish/guestfish.pod:1017
23367 #: ../fish/guestfish.pod:1019
23369 "If compiled with GNU readline support, various files in the home directory "
23370 "can be used. See L</FILES>."
23375 #: ../fish/guestfish.pod:1028
23377 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
23378 "effect as using the B<-v> option."
23383 #: ../fish/guestfish.pod:1040
23385 "Set the path that guestfish uses to search for kernel and initrd.img. See "
23386 "the discussion of paths in L<guestfs(3)>."
23391 #: ../fish/guestfish.pod:1051
23392 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
23397 #: ../fish/guestfish.pod:1053
23403 #: ../fish/guestfish.pod:1055
23405 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
23411 #: ../fish/guestfish.pod:1071 ../test-tool/libguestfs-test-tool.pod:88
23417 #: ../fish/guestfish.pod:1075
23418 msgid "$HOME/.guestfish"
23423 #: ../fish/guestfish.pod:1077
23425 "If compiled with GNU readline support, then the command history is saved in "
23431 #: ../fish/guestfish.pod:1080
23432 msgid "$HOME/.inputrc"
23437 #: ../fish/guestfish.pod:1082
23438 msgid "/etc/inputrc"
23443 #: ../fish/guestfish.pod:1084
23445 "If compiled with GNU readline support, then these files can be used to "
23446 "configure readline. For further information, please see L<readline(3)/"
23447 "INITIALIZATION FILE>."
23452 #: ../fish/guestfish.pod:1088
23453 msgid "To write rules which only apply to guestfish, use:"
23458 #: ../fish/guestfish.pod:1090
23469 #: ../fish/guestfish.pod:1094
23471 "Variables that you can set in inputrc that change the behaviour of guestfish "
23472 "in useful ways include:"
23477 #: ../fish/guestfish.pod:1099
23478 msgid "completion-ignore-case (default: on)"
23483 #: ../fish/guestfish.pod:1101
23485 "By default, guestfish will ignore case when tab-completing paths on the "
23491 #: ../fish/guestfish.pod:1104
23494 " set completion-ignore-case off\n"
23500 #: ../fish/guestfish.pod:1106
23501 msgid "to make guestfish case sensitive."
23506 #: ../fish/guestfish.pod:1110
23512 #: ../fish/guestfish.pod:1112
23513 msgid "test2.img (etc)"
23518 #: ../fish/guestfish.pod:1114
23520 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
23521 "will be created in the file C<test1.img> in the current directory. The "
23522 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
23523 "the same name will be overwritten."
23527 #: ../fish/guestfish.pod:1123
23529 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
23530 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
23531 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
23532 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
23533 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
23534 ">, L<hexedit(1)>."
23539 #: ../fish/guestfish.pod:1153 ../test-tool/libguestfs-test-tool.pod:124
23540 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:372
23541 #: ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1512
23542 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309
23543 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
23545 "This program is free software; you can redistribute it and/or modify it "
23546 "under the terms of the GNU General Public License as published by the Free "
23547 "Software Foundation; either version 2 of the License, or (at your option) "
23548 "any later version."
23553 #: ../fish/guestfish.pod:1158 ../test-tool/libguestfs-test-tool.pod:129
23554 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:377
23555 #: ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1517
23556 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314
23557 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
23559 "This program is distributed in the hope that it will be useful, but WITHOUT "
23560 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
23561 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
23567 #: ../fish/guestfish.pod:1163 ../test-tool/libguestfs-test-tool.pod:134
23568 #: ../fuse/guestmount.pod:268 ../tools/virt-edit.pl:382
23569 #: ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1522
23570 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319
23571 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
23573 "You should have received a copy of the GNU General Public License along with "
23574 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
23575 "Ave, Cambridge, MA 02139, USA."
23580 #: ../fish/guestfish-actions.pod:1
23586 #: ../fish/guestfish-actions.pod:3
23589 " add-cdrom filename\n"
23595 #: ../fish/guestfish-actions.pod:15
23597 "This call checks for the existence of C<filename>. This stops you from "
23598 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23599 "and C<http:> URLs. To specify those, use the general L</config> call "
23605 #: ../fish/guestfish-actions.pod:22
23607 "If you just want to add an ISO file (often you use this as an efficient way "
23608 "to transfer large files into the guest), then you should probably use L</add-"
23609 "drive-ro> instead."
23614 #: ../fish/guestfish-actions.pod:35
23620 #: ../fish/guestfish-actions.pod:37
23625 #: ../fish/guestfish-actions.pod:39
23628 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..]\n"
23634 #: ../fish/guestfish-actions.pod:41
23636 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23637 "It works by connecting to libvirt, requesting the domain and domain XML from "
23638 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
23643 #: ../fish/guestfish-actions.pod:71
23645 "The other optional parameters are passed directly through to L</add-drive-"
23651 #: ../fish/guestfish-actions.pod:74 ../fish/guestfish-actions.pod:138
23652 #: ../fish/guestfish-actions.pod:2947
23654 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
23659 #: ../fish/guestfish-actions.pod:76
23665 #: ../fish/guestfish-actions.pod:78
23668 " add-drive filename\n"
23674 #: ../fish/guestfish-actions.pod:80
23676 "This function is the equivalent of calling L</add-drive-opts> with no "
23677 "optional parameters, so the disk is added writable, with the format being "
23678 "detected automatically."
23683 #: ../fish/guestfish-actions.pod:84
23685 "Automatic detection of the format opens you up to a potential security hole "
23686 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23687 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23688 "you should think about replacing calls to this function with calls to L</add-"
23689 "drive-opts>, and specifying the format."
23694 #: ../fish/guestfish-actions.pod:91
23695 msgid "add-drive-opts"
23700 #: ../fish/guestfish-actions.pod:93
23706 #: ../fish/guestfish-actions.pod:95
23709 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
23715 #: ../fish/guestfish-actions.pod:122
23717 "This forces the image format. If you omit this (or use L</add-drive> or L</"
23718 "add-drive-ro>) then the format is automatically detected. Possible formats "
23719 "include C<raw> and C<qcow2>."
23724 #: ../fish/guestfish-actions.pod:133
23726 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
23727 "add-drive-with-if> call (q.v.)"
23732 #: ../fish/guestfish-actions.pod:140
23733 msgid "add-drive-ro"
23738 #: ../fish/guestfish-actions.pod:142
23744 #: ../fish/guestfish-actions.pod:144
23747 " add-drive-ro filename\n"
23753 #: ../fish/guestfish-actions.pod:146
23755 "This function is the equivalent of calling L</add-drive-opts> with the "
23756 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
23757 "is added read-only, with the format being detected automatically."
23762 #: ../fish/guestfish-actions.pod:151
23763 msgid "add-drive-ro-with-if"
23768 #: ../fish/guestfish-actions.pod:153
23771 " add-drive-ro-with-if filename iface\n"
23777 #: ../fish/guestfish-actions.pod:155
23779 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
23780 "interface emulation to use at run time."
23785 #: ../fish/guestfish-actions.pod:165
23786 msgid "add-drive-with-if"
23791 #: ../fish/guestfish-actions.pod:167
23794 " add-drive-with-if filename iface\n"
23800 #: ../fish/guestfish-actions.pod:169
23802 "This is the same as L</add-drive> but it allows you to specify the QEMU "
23803 "interface emulation to use at run time."
23808 #: ../fish/guestfish-actions.pod:179
23814 #: ../fish/guestfish-actions.pod:181
23817 " aug-clear augpath\n"
23823 #: ../fish/guestfish-actions.pod:186
23829 #: ../fish/guestfish-actions.pod:188
23838 #: ../fish/guestfish-actions.pod:190
23840 "Close the current Augeas handle and free up any resources used by it. After "
23841 "calling this, you have to call L</aug-init> again before you can use any "
23842 "other Augeas functions."
23847 #: ../fish/guestfish-actions.pod:195
23848 msgid "aug-defnode"
23853 #: ../fish/guestfish-actions.pod:197
23856 " aug-defnode name expr val\n"
23862 #: ../fish/guestfish-actions.pod:202
23864 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23865 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
23866 "containing that single node."
23871 #: ../fish/guestfish-actions.pod:210
23877 #: ../fish/guestfish-actions.pod:212
23880 " aug-defvar name expr\n"
23886 #: ../fish/guestfish-actions.pod:221
23892 #: ../fish/guestfish-actions.pod:223
23895 " aug-get augpath\n"
23901 #: ../fish/guestfish-actions.pod:228
23907 #: ../fish/guestfish-actions.pod:230
23910 " aug-init root flags\n"
23916 #: ../fish/guestfish-actions.pod:236
23917 msgid "You must call this before using any other L</aug-*> commands."
23922 #: ../fish/guestfish-actions.pod:271
23923 msgid "Do not load the tree in L</aug-init>."
23928 #: ../fish/guestfish-actions.pod:275
23929 msgid "To close the handle, you can call L</aug-close>."
23934 #: ../fish/guestfish-actions.pod:279
23940 #: ../fish/guestfish-actions.pod:281
23943 " aug-insert augpath label true|false\n"
23949 #: ../fish/guestfish-actions.pod:291
23955 #: ../fish/guestfish-actions.pod:293
23964 #: ../fish/guestfish-actions.pod:300
23970 #: ../fish/guestfish-actions.pod:302
23973 " aug-ls augpath\n"
23979 #: ../fish/guestfish-actions.pod:304
23981 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
23982 "resulting nodes into alphabetical order."
23987 #: ../fish/guestfish-actions.pod:307
23993 #: ../fish/guestfish-actions.pod:309
23996 " aug-match augpath\n"
24002 #: ../fish/guestfish-actions.pod:315
24008 #: ../fish/guestfish-actions.pod:317
24011 " aug-mv src dest\n"
24017 #: ../fish/guestfish-actions.pod:322
24023 #: ../fish/guestfish-actions.pod:324
24026 " aug-rm augpath\n"
24032 #: ../fish/guestfish-actions.pod:330
24038 #: ../fish/guestfish-actions.pod:332
24047 #: ../fish/guestfish-actions.pod:336
24049 "The flags which were passed to L</aug-init> affect exactly how files are "
24055 #: ../fish/guestfish-actions.pod:339
24061 #: ../fish/guestfish-actions.pod:341
24064 " aug-set augpath val\n"
24070 #: ../fish/guestfish-actions.pod:345
24072 "In the Augeas API, it is possible to clear a node by setting the value to "
24073 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24074 "this call. Instead you must use the L</aug-clear> call."
24079 #: ../fish/guestfish-actions.pod:350
24085 #: ../fish/guestfish-actions.pod:352
24088 " available 'groups ...'\n"
24094 #: ../fish/guestfish-actions.pod:358
24096 "The libguestfs groups, and the functions that those groups correspond to, "
24097 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24098 "runtime by calling L</available-all-groups>."
24103 #: ../fish/guestfish-actions.pod:382
24104 msgid "You must call L</launch> before calling this function."
24109 #: ../fish/guestfish-actions.pod:404
24111 "This call was added in version C<1.0.80>. In previous versions of "
24112 "libguestfs all you could do would be to speculatively execute a command to "
24113 "find out if the daemon implemented it. See also L</version>."
24118 #: ../fish/guestfish-actions.pod:411
24119 msgid "available-all-groups"
24124 #: ../fish/guestfish-actions.pod:413
24127 " available-all-groups\n"
24133 #: ../fish/guestfish-actions.pod:415
24135 "This command returns a list of all optional groups that this daemon knows "
24136 "about. Note this returns both supported and unsupported groups. To find "
24137 "out which ones the daemon can actually support you have to call L</"
24138 "available> on each member of the returned list."
24143 #: ../fish/guestfish-actions.pod:421
24144 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
24149 #: ../fish/guestfish-actions.pod:423
24155 #: ../fish/guestfish-actions.pod:425
24158 " base64-in (base64file|-) filename\n"
24164 #: ../fish/guestfish-actions.pod:430 ../fish/guestfish-actions.pod:439
24165 #: ../fish/guestfish-actions.pod:663 ../fish/guestfish-actions.pod:832
24166 #: ../fish/guestfish-actions.pod:851 ../fish/guestfish-actions.pod:1228
24167 #: ../fish/guestfish-actions.pod:4341 ../fish/guestfish-actions.pod:4353
24168 #: ../fish/guestfish-actions.pod:4364 ../fish/guestfish-actions.pod:4375
24169 #: ../fish/guestfish-actions.pod:4427 ../fish/guestfish-actions.pod:4436
24170 #: ../fish/guestfish-actions.pod:4490 ../fish/guestfish-actions.pod:4513
24171 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
24176 #: ../fish/guestfish-actions.pod:432
24182 #: ../fish/guestfish-actions.pod:434
24185 " base64-out filename (base64file|-)\n"
24191 #: ../fish/guestfish-actions.pod:441
24192 msgid "blockdev-flushbufs"
24197 #: ../fish/guestfish-actions.pod:443
24200 " blockdev-flushbufs device\n"
24206 #: ../fish/guestfish-actions.pod:450
24207 msgid "blockdev-getbsz"
24212 #: ../fish/guestfish-actions.pod:452
24215 " blockdev-getbsz device\n"
24221 #: ../fish/guestfish-actions.pod:461
24222 msgid "blockdev-getro"
24227 #: ../fish/guestfish-actions.pod:463
24230 " blockdev-getro device\n"
24236 #: ../fish/guestfish-actions.pod:470
24237 msgid "blockdev-getsize64"
24242 #: ../fish/guestfish-actions.pod:472
24245 " blockdev-getsize64 device\n"
24251 #: ../fish/guestfish-actions.pod:476
24252 msgid "See also L</blockdev-getsz>."
24257 #: ../fish/guestfish-actions.pod:480
24258 msgid "blockdev-getss"
24263 #: ../fish/guestfish-actions.pod:482
24266 " blockdev-getss device\n"
24272 #: ../fish/guestfish-actions.pod:487
24274 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
24279 #: ../fish/guestfish-actions.pod:492
24280 msgid "blockdev-getsz"
24285 #: ../fish/guestfish-actions.pod:494
24288 " blockdev-getsz device\n"
24294 #: ../fish/guestfish-actions.pod:499
24296 "See also L</blockdev-getss> for the real sector size of the device, and L</"
24297 "blockdev-getsize64> for the more useful I<size in bytes>."
24302 #: ../fish/guestfish-actions.pod:505
24303 msgid "blockdev-rereadpt"
24308 #: ../fish/guestfish-actions.pod:507
24311 " blockdev-rereadpt device\n"
24317 #: ../fish/guestfish-actions.pod:513
24318 msgid "blockdev-setbsz"
24323 #: ../fish/guestfish-actions.pod:515
24326 " blockdev-setbsz device blocksize\n"
24332 #: ../fish/guestfish-actions.pod:524
24333 msgid "blockdev-setro"
24338 #: ../fish/guestfish-actions.pod:526
24341 " blockdev-setro device\n"
24347 #: ../fish/guestfish-actions.pod:532
24348 msgid "blockdev-setrw"
24353 #: ../fish/guestfish-actions.pod:534
24356 " blockdev-setrw device\n"
24362 #: ../fish/guestfish-actions.pod:540
24363 msgid "case-sensitive-path"
24368 #: ../fish/guestfish-actions.pod:542
24371 " case-sensitive-path path\n"
24377 #: ../fish/guestfish-actions.pod:566
24379 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
24380 "WINDOWS/system32\"> (the exact return value would depend on details of how "
24381 "the directories were originally created under Windows)."
24386 #: ../fish/guestfish-actions.pod:574
24387 msgid "See also L</realpath>."
24392 #: ../fish/guestfish-actions.pod:576
24398 #: ../fish/guestfish-actions.pod:578
24407 #: ../fish/guestfish-actions.pod:582
24409 "Note that this function cannot correctly handle binary files (specifically, "
24410 "files containing C<\\0> character which is treated as end of string). For "
24411 "those you need to use the L</read-file> or L</download> functions which have "
24412 "a more complex interface."
24417 #: ../fish/guestfish-actions.pod:590
24423 #: ../fish/guestfish-actions.pod:592
24426 " checksum csumtype path\n"
24432 #: ../fish/guestfish-actions.pod:635
24433 msgid "To get the checksum for a device, use L</checksum-device>."
24438 #: ../fish/guestfish-actions.pod:637
24439 msgid "To get the checksums for many files, use L</checksums-out>."
24444 #: ../fish/guestfish-actions.pod:639
24445 msgid "checksum-device"
24450 #: ../fish/guestfish-actions.pod:641
24453 " checksum-device csumtype device\n"
24459 #: ../fish/guestfish-actions.pod:643
24461 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24462 "device named C<device>. For the types of checksums supported see the L</"
24463 "checksum> command."
24468 #: ../fish/guestfish-actions.pod:647
24469 msgid "checksums-out"
24474 #: ../fish/guestfish-actions.pod:649
24477 " checksums-out csumtype directory (sumsfile|-)\n"
24483 #: ../fish/guestfish-actions.pod:665
24489 #: ../fish/guestfish-actions.pod:667
24492 " chmod mode path\n"
24498 #: ../fish/guestfish-actions.pod:678
24504 #: ../fish/guestfish-actions.pod:680
24507 " chown owner group path\n"
24513 #: ../fish/guestfish-actions.pod:688
24519 #: ../fish/guestfish-actions.pod:690
24522 " command 'arguments ...'\n"
24528 #: ../fish/guestfish-actions.pod:697
24530 "The single parameter is an argv-style list of arguments. The first element "
24531 "is the name of the program to run. Subsequent elements are parameters. The "
24532 "list must be non-empty (ie. must contain a program name). Note that the "
24533 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
24538 #: ../fish/guestfish-actions.pod:725
24539 msgid "command-lines"
24544 #: ../fish/guestfish-actions.pod:727
24547 " command-lines 'arguments ...'\n"
24553 #: ../fish/guestfish-actions.pod:729
24555 "This is the same as L</command>, but splits the result into a list of lines."
24560 #: ../fish/guestfish-actions.pod:732
24561 msgid "See also: L</sh-lines>"
24566 #: ../fish/guestfish-actions.pod:737
24572 #: ../fish/guestfish-actions.pod:739
24575 " config qemuparam qemuvalue\n"
24581 #: ../fish/guestfish-actions.pod:750
24587 #: ../fish/guestfish-actions.pod:752
24590 " copy-size src dest size\n"
24596 #: ../fish/guestfish-actions.pod:760
24602 #: ../fish/guestfish-actions.pod:762
24611 #: ../fish/guestfish-actions.pod:767
24617 #: ../fish/guestfish-actions.pod:769
24626 #: ../fish/guestfish-actions.pod:774
24632 #: ../fish/guestfish-actions.pod:776
24641 #: ../fish/guestfish-actions.pod:783
24643 "If the destination is a device, it must be as large or larger than the "
24644 "source file or device, otherwise the copy will fail. This command cannot do "
24645 "partial copies (see L</copy-size>)."
24650 #: ../fish/guestfish-actions.pod:787
24656 #: ../fish/guestfish-actions.pod:789
24665 #: ../fish/guestfish-actions.pod:793 ../fish/guestfish-actions.pod:804
24667 "This command is mostly useful for interactive sessions. It is I<not> "
24668 "intended that you try to parse the output string. Use L</statvfs> from "
24674 #: ../fish/guestfish-actions.pod:797
24680 #: ../fish/guestfish-actions.pod:799
24689 #: ../fish/guestfish-actions.pod:808
24695 #: ../fish/guestfish-actions.pod:810
24704 #: ../fish/guestfish-actions.pod:816
24706 "Another way to get the same information is to enable verbose messages with "
24707 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
24708 "before running the program."
24713 #: ../fish/guestfish-actions.pod:821
24719 #: ../fish/guestfish-actions.pod:823
24722 " download remotefilename (filename|-)\n"
24728 #: ../fish/guestfish-actions.pod:830
24729 msgid "See also L</upload>, L</cat>."
24734 #: ../fish/guestfish-actions.pod:834
24735 msgid "download-offset"
24740 #: ../fish/guestfish-actions.pod:836
24743 " download-offset remotefilename (filename|-) offset size\n"
24749 #: ../fish/guestfish-actions.pod:844
24751 "Note that there is no limit on the amount of data that can be downloaded "
24752 "with this call, unlike with L</pread>, and this call always reads the full "
24753 "amount unless an error occurs."
24758 #: ../fish/guestfish-actions.pod:849
24759 msgid "See also L</download>, L</pread>."
24764 #: ../fish/guestfish-actions.pod:853
24765 msgid "drop-caches"
24770 #: ../fish/guestfish-actions.pod:855
24773 " drop-caches whattodrop\n"
24779 #: ../fish/guestfish-actions.pod:867
24785 #: ../fish/guestfish-actions.pod:869
24794 #: ../fish/guestfish-actions.pod:881
24800 #: ../fish/guestfish-actions.pod:883
24803 " e2fsck-f device\n"
24809 #: ../fish/guestfish-actions.pod:889
24811 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
24812 "should use L</fsck>."
24817 #: ../fish/guestfish-actions.pod:892
24818 msgid "echo-daemon"
24823 #: ../fish/guestfish-actions.pod:894
24826 " echo-daemon 'words ...'\n"
24832 #: ../fish/guestfish-actions.pod:901
24833 msgid "See also L</ping-daemon>."
24838 #: ../fish/guestfish-actions.pod:903
24844 #: ../fish/guestfish-actions.pod:905
24847 " egrep regex path\n"
24853 #: ../fish/guestfish-actions.pod:913
24859 #: ../fish/guestfish-actions.pod:915
24862 " egrepi regex path\n"
24868 #: ../fish/guestfish-actions.pod:923
24874 #: ../fish/guestfish-actions.pod:925
24877 " equal file1 file2\n"
24883 #: ../fish/guestfish-actions.pod:932
24889 #: ../fish/guestfish-actions.pod:934
24898 #: ../fish/guestfish-actions.pod:939
24899 msgid "See also L</is-file>, L</is-dir>, L</stat>."
24904 #: ../fish/guestfish-actions.pod:941
24910 #: ../fish/guestfish-actions.pod:943
24913 " fallocate path len\n"
24919 #: ../fish/guestfish-actions.pod:960
24920 msgid "fallocate64"
24925 #: ../fish/guestfish-actions.pod:962
24928 " fallocate64 path len\n"
24934 #: ../fish/guestfish-actions.pod:968
24936 "Note that this call allocates disk blocks for the file. To create a sparse "
24937 "file use L</truncate-size> instead."
24942 #: ../fish/guestfish-actions.pod:971
24944 "The deprecated call L</fallocate> does the same, but owing to an oversight "
24945 "it only allowed 30 bit lengths to be specified, effectively limiting the "
24946 "maximum size of files created through that call to 1GB."
24951 #: ../fish/guestfish-actions.pod:980
24957 #: ../fish/guestfish-actions.pod:982
24960 " fgrep pattern path\n"
24966 #: ../fish/guestfish-actions.pod:990
24972 #: ../fish/guestfish-actions.pod:992
24975 " fgrepi pattern path\n"
24981 #: ../fish/guestfish-actions.pod:1000
24987 #: ../fish/guestfish-actions.pod:1002
24996 #: ../fish/guestfish-actions.pod:1014
24998 "This command can also be used on C</dev/> devices (and partitions, LV "
24999 "names). You can for example use this to determine if a device contains a "
25000 "filesystem, although it's usually better to use L</vfs-type>."
25005 #: ../fish/guestfish-actions.pod:1024
25006 msgid "file-architecture"
25011 #: ../fish/guestfish-actions.pod:1026
25014 " file-architecture filename\n"
25020 #: ../fish/guestfish-actions.pod:1129
25026 #: ../fish/guestfish-actions.pod:1131
25035 #: ../fish/guestfish-actions.pod:1135
25037 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
25038 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
25043 #: ../fish/guestfish-actions.pod:1139
25049 #: ../fish/guestfish-actions.pod:1141
25052 " fill c len path\n"
25058 #: ../fish/guestfish-actions.pod:1147
25060 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25061 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
25062 "L</fill-pattern>."
25067 #: ../fish/guestfish-actions.pod:1152
25068 msgid "fill-pattern"
25073 #: ../fish/guestfish-actions.pod:1154
25076 " fill-pattern pattern len path\n"
25082 #: ../fish/guestfish-actions.pod:1156
25084 "This function is like L</fill> except that it creates a new file of length "
25085 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
25086 "is truncated if necessary to ensure the length of the file is exactly C<len> "
25092 #: ../fish/guestfish-actions.pod:1161
25098 #: ../fish/guestfish-actions.pod:1163
25101 " find directory\n"
25107 #: ../fish/guestfish-actions.pod:1177
25108 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
25113 #: ../fish/guestfish-actions.pod:1190
25114 msgid "See also L</find0>."
25119 #: ../fish/guestfish-actions.pod:1195
25125 #: ../fish/guestfish-actions.pod:1197
25128 " find0 directory (files|-)\n"
25134 #: ../fish/guestfish-actions.pod:1203
25136 "This command works the same way as L</find> with the following exceptions:"
25141 #: ../fish/guestfish-actions.pod:1230
25142 msgid "findfs-label"
25147 #: ../fish/guestfish-actions.pod:1232
25150 " findfs-label label\n"
25156 #: ../fish/guestfish-actions.pod:1238
25157 msgid "To find the label of a filesystem, use L</vfs-label>."
25162 #: ../fish/guestfish-actions.pod:1240
25163 msgid "findfs-uuid"
25168 #: ../fish/guestfish-actions.pod:1242
25171 " findfs-uuid uuid\n"
25177 #: ../fish/guestfish-actions.pod:1248
25178 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
25183 #: ../fish/guestfish-actions.pod:1250
25189 #: ../fish/guestfish-actions.pod:1252
25192 " fsck fstype device\n"
25198 #: ../fish/guestfish-actions.pod:1282
25204 #: ../fish/guestfish-actions.pod:1284
25212 #: ../fish/guestfish-actions.pod:1291
25213 msgid "get-attach-method"
25217 #: ../fish/guestfish-actions.pod:1293
25220 " get-attach-method\n"
25225 #: ../fish/guestfish-actions.pod:1295
25226 msgid "Return the current attach method. See L</set-attach-method>."
25231 #: ../fish/guestfish-actions.pod:1297
25232 msgid "get-autosync"
25237 #: ../fish/guestfish-actions.pod:1299
25246 #: ../fish/guestfish-actions.pod:1303
25252 #: ../fish/guestfish-actions.pod:1305
25261 #: ../fish/guestfish-actions.pod:1309
25262 msgid "get-e2label"
25267 #: ../fish/guestfish-actions.pod:1311
25270 " get-e2label device\n"
25276 #: ../fish/guestfish-actions.pod:1323
25282 #: ../fish/guestfish-actions.pod:1325
25285 " get-e2uuid device\n"
25291 #: ../fish/guestfish-actions.pod:1337
25292 msgid "get-memsize"
25297 #: ../fish/guestfish-actions.pod:1339
25306 #: ../fish/guestfish-actions.pod:1344
25308 "If L</set-memsize> was not called on this handle, and if "
25309 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25310 "value for memsize."
25315 #: ../fish/guestfish-actions.pod:1351
25316 msgid "get-network"
25321 #: ../fish/guestfish-actions.pod:1353
25330 #: ../fish/guestfish-actions.pod:1357
25336 #: ../fish/guestfish-actions.pod:1359
25345 #: ../fish/guestfish-actions.pod:1366
25351 #: ../fish/guestfish-actions.pod:1368
25357 #: ../fish/guestfish-actions.pod:1370
25366 #: ../fish/guestfish-actions.pod:1377
25372 #: ../fish/guestfish-actions.pod:1379
25381 #: ../fish/guestfish-actions.pod:1386
25382 msgid "get-recovery-proc"
25387 #: ../fish/guestfish-actions.pod:1388
25390 " get-recovery-proc\n"
25396 #: ../fish/guestfish-actions.pod:1392
25397 msgid "get-selinux"
25402 #: ../fish/guestfish-actions.pod:1394
25411 #: ../fish/guestfish-actions.pod:1396
25413 "This returns the current setting of the selinux flag which is passed to the "
25414 "appliance at boot time. See L</set-selinux>."
25419 #: ../fish/guestfish-actions.pod:1402
25425 #: ../fish/guestfish-actions.pod:1404
25434 #: ../fish/guestfish-actions.pod:1411
25440 #: ../fish/guestfish-actions.pod:1413
25449 #: ../fish/guestfish-actions.pod:1417
25455 #: ../fish/guestfish-actions.pod:1419
25464 #: ../fish/guestfish-actions.pod:1421
25466 "Return the current umask. By default the umask is C<022> unless it has been "
25467 "set by calling L</umask>."
25472 #: ../fish/guestfish-actions.pod:1424
25473 msgid "get-verbose"
25478 #: ../fish/guestfish-actions.pod:1426
25487 #: ../fish/guestfish-actions.pod:1430
25493 #: ../fish/guestfish-actions.pod:1432
25502 #: ../fish/guestfish-actions.pod:1436
25503 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
25508 #: ../fish/guestfish-actions.pod:1439
25514 #: ../fish/guestfish-actions.pod:1441
25517 " getxattr path name\n"
25523 #: ../fish/guestfish-actions.pod:1443
25525 "Get a single extended attribute from file C<path> named C<name>. This call "
25526 "follows symlinks. If you want to lookup an extended attribute for the "
25527 "symlink itself, use L</lgetxattr>."
25532 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2353
25534 "Normally it is better to get all extended attributes from a file in one go "
25535 "by calling L</getxattrs>. However some Linux filesystem implementations are "
25536 "buggy and do not provide a way to list out attributes. For these "
25537 "filesystems (notably ntfs-3g) you have to know the names of the extended "
25538 "attributes you want in advance and call this function."
25543 #: ../fish/guestfish-actions.pod:1457
25544 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
25549 #: ../fish/guestfish-actions.pod:1459
25555 #: ../fish/guestfish-actions.pod:1461
25558 " getxattrs path\n"
25564 #: ../fish/guestfish-actions.pod:1469
25565 msgid "See also: L</lgetxattrs>, L<attr(5)>."
25570 #: ../fish/guestfish-actions.pod:1471
25571 msgid "glob-expand"
25576 #: ../fish/guestfish-actions.pod:1473
25579 " glob-expand pattern\n"
25585 #: ../fish/guestfish-actions.pod:1486
25591 #: ../fish/guestfish-actions.pod:1488
25594 " grep regex path\n"
25600 #: ../fish/guestfish-actions.pod:1496
25606 #: ../fish/guestfish-actions.pod:1498
25609 " grepi regex path\n"
25615 #: ../fish/guestfish-actions.pod:1506
25616 msgid "grub-install"
25621 #: ../fish/guestfish-actions.pod:1508
25624 " grub-install root device\n"
25630 #: ../fish/guestfish-actions.pod:1524
25636 #: ../fish/guestfish-actions.pod:1526
25645 #: ../fish/guestfish-actions.pod:1534
25651 #: ../fish/guestfish-actions.pod:1536
25654 " head-n nrlines path\n"
25660 #: ../fish/guestfish-actions.pod:1549
25666 #: ../fish/guestfish-actions.pod:1551
25675 #: ../fish/guestfish-actions.pod:1559
25681 #: ../fish/guestfish-actions.pod:1561
25684 " initrd-cat initrdpath filename\n"
25690 #: ../fish/guestfish-actions.pod:1573
25691 msgid "See also L</initrd-list>."
25696 #: ../fish/guestfish-actions.pod:1578
25697 msgid "initrd-list"
25702 #: ../fish/guestfish-actions.pod:1580
25705 " initrd-list path\n"
25711 #: ../fish/guestfish-actions.pod:1592
25712 msgid "inotify-add-watch"
25717 #: ../fish/guestfish-actions.pod:1594
25720 " inotify-add-watch path mask\n"
25726 #: ../fish/guestfish-actions.pod:1606
25727 msgid "inotify-close"
25732 #: ../fish/guestfish-actions.pod:1608
25741 #: ../fish/guestfish-actions.pod:1614
25742 msgid "inotify-files"
25747 #: ../fish/guestfish-actions.pod:1616
25756 #: ../fish/guestfish-actions.pod:1618
25758 "This function is a helpful wrapper around L</inotify-read> which just "
25759 "returns a list of pathnames of objects that were touched. The returned "
25760 "pathnames are sorted and deduplicated."
25765 #: ../fish/guestfish-actions.pod:1622
25766 msgid "inotify-init"
25771 #: ../fish/guestfish-actions.pod:1624
25774 " inotify-init maxevents\n"
25780 #: ../fish/guestfish-actions.pod:1630
25782 "C<maxevents> is the maximum number of events which will be queued up between "
25783 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
25784 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
25785 "default was 16384 events. Beyond this limit, the kernel throws away events, "
25786 "but records the fact that it threw them away by setting a flag "
25787 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
25792 #: ../fish/guestfish-actions.pod:1640
25794 "Before any events are generated, you have to add some watches to the "
25795 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
25796 "L</inotify-watch-all>."
25801 #: ../fish/guestfish-actions.pod:1646
25803 "Queued up events should be read periodically by calling L</inotify-read> (or "
25804 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
25805 "If you don't read the events out often enough then you risk the internal "
25806 "queue overflowing."
25811 #: ../fish/guestfish-actions.pod:1653
25813 "The handle should be closed after use by calling L</inotify-close>. This "
25814 "also removes any watches automatically."
25819 #: ../fish/guestfish-actions.pod:1662
25820 msgid "inotify-read"
25825 #: ../fish/guestfish-actions.pod:1664
25834 #: ../fish/guestfish-actions.pod:1677
25835 msgid "inotify-rm-watch"
25840 #: ../fish/guestfish-actions.pod:1679
25843 " inotify-rm-watch wd\n"
25849 #: ../fish/guestfish-actions.pod:1681
25850 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
25855 #: ../fish/guestfish-actions.pod:1684
25856 msgid "inspect-get-arch"
25861 #: ../fish/guestfish-actions.pod:1686
25864 " inspect-get-arch root\n"
25870 #: ../fish/guestfish-actions.pod:1688 ../fish/guestfish-actions.pod:1704
25871 #: ../fish/guestfish-actions.pod:1778 ../fish/guestfish-actions.pod:1796
25872 #: ../fish/guestfish-actions.pod:1830 ../fish/guestfish-actions.pod:1845
25873 #: ../fish/guestfish-actions.pod:1866 ../fish/guestfish-actions.pod:1881
25874 #: ../fish/guestfish-actions.pod:1908 ../fish/guestfish-actions.pod:1930
25875 #: ../fish/guestfish-actions.pod:1954 ../fish/guestfish-actions.pod:1984
25876 #: ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2035
25877 #: ../fish/guestfish-actions.pod:2048 ../fish/guestfish-actions.pod:2061
25878 #: ../fish/guestfish-actions.pod:2076
25880 "This function should only be called with a root device string as returned by "
25886 #: ../fish/guestfish-actions.pod:1691
25888 "This returns the architecture of the inspected operating system. The "
25889 "possible return values are listed under L</file-architecture>."
25894 #: ../fish/guestfish-actions.pod:1700
25895 msgid "inspect-get-distro"
25900 #: ../fish/guestfish-actions.pod:1702
25903 " inspect-get-distro root\n"
25909 #: ../fish/guestfish-actions.pod:1774
25910 msgid "inspect-get-filesystems"
25915 #: ../fish/guestfish-actions.pod:1776
25918 " inspect-get-filesystems root\n"
25924 #: ../fish/guestfish-actions.pod:1789
25926 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25927 "get-mountpoints>."
25931 #: ../fish/guestfish-actions.pod:1792
25932 msgid "inspect-get-format"
25936 #: ../fish/guestfish-actions.pod:1794
25939 " inspect-get-format root\n"
25945 #: ../fish/guestfish-actions.pod:1826
25946 msgid "inspect-get-hostname"
25951 #: ../fish/guestfish-actions.pod:1828
25954 " inspect-get-hostname root\n"
25960 #: ../fish/guestfish-actions.pod:1841
25961 msgid "inspect-get-major-version"
25966 #: ../fish/guestfish-actions.pod:1843
25969 " inspect-get-major-version root\n"
25975 #: ../fish/guestfish-actions.pod:1862
25976 msgid "inspect-get-minor-version"
25981 #: ../fish/guestfish-actions.pod:1864
25984 " inspect-get-minor-version root\n"
25990 #: ../fish/guestfish-actions.pod:1874
25992 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25993 "get-major-version>."
25998 #: ../fish/guestfish-actions.pod:1877
25999 msgid "inspect-get-mountpoints"
26004 #: ../fish/guestfish-actions.pod:1879
26007 " inspect-get-mountpoints root\n"
26013 #: ../fish/guestfish-actions.pod:1901
26015 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26016 "get-filesystems>."
26021 #: ../fish/guestfish-actions.pod:1904
26022 msgid "inspect-get-package-format"
26027 #: ../fish/guestfish-actions.pod:1906
26030 " inspect-get-package-format root\n"
26036 #: ../fish/guestfish-actions.pod:1911
26038 "This function and L</inspect-get-package-management> return the package "
26039 "format and package management tool used by the inspected operating system. "
26040 "For example for Fedora these functions would return C<rpm> (package format) "
26041 "and C<yum> (package management)."
26046 #: ../fish/guestfish-actions.pod:1926
26047 msgid "inspect-get-package-management"
26052 #: ../fish/guestfish-actions.pod:1928
26055 " inspect-get-package-management root\n"
26061 #: ../fish/guestfish-actions.pod:1933
26063 "L</inspect-get-package-format> and this function return the package format "
26064 "and package management tool used by the inspected operating system. For "
26065 "example for Fedora these functions would return C<rpm> (package format) and "
26066 "C<yum> (package management)."
26071 #: ../fish/guestfish-actions.pod:1950
26072 msgid "inspect-get-product-name"
26077 #: ../fish/guestfish-actions.pod:1952
26080 " inspect-get-product-name root\n"
26086 #: ../fish/guestfish-actions.pod:1967
26087 msgid "inspect-get-roots"
26092 #: ../fish/guestfish-actions.pod:1969
26095 " inspect-get-roots\n"
26101 #: ../fish/guestfish-actions.pod:1971
26103 "This function is a convenient way to get the list of root devices, as "
26104 "returned from a previous call to L</inspect-os>, but without redoing the "
26105 "whole inspection process."
26110 #: ../fish/guestfish-actions.pod:1975
26112 "This returns an empty list if either no root devices were found or the "
26113 "caller has not called L</inspect-os>."
26118 #: ../fish/guestfish-actions.pod:1980
26119 msgid "inspect-get-type"
26124 #: ../fish/guestfish-actions.pod:1982
26127 " inspect-get-type root\n"
26133 #: ../fish/guestfish-actions.pod:2015
26134 msgid "inspect-get-windows-systemroot"
26139 #: ../fish/guestfish-actions.pod:2017
26142 " inspect-get-windows-systemroot root\n"
26147 #: ../fish/guestfish-actions.pod:2031
26148 msgid "inspect-is-live"
26152 #: ../fish/guestfish-actions.pod:2033
26155 " inspect-is-live root\n"
26160 #: ../fish/guestfish-actions.pod:2038
26162 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
26163 "then this returns true if a live image was detected on the disk."
26167 #: ../fish/guestfish-actions.pod:2044
26168 msgid "inspect-is-multipart"
26172 #: ../fish/guestfish-actions.pod:2046
26175 " inspect-is-multipart root\n"
26180 #: ../fish/guestfish-actions.pod:2051
26182 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
26183 "then this returns true if the disk is part of a set."
26187 #: ../fish/guestfish-actions.pod:2057
26188 msgid "inspect-is-netinst"
26192 #: ../fish/guestfish-actions.pod:2059
26195 " inspect-is-netinst root\n"
26200 #: ../fish/guestfish-actions.pod:2064
26202 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
26203 "then this returns true if the disk is a network installer, ie. not a self-"
26204 "contained install CD but one which is likely to require network access to "
26205 "complete the install."
26210 #: ../fish/guestfish-actions.pod:2072
26211 msgid "inspect-list-applications"
26216 #: ../fish/guestfish-actions.pod:2074
26219 " inspect-list-applications root\n"
26225 #: ../fish/guestfish-actions.pod:2081
26227 "I<Note:> This call works differently from other parts of the inspection "
26228 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
26229 "then mount up the disks, before calling this. Listing applications is a "
26230 "significantly more difficult operation which requires access to the full "
26231 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
26232 "are just returning data cached in the libguestfs handle, this call actually "
26233 "reads parts of the mounted filesystems during the call."
26238 #: ../fish/guestfish-actions.pod:2171
26244 #: ../fish/guestfish-actions.pod:2173
26253 #: ../fish/guestfish-actions.pod:2188
26255 "You can pass the root string(s) returned to other L</inspect-get-*> "
26256 "functions in order to query further information about each operating system, "
26257 "such as the name and version."
26262 #: ../fish/guestfish-actions.pod:2193
26264 "This function uses other libguestfs features such as L</mount-ro> and L</"
26265 "umount-all> in order to mount and unmount filesystems and look at the "
26266 "contents. This should be called with no disks currently mounted. The "
26267 "function may also use Augeas, so any existing Augeas handle will be closed."
26272 #: ../fish/guestfish-actions.pod:2205 ../fish/guestfish-actions.pod:2381
26273 #: ../fish/guestfish-actions.pod:2427
26274 msgid "See also L</list-filesystems>."
26279 #: ../fish/guestfish-actions.pod:2207
26280 msgid "is-blockdev"
26285 #: ../fish/guestfish-actions.pod:2209
26288 " is-blockdev path\n"
26294 #: ../fish/guestfish-actions.pod:2214 ../fish/guestfish-actions.pod:2232
26295 #: ../fish/guestfish-actions.pod:2251 ../fish/guestfish-actions.pod:2260
26296 #: ../fish/guestfish-actions.pod:2270 ../fish/guestfish-actions.pod:2304
26297 #: ../fish/guestfish-actions.pod:2313
26298 msgid "See also L</stat>."
26303 #: ../fish/guestfish-actions.pod:2216
26309 #: ../fish/guestfish-actions.pod:2218
26318 #: ../fish/guestfish-actions.pod:2225
26324 #: ../fish/guestfish-actions.pod:2227
26327 " is-chardev path\n"
26333 #: ../fish/guestfish-actions.pod:2234
26339 #: ../fish/guestfish-actions.pod:2236
26348 #: ../fish/guestfish-actions.pod:2243
26354 #: ../fish/guestfish-actions.pod:2245
26363 #: ../fish/guestfish-actions.pod:2253
26369 #: ../fish/guestfish-actions.pod:2255
26378 #: ../fish/guestfish-actions.pod:2262
26384 #: ../fish/guestfish-actions.pod:2264
26393 #: ../fish/guestfish-actions.pod:2272
26394 msgid "is-launching"
26399 #: ../fish/guestfish-actions.pod:2274
26408 #: ../fish/guestfish-actions.pod:2281
26414 #: ../fish/guestfish-actions.pod:2283
26423 #: ../fish/guestfish-actions.pod:2288
26429 #: ../fish/guestfish-actions.pod:2290
26438 #: ../fish/guestfish-actions.pod:2297
26444 #: ../fish/guestfish-actions.pod:2299
26447 " is-socket path\n"
26453 #: ../fish/guestfish-actions.pod:2306
26459 #: ../fish/guestfish-actions.pod:2308
26462 " is-symlink path\n"
26468 #: ../fish/guestfish-actions.pod:2315
26469 msgid "kill-subprocess"
26474 #: ../fish/guestfish-actions.pod:2317
26477 " kill-subprocess\n"
26483 #: ../fish/guestfish-actions.pod:2321
26489 #: ../fish/guestfish-actions.pod:2323
26495 #: ../fish/guestfish-actions.pod:2325
26504 #: ../fish/guestfish-actions.pod:2333
26510 #: ../fish/guestfish-actions.pod:2335
26513 " lchown owner group path\n"
26519 #: ../fish/guestfish-actions.pod:2337
26521 "Change the file owner to C<owner> and group to C<group>. This is like L</"
26522 "chown> but if C<path> is a symlink then the link itself is changed, not the "
26528 #: ../fish/guestfish-actions.pod:2345
26534 #: ../fish/guestfish-actions.pod:2347
26537 " lgetxattr path name\n"
26543 #: ../fish/guestfish-actions.pod:2363
26544 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
26549 #: ../fish/guestfish-actions.pod:2365
26555 #: ../fish/guestfish-actions.pod:2367
26558 " lgetxattrs path\n"
26564 #: ../fish/guestfish-actions.pod:2369
26566 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
26567 "it returns the extended attributes of the link itself."
26572 #: ../fish/guestfish-actions.pod:2373
26573 msgid "list-devices"
26578 #: ../fish/guestfish-actions.pod:2375
26587 #: ../fish/guestfish-actions.pod:2383
26588 msgid "list-filesystems"
26593 #: ../fish/guestfish-actions.pod:2385
26596 " list-filesystems\n"
26602 #: ../fish/guestfish-actions.pod:2404
26604 "This command runs other libguestfs commands, which might include L</mount> "
26605 "and L</umount>, and therefore you should use this soon after launch and only "
26606 "when nothing is mounted."
26611 #: ../fish/guestfish-actions.pod:2408
26613 "Not all of the filesystems returned will be mountable. In particular, swap "
26614 "partitions are returned in the list. Also this command does not check that "
26615 "each filesystem found is valid and mountable, and some filesystems might be "
26616 "mountable but require special options. Filesystems may not all belong to a "
26617 "single logical operating system (use L</inspect-os> to look for OSes)."
26622 #: ../fish/guestfish-actions.pod:2416
26623 msgid "list-partitions"
26628 #: ../fish/guestfish-actions.pod:2418
26631 " list-partitions\n"
26637 #: ../fish/guestfish-actions.pod:2424
26639 "This does not return logical volumes. For that you will need to call L</"
26645 #: ../fish/guestfish-actions.pod:2429
26651 #: ../fish/guestfish-actions.pod:2431
26660 #: ../fish/guestfish-actions.pod:2439
26666 #: ../fish/guestfish-actions.pod:2441
26669 " ln target linkname\n"
26675 #: ../fish/guestfish-actions.pod:2445
26681 #: ../fish/guestfish-actions.pod:2447
26684 " ln-f target linkname\n"
26690 #: ../fish/guestfish-actions.pod:2452
26696 #: ../fish/guestfish-actions.pod:2454
26699 " ln-s target linkname\n"
26705 #: ../fish/guestfish-actions.pod:2458
26711 #: ../fish/guestfish-actions.pod:2460
26714 " ln-sf target linkname\n"
26720 #: ../fish/guestfish-actions.pod:2465
26721 msgid "lremovexattr"
26726 #: ../fish/guestfish-actions.pod:2467
26729 " lremovexattr xattr path\n"
26735 #: ../fish/guestfish-actions.pod:2469
26737 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
26738 "it removes an extended attribute of the link itself."
26743 #: ../fish/guestfish-actions.pod:2473
26749 #: ../fish/guestfish-actions.pod:2475
26758 #: ../fish/guestfish-actions.pod:2481
26760 "This command is mostly useful for interactive sessions. Programs should "
26761 "probably use L</readdir> instead."
26766 #: ../fish/guestfish-actions.pod:2484
26772 #: ../fish/guestfish-actions.pod:2486
26775 " lsetxattr xattr val vallen path\n"
26781 #: ../fish/guestfish-actions.pod:2488
26783 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
26784 "sets an extended attribute of the link itself."
26789 #: ../fish/guestfish-actions.pod:2492
26795 #: ../fish/guestfish-actions.pod:2494
26804 #: ../fish/guestfish-actions.pod:2498
26806 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
26807 "the link is stat-ed, not the file it refers to."
26812 #: ../fish/guestfish-actions.pod:2504
26818 #: ../fish/guestfish-actions.pod:2506
26821 " lstatlist path 'names ...'\n"
26827 #: ../fish/guestfish-actions.pod:2508
26829 "This call allows you to perform the L</lstat> operation on multiple files, "
26830 "where all files are in the directory C<path>. C<names> is the list of files "
26831 "from this directory."
26836 #: ../fish/guestfish-actions.pod:2517
26838 "This call is intended for programs that want to efficiently list a directory "
26839 "contents without making many round-trips. See also L</lxattrlist> for a "
26840 "similarly efficient call for getting extended attributes. Very long "
26841 "directory listings might cause the protocol message size to be exceeded, "
26842 "causing this call to fail. The caller must split up such requests into "
26843 "smaller groups of names."
26848 #: ../fish/guestfish-actions.pod:2525
26849 msgid "luks-add-key"
26854 #: ../fish/guestfish-actions.pod:2527
26857 " luks-add-key device keyslot\n"
26863 #: ../fish/guestfish-actions.pod:2534
26865 "Note that if C<keyslot> already contains a key, then this command will "
26866 "fail. You have to use L</luks-kill-slot> first to remove that key."
26871 #: ../fish/guestfish-actions.pod:2538 ../fish/guestfish-actions.pod:2560
26872 #: ../fish/guestfish-actions.pod:2573 ../fish/guestfish-actions.pod:2587
26873 #: ../fish/guestfish-actions.pod:2610 ../fish/guestfish-actions.pod:2620
26875 "This command has one or more key or passphrase parameters. Guestfish will "
26876 "prompt for these separately."
26881 #: ../fish/guestfish-actions.pod:2541
26887 #: ../fish/guestfish-actions.pod:2543
26890 " luks-close device\n"
26896 #: ../fish/guestfish-actions.pod:2545
26898 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
26899 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
26900 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
26906 #: ../fish/guestfish-actions.pod:2551
26907 msgid "luks-format"
26912 #: ../fish/guestfish-actions.pod:2553
26915 " luks-format device keyslot\n"
26921 #: ../fish/guestfish-actions.pod:2566
26922 msgid "luks-format-cipher"
26927 #: ../fish/guestfish-actions.pod:2568
26930 " luks-format-cipher device keyslot cipher\n"
26936 #: ../fish/guestfish-actions.pod:2570
26938 "This command is the same as L</luks-format> but it also allows you to set "
26939 "the C<cipher> used."
26944 #: ../fish/guestfish-actions.pod:2579
26945 msgid "luks-kill-slot"
26950 #: ../fish/guestfish-actions.pod:2581
26953 " luks-kill-slot device keyslot\n"
26959 #: ../fish/guestfish-actions.pod:2590
26965 #: ../fish/guestfish-actions.pod:2592
26968 " luks-open device mapname\n"
26974 #: ../fish/guestfish-actions.pod:2606
26976 "If this block device contains LVM volume groups, then calling L</vgscan> "
26977 "followed by L</vg-activate-all> will make them visible."
26982 #: ../fish/guestfish-actions.pod:2613
26983 msgid "luks-open-ro"
26988 #: ../fish/guestfish-actions.pod:2615
26991 " luks-open-ro device mapname\n"
26997 #: ../fish/guestfish-actions.pod:2617
26999 "This is the same as L</luks-open> except that a read-only mapping is created."
27004 #: ../fish/guestfish-actions.pod:2623
27010 #: ../fish/guestfish-actions.pod:2625
27013 " lvcreate logvol volgroup mbytes\n"
27019 #: ../fish/guestfish-actions.pod:2630
27020 msgid "lvm-canonical-lv-name"
27025 #: ../fish/guestfish-actions.pod:2632
27028 " lvm-canonical-lv-name lvname\n"
27034 #: ../fish/guestfish-actions.pod:2641
27035 msgid "See also L</is-lv>."
27040 #: ../fish/guestfish-actions.pod:2643
27041 msgid "lvm-clear-filter"
27046 #: ../fish/guestfish-actions.pod:2645
27049 " lvm-clear-filter\n"
27055 #: ../fish/guestfish-actions.pod:2647
27057 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
27063 #: ../fish/guestfish-actions.pod:2653
27064 msgid "lvm-remove-all"
27069 #: ../fish/guestfish-actions.pod:2655
27072 " lvm-remove-all\n"
27078 #: ../fish/guestfish-actions.pod:2663
27079 msgid "lvm-set-filter"
27084 #: ../fish/guestfish-actions.pod:2665
27087 " lvm-set-filter 'devices ...'\n"
27093 #: ../fish/guestfish-actions.pod:2690
27099 #: ../fish/guestfish-actions.pod:2692
27102 " lvremove device\n"
27108 #: ../fish/guestfish-actions.pod:2700
27114 #: ../fish/guestfish-actions.pod:2702
27117 " lvrename logvol newlogvol\n"
27123 #: ../fish/guestfish-actions.pod:2706
27129 #: ../fish/guestfish-actions.pod:2708
27132 " lvresize device mbytes\n"
27138 #: ../fish/guestfish-actions.pod:2714
27139 msgid "lvresize-free"
27144 #: ../fish/guestfish-actions.pod:2716
27147 " lvresize-free lv percent\n"
27153 #: ../fish/guestfish-actions.pod:2724
27159 #: ../fish/guestfish-actions.pod:2726
27168 #: ../fish/guestfish-actions.pod:2734
27169 msgid "See also L</lvs-full>, L</list-filesystems>."
27174 #: ../fish/guestfish-actions.pod:2736
27180 #: ../fish/guestfish-actions.pod:2738
27189 #: ../fish/guestfish-actions.pod:2743
27195 #: ../fish/guestfish-actions.pod:2745
27204 #: ../fish/guestfish-actions.pod:2749
27210 #: ../fish/guestfish-actions.pod:2751
27213 " lxattrlist path 'names ...'\n"
27219 #: ../fish/guestfish-actions.pod:2767
27221 "This call is intended for programs that want to efficiently list a directory "
27222 "contents without making many round-trips. See also L</lstatlist> for a "
27223 "similarly efficient call for getting standard stats. Very long directory "
27224 "listings might cause the protocol message size to be exceeded, causing this "
27225 "call to fail. The caller must split up such requests into smaller groups of "
27231 #: ../fish/guestfish-actions.pod:2775
27237 #: ../fish/guestfish-actions.pod:2777
27246 #: ../fish/guestfish-actions.pod:2781
27252 #: ../fish/guestfish-actions.pod:2783
27255 " mkdir-mode path mode\n"
27261 #: ../fish/guestfish-actions.pod:2792
27262 msgid "See also L</mkdir>, L</umask>"
27267 #: ../fish/guestfish-actions.pod:2794
27273 #: ../fish/guestfish-actions.pod:2796
27282 #: ../fish/guestfish-actions.pod:2801
27288 #: ../fish/guestfish-actions.pod:2803
27291 " mkdtemp template\n"
27297 #: ../fish/guestfish-actions.pod:2824
27303 #: ../fish/guestfish-actions.pod:2826
27306 " mke2fs-J fstype blocksize device journal\n"
27312 #: ../fish/guestfish-actions.pod:2834
27313 msgid "See also L</mke2journal>."
27318 #: ../fish/guestfish-actions.pod:2836
27324 #: ../fish/guestfish-actions.pod:2838
27327 " mke2fs-JL fstype blocksize device label\n"
27333 #: ../fish/guestfish-actions.pod:2843
27334 msgid "See also L</mke2journal-L>."
27339 #: ../fish/guestfish-actions.pod:2845
27345 #: ../fish/guestfish-actions.pod:2847
27348 " mke2fs-JU fstype blocksize device uuid\n"
27354 #: ../fish/guestfish-actions.pod:2852
27355 msgid "See also L</mke2journal-U>."
27360 #: ../fish/guestfish-actions.pod:2854
27361 msgid "mke2journal"
27366 #: ../fish/guestfish-actions.pod:2856
27369 " mke2journal blocksize device\n"
27375 #: ../fish/guestfish-actions.pod:2863
27376 msgid "mke2journal-L"
27381 #: ../fish/guestfish-actions.pod:2865
27384 " mke2journal-L blocksize label device\n"
27390 #: ../fish/guestfish-actions.pod:2869
27391 msgid "mke2journal-U"
27396 #: ../fish/guestfish-actions.pod:2871
27399 " mke2journal-U blocksize uuid device\n"
27405 #: ../fish/guestfish-actions.pod:2875
27411 #: ../fish/guestfish-actions.pod:2877
27414 " mkfifo mode path\n"
27420 #: ../fish/guestfish-actions.pod:2879
27422 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
27423 "is just a convenient wrapper around L</mknod>."
27428 #: ../fish/guestfish-actions.pod:2885
27434 #: ../fish/guestfish-actions.pod:2887
27437 " mkfs fstype device\n"
27443 #: ../fish/guestfish-actions.pod:2893
27449 #: ../fish/guestfish-actions.pod:2895
27452 " mkfs-b fstype blocksize device\n"
27458 #: ../fish/guestfish-actions.pod:2897
27460 "This call is similar to L</mkfs>, but it allows you to control the block "
27461 "size of the resulting filesystem. Supported block sizes depend on the "
27462 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
27467 #: ../fish/guestfish-actions.pod:2912
27472 #: ../fish/guestfish-actions.pod:2914
27475 " mkfs-opts fstype device [blocksize:..] [features:..]\n"
27481 #: ../fish/guestfish-actions.pod:2949
27482 msgid "mkmountpoint"
27487 #: ../fish/guestfish-actions.pod:2951
27490 " mkmountpoint exemptpath\n"
27496 #: ../fish/guestfish-actions.pod:2953
27498 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
27499 "to create extra mountpoints before mounting the first filesystem."
27504 #: ../fish/guestfish-actions.pod:2977
27506 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
27507 "unexpected errors if you try to mix these calls. It is safest to manually "
27508 "unmount filesystems and remove mountpoints after use."
27513 #: ../fish/guestfish-actions.pod:2981
27515 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
27516 "for this to work for manual mountpoints, you must ensure that the innermost "
27517 "mountpoints have the longest pathnames, as in the example code above."
27521 #: ../fish/guestfish-actions.pod:2988
27523 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
27524 "L</umount-all> to be called when the handle is closed which can also trigger "
27530 #: ../fish/guestfish-actions.pod:2992
27536 #: ../fish/guestfish-actions.pod:2994
27539 " mknod mode devmajor devminor path\n"
27545 #: ../fish/guestfish-actions.pod:3004
27547 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27548 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27549 "regular file). These constants are available in the standard Linux header "
27550 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
27551 "wrappers around this command which bitwise OR in the appropriate constant "
27557 #: ../fish/guestfish-actions.pod:3014
27563 #: ../fish/guestfish-actions.pod:3016
27566 " mknod-b mode devmajor devminor path\n"
27572 #: ../fish/guestfish-actions.pod:3018
27574 "This call creates a block device node called C<path> with mode C<mode> and "
27575 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27576 "wrapper around L</mknod>."
27581 #: ../fish/guestfish-actions.pod:3024
27587 #: ../fish/guestfish-actions.pod:3026
27590 " mknod-c mode devmajor devminor path\n"
27596 #: ../fish/guestfish-actions.pod:3028
27598 "This call creates a char device node called C<path> with mode C<mode> and "
27599 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27600 "wrapper around L</mknod>."
27605 #: ../fish/guestfish-actions.pod:3034
27611 #: ../fish/guestfish-actions.pod:3036
27620 #: ../fish/guestfish-actions.pod:3040
27626 #: ../fish/guestfish-actions.pod:3042
27629 " mkswap-L label device\n"
27635 #: ../fish/guestfish-actions.pod:3050
27641 #: ../fish/guestfish-actions.pod:3052
27644 " mkswap-U uuid device\n"
27650 #: ../fish/guestfish-actions.pod:3056
27651 msgid "mkswap-file"
27656 #: ../fish/guestfish-actions.pod:3058
27659 " mkswap-file path\n"
27665 #: ../fish/guestfish-actions.pod:3062
27667 "This command just writes a swap file signature to an existing file. To "
27668 "create the file itself, use something like L</fallocate>."
27673 #: ../fish/guestfish-actions.pod:3065
27679 #: ../fish/guestfish-actions.pod:3067
27682 " modprobe modulename\n"
27688 #: ../fish/guestfish-actions.pod:3074
27694 #: ../fish/guestfish-actions.pod:3076
27697 " mount device mountpoint\n"
27703 #: ../fish/guestfish-actions.pod:3092
27705 "B<Important note:> When you use this call, the filesystem options C<sync> "
27706 "and C<noatime> are set implicitly. This was originally done because we "
27707 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27708 "very large negative performance impact and negligible effect on "
27709 "reliability. Therefore we recommend that you avoid using L</mount> in any "
27710 "code that needs performance, and instead use L</mount-options> (use an empty "
27711 "string for the first parameter if you don't want any options)."
27716 #: ../fish/guestfish-actions.pod:3102
27722 #: ../fish/guestfish-actions.pod:3104
27725 " mount-loop file mountpoint\n"
27731 #: ../fish/guestfish-actions.pod:3110
27732 msgid "mount-options"
27737 #: ../fish/guestfish-actions.pod:3112
27740 " mount-options options device mountpoint\n"
27746 #: ../fish/guestfish-actions.pod:3114
27748 "This is the same as the L</mount> command, but it allows you to set the "
27749 "mount options as for the L<mount(8)> I<-o> flag."
27754 #: ../fish/guestfish-actions.pod:3122
27760 #: ../fish/guestfish-actions.pod:3124
27763 " mount-ro device mountpoint\n"
27769 #: ../fish/guestfish-actions.pod:3126
27771 "This is the same as the L</mount> command, but it mounts the filesystem with "
27772 "the read-only (I<-o ro>) flag."
27777 #: ../fish/guestfish-actions.pod:3129
27783 #: ../fish/guestfish-actions.pod:3131
27786 " mount-vfs options vfstype device mountpoint\n"
27792 #: ../fish/guestfish-actions.pod:3133
27794 "This is the same as the L</mount> command, but it allows you to set both the "
27795 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
27800 #: ../fish/guestfish-actions.pod:3137
27801 msgid "mountpoints"
27806 #: ../fish/guestfish-actions.pod:3139
27815 #: ../fish/guestfish-actions.pod:3141
27817 "This call is similar to L</mounts>. That call returns a list of devices. "
27818 "This one returns a hash table (map) of device name to directory where the "
27819 "device is mounted."
27824 #: ../fish/guestfish-actions.pod:3145
27830 #: ../fish/guestfish-actions.pod:3147
27839 #: ../fish/guestfish-actions.pod:3154
27840 msgid "See also: L</mountpoints>"
27845 #: ../fish/guestfish-actions.pod:3156
27851 #: ../fish/guestfish-actions.pod:3158
27860 #: ../fish/guestfish-actions.pod:3163
27861 msgid "ntfs-3g-probe"
27866 #: ../fish/guestfish-actions.pod:3165
27869 " ntfs-3g-probe true|false device\n"
27875 #: ../fish/guestfish-actions.pod:3179
27881 #: ../fish/guestfish-actions.pod:3181
27884 " ntfsresize device\n"
27890 #: ../fish/guestfish-actions.pod:3187
27891 msgid "ntfsresize-size"
27896 #: ../fish/guestfish-actions.pod:3189
27899 " ntfsresize-size device size\n"
27905 #: ../fish/guestfish-actions.pod:3191
27907 "This command is the same as L</ntfsresize> except that it allows you to "
27908 "specify the new size (in bytes) explicitly."
27913 #: ../fish/guestfish-actions.pod:3194
27919 #: ../fish/guestfish-actions.pod:3196
27922 " part-add device prlogex startsect endsect\n"
27928 #: ../fish/guestfish-actions.pod:3198
27930 "This command adds a partition to C<device>. If there is no partition table "
27931 "on the device, call L</part-init> first."
27936 #: ../fish/guestfish-actions.pod:3210
27938 "Creating a partition which covers the whole disk is not so easy. Use L</"
27939 "part-disk> to do that."
27944 #: ../fish/guestfish-actions.pod:3213
27950 #: ../fish/guestfish-actions.pod:3215
27953 " part-del device partnum\n"
27959 #: ../fish/guestfish-actions.pod:3223
27965 #: ../fish/guestfish-actions.pod:3225
27968 " part-disk device parttype\n"
27974 #: ../fish/guestfish-actions.pod:3227
27976 "This command is simply a combination of L</part-init> followed by L</part-"
27977 "add> to create a single primary partition covering the whole disk."
27982 #: ../fish/guestfish-actions.pod:3231
27984 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27985 "possible values are described in L</part-init>."
27990 #: ../fish/guestfish-actions.pod:3237
27991 msgid "part-get-bootable"
27996 #: ../fish/guestfish-actions.pod:3239
27999 " part-get-bootable device partnum\n"
28005 #: ../fish/guestfish-actions.pod:3244
28006 msgid "See also L</part-set-bootable>."
28011 #: ../fish/guestfish-actions.pod:3246
28012 msgid "part-get-mbr-id"
28017 #: ../fish/guestfish-actions.pod:3248
28020 " part-get-mbr-id device partnum\n"
28026 #: ../fish/guestfish-actions.pod:3253 ../fish/guestfish-actions.pod:3391
28028 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
28029 "undefined results for other partition table types (see L</part-get-"
28035 #: ../fish/guestfish-actions.pod:3257
28036 msgid "part-get-parttype"
28041 #: ../fish/guestfish-actions.pod:3259
28044 " part-get-parttype device\n"
28050 #: ../fish/guestfish-actions.pod:3264
28052 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
28053 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
28054 "possible, although unusual. See L</part-init> for a full list."
28059 #: ../fish/guestfish-actions.pod:3269
28065 #: ../fish/guestfish-actions.pod:3271
28068 " part-init device parttype\n"
28074 #: ../fish/guestfish-actions.pod:3277
28076 "Initially there are no partitions. Following this, you should call L</part-"
28077 "add> for each partition required."
28082 #: ../fish/guestfish-actions.pod:3340
28088 #: ../fish/guestfish-actions.pod:3342
28091 " part-list device\n"
28097 #: ../fish/guestfish-actions.pod:3357
28099 "Start of the partition I<in bytes>. To get sectors you have to divide by "
28100 "the device's sector size, see L</blockdev-getss>."
28105 #: ../fish/guestfish-actions.pod:3370
28106 msgid "part-set-bootable"
28111 #: ../fish/guestfish-actions.pod:3372
28114 " part-set-bootable device partnum true|false\n"
28120 #: ../fish/guestfish-actions.pod:3381
28121 msgid "part-set-mbr-id"
28126 #: ../fish/guestfish-actions.pod:3383
28129 " part-set-mbr-id device partnum idbyte\n"
28135 #: ../fish/guestfish-actions.pod:3395
28136 msgid "part-set-name"
28141 #: ../fish/guestfish-actions.pod:3397
28144 " part-set-name device partnum name\n"
28150 #: ../fish/guestfish-actions.pod:3405
28151 msgid "part-to-dev"
28156 #: ../fish/guestfish-actions.pod:3407
28159 " part-to-dev partition\n"
28165 #: ../fish/guestfish-actions.pod:3413
28167 "The named partition must exist, for example as a string returned from L</"
28168 "list-partitions>."
28173 #: ../fish/guestfish-actions.pod:3416
28174 msgid "ping-daemon"
28179 #: ../fish/guestfish-actions.pod:3418
28188 #: ../fish/guestfish-actions.pod:3425
28194 #: ../fish/guestfish-actions.pod:3427
28197 " pread path count offset\n"
28203 #: ../fish/guestfish-actions.pod:3435
28204 msgid "See also L</pwrite>, L</pread-device>."
28209 #: ../fish/guestfish-actions.pod:3440
28210 msgid "pread-device"
28215 #: ../fish/guestfish-actions.pod:3442
28218 " pread-device device count offset\n"
28224 #: ../fish/guestfish-actions.pod:3450
28225 msgid "See also L</pread>."
28230 #: ../fish/guestfish-actions.pod:3455
28236 #: ../fish/guestfish-actions.pod:3457
28239 " pvcreate device\n"
28245 #: ../fish/guestfish-actions.pod:3463
28251 #: ../fish/guestfish-actions.pod:3465
28254 " pvremove device\n"
28260 #: ../fish/guestfish-actions.pod:3474
28266 #: ../fish/guestfish-actions.pod:3476
28269 " pvresize device\n"
28275 #: ../fish/guestfish-actions.pod:3481
28276 msgid "pvresize-size"
28281 #: ../fish/guestfish-actions.pod:3483
28284 " pvresize-size device size\n"
28290 #: ../fish/guestfish-actions.pod:3485
28292 "This command is the same as L</pvresize> except that it allows you to "
28293 "specify the new size (in bytes) explicitly."
28298 #: ../fish/guestfish-actions.pod:3488
28304 #: ../fish/guestfish-actions.pod:3490
28313 #: ../fish/guestfish-actions.pod:3498
28314 msgid "See also L</pvs-full>."
28319 #: ../fish/guestfish-actions.pod:3500
28325 #: ../fish/guestfish-actions.pod:3502
28334 #: ../fish/guestfish-actions.pod:3507
28340 #: ../fish/guestfish-actions.pod:3509
28349 #: ../fish/guestfish-actions.pod:3513
28355 #: ../fish/guestfish-actions.pod:3515
28358 " pwrite path content offset\n"
28364 #: ../fish/guestfish-actions.pod:3526
28365 msgid "See also L</pread>, L</pwrite-device>."
28370 #: ../fish/guestfish-actions.pod:3531
28371 msgid "pwrite-device"
28376 #: ../fish/guestfish-actions.pod:3533
28379 " pwrite-device device content offset\n"
28385 #: ../fish/guestfish-actions.pod:3543
28386 msgid "See also L</pwrite>."
28391 #: ../fish/guestfish-actions.pod:3548
28397 #: ../fish/guestfish-actions.pod:3550
28400 " read-file path\n"
28406 #: ../fish/guestfish-actions.pod:3555
28408 "Unlike L</cat>, this function can correctly handle files that contain "
28409 "embedded ASCII NUL characters. However unlike L</download>, this function "
28410 "is limited in the total size of file that can be handled."
28415 #: ../fish/guestfish-actions.pod:3563
28421 #: ../fish/guestfish-actions.pod:3565
28424 " read-lines path\n"
28430 #: ../fish/guestfish-actions.pod:3572
28432 "Note that this function cannot correctly handle binary files (specifically, "
28433 "files containing C<\\0> character which is treated as end of line). For "
28434 "those you need to use the L</read-file> function which has a more complex "
28440 #: ../fish/guestfish-actions.pod:3577
28446 #: ../fish/guestfish-actions.pod:3579
28455 #: ../fish/guestfish-actions.pod:3631
28457 "This function is primarily intended for use by programs. To get a simple "
28458 "list of names, use L</ls>. To get a printable directory for human "
28459 "consumption, use L</ll>."
28464 #: ../fish/guestfish-actions.pod:3635
28470 #: ../fish/guestfish-actions.pod:3637
28479 #: ../fish/guestfish-actions.pod:3641
28480 msgid "readlinklist"
28485 #: ../fish/guestfish-actions.pod:3643
28488 " readlinklist path 'names ...'\n"
28494 #: ../fish/guestfish-actions.pod:3667
28500 #: ../fish/guestfish-actions.pod:3669
28509 #: ../fish/guestfish-actions.pod:3674
28510 msgid "removexattr"
28515 #: ../fish/guestfish-actions.pod:3676
28518 " removexattr xattr path\n"
28524 #: ../fish/guestfish-actions.pod:3681
28525 msgid "See also: L</lremovexattr>, L<attr(5)>."
28530 #: ../fish/guestfish-actions.pod:3683
28536 #: ../fish/guestfish-actions.pod:3685
28539 " resize2fs device\n"
28545 #: ../fish/guestfish-actions.pod:3690
28547 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
28548 "before calling this command. For unknown reasons C<resize2fs> sometimes "
28549 "gives an error about this and sometimes not. In any case, it is always safe "
28550 "to call L</e2fsck-f> before calling this function."
28554 #: ../fish/guestfish-actions.pod:3696
28555 msgid "resize2fs-M"
28559 #: ../fish/guestfish-actions.pod:3698
28562 " resize2fs-M device\n"
28567 #: ../fish/guestfish-actions.pod:3700
28569 "This command is the same as L</resize2fs>, but the filesystem is resized to "
28570 "its minimum size. This works like the C<-M> option to the C<resize2fs> "
28575 #: ../fish/guestfish-actions.pod:3704
28577 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
28578 "and read the C<Block size> and C<Block count> values. These two numbers, "
28579 "multiplied together, give the resulting size of the minimal filesystem in "
28585 #: ../fish/guestfish-actions.pod:3709
28586 msgid "resize2fs-size"
28591 #: ../fish/guestfish-actions.pod:3711
28594 " resize2fs-size device size\n"
28600 #: ../fish/guestfish-actions.pod:3713
28602 "This command is the same as L</resize2fs> except that it allows you to "
28603 "specify the new size (in bytes) explicitly."
28608 #: ../fish/guestfish-actions.pod:3716
28614 #: ../fish/guestfish-actions.pod:3718
28623 #: ../fish/guestfish-actions.pod:3722
28629 #: ../fish/guestfish-actions.pod:3724
28638 #: ../fish/guestfish-actions.pod:3730
28644 #: ../fish/guestfish-actions.pod:3732
28653 #: ../fish/guestfish-actions.pod:3736
28654 msgid "rmmountpoint"
28659 #: ../fish/guestfish-actions.pod:3738
28662 " rmmountpoint exemptpath\n"
28668 #: ../fish/guestfish-actions.pod:3740
28670 "This calls removes a mountpoint that was previously created with L</"
28671 "mkmountpoint>. See L</mkmountpoint> for full details."
28676 #: ../fish/guestfish-actions.pod:3744
28677 msgid "scrub-device"
28682 #: ../fish/guestfish-actions.pod:3746
28685 " scrub-device device\n"
28691 #: ../fish/guestfish-actions.pod:3757
28697 #: ../fish/guestfish-actions.pod:3759
28700 " scrub-file file\n"
28706 #: ../fish/guestfish-actions.pod:3769
28707 msgid "scrub-freespace"
28712 #: ../fish/guestfish-actions.pod:3771
28715 " scrub-freespace dir\n"
28721 #: ../fish/guestfish-actions.pod:3773
28723 "This command creates the directory C<dir> and then fills it with files until "
28724 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
28725 "deletes them. The intention is to scrub any free space on the partition "
28726 "containing C<dir>."
28731 #: ../fish/guestfish-actions.pod:3782
28737 #: ../fish/guestfish-actions.pod:3784
28743 #: ../fish/guestfish-actions.pod:3786
28746 " set-append append\n"
28751 #: ../fish/guestfish-actions.pod:3797
28752 msgid "set-attach-method"
28756 #: ../fish/guestfish-actions.pod:3799
28757 msgid "attach-method"
28761 #: ../fish/guestfish-actions.pod:3801
28764 " set-attach-method attachmethod\n"
28770 #: ../fish/guestfish-actions.pod:3823
28771 msgid "set-autosync"
28776 #: ../fish/guestfish-actions.pod:3825
28782 #: ../fish/guestfish-actions.pod:3827
28785 " set-autosync true|false\n"
28791 #: ../fish/guestfish-actions.pod:3837
28797 #: ../fish/guestfish-actions.pod:3839
28803 #: ../fish/guestfish-actions.pod:3841
28806 " set-direct true|false\n"
28812 #: ../fish/guestfish-actions.pod:3847
28814 "One consequence of this is that log messages aren't caught by the library "
28815 "and handled by L</set-log-message-callback>, but go straight to stdout."
28820 #: ../fish/guestfish-actions.pod:3856
28821 msgid "set-e2label"
28826 #: ../fish/guestfish-actions.pod:3858
28829 " set-e2label device label\n"
28835 #: ../fish/guestfish-actions.pod:3864
28837 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
28838 "label on a filesystem."
28843 #: ../fish/guestfish-actions.pod:3867
28849 #: ../fish/guestfish-actions.pod:3869
28852 " set-e2uuid device uuid\n"
28858 #: ../fish/guestfish-actions.pod:3876
28860 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
28861 "UUID of a filesystem."
28866 #: ../fish/guestfish-actions.pod:3879
28867 msgid "set-memsize"
28872 #: ../fish/guestfish-actions.pod:3881
28878 #: ../fish/guestfish-actions.pod:3883
28881 " set-memsize memsize\n"
28887 #: ../fish/guestfish-actions.pod:3885
28889 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28890 "This only has any effect if called before L</launch>."
28895 #: ../fish/guestfish-actions.pod:3896
28896 msgid "set-network"
28901 #: ../fish/guestfish-actions.pod:3898
28907 #: ../fish/guestfish-actions.pod:3900
28910 " set-network true|false\n"
28916 #: ../fish/guestfish-actions.pod:3908
28918 "You must call this before calling L</launch>, otherwise it has no effect."
28923 #: ../fish/guestfish-actions.pod:3911
28929 #: ../fish/guestfish-actions.pod:3913
28935 #: ../fish/guestfish-actions.pod:3915
28938 " set-path searchpath\n"
28944 #: ../fish/guestfish-actions.pod:3924
28950 #: ../fish/guestfish-actions.pod:3926
28956 #: ../fish/guestfish-actions.pod:3928
28965 #: ../fish/guestfish-actions.pod:3948
28966 msgid "set-recovery-proc"
28971 #: ../fish/guestfish-actions.pod:3950
28972 msgid "recovery-proc"
28977 #: ../fish/guestfish-actions.pod:3952
28980 " set-recovery-proc true|false\n"
28986 #: ../fish/guestfish-actions.pod:3954
28988 "If this is called with the parameter C<false> then L</launch> does not "
28989 "create a recovery process. The purpose of the recovery process is to stop "
28990 "runaway qemu processes in the case where the main program aborts abruptly."
28995 #: ../fish/guestfish-actions.pod:3959
28997 "This only has any effect if called before L</launch>, and the default is "
29003 #: ../fish/guestfish-actions.pod:3968
29004 msgid "set-selinux"
29009 #: ../fish/guestfish-actions.pod:3970
29015 #: ../fish/guestfish-actions.pod:3972
29018 " set-selinux true|false\n"
29024 #: ../fish/guestfish-actions.pod:3983
29030 #: ../fish/guestfish-actions.pod:3985
29036 #: ../fish/guestfish-actions.pod:3987
29039 " set-trace true|false\n"
29045 #: ../fish/guestfish-actions.pod:4003
29046 msgid "set-verbose"
29051 #: ../fish/guestfish-actions.pod:4005
29057 #: ../fish/guestfish-actions.pod:4007
29060 " set-verbose true|false\n"
29066 #: ../fish/guestfish-actions.pod:4014
29072 #: ../fish/guestfish-actions.pod:4016
29075 " setcon context\n"
29081 #: ../fish/guestfish-actions.pod:4023
29087 #: ../fish/guestfish-actions.pod:4025
29090 " setxattr xattr val vallen path\n"
29096 #: ../fish/guestfish-actions.pod:4031
29097 msgid "See also: L</lsetxattr>, L<attr(5)>."
29102 #: ../fish/guestfish-actions.pod:4033
29108 #: ../fish/guestfish-actions.pod:4035
29111 " sfdisk device cyls heads sectors 'lines ...'\n"
29117 #: ../fish/guestfish-actions.pod:4057
29118 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
29123 #: ../fish/guestfish-actions.pod:4063
29129 #: ../fish/guestfish-actions.pod:4065
29132 " sfdiskM device 'lines ...'\n"
29138 #: ../fish/guestfish-actions.pod:4067
29140 "This is a simplified interface to the L</sfdisk> command, where partition "
29141 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
29142 "you don't need to specify the cyls, heads and sectors parameters which were "
29143 "rarely if ever used anyway."
29148 #: ../fish/guestfish-actions.pod:4073
29149 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
29154 #: ../fish/guestfish-actions.pod:4079
29160 #: ../fish/guestfish-actions.pod:4081
29163 " sfdisk-N device partnum cyls heads sectors line\n"
29169 #: ../fish/guestfish-actions.pod:4086
29171 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
29172 "cyls/heads/sectors parameters."
29177 #: ../fish/guestfish-actions.pod:4089
29178 msgid "See also: L</part-add>"
29183 #: ../fish/guestfish-actions.pod:4094
29184 msgid "sfdisk-disk-geometry"
29189 #: ../fish/guestfish-actions.pod:4096
29192 " sfdisk-disk-geometry device\n"
29198 #: ../fish/guestfish-actions.pod:4098
29200 "This displays the disk geometry of C<device> read from the partition table. "
29201 "Especially in the case where the underlying block device has been resized, "
29202 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
29203 "kernel-geometry>)."
29208 #: ../fish/guestfish-actions.pod:4106
29209 msgid "sfdisk-kernel-geometry"
29214 #: ../fish/guestfish-actions.pod:4108
29217 " sfdisk-kernel-geometry device\n"
29223 #: ../fish/guestfish-actions.pod:4115
29229 #: ../fish/guestfish-actions.pod:4117
29232 " sfdisk-l device\n"
29238 #: ../fish/guestfish-actions.pod:4123
29239 msgid "See also: L</part-list>"
29244 #: ../fish/guestfish-actions.pod:4125
29250 #: ../fish/guestfish-actions.pod:4127
29259 #: ../fish/guestfish-actions.pod:4132
29260 msgid "This is like L</command>, but passes the command to:"
29265 #: ../fish/guestfish-actions.pod:4140
29266 msgid "All the provisos about L</command> apply to this call."
29271 #: ../fish/guestfish-actions.pod:4142
29277 #: ../fish/guestfish-actions.pod:4144
29280 " sh-lines command\n"
29286 #: ../fish/guestfish-actions.pod:4146
29287 msgid "This is the same as L</sh>, but splits the result into a list of lines."
29292 #: ../fish/guestfish-actions.pod:4149
29293 msgid "See also: L</command-lines>"
29298 #: ../fish/guestfish-actions.pod:4151
29304 #: ../fish/guestfish-actions.pod:4153
29313 #: ../fish/guestfish-actions.pod:4157
29319 #: ../fish/guestfish-actions.pod:4159
29328 #: ../fish/guestfish-actions.pod:4165
29334 #: ../fish/guestfish-actions.pod:4167
29343 #: ../fish/guestfish-actions.pod:4175
29349 #: ../fish/guestfish-actions.pod:4177
29358 #: ../fish/guestfish-actions.pod:4185
29364 #: ../fish/guestfish-actions.pod:4187
29367 " strings-e encoding path\n"
29373 #: ../fish/guestfish-actions.pod:4189
29375 "This is like the L</strings> command, but allows you to specify the encoding "
29376 "of strings that are looked for in the source file C<path>."
29381 #: ../fish/guestfish-actions.pod:4199
29383 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29384 "ISO-8859-X (this is what L</strings> uses)."
29389 #: ../fish/guestfish-actions.pod:4231
29390 msgid "swapoff-device"
29395 #: ../fish/guestfish-actions.pod:4233
29398 " swapoff-device device\n"
29404 #: ../fish/guestfish-actions.pod:4235
29406 "This command disables the libguestfs appliance swap device or partition "
29407 "named C<device>. See L</swapon-device>."
29412 #: ../fish/guestfish-actions.pod:4239
29413 msgid "swapoff-file"
29418 #: ../fish/guestfish-actions.pod:4241
29421 " swapoff-file file\n"
29427 #: ../fish/guestfish-actions.pod:4245
29428 msgid "swapoff-label"
29433 #: ../fish/guestfish-actions.pod:4247
29436 " swapoff-label label\n"
29442 #: ../fish/guestfish-actions.pod:4252
29443 msgid "swapoff-uuid"
29448 #: ../fish/guestfish-actions.pod:4254
29451 " swapoff-uuid uuid\n"
29457 #: ../fish/guestfish-actions.pod:4259
29458 msgid "swapon-device"
29463 #: ../fish/guestfish-actions.pod:4261
29466 " swapon-device device\n"
29472 #: ../fish/guestfish-actions.pod:4263
29474 "This command enables the libguestfs appliance to use the swap device or "
29475 "partition named C<device>. The increased memory is made available for all "
29476 "commands, for example those run using L</command> or L</sh>."
29481 #: ../fish/guestfish-actions.pod:4275
29482 msgid "swapon-file"
29487 #: ../fish/guestfish-actions.pod:4277
29490 " swapon-file file\n"
29496 #: ../fish/guestfish-actions.pod:4279
29498 "This command enables swap to a file. See L</swapon-device> for other notes."
29503 #: ../fish/guestfish-actions.pod:4282
29504 msgid "swapon-label"
29509 #: ../fish/guestfish-actions.pod:4284
29512 " swapon-label label\n"
29518 #: ../fish/guestfish-actions.pod:4286
29520 "This command enables swap to a labeled swap partition. See L</swapon-"
29521 "device> for other notes."
29526 #: ../fish/guestfish-actions.pod:4289
29527 msgid "swapon-uuid"
29532 #: ../fish/guestfish-actions.pod:4291
29535 " swapon-uuid uuid\n"
29541 #: ../fish/guestfish-actions.pod:4293
29543 "This command enables swap to a swap partition with the given UUID. See L</"
29544 "swapon-device> for other notes."
29549 #: ../fish/guestfish-actions.pod:4296
29555 #: ../fish/guestfish-actions.pod:4298
29564 #: ../fish/guestfish-actions.pod:4306
29570 #: ../fish/guestfish-actions.pod:4308
29579 #: ../fish/guestfish-actions.pod:4316
29585 #: ../fish/guestfish-actions.pod:4318
29588 " tail-n nrlines path\n"
29594 #: ../fish/guestfish-actions.pod:4331
29600 #: ../fish/guestfish-actions.pod:4333
29603 " tar-in (tarfile|-) directory\n"
29609 #: ../fish/guestfish-actions.pod:4338
29610 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
29615 #: ../fish/guestfish-actions.pod:4343
29621 #: ../fish/guestfish-actions.pod:4345
29624 " tar-out directory (tarfile|-)\n"
29630 #: ../fish/guestfish-actions.pod:4350
29631 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
29636 #: ../fish/guestfish-actions.pod:4355
29642 #: ../fish/guestfish-actions.pod:4357
29645 " tgz-in (tarball|-) directory\n"
29651 #: ../fish/guestfish-actions.pod:4362
29652 msgid "To upload an uncompressed tarball, use L</tar-in>."
29657 #: ../fish/guestfish-actions.pod:4366
29663 #: ../fish/guestfish-actions.pod:4368
29666 " tgz-out directory (tarball|-)\n"
29672 #: ../fish/guestfish-actions.pod:4373
29673 msgid "To download an uncompressed tarball, use L</tar-out>."
29678 #: ../fish/guestfish-actions.pod:4377
29684 #: ../fish/guestfish-actions.pod:4379
29693 #: ../fish/guestfish-actions.pod:4388
29699 #: ../fish/guestfish-actions.pod:4390
29708 #: ../fish/guestfish-actions.pod:4395
29709 msgid "truncate-size"
29714 #: ../fish/guestfish-actions.pod:4397
29717 " truncate-size path size\n"
29723 #: ../fish/guestfish-actions.pod:4402
29725 "If the current file size is less than C<size> then the file is extended to "
29726 "the required size with zero bytes. This creates a sparse file (ie. disk "
29727 "blocks are not allocated for the file until you write to it). To create a "
29728 "non-sparse file of zeroes, use L</fallocate64> instead."
29733 #: ../fish/guestfish-actions.pod:4408
29739 #: ../fish/guestfish-actions.pod:4410
29742 " tune2fs-l device\n"
29748 #: ../fish/guestfish-actions.pod:4420
29754 #: ../fish/guestfish-actions.pod:4422
29757 " txz-in (tarball|-) directory\n"
29763 #: ../fish/guestfish-actions.pod:4429
29769 #: ../fish/guestfish-actions.pod:4431
29772 " txz-out directory (tarball|-)\n"
29778 #: ../fish/guestfish-actions.pod:4438
29784 #: ../fish/guestfish-actions.pod:4440
29793 #: ../fish/guestfish-actions.pod:4454
29794 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
29799 #: ../fish/guestfish-actions.pod:4459
29805 #: ../fish/guestfish-actions.pod:4461
29811 #: ../fish/guestfish-actions.pod:4463
29814 " umount pathordevice\n"
29820 #: ../fish/guestfish-actions.pod:4469
29826 #: ../fish/guestfish-actions.pod:4471
29827 msgid "unmount-all"
29832 #: ../fish/guestfish-actions.pod:4473
29841 #: ../fish/guestfish-actions.pod:4479
29847 #: ../fish/guestfish-actions.pod:4481
29850 " upload (filename|-) remotefilename\n"
29856 #: ../fish/guestfish-actions.pod:4488
29857 msgid "See also L</download>."
29862 #: ../fish/guestfish-actions.pod:4492
29863 msgid "upload-offset"
29868 #: ../fish/guestfish-actions.pod:4494
29871 " upload-offset (filename|-) remotefilename offset\n"
29877 #: ../fish/guestfish-actions.pod:4506
29879 "Note that there is no limit on the amount of data that can be uploaded with "
29880 "this call, unlike with L</pwrite>, and this call always writes the full "
29881 "amount unless an error occurs."
29886 #: ../fish/guestfish-actions.pod:4511
29887 msgid "See also L</upload>, L</pwrite>."
29892 #: ../fish/guestfish-actions.pod:4515
29898 #: ../fish/guestfish-actions.pod:4517
29901 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
29907 #: ../fish/guestfish-actions.pod:4536
29913 #: ../fish/guestfish-actions.pod:4538
29922 #: ../fish/guestfish-actions.pod:4565
29924 "I<Note:> Don't use this call to test for availability of features. In "
29925 "enterprise distributions we backport features from later versions into "
29926 "earlier versions, making this an unreliable way to test for features. Use "
29927 "L</available> instead."
29932 #: ../fish/guestfish-actions.pod:4571
29938 #: ../fish/guestfish-actions.pod:4573
29941 " vfs-label device\n"
29947 #: ../fish/guestfish-actions.pod:4580
29948 msgid "To find a filesystem from the label, use L</findfs-label>."
29953 #: ../fish/guestfish-actions.pod:4582
29959 #: ../fish/guestfish-actions.pod:4584
29962 " vfs-type device\n"
29968 #: ../fish/guestfish-actions.pod:4594
29974 #: ../fish/guestfish-actions.pod:4596
29977 " vfs-uuid device\n"
29983 #: ../fish/guestfish-actions.pod:4603
29984 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
29989 #: ../fish/guestfish-actions.pod:4605
29990 msgid "vg-activate"
29995 #: ../fish/guestfish-actions.pod:4607
29998 " vg-activate true|false 'volgroups ...'\n"
30004 #: ../fish/guestfish-actions.pod:4620
30005 msgid "vg-activate-all"
30010 #: ../fish/guestfish-actions.pod:4622
30013 " vg-activate-all true|false\n"
30019 #: ../fish/guestfish-actions.pod:4632
30025 #: ../fish/guestfish-actions.pod:4634
30028 " vgcreate volgroup 'physvols ...'\n"
30034 #: ../fish/guestfish-actions.pod:4639
30040 #: ../fish/guestfish-actions.pod:4641
30043 " vglvuuids vgname\n"
30049 #: ../fish/guestfish-actions.pod:4646
30051 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
30052 "logical volumes and volume groups."
30057 #: ../fish/guestfish-actions.pod:4649
30058 msgid "See also L</vgpvuuids>."
30063 #: ../fish/guestfish-actions.pod:4651
30069 #: ../fish/guestfish-actions.pod:4653
30072 " vgpvuuids vgname\n"
30078 #: ../fish/guestfish-actions.pod:4658
30080 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
30081 "physical volumes and volume groups."
30086 #: ../fish/guestfish-actions.pod:4661
30087 msgid "See also L</vglvuuids>."
30092 #: ../fish/guestfish-actions.pod:4663
30098 #: ../fish/guestfish-actions.pod:4665
30101 " vgremove vgname\n"
30107 #: ../fish/guestfish-actions.pod:4672
30113 #: ../fish/guestfish-actions.pod:4674
30116 " vgrename volgroup newvolgroup\n"
30122 #: ../fish/guestfish-actions.pod:4678
30128 #: ../fish/guestfish-actions.pod:4680
30137 #: ../fish/guestfish-actions.pod:4688
30138 msgid "See also L</vgs-full>."
30143 #: ../fish/guestfish-actions.pod:4690
30149 #: ../fish/guestfish-actions.pod:4692
30158 #: ../fish/guestfish-actions.pod:4697
30164 #: ../fish/guestfish-actions.pod:4699
30173 #: ../fish/guestfish-actions.pod:4704
30179 #: ../fish/guestfish-actions.pod:4706
30188 #: ../fish/guestfish-actions.pod:4710
30194 #: ../fish/guestfish-actions.pod:4712
30203 #: ../fish/guestfish-actions.pod:4717
30209 #: ../fish/guestfish-actions.pod:4719
30218 #: ../fish/guestfish-actions.pod:4724
30224 #: ../fish/guestfish-actions.pod:4726
30233 #: ../fish/guestfish-actions.pod:4731
30239 #: ../fish/guestfish-actions.pod:4733
30242 " write path content\n"
30248 #: ../fish/guestfish-actions.pod:4741
30254 #: ../fish/guestfish-actions.pod:4743
30257 " write-file path content size\n"
30263 #: ../fish/guestfish-actions.pod:4766
30269 #: ../fish/guestfish-actions.pod:4768
30272 " zegrep regex path\n"
30278 #: ../fish/guestfish-actions.pod:4776
30284 #: ../fish/guestfish-actions.pod:4778
30287 " zegrepi regex path\n"
30293 #: ../fish/guestfish-actions.pod:4786
30299 #: ../fish/guestfish-actions.pod:4788
30308 #: ../fish/guestfish-actions.pod:4796
30309 msgid "See also: L</zero-device>, L</scrub-device>."
30314 #: ../fish/guestfish-actions.pod:4798
30315 msgid "zero-device"
30320 #: ../fish/guestfish-actions.pod:4800
30323 " zero-device device\n"
30329 #: ../fish/guestfish-actions.pod:4802
30331 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
30332 "which just zeroes the first few blocks of a device."
30337 #: ../fish/guestfish-actions.pod:4809
30343 #: ../fish/guestfish-actions.pod:4811
30346 " zerofree device\n"
30352 #: ../fish/guestfish-actions.pod:4824
30358 #: ../fish/guestfish-actions.pod:4826
30361 " zfgrep pattern path\n"
30367 #: ../fish/guestfish-actions.pod:4834
30373 #: ../fish/guestfish-actions.pod:4836
30376 " zfgrepi pattern path\n"
30382 #: ../fish/guestfish-actions.pod:4844
30388 #: ../fish/guestfish-actions.pod:4846
30391 " zfile meth path\n"
30397 #: ../fish/guestfish-actions.pod:4853
30399 "Since 1.0.63, use L</file> instead which can now process compressed files."
30404 #: ../fish/guestfish-actions.pod:4863
30410 #: ../fish/guestfish-actions.pod:4865
30413 " zgrep regex path\n"
30419 #: ../fish/guestfish-actions.pod:4873
30425 #: ../fish/guestfish-actions.pod:4875
30428 " zgrepi regex path\n"
30434 #: ../fish/guestfish-commands.pod:1
30440 #: ../fish/guestfish-commands.pod:3
30446 #: ../fish/guestfish-commands.pod:5
30449 " alloc filename size\n"
30455 #: ../fish/guestfish-commands.pod:7
30457 "This creates an empty (zeroed) file of the given size, and then adds so it "
30458 "can be further examined."
30463 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
30464 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
30469 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
30470 msgid "Size can be specified using standard suffixes, eg. C<1M>."
30475 #: ../fish/guestfish-commands.pod:14
30477 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
30478 "image, see L</PREPARED DISK IMAGES>."
30483 #: ../fish/guestfish-commands.pod:17
30489 #: ../fish/guestfish-commands.pod:19
30492 " copy-in local [local ...] /remotedir\n"
30498 #: ../fish/guestfish-commands.pod:21
30500 "C<copy-in> copies local files or directories recursively into the disk "
30501 "image, placing them in the directory called C</remotedir> (which must "
30502 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
30503 "other commands as necessary."
30508 #: ../fish/guestfish-commands.pod:26
30510 "Multiple local files and directories can be specified, but the last "
30511 "parameter must always be a remote directory. Wildcards cannot be used."
30516 #: ../fish/guestfish-commands.pod:30
30522 #: ../fish/guestfish-commands.pod:32
30525 " copy-out remote [remote ...] localdir\n"
30531 #: ../fish/guestfish-commands.pod:34
30533 "C<copy-out> copies remote files or directories recursively out of the disk "
30534 "image, placing them on the host disk in a local directory called C<localdir> "
30535 "(which must exist). This guestfish meta-command turns into a sequence of L</"
30536 "download>, L</tar-out> and other commands as necessary."
30541 #: ../fish/guestfish-commands.pod:40
30543 "Multiple remote files and directories can be specified, but the last "
30544 "parameter must always be a local directory. To download to the current "
30545 "directory, use C<.> as in:"
30550 #: ../fish/guestfish-commands.pod:44
30553 " copy-out /home .\n"
30559 #: ../fish/guestfish-commands.pod:46
30561 "Wildcards cannot be used in the ordinary command, but you can use them with "
30562 "the help of L</glob> like this:"
30567 #: ../fish/guestfish-commands.pod:49
30570 " glob copy-out /home/* .\n"
30576 #: ../fish/guestfish-commands.pod:51
30582 #: ../fish/guestfish-commands.pod:53
30585 " echo [params ...]\n"
30591 #: ../fish/guestfish-commands.pod:55
30592 msgid "This echos the parameters to the terminal."
30597 #: ../fish/guestfish-commands.pod:57
30603 #: ../fish/guestfish-commands.pod:59
30609 #: ../fish/guestfish-commands.pod:61
30615 #: ../fish/guestfish-commands.pod:63
30624 #: ../fish/guestfish-commands.pod:65
30626 "This is used to edit a file. It downloads the file, edits it locally using "
30627 "your editor, then uploads the result."
30632 #: ../fish/guestfish-commands.pod:68
30634 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
30635 "or C<emacs> you will get those corresponding editors."
30640 #: ../fish/guestfish-commands.pod:72
30646 #: ../fish/guestfish-commands.pod:74
30649 " glob command args...\n"
30655 #: ../fish/guestfish-commands.pod:76
30657 "Expand wildcards in any paths in the args list, and run C<command> "
30658 "repeatedly on each matching path."
30663 #: ../fish/guestfish-commands.pod:79
30664 msgid "See L</WILDCARDS AND GLOBBING>."
30669 #: ../fish/guestfish-commands.pod:81
30675 #: ../fish/guestfish-commands.pod:83
30678 " hexedit <filename|device>\n"
30679 " hexedit <filename|device> <max>\n"
30680 " hexedit <filename|device> <start> <max>\n"
30686 #: ../fish/guestfish-commands.pod:87
30688 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
30694 #: ../fish/guestfish-commands.pod:90
30696 "This command works by downloading potentially the whole file or device, "
30697 "editing it locally, then uploading it. If the file or device is large, you "
30698 "have to specify which part you wish to edit by using C<max> and/or C<start> "
30699 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
30700 "usual modifiers allowed such as C<1M> (1 megabyte)."
30705 #: ../fish/guestfish-commands.pod:97
30706 msgid "For example to edit the first few sectors of a disk you might do:"
30711 #: ../fish/guestfish-commands.pod:100
30714 " hexedit /dev/sda 1M\n"
30720 #: ../fish/guestfish-commands.pod:102
30722 "which would allow you to edit anywhere within the first megabyte of the disk."
30727 #: ../fish/guestfish-commands.pod:105
30728 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
30733 #: ../fish/guestfish-commands.pod:107
30736 " hexedit /dev/sda1 0x400 0x400\n"
30742 #: ../fish/guestfish-commands.pod:109
30743 msgid "(assuming the superblock is in the standard location)."
30748 #: ../fish/guestfish-commands.pod:111
30750 "This command requires the external L<hexedit(1)> program. You can specify "
30751 "another program to use by setting the C<HEXEDITOR> environment variable."
30756 #: ../fish/guestfish-commands.pod:115
30757 msgid "See also L</hexdump>."
30762 #: ../fish/guestfish-commands.pod:117
30768 #: ../fish/guestfish-commands.pod:119
30777 #: ../fish/guestfish-commands.pod:121
30779 "Change the local directory, ie. the current directory of guestfish itself."
30784 #: ../fish/guestfish-commands.pod:124
30785 msgid "Note that C<!cd> won't do what you might expect."
30790 #: ../fish/guestfish-commands.pod:126
30796 #: ../fish/guestfish-commands.pod:128
30802 #: ../fish/guestfish-commands.pod:130
30811 #: ../fish/guestfish-commands.pod:132
30812 msgid "Opens the manual page for guestfish."
30817 #: ../fish/guestfish-commands.pod:134
30823 #: ../fish/guestfish-commands.pod:136
30829 #: ../fish/guestfish-commands.pod:138
30838 #: ../fish/guestfish-commands.pod:140
30847 #: ../fish/guestfish-commands.pod:142
30848 msgid "This is used to view a file."
30853 #: ../fish/guestfish-commands.pod:144
30855 "The default viewer is C<$PAGER>. However if you use the alternate command "
30856 "C<less> you will get the C<less> command specifically."
30861 #: ../fish/guestfish-commands.pod:147
30867 #: ../fish/guestfish-commands.pod:149
30876 #: ../fish/guestfish-commands.pod:151
30878 "Close and reopen the libguestfs handle. It is not necessary to use this "
30879 "normally, because the handle is closed properly when guestfish exits. "
30880 "However this is occasionally useful for testing."
30885 #: ../fish/guestfish-commands.pod:155
30891 #: ../fish/guestfish-commands.pod:157
30894 " sparse filename size\n"
30900 #: ../fish/guestfish-commands.pod:159
30902 "This creates an empty sparse file of the given size, and then adds so it can "
30903 "be further examined."
30908 #: ../fish/guestfish-commands.pod:162
30910 "In all respects it works the same as the L</alloc> command, except that the "
30911 "image file is allocated sparsely, which means that disk blocks are not "
30912 "assigned to the file until they are needed. Sparse disk files only use "
30913 "space when written to, but they are slower and there is a danger you could "
30914 "run out of real disk space during a write operation."
30919 #: ../fish/guestfish-commands.pod:172
30925 #: ../fish/guestfish-commands.pod:174
30934 #: ../fish/guestfish-commands.pod:176
30936 "This command returns a list of the optional groups known to the daemon, and "
30937 "indicates which ones are supported by this build of the libguestfs appliance."
30942 #: ../fish/guestfish-commands.pod:180
30943 msgid "See also L<guestfs(3)/AVAILABILITY>."
30948 #: ../fish/guestfish-commands.pod:182
30954 #: ../fish/guestfish-commands.pod:184
30957 " time command args...\n"
30963 #: ../fish/guestfish-commands.pod:186
30965 "Run the command as usual, but print the elapsed time afterwards. This can "
30966 "be useful for benchmarking operations."
30971 #: ../test-tool/libguestfs-test-tool.pod:5
30972 msgid "libguestfs-test-tool - End user tests for libguestfs"
30977 #: ../test-tool/libguestfs-test-tool.pod:9
30980 " libguestfs-test-tool [--options]\n"
30986 #: ../test-tool/libguestfs-test-tool.pod:13
30988 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
30989 "and developers, to allow them to check basic libguestfs functionality is "
30990 "working. This is needed because libguestfs occasionally breaks for reasons "
30991 "beyond our control: usually because of changes in the underlying qemu or "
30992 "kernel packages, or the host environment."
30997 #: ../test-tool/libguestfs-test-tool.pod:20
30998 msgid "If you suspect a problem in libguestfs, then just run:"
31003 #: ../test-tool/libguestfs-test-tool.pod:22
31006 " libguestfs-test-tool\n"
31012 #: ../test-tool/libguestfs-test-tool.pod:24
31013 msgid "It will print lots of diagnostic messages."
31018 #: ../test-tool/libguestfs-test-tool.pod:26
31019 msgid "If it runs to completion successfully, you will see this near the end:"
31024 #: ../test-tool/libguestfs-test-tool.pod:28
31027 " ===== TEST FINISHED OK =====\n"
31033 #: ../test-tool/libguestfs-test-tool.pod:30
31034 msgid "and the test tool will exit with code 0."
31039 #: ../test-tool/libguestfs-test-tool.pod:32
31041 "If it fails (and/or exits with non-zero error code), please paste the "
31042 "B<complete, unedited> output of the test tool into a bug report. More "
31043 "information about reporting bugs can be found on the L<http://libguestfs.org/"
31049 #: ../test-tool/libguestfs-test-tool.pod:41
31055 #: ../test-tool/libguestfs-test-tool.pod:43
31056 msgid "Display short usage information and exit."
31061 #: ../test-tool/libguestfs-test-tool.pod:45
31062 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
31067 #: ../test-tool/libguestfs-test-tool.pod:47
31069 "Pass an alternate name for the helper program. libguestfs-test-tool will "
31070 "normally look in the C<$libexec> directory that was configured when the tool "
31076 #: ../test-tool/libguestfs-test-tool.pod:51
31077 msgid "I<--qemu qemu_binary>"
31082 #: ../test-tool/libguestfs-test-tool.pod:53
31084 "If you have downloaded another qemu binary, point this option at the full "
31085 "path of the binary to try it."
31090 #: ../test-tool/libguestfs-test-tool.pod:56
31091 msgid "I<--qemudir qemu_source_dir>"
31096 #: ../test-tool/libguestfs-test-tool.pod:58
31098 "If you have compiled qemu from source, point this option at the source "
31099 "directory to try it."
31104 #: ../test-tool/libguestfs-test-tool.pod:61
31105 msgid "I<--timeout N>"
31110 #: ../test-tool/libguestfs-test-tool.pod:63
31112 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
31113 "does not usually need to be adjusted unless your machine is very slow."
31118 #: ../test-tool/libguestfs-test-tool.pod:69
31119 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
31124 #: ../test-tool/libguestfs-test-tool.pod:71
31126 "If you have compiled another version of qemu from source and would like to "
31127 "try that, then you can use the I<--qemudir> option to point to the qemu "
31128 "source directory."
31133 #: ../test-tool/libguestfs-test-tool.pod:75
31135 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
31136 "option to point to the binary."
31141 #: ../test-tool/libguestfs-test-tool.pod:78
31143 "When using an alternate qemu with libguestfs, usually you would need to "
31144 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
31145 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
31146 "use either of the I<--qemudir> or I<--qemu> options."
31151 #: ../test-tool/libguestfs-test-tool.pod:85
31153 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
31154 "I<1> if there was an error."
31159 #: ../test-tool/libguestfs-test-tool.pod:92
31160 msgid "/usr/libexec/libguestfs-test-tool-helper"
31165 #: ../test-tool/libguestfs-test-tool.pod:94
31167 "This helper program is run inside the appliance and provides additional "
31173 #: ../test-tool/libguestfs-test-tool.pod:97
31174 msgid "/usr/bin/mkisofs"
31179 #: ../test-tool/libguestfs-test-tool.pod:99
31181 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
31182 "which is used as part of the tests."
31187 #: ../test-tool/libguestfs-test-tool.pod:106
31189 "For the full list of environment variables which may affect libguestfs, "
31190 "please see the L<guestfs(3)> manual page."
31195 #: ../test-tool/libguestfs-test-tool.pod:111
31196 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
31201 #: ../test-tool/libguestfs-test-tool.pod:121
31202 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
31207 #: ../fuse/guestmount.pod:5
31209 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
31214 #: ../fuse/guestmount.pod:9
31217 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
31223 #: ../fuse/guestmount.pod:11
31226 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
31232 #: ../fuse/guestmount.pod:13
31235 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
31241 #: ../fuse/guestmount.pod:17
31243 "You must I<not> use C<guestmount> in read-write mode on live virtual "
31244 "machines. If you do this, you risk disk corruption in the VM."
31249 #: ../fuse/guestmount.pod:22
31251 "The guestmount program can be used to mount virtual machine filesystems and "
31252 "other disk images on the host. It uses libguestfs for access to the guest "
31253 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
31254 "a mountable device."
31259 #: ../fuse/guestmount.pod:27
31261 "Along with other options, you have to give at least one device (I<-a> "
31262 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
31263 "option) or use the I<-i> inspection option. How this works is better "
31264 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
31270 #: ../fuse/guestmount.pod:33
31272 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
31273 "by you, and the filesystem will not be visible to any other users unless you "
31274 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
31275 "the filesystem, use the C<fusermount -u> command."
31280 #: ../fuse/guestmount.pod:41
31282 "For a typical Windows guest which has its main filesystem on the first "
31288 #: ../fuse/guestmount.pod:44
31291 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
31297 #: ../fuse/guestmount.pod:46
31299 "For a typical Linux guest which has a /boot filesystem on the first "
31300 "partition, and the root filesystem on a logical volume:"
31305 #: ../fuse/guestmount.pod:49
31308 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
31314 #: ../fuse/guestmount.pod:51
31315 msgid "To get libguestfs to detect guest mountpoints for you:"
31320 #: ../fuse/guestmount.pod:53
31323 " guestmount -a guest.img -i --ro /mnt\n"
31329 #: ../fuse/guestmount.pod:55
31330 msgid "For a libvirt guest called \"Guest\" you could do:"
31335 #: ../fuse/guestmount.pod:57
31338 " guestmount -d Guest -i --ro /mnt\n"
31344 #: ../fuse/guestmount.pod:59
31346 "If you don't know what filesystems are contained in a guest or disk image, "
31347 "use L<virt-filesystems(1)> first:"
31352 #: ../fuse/guestmount.pod:62
31355 " virt-filesystems MyGuest\n"
31361 #: ../fuse/guestmount.pod:64
31363 "If you want to trace the libguestfs calls but without excessive debugging "
31364 "information, we recommend:"
31369 #: ../fuse/guestmount.pod:67
31372 " guestmount [...] --trace /mnt\n"
31378 #: ../fuse/guestmount.pod:69
31379 msgid "If you want to debug the program, we recommend:"
31384 #: ../fuse/guestmount.pod:71
31387 " guestmount [...] --trace --verbose /mnt\n"
31393 #: ../fuse/guestmount.pod:77
31394 msgid "B<-a image> | B<--add image>"
31399 #: ../fuse/guestmount.pod:79
31400 msgid "Add a block device or virtual machine image."
31405 #: ../fuse/guestmount.pod:84
31406 msgid "B<-c URI> | B<--connect URI>"
31411 #: ../fuse/guestmount.pod:90
31412 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
31417 #: ../fuse/guestmount.pod:96
31418 msgid "B<--dir-cache-timeout N>"
31423 #: ../fuse/guestmount.pod:98
31425 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
31426 "seconds. The readdir cache [actually, there are several semi-independent "
31427 "caches] is populated after a readdir(2) call with the stat and extended "
31428 "attributes of the files in the directory, in anticipation that they will be "
31429 "requested soon after."
31434 #: ../fuse/guestmount.pod:104
31436 "There is also a different attribute cache implemented by FUSE (see the FUSE "
31437 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
31438 "requests, only cache existing ones."
31443 #: ../fuse/guestmount.pod:115
31444 msgid "B<--format=raw|qcow2|..> | B<--format>"
31449 #: ../fuse/guestmount.pod:122
31451 "If you have untrusted raw-format guest disk images, you should use this "
31452 "option to specify the disk format. This avoids a possible security problem "
31453 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
31454 "guestfs_add_drive_opts>."
31459 #: ../fuse/guestmount.pod:127
31460 msgid "B<--fuse-help>"
31465 #: ../fuse/guestmount.pod:129
31466 msgid "Display help on special FUSE options (see I<-o> below)."
31471 #: ../fuse/guestmount.pod:133
31472 msgid "Display brief help and exit."
31477 #: ../fuse/guestmount.pod:135
31478 msgid "B<-i> | B<--inspector>"
31483 #: ../fuse/guestmount.pod:151
31484 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
31489 #: ../fuse/guestmount.pod:153
31491 "Mount the named partition or logical volume on the given mountpoint B<in the "
31492 "guest> (this has nothing to do with mountpoints in the host)."
31497 #: ../fuse/guestmount.pod:156
31499 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
31500 "something on C</>."
31505 #: ../fuse/guestmount.pod:159
31506 msgid "B<-n> | B<--no-sync>"
31511 #: ../fuse/guestmount.pod:161
31513 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
31514 "unmounted. If you specify this option, then we don't attempt to sync the "
31515 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
31520 #: ../fuse/guestmount.pod:166
31521 msgid "B<-o option> | B<--option option>"
31526 #: ../fuse/guestmount.pod:168
31527 msgid "Pass extra options to FUSE."
31532 #: ../fuse/guestmount.pod:170
31534 "To get a list of all the extra options supported by FUSE, use the command "
31535 "below. Note that only the FUSE I<-o> options can be passed, and only some "
31536 "of them are a good idea."
31541 #: ../fuse/guestmount.pod:174
31544 " guestmount --fuse-help\n"
31550 #: ../fuse/guestmount.pod:176
31551 msgid "Some potentially useful FUSE options:"
31556 #: ../fuse/guestmount.pod:180
31557 msgid "B<-o allow_other>"
31562 #: ../fuse/guestmount.pod:182
31563 msgid "Allow other users to see the filesystem."
31568 #: ../fuse/guestmount.pod:184
31569 msgid "B<-o attr_timeout=N>"
31574 #: ../fuse/guestmount.pod:186
31575 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
31580 #: ../fuse/guestmount.pod:188
31581 msgid "B<-o kernel_cache>"
31586 #: ../fuse/guestmount.pod:190
31588 "Allow the kernel to cache files (reduces the number of reads that have to go "
31589 "through the L<guestfs(3)> API). This is generally a good idea if you can "
31590 "afford the extra memory usage."
31595 #: ../fuse/guestmount.pod:194
31596 msgid "B<-o uid=N> B<-o gid=N>"
31601 #: ../fuse/guestmount.pod:196
31603 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
31604 "the chosen values."
31609 #: ../fuse/guestmount.pod:201
31610 msgid "B<-r> | B<--ro>"
31615 #: ../fuse/guestmount.pod:203
31617 "Add devices and mount everything read-only. Also disallow writes and make "
31618 "the disk appear read-only to FUSE."
31623 #: ../fuse/guestmount.pod:206
31625 "This is highly recommended if you are not going to edit the guest disk. If "
31626 "the guest is running and this option is I<not> supplied, then there is a "
31627 "strong risk of disk corruption in the guest. We try to prevent this from "
31628 "happening, but it is not always possible."
31633 #: ../fuse/guestmount.pod:211
31634 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
31639 #: ../fuse/guestmount.pod:215
31640 msgid "Enable SELinux support for the guest."
31645 #: ../fuse/guestmount.pod:217
31646 msgid "B<-v> | B<--verbose>"
31651 #: ../fuse/guestmount.pod:219
31652 msgid "Enable verbose messages from underlying libguestfs."
31657 #: ../fuse/guestmount.pod:221
31658 msgid "B<-V> | B<--version>"
31663 #: ../fuse/guestmount.pod:223
31664 msgid "Display the program version and exit."
31669 #: ../fuse/guestmount.pod:225
31670 msgid "B<-w> | B<--rw>"
31675 #: ../fuse/guestmount.pod:227
31677 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
31678 "FOR READ AND WRITE>."
31683 #: ../fuse/guestmount.pod:230
31684 msgid "B<-x> | B<--trace>"
31689 #: ../fuse/guestmount.pod:232
31690 msgid "Trace libguestfs calls and entry into each FUSE function."
31695 #: ../fuse/guestmount.pod:234
31696 msgid "This also stops the daemon from forking into the background."
31701 #: ../fuse/guestmount.pod:240
31703 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
31704 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
31710 #: ../tools/virt-edit.pl:34
31711 msgid "virt-edit - Edit a file in a virtual machine"
31716 #: ../tools/virt-edit.pl:38
31719 " virt-edit [--options] domname file\n"
31725 #: ../tools/virt-edit.pl:40
31728 " virt-edit [--options] disk.img [disk.img ...] file\n"
31734 #: ../tools/virt-edit.pl:42
31737 " virt-edit [domname|disk.img] file -e 'expr'\n"
31743 #: ../tools/virt-edit.pl:46
31745 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
31746 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
31747 "doing this, but doesn't catch all cases."
31752 #: ../tools/virt-edit.pl:52
31754 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
31755 "the named virtual machine (or disk image)."
31760 #: ../tools/virt-edit.pl:55
31762 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
31763 "you should look at the L<guestfish(1)> tool."
31768 #: ../tools/virt-edit.pl:60
31769 msgid "Edit the named files interactively:"
31774 #: ../tools/virt-edit.pl:62
31777 " virt-edit mydomain /boot/grub/grub.conf\n"
31783 #: ../tools/virt-edit.pl:64
31786 " virt-edit mydomain /etc/passwd\n"
31792 #: ../tools/virt-edit.pl:66
31794 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
31795 "below). To change the init default level to 5:"
31800 #: ../tools/virt-edit.pl:70
31803 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
31809 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:106
31810 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113
31811 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
31812 msgid "Display brief help."
31817 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114
31818 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
31819 #: ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171
31820 #: ../tools/virt-list-partitions.pl:72
31821 msgid "Display version number and exit."
31826 #: ../tools/virt-edit.pl:96
31827 msgid "B<--backup extension> | B<-b extension>"
31832 #: ../tools/virt-edit.pl:98
31834 "Create a backup of the original file I<in the guest disk image>. The backup "
31835 "has the original filename with C<extension> added."
31840 #: ../tools/virt-edit.pl:101
31842 "Usually the first character of C<extension> would be a dot C<.> so you would "
31848 #: ../tools/virt-edit.pl:104
31851 " virt-edit -b .orig [etc]\n"
31857 #: ../tools/virt-edit.pl:106
31858 msgid "By default, no backup file is made."
31863 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128
31864 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127
31865 #: ../tools/virt-list-partitions.pl:78
31866 msgid "B<--connect URI> | B<-c URI>"
31871 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130
31872 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129
31873 #: ../tools/virt-list-partitions.pl:80
31875 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
31876 "to the default libvirt hypervisor."
31881 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133
31882 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132
31883 #: ../tools/virt-list-partitions.pl:83
31885 "If you specify guest block devices directly, then libvirt is not used at all."
31890 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140
31891 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
31892 #: ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
31893 msgid "B<--format> raw"
31898 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142
31899 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141
31900 #: ../tools/virt-list-partitions.pl:92
31902 "Specify the format of disk images given on the command line. If this is "
31903 "omitted then the format is autodetected from the content of the disk image."
31908 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146
31909 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145
31910 #: ../tools/virt-list-partitions.pl:96
31912 "If disk images are requested from libvirt, then this program asks libvirt "
31913 "for this information. In this case, the value of the format parameter is "
31919 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150
31920 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
31921 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149
31922 #: ../tools/virt-list-partitions.pl:100
31924 "If working with untrusted raw-format guest disk images, you should ensure "
31925 "the format is always specified."
31930 #: ../tools/virt-edit.pl:141
31931 msgid "B<--expr EXPR> | B<-e EXPR>"
31936 #: ../tools/virt-edit.pl:143
31938 "Instead of launching the external editor, non-interactively apply the Perl "
31939 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
31945 #: ../tools/virt-edit.pl:147
31947 "Be careful to properly quote the expression to prevent it from being altered "
31953 #: ../tools/virt-edit.pl:268
31954 msgid "NON-INTERACTIVE EDITING"
31959 #: ../tools/virt-edit.pl:270
31961 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
31962 "administrator can interactively edit the file."
31967 #: ../tools/virt-edit.pl:273
31969 "There are two ways also to use C<virt-edit> from scripts in order to make "
31970 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
31971 "like this, it's less error-prone to write scripts directly using the "
31972 "libguestfs API and Augeas for configuration file editing.)"
31977 #: ../tools/virt-edit.pl:279
31979 "The first method is to temporarily set C<$EDITOR> to any script or program "
31980 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
31981 "update C<tmpfile> in place however it likes."
31986 #: ../tools/virt-edit.pl:283
31988 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
31989 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
31990 "instances of C<foo> with C<bar> in a file:"
31995 #: ../tools/virt-edit.pl:287
31998 " virt-edit domname filename -e 's/foo/bar/'\n"
32004 #: ../tools/virt-edit.pl:289
32006 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
32007 "For example to delete root's password you could do:"
32012 #: ../tools/virt-edit.pl:292
32015 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
32021 #: ../tools/virt-edit.pl:294
32023 "What really happens is that the snippet is evaluated as a Perl expression "
32024 "for each line of the file. The line, including the final C<\\n>, is passed "
32025 "in C<$_> and the expression should update C<$_> or leave it unchanged."
32030 #: ../tools/virt-edit.pl:299
32032 "To delete a line, set C<$_> to the empty string. For example, to delete the "
32033 "C<apache> user account from the password file you can do:"
32038 #: ../tools/virt-edit.pl:302
32041 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
32047 #: ../tools/virt-edit.pl:304
32049 "To insert a line, prepend or append it to C<$_>. However appending lines to "
32050 "the end of the file is rather difficult this way since there is no concept "
32051 "of \"last line of the file\" - your expression just doesn't get called "
32052 "again. You might want to use the first method (setting C<$EDITOR>) if you "
32058 #: ../tools/virt-edit.pl:310
32060 "The variable C<$lineno> contains the current line number. As is "
32061 "traditional, the first line in the file is number C<1>."
32066 #: ../tools/virt-edit.pl:313
32068 "The return value from the expression is ignored, but the expression may call "
32069 "C<die> in order to abort the whole program, leaving the original file "
32075 #: ../tools/virt-edit.pl:317
32077 "Remember when matching the end of a line that C<$_> may contain the final C<"
32078 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
32079 "newline then neither of these. Thus to match or substitute some text at the "
32080 "end of a line, use this regular expression:"
32085 #: ../tools/virt-edit.pl:322
32088 " /some text(\\r?\\n)?$/\n"
32094 #: ../tools/virt-edit.pl:324
32096 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
32097 "$_> itself (since that would remove all newlines from the file):"
32102 #: ../tools/virt-edit.pl:328
32105 " my $m = $_; chomp $m; $m =~ /some text$/\n"
32111 #: ../tools/virt-edit.pl:334
32117 #: ../tools/virt-edit.pl:336
32119 "If set, this string is used as the editor. It may contain arguments, eg. C<"
32125 #: ../tools/virt-edit.pl:339
32126 msgid "If not set, C<vi> is used."
32131 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559
32132 #: ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182
32133 #: ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:527
32134 #: ../tools/virt-list-partitions.pl:250
32135 msgid "SHELL QUOTING"
32140 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567
32141 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
32142 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:529
32143 #: ../tools/virt-list-partitions.pl:252
32145 "Libvirt guest names can contain arbitrary characters, some of which have "
32146 "meaning to the shell such as C<#> and space. You may need to quote or "
32147 "escape these characters on the command line. See the shell manual page L<sh"
32148 "(1)> for details."
32152 #: ../tools/virt-edit.pl:352
32154 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
32155 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
32156 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
32161 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:598
32162 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
32163 #: ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:559
32164 #: ../tools/virt-list-partitions.pl:269
32170 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:600
32171 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
32172 #: ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:561
32173 #: ../tools/virt-list-partitions.pl:271
32174 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
32179 #: ../tools/virt-edit.pl:370 ../tools/virt-list-partitions.pl:275
32180 msgid "Copyright (C) 2009-2010 Red Hat Inc."
32185 #: ../tools/virt-win-reg.pl:37
32187 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
32192 #: ../tools/virt-win-reg.pl:41
32195 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
32201 #: ../tools/virt-win-reg.pl:43
32204 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
32210 #: ../tools/virt-win-reg.pl:45
32213 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
32219 #: ../tools/virt-win-reg.pl:47
32222 " virt-win-reg --merge domname [input.reg ...]\n"
32228 #: ../tools/virt-win-reg.pl:49
32231 " virt-win-reg [--options] disk.img ... # instead of domname\n"
32237 #: ../tools/virt-win-reg.pl:53
32239 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
32240 "virtual machines. If you do this, you I<will> get irreversible disk "
32241 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
32242 "but doesn't catch all cases."
32247 #: ../tools/virt-win-reg.pl:58
32249 "Modifying the Windows Registry is an inherently risky operation. The format "
32250 "is deliberately obscure and undocumented, and Registry changes can leave the "
32251 "system unbootable. Therefore when using the C<--merge> option, make sure "
32252 "you have a reliable backup first."
32257 #: ../tools/virt-win-reg.pl:65
32259 "This program can export and merge Windows Registry entries from a Windows "
32265 #: ../tools/virt-win-reg.pl:68
32267 "The first parameter is the libvirt guest name or the raw disk image of a "
32273 #: ../tools/virt-win-reg.pl:71
32275 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
32276 "exported (recursively). For example:"
32281 #: ../tools/virt-win-reg.pl:74
32284 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
32290 #: ../tools/virt-win-reg.pl:76
32292 "You can also display single values from within registry keys, for example:"
32297 #: ../tools/virt-win-reg.pl:79
32300 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
32301 " $ virt-win-reg Windows7 $cvkey ProductName\n"
32302 " Windows 7 Enterprise\n"
32308 #: ../tools/virt-win-reg.pl:83
32310 "With C<--merge>, you can merge a textual regedit file into the Windows "
32316 #: ../tools/virt-win-reg.pl:86
32319 " $ virt-win-reg --merge Windows7 changes.reg\n"
32325 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
32331 #: ../tools/virt-win-reg.pl:90
32333 "This program is only meant for simple access to the registry. If you want "
32334 "to do complicated things with the registry, we suggest you download the "
32335 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
32336 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
32337 "L<hivexregedit(1)>."
32342 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
32348 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
32349 msgid "Enable debugging messages."
32354 #: ../tools/virt-win-reg.pl:157
32360 #: ../tools/virt-win-reg.pl:159
32362 "In merge mode, this merges a textual regedit file into the Windows Registry "
32363 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
32364 "displays or exports Registry entries instead."
32369 #: ../tools/virt-win-reg.pl:163
32371 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
32372 "result in disk corruption. However exporting (without this flag) is always "
32378 #: ../tools/virt-win-reg.pl:171
32379 msgid "B<--encoding> UTF-16LE|ASCII"
32384 #: ../tools/virt-win-reg.pl:173
32386 "When merging (only), you may need to specify the encoding for strings to be "
32387 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
32388 "(3)/ENCODING STRINGS>."
32393 #: ../tools/virt-win-reg.pl:177
32395 "The default is to use UTF-16LE, which should work with recent versions of "
32401 #: ../tools/virt-win-reg.pl:402
32402 msgid "SUPPORTED SYSTEMS"
32407 #: ../tools/virt-win-reg.pl:404
32409 "The program currently supports Windows NT-derived guests starting with "
32410 "Windows XP through to at least Windows 7."
32415 #: ../tools/virt-win-reg.pl:407
32417 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
32418 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
32419 "and C<HKEY_USERS\\.DEFAULT>."
32424 #: ../tools/virt-win-reg.pl:411
32426 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
32432 #: ../tools/virt-win-reg.pl:414
32434 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
32440 #: ../tools/virt-win-reg.pl:417
32446 #: ../tools/virt-win-reg.pl:419
32448 "C<virt-win-reg> expects that regedit files have already been reencoded in "
32449 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
32450 "style line endings. Since Windows regedit files are often in UTF-16LE with "
32451 "Windows-style line endings, you may need to reencode the whole file before "
32452 "or after processing."
32457 #: ../tools/virt-win-reg.pl:425
32459 "To reencode a file from Windows format to Linux (before processing it with "
32460 "the C<--merge> option), you would do something like this:"
32465 #: ../tools/virt-win-reg.pl:428
32468 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
32474 #: ../tools/virt-win-reg.pl:430
32476 "To go in the opposite direction, after exporting and before sending the file "
32477 "to a Windows user, do something like this:"
32482 #: ../tools/virt-win-reg.pl:433
32485 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
32491 #: ../tools/virt-win-reg.pl:435
32492 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
32497 #: ../tools/virt-win-reg.pl:437
32499 "If you are unsure about the current encoding, use the L<file(1)> command. "
32500 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
32501 "style (CRLF) line endings, like this:"
32506 #: ../tools/virt-win-reg.pl:441
32509 " $ file software.reg\n"
32510 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
32511 " with CRLF line terminators\n"
32517 #: ../tools/virt-win-reg.pl:445
32518 msgid "This file would need conversion before you could C<--merge> it."
32523 #: ../tools/virt-win-reg.pl:447
32524 msgid "CurrentControlSet etc."
32529 #: ../tools/virt-win-reg.pl:449
32531 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
32532 "Registry at the level of the hive file, and therefore you cannot modify "
32538 #: ../tools/virt-win-reg.pl:453
32540 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
32541 "circumstances it might refer to another control set. The way to find out is "
32542 "to look at the C<HKLM\\SYSTEM\\Select> key:"
32547 #: ../tools/virt-win-reg.pl:457
32550 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
32551 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
32552 " \"Current\"=dword:00000001\n"
32553 " \"Default\"=dword:00000001\n"
32554 " \"Failed\"=dword:00000000\n"
32555 " \"LastKnownGood\"=dword:00000002\n"
32561 #: ../tools/virt-win-reg.pl:464
32562 msgid "\"Current\" is the one which Windows will choose when it boots."
32567 #: ../tools/virt-win-reg.pl:466
32569 "Similarly, other C<Current...> keys in the path may need to be replaced."
32574 #: ../tools/virt-win-reg.pl:469
32575 msgid "WINDOWS TIPS"
32580 #: ../tools/virt-win-reg.pl:471
32582 "Note that some of these tips modify the guest disk image. The guest I<must> "
32583 "be shut off, else you will get disk corruption."
32588 #: ../tools/virt-win-reg.pl:474
32589 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
32594 #: ../tools/virt-win-reg.pl:476
32596 "Prepare a DOS batch script, VBScript or executable. Upload this using "
32597 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
32598 "is uploaded into C<C:\\>:"
32603 #: ../tools/virt-win-reg.pl:480
32606 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
32612 #: ../tools/virt-win-reg.pl:482
32613 msgid "Prepare a regedit file containing the registry change:"
32618 #: ../tools/virt-win-reg.pl:484
32621 " cat > test.reg <<'EOF'\n"
32622 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
32623 " \"Test\"=\"c:\\\\test.bat\"\n"
32630 #: ../tools/virt-win-reg.pl:489
32632 "In this example we use the key C<RunOnce> which means that the script will "
32633 "run precisely once when the first user logs in. If you want it to run every "
32634 "time a user logs in, replace C<RunOnce> with C<Run>."
32639 #: ../tools/virt-win-reg.pl:493
32640 msgid "Now update the registry:"
32645 #: ../tools/virt-win-reg.pl:495
32648 " virt-win-reg --merge WindowsGuest test.reg\n"
32654 #: ../tools/virt-win-reg.pl:497
32655 msgid "INSTALLING A SERVICE"
32660 #: ../tools/virt-win-reg.pl:499
32662 "This section assumes you are familiar with Windows services, and you either "
32663 "have a program which handles the Windows Service Control Protocol directly "
32664 "or you want to run any program using a service wrapper like SrvAny or the "
32670 #: ../tools/virt-win-reg.pl:504
32672 "First upload the program and optionally the service wrapper. In this case "
32673 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
32678 #: ../tools/virt-win-reg.pl:508
32681 " guestfish -i -d WindowsGuest <<EOF\n"
32682 " upload rhsrvany.exe /rhsrvany.exe\n"
32683 " upload test.exe /test.exe\n"
32690 #: ../tools/virt-win-reg.pl:513
32692 "Prepare a regedit file containing the registry changes. In this example, "
32693 "the first registry change is needed for the service itself or the service "
32694 "wrapper (if used). The second registry change is only needed because I am "
32695 "using the RHSrvAny service wrapper."
32700 #: ../tools/virt-win-reg.pl:518
32703 " cat > service.reg <<'EOF'\n"
32704 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
32705 " \"Type\"=dword:00000010\n"
32706 " \"Start\"=dword:00000002\n"
32707 " \"ErrorControl\"=dword:00000001\n"
32708 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
32709 " \"DisplayName\"=\"RHSrvAny\"\n"
32710 " \"ObjectName\"=\"NetworkService\"\n"
32716 #: ../tools/virt-win-reg.pl:527
32719 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
32720 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
32721 " \"PWD\"=\"c:\\\\Temp\"\n"
32728 #: ../tools/virt-win-reg.pl:538
32730 "For use of C<ControlSet001> see the section above in this manual page. You "
32731 "may need to adjust this according to the control set that is in use by the "
32737 #: ../tools/virt-win-reg.pl:544
32739 "C<\"ObjectName\"> controls the privileges that the service will have. An "
32740 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
32741 "privileged account."
32746 #: ../tools/virt-win-reg.pl:550
32748 "For the meaning of the magic numbers, see this Microsoft KB article: "
32749 "L<http://support.microsoft.com/kb/103000>."
32754 #: ../tools/virt-win-reg.pl:555
32755 msgid "Update the registry:"
32760 #: ../tools/virt-win-reg.pl:557
32763 " virt-win-reg --merge WindowsGuest service.reg\n"
32769 #: ../tools/virt-win-reg.pl:561
32771 "Be careful when passing parameters containing C<\\> (backslash) in the "
32772 "shell. Usually you will have to use 'single quotes' or double backslashes "
32773 "(but not both) to protect them from the shell."
32778 #: ../tools/virt-win-reg.pl:565
32779 msgid "Paths and value names are case-insensitive."
32784 #: ../tools/virt-win-reg.pl:574
32786 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
32787 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
32788 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
32793 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:550
32795 "When reporting bugs, please enable debugging and capture the I<complete> "
32801 #: ../tools/virt-win-reg.pl:592
32804 " export LIBGUESTFS_DEBUG=1\n"
32805 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
32811 #: ../tools/virt-win-reg.pl:595
32813 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
32819 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1510
32820 #: ../tools/virt-make-fs.pl:565
32821 msgid "Copyright (C) 2010 Red Hat Inc."
32826 #: ../tools/virt-resize.pl:42
32827 msgid "virt-resize - Resize a virtual machine disk"
32832 #: ../tools/virt-resize.pl:46
32835 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
32836 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
32837 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
32843 #: ../tools/virt-resize.pl:52
32845 "Virt-resize is a tool which can resize a virtual machine disk, making it "
32846 "larger or smaller overall, and resizing or deleting any partitions contained "
32852 #: ../tools/virt-resize.pl:56
32854 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
32855 "not> be used on live virtual machines - for consistent results, shut the "
32856 "virtual machine down before resizing it."
32861 #: ../tools/virt-resize.pl:60
32863 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
32864 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
32869 #: ../tools/virt-resize.pl:66
32871 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
32872 "fill the extra 5GB of space."
32876 #: ../tools/virt-resize.pl:69
32879 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
32880 " virt-filesystems --long -h --all -a olddisk\n"
32881 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
32882 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
32888 #: ../tools/virt-resize.pl:74
32890 "As above, but make the /boot partition 200MB bigger, while giving the "
32891 "remaining space to /dev/sda2:"
32896 #: ../tools/virt-resize.pl:77
32899 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
32905 #: ../tools/virt-resize.pl:79
32906 msgid "As above, but the output format will be uncompressed qcow2:"
32911 #: ../tools/virt-resize.pl:81
32914 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
32915 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
32921 #: ../tools/virt-resize.pl:84
32922 msgid "DETAILED USAGE"
32927 #: ../tools/virt-resize.pl:86
32928 msgid "EXPANDING A VIRTUAL MACHINE DISK"
32933 #: ../tools/virt-resize.pl:90
32934 msgid "1. Shut down the virtual machine"
32939 #: ../tools/virt-resize.pl:92
32940 msgid "2. Locate input disk image"
32945 #: ../tools/virt-resize.pl:94
32947 "Locate the input disk image (ie. the file or device on the host containing "
32948 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
32949 "dumpxml> like this to find the disk image name:"
32954 #: ../tools/virt-resize.pl:98
32957 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
32958 " Found 1 nodes:\n"
32960 " <source dev=\"/dev/vg/lv_guest\" />\n"
32966 #: ../tools/virt-resize.pl:103
32967 msgid "3. Look at current sizing"
32972 #: ../tools/virt-resize.pl:105
32973 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
32978 #: ../tools/virt-resize.pl:108
32981 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
32982 " Name Type Size Parent\n"
32983 " /dev/sda1 partition 101M /dev/sda\n"
32984 " /dev/sda2 partition 7.9G /dev/sda\n"
32985 " /dev/sda device 8.0G -\n"
32991 #: ../tools/virt-resize.pl:114
32993 "(This example is a virtual machine with an 8 GB disk which we would like to "
32994 "expand up to 10 GB)."
32999 #: ../tools/virt-resize.pl:117
33000 msgid "4. Create output disk"
33005 #: ../tools/virt-resize.pl:119
33007 "Virt-resize cannot do in-place disk modifications. You have to have space "
33008 "to store the resized output disk."
33013 #: ../tools/virt-resize.pl:122
33015 "To store the resized disk image in a file, create a file of a suitable size:"
33020 #: ../tools/virt-resize.pl:125
33023 " # rm -f outdisk\n"
33024 " # truncate -s 10G outdisk\n"
33030 #: ../tools/virt-resize.pl:128
33031 msgid "Or use L<lvcreate(1)> to create a logical volume:"
33036 #: ../tools/virt-resize.pl:130
33039 " # lvcreate -L 10G -n lv_name vg_name\n"
33045 #: ../tools/virt-resize.pl:132
33046 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
33051 #: ../tools/virt-resize.pl:134
33054 " # virsh pool-list\n"
33055 " # virsh vol-create-as poolname newvol 10G\n"
33061 #: ../tools/virt-resize.pl:137
33067 #: ../tools/virt-resize.pl:139
33069 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
33070 "file) and the output disk. The output disk is the one created in the "
33076 #: ../tools/virt-resize.pl:143
33079 " # virt-resize indisk outdisk\n"
33085 #: ../tools/virt-resize.pl:145
33087 "This command just copies disk image C<indisk> to disk image C<outdisk> "
33088 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
33089 "larger, then an extra, empty partition is created at the end of the disk "
33090 "covering the extra space. If C<outdisk> is smaller, then it will give an "
33096 #: ../tools/virt-resize.pl:151
33098 "More realistically you'd want to expand existing partitions in the disk "
33099 "image by passing extra options (for the full list see the L</OPTIONS> "
33105 #: ../tools/virt-resize.pl:155
33107 "L</--expand> is the most useful option. It expands the named partition "
33108 "within the disk to fill any extra space:"
33113 #: ../tools/virt-resize.pl:158
33116 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
33122 #: ../tools/virt-resize.pl:160
33124 "(In this case, an extra partition is I<not> created at the end of the disk, "
33125 "because there will be no unused space)."
33130 #: ../tools/virt-resize.pl:163
33132 "L</--resize> is the other commonly used option. The following would "
33133 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
33134 "rest of the available space:"
33139 #: ../tools/virt-resize.pl:167
33142 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
33143 " indisk outdisk\n"
33149 #: ../tools/virt-resize.pl:170
33151 "If the expanded partition in the image contains a filesystem or LVM PV, then "
33152 "if virt-resize knows how, it will resize the contents, the equivalent of "
33153 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
33154 ">. However virt-resize does not know how to resize some filesystems, so you "
33155 "would have to online resize them after booting the guest."
33160 #: ../tools/virt-resize.pl:177
33161 msgid "Other options are covered below."
33166 #: ../tools/virt-resize.pl:179
33172 #: ../tools/virt-resize.pl:181
33173 msgid "Thoroughly test the new disk image I<before> discarding the old one."
33178 #: ../tools/virt-resize.pl:183
33179 msgid "If you are using libvirt, edit the XML to point at the new disk:"
33184 #: ../tools/virt-resize.pl:185
33187 " # virsh edit guestname\n"
33193 #: ../tools/virt-resize.pl:187
33195 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
33196 "html#elementsDisks>"
33201 #: ../tools/virt-resize.pl:190
33202 msgid "Then start up the domain with the new, resized disk:"
33207 #: ../tools/virt-resize.pl:192
33210 " # virsh start guestname\n"
33216 #: ../tools/virt-resize.pl:194
33218 "and check that it still works. See also the L</NOTES> section below for "
33219 "additional information."
33224 #: ../tools/virt-resize.pl:197
33225 msgid "7. Resize LVs etc inside the guest"
33230 #: ../tools/virt-resize.pl:199
33231 msgid "(This can also be done offline using L<guestfish(1)>)"
33236 #: ../tools/virt-resize.pl:201
33238 "Once the guest has booted you should see the new space available, at least "
33239 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
33240 "may need to resize LVs inside PVs, and also resize filesystem types that "
33241 "virt-resize does not know how to expand."
33246 #: ../tools/virt-resize.pl:208
33247 msgid "SHRINKING A VIRTUAL MACHINE DISK"
33252 #: ../tools/virt-resize.pl:210
33254 "Shrinking is somewhat more complex than expanding, and only an overview is "
33260 #: ../tools/virt-resize.pl:213
33262 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
33263 "filesystems). The user has to shrink content before passing the disk image "
33264 "to virt-resize, and virt-resize will check that the content has been shrunk "
33270 #: ../tools/virt-resize.pl:218
33271 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
33276 #: ../tools/virt-resize.pl:220
33278 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
33279 "steps 3 and 4 above to allocate a new disk image."
33284 #: ../tools/virt-resize.pl:223
33286 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
33291 #: ../tools/virt-resize.pl:226
33292 msgid "IGNORING OR DELETING PARTITIONS"
33297 #: ../tools/virt-resize.pl:228
33299 "virt-resize also gives a convenient way to ignore or delete partitions when "
33300 "copying from the input disk to the output disk. Ignoring a partition speeds "
33301 "up the copy where you don't care about the existing contents of a "
33302 "partition. Deleting a partition removes it completely, but note that it "
33303 "also renumbers any partitions after the one which is deleted, which can "
33304 "leave some guests unbootable."
33309 #: ../tools/virt-resize.pl:235
33310 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
33315 #: ../tools/virt-resize.pl:237
33317 "If the input disk is in qcow2 format, then you may prefer that the output is "
33318 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
33319 "the fly. The output format is simply determined by the format of the empty "
33320 "output container that you provide. Thus to create qcow2 output, use:"
33325 #: ../tools/virt-resize.pl:243
33328 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
33334 #: ../tools/virt-resize.pl:245
33335 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
33340 #: ../tools/virt-resize.pl:247
33341 msgid "Similarly, to get non-sparse raw output use:"
33346 #: ../tools/virt-resize.pl:249
33349 " fallocate -l size outdisk\n"
33355 #: ../tools/virt-resize.pl:251
33357 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
33358 "dev/zero of=outdisk bs=1M count=..>)"
33363 #: ../tools/virt-resize.pl:264
33364 msgid "Display help."
33369 #: ../tools/virt-resize.pl:278
33370 msgid "B<--resize part=size>"
33375 #: ../tools/virt-resize.pl:280
33377 "Resize the named partition (expanding or shrinking it) so that it has the "
33383 #: ../tools/virt-resize.pl:283
33385 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
33386 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
33387 "Exabytes; or as a percentage of the current size; or as a relative number or "
33388 "percentage. For example:"
33393 #: ../tools/virt-resize.pl:288
33396 " --resize /dev/sda2=10G\n"
33402 #: ../tools/virt-resize.pl:290
33405 " --resize /dev/sda4=90%\n"
33411 #: ../tools/virt-resize.pl:292
33414 " --resize /dev/sda2=+1G\n"
33420 #: ../tools/virt-resize.pl:294
33423 " --resize /dev/sda2=-200M\n"
33429 #: ../tools/virt-resize.pl:296
33432 " --resize /dev/sda1=+128K\n"
33438 #: ../tools/virt-resize.pl:298
33441 " --resize /dev/sda1=+10%\n"
33447 #: ../tools/virt-resize.pl:300
33450 " --resize /dev/sda1=-10%\n"
33456 #: ../tools/virt-resize.pl:302
33458 "You can increase the size of any partition. Virt-resize will expand the "
33459 "direct content of the partition if it knows how (see C<--expand> below)."
33464 #: ../tools/virt-resize.pl:306
33466 "You can only I<decrease> the size of partitions that contain filesystems or "
33467 "PVs which have already been shrunk. Virt-resize will check this has been "
33468 "done before proceeding, or else will print an error (see also C<--resize-"
33474 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
33475 #: ../tools/virt-resize.pl:420
33476 msgid "You can give this option multiple times."
33481 #: ../tools/virt-resize.pl:317
33482 msgid "B<--resize-force part=size>"
33487 #: ../tools/virt-resize.pl:319
33489 "This is the same as C<--resize> except that it will let you decrease the "
33490 "size of any partition. Generally this means you will lose any data which "
33491 "was at the end of the partition you shrink, but you may not care about that "
33492 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
33493 "as a swap partition)."
33498 #: ../tools/virt-resize.pl:325
33499 msgid "See also the C<--ignore> option."
33504 #: ../tools/virt-resize.pl:331
33505 msgid "B<--expand part>"
33510 #: ../tools/virt-resize.pl:333
33512 "Expand the named partition so it uses up all extra space (space left over "
33513 "after any other resize changes that you request have been done)."
33518 #: ../tools/virt-resize.pl:336
33520 "If virt-resize knows how, it will expand the direct content of the "
33521 "partition. For example, if the partition is an LVM PV, it will expand the "
33522 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
33523 "content it doesn't know about alone."
33528 #: ../tools/virt-resize.pl:341
33529 msgid "Currently virt-resize can resize:"
33534 #: ../tools/virt-resize.pl:347
33536 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
33542 #: ../tools/virt-resize.pl:352
33544 "NTFS filesystems contained directly in a partition, if libguestfs was "
33545 "compiled with support for NTFS."
33550 #: ../tools/virt-resize.pl:355
33552 "The filesystem must have been shut down consistently last time it was used. "
33553 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
33554 "consistency check, so at the first boot after resizing Windows will check "
33560 #: ../tools/virt-resize.pl:362
33562 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
33563 "inside the PV, but see the C<--LV-expand> option. The user could also "
33564 "resize LVs as desired after boot."
33569 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
33570 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
33575 #: ../tools/virt-resize.pl:374
33576 msgid "B<--shrink part>"
33581 #: ../tools/virt-resize.pl:376
33583 "Shrink the named partition until the overall disk image fits in the "
33584 "destination. The named partition B<must> contain a filesystem or PV which "
33585 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
33586 "online tools). Virt-resize will check this and give an error if it has not "
33592 #: ../tools/virt-resize.pl:382
33594 "The amount by which the overall disk must be shrunk (after carrying out all "
33595 "other operations requested by the user) is called the \"deficit\". For "
33596 "example, a straight copy (assume no other operations) from a 5GB disk image "
33597 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
33598 "would give an error unless the user specified a partition to shrink and that "
33599 "partition had more than a gigabyte of free space."
33604 #: ../tools/virt-resize.pl:396
33605 msgid "B<--ignore part>"
33610 #: ../tools/virt-resize.pl:398
33612 "Ignore the named partition. Effectively this means the partition is "
33613 "allocated on the destination disk, but the content is not copied across from "
33614 "the source disk. The content of the partition will be blank (all zero "
33620 #: ../tools/virt-resize.pl:409
33621 msgid "B<--delete part>"
33626 #: ../tools/virt-resize.pl:411
33628 "Delete the named partition. It would be more accurate to describe this as "
33629 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
33630 "the original disk image is left intact."
33635 #: ../tools/virt-resize.pl:415
33637 "Note that when you delete a partition, then anything contained in the "
33638 "partition is also deleted. Furthermore, this causes any partitions that "
33639 "come after to be I<renumbered>, which can easily make your guest unbootable."
33644 #: ../tools/virt-resize.pl:426
33645 msgid "B<--LV-expand logvol>"
33650 #: ../tools/virt-resize.pl:428
33652 "This takes the logical volume and, as a final step, expands it to fill all "
33653 "the space available in its volume group. A typical usage, assuming a Linux "
33654 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
33655 "lv_root> would be:"
33660 #: ../tools/virt-resize.pl:433
33663 " virt-resize indisk outdisk \\\n"
33664 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
33670 #: ../tools/virt-resize.pl:436
33672 "This would first expand the partition (and PV), and then expand the root "
33673 "device to fill the extra space in the PV."
33678 #: ../tools/virt-resize.pl:439
33680 "The contents of the LV are also resized if virt-resize knows how to do "
33681 "that. You can stop virt-resize from trying to expand the content by using "
33682 "the option C<--no-expand-content>."
33687 #: ../tools/virt-resize.pl:443
33688 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
33693 #: ../tools/virt-resize.pl:446
33695 "You can give this option multiple times, I<but> it doesn't make sense to do "
33696 "this unless the logical volumes you specify are all in different volume "
33702 #: ../tools/virt-resize.pl:454
33703 msgid "B<--no-copy-boot-loader>"
33708 #: ../tools/virt-resize.pl:456
33710 "By default, virt-resize copies over some sectors at the start of the disk "
33711 "(up to the beginning of the first partition). Commonly these sectors "
33712 "contain the Master Boot Record (MBR) and the boot loader, and are required "
33713 "in order for the guest to boot correctly."
33718 #: ../tools/virt-resize.pl:461
33720 "If you specify this flag, then this initial copy is not done. You may need "
33721 "to reinstall the boot loader in this case."
33726 #: ../tools/virt-resize.pl:469
33727 msgid "B<--no-extra-partition>"
33732 #: ../tools/virt-resize.pl:471
33734 "By default, virt-resize creates an extra partition if there is any extra, "
33735 "unused space after all resizing has happened. Use this option to prevent "
33736 "the extra partition from being created. If you do this then the extra space "
33737 "will be inaccessible until you run fdisk, parted, or some other partitioning "
33738 "tool in the guest."
33743 #: ../tools/virt-resize.pl:477
33745 "Note that if the surplus space is smaller than 10 MB, no extra partition "
33751 #: ../tools/virt-resize.pl:484
33752 msgid "B<--no-expand-content>"
33757 #: ../tools/virt-resize.pl:486
33759 "By default, virt-resize will try to expand the direct contents of "
33760 "partitions, if it knows how (see C<--expand> option above)."
33765 #: ../tools/virt-resize.pl:489
33767 "If you give the C<--no-expand-content> option then virt-resize will not "
33773 #: ../tools/virt-resize.pl:496
33774 msgid "B<-d> | B<--debug>"
33779 #: ../tools/virt-resize.pl:504
33780 msgid "B<-n> | B<--dryrun>"
33785 #: ../tools/virt-resize.pl:506
33786 msgid "Print a summary of what would be done, but don't do anything."
33791 #: ../tools/virt-resize.pl:512
33792 msgid "B<-q> | B<--quiet>"
33797 #: ../tools/virt-resize.pl:514
33798 msgid "Don't print the summary."
33803 #: ../tools/virt-resize.pl:522
33805 "Specify the format of the input disk image. If this flag is not given then "
33806 "it is auto-detected from the image itself."
33811 #: ../tools/virt-resize.pl:528
33813 "Note that this option I<does not> affect the output format. See L</QCOW2 "
33814 "AND NON-SPARSE RAW FORMATS>."
33819 #: ../tools/virt-resize.pl:535
33820 msgid "B<--output-format> raw"
33825 #: ../tools/virt-resize.pl:537
33827 "Specify the format of the output disk image. If this flag is not given then "
33828 "it is auto-detected from the image itself."
33833 #: ../tools/virt-resize.pl:543
33835 "Note that you still need to create the output disk with the right format. "
33836 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
33841 #: ../tools/virt-resize.pl:1419
33847 #: ../tools/virt-resize.pl:1421
33848 msgid "\"Partition 1 does not end on cylinder boundary.\""
33853 #: ../tools/virt-resize.pl:1423
33855 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
33856 "means the partitions will not be aligned to the ancient CHS geometry. "
33857 "However CHS geometry is meaningless for disks manufactured since the early "
33858 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
33859 "cylinders is not required by any modern operating system."
33864 #: ../tools/virt-resize.pl:1430
33865 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
33870 #: ../tools/virt-resize.pl:1432
33872 "In Windows Vista and later versions, Microsoft switched to using a separate "
33873 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
33874 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
33875 "the boot partition. Doing so seems to break the guest completely. However "
33876 "expanding the second partition (ie. C: drive) should work."
33881 #: ../tools/virt-resize.pl:1439
33883 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
33884 "NTFS partitions have been expanded. This is just a safety check and (unless "
33885 "it find errors) is nothing to worry about."
33890 #: ../tools/virt-resize.pl:1443
33891 msgid "GUEST BOOT STUCK AT \"GRUB\""
33896 #: ../tools/virt-resize.pl:1445
33898 "If a Linux guest does not boot after resizing, and the boot is stuck after "
33899 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
33900 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
33901 "although we think is to do with partition alignment."
33906 #: ../tools/virt-resize.pl:1450
33909 " guestfish -i -a newdisk\n"
33910 " ><fs> cat /boot/grub/device.map\n"
33911 " # check the contents of this file are sensible or\n"
33912 " # edit the file if necessary\n"
33913 " ><fs> grub-install / /dev/vda\n"
33920 #: ../tools/virt-resize.pl:1457
33922 "For more flexible guest reconfiguration, including if you need to specify "
33923 "other parameters to grub-install, use L<virt-rescue(1)>."
33928 #: ../tools/virt-resize.pl:1460
33929 msgid "ALTERNATIVE TOOLS"
33934 #: ../tools/virt-resize.pl:1462
33936 "There are several proprietary tools for resizing partitions. We won't "
33937 "mention any here."
33942 #: ../tools/virt-resize.pl:1465
33944 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
33945 "operations on disk images. They can resize and move partitions, but I don't "
33946 "think they can do anything with the contents, and they certainly don't "
33952 #: ../tools/virt-resize.pl:1470
33954 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
33955 "but at a much lower level. You will probably end up hand-calculating sector "
33956 "offsets, which is something that virt-resize was designed to avoid. If you "
33957 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
33963 #: ../tools/virt-resize.pl:1485
33965 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
33966 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
33967 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
33968 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
33969 "libguestfs.org/>."
33974 #: ../tools/virt-list-filesystems.pl:32
33976 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
33981 #: ../tools/virt-list-filesystems.pl:36
33984 " virt-list-filesystems [--options] domname\n"
33990 #: ../tools/virt-list-filesystems.pl:38
33993 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
33999 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
34001 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
34007 #: ../tools/virt-list-filesystems.pl:45
34009 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
34010 "are contained in a virtual machine or disk image."
34015 #: ../tools/virt-list-filesystems.pl:49
34017 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
34018 "functionality. For more complex cases you should look at the L<guestfish(1)"
34024 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
34025 msgid "B<-l> | B<--long>"
34030 #: ../tools/virt-list-filesystems.pl:108
34032 "With this option, C<virt-list-filesystems> displays the type of each "
34033 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
34038 #: ../tools/virt-list-filesystems.pl:115
34039 msgid "B<-a> | B<--all>"
34044 #: ../tools/virt-list-filesystems.pl:117
34046 "Normally we only show mountable filesystems. If this option is given then "
34047 "swap devices are shown too."
34052 #: ../tools/virt-list-filesystems.pl:191
34054 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
34055 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
34056 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
34061 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
34062 msgid "Copyright (C) 2009 Red Hat Inc."
34067 #: ../tools/virt-tar.pl:33
34068 msgid "virt-tar - Extract or upload files to a virtual machine"
34073 #: ../tools/virt-tar.pl:37
34076 " virt-tar [--options] -x domname directory tarball\n"
34082 #: ../tools/virt-tar.pl:39
34085 " virt-tar [--options] -u domname tarball directory\n"
34091 #: ../tools/virt-tar.pl:41
34094 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
34100 #: ../tools/virt-tar.pl:43
34103 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
34108 #: ../tools/virt-tar.pl:47
34110 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
34111 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
34116 #: ../tools/virt-tar.pl:52
34117 msgid "Download C</home> from the VM into a local tarball:"
34122 #: ../tools/virt-tar.pl:54
34125 " virt-tar -x domname /home home.tar\n"
34131 #: ../tools/virt-tar.pl:56
34134 " virt-tar -zx domname /home home.tar.gz\n"
34140 #: ../tools/virt-tar.pl:58
34141 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
34146 #: ../tools/virt-tar.pl:60
34149 " virt-tar -u domname uploadstuff.tar /tmp\n"
34155 #: ../tools/virt-tar.pl:62
34158 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
34164 #: ../tools/virt-tar.pl:66
34166 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
34167 "virtual machines. If you do this, you risk disk corruption in the VM. "
34168 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
34173 #: ../tools/virt-tar.pl:71
34175 "You can use C<-x> (extract) on live virtual machines, but you might get "
34176 "inconsistent results or errors if there is filesystem activity inside the "
34177 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
34178 "work, but the only way to guarantee consistent results is if the virtual "
34179 "machine is shut down."
34184 #: ../tools/virt-tar.pl:79
34186 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
34187 "parts of a guest filesystem. There are many possibilities: making backups, "
34188 "uploading data files, snooping on guest activity, fixing or customizing "
34194 #: ../tools/virt-tar.pl:84
34196 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
34197 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
34198 "should look at the L<guestfish(1)> tool."
34203 #: ../tools/virt-tar.pl:88
34205 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
34206 "its contents (recursively) from the virtual machine into a local tarball. "
34207 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
34208 "virtual machine. You cannot use these two options together."
34213 #: ../tools/virt-tar.pl:94
34215 "In addition, you may need to use the C<-z> (gZip) option to enable "
34216 "compression. When uploading, you have to specify C<-z> if the upload file "
34217 "is compressed because virt-tar won't detect this on its own."
34222 #: ../tools/virt-tar.pl:98
34224 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
34225 "example it cannot do PKZip files or bzip2 compression. If you want that "
34226 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
34227 "the L<libguestfs(3)> API)."
34232 #: ../tools/virt-tar.pl:156
34233 msgid "B<-x> | B<--extract> | B<--download>"
34238 #: ../tools/virt-tar.pl:158
34239 msgid "B<-u> | B<--upload>"
34244 #: ../tools/virt-tar.pl:160
34246 "Use C<-x> to extract (download) a directory from a virtual machine to a "
34252 #: ../tools/virt-tar.pl:163
34254 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
34255 "Please read the L</WARNING> section above before using this option."
34260 #: ../tools/virt-tar.pl:167
34261 msgid "You must specify exactly one of these options."
34266 #: ../tools/virt-tar.pl:173
34267 msgid "B<-z> | B<--gzip>"
34272 #: ../tools/virt-tar.pl:175
34273 msgid "Specify that the input or output tarball is gzip-compressed."
34277 #: ../tools/virt-tar.pl:288
34279 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
34280 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
34281 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
34287 #: ../tools/virt-make-fs.pl:37
34288 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
34293 #: ../tools/virt-make-fs.pl:41
34296 " virt-make-fs [--options] input.tar output.img\n"
34302 #: ../tools/virt-make-fs.pl:43
34305 " virt-make-fs [--options] input.tar.gz output.img\n"
34311 #: ../tools/virt-make-fs.pl:45
34314 " virt-make-fs [--options] directory output.img\n"
34320 #: ../tools/virt-make-fs.pl:49
34322 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
34323 "archive or some files in a directory. It is similar to tools like L<mkisofs"
34324 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
34325 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
34326 "you want to attach these filesystems to existing virtual machines (eg. to "
34327 "import large amounts of read-only data to a VM)."
34332 #: ../tools/virt-make-fs.pl:57
34333 msgid "Basic usage is:"
34338 #: ../tools/virt-make-fs.pl:59
34341 " virt-make-fs input output\n"
34347 #: ../tools/virt-make-fs.pl:61
34349 "where C<input> is either a directory containing files that you want to add, "
34350 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
34351 "C<output> is a disk image. The input type is detected automatically. The "
34352 "output disk image defaults to a raw ext2 image unless you specify extra "
34353 "flags (see L</OPTIONS> below)."
34358 #: ../tools/virt-make-fs.pl:67
34359 msgid "EXTRA SPACE"
34364 #: ../tools/virt-make-fs.pl:69
34366 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
34367 "the files that it contains, but might have extra space. Depending on how "
34368 "you are going to use the output, you might think this extra space is wasted "
34369 "and want to minimize it, or you might want to leave space so that more files "
34370 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
34371 "but you can use the C<--size> flag to leave space in the filesystem if you "
34377 #: ../tools/virt-make-fs.pl:77
34379 "An alternative way to leave extra space but not make the output image any "
34380 "bigger is to use an alternative disk image format (instead of the default "
34381 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
34382 "image format (check your hypervisor supports this before using it). This "
34383 "allows you to choose a large C<--size> but the extra space won't actually be "
34384 "allocated in the image until you try to store something in it."
34388 #: ../tools/virt-make-fs.pl:85
34390 "Don't forget that you can also use local commands including L<resize2fs(8)> "
34391 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
34392 "to build another image from scratch."
34397 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
34398 #: ../tools/virt-make-fs.pl:142
34404 #: ../tools/virt-make-fs.pl:91
34407 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
34413 #: ../tools/virt-make-fs.pl:93
34414 msgid "FILESYSTEM TYPE"
34419 #: ../tools/virt-make-fs.pl:95
34421 "The default filesystem type is C<ext2>. Just about any filesystem type that "
34422 "libguestfs supports can be used (but I<not> read-only formats like "
34423 "ISO9660). Here are some of the more common choices:"
34428 #: ../tools/virt-make-fs.pl:101
34434 #: ../tools/virt-make-fs.pl:103
34436 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
34437 "you are not going to use the filesystem in a way that requires the journal, "
34438 "then this is just wasted overhead."
34443 #: ../tools/virt-make-fs.pl:107
34444 msgid "I<ntfs> or I<vfat>"
34449 #: ../tools/virt-make-fs.pl:109
34450 msgid "Useful if exporting data to a Windows guest."
34455 #: ../tools/virt-make-fs.pl:111
34457 "I<Note for vfat>: The tar archive or local directory must only contain files "
34458 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
34459 "program running within libguestfs is unable to change the ownership of non-"
34460 "root files, since vfat itself does not support this."
34465 #: ../tools/virt-make-fs.pl:116
34471 #: ../tools/virt-make-fs.pl:118
34473 "Lower overhead than C<ext2>, but certain limitations on filename length and "
34474 "total filesystem size."
34479 #: ../tools/virt-make-fs.pl:125
34482 " virt-make-fs --type=minix input minixfs.img\n"
34488 #: ../tools/virt-make-fs.pl:127
34489 msgid "TO PARTITION OR NOT TO PARTITION"
34494 #: ../tools/virt-make-fs.pl:129
34495 msgid "Optionally virt-make-fs can add a partition table to the output disk."
34500 #: ../tools/virt-make-fs.pl:131
34502 "Adding a partition can make the disk image more compatible with certain "
34503 "virtualized operating systems which don't expect to see a filesystem "
34504 "directly located on a block device (Linux doesn't care and will happily "
34505 "handle both types)."
34510 #: ../tools/virt-make-fs.pl:136
34512 "On the other hand, if you have a partition table then the output image is no "
34513 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
34514 "directly on a partitioned disk image. (However libguestfs tools such as "
34515 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
34520 #: ../tools/virt-make-fs.pl:144
34521 msgid "Add an MBR partition:"
34526 #: ../tools/virt-make-fs.pl:146
34529 " virt-make-fs --partition -- input disk.img\n"
34535 #: ../tools/virt-make-fs.pl:148
34537 "If the output disk image could be terabyte-sized or larger, it's better to "
34538 "use an EFI/GPT-compatible partition table:"
34543 #: ../tools/virt-make-fs.pl:151
34546 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
34552 #: ../tools/virt-make-fs.pl:179
34553 msgid "Enable debugging information."
34558 #: ../tools/virt-make-fs.pl:185
34559 msgid "B<--size=E<lt>NE<gt>>"
34564 #: ../tools/virt-make-fs.pl:187
34565 msgid "B<--size=+E<lt>NE<gt>>"
34570 #: ../tools/virt-make-fs.pl:189
34571 msgid "B<-s E<lt>NE<gt>>"
34576 #: ../tools/virt-make-fs.pl:191
34577 msgid "B<-s +E<lt>NE<gt>>"
34582 #: ../tools/virt-make-fs.pl:193
34584 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
34589 #: ../tools/virt-make-fs.pl:196
34591 "If this option is I<not> given, then the output image will be just large "
34592 "enough to contain all the files, with not much wasted space."
34597 #: ../tools/virt-make-fs.pl:199
34599 "To choose a fixed size output disk, specify an absolute number followed by b/"
34600 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34601 "Petabytes or Exabytes. This must be large enough to contain all the input "
34602 "files, else you will get an error."
34607 #: ../tools/virt-make-fs.pl:204
34609 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
34610 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34611 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
34612 "the input files, and (approximately) an extra 200 MB free space."
34617 #: ../tools/virt-make-fs.pl:210
34619 "Note that virt-make-fs estimates free space, and therefore will not produce "
34620 "filesystems containing precisely the free space requested. (It is much more "
34621 "expensive and time-consuming to produce a filesystem which has precisely the "
34622 "desired free space)."
34627 #: ../tools/virt-make-fs.pl:219
34628 msgid "B<--format=E<lt>fmtE<gt>>"
34633 #: ../tools/virt-make-fs.pl:221
34634 msgid "B<-F E<lt>fmtE<gt>>"
34639 #: ../tools/virt-make-fs.pl:223
34640 msgid "Choose the output disk image format."
34645 #: ../tools/virt-make-fs.pl:225
34646 msgid "The default is C<raw> (raw disk image)."
34651 #: ../tools/virt-make-fs.pl:227
34653 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
34654 "that would really make sense here is C<qcow2>."
34659 #: ../tools/virt-make-fs.pl:234
34660 msgid "B<--type=E<lt>fsE<gt>>"
34665 #: ../tools/virt-make-fs.pl:236
34666 msgid "B<-t E<lt>fsE<gt>>"
34671 #: ../tools/virt-make-fs.pl:238
34672 msgid "Choose the output filesystem type."
34677 #: ../tools/virt-make-fs.pl:240
34678 msgid "The default is C<ext2>."
34683 #: ../tools/virt-make-fs.pl:242
34685 "Any filesystem which is supported read-write by libguestfs can be used here."
34690 #: ../tools/virt-make-fs.pl:249
34691 msgid "B<--partition>"
34696 #: ../tools/virt-make-fs.pl:251
34697 msgid "B<--partition=E<lt>parttypeE<gt>>"
34702 #: ../tools/virt-make-fs.pl:253
34704 "If specified, this flag adds an MBR partition table to the output disk image."
34709 #: ../tools/virt-make-fs.pl:256
34711 "You can change the partition table type, eg. C<--partition=gpt> for large "
34717 #: ../tools/virt-make-fs.pl:259
34719 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
34720 "might consider the next parameter to be the partition type. For example:"
34725 #: ../tools/virt-make-fs.pl:263
34728 " virt-make-fs --partition input.tar ...\n"
34734 #: ../tools/virt-make-fs.pl:265
34736 "would cause virt-make-fs to think you wanted to use a partition type of "
34737 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
34738 "dash) between options and the input file argument:"
34743 #: ../tools/virt-make-fs.pl:269
34746 " virt-make-fs --partition -- input.tar ...\n"
34751 #: ../tools/virt-make-fs.pl:536
34753 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
34754 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
34755 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
34760 #: ../tools/virt-make-fs.pl:553
34763 " export LIBGUESTFS_DEBUG=1\n"
34764 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
34770 #: ../tools/virt-make-fs.pl:556
34772 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
34778 #: ../tools/virt-list-partitions.pl:32
34780 "virt-list-partitions - List partitions in a virtual machine or disk image"
34785 #: ../tools/virt-list-partitions.pl:36
34788 " virt-list-partitions [--options] domname\n"
34794 #: ../tools/virt-list-partitions.pl:38
34797 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
34803 #: ../tools/virt-list-partitions.pl:45
34805 "C<virt-list-partitions> is a command line tool to list the partitions that "
34806 "are contained in a virtual machine or disk image. It is mainly useful as a "
34807 "first step to using L<virt-resize(1)>."
34812 #: ../tools/virt-list-partitions.pl:50
34814 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
34815 "functionality. For more complex cases you should look at the L<guestfish(1)"
34821 #: ../tools/virt-list-partitions.pl:107
34822 msgid "B<-h> | B<--human-readable>"
34827 #: ../tools/virt-list-partitions.pl:109
34828 msgid "Show sizes in human-readable form (eg. \"1G\")."
34833 #: ../tools/virt-list-partitions.pl:117
34835 "With this option, C<virt-list-partitions> displays the type and size of each "
34836 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
34841 #: ../tools/virt-list-partitions.pl:124
34842 msgid "B<-t> | B<--total>"
34847 #: ../tools/virt-list-partitions.pl:126
34849 "Display the total size of each block device (as a separate row or rows)."
34854 #: ../tools/virt-list-partitions.pl:259
34856 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
34857 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
34858 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."