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-01-30 23:51+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:1031
922 #: ../src/guestfs.pod:1035 ../src/guestfs.pod:1039 ../src/guestfs.pod:1044
923 #: ../src/guestfs.pod:1052 ../src/guestfs.pod:1071 ../src/guestfs.pod:1079
924 #: ../src/guestfs.pod:1101 ../src/guestfs.pod:1105 ../src/guestfs.pod:1109
925 #: ../src/guestfs.pod:1113 ../src/guestfs.pod:1117 ../src/guestfs.pod:1121
926 #: ../src/guestfs.pod:1603 ../src/guestfs.pod:1608 ../src/guestfs.pod:1612
927 #: ../src/guestfs.pod:1722 ../src/guestfs.pod:1727 ../src/guestfs.pod:1731
928 #: ../src/guestfs.pod:2083 ../src/guestfs.pod:2089 ../src/guestfs.pod:2094
929 #: ../src/guestfs.pod:2100 ../src/guestfs.pod:2565 ../src/guestfs.pod:2569
930 #: ../src/guestfs.pod:2573 ../src/guestfs.pod:2577
931 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
932 #: ../src/guestfs-actions.pod:569 ../src/guestfs-actions.pod:577
933 #: ../src/guestfs-actions.pod:584 ../src/guestfs-actions.pod:591
934 #: ../src/guestfs-actions.pod:1587 ../src/guestfs-actions.pod:1591
935 #: ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1599
936 #: ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1611
937 #: ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1625
938 #: ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1633
939 #: ../src/guestfs-actions.pod:1771 ../src/guestfs-actions.pod:1775
940 #: ../src/guestfs-actions.pod:1780 ../src/guestfs-actions.pod:1785
941 #: ../src/guestfs-actions.pod:1846 ../src/guestfs-actions.pod:1850
942 #: ../src/guestfs-actions.pod:1855 ../fish/guestfish.pod:427
943 #: ../fish/guestfish.pod:431 ../fish/guestfish.pod:435
944 #: ../fish/guestfish.pod:439 ../fish/guestfish-actions.pod:13
945 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:373
946 #: ../fish/guestfish-actions.pod:381 ../fish/guestfish-actions.pod:388
947 #: ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:1065
948 #: ../fish/guestfish-actions.pod:1069 ../fish/guestfish-actions.pod:1073
949 #: ../fish/guestfish-actions.pod:1077 ../fish/guestfish-actions.pod:1085
950 #: ../fish/guestfish-actions.pod:1089 ../fish/guestfish-actions.pod:1093
951 #: ../fish/guestfish-actions.pod:1103 ../fish/guestfish-actions.pod:1107
952 #: ../fish/guestfish-actions.pod:1111 ../fish/guestfish-actions.pod:1201
953 #: ../fish/guestfish-actions.pod:1205 ../fish/guestfish-actions.pod:1210
954 #: ../fish/guestfish-actions.pod:1215 ../fish/guestfish-actions.pod:1257
955 #: ../fish/guestfish-actions.pod:1261 ../fish/guestfish-actions.pod:1266
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:1224 ../src/guestfs.pod:1355
1104 #: ../src/guestfs.pod:2128
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:1228 ../src/guestfs.pod:1359
1126 #: ../src/guestfs.pod:2153
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:1365
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:746
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."
2250 #: ../src/guestfs.pod:975
2251 msgid "ABI GUARANTEE"
2256 #: ../src/guestfs.pod:977
2258 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2259 "actions as outlined in this section. Although we will deprecate some "
2260 "actions, for example if they get replaced by newer calls, we will keep the "
2261 "old actions forever. This allows you the developer to program in confidence "
2262 "against the libguestfs API."
2267 #: ../src/guestfs.pod:983
2268 msgid "BLOCK DEVICE NAMING"
2273 #: ../src/guestfs.pod:985
2275 "In the kernel there is now quite a profusion of schemata for naming block "
2276 "devices (in this context, by I<block device> I mean a physical or virtual "
2277 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2278 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2279 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2280 "for the old IDE driver (particularly for SATA devices) those devices also "
2281 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2282 "paravirtualized drivers. This has created several different naming systems, "
2283 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2288 #: ../src/guestfs.pod:997
2290 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2291 "Linux kernel to access block devices. We can run a variety of appliances "
2292 "based on a variety of Linux kernels."
2297 #: ../src/guestfs.pod:1001
2299 "This causes a problem for libguestfs because many API calls use device or "
2300 "partition names. Working scripts and the recipe (example) scripts that we "
2301 "make available over the internet could fail if the naming scheme changes."
2306 #: ../src/guestfs.pod:1006
2308 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2309 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2310 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2311 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2316 #: ../src/guestfs.pod:1012
2318 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2319 "L</guestfs_list_partitions> and similar calls return the true names of the "
2320 "devices and partitions as known to the appliance."
2325 #: ../src/guestfs.pod:1017
2326 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2331 #: ../src/guestfs.pod:1019
2333 "Usually this translation is transparent. However in some (very rare) cases "
2334 "you may need to know the exact algorithm. Such cases include where you use "
2335 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2336 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2341 #: ../src/guestfs.pod:1025
2343 "The algorithm is applied only to I<parameters> which are known to be either "
2344 "device or partition names. Return values from functions such as L</"
2345 "guestfs_list_devices> are never changed."
2350 #: ../src/guestfs.pod:1033
2351 msgid "Is the string a parameter which is a device or partition name?"
2356 #: ../src/guestfs.pod:1037
2357 msgid "Does the string begin with C</dev/sd>?"
2362 #: ../src/guestfs.pod:1041
2364 "Does the named device exist? If so, we use that device. However if I<not> "
2365 "then we continue with this algorithm."
2370 #: ../src/guestfs.pod:1046
2371 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2376 #: ../src/guestfs.pod:1048
2377 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2382 #: ../src/guestfs.pod:1050
2383 msgid "If that named device exists, use it. If not, continue."
2388 #: ../src/guestfs.pod:1054
2389 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2394 #: ../src/guestfs.pod:1056
2395 msgid "If that named device exists, use it. If not, return an error."
2400 #: ../src/guestfs.pod:1060
2401 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2406 #: ../src/guestfs.pod:1062
2408 "Although the standard naming scheme and automatic translation is useful for "
2409 "simple programs and guestfish scripts, for larger programs it is best not to "
2410 "rely on this mechanism."
2415 #: ../src/guestfs.pod:1066
2417 "Where possible for maximum future portability programs using libguestfs "
2418 "should use these future-proof techniques:"
2423 #: ../src/guestfs.pod:1073
2425 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2426 "device names, and then use those names directly."
2431 #: ../src/guestfs.pod:1076
2433 "Since those device names exist by definition, they will never be translated."
2438 #: ../src/guestfs.pod:1081
2440 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2441 "filesystem labels."
2446 #: ../src/guestfs.pod:1086
2452 #: ../src/guestfs.pod:1088
2454 "This section discusses security implications of using libguestfs, "
2455 "particularly with untrusted or malicious guests or disk images."
2460 #: ../src/guestfs.pod:1091
2461 msgid "GENERAL SECURITY CONSIDERATIONS"
2466 #: ../src/guestfs.pod:1093
2468 "Be careful with any files or data that you download from a guest (by "
2469 "\"download\" we mean not just the L</guestfs_download> command but any "
2470 "command that reads files, filenames, directories or anything else from a "
2471 "disk image). An attacker could manipulate the data to fool your program "
2472 "into doing the wrong thing. Consider cases such as:"
2477 #: ../src/guestfs.pod:1103
2478 msgid "the data (file etc) not being present"
2483 #: ../src/guestfs.pod:1107
2484 msgid "being present but empty"
2489 #: ../src/guestfs.pod:1111
2490 msgid "being much larger than normal"
2495 #: ../src/guestfs.pod:1115
2496 msgid "containing arbitrary 8 bit data"
2501 #: ../src/guestfs.pod:1119
2502 msgid "being in an unexpected character encoding"
2507 #: ../src/guestfs.pod:1123
2508 msgid "containing homoglyphs."
2513 #: ../src/guestfs.pod:1127
2514 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2519 #: ../src/guestfs.pod:1129
2521 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2522 "(VFS) module can sometimes be escalated into exploits by deliberately "
2523 "creating a malicious, malformed filesystem. These exploits are very severe "
2524 "for two reasons. Firstly there are very many filesystem drivers in the "
2525 "kernel, and many of them are infrequently used and not much developer "
2526 "attention has been paid to the code. Linux userspace helps potential "
2527 "crackers by detecting the filesystem type and automatically choosing the "
2528 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2529 "the administrator. Secondly, a kernel-level exploit is like a local root "
2530 "exploit (worse in some ways), giving immediate and total access to the "
2531 "system right down to the hardware level."
2536 #: ../src/guestfs.pod:1142
2538 "That explains why you should never mount a filesystem from an untrusted "
2539 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2540 "inside a qemu virtual machine, usually running as a non-root user. The "
2541 "attacker would need to write a filesystem which first exploited the kernel, "
2542 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2543 "the libguestfs protocol, and finally to be as serious as the host kernel "
2544 "exploit it would need to escalate its privileges to root. This multi-step "
2545 "escalation, performed by a static piece of data, is thought to be extremely "
2546 "hard to do, although we never say 'never' about security issues."
2551 #: ../src/guestfs.pod:1153
2553 "In any case callers can reduce the attack surface by forcing the filesystem "
2554 "type when mounting (use L</guestfs_mount_vfs>)."
2559 #: ../src/guestfs.pod:1156
2560 msgid "PROTOCOL SECURITY"
2565 #: ../src/guestfs.pod:1158
2567 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2568 "defined upper message size. However a program that uses libguestfs must "
2569 "also take care - for example you can write a program that downloads a binary "
2570 "from a disk image and executes it locally, and no amount of protocol "
2571 "security will save you from the consequences."
2576 #: ../src/guestfs.pod:1164
2577 msgid "INSPECTION SECURITY"
2582 #: ../src/guestfs.pod:1166
2584 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2585 "directly from the guest, and these could contain any 8 bit data. Callers "
2586 "should be careful to escape these before printing them to a structured file "
2587 "(for example, use HTML escaping if creating a web page)."
2592 #: ../src/guestfs.pod:1172
2594 "Guest configuration may be altered in unusual ways by the administrator of "
2595 "the virtual machine, and may not reflect reality (particularly for untrusted "
2596 "or actively malicious guests). For example we parse the hostname from "
2597 "configuration files like C</etc/sysconfig/network> that we find in the "
2598 "guest, but the guest administrator can easily manipulate these files to "
2599 "provide the wrong hostname."
2604 #: ../src/guestfs.pod:1180
2606 "The inspection API parses guest configuration using two external libraries: "
2607 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2608 "designed to be robust in the face of malicious data, although denial of "
2609 "service attacks are still possible, for example with oversized configuration "
2615 #: ../src/guestfs.pod:1186
2616 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2621 #: ../src/guestfs.pod:1188
2623 "Be very cautious about running commands from the guest. By running a "
2624 "command in the guest, you are giving CPU time to a binary that you do not "
2625 "control, under the same user account as the library, albeit wrapped in qemu "
2626 "virtualization. More information and alternatives can be found in the "
2627 "section L</RUNNING COMMANDS>."
2632 #: ../src/guestfs.pod:1194
2633 msgid "CVE-2010-3851"
2638 #: ../src/guestfs.pod:1196
2639 msgid "https://bugzilla.redhat.com/642934"
2644 #: ../src/guestfs.pod:1198
2646 "This security bug concerns the automatic disk format detection that qemu "
2647 "does on disk images."
2652 #: ../src/guestfs.pod:1201
2654 "A raw disk image is just the raw bytes, there is no header. Other disk "
2655 "images like qcow2 contain a special header. Qemu deals with this by looking "
2656 "for one of the known headers, and if none is found then assuming the disk "
2657 "image must be raw."
2662 #: ../src/guestfs.pod:1206
2664 "This allows a guest which has been given a raw disk image to write some "
2665 "other header. At next boot (or when the disk image is accessed by "
2666 "libguestfs) qemu would do autodetection and think the disk image format was, "
2667 "say, qcow2 based on the header written by the guest."
2672 #: ../src/guestfs.pod:1211
2674 "This in itself would not be a problem, but qcow2 offers many features, one "
2675 "of which is to allow a disk image to refer to another image (called the "
2676 "\"backing disk\"). It does this by placing the path to the backing disk "
2677 "into the qcow2 header. This path is not validated and could point to any "
2678 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2679 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2680 "control of the attacker."
2685 #: ../src/guestfs.pod:1219
2687 "In libguestfs this is rather hard to exploit except under two circumstances:"
2692 #: ../src/guestfs.pod:1226
2693 msgid "You have enabled the network or have opened the disk in write mode."
2698 #: ../src/guestfs.pod:1230
2700 "You are also running untrusted code from the guest (see L</RUNNING "
2706 #: ../src/guestfs.pod:1235
2708 "The way to avoid this is to specify the expected disk format when adding "
2709 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2710 "should always do this if the disk is raw format, and it's a good idea for "
2716 #: ../src/guestfs.pod:1240
2718 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2719 "format is fetched from libvirt and passed through."
2724 #: ../src/guestfs.pod:1243
2726 "For libguestfs tools, use the I<--format> command line parameter as "
2732 #: ../src/guestfs.pod:1246
2733 msgid "CONNECTION MANAGEMENT"
2738 #: ../src/guestfs.pod:1248
2744 #: ../src/guestfs.pod:1250
2746 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2747 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2748 "handle and release all resources used."
2753 #: ../src/guestfs.pod:1254
2755 "For information on using multiple handles and threads, see the section L</"
2756 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2761 #: ../src/guestfs.pod:1257
2762 msgid "guestfs_create"
2767 #: ../src/guestfs.pod:1259
2770 " guestfs_h *guestfs_create (void);\n"
2776 #: ../src/guestfs.pod:1261
2777 msgid "Create a connection handle."
2782 #: ../src/guestfs.pod:1263
2784 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2785 "on the handle at least once."
2790 #: ../src/guestfs.pod:1266
2792 "This function returns a non-NULL pointer to a handle on success or NULL on "
2798 #: ../src/guestfs.pod:1269
2799 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2804 #: ../src/guestfs.pod:1271
2806 "You may also want to configure error handling for the handle. See L</ERROR "
2807 "HANDLING> section below."
2812 #: ../src/guestfs.pod:1274
2813 msgid "guestfs_close"
2818 #: ../src/guestfs.pod:1276
2821 " void guestfs_close (guestfs_h *g);\n"
2827 #: ../src/guestfs.pod:1278
2828 msgid "This closes the connection handle and frees up all resources used."
2833 #: ../src/guestfs.pod:1280
2834 msgid "ERROR HANDLING"
2839 #: ../src/guestfs.pod:1282
2841 "API functions can return errors. For example, almost all functions that "
2842 "return C<int> will return C<-1> to indicate an error."
2847 #: ../src/guestfs.pod:1285
2849 "Additional information is available for errors: an error message string and "
2850 "optionally an error number (errno) if the thing that failed was a system "
2856 #: ../src/guestfs.pod:1289
2858 "You can get at the additional information about the last error on the handle "
2859 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2860 "up an error handler with L</guestfs_set_error_handler>."
2865 #: ../src/guestfs.pod:1294
2867 "When the handle is created, a default error handler is installed which "
2868 "prints the error message string to C<stderr>. For small short-running "
2869 "command line programs it is sufficient to do:"
2874 #: ../src/guestfs.pod:1298
2877 " if (guestfs_launch (g) == -1)\n"
2878 " exit (EXIT_FAILURE);\n"
2884 #: ../src/guestfs.pod:1301
2886 "since the default error handler will ensure that an error message has been "
2887 "printed to C<stderr> before the program exits."
2892 #: ../src/guestfs.pod:1304
2894 "For other programs the caller will almost certainly want to install an "
2895 "alternate error handler or do error handling in-line like this:"
2900 #: ../src/guestfs.pod:1307
2903 " g = guestfs_create ();\n"
2909 #: ../src/guestfs.pod:1309
2912 " /* This disables the default behaviour of printing errors\n"
2914 " guestfs_set_error_handler (g, NULL, NULL);\n"
2920 #: ../src/guestfs.pod:1313
2923 " if (guestfs_launch (g) == -1) {\n"
2924 " /* Examine the error message and print it etc. */\n"
2925 " char *msg = guestfs_last_error (g);\n"
2926 " int errnum = guestfs_last_errno (g);\n"
2927 " fprintf (stderr, \"%s\\n\", msg);\n"
2935 #: ../src/guestfs.pod:1321
2937 "Out of memory errors are handled differently. The default action is to call "
2938 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2939 "guestfs_set_out_of_memory_handler>."
2944 #: ../src/guestfs.pod:1325
2946 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2947 "because there is no handle if this happens there is no way to get additional "
2948 "error information. However L</guestfs_create> is supposed to be a "
2949 "lightweight operation which can only fail because of insufficient memory (it "
2950 "returns NULL in this case)."
2955 #: ../src/guestfs.pod:1331
2956 msgid "guestfs_last_error"
2961 #: ../src/guestfs.pod:1333
2964 " const char *guestfs_last_error (guestfs_h *g);\n"
2970 #: ../src/guestfs.pod:1335
2972 "This returns the last error message that happened on C<g>. If there has not "
2973 "been an error since the handle was created, then this returns C<NULL>."
2978 #: ../src/guestfs.pod:1339
2980 "The lifetime of the returned string is until the next error occurs, or L</"
2981 "guestfs_close> is called."
2986 #: ../src/guestfs.pod:1342
2987 msgid "guestfs_last_errno"
2992 #: ../src/guestfs.pod:1344
2995 " int guestfs_last_errno (guestfs_h *g);\n"
3001 #: ../src/guestfs.pod:1346
3002 msgid "This returns the last error number (errno) that happened on C<g>."
3007 #: ../src/guestfs.pod:1348
3008 msgid "If successful, an errno integer not equal to zero is returned."
3013 #: ../src/guestfs.pod:1350
3015 "If no error, this returns 0. This call can return 0 in three situations:"
3020 #: ../src/guestfs.pod:1357
3021 msgid "There has not been any error on the handle."
3026 #: ../src/guestfs.pod:1361
3028 "There has been an error but the errno was meaningless. This corresponds to "
3029 "the case where the error did not come from a failed system call, but for "
3030 "some other reason."
3035 #: ../src/guestfs.pod:1367
3037 "There was an error from a failed system call, but for some reason the errno "
3038 "was not captured and returned. This usually indicates a bug in libguestfs."
3043 #: ../src/guestfs.pod:1373
3045 "Libguestfs tries to convert the errno from inside the applicance into a "
3046 "corresponding errno for the caller (not entirely trivial: the appliance "
3047 "might be running a completely different operating system from the library "
3048 "and error numbers are not standardized across Un*xen). If this could not be "
3049 "done, then the error is translated to C<EINVAL>. In practice this should "
3050 "only happen in very rare circumstances."
3055 #: ../src/guestfs.pod:1381
3056 msgid "guestfs_set_error_handler"
3061 #: ../src/guestfs.pod:1383
3064 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
3066 " const char *msg);\n"
3067 " void guestfs_set_error_handler (guestfs_h *g,\n"
3068 " guestfs_error_handler_cb cb,\n"
3075 #: ../src/guestfs.pod:1390
3077 "The callback C<cb> will be called if there is an error. The parameters "
3078 "passed to the callback are an opaque data pointer and the error message "
3084 #: ../src/guestfs.pod:1394
3086 "C<errno> is not passed to the callback. To get that the callback must call "
3087 "L</guestfs_last_errno>."
3092 #: ../src/guestfs.pod:1397
3094 "Note that the message string C<msg> is freed as soon as the callback "
3095 "function returns, so if you want to stash it somewhere you must make your "
3101 #: ../src/guestfs.pod:1401
3102 msgid "The default handler prints messages on C<stderr>."
3107 #: ../src/guestfs.pod:1403
3108 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
3113 #: ../src/guestfs.pod:1405
3114 msgid "guestfs_get_error_handler"
3119 #: ../src/guestfs.pod:1407
3122 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
3123 " void **opaque_rtn);\n"
3129 #: ../src/guestfs.pod:1410
3130 msgid "Returns the current error handler callback."
3135 #: ../src/guestfs.pod:1412
3136 msgid "guestfs_set_out_of_memory_handler"
3141 #: ../src/guestfs.pod:1414
3144 " typedef void (*guestfs_abort_cb) (void);\n"
3145 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
3146 " guestfs_abort_cb);\n"
3152 #: ../src/guestfs.pod:1418
3154 "The callback C<cb> will be called if there is an out of memory situation. "
3155 "I<Note this callback must not return>."
3160 #: ../src/guestfs.pod:1421
3161 msgid "The default is to call L<abort(3)>."
3166 #: ../src/guestfs.pod:1423
3168 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
3173 #: ../src/guestfs.pod:1426
3174 msgid "guestfs_get_out_of_memory_handler"
3179 #: ../src/guestfs.pod:1428
3182 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
3188 #: ../src/guestfs.pod:1430
3189 msgid "This returns the current out of memory handler."
3194 #: ../src/guestfs.pod:1432
3200 #: ../src/guestfs.pod:1434 ../fish/guestfish.pod:984
3206 #: ../src/guestfs.pod:1436
3212 #: ../src/guestfs.pod:1438
3218 #: ../src/guestfs.pod:1440
3219 msgid "AVAILABILITY"
3224 #: ../src/guestfs.pod:1442
3225 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
3230 #: ../src/guestfs.pod:1444
3232 "Using L</guestfs_available> you can test availability of the following "
3233 "groups of functions. This test queries the appliance to see if the "
3234 "appliance you are currently using supports the functionality."
3239 #: ../src/guestfs.pod:1449
3240 msgid "@AVAILABILITY@"
3245 #: ../src/guestfs.pod:1451
3246 msgid "GUESTFISH supported COMMAND"
3251 #: ../src/guestfs.pod:1453
3253 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
3254 "prints out the available groups and whether they are supported by this build "
3255 "of libguestfs. Note however that you have to do C<run> first."
3260 #: ../src/guestfs.pod:1458
3261 msgid "SINGLE CALLS AT COMPILE TIME"
3266 #: ../src/guestfs.pod:1460
3268 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
3269 "function, such as:"
3274 #: ../src/guestfs.pod:1463
3277 " #define LIBGUESTFS_HAVE_DD 1\n"
3283 #: ../src/guestfs.pod:1465
3284 msgid "if L</guestfs_dd> is available."
3289 #: ../src/guestfs.pod:1467
3291 "Before version 1.5.8, if you needed to test whether a single libguestfs "
3292 "function is available at compile time, we recommended using build tools such "
3293 "as autoconf or cmake. For example in autotools you could use:"
3298 #: ../src/guestfs.pod:1472
3301 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
3302 " AC_CHECK_FUNCS([guestfs_dd])\n"
3308 #: ../src/guestfs.pod:1475
3310 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
3316 #: ../src/guestfs.pod:1478
3317 msgid "SINGLE CALLS AT RUN TIME"
3322 #: ../src/guestfs.pod:1480
3324 "Testing at compile time doesn't guarantee that a function really exists in "
3325 "the library. The reason is that you might be dynamically linked against a "
3326 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
3327 "This situation unfortunately results in a segmentation fault, which is a "
3328 "shortcoming of the C dynamic linking system itself."
3333 #: ../src/guestfs.pod:1487
3335 "You can use L<dlopen(3)> to test if a function is available at run time, as "
3336 "in this example program (note that you still need the compile time check as "
3342 #: ../src/guestfs.pod:1491
3345 " #include <stdio.h>\n"
3346 " #include <stdlib.h>\n"
3347 " #include <unistd.h>\n"
3348 " #include <dlfcn.h>\n"
3349 " #include <guestfs.h>\n"
3355 #: ../src/guestfs.pod:1497
3360 " #ifdef LIBGUESTFS_HAVE_DD\n"
3362 " int has_function;\n"
3368 #: ../src/guestfs.pod:1503
3371 " /* Test if the function guestfs_dd is really available. */\n"
3372 " dl = dlopen (NULL, RTLD_LAZY);\n"
3374 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
3375 " exit (EXIT_FAILURE);\n"
3377 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
3384 #: ../src/guestfs.pod:1512
3387 " if (!has_function)\n"
3388 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
3390 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
3391 " /* Now it's safe to call\n"
3392 " guestfs_dd (g, \"foo\", \"bar\");\n"
3396 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
3404 #: ../src/guestfs.pod:1525
3406 "You may think the above is an awful lot of hassle, and it is. There are "
3407 "other ways outside of the C linking system to ensure that this kind of "
3408 "incompatibility never arises, such as using package versioning:"
3413 #: ../src/guestfs.pod:1530
3416 " Requires: libguestfs >= 1.0.80\n"
3422 #: ../src/guestfs.pod:1532
3423 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3428 #: ../src/guestfs.pod:1534
3430 "A recent feature of the API is the introduction of calls which take optional "
3431 "arguments. In C these are declared 3 ways. The main way is as a call which "
3432 "takes variable arguments (ie. C<...>), as in this example:"
3437 #: ../src/guestfs.pod:1539
3440 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3446 #: ../src/guestfs.pod:1541
3448 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3449 "call with no optional arguments specified:"
3454 #: ../src/guestfs.pod:1544
3457 " guestfs_add_drive_opts (g, filename, -1);\n"
3463 #: ../src/guestfs.pod:1546
3464 msgid "With a single optional argument:"
3469 #: ../src/guestfs.pod:1548
3472 " guestfs_add_drive_opts (g, filename,\n"
3473 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3480 #: ../src/guestfs.pod:1552
3486 #: ../src/guestfs.pod:1554
3489 " guestfs_add_drive_opts (g, filename,\n"
3490 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3491 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3498 #: ../src/guestfs.pod:1559
3500 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3506 #: ../src/guestfs.pod:1562
3507 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3512 #: ../src/guestfs.pod:1564
3514 "The second variant has the same name with the suffix C<_va>, which works the "
3515 "same way but takes a C<va_list>. See the C manual for details. For the "
3516 "example function, this is declared:"
3521 #: ../src/guestfs.pod:1568
3524 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3531 #: ../src/guestfs.pod:1571
3532 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3537 #: ../src/guestfs.pod:1573
3539 "The third variant is useful where you need to construct these calls. You "
3540 "pass in a structure where you fill in the optional fields. The structure "
3541 "has a bitmask as the first element which you must set to indicate which "
3542 "fields you have filled in. For our example function the structure and call "
3548 #: ../src/guestfs.pod:1579
3551 " struct guestfs_add_drive_opts_argv {\n"
3552 " uint64_t bitmask;\n"
3554 " const char *format;\n"
3557 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3558 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3564 #: ../src/guestfs.pod:1588
3565 msgid "You could call it like this:"
3570 #: ../src/guestfs.pod:1590
3573 " struct guestfs_add_drive_opts_argv optargs = {\n"
3574 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3575 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3577 " .format = \"qcow2\"\n"
3584 #: ../src/guestfs.pod:1597
3587 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3593 #: ../src/guestfs.pod:1599 ../src/guestfs-actions.pod:11
3594 #: ../src/guestfs-actions.pod:1842 ../fish/guestfish-actions.pod:9
3595 #: ../fish/guestfish-actions.pod:1253 ../tools/virt-win-reg.pl:532
3601 #: ../src/guestfs.pod:1605
3602 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3607 #: ../src/guestfs.pod:1610
3608 msgid "You do not need to fill in all fields of the structure."
3613 #: ../src/guestfs.pod:1614
3615 "There must be a one-to-one correspondence between fields of the structure "
3616 "that are filled in, and bits set in the bitmask."
3621 #: ../src/guestfs.pod:1619
3622 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3627 #: ../src/guestfs.pod:1621
3629 "In other languages, optional arguments are expressed in the way that is "
3630 "natural for that language. We refer you to the language-specific "
3631 "documentation for more details on that."
3636 #: ../src/guestfs.pod:1625
3637 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3642 #: ../src/guestfs.pod:1627
3643 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3648 #: ../src/guestfs.pod:1629
3650 "The child process generates events in some situations. Current events "
3651 "include: receiving a log message, the child process exits."
3656 #: ../src/guestfs.pod:1632
3658 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3664 #: ../src/guestfs.pod:1635
3666 "Only I<one callback of each type> can be registered for each handle. "
3667 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3668 "that type. Cancel all callbacks of this type by calling this function with "
3669 "C<cb> set to C<NULL>."
3674 #: ../src/guestfs.pod:1640
3675 msgid "guestfs_set_log_message_callback"
3680 #: ../src/guestfs.pod:1642
3683 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3684 " char *buf, int len);\n"
3685 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3686 " guestfs_log_message_cb cb,\n"
3693 #: ../src/guestfs.pod:1648
3695 "The callback function C<cb> will be called whenever qemu or the guest writes "
3696 "anything to the console."
3701 #: ../src/guestfs.pod:1651
3702 msgid "Use this function to capture kernel messages and similar."
3707 #: ../src/guestfs.pod:1653
3709 "Normally there is no log message handler, and log messages are just "
3715 #: ../src/guestfs.pod:1656
3716 msgid "guestfs_set_subprocess_quit_callback"
3721 #: ../src/guestfs.pod:1658
3724 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3725 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3726 " guestfs_subprocess_quit_cb cb,\n"
3733 #: ../src/guestfs.pod:1663
3735 "The callback function C<cb> will be called when the child process quits, "
3736 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3737 "corresponds to a transition from any state to the CONFIG state)."
3742 #: ../src/guestfs.pod:1668
3743 msgid "guestfs_set_launch_done_callback"
3748 #: ../src/guestfs.pod:1670
3751 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3752 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3753 " guestfs_launch_done_cb cb,\n"
3760 #: ../src/guestfs.pod:1675
3762 "The callback function C<cb> will be called when the child process becomes "
3763 "ready first time after it has been launched. (This corresponds to a "
3764 "transition from LAUNCHING to the READY state)."
3769 #: ../src/guestfs.pod:1679
3770 msgid "guestfs_set_close_callback"
3775 #: ../src/guestfs.pod:1681
3778 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3779 " void guestfs_set_close_callback (guestfs_h *g,\n"
3780 " guestfs_close_cb cb,\n"
3787 #: ../src/guestfs.pod:1686
3789 "The callback function C<cb> will be called while the handle is being closed "
3790 "(synchronously from L</guestfs_close>)."
3795 #: ../src/guestfs.pod:1689
3797 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3798 "handles that are open when the program exits. This means that this callback "
3799 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3800 "problems in higher-level languages (eg. if your HLL interpreter has already "
3801 "been cleaned up by the time this is called, and if your callback then jumps "
3802 "into some HLL function)."
3807 #: ../src/guestfs.pod:1697
3808 msgid "guestfs_set_progress_callback"
3813 #: ../src/guestfs.pod:1699
3816 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3817 " int proc_nr, int serial,\n"
3818 " uint64_t position, uint64_t total);\n"
3819 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3820 " guestfs_progress_cb cb,\n"
3827 #: ../src/guestfs.pod:1706
3829 "Some long-running operations can generate progress messages. If this "
3830 "callback is registered, then it will be called each time a progress message "
3831 "is generated (usually two seconds after the operation started, and three "
3832 "times per second thereafter until it completes, although the frequency may "
3833 "change in future versions)."
3838 #: ../src/guestfs.pod:1712
3840 "The callback receives two numbers: C<position> and C<total>. The units of "
3841 "C<total> are not defined, although for some operations C<total> may relate "
3842 "in some way to the amount of data to be transferred (eg. in bytes or "
3843 "megabytes), and C<position> may be the portion which has been transferred."
3848 #: ../src/guestfs.pod:1718
3849 msgid "The only defined and stable parts of the API are:"
3854 #: ../src/guestfs.pod:1724
3856 "The callback can display to the user some type of progress bar or indicator "
3857 "which shows the ratio of C<position>:C<total>."
3862 #: ../src/guestfs.pod:1729
3863 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3868 #: ../src/guestfs.pod:1733
3870 "If any progress notification is sent during a call, then a final progress "
3871 "notification is always sent when C<position> = C<total>."
3876 #: ../src/guestfs.pod:1736
3878 "This is to simplify caller code, so callers can easily set the progress "
3879 "indicator to \"100%\" at the end of the operation, without requiring special "
3880 "code to detect this case."
3885 #: ../src/guestfs.pod:1742
3887 "The callback also receives the procedure number and serial number of the "
3888 "call. These are only useful for debugging protocol issues, and the callback "
3889 "can normally ignore them. The callback may want to print these numbers in "
3890 "error messages or debugging messages."
3895 #: ../src/guestfs.pod:1747
3896 msgid "PRIVATE DATA AREA"
3901 #: ../src/guestfs.pod:1749
3903 "You can attach named pieces of private data to the libguestfs handle, and "
3904 "fetch them by name for the lifetime of the handle. This is called the "
3905 "private data area and is only available from the C API."
3910 #: ../src/guestfs.pod:1753
3911 msgid "To attach a named piece of data, use the following call:"
3916 #: ../src/guestfs.pod:1755
3919 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3925 #: ../src/guestfs.pod:1757
3927 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3928 "pointer (which can be C<NULL>). Any previous item with the same name is "
3934 #: ../src/guestfs.pod:1761
3936 "You can use any C<key> you want, but names beginning with an underscore "
3937 "character are reserved for internal libguestfs purposes (for implementing "
3938 "language bindings). It is recommended to prefix the name with some unique "
3939 "string to avoid collisions with other users."
3944 #: ../src/guestfs.pod:1766
3945 msgid "To retrieve the pointer, use:"
3950 #: ../src/guestfs.pod:1768
3953 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3959 #: ../src/guestfs.pod:1770
3961 "This function returns C<NULL> if either no data is found associated with "
3962 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3968 #: ../src/guestfs.pod:1774
3970 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3971 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3972 "all. In particular, libguestfs does I<not> try to free the data when the "
3973 "handle is closed. If the data must be freed, then the caller must either "
3974 "free it before calling L</guestfs_close> or must set up a close callback to "
3975 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3976 "can be registered for a handle)."
3981 #: ../src/guestfs.pod:1782
3983 "The private data area is implemented using a hash table, and should be "
3984 "reasonably efficient for moderate numbers of keys."
3989 #: ../src/guestfs.pod:1785 ../src/guestfs.pod:1790
3995 #: ../src/guestfs.pod:1787
3997 "<!-- old anchor for the next section --> <a name="
3998 "\"state_machine_and_low_level_event_api\"/>"
4003 #: ../src/guestfs.pod:1792
4004 msgid "ARCHITECTURE"
4009 #: ../src/guestfs.pod:1794
4011 "Internally, libguestfs is implemented by running an appliance (a special "
4012 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
4013 "process of the main program."
4018 #: ../src/guestfs.pod:1798
4021 " ___________________\n"
4023 " | main program |\n"
4025 " | | child process / appliance\n"
4026 " | | __________________________\n"
4028 " +-------------------+ RPC | +-----------------+ |\n"
4029 " | libguestfs <--------------------> guestfsd | |\n"
4030 " | | | +-----------------+ |\n"
4031 " \\___________________/ | | Linux kernel | |\n"
4032 " | +--^--------------+ |\n"
4033 " \\_________|________________/\n"
4039 " \\______________/\n"
4045 #: ../src/guestfs.pod:1818
4047 "The library, linked to the main program, creates the child process and hence "
4048 "the appliance in the L</guestfs_launch> function."
4053 #: ../src/guestfs.pod:1821
4055 "Inside the appliance is a Linux kernel and a complete stack of userspace "
4056 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
4057 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
4058 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
4059 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
4060 "attached to the qemu process which translates device access by the "
4061 "appliance's Linux kernel into accesses to the image."
4066 #: ../src/guestfs.pod:1830
4068 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
4069 "Although the disk image you are attached to might also be used by some "
4070 "virtual machine, libguestfs doesn't know or care about this. (But you will "
4071 "care if both libguestfs's qemu process and your virtual machine are trying "
4072 "to update the disk image at the same time, since these usually results in "
4073 "massive disk corruption)."
4078 #: ../src/guestfs.pod:1837
4079 msgid "STATE MACHINE"
4084 #: ../src/guestfs.pod:1839
4085 msgid "libguestfs uses a state machine to model the child process:"
4090 #: ../src/guestfs.pod:1841
4102 " / | \\ \\ guestfs_launch\n"
4103 " / | _\\__V______\n"
4105 " / | | LAUNCHING |\n"
4106 " / | \\___________/\n"
4108 " / | guestfs_launch\n"
4110 " ______ / __|____V\n"
4111 " / \\ ------> / \\\n"
4112 " | BUSY | | READY |\n"
4113 " \\______/ <------ \\________/\n"
4119 #: ../src/guestfs.pod:1863
4121 "The normal transitions are (1) CONFIG (when the handle is created, but there "
4122 "is no child process), (2) LAUNCHING (when the child process is booting up), "
4123 "(3) alternating between READY and BUSY as commands are issued to, and "
4124 "carried out by, the child process."
4129 #: ../src/guestfs.pod:1868
4131 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
4132 "asynchronously at any time (eg. due to some internal error), and that causes "
4133 "the state to transition back to CONFIG."
4138 #: ../src/guestfs.pod:1872
4140 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
4141 "issued when in the CONFIG state."
4146 #: ../src/guestfs.pod:1875
4148 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
4149 "L</guestfs_launch> blocks until the child process is READY to accept "
4150 "commands (or until some failure or timeout). L</guestfs_launch> internally "
4151 "moves the state from CONFIG to LAUNCHING while it is running."
4156 #: ../src/guestfs.pod:1881
4158 "API actions such as L</guestfs_mount> can only be issued when in the READY "
4159 "state. These API calls block waiting for the command to be carried out (ie. "
4160 "the state to transition to BUSY and then back to READY). There are no non-"
4161 "blocking versions, and no way to issue more than one command per handle at "
4167 #: ../src/guestfs.pod:1887
4169 "Finally, the child process sends asynchronous messages back to the main "
4170 "program, such as kernel log messages. You can register a callback to "
4171 "receive these messages."
4176 #: ../src/guestfs.pod:1891
4182 #: ../src/guestfs.pod:1893
4183 msgid "COMMUNICATION PROTOCOL"
4188 #: ../src/guestfs.pod:1895
4190 "Don't rely on using this protocol directly. This section documents how it "
4191 "currently works, but it may change at any time."
4196 #: ../src/guestfs.pod:1898
4198 "The protocol used to talk between the library and the daemon running inside "
4199 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
4200 "1014, RFC 1832, RFC 4506)."
4205 #: ../src/guestfs.pod:1902
4207 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
4208 "this file is automatically generated)."
4213 #: ../src/guestfs.pod:1905
4215 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
4216 "and C<FileOut> parameters, which are handled with very simple request/reply "
4217 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
4218 "parameters, which use the same request and reply messages, but they may also "
4219 "be followed by files sent using a chunked encoding."
4224 #: ../src/guestfs.pod:1912
4225 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
4230 #: ../src/guestfs.pod:1914
4231 msgid "For ordinary functions, the request message is:"
4236 #: ../src/guestfs.pod:1916
4239 " total length (header + arguments,\n"
4240 " but not including the length word itself)\n"
4241 " struct guestfs_message_header (encoded as XDR)\n"
4242 " struct guestfs_<foo>_args (encoded as XDR)\n"
4248 #: ../src/guestfs.pod:1921
4250 "The total length field allows the daemon to allocate a fixed size buffer "
4251 "into which it slurps the rest of the message. As a result, the total length "
4252 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
4253 "effective size of any request is limited to somewhere under this size."
4258 #: ../src/guestfs.pod:1927
4260 "Note also that many functions don't take any arguments, in which case the "
4261 "C<guestfs_I<foo>_args> is completely omitted."
4266 #: ../src/guestfs.pod:1930
4268 "The header contains the procedure number (C<guestfs_proc>) which is how the "
4269 "receiver knows what type of args structure to expect, or none at all."
4274 #: ../src/guestfs.pod:1934
4276 "For functions that take optional arguments, the optional arguments are "
4277 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
4278 "arguments. A bitmask in the header indicates which optional arguments are "
4279 "meaningful. The bitmask is also checked to see if it contains bits set "
4280 "which the daemon does not know about (eg. if more optional arguments were "
4281 "added in a later version of the library), and this causes the call to be "
4287 #: ../src/guestfs.pod:1942
4288 msgid "The reply message for ordinary functions is:"
4293 #: ../src/guestfs.pod:1944
4296 " total length (header + ret,\n"
4297 " but not including the length word itself)\n"
4298 " struct guestfs_message_header (encoded as XDR)\n"
4299 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4305 #: ../src/guestfs.pod:1949
4307 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
4308 "functions that return no formal return values."
4313 #: ../src/guestfs.pod:1952
4315 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
4320 #: ../src/guestfs.pod:1955
4322 "In the case of an error, a flag is set in the header, and the reply message "
4323 "is slightly changed:"
4328 #: ../src/guestfs.pod:1958
4331 " total length (header + error,\n"
4332 " but not including the length word itself)\n"
4333 " struct guestfs_message_header (encoded as XDR)\n"
4334 " struct guestfs_message_error (encoded as XDR)\n"
4340 #: ../src/guestfs.pod:1963
4342 "The C<guestfs_message_error> structure contains the error message as a "
4348 #: ../src/guestfs.pod:1966
4349 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
4354 #: ../src/guestfs.pod:1968
4356 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
4357 "The normal request message is sent (see above). However this is followed by "
4358 "a sequence of file chunks."
4363 #: ../src/guestfs.pod:1972
4366 " total length (header + arguments,\n"
4367 " but not including the length word itself,\n"
4368 " and not including the chunks)\n"
4369 " struct guestfs_message_header (encoded as XDR)\n"
4370 " struct guestfs_<foo>_args (encoded as XDR)\n"
4371 " sequence of chunks for FileIn param #0\n"
4372 " sequence of chunks for FileIn param #1 etc.\n"
4378 #: ../src/guestfs.pod:1980
4379 msgid "The \"sequence of chunks\" is:"
4384 #: ../src/guestfs.pod:1982
4387 " length of chunk (not including length word itself)\n"
4388 " struct guestfs_chunk (encoded as XDR)\n"
4389 " length of chunk\n"
4390 " struct guestfs_chunk (encoded as XDR)\n"
4392 " length of chunk\n"
4393 " struct guestfs_chunk (with data.data_len == 0)\n"
4399 #: ../src/guestfs.pod:1990
4401 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
4402 "is set in the final chunk to indicate either successful completion or early "
4408 #: ../src/guestfs.pod:1994
4410 "At time of writing there are no functions that have more than one FileIn "
4411 "parameter. However this is (theoretically) supported, by sending the "
4412 "sequence of chunks for each FileIn parameter one after another (from left to "
4418 #: ../src/guestfs.pod:1999
4420 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
4421 "transfer. The library does this by sending a chunk with a special flag set "
4422 "to indicate cancellation. When the daemon sees this, it cancels the whole "
4423 "RPC, does I<not> send any reply, and goes back to reading the next request."
4428 #: ../src/guestfs.pod:2005
4430 "The daemon may also cancel. It does this by writing a special word "
4431 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
4432 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
4433 "cancel chunk). The special word is chosen so that even if cancellation "
4434 "happens right at the end of the transfer (after the library has finished "
4435 "writing and has started listening for the reply), the \"spurious\" cancel "
4436 "flag will not be confused with the reply message."
4441 #: ../src/guestfs.pod:2014
4443 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
4444 "limit), and also files where the size is not known in advance (eg. from "
4445 "pipes or sockets). However the chunks are rather small "
4446 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
4447 "to keep much in memory."
4452 #: ../src/guestfs.pod:2020
4453 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
4458 #: ../src/guestfs.pod:2022
4460 "The protocol for FileOut parameters is exactly the same as for FileIn "
4461 "parameters, but with the roles of daemon and library reversed."
4466 #: ../src/guestfs.pod:2025
4469 " total length (header + ret,\n"
4470 " but not including the length word itself,\n"
4471 " and not including the chunks)\n"
4472 " struct guestfs_message_header (encoded as XDR)\n"
4473 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4474 " sequence of chunks for FileOut param #0\n"
4475 " sequence of chunks for FileOut param #1 etc.\n"
4481 #: ../src/guestfs.pod:2033
4482 msgid "INITIAL MESSAGE"
4487 #: ../src/guestfs.pod:2035
4489 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
4490 "which indicates that the guest and daemon is alive. This is what L</"
4491 "guestfs_launch> waits for."
4496 #: ../src/guestfs.pod:2039
4497 msgid "PROGRESS NOTIFICATION MESSAGES"
4502 #: ../src/guestfs.pod:2041
4504 "The daemon may send progress notification messages at any time. These are "
4505 "distinguished by the normal length word being replaced by "
4506 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
4511 #: ../src/guestfs.pod:2045
4513 "The library turns them into progress callbacks (see "
4514 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
4515 "discards them if not."
4520 #: ../src/guestfs.pod:2049
4522 "The daemon self-limits the frequency of progress messages it sends (see "
4523 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
4529 #: ../src/guestfs.pod:2053
4530 msgid "LIBGUESTFS VERSION NUMBERS"
4535 #: ../src/guestfs.pod:2055
4537 "Since April 2010, libguestfs has started to make separate development and "
4538 "stable releases, along with corresponding branches in our git repository. "
4539 "These separate releases can be identified by version number:"
4544 #: ../src/guestfs.pod:2060
4547 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
4548 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
4554 " | `-------- sub-version\n"
4556 " `------ always '1' because we don't change the ABI\n"
4562 #: ../src/guestfs.pod:2071
4563 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
4568 #: ../src/guestfs.pod:2073
4570 "As time passes we cherry pick fixes from the development branch and backport "
4571 "those into the stable branch, the effect being that the stable branch should "
4572 "get more stable and less buggy over time. So the stable releases are ideal "
4573 "for people who don't need new features but would just like the software to "
4579 #: ../src/guestfs.pod:2079
4580 msgid "Our criteria for backporting changes are:"
4585 #: ../src/guestfs.pod:2085
4587 "Documentation changes which don't affect any code are backported unless the "
4588 "documentation refers to a future feature which is not in stable."
4593 #: ../src/guestfs.pod:2091
4595 "Bug fixes which are not controversial, fix obvious problems, and have been "
4596 "well tested are backported."
4601 #: ../src/guestfs.pod:2096
4603 "Simple rearrangements of code which shouldn't affect how it works get "
4604 "backported. This is so that the code in the two branches doesn't get too "
4605 "far out of step, allowing us to backport future fixes more easily."
4610 #: ../src/guestfs.pod:2102
4612 "We I<don't> backport new features, new APIs, new tools etc, except in one "
4613 "exceptional case: the new feature is required in order to implement an "
4614 "important bug fix."
4619 #: ../src/guestfs.pod:2108
4621 "A new stable branch starts when we think the new features in development are "
4622 "substantial and compelling enough over the current stable branch to warrant "
4623 "it. When that happens we create new stable and development versions 1.N.0 "
4624 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
4625 "stable at this point, but by backporting fixes from development, that branch "
4626 "will stabilize over time."
4630 #: ../src/guestfs.pod:2116
4631 msgid "EXTENDING LIBGUESTFS"
4635 #: ../src/guestfs.pod:2118
4636 msgid "ADDING A NEW API ACTION"
4640 #: ../src/guestfs.pod:2120
4642 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
4643 "documentation) are generated, and this makes it easy to extend the "
4648 #: ../src/guestfs.pod:2124
4649 msgid "To add a new API action there are two changes:"
4653 #: ../src/guestfs.pod:2130
4655 "You need to add a description of the call (name, parameters, return type, "
4656 "tests, documentation) to C<generator/generator_actions.ml>."
4660 #: ../src/guestfs.pod:2133
4662 "There are two sorts of API action, depending on whether the call goes "
4663 "through to the daemon in the appliance, or is serviced entirely by the "
4664 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
4665 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
4666 "an example of the latter, since a trace flag is maintained in the handle and "
4667 "all tracing is done on the library side."
4671 #: ../src/guestfs.pod:2141
4673 "Most new actions are of the first type, and get added to the "
4674 "C<daemon_functions> list. Each function has a unique procedure number used "
4675 "in the RPC protocol which is assigned to that action when we publish "
4676 "libguestfs and cannot be reused. Take the latest procedure number and "
4681 #: ../src/guestfs.pod:2147
4683 "For library-only actions of the second type, add to the "
4684 "C<non_daemon_functions> list. Since these functions are serviced by the "
4685 "library and do not travel over the RPC mechanism to the daemon, these "
4686 "functions do not need a procedure number, and so the procedure number is set "
4691 #: ../src/guestfs.pod:2155
4692 msgid "Implement the action (in C):"
4696 #: ../src/guestfs.pod:2157
4698 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
4699 "C<daemon/> directory."
4703 #: ../src/guestfs.pod:2160
4705 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
4706 "(note: double underscore) in the C<src/> directory."
4710 #: ../src/guestfs.pod:2163
4711 msgid "In either case, use another function as an example of what to do."
4715 #: ../src/guestfs.pod:2167
4716 msgid "After making these changes, use C<make> to compile."
4720 #: ../src/guestfs.pod:2169
4722 "Note that you don't need to implement the RPC, language bindings, manual "
4723 "pages or anything else. It's all automatically generated from the OCaml "
4728 #: ../src/guestfs.pod:2173
4729 msgid "ADDING TESTS FOR AN API ACTION"
4733 #: ../src/guestfs.pod:2175
4735 "You can supply zero or as many tests as you want per API call. The tests "
4736 "can either be added as part of the API description (C<generator/"
4737 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
4738 "into C<regressions/>. Note that adding a script to C<regressions/> is "
4739 "slower, so if possible use the first method."
4743 #: ../src/guestfs.pod:2181
4745 "The following describes the test environment used when you add an API test "
4746 "in C<generator_actions.ml>."
4750 #: ../src/guestfs.pod:2184
4751 msgid "The test environment has 4 block devices:"
4755 #: ../src/guestfs.pod:2188
4756 msgid "C</dev/sda> 500MB"
4760 #: ../src/guestfs.pod:2190
4761 msgid "General block device for testing."
4765 #: ../src/guestfs.pod:2192
4766 msgid "C</dev/sdb> 50MB"
4770 #: ../src/guestfs.pod:2194
4772 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
4777 #: ../src/guestfs.pod:2197
4778 msgid "C</dev/sdc> 10MB"
4782 #: ../src/guestfs.pod:2199
4783 msgid "Used in a few tests where two block devices are needed."
4787 #: ../src/guestfs.pod:2201
4792 #: ../src/guestfs.pod:2203
4793 msgid "ISO with fixed content (see C<images/test.iso>)."
4797 #: ../src/guestfs.pod:2207
4799 "To be able to run the tests in a reasonable amount of time, the libguestfs "
4800 "appliance and block devices are reused between tests. So don't try testing "
4801 "L</guestfs_kill_subprocess> :-x"
4805 #: ../src/guestfs.pod:2211
4807 "Each test starts with an initial scenario, selected using one of the "
4808 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
4809 "initialize the disks mentioned above in a particular way as documented in "
4810 "C<generator_types.ml>. You should not assume anything about the previous "
4811 "contents of other disks that are not initialized."
4815 #: ../src/guestfs.pod:2217
4817 "You can add a prerequisite clause to any individual test. This is a run-"
4818 "time check, which, if it fails, causes the test to be skipped. Useful if "
4819 "testing a command which might not work on all variations of libguestfs "
4820 "builds. A test that has prerequisite of C<Always> means to run "
4825 #: ../src/guestfs.pod:2223
4827 "In addition, packagers can skip individual tests by setting environment "
4828 "variables before running C<make check>."
4832 #: ../src/guestfs.pod:2226
4835 " SKIP_TEST_<CMD>_<NUM>=1\n"
4840 #: ../src/guestfs.pod:2228
4841 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
4845 #: ../src/guestfs.pod:2230
4850 #: ../src/guestfs.pod:2232
4853 " SKIP_TEST_<CMD>=1\n"
4858 #: ../src/guestfs.pod:2234
4859 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
4863 #: ../src/guestfs.pod:2236
4864 msgid "Packagers can run only certain tests by setting for example:"
4868 #: ../src/guestfs.pod:2238
4871 " TEST_ONLY=\"vfs_type zerofree\"\n"
4876 #: ../src/guestfs.pod:2240
4878 "See C<capitests/tests.c> for more details of how these environment variables "
4883 #: ../src/guestfs.pod:2243
4884 msgid "DEBUGGING NEW API ACTIONS"
4888 #: ../src/guestfs.pod:2245
4889 msgid "Test new actions work before submitting them."
4893 #: ../src/guestfs.pod:2247
4894 msgid "You can use guestfish to try out new commands."
4898 #: ../src/guestfs.pod:2249
4900 "Debugging the daemon is a problem because it runs inside a minimal "
4901 "environment. However you can fprintf messages in the daemon to stderr, and "
4902 "they will show up if you use C<guestfish -v>."
4906 #: ../src/guestfs.pod:2253
4907 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
4911 #: ../src/guestfs.pod:2255
4913 "Our C source code generally adheres to some basic code-formatting "
4914 "conventions. The existing code base is not totally consistent on this "
4915 "front, but we do prefer that contributed code be formatted similarly. In "
4916 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
4917 "indentation level, and other than that, follow the K&R style."
4921 #: ../src/guestfs.pod:2261
4923 "If you use Emacs, add the following to one of one of your start-up files (e."
4924 "g., ~/.emacs), to help ensure that you get indentation right:"
4928 #: ../src/guestfs.pod:2264
4931 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
4932 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
4933 " (add-hook 'find-file-hook\n"
4934 " '(lambda () (if (and buffer-file-name\n"
4935 " (string-match \"/libguestfs\\\\>\"\n"
4936 " (buffer-file-name))\n"
4937 " (not (string-equal mode-name \"Change Log\"))\n"
4938 " (not (string-equal mode-name \"Makefile\")))\n"
4939 " (setq indent-tabs-mode nil))))\n"
4944 #: ../src/guestfs.pod:2274
4947 " ;;; When editing C sources in libguestfs, use this style.\n"
4948 " (defun libguestfs-c-mode ()\n"
4949 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
4951 " (c-set-style \"K&R\")\n"
4952 " (setq c-indent-level 2)\n"
4953 " (setq c-basic-offset 2))\n"
4954 " (add-hook 'c-mode-hook\n"
4955 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
4956 " (buffer-file-name))\n"
4957 " (libguestfs-c-mode))))\n"
4962 #: ../src/guestfs.pod:2286
4963 msgid "Enable warnings when compiling (and fix any problems this finds):"
4967 #: ../src/guestfs.pod:2289
4970 " ./configure --enable-gcc-warnings\n"
4975 #: ../src/guestfs.pod:2291
4976 msgid "Useful targets are:"
4980 #: ../src/guestfs.pod:2293
4983 " make syntax-check # checks the syntax of the C code\n"
4984 " make check # runs the test suite\n"
4989 #: ../src/guestfs.pod:2296
4990 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
4994 #: ../src/guestfs.pod:2298
4996 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
4997 "which are used to do shell quoting."
5001 #: ../src/guestfs.pod:2303
5006 #: ../src/guestfs.pod:2305
5008 "Simple shell quoted string. Any spaces or other shell characters are "
5013 #: ../src/guestfs.pod:2308
5018 #: ../src/guestfs.pod:2310
5020 "Same as C<%Q> except the string is treated as a path which is prefixed by "
5026 #: ../src/guestfs.pod:2315 ../fish/guestfish.pod:240 ../fish/guestfish.pod:594
5027 msgid "For example:"
5031 #: ../src/guestfs.pod:2317
5034 " asprintf (&cmd, \"cat %R\", path);\n"
5039 #: ../src/guestfs.pod:2319
5040 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
5044 #: ../src/guestfs.pod:2321
5046 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
5047 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
5048 "they are not passed via the shell (instead, straight to exec). You probably "
5049 "want to use the C<sysroot_path()> function however."
5053 #: ../src/guestfs.pod:2327
5054 msgid "SUBMITTING YOUR NEW API ACTIONS"
5058 #: ../src/guestfs.pod:2329
5060 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
5061 "libguestfs> and CC to L<rjones@redhat.com>."
5065 #: ../src/guestfs.pod:2333
5066 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
5070 #: ../src/guestfs.pod:2335
5071 msgid "We support i18n (gettext anyhow) in the library."
5075 #: ../src/guestfs.pod:2337
5077 "However many messages come from the daemon, and we don't translate those at "
5078 "the moment. One reason is that the appliance generally has all locale files "
5079 "removed from it, because they take up a lot of space. So we'd have to readd "
5080 "some of those, as well as copying our PO files into the appliance."
5084 #: ../src/guestfs.pod:2343
5086 "Debugging messages are never translated, since they are intended for the "
5091 #: ../src/guestfs.pod:2346
5092 msgid "SOURCE CODE SUBDIRECTORIES"
5096 #: ../src/guestfs.pod:2350
5097 msgid "C<appliance>"
5101 #: ../src/guestfs.pod:2352
5102 msgid "The libguestfs appliance, build scripts and so on."
5106 #: ../src/guestfs.pod:2354
5107 msgid "C<capitests>"
5111 #: ../src/guestfs.pod:2356
5112 msgid "Automated tests of the C API."
5116 #: ../src/guestfs.pod:2358
5121 #: ../src/guestfs.pod:2360
5123 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
5128 #: ../src/guestfs.pod:2363
5133 #: ../src/guestfs.pod:2365
5134 msgid "Outside contributions, experimental parts."
5138 #: ../src/guestfs.pod:2367
5143 #: ../src/guestfs.pod:2369
5145 "The daemon that runs inside the libguestfs appliance and carries out actions."
5149 #: ../src/guestfs.pod:2372
5154 #: ../src/guestfs.pod:2374
5155 msgid "L<virt-df(1)> command and documentation."
5159 #: ../src/guestfs.pod:2376
5164 #: ../src/guestfs.pod:2378
5165 msgid "C API example code."
5169 #: ../src/guestfs.pod:2380
5174 #: ../src/guestfs.pod:2382
5176 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
5177 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
5178 "L<virt-tar-out(1)>."
5182 #: ../src/guestfs.pod:2386
5187 #: ../src/guestfs.pod:2388
5189 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
5193 #: ../src/guestfs.pod:2390
5194 msgid "C<generator>"
5198 #: ../src/guestfs.pod:2392
5200 "The crucially important generator, used to automatically generate large "
5201 "amounts of boilerplate C code for things like RPC and bindings."
5205 #: ../src/guestfs.pod:2395
5210 #: ../src/guestfs.pod:2397
5211 msgid "Files used by the test suite."
5215 #: ../src/guestfs.pod:2399
5216 msgid "Some \"phony\" guest images which we test against."
5220 #: ../src/guestfs.pod:2401
5221 msgid "C<inspector>"
5225 #: ../src/guestfs.pod:2403
5226 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
5230 #: ../src/guestfs.pod:2405
5235 #: ../src/guestfs.pod:2407
5236 msgid "Logo used on the website. The fish is called Arthur by the way."
5240 #: ../src/guestfs.pod:2409
5245 #: ../src/guestfs.pod:2411
5246 msgid "M4 macros used by autoconf."
5250 #: ../src/guestfs.pod:2413
5255 #: ../src/guestfs.pod:2415
5256 msgid "Translations of simple gettext strings."
5260 #: ../src/guestfs.pod:2417
5265 #: ../src/guestfs.pod:2419
5267 "The build infrastructure and PO files for translations of manpages and POD "
5268 "files. Eventually this will be combined with the C<po> directory, but that "
5269 "is rather complicated."
5273 #: ../src/guestfs.pod:2423
5274 msgid "C<regressions>"
5278 #: ../src/guestfs.pod:2425
5279 msgid "Regression tests."
5283 #: ../src/guestfs.pod:2427
5288 #: ../src/guestfs.pod:2429
5289 msgid "L<virt-rescue(1)> command and documentation."
5293 #: ../src/guestfs.pod:2431
5298 #: ../src/guestfs.pod:2433
5299 msgid "Source code to the C library."
5303 #: ../src/guestfs.pod:2435
5308 #: ../src/guestfs.pod:2437
5309 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
5313 #: ../src/guestfs.pod:2439
5314 msgid "C<test-tool>"
5318 #: ../src/guestfs.pod:2441
5320 "Test tool for end users to test if their qemu/kernel combination will work "
5325 #: ../src/guestfs.pod:2444
5330 #: ../src/guestfs.pod:2446
5335 #: ../src/guestfs.pod:2448
5340 #: ../src/guestfs.pod:2450
5345 #: ../src/guestfs.pod:2452
5350 #: ../src/guestfs.pod:2454
5355 #: ../src/guestfs.pod:2456
5360 #: ../src/guestfs.pod:2458
5365 #: ../src/guestfs.pod:2460
5366 msgid "Language bindings."
5371 #: ../src/guestfs.pod:2464 ../fish/guestfish.pod:991
5372 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
5373 msgid "ENVIRONMENT VARIABLES"
5378 #: ../src/guestfs.pod:2468 ../fish/guestfish.pod:1017
5379 msgid "LIBGUESTFS_APPEND"
5384 #: ../src/guestfs.pod:2470 ../fish/guestfish.pod:1019
5385 msgid "Pass additional options to the guest kernel."
5390 #: ../src/guestfs.pod:2472 ../fish/guestfish.pod:1021
5391 msgid "LIBGUESTFS_DEBUG"
5396 #: ../src/guestfs.pod:2474
5398 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
5399 "effect as calling C<guestfs_set_verbose (g, 1)>."
5404 #: ../src/guestfs.pod:2477 ../fish/guestfish.pod:1026
5405 msgid "LIBGUESTFS_MEMSIZE"
5410 #: ../src/guestfs.pod:2479 ../fish/guestfish.pod:1028
5412 "Set the memory allocated to the qemu process, in megabytes. For example:"
5417 #: ../src/guestfs.pod:2482 ../fish/guestfish.pod:1031
5420 " LIBGUESTFS_MEMSIZE=700\n"
5426 #: ../src/guestfs.pod:2484 ../fish/guestfish.pod:1033
5427 msgid "LIBGUESTFS_PATH"
5432 #: ../src/guestfs.pod:2486
5434 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
5435 "the discussion of paths in section PATH above."
5440 #: ../src/guestfs.pod:2489 ../fish/guestfish.pod:1038
5441 msgid "LIBGUESTFS_QEMU"
5446 #: ../src/guestfs.pod:2491 ../fish/guestfish.pod:1040
5448 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
5449 "which was found at compile time by the configure script is used."
5454 #: ../src/guestfs.pod:2495
5455 msgid "See also L</QEMU WRAPPERS> above."
5460 #: ../src/guestfs.pod:2497 ../fish/guestfish.pod:1044
5461 msgid "LIBGUESTFS_TRACE"
5466 #: ../src/guestfs.pod:2499
5468 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
5469 "effect as calling C<guestfs_set_trace (g, 1)>."
5474 #: ../src/guestfs.pod:2502 ../fish/guestfish.pod:1053
5479 #: ../src/guestfs.pod:2504 ../fish/guestfish.pod:1055
5481 "Location of temporary directory, defaults to C</tmp> except for the cached "
5482 "supermin appliance which defaults to C</var/tmp>."
5486 #: ../src/guestfs.pod:2507 ../fish/guestfish.pod:1058
5488 "If libguestfs was compiled to use the supermin appliance then the real "
5489 "appliance is cached in this directory, shared between all handles belonging "
5490 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
5491 "use in case C</var/tmp> is not large enough."
5496 #: ../src/guestfs.pod:2515 ../fish/guestfish.pod:1116
5497 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
5498 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:572
5499 #: ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189
5500 #: ../tools/virt-tar.pl:286 ../tools/virt-make-fs.pl:534
5501 #: ../tools/virt-list-partitions.pl:257
5506 #: ../src/guestfs.pod:2517
5508 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
5509 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in"
5510 "(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems"
5511 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
5512 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
5513 "tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)"
5514 ">, L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
5519 #: ../src/guestfs.pod:2544
5521 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
5522 "(8)>, L<disktype(1)>."
5527 #: ../src/guestfs.pod:2551 ../tools/virt-win-reg.pl:587
5528 #: ../tools/virt-make-fs.pl:548
5534 #: ../src/guestfs.pod:2553
5535 msgid "To get a list of bugs against libguestfs use this link:"
5540 #: ../src/guestfs.pod:2555
5542 "L<https://bugzilla.redhat.com/buglist.cgi?"
5543 "component=libguestfs&product=Virtualization+Tools>"
5548 #: ../src/guestfs.pod:2557
5549 msgid "To report a new bug against libguestfs use this link:"
5554 #: ../src/guestfs.pod:2559
5556 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
5557 "component=libguestfs&product=Virtualization+Tools>"
5562 #: ../src/guestfs.pod:2561
5563 msgid "When reporting a bug, please check:"
5568 #: ../src/guestfs.pod:2567
5569 msgid "That the bug hasn't been reported already."
5574 #: ../src/guestfs.pod:2571
5575 msgid "That you are testing a recent version."
5580 #: ../src/guestfs.pod:2575
5581 msgid "Describe the bug accurately, and give a way to reproduce it."
5586 #: ../src/guestfs.pod:2579
5588 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
5594 #: ../src/guestfs.pod:2584 ../fish/guestfish.pod:1139
5595 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
5601 #: ../src/guestfs.pod:2586 ../fish/guestfish.pod:1141
5602 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
5603 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
5608 #: ../src/guestfs.pod:2588 ../fish/guestfish.pod:1143
5609 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
5610 #: ../tools/virt-edit.pl:368 ../tools/virt-win-reg.pl:602
5611 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206
5612 #: ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:563
5613 #: ../tools/virt-list-partitions.pl:273
5619 #: ../src/guestfs.pod:2590 ../fish/guestfish.pod:1145
5620 #: ../fuse/guestmount.pod:250
5621 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
5626 #: ../src/guestfs.pod:2593
5628 "This library is free software; you can redistribute it and/or modify it "
5629 "under the terms of the GNU Lesser General Public License as published by the "
5630 "Free Software Foundation; either version 2 of the License, or (at your "
5631 "option) any later version."
5636 #: ../src/guestfs.pod:2598
5638 "This library is distributed in the hope that it will be useful, but WITHOUT "
5639 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
5640 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
5646 #: ../src/guestfs.pod:2603
5648 "You should have received a copy of the GNU Lesser General Public License "
5649 "along with this library; if not, write to the Free Software Foundation, "
5650 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
5655 #: ../src/guestfs-actions.pod:1
5656 msgid "guestfs_add_cdrom"
5661 #: ../src/guestfs-actions.pod:3
5665 " guestfs_add_cdrom (guestfs_h *g,\n"
5666 " const char *filename);\n"
5672 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
5673 msgid "This function adds a virtual CD-ROM disk image to the guest."
5678 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
5679 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
5684 #: ../src/guestfs-actions.pod:17
5686 "This call checks for the existence of C<filename>. This stops you from "
5687 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5688 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
5694 #: ../src/guestfs-actions.pod:24
5696 "If you just want to add an ISO file (often you use this as an efficient way "
5697 "to transfer large files into the guest), then you should probably use "
5698 "C<guestfs_add_drive_ro> instead."
5703 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:126
5704 #: ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:224
5705 #: ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259
5706 #: ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:293
5707 #: ../src/guestfs-actions.pod:408 ../src/guestfs-actions.pod:428
5708 #: ../src/guestfs-actions.pod:442 ../src/guestfs-actions.pod:487
5709 #: ../src/guestfs-actions.pod:515 ../src/guestfs-actions.pod:533
5710 #: ../src/guestfs-actions.pod:600 ../src/guestfs-actions.pod:633
5711 #: ../src/guestfs-actions.pod:647 ../src/guestfs-actions.pod:662
5712 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
5713 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
5714 #: ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:988
5715 #: ../src/guestfs-actions.pod:1006 ../src/guestfs-actions.pod:1090
5716 #: ../src/guestfs-actions.pod:1108 ../src/guestfs-actions.pod:1127
5717 #: ../src/guestfs-actions.pod:1141 ../src/guestfs-actions.pod:1161
5718 #: ../src/guestfs-actions.pod:1231 ../src/guestfs-actions.pod:1262
5719 #: ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:1324
5720 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1464
5721 #: ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1704
5722 #: ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2243
5723 #: ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2448
5724 #: ../src/guestfs-actions.pod:2483 ../src/guestfs-actions.pod:3318
5725 #: ../src/guestfs-actions.pod:3333 ../src/guestfs-actions.pod:3353
5726 #: ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3522
5727 #: ../src/guestfs-actions.pod:3535 ../src/guestfs-actions.pod:3549
5728 #: ../src/guestfs-actions.pod:3564 ../src/guestfs-actions.pod:3600
5729 #: ../src/guestfs-actions.pod:3672 ../src/guestfs-actions.pod:3692
5730 #: ../src/guestfs-actions.pod:3709 ../src/guestfs-actions.pod:3732
5731 #: ../src/guestfs-actions.pod:3755 ../src/guestfs-actions.pod:3787
5732 #: ../src/guestfs-actions.pod:3806 ../src/guestfs-actions.pod:3825
5733 #: ../src/guestfs-actions.pod:3860 ../src/guestfs-actions.pod:3872
5734 #: ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3924
5735 #: ../src/guestfs-actions.pod:3937 ../src/guestfs-actions.pod:3952
5736 #: ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:4062
5737 #: ../src/guestfs-actions.pod:4082 ../src/guestfs-actions.pod:4095
5738 #: ../src/guestfs-actions.pod:4146 ../src/guestfs-actions.pod:4164
5739 #: ../src/guestfs-actions.pod:4182 ../src/guestfs-actions.pod:4198
5740 #: ../src/guestfs-actions.pod:4212 ../src/guestfs-actions.pod:4226
5741 #: ../src/guestfs-actions.pod:4243 ../src/guestfs-actions.pod:4258
5742 #: ../src/guestfs-actions.pod:4278 ../src/guestfs-actions.pod:4336
5743 #: ../src/guestfs-actions.pod:4409 ../src/guestfs-actions.pod:4440
5744 #: ../src/guestfs-actions.pod:4459 ../src/guestfs-actions.pod:4478
5745 #: ../src/guestfs-actions.pod:4490 ../src/guestfs-actions.pod:4507
5746 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4535
5747 #: ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:4585
5748 #: ../src/guestfs-actions.pod:4600 ../src/guestfs-actions.pod:4620
5749 #: ../src/guestfs-actions.pod:4634 ../src/guestfs-actions.pod:4651
5750 #: ../src/guestfs-actions.pod:4700 ../src/guestfs-actions.pod:4737
5751 #: ../src/guestfs-actions.pod:4751 ../src/guestfs-actions.pod:4779
5752 #: ../src/guestfs-actions.pod:4796 ../src/guestfs-actions.pod:4814
5753 #: ../src/guestfs-actions.pod:4948 ../src/guestfs-actions.pod:5005
5754 #: ../src/guestfs-actions.pod:5027 ../src/guestfs-actions.pod:5045
5755 #: ../src/guestfs-actions.pod:5077 ../src/guestfs-actions.pod:5143
5756 #: ../src/guestfs-actions.pod:5160 ../src/guestfs-actions.pod:5173
5757 #: ../src/guestfs-actions.pod:5187 ../src/guestfs-actions.pod:5476
5758 #: ../src/guestfs-actions.pod:5495 ../src/guestfs-actions.pod:5514
5759 #: ../src/guestfs-actions.pod:5526 ../src/guestfs-actions.pod:5538
5760 #: ../src/guestfs-actions.pod:5552 ../src/guestfs-actions.pod:5564
5761 #: ../src/guestfs-actions.pod:5578 ../src/guestfs-actions.pod:5594
5762 #: ../src/guestfs-actions.pod:5615 ../src/guestfs-actions.pod:5634
5763 #: ../src/guestfs-actions.pod:5653 ../src/guestfs-actions.pod:5671
5764 #: ../src/guestfs-actions.pod:5694 ../src/guestfs-actions.pod:5712
5765 #: ../src/guestfs-actions.pod:5731 ../src/guestfs-actions.pod:5752
5766 #: ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:5788
5767 #: ../src/guestfs-actions.pod:5816 ../src/guestfs-actions.pod:5840
5768 #: ../src/guestfs-actions.pod:5859 ../src/guestfs-actions.pod:5883
5769 #: ../src/guestfs-actions.pod:5898 ../src/guestfs-actions.pod:5913
5770 #: ../src/guestfs-actions.pod:5932 ../src/guestfs-actions.pod:5969
5771 #: ../src/guestfs-actions.pod:5992 ../src/guestfs-actions.pod:6018
5772 #: ../src/guestfs-actions.pod:6126 ../src/guestfs-actions.pod:6247
5773 #: ../src/guestfs-actions.pod:6259 ../src/guestfs-actions.pod:6272
5774 #: ../src/guestfs-actions.pod:6285 ../src/guestfs-actions.pod:6307
5775 #: ../src/guestfs-actions.pod:6320 ../src/guestfs-actions.pod:6333
5776 #: ../src/guestfs-actions.pod:6346 ../src/guestfs-actions.pod:6361
5777 #: ../src/guestfs-actions.pod:6420 ../src/guestfs-actions.pod:6437
5778 #: ../src/guestfs-actions.pod:6453 ../src/guestfs-actions.pod:6469
5779 #: ../src/guestfs-actions.pod:6486 ../src/guestfs-actions.pod:6499
5780 #: ../src/guestfs-actions.pod:6519 ../src/guestfs-actions.pod:6555
5781 #: ../src/guestfs-actions.pod:6569 ../src/guestfs-actions.pod:6610
5782 #: ../src/guestfs-actions.pod:6623 ../src/guestfs-actions.pod:6641
5783 #: ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:6711
5784 #: ../src/guestfs-actions.pod:6830 ../src/guestfs-actions.pod:6848
5785 #: ../src/guestfs-actions.pod:6862 ../src/guestfs-actions.pod:6917
5786 #: ../src/guestfs-actions.pod:6930 ../src/guestfs-actions.pod:6975
5787 #: ../src/guestfs-actions.pod:7008 ../src/guestfs-actions.pod:7062
5788 #: ../src/guestfs-actions.pod:7088 ../src/guestfs-actions.pod:7154
5789 #: ../src/guestfs-actions.pod:7173 ../src/guestfs-actions.pod:7202
5790 msgid "This function returns 0 on success or -1 on error."
5795 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:240
5796 #: ../src/guestfs-actions.pod:261 ../fish/guestfish-actions.pod:28
5797 #: ../fish/guestfish-actions.pod:151 ../fish/guestfish-actions.pod:165
5799 "This function is deprecated. In new code, use the C<add_drive_opts> call "
5805 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:243
5806 #: ../src/guestfs-actions.pod:264 ../src/guestfs-actions.pod:1435
5807 #: ../src/guestfs-actions.pod:1921 ../src/guestfs-actions.pod:1942
5808 #: ../src/guestfs-actions.pod:4283 ../src/guestfs-actions.pod:7096
5809 #: ../src/guestfs-actions.pod:7265 ../fish/guestfish-actions.pod:31
5810 #: ../fish/guestfish-actions.pod:154 ../fish/guestfish-actions.pod:168
5811 #: ../fish/guestfish-actions.pod:949 ../fish/guestfish-actions.pod:1306
5812 #: ../fish/guestfish-actions.pod:1320 ../fish/guestfish-actions.pod:2895
5813 #: ../fish/guestfish-actions.pod:4723 ../fish/guestfish-actions.pod:4820
5815 "Deprecated functions will not be removed from the API, but the fact that "
5816 "they are deprecated indicates that there are problems with correct use of "
5822 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:128
5823 #: ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1893
5824 #: ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2094
5825 #: ../src/guestfs-actions.pod:3320 ../src/guestfs-actions.pod:3335
5826 #: ../src/guestfs-actions.pod:4587 ../src/guestfs-actions.pod:5673
5827 #: ../src/guestfs-actions.pod:5790 ../src/guestfs-actions.pod:5900
5828 #: ../src/guestfs-actions.pod:6363 ../src/guestfs-actions.pod:6488
5829 #: ../src/guestfs-actions.pod:7010
5830 msgid "(Added in 0.3)"
5835 #: ../src/guestfs-actions.pod:41
5836 msgid "guestfs_add_domain"
5841 #: ../src/guestfs-actions.pod:43
5845 " guestfs_add_domain (guestfs_h *g,\n"
5846 " const char *dom,\n"
5853 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:137
5854 #: ../src/guestfs-actions.pod:4297
5856 "You may supply a list of optional arguments to this call. Use zero or more "
5857 "of the following pairs of parameters, and terminate the list with C<-1> on "
5858 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
5863 #: ../src/guestfs-actions.pod:53
5866 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
5867 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
5868 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
5874 #: ../src/guestfs-actions.pod:57
5876 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5877 "It works by connecting to libvirt, requesting the domain and domain XML from "
5878 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
5884 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
5886 "The number of disks added is returned. This operation is atomic: if an "
5887 "error is returned, then no disks are added."
5892 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
5894 "This function does some minimal checks to make sure the libvirt domain is "
5895 "not running (unless C<readonly> is true). In a future version we will try "
5896 "to acquire the libvirt lock on each disk."
5901 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
5903 "Disks must be accessible locally. This often means that adding disks from a "
5904 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5905 "unless those disks are accessible via the same device path locally too."
5909 #: ../src/guestfs-actions.pod:74 ../fish/guestfish-actions.pod:58
5911 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
5912 "libvirt.org/uri.html>). If this is not set then we connect to the default "
5913 "libvirt URI (or one set through an environment variable, see the libvirt "
5914 "documentation for full details)."
5919 #: ../src/guestfs-actions.pod:80
5921 "The other optional parameters are passed directly through to "
5922 "C<guestfs_add_drive_opts>."
5927 #: ../src/guestfs-actions.pod:83 ../src/guestfs-actions.pod:336
5928 #: ../src/guestfs-actions.pod:501 ../src/guestfs-actions.pod:679
5929 #: ../src/guestfs-actions.pod:710 ../src/guestfs-actions.pod:728
5930 #: ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:1307
5931 #: ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1864
5932 #: ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:2003
5933 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:2081
5934 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2701
5935 #: ../src/guestfs-actions.pod:2722 ../src/guestfs-actions.pod:4723
5936 #: ../src/guestfs-actions.pod:4851 ../src/guestfs-actions.pod:5257
5937 #: ../src/guestfs-actions.pod:5283 ../src/guestfs-actions.pod:6596
5938 #: ../src/guestfs-actions.pod:7021 ../src/guestfs-actions.pod:7034
5939 #: ../src/guestfs-actions.pod:7047
5940 msgid "On error this function returns -1."
5945 #: ../src/guestfs-actions.pod:85
5946 msgid "(Added in 1.7.4)"
5951 #: ../src/guestfs-actions.pod:87
5952 msgid "guestfs_add_domain_va"
5957 #: ../src/guestfs-actions.pod:89
5961 " guestfs_add_domain_va (guestfs_h *g,\n"
5962 " const char *dom,\n"
5969 #: ../src/guestfs-actions.pod:94
5970 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
5975 #: ../src/guestfs-actions.pod:96 ../src/guestfs-actions.pod:107
5976 #: ../src/guestfs-actions.pod:200 ../src/guestfs-actions.pod:211
5977 #: ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4362
5978 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
5983 #: ../src/guestfs-actions.pod:98
5984 msgid "guestfs_add_domain_argv"
5989 #: ../src/guestfs-actions.pod:100
5993 " guestfs_add_domain_argv (guestfs_h *g,\n"
5994 " const char *dom,\n"
5995 " const struct guestfs_add_domain_argv *optargs);\n"
6001 #: ../src/guestfs-actions.pod:105
6002 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
6007 #: ../src/guestfs-actions.pod:109
6008 msgid "guestfs_add_drive"
6013 #: ../src/guestfs-actions.pod:111
6017 " guestfs_add_drive (guestfs_h *g,\n"
6018 " const char *filename);\n"
6024 #: ../src/guestfs-actions.pod:115
6026 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
6027 "optional parameters, so the disk is added writable, with the format being "
6028 "detected automatically."
6033 #: ../src/guestfs-actions.pod:119
6035 "Automatic detection of the format opens you up to a potential security hole "
6036 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6037 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6038 "you should think about replacing calls to this function with calls to "
6039 "C<guestfs_add_drive_opts>, and specifying the format."
6044 #: ../src/guestfs-actions.pod:130
6045 msgid "guestfs_add_drive_opts"
6050 #: ../src/guestfs-actions.pod:132
6054 " guestfs_add_drive_opts (guestfs_h *g,\n"
6055 " const char *filename,\n"
6062 #: ../src/guestfs-actions.pod:142
6065 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
6066 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
6067 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
6073 #: ../src/guestfs-actions.pod:146 ../fish/guestfish-actions.pod:90
6075 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6076 "The first time you call this function, the disk appears as C</dev/sda>, the "
6077 "second time as C</dev/sdb>, and so on."
6082 #: ../src/guestfs-actions.pod:151 ../fish/guestfish-actions.pod:95
6084 "You don't necessarily need to be root when using libguestfs. However you "
6085 "obviously do need sufficient permissions to access the filename for whatever "
6086 "operations you want to perform (ie. read access if you just want to read the "
6087 "image or write access if you want to modify the image)."
6092 #: ../src/guestfs-actions.pod:157 ../fish/guestfish-actions.pod:101
6093 msgid "This call checks that C<filename> exists."
6098 #: ../src/guestfs-actions.pod:159 ../src/guestfs-actions.pod:4308
6099 #: ../fish/guestfish-actions.pod:103 ../fish/guestfish-actions.pod:2906
6100 msgid "The optional arguments are:"
6105 #: ../src/guestfs-actions.pod:163 ../fish/guestfish-actions.pod:107
6111 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
6113 "If true then the image is treated as read-only. Writes are still allowed, "
6114 "but they are stored in a temporary snapshot overlay which is discarded at "
6115 "the end. The disk that you add is not modified."
6120 #: ../src/guestfs-actions.pod:169 ../fish/guestfish-actions.pod:113
6126 #: ../src/guestfs-actions.pod:171
6128 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
6129 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
6130 "Possible formats include C<raw> and C<qcow2>."
6135 #: ../src/guestfs-actions.pod:175 ../fish/guestfish-actions.pod:119
6137 "Automatic detection of the format opens you up to a potential security hole "
6138 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6139 "RHBZ#642934. Specifying the format closes this security hole."
6144 #: ../src/guestfs-actions.pod:180 ../fish/guestfish-actions.pod:124
6150 #: ../src/guestfs-actions.pod:182
6152 "This rarely-used option lets you emulate the behaviour of the deprecated "
6153 "C<guestfs_add_drive_with_if> call (q.v.)"
6158 #: ../src/guestfs-actions.pod:189
6159 msgid "(Added in 1.5.23)"
6164 #: ../src/guestfs-actions.pod:191
6165 msgid "guestfs_add_drive_opts_va"
6170 #: ../src/guestfs-actions.pod:193
6174 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
6175 " const char *filename,\n"
6182 #: ../src/guestfs-actions.pod:198
6183 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
6188 #: ../src/guestfs-actions.pod:202
6189 msgid "guestfs_add_drive_opts_argv"
6194 #: ../src/guestfs-actions.pod:204
6198 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
6199 " const char *filename,\n"
6200 " const struct guestfs_add_drive_opts_argv *optargs);\n"
6206 #: ../src/guestfs-actions.pod:209
6207 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
6212 #: ../src/guestfs-actions.pod:213
6213 msgid "guestfs_add_drive_ro"
6218 #: ../src/guestfs-actions.pod:215
6222 " guestfs_add_drive_ro (guestfs_h *g,\n"
6223 " const char *filename);\n"
6229 #: ../src/guestfs-actions.pod:219
6231 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
6232 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
6233 "disk is added read-only, with the format being detected automatically."
6238 #: ../src/guestfs-actions.pod:226
6239 msgid "(Added in 1.0.38)"
6244 #: ../src/guestfs-actions.pod:228
6245 msgid "guestfs_add_drive_ro_with_if"
6250 #: ../src/guestfs-actions.pod:230
6254 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
6255 " const char *filename,\n"
6256 " const char *iface);\n"
6262 #: ../src/guestfs-actions.pod:235
6264 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
6265 "QEMU interface emulation to use at run time."
6270 #: ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:268
6271 #: ../src/guestfs-actions.pod:2333
6272 msgid "(Added in 1.0.84)"
6277 #: ../src/guestfs-actions.pod:249
6278 msgid "guestfs_add_drive_with_if"
6283 #: ../src/guestfs-actions.pod:251
6287 " guestfs_add_drive_with_if (guestfs_h *g,\n"
6288 " const char *filename,\n"
6289 " const char *iface);\n"
6295 #: ../src/guestfs-actions.pod:256
6297 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
6298 "QEMU interface emulation to use at run time."
6303 #: ../src/guestfs-actions.pod:270
6304 msgid "guestfs_aug_clear"
6309 #: ../src/guestfs-actions.pod:272
6313 " guestfs_aug_clear (guestfs_h *g,\n"
6314 " const char *augpath);\n"
6320 #: ../src/guestfs-actions.pod:276 ../fish/guestfish-actions.pod:176
6322 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6323 "L<augtool(1)> C<clear> command."
6328 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:2083
6329 msgid "(Added in 1.3.4)"
6334 #: ../src/guestfs-actions.pod:283
6335 msgid "guestfs_aug_close"
6340 #: ../src/guestfs-actions.pod:285
6344 " guestfs_aug_close (guestfs_h *g);\n"
6350 #: ../src/guestfs-actions.pod:288
6352 "Close the current Augeas handle and free up any resources used by it. After "
6353 "calling this, you have to call C<guestfs_aug_init> again before you can use "
6354 "any other Augeas functions."
6359 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:320
6360 #: ../src/guestfs-actions.pod:338 ../src/guestfs-actions.pod:352
6361 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
6362 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:475
6363 #: ../src/guestfs-actions.pod:489 ../src/guestfs-actions.pod:503
6364 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
6365 #: ../src/guestfs-actions.pod:5334
6366 msgid "(Added in 0.7)"
6371 #: ../src/guestfs-actions.pod:297
6372 msgid "guestfs_aug_defnode"
6377 #: ../src/guestfs-actions.pod:299
6380 " struct guestfs_int_bool *\n"
6381 " guestfs_aug_defnode (guestfs_h *g,\n"
6382 " const char *name,\n"
6383 " const char *expr,\n"
6384 " const char *val);\n"
6390 #: ../src/guestfs-actions.pod:305 ../fish/guestfish-actions.pod:192
6392 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6397 #: ../src/guestfs-actions.pod:308
6399 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6400 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
6401 "containing that single node."
6406 #: ../src/guestfs-actions.pod:312 ../fish/guestfish-actions.pod:199
6408 "On success this returns a pair containing the number of nodes in the "
6409 "nodeset, and a boolean flag if a node was created."
6414 #: ../src/guestfs-actions.pod:316
6416 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
6417 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
6422 #: ../src/guestfs-actions.pod:322
6423 msgid "guestfs_aug_defvar"
6428 #: ../src/guestfs-actions.pod:324
6432 " guestfs_aug_defvar (guestfs_h *g,\n"
6433 " const char *name,\n"
6434 " const char *expr);\n"
6440 #: ../src/guestfs-actions.pod:329 ../fish/guestfish-actions.pod:207
6442 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6443 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6448 #: ../src/guestfs-actions.pod:333 ../fish/guestfish-actions.pod:211
6450 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6451 "evaluates to something which is not a nodeset."
6456 #: ../src/guestfs-actions.pod:340
6457 msgid "guestfs_aug_get"
6462 #: ../src/guestfs-actions.pod:342
6466 " guestfs_aug_get (guestfs_h *g,\n"
6467 " const char *augpath);\n"
6473 #: ../src/guestfs-actions.pod:346 ../fish/guestfish-actions.pod:218
6475 "Look up the value associated with C<path>. If C<path> matches exactly one "
6476 "node, the C<value> is returned."
6481 #: ../src/guestfs-actions.pod:349 ../src/guestfs-actions.pod:849
6482 #: ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:927
6483 #: ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1046
6484 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1193
6485 #: ../src/guestfs-actions.pod:1212 ../src/guestfs-actions.pod:1341
6486 #: ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1644
6487 #: ../src/guestfs-actions.pod:1807 ../src/guestfs-actions.pod:1824
6488 #: ../src/guestfs-actions.pod:1915 ../src/guestfs-actions.pod:1936
6489 #: ../src/guestfs-actions.pod:2106 ../src/guestfs-actions.pod:2298
6490 #: ../src/guestfs-actions.pod:2505 ../src/guestfs-actions.pod:2586
6491 #: ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:2673
6492 #: ../src/guestfs-actions.pod:2787 ../src/guestfs-actions.pod:2818
6493 #: ../src/guestfs-actions.pod:2842 ../src/guestfs-actions.pod:2904
6494 #: ../src/guestfs-actions.pod:2927 ../src/guestfs-actions.pod:3494
6495 #: ../src/guestfs-actions.pod:3844 ../src/guestfs-actions.pod:4014
6496 #: ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:4869
6497 #: ../src/guestfs-actions.pod:5062 ../src/guestfs-actions.pod:5232
6498 #: ../src/guestfs-actions.pod:5410 ../src/guestfs-actions.pod:5459
6499 #: ../src/guestfs-actions.pod:6039 ../src/guestfs-actions.pod:6055
6500 #: ../src/guestfs-actions.pod:6072 ../src/guestfs-actions.pod:6096
6501 #: ../src/guestfs-actions.pod:6770 ../src/guestfs-actions.pod:6789
6502 #: ../src/guestfs-actions.pod:6807 ../src/guestfs-actions.pod:6987
6503 #: ../src/guestfs-actions.pod:7259
6505 "This function returns a string, or NULL on error. I<The caller must free "
6506 "the returned string after use>."
6511 #: ../src/guestfs-actions.pod:354
6512 msgid "guestfs_aug_init"
6517 #: ../src/guestfs-actions.pod:356
6521 " guestfs_aug_init (guestfs_h *g,\n"
6522 " const char *root,\n"
6529 #: ../src/guestfs-actions.pod:361 ../fish/guestfish-actions.pod:225
6531 "Create a new Augeas handle for editing configuration files. If there was "
6532 "any previous Augeas handle associated with this guestfs session, then it is "
6538 #: ../src/guestfs-actions.pod:365
6539 msgid "You must call this before using any other C<guestfs_aug_*> commands."
6544 #: ../src/guestfs-actions.pod:368 ../fish/guestfish-actions.pod:232
6546 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6551 #: ../src/guestfs-actions.pod:371 ../fish/guestfish-actions.pod:235
6553 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6554 "logical I<or> of the following integers:"
6559 #: ../src/guestfs-actions.pod:377 ../fish/guestfish-actions.pod:241
6560 msgid "C<AUG_SAVE_BACKUP> = 1"
6565 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
6566 msgid "Keep the original file with a C<.augsave> extension."
6571 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
6572 msgid "C<AUG_SAVE_NEWFILE> = 2"
6577 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
6579 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6580 "original. Overrides C<AUG_SAVE_BACKUP>."
6585 #: ../src/guestfs-actions.pod:386 ../fish/guestfish-actions.pod:250
6586 msgid "C<AUG_TYPE_CHECK> = 4"
6591 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
6592 msgid "Typecheck lenses (can be expensive)."
6597 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
6598 msgid "C<AUG_NO_STDINC> = 8"
6603 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
6604 msgid "Do not use standard load path for modules."
6609 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
6610 msgid "C<AUG_SAVE_NOOP> = 16"
6615 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
6616 msgid "Make save a no-op, just record what would have been changed."
6621 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
6622 msgid "C<AUG_NO_LOAD> = 32"
6627 #: ../src/guestfs-actions.pod:400
6628 msgid "Do not load the tree in C<guestfs_aug_init>."
6633 #: ../src/guestfs-actions.pod:404
6634 msgid "To close the handle, you can call C<guestfs_aug_close>."
6639 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:270
6640 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6645 #: ../src/guestfs-actions.pod:412
6646 msgid "guestfs_aug_insert"
6651 #: ../src/guestfs-actions.pod:414
6655 " guestfs_aug_insert (guestfs_h *g,\n"
6656 " const char *augpath,\n"
6657 " const char *label,\n"
6664 #: ../src/guestfs-actions.pod:420 ../fish/guestfish-actions.pod:276
6666 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6667 "or after C<path> (depending on the boolean flag C<before>)."
6672 #: ../src/guestfs-actions.pod:424 ../fish/guestfish-actions.pod:280
6674 "C<path> must match exactly one existing node in the tree, and C<label> must "
6675 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6680 #: ../src/guestfs-actions.pod:432
6681 msgid "guestfs_aug_load"
6686 #: ../src/guestfs-actions.pod:434
6690 " guestfs_aug_load (guestfs_h *g);\n"
6696 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:288
6697 msgid "Load files into the tree."
6702 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
6703 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6708 #: ../src/guestfs-actions.pod:446
6709 msgid "guestfs_aug_ls"
6714 #: ../src/guestfs-actions.pod:448
6718 " guestfs_aug_ls (guestfs_h *g,\n"
6719 " const char *augpath);\n"
6725 #: ../src/guestfs-actions.pod:452
6727 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
6728 "sorting the resulting nodes into alphabetical order."
6733 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:471
6734 #: ../src/guestfs-actions.pod:617 ../src/guestfs-actions.pod:1065
6735 #: ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1375
6736 #: ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1497
6737 #: ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:2178
6738 #: ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2213
6739 #: ../src/guestfs-actions.pod:2256 ../src/guestfs-actions.pod:2280
6740 #: ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:2400
6741 #: ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:2861
6742 #: ../src/guestfs-actions.pod:3129 ../src/guestfs-actions.pod:3414
6743 #: ../src/guestfs-actions.pod:3476 ../src/guestfs-actions.pod:3581
6744 #: ../src/guestfs-actions.pod:3986 ../src/guestfs-actions.pod:4684
6745 #: ../src/guestfs-actions.pod:5204 ../src/guestfs-actions.pod:5330
6746 #: ../src/guestfs-actions.pod:5444 ../src/guestfs-actions.pod:6112
6747 #: ../src/guestfs-actions.pod:6173 ../src/guestfs-actions.pod:6228
6748 #: ../src/guestfs-actions.pod:6374 ../src/guestfs-actions.pod:6398
6749 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6900
6750 #: ../src/guestfs-actions.pod:6947 ../src/guestfs-actions.pod:7112
6751 #: ../src/guestfs-actions.pod:7131 ../src/guestfs-actions.pod:7216
6752 #: ../src/guestfs-actions.pod:7235 ../src/guestfs-actions.pod:7281
6753 #: ../src/guestfs-actions.pod:7300
6755 "This function returns a NULL-terminated array of strings (like L<environ(3)"
6756 ">), or NULL if there was an error. I<The caller must free the strings and "
6757 "the array after use>."
6762 #: ../src/guestfs-actions.pod:459 ../src/guestfs-actions.pod:990
6763 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1413
6764 #: ../src/guestfs-actions.pod:3207 ../src/guestfs-actions.pod:3238
6765 #: ../src/guestfs-actions.pod:3827 ../src/guestfs-actions.pod:3877
6766 #: ../src/guestfs-actions.pod:4064 ../src/guestfs-actions.pod:4097
6767 #: ../src/guestfs-actions.pod:4260 ../src/guestfs-actions.pod:4688
6768 #: ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5540
6769 #: ../src/guestfs-actions.pod:5554 ../src/guestfs-actions.pod:5566
6770 #: ../src/guestfs-actions.pod:5974 ../src/guestfs-actions.pod:6612
6771 #: ../src/guestfs-actions.pod:6625 ../src/guestfs-actions.pod:6864
6772 #: ../src/guestfs-actions.pod:7100
6773 msgid "(Added in 0.8)"
6778 #: ../src/guestfs-actions.pod:461
6779 msgid "guestfs_aug_match"
6784 #: ../src/guestfs-actions.pod:463
6788 " guestfs_aug_match (guestfs_h *g,\n"
6789 " const char *augpath);\n"
6795 #: ../src/guestfs-actions.pod:467 ../fish/guestfish-actions.pod:304
6797 "Returns a list of paths which match the path expression C<path>. The "
6798 "returned paths are sufficiently qualified so that they match exactly one "
6799 "node in the current tree."
6804 #: ../src/guestfs-actions.pod:477
6805 msgid "guestfs_aug_mv"
6810 #: ../src/guestfs-actions.pod:479
6814 " guestfs_aug_mv (guestfs_h *g,\n"
6815 " const char *src,\n"
6816 " const char *dest);\n"
6822 #: ../src/guestfs-actions.pod:484 ../fish/guestfish-actions.pod:312
6824 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6825 "C<dest> is overwritten if it exists."
6830 #: ../src/guestfs-actions.pod:491
6831 msgid "guestfs_aug_rm"
6836 #: ../src/guestfs-actions.pod:493
6840 " guestfs_aug_rm (guestfs_h *g,\n"
6841 " const char *augpath);\n"
6847 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:319
6848 msgid "Remove C<path> and all of its children."
6853 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
6854 msgid "On success this returns the number of entries which were removed."
6859 #: ../src/guestfs-actions.pod:505
6860 msgid "guestfs_aug_save"
6865 #: ../src/guestfs-actions.pod:507
6869 " guestfs_aug_save (guestfs_h *g);\n"
6875 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:327
6876 msgid "This writes all pending changes to disk."
6881 #: ../src/guestfs-actions.pod:512
6883 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
6889 #: ../src/guestfs-actions.pod:519
6890 msgid "guestfs_aug_set"
6895 #: ../src/guestfs-actions.pod:521
6899 " guestfs_aug_set (guestfs_h *g,\n"
6900 " const char *augpath,\n"
6901 " const char *val);\n"
6907 #: ../src/guestfs-actions.pod:526 ../fish/guestfish-actions.pod:336
6908 msgid "Set the value associated with C<path> to C<val>."
6913 #: ../src/guestfs-actions.pod:528
6915 "In the Augeas API, it is possible to clear a node by setting the value to "
6916 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6917 "this call. Instead you must use the C<guestfs_aug_clear> call."
6922 #: ../src/guestfs-actions.pod:537
6923 msgid "guestfs_available"
6928 #: ../src/guestfs-actions.pod:539
6932 " guestfs_available (guestfs_h *g,\n"
6933 " char *const *groups);\n"
6939 #: ../src/guestfs-actions.pod:543 ../fish/guestfish-actions.pod:347
6941 "This command is used to check the availability of some groups of "
6942 "functionality in the appliance, which not all builds of the libguestfs "
6943 "appliance will be able to provide."
6948 #: ../src/guestfs-actions.pod:547
6950 "The libguestfs groups, and the functions that those groups correspond to, "
6951 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6952 "runtime by calling C<guestfs_available_all_groups>."
6957 #: ../src/guestfs-actions.pod:552 ../fish/guestfish-actions.pod:356
6959 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
6960 "\"]> would check for the availability of the Linux inotify functions and "
6961 "Augeas (configuration file editing) functions."
6966 #: ../src/guestfs-actions.pod:557 ../fish/guestfish-actions.pod:361
6967 msgid "The command returns no error if I<all> requested groups are available."
6972 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
6974 "It fails with an error if one or more of the requested groups is unavailable "
6980 #: ../src/guestfs-actions.pod:562 ../fish/guestfish-actions.pod:366
6982 "If an unknown group name is included in the list of groups then an error is "
6988 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:369
6994 #: ../src/guestfs-actions.pod:571
6995 msgid "You must call C<guestfs_launch> before calling this function."
7000 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:377
7002 "The reason is because we don't know what groups are supported by the "
7003 "appliance/daemon until it is running and can be queried."
7008 #: ../src/guestfs-actions.pod:579 ../fish/guestfish-actions.pod:383
7010 "If a group of functions is available, this does not necessarily mean that "
7011 "they will work. You still have to check for errors when calling individual "
7012 "API functions even if they are available."
7017 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:390
7019 "It is usually the job of distro packagers to build complete functionality "
7020 "into the libguestfs appliance. Upstream libguestfs, if built from source "
7021 "with all requirements satisfied, will support everything."
7026 #: ../src/guestfs-actions.pod:593
7028 "This call was added in version C<1.0.80>. In previous versions of "
7029 "libguestfs all you could do would be to speculatively execute a command to "
7030 "find out if the daemon implemented it. See also C<guestfs_version>."
7035 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:1163
7036 msgid "(Added in 1.0.80)"
7041 #: ../src/guestfs-actions.pod:604
7042 msgid "guestfs_available_all_groups"
7047 #: ../src/guestfs-actions.pod:606
7051 " guestfs_available_all_groups (guestfs_h *g);\n"
7057 #: ../src/guestfs-actions.pod:609
7059 "This command returns a list of all optional groups that this daemon knows "
7060 "about. Note this returns both supported and unsupported groups. To find "
7061 "out which ones the daemon can actually support you have to call "
7062 "C<guestfs_available> on each member of the returned list."
7067 #: ../src/guestfs-actions.pod:615
7068 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
7073 #: ../src/guestfs-actions.pod:621
7074 msgid "(Added in 1.3.15)"
7079 #: ../src/guestfs-actions.pod:623
7080 msgid "guestfs_base64_in"
7085 #: ../src/guestfs-actions.pod:625
7089 " guestfs_base64_in (guestfs_h *g,\n"
7090 " const char *base64file,\n"
7091 " const char *filename);\n"
7097 #: ../src/guestfs-actions.pod:630 ../fish/guestfish-actions.pod:420
7099 "This command uploads base64-encoded data from C<base64file> to C<filename>."
7104 #: ../src/guestfs-actions.pod:635 ../src/guestfs-actions.pod:649
7105 msgid "(Added in 1.3.5)"
7110 #: ../src/guestfs-actions.pod:637
7111 msgid "guestfs_base64_out"
7116 #: ../src/guestfs-actions.pod:639
7120 " guestfs_base64_out (guestfs_h *g,\n"
7121 " const char *filename,\n"
7122 " const char *base64file);\n"
7128 #: ../src/guestfs-actions.pod:644 ../fish/guestfish-actions.pod:429
7130 "This command downloads the contents of C<filename>, writing it out to local "
7131 "file C<base64file> encoded as base64."
7136 #: ../src/guestfs-actions.pod:651
7137 msgid "guestfs_blockdev_flushbufs"
7142 #: ../src/guestfs-actions.pod:653
7146 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
7147 " const char *device);\n"
7153 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:438
7155 "This tells the kernel to flush internal buffers associated with C<device>."
7160 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:677
7161 #: ../src/guestfs-actions.pod:692 ../src/guestfs-actions.pod:708
7162 #: ../src/guestfs-actions.pod:726 ../src/guestfs-actions.pod:745
7163 #: ../src/guestfs-actions.pod:759 ../src/guestfs-actions.pod:777
7164 #: ../src/guestfs-actions.pod:791 ../src/guestfs-actions.pod:805
7165 #: ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:452
7166 #: ../fish/guestfish-actions.pod:461 ../fish/guestfish-actions.pod:471
7167 #: ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:496
7168 #: ../fish/guestfish-actions.pod:504 ../fish/guestfish-actions.pod:515
7169 #: ../fish/guestfish-actions.pod:523 ../fish/guestfish-actions.pod:531
7170 msgid "This uses the L<blockdev(8)> command."
7175 #: ../src/guestfs-actions.pod:664 ../src/guestfs-actions.pod:681
7176 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:712
7177 #: ../src/guestfs-actions.pod:730 ../src/guestfs-actions.pod:749
7178 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
7179 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
7180 msgid "(Added in 0.9.3)"
7185 #: ../src/guestfs-actions.pod:666
7186 msgid "guestfs_blockdev_getbsz"
7191 #: ../src/guestfs-actions.pod:668
7195 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
7196 " const char *device);\n"
7202 #: ../src/guestfs-actions.pod:672 ../fish/guestfish-actions.pod:447
7203 msgid "This returns the block size of a device."
7208 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:774
7209 #: ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:512
7211 "(Note this is different from both I<size in blocks> and I<filesystem block "
7217 #: ../src/guestfs-actions.pod:683
7218 msgid "guestfs_blockdev_getro"
7223 #: ../src/guestfs-actions.pod:685
7227 " guestfs_blockdev_getro (guestfs_h *g,\n"
7228 " const char *device);\n"
7234 #: ../src/guestfs-actions.pod:689 ../fish/guestfish-actions.pod:458
7236 "Returns a boolean indicating if the block device is read-only (true if read-"
7237 "only, false if not)."
7242 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:1396
7243 #: ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1891
7244 #: ../src/guestfs-actions.pod:1902 ../src/guestfs-actions.pod:1974
7245 #: ../src/guestfs-actions.pod:2029 ../src/guestfs-actions.pod:2044
7246 #: ../src/guestfs-actions.pod:2069 ../src/guestfs-actions.pod:2092
7247 #: ../src/guestfs-actions.pod:2947 ../src/guestfs-actions.pod:2964
7248 #: ../src/guestfs-actions.pod:2983 ../src/guestfs-actions.pod:3146
7249 #: ../src/guestfs-actions.pod:3160 ../src/guestfs-actions.pod:3175
7250 #: ../src/guestfs-actions.pod:3189 ../src/guestfs-actions.pod:3205
7251 #: ../src/guestfs-actions.pod:3220 ../src/guestfs-actions.pod:3236
7252 #: ../src/guestfs-actions.pod:3250 ../src/guestfs-actions.pod:3263
7253 #: ../src/guestfs-actions.pod:3277 ../src/guestfs-actions.pod:3292
7254 #: ../src/guestfs-actions.pod:3307 ../src/guestfs-actions.pod:4833
7255 msgid "This function returns a C truth value on success or -1 on error."
7260 #: ../src/guestfs-actions.pod:698
7261 msgid "guestfs_blockdev_getsize64"
7266 #: ../src/guestfs-actions.pod:700
7270 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
7271 " const char *device);\n"
7277 #: ../src/guestfs-actions.pod:704 ../fish/guestfish-actions.pod:467
7278 msgid "This returns the size of the device in bytes."
7283 #: ../src/guestfs-actions.pod:706
7284 msgid "See also C<guestfs_blockdev_getsz>."
7289 #: ../src/guestfs-actions.pod:714
7290 msgid "guestfs_blockdev_getss"
7295 #: ../src/guestfs-actions.pod:716
7299 " guestfs_blockdev_getss (guestfs_h *g,\n"
7300 " const char *device);\n"
7306 #: ../src/guestfs-actions.pod:720 ../fish/guestfish-actions.pod:477
7308 "This returns the size of sectors on a block device. Usually 512, but can be "
7309 "larger for modern devices."
7314 #: ../src/guestfs-actions.pod:723
7316 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
7322 #: ../src/guestfs-actions.pod:732
7323 msgid "guestfs_blockdev_getsz"
7328 #: ../src/guestfs-actions.pod:734
7332 " guestfs_blockdev_getsz (guestfs_h *g,\n"
7333 " const char *device);\n"
7339 #: ../src/guestfs-actions.pod:738 ../fish/guestfish-actions.pod:489
7341 "This returns the size of the device in units of 512-byte sectors (even if "
7342 "the sectorsize isn't 512 bytes ... weird)."
7347 #: ../src/guestfs-actions.pod:741
7349 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
7350 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
7355 #: ../src/guestfs-actions.pod:751
7356 msgid "guestfs_blockdev_rereadpt"
7361 #: ../src/guestfs-actions.pod:753
7365 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
7366 " const char *device);\n"
7372 #: ../src/guestfs-actions.pod:757 ../fish/guestfish-actions.pod:502
7373 msgid "Reread the partition table on C<device>."
7378 #: ../src/guestfs-actions.pod:765
7379 msgid "guestfs_blockdev_setbsz"
7384 #: ../src/guestfs-actions.pod:767
7388 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
7389 " const char *device,\n"
7390 " int blocksize);\n"
7396 #: ../src/guestfs-actions.pod:772 ../fish/guestfish-actions.pod:510
7397 msgid "This sets the block size of a device."
7402 #: ../src/guestfs-actions.pod:783
7403 msgid "guestfs_blockdev_setro"
7408 #: ../src/guestfs-actions.pod:785
7412 " guestfs_blockdev_setro (guestfs_h *g,\n"
7413 " const char *device);\n"
7419 #: ../src/guestfs-actions.pod:789 ../fish/guestfish-actions.pod:521
7420 msgid "Sets the block device named C<device> to read-only."
7425 #: ../src/guestfs-actions.pod:797
7426 msgid "guestfs_blockdev_setrw"
7431 #: ../src/guestfs-actions.pod:799
7435 " guestfs_blockdev_setrw (guestfs_h *g,\n"
7436 " const char *device);\n"
7442 #: ../src/guestfs-actions.pod:803 ../fish/guestfish-actions.pod:529
7443 msgid "Sets the block device named C<device> to read-write."
7448 #: ../src/guestfs-actions.pod:811
7449 msgid "guestfs_case_sensitive_path"
7454 #: ../src/guestfs-actions.pod:813
7458 " guestfs_case_sensitive_path (guestfs_h *g,\n"
7459 " const char *path);\n"
7465 #: ../src/guestfs-actions.pod:817 ../fish/guestfish-actions.pod:537
7467 "This can be used to resolve case insensitive paths on a filesystem which is "
7468 "case sensitive. The use case is to resolve paths which you have read from "
7469 "Windows configuration files or the Windows Registry, to the true path."
7474 #: ../src/guestfs-actions.pod:822 ../fish/guestfish-actions.pod:542
7476 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7477 "(and probably others), which is that although the underlying filesystem is "
7478 "case-insensitive, the driver exports the filesystem to Linux as case-"
7484 #: ../src/guestfs-actions.pod:827 ../fish/guestfish-actions.pod:547
7486 "One consequence of this is that special directories such as C<c:\\windows> "
7487 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7488 "precise details of how they were created. In Windows itself this would not "
7494 #: ../src/guestfs-actions.pod:833 ../fish/guestfish-actions.pod:553
7496 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
7502 #: ../src/guestfs-actions.pod:836 ../fish/guestfish-actions.pod:556
7504 "This function resolves the true case of each element in the path and returns "
7505 "the case-sensitive path."
7510 #: ../src/guestfs-actions.pod:839
7512 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
7513 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
7514 "how the directories were originally created under Windows)."
7519 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:564
7520 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7525 #: ../src/guestfs-actions.pod:847
7526 msgid "See also C<guestfs_realpath>."
7531 #: ../src/guestfs-actions.pod:852 ../src/guestfs-actions.pod:6792
7532 msgid "(Added in 1.0.75)"
7537 #: ../src/guestfs-actions.pod:854
7543 #: ../src/guestfs-actions.pod:856
7547 " guestfs_cat (guestfs_h *g,\n"
7548 " const char *path);\n"
7554 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5320
7555 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:3554
7556 msgid "Return the contents of the file named C<path>."
7561 #: ../src/guestfs-actions.pod:862
7563 "Note that this function cannot correctly handle binary files (specifically, "
7564 "files containing C<\\0> character which is treated as end of string). For "
7565 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
7566 "functions which have a more complex interface."
7571 #: ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:1049
7572 #: ../src/guestfs-actions.pod:1069 ../src/guestfs-actions.pod:1360
7573 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1482
7574 #: ../src/guestfs-actions.pod:1501 ../src/guestfs-actions.pod:1750
7575 #: ../src/guestfs-actions.pod:2198 ../src/guestfs-actions.pod:2217
7576 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2284
7577 #: ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2330
7578 #: ../src/guestfs-actions.pod:5102 ../src/guestfs-actions.pod:5128
7579 #: ../src/guestfs-actions.pod:5259 ../src/guestfs-actions.pod:5285
7580 #: ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:6177
7581 #: ../src/guestfs-actions.pod:6232 ../src/guestfs-actions.pod:6378
7582 #: ../src/guestfs-actions.pod:6402 ../src/guestfs-actions.pod:7064
7583 #: ../src/guestfs-actions.pod:7090 ../src/guestfs-actions.pod:7116
7584 #: ../src/guestfs-actions.pod:7135 ../src/guestfs-actions.pod:7220
7585 #: ../src/guestfs-actions.pod:7239 ../src/guestfs-actions.pod:7285
7586 #: ../src/guestfs-actions.pod:7304 ../fish/guestfish-actions.pod:580
7587 #: ../fish/guestfish-actions.pod:715 ../fish/guestfish-actions.pod:727
7588 #: ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:913
7589 #: ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:990
7590 #: ../fish/guestfish-actions.pod:1185 ../fish/guestfish-actions.pod:1480
7591 #: ../fish/guestfish-actions.pod:1490 ../fish/guestfish-actions.pod:1518
7592 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:1543
7593 #: ../fish/guestfish-actions.pod:1562 ../fish/guestfish-actions.pod:3424
7594 #: ../fish/guestfish-actions.pod:3439 ../fish/guestfish-actions.pod:3515
7595 #: ../fish/guestfish-actions.pod:3532 ../fish/guestfish-actions.pod:3547
7596 #: ../fish/guestfish-actions.pod:4143 ../fish/guestfish-actions.pod:4189
7597 #: ../fish/guestfish-actions.pod:4274 ../fish/guestfish-actions.pod:4289
7598 #: ../fish/guestfish-actions.pod:4699 ../fish/guestfish-actions.pod:4717
7599 #: ../fish/guestfish-actions.pod:4734 ../fish/guestfish-actions.pod:4744
7600 #: ../fish/guestfish-actions.pod:4792 ../fish/guestfish-actions.pod:4802
7601 #: ../fish/guestfish-actions.pod:4831 ../fish/guestfish-actions.pod:4841
7603 "Because of the message protocol, there is a transfer limit of somewhere "
7604 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7609 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:3418
7610 #: ../src/guestfs-actions.pod:3480 ../src/guestfs-actions.pod:3497
7611 #: ../src/guestfs-actions.pod:3585 ../src/guestfs-actions.pod:3990
7612 #: ../src/guestfs-actions.pod:4004 ../src/guestfs-actions.pod:5208
7613 #: ../src/guestfs-actions.pod:5222 ../src/guestfs-actions.pod:6951
7614 #: ../src/guestfs-actions.pod:6965
7615 msgid "(Added in 0.4)"
7620 #: ../src/guestfs-actions.pod:875
7621 msgid "guestfs_checksum"
7626 #: ../src/guestfs-actions.pod:877
7630 " guestfs_checksum (guestfs_h *g,\n"
7631 " const char *csumtype,\n"
7632 " const char *path);\n"
7638 #: ../src/guestfs-actions.pod:882 ../fish/guestfish-actions.pod:587
7640 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7645 #: ../src/guestfs-actions.pod:885 ../fish/guestfish-actions.pod:590
7647 "The type of checksum to compute is given by the C<csumtype> parameter which "
7648 "must have one of the following values:"
7653 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:595
7659 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
7661 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7667 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:600
7673 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
7674 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7679 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
7685 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
7686 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7691 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
7697 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
7698 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7703 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
7709 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
7710 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7715 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
7721 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
7722 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7727 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
7733 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
7734 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7739 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:626
7740 msgid "The checksum is returned as a printable string."
7745 #: ../src/guestfs-actions.pod:923
7746 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
7751 #: ../src/guestfs-actions.pod:925
7752 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
7757 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:1238
7758 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:3162
7759 #: ../src/guestfs-actions.pod:3191 ../src/guestfs-actions.pod:3252
7760 #: ../src/guestfs-actions.pod:3279 ../src/guestfs-actions.pod:6648
7761 msgid "(Added in 1.0.2)"
7766 #: ../src/guestfs-actions.pod:932
7767 msgid "guestfs_checksum_device"
7772 #: ../src/guestfs-actions.pod:934
7776 " guestfs_checksum_device (guestfs_h *g,\n"
7777 " const char *csumtype,\n"
7778 " const char *device);\n"
7784 #: ../src/guestfs-actions.pod:939
7786 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7787 "device named C<device>. For the types of checksums supported see the "
7788 "C<guestfs_checksum> command."
7793 #: ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:4739
7794 #: ../src/guestfs-actions.pod:4798 ../src/guestfs-actions.pod:4835
7795 #: ../src/guestfs-actions.pod:4853 ../src/guestfs-actions.pod:5029
7796 #: ../src/guestfs-actions.pod:6557 ../src/guestfs-actions.pod:6571
7797 #: ../src/guestfs-actions.pod:6977
7798 msgid "(Added in 1.3.2)"
7803 #: ../src/guestfs-actions.pod:948
7804 msgid "guestfs_checksums_out"
7809 #: ../src/guestfs-actions.pod:950
7813 " guestfs_checksums_out (guestfs_h *g,\n"
7814 " const char *csumtype,\n"
7815 " const char *directory,\n"
7816 " const char *sumsfile);\n"
7822 #: ../src/guestfs-actions.pod:956 ../fish/guestfish-actions.pod:644
7824 "This command computes the checksums of all regular files in C<directory> and "
7825 "then emits a list of those checksums to the local output file C<sumsfile>."
7830 #: ../src/guestfs-actions.pod:960 ../fish/guestfish-actions.pod:648
7832 "This can be used for verifying the integrity of a virtual machine. However "
7833 "to be properly secure you should pay attention to the output of the checksum "
7834 "command (it uses the ones from GNU coreutils). In particular when the "
7835 "filename is not printable, coreutils uses a special backslash syntax. For "
7836 "more information, see the GNU coreutils info file."
7841 #: ../src/guestfs-actions.pod:970
7842 msgid "(Added in 1.3.7)"
7847 #: ../src/guestfs-actions.pod:972
7848 msgid "guestfs_chmod"
7853 #: ../src/guestfs-actions.pod:974
7857 " guestfs_chmod (guestfs_h *g,\n"
7859 " const char *path);\n"
7865 #: ../src/guestfs-actions.pod:979 ../fish/guestfish-actions.pod:662
7867 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7873 #: ../src/guestfs-actions.pod:982 ../fish/guestfish-actions.pod:665
7875 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7876 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7882 #: ../src/guestfs-actions.pod:986 ../src/guestfs-actions.pod:4241
7883 #: ../src/guestfs-actions.pod:4438 ../src/guestfs-actions.pod:4457
7884 #: ../src/guestfs-actions.pod:4476 ../fish/guestfish-actions.pod:669
7885 #: ../fish/guestfish-actions.pod:2870 ../fish/guestfish-actions.pod:2999
7886 #: ../fish/guestfish-actions.pod:3009 ../fish/guestfish-actions.pod:3019
7887 msgid "The mode actually set is affected by the umask."
7892 #: ../src/guestfs-actions.pod:992
7893 msgid "guestfs_chown"
7898 #: ../src/guestfs-actions.pod:994
7902 " guestfs_chown (guestfs_h *g,\n"
7905 " const char *path);\n"
7911 #: ../src/guestfs-actions.pod:1000 ../fish/guestfish-actions.pod:675
7912 msgid "Change the file owner to C<owner> and group to C<group>."
7917 #: ../src/guestfs-actions.pod:1002 ../src/guestfs-actions.pod:3349
7918 #: ../fish/guestfish-actions.pod:677 ../fish/guestfish-actions.pod:2328
7920 "Only numeric uid and gid are supported. If you want to use names, you will "
7921 "need to locate and parse the password file yourself (Augeas support makes "
7922 "this relatively easy)."
7927 #: ../src/guestfs-actions.pod:1010
7928 msgid "guestfs_command"
7933 #: ../src/guestfs-actions.pod:1012
7937 " guestfs_command (guestfs_h *g,\n"
7938 " char *const *arguments);\n"
7944 #: ../src/guestfs-actions.pod:1016 ../fish/guestfish-actions.pod:685
7946 "This call runs a command from the guest filesystem. The filesystem must be "
7947 "mounted, and must contain a compatible operating system (ie. something "
7948 "Linux, with the same or compatible processor architecture)."
7953 #: ../src/guestfs-actions.pod:1021
7955 "The single parameter is an argv-style list of arguments. The first element "
7956 "is the name of the program to run. Subsequent elements are parameters. The "
7957 "list must be non-empty (ie. must contain a program name). Note that the "
7958 "command runs directly, and is I<not> invoked via the shell (see "
7964 #: ../src/guestfs-actions.pod:1028 ../fish/guestfish-actions.pod:697
7965 msgid "The return value is anything printed to I<stdout> by the command."
7970 #: ../src/guestfs-actions.pod:1031 ../fish/guestfish-actions.pod:700
7972 "If the command returns a non-zero exit status, then this function returns an "
7973 "error message. The error message string is the content of I<stderr> from "
7979 #: ../src/guestfs-actions.pod:1035 ../fish/guestfish-actions.pod:704
7981 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
7982 "bin>. If you require a program from another location, you should provide "
7983 "the full path in the first parameter."
7988 #: ../src/guestfs-actions.pod:1040 ../fish/guestfish-actions.pod:709
7990 "Shared libraries and data files required by the program must be available on "
7991 "filesystems which are mounted in the correct places. It is the caller's "
7992 "responsibility to ensure all filesystems that are needed are mounted at the "
7998 #: ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072
7999 #: ../src/guestfs-actions.pod:1535
8000 msgid "(Added in 0.9.1)"
8005 #: ../src/guestfs-actions.pod:1054
8006 msgid "guestfs_command_lines"
8011 #: ../src/guestfs-actions.pod:1056
8015 " guestfs_command_lines (guestfs_h *g,\n"
8016 " char *const *arguments);\n"
8022 #: ../src/guestfs-actions.pod:1060
8024 "This is the same as C<guestfs_command>, but splits the result into a list of "
8030 #: ../src/guestfs-actions.pod:1063
8031 msgid "See also: C<guestfs_sh_lines>"
8036 #: ../src/guestfs-actions.pod:1074
8037 msgid "guestfs_config"
8042 #: ../src/guestfs-actions.pod:1076
8046 " guestfs_config (guestfs_h *g,\n"
8047 " const char *qemuparam,\n"
8048 " const char *qemuvalue);\n"
8054 #: ../src/guestfs-actions.pod:1081 ../fish/guestfish-actions.pod:734
8056 "This can be used to add arbitrary qemu command line parameters of the form "
8057 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
8058 "setting some parameters which would interfere with parameters that we use."
8063 #: ../src/guestfs-actions.pod:1086 ../fish/guestfish-actions.pod:739
8064 msgid "The first character of C<param> string must be a C<-> (dash)."
8069 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
8070 msgid "C<value> can be NULL."
8075 #: ../src/guestfs-actions.pod:1094
8076 msgid "guestfs_copy_size"
8081 #: ../src/guestfs-actions.pod:1096
8085 " guestfs_copy_size (guestfs_h *g,\n"
8086 " const char *src,\n"
8087 " const char *dest,\n"
8094 #: ../src/guestfs-actions.pod:1102 ../fish/guestfish-actions.pod:747
8096 "This command copies exactly C<size> bytes from one source device or file "
8097 "C<src> to another destination device or file C<dest>."
8102 #: ../src/guestfs-actions.pod:1105 ../fish/guestfish-actions.pod:750
8104 "Note this will fail if the source is too short or if the destination is not "
8110 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1233
8111 #: ../src/guestfs-actions.pod:1264 ../src/guestfs-actions.pod:1684
8112 #: ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:6643
8113 #: ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:7156
8114 #: ../src/guestfs-actions.pod:7175
8116 "This long-running command can generate progress notification messages so "
8117 "that the caller can display a progress bar or indicator. To receive these "
8118 "messages, the caller must register a progress callback. See L<guestfs(3)/"
8119 "guestfs_set_progress_callback>."
8124 #: ../src/guestfs-actions.pod:1115 ../src/guestfs-actions.pod:4017
8125 #: ../src/guestfs-actions.pod:5235 ../src/guestfs-actions.pod:6884
8126 #: ../src/guestfs-actions.pod:6904 ../src/guestfs-actions.pod:6990
8127 msgid "(Added in 1.0.87)"
8132 #: ../src/guestfs-actions.pod:1117
8138 #: ../src/guestfs-actions.pod:1119
8142 " guestfs_cp (guestfs_h *g,\n"
8143 " const char *src,\n"
8144 " const char *dest);\n"
8150 #: ../src/guestfs-actions.pod:1124 ../fish/guestfish-actions.pod:757
8152 "This copies a file from C<src> to C<dest> where C<dest> is either a "
8153 "destination filename or destination directory."
8158 #: ../src/guestfs-actions.pod:1129 ../src/guestfs-actions.pod:1143
8159 #: ../src/guestfs-actions.pod:1215 ../src/guestfs-actions.pod:1289
8160 #: ../src/guestfs-actions.pod:1398 ../src/guestfs-actions.pod:4702
8161 #: ../src/guestfs-actions.pod:5079
8162 msgid "(Added in 1.0.18)"
8167 #: ../src/guestfs-actions.pod:1131
8168 msgid "guestfs_cp_a"
8173 #: ../src/guestfs-actions.pod:1133
8177 " guestfs_cp_a (guestfs_h *g,\n"
8178 " const char *src,\n"
8179 " const char *dest);\n"
8185 #: ../src/guestfs-actions.pod:1138 ../fish/guestfish-actions.pod:764
8187 "This copies a file or directory from C<src> to C<dest> recursively using the "
8193 #: ../src/guestfs-actions.pod:1145
8199 #: ../src/guestfs-actions.pod:1147
8203 " guestfs_dd (guestfs_h *g,\n"
8204 " const char *src,\n"
8205 " const char *dest);\n"
8211 #: ../src/guestfs-actions.pod:1152 ../fish/guestfish-actions.pod:771
8213 "This command copies from one source device or file C<src> to another "
8214 "destination device or file C<dest>. Normally you would use this to copy to "
8215 "or from a device or partition, for example to duplicate a filesystem."
8220 #: ../src/guestfs-actions.pod:1157
8222 "If the destination is a device, it must be as large or larger than the "
8223 "source file or device, otherwise the copy will fail. This command cannot do "
8224 "partial copies (see C<guestfs_copy_size>)."
8229 #: ../src/guestfs-actions.pod:1165
8235 #: ../src/guestfs-actions.pod:1167
8239 " guestfs_df (guestfs_h *g);\n"
8245 #: ../src/guestfs-actions.pod:1170 ../fish/guestfish-actions.pod:784
8246 msgid "This command runs the C<df> command to report disk space used."
8251 #: ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:1189
8253 "This command is mostly useful for interactive sessions. It is I<not> "
8254 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
8260 #: ../src/guestfs-actions.pod:1179 ../src/guestfs-actions.pod:1196
8261 #: ../src/guestfs-actions.pod:1309 ../src/guestfs-actions.pod:2263
8262 #: ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:2355
8263 #: ../src/guestfs-actions.pod:4127 ../src/guestfs-actions.pod:4602
8264 #: ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6405
8265 #: ../src/guestfs-actions.pod:7023 ../src/guestfs-actions.pod:7036
8266 #: ../src/guestfs-actions.pod:7049
8267 msgid "(Added in 1.0.54)"
8272 #: ../src/guestfs-actions.pod:1181
8273 msgid "guestfs_df_h"
8278 #: ../src/guestfs-actions.pod:1183
8282 " guestfs_df_h (guestfs_h *g);\n"
8288 #: ../src/guestfs-actions.pod:1186 ../fish/guestfish-actions.pod:794
8290 "This command runs the C<df -h> command to report disk space used in human-"
8296 #: ../src/guestfs-actions.pod:1198
8297 msgid "guestfs_dmesg"
8302 #: ../src/guestfs-actions.pod:1200
8306 " guestfs_dmesg (guestfs_h *g);\n"
8312 #: ../src/guestfs-actions.pod:1203 ../fish/guestfish-actions.pod:805
8314 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
8315 "This is sometimes useful for extended debugging of problems."
8320 #: ../src/guestfs-actions.pod:1207
8322 "Another way to get the same information is to enable verbose messages with "
8323 "C<guestfs_set_verbose> or by setting the environment variable "
8324 "C<LIBGUESTFS_DEBUG=1> before running the program."
8329 #: ../src/guestfs-actions.pod:1217
8330 msgid "guestfs_download"
8335 #: ../src/guestfs-actions.pod:1219
8339 " guestfs_download (guestfs_h *g,\n"
8340 " const char *remotefilename,\n"
8341 " const char *filename);\n"
8347 #: ../src/guestfs-actions.pod:1224 ../src/guestfs-actions.pod:1249
8348 #: ../fish/guestfish-actions.pod:818 ../fish/guestfish-actions.pod:831
8350 "Download file C<remotefilename> and save it as C<filename> on the local "
8356 #: ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:6637
8357 #: ../fish/guestfish-actions.pod:821 ../fish/guestfish-actions.pod:4447
8358 msgid "C<filename> can also be a named pipe."
8363 #: ../src/guestfs-actions.pod:1229
8364 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
8369 #: ../src/guestfs-actions.pod:1240
8370 msgid "guestfs_download_offset"
8375 #: ../src/guestfs-actions.pod:1242
8379 " guestfs_download_offset (guestfs_h *g,\n"
8380 " const char *remotefilename,\n"
8381 " const char *filename,\n"
8382 " int64_t offset,\n"
8389 #: ../src/guestfs-actions.pod:1252 ../fish/guestfish-actions.pod:834
8391 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
8392 "region must be within the file or device)."
8397 #: ../src/guestfs-actions.pod:1255
8399 "Note that there is no limit on the amount of data that can be downloaded "
8400 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
8401 "full amount unless an error occurs."
8406 #: ../src/guestfs-actions.pod:1260
8407 msgid "See also C<guestfs_download>, C<guestfs_pread>."
8412 #: ../src/guestfs-actions.pod:1269 ../src/guestfs-actions.pod:6682
8413 msgid "(Added in 1.5.17)"
8418 #: ../src/guestfs-actions.pod:1271
8419 msgid "guestfs_drop_caches"
8424 #: ../src/guestfs-actions.pod:1273
8428 " guestfs_drop_caches (guestfs_h *g,\n"
8429 " int whattodrop);\n"
8435 #: ../src/guestfs-actions.pod:1277 ../fish/guestfish-actions.pod:850
8437 "This instructs the guest kernel to drop its page cache, and/or dentries and "
8438 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
8439 "to drop, see L<http://linux-mm.org/Drop_Caches>"
8444 #: ../src/guestfs-actions.pod:1282 ../fish/guestfish-actions.pod:855
8445 msgid "Setting C<whattodrop> to 3 should drop everything."
8450 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
8452 "This automatically calls L<sync(2)> before the operation, so that the "
8453 "maximum guest memory is freed."
8458 #: ../src/guestfs-actions.pod:1291
8464 #: ../src/guestfs-actions.pod:1293
8468 " guestfs_du (guestfs_h *g,\n"
8469 " const char *path);\n"
8475 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:864
8477 "This command runs the C<du -s> command to estimate file space usage for "
8483 #: ../src/guestfs-actions.pod:1300 ../fish/guestfish-actions.pod:867
8485 "C<path> can be a file or a directory. If C<path> is a directory then the "
8486 "estimate includes the contents of the directory and all subdirectories "
8492 #: ../src/guestfs-actions.pod:1304 ../fish/guestfish-actions.pod:871
8494 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
8499 #: ../src/guestfs-actions.pod:1311
8500 msgid "guestfs_e2fsck_f"
8505 #: ../src/guestfs-actions.pod:1313
8509 " guestfs_e2fsck_f (guestfs_h *g,\n"
8510 " const char *device);\n"
8516 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:878
8518 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
8519 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
8525 #: ../src/guestfs-actions.pod:1321
8527 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
8528 "Normally you should use C<guestfs_fsck>."
8533 #: ../src/guestfs-actions.pod:1326
8534 msgid "(Added in 1.0.29)"
8539 #: ../src/guestfs-actions.pod:1328
8540 msgid "guestfs_echo_daemon"
8545 #: ../src/guestfs-actions.pod:1330
8549 " guestfs_echo_daemon (guestfs_h *g,\n"
8550 " char *const *words);\n"
8556 #: ../src/guestfs-actions.pod:1334 ../fish/guestfish-actions.pod:889
8558 "This command concatenates the list of C<words> passed with single spaces "
8559 "between them and returns the resulting string."
8564 #: ../src/guestfs-actions.pod:1337 ../fish/guestfish-actions.pod:892
8565 msgid "You can use this command to test the connection through to the daemon."
8570 #: ../src/guestfs-actions.pod:1339
8571 msgid "See also C<guestfs_ping_daemon>."
8576 #: ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:2071
8577 #: ../src/guestfs-actions.pod:5885
8578 msgid "(Added in 1.0.69)"
8583 #: ../src/guestfs-actions.pod:1346
8584 msgid "guestfs_egrep"
8589 #: ../src/guestfs-actions.pod:1348
8593 " guestfs_egrep (guestfs_h *g,\n"
8594 " const char *regex,\n"
8595 " const char *path);\n"
8601 #: ../src/guestfs-actions.pod:1353 ../fish/guestfish-actions.pod:900
8603 "This calls the external C<egrep> program and returns the matching lines."
8608 #: ../src/guestfs-actions.pod:1363 ../src/guestfs-actions.pod:1382
8609 #: ../src/guestfs-actions.pod:1439 ../src/guestfs-actions.pod:1485
8610 #: ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:2201
8611 #: ../src/guestfs-actions.pod:2220 ../src/guestfs-actions.pod:2376
8612 #: ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2404
8613 #: ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:2472
8614 #: ../src/guestfs-actions.pod:2485 ../src/guestfs-actions.pod:3510
8615 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:3537
8616 #: ../src/guestfs-actions.pod:3551 ../src/guestfs-actions.pod:4537
8617 #: ../src/guestfs-actions.pod:5413 ../src/guestfs-actions.pod:5462
8618 #: ../src/guestfs-actions.pod:6249 ../src/guestfs-actions.pod:6261
8619 #: ../src/guestfs-actions.pod:6274 ../src/guestfs-actions.pod:6287
8620 #: ../src/guestfs-actions.pod:6309 ../src/guestfs-actions.pod:6322
8621 #: ../src/guestfs-actions.pod:6335 ../src/guestfs-actions.pod:6348
8622 #: ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7138
8623 #: ../src/guestfs-actions.pod:7223 ../src/guestfs-actions.pod:7242
8624 #: ../src/guestfs-actions.pod:7288 ../src/guestfs-actions.pod:7307
8625 msgid "(Added in 1.0.66)"
8630 #: ../src/guestfs-actions.pod:1365
8631 msgid "guestfs_egrepi"
8636 #: ../src/guestfs-actions.pod:1367
8640 " guestfs_egrepi (guestfs_h *g,\n"
8641 " const char *regex,\n"
8642 " const char *path);\n"
8648 #: ../src/guestfs-actions.pod:1372 ../fish/guestfish-actions.pod:910
8650 "This calls the external C<egrep -i> program and returns the matching lines."
8655 #: ../src/guestfs-actions.pod:1384
8656 msgid "guestfs_equal"
8661 #: ../src/guestfs-actions.pod:1386
8665 " guestfs_equal (guestfs_h *g,\n"
8666 " const char *file1,\n"
8667 " const char *file2);\n"
8673 #: ../src/guestfs-actions.pod:1391 ../fish/guestfish-actions.pod:920
8675 "This compares the two files C<file1> and C<file2> and returns true if their "
8676 "content is exactly equal, or false otherwise."
8681 #: ../src/guestfs-actions.pod:1394 ../fish/guestfish-actions.pod:923
8682 msgid "The external L<cmp(1)> program is used for the comparison."
8687 #: ../src/guestfs-actions.pod:1400
8688 msgid "guestfs_exists"
8693 #: ../src/guestfs-actions.pod:1402
8697 " guestfs_exists (guestfs_h *g,\n"
8698 " const char *path);\n"
8704 #: ../src/guestfs-actions.pod:1406 ../fish/guestfish-actions.pod:929
8706 "This returns C<true> if and only if there is a file, directory (or anything) "
8707 "with the given C<path> name."
8712 #: ../src/guestfs-actions.pod:1409
8713 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
8718 #: ../src/guestfs-actions.pod:1415
8719 msgid "guestfs_fallocate"
8724 #: ../src/guestfs-actions.pod:1417
8728 " guestfs_fallocate (guestfs_h *g,\n"
8729 " const char *path,\n"
8736 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1448
8737 #: ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:957
8739 "This command preallocates a file (containing zero bytes) named C<path> of "
8740 "size C<len> bytes. If the file exists already, it is overwritten."
8745 #: ../src/guestfs-actions.pod:1426 ../fish/guestfish-actions.pod:942
8747 "Do not confuse this with the guestfish-specific C<alloc> command which "
8748 "allocates a file in the host and attaches it as a device."
8753 #: ../src/guestfs-actions.pod:1432 ../fish/guestfish-actions.pod:946
8755 "This function is deprecated. In new code, use the C<fallocate64> call "
8761 #: ../src/guestfs-actions.pod:1441
8762 msgid "guestfs_fallocate64"
8767 #: ../src/guestfs-actions.pod:1443
8771 " guestfs_fallocate64 (guestfs_h *g,\n"
8772 " const char *path,\n"
8779 #: ../src/guestfs-actions.pod:1452
8781 "Note that this call allocates disk blocks for the file. To create a sparse "
8782 "file use C<guestfs_truncate_size> instead."
8787 #: ../src/guestfs-actions.pod:1455
8789 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
8790 "oversight it only allowed 30 bit lengths to be specified, effectively "
8791 "limiting the maximum size of files created through that call to 1GB."
8796 #: ../src/guestfs-actions.pod:1460 ../fish/guestfish-actions.pod:969
8798 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8799 "commands which create a file in the host and attach it as a device."
8804 #: ../src/guestfs-actions.pod:1466
8805 msgid "(Added in 1.3.17)"
8810 #: ../src/guestfs-actions.pod:1468
8811 msgid "guestfs_fgrep"
8816 #: ../src/guestfs-actions.pod:1470
8820 " guestfs_fgrep (guestfs_h *g,\n"
8821 " const char *pattern,\n"
8822 " const char *path);\n"
8828 #: ../src/guestfs-actions.pod:1475 ../fish/guestfish-actions.pod:977
8830 "This calls the external C<fgrep> program and returns the matching lines."
8835 #: ../src/guestfs-actions.pod:1487
8836 msgid "guestfs_fgrepi"
8841 #: ../src/guestfs-actions.pod:1489
8845 " guestfs_fgrepi (guestfs_h *g,\n"
8846 " const char *pattern,\n"
8847 " const char *path);\n"
8853 #: ../src/guestfs-actions.pod:1494 ../fish/guestfish-actions.pod:987
8855 "This calls the external C<fgrep -i> program and returns the matching lines."
8860 #: ../src/guestfs-actions.pod:1506
8861 msgid "guestfs_file"
8866 #: ../src/guestfs-actions.pod:1508
8870 " guestfs_file (guestfs_h *g,\n"
8871 " const char *path);\n"
8877 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:997
8879 "This call uses the standard L<file(1)> command to determine the type or "
8880 "contents of the file."
8885 #: ../src/guestfs-actions.pod:1515 ../fish/guestfish-actions.pod:1000
8887 "This call will also transparently look inside various types of compressed "
8893 #: ../src/guestfs-actions.pod:1518 ../fish/guestfish-actions.pod:1003
8895 "The exact command which runs is C<file -zb path>. Note in particular that "
8896 "the filename is not prepended to the output (the C<-b> option)."
8901 #: ../src/guestfs-actions.pod:1522
8903 "This command can also be used on C</dev/> devices (and partitions, LV "
8904 "names). You can for example use this to determine if a device contains a "
8905 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
8910 #: ../src/guestfs-actions.pod:1527 ../fish/guestfish-actions.pod:1012
8912 "If the C<path> does not begin with C</dev/> then this command only works for "
8913 "the content of regular files. For other file types (directory, symbolic "
8914 "link etc) it will just return the string C<directory> etc."
8919 #: ../src/guestfs-actions.pod:1537
8920 msgid "guestfs_file_architecture"
8925 #: ../src/guestfs-actions.pod:1539
8929 " guestfs_file_architecture (guestfs_h *g,\n"
8930 " const char *filename);\n"
8936 #: ../src/guestfs-actions.pod:1543 ../fish/guestfish-actions.pod:1021
8938 "This detects the architecture of the binary C<filename>, and returns it if "
8944 #: ../src/guestfs-actions.pod:1546 ../fish/guestfish-actions.pod:1024
8945 msgid "Currently defined architectures are:"
8950 #: ../src/guestfs-actions.pod:1550 ../fish/guestfish-actions.pod:1028
8956 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
8958 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8959 "irrespective of the precise processor requirements of the binary."
8964 #: ../src/guestfs-actions.pod:1555 ../fish/guestfish-actions.pod:1033
8970 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
8971 msgid "64 bit x86-64."
8976 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
8982 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
8983 msgid "32 bit SPARC."
8988 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
8994 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
8995 msgid "64 bit SPARC V9 and above."
9000 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
9006 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
9007 msgid "Intel Itanium."
9012 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
9018 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
9019 msgid "32 bit Power PC."
9024 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
9030 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
9031 msgid "64 bit Power PC."
9036 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1059
9037 msgid "Libguestfs may return other architecture strings in future."
9042 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
9043 msgid "The function works on at least the following types of files:"
9048 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1067
9049 msgid "many types of Un*x and Linux binary"
9054 #: ../src/guestfs-actions.pod:1593 ../fish/guestfish-actions.pod:1071
9055 msgid "many types of Un*x and Linux shared library"
9060 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1075
9061 msgid "Windows Win32 and Win64 binaries"
9066 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1079
9067 msgid "Windows Win32 and Win64 DLLs"
9072 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
9073 msgid "Win32 binaries and DLLs return C<i386>."
9078 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
9079 msgid "Win64 binaries and DLLs return C<x86_64>."
9084 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1087
9085 msgid "Linux kernel modules"
9090 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1091
9091 msgid "Linux new-style initrd images"
9096 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1095
9097 msgid "some non-x86 Linux vmlinuz kernels"
9102 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1099
9103 msgid "What it can't do currently:"
9108 #: ../src/guestfs-actions.pod:1627 ../fish/guestfish-actions.pod:1105
9109 msgid "static libraries (libfoo.a)"
9114 #: ../src/guestfs-actions.pod:1631 ../fish/guestfish-actions.pod:1109
9115 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
9120 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1113
9121 msgid "x86 Linux vmlinuz kernels"
9126 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
9128 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
9129 "compressed code, and are horribly hard to unpack. If you want to find the "
9130 "architecture of a kernel, use the architecture of the associated initrd or "
9131 "kernel module(s) instead."
9136 #: ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1810
9137 #: ../src/guestfs-actions.pod:1827 ../src/guestfs-actions.pod:2508
9138 #: ../src/guestfs-actions.pod:2589 ../src/guestfs-actions.pod:2615
9139 #: ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2724
9140 #: ../src/guestfs-actions.pod:2761 ../src/guestfs-actions.pod:2845
9141 #: ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:3133
9142 #: ../src/guestfs-actions.pod:3265
9143 msgid "(Added in 1.5.3)"
9148 #: ../src/guestfs-actions.pod:1649
9149 msgid "guestfs_filesize"
9154 #: ../src/guestfs-actions.pod:1651
9158 " guestfs_filesize (guestfs_h *g,\n"
9159 " const char *file);\n"
9165 #: ../src/guestfs-actions.pod:1655 ../fish/guestfish-actions.pod:1126
9166 msgid "This command returns the size of C<file> in bytes."
9171 #: ../src/guestfs-actions.pod:1657
9173 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
9174 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
9175 "devices, use C<guestfs_blockdev_getsize64>."
9180 #: ../src/guestfs-actions.pod:1663
9181 msgid "(Added in 1.0.82)"
9186 #: ../src/guestfs-actions.pod:1665
9187 msgid "guestfs_fill"
9192 #: ../src/guestfs-actions.pod:1667
9196 " guestfs_fill (guestfs_h *g,\n"
9199 " const char *path);\n"
9205 #: ../src/guestfs-actions.pod:1673 ../fish/guestfish-actions.pod:1136
9207 "This command creates a new file called C<path>. The initial content of the "
9208 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
9214 #: ../src/guestfs-actions.pod:1677
9216 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
9217 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
9218 "bytes use C<guestfs_fill_pattern>."
9223 #: ../src/guestfs-actions.pod:1689
9224 msgid "(Added in 1.0.79)"
9229 #: ../src/guestfs-actions.pod:1691
9230 msgid "guestfs_fill_pattern"
9235 #: ../src/guestfs-actions.pod:1693
9239 " guestfs_fill_pattern (guestfs_h *g,\n"
9240 " const char *pattern,\n"
9242 " const char *path);\n"
9248 #: ../src/guestfs-actions.pod:1699
9250 "This function is like C<guestfs_fill> except that it creates a new file of "
9251 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
9252 "pattern is truncated if necessary to ensure the length of the file is "
9253 "exactly C<len> bytes."
9258 #: ../src/guestfs-actions.pod:1711
9259 msgid "(Added in 1.3.12)"
9264 #: ../src/guestfs-actions.pod:1713
9265 msgid "guestfs_find"
9270 #: ../src/guestfs-actions.pod:1715
9274 " guestfs_find (guestfs_h *g,\n"
9275 " const char *directory);\n"
9281 #: ../src/guestfs-actions.pod:1719 ../fish/guestfish-actions.pod:1158
9283 "This command lists out all files and directories, recursively, starting at "
9284 "C<directory>. It is essentially equivalent to running the shell command "
9285 "C<find directory -print> but some post-processing happens on the output, "
9291 #: ../src/guestfs-actions.pod:1724 ../fish/guestfish-actions.pod:1163
9293 "This returns a list of strings I<without any prefix>. Thus if the directory "
9299 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1166
9310 #: ../src/guestfs-actions.pod:1731
9312 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
9317 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1173
9329 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1178
9330 msgid "If C<directory> is not a directory, then this command returns an error."
9335 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1181
9336 msgid "The returned list is sorted."
9341 #: ../src/guestfs-actions.pod:1744
9342 msgid "See also C<guestfs_find0>."
9347 #: ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:3954
9348 #: ../src/guestfs-actions.pod:5497
9349 msgid "(Added in 1.0.27)"
9354 #: ../src/guestfs-actions.pod:1755
9355 msgid "guestfs_find0"
9360 #: ../src/guestfs-actions.pod:1757
9364 " guestfs_find0 (guestfs_h *g,\n"
9365 " const char *directory,\n"
9366 " const char *files);\n"
9372 #: ../src/guestfs-actions.pod:1762 ../fish/guestfish-actions.pod:1192
9374 "This command lists out all files and directories, recursively, starting at "
9375 "C<directory>, placing the resulting list in the external file called "
9381 #: ../src/guestfs-actions.pod:1766
9383 "This command works the same way as C<guestfs_find> with the following "
9389 #: ../src/guestfs-actions.pod:1773 ../fish/guestfish-actions.pod:1203
9390 msgid "The resulting list is written to an external file."
9395 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1207
9397 "Items (filenames) in the result are separated by C<\\0> characters. See "
9398 "L<find(1)> option I<-print0>."
9403 #: ../src/guestfs-actions.pod:1782 ../fish/guestfish-actions.pod:1212
9404 msgid "This command is not limited in the number of names that it can return."
9409 #: ../src/guestfs-actions.pod:1787 ../fish/guestfish-actions.pod:1217
9410 msgid "The result list is not sorted."
9415 #: ../src/guestfs-actions.pod:1793
9416 msgid "(Added in 1.0.74)"
9421 #: ../src/guestfs-actions.pod:1795
9422 msgid "guestfs_findfs_label"
9427 #: ../src/guestfs-actions.pod:1797
9431 " guestfs_findfs_label (guestfs_h *g,\n"
9432 " const char *label);\n"
9438 #: ../src/guestfs-actions.pod:1801 ../fish/guestfish-actions.pod:1227
9440 "This command searches the filesystems and returns the one which has the "
9441 "given label. An error is returned if no such filesystem can be found."
9446 #: ../src/guestfs-actions.pod:1805
9447 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
9452 #: ../src/guestfs-actions.pod:1812
9453 msgid "guestfs_findfs_uuid"
9458 #: ../src/guestfs-actions.pod:1814
9462 " guestfs_findfs_uuid (guestfs_h *g,\n"
9463 " const char *uuid);\n"
9469 #: ../src/guestfs-actions.pod:1818 ../fish/guestfish-actions.pod:1237
9471 "This command searches the filesystems and returns the one which has the "
9472 "given UUID. An error is returned if no such filesystem can be found."
9477 #: ../src/guestfs-actions.pod:1822
9478 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
9483 #: ../src/guestfs-actions.pod:1829
9484 msgid "guestfs_fsck"
9489 #: ../src/guestfs-actions.pod:1831
9493 " guestfs_fsck (guestfs_h *g,\n"
9494 " const char *fstype,\n"
9495 " const char *device);\n"
9501 #: ../src/guestfs-actions.pod:1836 ../fish/guestfish-actions.pod:1247
9503 "This runs the filesystem checker (fsck) on C<device> which should have "
9504 "filesystem type C<fstype>."
9509 #: ../src/guestfs-actions.pod:1839 ../fish/guestfish-actions.pod:1250
9511 "The returned integer is the status. See L<fsck(8)> for the list of status "
9512 "codes from C<fsck>."
9517 #: ../src/guestfs-actions.pod:1848 ../fish/guestfish-actions.pod:1259
9518 msgid "Multiple status codes can be summed together."
9523 #: ../src/guestfs-actions.pod:1852 ../fish/guestfish-actions.pod:1263
9525 "A non-zero return code can mean \"success\", for example if errors have been "
9526 "corrected on the filesystem."
9531 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish-actions.pod:1268
9532 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
9537 #: ../src/guestfs-actions.pod:1862 ../fish/guestfish-actions.pod:1273
9539 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
9544 #: ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:7161
9545 msgid "(Added in 1.0.16)"
9550 #: ../src/guestfs-actions.pod:1868
9551 msgid "guestfs_get_append"
9556 #: ../src/guestfs-actions.pod:1870
9560 " guestfs_get_append (guestfs_h *g);\n"
9566 #: ../src/guestfs-actions.pod:1873 ../fish/guestfish-actions.pod:1279
9568 "Return the additional kernel options which are added to the guest kernel "
9574 #: ../src/guestfs-actions.pod:1876 ../fish/guestfish-actions.pod:1282
9575 msgid "If C<NULL> then no options are added."
9580 #: ../src/guestfs-actions.pod:1878
9582 "This function returns a string which may be NULL. There is no way to return "
9583 "an error from this function. The string is owned by the guest handle and "
9584 "must I<not> be freed."
9589 #: ../src/guestfs-actions.pod:1882 ../src/guestfs-actions.pod:5175
9590 #: ../src/guestfs-actions.pod:5655 ../src/guestfs-actions.pod:6023
9591 #: ../src/guestfs-actions.pod:6042 ../src/guestfs-actions.pod:6058
9592 #: ../src/guestfs-actions.pod:6075 ../src/guestfs-actions.pod:6832
9593 #: ../src/guestfs-actions.pod:6850 ../src/guestfs-actions.pod:7204
9594 msgid "(Added in 1.0.26)"
9599 #: ../src/guestfs-actions.pod:1884
9600 msgid "guestfs_get_autosync"
9605 #: ../src/guestfs-actions.pod:1886
9609 " guestfs_get_autosync (guestfs_h *g);\n"
9615 #: ../src/guestfs-actions.pod:1889 ../fish/guestfish-actions.pod:1288
9616 msgid "Get the autosync flag."
9621 #: ../src/guestfs-actions.pod:1895
9622 msgid "guestfs_get_direct"
9627 #: ../src/guestfs-actions.pod:1897
9631 " guestfs_get_direct (guestfs_h *g);\n"
9637 #: ../src/guestfs-actions.pod:1900 ../fish/guestfish-actions.pod:1294
9638 msgid "Return the direct appliance mode flag."
9643 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:5696
9644 msgid "(Added in 1.0.72)"
9649 #: ../src/guestfs-actions.pod:1906
9650 msgid "guestfs_get_e2label"
9655 #: ../src/guestfs-actions.pod:1908
9659 " guestfs_get_e2label (guestfs_h *g,\n"
9660 " const char *device);\n"
9666 #: ../src/guestfs-actions.pod:1912 ../fish/guestfish-actions.pod:1300
9668 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
9673 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1303
9675 "This function is deprecated. In new code, use the C<vfs_label> call instead."
9680 #: ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1946
9681 #: ../src/guestfs-actions.pod:5714 ../src/guestfs-actions.pod:5733
9682 msgid "(Added in 1.0.15)"
9687 #: ../src/guestfs-actions.pod:1927
9688 msgid "guestfs_get_e2uuid"
9693 #: ../src/guestfs-actions.pod:1929
9697 " guestfs_get_e2uuid (guestfs_h *g,\n"
9698 " const char *device);\n"
9704 #: ../src/guestfs-actions.pod:1933 ../fish/guestfish-actions.pod:1314
9706 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
9711 #: ../src/guestfs-actions.pod:1939 ../fish/guestfish-actions.pod:1317
9713 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
9718 #: ../src/guestfs-actions.pod:1948
9719 msgid "guestfs_get_memsize"
9724 #: ../src/guestfs-actions.pod:1950
9728 " guestfs_get_memsize (guestfs_h *g);\n"
9734 #: ../src/guestfs-actions.pod:1953 ../fish/guestfish-actions.pod:1328
9736 "This gets the memory size in megabytes allocated to the qemu subprocess."
9741 #: ../src/guestfs-actions.pod:1956
9743 "If C<guestfs_set_memsize> was not called on this handle, and if "
9744 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
9745 "value for memsize."
9750 #: ../src/guestfs-actions.pod:1960 ../src/guestfs-actions.pod:2041
9751 #: ../src/guestfs-actions.pod:5749 ../src/guestfs-actions.pod:5856
9752 #: ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:1386
9753 #: ../fish/guestfish-actions.pod:3854 ../fish/guestfish-actions.pod:3941
9755 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
9760 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:4245
9761 #: ../src/guestfs-actions.pod:4442 ../src/guestfs-actions.pod:4461
9762 #: ../src/guestfs-actions.pod:4480 ../src/guestfs-actions.pod:4492
9763 #: ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4522
9764 #: ../src/guestfs-actions.pod:5400 ../src/guestfs-actions.pod:5754
9765 #: ../src/guestfs-actions.pod:5997 ../src/guestfs-actions.pod:6598
9766 msgid "(Added in 1.0.55)"
9771 #: ../src/guestfs-actions.pod:1967
9772 msgid "guestfs_get_network"
9777 #: ../src/guestfs-actions.pod:1969
9781 " guestfs_get_network (guestfs_h *g);\n"
9787 #: ../src/guestfs-actions.pod:1972 ../fish/guestfish-actions.pod:1342
9788 msgid "This returns the enable network flag."
9793 #: ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:5773
9794 msgid "(Added in 1.5.4)"
9799 #: ../src/guestfs-actions.pod:1978
9800 msgid "guestfs_get_path"
9805 #: ../src/guestfs-actions.pod:1980
9809 " guestfs_get_path (guestfs_h *g);\n"
9815 #: ../src/guestfs-actions.pod:1983 ../fish/guestfish-actions.pod:1348
9816 msgid "Return the current search path."
9821 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
9823 "This is always non-NULL. If it wasn't set already, then this will return "
9829 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2017
9831 "This function returns a string, or NULL on error. The string is owned by "
9832 "the guest handle and must I<not> be freed."
9837 #: ../src/guestfs-actions.pod:1993
9838 msgid "guestfs_get_pid"
9843 #: ../src/guestfs-actions.pod:1995
9847 " guestfs_get_pid (guestfs_h *g);\n"
9853 #: ../src/guestfs-actions.pod:1998 ../fish/guestfish-actions.pod:1359
9855 "Return the process ID of the qemu subprocess. If there is no qemu "
9856 "subprocess, then this will return an error."
9861 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1362
9862 msgid "This is an internal call used for debugging and testing."
9867 #: ../src/guestfs-actions.pod:2005
9868 msgid "(Added in 1.0.56)"
9873 #: ../src/guestfs-actions.pod:2007
9874 msgid "guestfs_get_qemu"
9879 #: ../src/guestfs-actions.pod:2009
9883 " guestfs_get_qemu (guestfs_h *g);\n"
9889 #: ../src/guestfs-actions.pod:2012 ../fish/guestfish-actions.pod:1368
9890 msgid "Return the current qemu binary."
9895 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
9897 "This is always non-NULL. If it wasn't set already, then this will return "
9898 "the default qemu binary name."
9903 #: ../src/guestfs-actions.pod:2020 ../src/guestfs-actions.pod:5818
9904 msgid "(Added in 1.0.6)"
9909 #: ../src/guestfs-actions.pod:2022
9910 msgid "guestfs_get_recovery_proc"
9915 #: ../src/guestfs-actions.pod:2024
9919 " guestfs_get_recovery_proc (guestfs_h *g);\n"
9925 #: ../src/guestfs-actions.pod:2027 ../fish/guestfish-actions.pod:1377
9926 msgid "Return the recovery process enabled flag."
9931 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:3355
9932 #: ../src/guestfs-actions.pod:3652 ../src/guestfs-actions.pod:4052
9933 #: ../src/guestfs-actions.pod:4084 ../src/guestfs-actions.pod:5105
9934 #: ../src/guestfs-actions.pod:5448 ../src/guestfs-actions.pod:5842
9935 #: ../src/guestfs-actions.pod:6501 ../src/guestfs-actions.pod:6521
9936 #: ../src/guestfs-actions.pod:6713
9937 msgid "(Added in 1.0.77)"
9942 #: ../src/guestfs-actions.pod:2033
9943 msgid "guestfs_get_selinux"
9948 #: ../src/guestfs-actions.pod:2035
9952 " guestfs_get_selinux (guestfs_h *g);\n"
9958 #: ../src/guestfs-actions.pod:2038
9960 "This returns the current setting of the selinux flag which is passed to the "
9961 "appliance at boot time. See C<guestfs_set_selinux>."
9966 #: ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2109
9967 #: ../src/guestfs-actions.pod:5861 ../src/guestfs-actions.pod:5915
9968 msgid "(Added in 1.0.67)"
9973 #: ../src/guestfs-actions.pod:2048
9974 msgid "guestfs_get_state"
9979 #: ../src/guestfs-actions.pod:2050
9983 " guestfs_get_state (guestfs_h *g);\n"
9989 #: ../src/guestfs-actions.pod:2053 ../fish/guestfish-actions.pod:1393
9991 "This returns the current state as an opaque integer. This is only useful "
9992 "for printing debug and internal error messages."
9997 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:3158
9998 #: ../src/guestfs-actions.pod:3187 ../src/guestfs-actions.pod:3248
9999 #: ../src/guestfs-actions.pod:3275 ../fish/guestfish-actions.pod:1396
10000 #: ../fish/guestfish-actions.pod:2210 ../fish/guestfish-actions.pod:2228
10001 #: ../fish/guestfish-actions.pod:2266 ../fish/guestfish-actions.pod:2282
10002 msgid "For more information on states, see L<guestfs(3)>."
10007 #: ../src/guestfs-actions.pod:2062
10008 msgid "guestfs_get_trace"
10013 #: ../src/guestfs-actions.pod:2064
10017 " guestfs_get_trace (guestfs_h *g);\n"
10023 #: ../src/guestfs-actions.pod:2067 ../fish/guestfish-actions.pod:1402
10024 msgid "Return the command trace flag."
10029 #: ../src/guestfs-actions.pod:2073
10030 msgid "guestfs_get_umask"
10035 #: ../src/guestfs-actions.pod:2075
10039 " guestfs_get_umask (guestfs_h *g);\n"
10045 #: ../src/guestfs-actions.pod:2078
10047 "Return the current umask. By default the umask is C<022> unless it has been "
10048 "set by calling C<guestfs_umask>."
10053 #: ../src/guestfs-actions.pod:2085
10054 msgid "guestfs_get_verbose"
10059 #: ../src/guestfs-actions.pod:2087
10063 " guestfs_get_verbose (guestfs_h *g);\n"
10069 #: ../src/guestfs-actions.pod:2090 ../fish/guestfish-actions.pod:1415
10070 msgid "This returns the verbose messages flag."
10075 #: ../src/guestfs-actions.pod:2096
10076 msgid "guestfs_getcon"
10081 #: ../src/guestfs-actions.pod:2098
10085 " guestfs_getcon (guestfs_h *g);\n"
10091 #: ../src/guestfs-actions.pod:2101 ../fish/guestfish-actions.pod:1421
10092 msgid "This gets the SELinux security context of the daemon."
10097 #: ../src/guestfs-actions.pod:2103
10099 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
10104 #: ../src/guestfs-actions.pod:2111
10105 msgid "guestfs_getxattr"
10110 #: ../src/guestfs-actions.pod:2113
10114 " guestfs_getxattr (guestfs_h *g,\n"
10115 " const char *path,\n"
10116 " const char *name,\n"
10117 " size_t *size_r);\n"
10123 #: ../src/guestfs-actions.pod:2119
10125 "Get a single extended attribute from file C<path> named C<name>. This call "
10126 "follows symlinks. If you want to lookup an extended attribute for the "
10127 "symlink itself, use C<guestfs_lgetxattr>."
10132 #: ../src/guestfs-actions.pod:2123 ../src/guestfs-actions.pod:3369
10134 "Normally it is better to get all extended attributes from a file in one go "
10135 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
10136 "implementations are buggy and do not provide a way to list out attributes. "
10137 "For these filesystems (notably ntfs-3g) you have to know the names of the "
10138 "extended attributes you want in advance and call this function."
10143 #: ../src/guestfs-actions.pod:2130 ../src/guestfs-actions.pod:3376
10144 #: ../fish/guestfish-actions.pod:1441 ../fish/guestfish-actions.pod:2347
10146 "Extended attribute values are blobs of binary data. If there is no extended "
10147 "attribute named C<name>, this returns an error."
10152 #: ../src/guestfs-actions.pod:2133
10153 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
10158 #: ../src/guestfs-actions.pod:2135 ../src/guestfs-actions.pod:2326
10159 #: ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:5098
10160 #: ../src/guestfs-actions.pod:5124 ../src/guestfs-actions.pod:5305
10162 "This function returns a buffer, or NULL on error. The size of the returned "
10163 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
10168 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:3385
10169 msgid "(Added in 1.7.24)"
10174 #: ../src/guestfs-actions.pod:2141
10175 msgid "guestfs_getxattrs"
10180 #: ../src/guestfs-actions.pod:2143
10183 " struct guestfs_xattr_list *\n"
10184 " guestfs_getxattrs (guestfs_h *g,\n"
10185 " const char *path);\n"
10191 #: ../src/guestfs-actions.pod:2147 ../fish/guestfish-actions.pod:1450
10193 "This call lists the extended attributes of the file or directory C<path>."
10198 #: ../src/guestfs-actions.pod:2150 ../fish/guestfish-actions.pod:1453
10200 "At the system call level, this is a combination of the L<listxattr(2)> and "
10201 "L<getxattr(2)> calls."
10206 #: ../src/guestfs-actions.pod:2153
10207 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
10212 #: ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:3397
10213 #: ../src/guestfs-actions.pod:4048
10215 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
10216 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
10221 #: ../src/guestfs-actions.pod:2159 ../src/guestfs-actions.pod:3401
10222 #: ../src/guestfs-actions.pod:3566 ../src/guestfs-actions.pod:3602
10223 #: ../src/guestfs-actions.pod:5478 ../src/guestfs-actions.pod:5934
10224 #: ../src/guestfs-actions.pod:7269
10225 msgid "(Added in 1.0.59)"
10230 #: ../src/guestfs-actions.pod:2161
10231 msgid "guestfs_glob_expand"
10236 #: ../src/guestfs-actions.pod:2163
10240 " guestfs_glob_expand (guestfs_h *g,\n"
10241 " const char *pattern);\n"
10247 #: ../src/guestfs-actions.pod:2167 ../fish/guestfish-actions.pod:1462
10249 "This command searches for all the pathnames matching C<pattern> according to "
10250 "the wildcard expansion rules used by the shell."
10255 #: ../src/guestfs-actions.pod:2171 ../fish/guestfish-actions.pod:1466
10257 "If no paths match, then this returns an empty list (note: not an error)."
10262 #: ../src/guestfs-actions.pod:2174 ../fish/guestfish-actions.pod:1469
10264 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
10265 "GLOB_BRACE>. See that manual page for more details."
10270 #: ../src/guestfs-actions.pod:2182 ../src/guestfs-actions.pod:6099
10271 #: ../src/guestfs-actions.pod:6116
10272 msgid "(Added in 1.0.50)"
10277 #: ../src/guestfs-actions.pod:2184
10278 msgid "guestfs_grep"
10283 #: ../src/guestfs-actions.pod:2186
10287 " guestfs_grep (guestfs_h *g,\n"
10288 " const char *regex,\n"
10289 " const char *path);\n"
10295 #: ../src/guestfs-actions.pod:2191 ../fish/guestfish-actions.pod:1477
10296 msgid "This calls the external C<grep> program and returns the matching lines."
10301 #: ../src/guestfs-actions.pod:2203
10302 msgid "guestfs_grepi"
10307 #: ../src/guestfs-actions.pod:2205
10311 " guestfs_grepi (guestfs_h *g,\n"
10312 " const char *regex,\n"
10313 " const char *path);\n"
10319 #: ../src/guestfs-actions.pod:2210 ../fish/guestfish-actions.pod:1487
10321 "This calls the external C<grep -i> program and returns the matching lines."
10326 #: ../src/guestfs-actions.pod:2222
10327 msgid "guestfs_grub_install"
10332 #: ../src/guestfs-actions.pod:2224
10336 " guestfs_grub_install (guestfs_h *g,\n"
10337 " const char *root,\n"
10338 " const char *device);\n"
10344 #: ../src/guestfs-actions.pod:2229 ../fish/guestfish-actions.pod:1497
10346 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
10347 "the root directory being C<root>."
10352 #: ../src/guestfs-actions.pod:2232 ../fish/guestfish-actions.pod:1500
10354 "Note: If grub-install reports the error \"No suitable drive was found in the "
10355 "generated device map.\" it may be that you need to create a C</boot/grub/"
10356 "device.map> file first that contains the mapping between grub device names "
10357 "and Linux device names. It is usually sufficient to create a file "
10363 #: ../src/guestfs-actions.pod:2239 ../fish/guestfish-actions.pod:1507
10366 " (hd0) /dev/vda\n"
10372 #: ../src/guestfs-actions.pod:2241 ../fish/guestfish-actions.pod:1509
10373 msgid "replacing C</dev/vda> with the name of the installation device."
10378 #: ../src/guestfs-actions.pod:2245
10379 msgid "(Added in 1.0.17)"
10384 #: ../src/guestfs-actions.pod:2247
10385 msgid "guestfs_head"
10390 #: ../src/guestfs-actions.pod:2249
10394 " guestfs_head (guestfs_h *g,\n"
10395 " const char *path);\n"
10401 #: ../src/guestfs-actions.pod:2253 ../fish/guestfish-actions.pod:1515
10403 "This command returns up to the first 10 lines of a file as a list of strings."
10408 #: ../src/guestfs-actions.pod:2265
10409 msgid "guestfs_head_n"
10414 #: ../src/guestfs-actions.pod:2267
10418 " guestfs_head_n (guestfs_h *g,\n"
10420 " const char *path);\n"
10426 #: ../src/guestfs-actions.pod:2272 ../fish/guestfish-actions.pod:1525
10428 "If the parameter C<nrlines> is a positive number, this returns the first "
10429 "C<nrlines> lines of the file C<path>."
10434 #: ../src/guestfs-actions.pod:2275 ../fish/guestfish-actions.pod:1528
10436 "If the parameter C<nrlines> is a negative number, this returns lines from "
10437 "the file C<path>, excluding the last C<nrlines> lines."
10442 #: ../src/guestfs-actions.pod:2278 ../src/guestfs-actions.pod:6396
10443 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:4287
10444 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
10449 #: ../src/guestfs-actions.pod:2289
10450 msgid "guestfs_hexdump"
10455 #: ../src/guestfs-actions.pod:2291
10459 " guestfs_hexdump (guestfs_h *g,\n"
10460 " const char *path);\n"
10466 #: ../src/guestfs-actions.pod:2295 ../fish/guestfish-actions.pod:1540
10468 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
10469 "readable, canonical hex dump of the file."
10474 #: ../src/guestfs-actions.pod:2304 ../src/guestfs-actions.pod:6180
10475 #: ../src/guestfs-actions.pod:6235
10476 msgid "(Added in 1.0.22)"
10481 #: ../src/guestfs-actions.pod:2306
10482 msgid "guestfs_initrd_cat"
10487 #: ../src/guestfs-actions.pod:2308
10491 " guestfs_initrd_cat (guestfs_h *g,\n"
10492 " const char *initrdpath,\n"
10493 " const char *filename,\n"
10494 " size_t *size_r);\n"
10500 #: ../src/guestfs-actions.pod:2314 ../fish/guestfish-actions.pod:1550
10502 "This command unpacks the file C<filename> from the initrd file called "
10503 "C<initrdpath>. The filename must be given I<without> the initial C</> "
10509 #: ../src/guestfs-actions.pod:2318 ../fish/guestfish-actions.pod:1554
10511 "For example, in guestfish you could use the following command to examine the "
10512 "boot script (usually called C</init>) contained in a Linux initrd or "
10518 #: ../src/guestfs-actions.pod:2322 ../fish/guestfish-actions.pod:1558
10521 " initrd-cat /boot/initrd-<version>.img init\n"
10527 #: ../src/guestfs-actions.pod:2324
10528 msgid "See also C<guestfs_initrd_list>."
10533 #: ../src/guestfs-actions.pod:2335
10534 msgid "guestfs_initrd_list"
10539 #: ../src/guestfs-actions.pod:2337
10543 " guestfs_initrd_list (guestfs_h *g,\n"
10544 " const char *path);\n"
10550 #: ../src/guestfs-actions.pod:2341 ../fish/guestfish-actions.pod:1569
10551 msgid "This command lists out files contained in an initrd."
10556 #: ../src/guestfs-actions.pod:2343 ../fish/guestfish-actions.pod:1571
10558 "The files are listed without any initial C</> character. The files are "
10559 "listed in the order they appear (not necessarily alphabetical). Directory "
10560 "names are listed as separate items."
10565 #: ../src/guestfs-actions.pod:2347 ../fish/guestfish-actions.pod:1575
10567 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
10568 "initrd. We I<only> support the newer initramfs format (compressed cpio "
10574 #: ../src/guestfs-actions.pod:2357
10575 msgid "guestfs_inotify_add_watch"
10580 #: ../src/guestfs-actions.pod:2359
10584 " guestfs_inotify_add_watch (guestfs_h *g,\n"
10585 " const char *path,\n"
10592 #: ../src/guestfs-actions.pod:2364 ../fish/guestfish-actions.pod:1583
10593 msgid "Watch C<path> for the events listed in C<mask>."
10598 #: ../src/guestfs-actions.pod:2366 ../fish/guestfish-actions.pod:1585
10600 "Note that if C<path> is a directory then events within that directory are "
10601 "watched, but this does I<not> happen recursively (in subdirectories)."
10606 #: ../src/guestfs-actions.pod:2370 ../fish/guestfish-actions.pod:1589
10608 "Note for non-C or non-Linux callers: the inotify events are defined by the "
10609 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
10614 #: ../src/guestfs-actions.pod:2378
10615 msgid "guestfs_inotify_close"
10620 #: ../src/guestfs-actions.pod:2380
10624 " guestfs_inotify_close (guestfs_h *g);\n"
10630 #: ../src/guestfs-actions.pod:2383 ../fish/guestfish-actions.pod:1597
10632 "This closes the inotify handle which was previously opened by inotify_init. "
10633 "It removes all watches, throws away any pending events, and deallocates all "
10639 #: ../src/guestfs-actions.pod:2391
10640 msgid "guestfs_inotify_files"
10645 #: ../src/guestfs-actions.pod:2393
10649 " guestfs_inotify_files (guestfs_h *g);\n"
10655 #: ../src/guestfs-actions.pod:2396
10657 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
10658 "returns a list of pathnames of objects that were touched. The returned "
10659 "pathnames are sorted and deduplicated."
10664 #: ../src/guestfs-actions.pod:2406
10665 msgid "guestfs_inotify_init"
10670 #: ../src/guestfs-actions.pod:2408
10674 " guestfs_inotify_init (guestfs_h *g,\n"
10675 " int maxevents);\n"
10681 #: ../src/guestfs-actions.pod:2412 ../fish/guestfish-actions.pod:1613
10683 "This command creates a new inotify handle. The inotify subsystem can be "
10684 "used to notify events which happen to objects in the guest filesystem."
10689 #: ../src/guestfs-actions.pod:2416
10691 "C<maxevents> is the maximum number of events which will be queued up between "
10692 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
10693 "passed as C<0>, then the kernel (or previously set) default is used. For "
10694 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
10695 "throws away events, but records the fact that it threw them away by setting "
10696 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
10697 "C<guestfs_inotify_read>)."
10702 #: ../src/guestfs-actions.pod:2426
10704 "Before any events are generated, you have to add some watches to the "
10705 "internal watch list. See: C<guestfs_inotify_add_watch>, "
10706 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
10711 #: ../src/guestfs-actions.pod:2432
10713 "Queued up events should be read periodically by calling "
10714 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
10715 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
10716 "often enough then you risk the internal queue overflowing."
10721 #: ../src/guestfs-actions.pod:2439
10723 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
10724 "This also removes any watches automatically."
10729 #: ../src/guestfs-actions.pod:2443 ../fish/guestfish-actions.pod:1644
10731 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
10732 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
10733 "that there is one global inotify handle per libguestfs instance."
10738 #: ../src/guestfs-actions.pod:2452
10739 msgid "guestfs_inotify_read"
10744 #: ../src/guestfs-actions.pod:2454
10747 " struct guestfs_inotify_event_list *\n"
10748 " guestfs_inotify_read (guestfs_h *g);\n"
10754 #: ../src/guestfs-actions.pod:2457 ../fish/guestfish-actions.pod:1653
10756 "Return the complete queue of events that have happened since the previous "
10762 #: ../src/guestfs-actions.pod:2460 ../fish/guestfish-actions.pod:1656
10763 msgid "If no events have happened, this returns an empty list."
10768 #: ../src/guestfs-actions.pod:2462 ../fish/guestfish-actions.pod:1658
10770 "I<Note>: In order to make sure that all events have been read, you must call "
10771 "this function repeatedly until it returns an empty list. The reason is that "
10772 "the call will read events up to the maximum appliance-to-host message size "
10773 "and leave remaining events in the queue."
10778 #: ../src/guestfs-actions.pod:2468
10780 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
10781 "there was an error. I<The caller must call "
10782 "C<guestfs_free_inotify_event_list> after use>."
10787 #: ../src/guestfs-actions.pod:2474
10788 msgid "guestfs_inotify_rm_watch"
10793 #: ../src/guestfs-actions.pod:2476
10797 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
10804 #: ../src/guestfs-actions.pod:2480
10806 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
10811 #: ../src/guestfs-actions.pod:2487
10812 msgid "guestfs_inspect_get_arch"
10817 #: ../src/guestfs-actions.pod:2489
10821 " guestfs_inspect_get_arch (guestfs_h *g,\n"
10822 " const char *root);\n"
10828 #: ../src/guestfs-actions.pod:2493 ../src/guestfs-actions.pod:2516
10829 #: ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:2623
10830 #: ../src/guestfs-actions.pod:2662 ../src/guestfs-actions.pod:2684
10831 #: ../src/guestfs-actions.pod:2711 ../src/guestfs-actions.pod:2732
10832 #: ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2798
10833 #: ../src/guestfs-actions.pod:2829 ../src/guestfs-actions.pod:2873
10834 #: ../src/guestfs-actions.pod:2915 ../src/guestfs-actions.pod:2938
10835 #: ../src/guestfs-actions.pod:2955 ../src/guestfs-actions.pod:2972
10836 #: ../src/guestfs-actions.pod:2991
10838 "This function should only be called with a root device string as returned by "
10839 "C<guestfs_inspect_os>."
10844 #: ../src/guestfs-actions.pod:2496
10846 "This returns the architecture of the inspected operating system. The "
10847 "possible return values are listed under C<guestfs_file_architecture>."
10852 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1682
10854 "If the architecture could not be determined, then the string C<unknown> is "
10860 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2584
10861 #: ../src/guestfs-actions.pod:2651 ../src/guestfs-actions.pod:2671
10862 #: ../src/guestfs-actions.pod:2699 ../src/guestfs-actions.pod:2785
10863 #: ../src/guestfs-actions.pod:2816 ../src/guestfs-actions.pod:2840
10864 #: ../src/guestfs-actions.pod:2859 ../src/guestfs-actions.pod:2902
10865 #: ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:2945
10866 #: ../src/guestfs-actions.pod:2962 ../src/guestfs-actions.pod:2981
10867 #: ../src/guestfs-actions.pod:3084 ../src/guestfs-actions.pod:3125
10868 #: ../fish/guestfish-actions.pod:1685 ../fish/guestfish-actions.pod:1759
10869 #: ../fish/guestfish-actions.pod:1811 ../fish/guestfish-actions.pod:1826
10870 #: ../fish/guestfish-actions.pod:1847 ../fish/guestfish-actions.pod:1911
10871 #: ../fish/guestfish-actions.pod:1935 ../fish/guestfish-actions.pod:1952
10872 #: ../fish/guestfish-actions.pod:1965 ../fish/guestfish-actions.pod:2000
10873 #: ../fish/guestfish-actions.pod:2016 ../fish/guestfish-actions.pod:2029
10874 #: ../fish/guestfish-actions.pod:2042 ../fish/guestfish-actions.pod:2057
10875 #: ../fish/guestfish-actions.pod:2156 ../fish/guestfish-actions.pod:2190
10876 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
10881 #: ../src/guestfs-actions.pod:2510
10882 msgid "guestfs_inspect_get_distro"
10887 #: ../src/guestfs-actions.pod:2512
10891 " guestfs_inspect_get_distro (guestfs_h *g,\n"
10892 " const char *root);\n"
10898 #: ../src/guestfs-actions.pod:2519 ../fish/guestfish-actions.pod:1694
10900 "This returns the distro (distribution) of the inspected operating system."
10905 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1697
10906 msgid "Currently defined distros are:"
10911 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1701
10912 msgid "\"archlinux\""
10917 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1703
10918 msgid "Arch Linux."
10923 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1705
10929 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1707
10935 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1709
10941 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1711
10947 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1713
10953 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1715
10959 #: ../src/guestfs-actions.pod:2542 ../fish/guestfish-actions.pod:1717
10960 msgid "\"linuxmint\""
10965 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1719
10966 msgid "Linux Mint."
10971 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1721
10972 msgid "\"mandriva\""
10977 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1723
10983 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:1725
10989 #: ../src/guestfs-actions.pod:2552 ../fish/guestfish-actions.pod:1727
10995 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:1729
11001 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:1731
11007 #: ../src/guestfs-actions.pod:2558 ../fish/guestfish-actions.pod:1733
11008 msgid "\"redhat-based\""
11013 #: ../src/guestfs-actions.pod:2560 ../fish/guestfish-actions.pod:1735
11014 msgid "Some Red Hat-derived distro."
11019 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1737
11025 #: ../src/guestfs-actions.pod:2564 ../fish/guestfish-actions.pod:1739
11026 msgid "Red Hat Enterprise Linux and some derivatives."
11031 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1741
11037 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:1743
11043 #: ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2642
11044 #: ../src/guestfs-actions.pod:2893 ../fish/guestfish-actions.pod:1745
11045 #: ../fish/guestfish-actions.pod:1802 ../fish/guestfish-actions.pod:1991
11046 msgid "\"unknown\""
11051 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1747
11052 msgid "The distro could not be determined."
11057 #: ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:2885
11058 #: ../fish/guestfish-actions.pod:1749 ../fish/guestfish-actions.pod:1983
11059 msgid "\"windows\""
11064 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:1751
11066 "Windows does not have distributions. This string is returned if the OS type "
11072 #: ../src/guestfs-actions.pod:2581 ../src/guestfs-actions.pod:2648
11073 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:1756
11074 #: ../fish/guestfish-actions.pod:1808 ../fish/guestfish-actions.pod:1997
11076 "Future versions of libguestfs may return other strings here. The caller "
11077 "should be prepared to handle any string."
11082 #: ../src/guestfs-actions.pod:2591
11083 msgid "guestfs_inspect_get_filesystems"
11088 #: ../src/guestfs-actions.pod:2593
11092 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
11093 " const char *root);\n"
11099 #: ../src/guestfs-actions.pod:2600 ../fish/guestfish-actions.pod:1768
11101 "This returns a list of all the filesystems that we think are associated with "
11102 "this operating system. This includes the root filesystem, other ordinary "
11103 "filesystems, and non-mounted devices like swap partitions."
11108 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:1773
11110 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
11111 "to be shared between operating systems."
11116 #: ../src/guestfs-actions.pod:2608
11118 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11119 "C<guestfs_inspect_get_mountpoints>."
11123 #: ../src/guestfs-actions.pod:2617
11124 msgid "guestfs_inspect_get_format"
11128 #: ../src/guestfs-actions.pod:2619
11132 " guestfs_inspect_get_format (guestfs_h *g,\n"
11133 " const char *root);\n"
11138 #: ../src/guestfs-actions.pod:2626 ../fish/guestfish-actions.pod:1786
11140 "This returns the format of the inspected operating system. You can use it "
11141 "to detect install images, live CDs and similar."
11145 #: ../src/guestfs-actions.pod:2629 ../fish/guestfish-actions.pod:1789
11146 msgid "Currently defined formats are:"
11150 #: ../src/guestfs-actions.pod:2633 ../fish/guestfish-actions.pod:1793
11151 msgid "\"installed\""
11155 #: ../src/guestfs-actions.pod:2635 ../fish/guestfish-actions.pod:1795
11156 msgid "This is an installed operating system."
11160 #: ../src/guestfs-actions.pod:2637 ../fish/guestfish-actions.pod:1797
11161 msgid "\"installer\""
11165 #: ../src/guestfs-actions.pod:2639 ../fish/guestfish-actions.pod:1799
11167 "The disk image being inspected is not an installed operating system, but a "
11168 "I<bootable> install disk, live CD, or similar."
11172 #: ../src/guestfs-actions.pod:2644 ../fish/guestfish-actions.pod:1804
11173 msgid "The format of this disk image is not known."
11178 #: ../src/guestfs-actions.pod:2656
11179 msgid "guestfs_inspect_get_hostname"
11184 #: ../src/guestfs-actions.pod:2658
11188 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
11189 " const char *root);\n"
11195 #: ../src/guestfs-actions.pod:2665 ../fish/guestfish-actions.pod:1820
11197 "This function returns the hostname of the operating system as found by "
11198 "inspection of the guest's configuration files."
11203 #: ../src/guestfs-actions.pod:2668 ../fish/guestfish-actions.pod:1823
11205 "If the hostname could not be determined, then the string C<unknown> is "
11211 #: ../src/guestfs-actions.pod:2676
11212 msgid "(Added in 1.7.9)"
11217 #: ../src/guestfs-actions.pod:2678
11218 msgid "guestfs_inspect_get_major_version"
11223 #: ../src/guestfs-actions.pod:2680
11227 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
11228 " const char *root);\n"
11234 #: ../src/guestfs-actions.pod:2687 ../fish/guestfish-actions.pod:1835
11236 "This returns the major version number of the inspected operating system."
11241 #: ../src/guestfs-actions.pod:2690 ../fish/guestfish-actions.pod:1838
11243 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
11244 "popular public names used by the operating system. Notably the operating "
11245 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
11246 "1). You can find out the real versions corresponding to releases of Windows "
11247 "by consulting Wikipedia or MSDN."
11252 #: ../src/guestfs-actions.pod:2697 ../src/guestfs-actions.pod:2717
11253 #: ../fish/guestfish-actions.pod:1845 ../fish/guestfish-actions.pod:1859
11254 msgid "If the version could not be determined, then C<0> is returned."
11259 #: ../src/guestfs-actions.pod:2705
11260 msgid "guestfs_inspect_get_minor_version"
11265 #: ../src/guestfs-actions.pod:2707
11269 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
11270 " const char *root);\n"
11276 #: ../src/guestfs-actions.pod:2714 ../fish/guestfish-actions.pod:1856
11278 "This returns the minor version number of the inspected operating system."
11283 #: ../src/guestfs-actions.pod:2719
11285 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11286 "C<guestfs_inspect_get_major_version>."
11291 #: ../src/guestfs-actions.pod:2726
11292 msgid "guestfs_inspect_get_mountpoints"
11297 #: ../src/guestfs-actions.pod:2728
11301 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
11302 " const char *root);\n"
11307 #: ../src/guestfs-actions.pod:2735 ../fish/guestfish-actions.pod:1871
11309 "This returns a hash of where we think the filesystems associated with this "
11310 "operating system should be mounted. Callers should note that this is at "
11311 "best an educated guess made by reading configuration files such as C</etc/"
11312 "fstab>. I<In particular note> that this may return filesystems which are "
11313 "non-existent or not mountable and callers should be prepared to handle or "
11314 "ignore failures if they try to mount them."
11319 #: ../src/guestfs-actions.pod:2744 ../fish/guestfish-actions.pod:1880
11321 "Each element in the returned hashtable has a key which is the path of the "
11322 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
11323 "mounted there (eg. C</dev/sda1>)."
11328 #: ../src/guestfs-actions.pod:2749 ../fish/guestfish-actions.pod:1885
11330 "Non-mounted devices such as swap devices are I<not> returned in this list."
11335 #: ../src/guestfs-actions.pod:2752
11337 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11338 "C<guestfs_inspect_get_filesystems>."
11343 #: ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:3454
11344 #: ../src/guestfs-actions.pod:4664 ../src/guestfs-actions.pod:6537
11346 "This function returns a NULL-terminated array of strings, or NULL if there "
11347 "was an error. The array of strings will always have length C<2n+1>, where "
11348 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
11349 "caller must free the strings and the array after use>."
11354 #: ../src/guestfs-actions.pod:2763
11355 msgid "guestfs_inspect_get_package_format"
11360 #: ../src/guestfs-actions.pod:2765
11364 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
11365 " const char *root);\n"
11371 #: ../src/guestfs-actions.pod:2772
11373 "This function and C<guestfs_inspect_get_package_management> return the "
11374 "package format and package management tool used by the inspected operating "
11375 "system. For example for Fedora these functions would return C<rpm> (package "
11376 "format) and C<yum> (package management)."
11381 #: ../src/guestfs-actions.pod:2778 ../fish/guestfish-actions.pod:1904
11383 "This returns the string C<unknown> if we could not determine the package "
11384 "format I<or> if the operating system does not have a real packaging system "
11390 #: ../src/guestfs-actions.pod:2782 ../fish/guestfish-actions.pod:1908
11392 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
11393 "Future versions of libguestfs may return other strings."
11398 #: ../src/guestfs-actions.pod:2790 ../src/guestfs-actions.pod:2821
11399 msgid "(Added in 1.7.5)"
11404 #: ../src/guestfs-actions.pod:2792
11405 msgid "guestfs_inspect_get_package_management"
11410 #: ../src/guestfs-actions.pod:2794
11414 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
11415 " const char *root);\n"
11421 #: ../src/guestfs-actions.pod:2801
11423 "C<guestfs_inspect_get_package_format> and this function return the package "
11424 "format and package management tool used by the inspected operating system. "
11425 "For example for Fedora these functions would return C<rpm> (package format) "
11426 "and C<yum> (package management)."
11431 #: ../src/guestfs-actions.pod:2807 ../fish/guestfish-actions.pod:1926
11433 "This returns the string C<unknown> if we could not determine the package "
11434 "management tool I<or> if the operating system does not have a real packaging "
11435 "system (eg. Windows)."
11440 #: ../src/guestfs-actions.pod:2811 ../fish/guestfish-actions.pod:1930
11442 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
11443 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
11444 "libguestfs may return other strings."
11449 #: ../src/guestfs-actions.pod:2823
11450 msgid "guestfs_inspect_get_product_name"
11455 #: ../src/guestfs-actions.pod:2825
11459 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
11460 " const char *root);\n"
11466 #: ../src/guestfs-actions.pod:2832 ../fish/guestfish-actions.pod:1944
11468 "This returns the product name of the inspected operating system. The "
11469 "product name is generally some freeform string which can be displayed to the "
11470 "user, but should not be parsed by programs."
11475 #: ../src/guestfs-actions.pod:2837 ../fish/guestfish-actions.pod:1949
11477 "If the product name could not be determined, then the string C<unknown> is "
11483 #: ../src/guestfs-actions.pod:2847
11484 msgid "guestfs_inspect_get_roots"
11489 #: ../src/guestfs-actions.pod:2849
11493 " guestfs_inspect_get_roots (guestfs_h *g);\n"
11499 #: ../src/guestfs-actions.pod:2852
11501 "This function is a convenient way to get the list of root devices, as "
11502 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
11503 "the whole inspection process."
11508 #: ../src/guestfs-actions.pod:2856
11510 "This returns an empty list if either no root devices were found or the "
11511 "caller has not called C<guestfs_inspect_os>."
11516 #: ../src/guestfs-actions.pod:2865
11517 msgid "(Added in 1.7.3)"
11522 #: ../src/guestfs-actions.pod:2867
11523 msgid "guestfs_inspect_get_type"
11528 #: ../src/guestfs-actions.pod:2869
11532 " guestfs_inspect_get_type (guestfs_h *g,\n"
11533 " const char *root);\n"
11539 #: ../src/guestfs-actions.pod:2876 ../fish/guestfish-actions.pod:1974
11541 "This returns the type of the inspected operating system. Currently defined "
11547 #: ../src/guestfs-actions.pod:2881 ../fish/guestfish-actions.pod:1979
11553 #: ../src/guestfs-actions.pod:2883 ../fish/guestfish-actions.pod:1981
11554 msgid "Any Linux-based operating system."
11559 #: ../src/guestfs-actions.pod:2887 ../fish/guestfish-actions.pod:1985
11560 msgid "Any Microsoft Windows operating system."
11565 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:1987
11566 msgid "\"freebsd\""
11571 #: ../src/guestfs-actions.pod:2891 ../fish/guestfish-actions.pod:1989
11577 #: ../src/guestfs-actions.pod:2895 ../fish/guestfish-actions.pod:1993
11578 msgid "The operating system type could not be determined."
11583 #: ../src/guestfs-actions.pod:2909
11584 msgid "guestfs_inspect_get_windows_systemroot"
11589 #: ../src/guestfs-actions.pod:2911
11593 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
11594 " const char *root);\n"
11600 #: ../src/guestfs-actions.pod:2918 ../fish/guestfish-actions.pod:2009
11602 "This returns the Windows systemroot of the inspected guest. The systemroot "
11603 "is a directory path such as C</WINDOWS>."
11608 #: ../src/guestfs-actions.pod:2921 ../fish/guestfish-actions.pod:2012
11610 "This call assumes that the guest is Windows and that the systemroot could be "
11611 "determined by inspection. If this is not the case then an error is returned."
11616 #: ../src/guestfs-actions.pod:2930
11617 msgid "(Added in 1.5.25)"
11621 #: ../src/guestfs-actions.pod:2932
11622 msgid "guestfs_inspect_is_live"
11626 #: ../src/guestfs-actions.pod:2934
11630 " guestfs_inspect_is_live (guestfs_h *g,\n"
11631 " const char *root);\n"
11636 #: ../src/guestfs-actions.pod:2941
11638 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
11639 "disk), then this returns true if a live image was detected on the disk."
11643 #: ../src/guestfs-actions.pod:2949
11644 msgid "guestfs_inspect_is_multipart"
11648 #: ../src/guestfs-actions.pod:2951
11652 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
11653 " const char *root);\n"
11658 #: ../src/guestfs-actions.pod:2958
11660 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
11661 "disk), then this returns true if the disk is part of a set."
11665 #: ../src/guestfs-actions.pod:2966
11666 msgid "guestfs_inspect_is_netinst"
11670 #: ../src/guestfs-actions.pod:2968
11674 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
11675 " const char *root);\n"
11680 #: ../src/guestfs-actions.pod:2975
11682 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
11683 "disk), then this returns true if the disk is a network installer, ie. not a "
11684 "self-contained install CD but one which is likely to require network access "
11685 "to complete the install."
11690 #: ../src/guestfs-actions.pod:2985
11691 msgid "guestfs_inspect_list_applications"
11696 #: ../src/guestfs-actions.pod:2987
11699 " struct guestfs_application_list *\n"
11700 " guestfs_inspect_list_applications (guestfs_h *g,\n"
11701 " const char *root);\n"
11707 #: ../src/guestfs-actions.pod:2994 ../fish/guestfish-actions.pod:2066
11708 msgid "Return the list of applications installed in the operating system."
11713 #: ../src/guestfs-actions.pod:2996
11715 "I<Note:> This call works differently from other parts of the inspection "
11716 "API. You have to call C<guestfs_inspect_os>, then "
11717 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
11718 "this. Listing applications is a significantly more difficult operation "
11719 "which requires access to the full filesystem. Also note that unlike the "
11720 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
11721 "the libguestfs handle, this call actually reads parts of the mounted "
11722 "filesystems during the call."
11727 #: ../src/guestfs-actions.pod:3006 ../fish/guestfish-actions.pod:2078
11729 "This returns an empty list if the inspection code was not able to determine "
11730 "the list of applications."
11735 #: ../src/guestfs-actions.pod:3009 ../fish/guestfish-actions.pod:2081
11736 msgid "The application structure contains the following fields:"
11741 #: ../src/guestfs-actions.pod:3013 ../fish/guestfish-actions.pod:2085
11742 msgid "C<app_name>"
11747 #: ../src/guestfs-actions.pod:3015 ../fish/guestfish-actions.pod:2087
11749 "The name of the application. For Red Hat-derived and Debian-derived Linux "
11750 "guests, this is the package name."
11755 #: ../src/guestfs-actions.pod:3018 ../fish/guestfish-actions.pod:2090
11756 msgid "C<app_display_name>"
11761 #: ../src/guestfs-actions.pod:3020 ../fish/guestfish-actions.pod:2092
11763 "The display name of the application, sometimes localized to the install "
11764 "language of the guest operating system."
11769 #: ../src/guestfs-actions.pod:3023 ../fish/guestfish-actions.pod:2095
11771 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
11772 "to display something can use C<app_name> instead."
11777 #: ../src/guestfs-actions.pod:3026 ../fish/guestfish-actions.pod:2098
11778 msgid "C<app_epoch>"
11783 #: ../src/guestfs-actions.pod:3028 ../fish/guestfish-actions.pod:2100
11785 "For package managers which use epochs, this contains the epoch of the "
11786 "package (an integer). If unavailable, this is returned as C<0>."
11791 #: ../src/guestfs-actions.pod:3031 ../fish/guestfish-actions.pod:2103
11792 msgid "C<app_version>"
11797 #: ../src/guestfs-actions.pod:3033 ../fish/guestfish-actions.pod:2105
11799 "The version string of the application or package. If unavailable this is "
11800 "returned as an empty string C<\"\">."
11805 #: ../src/guestfs-actions.pod:3036 ../fish/guestfish-actions.pod:2108
11806 msgid "C<app_release>"
11811 #: ../src/guestfs-actions.pod:3038 ../fish/guestfish-actions.pod:2110
11813 "The release string of the application or package, for package managers that "
11814 "use this. If unavailable this is returned as an empty string C<\"\">."
11819 #: ../src/guestfs-actions.pod:3042 ../fish/guestfish-actions.pod:2114
11820 msgid "C<app_install_path>"
11825 #: ../src/guestfs-actions.pod:3044 ../fish/guestfish-actions.pod:2116
11827 "The installation path of the application (on operating systems such as "
11828 "Windows which use installation paths). This path is in the format used by "
11829 "the guest operating system, it is not a libguestfs path."
11834 #: ../src/guestfs-actions.pod:3049 ../fish/guestfish-actions.pod:2121
11835 msgid "If unavailable this is returned as an empty string C<\"\">."
11840 #: ../src/guestfs-actions.pod:3051 ../fish/guestfish-actions.pod:2123
11841 msgid "C<app_trans_path>"
11846 #: ../src/guestfs-actions.pod:3053 ../fish/guestfish-actions.pod:2125
11848 "The install path translated into a libguestfs path. If unavailable this is "
11849 "returned as an empty string C<\"\">."
11854 #: ../src/guestfs-actions.pod:3056 ../fish/guestfish-actions.pod:2128
11855 msgid "C<app_publisher>"
11860 #: ../src/guestfs-actions.pod:3058 ../fish/guestfish-actions.pod:2130
11862 "The name of the publisher of the application, for package managers that use "
11863 "this. If unavailable this is returned as an empty string C<\"\">."
11868 #: ../src/guestfs-actions.pod:3062 ../fish/guestfish-actions.pod:2134
11874 #: ../src/guestfs-actions.pod:3064 ../fish/guestfish-actions.pod:2136
11876 "The URL (eg. upstream URL) of the application. If unavailable this is "
11877 "returned as an empty string C<\"\">."
11882 #: ../src/guestfs-actions.pod:3067 ../fish/guestfish-actions.pod:2139
11883 msgid "C<app_source_package>"
11888 #: ../src/guestfs-actions.pod:3069 ../fish/guestfish-actions.pod:2141
11890 "For packaging systems which support this, the name of the source package. "
11891 "If unavailable this is returned as an empty string C<\"\">."
11896 #: ../src/guestfs-actions.pod:3072 ../fish/guestfish-actions.pod:2144
11897 msgid "C<app_summary>"
11902 #: ../src/guestfs-actions.pod:3074 ../fish/guestfish-actions.pod:2146
11904 "A short (usually one line) description of the application or package. If "
11905 "unavailable this is returned as an empty string C<\"\">."
11910 #: ../src/guestfs-actions.pod:3077 ../fish/guestfish-actions.pod:2149
11911 msgid "C<app_description>"
11916 #: ../src/guestfs-actions.pod:3079 ../fish/guestfish-actions.pod:2151
11918 "A longer description of the application or package. If unavailable this is "
11919 "returned as an empty string C<\"\">."
11924 #: ../src/guestfs-actions.pod:3086
11926 "This function returns a C<struct guestfs_application_list *>, or NULL if "
11927 "there was an error. I<The caller must call C<guestfs_free_application_list> "
11933 #: ../src/guestfs-actions.pod:3090
11934 msgid "(Added in 1.7.8)"
11939 #: ../src/guestfs-actions.pod:3092
11940 msgid "guestfs_inspect_os"
11945 #: ../src/guestfs-actions.pod:3094
11949 " guestfs_inspect_os (guestfs_h *g);\n"
11955 #: ../src/guestfs-actions.pod:3097 ../fish/guestfish-actions.pod:2162
11957 "This function uses other libguestfs functions and certain heuristics to "
11958 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
11959 "for operating systems."
11964 #: ../src/guestfs-actions.pod:3101 ../fish/guestfish-actions.pod:2166
11965 msgid "The list returned is empty if no operating systems were found."
11970 #: ../src/guestfs-actions.pod:3103 ../fish/guestfish-actions.pod:2168
11972 "If one operating system was found, then this returns a list with a single "
11973 "element, which is the name of the root filesystem of this operating system. "
11974 "It is also possible for this function to return a list containing more than "
11975 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
11976 "element being the root filesystem of one of the operating systems."
11981 #: ../src/guestfs-actions.pod:3110
11983 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
11984 "functions in order to query further information about each operating system, "
11985 "such as the name and version."
11990 #: ../src/guestfs-actions.pod:3115
11992 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
11993 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
11994 "the contents. This should be called with no disks currently mounted. The "
11995 "function may also use Augeas, so any existing Augeas handle will be closed."
12000 #: ../src/guestfs-actions.pod:3121 ../fish/guestfish-actions.pod:2186
12002 "This function cannot decrypt encrypted disks. The caller must do that first "
12003 "(supplying the necessary keys) if the disk is encrypted."
12008 #: ../src/guestfs-actions.pod:3127 ../src/guestfs-actions.pod:3412
12009 #: ../src/guestfs-actions.pod:3474
12010 msgid "See also C<guestfs_list_filesystems>."
12015 #: ../src/guestfs-actions.pod:3135
12016 msgid "guestfs_is_blockdev"
12021 #: ../src/guestfs-actions.pod:3137
12025 " guestfs_is_blockdev (guestfs_h *g,\n"
12026 " const char *path);\n"
12032 #: ../src/guestfs-actions.pod:3141 ../fish/guestfish-actions.pod:2198
12034 "This returns C<true> if and only if there is a block device with the given "
12040 #: ../src/guestfs-actions.pod:3144 ../src/guestfs-actions.pod:3173
12041 #: ../src/guestfs-actions.pod:3203 ../src/guestfs-actions.pod:3218
12042 #: ../src/guestfs-actions.pod:3234 ../src/guestfs-actions.pod:3290
12043 #: ../src/guestfs-actions.pod:3305
12044 msgid "See also C<guestfs_stat>."
12049 #: ../src/guestfs-actions.pod:3148 ../src/guestfs-actions.pod:3177
12050 #: ../src/guestfs-actions.pod:3222 ../src/guestfs-actions.pod:3294
12051 #: ../src/guestfs-actions.pod:3309
12052 msgid "(Added in 1.5.10)"
12057 #: ../src/guestfs-actions.pod:3150
12058 msgid "guestfs_is_busy"
12063 #: ../src/guestfs-actions.pod:3152
12067 " guestfs_is_busy (guestfs_h *g);\n"
12073 #: ../src/guestfs-actions.pod:3155 ../fish/guestfish-actions.pod:2207
12075 "This returns true iff this handle is busy processing a command (in the "
12081 #: ../src/guestfs-actions.pod:3164
12082 msgid "guestfs_is_chardev"
12087 #: ../src/guestfs-actions.pod:3166
12091 " guestfs_is_chardev (guestfs_h *g,\n"
12092 " const char *path);\n"
12098 #: ../src/guestfs-actions.pod:3170 ../fish/guestfish-actions.pod:2216
12100 "This returns C<true> if and only if there is a character device with the "
12101 "given C<path> name."
12106 #: ../src/guestfs-actions.pod:3179
12107 msgid "guestfs_is_config"
12112 #: ../src/guestfs-actions.pod:3181
12116 " guestfs_is_config (guestfs_h *g);\n"
12122 #: ../src/guestfs-actions.pod:3184 ../fish/guestfish-actions.pod:2225
12124 "This returns true iff this handle is being configured (in the C<CONFIG> "
12130 #: ../src/guestfs-actions.pod:3193
12131 msgid "guestfs_is_dir"
12136 #: ../src/guestfs-actions.pod:3195
12140 " guestfs_is_dir (guestfs_h *g,\n"
12141 " const char *path);\n"
12147 #: ../src/guestfs-actions.pod:3199 ../fish/guestfish-actions.pod:2234
12149 "This returns C<true> if and only if there is a directory with the given "
12150 "C<path> name. Note that it returns false for other objects like files."
12155 #: ../src/guestfs-actions.pod:3209
12156 msgid "guestfs_is_fifo"
12161 #: ../src/guestfs-actions.pod:3211
12165 " guestfs_is_fifo (guestfs_h *g,\n"
12166 " const char *path);\n"
12172 #: ../src/guestfs-actions.pod:3215 ../fish/guestfish-actions.pod:2244
12174 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
12175 "given C<path> name."
12180 #: ../src/guestfs-actions.pod:3224
12181 msgid "guestfs_is_file"
12186 #: ../src/guestfs-actions.pod:3226
12190 " guestfs_is_file (guestfs_h *g,\n"
12191 " const char *path);\n"
12197 #: ../src/guestfs-actions.pod:3230 ../fish/guestfish-actions.pod:2253
12199 "This returns C<true> if and only if there is a regular file with the given "
12200 "C<path> name. Note that it returns false for other objects like directories."
12205 #: ../src/guestfs-actions.pod:3240
12206 msgid "guestfs_is_launching"
12211 #: ../src/guestfs-actions.pod:3242
12215 " guestfs_is_launching (guestfs_h *g);\n"
12221 #: ../src/guestfs-actions.pod:3245 ../fish/guestfish-actions.pod:2263
12223 "This returns true iff this handle is launching the subprocess (in the "
12224 "C<LAUNCHING> state)."
12229 #: ../src/guestfs-actions.pod:3254
12230 msgid "guestfs_is_lv"
12235 #: ../src/guestfs-actions.pod:3256
12239 " guestfs_is_lv (guestfs_h *g,\n"
12240 " const char *device);\n"
12246 #: ../src/guestfs-actions.pod:3260 ../fish/guestfish-actions.pod:2272
12248 "This command tests whether C<device> is a logical volume, and returns true "
12249 "iff this is the case."
12254 #: ../src/guestfs-actions.pod:3267
12255 msgid "guestfs_is_ready"
12260 #: ../src/guestfs-actions.pod:3269
12264 " guestfs_is_ready (guestfs_h *g);\n"
12270 #: ../src/guestfs-actions.pod:3272 ../fish/guestfish-actions.pod:2279
12272 "This returns true iff this handle is ready to accept commands (in the "
12278 #: ../src/guestfs-actions.pod:3281
12279 msgid "guestfs_is_socket"
12284 #: ../src/guestfs-actions.pod:3283
12288 " guestfs_is_socket (guestfs_h *g,\n"
12289 " const char *path);\n"
12295 #: ../src/guestfs-actions.pod:3287 ../fish/guestfish-actions.pod:2288
12297 "This returns C<true> if and only if there is a Unix domain socket with the "
12298 "given C<path> name."
12303 #: ../src/guestfs-actions.pod:3296
12304 msgid "guestfs_is_symlink"
12309 #: ../src/guestfs-actions.pod:3298
12313 " guestfs_is_symlink (guestfs_h *g,\n"
12314 " const char *path);\n"
12320 #: ../src/guestfs-actions.pod:3302 ../fish/guestfish-actions.pod:2297
12322 "This returns C<true> if and only if there is a symbolic link with the given "
12328 #: ../src/guestfs-actions.pod:3311
12329 msgid "guestfs_kill_subprocess"
12334 #: ../src/guestfs-actions.pod:3313
12338 " guestfs_kill_subprocess (guestfs_h *g);\n"
12344 #: ../src/guestfs-actions.pod:3316 ../fish/guestfish-actions.pod:2306
12345 msgid "This kills the qemu subprocess. You should never need to call this."
12350 #: ../src/guestfs-actions.pod:3322
12351 msgid "guestfs_launch"
12356 #: ../src/guestfs-actions.pod:3324
12360 " guestfs_launch (guestfs_h *g);\n"
12366 #: ../src/guestfs-actions.pod:3327 ../fish/guestfish-actions.pod:2314
12368 "Internally libguestfs is implemented by running a virtual machine using "
12374 #: ../src/guestfs-actions.pod:3330 ../fish/guestfish-actions.pod:2317
12376 "You should call this after configuring the handle (eg. adding drives) but "
12377 "before performing any actions."
12382 #: ../src/guestfs-actions.pod:3337
12383 msgid "guestfs_lchown"
12388 #: ../src/guestfs-actions.pod:3339
12392 " guestfs_lchown (guestfs_h *g,\n"
12395 " const char *path);\n"
12401 #: ../src/guestfs-actions.pod:3345
12403 "Change the file owner to C<owner> and group to C<group>. This is like "
12404 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
12405 "changed, not the target."
12410 #: ../src/guestfs-actions.pod:3357
12411 msgid "guestfs_lgetxattr"
12416 #: ../src/guestfs-actions.pod:3359
12420 " guestfs_lgetxattr (guestfs_h *g,\n"
12421 " const char *path,\n"
12422 " const char *name,\n"
12423 " size_t *size_r);\n"
12429 #: ../src/guestfs-actions.pod:3365 ../fish/guestfish-actions.pod:2336
12431 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
12432 "is a symlink, then this call returns an extended attribute from the symlink."
12437 #: ../src/guestfs-actions.pod:3379
12438 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
12443 #: ../src/guestfs-actions.pod:3387
12444 msgid "guestfs_lgetxattrs"
12449 #: ../src/guestfs-actions.pod:3389
12452 " struct guestfs_xattr_list *\n"
12453 " guestfs_lgetxattrs (guestfs_h *g,\n"
12454 " const char *path);\n"
12460 #: ../src/guestfs-actions.pod:3393
12462 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
12463 "then it returns the extended attributes of the link itself."
12468 #: ../src/guestfs-actions.pod:3403
12469 msgid "guestfs_list_devices"
12474 #: ../src/guestfs-actions.pod:3405
12478 " guestfs_list_devices (guestfs_h *g);\n"
12484 #: ../src/guestfs-actions.pod:3408 ../fish/guestfish-actions.pod:2364
12485 msgid "List all the block devices."
12490 #: ../src/guestfs-actions.pod:3410 ../fish/guestfish-actions.pod:2366
12491 msgid "The full block device names are returned, eg. C</dev/sda>."
12496 #: ../src/guestfs-actions.pod:3420
12497 msgid "guestfs_list_filesystems"
12502 #: ../src/guestfs-actions.pod:3422
12506 " guestfs_list_filesystems (guestfs_h *g);\n"
12512 #: ../src/guestfs-actions.pod:3425 ../fish/guestfish-actions.pod:2374
12514 "This inspection command looks for filesystems on partitions, block devices "
12515 "and logical volumes, returning a list of devices containing filesystems and "
12521 #: ../src/guestfs-actions.pod:3429 ../fish/guestfish-actions.pod:2378
12523 "The return value is a hash, where the keys are the devices containing "
12524 "filesystems, and the values are the filesystem types. For example:"
12529 #: ../src/guestfs-actions.pod:3433 ../fish/guestfish-actions.pod:2382
12532 " \"/dev/sda1\" => \"ntfs\"\n"
12533 " \"/dev/sda2\" => \"ext2\"\n"
12534 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
12535 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
12541 #: ../src/guestfs-actions.pod:3438 ../fish/guestfish-actions.pod:2387
12543 "The value can have the special value \"unknown\", meaning the content of the "
12544 "device is undetermined or empty. \"swap\" means a Linux swap partition."
12549 #: ../src/guestfs-actions.pod:3442
12551 "This command runs other libguestfs commands, which might include "
12552 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
12553 "soon after launch and only when nothing is mounted."
12558 #: ../src/guestfs-actions.pod:3446
12560 "Not all of the filesystems returned will be mountable. In particular, swap "
12561 "partitions are returned in the list. Also this command does not check that "
12562 "each filesystem found is valid and mountable, and some filesystems might be "
12563 "mountable but require special options. Filesystems may not all belong to a "
12564 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
12569 #: ../src/guestfs-actions.pod:3460 ../src/guestfs-actions.pod:5065
12570 msgid "(Added in 1.5.15)"
12575 #: ../src/guestfs-actions.pod:3462
12576 msgid "guestfs_list_partitions"
12581 #: ../src/guestfs-actions.pod:3464
12585 " guestfs_list_partitions (guestfs_h *g);\n"
12591 #: ../src/guestfs-actions.pod:3467 ../fish/guestfish-actions.pod:2407
12592 msgid "List all the partitions detected on all block devices."
12597 #: ../src/guestfs-actions.pod:3469 ../fish/guestfish-actions.pod:2409
12598 msgid "The full partition device names are returned, eg. C</dev/sda1>"
12603 #: ../src/guestfs-actions.pod:3471
12605 "This does not return logical volumes. For that you will need to call "
12611 #: ../src/guestfs-actions.pod:3482
12617 #: ../src/guestfs-actions.pod:3484
12621 " guestfs_ll (guestfs_h *g,\n"
12622 " const char *directory);\n"
12628 #: ../src/guestfs-actions.pod:3488 ../fish/guestfish-actions.pod:2420
12630 "List the files in C<directory> (relative to the root directory, there is no "
12631 "cwd) in the format of 'ls -la'."
12636 #: ../src/guestfs-actions.pod:3491 ../fish/guestfish-actions.pod:2423
12638 "This command is mostly useful for interactive sessions. It is I<not> "
12639 "intended that you try to parse the output string."
12644 #: ../src/guestfs-actions.pod:3499
12650 #: ../src/guestfs-actions.pod:3501
12654 " guestfs_ln (guestfs_h *g,\n"
12655 " const char *target,\n"
12656 " const char *linkname);\n"
12662 #: ../src/guestfs-actions.pod:3506 ../fish/guestfish-actions.pod:2430
12663 msgid "This command creates a hard link using the C<ln> command."
12668 #: ../src/guestfs-actions.pod:3512
12669 msgid "guestfs_ln_f"
12674 #: ../src/guestfs-actions.pod:3514
12678 " guestfs_ln_f (guestfs_h *g,\n"
12679 " const char *target,\n"
12680 " const char *linkname);\n"
12686 #: ../src/guestfs-actions.pod:3519 ../fish/guestfish-actions.pod:2436
12688 "This command creates a hard link using the C<ln -f> command. The C<-f> "
12689 "option removes the link (C<linkname>) if it exists already."
12694 #: ../src/guestfs-actions.pod:3526
12695 msgid "guestfs_ln_s"
12700 #: ../src/guestfs-actions.pod:3528
12704 " guestfs_ln_s (guestfs_h *g,\n"
12705 " const char *target,\n"
12706 " const char *linkname);\n"
12712 #: ../src/guestfs-actions.pod:3533 ../fish/guestfish-actions.pod:2443
12713 msgid "This command creates a symbolic link using the C<ln -s> command."
12718 #: ../src/guestfs-actions.pod:3539
12719 msgid "guestfs_ln_sf"
12724 #: ../src/guestfs-actions.pod:3541
12728 " guestfs_ln_sf (guestfs_h *g,\n"
12729 " const char *target,\n"
12730 " const char *linkname);\n"
12736 #: ../src/guestfs-actions.pod:3546 ../fish/guestfish-actions.pod:2449
12738 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
12739 "option removes the link (C<linkname>) if it exists already."
12744 #: ../src/guestfs-actions.pod:3553
12745 msgid "guestfs_lremovexattr"
12750 #: ../src/guestfs-actions.pod:3555
12754 " guestfs_lremovexattr (guestfs_h *g,\n"
12755 " const char *xattr,\n"
12756 " const char *path);\n"
12762 #: ../src/guestfs-actions.pod:3560
12764 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
12765 "link, then it removes an extended attribute of the link itself."
12770 #: ../src/guestfs-actions.pod:3568
12776 #: ../src/guestfs-actions.pod:3570
12780 " guestfs_ls (guestfs_h *g,\n"
12781 " const char *directory);\n"
12787 #: ../src/guestfs-actions.pod:3574 ../fish/guestfish-actions.pod:2464
12789 "List the files in C<directory> (relative to the root directory, there is no "
12790 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
12795 #: ../src/guestfs-actions.pod:3578
12797 "This command is mostly useful for interactive sessions. Programs should "
12798 "probably use C<guestfs_readdir> instead."
12803 #: ../src/guestfs-actions.pod:3587
12804 msgid "guestfs_lsetxattr"
12809 #: ../src/guestfs-actions.pod:3589
12813 " guestfs_lsetxattr (guestfs_h *g,\n"
12814 " const char *xattr,\n"
12815 " const char *val,\n"
12817 " const char *path);\n"
12823 #: ../src/guestfs-actions.pod:3596
12825 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
12826 "then it sets an extended attribute of the link itself."
12831 #: ../src/guestfs-actions.pod:3604
12832 msgid "guestfs_lstat"
12837 #: ../src/guestfs-actions.pod:3606
12840 " struct guestfs_stat *\n"
12841 " guestfs_lstat (guestfs_h *g,\n"
12842 " const char *path);\n"
12848 #: ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:6136
12849 #: ../fish/guestfish-actions.pod:2483 ../fish/guestfish-actions.pod:4122
12850 msgid "Returns file information for the given C<path>."
12855 #: ../src/guestfs-actions.pod:3612
12857 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
12858 "link, then the link is stat-ed, not the file it refers to."
12863 #: ../src/guestfs-actions.pod:3616 ../fish/guestfish-actions.pod:2489
12864 msgid "This is the same as the C<lstat(2)> system call."
12869 #: ../src/guestfs-actions.pod:3618 ../src/guestfs-actions.pod:6140
12871 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
12872 "error. I<The caller must call C<guestfs_free_stat> after use>."
12877 #: ../src/guestfs-actions.pod:3622 ../src/guestfs-actions.pod:6144
12878 #: ../src/guestfs-actions.pod:6162 ../src/guestfs-actions.pod:6543
12879 msgid "(Added in 0.9.2)"
12884 #: ../src/guestfs-actions.pod:3624
12885 msgid "guestfs_lstatlist"
12890 #: ../src/guestfs-actions.pod:3626
12893 " struct guestfs_stat_list *\n"
12894 " guestfs_lstatlist (guestfs_h *g,\n"
12895 " const char *path,\n"
12896 " char *const *names);\n"
12902 #: ../src/guestfs-actions.pod:3631
12904 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
12905 "files, where all files are in the directory C<path>. C<names> is the list "
12906 "of files from this directory."
12911 #: ../src/guestfs-actions.pod:3635 ../fish/guestfish-actions.pod:2499
12913 "On return you get a list of stat structs, with a one-to-one correspondence "
12914 "to the C<names> list. If any name did not exist or could not be lstat'd, "
12915 "then the C<ino> field of that structure is set to C<-1>."
12920 #: ../src/guestfs-actions.pod:3640
12922 "This call is intended for programs that want to efficiently list a directory "
12923 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
12924 "for a similarly efficient call for getting extended attributes. Very long "
12925 "directory listings might cause the protocol message size to be exceeded, "
12926 "causing this call to fail. The caller must split up such requests into "
12927 "smaller groups of names."
12932 #: ../src/guestfs-actions.pod:3648
12934 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
12935 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
12940 #: ../src/guestfs-actions.pod:3654
12941 msgid "guestfs_luks_add_key"
12946 #: ../src/guestfs-actions.pod:3656
12950 " guestfs_luks_add_key (guestfs_h *g,\n"
12951 " const char *device,\n"
12952 " const char *key,\n"
12953 " const char *newkey,\n"
12960 #: ../src/guestfs-actions.pod:3663 ../fish/guestfish-actions.pod:2516
12962 "This command adds a new key on LUKS device C<device>. C<key> is any "
12963 "existing key, and is used to access the device. C<newkey> is the new key to "
12964 "add. C<keyslot> is the key slot that will be replaced."
12969 #: ../src/guestfs-actions.pod:3668
12971 "Note that if C<keyslot> already contains a key, then this command will "
12972 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
12977 #: ../src/guestfs-actions.pod:3674 ../src/guestfs-actions.pod:3714
12978 #: ../src/guestfs-actions.pod:3737 ../src/guestfs-actions.pod:3757
12979 #: ../src/guestfs-actions.pod:3789 ../src/guestfs-actions.pod:3808
12981 "This function takes a key or passphrase parameter which could contain "
12982 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
12988 #: ../src/guestfs-actions.pod:3678 ../src/guestfs-actions.pod:3718
12989 #: ../src/guestfs-actions.pod:3741 ../src/guestfs-actions.pod:3761
12990 msgid "(Added in 1.5.2)"
12995 #: ../src/guestfs-actions.pod:3680
12996 msgid "guestfs_luks_close"
13001 #: ../src/guestfs-actions.pod:3682
13005 " guestfs_luks_close (guestfs_h *g,\n"
13006 " const char *device);\n"
13012 #: ../src/guestfs-actions.pod:3686
13014 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
13015 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
13016 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
13017 "underlying block device."
13022 #: ../src/guestfs-actions.pod:3694 ../src/guestfs-actions.pod:3793
13023 #: ../src/guestfs-actions.pod:3812 ../src/guestfs-actions.pod:3862
13024 #: ../src/guestfs-actions.pod:3910
13025 msgid "(Added in 1.5.1)"
13030 #: ../src/guestfs-actions.pod:3696
13031 msgid "guestfs_luks_format"
13036 #: ../src/guestfs-actions.pod:3698
13040 " guestfs_luks_format (guestfs_h *g,\n"
13041 " const char *device,\n"
13042 " const char *key,\n"
13049 #: ../src/guestfs-actions.pod:3704 ../fish/guestfish-actions.pod:2542
13051 "This command erases existing data on C<device> and formats the device as a "
13052 "LUKS encrypted device. C<key> is the initial key, which is added to key "
13053 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
13058 #: ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3734
13059 #: ../src/guestfs-actions.pod:3874 ../src/guestfs-actions.pod:4816
13060 #: ../src/guestfs-actions.pod:5596 ../src/guestfs-actions.pod:5971
13061 #: ../src/guestfs-actions.pod:5994 ../src/guestfs-actions.pod:6020
13062 #: ../src/guestfs-actions.pod:7180 ../fish/guestfish-actions.pod:2550
13063 #: ../fish/guestfish-actions.pod:2563 ../fish/guestfish-actions.pod:2647
13064 #: ../fish/guestfish-actions.pod:3221 ../fish/guestfish-actions.pod:3741
13065 #: ../fish/guestfish-actions.pod:4021 ../fish/guestfish-actions.pod:4037
13066 #: ../fish/guestfish-actions.pod:4052 ../fish/guestfish-actions.pod:4767
13068 "B<This command is dangerous. Without careful use you can easily destroy all "
13074 #: ../src/guestfs-actions.pod:3720
13075 msgid "guestfs_luks_format_cipher"
13080 #: ../src/guestfs-actions.pod:3722
13084 " guestfs_luks_format_cipher (guestfs_h *g,\n"
13085 " const char *device,\n"
13086 " const char *key,\n"
13088 " const char *cipher);\n"
13094 #: ../src/guestfs-actions.pod:3729
13096 "This command is the same as C<guestfs_luks_format> but it also allows you to "
13097 "set the C<cipher> used."
13102 #: ../src/guestfs-actions.pod:3743
13103 msgid "guestfs_luks_kill_slot"
13108 #: ../src/guestfs-actions.pod:3745
13112 " guestfs_luks_kill_slot (guestfs_h *g,\n"
13113 " const char *device,\n"
13114 " const char *key,\n"
13121 #: ../src/guestfs-actions.pod:3751 ../fish/guestfish-actions.pod:2570
13123 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
13124 "device C<device>. C<key> must be one of the I<other> keys."
13129 #: ../src/guestfs-actions.pod:3763
13130 msgid "guestfs_luks_open"
13135 #: ../src/guestfs-actions.pod:3765
13139 " guestfs_luks_open (guestfs_h *g,\n"
13140 " const char *device,\n"
13141 " const char *key,\n"
13142 " const char *mapname);\n"
13148 #: ../src/guestfs-actions.pod:3771 ../fish/guestfish-actions.pod:2581
13150 "This command opens a block device which has been encrypted according to the "
13151 "Linux Unified Key Setup (LUKS) standard."
13156 #: ../src/guestfs-actions.pod:3774 ../fish/guestfish-actions.pod:2584
13157 msgid "C<device> is the encrypted block device or partition."
13162 #: ../src/guestfs-actions.pod:3776 ../fish/guestfish-actions.pod:2586
13164 "The caller must supply one of the keys associated with the LUKS block "
13165 "device, in the C<key> parameter."
13170 #: ../src/guestfs-actions.pod:3779 ../fish/guestfish-actions.pod:2589
13172 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
13173 "writes to this block device are decrypted from and encrypted to the "
13174 "underlying C<device> respectively."
13179 #: ../src/guestfs-actions.pod:3783
13181 "If this block device contains LVM volume groups, then calling "
13182 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
13188 #: ../src/guestfs-actions.pod:3795
13189 msgid "guestfs_luks_open_ro"
13194 #: ../src/guestfs-actions.pod:3797
13198 " guestfs_luks_open_ro (guestfs_h *g,\n"
13199 " const char *device,\n"
13200 " const char *key,\n"
13201 " const char *mapname);\n"
13207 #: ../src/guestfs-actions.pod:3803
13209 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
13215 #: ../src/guestfs-actions.pod:3814
13216 msgid "guestfs_lvcreate"
13221 #: ../src/guestfs-actions.pod:3816
13225 " guestfs_lvcreate (guestfs_h *g,\n"
13226 " const char *logvol,\n"
13227 " const char *volgroup,\n"
13234 #: ../src/guestfs-actions.pod:3822 ../fish/guestfish-actions.pod:2614
13236 "This creates an LVM logical volume called C<logvol> on the volume group "
13237 "C<volgroup>, with C<size> megabytes."
13242 #: ../src/guestfs-actions.pod:3829
13243 msgid "guestfs_lvm_canonical_lv_name"
13248 #: ../src/guestfs-actions.pod:3831
13252 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
13253 " const char *lvname);\n"
13259 #: ../src/guestfs-actions.pod:3835 ../fish/guestfish-actions.pod:2621
13261 "This converts alternative naming schemes for LVs that you might find to the "
13262 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
13268 #: ../src/guestfs-actions.pod:3839 ../fish/guestfish-actions.pod:2625
13270 "This command returns an error if the C<lvname> parameter does not refer to a "
13276 #: ../src/guestfs-actions.pod:3842
13277 msgid "See also C<guestfs_is_lv>."
13282 #: ../src/guestfs-actions.pod:3847
13283 msgid "(Added in 1.5.24)"
13288 #: ../src/guestfs-actions.pod:3849
13289 msgid "guestfs_lvm_clear_filter"
13294 #: ../src/guestfs-actions.pod:3851
13298 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
13304 #: ../src/guestfs-actions.pod:3854
13306 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
13307 "see every block device."
13312 #: ../src/guestfs-actions.pod:3857 ../src/guestfs-actions.pod:3899
13313 #: ../fish/guestfish-actions.pod:2637 ../fish/guestfish-actions.pod:2668
13315 "This command also clears the LVM cache and performs a volume group scan."
13320 #: ../src/guestfs-actions.pod:3864
13321 msgid "guestfs_lvm_remove_all"
13326 #: ../src/guestfs-actions.pod:3866
13330 " guestfs_lvm_remove_all (guestfs_h *g);\n"
13336 #: ../src/guestfs-actions.pod:3869 ../fish/guestfish-actions.pod:2644
13338 "This command removes all LVM logical volumes, volume groups and physical "
13344 #: ../src/guestfs-actions.pod:3879
13345 msgid "guestfs_lvm_set_filter"
13350 #: ../src/guestfs-actions.pod:3881
13354 " guestfs_lvm_set_filter (guestfs_h *g,\n"
13355 " char *const *devices);\n"
13361 #: ../src/guestfs-actions.pod:3885 ../fish/guestfish-actions.pod:2654
13363 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
13364 "block devices in the list C<devices>, and will ignore all other attached "
13370 #: ../src/guestfs-actions.pod:3889 ../fish/guestfish-actions.pod:2658
13372 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
13373 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
13374 "there are two types of duplication possible: either cloned PVs/VGs which "
13375 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
13376 "same name. In normal operation you cannot create this situation, but you "
13377 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
13378 "inside the LVM metadata."
13383 #: ../src/guestfs-actions.pod:3902 ../fish/guestfish-actions.pod:2671
13384 msgid "You can filter whole block devices or individual partitions."
13389 #: ../src/guestfs-actions.pod:3904 ../fish/guestfish-actions.pod:2673
13391 "You cannot use this if any VG is currently in use (eg. contains a mounted "
13392 "filesystem), even if you are not filtering out that VG."
13397 #: ../src/guestfs-actions.pod:3912
13398 msgid "guestfs_lvremove"
13403 #: ../src/guestfs-actions.pod:3914
13407 " guestfs_lvremove (guestfs_h *g,\n"
13408 " const char *device);\n"
13414 #: ../src/guestfs-actions.pod:3918 ../fish/guestfish-actions.pod:2681
13416 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
13417 "LV, such as C</dev/VG/LV>."
13422 #: ../src/guestfs-actions.pod:3921 ../fish/guestfish-actions.pod:2684
13424 "You can also remove all LVs in a volume group by specifying the VG name, C</"
13430 #: ../src/guestfs-actions.pod:3926 ../src/guestfs-actions.pod:5162
13431 #: ../src/guestfs-actions.pod:6919
13432 msgid "(Added in 1.0.13)"
13437 #: ../src/guestfs-actions.pod:3928
13438 msgid "guestfs_lvrename"
13443 #: ../src/guestfs-actions.pod:3930
13447 " guestfs_lvrename (guestfs_h *g,\n"
13448 " const char *logvol,\n"
13449 " const char *newlogvol);\n"
13455 #: ../src/guestfs-actions.pod:3935 ../fish/guestfish-actions.pod:2691
13456 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
13461 #: ../src/guestfs-actions.pod:3939 ../src/guestfs-actions.pod:6932
13462 msgid "(Added in 1.0.83)"
13467 #: ../src/guestfs-actions.pod:3941
13468 msgid "guestfs_lvresize"
13473 #: ../src/guestfs-actions.pod:3943
13477 " guestfs_lvresize (guestfs_h *g,\n"
13478 " const char *device,\n"
13485 #: ../src/guestfs-actions.pod:3948 ../fish/guestfish-actions.pod:2697
13487 "This resizes (expands or shrinks) an existing LVM logical volume to "
13488 "C<mbytes>. When reducing, data in the reduced part is lost."
13493 #: ../src/guestfs-actions.pod:3956
13494 msgid "guestfs_lvresize_free"
13499 #: ../src/guestfs-actions.pod:3958
13503 " guestfs_lvresize_free (guestfs_h *g,\n"
13504 " const char *lv,\n"
13511 #: ../src/guestfs-actions.pod:3963 ../fish/guestfish-actions.pod:2705
13513 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
13514 "remaining free space in the volume group. Commonly you would call this with "
13515 "pc = 100 which expands the logical volume as much as possible, using all "
13516 "remaining free space in the volume group."
13521 #: ../src/guestfs-actions.pod:3971
13522 msgid "(Added in 1.3.3)"
13527 #: ../src/guestfs-actions.pod:3973
13528 msgid "guestfs_lvs"
13533 #: ../src/guestfs-actions.pod:3975
13537 " guestfs_lvs (guestfs_h *g);\n"
13543 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:2715
13545 "List all the logical volumes detected. This is the equivalent of the L<lvs"
13551 #: ../src/guestfs-actions.pod:3981 ../fish/guestfish-actions.pod:2718
13553 "This returns a list of the logical volume device names (eg. C</dev/"
13554 "VolGroup00/LogVol00>)."
13559 #: ../src/guestfs-actions.pod:3984
13560 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
13565 #: ../src/guestfs-actions.pod:3992
13566 msgid "guestfs_lvs_full"
13571 #: ../src/guestfs-actions.pod:3994
13574 " struct guestfs_lvm_lv_list *\n"
13575 " guestfs_lvs_full (guestfs_h *g);\n"
13581 #: ../src/guestfs-actions.pod:3997 ../fish/guestfish-actions.pod:2727
13583 "List all the logical volumes detected. This is the equivalent of the L<lvs"
13584 "(8)> command. The \"full\" version includes all fields."
13589 #: ../src/guestfs-actions.pod:4000
13591 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
13592 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
13597 #: ../src/guestfs-actions.pod:4006
13598 msgid "guestfs_lvuuid"
13603 #: ../src/guestfs-actions.pod:4008
13607 " guestfs_lvuuid (guestfs_h *g,\n"
13608 " const char *device);\n"
13614 #: ../src/guestfs-actions.pod:4012 ../fish/guestfish-actions.pod:2734
13615 msgid "This command returns the UUID of the LVM LV C<device>."
13620 #: ../src/guestfs-actions.pod:4019
13621 msgid "guestfs_lxattrlist"
13626 #: ../src/guestfs-actions.pod:4021
13629 " struct guestfs_xattr_list *\n"
13630 " guestfs_lxattrlist (guestfs_h *g,\n"
13631 " const char *path,\n"
13632 " char *const *names);\n"
13638 #: ../src/guestfs-actions.pod:4026 ../fish/guestfish-actions.pod:2740
13640 "This call allows you to get the extended attributes of multiple files, where "
13641 "all files are in the directory C<path>. C<names> is the list of files from "
13647 #: ../src/guestfs-actions.pod:4030 ../fish/guestfish-actions.pod:2744
13649 "On return you get a flat list of xattr structs which must be interpreted "
13650 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
13651 "C<attrval> in this struct is zero-length to indicate there was an error "
13652 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
13653 "number (the number of following attributes for this file, which could be C<"
13654 "\"0\">). Then after the first xattr struct are the zero or more attributes "
13655 "for the first named file. This repeats for the second and subsequent files."
13660 #: ../src/guestfs-actions.pod:4040
13662 "This call is intended for programs that want to efficiently list a directory "
13663 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
13664 "a similarly efficient call for getting standard stats. Very long directory "
13665 "listings might cause the protocol message size to be exceeded, causing this "
13666 "call to fail. The caller must split up such requests into smaller groups of "
13672 #: ../src/guestfs-actions.pod:4054
13673 msgid "guestfs_mkdir"
13678 #: ../src/guestfs-actions.pod:4056
13682 " guestfs_mkdir (guestfs_h *g,\n"
13683 " const char *path);\n"
13689 #: ../src/guestfs-actions.pod:4060 ../fish/guestfish-actions.pod:2766
13690 msgid "Create a directory named C<path>."
13695 #: ../src/guestfs-actions.pod:4066
13696 msgid "guestfs_mkdir_mode"
13701 #: ../src/guestfs-actions.pod:4068
13705 " guestfs_mkdir_mode (guestfs_h *g,\n"
13706 " const char *path,\n"
13713 #: ../src/guestfs-actions.pod:4073 ../fish/guestfish-actions.pod:2772
13715 "This command creates a directory, setting the initial permissions of the "
13716 "directory to C<mode>."
13721 #: ../src/guestfs-actions.pod:4076 ../fish/guestfish-actions.pod:2775
13723 "For common Linux filesystems, the actual mode which is set will be C<mode & "
13724 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
13730 #: ../src/guestfs-actions.pod:4080
13731 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
13736 #: ../src/guestfs-actions.pod:4086
13737 msgid "guestfs_mkdir_p"
13742 #: ../src/guestfs-actions.pod:4088
13746 " guestfs_mkdir_p (guestfs_h *g,\n"
13747 " const char *path);\n"
13753 #: ../src/guestfs-actions.pod:4092 ../fish/guestfish-actions.pod:2785
13755 "Create a directory named C<path>, creating any parent directories as "
13756 "necessary. This is like the C<mkdir -p> shell command."
13761 #: ../src/guestfs-actions.pod:4099
13762 msgid "guestfs_mkdtemp"
13767 #: ../src/guestfs-actions.pod:4101
13771 " guestfs_mkdtemp (guestfs_h *g,\n"
13772 " const char *template);\n"
13778 #: ../src/guestfs-actions.pod:4105 ../fish/guestfish-actions.pod:2792
13780 "This command creates a temporary directory. The C<template> parameter "
13781 "should be a full pathname for the temporary directory name with the final "
13782 "six characters being \"XXXXXX\"."
13787 #: ../src/guestfs-actions.pod:4110 ../fish/guestfish-actions.pod:2797
13789 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
13790 "being suitable for Windows filesystems."
13795 #: ../src/guestfs-actions.pod:4113 ../fish/guestfish-actions.pod:2800
13796 msgid "The name of the temporary directory that was created is returned."
13801 #: ../src/guestfs-actions.pod:4116 ../fish/guestfish-actions.pod:2803
13802 msgid "The temporary directory is created with mode 0700 and is owned by root."
13807 #: ../src/guestfs-actions.pod:4119 ../fish/guestfish-actions.pod:2806
13809 "The caller is responsible for deleting the temporary directory and its "
13810 "contents after use."
13815 #: ../src/guestfs-actions.pod:4122 ../fish/guestfish-actions.pod:2809
13816 msgid "See also: L<mkdtemp(3)>"
13821 #: ../src/guestfs-actions.pod:4129
13822 msgid "guestfs_mke2fs_J"
13827 #: ../src/guestfs-actions.pod:4131
13831 " guestfs_mke2fs_J (guestfs_h *g,\n"
13832 " const char *fstype,\n"
13833 " int blocksize,\n"
13834 " const char *device,\n"
13835 " const char *journal);\n"
13841 #: ../src/guestfs-actions.pod:4138 ../fish/guestfish-actions.pod:2815
13843 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13844 "C<journal>. It is equivalent to the command:"
13849 #: ../src/guestfs-actions.pod:4142 ../fish/guestfish-actions.pod:2819
13852 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
13858 #: ../src/guestfs-actions.pod:4144
13859 msgid "See also C<guestfs_mke2journal>."
13864 #: ../src/guestfs-actions.pod:4148 ../src/guestfs-actions.pod:4166
13865 #: ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4200
13866 #: ../src/guestfs-actions.pod:4214 ../src/guestfs-actions.pod:4228
13867 #: ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4552
13868 msgid "(Added in 1.0.68)"
13873 #: ../src/guestfs-actions.pod:4150
13874 msgid "guestfs_mke2fs_JL"
13879 #: ../src/guestfs-actions.pod:4152
13883 " guestfs_mke2fs_JL (guestfs_h *g,\n"
13884 " const char *fstype,\n"
13885 " int blocksize,\n"
13886 " const char *device,\n"
13887 " const char *label);\n"
13893 #: ../src/guestfs-actions.pod:4159 ../fish/guestfish-actions.pod:2827
13895 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13896 "the journal labeled C<label>."
13901 #: ../src/guestfs-actions.pod:4162
13902 msgid "See also C<guestfs_mke2journal_L>."
13907 #: ../src/guestfs-actions.pod:4168
13908 msgid "guestfs_mke2fs_JU"
13913 #: ../src/guestfs-actions.pod:4170
13917 " guestfs_mke2fs_JU (guestfs_h *g,\n"
13918 " const char *fstype,\n"
13919 " int blocksize,\n"
13920 " const char *device,\n"
13921 " const char *uuid);\n"
13927 #: ../src/guestfs-actions.pod:4177 ../fish/guestfish-actions.pod:2836
13929 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13930 "the journal with UUID C<uuid>."
13935 #: ../src/guestfs-actions.pod:4180
13936 msgid "See also C<guestfs_mke2journal_U>."
13941 #: ../src/guestfs-actions.pod:4186
13942 msgid "guestfs_mke2journal"
13947 #: ../src/guestfs-actions.pod:4188
13951 " guestfs_mke2journal (guestfs_h *g,\n"
13952 " int blocksize,\n"
13953 " const char *device);\n"
13959 #: ../src/guestfs-actions.pod:4193 ../fish/guestfish-actions.pod:2845
13961 "This creates an ext2 external journal on C<device>. It is equivalent to the "
13967 #: ../src/guestfs-actions.pod:4196 ../fish/guestfish-actions.pod:2848
13970 " mke2fs -O journal_dev -b blocksize device\n"
13976 #: ../src/guestfs-actions.pod:4202
13977 msgid "guestfs_mke2journal_L"
13982 #: ../src/guestfs-actions.pod:4204
13986 " guestfs_mke2journal_L (guestfs_h *g,\n"
13987 " int blocksize,\n"
13988 " const char *label,\n"
13989 " const char *device);\n"
13995 #: ../src/guestfs-actions.pod:4210 ../fish/guestfish-actions.pod:2854
13996 msgid "This creates an ext2 external journal on C<device> with label C<label>."
14001 #: ../src/guestfs-actions.pod:4216
14002 msgid "guestfs_mke2journal_U"
14007 #: ../src/guestfs-actions.pod:4218
14011 " guestfs_mke2journal_U (guestfs_h *g,\n"
14012 " int blocksize,\n"
14013 " const char *uuid,\n"
14014 " const char *device);\n"
14020 #: ../src/guestfs-actions.pod:4224 ../fish/guestfish-actions.pod:2860
14021 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
14026 #: ../src/guestfs-actions.pod:4230
14027 msgid "guestfs_mkfifo"
14032 #: ../src/guestfs-actions.pod:4232
14036 " guestfs_mkfifo (guestfs_h *g,\n"
14038 " const char *path);\n"
14044 #: ../src/guestfs-actions.pod:4237
14046 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
14047 "is just a convenient wrapper around C<guestfs_mknod>."
14052 #: ../src/guestfs-actions.pod:4247
14053 msgid "guestfs_mkfs"
14058 #: ../src/guestfs-actions.pod:4249
14062 " guestfs_mkfs (guestfs_h *g,\n"
14063 " const char *fstype,\n"
14064 " const char *device);\n"
14070 #: ../src/guestfs-actions.pod:4254 ../fish/guestfish-actions.pod:2876
14072 "This creates a filesystem on C<device> (usually a partition or LVM logical "
14073 "volume). The filesystem type is C<fstype>, for example C<ext3>."
14078 #: ../src/guestfs-actions.pod:4262
14079 msgid "guestfs_mkfs_b"
14084 #: ../src/guestfs-actions.pod:4264
14088 " guestfs_mkfs_b (guestfs_h *g,\n"
14089 " const char *fstype,\n"
14090 " int blocksize,\n"
14091 " const char *device);\n"
14097 #: ../src/guestfs-actions.pod:4270
14099 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
14100 "block size of the resulting filesystem. Supported block sizes depend on the "
14101 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
14106 #: ../src/guestfs-actions.pod:4275 ../src/guestfs-actions.pod:4318
14107 #: ../fish/guestfish-actions.pod:2889 ../fish/guestfish-actions.pod:2916
14109 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
14115 #: ../src/guestfs-actions.pod:4280 ../fish/guestfish-actions.pod:2892
14117 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
14122 #: ../src/guestfs-actions.pod:4289
14123 msgid "guestfs_mkfs_opts"
14128 #: ../src/guestfs-actions.pod:4291
14132 " guestfs_mkfs_opts (guestfs_h *g,\n"
14133 " const char *fstype,\n"
14134 " const char *device,\n"
14140 #: ../src/guestfs-actions.pod:4302
14143 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
14144 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
14150 #: ../src/guestfs-actions.pod:4305 ../fish/guestfish-actions.pod:2903
14152 "This function creates a filesystem on C<device>. The filesystem type is "
14153 "C<fstype>, for example C<ext3>."
14158 #: ../src/guestfs-actions.pod:4312 ../fish/guestfish-actions.pod:2910
14159 msgid "C<blocksize>"
14164 #: ../src/guestfs-actions.pod:4314 ../fish/guestfish-actions.pod:2912
14166 "The filesystem block size. Supported block sizes depend on the filesystem "
14167 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
14172 #: ../src/guestfs-actions.pod:4321 ../fish/guestfish-actions.pod:2919
14173 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
14177 #: ../src/guestfs-actions.pod:4323 ../fish/guestfish-actions.pod:2921
14178 msgid "C<features>"
14182 #: ../src/guestfs-actions.pod:4325 ../fish/guestfish-actions.pod:2923
14183 msgid "This passes the C<-O> parameter to the external mkfs program."
14187 #: ../src/guestfs-actions.pod:4327 ../fish/guestfish-actions.pod:2925
14189 "For certain filesystem types, this allows extra filesystem features to be "
14190 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
14194 #: ../src/guestfs-actions.pod:4331 ../fish/guestfish-actions.pod:2929
14196 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
14201 #: ../src/guestfs-actions.pod:4338
14202 msgid "(Added in 1.7.19)"
14207 #: ../src/guestfs-actions.pod:4340
14208 msgid "guestfs_mkfs_opts_va"
14213 #: ../src/guestfs-actions.pod:4342
14217 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
14218 " const char *fstype,\n"
14219 " const char *device,\n"
14220 " va_list args);\n"
14226 #: ../src/guestfs-actions.pod:4348
14227 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
14232 #: ../src/guestfs-actions.pod:4352
14233 msgid "guestfs_mkfs_opts_argv"
14238 #: ../src/guestfs-actions.pod:4354
14242 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
14243 " const char *fstype,\n"
14244 " const char *device,\n"
14245 " const struct guestfs_mkfs_opts_argv *optargs);\n"
14251 #: ../src/guestfs-actions.pod:4360
14252 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
14257 #: ../src/guestfs-actions.pod:4364
14258 msgid "guestfs_mkmountpoint"
14263 #: ../src/guestfs-actions.pod:4366
14267 " guestfs_mkmountpoint (guestfs_h *g,\n"
14268 " const char *exemptpath);\n"
14274 #: ../src/guestfs-actions.pod:4370
14276 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
14277 "that can be used to create extra mountpoints before mounting the first "
14283 #: ../src/guestfs-actions.pod:4374 ../fish/guestfish-actions.pod:2944
14285 "These calls are I<only> necessary in some very limited circumstances, mainly "
14286 "the case where you want to mount a mix of unrelated and/or read-only "
14287 "filesystems together."
14292 #: ../src/guestfs-actions.pod:4378 ../fish/guestfish-actions.pod:2948
14294 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
14295 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
14296 "inside that. You can unpack this as follows in guestfish:"
14301 #: ../src/guestfs-actions.pod:4383 ../fish/guestfish-actions.pod:2953
14304 " add-ro Fedora-11-i686-Live.iso\n"
14306 " mkmountpoint /cd\n"
14307 " mkmountpoint /sqsh\n"
14308 " mkmountpoint /ext3fs\n"
14309 " mount /dev/sda /cd\n"
14310 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
14311 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
14317 #: ../src/guestfs-actions.pod:4392 ../fish/guestfish-actions.pod:2962
14318 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
14323 #: ../src/guestfs-actions.pod:4394
14325 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
14326 "may get unexpected errors if you try to mix these calls. It is safest to "
14327 "manually unmount filesystems and remove mountpoints after use."
14332 #: ../src/guestfs-actions.pod:4398
14334 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
14335 "first, so for this to work for manual mountpoints, you must ensure that the "
14336 "innermost mountpoints have the longest pathnames, as in the example code "
14342 #: ../src/guestfs-actions.pod:4403 ../fish/guestfish-actions.pod:2973
14344 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
14348 #: ../src/guestfs-actions.pod:4405
14350 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
14351 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
14352 "can also trigger these issues."
14357 #: ../src/guestfs-actions.pod:4411 ../src/guestfs-actions.pod:4670
14358 #: ../src/guestfs-actions.pod:5580
14359 msgid "(Added in 1.0.62)"
14364 #: ../src/guestfs-actions.pod:4413
14365 msgid "guestfs_mknod"
14370 #: ../src/guestfs-actions.pod:4415
14374 " guestfs_mknod (guestfs_h *g,\n"
14378 " const char *path);\n"
14384 #: ../src/guestfs-actions.pod:4422 ../fish/guestfish-actions.pod:2983
14386 "This call creates block or character special devices, or named pipes (FIFOs)."
14391 #: ../src/guestfs-actions.pod:4425 ../fish/guestfish-actions.pod:2986
14393 "The C<mode> parameter should be the mode, using the standard constants. "
14394 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
14395 "used when creating block and character special devices."
14400 #: ../src/guestfs-actions.pod:4430
14402 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
14403 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
14404 "regular file). These constants are available in the standard Linux header "
14405 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
14406 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
14407 "the appropriate constant for you."
14412 #: ../src/guestfs-actions.pod:4444
14413 msgid "guestfs_mknod_b"
14418 #: ../src/guestfs-actions.pod:4446
14422 " guestfs_mknod_b (guestfs_h *g,\n"
14426 " const char *path);\n"
14432 #: ../src/guestfs-actions.pod:4453
14434 "This call creates a block device node called C<path> with mode C<mode> and "
14435 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
14436 "wrapper around C<guestfs_mknod>."
14441 #: ../src/guestfs-actions.pod:4463
14442 msgid "guestfs_mknod_c"
14447 #: ../src/guestfs-actions.pod:4465
14451 " guestfs_mknod_c (guestfs_h *g,\n"
14455 " const char *path);\n"
14461 #: ../src/guestfs-actions.pod:4472
14463 "This call creates a char device node called C<path> with mode C<mode> and "
14464 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
14465 "wrapper around C<guestfs_mknod>."
14470 #: ../src/guestfs-actions.pod:4482
14471 msgid "guestfs_mkswap"
14476 #: ../src/guestfs-actions.pod:4484
14480 " guestfs_mkswap (guestfs_h *g,\n"
14481 " const char *device);\n"
14487 #: ../src/guestfs-actions.pod:4488 ../fish/guestfish-actions.pod:3025
14488 msgid "Create a swap partition on C<device>."
14493 #: ../src/guestfs-actions.pod:4494
14494 msgid "guestfs_mkswap_L"
14499 #: ../src/guestfs-actions.pod:4496
14503 " guestfs_mkswap_L (guestfs_h *g,\n"
14504 " const char *label,\n"
14505 " const char *device);\n"
14511 #: ../src/guestfs-actions.pod:4501 ../fish/guestfish-actions.pod:3031
14512 msgid "Create a swap partition on C<device> with label C<label>."
14517 #: ../src/guestfs-actions.pod:4503 ../fish/guestfish-actions.pod:3033
14519 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
14520 "sda>), just to a partition. This appears to be a limitation of the kernel "
14526 #: ../src/guestfs-actions.pod:4511
14527 msgid "guestfs_mkswap_U"
14532 #: ../src/guestfs-actions.pod:4513
14536 " guestfs_mkswap_U (guestfs_h *g,\n"
14537 " const char *uuid,\n"
14538 " const char *device);\n"
14544 #: ../src/guestfs-actions.pod:4518 ../fish/guestfish-actions.pod:3041
14545 msgid "Create a swap partition on C<device> with UUID C<uuid>."
14550 #: ../src/guestfs-actions.pod:4524
14551 msgid "guestfs_mkswap_file"
14556 #: ../src/guestfs-actions.pod:4526
14560 " guestfs_mkswap_file (guestfs_h *g,\n"
14561 " const char *path);\n"
14567 #: ../src/guestfs-actions.pod:4530 ../fish/guestfish-actions.pod:3047
14568 msgid "Create a swap file."
14573 #: ../src/guestfs-actions.pod:4532
14575 "This command just writes a swap file signature to an existing file. To "
14576 "create the file itself, use something like C<guestfs_fallocate>."
14581 #: ../src/guestfs-actions.pod:4539
14582 msgid "guestfs_modprobe"
14587 #: ../src/guestfs-actions.pod:4541
14591 " guestfs_modprobe (guestfs_h *g,\n"
14592 " const char *modulename);\n"
14598 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3056
14599 msgid "This loads a kernel module in the appliance."
14604 #: ../src/guestfs-actions.pod:4547 ../fish/guestfish-actions.pod:3058
14606 "The kernel module must have been whitelisted when libguestfs was built (see "
14607 "C<appliance/kmod.whitelist.in> in the source)."
14612 #: ../src/guestfs-actions.pod:4554
14613 msgid "guestfs_mount"
14618 #: ../src/guestfs-actions.pod:4556
14622 " guestfs_mount (guestfs_h *g,\n"
14623 " const char *device,\n"
14624 " const char *mountpoint);\n"
14630 #: ../src/guestfs-actions.pod:4561 ../fish/guestfish-actions.pod:3065
14632 "Mount a guest disk at a position in the filesystem. Block devices are named "
14633 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
14634 "those block devices contain partitions, they will have the usual names (eg. "
14635 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
14640 #: ../src/guestfs-actions.pod:4567 ../fish/guestfish-actions.pod:3071
14642 "The rules are the same as for L<mount(2)>: A filesystem must first be "
14643 "mounted on C</> before others can be mounted. Other filesystems can only be "
14644 "mounted on directories which already exist."
14649 #: ../src/guestfs-actions.pod:4572 ../fish/guestfish-actions.pod:3076
14651 "The mounted filesystem is writable, if we have sufficient permissions on the "
14652 "underlying device."
14657 #: ../src/guestfs-actions.pod:4575
14659 "B<Important note:> When you use this call, the filesystem options C<sync> "
14660 "and C<noatime> are set implicitly. This was originally done because we "
14661 "thought it would improve reliability, but it turns out that I<-o sync> has a "
14662 "very large negative performance impact and negligible effect on "
14663 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
14664 "in any code that needs performance, and instead use C<guestfs_mount_options> "
14665 "(use an empty string for the first parameter if you don't want any options)."
14670 #: ../src/guestfs-actions.pod:4589
14671 msgid "guestfs_mount_loop"
14676 #: ../src/guestfs-actions.pod:4591
14680 " guestfs_mount_loop (guestfs_h *g,\n"
14681 " const char *file,\n"
14682 " const char *mountpoint);\n"
14688 #: ../src/guestfs-actions.pod:4596 ../fish/guestfish-actions.pod:3093
14690 "This command lets you mount C<file> (a filesystem image in a file) on a "
14691 "mount point. It is entirely equivalent to the command C<mount -o loop file "
14697 #: ../src/guestfs-actions.pod:4604
14698 msgid "guestfs_mount_options"
14703 #: ../src/guestfs-actions.pod:4606
14707 " guestfs_mount_options (guestfs_h *g,\n"
14708 " const char *options,\n"
14709 " const char *device,\n"
14710 " const char *mountpoint);\n"
14716 #: ../src/guestfs-actions.pod:4612
14718 "This is the same as the C<guestfs_mount> command, but it allows you to set "
14719 "the mount options as for the L<mount(8)> I<-o> flag."
14724 #: ../src/guestfs-actions.pod:4616 ../fish/guestfish-actions.pod:3105
14726 "If the C<options> parameter is an empty string, then no options are passed "
14727 "(all options default to whatever the filesystem uses)."
14732 #: ../src/guestfs-actions.pod:4622 ../src/guestfs-actions.pod:4636
14733 #: ../src/guestfs-actions.pod:4653
14734 msgid "(Added in 1.0.10)"
14739 #: ../src/guestfs-actions.pod:4624
14740 msgid "guestfs_mount_ro"
14745 #: ../src/guestfs-actions.pod:4626
14749 " guestfs_mount_ro (guestfs_h *g,\n"
14750 " const char *device,\n"
14751 " const char *mountpoint);\n"
14757 #: ../src/guestfs-actions.pod:4631
14759 "This is the same as the C<guestfs_mount> command, but it mounts the "
14760 "filesystem with the read-only (I<-o ro>) flag."
14765 #: ../src/guestfs-actions.pod:4638
14766 msgid "guestfs_mount_vfs"
14771 #: ../src/guestfs-actions.pod:4640
14775 " guestfs_mount_vfs (guestfs_h *g,\n"
14776 " const char *options,\n"
14777 " const char *vfstype,\n"
14778 " const char *device,\n"
14779 " const char *mountpoint);\n"
14785 #: ../src/guestfs-actions.pod:4647
14787 "This is the same as the C<guestfs_mount> command, but it allows you to set "
14788 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
14794 #: ../src/guestfs-actions.pod:4655
14795 msgid "guestfs_mountpoints"
14800 #: ../src/guestfs-actions.pod:4657
14804 " guestfs_mountpoints (guestfs_h *g);\n"
14810 #: ../src/guestfs-actions.pod:4660
14812 "This call is similar to C<guestfs_mounts>. That call returns a list of "
14813 "devices. This one returns a hash table (map) of device name to directory "
14814 "where the device is mounted."
14819 #: ../src/guestfs-actions.pod:4672
14820 msgid "guestfs_mounts"
14825 #: ../src/guestfs-actions.pod:4674
14829 " guestfs_mounts (guestfs_h *g);\n"
14835 #: ../src/guestfs-actions.pod:4677 ../fish/guestfish-actions.pod:3136
14837 "This returns the list of currently mounted filesystems. It returns the list "
14838 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
14843 #: ../src/guestfs-actions.pod:4680 ../fish/guestfish-actions.pod:3139
14844 msgid "Some internal mounts are not shown."
14849 #: ../src/guestfs-actions.pod:4682
14850 msgid "See also: C<guestfs_mountpoints>"
14855 #: ../src/guestfs-actions.pod:4690
14861 #: ../src/guestfs-actions.pod:4692
14865 " guestfs_mv (guestfs_h *g,\n"
14866 " const char *src,\n"
14867 " const char *dest);\n"
14873 #: ../src/guestfs-actions.pod:4697 ../fish/guestfish-actions.pod:3147
14875 "This moves a file from C<src> to C<dest> where C<dest> is either a "
14876 "destination filename or destination directory."
14881 #: ../src/guestfs-actions.pod:4704
14882 msgid "guestfs_ntfs_3g_probe"
14887 #: ../src/guestfs-actions.pod:4706
14891 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
14893 " const char *device);\n"
14899 #: ../src/guestfs-actions.pod:4711 ../fish/guestfish-actions.pod:3154
14901 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
14902 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
14903 "write, and some cannot be mounted at all)."
14908 #: ../src/guestfs-actions.pod:4715 ../fish/guestfish-actions.pod:3158
14910 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
14911 "can be mounted read-write. Set it to false if you want to test if the "
14912 "volume can be mounted read-only."
14917 #: ../src/guestfs-actions.pod:4719 ../fish/guestfish-actions.pod:3162
14919 "The return value is an integer which C<0> if the operation would succeed, or "
14920 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
14925 #: ../src/guestfs-actions.pod:4725
14926 msgid "(Added in 1.0.43)"
14931 #: ../src/guestfs-actions.pod:4727
14932 msgid "guestfs_ntfsresize"
14937 #: ../src/guestfs-actions.pod:4729
14941 " guestfs_ntfsresize (guestfs_h *g,\n"
14942 " const char *device);\n"
14948 #: ../src/guestfs-actions.pod:4733 ../fish/guestfish-actions.pod:3170
14950 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
14951 "size of the underlying device. See also L<ntfsresize(8)>."
14956 #: ../src/guestfs-actions.pod:4741
14957 msgid "guestfs_ntfsresize_size"
14962 #: ../src/guestfs-actions.pod:4743
14966 " guestfs_ntfsresize_size (guestfs_h *g,\n"
14967 " const char *device,\n"
14968 " int64_t size);\n"
14974 #: ../src/guestfs-actions.pod:4748
14976 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
14977 "to specify the new size (in bytes) explicitly."
14982 #: ../src/guestfs-actions.pod:4753 ../src/guestfs-actions.pod:5189
14983 #: ../src/guestfs-actions.pod:5262 ../src/guestfs-actions.pod:5528
14984 #: ../src/guestfs-actions.pod:7067
14985 msgid "(Added in 1.3.14)"
14990 #: ../src/guestfs-actions.pod:4755
14991 msgid "guestfs_part_add"
14996 #: ../src/guestfs-actions.pod:4757
15000 " guestfs_part_add (guestfs_h *g,\n"
15001 " const char *device,\n"
15002 " const char *prlogex,\n"
15003 " int64_t startsect,\n"
15004 " int64_t endsect);\n"
15010 #: ../src/guestfs-actions.pod:4764
15012 "This command adds a partition to C<device>. If there is no partition table "
15013 "on the device, call C<guestfs_part_init> first."
15018 #: ../src/guestfs-actions.pod:4767 ../fish/guestfish-actions.pod:3188
15020 "The C<prlogex> parameter is the type of partition. Normally you should pass "
15021 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
15022 "C<logical>) and C<e> (or C<extended>) partition types."
15027 #: ../src/guestfs-actions.pod:4772 ../fish/guestfish-actions.pod:3193
15029 "C<startsect> and C<endsect> are the start and end of the partition in "
15030 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
15031 "from the end of the disk (C<-1> is the last sector)."
15036 #: ../src/guestfs-actions.pod:4776
15038 "Creating a partition which covers the whole disk is not so easy. Use "
15039 "C<guestfs_part_disk> to do that."
15044 #: ../src/guestfs-actions.pod:4781 ../src/guestfs-actions.pod:4819
15045 #: ../src/guestfs-actions.pod:4872 ../src/guestfs-actions.pod:4950
15046 #: ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5007
15047 #: ../src/guestfs-actions.pod:5047
15048 msgid "(Added in 1.0.78)"
15053 #: ../src/guestfs-actions.pod:4783
15054 msgid "guestfs_part_del"
15059 #: ../src/guestfs-actions.pod:4785
15063 " guestfs_part_del (guestfs_h *g,\n"
15064 " const char *device,\n"
15071 #: ../src/guestfs-actions.pod:4790 ../fish/guestfish-actions.pod:3204
15072 msgid "This command deletes the partition numbered C<partnum> on C<device>."
15077 #: ../src/guestfs-actions.pod:4792 ../fish/guestfish-actions.pod:3206
15079 "Note that in the case of MBR partitioning, deleting an extended partition "
15080 "also deletes any logical partitions it contains."
15085 #: ../src/guestfs-actions.pod:4800
15086 msgid "guestfs_part_disk"
15091 #: ../src/guestfs-actions.pod:4802
15095 " guestfs_part_disk (guestfs_h *g,\n"
15096 " const char *device,\n"
15097 " const char *parttype);\n"
15103 #: ../src/guestfs-actions.pod:4807
15105 "This command is simply a combination of C<guestfs_part_init> followed by "
15106 "C<guestfs_part_add> to create a single primary partition covering the whole "
15112 #: ../src/guestfs-actions.pod:4811
15114 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
15115 "possible values are described in C<guestfs_part_init>."
15120 #: ../src/guestfs-actions.pod:4821
15121 msgid "guestfs_part_get_bootable"
15126 #: ../src/guestfs-actions.pod:4823
15130 " guestfs_part_get_bootable (guestfs_h *g,\n"
15131 " const char *device,\n"
15138 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3228
15140 "This command returns true if the partition C<partnum> on C<device> has the "
15141 "bootable flag set."
15146 #: ../src/guestfs-actions.pod:4831
15147 msgid "See also C<guestfs_part_set_bootable>."
15152 #: ../src/guestfs-actions.pod:4837
15153 msgid "guestfs_part_get_mbr_id"
15158 #: ../src/guestfs-actions.pod:4839
15162 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
15163 " const char *device,\n"
15170 #: ../src/guestfs-actions.pod:4844 ../fish/guestfish-actions.pod:3237
15172 "Returns the MBR type byte (also known as the ID byte) from the numbered "
15173 "partition C<partnum>."
15178 #: ../src/guestfs-actions.pod:4847 ../src/guestfs-actions.pod:5023
15180 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
15181 "undefined results for other partition table types (see "
15182 "C<guestfs_part_get_parttype>)."
15187 #: ../src/guestfs-actions.pod:4855
15188 msgid "guestfs_part_get_parttype"
15193 #: ../src/guestfs-actions.pod:4857
15197 " guestfs_part_get_parttype (guestfs_h *g,\n"
15198 " const char *device);\n"
15204 #: ../src/guestfs-actions.pod:4861 ../fish/guestfish-actions.pod:3248
15206 "This command examines the partition table on C<device> and returns the "
15207 "partition table type (format) being used."
15212 #: ../src/guestfs-actions.pod:4864
15214 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
15215 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
15216 "possible, although unusual. See C<guestfs_part_init> for a full list."
15221 #: ../src/guestfs-actions.pod:4874
15222 msgid "guestfs_part_init"
15227 #: ../src/guestfs-actions.pod:4876
15231 " guestfs_part_init (guestfs_h *g,\n"
15232 " const char *device,\n"
15233 " const char *parttype);\n"
15239 #: ../src/guestfs-actions.pod:4881 ../fish/guestfish-actions.pod:3260
15241 "This creates an empty partition table on C<device> of one of the partition "
15242 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
15243 "(for large disks)."
15248 #: ../src/guestfs-actions.pod:4885
15250 "Initially there are no partitions. Following this, you should call "
15251 "C<guestfs_part_add> for each partition required."
15256 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3267
15257 msgid "Possible values for C<parttype> are:"
15262 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3271
15263 msgid "B<efi> | B<gpt>"
15268 #: ../src/guestfs-actions.pod:4894 ../fish/guestfish-actions.pod:3273
15269 msgid "Intel EFI / GPT partition table."
15274 #: ../src/guestfs-actions.pod:4896 ../fish/guestfish-actions.pod:3275
15276 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
15277 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
15278 "the C<mbr> format."
15283 #: ../src/guestfs-actions.pod:4900 ../fish/guestfish-actions.pod:3279
15284 msgid "B<mbr> | B<msdos>"
15289 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3281
15291 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
15292 "Windows. This partition type will B<only> work for device sizes up to 2 "
15293 "TB. For large disks we recommend using C<gpt>."
15298 #: ../src/guestfs-actions.pod:4909 ../fish/guestfish-actions.pod:3288
15300 "Other partition table types that may work but are not supported include:"
15305 #: ../src/guestfs-actions.pod:4914 ../fish/guestfish-actions.pod:3293
15311 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3295
15312 msgid "AIX disk labels."
15317 #: ../src/guestfs-actions.pod:4918 ../fish/guestfish-actions.pod:3297
15318 msgid "B<amiga> | B<rdb>"
15323 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3299
15324 msgid "Amiga \"Rigid Disk Block\" format."
15329 #: ../src/guestfs-actions.pod:4922 ../fish/guestfish-actions.pod:3301
15335 #: ../src/guestfs-actions.pod:4924 ../fish/guestfish-actions.pod:3303
15336 msgid "BSD disk labels."
15341 #: ../src/guestfs-actions.pod:4926 ../fish/guestfish-actions.pod:3305
15347 #: ../src/guestfs-actions.pod:4928 ../fish/guestfish-actions.pod:3307
15348 msgid "DASD, used on IBM mainframes."
15353 #: ../src/guestfs-actions.pod:4930 ../fish/guestfish-actions.pod:3309
15359 #: ../src/guestfs-actions.pod:4932 ../fish/guestfish-actions.pod:3311
15360 msgid "MIPS/SGI volumes."
15365 #: ../src/guestfs-actions.pod:4934 ../fish/guestfish-actions.pod:3313
15371 #: ../src/guestfs-actions.pod:4936 ../fish/guestfish-actions.pod:3315
15372 msgid "Old Mac partition format. Modern Macs use C<gpt>."
15377 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3317
15383 #: ../src/guestfs-actions.pod:4940 ../fish/guestfish-actions.pod:3319
15384 msgid "NEC PC-98 format, common in Japan apparently."
15389 #: ../src/guestfs-actions.pod:4942 ../fish/guestfish-actions.pod:3321
15395 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3323
15396 msgid "Sun disk labels."
15401 #: ../src/guestfs-actions.pod:4952
15402 msgid "guestfs_part_list"
15407 #: ../src/guestfs-actions.pod:4954
15410 " struct guestfs_partition_list *\n"
15411 " guestfs_part_list (guestfs_h *g,\n"
15412 " const char *device);\n"
15418 #: ../src/guestfs-actions.pod:4958 ../fish/guestfish-actions.pod:3331
15420 "This command parses the partition table on C<device> and returns the list of "
15421 "partitions found."
15426 #: ../src/guestfs-actions.pod:4961 ../fish/guestfish-actions.pod:3334
15427 msgid "The fields in the returned structure are:"
15432 #: ../src/guestfs-actions.pod:4965 ../fish/guestfish-actions.pod:3338
15433 msgid "B<part_num>"
15438 #: ../src/guestfs-actions.pod:4967 ../fish/guestfish-actions.pod:3340
15439 msgid "Partition number, counting from 1."
15444 #: ../src/guestfs-actions.pod:4969 ../fish/guestfish-actions.pod:3342
15445 msgid "B<part_start>"
15450 #: ../src/guestfs-actions.pod:4971
15452 "Start of the partition I<in bytes>. To get sectors you have to divide by "
15453 "the device's sector size, see C<guestfs_blockdev_getss>."
15458 #: ../src/guestfs-actions.pod:4974 ../fish/guestfish-actions.pod:3347
15459 msgid "B<part_end>"
15464 #: ../src/guestfs-actions.pod:4976 ../fish/guestfish-actions.pod:3349
15465 msgid "End of the partition in bytes."
15470 #: ../src/guestfs-actions.pod:4978 ../fish/guestfish-actions.pod:3351
15471 msgid "B<part_size>"
15476 #: ../src/guestfs-actions.pod:4980 ../fish/guestfish-actions.pod:3353
15477 msgid "Size of the partition in bytes."
15482 #: ../src/guestfs-actions.pod:4984
15484 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
15485 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
15491 #: ../src/guestfs-actions.pod:4990
15492 msgid "guestfs_part_set_bootable"
15497 #: ../src/guestfs-actions.pod:4992
15501 " guestfs_part_set_bootable (guestfs_h *g,\n"
15502 " const char *device,\n"
15504 " int bootable);\n"
15510 #: ../src/guestfs-actions.pod:4998 ../fish/guestfish-actions.pod:3361
15512 "This sets the bootable flag on partition numbered C<partnum> on device "
15513 "C<device>. Note that partitions are numbered from 1."
15518 #: ../src/guestfs-actions.pod:5001 ../fish/guestfish-actions.pod:3364
15520 "The bootable flag is used by some operating systems (notably Windows) to "
15521 "determine which partition to boot from. It is by no means universally "
15527 #: ../src/guestfs-actions.pod:5009
15528 msgid "guestfs_part_set_mbr_id"
15533 #: ../src/guestfs-actions.pod:5011
15537 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
15538 " const char *device,\n"
15546 #: ../src/guestfs-actions.pod:5017 ../fish/guestfish-actions.pod:3372
15548 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
15549 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
15550 "documentation are in fact hexadecimal numbers, but usually documented "
15551 "without any leading \"0x\" which might be confusing."
15556 #: ../src/guestfs-actions.pod:5031
15557 msgid "guestfs_part_set_name"
15562 #: ../src/guestfs-actions.pod:5033
15566 " guestfs_part_set_name (guestfs_h *g,\n"
15567 " const char *device,\n"
15569 " const char *name);\n"
15575 #: ../src/guestfs-actions.pod:5039 ../fish/guestfish-actions.pod:3386
15577 "This sets the partition name on partition numbered C<partnum> on device "
15578 "C<device>. Note that partitions are numbered from 1."
15583 #: ../src/guestfs-actions.pod:5042 ../fish/guestfish-actions.pod:3389
15585 "The partition name can only be set on certain types of partition table. "
15586 "This works on C<gpt> but not on C<mbr> partitions."
15591 #: ../src/guestfs-actions.pod:5049
15592 msgid "guestfs_part_to_dev"
15597 #: ../src/guestfs-actions.pod:5051
15601 " guestfs_part_to_dev (guestfs_h *g,\n"
15602 " const char *partition);\n"
15608 #: ../src/guestfs-actions.pod:5055 ../fish/guestfish-actions.pod:3396
15610 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
15611 "partition number, returning the device name (eg. \"/dev/sdb\")."
15616 #: ../src/guestfs-actions.pod:5059
15618 "The named partition must exist, for example as a string returned from "
15619 "C<guestfs_list_partitions>."
15624 #: ../src/guestfs-actions.pod:5067
15625 msgid "guestfs_ping_daemon"
15630 #: ../src/guestfs-actions.pod:5069
15634 " guestfs_ping_daemon (guestfs_h *g);\n"
15640 #: ../src/guestfs-actions.pod:5072 ../fish/guestfish-actions.pod:3407
15642 "This is a test probe into the guestfs daemon running inside the qemu "
15643 "subprocess. Calling this function checks that the daemon responds to the "
15644 "ping message, without affecting the daemon or attached block device(s) in "
15650 #: ../src/guestfs-actions.pod:5081
15651 msgid "guestfs_pread"
15656 #: ../src/guestfs-actions.pod:5083
15660 " guestfs_pread (guestfs_h *g,\n"
15661 " const char *path,\n"
15663 " int64_t offset,\n"
15664 " size_t *size_r);\n"
15670 #: ../src/guestfs-actions.pod:5090 ../fish/guestfish-actions.pod:3416
15672 "This command lets you read part of a file. It reads C<count> bytes of the "
15673 "file, starting at C<offset>, from file C<path>."
15678 #: ../src/guestfs-actions.pod:5093 ../src/guestfs-actions.pod:5119
15679 #: ../fish/guestfish-actions.pod:3419 ../fish/guestfish-actions.pod:3434
15681 "This may read fewer bytes than requested. For further details see the "
15682 "L<pread(2)> system call."
15687 #: ../src/guestfs-actions.pod:5096
15688 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
15693 #: ../src/guestfs-actions.pod:5107
15694 msgid "guestfs_pread_device"
15699 #: ../src/guestfs-actions.pod:5109
15703 " guestfs_pread_device (guestfs_h *g,\n"
15704 " const char *device,\n"
15706 " int64_t offset,\n"
15707 " size_t *size_r);\n"
15713 #: ../src/guestfs-actions.pod:5116 ../fish/guestfish-actions.pod:3431
15715 "This command lets you read part of a file. It reads C<count> bytes of "
15716 "C<device>, starting at C<offset>."
15721 #: ../src/guestfs-actions.pod:5122
15722 msgid "See also C<guestfs_pread>."
15727 #: ../src/guestfs-actions.pod:5131
15728 msgid "(Added in 1.5.21)"
15733 #: ../src/guestfs-actions.pod:5133
15734 msgid "guestfs_pvcreate"
15739 #: ../src/guestfs-actions.pod:5135
15743 " guestfs_pvcreate (guestfs_h *g,\n"
15744 " const char *device);\n"
15750 #: ../src/guestfs-actions.pod:5139 ../fish/guestfish-actions.pod:3446
15752 "This creates an LVM physical volume on the named C<device>, where C<device> "
15753 "should usually be a partition name such as C</dev/sda1>."
15758 #: ../src/guestfs-actions.pod:5147
15759 msgid "guestfs_pvremove"
15764 #: ../src/guestfs-actions.pod:5149
15768 " guestfs_pvremove (guestfs_h *g,\n"
15769 " const char *device);\n"
15775 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3454
15777 "This wipes a physical volume C<device> so that LVM will no longer recognise "
15783 #: ../src/guestfs-actions.pod:5156 ../fish/guestfish-actions.pod:3457
15785 "The implementation uses the C<pvremove> command which refuses to wipe "
15786 "physical volumes that contain any volume groups, so you have to remove those "
15792 #: ../src/guestfs-actions.pod:5164
15793 msgid "guestfs_pvresize"
15798 #: ../src/guestfs-actions.pod:5166
15802 " guestfs_pvresize (guestfs_h *g,\n"
15803 " const char *device);\n"
15809 #: ../src/guestfs-actions.pod:5170 ../fish/guestfish-actions.pod:3465
15811 "This resizes (expands or shrinks) an existing LVM physical volume to match "
15812 "the new size of the underlying device."
15817 #: ../src/guestfs-actions.pod:5177
15818 msgid "guestfs_pvresize_size"
15823 #: ../src/guestfs-actions.pod:5179
15827 " guestfs_pvresize_size (guestfs_h *g,\n"
15828 " const char *device,\n"
15829 " int64_t size);\n"
15835 #: ../src/guestfs-actions.pod:5184
15837 "This command is the same as C<guestfs_pvresize> except that it allows you to "
15838 "specify the new size (in bytes) explicitly."
15843 #: ../src/guestfs-actions.pod:5191
15844 msgid "guestfs_pvs"
15849 #: ../src/guestfs-actions.pod:5193
15853 " guestfs_pvs (guestfs_h *g);\n"
15859 #: ../src/guestfs-actions.pod:5196 ../fish/guestfish-actions.pod:3479
15861 "List all the physical volumes detected. This is the equivalent of the L<pvs"
15867 #: ../src/guestfs-actions.pod:5199 ../fish/guestfish-actions.pod:3482
15869 "This returns a list of just the device names that contain PVs (eg. C</dev/"
15875 #: ../src/guestfs-actions.pod:5202
15876 msgid "See also C<guestfs_pvs_full>."
15881 #: ../src/guestfs-actions.pod:5210
15882 msgid "guestfs_pvs_full"
15887 #: ../src/guestfs-actions.pod:5212
15890 " struct guestfs_lvm_pv_list *\n"
15891 " guestfs_pvs_full (guestfs_h *g);\n"
15897 #: ../src/guestfs-actions.pod:5215 ../fish/guestfish-actions.pod:3491
15899 "List all the physical volumes detected. This is the equivalent of the L<pvs"
15900 "(8)> command. The \"full\" version includes all fields."
15905 #: ../src/guestfs-actions.pod:5218
15907 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
15908 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
15913 #: ../src/guestfs-actions.pod:5224
15914 msgid "guestfs_pvuuid"
15919 #: ../src/guestfs-actions.pod:5226
15923 " guestfs_pvuuid (guestfs_h *g,\n"
15924 " const char *device);\n"
15930 #: ../src/guestfs-actions.pod:5230 ../fish/guestfish-actions.pod:3498
15931 msgid "This command returns the UUID of the LVM PV C<device>."
15936 #: ../src/guestfs-actions.pod:5237
15937 msgid "guestfs_pwrite"
15942 #: ../src/guestfs-actions.pod:5239
15946 " guestfs_pwrite (guestfs_h *g,\n"
15947 " const char *path,\n"
15948 " const char *content,\n"
15949 " size_t content_size,\n"
15950 " int64_t offset);\n"
15956 #: ../src/guestfs-actions.pod:5246 ../fish/guestfish-actions.pod:3504
15958 "This command writes to part of a file. It writes the data buffer C<content> "
15959 "to the file C<path> starting at offset C<offset>."
15964 #: ../src/guestfs-actions.pod:5249 ../fish/guestfish-actions.pod:3507
15966 "This command implements the L<pwrite(2)> system call, and like that system "
15967 "call it may not write the full data requested. The return value is the "
15968 "number of bytes that were actually written to the file. This could even be "
15969 "0, although short writes are unlikely for regular files in ordinary "
15975 #: ../src/guestfs-actions.pod:5255
15976 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
15981 #: ../src/guestfs-actions.pod:5264
15982 msgid "guestfs_pwrite_device"
15987 #: ../src/guestfs-actions.pod:5266
15991 " guestfs_pwrite_device (guestfs_h *g,\n"
15992 " const char *device,\n"
15993 " const char *content,\n"
15994 " size_t content_size,\n"
15995 " int64_t offset);\n"
16001 #: ../src/guestfs-actions.pod:5273 ../fish/guestfish-actions.pod:3522
16003 "This command writes to part of a device. It writes the data buffer "
16004 "C<content> to C<device> starting at offset C<offset>."
16009 #: ../src/guestfs-actions.pod:5276 ../fish/guestfish-actions.pod:3525
16011 "This command implements the L<pwrite(2)> system call, and like that system "
16012 "call it may not write the full data requested (although short writes to disk "
16013 "devices and partitions are probably impossible with standard Linux kernels)."
16018 #: ../src/guestfs-actions.pod:5281
16019 msgid "See also C<guestfs_pwrite>."
16024 #: ../src/guestfs-actions.pod:5288
16025 msgid "(Added in 1.5.20)"
16030 #: ../src/guestfs-actions.pod:5290
16031 msgid "guestfs_read_file"
16036 #: ../src/guestfs-actions.pod:5292
16040 " guestfs_read_file (guestfs_h *g,\n"
16041 " const char *path,\n"
16042 " size_t *size_r);\n"
16048 #: ../src/guestfs-actions.pod:5297 ../fish/guestfish-actions.pod:3539
16049 msgid "This calls returns the contents of the file C<path> as a buffer."
16054 #: ../src/guestfs-actions.pod:5300
16056 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
16057 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
16058 "function is limited in the total size of file that can be handled."
16063 #: ../src/guestfs-actions.pod:5312
16064 msgid "(Added in 1.0.63)"
16069 #: ../src/guestfs-actions.pod:5314
16070 msgid "guestfs_read_lines"
16075 #: ../src/guestfs-actions.pod:5316
16079 " guestfs_read_lines (guestfs_h *g,\n"
16080 " const char *path);\n"
16086 #: ../src/guestfs-actions.pod:5322 ../fish/guestfish-actions.pod:3556
16088 "The file contents are returned as a list of lines. Trailing C<LF> and "
16089 "C<CRLF> character sequences are I<not> returned."
16094 #: ../src/guestfs-actions.pod:5325
16096 "Note that this function cannot correctly handle binary files (specifically, "
16097 "files containing C<\\0> character which is treated as end of line). For "
16098 "those you need to use the C<guestfs_read_file> function which has a more "
16099 "complex interface."
16104 #: ../src/guestfs-actions.pod:5336
16105 msgid "guestfs_readdir"
16110 #: ../src/guestfs-actions.pod:5338
16113 " struct guestfs_dirent_list *\n"
16114 " guestfs_readdir (guestfs_h *g,\n"
16115 " const char *dir);\n"
16121 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3568
16122 msgid "This returns the list of directory entries in directory C<dir>."
16127 #: ../src/guestfs-actions.pod:5344 ../fish/guestfish-actions.pod:3570
16129 "All entries in the directory are returned, including C<.> and C<..>. The "
16130 "entries are I<not> sorted, but returned in the same order as the underlying "
16136 #: ../src/guestfs-actions.pod:5348 ../fish/guestfish-actions.pod:3574
16138 "Also this call returns basic file type information about each file. The "
16139 "C<ftyp> field will contain one of the following characters:"
16144 #: ../src/guestfs-actions.pod:5353 ../fish/guestfish-actions.pod:3579
16150 #: ../src/guestfs-actions.pod:5355 ../fish/guestfish-actions.pod:3581
16151 msgid "Block special"
16156 #: ../src/guestfs-actions.pod:5357 ../fish/guestfish-actions.pod:3583
16162 #: ../src/guestfs-actions.pod:5359 ../fish/guestfish-actions.pod:3585
16163 msgid "Char special"
16168 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3587
16174 #: ../src/guestfs-actions.pod:5363 ../fish/guestfish-actions.pod:3589
16180 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:3591
16186 #: ../src/guestfs-actions.pod:5367 ../fish/guestfish-actions.pod:3593
16187 msgid "FIFO (named pipe)"
16192 #: ../src/guestfs-actions.pod:5369 ../fish/guestfish-actions.pod:3595
16198 #: ../src/guestfs-actions.pod:5371 ../fish/guestfish-actions.pod:3597
16199 msgid "Symbolic link"
16204 #: ../src/guestfs-actions.pod:5373 ../fish/guestfish-actions.pod:3599
16210 #: ../src/guestfs-actions.pod:5375 ../fish/guestfish-actions.pod:3601
16211 msgid "Regular file"
16216 #: ../src/guestfs-actions.pod:5377 ../fish/guestfish-actions.pod:3603
16222 #: ../src/guestfs-actions.pod:5379 ../fish/guestfish-actions.pod:3605
16228 #: ../src/guestfs-actions.pod:5381 ../fish/guestfish-actions.pod:3607
16234 #: ../src/guestfs-actions.pod:5383 ../fish/guestfish-actions.pod:3609
16235 msgid "Unknown file type"
16240 #: ../src/guestfs-actions.pod:5385 ../fish/guestfish-actions.pod:3611
16246 #: ../src/guestfs-actions.pod:5387 ../fish/guestfish-actions.pod:3613
16248 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
16253 #: ../src/guestfs-actions.pod:5392
16255 "This function is primarily intended for use by programs. To get a simple "
16256 "list of names, use C<guestfs_ls>. To get a printable directory for human "
16257 "consumption, use C<guestfs_ll>."
16262 #: ../src/guestfs-actions.pod:5396
16264 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
16265 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
16270 #: ../src/guestfs-actions.pod:5402
16271 msgid "guestfs_readlink"
16276 #: ../src/guestfs-actions.pod:5404
16280 " guestfs_readlink (guestfs_h *g,\n"
16281 " const char *path);\n"
16287 #: ../src/guestfs-actions.pod:5408 ../fish/guestfish-actions.pod:3626
16288 msgid "This command reads the target of a symbolic link."
16293 #: ../src/guestfs-actions.pod:5415
16294 msgid "guestfs_readlinklist"
16299 #: ../src/guestfs-actions.pod:5417
16303 " guestfs_readlinklist (guestfs_h *g,\n"
16304 " const char *path,\n"
16305 " char *const *names);\n"
16311 #: ../src/guestfs-actions.pod:5422 ../fish/guestfish-actions.pod:3632
16313 "This call allows you to do a C<readlink> operation on multiple files, where "
16314 "all files are in the directory C<path>. C<names> is the list of files from "
16320 #: ../src/guestfs-actions.pod:5426 ../fish/guestfish-actions.pod:3636
16322 "On return you get a list of strings, with a one-to-one correspondence to the "
16323 "C<names> list. Each string is the value of the symbolic link."
16328 #: ../src/guestfs-actions.pod:5430 ../fish/guestfish-actions.pod:3640
16330 "If the C<readlink(2)> operation fails on any name, then the corresponding "
16331 "result string is the empty string C<\"\">. However the whole operation is "
16332 "completed even if there were C<readlink(2)> errors, and so you can call this "
16333 "function with names where you don't know if they are symbolic links already "
16334 "(albeit slightly less efficient)."
16339 #: ../src/guestfs-actions.pod:5437 ../fish/guestfish-actions.pod:3647
16341 "This call is intended for programs that want to efficiently list a directory "
16342 "contents without making many round-trips. Very long directory listings "
16343 "might cause the protocol message size to be exceeded, causing this call to "
16344 "fail. The caller must split up such requests into smaller groups of names."
16349 #: ../src/guestfs-actions.pod:5450
16350 msgid "guestfs_realpath"
16355 #: ../src/guestfs-actions.pod:5452
16359 " guestfs_realpath (guestfs_h *g,\n"
16360 " const char *path);\n"
16366 #: ../src/guestfs-actions.pod:5456 ../fish/guestfish-actions.pod:3658
16368 "Return the canonicalized absolute pathname of C<path>. The returned path "
16369 "has no C<.>, C<..> or symbolic link path elements."
16374 #: ../src/guestfs-actions.pod:5464
16375 msgid "guestfs_removexattr"
16380 #: ../src/guestfs-actions.pod:5466
16384 " guestfs_removexattr (guestfs_h *g,\n"
16385 " const char *xattr,\n"
16386 " const char *path);\n"
16392 #: ../src/guestfs-actions.pod:5471 ../fish/guestfish-actions.pod:3665
16394 "This call removes the extended attribute named C<xattr> of the file C<path>."
16399 #: ../src/guestfs-actions.pod:5474
16400 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
16405 #: ../src/guestfs-actions.pod:5480
16406 msgid "guestfs_resize2fs"
16411 #: ../src/guestfs-actions.pod:5482
16415 " guestfs_resize2fs (guestfs_h *g,\n"
16416 " const char *device);\n"
16422 #: ../src/guestfs-actions.pod:5486 ../fish/guestfish-actions.pod:3674
16424 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
16425 "underlying device."
16430 #: ../src/guestfs-actions.pod:5489
16432 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
16433 "C<device> before calling this command. For unknown reasons C<resize2fs> "
16434 "sometimes gives an error about this and sometimes not. In any case, it is "
16435 "always safe to call C<guestfs_e2fsck_f> before calling this function."
16439 #: ../src/guestfs-actions.pod:5499
16440 msgid "guestfs_resize2fs_M"
16444 #: ../src/guestfs-actions.pod:5501
16448 " guestfs_resize2fs_M (guestfs_h *g,\n"
16449 " const char *device);\n"
16454 #: ../src/guestfs-actions.pod:5505
16456 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
16457 "resized to its minimum size. This works like the C<-M> option to the "
16458 "C<resize2fs> command."
16462 #: ../src/guestfs-actions.pod:5509
16464 "To get the resulting size of the filesystem you should call "
16465 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
16466 "These two numbers, multiplied together, give the resulting size of the "
16467 "minimal filesystem in bytes."
16472 #: ../src/guestfs-actions.pod:5516
16473 msgid "guestfs_resize2fs_size"
16478 #: ../src/guestfs-actions.pod:5518
16482 " guestfs_resize2fs_size (guestfs_h *g,\n"
16483 " const char *device,\n"
16484 " int64_t size);\n"
16490 #: ../src/guestfs-actions.pod:5523
16492 "This command is the same as C<guestfs_resize2fs> except that it allows you "
16493 "to specify the new size (in bytes) explicitly."
16498 #: ../src/guestfs-actions.pod:5530
16504 #: ../src/guestfs-actions.pod:5532
16508 " guestfs_rm (guestfs_h *g,\n"
16509 " const char *path);\n"
16515 #: ../src/guestfs-actions.pod:5536 ../fish/guestfish-actions.pod:3707
16516 msgid "Remove the single file C<path>."
16521 #: ../src/guestfs-actions.pod:5542
16522 msgid "guestfs_rm_rf"
16527 #: ../src/guestfs-actions.pod:5544
16531 " guestfs_rm_rf (guestfs_h *g,\n"
16532 " const char *path);\n"
16538 #: ../src/guestfs-actions.pod:5548 ../fish/guestfish-actions.pod:3713
16540 "Remove the file or directory C<path>, recursively removing the contents if "
16541 "its a directory. This is like the C<rm -rf> shell command."
16546 #: ../src/guestfs-actions.pod:5556
16547 msgid "guestfs_rmdir"
16552 #: ../src/guestfs-actions.pod:5558
16556 " guestfs_rmdir (guestfs_h *g,\n"
16557 " const char *path);\n"
16563 #: ../src/guestfs-actions.pod:5562 ../fish/guestfish-actions.pod:3721
16564 msgid "Remove the single directory C<path>."
16569 #: ../src/guestfs-actions.pod:5568
16570 msgid "guestfs_rmmountpoint"
16575 #: ../src/guestfs-actions.pod:5570
16579 " guestfs_rmmountpoint (guestfs_h *g,\n"
16580 " const char *exemptpath);\n"
16586 #: ../src/guestfs-actions.pod:5574
16588 "This calls removes a mountpoint that was previously created with "
16589 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
16594 #: ../src/guestfs-actions.pod:5582
16595 msgid "guestfs_scrub_device"
16600 #: ../src/guestfs-actions.pod:5584
16604 " guestfs_scrub_device (guestfs_h *g,\n"
16605 " const char *device);\n"
16611 #: ../src/guestfs-actions.pod:5588 ../fish/guestfish-actions.pod:3735
16613 "This command writes patterns over C<device> to make data retrieval more "
16619 #: ../src/guestfs-actions.pod:5591 ../src/guestfs-actions.pod:5612
16620 #: ../src/guestfs-actions.pod:5631 ../fish/guestfish-actions.pod:3738
16621 #: ../fish/guestfish-actions.pod:3753 ../fish/guestfish-actions.pod:3766
16623 "It is an interface to the L<scrub(1)> program. See that manual page for "
16629 #: ../src/guestfs-actions.pod:5599 ../src/guestfs-actions.pod:5617
16630 #: ../src/guestfs-actions.pod:5636
16631 msgid "(Added in 1.0.52)"
16636 #: ../src/guestfs-actions.pod:5601
16637 msgid "guestfs_scrub_file"
16642 #: ../src/guestfs-actions.pod:5603
16646 " guestfs_scrub_file (guestfs_h *g,\n"
16647 " const char *file);\n"
16653 #: ../src/guestfs-actions.pod:5607 ../fish/guestfish-actions.pod:3748
16655 "This command writes patterns over a file to make data retrieval more "
16661 #: ../src/guestfs-actions.pod:5610 ../fish/guestfish-actions.pod:3751
16662 msgid "The file is I<removed> after scrubbing."
16667 #: ../src/guestfs-actions.pod:5619
16668 msgid "guestfs_scrub_freespace"
16673 #: ../src/guestfs-actions.pod:5621
16677 " guestfs_scrub_freespace (guestfs_h *g,\n"
16678 " const char *dir);\n"
16684 #: ../src/guestfs-actions.pod:5625
16686 "This command creates the directory C<dir> and then fills it with files until "
16687 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
16688 "and deletes them. The intention is to scrub any free space on the partition "
16689 "containing C<dir>."
16694 #: ../src/guestfs-actions.pod:5638
16695 msgid "guestfs_set_append"
16700 #: ../src/guestfs-actions.pod:5640
16704 " guestfs_set_append (guestfs_h *g,\n"
16705 " const char *append);\n"
16711 #: ../src/guestfs-actions.pod:5644 ../fish/guestfish-actions.pod:3775
16713 "This function is used to add additional options to the guest kernel command "
16719 #: ../src/guestfs-actions.pod:5647 ../fish/guestfish-actions.pod:3778
16721 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
16722 "environment variable."
16727 #: ../src/guestfs-actions.pod:5650 ../fish/guestfish-actions.pod:3781
16729 "Setting C<append> to C<NULL> means I<no> additional options are passed "
16730 "(libguestfs always adds a few of its own)."
16735 #: ../src/guestfs-actions.pod:5657
16736 msgid "guestfs_set_autosync"
16741 #: ../src/guestfs-actions.pod:5659
16745 " guestfs_set_autosync (guestfs_h *g,\n"
16746 " int autosync);\n"
16751 #: ../src/guestfs-actions.pod:5663 ../fish/guestfish-actions.pod:3790
16753 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
16754 "effort attempt to make filesystems consistent and synchronized when the "
16755 "handle is closed (also if the program exits without closing handles)."
16760 #: ../src/guestfs-actions.pod:5668 ../fish/guestfish-actions.pod:3795
16762 "This is enabled by default (since libguestfs 1.5.24, previously it was "
16763 "disabled by default)."
16768 #: ../src/guestfs-actions.pod:5675
16769 msgid "guestfs_set_direct"
16774 #: ../src/guestfs-actions.pod:5677
16778 " guestfs_set_direct (guestfs_h *g,\n"
16785 #: ../src/guestfs-actions.pod:5681 ../fish/guestfish-actions.pod:3804
16787 "If the direct appliance mode flag is enabled, then stdin and stdout are "
16788 "passed directly through to the appliance once it is launched."
16793 #: ../src/guestfs-actions.pod:5685
16795 "One consequence of this is that log messages aren't caught by the library "
16796 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
16802 #: ../src/guestfs-actions.pod:5689 ../fish/guestfish-actions.pod:3812
16803 msgid "You probably don't want to use this unless you know what you are doing."
16808 #: ../src/guestfs-actions.pod:5692 ../fish/guestfish-actions.pod:3815
16809 msgid "The default is disabled."
16814 #: ../src/guestfs-actions.pod:5698
16815 msgid "guestfs_set_e2label"
16820 #: ../src/guestfs-actions.pod:5700
16824 " guestfs_set_e2label (guestfs_h *g,\n"
16825 " const char *device,\n"
16826 " const char *label);\n"
16832 #: ../src/guestfs-actions.pod:5705 ../fish/guestfish-actions.pod:3821
16834 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
16835 "C<label>. Filesystem labels are limited to 16 characters."
16840 #: ../src/guestfs-actions.pod:5709
16842 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
16843 "the existing label on a filesystem."
16848 #: ../src/guestfs-actions.pod:5716
16849 msgid "guestfs_set_e2uuid"
16854 #: ../src/guestfs-actions.pod:5718
16858 " guestfs_set_e2uuid (guestfs_h *g,\n"
16859 " const char *device,\n"
16860 " const char *uuid);\n"
16866 #: ../src/guestfs-actions.pod:5723 ../fish/guestfish-actions.pod:3832
16868 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
16869 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
16870 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
16875 #: ../src/guestfs-actions.pod:5728
16877 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
16878 "the existing UUID of a filesystem."
16883 #: ../src/guestfs-actions.pod:5735
16884 msgid "guestfs_set_memsize"
16889 #: ../src/guestfs-actions.pod:5737
16893 " guestfs_set_memsize (guestfs_h *g,\n"
16900 #: ../src/guestfs-actions.pod:5741
16902 "This sets the memory size in megabytes allocated to the qemu subprocess. "
16903 "This only has any effect if called before C<guestfs_launch>."
16908 #: ../src/guestfs-actions.pod:5745 ../fish/guestfish-actions.pod:3850
16910 "You can also change this by setting the environment variable "
16911 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
16916 #: ../src/guestfs-actions.pod:5756
16917 msgid "guestfs_set_network"
16922 #: ../src/guestfs-actions.pod:5758
16926 " guestfs_set_network (guestfs_h *g,\n"
16933 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3863
16935 "If C<network> is true, then the network is enabled in the libguestfs "
16936 "appliance. The default is false."
16941 #: ../src/guestfs-actions.pod:5765 ../fish/guestfish-actions.pod:3866
16943 "This affects whether commands are able to access the network (see L<guestfs"
16944 "(3)/RUNNING COMMANDS>)."
16949 #: ../src/guestfs-actions.pod:5768
16951 "You must call this before calling C<guestfs_launch>, otherwise it has no "
16957 #: ../src/guestfs-actions.pod:5775
16958 msgid "guestfs_set_path"
16963 #: ../src/guestfs-actions.pod:5777
16967 " guestfs_set_path (guestfs_h *g,\n"
16968 " const char *searchpath);\n"
16974 #: ../src/guestfs-actions.pod:5781 ../fish/guestfish-actions.pod:3878
16975 msgid "Set the path that libguestfs searches for kernel and initrd.img."
16980 #: ../src/guestfs-actions.pod:5783 ../fish/guestfish-actions.pod:3880
16982 "The default is C<$libdir/guestfs> unless overridden by setting "
16983 "C<LIBGUESTFS_PATH> environment variable."
16988 #: ../src/guestfs-actions.pod:5786 ../fish/guestfish-actions.pod:3883
16989 msgid "Setting C<path> to C<NULL> restores the default path."
16994 #: ../src/guestfs-actions.pod:5792
16995 msgid "guestfs_set_qemu"
17000 #: ../src/guestfs-actions.pod:5794
17004 " guestfs_set_qemu (guestfs_h *g,\n"
17005 " const char *qemu);\n"
17011 #: ../src/guestfs-actions.pod:5798 ../fish/guestfish-actions.pod:3891
17012 msgid "Set the qemu binary that we will use."
17017 #: ../src/guestfs-actions.pod:5800 ../fish/guestfish-actions.pod:3893
17019 "The default is chosen when the library was compiled by the configure script."
17024 #: ../src/guestfs-actions.pod:5803 ../fish/guestfish-actions.pod:3896
17026 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
17032 #: ../src/guestfs-actions.pod:5806 ../fish/guestfish-actions.pod:3899
17033 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
17038 #: ../src/guestfs-actions.pod:5808 ../fish/guestfish-actions.pod:3901
17040 "Note that you should call this function as early as possible after creating "
17041 "the handle. This is because some pre-launch operations depend on testing "
17042 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
17043 "don't retest features, and so you might see inconsistent results. Using the "
17044 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
17045 "the qemu binary at the same time as the handle is created."
17050 #: ../src/guestfs-actions.pod:5820
17051 msgid "guestfs_set_recovery_proc"
17056 #: ../src/guestfs-actions.pod:5822
17060 " guestfs_set_recovery_proc (guestfs_h *g,\n"
17061 " int recoveryproc);\n"
17067 #: ../src/guestfs-actions.pod:5826
17069 "If this is called with the parameter C<false> then C<guestfs_launch> does "
17070 "not create a recovery process. The purpose of the recovery process is to "
17071 "stop runaway qemu processes in the case where the main program aborts "
17077 #: ../src/guestfs-actions.pod:5831
17079 "This only has any effect if called before C<guestfs_launch>, and the default "
17085 #: ../src/guestfs-actions.pod:5834 ../fish/guestfish-actions.pod:3923
17087 "About the only time when you would want to disable this is if the main "
17088 "process will fork itself into the background (\"daemonize\" itself). In "
17089 "this case the recovery process thinks that the main program has disappeared "
17090 "and so kills qemu, which is not very helpful."
17095 #: ../src/guestfs-actions.pod:5844
17096 msgid "guestfs_set_selinux"
17101 #: ../src/guestfs-actions.pod:5846
17105 " guestfs_set_selinux (guestfs_h *g,\n"
17112 #: ../src/guestfs-actions.pod:5850 ../fish/guestfish-actions.pod:3935
17114 "This sets the selinux flag that is passed to the appliance at boot time. "
17115 "The default is C<selinux=0> (disabled)."
17120 #: ../src/guestfs-actions.pod:5853 ../fish/guestfish-actions.pod:3938
17122 "Note that if SELinux is enabled, it is always in Permissive mode "
17123 "(C<enforcing=0>)."
17128 #: ../src/guestfs-actions.pod:5863
17129 msgid "guestfs_set_trace"
17134 #: ../src/guestfs-actions.pod:5865
17138 " guestfs_set_trace (guestfs_h *g,\n"
17145 #: ../src/guestfs-actions.pod:5869 ../fish/guestfish-actions.pod:3950
17147 "If the command trace flag is set to 1, then commands are printed on stderr "
17148 "before they are executed in a format which is very similar to the one used "
17149 "by guestfish. In other words, you can run a program with this enabled, and "
17150 "you will get out a script which you can feed to guestfish to perform the "
17151 "same set of actions."
17156 #: ../src/guestfs-actions.pod:5876 ../fish/guestfish-actions.pod:3957
17158 "If you want to trace C API calls into libguestfs (and other libraries) then "
17159 "possibly a better way is to use the external ltrace(1) command."
17164 #: ../src/guestfs-actions.pod:5880 ../fish/guestfish-actions.pod:3961
17166 "Command traces are disabled unless the environment variable "
17167 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
17172 #: ../src/guestfs-actions.pod:5887
17173 msgid "guestfs_set_verbose"
17178 #: ../src/guestfs-actions.pod:5889
17182 " guestfs_set_verbose (guestfs_h *g,\n"
17189 #: ../src/guestfs-actions.pod:5893 ../fish/guestfish-actions.pod:3970
17190 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
17195 #: ../src/guestfs-actions.pod:5895 ../fish/guestfish-actions.pod:3972
17197 "Verbose messages are disabled unless the environment variable "
17198 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
17203 #: ../src/guestfs-actions.pod:5902
17204 msgid "guestfs_setcon"
17209 #: ../src/guestfs-actions.pod:5904
17213 " guestfs_setcon (guestfs_h *g,\n"
17214 " const char *context);\n"
17220 #: ../src/guestfs-actions.pod:5908 ../fish/guestfish-actions.pod:3979
17222 "This sets the SELinux security context of the daemon to the string "
17228 #: ../src/guestfs-actions.pod:5911 ../fish/guestfish-actions.pod:3982
17229 msgid "See the documentation about SELINUX in L<guestfs(3)>."
17234 #: ../src/guestfs-actions.pod:5917
17235 msgid "guestfs_setxattr"
17240 #: ../src/guestfs-actions.pod:5919
17244 " guestfs_setxattr (guestfs_h *g,\n"
17245 " const char *xattr,\n"
17246 " const char *val,\n"
17248 " const char *path);\n"
17254 #: ../src/guestfs-actions.pod:5926 ../fish/guestfish-actions.pod:3988
17256 "This call sets the extended attribute named C<xattr> of the file C<path> to "
17257 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
17262 #: ../src/guestfs-actions.pod:5930
17263 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
17268 #: ../src/guestfs-actions.pod:5936
17269 msgid "guestfs_sfdisk"
17274 #: ../src/guestfs-actions.pod:5938
17278 " guestfs_sfdisk (guestfs_h *g,\n"
17279 " const char *device,\n"
17283 " char *const *lines);\n"
17289 #: ../src/guestfs-actions.pod:5946 ../fish/guestfish-actions.pod:3998
17291 "This is a direct interface to the L<sfdisk(8)> program for creating "
17292 "partitions on block devices."
17297 #: ../src/guestfs-actions.pod:5949 ../fish/guestfish-actions.pod:4001
17298 msgid "C<device> should be a block device, for example C</dev/sda>."
17303 #: ../src/guestfs-actions.pod:5951 ../fish/guestfish-actions.pod:4003
17305 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
17306 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
17307 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
17308 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
17309 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
17310 "the kernel) cannot work out the right geometry and you will need to tell it."
17315 #: ../src/guestfs-actions.pod:5959 ../fish/guestfish-actions.pod:4011
17317 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
17318 "refer to the L<sfdisk(8)> manpage."
17323 #: ../src/guestfs-actions.pod:5962 ../fish/guestfish-actions.pod:4014
17325 "To create a single partition occupying the whole disk, you would pass "
17326 "C<lines> as a single element list, when the single element being the string "
17332 #: ../src/guestfs-actions.pod:5966
17334 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
17339 #: ../src/guestfs-actions.pod:5976
17340 msgid "guestfs_sfdiskM"
17345 #: ../src/guestfs-actions.pod:5978
17349 " guestfs_sfdiskM (guestfs_h *g,\n"
17350 " const char *device,\n"
17351 " char *const *lines);\n"
17357 #: ../src/guestfs-actions.pod:5983
17359 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
17360 "partition sizes are specified in megabytes only (rounded to the nearest "
17361 "cylinder) and you don't need to specify the cyls, heads and sectors "
17362 "parameters which were rarely if ever used anyway."
17367 #: ../src/guestfs-actions.pod:5989
17369 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
17370 "C<guestfs_part_disk>"
17375 #: ../src/guestfs-actions.pod:5999
17376 msgid "guestfs_sfdisk_N"
17381 #: ../src/guestfs-actions.pod:6001
17385 " guestfs_sfdisk_N (guestfs_h *g,\n"
17386 " const char *device,\n"
17391 " const char *line);\n"
17397 #: ../src/guestfs-actions.pod:6010 ../fish/guestfish-actions.pod:4044
17399 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
17400 "(note: C<n> counts from 1)."
17405 #: ../src/guestfs-actions.pod:6013
17407 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
17408 "for the cyls/heads/sectors parameters."
17413 #: ../src/guestfs-actions.pod:6016
17414 msgid "See also: C<guestfs_part_add>"
17419 #: ../src/guestfs-actions.pod:6025
17420 msgid "guestfs_sfdisk_disk_geometry"
17425 #: ../src/guestfs-actions.pod:6027
17429 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
17430 " const char *device);\n"
17436 #: ../src/guestfs-actions.pod:6031
17438 "This displays the disk geometry of C<device> read from the partition table. "
17439 "Especially in the case where the underlying block device has been resized, "
17440 "this can be different from the kernel's idea of the geometry (see "
17441 "C<guestfs_sfdisk_kernel_geometry>)."
17446 #: ../src/guestfs-actions.pod:6036 ../src/guestfs-actions.pod:6052
17447 #: ../fish/guestfish-actions.pod:4064 ../fish/guestfish-actions.pod:4073
17448 msgid "The result is in human-readable format, and not designed to be parsed."
17453 #: ../src/guestfs-actions.pod:6044
17454 msgid "guestfs_sfdisk_kernel_geometry"
17459 #: ../src/guestfs-actions.pod:6046
17463 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
17464 " const char *device);\n"
17470 #: ../src/guestfs-actions.pod:6050 ../fish/guestfish-actions.pod:4071
17471 msgid "This displays the kernel's idea of the geometry of C<device>."
17476 #: ../src/guestfs-actions.pod:6060
17477 msgid "guestfs_sfdisk_l"
17482 #: ../src/guestfs-actions.pod:6062
17486 " guestfs_sfdisk_l (guestfs_h *g,\n"
17487 " const char *device);\n"
17493 #: ../src/guestfs-actions.pod:6066 ../fish/guestfish-actions.pod:4080
17495 "This displays the partition table on C<device>, in the human-readable output "
17496 "of the L<sfdisk(8)> command. It is not intended to be parsed."
17501 #: ../src/guestfs-actions.pod:6070
17502 msgid "See also: C<guestfs_part_list>"
17507 #: ../src/guestfs-actions.pod:6077
17513 #: ../src/guestfs-actions.pod:6079
17517 " guestfs_sh (guestfs_h *g,\n"
17518 " const char *command);\n"
17524 #: ../src/guestfs-actions.pod:6083 ../fish/guestfish-actions.pod:4090
17526 "This call runs a command from the guest filesystem via the guest's C</bin/"
17532 #: ../src/guestfs-actions.pod:6086
17533 msgid "This is like C<guestfs_command>, but passes the command to:"
17538 #: ../src/guestfs-actions.pod:6088 ../fish/guestfish-actions.pod:4095
17541 " /bin/sh -c \"command\"\n"
17547 #: ../src/guestfs-actions.pod:6090 ../fish/guestfish-actions.pod:4097
17549 "Depending on the guest's shell, this usually results in wildcards being "
17550 "expanded, shell expressions being interpolated and so on."
17555 #: ../src/guestfs-actions.pod:6094
17556 msgid "All the provisos about C<guestfs_command> apply to this call."
17561 #: ../src/guestfs-actions.pod:6101
17562 msgid "guestfs_sh_lines"
17567 #: ../src/guestfs-actions.pod:6103
17571 " guestfs_sh_lines (guestfs_h *g,\n"
17572 " const char *command);\n"
17578 #: ../src/guestfs-actions.pod:6107
17580 "This is the same as C<guestfs_sh>, but splits the result into a list of "
17586 #: ../src/guestfs-actions.pod:6110
17587 msgid "See also: C<guestfs_command_lines>"
17592 #: ../src/guestfs-actions.pod:6118
17593 msgid "guestfs_sleep"
17598 #: ../src/guestfs-actions.pod:6120
17602 " guestfs_sleep (guestfs_h *g,\n"
17609 #: ../src/guestfs-actions.pod:6124 ../fish/guestfish-actions.pod:4116
17610 msgid "Sleep for C<secs> seconds."
17615 #: ../src/guestfs-actions.pod:6128
17616 msgid "(Added in 1.0.41)"
17621 #: ../src/guestfs-actions.pod:6130 ../src/guestfs-structs.pod:109
17622 msgid "guestfs_stat"
17627 #: ../src/guestfs-actions.pod:6132
17630 " struct guestfs_stat *\n"
17631 " guestfs_stat (guestfs_h *g,\n"
17632 " const char *path);\n"
17638 #: ../src/guestfs-actions.pod:6138 ../fish/guestfish-actions.pod:4124
17639 msgid "This is the same as the C<stat(2)> system call."
17644 #: ../src/guestfs-actions.pod:6146 ../src/guestfs-structs.pod:135
17645 msgid "guestfs_statvfs"
17650 #: ../src/guestfs-actions.pod:6148
17653 " struct guestfs_statvfs *\n"
17654 " guestfs_statvfs (guestfs_h *g,\n"
17655 " const char *path);\n"
17661 #: ../src/guestfs-actions.pod:6152 ../fish/guestfish-actions.pod:4130
17663 "Returns file system statistics for any mounted file system. C<path> should "
17664 "be a file or directory in the mounted file system (typically it is the mount "
17665 "point itself, but it doesn't need to be)."
17670 #: ../src/guestfs-actions.pod:6156 ../fish/guestfish-actions.pod:4134
17671 msgid "This is the same as the C<statvfs(2)> system call."
17676 #: ../src/guestfs-actions.pod:6158
17678 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
17679 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
17684 #: ../src/guestfs-actions.pod:6164
17685 msgid "guestfs_strings"
17690 #: ../src/guestfs-actions.pod:6166
17694 " guestfs_strings (guestfs_h *g,\n"
17695 " const char *path);\n"
17701 #: ../src/guestfs-actions.pod:6170 ../fish/guestfish-actions.pod:4140
17703 "This runs the L<strings(1)> command on a file and returns the list of "
17704 "printable strings found."
17709 #: ../src/guestfs-actions.pod:6182
17710 msgid "guestfs_strings_e"
17715 #: ../src/guestfs-actions.pod:6184
17719 " guestfs_strings_e (guestfs_h *g,\n"
17720 " const char *encoding,\n"
17721 " const char *path);\n"
17727 #: ../src/guestfs-actions.pod:6189
17729 "This is like the C<guestfs_strings> command, but allows you to specify the "
17730 "encoding of strings that are looked for in the source file C<path>."
17735 #: ../src/guestfs-actions.pod:6193 ../fish/guestfish-actions.pod:4154
17736 msgid "Allowed encodings are:"
17741 #: ../src/guestfs-actions.pod:6197 ../fish/guestfish-actions.pod:4158
17747 #: ../src/guestfs-actions.pod:6199
17749 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
17750 "ISO-8859-X (this is what C<guestfs_strings> uses)."
17755 #: ../src/guestfs-actions.pod:6202 ../fish/guestfish-actions.pod:4163
17761 #: ../src/guestfs-actions.pod:6204 ../fish/guestfish-actions.pod:4165
17762 msgid "Single 8-bit-byte characters."
17767 #: ../src/guestfs-actions.pod:6206 ../fish/guestfish-actions.pod:4167
17773 #: ../src/guestfs-actions.pod:6208 ../fish/guestfish-actions.pod:4169
17774 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
17779 #: ../src/guestfs-actions.pod:6211 ../fish/guestfish-actions.pod:4172
17780 msgid "l (lower case letter L)"
17785 #: ../src/guestfs-actions.pod:6213 ../fish/guestfish-actions.pod:4174
17787 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
17788 "examining binaries in Windows guests."
17793 #: ../src/guestfs-actions.pod:6216 ../fish/guestfish-actions.pod:4177
17799 #: ../src/guestfs-actions.pod:6218 ../fish/guestfish-actions.pod:4179
17800 msgid "32-bit big endian such as UCS-4BE."
17805 #: ../src/guestfs-actions.pod:6220 ../fish/guestfish-actions.pod:4181
17811 #: ../src/guestfs-actions.pod:6222 ../fish/guestfish-actions.pod:4183
17812 msgid "32-bit little endian such as UCS-4LE."
17817 #: ../src/guestfs-actions.pod:6226 ../fish/guestfish-actions.pod:4187
17818 msgid "The returned strings are transcoded to UTF-8."
17823 #: ../src/guestfs-actions.pod:6237
17824 msgid "guestfs_swapoff_device"
17829 #: ../src/guestfs-actions.pod:6239
17833 " guestfs_swapoff_device (guestfs_h *g,\n"
17834 " const char *device);\n"
17840 #: ../src/guestfs-actions.pod:6243
17842 "This command disables the libguestfs appliance swap device or partition "
17843 "named C<device>. See C<guestfs_swapon_device>."
17848 #: ../src/guestfs-actions.pod:6251
17849 msgid "guestfs_swapoff_file"
17854 #: ../src/guestfs-actions.pod:6253
17858 " guestfs_swapoff_file (guestfs_h *g,\n"
17859 " const char *file);\n"
17865 #: ../src/guestfs-actions.pod:6257 ../fish/guestfish-actions.pod:4204
17866 msgid "This command disables the libguestfs appliance swap on file."
17871 #: ../src/guestfs-actions.pod:6263
17872 msgid "guestfs_swapoff_label"
17877 #: ../src/guestfs-actions.pod:6265
17881 " guestfs_swapoff_label (guestfs_h *g,\n"
17882 " const char *label);\n"
17888 #: ../src/guestfs-actions.pod:6269 ../fish/guestfish-actions.pod:4210
17890 "This command disables the libguestfs appliance swap on labeled swap "
17896 #: ../src/guestfs-actions.pod:6276
17897 msgid "guestfs_swapoff_uuid"
17902 #: ../src/guestfs-actions.pod:6278
17906 " guestfs_swapoff_uuid (guestfs_h *g,\n"
17907 " const char *uuid);\n"
17913 #: ../src/guestfs-actions.pod:6282 ../fish/guestfish-actions.pod:4217
17915 "This command disables the libguestfs appliance swap partition with the given "
17921 #: ../src/guestfs-actions.pod:6289
17922 msgid "guestfs_swapon_device"
17927 #: ../src/guestfs-actions.pod:6291
17931 " guestfs_swapon_device (guestfs_h *g,\n"
17932 " const char *device);\n"
17938 #: ../src/guestfs-actions.pod:6295
17940 "This command enables the libguestfs appliance to use the swap device or "
17941 "partition named C<device>. The increased memory is made available for all "
17942 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
17947 #: ../src/guestfs-actions.pod:6300 ../fish/guestfish-actions.pod:4229
17949 "Note that you should not swap to existing guest swap partitions unless you "
17950 "know what you are doing. They may contain hibernation information, or other "
17951 "information that the guest doesn't want you to trash. You also risk leaking "
17952 "information about the host to the guest this way. Instead, attach a new "
17953 "host device to the guest and swap on that."
17958 #: ../src/guestfs-actions.pod:6311
17959 msgid "guestfs_swapon_file"
17964 #: ../src/guestfs-actions.pod:6313
17968 " guestfs_swapon_file (guestfs_h *g,\n"
17969 " const char *file);\n"
17975 #: ../src/guestfs-actions.pod:6317
17977 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
17983 #: ../src/guestfs-actions.pod:6324
17984 msgid "guestfs_swapon_label"
17989 #: ../src/guestfs-actions.pod:6326
17993 " guestfs_swapon_label (guestfs_h *g,\n"
17994 " const char *label);\n"
18000 #: ../src/guestfs-actions.pod:6330
18002 "This command enables swap to a labeled swap partition. See "
18003 "C<guestfs_swapon_device> for other notes."
18008 #: ../src/guestfs-actions.pod:6337
18009 msgid "guestfs_swapon_uuid"
18014 #: ../src/guestfs-actions.pod:6339
18018 " guestfs_swapon_uuid (guestfs_h *g,\n"
18019 " const char *uuid);\n"
18025 #: ../src/guestfs-actions.pod:6343
18027 "This command enables swap to a swap partition with the given UUID. See "
18028 "C<guestfs_swapon_device> for other notes."
18033 #: ../src/guestfs-actions.pod:6350
18034 msgid "guestfs_sync"
18039 #: ../src/guestfs-actions.pod:6352
18043 " guestfs_sync (guestfs_h *g);\n"
18049 #: ../src/guestfs-actions.pod:6355 ../fish/guestfish-actions.pod:4261
18051 "This syncs the disk, so that any writes are flushed through to the "
18052 "underlying disk image."
18057 #: ../src/guestfs-actions.pod:6358 ../fish/guestfish-actions.pod:4264
18059 "You should always call this if you have modified a disk image, before "
18060 "closing the handle."
18065 #: ../src/guestfs-actions.pod:6365
18066 msgid "guestfs_tail"
18071 #: ../src/guestfs-actions.pod:6367
18075 " guestfs_tail (guestfs_h *g,\n"
18076 " const char *path);\n"
18082 #: ../src/guestfs-actions.pod:6371 ../fish/guestfish-actions.pod:4271
18084 "This command returns up to the last 10 lines of a file as a list of strings."
18089 #: ../src/guestfs-actions.pod:6383
18090 msgid "guestfs_tail_n"
18095 #: ../src/guestfs-actions.pod:6385
18099 " guestfs_tail_n (guestfs_h *g,\n"
18101 " const char *path);\n"
18107 #: ../src/guestfs-actions.pod:6390 ../fish/guestfish-actions.pod:4281
18109 "If the parameter C<nrlines> is a positive number, this returns the last "
18110 "C<nrlines> lines of the file C<path>."
18115 #: ../src/guestfs-actions.pod:6393 ../fish/guestfish-actions.pod:4284
18117 "If the parameter C<nrlines> is a negative number, this returns lines from "
18118 "the file C<path>, starting with the C<-nrlines>th line."
18123 #: ../src/guestfs-actions.pod:6407
18124 msgid "guestfs_tar_in"
18129 #: ../src/guestfs-actions.pod:6409
18133 " guestfs_tar_in (guestfs_h *g,\n"
18134 " const char *tarfile,\n"
18135 " const char *directory);\n"
18141 #: ../src/guestfs-actions.pod:6414 ../fish/guestfish-actions.pod:4296
18143 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
18144 "tar file) into C<directory>."
18149 #: ../src/guestfs-actions.pod:6417
18151 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
18156 #: ../src/guestfs-actions.pod:6422 ../src/guestfs-actions.pod:6439
18157 #: ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6471
18158 msgid "(Added in 1.0.3)"
18163 #: ../src/guestfs-actions.pod:6424
18164 msgid "guestfs_tar_out"
18169 #: ../src/guestfs-actions.pod:6426
18173 " guestfs_tar_out (guestfs_h *g,\n"
18174 " const char *directory,\n"
18175 " const char *tarfile);\n"
18181 #: ../src/guestfs-actions.pod:6431 ../fish/guestfish-actions.pod:4308
18183 "This command packs the contents of C<directory> and downloads it to local "
18189 #: ../src/guestfs-actions.pod:6434
18191 "To download a compressed tarball, use C<guestfs_tgz_out> or "
18192 "C<guestfs_txz_out>."
18197 #: ../src/guestfs-actions.pod:6441
18198 msgid "guestfs_tgz_in"
18203 #: ../src/guestfs-actions.pod:6443
18207 " guestfs_tgz_in (guestfs_h *g,\n"
18208 " const char *tarball,\n"
18209 " const char *directory);\n"
18215 #: ../src/guestfs-actions.pod:6448 ../fish/guestfish-actions.pod:4320
18217 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
18218 "tar file) into C<directory>."
18223 #: ../src/guestfs-actions.pod:6451
18224 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
18229 #: ../src/guestfs-actions.pod:6457
18230 msgid "guestfs_tgz_out"
18235 #: ../src/guestfs-actions.pod:6459
18239 " guestfs_tgz_out (guestfs_h *g,\n"
18240 " const char *directory,\n"
18241 " const char *tarball);\n"
18247 #: ../src/guestfs-actions.pod:6464 ../fish/guestfish-actions.pod:4331
18249 "This command packs the contents of C<directory> and downloads it to local "
18255 #: ../src/guestfs-actions.pod:6467
18256 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
18261 #: ../src/guestfs-actions.pod:6473
18262 msgid "guestfs_touch"
18267 #: ../src/guestfs-actions.pod:6475
18271 " guestfs_touch (guestfs_h *g,\n"
18272 " const char *path);\n"
18278 #: ../src/guestfs-actions.pod:6479 ../fish/guestfish-actions.pod:4342
18280 "Touch acts like the L<touch(1)> command. It can be used to update the "
18281 "timestamps on a file, or, if the file does not exist, to create a new zero-"
18287 #: ../src/guestfs-actions.pod:6483 ../fish/guestfish-actions.pod:4346
18289 "This command only works on regular files, and will fail on other file types "
18290 "such as directories, symbolic links, block special etc."
18295 #: ../src/guestfs-actions.pod:6490
18296 msgid "guestfs_truncate"
18301 #: ../src/guestfs-actions.pod:6492
18305 " guestfs_truncate (guestfs_h *g,\n"
18306 " const char *path);\n"
18312 #: ../src/guestfs-actions.pod:6496 ../fish/guestfish-actions.pod:4353
18314 "This command truncates C<path> to a zero-length file. The file must exist "
18320 #: ../src/guestfs-actions.pod:6503
18321 msgid "guestfs_truncate_size"
18326 #: ../src/guestfs-actions.pod:6505
18330 " guestfs_truncate_size (guestfs_h *g,\n"
18331 " const char *path,\n"
18332 " int64_t size);\n"
18338 #: ../src/guestfs-actions.pod:6510 ../fish/guestfish-actions.pod:4360
18340 "This command truncates C<path> to size C<size> bytes. The file must exist "
18346 #: ../src/guestfs-actions.pod:6513
18348 "If the current file size is less than C<size> then the file is extended to "
18349 "the required size with zero bytes. This creates a sparse file (ie. disk "
18350 "blocks are not allocated for the file until you write to it). To create a "
18351 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
18356 #: ../src/guestfs-actions.pod:6523
18357 msgid "guestfs_tune2fs_l"
18362 #: ../src/guestfs-actions.pod:6525
18366 " guestfs_tune2fs_l (guestfs_h *g,\n"
18367 " const char *device);\n"
18373 #: ../src/guestfs-actions.pod:6529 ../fish/guestfish-actions.pod:4373
18375 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
18381 #: ../src/guestfs-actions.pod:6532 ../fish/guestfish-actions.pod:4376
18383 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
18384 "for more details. The list of fields returned isn't clearly defined, and "
18385 "depends on both the version of C<tune2fs> that libguestfs was built against, "
18386 "and the filesystem itself."
18391 #: ../src/guestfs-actions.pod:6545
18392 msgid "guestfs_txz_in"
18397 #: ../src/guestfs-actions.pod:6547
18401 " guestfs_txz_in (guestfs_h *g,\n"
18402 " const char *tarball,\n"
18403 " const char *directory);\n"
18409 #: ../src/guestfs-actions.pod:6552 ../fish/guestfish-actions.pod:4385
18411 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
18412 "tar file) into C<directory>."
18417 #: ../src/guestfs-actions.pod:6559
18418 msgid "guestfs_txz_out"
18423 #: ../src/guestfs-actions.pod:6561
18427 " guestfs_txz_out (guestfs_h *g,\n"
18428 " const char *directory,\n"
18429 " const char *tarball);\n"
18435 #: ../src/guestfs-actions.pod:6566 ../fish/guestfish-actions.pod:4394
18437 "This command packs the contents of C<directory> and downloads it to local "
18438 "file C<tarball> (as an xz compressed tar archive)."
18443 #: ../src/guestfs-actions.pod:6573
18444 msgid "guestfs_umask"
18449 #: ../src/guestfs-actions.pod:6575
18453 " guestfs_umask (guestfs_h *g,\n"
18460 #: ../src/guestfs-actions.pod:6579 ../fish/guestfish-actions.pod:4403
18462 "This function sets the mask used for creating new files and device nodes to "
18468 #: ../src/guestfs-actions.pod:6582 ../fish/guestfish-actions.pod:4406
18470 "Typical umask values would be C<022> which creates new files with "
18471 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
18472 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
18477 #: ../src/guestfs-actions.pod:6587 ../fish/guestfish-actions.pod:4411
18479 "The default umask is C<022>. This is important because it means that "
18480 "directories and device nodes will be created with C<0644> or C<0755> mode "
18481 "even if you specify C<0777>."
18486 #: ../src/guestfs-actions.pod:6591
18488 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
18489 "C<guestfs_mkdir>."
18494 #: ../src/guestfs-actions.pod:6594 ../fish/guestfish-actions.pod:4418
18495 msgid "This call returns the previous umask."
18500 #: ../src/guestfs-actions.pod:6600
18501 msgid "guestfs_umount"
18506 #: ../src/guestfs-actions.pod:6602
18510 " guestfs_umount (guestfs_h *g,\n"
18511 " const char *pathordevice);\n"
18517 #: ../src/guestfs-actions.pod:6606 ../fish/guestfish-actions.pod:4426
18519 "This unmounts the given filesystem. The filesystem may be specified either "
18520 "by its mountpoint (path) or the device which contains the filesystem."
18525 #: ../src/guestfs-actions.pod:6614
18526 msgid "guestfs_umount_all"
18531 #: ../src/guestfs-actions.pod:6616
18535 " guestfs_umount_all (guestfs_h *g);\n"
18541 #: ../src/guestfs-actions.pod:6619 ../fish/guestfish-actions.pod:4436
18542 msgid "This unmounts all mounted filesystems."
18547 #: ../src/guestfs-actions.pod:6621 ../fish/guestfish-actions.pod:4438
18548 msgid "Some internal mounts are not unmounted by this call."
18553 #: ../src/guestfs-actions.pod:6627
18554 msgid "guestfs_upload"
18559 #: ../src/guestfs-actions.pod:6629
18563 " guestfs_upload (guestfs_h *g,\n"
18564 " const char *filename,\n"
18565 " const char *remotefilename);\n"
18571 #: ../src/guestfs-actions.pod:6634 ../src/guestfs-actions.pod:6658
18572 #: ../fish/guestfish-actions.pod:4444 ../fish/guestfish-actions.pod:4457
18573 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
18578 #: ../src/guestfs-actions.pod:6639
18579 msgid "See also C<guestfs_download>."
18584 #: ../src/guestfs-actions.pod:6650
18585 msgid "guestfs_upload_offset"
18590 #: ../src/guestfs-actions.pod:6652
18594 " guestfs_upload_offset (guestfs_h *g,\n"
18595 " const char *filename,\n"
18596 " const char *remotefilename,\n"
18597 " int64_t offset);\n"
18603 #: ../src/guestfs-actions.pod:6661 ../fish/guestfish-actions.pod:4460
18605 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
18606 "The intention is to overwrite parts of existing files or devices, although "
18607 "if a non-existant file is specified then it is created with a \"hole\" "
18608 "before C<offset>. The size of the data written is implicit in the size of "
18609 "the source C<filename>."
18614 #: ../src/guestfs-actions.pod:6668
18616 "Note that there is no limit on the amount of data that can be uploaded with "
18617 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
18618 "full amount unless an error occurs."
18623 #: ../src/guestfs-actions.pod:6673
18624 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
18629 #: ../src/guestfs-actions.pod:6684
18630 msgid "guestfs_utimens"
18635 #: ../src/guestfs-actions.pod:6686
18639 " guestfs_utimens (guestfs_h *g,\n"
18640 " const char *path,\n"
18641 " int64_t atsecs,\n"
18642 " int64_t atnsecs,\n"
18643 " int64_t mtsecs,\n"
18644 " int64_t mtnsecs);\n"
18650 #: ../src/guestfs-actions.pod:6694 ../fish/guestfish-actions.pod:4480
18651 msgid "This command sets the timestamps of a file with nanosecond precision."
18656 #: ../src/guestfs-actions.pod:6697 ../fish/guestfish-actions.pod:4483
18658 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
18664 #: ../src/guestfs-actions.pod:6700 ../fish/guestfish-actions.pod:4486
18666 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
18667 "nanoseconds from the epoch."
18672 #: ../src/guestfs-actions.pod:6703 ../fish/guestfish-actions.pod:4489
18674 "If the C<*nsecs> field contains the special value C<-1> then the "
18675 "corresponding timestamp is set to the current time. (The C<*secs> field is "
18676 "ignored in this case)."
18681 #: ../src/guestfs-actions.pod:6707 ../fish/guestfish-actions.pod:4493
18683 "If the C<*nsecs> field contains the special value C<-2> then the "
18684 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
18690 #: ../src/guestfs-actions.pod:6715 ../src/guestfs-structs.pod:175
18691 msgid "guestfs_version"
18696 #: ../src/guestfs-actions.pod:6717
18699 " struct guestfs_version *\n"
18700 " guestfs_version (guestfs_h *g);\n"
18706 #: ../src/guestfs-actions.pod:6720 ../fish/guestfish-actions.pod:4501
18708 "Return the libguestfs version number that the program is linked against."
18713 #: ../src/guestfs-actions.pod:6723 ../fish/guestfish-actions.pod:4504
18715 "Note that because of dynamic linking this is not necessarily the version of "
18716 "libguestfs that you compiled against. You can compile the program, and then "
18717 "at runtime dynamically link against a completely different C<libguestfs.so> "
18723 #: ../src/guestfs-actions.pod:6728 ../fish/guestfish-actions.pod:4509
18725 "This call was added in version C<1.0.58>. In previous versions of "
18726 "libguestfs there was no way to get the version number. From C code you can "
18727 "use dynamic linker functions to find out if this symbol exists (if it "
18728 "doesn't, then it's an earlier version)."
18733 #: ../src/guestfs-actions.pod:6734 ../fish/guestfish-actions.pod:4515
18735 "The call returns a structure with four elements. The first three (C<major>, "
18736 "C<minor> and C<release>) are numbers and correspond to the usual version "
18737 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
18738 "but may be used for distro-specific information."
18743 #: ../src/guestfs-actions.pod:6740 ../fish/guestfish-actions.pod:4521
18745 "To construct the original version string: C<$major.$minor.$release$extra>"
18750 #: ../src/guestfs-actions.pod:6743 ../fish/guestfish-actions.pod:4524
18751 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
18756 #: ../src/guestfs-actions.pod:6745
18758 "I<Note:> Don't use this call to test for availability of features. In "
18759 "enterprise distributions we backport features from later versions into "
18760 "earlier versions, making this an unreliable way to test for features. Use "
18761 "C<guestfs_available> instead."
18766 #: ../src/guestfs-actions.pod:6751
18768 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
18769 "error. I<The caller must call C<guestfs_free_version> after use>."
18774 #: ../src/guestfs-actions.pod:6755
18775 msgid "(Added in 1.0.58)"
18780 #: ../src/guestfs-actions.pod:6757
18781 msgid "guestfs_vfs_label"
18786 #: ../src/guestfs-actions.pod:6759
18790 " guestfs_vfs_label (guestfs_h *g,\n"
18791 " const char *device);\n"
18797 #: ../src/guestfs-actions.pod:6763 ../fish/guestfish-actions.pod:4536
18798 msgid "This returns the filesystem label of the filesystem on C<device>."
18803 #: ../src/guestfs-actions.pod:6766 ../fish/guestfish-actions.pod:4539
18804 msgid "If the filesystem is unlabeled, this returns the empty string."
18809 #: ../src/guestfs-actions.pod:6768
18810 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
18815 #: ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:6810
18816 msgid "(Added in 1.3.18)"
18821 #: ../src/guestfs-actions.pod:6775
18822 msgid "guestfs_vfs_type"
18827 #: ../src/guestfs-actions.pod:6777
18831 " guestfs_vfs_type (guestfs_h *g,\n"
18832 " const char *device);\n"
18838 #: ../src/guestfs-actions.pod:6781 ../fish/guestfish-actions.pod:4547
18840 "This command gets the filesystem type corresponding to the filesystem on "
18846 #: ../src/guestfs-actions.pod:6784 ../fish/guestfish-actions.pod:4550
18848 "For most filesystems, the result is the name of the Linux VFS module which "
18849 "would be used to mount this filesystem if you mounted it without specifying "
18850 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
18855 #: ../src/guestfs-actions.pod:6794
18856 msgid "guestfs_vfs_uuid"
18861 #: ../src/guestfs-actions.pod:6796
18865 " guestfs_vfs_uuid (guestfs_h *g,\n"
18866 " const char *device);\n"
18872 #: ../src/guestfs-actions.pod:6800 ../fish/guestfish-actions.pod:4559
18873 msgid "This returns the filesystem UUID of the filesystem on C<device>."
18878 #: ../src/guestfs-actions.pod:6803 ../fish/guestfish-actions.pod:4562
18879 msgid "If the filesystem does not have a UUID, this returns the empty string."
18884 #: ../src/guestfs-actions.pod:6805
18885 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
18890 #: ../src/guestfs-actions.pod:6812
18891 msgid "guestfs_vg_activate"
18896 #: ../src/guestfs-actions.pod:6814
18900 " guestfs_vg_activate (guestfs_h *g,\n"
18902 " char *const *volgroups);\n"
18908 #: ../src/guestfs-actions.pod:6819 ../fish/guestfish-actions.pod:4570
18910 "This command activates or (if C<activate> is false) deactivates all logical "
18911 "volumes in the listed volume groups C<volgroups>. If activated, then they "
18912 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
18913 "deactivated, then those devices disappear."
18918 #: ../src/guestfs-actions.pod:6825 ../fish/guestfish-actions.pod:4576
18919 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
18924 #: ../src/guestfs-actions.pod:6827 ../fish/guestfish-actions.pod:4578
18926 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
18927 "activated or deactivated."
18932 #: ../src/guestfs-actions.pod:6834
18933 msgid "guestfs_vg_activate_all"
18938 #: ../src/guestfs-actions.pod:6836
18942 " guestfs_vg_activate_all (guestfs_h *g,\n"
18943 " int activate);\n"
18949 #: ../src/guestfs-actions.pod:6840 ../fish/guestfish-actions.pod:4585
18951 "This command activates or (if C<activate> is false) deactivates all logical "
18952 "volumes in all volume groups. If activated, then they are made known to the "
18953 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
18954 "those devices disappear."
18959 #: ../src/guestfs-actions.pod:6846 ../fish/guestfish-actions.pod:4591
18960 msgid "This command is the same as running C<vgchange -a y|n>"
18965 #: ../src/guestfs-actions.pod:6852
18966 msgid "guestfs_vgcreate"
18971 #: ../src/guestfs-actions.pod:6854
18975 " guestfs_vgcreate (guestfs_h *g,\n"
18976 " const char *volgroup,\n"
18977 " char *const *physvols);\n"
18983 #: ../src/guestfs-actions.pod:6859 ../fish/guestfish-actions.pod:4597
18985 "This creates an LVM volume group called C<volgroup> from the non-empty list "
18986 "of physical volumes C<physvols>."
18991 #: ../src/guestfs-actions.pod:6866
18992 msgid "guestfs_vglvuuids"
18997 #: ../src/guestfs-actions.pod:6868
19001 " guestfs_vglvuuids (guestfs_h *g,\n"
19002 " const char *vgname);\n"
19008 #: ../src/guestfs-actions.pod:6872 ../fish/guestfish-actions.pod:4604
19010 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
19011 "volumes created in this volume group."
19016 #: ../src/guestfs-actions.pod:6875
19018 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
19019 "associate logical volumes and volume groups."
19024 #: ../src/guestfs-actions.pod:6878
19025 msgid "See also C<guestfs_vgpvuuids>."
19030 #: ../src/guestfs-actions.pod:6886
19031 msgid "guestfs_vgpvuuids"
19036 #: ../src/guestfs-actions.pod:6888
19040 " guestfs_vgpvuuids (guestfs_h *g,\n"
19041 " const char *vgname);\n"
19047 #: ../src/guestfs-actions.pod:6892 ../fish/guestfish-actions.pod:4616
19049 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
19050 "volumes that this volume group resides on."
19055 #: ../src/guestfs-actions.pod:6895
19057 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
19058 "associate physical volumes and volume groups."
19063 #: ../src/guestfs-actions.pod:6898
19064 msgid "See also C<guestfs_vglvuuids>."
19069 #: ../src/guestfs-actions.pod:6906
19070 msgid "guestfs_vgremove"
19075 #: ../src/guestfs-actions.pod:6908
19079 " guestfs_vgremove (guestfs_h *g,\n"
19080 " const char *vgname);\n"
19086 #: ../src/guestfs-actions.pod:6912 ../fish/guestfish-actions.pod:4628
19087 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
19092 #: ../src/guestfs-actions.pod:6914 ../fish/guestfish-actions.pod:4630
19094 "This also forcibly removes all logical volumes in the volume group (if any)."
19099 #: ../src/guestfs-actions.pod:6921
19100 msgid "guestfs_vgrename"
19105 #: ../src/guestfs-actions.pod:6923
19109 " guestfs_vgrename (guestfs_h *g,\n"
19110 " const char *volgroup,\n"
19111 " const char *newvolgroup);\n"
19117 #: ../src/guestfs-actions.pod:6928 ../fish/guestfish-actions.pod:4637
19118 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
19123 #: ../src/guestfs-actions.pod:6934
19124 msgid "guestfs_vgs"
19129 #: ../src/guestfs-actions.pod:6936
19133 " guestfs_vgs (guestfs_h *g);\n"
19139 #: ../src/guestfs-actions.pod:6939 ../fish/guestfish-actions.pod:4643
19141 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19147 #: ../src/guestfs-actions.pod:6942 ../fish/guestfish-actions.pod:4646
19149 "This returns a list of just the volume group names that were detected (eg. "
19155 #: ../src/guestfs-actions.pod:6945
19156 msgid "See also C<guestfs_vgs_full>."
19161 #: ../src/guestfs-actions.pod:6953
19162 msgid "guestfs_vgs_full"
19167 #: ../src/guestfs-actions.pod:6955
19170 " struct guestfs_lvm_vg_list *\n"
19171 " guestfs_vgs_full (guestfs_h *g);\n"
19177 #: ../src/guestfs-actions.pod:6958 ../fish/guestfish-actions.pod:4655
19179 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19180 "> command. The \"full\" version includes all fields."
19185 #: ../src/guestfs-actions.pod:6961
19187 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
19188 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
19193 #: ../src/guestfs-actions.pod:6967
19194 msgid "guestfs_vgscan"
19199 #: ../src/guestfs-actions.pod:6969
19203 " guestfs_vgscan (guestfs_h *g);\n"
19209 #: ../src/guestfs-actions.pod:6972 ../fish/guestfish-actions.pod:4662
19211 "This rescans all block devices and rebuilds the list of LVM physical "
19212 "volumes, volume groups and logical volumes."
19217 #: ../src/guestfs-actions.pod:6979
19218 msgid "guestfs_vguuid"
19223 #: ../src/guestfs-actions.pod:6981
19227 " guestfs_vguuid (guestfs_h *g,\n"
19228 " const char *vgname);\n"
19234 #: ../src/guestfs-actions.pod:6985 ../fish/guestfish-actions.pod:4669
19235 msgid "This command returns the UUID of the LVM VG named C<vgname>."
19240 #: ../src/guestfs-actions.pod:6992
19241 msgid "guestfs_wait_ready"
19246 #: ../src/guestfs-actions.pod:6994
19250 " guestfs_wait_ready (guestfs_h *g);\n"
19256 #: ../src/guestfs-actions.pod:6997
19257 msgid "This function is a no op."
19262 #: ../src/guestfs-actions.pod:6999
19264 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
19265 "calling C<guestfs_launch> to wait for the launch to complete. However this "
19266 "is no longer necessary because C<guestfs_launch> now does the waiting."
19271 #: ../src/guestfs-actions.pod:7004
19273 "If you see any calls to this function in code then you can just remove them, "
19274 "unless you want to retain compatibility with older versions of the API."
19279 #: ../src/guestfs-actions.pod:7012
19280 msgid "guestfs_wc_c"
19285 #: ../src/guestfs-actions.pod:7014
19289 " guestfs_wc_c (guestfs_h *g,\n"
19290 " const char *path);\n"
19296 #: ../src/guestfs-actions.pod:7018 ../fish/guestfish-actions.pod:4675
19298 "This command counts the characters in a file, using the C<wc -c> external "
19304 #: ../src/guestfs-actions.pod:7025
19305 msgid "guestfs_wc_l"
19310 #: ../src/guestfs-actions.pod:7027
19314 " guestfs_wc_l (guestfs_h *g,\n"
19315 " const char *path);\n"
19321 #: ../src/guestfs-actions.pod:7031 ../fish/guestfish-actions.pod:4682
19323 "This command counts the lines in a file, using the C<wc -l> external command."
19328 #: ../src/guestfs-actions.pod:7038
19329 msgid "guestfs_wc_w"
19334 #: ../src/guestfs-actions.pod:7040
19338 " guestfs_wc_w (guestfs_h *g,\n"
19339 " const char *path);\n"
19345 #: ../src/guestfs-actions.pod:7044 ../fish/guestfish-actions.pod:4689
19347 "This command counts the words in a file, using the C<wc -w> external command."
19352 #: ../src/guestfs-actions.pod:7051
19353 msgid "guestfs_write"
19358 #: ../src/guestfs-actions.pod:7053
19362 " guestfs_write (guestfs_h *g,\n"
19363 " const char *path,\n"
19364 " const char *content,\n"
19365 " size_t content_size);\n"
19371 #: ../src/guestfs-actions.pod:7059 ../fish/guestfish-actions.pod:4696
19373 "This call creates a file called C<path>. The content of the file is the "
19374 "string C<content> (which can contain any 8 bit data)."
19379 #: ../src/guestfs-actions.pod:7069
19380 msgid "guestfs_write_file"
19385 #: ../src/guestfs-actions.pod:7071
19389 " guestfs_write_file (guestfs_h *g,\n"
19390 " const char *path,\n"
19391 " const char *content,\n"
19398 #: ../src/guestfs-actions.pod:7077 ../fish/guestfish-actions.pod:4706
19400 "This call creates a file called C<path>. The contents of the file is the "
19401 "string C<content> (which can contain any 8 bit data), with length C<size>."
19406 #: ../src/guestfs-actions.pod:7081 ../fish/guestfish-actions.pod:4710
19408 "As a special case, if C<size> is C<0> then the length is calculated using "
19409 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
19414 #: ../src/guestfs-actions.pod:7085 ../fish/guestfish-actions.pod:4714
19416 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
19417 "I<not> work, even if the length is specified."
19422 #: ../src/guestfs-actions.pod:7093 ../fish/guestfish-actions.pod:4720
19424 "This function is deprecated. In new code, use the C<write> call instead."
19429 #: ../src/guestfs-actions.pod:7102
19430 msgid "guestfs_zegrep"
19435 #: ../src/guestfs-actions.pod:7104
19439 " guestfs_zegrep (guestfs_h *g,\n"
19440 " const char *regex,\n"
19441 " const char *path);\n"
19447 #: ../src/guestfs-actions.pod:7109 ../fish/guestfish-actions.pod:4731
19449 "This calls the external C<zegrep> program and returns the matching lines."
19454 #: ../src/guestfs-actions.pod:7121
19455 msgid "guestfs_zegrepi"
19460 #: ../src/guestfs-actions.pod:7123
19464 " guestfs_zegrepi (guestfs_h *g,\n"
19465 " const char *regex,\n"
19466 " const char *path);\n"
19472 #: ../src/guestfs-actions.pod:7128 ../fish/guestfish-actions.pod:4741
19474 "This calls the external C<zegrep -i> program and returns the matching lines."
19479 #: ../src/guestfs-actions.pod:7140
19480 msgid "guestfs_zero"
19485 #: ../src/guestfs-actions.pod:7142
19489 " guestfs_zero (guestfs_h *g,\n"
19490 " const char *device);\n"
19496 #: ../src/guestfs-actions.pod:7146 ../fish/guestfish-actions.pod:4751
19497 msgid "This command writes zeroes over the first few blocks of C<device>."
19502 #: ../src/guestfs-actions.pod:7148 ../fish/guestfish-actions.pod:4753
19504 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
19505 "securely wipe the device). It should be sufficient to remove any partition "
19506 "tables, filesystem superblocks and so on."
19511 #: ../src/guestfs-actions.pod:7152
19512 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
19517 #: ../src/guestfs-actions.pod:7163
19518 msgid "guestfs_zero_device"
19523 #: ../src/guestfs-actions.pod:7165
19527 " guestfs_zero_device (guestfs_h *g,\n"
19528 " const char *device);\n"
19534 #: ../src/guestfs-actions.pod:7169
19536 "This command writes zeroes over the entire C<device>. Compare with "
19537 "C<guestfs_zero> which just zeroes the first few blocks of a device."
19542 #: ../src/guestfs-actions.pod:7183
19543 msgid "(Added in 1.3.1)"
19548 #: ../src/guestfs-actions.pod:7185
19549 msgid "guestfs_zerofree"
19554 #: ../src/guestfs-actions.pod:7187
19558 " guestfs_zerofree (guestfs_h *g,\n"
19559 " const char *device);\n"
19565 #: ../src/guestfs-actions.pod:7191 ../fish/guestfish-actions.pod:4774
19567 "This runs the I<zerofree> program on C<device>. This program claims to zero "
19568 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
19569 "possible to compress the filesystem more effectively."
19574 #: ../src/guestfs-actions.pod:7196 ../fish/guestfish-actions.pod:4779
19575 msgid "You should B<not> run this program if the filesystem is mounted."
19580 #: ../src/guestfs-actions.pod:7199 ../fish/guestfish-actions.pod:4782
19582 "It is possible that using this program can damage the filesystem or data on "
19588 #: ../src/guestfs-actions.pod:7206
19589 msgid "guestfs_zfgrep"
19594 #: ../src/guestfs-actions.pod:7208
19598 " guestfs_zfgrep (guestfs_h *g,\n"
19599 " const char *pattern,\n"
19600 " const char *path);\n"
19606 #: ../src/guestfs-actions.pod:7213 ../fish/guestfish-actions.pod:4789
19608 "This calls the external C<zfgrep> program and returns the matching lines."
19613 #: ../src/guestfs-actions.pod:7225
19614 msgid "guestfs_zfgrepi"
19619 #: ../src/guestfs-actions.pod:7227
19623 " guestfs_zfgrepi (guestfs_h *g,\n"
19624 " const char *pattern,\n"
19625 " const char *path);\n"
19631 #: ../src/guestfs-actions.pod:7232 ../fish/guestfish-actions.pod:4799
19633 "This calls the external C<zfgrep -i> program and returns the matching lines."
19638 #: ../src/guestfs-actions.pod:7244
19639 msgid "guestfs_zfile"
19644 #: ../src/guestfs-actions.pod:7246
19648 " guestfs_zfile (guestfs_h *g,\n"
19649 " const char *meth,\n"
19650 " const char *path);\n"
19656 #: ../src/guestfs-actions.pod:7251 ../fish/guestfish-actions.pod:4809
19658 "This command runs C<file> after first decompressing C<path> using C<method>."
19663 #: ../src/guestfs-actions.pod:7254 ../fish/guestfish-actions.pod:4812
19664 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
19669 #: ../src/guestfs-actions.pod:7256
19671 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
19677 #: ../src/guestfs-actions.pod:7262 ../fish/guestfish-actions.pod:4817
19679 "This function is deprecated. In new code, use the C<file> call instead."
19684 #: ../src/guestfs-actions.pod:7271
19685 msgid "guestfs_zgrep"
19690 #: ../src/guestfs-actions.pod:7273
19694 " guestfs_zgrep (guestfs_h *g,\n"
19695 " const char *regex,\n"
19696 " const char *path);\n"
19702 #: ../src/guestfs-actions.pod:7278 ../fish/guestfish-actions.pod:4828
19704 "This calls the external C<zgrep> program and returns the matching lines."
19709 #: ../src/guestfs-actions.pod:7290
19710 msgid "guestfs_zgrepi"
19715 #: ../src/guestfs-actions.pod:7292
19719 " guestfs_zgrepi (guestfs_h *g,\n"
19720 " const char *regex,\n"
19721 " const char *path);\n"
19727 #: ../src/guestfs-actions.pod:7297 ../fish/guestfish-actions.pod:4838
19729 "This calls the external C<zgrep -i> program and returns the matching lines."
19734 #: ../src/guestfs-availability.pod:3
19740 #: ../src/guestfs-availability.pod:5
19742 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
19743 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
19744 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
19745 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
19746 "L</guestfs_aug_save> L</guestfs_aug_set>"
19751 #: ../src/guestfs-availability.pod:21
19757 #: ../src/guestfs-availability.pod:23
19759 "The following functions: L</guestfs_inotify_add_watch> L</"
19760 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
19761 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
19766 #: ../src/guestfs-availability.pod:31
19767 msgid "B<linuxfsuuid>"
19772 #: ../src/guestfs-availability.pod:33
19774 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
19775 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
19780 #: ../src/guestfs-availability.pod:40
19781 msgid "B<linuxmodules>"
19786 #: ../src/guestfs-availability.pod:42
19787 msgid "The following functions: L</guestfs_modprobe>"
19792 #: ../src/guestfs-availability.pod:45
19793 msgid "B<linuxxattrs>"
19798 #: ../src/guestfs-availability.pod:47
19800 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
19801 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
19802 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
19803 "guestfs_setxattr>"
19808 #: ../src/guestfs-availability.pod:58
19814 #: ../src/guestfs-availability.pod:60
19816 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
19817 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
19818 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
19823 #: ../src/guestfs-availability.pod:69
19829 #: ../src/guestfs-availability.pod:71
19831 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
19832 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
19833 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
19834 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
19835 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
19836 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
19837 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
19842 #: ../src/guestfs-availability.pod:94
19848 #: ../src/guestfs-availability.pod:96
19850 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
19851 "guestfs_mknod_b> L</guestfs_mknod_c>"
19856 #: ../src/guestfs-availability.pod:102
19862 #: ../src/guestfs-availability.pod:104
19863 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
19868 #: ../src/guestfs-availability.pod:107
19869 msgid "B<ntfsprogs>"
19874 #: ../src/guestfs-availability.pod:109
19876 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
19881 #: ../src/guestfs-availability.pod:113
19882 msgid "B<realpath>"
19887 #: ../src/guestfs-availability.pod:115
19888 msgid "The following functions: L</guestfs_realpath>"
19893 #: ../src/guestfs-availability.pod:118
19899 #: ../src/guestfs-availability.pod:120
19901 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
19902 "guestfs_scrub_freespace>"
19907 #: ../src/guestfs-availability.pod:125
19913 #: ../src/guestfs-availability.pod:127
19914 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
19919 #: ../src/guestfs-availability.pod:131
19925 #: ../src/guestfs-availability.pod:133
19926 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
19931 #: ../src/guestfs-availability.pod:137
19932 msgid "B<zerofree>"
19937 #: ../src/guestfs-availability.pod:139
19938 msgid "The following functions: L</guestfs_zerofree>"
19943 #: ../src/guestfs-structs.pod:1
19944 msgid "guestfs_int_bool"
19949 #: ../src/guestfs-structs.pod:3
19952 " struct guestfs_int_bool {\n"
19961 #: ../src/guestfs-structs.pod:8
19964 " struct guestfs_int_bool_list {\n"
19965 " uint32_t len; /* Number of elements in list. */\n"
19966 " struct guestfs_int_bool *val; /* Elements. */\n"
19973 #: ../src/guestfs-structs.pod:13
19976 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
19977 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
19983 #: ../src/guestfs-structs.pod:16
19984 msgid "guestfs_lvm_pv"
19989 #: ../src/guestfs-structs.pod:18
19992 " struct guestfs_lvm_pv {\n"
19993 " char *pv_name;\n"
19994 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
19995 " char pv_uuid[32];\n"
19997 " uint64_t pv_size;\n"
19998 " uint64_t dev_size;\n"
19999 " uint64_t pv_free;\n"
20000 " uint64_t pv_used;\n"
20001 " char *pv_attr;\n"
20002 " int64_t pv_pe_count;\n"
20003 " int64_t pv_pe_alloc_count;\n"
20004 " char *pv_tags;\n"
20005 " uint64_t pe_start;\n"
20006 " int64_t pv_mda_count;\n"
20007 " uint64_t pv_mda_free;\n"
20014 #: ../src/guestfs-structs.pod:36
20017 " struct guestfs_lvm_pv_list {\n"
20018 " uint32_t len; /* Number of elements in list. */\n"
20019 " struct guestfs_lvm_pv *val; /* Elements. */\n"
20026 #: ../src/guestfs-structs.pod:41
20029 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
20030 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
20036 #: ../src/guestfs-structs.pod:44
20037 msgid "guestfs_lvm_vg"
20042 #: ../src/guestfs-structs.pod:46
20045 " struct guestfs_lvm_vg {\n"
20046 " char *vg_name;\n"
20047 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20048 " char vg_uuid[32];\n"
20050 " char *vg_attr;\n"
20051 " uint64_t vg_size;\n"
20052 " uint64_t vg_free;\n"
20053 " char *vg_sysid;\n"
20054 " uint64_t vg_extent_size;\n"
20055 " int64_t vg_extent_count;\n"
20056 " int64_t vg_free_count;\n"
20057 " int64_t max_lv;\n"
20058 " int64_t max_pv;\n"
20059 " int64_t pv_count;\n"
20060 " int64_t lv_count;\n"
20061 " int64_t snap_count;\n"
20062 " int64_t vg_seqno;\n"
20063 " char *vg_tags;\n"
20064 " int64_t vg_mda_count;\n"
20065 " uint64_t vg_mda_free;\n"
20072 #: ../src/guestfs-structs.pod:69
20075 " struct guestfs_lvm_vg_list {\n"
20076 " uint32_t len; /* Number of elements in list. */\n"
20077 " struct guestfs_lvm_vg *val; /* Elements. */\n"
20084 #: ../src/guestfs-structs.pod:74
20087 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
20088 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
20094 #: ../src/guestfs-structs.pod:77
20095 msgid "guestfs_lvm_lv"
20100 #: ../src/guestfs-structs.pod:79
20103 " struct guestfs_lvm_lv {\n"
20104 " char *lv_name;\n"
20105 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20106 " char lv_uuid[32];\n"
20107 " char *lv_attr;\n"
20108 " int64_t lv_major;\n"
20109 " int64_t lv_minor;\n"
20110 " int64_t lv_kernel_major;\n"
20111 " int64_t lv_kernel_minor;\n"
20112 " uint64_t lv_size;\n"
20113 " int64_t seg_count;\n"
20115 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20116 " float snap_percent;\n"
20117 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20118 " float copy_percent;\n"
20119 " char *move_pv;\n"
20120 " char *lv_tags;\n"
20121 " char *mirror_log;\n"
20122 " char *modules;\n"
20129 #: ../src/guestfs-structs.pod:101
20132 " struct guestfs_lvm_lv_list {\n"
20133 " uint32_t len; /* Number of elements in list. */\n"
20134 " struct guestfs_lvm_lv *val; /* Elements. */\n"
20141 #: ../src/guestfs-structs.pod:106
20144 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
20145 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
20151 #: ../src/guestfs-structs.pod:111
20154 " struct guestfs_stat {\n"
20158 " int64_t nlink;\n"
20163 " int64_t blksize;\n"
20164 " int64_t blocks;\n"
20165 " int64_t atime;\n"
20166 " int64_t mtime;\n"
20167 " int64_t ctime;\n"
20174 #: ../src/guestfs-structs.pod:127
20177 " struct guestfs_stat_list {\n"
20178 " uint32_t len; /* Number of elements in list. */\n"
20179 " struct guestfs_stat *val; /* Elements. */\n"
20186 #: ../src/guestfs-structs.pod:132
20189 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
20190 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
20196 #: ../src/guestfs-structs.pod:137
20199 " struct guestfs_statvfs {\n"
20200 " int64_t bsize;\n"
20201 " int64_t frsize;\n"
20202 " int64_t blocks;\n"
20203 " int64_t bfree;\n"
20204 " int64_t bavail;\n"
20205 " int64_t files;\n"
20206 " int64_t ffree;\n"
20207 " int64_t favail;\n"
20210 " int64_t namemax;\n"
20217 #: ../src/guestfs-structs.pod:151
20220 " struct guestfs_statvfs_list {\n"
20221 " uint32_t len; /* Number of elements in list. */\n"
20222 " struct guestfs_statvfs *val; /* Elements. */\n"
20229 #: ../src/guestfs-structs.pod:156
20232 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
20233 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
20239 #: ../src/guestfs-structs.pod:159
20240 msgid "guestfs_dirent"
20245 #: ../src/guestfs-structs.pod:161
20248 " struct guestfs_dirent {\n"
20258 #: ../src/guestfs-structs.pod:167
20261 " struct guestfs_dirent_list {\n"
20262 " uint32_t len; /* Number of elements in list. */\n"
20263 " struct guestfs_dirent *val; /* Elements. */\n"
20270 #: ../src/guestfs-structs.pod:172
20273 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
20274 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
20280 #: ../src/guestfs-structs.pod:177
20283 " struct guestfs_version {\n"
20284 " int64_t major;\n"
20285 " int64_t minor;\n"
20286 " int64_t release;\n"
20294 #: ../src/guestfs-structs.pod:184
20297 " struct guestfs_version_list {\n"
20298 " uint32_t len; /* Number of elements in list. */\n"
20299 " struct guestfs_version *val; /* Elements. */\n"
20306 #: ../src/guestfs-structs.pod:189
20309 " void guestfs_free_version (struct guestfs_free_version *);\n"
20310 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
20316 #: ../src/guestfs-structs.pod:192
20317 msgid "guestfs_xattr"
20322 #: ../src/guestfs-structs.pod:194
20325 " struct guestfs_xattr {\n"
20326 " char *attrname;\n"
20327 " /* The next two fields describe a byte array. */\n"
20328 " uint32_t attrval_len;\n"
20329 " char *attrval;\n"
20336 #: ../src/guestfs-structs.pod:201
20339 " struct guestfs_xattr_list {\n"
20340 " uint32_t len; /* Number of elements in list. */\n"
20341 " struct guestfs_xattr *val; /* Elements. */\n"
20348 #: ../src/guestfs-structs.pod:206
20351 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
20352 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
20358 #: ../src/guestfs-structs.pod:209
20359 msgid "guestfs_inotify_event"
20364 #: ../src/guestfs-structs.pod:211
20367 " struct guestfs_inotify_event {\n"
20368 " int64_t in_wd;\n"
20369 " uint32_t in_mask;\n"
20370 " uint32_t in_cookie;\n"
20371 " char *in_name;\n"
20378 #: ../src/guestfs-structs.pod:218
20381 " struct guestfs_inotify_event_list {\n"
20382 " uint32_t len; /* Number of elements in list. */\n"
20383 " struct guestfs_inotify_event *val; /* Elements. */\n"
20390 #: ../src/guestfs-structs.pod:223
20393 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
20394 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
20400 #: ../src/guestfs-structs.pod:226
20401 msgid "guestfs_partition"
20406 #: ../src/guestfs-structs.pod:228
20409 " struct guestfs_partition {\n"
20410 " int32_t part_num;\n"
20411 " uint64_t part_start;\n"
20412 " uint64_t part_end;\n"
20413 " uint64_t part_size;\n"
20420 #: ../src/guestfs-structs.pod:235
20423 " struct guestfs_partition_list {\n"
20424 " uint32_t len; /* Number of elements in list. */\n"
20425 " struct guestfs_partition *val; /* Elements. */\n"
20432 #: ../src/guestfs-structs.pod:240
20435 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
20436 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
20442 #: ../src/guestfs-structs.pod:243
20443 msgid "guestfs_application"
20448 #: ../src/guestfs-structs.pod:245
20451 " struct guestfs_application {\n"
20452 " char *app_name;\n"
20453 " char *app_display_name;\n"
20454 " int32_t app_epoch;\n"
20455 " char *app_version;\n"
20456 " char *app_release;\n"
20457 " char *app_install_path;\n"
20458 " char *app_trans_path;\n"
20459 " char *app_publisher;\n"
20460 " char *app_url;\n"
20461 " char *app_source_package;\n"
20462 " char *app_summary;\n"
20463 " char *app_description;\n"
20470 #: ../src/guestfs-structs.pod:260
20473 " struct guestfs_application_list {\n"
20474 " uint32_t len; /* Number of elements in list. */\n"
20475 " struct guestfs_application *val; /* Elements. */\n"
20482 #: ../src/guestfs-structs.pod:265
20485 " void guestfs_free_application (struct guestfs_free_application *);\n"
20486 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
20492 #: ../fish/guestfish.pod:5
20493 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
20498 #: ../fish/guestfish.pod:9
20501 " guestfish [--options] [commands]\n"
20507 #: ../fish/guestfish.pod:11
20516 #: ../fish/guestfish.pod:13
20519 " guestfish [--ro|--rw] -a disk.img\n"
20525 #: ../fish/guestfish.pod:15
20528 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
20534 #: ../fish/guestfish.pod:17
20537 " guestfish -d libvirt-domain\n"
20543 #: ../fish/guestfish.pod:19
20546 " guestfish [--ro|--rw] -a disk.img -i\n"
20552 #: ../fish/guestfish.pod:21
20555 " guestfish -d libvirt-domain -i\n"
20561 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
20562 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
20568 #: ../fish/guestfish.pod:25
20570 "Using guestfish in read/write mode on live virtual machines can be "
20571 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
20572 "option to use guestfish safely if the disk image or virtual machine might be "
20578 #: ../fish/guestfish.pod:32
20580 "Guestfish is a shell and command-line tool for examining and modifying "
20581 "virtual machine filesystems. It uses libguestfs and exposes all of the "
20582 "functionality of the guestfs API, see L<guestfs(3)>."
20587 #: ../fish/guestfish.pod:36
20589 "Guestfish gives you structured access to the libguestfs API, from shell "
20590 "scripts or the command line or interactively. If you want to rescue a "
20591 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
20597 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:923
20598 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
20599 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:50
20605 #: ../fish/guestfish.pod:43
20606 msgid "As an interactive shell"
20611 #: ../fish/guestfish.pod:45
20620 #: ../fish/guestfish.pod:47
20623 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
20624 " editing virtual machine filesystems.\n"
20630 #: ../fish/guestfish.pod:50
20633 " Type: 'help' for a list of commands\n"
20634 " 'man' to read the manual\n"
20635 " 'quit' to quit the shell\n"
20641 #: ../fish/guestfish.pod:54
20644 " ><fs> add-ro disk.img\n"
20646 " ><fs> list-filesystems\n"
20647 " /dev/sda1: ext4\n"
20648 " /dev/vg_guest/lv_root: ext4\n"
20649 " /dev/vg_guest/lv_swap: swap\n"
20650 " ><fs> mount /dev/vg_guest/lv_root /\n"
20651 " ><fs> cat /etc/fstab\n"
20653 " # Created by anaconda\n"
20661 #: ../fish/guestfish.pod:67
20662 msgid "From shell scripts"
20667 #: ../fish/guestfish.pod:69
20668 msgid "Create a new C</etc/motd> file in a guest or disk image:"
20673 #: ../fish/guestfish.pod:71
20676 " guestfish <<_EOF_\n"
20679 " mount /dev/vg_guest/lv_root /\n"
20680 " write /etc/motd \"Welcome, new users\"\n"
20687 #: ../fish/guestfish.pod:78
20688 msgid "List the LVM logical volumes in a disk image:"
20693 #: ../fish/guestfish.pod:80
20696 " guestfish -a disk.img --ro <<_EOF_\n"
20705 #: ../fish/guestfish.pod:85
20706 msgid "List all the filesystems in a disk image:"
20711 #: ../fish/guestfish.pod:87
20714 " guestfish -a disk.img --ro <<_EOF_\n"
20716 " list-filesystems\n"
20723 #: ../fish/guestfish.pod:92
20724 msgid "On one command line"
20729 #: ../fish/guestfish.pod:94
20730 msgid "Update C</etc/resolv.conf> in a guest:"
20735 #: ../fish/guestfish.pod:96
20739 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
20740 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
20746 #: ../fish/guestfish.pod:100
20747 msgid "Edit C</boot/grub/grub.conf> interactively:"
20752 #: ../fish/guestfish.pod:102
20755 " guestfish --rw --add disk.img \\\n"
20756 " --mount /dev/vg_guest/lv_root \\\n"
20757 " --mount /dev/sda1:/boot \\\n"
20758 " edit /boot/grub/grub.conf\n"
20764 #: ../fish/guestfish.pod:107
20765 msgid "Mount disks automatically"
20770 #: ../fish/guestfish.pod:109
20772 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
20777 #: ../fish/guestfish.pod:112
20780 " guestfish --ro -a disk.img -i cat /etc/group\n"
20786 #: ../fish/guestfish.pod:114
20789 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
20795 #: ../fish/guestfish.pod:116
20796 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
20801 #: ../fish/guestfish.pod:118
20804 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
20810 #: ../fish/guestfish.pod:120
20811 msgid "As a script interpreter"
20816 #: ../fish/guestfish.pod:122
20817 msgid "Create a 100MB disk containing an ext2-formatted partition:"
20822 #: ../fish/guestfish.pod:124
20825 " #!/usr/bin/guestfish -f\n"
20826 " sparse test1.img 100M\n"
20828 " part-disk /dev/sda mbr\n"
20829 " mkfs ext2 /dev/sda1\n"
20835 #: ../fish/guestfish.pod:130
20836 msgid "Start with a prepared disk"
20841 #: ../fish/guestfish.pod:132
20843 "An alternate way to create a 100MB disk called C<test1.img> containing a "
20844 "single ext2-formatted partition:"
20849 #: ../fish/guestfish.pod:135
20852 " guestfish -N fs\n"
20858 #: ../fish/guestfish.pod:137
20859 msgid "To list what is available do:"
20864 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:914
20867 " guestfish -N help | less\n"
20873 #: ../fish/guestfish.pod:141
20874 msgid "Remote control"
20879 #: ../fish/guestfish.pod:143
20882 " eval \"`guestfish --listen`\"\n"
20883 " guestfish --remote add-ro disk.img\n"
20884 " guestfish --remote run\n"
20885 " guestfish --remote lvs\n"
20891 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
20892 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
20893 #: ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254
20894 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103
20895 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
20901 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
20902 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104
20903 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
20904 #: ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161
20905 #: ../tools/virt-list-partitions.pl:62
20911 #: ../fish/guestfish.pod:154
20912 msgid "Displays general help on options."
20917 #: ../fish/guestfish.pod:156
20923 #: ../fish/guestfish.pod:158
20924 msgid "B<--cmd-help>"
20929 #: ../fish/guestfish.pod:160
20930 msgid "Lists all available guestfish commands."
20935 #: ../fish/guestfish.pod:162
20941 #: ../fish/guestfish.pod:164
20942 msgid "B<--cmd-help cmd>"
20947 #: ../fish/guestfish.pod:166
20948 msgid "Displays detailed help on a single command C<cmd>."
20953 #: ../fish/guestfish.pod:168
20954 msgid "B<-a image>"
20959 #: ../fish/guestfish.pod:170
20960 msgid "B<--add image>"
20965 #: ../fish/guestfish.pod:172
20966 msgid "Add a block device or virtual machine image to the shell."
20971 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
20973 "The format of the disk image is auto-detected. To override this and force a "
20974 "particular format use the I<--format=..> option."
20979 #: ../fish/guestfish.pod:177
20981 "Using this flag is mostly equivalent to using the C<add> command, with "
20982 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
20983 "the I<--format:...> flag was given."
20988 #: ../fish/guestfish.pod:181
20994 #: ../fish/guestfish.pod:183
20995 msgid "B<--connect URI>"
21000 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
21002 "When used in conjunction with the I<-d> option, this specifies the libvirt "
21003 "URI to use. The default is to use the default libvirt connection."
21008 #: ../fish/guestfish.pod:189
21014 #: ../fish/guestfish.pod:191
21016 "If using the I<--listen> option and a csh-like shell, use this option. See "
21017 "section L</REMOTE CONTROL AND CSH> below."
21022 #: ../fish/guestfish.pod:194
21023 msgid "B<-d libvirt-domain>"
21028 #: ../fish/guestfish.pod:196
21029 msgid "B<--domain libvirt-domain>"
21034 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
21036 "Add disks from the named libvirt domain. If the I<--ro> option is also "
21037 "used, then any libvirt domain can be used. However in write mode, only "
21038 "libvirt domains which are shut down can be named here."
21043 #: ../fish/guestfish.pod:202
21045 "Using this flag is mostly equivalent to using the C<add-domain> command, "
21046 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
21047 "if the I<--format:...> flag was given."
21052 #: ../fish/guestfish.pod:206
21058 #: ../fish/guestfish.pod:208
21059 msgid "B<--no-dest-paths>"
21064 #: ../fish/guestfish.pod:210
21066 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
21067 "to hit the tab key to complete paths on the guest filesystem, but this "
21068 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
21069 "allow this feature to be disabled."
21074 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
21075 msgid "B<--echo-keys>"
21080 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
21082 "When prompting for keys and passphrases, guestfish normally turns echoing "
21083 "off so you cannot see what you are typing. If you are not worried about "
21084 "Tempest attacks and there is no one else in the room you can specify this "
21085 "flag to see what you are typing."
21090 #: ../fish/guestfish.pod:222
21096 #: ../fish/guestfish.pod:224
21097 msgid "B<--file file>"
21102 #: ../fish/guestfish.pod:226
21103 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
21108 #: ../fish/guestfish.pod:229
21111 " #!/usr/bin/guestfish -f\n"
21117 #: ../fish/guestfish.pod:231
21118 msgid "B<--format=raw|qcow2|..>"
21123 #: ../fish/guestfish.pod:233
21124 msgid "B<--format>"
21129 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
21131 "The default for the I<-a> option is to auto-detect the format of the disk "
21132 "image. Using this forces the disk format for I<-a> options which follow on "
21133 "the command line. Using I<--format> with no argument switches back to auto-"
21134 "detection for subsequent I<-a> options."
21139 #: ../fish/guestfish.pod:242
21142 " guestfish --format=raw -a disk.img\n"
21148 #: ../fish/guestfish.pod:244
21149 msgid "forces raw format (no auto-detection) for C<disk.img>."
21154 #: ../fish/guestfish.pod:246
21157 " guestfish --format=raw -a disk.img --format -a another.img\n"
21163 #: ../fish/guestfish.pod:248
21165 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
21166 "detection for C<another.img>."
21171 #: ../fish/guestfish.pod:251
21173 "If you have untrusted raw-format guest disk images, you should use this "
21174 "option to specify the disk format. This avoids a possible security problem "
21175 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
21180 #: ../fish/guestfish.pod:256
21186 #: ../fish/guestfish.pod:258
21187 msgid "B<--inspector>"
21192 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
21194 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
21195 "system and mount filesystems as they would be mounted on the real virtual "
21201 #: ../fish/guestfish.pod:264
21202 msgid "Typical usage is either:"
21207 #: ../fish/guestfish.pod:266
21210 " guestfish -d myguest -i\n"
21216 #: ../fish/guestfish.pod:268
21217 msgid "(for an inactive libvirt domain called I<myguest>), or:"
21222 #: ../fish/guestfish.pod:270
21225 " guestfish --ro -d myguest -i\n"
21231 #: ../fish/guestfish.pod:272
21232 msgid "(for active domains, readonly), or specify the block device directly:"
21237 #: ../fish/guestfish.pod:274
21240 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
21246 #: ../fish/guestfish.pod:276
21248 "Note that the command line syntax changed slightly over older versions of "
21249 "guestfish. You can still use the old syntax:"
21254 #: ../fish/guestfish.pod:279
21257 " guestfish [--ro] -i disk.img\n"
21263 #: ../fish/guestfish.pod:281
21266 " guestfish [--ro] -i libvirt-domain\n"
21272 #: ../fish/guestfish.pod:283
21274 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
21275 "then using other commands to mount the filesystems that were found."
21280 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
21281 msgid "B<--keys-from-stdin>"
21286 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
21288 "Read key or passphrase parameters from stdin. The default is to try to read "
21289 "passphrases from the user by opening C</dev/tty>."
21294 #: ../fish/guestfish.pod:292
21295 msgid "B<--listen>"
21300 #: ../fish/guestfish.pod:294
21302 "Fork into the background and listen for remote commands. See section L</"
21303 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
21308 #: ../fish/guestfish.pod:297
21309 msgid "B<-m dev[:mountpoint]>"
21314 #: ../fish/guestfish.pod:299
21315 msgid "B<--mount dev[:mountpoint]>"
21320 #: ../fish/guestfish.pod:301
21321 msgid "Mount the named partition or logical volume on the given mountpoint."
21326 #: ../fish/guestfish.pod:303
21327 msgid "If the mountpoint is omitted, it defaults to C</>."
21332 #: ../fish/guestfish.pod:305
21333 msgid "You have to mount something on C</> before most commands will work."
21338 #: ../fish/guestfish.pod:307
21340 "If any I<-m> or I<--mount> options are given, the guest is automatically "
21346 #: ../fish/guestfish.pod:310
21348 "If you don't know what filesystems a disk image contains, you can either run "
21349 "guestfish without this option, then list the partitions, filesystems and LVs "
21350 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
21351 "commands), or you can use the L<virt-filesystems(1)> program."
21356 #: ../fish/guestfish.pod:316
21358 "Using this flag is mostly equivalent to using the C<mount-options> command "
21359 "or the C<mount-ro> command if the I<--ro> flag was given."
21364 #: ../fish/guestfish.pod:319
21370 #: ../fish/guestfish.pod:321
21371 msgid "B<--no-sync>"
21376 #: ../fish/guestfish.pod:323
21378 "Disable autosync. This is enabled by default. See the discussion of "
21379 "autosync in the L<guestfs(3)> manpage."
21384 #: ../fish/guestfish.pod:326
21390 #: ../fish/guestfish.pod:328
21391 msgid "B<--new type>"
21396 #: ../fish/guestfish.pod:330
21402 #: ../fish/guestfish.pod:332
21404 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
21405 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
21406 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
21412 #: ../fish/guestfish.pod:337
21413 msgid "B<--progress-bars>"
21418 #: ../fish/guestfish.pod:339
21419 msgid "Enable progress bars, even when guestfish is used non-interactively."
21424 #: ../fish/guestfish.pod:341
21426 "Progress bars are enabled by default when guestfish is used as an "
21427 "interactive shell."
21432 #: ../fish/guestfish.pod:344
21433 msgid "B<--no-progress-bars>"
21438 #: ../fish/guestfish.pod:346
21439 msgid "Disable progress bars."
21444 #: ../fish/guestfish.pod:348
21445 msgid "B<--remote[=pid]>"
21450 #: ../fish/guestfish.pod:350
21452 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
21453 "CONTROL GUESTFISH OVER A SOCKET> below."
21458 #: ../fish/guestfish.pod:353
21464 #: ../fish/guestfish.pod:355
21470 #: ../fish/guestfish.pod:357
21472 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
21473 "mounts are done read-only."
21478 #: ../fish/guestfish.pod:360
21480 "The option must always be used if the disk image or virtual machine might be "
21481 "running, and is generally recommended in cases where you don't need write "
21482 "access to the disk."
21487 #: ../fish/guestfish.pod:364
21489 "Note that prepared disk images created with I<-N> are not affected by this "
21490 "option. Also commands like C<add> are not affected - you have to specify "
21491 "the C<readonly:true> option explicitly if you need it."
21496 #: ../fish/guestfish.pod:368
21497 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
21502 #: ../fish/guestfish.pod:370 ../fuse/guestmount.pod:208
21503 msgid "B<--selinux>"
21508 #: ../fish/guestfish.pod:372
21509 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
21514 #: ../fish/guestfish.pod:374
21520 #: ../fish/guestfish.pod:376
21521 msgid "B<--verbose>"
21526 #: ../fish/guestfish.pod:378
21528 "Enable very verbose messages. This is particularly useful if you find a bug."
21533 #: ../fish/guestfish.pod:381
21539 #: ../fish/guestfish.pod:383 ../tools/virt-edit.pl:88
21540 #: ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270
21541 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119
21542 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
21543 msgid "B<--version>"
21548 #: ../fish/guestfish.pod:385
21549 msgid "Display the guestfish / libguestfs version number and exit."
21554 #: ../fish/guestfish.pod:387
21560 #: ../fish/guestfish.pod:389
21566 #: ../fish/guestfish.pod:391
21568 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
21574 #: ../fish/guestfish.pod:394
21580 #: ../fish/guestfish.pod:396
21581 msgid "Echo each command before executing it."
21586 #: ../fish/guestfish.pod:400
21587 msgid "COMMANDS ON COMMAND LINE"
21592 #: ../fish/guestfish.pod:402
21594 "Any additional (non-option) arguments are treated as commands to execute."
21599 #: ../fish/guestfish.pod:405
21601 "Commands to execute should be separated by a colon (C<:>), where the colon "
21602 "is a separate parameter. Thus:"
21607 #: ../fish/guestfish.pod:408
21610 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
21616 #: ../fish/guestfish.pod:410
21618 "If there are no additional arguments, then we enter a shell, either an "
21619 "interactive shell with a prompt (if the input is a terminal) or a non-"
21620 "interactive shell."
21625 #: ../fish/guestfish.pod:414
21627 "In either command line mode or non-interactive shell, the first command that "
21628 "gives an error causes the whole shell to exit. In interactive mode (with a "
21629 "prompt) if a command fails, you can continue to enter commands."
21634 #: ../fish/guestfish.pod:419
21635 msgid "USING launch (OR run)"
21640 #: ../fish/guestfish.pod:421
21642 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
21643 "then launch it, then mount any disks you need, and finally issue actions/"
21644 "commands. So the general order of the day is:"
21649 #: ../fish/guestfish.pod:429
21650 msgid "add or -a/--add"
21655 #: ../fish/guestfish.pod:433
21656 msgid "launch (aka run)"
21661 #: ../fish/guestfish.pod:437
21662 msgid "mount or -m/--mount"
21667 #: ../fish/guestfish.pod:441
21668 msgid "any other commands"
21673 #: ../fish/guestfish.pod:445
21675 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
21676 "guest before mounting or performing any other commands."
21681 #: ../fish/guestfish.pod:448
21683 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
21684 "I<--new> options were given then C<run> is done automatically, simply "
21685 "because guestfish can't perform the action you asked for without doing this."
21690 #: ../fish/guestfish.pod:453
21691 msgid "OPENING DISKS FOR READ AND WRITE"
21696 #: ../fish/guestfish.pod:455
21698 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
21699 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
21700 "open disk images read-only or for writing."
21705 #: ../fish/guestfish.pod:459
21707 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
21708 "disk images supplied on the command line for write. To open a disk image "
21709 "read-only you have to do I<-a image --ro>."
21714 #: ../fish/guestfish.pod:463
21716 "This matters: If you accidentally open a live VM disk image writable then "
21717 "you will cause irreversible disk corruption."
21721 #: ../fish/guestfish.pod:466
21723 "By libguestfs 1.10 we intend to change the default the other way. Disk "
21724 "images will be opened read-only. You will have to either specify "
21725 "I<guestfish --rw> or change a configuration file in order to get write "
21726 "access for disk images specified by those other command line options."
21731 #: ../fish/guestfish.pod:471
21733 "This version of guestfish has a I<--rw> option which does nothing (it is "
21734 "already the default). However it is highly recommended that you use this "
21735 "option to indicate that guestfish needs write access, and to prepare your "
21736 "scripts for the day when this option will be required for write access."
21741 #: ../fish/guestfish.pod:477
21743 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
21744 "other libguestfs program apart from guestfish and guestmount."
21749 #: ../fish/guestfish.pod:480
21755 #: ../fish/guestfish.pod:482
21757 "You can quote ordinary parameters using either single or double quotes. For "
21763 #: ../fish/guestfish.pod:485
21766 " add \"file with a space.img\"\n"
21772 #: ../fish/guestfish.pod:487
21775 " rm '/file name'\n"
21781 #: ../fish/guestfish.pod:489
21790 #: ../fish/guestfish.pod:491
21792 "A few commands require a list of strings to be passed. For these, use a "
21793 "whitespace-separated list, enclosed in quotes. Strings containing "
21794 "whitespace to be passed through must be enclosed in single quotes. A "
21795 "literal single quote must be escaped with a backslash."
21800 #: ../fish/guestfish.pod:496
21803 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
21804 " command \"/bin/echo 'foo bar'\"\n"
21805 " command \"/bin/echo \\'foo\\'\"\n"
21811 #: ../fish/guestfish.pod:500
21812 msgid "OPTIONAL ARGUMENTS"
21817 #: ../fish/guestfish.pod:502
21819 "Some commands take optional arguments. These arguments appear in this "
21820 "documentation as C<[argname:..]>. You can use them as in these examples:"
21825 #: ../fish/guestfish.pod:506
21828 " add-drive-opts filename\n"
21834 #: ../fish/guestfish.pod:508
21837 " add-drive-opts filename readonly:true\n"
21843 #: ../fish/guestfish.pod:510
21846 " add-drive-opts filename format:qcow2 readonly:false\n"
21852 #: ../fish/guestfish.pod:512
21854 "Each optional argument can appear at most once. All optional arguments must "
21855 "appear after the required ones."
21860 #: ../fish/guestfish.pod:515
21866 #: ../fish/guestfish.pod:517
21868 "This section applies to all commands which can take integers as parameters."
21873 #: ../fish/guestfish.pod:520
21874 msgid "SIZE SUFFIX"
21879 #: ../fish/guestfish.pod:522
21881 "When the command takes a parameter measured in bytes, you can use one of the "
21882 "following suffixes to specify kilobytes, megabytes and larger sizes:"
21887 #: ../fish/guestfish.pod:528
21888 msgid "B<k> or B<K> or B<KiB>"
21893 #: ../fish/guestfish.pod:530
21894 msgid "The size in kilobytes (multiplied by 1024)."
21899 #: ../fish/guestfish.pod:532
21905 #: ../fish/guestfish.pod:534
21906 msgid "The size in SI 1000 byte units."
21911 #: ../fish/guestfish.pod:536
21912 msgid "B<M> or B<MiB>"
21917 #: ../fish/guestfish.pod:538
21918 msgid "The size in megabytes (multiplied by 1048576)."
21923 #: ../fish/guestfish.pod:540
21929 #: ../fish/guestfish.pod:542
21930 msgid "The size in SI 1000000 byte units."
21935 #: ../fish/guestfish.pod:544
21936 msgid "B<G> or B<GiB>"
21941 #: ../fish/guestfish.pod:546
21942 msgid "The size in gigabytes (multiplied by 2**30)."
21947 #: ../fish/guestfish.pod:548
21953 #: ../fish/guestfish.pod:550
21954 msgid "The size in SI 10**9 byte units."
21959 #: ../fish/guestfish.pod:552
21960 msgid "B<T> or B<TiB>"
21965 #: ../fish/guestfish.pod:554
21966 msgid "The size in terabytes (multiplied by 2**40)."
21971 #: ../fish/guestfish.pod:556
21977 #: ../fish/guestfish.pod:558
21978 msgid "The size in SI 10**12 byte units."
21983 #: ../fish/guestfish.pod:560
21984 msgid "B<P> or B<PiB>"
21989 #: ../fish/guestfish.pod:562
21990 msgid "The size in petabytes (multiplied by 2**50)."
21995 #: ../fish/guestfish.pod:564
22001 #: ../fish/guestfish.pod:566
22002 msgid "The size in SI 10**15 byte units."
22007 #: ../fish/guestfish.pod:568
22008 msgid "B<E> or B<EiB>"
22013 #: ../fish/guestfish.pod:570
22014 msgid "The size in exabytes (multiplied by 2**60)."
22019 #: ../fish/guestfish.pod:572
22025 #: ../fish/guestfish.pod:574
22026 msgid "The size in SI 10**18 byte units."
22031 #: ../fish/guestfish.pod:576
22032 msgid "B<Z> or B<ZiB>"
22037 #: ../fish/guestfish.pod:578
22038 msgid "The size in zettabytes (multiplied by 2**70)."
22043 #: ../fish/guestfish.pod:580
22049 #: ../fish/guestfish.pod:582
22050 msgid "The size in SI 10**21 byte units."
22055 #: ../fish/guestfish.pod:584
22056 msgid "B<Y> or B<YiB>"
22061 #: ../fish/guestfish.pod:586
22062 msgid "The size in yottabytes (multiplied by 2**80)."
22067 #: ../fish/guestfish.pod:588
22073 #: ../fish/guestfish.pod:590
22074 msgid "The size in SI 10**24 byte units."
22079 #: ../fish/guestfish.pod:596
22082 " truncate-size /file 1G\n"
22088 #: ../fish/guestfish.pod:598
22089 msgid "would truncate the file to 1 gigabyte."
22094 #: ../fish/guestfish.pod:600
22096 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
22097 "the parameter to L</memsize> is specified in megabytes already). Adding a "
22098 "suffix will probably not do what you expect."
22103 #: ../fish/guestfish.pod:604
22104 msgid "OCTAL AND HEXADECIMAL NUMBERS"
22109 #: ../fish/guestfish.pod:606
22111 "For specifying the radix (base) use the C convention: C<0> to prefix an "
22112 "octal number or C<0x> to prefix a hexadecimal number. For example:"
22117 #: ../fish/guestfish.pod:609
22120 " 1234 decimal number 1234\n"
22121 " 02322 octal number, equivalent to decimal 1234\n"
22122 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
22128 #: ../fish/guestfish.pod:613
22130 "When using the C<chmod> command, you almost always want to specify an octal "
22131 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
22132 "L<chmod(1)> program):"
22137 #: ../fish/guestfish.pod:617
22140 " chmod 0777 /public # OK\n"
22141 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
22147 #: ../fish/guestfish.pod:620
22149 "Commands that return numbers usually print them in decimal, but some "
22150 "commands print numbers in other radices (eg. C<umask> prints the mode in "
22151 "octal, preceeded by C<0>)."
22156 #: ../fish/guestfish.pod:624
22157 msgid "WILDCARDS AND GLOBBING"
22162 #: ../fish/guestfish.pod:626
22164 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
22165 "(globbing) by default. So for example the following will not do what you "
22171 #: ../fish/guestfish.pod:630
22180 #: ../fish/guestfish.pod:632
22182 "Assuming you don't have a directory called literally C</home/*> then the "
22183 "above command will return an error."
22188 #: ../fish/guestfish.pod:635
22189 msgid "To perform wildcard expansion, use the C<glob> command."
22194 #: ../fish/guestfish.pod:637
22197 " glob rm-rf /home/*\n"
22203 #: ../fish/guestfish.pod:639
22205 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
22206 "many times), equivalent to:"
22211 #: ../fish/guestfish.pod:642
22214 " rm-rf /home/jim\n"
22215 " rm-rf /home/joe\n"
22216 " rm-rf /home/mary\n"
22222 #: ../fish/guestfish.pod:646
22223 msgid "C<glob> only works on simple guest paths and not on device names."
22228 #: ../fish/guestfish.pod:648
22230 "If you have several parameters, each containing a wildcard, then glob will "
22231 "perform a Cartesian product."
22236 #: ../fish/guestfish.pod:651
22242 #: ../fish/guestfish.pod:653
22244 "Any line which starts with a I<#> character is treated as a comment and "
22245 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
22246 "a command. For example:"
22251 #: ../fish/guestfish.pod:657
22254 " # this is a comment\n"
22255 " # this is a comment\n"
22256 " foo # NOT a comment\n"
22262 #: ../fish/guestfish.pod:661
22263 msgid "Blank lines are also ignored."
22268 #: ../fish/guestfish.pod:663
22269 msgid "RUNNING COMMANDS LOCALLY"
22274 #: ../fish/guestfish.pod:665
22276 "Any line which starts with a I<!> character is treated as a command sent to "
22277 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
22282 #: ../fish/guestfish.pod:669
22286 " tgz-out /remote local/remote-data.tar.gz\n"
22292 #: ../fish/guestfish.pod:672
22294 "will create a directory C<local> on the host, and then export the contents "
22295 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
22296 "(See C<tgz-out>)."
22301 #: ../fish/guestfish.pod:676
22303 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
22304 "effect, due to the way that subprocesses work in Unix."
22308 #: ../fish/guestfish.pod:679
22309 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
22313 #: ../fish/guestfish.pod:681
22315 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
22316 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
22317 "and executed as guestfish commands."
22321 #: ../fish/guestfish.pod:685
22323 "Thus you can use shell script to construct arbitrary guestfish commands "
22324 "which are then parsed by guestfish."
22328 #: ../fish/guestfish.pod:688
22330 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
22331 "through C</foo.100>) using guestfish commands alone. However this is simple "
22332 "if we use a shell script to create the guestfish commands for us:"
22336 #: ../fish/guestfish.pod:693
22339 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
22344 #: ../fish/guestfish.pod:695
22345 msgid "or with names like C</foo.001>:"
22349 #: ../fish/guestfish.pod:697
22352 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
22357 #: ../fish/guestfish.pod:699
22359 "When using guestfish interactively it can be helpful to just run the shell "
22360 "script first (ie. remove the initial C<E<lt>> character so it is just an "
22361 "ordinary I<!> local command), see what guestfish commands it would run, and "
22362 "when you are happy with those prepend the C<E<lt>> character to run the "
22363 "guestfish commands for real."
22368 #: ../fish/guestfish.pod:705
22374 #: ../fish/guestfish.pod:707
22376 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
22377 "command (a guestfish command) to the second command (any host command). For "
22383 #: ../fish/guestfish.pod:711
22386 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
22392 #: ../fish/guestfish.pod:713
22394 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
22395 "program). The above command would list all accounts in the guest filesystem "
22396 "which have UID 0, ie. root accounts including backdoors. Other examples:"
22401 #: ../fish/guestfish.pod:718
22404 " hexdump /bin/ls | head\n"
22405 " list-devices | tail -1\n"
22406 " tgz-out / - | tar ztf -\n"
22412 #: ../fish/guestfish.pod:722
22414 "The space before the pipe symbol is required, any space after the pipe "
22415 "symbol is optional. Everything after the pipe symbol is just passed "
22416 "straight to the host shell, so it can contain redirections, globs and "
22417 "anything else that makes sense on the host side."
22422 #: ../fish/guestfish.pod:727
22424 "To use a literal argument which begins with a pipe symbol, you have to quote "
22430 #: ../fish/guestfish.pod:730
22439 #: ../fish/guestfish.pod:732
22440 msgid "HOME DIRECTORIES"
22445 #: ../fish/guestfish.pod:734
22447 "If a parameter starts with the character C<~> then the tilde may be expanded "
22448 "as a home directory path (either C<~> for the current user's home directory, "
22449 "or C<~user> for another user)."
22454 #: ../fish/guestfish.pod:738
22456 "Note that home directory expansion happens for users known I<on the host>, "
22457 "not in the guest filesystem."
22462 #: ../fish/guestfish.pod:741
22464 "To use a literal argument which begins with a tilde, you have to quote it, "
22470 #: ../fish/guestfish.pod:744
22479 #: ../fish/guestfish.pod:748
22481 "Libguestfs has some support for Linux guests encrypted according to the "
22482 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
22483 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
22484 "LUKS is supported."
22489 #: ../fish/guestfish.pod:753
22490 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
22495 #: ../fish/guestfish.pod:755
22498 " ><fs> vfs-type /dev/sda2\n"
22505 #: ../fish/guestfish.pod:758
22507 "Then open those devices using L</luks-open>. This creates a device-mapper "
22508 "device called C</dev/mapper/luksdev>."
22513 #: ../fish/guestfish.pod:761
22516 " ><fs> luks-open /dev/sda2 luksdev\n"
22517 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
22523 #: ../fish/guestfish.pod:764
22525 "Finally you have to tell LVM to scan for volume groups on the newly created "
22531 #: ../fish/guestfish.pod:767
22535 " vg-activate-all true\n"
22541 #: ../fish/guestfish.pod:770
22542 msgid "The logical volume(s) can now be mounted in the usual way."
22547 #: ../fish/guestfish.pod:772
22549 "Before closing a LUKS device you must unmount any logical volumes on it and "
22550 "deactivate the volume groups by calling C<vg-activate false VG> on each "
22551 "one. Then you can close the mapper device:"
22556 #: ../fish/guestfish.pod:776
22559 " vg-activate false /dev/VG\n"
22560 " luks-close /dev/mapper/luksdev\n"
22566 #: ../fish/guestfish.pod:779
22567 msgid "WINDOWS PATHS"
22572 #: ../fish/guestfish.pod:781
22574 "If a path is prefixed with C<win:> then you can use Windows-style paths "
22575 "(with some limitations). The following commands are equivalent:"
22580 #: ../fish/guestfish.pod:784
22583 " file /WINDOWS/system32/config/system.LOG\n"
22589 #: ../fish/guestfish.pod:786
22592 " file win:/windows/system32/config/system.log\n"
22598 #: ../fish/guestfish.pod:788
22601 " file win:\\windows\\system32\\config\\system.log\n"
22607 #: ../fish/guestfish.pod:790
22610 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
22616 #: ../fish/guestfish.pod:792
22618 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
22619 "handles case insensitivity like Windows would. This only works in argument "
22620 "positions that expect a path."
22625 #: ../fish/guestfish.pod:796
22626 msgid "UPLOADING AND DOWNLOADING FILES"
22631 #: ../fish/guestfish.pod:798
22633 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
22634 "others which upload from or download to a local file, you can use the "
22635 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
22640 #: ../fish/guestfish.pod:802
22649 #: ../fish/guestfish.pod:804
22651 "reads stdin and creates from that a file C</foo> in the disk image, and:"
22656 #: ../fish/guestfish.pod:807
22659 " tar-out /etc - | tar tf -\n"
22665 #: ../fish/guestfish.pod:809
22667 "writes the tarball to stdout and then pipes that into the external \"tar\" "
22668 "command (see L</PIPES>)."
22673 #: ../fish/guestfish.pod:812
22675 "When using C<-> to read from stdin, the input is read up to the end of "
22676 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
22677 "some arbitrary end marker:"
22682 #: ../fish/guestfish.pod:816
22685 " upload -<<END /foo\n"
22695 #: ../fish/guestfish.pod:822
22697 "Any string of characters can be used instead of C<END>. The end marker must "
22698 "appear on a line of its own, without any preceeding or following characters "
22699 "(not even spaces)."
22704 #: ../fish/guestfish.pod:826
22706 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
22707 "upload local files (so-called \"FileIn\" parameters in the generator)."
22712 #: ../fish/guestfish.pod:829
22713 msgid "EXIT ON ERROR BEHAVIOUR"
22718 #: ../fish/guestfish.pod:831
22720 "By default, guestfish will ignore any errors when in interactive mode (ie. "
22721 "taking commands from a human over a tty), and will exit on the first error "
22722 "in non-interactive mode (scripts, commands given on the command line)."
22727 #: ../fish/guestfish.pod:836
22729 "If you prefix a command with a I<-> character, then that command will not "
22730 "cause guestfish to exit, even if that (one) command returns an error."
22735 #: ../fish/guestfish.pod:840
22736 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
22741 #: ../fish/guestfish.pod:842
22743 "Guestfish can be remote-controlled over a socket. This is useful "
22744 "particularly in shell scripts where you want to make several different "
22745 "changes to a filesystem, but you don't want the overhead of starting up a "
22746 "guestfish process each time."
22751 #: ../fish/guestfish.pod:847
22752 msgid "Start a guestfish server process using:"
22757 #: ../fish/guestfish.pod:849
22760 " eval \"`guestfish --listen`\"\n"
22766 #: ../fish/guestfish.pod:851
22767 msgid "and then send it commands by doing:"
22772 #: ../fish/guestfish.pod:853
22775 " guestfish --remote cmd [...]\n"
22781 #: ../fish/guestfish.pod:855
22782 msgid "To cause the server to exit, send it the exit command:"
22787 #: ../fish/guestfish.pod:857
22790 " guestfish --remote exit\n"
22796 #: ../fish/guestfish.pod:859
22798 "Note that the server will normally exit if there is an error in a command. "
22799 "You can change this in the usual way. See section L</EXIT ON ERROR "
22805 #: ../fish/guestfish.pod:863
22806 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
22811 #: ../fish/guestfish.pod:865
22813 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
22814 "is how the I<--remote> option knows where to send the commands. You can "
22815 "have several guestfish listener processes running using:"
22820 #: ../fish/guestfish.pod:869
22823 " eval \"`guestfish --listen`\"\n"
22824 " pid1=$GUESTFISH_PID\n"
22825 " eval \"`guestfish --listen`\"\n"
22826 " pid2=$GUESTFISH_PID\n"
22828 " guestfish --remote=$pid1 cmd\n"
22829 " guestfish --remote=$pid2 cmd\n"
22835 #: ../fish/guestfish.pod:877
22836 msgid "REMOTE CONTROL AND CSH"
22841 #: ../fish/guestfish.pod:879
22843 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
22849 #: ../fish/guestfish.pod:882
22852 " eval \"`guestfish --listen --csh`\"\n"
22858 #: ../fish/guestfish.pod:884
22859 msgid "REMOTE CONTROL DETAILS"
22864 #: ../fish/guestfish.pod:886
22866 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
22867 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
22868 "and C<$PID> is the process ID of the server."
22873 #: ../fish/guestfish.pod:890
22874 msgid "Guestfish client and server versions must match exactly."
22879 #: ../fish/guestfish.pod:892
22880 msgid "PREPARED DISK IMAGES"
22885 #: ../fish/guestfish.pod:894
22887 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
22888 "preformatted disk images that guestfish can make for you to save typing. "
22889 "This is particularly useful for testing purposes. This option is used "
22890 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
22891 "can be mixed with I<-a>)."
22896 #: ../fish/guestfish.pod:900
22898 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
22899 "the second and so on. Existing files in the current directory are "
22905 #: ../fish/guestfish.pod:904
22907 "The type briefly describes how the disk should be sized, partitioned, how "
22908 "filesystem(s) should be created, and how content should be added. "
22909 "Optionally the type can be followed by extra parameters, separated by C<:> "
22910 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
22911 "allocated disk, containing a single partition, with the partition formatted "
22912 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
22918 #: ../fish/guestfish.pod:912
22919 msgid "To list the available types and any extra parameters they take, run:"
22924 #: ../fish/guestfish.pod:916
22926 "Note that the prepared filesystem is not mounted. You would usually have to "
22927 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
22932 #: ../fish/guestfish.pod:920
22934 "If any I<-N> or I<--new> options are given, the guest is automatically "
22940 #: ../fish/guestfish.pod:925
22941 msgid "Create a 100MB disk with an ext4-formatted partition:"
22946 #: ../fish/guestfish.pod:927
22949 " guestfish -N fs:ext4\n"
22955 #: ../fish/guestfish.pod:929
22956 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
22961 #: ../fish/guestfish.pod:931
22964 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
22970 #: ../fish/guestfish.pod:933
22971 msgid "Create a blank 200MB disk:"
22976 #: ../fish/guestfish.pod:935
22979 " guestfish -N disk:200M\n"
22985 #: ../fish/guestfish.pod:937
22986 msgid "PROGRESS BARS"
22991 #: ../fish/guestfish.pod:939
22993 "Some (not all) long-running commands send progress notification messages as "
22994 "they are running. Guestfish turns these messages into progress bars."
22999 #: ../fish/guestfish.pod:943
23001 "When a command that supports progress bars takes longer than two seconds to "
23002 "run, and if progress bars are enabled, then you will see one appearing below "
23008 #: ../fish/guestfish.pod:947
23011 " ><fs> copy-size /large-file /another-file 2048M\n"
23012 " / 10% [#####-----------------------------------------] 00:30\n"
23018 #: ../fish/guestfish.pod:950
23020 "The spinner on the left hand side moves round once for every progress "
23021 "notification received from the backend. This is a (reasonably) golden "
23022 "assurance that the command is \"doing something\" even if the progress bar "
23023 "is not moving, because the command is able to send the progress "
23024 "notifications. When the bar reaches 100% and the command finishes, the "
23025 "spinner disappears."
23030 #: ../fish/guestfish.pod:957
23032 "Progress bars are enabled by default when guestfish is used interactively. "
23033 "You can enable them even for non-interactive modes using I<--progress-bars>, "
23034 "and you can disable them completely using I<--no-progress-bars>."
23039 #: ../fish/guestfish.pod:962
23040 msgid "GUESTFISH COMMANDS"
23045 #: ../fish/guestfish.pod:964
23047 "The commands in this section are guestfish convenience commands, in other "
23048 "words, they are not part of the L<guestfs(3)> API."
23053 #: ../fish/guestfish.pod:967
23059 #: ../fish/guestfish.pod:969
23069 #: ../fish/guestfish.pod:972
23070 msgid "Without any parameter, this provides general help."
23075 #: ../fish/guestfish.pod:974
23076 msgid "With a C<cmd> parameter, this displays detailed help for that command."
23081 #: ../fish/guestfish.pod:976
23082 msgid "quit | exit"
23087 #: ../fish/guestfish.pod:978
23088 msgid "This exits guestfish. You can also use C<^D> key."
23093 #: ../fish/guestfish.pod:980
23094 msgid "@FISH_COMMANDS@"
23099 #: ../fish/guestfish.pod:982
23105 #: ../fish/guestfish.pod:986 ../test-tool/libguestfs-test-tool.pod:83
23111 #: ../fish/guestfish.pod:988
23113 "guestfish returns 0 if the commands completed without error, or 1 if there "
23119 #: ../fish/guestfish.pod:995
23125 #: ../fish/guestfish.pod:997
23127 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
23133 #: ../fish/guestfish.pod:1000
23134 msgid "GUESTFISH_PID"
23139 #: ../fish/guestfish.pod:1002
23141 "Used with the I<--remote> option to specify the remote guestfish process to "
23142 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
23147 #: ../fish/guestfish.pod:1006
23153 #: ../fish/guestfish.pod:1008
23155 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
23156 "not specified, the external L<hexedit(1)> program is used."
23161 #: ../fish/guestfish.pod:1012
23167 #: ../fish/guestfish.pod:1014
23169 "If compiled with GNU readline support, various files in the home directory "
23170 "can be used. See L</FILES>."
23175 #: ../fish/guestfish.pod:1023
23177 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
23178 "effect as using the B<-v> option."
23183 #: ../fish/guestfish.pod:1035
23185 "Set the path that guestfish uses to search for kernel and initrd.img. See "
23186 "the discussion of paths in L<guestfs(3)>."
23191 #: ../fish/guestfish.pod:1046
23192 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
23197 #: ../fish/guestfish.pod:1048
23203 #: ../fish/guestfish.pod:1050
23205 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
23211 #: ../fish/guestfish.pod:1066 ../test-tool/libguestfs-test-tool.pod:88
23217 #: ../fish/guestfish.pod:1070
23218 msgid "$HOME/.guestfish"
23223 #: ../fish/guestfish.pod:1072
23225 "If compiled with GNU readline support, then the command history is saved in "
23231 #: ../fish/guestfish.pod:1075
23232 msgid "$HOME/.inputrc"
23237 #: ../fish/guestfish.pod:1077
23238 msgid "/etc/inputrc"
23243 #: ../fish/guestfish.pod:1079
23245 "If compiled with GNU readline support, then these files can be used to "
23246 "configure readline. For further information, please see L<readline(3)/"
23247 "INITIALIZATION FILE>."
23252 #: ../fish/guestfish.pod:1083
23253 msgid "To write rules which only apply to guestfish, use:"
23258 #: ../fish/guestfish.pod:1085
23269 #: ../fish/guestfish.pod:1089
23271 "Variables that you can set in inputrc that change the behaviour of guestfish "
23272 "in useful ways include:"
23277 #: ../fish/guestfish.pod:1094
23278 msgid "completion-ignore-case (default: on)"
23283 #: ../fish/guestfish.pod:1096
23285 "By default, guestfish will ignore case when tab-completing paths on the "
23291 #: ../fish/guestfish.pod:1099
23294 " set completion-ignore-case off\n"
23300 #: ../fish/guestfish.pod:1101
23301 msgid "to make guestfish case sensitive."
23306 #: ../fish/guestfish.pod:1105
23312 #: ../fish/guestfish.pod:1107
23313 msgid "test2.img (etc)"
23318 #: ../fish/guestfish.pod:1109
23320 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
23321 "will be created in the file C<test1.img> in the current directory. The "
23322 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
23323 "the same name will be overwritten."
23327 #: ../fish/guestfish.pod:1118
23329 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
23330 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
23331 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
23332 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
23333 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
23334 ">, L<hexedit(1)>."
23339 #: ../fish/guestfish.pod:1148 ../test-tool/libguestfs-test-tool.pod:124
23340 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:372
23341 #: ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1512
23342 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309
23343 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
23345 "This program is free software; you can redistribute it and/or modify it "
23346 "under the terms of the GNU General Public License as published by the Free "
23347 "Software Foundation; either version 2 of the License, or (at your option) "
23348 "any later version."
23353 #: ../fish/guestfish.pod:1153 ../test-tool/libguestfs-test-tool.pod:129
23354 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:377
23355 #: ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1517
23356 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314
23357 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
23359 "This program is distributed in the hope that it will be useful, but WITHOUT "
23360 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
23361 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
23367 #: ../fish/guestfish.pod:1158 ../test-tool/libguestfs-test-tool.pod:134
23368 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:382
23369 #: ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1522
23370 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319
23371 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
23373 "You should have received a copy of the GNU General Public License along with "
23374 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
23375 "Ave, Cambridge, MA 02139, USA."
23380 #: ../fish/guestfish-actions.pod:1
23386 #: ../fish/guestfish-actions.pod:3
23389 " add-cdrom filename\n"
23395 #: ../fish/guestfish-actions.pod:15
23397 "This call checks for the existence of C<filename>. This stops you from "
23398 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23399 "and C<http:> URLs. To specify those, use the general L</config> call "
23405 #: ../fish/guestfish-actions.pod:22
23407 "If you just want to add an ISO file (often you use this as an efficient way "
23408 "to transfer large files into the guest), then you should probably use L</add-"
23409 "drive-ro> instead."
23414 #: ../fish/guestfish-actions.pod:35
23420 #: ../fish/guestfish-actions.pod:37
23426 #: ../fish/guestfish-actions.pod:39
23429 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
23435 #: ../fish/guestfish-actions.pod:41
23437 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23438 "It works by connecting to libvirt, requesting the domain and domain XML from "
23439 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
23444 #: ../fish/guestfish-actions.pod:64
23446 "The other optional parameters are passed directly through to L</add-drive-"
23452 #: ../fish/guestfish-actions.pod:67 ../fish/guestfish-actions.pod:131
23453 #: ../fish/guestfish-actions.pod:2934
23455 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
23460 #: ../fish/guestfish-actions.pod:69
23466 #: ../fish/guestfish-actions.pod:71
23469 " add-drive filename\n"
23475 #: ../fish/guestfish-actions.pod:73
23477 "This function is the equivalent of calling L</add-drive-opts> with no "
23478 "optional parameters, so the disk is added writable, with the format being "
23479 "detected automatically."
23484 #: ../fish/guestfish-actions.pod:77
23486 "Automatic detection of the format opens you up to a potential security hole "
23487 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23488 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23489 "you should think about replacing calls to this function with calls to L</add-"
23490 "drive-opts>, and specifying the format."
23495 #: ../fish/guestfish-actions.pod:84
23496 msgid "add-drive-opts"
23501 #: ../fish/guestfish-actions.pod:86
23507 #: ../fish/guestfish-actions.pod:88
23510 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
23516 #: ../fish/guestfish-actions.pod:115
23518 "This forces the image format. If you omit this (or use L</add-drive> or L</"
23519 "add-drive-ro>) then the format is automatically detected. Possible formats "
23520 "include C<raw> and C<qcow2>."
23525 #: ../fish/guestfish-actions.pod:126
23527 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
23528 "add-drive-with-if> call (q.v.)"
23533 #: ../fish/guestfish-actions.pod:133
23534 msgid "add-drive-ro"
23539 #: ../fish/guestfish-actions.pod:135
23545 #: ../fish/guestfish-actions.pod:137
23548 " add-drive-ro filename\n"
23554 #: ../fish/guestfish-actions.pod:139
23556 "This function is the equivalent of calling L</add-drive-opts> with the "
23557 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
23558 "is added read-only, with the format being detected automatically."
23563 #: ../fish/guestfish-actions.pod:144
23564 msgid "add-drive-ro-with-if"
23569 #: ../fish/guestfish-actions.pod:146
23572 " add-drive-ro-with-if filename iface\n"
23578 #: ../fish/guestfish-actions.pod:148
23580 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
23581 "interface emulation to use at run time."
23586 #: ../fish/guestfish-actions.pod:158
23587 msgid "add-drive-with-if"
23592 #: ../fish/guestfish-actions.pod:160
23595 " add-drive-with-if filename iface\n"
23601 #: ../fish/guestfish-actions.pod:162
23603 "This is the same as L</add-drive> but it allows you to specify the QEMU "
23604 "interface emulation to use at run time."
23609 #: ../fish/guestfish-actions.pod:172
23615 #: ../fish/guestfish-actions.pod:174
23618 " aug-clear augpath\n"
23624 #: ../fish/guestfish-actions.pod:179
23630 #: ../fish/guestfish-actions.pod:181
23639 #: ../fish/guestfish-actions.pod:183
23641 "Close the current Augeas handle and free up any resources used by it. After "
23642 "calling this, you have to call L</aug-init> again before you can use any "
23643 "other Augeas functions."
23648 #: ../fish/guestfish-actions.pod:188
23649 msgid "aug-defnode"
23654 #: ../fish/guestfish-actions.pod:190
23657 " aug-defnode name expr val\n"
23663 #: ../fish/guestfish-actions.pod:195
23665 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23666 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
23667 "containing that single node."
23672 #: ../fish/guestfish-actions.pod:203
23678 #: ../fish/guestfish-actions.pod:205
23681 " aug-defvar name expr\n"
23687 #: ../fish/guestfish-actions.pod:214
23693 #: ../fish/guestfish-actions.pod:216
23696 " aug-get augpath\n"
23702 #: ../fish/guestfish-actions.pod:221
23708 #: ../fish/guestfish-actions.pod:223
23711 " aug-init root flags\n"
23717 #: ../fish/guestfish-actions.pod:229
23718 msgid "You must call this before using any other L</aug-*> commands."
23723 #: ../fish/guestfish-actions.pod:264
23724 msgid "Do not load the tree in L</aug-init>."
23729 #: ../fish/guestfish-actions.pod:268
23730 msgid "To close the handle, you can call L</aug-close>."
23735 #: ../fish/guestfish-actions.pod:272
23741 #: ../fish/guestfish-actions.pod:274
23744 " aug-insert augpath label true|false\n"
23750 #: ../fish/guestfish-actions.pod:284
23756 #: ../fish/guestfish-actions.pod:286
23765 #: ../fish/guestfish-actions.pod:293
23771 #: ../fish/guestfish-actions.pod:295
23774 " aug-ls augpath\n"
23780 #: ../fish/guestfish-actions.pod:297
23782 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
23783 "resulting nodes into alphabetical order."
23788 #: ../fish/guestfish-actions.pod:300
23794 #: ../fish/guestfish-actions.pod:302
23797 " aug-match augpath\n"
23803 #: ../fish/guestfish-actions.pod:308
23809 #: ../fish/guestfish-actions.pod:310
23812 " aug-mv src dest\n"
23818 #: ../fish/guestfish-actions.pod:315
23824 #: ../fish/guestfish-actions.pod:317
23827 " aug-rm augpath\n"
23833 #: ../fish/guestfish-actions.pod:323
23839 #: ../fish/guestfish-actions.pod:325
23848 #: ../fish/guestfish-actions.pod:329
23850 "The flags which were passed to L</aug-init> affect exactly how files are "
23856 #: ../fish/guestfish-actions.pod:332
23862 #: ../fish/guestfish-actions.pod:334
23865 " aug-set augpath val\n"
23871 #: ../fish/guestfish-actions.pod:338
23873 "In the Augeas API, it is possible to clear a node by setting the value to "
23874 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
23875 "this call. Instead you must use the L</aug-clear> call."
23880 #: ../fish/guestfish-actions.pod:343
23886 #: ../fish/guestfish-actions.pod:345
23889 " available 'groups ...'\n"
23895 #: ../fish/guestfish-actions.pod:351
23897 "The libguestfs groups, and the functions that those groups correspond to, "
23898 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
23899 "runtime by calling L</available-all-groups>."
23904 #: ../fish/guestfish-actions.pod:375
23905 msgid "You must call L</launch> before calling this function."
23910 #: ../fish/guestfish-actions.pod:397
23912 "This call was added in version C<1.0.80>. In previous versions of "
23913 "libguestfs all you could do would be to speculatively execute a command to "
23914 "find out if the daemon implemented it. See also L</version>."
23919 #: ../fish/guestfish-actions.pod:404
23920 msgid "available-all-groups"
23925 #: ../fish/guestfish-actions.pod:406
23928 " available-all-groups\n"
23934 #: ../fish/guestfish-actions.pod:408
23936 "This command returns a list of all optional groups that this daemon knows "
23937 "about. Note this returns both supported and unsupported groups. To find "
23938 "out which ones the daemon can actually support you have to call L</"
23939 "available> on each member of the returned list."
23944 #: ../fish/guestfish-actions.pod:414
23945 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
23950 #: ../fish/guestfish-actions.pod:416
23956 #: ../fish/guestfish-actions.pod:418
23959 " base64-in (base64file|-) filename\n"
23965 #: ../fish/guestfish-actions.pod:423 ../fish/guestfish-actions.pod:432
23966 #: ../fish/guestfish-actions.pod:656 ../fish/guestfish-actions.pod:825
23967 #: ../fish/guestfish-actions.pod:844 ../fish/guestfish-actions.pod:1221
23968 #: ../fish/guestfish-actions.pod:4302 ../fish/guestfish-actions.pod:4314
23969 #: ../fish/guestfish-actions.pod:4325 ../fish/guestfish-actions.pod:4336
23970 #: ../fish/guestfish-actions.pod:4388 ../fish/guestfish-actions.pod:4397
23971 #: ../fish/guestfish-actions.pod:4451 ../fish/guestfish-actions.pod:4474
23972 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
23977 #: ../fish/guestfish-actions.pod:425
23983 #: ../fish/guestfish-actions.pod:427
23986 " base64-out filename (base64file|-)\n"
23992 #: ../fish/guestfish-actions.pod:434
23993 msgid "blockdev-flushbufs"
23998 #: ../fish/guestfish-actions.pod:436
24001 " blockdev-flushbufs device\n"
24007 #: ../fish/guestfish-actions.pod:443
24008 msgid "blockdev-getbsz"
24013 #: ../fish/guestfish-actions.pod:445
24016 " blockdev-getbsz device\n"
24022 #: ../fish/guestfish-actions.pod:454
24023 msgid "blockdev-getro"
24028 #: ../fish/guestfish-actions.pod:456
24031 " blockdev-getro device\n"
24037 #: ../fish/guestfish-actions.pod:463
24038 msgid "blockdev-getsize64"
24043 #: ../fish/guestfish-actions.pod:465
24046 " blockdev-getsize64 device\n"
24052 #: ../fish/guestfish-actions.pod:469
24053 msgid "See also L</blockdev-getsz>."
24058 #: ../fish/guestfish-actions.pod:473
24059 msgid "blockdev-getss"
24064 #: ../fish/guestfish-actions.pod:475
24067 " blockdev-getss device\n"
24073 #: ../fish/guestfish-actions.pod:480
24075 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
24080 #: ../fish/guestfish-actions.pod:485
24081 msgid "blockdev-getsz"
24086 #: ../fish/guestfish-actions.pod:487
24089 " blockdev-getsz device\n"
24095 #: ../fish/guestfish-actions.pod:492
24097 "See also L</blockdev-getss> for the real sector size of the device, and L</"
24098 "blockdev-getsize64> for the more useful I<size in bytes>."
24103 #: ../fish/guestfish-actions.pod:498
24104 msgid "blockdev-rereadpt"
24109 #: ../fish/guestfish-actions.pod:500
24112 " blockdev-rereadpt device\n"
24118 #: ../fish/guestfish-actions.pod:506
24119 msgid "blockdev-setbsz"
24124 #: ../fish/guestfish-actions.pod:508
24127 " blockdev-setbsz device blocksize\n"
24133 #: ../fish/guestfish-actions.pod:517
24134 msgid "blockdev-setro"
24139 #: ../fish/guestfish-actions.pod:519
24142 " blockdev-setro device\n"
24148 #: ../fish/guestfish-actions.pod:525
24149 msgid "blockdev-setrw"
24154 #: ../fish/guestfish-actions.pod:527
24157 " blockdev-setrw device\n"
24163 #: ../fish/guestfish-actions.pod:533
24164 msgid "case-sensitive-path"
24169 #: ../fish/guestfish-actions.pod:535
24172 " case-sensitive-path path\n"
24178 #: ../fish/guestfish-actions.pod:559
24180 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
24181 "WINDOWS/system32\"> (the exact return value would depend on details of how "
24182 "the directories were originally created under Windows)."
24187 #: ../fish/guestfish-actions.pod:567
24188 msgid "See also L</realpath>."
24193 #: ../fish/guestfish-actions.pod:569
24199 #: ../fish/guestfish-actions.pod:571
24208 #: ../fish/guestfish-actions.pod:575
24210 "Note that this function cannot correctly handle binary files (specifically, "
24211 "files containing C<\\0> character which is treated as end of string). For "
24212 "those you need to use the L</read-file> or L</download> functions which have "
24213 "a more complex interface."
24218 #: ../fish/guestfish-actions.pod:583
24224 #: ../fish/guestfish-actions.pod:585
24227 " checksum csumtype path\n"
24233 #: ../fish/guestfish-actions.pod:628
24234 msgid "To get the checksum for a device, use L</checksum-device>."
24239 #: ../fish/guestfish-actions.pod:630
24240 msgid "To get the checksums for many files, use L</checksums-out>."
24245 #: ../fish/guestfish-actions.pod:632
24246 msgid "checksum-device"
24251 #: ../fish/guestfish-actions.pod:634
24254 " checksum-device csumtype device\n"
24260 #: ../fish/guestfish-actions.pod:636
24262 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24263 "device named C<device>. For the types of checksums supported see the L</"
24264 "checksum> command."
24269 #: ../fish/guestfish-actions.pod:640
24270 msgid "checksums-out"
24275 #: ../fish/guestfish-actions.pod:642
24278 " checksums-out csumtype directory (sumsfile|-)\n"
24284 #: ../fish/guestfish-actions.pod:658
24290 #: ../fish/guestfish-actions.pod:660
24293 " chmod mode path\n"
24299 #: ../fish/guestfish-actions.pod:671
24305 #: ../fish/guestfish-actions.pod:673
24308 " chown owner group path\n"
24314 #: ../fish/guestfish-actions.pod:681
24320 #: ../fish/guestfish-actions.pod:683
24323 " command 'arguments ...'\n"
24329 #: ../fish/guestfish-actions.pod:690
24331 "The single parameter is an argv-style list of arguments. The first element "
24332 "is the name of the program to run. Subsequent elements are parameters. The "
24333 "list must be non-empty (ie. must contain a program name). Note that the "
24334 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
24339 #: ../fish/guestfish-actions.pod:718
24340 msgid "command-lines"
24345 #: ../fish/guestfish-actions.pod:720
24348 " command-lines 'arguments ...'\n"
24354 #: ../fish/guestfish-actions.pod:722
24356 "This is the same as L</command>, but splits the result into a list of lines."
24361 #: ../fish/guestfish-actions.pod:725
24362 msgid "See also: L</sh-lines>"
24367 #: ../fish/guestfish-actions.pod:730
24373 #: ../fish/guestfish-actions.pod:732
24376 " config qemuparam qemuvalue\n"
24382 #: ../fish/guestfish-actions.pod:743
24388 #: ../fish/guestfish-actions.pod:745
24391 " copy-size src dest size\n"
24397 #: ../fish/guestfish-actions.pod:753
24403 #: ../fish/guestfish-actions.pod:755
24412 #: ../fish/guestfish-actions.pod:760
24418 #: ../fish/guestfish-actions.pod:762
24427 #: ../fish/guestfish-actions.pod:767
24433 #: ../fish/guestfish-actions.pod:769
24442 #: ../fish/guestfish-actions.pod:776
24444 "If the destination is a device, it must be as large or larger than the "
24445 "source file or device, otherwise the copy will fail. This command cannot do "
24446 "partial copies (see L</copy-size>)."
24451 #: ../fish/guestfish-actions.pod:780
24457 #: ../fish/guestfish-actions.pod:782
24466 #: ../fish/guestfish-actions.pod:786 ../fish/guestfish-actions.pod:797
24468 "This command is mostly useful for interactive sessions. It is I<not> "
24469 "intended that you try to parse the output string. Use L</statvfs> from "
24475 #: ../fish/guestfish-actions.pod:790
24481 #: ../fish/guestfish-actions.pod:792
24490 #: ../fish/guestfish-actions.pod:801
24496 #: ../fish/guestfish-actions.pod:803
24505 #: ../fish/guestfish-actions.pod:809
24507 "Another way to get the same information is to enable verbose messages with "
24508 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
24509 "before running the program."
24514 #: ../fish/guestfish-actions.pod:814
24520 #: ../fish/guestfish-actions.pod:816
24523 " download remotefilename (filename|-)\n"
24529 #: ../fish/guestfish-actions.pod:823
24530 msgid "See also L</upload>, L</cat>."
24535 #: ../fish/guestfish-actions.pod:827
24536 msgid "download-offset"
24541 #: ../fish/guestfish-actions.pod:829
24544 " download-offset remotefilename (filename|-) offset size\n"
24550 #: ../fish/guestfish-actions.pod:837
24552 "Note that there is no limit on the amount of data that can be downloaded "
24553 "with this call, unlike with L</pread>, and this call always reads the full "
24554 "amount unless an error occurs."
24559 #: ../fish/guestfish-actions.pod:842
24560 msgid "See also L</download>, L</pread>."
24565 #: ../fish/guestfish-actions.pod:846
24566 msgid "drop-caches"
24571 #: ../fish/guestfish-actions.pod:848
24574 " drop-caches whattodrop\n"
24580 #: ../fish/guestfish-actions.pod:860
24586 #: ../fish/guestfish-actions.pod:862
24595 #: ../fish/guestfish-actions.pod:874
24601 #: ../fish/guestfish-actions.pod:876
24604 " e2fsck-f device\n"
24610 #: ../fish/guestfish-actions.pod:882
24612 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
24613 "should use L</fsck>."
24618 #: ../fish/guestfish-actions.pod:885
24619 msgid "echo-daemon"
24624 #: ../fish/guestfish-actions.pod:887
24627 " echo-daemon 'words ...'\n"
24633 #: ../fish/guestfish-actions.pod:894
24634 msgid "See also L</ping-daemon>."
24639 #: ../fish/guestfish-actions.pod:896
24645 #: ../fish/guestfish-actions.pod:898
24648 " egrep regex path\n"
24654 #: ../fish/guestfish-actions.pod:906
24660 #: ../fish/guestfish-actions.pod:908
24663 " egrepi regex path\n"
24669 #: ../fish/guestfish-actions.pod:916
24675 #: ../fish/guestfish-actions.pod:918
24678 " equal file1 file2\n"
24684 #: ../fish/guestfish-actions.pod:925
24690 #: ../fish/guestfish-actions.pod:927
24699 #: ../fish/guestfish-actions.pod:932
24700 msgid "See also L</is-file>, L</is-dir>, L</stat>."
24705 #: ../fish/guestfish-actions.pod:934
24711 #: ../fish/guestfish-actions.pod:936
24714 " fallocate path len\n"
24720 #: ../fish/guestfish-actions.pod:953
24721 msgid "fallocate64"
24726 #: ../fish/guestfish-actions.pod:955
24729 " fallocate64 path len\n"
24735 #: ../fish/guestfish-actions.pod:961
24737 "Note that this call allocates disk blocks for the file. To create a sparse "
24738 "file use L</truncate-size> instead."
24743 #: ../fish/guestfish-actions.pod:964
24745 "The deprecated call L</fallocate> does the same, but owing to an oversight "
24746 "it only allowed 30 bit lengths to be specified, effectively limiting the "
24747 "maximum size of files created through that call to 1GB."
24752 #: ../fish/guestfish-actions.pod:973
24758 #: ../fish/guestfish-actions.pod:975
24761 " fgrep pattern path\n"
24767 #: ../fish/guestfish-actions.pod:983
24773 #: ../fish/guestfish-actions.pod:985
24776 " fgrepi pattern path\n"
24782 #: ../fish/guestfish-actions.pod:993
24788 #: ../fish/guestfish-actions.pod:995
24797 #: ../fish/guestfish-actions.pod:1007
24799 "This command can also be used on C</dev/> devices (and partitions, LV "
24800 "names). You can for example use this to determine if a device contains a "
24801 "filesystem, although it's usually better to use L</vfs-type>."
24806 #: ../fish/guestfish-actions.pod:1017
24807 msgid "file-architecture"
24812 #: ../fish/guestfish-actions.pod:1019
24815 " file-architecture filename\n"
24821 #: ../fish/guestfish-actions.pod:1122
24827 #: ../fish/guestfish-actions.pod:1124
24836 #: ../fish/guestfish-actions.pod:1128
24838 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
24839 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
24844 #: ../fish/guestfish-actions.pod:1132
24850 #: ../fish/guestfish-actions.pod:1134
24853 " fill c len path\n"
24859 #: ../fish/guestfish-actions.pod:1140
24861 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
24862 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
24863 "L</fill-pattern>."
24868 #: ../fish/guestfish-actions.pod:1145
24869 msgid "fill-pattern"
24874 #: ../fish/guestfish-actions.pod:1147
24877 " fill-pattern pattern len path\n"
24883 #: ../fish/guestfish-actions.pod:1149
24885 "This function is like L</fill> except that it creates a new file of length "
24886 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
24887 "is truncated if necessary to ensure the length of the file is exactly C<len> "
24893 #: ../fish/guestfish-actions.pod:1154
24899 #: ../fish/guestfish-actions.pod:1156
24902 " find directory\n"
24908 #: ../fish/guestfish-actions.pod:1170
24909 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
24914 #: ../fish/guestfish-actions.pod:1183
24915 msgid "See also L</find0>."
24920 #: ../fish/guestfish-actions.pod:1188
24926 #: ../fish/guestfish-actions.pod:1190
24929 " find0 directory (files|-)\n"
24935 #: ../fish/guestfish-actions.pod:1196
24937 "This command works the same way as L</find> with the following exceptions:"
24942 #: ../fish/guestfish-actions.pod:1223
24943 msgid "findfs-label"
24948 #: ../fish/guestfish-actions.pod:1225
24951 " findfs-label label\n"
24957 #: ../fish/guestfish-actions.pod:1231
24958 msgid "To find the label of a filesystem, use L</vfs-label>."
24963 #: ../fish/guestfish-actions.pod:1233
24964 msgid "findfs-uuid"
24969 #: ../fish/guestfish-actions.pod:1235
24972 " findfs-uuid uuid\n"
24978 #: ../fish/guestfish-actions.pod:1241
24979 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
24984 #: ../fish/guestfish-actions.pod:1243
24990 #: ../fish/guestfish-actions.pod:1245
24993 " fsck fstype device\n"
24999 #: ../fish/guestfish-actions.pod:1275
25005 #: ../fish/guestfish-actions.pod:1277
25014 #: ../fish/guestfish-actions.pod:1284
25015 msgid "get-autosync"
25020 #: ../fish/guestfish-actions.pod:1286
25029 #: ../fish/guestfish-actions.pod:1290
25035 #: ../fish/guestfish-actions.pod:1292
25044 #: ../fish/guestfish-actions.pod:1296
25045 msgid "get-e2label"
25050 #: ../fish/guestfish-actions.pod:1298
25053 " get-e2label device\n"
25059 #: ../fish/guestfish-actions.pod:1310
25065 #: ../fish/guestfish-actions.pod:1312
25068 " get-e2uuid device\n"
25074 #: ../fish/guestfish-actions.pod:1324
25075 msgid "get-memsize"
25080 #: ../fish/guestfish-actions.pod:1326
25089 #: ../fish/guestfish-actions.pod:1331
25091 "If L</set-memsize> was not called on this handle, and if "
25092 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25093 "value for memsize."
25098 #: ../fish/guestfish-actions.pod:1338
25099 msgid "get-network"
25104 #: ../fish/guestfish-actions.pod:1340
25113 #: ../fish/guestfish-actions.pod:1344
25119 #: ../fish/guestfish-actions.pod:1346
25128 #: ../fish/guestfish-actions.pod:1353
25134 #: ../fish/guestfish-actions.pod:1355
25140 #: ../fish/guestfish-actions.pod:1357
25149 #: ../fish/guestfish-actions.pod:1364
25155 #: ../fish/guestfish-actions.pod:1366
25164 #: ../fish/guestfish-actions.pod:1373
25165 msgid "get-recovery-proc"
25170 #: ../fish/guestfish-actions.pod:1375
25173 " get-recovery-proc\n"
25179 #: ../fish/guestfish-actions.pod:1379
25180 msgid "get-selinux"
25185 #: ../fish/guestfish-actions.pod:1381
25194 #: ../fish/guestfish-actions.pod:1383
25196 "This returns the current setting of the selinux flag which is passed to the "
25197 "appliance at boot time. See L</set-selinux>."
25202 #: ../fish/guestfish-actions.pod:1389
25208 #: ../fish/guestfish-actions.pod:1391
25217 #: ../fish/guestfish-actions.pod:1398
25223 #: ../fish/guestfish-actions.pod:1400
25232 #: ../fish/guestfish-actions.pod:1404
25238 #: ../fish/guestfish-actions.pod:1406
25247 #: ../fish/guestfish-actions.pod:1408
25249 "Return the current umask. By default the umask is C<022> unless it has been "
25250 "set by calling L</umask>."
25255 #: ../fish/guestfish-actions.pod:1411
25256 msgid "get-verbose"
25261 #: ../fish/guestfish-actions.pod:1413
25270 #: ../fish/guestfish-actions.pod:1417
25276 #: ../fish/guestfish-actions.pod:1419
25285 #: ../fish/guestfish-actions.pod:1423
25286 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
25291 #: ../fish/guestfish-actions.pod:1426
25297 #: ../fish/guestfish-actions.pod:1428
25300 " getxattr path name\n"
25306 #: ../fish/guestfish-actions.pod:1430
25308 "Get a single extended attribute from file C<path> named C<name>. This call "
25309 "follows symlinks. If you want to lookup an extended attribute for the "
25310 "symlink itself, use L</lgetxattr>."
25315 #: ../fish/guestfish-actions.pod:1434 ../fish/guestfish-actions.pod:2340
25317 "Normally it is better to get all extended attributes from a file in one go "
25318 "by calling L</getxattrs>. However some Linux filesystem implementations are "
25319 "buggy and do not provide a way to list out attributes. For these "
25320 "filesystems (notably ntfs-3g) you have to know the names of the extended "
25321 "attributes you want in advance and call this function."
25326 #: ../fish/guestfish-actions.pod:1444
25327 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
25332 #: ../fish/guestfish-actions.pod:1446
25338 #: ../fish/guestfish-actions.pod:1448
25341 " getxattrs path\n"
25347 #: ../fish/guestfish-actions.pod:1456
25348 msgid "See also: L</lgetxattrs>, L<attr(5)>."
25353 #: ../fish/guestfish-actions.pod:1458
25354 msgid "glob-expand"
25359 #: ../fish/guestfish-actions.pod:1460
25362 " glob-expand pattern\n"
25368 #: ../fish/guestfish-actions.pod:1473
25374 #: ../fish/guestfish-actions.pod:1475
25377 " grep regex path\n"
25383 #: ../fish/guestfish-actions.pod:1483
25389 #: ../fish/guestfish-actions.pod:1485
25392 " grepi regex path\n"
25398 #: ../fish/guestfish-actions.pod:1493
25399 msgid "grub-install"
25404 #: ../fish/guestfish-actions.pod:1495
25407 " grub-install root device\n"
25413 #: ../fish/guestfish-actions.pod:1511
25419 #: ../fish/guestfish-actions.pod:1513
25428 #: ../fish/guestfish-actions.pod:1521
25434 #: ../fish/guestfish-actions.pod:1523
25437 " head-n nrlines path\n"
25443 #: ../fish/guestfish-actions.pod:1536
25449 #: ../fish/guestfish-actions.pod:1538
25458 #: ../fish/guestfish-actions.pod:1546
25464 #: ../fish/guestfish-actions.pod:1548
25467 " initrd-cat initrdpath filename\n"
25473 #: ../fish/guestfish-actions.pod:1560
25474 msgid "See also L</initrd-list>."
25479 #: ../fish/guestfish-actions.pod:1565
25480 msgid "initrd-list"
25485 #: ../fish/guestfish-actions.pod:1567
25488 " initrd-list path\n"
25494 #: ../fish/guestfish-actions.pod:1579
25495 msgid "inotify-add-watch"
25500 #: ../fish/guestfish-actions.pod:1581
25503 " inotify-add-watch path mask\n"
25509 #: ../fish/guestfish-actions.pod:1593
25510 msgid "inotify-close"
25515 #: ../fish/guestfish-actions.pod:1595
25524 #: ../fish/guestfish-actions.pod:1601
25525 msgid "inotify-files"
25530 #: ../fish/guestfish-actions.pod:1603
25539 #: ../fish/guestfish-actions.pod:1605
25541 "This function is a helpful wrapper around L</inotify-read> which just "
25542 "returns a list of pathnames of objects that were touched. The returned "
25543 "pathnames are sorted and deduplicated."
25548 #: ../fish/guestfish-actions.pod:1609
25549 msgid "inotify-init"
25554 #: ../fish/guestfish-actions.pod:1611
25557 " inotify-init maxevents\n"
25563 #: ../fish/guestfish-actions.pod:1617
25565 "C<maxevents> is the maximum number of events which will be queued up between "
25566 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
25567 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
25568 "default was 16384 events. Beyond this limit, the kernel throws away events, "
25569 "but records the fact that it threw them away by setting a flag "
25570 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
25575 #: ../fish/guestfish-actions.pod:1627
25577 "Before any events are generated, you have to add some watches to the "
25578 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
25579 "L</inotify-watch-all>."
25584 #: ../fish/guestfish-actions.pod:1633
25586 "Queued up events should be read periodically by calling L</inotify-read> (or "
25587 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
25588 "If you don't read the events out often enough then you risk the internal "
25589 "queue overflowing."
25594 #: ../fish/guestfish-actions.pod:1640
25596 "The handle should be closed after use by calling L</inotify-close>. This "
25597 "also removes any watches automatically."
25602 #: ../fish/guestfish-actions.pod:1649
25603 msgid "inotify-read"
25608 #: ../fish/guestfish-actions.pod:1651
25617 #: ../fish/guestfish-actions.pod:1664
25618 msgid "inotify-rm-watch"
25623 #: ../fish/guestfish-actions.pod:1666
25626 " inotify-rm-watch wd\n"
25632 #: ../fish/guestfish-actions.pod:1668
25633 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
25638 #: ../fish/guestfish-actions.pod:1671
25639 msgid "inspect-get-arch"
25644 #: ../fish/guestfish-actions.pod:1673
25647 " inspect-get-arch root\n"
25653 #: ../fish/guestfish-actions.pod:1675 ../fish/guestfish-actions.pod:1691
25654 #: ../fish/guestfish-actions.pod:1765 ../fish/guestfish-actions.pod:1783
25655 #: ../fish/guestfish-actions.pod:1817 ../fish/guestfish-actions.pod:1832
25656 #: ../fish/guestfish-actions.pod:1853 ../fish/guestfish-actions.pod:1868
25657 #: ../fish/guestfish-actions.pod:1895 ../fish/guestfish-actions.pod:1917
25658 #: ../fish/guestfish-actions.pod:1941 ../fish/guestfish-actions.pod:1971
25659 #: ../fish/guestfish-actions.pod:2006 ../fish/guestfish-actions.pod:2022
25660 #: ../fish/guestfish-actions.pod:2035 ../fish/guestfish-actions.pod:2048
25661 #: ../fish/guestfish-actions.pod:2063
25663 "This function should only be called with a root device string as returned by "
25669 #: ../fish/guestfish-actions.pod:1678
25671 "This returns the architecture of the inspected operating system. The "
25672 "possible return values are listed under L</file-architecture>."
25677 #: ../fish/guestfish-actions.pod:1687
25678 msgid "inspect-get-distro"
25683 #: ../fish/guestfish-actions.pod:1689
25686 " inspect-get-distro root\n"
25692 #: ../fish/guestfish-actions.pod:1761
25693 msgid "inspect-get-filesystems"
25698 #: ../fish/guestfish-actions.pod:1763
25701 " inspect-get-filesystems root\n"
25707 #: ../fish/guestfish-actions.pod:1776
25709 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25710 "get-mountpoints>."
25714 #: ../fish/guestfish-actions.pod:1779
25715 msgid "inspect-get-format"
25719 #: ../fish/guestfish-actions.pod:1781
25722 " inspect-get-format root\n"
25728 #: ../fish/guestfish-actions.pod:1813
25729 msgid "inspect-get-hostname"
25734 #: ../fish/guestfish-actions.pod:1815
25737 " inspect-get-hostname root\n"
25743 #: ../fish/guestfish-actions.pod:1828
25744 msgid "inspect-get-major-version"
25749 #: ../fish/guestfish-actions.pod:1830
25752 " inspect-get-major-version root\n"
25758 #: ../fish/guestfish-actions.pod:1849
25759 msgid "inspect-get-minor-version"
25764 #: ../fish/guestfish-actions.pod:1851
25767 " inspect-get-minor-version root\n"
25773 #: ../fish/guestfish-actions.pod:1861
25775 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25776 "get-major-version>."
25781 #: ../fish/guestfish-actions.pod:1864
25782 msgid "inspect-get-mountpoints"
25787 #: ../fish/guestfish-actions.pod:1866
25790 " inspect-get-mountpoints root\n"
25796 #: ../fish/guestfish-actions.pod:1888
25798 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25799 "get-filesystems>."
25804 #: ../fish/guestfish-actions.pod:1891
25805 msgid "inspect-get-package-format"
25810 #: ../fish/guestfish-actions.pod:1893
25813 " inspect-get-package-format root\n"
25819 #: ../fish/guestfish-actions.pod:1898
25821 "This function and L</inspect-get-package-management> return the package "
25822 "format and package management tool used by the inspected operating system. "
25823 "For example for Fedora these functions would return C<rpm> (package format) "
25824 "and C<yum> (package management)."
25829 #: ../fish/guestfish-actions.pod:1913
25830 msgid "inspect-get-package-management"
25835 #: ../fish/guestfish-actions.pod:1915
25838 " inspect-get-package-management root\n"
25844 #: ../fish/guestfish-actions.pod:1920
25846 "L</inspect-get-package-format> and this function return the package format "
25847 "and package management tool used by the inspected operating system. For "
25848 "example for Fedora these functions would return C<rpm> (package format) and "
25849 "C<yum> (package management)."
25854 #: ../fish/guestfish-actions.pod:1937
25855 msgid "inspect-get-product-name"
25860 #: ../fish/guestfish-actions.pod:1939
25863 " inspect-get-product-name root\n"
25869 #: ../fish/guestfish-actions.pod:1954
25870 msgid "inspect-get-roots"
25875 #: ../fish/guestfish-actions.pod:1956
25878 " inspect-get-roots\n"
25884 #: ../fish/guestfish-actions.pod:1958
25886 "This function is a convenient way to get the list of root devices, as "
25887 "returned from a previous call to L</inspect-os>, but without redoing the "
25888 "whole inspection process."
25893 #: ../fish/guestfish-actions.pod:1962
25895 "This returns an empty list if either no root devices were found or the "
25896 "caller has not called L</inspect-os>."
25901 #: ../fish/guestfish-actions.pod:1967
25902 msgid "inspect-get-type"
25907 #: ../fish/guestfish-actions.pod:1969
25910 " inspect-get-type root\n"
25916 #: ../fish/guestfish-actions.pod:2002
25917 msgid "inspect-get-windows-systemroot"
25922 #: ../fish/guestfish-actions.pod:2004
25925 " inspect-get-windows-systemroot root\n"
25930 #: ../fish/guestfish-actions.pod:2018
25931 msgid "inspect-is-live"
25935 #: ../fish/guestfish-actions.pod:2020
25938 " inspect-is-live root\n"
25943 #: ../fish/guestfish-actions.pod:2025
25945 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
25946 "then this returns true if a live image was detected on the disk."
25950 #: ../fish/guestfish-actions.pod:2031
25951 msgid "inspect-is-multipart"
25955 #: ../fish/guestfish-actions.pod:2033
25958 " inspect-is-multipart root\n"
25963 #: ../fish/guestfish-actions.pod:2038
25965 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
25966 "then this returns true if the disk is part of a set."
25970 #: ../fish/guestfish-actions.pod:2044
25971 msgid "inspect-is-netinst"
25975 #: ../fish/guestfish-actions.pod:2046
25978 " inspect-is-netinst root\n"
25983 #: ../fish/guestfish-actions.pod:2051
25985 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
25986 "then this returns true if the disk is a network installer, ie. not a self-"
25987 "contained install CD but one which is likely to require network access to "
25988 "complete the install."
25993 #: ../fish/guestfish-actions.pod:2059
25994 msgid "inspect-list-applications"
25999 #: ../fish/guestfish-actions.pod:2061
26002 " inspect-list-applications root\n"
26008 #: ../fish/guestfish-actions.pod:2068
26010 "I<Note:> This call works differently from other parts of the inspection "
26011 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
26012 "then mount up the disks, before calling this. Listing applications is a "
26013 "significantly more difficult operation which requires access to the full "
26014 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
26015 "are just returning data cached in the libguestfs handle, this call actually "
26016 "reads parts of the mounted filesystems during the call."
26021 #: ../fish/guestfish-actions.pod:2158
26027 #: ../fish/guestfish-actions.pod:2160
26036 #: ../fish/guestfish-actions.pod:2175
26038 "You can pass the root string(s) returned to other L</inspect-get-*> "
26039 "functions in order to query further information about each operating system, "
26040 "such as the name and version."
26045 #: ../fish/guestfish-actions.pod:2180
26047 "This function uses other libguestfs features such as L</mount-ro> and L</"
26048 "umount-all> in order to mount and unmount filesystems and look at the "
26049 "contents. This should be called with no disks currently mounted. The "
26050 "function may also use Augeas, so any existing Augeas handle will be closed."
26055 #: ../fish/guestfish-actions.pod:2192 ../fish/guestfish-actions.pod:2368
26056 #: ../fish/guestfish-actions.pod:2414
26057 msgid "See also L</list-filesystems>."
26062 #: ../fish/guestfish-actions.pod:2194
26063 msgid "is-blockdev"
26068 #: ../fish/guestfish-actions.pod:2196
26071 " is-blockdev path\n"
26077 #: ../fish/guestfish-actions.pod:2201 ../fish/guestfish-actions.pod:2219
26078 #: ../fish/guestfish-actions.pod:2238 ../fish/guestfish-actions.pod:2247
26079 #: ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2291
26080 #: ../fish/guestfish-actions.pod:2300
26081 msgid "See also L</stat>."
26086 #: ../fish/guestfish-actions.pod:2203
26092 #: ../fish/guestfish-actions.pod:2205
26101 #: ../fish/guestfish-actions.pod:2212
26107 #: ../fish/guestfish-actions.pod:2214
26110 " is-chardev path\n"
26116 #: ../fish/guestfish-actions.pod:2221
26122 #: ../fish/guestfish-actions.pod:2223
26131 #: ../fish/guestfish-actions.pod:2230
26137 #: ../fish/guestfish-actions.pod:2232
26146 #: ../fish/guestfish-actions.pod:2240
26152 #: ../fish/guestfish-actions.pod:2242
26161 #: ../fish/guestfish-actions.pod:2249
26167 #: ../fish/guestfish-actions.pod:2251
26176 #: ../fish/guestfish-actions.pod:2259
26177 msgid "is-launching"
26182 #: ../fish/guestfish-actions.pod:2261
26191 #: ../fish/guestfish-actions.pod:2268
26197 #: ../fish/guestfish-actions.pod:2270
26206 #: ../fish/guestfish-actions.pod:2275
26212 #: ../fish/guestfish-actions.pod:2277
26221 #: ../fish/guestfish-actions.pod:2284
26227 #: ../fish/guestfish-actions.pod:2286
26230 " is-socket path\n"
26236 #: ../fish/guestfish-actions.pod:2293
26242 #: ../fish/guestfish-actions.pod:2295
26245 " is-symlink path\n"
26251 #: ../fish/guestfish-actions.pod:2302
26252 msgid "kill-subprocess"
26257 #: ../fish/guestfish-actions.pod:2304
26260 " kill-subprocess\n"
26266 #: ../fish/guestfish-actions.pod:2308
26272 #: ../fish/guestfish-actions.pod:2310
26278 #: ../fish/guestfish-actions.pod:2312
26287 #: ../fish/guestfish-actions.pod:2320
26293 #: ../fish/guestfish-actions.pod:2322
26296 " lchown owner group path\n"
26302 #: ../fish/guestfish-actions.pod:2324
26304 "Change the file owner to C<owner> and group to C<group>. This is like L</"
26305 "chown> but if C<path> is a symlink then the link itself is changed, not the "
26311 #: ../fish/guestfish-actions.pod:2332
26317 #: ../fish/guestfish-actions.pod:2334
26320 " lgetxattr path name\n"
26326 #: ../fish/guestfish-actions.pod:2350
26327 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
26332 #: ../fish/guestfish-actions.pod:2352
26338 #: ../fish/guestfish-actions.pod:2354
26341 " lgetxattrs path\n"
26347 #: ../fish/guestfish-actions.pod:2356
26349 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
26350 "it returns the extended attributes of the link itself."
26355 #: ../fish/guestfish-actions.pod:2360
26356 msgid "list-devices"
26361 #: ../fish/guestfish-actions.pod:2362
26370 #: ../fish/guestfish-actions.pod:2370
26371 msgid "list-filesystems"
26376 #: ../fish/guestfish-actions.pod:2372
26379 " list-filesystems\n"
26385 #: ../fish/guestfish-actions.pod:2391
26387 "This command runs other libguestfs commands, which might include L</mount> "
26388 "and L</umount>, and therefore you should use this soon after launch and only "
26389 "when nothing is mounted."
26394 #: ../fish/guestfish-actions.pod:2395
26396 "Not all of the filesystems returned will be mountable. In particular, swap "
26397 "partitions are returned in the list. Also this command does not check that "
26398 "each filesystem found is valid and mountable, and some filesystems might be "
26399 "mountable but require special options. Filesystems may not all belong to a "
26400 "single logical operating system (use L</inspect-os> to look for OSes)."
26405 #: ../fish/guestfish-actions.pod:2403
26406 msgid "list-partitions"
26411 #: ../fish/guestfish-actions.pod:2405
26414 " list-partitions\n"
26420 #: ../fish/guestfish-actions.pod:2411
26422 "This does not return logical volumes. For that you will need to call L</"
26428 #: ../fish/guestfish-actions.pod:2416
26434 #: ../fish/guestfish-actions.pod:2418
26443 #: ../fish/guestfish-actions.pod:2426
26449 #: ../fish/guestfish-actions.pod:2428
26452 " ln target linkname\n"
26458 #: ../fish/guestfish-actions.pod:2432
26464 #: ../fish/guestfish-actions.pod:2434
26467 " ln-f target linkname\n"
26473 #: ../fish/guestfish-actions.pod:2439
26479 #: ../fish/guestfish-actions.pod:2441
26482 " ln-s target linkname\n"
26488 #: ../fish/guestfish-actions.pod:2445
26494 #: ../fish/guestfish-actions.pod:2447
26497 " ln-sf target linkname\n"
26503 #: ../fish/guestfish-actions.pod:2452
26504 msgid "lremovexattr"
26509 #: ../fish/guestfish-actions.pod:2454
26512 " lremovexattr xattr path\n"
26518 #: ../fish/guestfish-actions.pod:2456
26520 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
26521 "it removes an extended attribute of the link itself."
26526 #: ../fish/guestfish-actions.pod:2460
26532 #: ../fish/guestfish-actions.pod:2462
26541 #: ../fish/guestfish-actions.pod:2468
26543 "This command is mostly useful for interactive sessions. Programs should "
26544 "probably use L</readdir> instead."
26549 #: ../fish/guestfish-actions.pod:2471
26555 #: ../fish/guestfish-actions.pod:2473
26558 " lsetxattr xattr val vallen path\n"
26564 #: ../fish/guestfish-actions.pod:2475
26566 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
26567 "sets an extended attribute of the link itself."
26572 #: ../fish/guestfish-actions.pod:2479
26578 #: ../fish/guestfish-actions.pod:2481
26587 #: ../fish/guestfish-actions.pod:2485
26589 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
26590 "the link is stat-ed, not the file it refers to."
26595 #: ../fish/guestfish-actions.pod:2491
26601 #: ../fish/guestfish-actions.pod:2493
26604 " lstatlist path 'names ...'\n"
26610 #: ../fish/guestfish-actions.pod:2495
26612 "This call allows you to perform the L</lstat> operation on multiple files, "
26613 "where all files are in the directory C<path>. C<names> is the list of files "
26614 "from this directory."
26619 #: ../fish/guestfish-actions.pod:2504
26621 "This call is intended for programs that want to efficiently list a directory "
26622 "contents without making many round-trips. See also L</lxattrlist> for a "
26623 "similarly efficient call for getting extended attributes. Very long "
26624 "directory listings might cause the protocol message size to be exceeded, "
26625 "causing this call to fail. The caller must split up such requests into "
26626 "smaller groups of names."
26631 #: ../fish/guestfish-actions.pod:2512
26632 msgid "luks-add-key"
26637 #: ../fish/guestfish-actions.pod:2514
26640 " luks-add-key device keyslot\n"
26646 #: ../fish/guestfish-actions.pod:2521
26648 "Note that if C<keyslot> already contains a key, then this command will "
26649 "fail. You have to use L</luks-kill-slot> first to remove that key."
26654 #: ../fish/guestfish-actions.pod:2525 ../fish/guestfish-actions.pod:2547
26655 #: ../fish/guestfish-actions.pod:2560 ../fish/guestfish-actions.pod:2574
26656 #: ../fish/guestfish-actions.pod:2597 ../fish/guestfish-actions.pod:2607
26658 "This command has one or more key or passphrase parameters. Guestfish will "
26659 "prompt for these separately."
26664 #: ../fish/guestfish-actions.pod:2528
26670 #: ../fish/guestfish-actions.pod:2530
26673 " luks-close device\n"
26679 #: ../fish/guestfish-actions.pod:2532
26681 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
26682 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
26683 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
26689 #: ../fish/guestfish-actions.pod:2538
26690 msgid "luks-format"
26695 #: ../fish/guestfish-actions.pod:2540
26698 " luks-format device keyslot\n"
26704 #: ../fish/guestfish-actions.pod:2553
26705 msgid "luks-format-cipher"
26710 #: ../fish/guestfish-actions.pod:2555
26713 " luks-format-cipher device keyslot cipher\n"
26719 #: ../fish/guestfish-actions.pod:2557
26721 "This command is the same as L</luks-format> but it also allows you to set "
26722 "the C<cipher> used."
26727 #: ../fish/guestfish-actions.pod:2566
26728 msgid "luks-kill-slot"
26733 #: ../fish/guestfish-actions.pod:2568
26736 " luks-kill-slot device keyslot\n"
26742 #: ../fish/guestfish-actions.pod:2577
26748 #: ../fish/guestfish-actions.pod:2579
26751 " luks-open device mapname\n"
26757 #: ../fish/guestfish-actions.pod:2593
26759 "If this block device contains LVM volume groups, then calling L</vgscan> "
26760 "followed by L</vg-activate-all> will make them visible."
26765 #: ../fish/guestfish-actions.pod:2600
26766 msgid "luks-open-ro"
26771 #: ../fish/guestfish-actions.pod:2602
26774 " luks-open-ro device mapname\n"
26780 #: ../fish/guestfish-actions.pod:2604
26782 "This is the same as L</luks-open> except that a read-only mapping is created."
26787 #: ../fish/guestfish-actions.pod:2610
26793 #: ../fish/guestfish-actions.pod:2612
26796 " lvcreate logvol volgroup mbytes\n"
26802 #: ../fish/guestfish-actions.pod:2617
26803 msgid "lvm-canonical-lv-name"
26808 #: ../fish/guestfish-actions.pod:2619
26811 " lvm-canonical-lv-name lvname\n"
26817 #: ../fish/guestfish-actions.pod:2628
26818 msgid "See also L</is-lv>."
26823 #: ../fish/guestfish-actions.pod:2630
26824 msgid "lvm-clear-filter"
26829 #: ../fish/guestfish-actions.pod:2632
26832 " lvm-clear-filter\n"
26838 #: ../fish/guestfish-actions.pod:2634
26840 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
26846 #: ../fish/guestfish-actions.pod:2640
26847 msgid "lvm-remove-all"
26852 #: ../fish/guestfish-actions.pod:2642
26855 " lvm-remove-all\n"
26861 #: ../fish/guestfish-actions.pod:2650
26862 msgid "lvm-set-filter"
26867 #: ../fish/guestfish-actions.pod:2652
26870 " lvm-set-filter 'devices ...'\n"
26876 #: ../fish/guestfish-actions.pod:2677
26882 #: ../fish/guestfish-actions.pod:2679
26885 " lvremove device\n"
26891 #: ../fish/guestfish-actions.pod:2687
26897 #: ../fish/guestfish-actions.pod:2689
26900 " lvrename logvol newlogvol\n"
26906 #: ../fish/guestfish-actions.pod:2693
26912 #: ../fish/guestfish-actions.pod:2695
26915 " lvresize device mbytes\n"
26921 #: ../fish/guestfish-actions.pod:2701
26922 msgid "lvresize-free"
26927 #: ../fish/guestfish-actions.pod:2703
26930 " lvresize-free lv percent\n"
26936 #: ../fish/guestfish-actions.pod:2711
26942 #: ../fish/guestfish-actions.pod:2713
26951 #: ../fish/guestfish-actions.pod:2721
26952 msgid "See also L</lvs-full>, L</list-filesystems>."
26957 #: ../fish/guestfish-actions.pod:2723
26963 #: ../fish/guestfish-actions.pod:2725
26972 #: ../fish/guestfish-actions.pod:2730
26978 #: ../fish/guestfish-actions.pod:2732
26987 #: ../fish/guestfish-actions.pod:2736
26993 #: ../fish/guestfish-actions.pod:2738
26996 " lxattrlist path 'names ...'\n"
27002 #: ../fish/guestfish-actions.pod:2754
27004 "This call is intended for programs that want to efficiently list a directory "
27005 "contents without making many round-trips. See also L</lstatlist> for a "
27006 "similarly efficient call for getting standard stats. Very long directory "
27007 "listings might cause the protocol message size to be exceeded, causing this "
27008 "call to fail. The caller must split up such requests into smaller groups of "
27014 #: ../fish/guestfish-actions.pod:2762
27020 #: ../fish/guestfish-actions.pod:2764
27029 #: ../fish/guestfish-actions.pod:2768
27035 #: ../fish/guestfish-actions.pod:2770
27038 " mkdir-mode path mode\n"
27044 #: ../fish/guestfish-actions.pod:2779
27045 msgid "See also L</mkdir>, L</umask>"
27050 #: ../fish/guestfish-actions.pod:2781
27056 #: ../fish/guestfish-actions.pod:2783
27065 #: ../fish/guestfish-actions.pod:2788
27071 #: ../fish/guestfish-actions.pod:2790
27074 " mkdtemp template\n"
27080 #: ../fish/guestfish-actions.pod:2811
27086 #: ../fish/guestfish-actions.pod:2813
27089 " mke2fs-J fstype blocksize device journal\n"
27095 #: ../fish/guestfish-actions.pod:2821
27096 msgid "See also L</mke2journal>."
27101 #: ../fish/guestfish-actions.pod:2823
27107 #: ../fish/guestfish-actions.pod:2825
27110 " mke2fs-JL fstype blocksize device label\n"
27116 #: ../fish/guestfish-actions.pod:2830
27117 msgid "See also L</mke2journal-L>."
27122 #: ../fish/guestfish-actions.pod:2832
27128 #: ../fish/guestfish-actions.pod:2834
27131 " mke2fs-JU fstype blocksize device uuid\n"
27137 #: ../fish/guestfish-actions.pod:2839
27138 msgid "See also L</mke2journal-U>."
27143 #: ../fish/guestfish-actions.pod:2841
27144 msgid "mke2journal"
27149 #: ../fish/guestfish-actions.pod:2843
27152 " mke2journal blocksize device\n"
27158 #: ../fish/guestfish-actions.pod:2850
27159 msgid "mke2journal-L"
27164 #: ../fish/guestfish-actions.pod:2852
27167 " mke2journal-L blocksize label device\n"
27173 #: ../fish/guestfish-actions.pod:2856
27174 msgid "mke2journal-U"
27179 #: ../fish/guestfish-actions.pod:2858
27182 " mke2journal-U blocksize uuid device\n"
27188 #: ../fish/guestfish-actions.pod:2862
27194 #: ../fish/guestfish-actions.pod:2864
27197 " mkfifo mode path\n"
27203 #: ../fish/guestfish-actions.pod:2866
27205 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
27206 "is just a convenient wrapper around L</mknod>."
27211 #: ../fish/guestfish-actions.pod:2872
27217 #: ../fish/guestfish-actions.pod:2874
27220 " mkfs fstype device\n"
27226 #: ../fish/guestfish-actions.pod:2880
27232 #: ../fish/guestfish-actions.pod:2882
27235 " mkfs-b fstype blocksize device\n"
27241 #: ../fish/guestfish-actions.pod:2884
27243 "This call is similar to L</mkfs>, but it allows you to control the block "
27244 "size of the resulting filesystem. Supported block sizes depend on the "
27245 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
27250 #: ../fish/guestfish-actions.pod:2899
27255 #: ../fish/guestfish-actions.pod:2901
27258 " mkfs-opts fstype device [blocksize:..] [features:..]\n"
27264 #: ../fish/guestfish-actions.pod:2936
27265 msgid "mkmountpoint"
27270 #: ../fish/guestfish-actions.pod:2938
27273 " mkmountpoint exemptpath\n"
27279 #: ../fish/guestfish-actions.pod:2940
27281 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
27282 "to create extra mountpoints before mounting the first filesystem."
27287 #: ../fish/guestfish-actions.pod:2964
27289 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
27290 "unexpected errors if you try to mix these calls. It is safest to manually "
27291 "unmount filesystems and remove mountpoints after use."
27296 #: ../fish/guestfish-actions.pod:2968
27298 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
27299 "for this to work for manual mountpoints, you must ensure that the innermost "
27300 "mountpoints have the longest pathnames, as in the example code above."
27304 #: ../fish/guestfish-actions.pod:2975
27306 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
27307 "L</umount-all> to be called when the handle is closed which can also trigger "
27313 #: ../fish/guestfish-actions.pod:2979
27319 #: ../fish/guestfish-actions.pod:2981
27322 " mknod mode devmajor devminor path\n"
27328 #: ../fish/guestfish-actions.pod:2991
27330 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27331 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27332 "regular file). These constants are available in the standard Linux header "
27333 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
27334 "wrappers around this command which bitwise OR in the appropriate constant "
27340 #: ../fish/guestfish-actions.pod:3001
27346 #: ../fish/guestfish-actions.pod:3003
27349 " mknod-b mode devmajor devminor path\n"
27355 #: ../fish/guestfish-actions.pod:3005
27357 "This call creates a block device node called C<path> with mode C<mode> and "
27358 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27359 "wrapper around L</mknod>."
27364 #: ../fish/guestfish-actions.pod:3011
27370 #: ../fish/guestfish-actions.pod:3013
27373 " mknod-c mode devmajor devminor path\n"
27379 #: ../fish/guestfish-actions.pod:3015
27381 "This call creates a char device node called C<path> with mode C<mode> and "
27382 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27383 "wrapper around L</mknod>."
27388 #: ../fish/guestfish-actions.pod:3021
27394 #: ../fish/guestfish-actions.pod:3023
27403 #: ../fish/guestfish-actions.pod:3027
27409 #: ../fish/guestfish-actions.pod:3029
27412 " mkswap-L label device\n"
27418 #: ../fish/guestfish-actions.pod:3037
27424 #: ../fish/guestfish-actions.pod:3039
27427 " mkswap-U uuid device\n"
27433 #: ../fish/guestfish-actions.pod:3043
27434 msgid "mkswap-file"
27439 #: ../fish/guestfish-actions.pod:3045
27442 " mkswap-file path\n"
27448 #: ../fish/guestfish-actions.pod:3049
27450 "This command just writes a swap file signature to an existing file. To "
27451 "create the file itself, use something like L</fallocate>."
27456 #: ../fish/guestfish-actions.pod:3052
27462 #: ../fish/guestfish-actions.pod:3054
27465 " modprobe modulename\n"
27471 #: ../fish/guestfish-actions.pod:3061
27477 #: ../fish/guestfish-actions.pod:3063
27480 " mount device mountpoint\n"
27486 #: ../fish/guestfish-actions.pod:3079
27488 "B<Important note:> When you use this call, the filesystem options C<sync> "
27489 "and C<noatime> are set implicitly. This was originally done because we "
27490 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27491 "very large negative performance impact and negligible effect on "
27492 "reliability. Therefore we recommend that you avoid using L</mount> in any "
27493 "code that needs performance, and instead use L</mount-options> (use an empty "
27494 "string for the first parameter if you don't want any options)."
27499 #: ../fish/guestfish-actions.pod:3089
27505 #: ../fish/guestfish-actions.pod:3091
27508 " mount-loop file mountpoint\n"
27514 #: ../fish/guestfish-actions.pod:3097
27515 msgid "mount-options"
27520 #: ../fish/guestfish-actions.pod:3099
27523 " mount-options options device mountpoint\n"
27529 #: ../fish/guestfish-actions.pod:3101
27531 "This is the same as the L</mount> command, but it allows you to set the "
27532 "mount options as for the L<mount(8)> I<-o> flag."
27537 #: ../fish/guestfish-actions.pod:3109
27543 #: ../fish/guestfish-actions.pod:3111
27546 " mount-ro device mountpoint\n"
27552 #: ../fish/guestfish-actions.pod:3113
27554 "This is the same as the L</mount> command, but it mounts the filesystem with "
27555 "the read-only (I<-o ro>) flag."
27560 #: ../fish/guestfish-actions.pod:3116
27566 #: ../fish/guestfish-actions.pod:3118
27569 " mount-vfs options vfstype device mountpoint\n"
27575 #: ../fish/guestfish-actions.pod:3120
27577 "This is the same as the L</mount> command, but it allows you to set both the "
27578 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
27583 #: ../fish/guestfish-actions.pod:3124
27584 msgid "mountpoints"
27589 #: ../fish/guestfish-actions.pod:3126
27598 #: ../fish/guestfish-actions.pod:3128
27600 "This call is similar to L</mounts>. That call returns a list of devices. "
27601 "This one returns a hash table (map) of device name to directory where the "
27602 "device is mounted."
27607 #: ../fish/guestfish-actions.pod:3132
27613 #: ../fish/guestfish-actions.pod:3134
27622 #: ../fish/guestfish-actions.pod:3141
27623 msgid "See also: L</mountpoints>"
27628 #: ../fish/guestfish-actions.pod:3143
27634 #: ../fish/guestfish-actions.pod:3145
27643 #: ../fish/guestfish-actions.pod:3150
27644 msgid "ntfs-3g-probe"
27649 #: ../fish/guestfish-actions.pod:3152
27652 " ntfs-3g-probe true|false device\n"
27658 #: ../fish/guestfish-actions.pod:3166
27664 #: ../fish/guestfish-actions.pod:3168
27667 " ntfsresize device\n"
27673 #: ../fish/guestfish-actions.pod:3174
27674 msgid "ntfsresize-size"
27679 #: ../fish/guestfish-actions.pod:3176
27682 " ntfsresize-size device size\n"
27688 #: ../fish/guestfish-actions.pod:3178
27690 "This command is the same as L</ntfsresize> except that it allows you to "
27691 "specify the new size (in bytes) explicitly."
27696 #: ../fish/guestfish-actions.pod:3181
27702 #: ../fish/guestfish-actions.pod:3183
27705 " part-add device prlogex startsect endsect\n"
27711 #: ../fish/guestfish-actions.pod:3185
27713 "This command adds a partition to C<device>. If there is no partition table "
27714 "on the device, call L</part-init> first."
27719 #: ../fish/guestfish-actions.pod:3197
27721 "Creating a partition which covers the whole disk is not so easy. Use L</"
27722 "part-disk> to do that."
27727 #: ../fish/guestfish-actions.pod:3200
27733 #: ../fish/guestfish-actions.pod:3202
27736 " part-del device partnum\n"
27742 #: ../fish/guestfish-actions.pod:3210
27748 #: ../fish/guestfish-actions.pod:3212
27751 " part-disk device parttype\n"
27757 #: ../fish/guestfish-actions.pod:3214
27759 "This command is simply a combination of L</part-init> followed by L</part-"
27760 "add> to create a single primary partition covering the whole disk."
27765 #: ../fish/guestfish-actions.pod:3218
27767 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27768 "possible values are described in L</part-init>."
27773 #: ../fish/guestfish-actions.pod:3224
27774 msgid "part-get-bootable"
27779 #: ../fish/guestfish-actions.pod:3226
27782 " part-get-bootable device partnum\n"
27788 #: ../fish/guestfish-actions.pod:3231
27789 msgid "See also L</part-set-bootable>."
27794 #: ../fish/guestfish-actions.pod:3233
27795 msgid "part-get-mbr-id"
27800 #: ../fish/guestfish-actions.pod:3235
27803 " part-get-mbr-id device partnum\n"
27809 #: ../fish/guestfish-actions.pod:3240 ../fish/guestfish-actions.pod:3378
27811 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27812 "undefined results for other partition table types (see L</part-get-"
27818 #: ../fish/guestfish-actions.pod:3244
27819 msgid "part-get-parttype"
27824 #: ../fish/guestfish-actions.pod:3246
27827 " part-get-parttype device\n"
27833 #: ../fish/guestfish-actions.pod:3251
27835 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27836 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27837 "possible, although unusual. See L</part-init> for a full list."
27842 #: ../fish/guestfish-actions.pod:3256
27848 #: ../fish/guestfish-actions.pod:3258
27851 " part-init device parttype\n"
27857 #: ../fish/guestfish-actions.pod:3264
27859 "Initially there are no partitions. Following this, you should call L</part-"
27860 "add> for each partition required."
27865 #: ../fish/guestfish-actions.pod:3327
27871 #: ../fish/guestfish-actions.pod:3329
27874 " part-list device\n"
27880 #: ../fish/guestfish-actions.pod:3344
27882 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27883 "the device's sector size, see L</blockdev-getss>."
27888 #: ../fish/guestfish-actions.pod:3357
27889 msgid "part-set-bootable"
27894 #: ../fish/guestfish-actions.pod:3359
27897 " part-set-bootable device partnum true|false\n"
27903 #: ../fish/guestfish-actions.pod:3368
27904 msgid "part-set-mbr-id"
27909 #: ../fish/guestfish-actions.pod:3370
27912 " part-set-mbr-id device partnum idbyte\n"
27918 #: ../fish/guestfish-actions.pod:3382
27919 msgid "part-set-name"
27924 #: ../fish/guestfish-actions.pod:3384
27927 " part-set-name device partnum name\n"
27933 #: ../fish/guestfish-actions.pod:3392
27934 msgid "part-to-dev"
27939 #: ../fish/guestfish-actions.pod:3394
27942 " part-to-dev partition\n"
27948 #: ../fish/guestfish-actions.pod:3400
27950 "The named partition must exist, for example as a string returned from L</"
27951 "list-partitions>."
27956 #: ../fish/guestfish-actions.pod:3403
27957 msgid "ping-daemon"
27962 #: ../fish/guestfish-actions.pod:3405
27971 #: ../fish/guestfish-actions.pod:3412
27977 #: ../fish/guestfish-actions.pod:3414
27980 " pread path count offset\n"
27986 #: ../fish/guestfish-actions.pod:3422
27987 msgid "See also L</pwrite>, L</pread-device>."
27992 #: ../fish/guestfish-actions.pod:3427
27993 msgid "pread-device"
27998 #: ../fish/guestfish-actions.pod:3429
28001 " pread-device device count offset\n"
28007 #: ../fish/guestfish-actions.pod:3437
28008 msgid "See also L</pread>."
28013 #: ../fish/guestfish-actions.pod:3442
28019 #: ../fish/guestfish-actions.pod:3444
28022 " pvcreate device\n"
28028 #: ../fish/guestfish-actions.pod:3450
28034 #: ../fish/guestfish-actions.pod:3452
28037 " pvremove device\n"
28043 #: ../fish/guestfish-actions.pod:3461
28049 #: ../fish/guestfish-actions.pod:3463
28052 " pvresize device\n"
28058 #: ../fish/guestfish-actions.pod:3468
28059 msgid "pvresize-size"
28064 #: ../fish/guestfish-actions.pod:3470
28067 " pvresize-size device size\n"
28073 #: ../fish/guestfish-actions.pod:3472
28075 "This command is the same as L</pvresize> except that it allows you to "
28076 "specify the new size (in bytes) explicitly."
28081 #: ../fish/guestfish-actions.pod:3475
28087 #: ../fish/guestfish-actions.pod:3477
28096 #: ../fish/guestfish-actions.pod:3485
28097 msgid "See also L</pvs-full>."
28102 #: ../fish/guestfish-actions.pod:3487
28108 #: ../fish/guestfish-actions.pod:3489
28117 #: ../fish/guestfish-actions.pod:3494
28123 #: ../fish/guestfish-actions.pod:3496
28132 #: ../fish/guestfish-actions.pod:3500
28138 #: ../fish/guestfish-actions.pod:3502
28141 " pwrite path content offset\n"
28147 #: ../fish/guestfish-actions.pod:3513
28148 msgid "See also L</pread>, L</pwrite-device>."
28153 #: ../fish/guestfish-actions.pod:3518
28154 msgid "pwrite-device"
28159 #: ../fish/guestfish-actions.pod:3520
28162 " pwrite-device device content offset\n"
28168 #: ../fish/guestfish-actions.pod:3530
28169 msgid "See also L</pwrite>."
28174 #: ../fish/guestfish-actions.pod:3535
28180 #: ../fish/guestfish-actions.pod:3537
28183 " read-file path\n"
28189 #: ../fish/guestfish-actions.pod:3542
28191 "Unlike L</cat>, this function can correctly handle files that contain "
28192 "embedded ASCII NUL characters. However unlike L</download>, this function "
28193 "is limited in the total size of file that can be handled."
28198 #: ../fish/guestfish-actions.pod:3550
28204 #: ../fish/guestfish-actions.pod:3552
28207 " read-lines path\n"
28213 #: ../fish/guestfish-actions.pod:3559
28215 "Note that this function cannot correctly handle binary files (specifically, "
28216 "files containing C<\\0> character which is treated as end of line). For "
28217 "those you need to use the L</read-file> function which has a more complex "
28223 #: ../fish/guestfish-actions.pod:3564
28229 #: ../fish/guestfish-actions.pod:3566
28238 #: ../fish/guestfish-actions.pod:3618
28240 "This function is primarily intended for use by programs. To get a simple "
28241 "list of names, use L</ls>. To get a printable directory for human "
28242 "consumption, use L</ll>."
28247 #: ../fish/guestfish-actions.pod:3622
28253 #: ../fish/guestfish-actions.pod:3624
28262 #: ../fish/guestfish-actions.pod:3628
28263 msgid "readlinklist"
28268 #: ../fish/guestfish-actions.pod:3630
28271 " readlinklist path 'names ...'\n"
28277 #: ../fish/guestfish-actions.pod:3654
28283 #: ../fish/guestfish-actions.pod:3656
28292 #: ../fish/guestfish-actions.pod:3661
28293 msgid "removexattr"
28298 #: ../fish/guestfish-actions.pod:3663
28301 " removexattr xattr path\n"
28307 #: ../fish/guestfish-actions.pod:3668
28308 msgid "See also: L</lremovexattr>, L<attr(5)>."
28313 #: ../fish/guestfish-actions.pod:3670
28319 #: ../fish/guestfish-actions.pod:3672
28322 " resize2fs device\n"
28328 #: ../fish/guestfish-actions.pod:3677
28330 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
28331 "before calling this command. For unknown reasons C<resize2fs> sometimes "
28332 "gives an error about this and sometimes not. In any case, it is always safe "
28333 "to call L</e2fsck-f> before calling this function."
28337 #: ../fish/guestfish-actions.pod:3683
28338 msgid "resize2fs-M"
28342 #: ../fish/guestfish-actions.pod:3685
28345 " resize2fs-M device\n"
28350 #: ../fish/guestfish-actions.pod:3687
28352 "This command is the same as L</resize2fs>, but the filesystem is resized to "
28353 "its minimum size. This works like the C<-M> option to the C<resize2fs> "
28358 #: ../fish/guestfish-actions.pod:3691
28360 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
28361 "and read the C<Block size> and C<Block count> values. These two numbers, "
28362 "multiplied together, give the resulting size of the minimal filesystem in "
28368 #: ../fish/guestfish-actions.pod:3696
28369 msgid "resize2fs-size"
28374 #: ../fish/guestfish-actions.pod:3698
28377 " resize2fs-size device size\n"
28383 #: ../fish/guestfish-actions.pod:3700
28385 "This command is the same as L</resize2fs> except that it allows you to "
28386 "specify the new size (in bytes) explicitly."
28391 #: ../fish/guestfish-actions.pod:3703
28397 #: ../fish/guestfish-actions.pod:3705
28406 #: ../fish/guestfish-actions.pod:3709
28412 #: ../fish/guestfish-actions.pod:3711
28421 #: ../fish/guestfish-actions.pod:3717
28427 #: ../fish/guestfish-actions.pod:3719
28436 #: ../fish/guestfish-actions.pod:3723
28437 msgid "rmmountpoint"
28442 #: ../fish/guestfish-actions.pod:3725
28445 " rmmountpoint exemptpath\n"
28451 #: ../fish/guestfish-actions.pod:3727
28453 "This calls removes a mountpoint that was previously created with L</"
28454 "mkmountpoint>. See L</mkmountpoint> for full details."
28459 #: ../fish/guestfish-actions.pod:3731
28460 msgid "scrub-device"
28465 #: ../fish/guestfish-actions.pod:3733
28468 " scrub-device device\n"
28474 #: ../fish/guestfish-actions.pod:3744
28480 #: ../fish/guestfish-actions.pod:3746
28483 " scrub-file file\n"
28489 #: ../fish/guestfish-actions.pod:3756
28490 msgid "scrub-freespace"
28495 #: ../fish/guestfish-actions.pod:3758
28498 " scrub-freespace dir\n"
28504 #: ../fish/guestfish-actions.pod:3760
28506 "This command creates the directory C<dir> and then fills it with files until "
28507 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
28508 "deletes them. The intention is to scrub any free space on the partition "
28509 "containing C<dir>."
28514 #: ../fish/guestfish-actions.pod:3769
28520 #: ../fish/guestfish-actions.pod:3771
28526 #: ../fish/guestfish-actions.pod:3773
28529 " set-append append\n"
28535 #: ../fish/guestfish-actions.pod:3784
28536 msgid "set-autosync"
28541 #: ../fish/guestfish-actions.pod:3786
28547 #: ../fish/guestfish-actions.pod:3788
28550 " set-autosync true|false\n"
28556 #: ../fish/guestfish-actions.pod:3798
28562 #: ../fish/guestfish-actions.pod:3800
28568 #: ../fish/guestfish-actions.pod:3802
28571 " set-direct true|false\n"
28577 #: ../fish/guestfish-actions.pod:3808
28579 "One consequence of this is that log messages aren't caught by the library "
28580 "and handled by L</set-log-message-callback>, but go straight to stdout."
28585 #: ../fish/guestfish-actions.pod:3817
28586 msgid "set-e2label"
28591 #: ../fish/guestfish-actions.pod:3819
28594 " set-e2label device label\n"
28600 #: ../fish/guestfish-actions.pod:3825
28602 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
28603 "label on a filesystem."
28608 #: ../fish/guestfish-actions.pod:3828
28614 #: ../fish/guestfish-actions.pod:3830
28617 " set-e2uuid device uuid\n"
28623 #: ../fish/guestfish-actions.pod:3837
28625 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
28626 "UUID of a filesystem."
28631 #: ../fish/guestfish-actions.pod:3840
28632 msgid "set-memsize"
28637 #: ../fish/guestfish-actions.pod:3842
28643 #: ../fish/guestfish-actions.pod:3844
28646 " set-memsize memsize\n"
28652 #: ../fish/guestfish-actions.pod:3846
28654 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28655 "This only has any effect if called before L</launch>."
28660 #: ../fish/guestfish-actions.pod:3857
28661 msgid "set-network"
28666 #: ../fish/guestfish-actions.pod:3859
28672 #: ../fish/guestfish-actions.pod:3861
28675 " set-network true|false\n"
28681 #: ../fish/guestfish-actions.pod:3869
28683 "You must call this before calling L</launch>, otherwise it has no effect."
28688 #: ../fish/guestfish-actions.pod:3872
28694 #: ../fish/guestfish-actions.pod:3874
28700 #: ../fish/guestfish-actions.pod:3876
28703 " set-path searchpath\n"
28709 #: ../fish/guestfish-actions.pod:3885
28715 #: ../fish/guestfish-actions.pod:3887
28721 #: ../fish/guestfish-actions.pod:3889
28730 #: ../fish/guestfish-actions.pod:3909
28731 msgid "set-recovery-proc"
28736 #: ../fish/guestfish-actions.pod:3911
28737 msgid "recovery-proc"
28742 #: ../fish/guestfish-actions.pod:3913
28745 " set-recovery-proc true|false\n"
28751 #: ../fish/guestfish-actions.pod:3915
28753 "If this is called with the parameter C<false> then L</launch> does not "
28754 "create a recovery process. The purpose of the recovery process is to stop "
28755 "runaway qemu processes in the case where the main program aborts abruptly."
28760 #: ../fish/guestfish-actions.pod:3920
28762 "This only has any effect if called before L</launch>, and the default is "
28768 #: ../fish/guestfish-actions.pod:3929
28769 msgid "set-selinux"
28774 #: ../fish/guestfish-actions.pod:3931
28780 #: ../fish/guestfish-actions.pod:3933
28783 " set-selinux true|false\n"
28789 #: ../fish/guestfish-actions.pod:3944
28795 #: ../fish/guestfish-actions.pod:3946
28801 #: ../fish/guestfish-actions.pod:3948
28804 " set-trace true|false\n"
28810 #: ../fish/guestfish-actions.pod:3964
28811 msgid "set-verbose"
28816 #: ../fish/guestfish-actions.pod:3966
28822 #: ../fish/guestfish-actions.pod:3968
28825 " set-verbose true|false\n"
28831 #: ../fish/guestfish-actions.pod:3975
28837 #: ../fish/guestfish-actions.pod:3977
28840 " setcon context\n"
28846 #: ../fish/guestfish-actions.pod:3984
28852 #: ../fish/guestfish-actions.pod:3986
28855 " setxattr xattr val vallen path\n"
28861 #: ../fish/guestfish-actions.pod:3992
28862 msgid "See also: L</lsetxattr>, L<attr(5)>."
28867 #: ../fish/guestfish-actions.pod:3994
28873 #: ../fish/guestfish-actions.pod:3996
28876 " sfdisk device cyls heads sectors 'lines ...'\n"
28882 #: ../fish/guestfish-actions.pod:4018
28883 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
28888 #: ../fish/guestfish-actions.pod:4024
28894 #: ../fish/guestfish-actions.pod:4026
28897 " sfdiskM device 'lines ...'\n"
28903 #: ../fish/guestfish-actions.pod:4028
28905 "This is a simplified interface to the L</sfdisk> command, where partition "
28906 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
28907 "you don't need to specify the cyls, heads and sectors parameters which were "
28908 "rarely if ever used anyway."
28913 #: ../fish/guestfish-actions.pod:4034
28914 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
28919 #: ../fish/guestfish-actions.pod:4040
28925 #: ../fish/guestfish-actions.pod:4042
28928 " sfdisk-N device partnum cyls heads sectors line\n"
28934 #: ../fish/guestfish-actions.pod:4047
28936 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
28937 "cyls/heads/sectors parameters."
28942 #: ../fish/guestfish-actions.pod:4050
28943 msgid "See also: L</part-add>"
28948 #: ../fish/guestfish-actions.pod:4055
28949 msgid "sfdisk-disk-geometry"
28954 #: ../fish/guestfish-actions.pod:4057
28957 " sfdisk-disk-geometry device\n"
28963 #: ../fish/guestfish-actions.pod:4059
28965 "This displays the disk geometry of C<device> read from the partition table. "
28966 "Especially in the case where the underlying block device has been resized, "
28967 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
28968 "kernel-geometry>)."
28973 #: ../fish/guestfish-actions.pod:4067
28974 msgid "sfdisk-kernel-geometry"
28979 #: ../fish/guestfish-actions.pod:4069
28982 " sfdisk-kernel-geometry device\n"
28988 #: ../fish/guestfish-actions.pod:4076
28994 #: ../fish/guestfish-actions.pod:4078
28997 " sfdisk-l device\n"
29003 #: ../fish/guestfish-actions.pod:4084
29004 msgid "See also: L</part-list>"
29009 #: ../fish/guestfish-actions.pod:4086
29015 #: ../fish/guestfish-actions.pod:4088
29024 #: ../fish/guestfish-actions.pod:4093
29025 msgid "This is like L</command>, but passes the command to:"
29030 #: ../fish/guestfish-actions.pod:4101
29031 msgid "All the provisos about L</command> apply to this call."
29036 #: ../fish/guestfish-actions.pod:4103
29042 #: ../fish/guestfish-actions.pod:4105
29045 " sh-lines command\n"
29051 #: ../fish/guestfish-actions.pod:4107
29052 msgid "This is the same as L</sh>, but splits the result into a list of lines."
29057 #: ../fish/guestfish-actions.pod:4110
29058 msgid "See also: L</command-lines>"
29063 #: ../fish/guestfish-actions.pod:4112
29069 #: ../fish/guestfish-actions.pod:4114
29078 #: ../fish/guestfish-actions.pod:4118
29084 #: ../fish/guestfish-actions.pod:4120
29093 #: ../fish/guestfish-actions.pod:4126
29099 #: ../fish/guestfish-actions.pod:4128
29108 #: ../fish/guestfish-actions.pod:4136
29114 #: ../fish/guestfish-actions.pod:4138
29123 #: ../fish/guestfish-actions.pod:4146
29129 #: ../fish/guestfish-actions.pod:4148
29132 " strings-e encoding path\n"
29138 #: ../fish/guestfish-actions.pod:4150
29140 "This is like the L</strings> command, but allows you to specify the encoding "
29141 "of strings that are looked for in the source file C<path>."
29146 #: ../fish/guestfish-actions.pod:4160
29148 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29149 "ISO-8859-X (this is what L</strings> uses)."
29154 #: ../fish/guestfish-actions.pod:4192
29155 msgid "swapoff-device"
29160 #: ../fish/guestfish-actions.pod:4194
29163 " swapoff-device device\n"
29169 #: ../fish/guestfish-actions.pod:4196
29171 "This command disables the libguestfs appliance swap device or partition "
29172 "named C<device>. See L</swapon-device>."
29177 #: ../fish/guestfish-actions.pod:4200
29178 msgid "swapoff-file"
29183 #: ../fish/guestfish-actions.pod:4202
29186 " swapoff-file file\n"
29192 #: ../fish/guestfish-actions.pod:4206
29193 msgid "swapoff-label"
29198 #: ../fish/guestfish-actions.pod:4208
29201 " swapoff-label label\n"
29207 #: ../fish/guestfish-actions.pod:4213
29208 msgid "swapoff-uuid"
29213 #: ../fish/guestfish-actions.pod:4215
29216 " swapoff-uuid uuid\n"
29222 #: ../fish/guestfish-actions.pod:4220
29223 msgid "swapon-device"
29228 #: ../fish/guestfish-actions.pod:4222
29231 " swapon-device device\n"
29237 #: ../fish/guestfish-actions.pod:4224
29239 "This command enables the libguestfs appliance to use the swap device or "
29240 "partition named C<device>. The increased memory is made available for all "
29241 "commands, for example those run using L</command> or L</sh>."
29246 #: ../fish/guestfish-actions.pod:4236
29247 msgid "swapon-file"
29252 #: ../fish/guestfish-actions.pod:4238
29255 " swapon-file file\n"
29261 #: ../fish/guestfish-actions.pod:4240
29263 "This command enables swap to a file. See L</swapon-device> for other notes."
29268 #: ../fish/guestfish-actions.pod:4243
29269 msgid "swapon-label"
29274 #: ../fish/guestfish-actions.pod:4245
29277 " swapon-label label\n"
29283 #: ../fish/guestfish-actions.pod:4247
29285 "This command enables swap to a labeled swap partition. See L</swapon-"
29286 "device> for other notes."
29291 #: ../fish/guestfish-actions.pod:4250
29292 msgid "swapon-uuid"
29297 #: ../fish/guestfish-actions.pod:4252
29300 " swapon-uuid uuid\n"
29306 #: ../fish/guestfish-actions.pod:4254
29308 "This command enables swap to a swap partition with the given UUID. See L</"
29309 "swapon-device> for other notes."
29314 #: ../fish/guestfish-actions.pod:4257
29320 #: ../fish/guestfish-actions.pod:4259
29329 #: ../fish/guestfish-actions.pod:4267
29335 #: ../fish/guestfish-actions.pod:4269
29344 #: ../fish/guestfish-actions.pod:4277
29350 #: ../fish/guestfish-actions.pod:4279
29353 " tail-n nrlines path\n"
29359 #: ../fish/guestfish-actions.pod:4292
29365 #: ../fish/guestfish-actions.pod:4294
29368 " tar-in (tarfile|-) directory\n"
29374 #: ../fish/guestfish-actions.pod:4299
29375 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
29380 #: ../fish/guestfish-actions.pod:4304
29386 #: ../fish/guestfish-actions.pod:4306
29389 " tar-out directory (tarfile|-)\n"
29395 #: ../fish/guestfish-actions.pod:4311
29396 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
29401 #: ../fish/guestfish-actions.pod:4316
29407 #: ../fish/guestfish-actions.pod:4318
29410 " tgz-in (tarball|-) directory\n"
29416 #: ../fish/guestfish-actions.pod:4323
29417 msgid "To upload an uncompressed tarball, use L</tar-in>."
29422 #: ../fish/guestfish-actions.pod:4327
29428 #: ../fish/guestfish-actions.pod:4329
29431 " tgz-out directory (tarball|-)\n"
29437 #: ../fish/guestfish-actions.pod:4334
29438 msgid "To download an uncompressed tarball, use L</tar-out>."
29443 #: ../fish/guestfish-actions.pod:4338
29449 #: ../fish/guestfish-actions.pod:4340
29458 #: ../fish/guestfish-actions.pod:4349
29464 #: ../fish/guestfish-actions.pod:4351
29473 #: ../fish/guestfish-actions.pod:4356
29474 msgid "truncate-size"
29479 #: ../fish/guestfish-actions.pod:4358
29482 " truncate-size path size\n"
29488 #: ../fish/guestfish-actions.pod:4363
29490 "If the current file size is less than C<size> then the file is extended to "
29491 "the required size with zero bytes. This creates a sparse file (ie. disk "
29492 "blocks are not allocated for the file until you write to it). To create a "
29493 "non-sparse file of zeroes, use L</fallocate64> instead."
29498 #: ../fish/guestfish-actions.pod:4369
29504 #: ../fish/guestfish-actions.pod:4371
29507 " tune2fs-l device\n"
29513 #: ../fish/guestfish-actions.pod:4381
29519 #: ../fish/guestfish-actions.pod:4383
29522 " txz-in (tarball|-) directory\n"
29528 #: ../fish/guestfish-actions.pod:4390
29534 #: ../fish/guestfish-actions.pod:4392
29537 " txz-out directory (tarball|-)\n"
29543 #: ../fish/guestfish-actions.pod:4399
29549 #: ../fish/guestfish-actions.pod:4401
29558 #: ../fish/guestfish-actions.pod:4415
29559 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
29564 #: ../fish/guestfish-actions.pod:4420
29570 #: ../fish/guestfish-actions.pod:4422
29576 #: ../fish/guestfish-actions.pod:4424
29579 " umount pathordevice\n"
29585 #: ../fish/guestfish-actions.pod:4430
29591 #: ../fish/guestfish-actions.pod:4432
29592 msgid "unmount-all"
29597 #: ../fish/guestfish-actions.pod:4434
29606 #: ../fish/guestfish-actions.pod:4440
29612 #: ../fish/guestfish-actions.pod:4442
29615 " upload (filename|-) remotefilename\n"
29621 #: ../fish/guestfish-actions.pod:4449
29622 msgid "See also L</download>."
29627 #: ../fish/guestfish-actions.pod:4453
29628 msgid "upload-offset"
29633 #: ../fish/guestfish-actions.pod:4455
29636 " upload-offset (filename|-) remotefilename offset\n"
29642 #: ../fish/guestfish-actions.pod:4467
29644 "Note that there is no limit on the amount of data that can be uploaded with "
29645 "this call, unlike with L</pwrite>, and this call always writes the full "
29646 "amount unless an error occurs."
29651 #: ../fish/guestfish-actions.pod:4472
29652 msgid "See also L</upload>, L</pwrite>."
29657 #: ../fish/guestfish-actions.pod:4476
29663 #: ../fish/guestfish-actions.pod:4478
29666 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
29672 #: ../fish/guestfish-actions.pod:4497
29678 #: ../fish/guestfish-actions.pod:4499
29687 #: ../fish/guestfish-actions.pod:4526
29689 "I<Note:> Don't use this call to test for availability of features. In "
29690 "enterprise distributions we backport features from later versions into "
29691 "earlier versions, making this an unreliable way to test for features. Use "
29692 "L</available> instead."
29697 #: ../fish/guestfish-actions.pod:4532
29703 #: ../fish/guestfish-actions.pod:4534
29706 " vfs-label device\n"
29712 #: ../fish/guestfish-actions.pod:4541
29713 msgid "To find a filesystem from the label, use L</findfs-label>."
29718 #: ../fish/guestfish-actions.pod:4543
29724 #: ../fish/guestfish-actions.pod:4545
29727 " vfs-type device\n"
29733 #: ../fish/guestfish-actions.pod:4555
29739 #: ../fish/guestfish-actions.pod:4557
29742 " vfs-uuid device\n"
29748 #: ../fish/guestfish-actions.pod:4564
29749 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
29754 #: ../fish/guestfish-actions.pod:4566
29755 msgid "vg-activate"
29760 #: ../fish/guestfish-actions.pod:4568
29763 " vg-activate true|false 'volgroups ...'\n"
29769 #: ../fish/guestfish-actions.pod:4581
29770 msgid "vg-activate-all"
29775 #: ../fish/guestfish-actions.pod:4583
29778 " vg-activate-all true|false\n"
29784 #: ../fish/guestfish-actions.pod:4593
29790 #: ../fish/guestfish-actions.pod:4595
29793 " vgcreate volgroup 'physvols ...'\n"
29799 #: ../fish/guestfish-actions.pod:4600
29805 #: ../fish/guestfish-actions.pod:4602
29808 " vglvuuids vgname\n"
29814 #: ../fish/guestfish-actions.pod:4607
29816 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
29817 "logical volumes and volume groups."
29822 #: ../fish/guestfish-actions.pod:4610
29823 msgid "See also L</vgpvuuids>."
29828 #: ../fish/guestfish-actions.pod:4612
29834 #: ../fish/guestfish-actions.pod:4614
29837 " vgpvuuids vgname\n"
29843 #: ../fish/guestfish-actions.pod:4619
29845 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
29846 "physical volumes and volume groups."
29851 #: ../fish/guestfish-actions.pod:4622
29852 msgid "See also L</vglvuuids>."
29857 #: ../fish/guestfish-actions.pod:4624
29863 #: ../fish/guestfish-actions.pod:4626
29866 " vgremove vgname\n"
29872 #: ../fish/guestfish-actions.pod:4633
29878 #: ../fish/guestfish-actions.pod:4635
29881 " vgrename volgroup newvolgroup\n"
29887 #: ../fish/guestfish-actions.pod:4639
29893 #: ../fish/guestfish-actions.pod:4641
29902 #: ../fish/guestfish-actions.pod:4649
29903 msgid "See also L</vgs-full>."
29908 #: ../fish/guestfish-actions.pod:4651
29914 #: ../fish/guestfish-actions.pod:4653
29923 #: ../fish/guestfish-actions.pod:4658
29929 #: ../fish/guestfish-actions.pod:4660
29938 #: ../fish/guestfish-actions.pod:4665
29944 #: ../fish/guestfish-actions.pod:4667
29953 #: ../fish/guestfish-actions.pod:4671
29959 #: ../fish/guestfish-actions.pod:4673
29968 #: ../fish/guestfish-actions.pod:4678
29974 #: ../fish/guestfish-actions.pod:4680
29983 #: ../fish/guestfish-actions.pod:4685
29989 #: ../fish/guestfish-actions.pod:4687
29998 #: ../fish/guestfish-actions.pod:4692
30004 #: ../fish/guestfish-actions.pod:4694
30007 " write path content\n"
30013 #: ../fish/guestfish-actions.pod:4702
30019 #: ../fish/guestfish-actions.pod:4704
30022 " write-file path content size\n"
30028 #: ../fish/guestfish-actions.pod:4727
30034 #: ../fish/guestfish-actions.pod:4729
30037 " zegrep regex path\n"
30043 #: ../fish/guestfish-actions.pod:4737
30049 #: ../fish/guestfish-actions.pod:4739
30052 " zegrepi regex path\n"
30058 #: ../fish/guestfish-actions.pod:4747
30064 #: ../fish/guestfish-actions.pod:4749
30073 #: ../fish/guestfish-actions.pod:4757
30074 msgid "See also: L</zero-device>, L</scrub-device>."
30079 #: ../fish/guestfish-actions.pod:4759
30080 msgid "zero-device"
30085 #: ../fish/guestfish-actions.pod:4761
30088 " zero-device device\n"
30094 #: ../fish/guestfish-actions.pod:4763
30096 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
30097 "which just zeroes the first few blocks of a device."
30102 #: ../fish/guestfish-actions.pod:4770
30108 #: ../fish/guestfish-actions.pod:4772
30111 " zerofree device\n"
30117 #: ../fish/guestfish-actions.pod:4785
30123 #: ../fish/guestfish-actions.pod:4787
30126 " zfgrep pattern path\n"
30132 #: ../fish/guestfish-actions.pod:4795
30138 #: ../fish/guestfish-actions.pod:4797
30141 " zfgrepi pattern path\n"
30147 #: ../fish/guestfish-actions.pod:4805
30153 #: ../fish/guestfish-actions.pod:4807
30156 " zfile meth path\n"
30162 #: ../fish/guestfish-actions.pod:4814
30164 "Since 1.0.63, use L</file> instead which can now process compressed files."
30169 #: ../fish/guestfish-actions.pod:4824
30175 #: ../fish/guestfish-actions.pod:4826
30178 " zgrep regex path\n"
30184 #: ../fish/guestfish-actions.pod:4834
30190 #: ../fish/guestfish-actions.pod:4836
30193 " zgrepi regex path\n"
30199 #: ../fish/guestfish-commands.pod:1
30205 #: ../fish/guestfish-commands.pod:3
30211 #: ../fish/guestfish-commands.pod:5
30214 " alloc filename size\n"
30220 #: ../fish/guestfish-commands.pod:7
30222 "This creates an empty (zeroed) file of the given size, and then adds so it "
30223 "can be further examined."
30228 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
30229 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
30234 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
30235 msgid "Size can be specified using standard suffixes, eg. C<1M>."
30240 #: ../fish/guestfish-commands.pod:14
30242 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
30243 "image, see L</PREPARED DISK IMAGES>."
30248 #: ../fish/guestfish-commands.pod:17
30254 #: ../fish/guestfish-commands.pod:19
30257 " copy-in local [local ...] /remotedir\n"
30263 #: ../fish/guestfish-commands.pod:21
30265 "C<copy-in> copies local files or directories recursively into the disk "
30266 "image, placing them in the directory called C</remotedir> (which must "
30267 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
30268 "other commands as necessary."
30273 #: ../fish/guestfish-commands.pod:26
30275 "Multiple local files and directories can be specified, but the last "
30276 "parameter must always be a remote directory. Wildcards cannot be used."
30281 #: ../fish/guestfish-commands.pod:30
30287 #: ../fish/guestfish-commands.pod:32
30290 " copy-out remote [remote ...] localdir\n"
30296 #: ../fish/guestfish-commands.pod:34
30298 "C<copy-out> copies remote files or directories recursively out of the disk "
30299 "image, placing them on the host disk in a local directory called C<localdir> "
30300 "(which must exist). This guestfish meta-command turns into a sequence of L</"
30301 "download>, L</tar-out> and other commands as necessary."
30306 #: ../fish/guestfish-commands.pod:40
30308 "Multiple remote files and directories can be specified, but the last "
30309 "parameter must always be a local directory. To download to the current "
30310 "directory, use C<.> as in:"
30315 #: ../fish/guestfish-commands.pod:44
30318 " copy-out /home .\n"
30324 #: ../fish/guestfish-commands.pod:46
30326 "Wildcards cannot be used in the ordinary command, but you can use them with "
30327 "the help of L</glob> like this:"
30332 #: ../fish/guestfish-commands.pod:49
30335 " glob copy-out /home/* .\n"
30341 #: ../fish/guestfish-commands.pod:51
30347 #: ../fish/guestfish-commands.pod:53
30350 " echo [params ...]\n"
30356 #: ../fish/guestfish-commands.pod:55
30357 msgid "This echos the parameters to the terminal."
30362 #: ../fish/guestfish-commands.pod:57
30368 #: ../fish/guestfish-commands.pod:59
30374 #: ../fish/guestfish-commands.pod:61
30380 #: ../fish/guestfish-commands.pod:63
30389 #: ../fish/guestfish-commands.pod:65
30391 "This is used to edit a file. It downloads the file, edits it locally using "
30392 "your editor, then uploads the result."
30397 #: ../fish/guestfish-commands.pod:68
30399 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
30400 "or C<emacs> you will get those corresponding editors."
30405 #: ../fish/guestfish-commands.pod:72
30411 #: ../fish/guestfish-commands.pod:74
30414 " glob command args...\n"
30420 #: ../fish/guestfish-commands.pod:76
30422 "Expand wildcards in any paths in the args list, and run C<command> "
30423 "repeatedly on each matching path."
30428 #: ../fish/guestfish-commands.pod:79
30429 msgid "See L</WILDCARDS AND GLOBBING>."
30434 #: ../fish/guestfish-commands.pod:81
30440 #: ../fish/guestfish-commands.pod:83
30443 " hexedit <filename|device>\n"
30444 " hexedit <filename|device> <max>\n"
30445 " hexedit <filename|device> <start> <max>\n"
30451 #: ../fish/guestfish-commands.pod:87
30453 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
30459 #: ../fish/guestfish-commands.pod:90
30461 "This command works by downloading potentially the whole file or device, "
30462 "editing it locally, then uploading it. If the file or device is large, you "
30463 "have to specify which part you wish to edit by using C<max> and/or C<start> "
30464 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
30465 "usual modifiers allowed such as C<1M> (1 megabyte)."
30470 #: ../fish/guestfish-commands.pod:97
30471 msgid "For example to edit the first few sectors of a disk you might do:"
30476 #: ../fish/guestfish-commands.pod:100
30479 " hexedit /dev/sda 1M\n"
30485 #: ../fish/guestfish-commands.pod:102
30487 "which would allow you to edit anywhere within the first megabyte of the disk."
30492 #: ../fish/guestfish-commands.pod:105
30493 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
30498 #: ../fish/guestfish-commands.pod:107
30501 " hexedit /dev/sda1 0x400 0x400\n"
30507 #: ../fish/guestfish-commands.pod:109
30508 msgid "(assuming the superblock is in the standard location)."
30513 #: ../fish/guestfish-commands.pod:111
30515 "This command requires the external L<hexedit(1)> program. You can specify "
30516 "another program to use by setting the C<HEXEDITOR> environment variable."
30521 #: ../fish/guestfish-commands.pod:115
30522 msgid "See also L</hexdump>."
30527 #: ../fish/guestfish-commands.pod:117
30533 #: ../fish/guestfish-commands.pod:119
30542 #: ../fish/guestfish-commands.pod:121
30544 "Change the local directory, ie. the current directory of guestfish itself."
30549 #: ../fish/guestfish-commands.pod:124
30550 msgid "Note that C<!cd> won't do what you might expect."
30555 #: ../fish/guestfish-commands.pod:126
30561 #: ../fish/guestfish-commands.pod:128
30567 #: ../fish/guestfish-commands.pod:130
30576 #: ../fish/guestfish-commands.pod:132
30577 msgid "Opens the manual page for guestfish."
30582 #: ../fish/guestfish-commands.pod:134
30588 #: ../fish/guestfish-commands.pod:136
30594 #: ../fish/guestfish-commands.pod:138
30603 #: ../fish/guestfish-commands.pod:140
30612 #: ../fish/guestfish-commands.pod:142
30613 msgid "This is used to view a file."
30618 #: ../fish/guestfish-commands.pod:144
30620 "The default viewer is C<$PAGER>. However if you use the alternate command "
30621 "C<less> you will get the C<less> command specifically."
30626 #: ../fish/guestfish-commands.pod:147
30632 #: ../fish/guestfish-commands.pod:149
30641 #: ../fish/guestfish-commands.pod:151
30643 "Close and reopen the libguestfs handle. It is not necessary to use this "
30644 "normally, because the handle is closed properly when guestfish exits. "
30645 "However this is occasionally useful for testing."
30650 #: ../fish/guestfish-commands.pod:155
30656 #: ../fish/guestfish-commands.pod:157
30659 " sparse filename size\n"
30665 #: ../fish/guestfish-commands.pod:159
30667 "This creates an empty sparse file of the given size, and then adds so it can "
30668 "be further examined."
30673 #: ../fish/guestfish-commands.pod:162
30675 "In all respects it works the same as the L</alloc> command, except that the "
30676 "image file is allocated sparsely, which means that disk blocks are not "
30677 "assigned to the file until they are needed. Sparse disk files only use "
30678 "space when written to, but they are slower and there is a danger you could "
30679 "run out of real disk space during a write operation."
30684 #: ../fish/guestfish-commands.pod:172
30690 #: ../fish/guestfish-commands.pod:174
30699 #: ../fish/guestfish-commands.pod:176
30701 "This command returns a list of the optional groups known to the daemon, and "
30702 "indicates which ones are supported by this build of the libguestfs appliance."
30707 #: ../fish/guestfish-commands.pod:180
30708 msgid "See also L<guestfs(3)/AVAILABILITY>."
30713 #: ../fish/guestfish-commands.pod:182
30719 #: ../fish/guestfish-commands.pod:184
30722 " time command args...\n"
30728 #: ../fish/guestfish-commands.pod:186
30730 "Run the command as usual, but print the elapsed time afterwards. This can "
30731 "be useful for benchmarking operations."
30736 #: ../test-tool/libguestfs-test-tool.pod:5
30737 msgid "libguestfs-test-tool - End user tests for libguestfs"
30742 #: ../test-tool/libguestfs-test-tool.pod:9
30745 " libguestfs-test-tool [--options]\n"
30751 #: ../test-tool/libguestfs-test-tool.pod:13
30753 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
30754 "and developers, to allow them to check basic libguestfs functionality is "
30755 "working. This is needed because libguestfs occasionally breaks for reasons "
30756 "beyond our control: usually because of changes in the underlying qemu or "
30757 "kernel packages, or the host environment."
30762 #: ../test-tool/libguestfs-test-tool.pod:20
30763 msgid "If you suspect a problem in libguestfs, then just run:"
30768 #: ../test-tool/libguestfs-test-tool.pod:22
30771 " libguestfs-test-tool\n"
30777 #: ../test-tool/libguestfs-test-tool.pod:24
30778 msgid "It will print lots of diagnostic messages."
30783 #: ../test-tool/libguestfs-test-tool.pod:26
30784 msgid "If it runs to completion successfully, you will see this near the end:"
30789 #: ../test-tool/libguestfs-test-tool.pod:28
30792 " ===== TEST FINISHED OK =====\n"
30798 #: ../test-tool/libguestfs-test-tool.pod:30
30799 msgid "and the test tool will exit with code 0."
30804 #: ../test-tool/libguestfs-test-tool.pod:32
30806 "If it fails (and/or exits with non-zero error code), please paste the "
30807 "B<complete, unedited> output of the test tool into a bug report. More "
30808 "information about reporting bugs can be found on the L<http://libguestfs.org/"
30814 #: ../test-tool/libguestfs-test-tool.pod:41
30820 #: ../test-tool/libguestfs-test-tool.pod:43
30821 msgid "Display short usage information and exit."
30826 #: ../test-tool/libguestfs-test-tool.pod:45
30827 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
30832 #: ../test-tool/libguestfs-test-tool.pod:47
30834 "Pass an alternate name for the helper program. libguestfs-test-tool will "
30835 "normally look in the C<$libexec> directory that was configured when the tool "
30841 #: ../test-tool/libguestfs-test-tool.pod:51
30842 msgid "I<--qemu qemu_binary>"
30847 #: ../test-tool/libguestfs-test-tool.pod:53
30849 "If you have downloaded another qemu binary, point this option at the full "
30850 "path of the binary to try it."
30855 #: ../test-tool/libguestfs-test-tool.pod:56
30856 msgid "I<--qemudir qemu_source_dir>"
30861 #: ../test-tool/libguestfs-test-tool.pod:58
30863 "If you have compiled qemu from source, point this option at the source "
30864 "directory to try it."
30869 #: ../test-tool/libguestfs-test-tool.pod:61
30870 msgid "I<--timeout N>"
30875 #: ../test-tool/libguestfs-test-tool.pod:63
30877 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
30878 "does not usually need to be adjusted unless your machine is very slow."
30883 #: ../test-tool/libguestfs-test-tool.pod:69
30884 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
30889 #: ../test-tool/libguestfs-test-tool.pod:71
30891 "If you have compiled another version of qemu from source and would like to "
30892 "try that, then you can use the I<--qemudir> option to point to the qemu "
30893 "source directory."
30898 #: ../test-tool/libguestfs-test-tool.pod:75
30900 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
30901 "option to point to the binary."
30906 #: ../test-tool/libguestfs-test-tool.pod:78
30908 "When using an alternate qemu with libguestfs, usually you would need to "
30909 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
30910 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
30911 "use either of the I<--qemudir> or I<--qemu> options."
30916 #: ../test-tool/libguestfs-test-tool.pod:85
30918 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
30919 "I<1> if there was an error."
30924 #: ../test-tool/libguestfs-test-tool.pod:92
30925 msgid "/usr/libexec/libguestfs-test-tool-helper"
30930 #: ../test-tool/libguestfs-test-tool.pod:94
30932 "This helper program is run inside the appliance and provides additional "
30938 #: ../test-tool/libguestfs-test-tool.pod:97
30939 msgid "/usr/bin/mkisofs"
30944 #: ../test-tool/libguestfs-test-tool.pod:99
30946 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
30947 "which is used as part of the tests."
30952 #: ../test-tool/libguestfs-test-tool.pod:106
30954 "For the full list of environment variables which may affect libguestfs, "
30955 "please see the L<guestfs(3)> manual page."
30960 #: ../test-tool/libguestfs-test-tool.pod:111
30961 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
30966 #: ../test-tool/libguestfs-test-tool.pod:121
30967 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
30972 #: ../fuse/guestmount.pod:5
30974 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
30979 #: ../fuse/guestmount.pod:9
30982 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
30988 #: ../fuse/guestmount.pod:11
30991 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
30997 #: ../fuse/guestmount.pod:13
31000 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
31006 #: ../fuse/guestmount.pod:17
31008 "You must I<not> use C<guestmount> in read-write mode on live virtual "
31009 "machines. If you do this, you risk disk corruption in the VM."
31014 #: ../fuse/guestmount.pod:22
31016 "The guestmount program can be used to mount virtual machine filesystems and "
31017 "other disk images on the host. It uses libguestfs for access to the guest "
31018 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
31019 "a mountable device."
31024 #: ../fuse/guestmount.pod:27
31026 "Along with other options, you have to give at least one device (I<-a> "
31027 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
31028 "option) or use the I<-i> inspection option. How this works is better "
31029 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
31035 #: ../fuse/guestmount.pod:33
31037 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
31038 "by you, and the filesystem will not be visible to any other users unless you "
31039 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
31040 "the filesystem, use the C<fusermount -u> command."
31045 #: ../fuse/guestmount.pod:41
31047 "For a typical Windows guest which has its main filesystem on the first "
31053 #: ../fuse/guestmount.pod:44
31056 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
31062 #: ../fuse/guestmount.pod:46
31064 "For a typical Linux guest which has a /boot filesystem on the first "
31065 "partition, and the root filesystem on a logical volume:"
31070 #: ../fuse/guestmount.pod:49
31073 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
31079 #: ../fuse/guestmount.pod:51
31080 msgid "To get libguestfs to detect guest mountpoints for you:"
31085 #: ../fuse/guestmount.pod:53
31088 " guestmount -a guest.img -i --ro /mnt\n"
31094 #: ../fuse/guestmount.pod:55
31095 msgid "For a libvirt guest called \"Guest\" you could do:"
31100 #: ../fuse/guestmount.pod:57
31103 " guestmount -d Guest -i --ro /mnt\n"
31109 #: ../fuse/guestmount.pod:59
31111 "If you don't know what filesystems are contained in a guest or disk image, "
31112 "use L<virt-filesystems(1)> first:"
31117 #: ../fuse/guestmount.pod:62
31120 " virt-filesystems MyGuest\n"
31126 #: ../fuse/guestmount.pod:64
31128 "If you want to trace the libguestfs calls but without excessive debugging "
31129 "information, we recommend:"
31134 #: ../fuse/guestmount.pod:67
31137 " guestmount [...] --trace /mnt\n"
31143 #: ../fuse/guestmount.pod:69
31144 msgid "If you want to debug the program, we recommend:"
31149 #: ../fuse/guestmount.pod:71
31152 " guestmount [...] --trace --verbose /mnt\n"
31158 #: ../fuse/guestmount.pod:77
31159 msgid "B<-a image> | B<--add image>"
31164 #: ../fuse/guestmount.pod:79
31165 msgid "Add a block device or virtual machine image."
31170 #: ../fuse/guestmount.pod:84
31171 msgid "B<-c URI> | B<--connect URI>"
31176 #: ../fuse/guestmount.pod:90
31177 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
31182 #: ../fuse/guestmount.pod:96
31183 msgid "B<--dir-cache-timeout N>"
31188 #: ../fuse/guestmount.pod:98
31190 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
31191 "seconds. The readdir cache [actually, there are several semi-independent "
31192 "caches] is populated after a readdir(2) call with the stat and extended "
31193 "attributes of the files in the directory, in anticipation that they will be "
31194 "requested soon after."
31199 #: ../fuse/guestmount.pod:104
31201 "There is also a different attribute cache implemented by FUSE (see the FUSE "
31202 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
31203 "requests, only cache existing ones."
31208 #: ../fuse/guestmount.pod:115
31209 msgid "B<--format=raw|qcow2|..> | B<--format>"
31214 #: ../fuse/guestmount.pod:122
31216 "If you have untrusted raw-format guest disk images, you should use this "
31217 "option to specify the disk format. This avoids a possible security problem "
31218 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
31219 "guestfs_add_drive_opts>."
31224 #: ../fuse/guestmount.pod:127
31225 msgid "B<--fuse-help>"
31230 #: ../fuse/guestmount.pod:129
31231 msgid "Display help on special FUSE options (see I<-o> below)."
31236 #: ../fuse/guestmount.pod:133
31237 msgid "Display brief help and exit."
31242 #: ../fuse/guestmount.pod:135
31243 msgid "B<-i> | B<--inspector>"
31248 #: ../fuse/guestmount.pod:146
31249 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
31254 #: ../fuse/guestmount.pod:148
31256 "Mount the named partition or logical volume on the given mountpoint B<in the "
31257 "guest> (this has nothing to do with mountpoints in the host)."
31262 #: ../fuse/guestmount.pod:151
31264 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
31265 "something on C</>."
31270 #: ../fuse/guestmount.pod:154
31271 msgid "B<-n> | B<--no-sync>"
31276 #: ../fuse/guestmount.pod:156
31278 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
31279 "unmounted. If you specify this option, then we don't attempt to sync the "
31280 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
31285 #: ../fuse/guestmount.pod:161
31286 msgid "B<-o option> | B<--option option>"
31291 #: ../fuse/guestmount.pod:163
31292 msgid "Pass extra options to FUSE."
31297 #: ../fuse/guestmount.pod:165
31299 "To get a list of all the extra options supported by FUSE, use the command "
31300 "below. Note that only the FUSE I<-o> options can be passed, and only some "
31301 "of them are a good idea."
31306 #: ../fuse/guestmount.pod:169
31309 " guestmount --fuse-help\n"
31315 #: ../fuse/guestmount.pod:171
31316 msgid "Some potentially useful FUSE options:"
31321 #: ../fuse/guestmount.pod:175
31322 msgid "B<-o allow_other>"
31327 #: ../fuse/guestmount.pod:177
31328 msgid "Allow other users to see the filesystem."
31333 #: ../fuse/guestmount.pod:179
31334 msgid "B<-o attr_timeout=N>"
31339 #: ../fuse/guestmount.pod:181
31340 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
31345 #: ../fuse/guestmount.pod:183
31346 msgid "B<-o kernel_cache>"
31351 #: ../fuse/guestmount.pod:185
31353 "Allow the kernel to cache files (reduces the number of reads that have to go "
31354 "through the L<guestfs(3)> API). This is generally a good idea if you can "
31355 "afford the extra memory usage."
31360 #: ../fuse/guestmount.pod:189
31361 msgid "B<-o uid=N> B<-o gid=N>"
31366 #: ../fuse/guestmount.pod:191
31368 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
31369 "the chosen values."
31374 #: ../fuse/guestmount.pod:196
31375 msgid "B<-r> | B<--ro>"
31380 #: ../fuse/guestmount.pod:198
31382 "Add devices and mount everything read-only. Also disallow writes and make "
31383 "the disk appear read-only to FUSE."
31388 #: ../fuse/guestmount.pod:201
31390 "This is highly recommended if you are not going to edit the guest disk. If "
31391 "the guest is running and this option is I<not> supplied, then there is a "
31392 "strong risk of disk corruption in the guest. We try to prevent this from "
31393 "happening, but it is not always possible."
31398 #: ../fuse/guestmount.pod:206
31399 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
31404 #: ../fuse/guestmount.pod:210
31405 msgid "Enable SELinux support for the guest."
31410 #: ../fuse/guestmount.pod:212
31411 msgid "B<-v> | B<--verbose>"
31416 #: ../fuse/guestmount.pod:214
31417 msgid "Enable verbose messages from underlying libguestfs."
31422 #: ../fuse/guestmount.pod:216
31423 msgid "B<-V> | B<--version>"
31428 #: ../fuse/guestmount.pod:218
31429 msgid "Display the program version and exit."
31434 #: ../fuse/guestmount.pod:220
31435 msgid "B<-w> | B<--rw>"
31440 #: ../fuse/guestmount.pod:222
31442 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
31443 "FOR READ AND WRITE>."
31448 #: ../fuse/guestmount.pod:225
31449 msgid "B<-x> | B<--trace>"
31454 #: ../fuse/guestmount.pod:227
31455 msgid "Trace libguestfs calls and entry into each FUSE function."
31460 #: ../fuse/guestmount.pod:229
31461 msgid "This also stops the daemon from forking into the background."
31466 #: ../fuse/guestmount.pod:235
31468 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
31469 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
31475 #: ../tools/virt-edit.pl:34
31476 msgid "virt-edit - Edit a file in a virtual machine"
31481 #: ../tools/virt-edit.pl:38
31484 " virt-edit [--options] domname file\n"
31490 #: ../tools/virt-edit.pl:40
31493 " virt-edit [--options] disk.img [disk.img ...] file\n"
31499 #: ../tools/virt-edit.pl:42
31502 " virt-edit [domname|disk.img] file -e 'expr'\n"
31508 #: ../tools/virt-edit.pl:46
31510 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
31511 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
31512 "doing this, but doesn't catch all cases."
31517 #: ../tools/virt-edit.pl:52
31519 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
31520 "the named virtual machine (or disk image)."
31525 #: ../tools/virt-edit.pl:55
31527 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
31528 "you should look at the L<guestfish(1)> tool."
31533 #: ../tools/virt-edit.pl:60
31534 msgid "Edit the named files interactively:"
31539 #: ../tools/virt-edit.pl:62
31542 " virt-edit mydomain /boot/grub/grub.conf\n"
31548 #: ../tools/virt-edit.pl:64
31551 " virt-edit mydomain /etc/passwd\n"
31557 #: ../tools/virt-edit.pl:66
31559 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
31560 "below). To change the init default level to 5:"
31565 #: ../tools/virt-edit.pl:70
31568 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
31574 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:106
31575 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113
31576 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
31577 msgid "Display brief help."
31582 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114
31583 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
31584 #: ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171
31585 #: ../tools/virt-list-partitions.pl:72
31586 msgid "Display version number and exit."
31591 #: ../tools/virt-edit.pl:96
31592 msgid "B<--backup extension> | B<-b extension>"
31597 #: ../tools/virt-edit.pl:98
31599 "Create a backup of the original file I<in the guest disk image>. The backup "
31600 "has the original filename with C<extension> added."
31605 #: ../tools/virt-edit.pl:101
31607 "Usually the first character of C<extension> would be a dot C<.> so you would "
31613 #: ../tools/virt-edit.pl:104
31616 " virt-edit -b .orig [etc]\n"
31622 #: ../tools/virt-edit.pl:106
31623 msgid "By default, no backup file is made."
31628 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128
31629 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127
31630 #: ../tools/virt-list-partitions.pl:78
31631 msgid "B<--connect URI> | B<-c URI>"
31636 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130
31637 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129
31638 #: ../tools/virt-list-partitions.pl:80
31640 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
31641 "to the default libvirt hypervisor."
31646 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133
31647 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132
31648 #: ../tools/virt-list-partitions.pl:83
31650 "If you specify guest block devices directly, then libvirt is not used at all."
31655 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140
31656 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
31657 #: ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
31658 msgid "B<--format> raw"
31663 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142
31664 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141
31665 #: ../tools/virt-list-partitions.pl:92
31667 "Specify the format of disk images given on the command line. If this is "
31668 "omitted then the format is autodetected from the content of the disk image."
31673 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146
31674 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145
31675 #: ../tools/virt-list-partitions.pl:96
31677 "If disk images are requested from libvirt, then this program asks libvirt "
31678 "for this information. In this case, the value of the format parameter is "
31684 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150
31685 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
31686 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149
31687 #: ../tools/virt-list-partitions.pl:100
31689 "If working with untrusted raw-format guest disk images, you should ensure "
31690 "the format is always specified."
31695 #: ../tools/virt-edit.pl:141
31696 msgid "B<--expr EXPR> | B<-e EXPR>"
31701 #: ../tools/virt-edit.pl:143
31703 "Instead of launching the external editor, non-interactively apply the Perl "
31704 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
31710 #: ../tools/virt-edit.pl:147
31712 "Be careful to properly quote the expression to prevent it from being altered "
31718 #: ../tools/virt-edit.pl:268
31719 msgid "NON-INTERACTIVE EDITING"
31724 #: ../tools/virt-edit.pl:270
31726 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
31727 "administrator can interactively edit the file."
31732 #: ../tools/virt-edit.pl:273
31734 "There are two ways also to use C<virt-edit> from scripts in order to make "
31735 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
31736 "like this, it's less error-prone to write scripts directly using the "
31737 "libguestfs API and Augeas for configuration file editing.)"
31742 #: ../tools/virt-edit.pl:279
31744 "The first method is to temporarily set C<$EDITOR> to any script or program "
31745 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
31746 "update C<tmpfile> in place however it likes."
31751 #: ../tools/virt-edit.pl:283
31753 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
31754 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
31755 "instances of C<foo> with C<bar> in a file:"
31760 #: ../tools/virt-edit.pl:287
31763 " virt-edit domname filename -e 's/foo/bar/'\n"
31769 #: ../tools/virt-edit.pl:289
31771 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
31772 "For example to delete root's password you could do:"
31777 #: ../tools/virt-edit.pl:292
31780 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
31786 #: ../tools/virt-edit.pl:294
31788 "What really happens is that the snippet is evaluated as a Perl expression "
31789 "for each line of the file. The line, including the final C<\\n>, is passed "
31790 "in C<$_> and the expression should update C<$_> or leave it unchanged."
31795 #: ../tools/virt-edit.pl:299
31797 "To delete a line, set C<$_> to the empty string. For example, to delete the "
31798 "C<apache> user account from the password file you can do:"
31803 #: ../tools/virt-edit.pl:302
31806 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
31812 #: ../tools/virt-edit.pl:304
31814 "To insert a line, prepend or append it to C<$_>. However appending lines to "
31815 "the end of the file is rather difficult this way since there is no concept "
31816 "of \"last line of the file\" - your expression just doesn't get called "
31817 "again. You might want to use the first method (setting C<$EDITOR>) if you "
31823 #: ../tools/virt-edit.pl:310
31825 "The variable C<$lineno> contains the current line number. As is "
31826 "traditional, the first line in the file is number C<1>."
31831 #: ../tools/virt-edit.pl:313
31833 "The return value from the expression is ignored, but the expression may call "
31834 "C<die> in order to abort the whole program, leaving the original file "
31840 #: ../tools/virt-edit.pl:317
31842 "Remember when matching the end of a line that C<$_> may contain the final C<"
31843 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
31844 "newline then neither of these. Thus to match or substitute some text at the "
31845 "end of a line, use this regular expression:"
31850 #: ../tools/virt-edit.pl:322
31853 " /some text(\\r?\\n)?$/\n"
31859 #: ../tools/virt-edit.pl:324
31861 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
31862 "$_> itself (since that would remove all newlines from the file):"
31867 #: ../tools/virt-edit.pl:328
31870 " my $m = $_; chomp $m; $m =~ /some text$/\n"
31876 #: ../tools/virt-edit.pl:334
31882 #: ../tools/virt-edit.pl:336
31884 "If set, this string is used as the editor. It may contain arguments, eg. C<"
31890 #: ../tools/virt-edit.pl:339
31891 msgid "If not set, C<vi> is used."
31896 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559
31897 #: ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182
31898 #: ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:527
31899 #: ../tools/virt-list-partitions.pl:250
31900 msgid "SHELL QUOTING"
31905 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567
31906 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
31907 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:529
31908 #: ../tools/virt-list-partitions.pl:252
31910 "Libvirt guest names can contain arbitrary characters, some of which have "
31911 "meaning to the shell such as C<#> and space. You may need to quote or "
31912 "escape these characters on the command line. See the shell manual page L<sh"
31913 "(1)> for details."
31917 #: ../tools/virt-edit.pl:352
31919 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
31920 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
31921 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
31926 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:598
31927 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
31928 #: ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:559
31929 #: ../tools/virt-list-partitions.pl:269
31935 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:600
31936 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
31937 #: ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:561
31938 #: ../tools/virt-list-partitions.pl:271
31939 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
31944 #: ../tools/virt-edit.pl:370 ../tools/virt-list-partitions.pl:275
31945 msgid "Copyright (C) 2009-2010 Red Hat Inc."
31950 #: ../tools/virt-win-reg.pl:37
31952 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
31957 #: ../tools/virt-win-reg.pl:41
31960 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
31966 #: ../tools/virt-win-reg.pl:43
31969 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
31975 #: ../tools/virt-win-reg.pl:45
31978 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
31984 #: ../tools/virt-win-reg.pl:47
31987 " virt-win-reg --merge domname [input.reg ...]\n"
31993 #: ../tools/virt-win-reg.pl:49
31996 " virt-win-reg [--options] disk.img ... # instead of domname\n"
32002 #: ../tools/virt-win-reg.pl:53
32004 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
32005 "virtual machines. If you do this, you I<will> get irreversible disk "
32006 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
32007 "but doesn't catch all cases."
32012 #: ../tools/virt-win-reg.pl:58
32014 "Modifying the Windows Registry is an inherently risky operation. The format "
32015 "is deliberately obscure and undocumented, and Registry changes can leave the "
32016 "system unbootable. Therefore when using the C<--merge> option, make sure "
32017 "you have a reliable backup first."
32022 #: ../tools/virt-win-reg.pl:65
32024 "This program can export and merge Windows Registry entries from a Windows "
32030 #: ../tools/virt-win-reg.pl:68
32032 "The first parameter is the libvirt guest name or the raw disk image of a "
32038 #: ../tools/virt-win-reg.pl:71
32040 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
32041 "exported (recursively). For example:"
32046 #: ../tools/virt-win-reg.pl:74
32049 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
32055 #: ../tools/virt-win-reg.pl:76
32057 "You can also display single values from within registry keys, for example:"
32062 #: ../tools/virt-win-reg.pl:79
32065 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
32066 " $ virt-win-reg Windows7 $cvkey ProductName\n"
32067 " Windows 7 Enterprise\n"
32073 #: ../tools/virt-win-reg.pl:83
32075 "With C<--merge>, you can merge a textual regedit file into the Windows "
32081 #: ../tools/virt-win-reg.pl:86
32084 " $ virt-win-reg --merge Windows7 changes.reg\n"
32090 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
32096 #: ../tools/virt-win-reg.pl:90
32098 "This program is only meant for simple access to the registry. If you want "
32099 "to do complicated things with the registry, we suggest you download the "
32100 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
32101 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
32102 "L<hivexregedit(1)>."
32107 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
32113 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
32114 msgid "Enable debugging messages."
32119 #: ../tools/virt-win-reg.pl:157
32125 #: ../tools/virt-win-reg.pl:159
32127 "In merge mode, this merges a textual regedit file into the Windows Registry "
32128 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
32129 "displays or exports Registry entries instead."
32134 #: ../tools/virt-win-reg.pl:163
32136 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
32137 "result in disk corruption. However exporting (without this flag) is always "
32143 #: ../tools/virt-win-reg.pl:171
32144 msgid "B<--encoding> UTF-16LE|ASCII"
32149 #: ../tools/virt-win-reg.pl:173
32151 "When merging (only), you may need to specify the encoding for strings to be "
32152 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
32153 "(3)/ENCODING STRINGS>."
32158 #: ../tools/virt-win-reg.pl:177
32160 "The default is to use UTF-16LE, which should work with recent versions of "
32166 #: ../tools/virt-win-reg.pl:402
32167 msgid "SUPPORTED SYSTEMS"
32172 #: ../tools/virt-win-reg.pl:404
32174 "The program currently supports Windows NT-derived guests starting with "
32175 "Windows XP through to at least Windows 7."
32180 #: ../tools/virt-win-reg.pl:407
32182 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
32183 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
32184 "and C<HKEY_USERS\\.DEFAULT>."
32189 #: ../tools/virt-win-reg.pl:411
32191 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
32197 #: ../tools/virt-win-reg.pl:414
32199 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
32205 #: ../tools/virt-win-reg.pl:417
32211 #: ../tools/virt-win-reg.pl:419
32213 "C<virt-win-reg> expects that regedit files have already been reencoded in "
32214 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
32215 "style line endings. Since Windows regedit files are often in UTF-16LE with "
32216 "Windows-style line endings, you may need to reencode the whole file before "
32217 "or after processing."
32222 #: ../tools/virt-win-reg.pl:425
32224 "To reencode a file from Windows format to Linux (before processing it with "
32225 "the C<--merge> option), you would do something like this:"
32230 #: ../tools/virt-win-reg.pl:428
32233 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
32239 #: ../tools/virt-win-reg.pl:430
32241 "To go in the opposite direction, after exporting and before sending the file "
32242 "to a Windows user, do something like this:"
32247 #: ../tools/virt-win-reg.pl:433
32250 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
32256 #: ../tools/virt-win-reg.pl:435
32257 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
32262 #: ../tools/virt-win-reg.pl:437
32264 "If you are unsure about the current encoding, use the L<file(1)> command. "
32265 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
32266 "style (CRLF) line endings, like this:"
32271 #: ../tools/virt-win-reg.pl:441
32274 " $ file software.reg\n"
32275 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
32276 " with CRLF line terminators\n"
32282 #: ../tools/virt-win-reg.pl:445
32283 msgid "This file would need conversion before you could C<--merge> it."
32288 #: ../tools/virt-win-reg.pl:447
32289 msgid "CurrentControlSet etc."
32294 #: ../tools/virt-win-reg.pl:449
32296 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
32297 "Registry at the level of the hive file, and therefore you cannot modify "
32303 #: ../tools/virt-win-reg.pl:453
32305 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
32306 "circumstances it might refer to another control set. The way to find out is "
32307 "to look at the C<HKLM\\SYSTEM\\Select> key:"
32312 #: ../tools/virt-win-reg.pl:457
32315 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
32316 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
32317 " \"Current\"=dword:00000001\n"
32318 " \"Default\"=dword:00000001\n"
32319 " \"Failed\"=dword:00000000\n"
32320 " \"LastKnownGood\"=dword:00000002\n"
32326 #: ../tools/virt-win-reg.pl:464
32327 msgid "\"Current\" is the one which Windows will choose when it boots."
32332 #: ../tools/virt-win-reg.pl:466
32334 "Similarly, other C<Current...> keys in the path may need to be replaced."
32339 #: ../tools/virt-win-reg.pl:469
32340 msgid "WINDOWS TIPS"
32345 #: ../tools/virt-win-reg.pl:471
32347 "Note that some of these tips modify the guest disk image. The guest I<must> "
32348 "be shut off, else you will get disk corruption."
32353 #: ../tools/virt-win-reg.pl:474
32354 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
32359 #: ../tools/virt-win-reg.pl:476
32361 "Prepare a DOS batch script, VBScript or executable. Upload this using "
32362 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
32363 "is uploaded into C<C:\\>:"
32368 #: ../tools/virt-win-reg.pl:480
32371 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
32377 #: ../tools/virt-win-reg.pl:482
32378 msgid "Prepare a regedit file containing the registry change:"
32383 #: ../tools/virt-win-reg.pl:484
32386 " cat > test.reg <<'EOF'\n"
32387 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
32388 " \"Test\"=\"c:\\\\test.bat\"\n"
32395 #: ../tools/virt-win-reg.pl:489
32397 "In this example we use the key C<RunOnce> which means that the script will "
32398 "run precisely once when the first user logs in. If you want it to run every "
32399 "time a user logs in, replace C<RunOnce> with C<Run>."
32404 #: ../tools/virt-win-reg.pl:493
32405 msgid "Now update the registry:"
32410 #: ../tools/virt-win-reg.pl:495
32413 " virt-win-reg --merge WindowsGuest test.reg\n"
32419 #: ../tools/virt-win-reg.pl:497
32420 msgid "INSTALLING A SERVICE"
32425 #: ../tools/virt-win-reg.pl:499
32427 "This section assumes you are familiar with Windows services, and you either "
32428 "have a program which handles the Windows Service Control Protocol directly "
32429 "or you want to run any program using a service wrapper like SrvAny or the "
32435 #: ../tools/virt-win-reg.pl:504
32437 "First upload the program and optionally the service wrapper. In this case "
32438 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
32443 #: ../tools/virt-win-reg.pl:508
32446 " guestfish -i -d WindowsGuest <<EOF\n"
32447 " upload rhsrvany.exe /rhsrvany.exe\n"
32448 " upload test.exe /test.exe\n"
32455 #: ../tools/virt-win-reg.pl:513
32457 "Prepare a regedit file containing the registry changes. In this example, "
32458 "the first registry change is needed for the service itself or the service "
32459 "wrapper (if used). The second registry change is only needed because I am "
32460 "using the RHSrvAny service wrapper."
32465 #: ../tools/virt-win-reg.pl:518
32468 " cat > service.reg <<'EOF'\n"
32469 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
32470 " \"Type\"=dword:00000010\n"
32471 " \"Start\"=dword:00000002\n"
32472 " \"ErrorControl\"=dword:00000001\n"
32473 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
32474 " \"DisplayName\"=\"RHSrvAny\"\n"
32475 " \"ObjectName\"=\"NetworkService\"\n"
32481 #: ../tools/virt-win-reg.pl:527
32484 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
32485 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
32486 " \"PWD\"=\"c:\\\\Temp\"\n"
32493 #: ../tools/virt-win-reg.pl:538
32495 "For use of C<ControlSet001> see the section above in this manual page. You "
32496 "may need to adjust this according to the control set that is in use by the "
32502 #: ../tools/virt-win-reg.pl:544
32504 "C<\"ObjectName\"> controls the privileges that the service will have. An "
32505 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
32506 "privileged account."
32511 #: ../tools/virt-win-reg.pl:550
32513 "For the meaning of the magic numbers, see this Microsoft KB article: "
32514 "L<http://support.microsoft.com/kb/103000>."
32519 #: ../tools/virt-win-reg.pl:555
32520 msgid "Update the registry:"
32525 #: ../tools/virt-win-reg.pl:557
32528 " virt-win-reg --merge WindowsGuest service.reg\n"
32534 #: ../tools/virt-win-reg.pl:561
32536 "Be careful when passing parameters containing C<\\> (backslash) in the "
32537 "shell. Usually you will have to use 'single quotes' or double backslashes "
32538 "(but not both) to protect them from the shell."
32543 #: ../tools/virt-win-reg.pl:565
32544 msgid "Paths and value names are case-insensitive."
32549 #: ../tools/virt-win-reg.pl:574
32551 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
32552 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
32553 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
32558 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:550
32560 "When reporting bugs, please enable debugging and capture the I<complete> "
32566 #: ../tools/virt-win-reg.pl:592
32569 " export LIBGUESTFS_DEBUG=1\n"
32570 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
32576 #: ../tools/virt-win-reg.pl:595
32578 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
32584 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1510
32585 #: ../tools/virt-make-fs.pl:565
32586 msgid "Copyright (C) 2010 Red Hat Inc."
32591 #: ../tools/virt-resize.pl:42
32592 msgid "virt-resize - Resize a virtual machine disk"
32597 #: ../tools/virt-resize.pl:46
32600 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
32601 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
32602 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
32608 #: ../tools/virt-resize.pl:52
32610 "Virt-resize is a tool which can resize a virtual machine disk, making it "
32611 "larger or smaller overall, and resizing or deleting any partitions contained "
32617 #: ../tools/virt-resize.pl:56
32619 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
32620 "not> be used on live virtual machines - for consistent results, shut the "
32621 "virtual machine down before resizing it."
32626 #: ../tools/virt-resize.pl:60
32628 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
32629 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
32634 #: ../tools/virt-resize.pl:66
32636 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
32637 "fill the extra 5GB of space."
32641 #: ../tools/virt-resize.pl:69
32644 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
32645 " virt-filesystems --long -h --all -a olddisk\n"
32646 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
32647 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
32653 #: ../tools/virt-resize.pl:74
32655 "As above, but make the /boot partition 200MB bigger, while giving the "
32656 "remaining space to /dev/sda2:"
32661 #: ../tools/virt-resize.pl:77
32664 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
32670 #: ../tools/virt-resize.pl:79
32671 msgid "As above, but the output format will be uncompressed qcow2:"
32676 #: ../tools/virt-resize.pl:81
32679 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
32680 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
32686 #: ../tools/virt-resize.pl:84
32687 msgid "DETAILED USAGE"
32692 #: ../tools/virt-resize.pl:86
32693 msgid "EXPANDING A VIRTUAL MACHINE DISK"
32698 #: ../tools/virt-resize.pl:90
32699 msgid "1. Shut down the virtual machine"
32704 #: ../tools/virt-resize.pl:92
32705 msgid "2. Locate input disk image"
32710 #: ../tools/virt-resize.pl:94
32712 "Locate the input disk image (ie. the file or device on the host containing "
32713 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
32714 "dumpxml> like this to find the disk image name:"
32719 #: ../tools/virt-resize.pl:98
32722 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
32723 " Found 1 nodes:\n"
32725 " <source dev=\"/dev/vg/lv_guest\" />\n"
32731 #: ../tools/virt-resize.pl:103
32732 msgid "3. Look at current sizing"
32737 #: ../tools/virt-resize.pl:105
32738 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
32743 #: ../tools/virt-resize.pl:108
32746 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
32747 " Name Type Size Parent\n"
32748 " /dev/sda1 partition 101M /dev/sda\n"
32749 " /dev/sda2 partition 7.9G /dev/sda\n"
32750 " /dev/sda device 8.0G -\n"
32756 #: ../tools/virt-resize.pl:114
32758 "(This example is a virtual machine with an 8 GB disk which we would like to "
32759 "expand up to 10 GB)."
32764 #: ../tools/virt-resize.pl:117
32765 msgid "4. Create output disk"
32770 #: ../tools/virt-resize.pl:119
32772 "Virt-resize cannot do in-place disk modifications. You have to have space "
32773 "to store the resized output disk."
32778 #: ../tools/virt-resize.pl:122
32780 "To store the resized disk image in a file, create a file of a suitable size:"
32785 #: ../tools/virt-resize.pl:125
32788 " # rm -f outdisk\n"
32789 " # truncate -s 10G outdisk\n"
32795 #: ../tools/virt-resize.pl:128
32796 msgid "Or use L<lvcreate(1)> to create a logical volume:"
32801 #: ../tools/virt-resize.pl:130
32804 " # lvcreate -L 10G -n lv_name vg_name\n"
32810 #: ../tools/virt-resize.pl:132
32811 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
32816 #: ../tools/virt-resize.pl:134
32819 " # virsh pool-list\n"
32820 " # virsh vol-create-as poolname newvol 10G\n"
32826 #: ../tools/virt-resize.pl:137
32832 #: ../tools/virt-resize.pl:139
32834 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
32835 "file) and the output disk. The output disk is the one created in the "
32841 #: ../tools/virt-resize.pl:143
32844 " # virt-resize indisk outdisk\n"
32850 #: ../tools/virt-resize.pl:145
32852 "This command just copies disk image C<indisk> to disk image C<outdisk> "
32853 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
32854 "larger, then an extra, empty partition is created at the end of the disk "
32855 "covering the extra space. If C<outdisk> is smaller, then it will give an "
32861 #: ../tools/virt-resize.pl:151
32863 "More realistically you'd want to expand existing partitions in the disk "
32864 "image by passing extra options (for the full list see the L</OPTIONS> "
32870 #: ../tools/virt-resize.pl:155
32872 "L</--expand> is the most useful option. It expands the named partition "
32873 "within the disk to fill any extra space:"
32878 #: ../tools/virt-resize.pl:158
32881 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
32887 #: ../tools/virt-resize.pl:160
32889 "(In this case, an extra partition is I<not> created at the end of the disk, "
32890 "because there will be no unused space)."
32895 #: ../tools/virt-resize.pl:163
32897 "L</--resize> is the other commonly used option. The following would "
32898 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
32899 "rest of the available space:"
32904 #: ../tools/virt-resize.pl:167
32907 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
32908 " indisk outdisk\n"
32914 #: ../tools/virt-resize.pl:170
32916 "If the expanded partition in the image contains a filesystem or LVM PV, then "
32917 "if virt-resize knows how, it will resize the contents, the equivalent of "
32918 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
32919 ">. However virt-resize does not know how to resize some filesystems, so you "
32920 "would have to online resize them after booting the guest."
32925 #: ../tools/virt-resize.pl:177
32926 msgid "Other options are covered below."
32931 #: ../tools/virt-resize.pl:179
32937 #: ../tools/virt-resize.pl:181
32938 msgid "Thoroughly test the new disk image I<before> discarding the old one."
32943 #: ../tools/virt-resize.pl:183
32944 msgid "If you are using libvirt, edit the XML to point at the new disk:"
32949 #: ../tools/virt-resize.pl:185
32952 " # virsh edit guestname\n"
32958 #: ../tools/virt-resize.pl:187
32960 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
32961 "html#elementsDisks>"
32966 #: ../tools/virt-resize.pl:190
32967 msgid "Then start up the domain with the new, resized disk:"
32972 #: ../tools/virt-resize.pl:192
32975 " # virsh start guestname\n"
32981 #: ../tools/virt-resize.pl:194
32983 "and check that it still works. See also the L</NOTES> section below for "
32984 "additional information."
32989 #: ../tools/virt-resize.pl:197
32990 msgid "7. Resize LVs etc inside the guest"
32995 #: ../tools/virt-resize.pl:199
32996 msgid "(This can also be done offline using L<guestfish(1)>)"
33001 #: ../tools/virt-resize.pl:201
33003 "Once the guest has booted you should see the new space available, at least "
33004 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
33005 "may need to resize LVs inside PVs, and also resize filesystem types that "
33006 "virt-resize does not know how to expand."
33011 #: ../tools/virt-resize.pl:208
33012 msgid "SHRINKING A VIRTUAL MACHINE DISK"
33017 #: ../tools/virt-resize.pl:210
33019 "Shrinking is somewhat more complex than expanding, and only an overview is "
33025 #: ../tools/virt-resize.pl:213
33027 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
33028 "filesystems). The user has to shrink content before passing the disk image "
33029 "to virt-resize, and virt-resize will check that the content has been shrunk "
33035 #: ../tools/virt-resize.pl:218
33036 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
33041 #: ../tools/virt-resize.pl:220
33043 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
33044 "steps 3 and 4 above to allocate a new disk image."
33049 #: ../tools/virt-resize.pl:223
33051 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
33056 #: ../tools/virt-resize.pl:226
33057 msgid "IGNORING OR DELETING PARTITIONS"
33062 #: ../tools/virt-resize.pl:228
33064 "virt-resize also gives a convenient way to ignore or delete partitions when "
33065 "copying from the input disk to the output disk. Ignoring a partition speeds "
33066 "up the copy where you don't care about the existing contents of a "
33067 "partition. Deleting a partition removes it completely, but note that it "
33068 "also renumbers any partitions after the one which is deleted, which can "
33069 "leave some guests unbootable."
33074 #: ../tools/virt-resize.pl:235
33075 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
33080 #: ../tools/virt-resize.pl:237
33082 "If the input disk is in qcow2 format, then you may prefer that the output is "
33083 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
33084 "the fly. The output format is simply determined by the format of the empty "
33085 "output container that you provide. Thus to create qcow2 output, use:"
33090 #: ../tools/virt-resize.pl:243
33093 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
33099 #: ../tools/virt-resize.pl:245
33100 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
33105 #: ../tools/virt-resize.pl:247
33106 msgid "Similarly, to get non-sparse raw output use:"
33111 #: ../tools/virt-resize.pl:249
33114 " fallocate -l size outdisk\n"
33120 #: ../tools/virt-resize.pl:251
33122 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
33123 "dev/zero of=outdisk bs=1M count=..>)"
33128 #: ../tools/virt-resize.pl:264
33129 msgid "Display help."
33134 #: ../tools/virt-resize.pl:278
33135 msgid "B<--resize part=size>"
33140 #: ../tools/virt-resize.pl:280
33142 "Resize the named partition (expanding or shrinking it) so that it has the "
33148 #: ../tools/virt-resize.pl:283
33150 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
33151 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
33152 "Exabytes; or as a percentage of the current size; or as a relative number or "
33153 "percentage. For example:"
33158 #: ../tools/virt-resize.pl:288
33161 " --resize /dev/sda2=10G\n"
33167 #: ../tools/virt-resize.pl:290
33170 " --resize /dev/sda4=90%\n"
33176 #: ../tools/virt-resize.pl:292
33179 " --resize /dev/sda2=+1G\n"
33185 #: ../tools/virt-resize.pl:294
33188 " --resize /dev/sda2=-200M\n"
33194 #: ../tools/virt-resize.pl:296
33197 " --resize /dev/sda1=+128K\n"
33203 #: ../tools/virt-resize.pl:298
33206 " --resize /dev/sda1=+10%\n"
33212 #: ../tools/virt-resize.pl:300
33215 " --resize /dev/sda1=-10%\n"
33221 #: ../tools/virt-resize.pl:302
33223 "You can increase the size of any partition. Virt-resize will expand the "
33224 "direct content of the partition if it knows how (see C<--expand> below)."
33229 #: ../tools/virt-resize.pl:306
33231 "You can only I<decrease> the size of partitions that contain filesystems or "
33232 "PVs which have already been shrunk. Virt-resize will check this has been "
33233 "done before proceeding, or else will print an error (see also C<--resize-"
33239 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
33240 #: ../tools/virt-resize.pl:420
33241 msgid "You can give this option multiple times."
33246 #: ../tools/virt-resize.pl:317
33247 msgid "B<--resize-force part=size>"
33252 #: ../tools/virt-resize.pl:319
33254 "This is the same as C<--resize> except that it will let you decrease the "
33255 "size of any partition. Generally this means you will lose any data which "
33256 "was at the end of the partition you shrink, but you may not care about that "
33257 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
33258 "as a swap partition)."
33263 #: ../tools/virt-resize.pl:325
33264 msgid "See also the C<--ignore> option."
33269 #: ../tools/virt-resize.pl:331
33270 msgid "B<--expand part>"
33275 #: ../tools/virt-resize.pl:333
33277 "Expand the named partition so it uses up all extra space (space left over "
33278 "after any other resize changes that you request have been done)."
33283 #: ../tools/virt-resize.pl:336
33285 "If virt-resize knows how, it will expand the direct content of the "
33286 "partition. For example, if the partition is an LVM PV, it will expand the "
33287 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
33288 "content it doesn't know about alone."
33293 #: ../tools/virt-resize.pl:341
33294 msgid "Currently virt-resize can resize:"
33299 #: ../tools/virt-resize.pl:347
33301 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
33307 #: ../tools/virt-resize.pl:352
33309 "NTFS filesystems contained directly in a partition, if libguestfs was "
33310 "compiled with support for NTFS."
33315 #: ../tools/virt-resize.pl:355
33317 "The filesystem must have been shut down consistently last time it was used. "
33318 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
33319 "consistency check, so at the first boot after resizing Windows will check "
33325 #: ../tools/virt-resize.pl:362
33327 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
33328 "inside the PV, but see the C<--LV-expand> option. The user could also "
33329 "resize LVs as desired after boot."
33334 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
33335 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
33340 #: ../tools/virt-resize.pl:374
33341 msgid "B<--shrink part>"
33346 #: ../tools/virt-resize.pl:376
33348 "Shrink the named partition until the overall disk image fits in the "
33349 "destination. The named partition B<must> contain a filesystem or PV which "
33350 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
33351 "online tools). Virt-resize will check this and give an error if it has not "
33357 #: ../tools/virt-resize.pl:382
33359 "The amount by which the overall disk must be shrunk (after carrying out all "
33360 "other operations requested by the user) is called the \"deficit\". For "
33361 "example, a straight copy (assume no other operations) from a 5GB disk image "
33362 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
33363 "would give an error unless the user specified a partition to shrink and that "
33364 "partition had more than a gigabyte of free space."
33369 #: ../tools/virt-resize.pl:396
33370 msgid "B<--ignore part>"
33375 #: ../tools/virt-resize.pl:398
33377 "Ignore the named partition. Effectively this means the partition is "
33378 "allocated on the destination disk, but the content is not copied across from "
33379 "the source disk. The content of the partition will be blank (all zero "
33385 #: ../tools/virt-resize.pl:409
33386 msgid "B<--delete part>"
33391 #: ../tools/virt-resize.pl:411
33393 "Delete the named partition. It would be more accurate to describe this as "
33394 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
33395 "the original disk image is left intact."
33400 #: ../tools/virt-resize.pl:415
33402 "Note that when you delete a partition, then anything contained in the "
33403 "partition is also deleted. Furthermore, this causes any partitions that "
33404 "come after to be I<renumbered>, which can easily make your guest unbootable."
33409 #: ../tools/virt-resize.pl:426
33410 msgid "B<--LV-expand logvol>"
33415 #: ../tools/virt-resize.pl:428
33417 "This takes the logical volume and, as a final step, expands it to fill all "
33418 "the space available in its volume group. A typical usage, assuming a Linux "
33419 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
33420 "lv_root> would be:"
33425 #: ../tools/virt-resize.pl:433
33428 " virt-resize indisk outdisk \\\n"
33429 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
33435 #: ../tools/virt-resize.pl:436
33437 "This would first expand the partition (and PV), and then expand the root "
33438 "device to fill the extra space in the PV."
33443 #: ../tools/virt-resize.pl:439
33445 "The contents of the LV are also resized if virt-resize knows how to do "
33446 "that. You can stop virt-resize from trying to expand the content by using "
33447 "the option C<--no-expand-content>."
33452 #: ../tools/virt-resize.pl:443
33453 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
33458 #: ../tools/virt-resize.pl:446
33460 "You can give this option multiple times, I<but> it doesn't make sense to do "
33461 "this unless the logical volumes you specify are all in different volume "
33467 #: ../tools/virt-resize.pl:454
33468 msgid "B<--no-copy-boot-loader>"
33473 #: ../tools/virt-resize.pl:456
33475 "By default, virt-resize copies over some sectors at the start of the disk "
33476 "(up to the beginning of the first partition). Commonly these sectors "
33477 "contain the Master Boot Record (MBR) and the boot loader, and are required "
33478 "in order for the guest to boot correctly."
33483 #: ../tools/virt-resize.pl:461
33485 "If you specify this flag, then this initial copy is not done. You may need "
33486 "to reinstall the boot loader in this case."
33491 #: ../tools/virt-resize.pl:469
33492 msgid "B<--no-extra-partition>"
33497 #: ../tools/virt-resize.pl:471
33499 "By default, virt-resize creates an extra partition if there is any extra, "
33500 "unused space after all resizing has happened. Use this option to prevent "
33501 "the extra partition from being created. If you do this then the extra space "
33502 "will be inaccessible until you run fdisk, parted, or some other partitioning "
33503 "tool in the guest."
33508 #: ../tools/virt-resize.pl:477
33510 "Note that if the surplus space is smaller than 10 MB, no extra partition "
33516 #: ../tools/virt-resize.pl:484
33517 msgid "B<--no-expand-content>"
33522 #: ../tools/virt-resize.pl:486
33524 "By default, virt-resize will try to expand the direct contents of "
33525 "partitions, if it knows how (see C<--expand> option above)."
33530 #: ../tools/virt-resize.pl:489
33532 "If you give the C<--no-expand-content> option then virt-resize will not "
33538 #: ../tools/virt-resize.pl:496
33539 msgid "B<-d> | B<--debug>"
33544 #: ../tools/virt-resize.pl:504
33545 msgid "B<-n> | B<--dryrun>"
33550 #: ../tools/virt-resize.pl:506
33551 msgid "Print a summary of what would be done, but don't do anything."
33556 #: ../tools/virt-resize.pl:512
33557 msgid "B<-q> | B<--quiet>"
33562 #: ../tools/virt-resize.pl:514
33563 msgid "Don't print the summary."
33568 #: ../tools/virt-resize.pl:522
33570 "Specify the format of the input disk image. If this flag is not given then "
33571 "it is auto-detected from the image itself."
33576 #: ../tools/virt-resize.pl:528
33578 "Note that this option I<does not> affect the output format. See L</QCOW2 "
33579 "AND NON-SPARSE RAW FORMATS>."
33584 #: ../tools/virt-resize.pl:535
33585 msgid "B<--output-format> raw"
33590 #: ../tools/virt-resize.pl:537
33592 "Specify the format of the output disk image. If this flag is not given then "
33593 "it is auto-detected from the image itself."
33598 #: ../tools/virt-resize.pl:543
33600 "Note that you still need to create the output disk with the right format. "
33601 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
33606 #: ../tools/virt-resize.pl:1419
33612 #: ../tools/virt-resize.pl:1421
33613 msgid "\"Partition 1 does not end on cylinder boundary.\""
33618 #: ../tools/virt-resize.pl:1423
33620 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
33621 "means the partitions will not be aligned to the ancient CHS geometry. "
33622 "However CHS geometry is meaningless for disks manufactured since the early "
33623 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
33624 "cylinders is not required by any modern operating system."
33629 #: ../tools/virt-resize.pl:1430
33630 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
33635 #: ../tools/virt-resize.pl:1432
33637 "In Windows Vista and later versions, Microsoft switched to using a separate "
33638 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
33639 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
33640 "the boot partition. Doing so seems to break the guest completely. However "
33641 "expanding the second partition (ie. C: drive) should work."
33646 #: ../tools/virt-resize.pl:1439
33648 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
33649 "NTFS partitions have been expanded. This is just a safety check and (unless "
33650 "it find errors) is nothing to worry about."
33655 #: ../tools/virt-resize.pl:1443
33656 msgid "GUEST BOOT STUCK AT \"GRUB\""
33661 #: ../tools/virt-resize.pl:1445
33663 "If a Linux guest does not boot after resizing, and the boot is stuck after "
33664 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
33665 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
33666 "although we think is to do with partition alignment."
33671 #: ../tools/virt-resize.pl:1450
33674 " guestfish -i -a newdisk\n"
33675 " ><fs> cat /boot/grub/device.map\n"
33676 " # check the contents of this file are sensible or\n"
33677 " # edit the file if necessary\n"
33678 " ><fs> grub-install / /dev/vda\n"
33685 #: ../tools/virt-resize.pl:1457
33687 "For more flexible guest reconfiguration, including if you need to specify "
33688 "other parameters to grub-install, use L<virt-rescue(1)>."
33693 #: ../tools/virt-resize.pl:1460
33694 msgid "ALTERNATIVE TOOLS"
33699 #: ../tools/virt-resize.pl:1462
33701 "There are several proprietary tools for resizing partitions. We won't "
33702 "mention any here."
33707 #: ../tools/virt-resize.pl:1465
33709 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
33710 "operations on disk images. They can resize and move partitions, but I don't "
33711 "think they can do anything with the contents, and they certainly don't "
33717 #: ../tools/virt-resize.pl:1470
33719 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
33720 "but at a much lower level. You will probably end up hand-calculating sector "
33721 "offsets, which is something that virt-resize was designed to avoid. If you "
33722 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
33728 #: ../tools/virt-resize.pl:1485
33730 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
33731 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
33732 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
33733 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
33734 "libguestfs.org/>."
33739 #: ../tools/virt-list-filesystems.pl:32
33741 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
33746 #: ../tools/virt-list-filesystems.pl:36
33749 " virt-list-filesystems [--options] domname\n"
33755 #: ../tools/virt-list-filesystems.pl:38
33758 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
33764 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
33766 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
33772 #: ../tools/virt-list-filesystems.pl:45
33774 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
33775 "are contained in a virtual machine or disk image."
33780 #: ../tools/virt-list-filesystems.pl:49
33782 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
33783 "functionality. For more complex cases you should look at the L<guestfish(1)"
33789 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
33790 msgid "B<-l> | B<--long>"
33795 #: ../tools/virt-list-filesystems.pl:108
33797 "With this option, C<virt-list-filesystems> displays the type of each "
33798 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
33803 #: ../tools/virt-list-filesystems.pl:115
33804 msgid "B<-a> | B<--all>"
33809 #: ../tools/virt-list-filesystems.pl:117
33811 "Normally we only show mountable filesystems. If this option is given then "
33812 "swap devices are shown too."
33817 #: ../tools/virt-list-filesystems.pl:191
33819 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
33820 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
33821 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
33826 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
33827 msgid "Copyright (C) 2009 Red Hat Inc."
33832 #: ../tools/virt-tar.pl:33
33833 msgid "virt-tar - Extract or upload files to a virtual machine"
33838 #: ../tools/virt-tar.pl:37
33841 " virt-tar [--options] -x domname directory tarball\n"
33847 #: ../tools/virt-tar.pl:39
33850 " virt-tar [--options] -u domname tarball directory\n"
33856 #: ../tools/virt-tar.pl:41
33859 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
33865 #: ../tools/virt-tar.pl:43
33868 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
33873 #: ../tools/virt-tar.pl:47
33875 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
33876 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
33881 #: ../tools/virt-tar.pl:52
33882 msgid "Download C</home> from the VM into a local tarball:"
33887 #: ../tools/virt-tar.pl:54
33890 " virt-tar -x domname /home home.tar\n"
33896 #: ../tools/virt-tar.pl:56
33899 " virt-tar -zx domname /home home.tar.gz\n"
33905 #: ../tools/virt-tar.pl:58
33906 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
33911 #: ../tools/virt-tar.pl:60
33914 " virt-tar -u domname uploadstuff.tar /tmp\n"
33920 #: ../tools/virt-tar.pl:62
33923 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
33929 #: ../tools/virt-tar.pl:66
33931 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
33932 "virtual machines. If you do this, you risk disk corruption in the VM. "
33933 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
33938 #: ../tools/virt-tar.pl:71
33940 "You can use C<-x> (extract) on live virtual machines, but you might get "
33941 "inconsistent results or errors if there is filesystem activity inside the "
33942 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
33943 "work, but the only way to guarantee consistent results is if the virtual "
33944 "machine is shut down."
33949 #: ../tools/virt-tar.pl:79
33951 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
33952 "parts of a guest filesystem. There are many possibilities: making backups, "
33953 "uploading data files, snooping on guest activity, fixing or customizing "
33959 #: ../tools/virt-tar.pl:84
33961 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
33962 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
33963 "should look at the L<guestfish(1)> tool."
33968 #: ../tools/virt-tar.pl:88
33970 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
33971 "its contents (recursively) from the virtual machine into a local tarball. "
33972 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
33973 "virtual machine. You cannot use these two options together."
33978 #: ../tools/virt-tar.pl:94
33980 "In addition, you may need to use the C<-z> (gZip) option to enable "
33981 "compression. When uploading, you have to specify C<-z> if the upload file "
33982 "is compressed because virt-tar won't detect this on its own."
33987 #: ../tools/virt-tar.pl:98
33989 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
33990 "example it cannot do PKZip files or bzip2 compression. If you want that "
33991 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
33992 "the L<libguestfs(3)> API)."
33997 #: ../tools/virt-tar.pl:156
33998 msgid "B<-x> | B<--extract> | B<--download>"
34003 #: ../tools/virt-tar.pl:158
34004 msgid "B<-u> | B<--upload>"
34009 #: ../tools/virt-tar.pl:160
34011 "Use C<-x> to extract (download) a directory from a virtual machine to a "
34017 #: ../tools/virt-tar.pl:163
34019 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
34020 "Please read the L</WARNING> section above before using this option."
34025 #: ../tools/virt-tar.pl:167
34026 msgid "You must specify exactly one of these options."
34031 #: ../tools/virt-tar.pl:173
34032 msgid "B<-z> | B<--gzip>"
34037 #: ../tools/virt-tar.pl:175
34038 msgid "Specify that the input or output tarball is gzip-compressed."
34042 #: ../tools/virt-tar.pl:288
34044 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
34045 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
34046 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
34052 #: ../tools/virt-make-fs.pl:37
34053 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
34058 #: ../tools/virt-make-fs.pl:41
34061 " virt-make-fs [--options] input.tar output.img\n"
34067 #: ../tools/virt-make-fs.pl:43
34070 " virt-make-fs [--options] input.tar.gz output.img\n"
34076 #: ../tools/virt-make-fs.pl:45
34079 " virt-make-fs [--options] directory output.img\n"
34085 #: ../tools/virt-make-fs.pl:49
34087 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
34088 "archive or some files in a directory. It is similar to tools like L<mkisofs"
34089 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
34090 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
34091 "you want to attach these filesystems to existing virtual machines (eg. to "
34092 "import large amounts of read-only data to a VM)."
34097 #: ../tools/virt-make-fs.pl:57
34098 msgid "Basic usage is:"
34103 #: ../tools/virt-make-fs.pl:59
34106 " virt-make-fs input output\n"
34112 #: ../tools/virt-make-fs.pl:61
34114 "where C<input> is either a directory containing files that you want to add, "
34115 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
34116 "C<output> is a disk image. The input type is detected automatically. The "
34117 "output disk image defaults to a raw ext2 image unless you specify extra "
34118 "flags (see L</OPTIONS> below)."
34123 #: ../tools/virt-make-fs.pl:67
34124 msgid "EXTRA SPACE"
34129 #: ../tools/virt-make-fs.pl:69
34131 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
34132 "the files that it contains, but might have extra space. Depending on how "
34133 "you are going to use the output, you might think this extra space is wasted "
34134 "and want to minimize it, or you might want to leave space so that more files "
34135 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
34136 "but you can use the C<--size> flag to leave space in the filesystem if you "
34142 #: ../tools/virt-make-fs.pl:77
34144 "An alternative way to leave extra space but not make the output image any "
34145 "bigger is to use an alternative disk image format (instead of the default "
34146 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
34147 "image format (check your hypervisor supports this before using it). This "
34148 "allows you to choose a large C<--size> but the extra space won't actually be "
34149 "allocated in the image until you try to store something in it."
34153 #: ../tools/virt-make-fs.pl:85
34155 "Don't forget that you can also use local commands including L<resize2fs(8)> "
34156 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
34157 "to build another image from scratch."
34162 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
34163 #: ../tools/virt-make-fs.pl:142
34169 #: ../tools/virt-make-fs.pl:91
34172 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
34178 #: ../tools/virt-make-fs.pl:93
34179 msgid "FILESYSTEM TYPE"
34184 #: ../tools/virt-make-fs.pl:95
34186 "The default filesystem type is C<ext2>. Just about any filesystem type that "
34187 "libguestfs supports can be used (but I<not> read-only formats like "
34188 "ISO9660). Here are some of the more common choices:"
34193 #: ../tools/virt-make-fs.pl:101
34199 #: ../tools/virt-make-fs.pl:103
34201 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
34202 "you are not going to use the filesystem in a way that requires the journal, "
34203 "then this is just wasted overhead."
34208 #: ../tools/virt-make-fs.pl:107
34209 msgid "I<ntfs> or I<vfat>"
34214 #: ../tools/virt-make-fs.pl:109
34215 msgid "Useful if exporting data to a Windows guest."
34220 #: ../tools/virt-make-fs.pl:111
34222 "I<Note for vfat>: The tar archive or local directory must only contain files "
34223 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
34224 "program running within libguestfs is unable to change the ownership of non-"
34225 "root files, since vfat itself does not support this."
34230 #: ../tools/virt-make-fs.pl:116
34236 #: ../tools/virt-make-fs.pl:118
34238 "Lower overhead than C<ext2>, but certain limitations on filename length and "
34239 "total filesystem size."
34244 #: ../tools/virt-make-fs.pl:125
34247 " virt-make-fs --type=minix input minixfs.img\n"
34253 #: ../tools/virt-make-fs.pl:127
34254 msgid "TO PARTITION OR NOT TO PARTITION"
34259 #: ../tools/virt-make-fs.pl:129
34260 msgid "Optionally virt-make-fs can add a partition table to the output disk."
34265 #: ../tools/virt-make-fs.pl:131
34267 "Adding a partition can make the disk image more compatible with certain "
34268 "virtualized operating systems which don't expect to see a filesystem "
34269 "directly located on a block device (Linux doesn't care and will happily "
34270 "handle both types)."
34275 #: ../tools/virt-make-fs.pl:136
34277 "On the other hand, if you have a partition table then the output image is no "
34278 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
34279 "directly on a partitioned disk image. (However libguestfs tools such as "
34280 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
34285 #: ../tools/virt-make-fs.pl:144
34286 msgid "Add an MBR partition:"
34291 #: ../tools/virt-make-fs.pl:146
34294 " virt-make-fs --partition -- input disk.img\n"
34300 #: ../tools/virt-make-fs.pl:148
34302 "If the output disk image could be terabyte-sized or larger, it's better to "
34303 "use an EFI/GPT-compatible partition table:"
34308 #: ../tools/virt-make-fs.pl:151
34311 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
34317 #: ../tools/virt-make-fs.pl:179
34318 msgid "Enable debugging information."
34323 #: ../tools/virt-make-fs.pl:185
34324 msgid "B<--size=E<lt>NE<gt>>"
34329 #: ../tools/virt-make-fs.pl:187
34330 msgid "B<--size=+E<lt>NE<gt>>"
34335 #: ../tools/virt-make-fs.pl:189
34336 msgid "B<-s E<lt>NE<gt>>"
34341 #: ../tools/virt-make-fs.pl:191
34342 msgid "B<-s +E<lt>NE<gt>>"
34347 #: ../tools/virt-make-fs.pl:193
34349 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
34354 #: ../tools/virt-make-fs.pl:196
34356 "If this option is I<not> given, then the output image will be just large "
34357 "enough to contain all the files, with not much wasted space."
34362 #: ../tools/virt-make-fs.pl:199
34364 "To choose a fixed size output disk, specify an absolute number followed by b/"
34365 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34366 "Petabytes or Exabytes. This must be large enough to contain all the input "
34367 "files, else you will get an error."
34372 #: ../tools/virt-make-fs.pl:204
34374 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
34375 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34376 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
34377 "the input files, and (approximately) an extra 200 MB free space."
34382 #: ../tools/virt-make-fs.pl:210
34384 "Note that virt-make-fs estimates free space, and therefore will not produce "
34385 "filesystems containing precisely the free space requested. (It is much more "
34386 "expensive and time-consuming to produce a filesystem which has precisely the "
34387 "desired free space)."
34392 #: ../tools/virt-make-fs.pl:219
34393 msgid "B<--format=E<lt>fmtE<gt>>"
34398 #: ../tools/virt-make-fs.pl:221
34399 msgid "B<-F E<lt>fmtE<gt>>"
34404 #: ../tools/virt-make-fs.pl:223
34405 msgid "Choose the output disk image format."
34410 #: ../tools/virt-make-fs.pl:225
34411 msgid "The default is C<raw> (raw disk image)."
34416 #: ../tools/virt-make-fs.pl:227
34418 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
34419 "that would really make sense here is C<qcow2>."
34424 #: ../tools/virt-make-fs.pl:234
34425 msgid "B<--type=E<lt>fsE<gt>>"
34430 #: ../tools/virt-make-fs.pl:236
34431 msgid "B<-t E<lt>fsE<gt>>"
34436 #: ../tools/virt-make-fs.pl:238
34437 msgid "Choose the output filesystem type."
34442 #: ../tools/virt-make-fs.pl:240
34443 msgid "The default is C<ext2>."
34448 #: ../tools/virt-make-fs.pl:242
34450 "Any filesystem which is supported read-write by libguestfs can be used here."
34455 #: ../tools/virt-make-fs.pl:249
34456 msgid "B<--partition>"
34461 #: ../tools/virt-make-fs.pl:251
34462 msgid "B<--partition=E<lt>parttypeE<gt>>"
34467 #: ../tools/virt-make-fs.pl:253
34469 "If specified, this flag adds an MBR partition table to the output disk image."
34474 #: ../tools/virt-make-fs.pl:256
34476 "You can change the partition table type, eg. C<--partition=gpt> for large "
34482 #: ../tools/virt-make-fs.pl:259
34484 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
34485 "might consider the next parameter to be the partition type. For example:"
34490 #: ../tools/virt-make-fs.pl:263
34493 " virt-make-fs --partition input.tar ...\n"
34499 #: ../tools/virt-make-fs.pl:265
34501 "would cause virt-make-fs to think you wanted to use a partition type of "
34502 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
34503 "dash) between options and the input file argument:"
34508 #: ../tools/virt-make-fs.pl:269
34511 " virt-make-fs --partition -- input.tar ...\n"
34516 #: ../tools/virt-make-fs.pl:536
34518 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
34519 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
34520 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
34525 #: ../tools/virt-make-fs.pl:553
34528 " export LIBGUESTFS_DEBUG=1\n"
34529 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
34535 #: ../tools/virt-make-fs.pl:556
34537 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
34543 #: ../tools/virt-list-partitions.pl:32
34545 "virt-list-partitions - List partitions in a virtual machine or disk image"
34550 #: ../tools/virt-list-partitions.pl:36
34553 " virt-list-partitions [--options] domname\n"
34559 #: ../tools/virt-list-partitions.pl:38
34562 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
34568 #: ../tools/virt-list-partitions.pl:45
34570 "C<virt-list-partitions> is a command line tool to list the partitions that "
34571 "are contained in a virtual machine or disk image. It is mainly useful as a "
34572 "first step to using L<virt-resize(1)>."
34577 #: ../tools/virt-list-partitions.pl:50
34579 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
34580 "functionality. For more complex cases you should look at the L<guestfish(1)"
34586 #: ../tools/virt-list-partitions.pl:107
34587 msgid "B<-h> | B<--human-readable>"
34592 #: ../tools/virt-list-partitions.pl:109
34593 msgid "Show sizes in human-readable form (eg. \"1G\")."
34598 #: ../tools/virt-list-partitions.pl:117
34600 "With this option, C<virt-list-partitions> displays the type and size of each "
34601 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
34606 #: ../tools/virt-list-partitions.pl:124
34607 msgid "B<-t> | B<--total>"
34612 #: ../tools/virt-list-partitions.pl:126
34614 "Display the total size of each block device (as a separate row or rows)."
34619 #: ../tools/virt-list-partitions.pl:259
34621 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
34622 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
34623 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."