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-18 13:31+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:2564 ../src/guestfs.pod:2568
930 #: ../src/guestfs.pod:2572 ../src/guestfs.pod:2576
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<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
5480 #: ../src/guestfs.pod:2504 ../fish/guestfish.pod:1055
5481 msgid "Location of temporary directory, defaults to C</tmp>."
5486 #: ../src/guestfs.pod:2506 ../fish/guestfish.pod:1057
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</tmp> is not large enough."
5496 #: ../src/guestfs.pod:2514 ../fish/guestfish.pod:1115
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:2516
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:2543
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:2550 ../tools/virt-win-reg.pl:587
5528 #: ../tools/virt-make-fs.pl:548
5534 #: ../src/guestfs.pod:2552
5535 msgid "To get a list of bugs against libguestfs use this link:"
5540 #: ../src/guestfs.pod:2554
5542 "L<https://bugzilla.redhat.com/buglist.cgi?"
5543 "component=libguestfs&product=Virtualization+Tools>"
5548 #: ../src/guestfs.pod:2556
5549 msgid "To report a new bug against libguestfs use this link:"
5554 #: ../src/guestfs.pod:2558
5556 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
5557 "component=libguestfs&product=Virtualization+Tools>"
5562 #: ../src/guestfs.pod:2560
5563 msgid "When reporting a bug, please check:"
5568 #: ../src/guestfs.pod:2566
5569 msgid "That the bug hasn't been reported already."
5574 #: ../src/guestfs.pod:2570
5575 msgid "That you are testing a recent version."
5580 #: ../src/guestfs.pod:2574
5581 msgid "Describe the bug accurately, and give a way to reproduce it."
5586 #: ../src/guestfs.pod:2578
5588 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
5594 #: ../src/guestfs.pod:2583 ../fish/guestfish.pod:1138
5595 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
5601 #: ../src/guestfs.pod:2585 ../fish/guestfish.pod:1140
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:2587 ../fish/guestfish.pod:1142
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:2589 ../fish/guestfish.pod:1144
5620 #: ../fuse/guestmount.pod:250
5621 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
5626 #: ../src/guestfs.pod:2592
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:2597
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:2602
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:4322
5743 #: ../src/guestfs-actions.pod:4395 ../src/guestfs-actions.pod:4426
5744 #: ../src/guestfs-actions.pod:4445 ../src/guestfs-actions.pod:4464
5745 #: ../src/guestfs-actions.pod:4476 ../src/guestfs-actions.pod:4493
5746 #: ../src/guestfs-actions.pod:4506 ../src/guestfs-actions.pod:4521
5747 #: ../src/guestfs-actions.pod:4536 ../src/guestfs-actions.pod:4571
5748 #: ../src/guestfs-actions.pod:4586 ../src/guestfs-actions.pod:4606
5749 #: ../src/guestfs-actions.pod:4620 ../src/guestfs-actions.pod:4637
5750 #: ../src/guestfs-actions.pod:4686 ../src/guestfs-actions.pod:4723
5751 #: ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4765
5752 #: ../src/guestfs-actions.pod:4782 ../src/guestfs-actions.pod:4800
5753 #: ../src/guestfs-actions.pod:4934 ../src/guestfs-actions.pod:4991
5754 #: ../src/guestfs-actions.pod:5013 ../src/guestfs-actions.pod:5031
5755 #: ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5129
5756 #: ../src/guestfs-actions.pod:5146 ../src/guestfs-actions.pod:5159
5757 #: ../src/guestfs-actions.pod:5173 ../src/guestfs-actions.pod:5462
5758 #: ../src/guestfs-actions.pod:5481 ../src/guestfs-actions.pod:5500
5759 #: ../src/guestfs-actions.pod:5512 ../src/guestfs-actions.pod:5524
5760 #: ../src/guestfs-actions.pod:5538 ../src/guestfs-actions.pod:5550
5761 #: ../src/guestfs-actions.pod:5564 ../src/guestfs-actions.pod:5580
5762 #: ../src/guestfs-actions.pod:5601 ../src/guestfs-actions.pod:5620
5763 #: ../src/guestfs-actions.pod:5639 ../src/guestfs-actions.pod:5657
5764 #: ../src/guestfs-actions.pod:5680 ../src/guestfs-actions.pod:5698
5765 #: ../src/guestfs-actions.pod:5717 ../src/guestfs-actions.pod:5738
5766 #: ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5774
5767 #: ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:5826
5768 #: ../src/guestfs-actions.pod:5845 ../src/guestfs-actions.pod:5869
5769 #: ../src/guestfs-actions.pod:5884 ../src/guestfs-actions.pod:5899
5770 #: ../src/guestfs-actions.pod:5918 ../src/guestfs-actions.pod:5955
5771 #: ../src/guestfs-actions.pod:5978 ../src/guestfs-actions.pod:6004
5772 #: ../src/guestfs-actions.pod:6112 ../src/guestfs-actions.pod:6233
5773 #: ../src/guestfs-actions.pod:6245 ../src/guestfs-actions.pod:6258
5774 #: ../src/guestfs-actions.pod:6271 ../src/guestfs-actions.pod:6293
5775 #: ../src/guestfs-actions.pod:6306 ../src/guestfs-actions.pod:6319
5776 #: ../src/guestfs-actions.pod:6332 ../src/guestfs-actions.pod:6347
5777 #: ../src/guestfs-actions.pod:6406 ../src/guestfs-actions.pod:6423
5778 #: ../src/guestfs-actions.pod:6439 ../src/guestfs-actions.pod:6455
5779 #: ../src/guestfs-actions.pod:6472 ../src/guestfs-actions.pod:6485
5780 #: ../src/guestfs-actions.pod:6505 ../src/guestfs-actions.pod:6541
5781 #: ../src/guestfs-actions.pod:6555 ../src/guestfs-actions.pod:6596
5782 #: ../src/guestfs-actions.pod:6609 ../src/guestfs-actions.pod:6627
5783 #: ../src/guestfs-actions.pod:6661 ../src/guestfs-actions.pod:6697
5784 #: ../src/guestfs-actions.pod:6816 ../src/guestfs-actions.pod:6834
5785 #: ../src/guestfs-actions.pod:6848 ../src/guestfs-actions.pod:6903
5786 #: ../src/guestfs-actions.pod:6916 ../src/guestfs-actions.pod:6961
5787 #: ../src/guestfs-actions.pod:6994 ../src/guestfs-actions.pod:7048
5788 #: ../src/guestfs-actions.pod:7074 ../src/guestfs-actions.pod:7140
5789 #: ../src/guestfs-actions.pod:7159 ../src/guestfs-actions.pod:7188
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:7082
5809 #: ../src/guestfs-actions.pod:7251 ../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:4710 ../fish/guestfish-actions.pod:4807
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:4573 ../src/guestfs-actions.pod:5659
5827 #: ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5886
5828 #: ../src/guestfs-actions.pod:6349 ../src/guestfs-actions.pod:6474
5829 #: ../src/guestfs-actions.pod:6996
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:4709
5936 #: ../src/guestfs-actions.pod:4837 ../src/guestfs-actions.pod:5243
5937 #: ../src/guestfs-actions.pod:5269 ../src/guestfs-actions.pod:6582
5938 #: ../src/guestfs-actions.pod:7007 ../src/guestfs-actions.pod:7020
5939 #: ../src/guestfs-actions.pod:7033
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:4336 ../src/guestfs-actions.pod:4348
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:4307
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:5320
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:4855
6497 #: ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5218
6498 #: ../src/guestfs-actions.pod:5396 ../src/guestfs-actions.pod:5445
6499 #: ../src/guestfs-actions.pod:6025 ../src/guestfs-actions.pod:6041
6500 #: ../src/guestfs-actions.pod:6058 ../src/guestfs-actions.pod:6082
6501 #: ../src/guestfs-actions.pod:6756 ../src/guestfs-actions.pod:6775
6502 #: ../src/guestfs-actions.pod:6793 ../src/guestfs-actions.pod:6973
6503 #: ../src/guestfs-actions.pod:7245
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:4670
6745 #: ../src/guestfs-actions.pod:5190 ../src/guestfs-actions.pod:5316
6746 #: ../src/guestfs-actions.pod:5430 ../src/guestfs-actions.pod:6098
6747 #: ../src/guestfs-actions.pod:6159 ../src/guestfs-actions.pod:6214
6748 #: ../src/guestfs-actions.pod:6360 ../src/guestfs-actions.pod:6384
6749 #: ../src/guestfs-actions.pod:6866 ../src/guestfs-actions.pod:6886
6750 #: ../src/guestfs-actions.pod:6933 ../src/guestfs-actions.pod:7098
6751 #: ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7202
6752 #: ../src/guestfs-actions.pod:7221 ../src/guestfs-actions.pod:7267
6753 #: ../src/guestfs-actions.pod:7286
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:4674
6768 #: ../src/guestfs-actions.pod:5131 ../src/guestfs-actions.pod:5526
6769 #: ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5552
6770 #: ../src/guestfs-actions.pod:5960 ../src/guestfs-actions.pod:6598
6771 #: ../src/guestfs-actions.pod:6611 ../src/guestfs-actions.pod:6850
6772 #: ../src/guestfs-actions.pod:7086
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:4819
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:6778
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:5306
7555 #: ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:3541
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:5088 ../src/guestfs-actions.pod:5114
7579 #: ../src/guestfs-actions.pod:5245 ../src/guestfs-actions.pod:5271
7580 #: ../src/guestfs-actions.pod:5295 ../src/guestfs-actions.pod:6163
7581 #: ../src/guestfs-actions.pod:6218 ../src/guestfs-actions.pod:6364
7582 #: ../src/guestfs-actions.pod:6388 ../src/guestfs-actions.pod:7050
7583 #: ../src/guestfs-actions.pod:7076 ../src/guestfs-actions.pod:7102
7584 #: ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7206
7585 #: ../src/guestfs-actions.pod:7225 ../src/guestfs-actions.pod:7271
7586 #: ../src/guestfs-actions.pod:7290 ../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:3411
7594 #: ../fish/guestfish-actions.pod:3426 ../fish/guestfish-actions.pod:3502
7595 #: ../fish/guestfish-actions.pod:3519 ../fish/guestfish-actions.pod:3534
7596 #: ../fish/guestfish-actions.pod:4130 ../fish/guestfish-actions.pod:4176
7597 #: ../fish/guestfish-actions.pod:4261 ../fish/guestfish-actions.pod:4276
7598 #: ../fish/guestfish-actions.pod:4686 ../fish/guestfish-actions.pod:4704
7599 #: ../fish/guestfish-actions.pod:4721 ../fish/guestfish-actions.pod:4731
7600 #: ../fish/guestfish-actions.pod:4779 ../fish/guestfish-actions.pod:4789
7601 #: ../fish/guestfish-actions.pod:4818 ../fish/guestfish-actions.pod:4828
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:5194
7613 #: ../src/guestfs-actions.pod:5208 ../src/guestfs-actions.pod:6937
7614 #: ../src/guestfs-actions.pod:6951
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:6634
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:4725
7794 #: ../src/guestfs-actions.pod:4784 ../src/guestfs-actions.pod:4821
7795 #: ../src/guestfs-actions.pod:4839 ../src/guestfs-actions.pod:5015
7796 #: ../src/guestfs-actions.pod:6543 ../src/guestfs-actions.pod:6557
7797 #: ../src/guestfs-actions.pod:6963
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:4424 ../src/guestfs-actions.pod:4443
7884 #: ../src/guestfs-actions.pod:4462 ../fish/guestfish-actions.pod:669
7885 #: ../fish/guestfish-actions.pod:2870 ../fish/guestfish-actions.pod:2986
7886 #: ../fish/guestfish-actions.pod:2996 ../fish/guestfish-actions.pod:3006
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:6629
8113 #: ../src/guestfs-actions.pod:6663 ../src/guestfs-actions.pod:7142
8114 #: ../src/guestfs-actions.pod:7161
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:5221 ../src/guestfs-actions.pod:6870
8126 #: ../src/guestfs-actions.pod:6890 ../src/guestfs-actions.pod:6976
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:4688
8161 #: ../src/guestfs-actions.pod:5065
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:4588
8264 #: ../src/guestfs-actions.pod:6367 ../src/guestfs-actions.pod:6391
8265 #: ../src/guestfs-actions.pod:7009 ../src/guestfs-actions.pod:7022
8266 #: ../src/guestfs-actions.pod:7035
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:6623
8357 #: ../fish/guestfish-actions.pod:821 ../fish/guestfish-actions.pod:4434
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:6668
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:5871
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:4523
8617 #: ../src/guestfs-actions.pod:5399 ../src/guestfs-actions.pod:5448
8618 #: ../src/guestfs-actions.pod:6235 ../src/guestfs-actions.pod:6247
8619 #: ../src/guestfs-actions.pod:6260 ../src/guestfs-actions.pod:6273
8620 #: ../src/guestfs-actions.pod:6295 ../src/guestfs-actions.pod:6308
8621 #: ../src/guestfs-actions.pod:6321 ../src/guestfs-actions.pod:6334
8622 #: ../src/guestfs-actions.pod:7105 ../src/guestfs-actions.pod:7124
8623 #: ../src/guestfs-actions.pod:7209 ../src/guestfs-actions.pod:7228
8624 #: ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7293
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:5483
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:7147
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:5161
9590 #: ../src/guestfs-actions.pod:5641 ../src/guestfs-actions.pod:6009
9591 #: ../src/guestfs-actions.pod:6028 ../src/guestfs-actions.pod:6044
9592 #: ../src/guestfs-actions.pod:6061 ../src/guestfs-actions.pod:6818
9593 #: ../src/guestfs-actions.pod:6836 ../src/guestfs-actions.pod:7190
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:5682
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:5700 ../src/guestfs-actions.pod:5719
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:5735 ../src/guestfs-actions.pod:5842
9752 #: ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:1386
9753 #: ../fish/guestfish-actions.pod:3841 ../fish/guestfish-actions.pod:3928
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:4428 ../src/guestfs-actions.pod:4447
9762 #: ../src/guestfs-actions.pod:4466 ../src/guestfs-actions.pod:4478
9763 #: ../src/guestfs-actions.pod:4495 ../src/guestfs-actions.pod:4508
9764 #: ../src/guestfs-actions.pod:5386 ../src/guestfs-actions.pod:5740
9765 #: ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6584
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:5759
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:5804
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:5091
9934 #: ../src/guestfs-actions.pod:5434 ../src/guestfs-actions.pod:5828
9935 #: ../src/guestfs-actions.pod:6487 ../src/guestfs-actions.pod:6507
9936 #: ../src/guestfs-actions.pod:6699
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:5847 ../src/guestfs-actions.pod:5901
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:5084
10160 #: ../src/guestfs-actions.pod:5110 ../src/guestfs-actions.pod:5291
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:5464 ../src/guestfs-actions.pod:5920
10224 #: ../src/guestfs-actions.pod:7255
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:6085
10271 #: ../src/guestfs-actions.pod:6102
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:6382
10443 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:4274
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:6166
10475 #: ../src/guestfs-actions.pod:6221
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:4650 ../src/guestfs-actions.pod:6523
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:5051
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:6122
12849 #: ../fish/guestfish-actions.pod:2483 ../fish/guestfish-actions.pod:4109
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:6126
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:6130
12878 #: ../src/guestfs-actions.pod:6148 ../src/guestfs-actions.pod:6529
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:4802
13060 #: ../src/guestfs-actions.pod:5582 ../src/guestfs-actions.pod:5957
13061 #: ../src/guestfs-actions.pod:5980 ../src/guestfs-actions.pod:6006
13062 #: ../src/guestfs-actions.pod:7166 ../fish/guestfish-actions.pod:2550
13063 #: ../fish/guestfish-actions.pod:2563 ../fish/guestfish-actions.pod:2647
13064 #: ../fish/guestfish-actions.pod:3208 ../fish/guestfish-actions.pod:3728
13065 #: ../fish/guestfish-actions.pod:4008 ../fish/guestfish-actions.pod:4024
13066 #: ../fish/guestfish-actions.pod:4039 ../fish/guestfish-actions.pod:4754
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:5148
13431 #: ../src/guestfs-actions.pod:6905
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:6918
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:4538
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:4317
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"
14141 #: ../src/guestfs-actions.pod:4302
14144 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
14150 #: ../src/guestfs-actions.pod:4304 ../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:4311 ../fish/guestfish-actions.pod:2910
14159 msgid "C<blocksize>"
14164 #: ../src/guestfs-actions.pod:4313 ../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:4324
14173 msgid "(Added in 1.7.19)"
14178 #: ../src/guestfs-actions.pod:4326
14179 msgid "guestfs_mkfs_opts_va"
14184 #: ../src/guestfs-actions.pod:4328
14188 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
14189 " const char *fstype,\n"
14190 " const char *device,\n"
14191 " va_list args);\n"
14197 #: ../src/guestfs-actions.pod:4334
14198 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
14203 #: ../src/guestfs-actions.pod:4338
14204 msgid "guestfs_mkfs_opts_argv"
14209 #: ../src/guestfs-actions.pod:4340
14213 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
14214 " const char *fstype,\n"
14215 " const char *device,\n"
14216 " const struct guestfs_mkfs_opts_argv *optargs);\n"
14222 #: ../src/guestfs-actions.pod:4346
14223 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
14228 #: ../src/guestfs-actions.pod:4350
14229 msgid "guestfs_mkmountpoint"
14234 #: ../src/guestfs-actions.pod:4352
14238 " guestfs_mkmountpoint (guestfs_h *g,\n"
14239 " const char *exemptpath);\n"
14245 #: ../src/guestfs-actions.pod:4356
14247 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
14248 "that can be used to create extra mountpoints before mounting the first "
14254 #: ../src/guestfs-actions.pod:4360 ../fish/guestfish-actions.pod:2931
14256 "These calls are I<only> necessary in some very limited circumstances, mainly "
14257 "the case where you want to mount a mix of unrelated and/or read-only "
14258 "filesystems together."
14263 #: ../src/guestfs-actions.pod:4364 ../fish/guestfish-actions.pod:2935
14265 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
14266 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
14267 "inside that. You can unpack this as follows in guestfish:"
14272 #: ../src/guestfs-actions.pod:4369 ../fish/guestfish-actions.pod:2940
14275 " add-ro Fedora-11-i686-Live.iso\n"
14277 " mkmountpoint /cd\n"
14278 " mkmountpoint /sqsh\n"
14279 " mkmountpoint /ext3fs\n"
14280 " mount /dev/sda /cd\n"
14281 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
14282 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
14288 #: ../src/guestfs-actions.pod:4378 ../fish/guestfish-actions.pod:2949
14289 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
14294 #: ../src/guestfs-actions.pod:4380
14296 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
14297 "may get unexpected errors if you try to mix these calls. It is safest to "
14298 "manually unmount filesystems and remove mountpoints after use."
14303 #: ../src/guestfs-actions.pod:4384
14305 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
14306 "first, so for this to work for manual mountpoints, you must ensure that the "
14307 "innermost mountpoints have the longest pathnames, as in the example code "
14313 #: ../src/guestfs-actions.pod:4389 ../fish/guestfish-actions.pod:2960
14315 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
14320 #: ../src/guestfs-actions.pod:4391
14322 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
14323 "means that C<guestfs_umount_all> is called when the handle is closed which "
14324 "can also trigger these issues."
14329 #: ../src/guestfs-actions.pod:4397 ../src/guestfs-actions.pod:4656
14330 #: ../src/guestfs-actions.pod:5566
14331 msgid "(Added in 1.0.62)"
14336 #: ../src/guestfs-actions.pod:4399
14337 msgid "guestfs_mknod"
14342 #: ../src/guestfs-actions.pod:4401
14346 " guestfs_mknod (guestfs_h *g,\n"
14350 " const char *path);\n"
14356 #: ../src/guestfs-actions.pod:4408 ../fish/guestfish-actions.pod:2970
14358 "This call creates block or character special devices, or named pipes (FIFOs)."
14363 #: ../src/guestfs-actions.pod:4411 ../fish/guestfish-actions.pod:2973
14365 "The C<mode> parameter should be the mode, using the standard constants. "
14366 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
14367 "used when creating block and character special devices."
14372 #: ../src/guestfs-actions.pod:4416
14374 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
14375 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
14376 "regular file). These constants are available in the standard Linux header "
14377 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
14378 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
14379 "the appropriate constant for you."
14384 #: ../src/guestfs-actions.pod:4430
14385 msgid "guestfs_mknod_b"
14390 #: ../src/guestfs-actions.pod:4432
14394 " guestfs_mknod_b (guestfs_h *g,\n"
14398 " const char *path);\n"
14404 #: ../src/guestfs-actions.pod:4439
14406 "This call creates a block device node called C<path> with mode C<mode> and "
14407 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
14408 "wrapper around C<guestfs_mknod>."
14413 #: ../src/guestfs-actions.pod:4449
14414 msgid "guestfs_mknod_c"
14419 #: ../src/guestfs-actions.pod:4451
14423 " guestfs_mknod_c (guestfs_h *g,\n"
14427 " const char *path);\n"
14433 #: ../src/guestfs-actions.pod:4458
14435 "This call creates a char device node called C<path> with mode C<mode> and "
14436 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
14437 "wrapper around C<guestfs_mknod>."
14442 #: ../src/guestfs-actions.pod:4468
14443 msgid "guestfs_mkswap"
14448 #: ../src/guestfs-actions.pod:4470
14452 " guestfs_mkswap (guestfs_h *g,\n"
14453 " const char *device);\n"
14459 #: ../src/guestfs-actions.pod:4474 ../fish/guestfish-actions.pod:3012
14460 msgid "Create a swap partition on C<device>."
14465 #: ../src/guestfs-actions.pod:4480
14466 msgid "guestfs_mkswap_L"
14471 #: ../src/guestfs-actions.pod:4482
14475 " guestfs_mkswap_L (guestfs_h *g,\n"
14476 " const char *label,\n"
14477 " const char *device);\n"
14483 #: ../src/guestfs-actions.pod:4487 ../fish/guestfish-actions.pod:3018
14484 msgid "Create a swap partition on C<device> with label C<label>."
14489 #: ../src/guestfs-actions.pod:4489 ../fish/guestfish-actions.pod:3020
14491 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
14492 "sda>), just to a partition. This appears to be a limitation of the kernel "
14498 #: ../src/guestfs-actions.pod:4497
14499 msgid "guestfs_mkswap_U"
14504 #: ../src/guestfs-actions.pod:4499
14508 " guestfs_mkswap_U (guestfs_h *g,\n"
14509 " const char *uuid,\n"
14510 " const char *device);\n"
14516 #: ../src/guestfs-actions.pod:4504 ../fish/guestfish-actions.pod:3028
14517 msgid "Create a swap partition on C<device> with UUID C<uuid>."
14522 #: ../src/guestfs-actions.pod:4510
14523 msgid "guestfs_mkswap_file"
14528 #: ../src/guestfs-actions.pod:4512
14532 " guestfs_mkswap_file (guestfs_h *g,\n"
14533 " const char *path);\n"
14539 #: ../src/guestfs-actions.pod:4516 ../fish/guestfish-actions.pod:3034
14540 msgid "Create a swap file."
14545 #: ../src/guestfs-actions.pod:4518
14547 "This command just writes a swap file signature to an existing file. To "
14548 "create the file itself, use something like C<guestfs_fallocate>."
14553 #: ../src/guestfs-actions.pod:4525
14554 msgid "guestfs_modprobe"
14559 #: ../src/guestfs-actions.pod:4527
14563 " guestfs_modprobe (guestfs_h *g,\n"
14564 " const char *modulename);\n"
14570 #: ../src/guestfs-actions.pod:4531 ../fish/guestfish-actions.pod:3043
14571 msgid "This loads a kernel module in the appliance."
14576 #: ../src/guestfs-actions.pod:4533 ../fish/guestfish-actions.pod:3045
14578 "The kernel module must have been whitelisted when libguestfs was built (see "
14579 "C<appliance/kmod.whitelist.in> in the source)."
14584 #: ../src/guestfs-actions.pod:4540
14585 msgid "guestfs_mount"
14590 #: ../src/guestfs-actions.pod:4542
14594 " guestfs_mount (guestfs_h *g,\n"
14595 " const char *device,\n"
14596 " const char *mountpoint);\n"
14602 #: ../src/guestfs-actions.pod:4547 ../fish/guestfish-actions.pod:3052
14604 "Mount a guest disk at a position in the filesystem. Block devices are named "
14605 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
14606 "those block devices contain partitions, they will have the usual names (eg. "
14607 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
14612 #: ../src/guestfs-actions.pod:4553 ../fish/guestfish-actions.pod:3058
14614 "The rules are the same as for L<mount(2)>: A filesystem must first be "
14615 "mounted on C</> before others can be mounted. Other filesystems can only be "
14616 "mounted on directories which already exist."
14621 #: ../src/guestfs-actions.pod:4558 ../fish/guestfish-actions.pod:3063
14623 "The mounted filesystem is writable, if we have sufficient permissions on the "
14624 "underlying device."
14629 #: ../src/guestfs-actions.pod:4561
14631 "B<Important note:> When you use this call, the filesystem options C<sync> "
14632 "and C<noatime> are set implicitly. This was originally done because we "
14633 "thought it would improve reliability, but it turns out that I<-o sync> has a "
14634 "very large negative performance impact and negligible effect on "
14635 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
14636 "in any code that needs performance, and instead use C<guestfs_mount_options> "
14637 "(use an empty string for the first parameter if you don't want any options)."
14642 #: ../src/guestfs-actions.pod:4575
14643 msgid "guestfs_mount_loop"
14648 #: ../src/guestfs-actions.pod:4577
14652 " guestfs_mount_loop (guestfs_h *g,\n"
14653 " const char *file,\n"
14654 " const char *mountpoint);\n"
14660 #: ../src/guestfs-actions.pod:4582 ../fish/guestfish-actions.pod:3080
14662 "This command lets you mount C<file> (a filesystem image in a file) on a "
14663 "mount point. It is entirely equivalent to the command C<mount -o loop file "
14669 #: ../src/guestfs-actions.pod:4590
14670 msgid "guestfs_mount_options"
14675 #: ../src/guestfs-actions.pod:4592
14679 " guestfs_mount_options (guestfs_h *g,\n"
14680 " const char *options,\n"
14681 " const char *device,\n"
14682 " const char *mountpoint);\n"
14688 #: ../src/guestfs-actions.pod:4598
14690 "This is the same as the C<guestfs_mount> command, but it allows you to set "
14691 "the mount options as for the L<mount(8)> I<-o> flag."
14696 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3092
14698 "If the C<options> parameter is an empty string, then no options are passed "
14699 "(all options default to whatever the filesystem uses)."
14704 #: ../src/guestfs-actions.pod:4608 ../src/guestfs-actions.pod:4622
14705 #: ../src/guestfs-actions.pod:4639
14706 msgid "(Added in 1.0.10)"
14711 #: ../src/guestfs-actions.pod:4610
14712 msgid "guestfs_mount_ro"
14717 #: ../src/guestfs-actions.pod:4612
14721 " guestfs_mount_ro (guestfs_h *g,\n"
14722 " const char *device,\n"
14723 " const char *mountpoint);\n"
14729 #: ../src/guestfs-actions.pod:4617
14731 "This is the same as the C<guestfs_mount> command, but it mounts the "
14732 "filesystem with the read-only (I<-o ro>) flag."
14737 #: ../src/guestfs-actions.pod:4624
14738 msgid "guestfs_mount_vfs"
14743 #: ../src/guestfs-actions.pod:4626
14747 " guestfs_mount_vfs (guestfs_h *g,\n"
14748 " const char *options,\n"
14749 " const char *vfstype,\n"
14750 " const char *device,\n"
14751 " const char *mountpoint);\n"
14757 #: ../src/guestfs-actions.pod:4633
14759 "This is the same as the C<guestfs_mount> command, but it allows you to set "
14760 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
14766 #: ../src/guestfs-actions.pod:4641
14767 msgid "guestfs_mountpoints"
14772 #: ../src/guestfs-actions.pod:4643
14776 " guestfs_mountpoints (guestfs_h *g);\n"
14782 #: ../src/guestfs-actions.pod:4646
14784 "This call is similar to C<guestfs_mounts>. That call returns a list of "
14785 "devices. This one returns a hash table (map) of device name to directory "
14786 "where the device is mounted."
14791 #: ../src/guestfs-actions.pod:4658
14792 msgid "guestfs_mounts"
14797 #: ../src/guestfs-actions.pod:4660
14801 " guestfs_mounts (guestfs_h *g);\n"
14807 #: ../src/guestfs-actions.pod:4663 ../fish/guestfish-actions.pod:3123
14809 "This returns the list of currently mounted filesystems. It returns the list "
14810 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
14815 #: ../src/guestfs-actions.pod:4666 ../fish/guestfish-actions.pod:3126
14816 msgid "Some internal mounts are not shown."
14821 #: ../src/guestfs-actions.pod:4668
14822 msgid "See also: C<guestfs_mountpoints>"
14827 #: ../src/guestfs-actions.pod:4676
14833 #: ../src/guestfs-actions.pod:4678
14837 " guestfs_mv (guestfs_h *g,\n"
14838 " const char *src,\n"
14839 " const char *dest);\n"
14845 #: ../src/guestfs-actions.pod:4683 ../fish/guestfish-actions.pod:3134
14847 "This moves a file from C<src> to C<dest> where C<dest> is either a "
14848 "destination filename or destination directory."
14853 #: ../src/guestfs-actions.pod:4690
14854 msgid "guestfs_ntfs_3g_probe"
14859 #: ../src/guestfs-actions.pod:4692
14863 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
14865 " const char *device);\n"
14871 #: ../src/guestfs-actions.pod:4697 ../fish/guestfish-actions.pod:3141
14873 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
14874 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
14875 "write, and some cannot be mounted at all)."
14880 #: ../src/guestfs-actions.pod:4701 ../fish/guestfish-actions.pod:3145
14882 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
14883 "can be mounted read-write. Set it to false if you want to test if the "
14884 "volume can be mounted read-only."
14889 #: ../src/guestfs-actions.pod:4705 ../fish/guestfish-actions.pod:3149
14891 "The return value is an integer which C<0> if the operation would succeed, or "
14892 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
14897 #: ../src/guestfs-actions.pod:4711
14898 msgid "(Added in 1.0.43)"
14903 #: ../src/guestfs-actions.pod:4713
14904 msgid "guestfs_ntfsresize"
14909 #: ../src/guestfs-actions.pod:4715
14913 " guestfs_ntfsresize (guestfs_h *g,\n"
14914 " const char *device);\n"
14920 #: ../src/guestfs-actions.pod:4719 ../fish/guestfish-actions.pod:3157
14922 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
14923 "size of the underlying device. See also L<ntfsresize(8)>."
14928 #: ../src/guestfs-actions.pod:4727
14929 msgid "guestfs_ntfsresize_size"
14934 #: ../src/guestfs-actions.pod:4729
14938 " guestfs_ntfsresize_size (guestfs_h *g,\n"
14939 " const char *device,\n"
14940 " int64_t size);\n"
14946 #: ../src/guestfs-actions.pod:4734
14948 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
14949 "to specify the new size (in bytes) explicitly."
14954 #: ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:5175
14955 #: ../src/guestfs-actions.pod:5248 ../src/guestfs-actions.pod:5514
14956 #: ../src/guestfs-actions.pod:7053
14957 msgid "(Added in 1.3.14)"
14962 #: ../src/guestfs-actions.pod:4741
14963 msgid "guestfs_part_add"
14968 #: ../src/guestfs-actions.pod:4743
14972 " guestfs_part_add (guestfs_h *g,\n"
14973 " const char *device,\n"
14974 " const char *prlogex,\n"
14975 " int64_t startsect,\n"
14976 " int64_t endsect);\n"
14982 #: ../src/guestfs-actions.pod:4750
14984 "This command adds a partition to C<device>. If there is no partition table "
14985 "on the device, call C<guestfs_part_init> first."
14990 #: ../src/guestfs-actions.pod:4753 ../fish/guestfish-actions.pod:3175
14992 "The C<prlogex> parameter is the type of partition. Normally you should pass "
14993 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
14994 "C<logical>) and C<e> (or C<extended>) partition types."
14999 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3180
15001 "C<startsect> and C<endsect> are the start and end of the partition in "
15002 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
15003 "from the end of the disk (C<-1> is the last sector)."
15008 #: ../src/guestfs-actions.pod:4762
15010 "Creating a partition which covers the whole disk is not so easy. Use "
15011 "C<guestfs_part_disk> to do that."
15016 #: ../src/guestfs-actions.pod:4767 ../src/guestfs-actions.pod:4805
15017 #: ../src/guestfs-actions.pod:4858 ../src/guestfs-actions.pod:4936
15018 #: ../src/guestfs-actions.pod:4974 ../src/guestfs-actions.pod:4993
15019 #: ../src/guestfs-actions.pod:5033
15020 msgid "(Added in 1.0.78)"
15025 #: ../src/guestfs-actions.pod:4769
15026 msgid "guestfs_part_del"
15031 #: ../src/guestfs-actions.pod:4771
15035 " guestfs_part_del (guestfs_h *g,\n"
15036 " const char *device,\n"
15043 #: ../src/guestfs-actions.pod:4776 ../fish/guestfish-actions.pod:3191
15044 msgid "This command deletes the partition numbered C<partnum> on C<device>."
15049 #: ../src/guestfs-actions.pod:4778 ../fish/guestfish-actions.pod:3193
15051 "Note that in the case of MBR partitioning, deleting an extended partition "
15052 "also deletes any logical partitions it contains."
15057 #: ../src/guestfs-actions.pod:4786
15058 msgid "guestfs_part_disk"
15063 #: ../src/guestfs-actions.pod:4788
15067 " guestfs_part_disk (guestfs_h *g,\n"
15068 " const char *device,\n"
15069 " const char *parttype);\n"
15075 #: ../src/guestfs-actions.pod:4793
15077 "This command is simply a combination of C<guestfs_part_init> followed by "
15078 "C<guestfs_part_add> to create a single primary partition covering the whole "
15084 #: ../src/guestfs-actions.pod:4797
15086 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
15087 "possible values are described in C<guestfs_part_init>."
15092 #: ../src/guestfs-actions.pod:4807
15093 msgid "guestfs_part_get_bootable"
15098 #: ../src/guestfs-actions.pod:4809
15102 " guestfs_part_get_bootable (guestfs_h *g,\n"
15103 " const char *device,\n"
15110 #: ../src/guestfs-actions.pod:4814 ../fish/guestfish-actions.pod:3215
15112 "This command returns true if the partition C<partnum> on C<device> has the "
15113 "bootable flag set."
15118 #: ../src/guestfs-actions.pod:4817
15119 msgid "See also C<guestfs_part_set_bootable>."
15124 #: ../src/guestfs-actions.pod:4823
15125 msgid "guestfs_part_get_mbr_id"
15130 #: ../src/guestfs-actions.pod:4825
15134 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
15135 " const char *device,\n"
15142 #: ../src/guestfs-actions.pod:4830 ../fish/guestfish-actions.pod:3224
15144 "Returns the MBR type byte (also known as the ID byte) from the numbered "
15145 "partition C<partnum>."
15150 #: ../src/guestfs-actions.pod:4833 ../src/guestfs-actions.pod:5009
15152 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
15153 "undefined results for other partition table types (see "
15154 "C<guestfs_part_get_parttype>)."
15159 #: ../src/guestfs-actions.pod:4841
15160 msgid "guestfs_part_get_parttype"
15165 #: ../src/guestfs-actions.pod:4843
15169 " guestfs_part_get_parttype (guestfs_h *g,\n"
15170 " const char *device);\n"
15176 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3235
15178 "This command examines the partition table on C<device> and returns the "
15179 "partition table type (format) being used."
15184 #: ../src/guestfs-actions.pod:4850
15186 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
15187 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
15188 "possible, although unusual. See C<guestfs_part_init> for a full list."
15193 #: ../src/guestfs-actions.pod:4860
15194 msgid "guestfs_part_init"
15199 #: ../src/guestfs-actions.pod:4862
15203 " guestfs_part_init (guestfs_h *g,\n"
15204 " const char *device,\n"
15205 " const char *parttype);\n"
15211 #: ../src/guestfs-actions.pod:4867 ../fish/guestfish-actions.pod:3247
15213 "This creates an empty partition table on C<device> of one of the partition "
15214 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
15215 "(for large disks)."
15220 #: ../src/guestfs-actions.pod:4871
15222 "Initially there are no partitions. Following this, you should call "
15223 "C<guestfs_part_add> for each partition required."
15228 #: ../src/guestfs-actions.pod:4874 ../fish/guestfish-actions.pod:3254
15229 msgid "Possible values for C<parttype> are:"
15234 #: ../src/guestfs-actions.pod:4878 ../fish/guestfish-actions.pod:3258
15235 msgid "B<efi> | B<gpt>"
15240 #: ../src/guestfs-actions.pod:4880 ../fish/guestfish-actions.pod:3260
15241 msgid "Intel EFI / GPT partition table."
15246 #: ../src/guestfs-actions.pod:4882 ../fish/guestfish-actions.pod:3262
15248 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
15249 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
15250 "the C<mbr> format."
15255 #: ../src/guestfs-actions.pod:4886 ../fish/guestfish-actions.pod:3266
15256 msgid "B<mbr> | B<msdos>"
15261 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3268
15263 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
15264 "Windows. This partition type will B<only> work for device sizes up to 2 "
15265 "TB. For large disks we recommend using C<gpt>."
15270 #: ../src/guestfs-actions.pod:4895 ../fish/guestfish-actions.pod:3275
15272 "Other partition table types that may work but are not supported include:"
15277 #: ../src/guestfs-actions.pod:4900 ../fish/guestfish-actions.pod:3280
15283 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3282
15284 msgid "AIX disk labels."
15289 #: ../src/guestfs-actions.pod:4904 ../fish/guestfish-actions.pod:3284
15290 msgid "B<amiga> | B<rdb>"
15295 #: ../src/guestfs-actions.pod:4906 ../fish/guestfish-actions.pod:3286
15296 msgid "Amiga \"Rigid Disk Block\" format."
15301 #: ../src/guestfs-actions.pod:4908 ../fish/guestfish-actions.pod:3288
15307 #: ../src/guestfs-actions.pod:4910 ../fish/guestfish-actions.pod:3290
15308 msgid "BSD disk labels."
15313 #: ../src/guestfs-actions.pod:4912 ../fish/guestfish-actions.pod:3292
15319 #: ../src/guestfs-actions.pod:4914 ../fish/guestfish-actions.pod:3294
15320 msgid "DASD, used on IBM mainframes."
15325 #: ../src/guestfs-actions.pod:4916 ../fish/guestfish-actions.pod:3296
15331 #: ../src/guestfs-actions.pod:4918 ../fish/guestfish-actions.pod:3298
15332 msgid "MIPS/SGI volumes."
15337 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3300
15343 #: ../src/guestfs-actions.pod:4922 ../fish/guestfish-actions.pod:3302
15344 msgid "Old Mac partition format. Modern Macs use C<gpt>."
15349 #: ../src/guestfs-actions.pod:4924 ../fish/guestfish-actions.pod:3304
15355 #: ../src/guestfs-actions.pod:4926 ../fish/guestfish-actions.pod:3306
15356 msgid "NEC PC-98 format, common in Japan apparently."
15361 #: ../src/guestfs-actions.pod:4928 ../fish/guestfish-actions.pod:3308
15367 #: ../src/guestfs-actions.pod:4930 ../fish/guestfish-actions.pod:3310
15368 msgid "Sun disk labels."
15373 #: ../src/guestfs-actions.pod:4938
15374 msgid "guestfs_part_list"
15379 #: ../src/guestfs-actions.pod:4940
15382 " struct guestfs_partition_list *\n"
15383 " guestfs_part_list (guestfs_h *g,\n"
15384 " const char *device);\n"
15390 #: ../src/guestfs-actions.pod:4944 ../fish/guestfish-actions.pod:3318
15392 "This command parses the partition table on C<device> and returns the list of "
15393 "partitions found."
15398 #: ../src/guestfs-actions.pod:4947 ../fish/guestfish-actions.pod:3321
15399 msgid "The fields in the returned structure are:"
15404 #: ../src/guestfs-actions.pod:4951 ../fish/guestfish-actions.pod:3325
15405 msgid "B<part_num>"
15410 #: ../src/guestfs-actions.pod:4953 ../fish/guestfish-actions.pod:3327
15411 msgid "Partition number, counting from 1."
15416 #: ../src/guestfs-actions.pod:4955 ../fish/guestfish-actions.pod:3329
15417 msgid "B<part_start>"
15422 #: ../src/guestfs-actions.pod:4957
15424 "Start of the partition I<in bytes>. To get sectors you have to divide by "
15425 "the device's sector size, see C<guestfs_blockdev_getss>."
15430 #: ../src/guestfs-actions.pod:4960 ../fish/guestfish-actions.pod:3334
15431 msgid "B<part_end>"
15436 #: ../src/guestfs-actions.pod:4962 ../fish/guestfish-actions.pod:3336
15437 msgid "End of the partition in bytes."
15442 #: ../src/guestfs-actions.pod:4964 ../fish/guestfish-actions.pod:3338
15443 msgid "B<part_size>"
15448 #: ../src/guestfs-actions.pod:4966 ../fish/guestfish-actions.pod:3340
15449 msgid "Size of the partition in bytes."
15454 #: ../src/guestfs-actions.pod:4970
15456 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
15457 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
15463 #: ../src/guestfs-actions.pod:4976
15464 msgid "guestfs_part_set_bootable"
15469 #: ../src/guestfs-actions.pod:4978
15473 " guestfs_part_set_bootable (guestfs_h *g,\n"
15474 " const char *device,\n"
15476 " int bootable);\n"
15482 #: ../src/guestfs-actions.pod:4984 ../fish/guestfish-actions.pod:3348
15484 "This sets the bootable flag on partition numbered C<partnum> on device "
15485 "C<device>. Note that partitions are numbered from 1."
15490 #: ../src/guestfs-actions.pod:4987 ../fish/guestfish-actions.pod:3351
15492 "The bootable flag is used by some operating systems (notably Windows) to "
15493 "determine which partition to boot from. It is by no means universally "
15499 #: ../src/guestfs-actions.pod:4995
15500 msgid "guestfs_part_set_mbr_id"
15505 #: ../src/guestfs-actions.pod:4997
15509 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
15510 " const char *device,\n"
15518 #: ../src/guestfs-actions.pod:5003 ../fish/guestfish-actions.pod:3359
15520 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
15521 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
15522 "documentation are in fact hexadecimal numbers, but usually documented "
15523 "without any leading \"0x\" which might be confusing."
15528 #: ../src/guestfs-actions.pod:5017
15529 msgid "guestfs_part_set_name"
15534 #: ../src/guestfs-actions.pod:5019
15538 " guestfs_part_set_name (guestfs_h *g,\n"
15539 " const char *device,\n"
15541 " const char *name);\n"
15547 #: ../src/guestfs-actions.pod:5025 ../fish/guestfish-actions.pod:3373
15549 "This sets the partition name on partition numbered C<partnum> on device "
15550 "C<device>. Note that partitions are numbered from 1."
15555 #: ../src/guestfs-actions.pod:5028 ../fish/guestfish-actions.pod:3376
15557 "The partition name can only be set on certain types of partition table. "
15558 "This works on C<gpt> but not on C<mbr> partitions."
15563 #: ../src/guestfs-actions.pod:5035
15564 msgid "guestfs_part_to_dev"
15569 #: ../src/guestfs-actions.pod:5037
15573 " guestfs_part_to_dev (guestfs_h *g,\n"
15574 " const char *partition);\n"
15580 #: ../src/guestfs-actions.pod:5041 ../fish/guestfish-actions.pod:3383
15582 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
15583 "partition number, returning the device name (eg. \"/dev/sdb\")."
15588 #: ../src/guestfs-actions.pod:5045
15590 "The named partition must exist, for example as a string returned from "
15591 "C<guestfs_list_partitions>."
15596 #: ../src/guestfs-actions.pod:5053
15597 msgid "guestfs_ping_daemon"
15602 #: ../src/guestfs-actions.pod:5055
15606 " guestfs_ping_daemon (guestfs_h *g);\n"
15612 #: ../src/guestfs-actions.pod:5058 ../fish/guestfish-actions.pod:3394
15614 "This is a test probe into the guestfs daemon running inside the qemu "
15615 "subprocess. Calling this function checks that the daemon responds to the "
15616 "ping message, without affecting the daemon or attached block device(s) in "
15622 #: ../src/guestfs-actions.pod:5067
15623 msgid "guestfs_pread"
15628 #: ../src/guestfs-actions.pod:5069
15632 " guestfs_pread (guestfs_h *g,\n"
15633 " const char *path,\n"
15635 " int64_t offset,\n"
15636 " size_t *size_r);\n"
15642 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3403
15644 "This command lets you read part of a file. It reads C<count> bytes of the "
15645 "file, starting at C<offset>, from file C<path>."
15650 #: ../src/guestfs-actions.pod:5079 ../src/guestfs-actions.pod:5105
15651 #: ../fish/guestfish-actions.pod:3406 ../fish/guestfish-actions.pod:3421
15653 "This may read fewer bytes than requested. For further details see the "
15654 "L<pread(2)> system call."
15659 #: ../src/guestfs-actions.pod:5082
15660 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
15665 #: ../src/guestfs-actions.pod:5093
15666 msgid "guestfs_pread_device"
15671 #: ../src/guestfs-actions.pod:5095
15675 " guestfs_pread_device (guestfs_h *g,\n"
15676 " const char *device,\n"
15678 " int64_t offset,\n"
15679 " size_t *size_r);\n"
15685 #: ../src/guestfs-actions.pod:5102 ../fish/guestfish-actions.pod:3418
15687 "This command lets you read part of a file. It reads C<count> bytes of "
15688 "C<device>, starting at C<offset>."
15693 #: ../src/guestfs-actions.pod:5108
15694 msgid "See also C<guestfs_pread>."
15699 #: ../src/guestfs-actions.pod:5117
15700 msgid "(Added in 1.5.21)"
15705 #: ../src/guestfs-actions.pod:5119
15706 msgid "guestfs_pvcreate"
15711 #: ../src/guestfs-actions.pod:5121
15715 " guestfs_pvcreate (guestfs_h *g,\n"
15716 " const char *device);\n"
15722 #: ../src/guestfs-actions.pod:5125 ../fish/guestfish-actions.pod:3433
15724 "This creates an LVM physical volume on the named C<device>, where C<device> "
15725 "should usually be a partition name such as C</dev/sda1>."
15730 #: ../src/guestfs-actions.pod:5133
15731 msgid "guestfs_pvremove"
15736 #: ../src/guestfs-actions.pod:5135
15740 " guestfs_pvremove (guestfs_h *g,\n"
15741 " const char *device);\n"
15747 #: ../src/guestfs-actions.pod:5139 ../fish/guestfish-actions.pod:3441
15749 "This wipes a physical volume C<device> so that LVM will no longer recognise "
15755 #: ../src/guestfs-actions.pod:5142 ../fish/guestfish-actions.pod:3444
15757 "The implementation uses the C<pvremove> command which refuses to wipe "
15758 "physical volumes that contain any volume groups, so you have to remove those "
15764 #: ../src/guestfs-actions.pod:5150
15765 msgid "guestfs_pvresize"
15770 #: ../src/guestfs-actions.pod:5152
15774 " guestfs_pvresize (guestfs_h *g,\n"
15775 " const char *device);\n"
15781 #: ../src/guestfs-actions.pod:5156 ../fish/guestfish-actions.pod:3452
15783 "This resizes (expands or shrinks) an existing LVM physical volume to match "
15784 "the new size of the underlying device."
15789 #: ../src/guestfs-actions.pod:5163
15790 msgid "guestfs_pvresize_size"
15795 #: ../src/guestfs-actions.pod:5165
15799 " guestfs_pvresize_size (guestfs_h *g,\n"
15800 " const char *device,\n"
15801 " int64_t size);\n"
15807 #: ../src/guestfs-actions.pod:5170
15809 "This command is the same as C<guestfs_pvresize> except that it allows you to "
15810 "specify the new size (in bytes) explicitly."
15815 #: ../src/guestfs-actions.pod:5177
15816 msgid "guestfs_pvs"
15821 #: ../src/guestfs-actions.pod:5179
15825 " guestfs_pvs (guestfs_h *g);\n"
15831 #: ../src/guestfs-actions.pod:5182 ../fish/guestfish-actions.pod:3466
15833 "List all the physical volumes detected. This is the equivalent of the L<pvs"
15839 #: ../src/guestfs-actions.pod:5185 ../fish/guestfish-actions.pod:3469
15841 "This returns a list of just the device names that contain PVs (eg. C</dev/"
15847 #: ../src/guestfs-actions.pod:5188
15848 msgid "See also C<guestfs_pvs_full>."
15853 #: ../src/guestfs-actions.pod:5196
15854 msgid "guestfs_pvs_full"
15859 #: ../src/guestfs-actions.pod:5198
15862 " struct guestfs_lvm_pv_list *\n"
15863 " guestfs_pvs_full (guestfs_h *g);\n"
15869 #: ../src/guestfs-actions.pod:5201 ../fish/guestfish-actions.pod:3478
15871 "List all the physical volumes detected. This is the equivalent of the L<pvs"
15872 "(8)> command. The \"full\" version includes all fields."
15877 #: ../src/guestfs-actions.pod:5204
15879 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
15880 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
15885 #: ../src/guestfs-actions.pod:5210
15886 msgid "guestfs_pvuuid"
15891 #: ../src/guestfs-actions.pod:5212
15895 " guestfs_pvuuid (guestfs_h *g,\n"
15896 " const char *device);\n"
15902 #: ../src/guestfs-actions.pod:5216 ../fish/guestfish-actions.pod:3485
15903 msgid "This command returns the UUID of the LVM PV C<device>."
15908 #: ../src/guestfs-actions.pod:5223
15909 msgid "guestfs_pwrite"
15914 #: ../src/guestfs-actions.pod:5225
15918 " guestfs_pwrite (guestfs_h *g,\n"
15919 " const char *path,\n"
15920 " const char *content,\n"
15921 " size_t content_size,\n"
15922 " int64_t offset);\n"
15928 #: ../src/guestfs-actions.pod:5232 ../fish/guestfish-actions.pod:3491
15930 "This command writes to part of a file. It writes the data buffer C<content> "
15931 "to the file C<path> starting at offset C<offset>."
15936 #: ../src/guestfs-actions.pod:5235 ../fish/guestfish-actions.pod:3494
15938 "This command implements the L<pwrite(2)> system call, and like that system "
15939 "call it may not write the full data requested. The return value is the "
15940 "number of bytes that were actually written to the file. This could even be "
15941 "0, although short writes are unlikely for regular files in ordinary "
15947 #: ../src/guestfs-actions.pod:5241
15948 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
15953 #: ../src/guestfs-actions.pod:5250
15954 msgid "guestfs_pwrite_device"
15959 #: ../src/guestfs-actions.pod:5252
15963 " guestfs_pwrite_device (guestfs_h *g,\n"
15964 " const char *device,\n"
15965 " const char *content,\n"
15966 " size_t content_size,\n"
15967 " int64_t offset);\n"
15973 #: ../src/guestfs-actions.pod:5259 ../fish/guestfish-actions.pod:3509
15975 "This command writes to part of a device. It writes the data buffer "
15976 "C<content> to C<device> starting at offset C<offset>."
15981 #: ../src/guestfs-actions.pod:5262 ../fish/guestfish-actions.pod:3512
15983 "This command implements the L<pwrite(2)> system call, and like that system "
15984 "call it may not write the full data requested (although short writes to disk "
15985 "devices and partitions are probably impossible with standard Linux kernels)."
15990 #: ../src/guestfs-actions.pod:5267
15991 msgid "See also C<guestfs_pwrite>."
15996 #: ../src/guestfs-actions.pod:5274
15997 msgid "(Added in 1.5.20)"
16002 #: ../src/guestfs-actions.pod:5276
16003 msgid "guestfs_read_file"
16008 #: ../src/guestfs-actions.pod:5278
16012 " guestfs_read_file (guestfs_h *g,\n"
16013 " const char *path,\n"
16014 " size_t *size_r);\n"
16020 #: ../src/guestfs-actions.pod:5283 ../fish/guestfish-actions.pod:3526
16021 msgid "This calls returns the contents of the file C<path> as a buffer."
16026 #: ../src/guestfs-actions.pod:5286
16028 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
16029 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
16030 "function is limited in the total size of file that can be handled."
16035 #: ../src/guestfs-actions.pod:5298
16036 msgid "(Added in 1.0.63)"
16041 #: ../src/guestfs-actions.pod:5300
16042 msgid "guestfs_read_lines"
16047 #: ../src/guestfs-actions.pod:5302
16051 " guestfs_read_lines (guestfs_h *g,\n"
16052 " const char *path);\n"
16058 #: ../src/guestfs-actions.pod:5308 ../fish/guestfish-actions.pod:3543
16060 "The file contents are returned as a list of lines. Trailing C<LF> and "
16061 "C<CRLF> character sequences are I<not> returned."
16066 #: ../src/guestfs-actions.pod:5311
16068 "Note that this function cannot correctly handle binary files (specifically, "
16069 "files containing C<\\0> character which is treated as end of line). For "
16070 "those you need to use the C<guestfs_read_file> function which has a more "
16071 "complex interface."
16076 #: ../src/guestfs-actions.pod:5322
16077 msgid "guestfs_readdir"
16082 #: ../src/guestfs-actions.pod:5324
16085 " struct guestfs_dirent_list *\n"
16086 " guestfs_readdir (guestfs_h *g,\n"
16087 " const char *dir);\n"
16093 #: ../src/guestfs-actions.pod:5328 ../fish/guestfish-actions.pod:3555
16094 msgid "This returns the list of directory entries in directory C<dir>."
16099 #: ../src/guestfs-actions.pod:5330 ../fish/guestfish-actions.pod:3557
16101 "All entries in the directory are returned, including C<.> and C<..>. The "
16102 "entries are I<not> sorted, but returned in the same order as the underlying "
16108 #: ../src/guestfs-actions.pod:5334 ../fish/guestfish-actions.pod:3561
16110 "Also this call returns basic file type information about each file. The "
16111 "C<ftyp> field will contain one of the following characters:"
16116 #: ../src/guestfs-actions.pod:5339 ../fish/guestfish-actions.pod:3566
16122 #: ../src/guestfs-actions.pod:5341 ../fish/guestfish-actions.pod:3568
16123 msgid "Block special"
16128 #: ../src/guestfs-actions.pod:5343 ../fish/guestfish-actions.pod:3570
16134 #: ../src/guestfs-actions.pod:5345 ../fish/guestfish-actions.pod:3572
16135 msgid "Char special"
16140 #: ../src/guestfs-actions.pod:5347 ../fish/guestfish-actions.pod:3574
16146 #: ../src/guestfs-actions.pod:5349 ../fish/guestfish-actions.pod:3576
16152 #: ../src/guestfs-actions.pod:5351 ../fish/guestfish-actions.pod:3578
16158 #: ../src/guestfs-actions.pod:5353 ../fish/guestfish-actions.pod:3580
16159 msgid "FIFO (named pipe)"
16164 #: ../src/guestfs-actions.pod:5355 ../fish/guestfish-actions.pod:3582
16170 #: ../src/guestfs-actions.pod:5357 ../fish/guestfish-actions.pod:3584
16171 msgid "Symbolic link"
16176 #: ../src/guestfs-actions.pod:5359 ../fish/guestfish-actions.pod:3586
16182 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3588
16183 msgid "Regular file"
16188 #: ../src/guestfs-actions.pod:5363 ../fish/guestfish-actions.pod:3590
16194 #: ../src/guestfs-actions.pod:5365 ../fish/guestfish-actions.pod:3592
16200 #: ../src/guestfs-actions.pod:5367 ../fish/guestfish-actions.pod:3594
16206 #: ../src/guestfs-actions.pod:5369 ../fish/guestfish-actions.pod:3596
16207 msgid "Unknown file type"
16212 #: ../src/guestfs-actions.pod:5371 ../fish/guestfish-actions.pod:3598
16218 #: ../src/guestfs-actions.pod:5373 ../fish/guestfish-actions.pod:3600
16220 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
16225 #: ../src/guestfs-actions.pod:5378
16227 "This function is primarily intended for use by programs. To get a simple "
16228 "list of names, use C<guestfs_ls>. To get a printable directory for human "
16229 "consumption, use C<guestfs_ll>."
16234 #: ../src/guestfs-actions.pod:5382
16236 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
16237 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
16242 #: ../src/guestfs-actions.pod:5388
16243 msgid "guestfs_readlink"
16248 #: ../src/guestfs-actions.pod:5390
16252 " guestfs_readlink (guestfs_h *g,\n"
16253 " const char *path);\n"
16259 #: ../src/guestfs-actions.pod:5394 ../fish/guestfish-actions.pod:3613
16260 msgid "This command reads the target of a symbolic link."
16265 #: ../src/guestfs-actions.pod:5401
16266 msgid "guestfs_readlinklist"
16271 #: ../src/guestfs-actions.pod:5403
16275 " guestfs_readlinklist (guestfs_h *g,\n"
16276 " const char *path,\n"
16277 " char *const *names);\n"
16283 #: ../src/guestfs-actions.pod:5408 ../fish/guestfish-actions.pod:3619
16285 "This call allows you to do a C<readlink> operation on multiple files, where "
16286 "all files are in the directory C<path>. C<names> is the list of files from "
16292 #: ../src/guestfs-actions.pod:5412 ../fish/guestfish-actions.pod:3623
16294 "On return you get a list of strings, with a one-to-one correspondence to the "
16295 "C<names> list. Each string is the value of the symbolic link."
16300 #: ../src/guestfs-actions.pod:5416 ../fish/guestfish-actions.pod:3627
16302 "If the C<readlink(2)> operation fails on any name, then the corresponding "
16303 "result string is the empty string C<\"\">. However the whole operation is "
16304 "completed even if there were C<readlink(2)> errors, and so you can call this "
16305 "function with names where you don't know if they are symbolic links already "
16306 "(albeit slightly less efficient)."
16311 #: ../src/guestfs-actions.pod:5423 ../fish/guestfish-actions.pod:3634
16313 "This call is intended for programs that want to efficiently list a directory "
16314 "contents without making many round-trips. Very long directory listings "
16315 "might cause the protocol message size to be exceeded, causing this call to "
16316 "fail. The caller must split up such requests into smaller groups of names."
16321 #: ../src/guestfs-actions.pod:5436
16322 msgid "guestfs_realpath"
16327 #: ../src/guestfs-actions.pod:5438
16331 " guestfs_realpath (guestfs_h *g,\n"
16332 " const char *path);\n"
16338 #: ../src/guestfs-actions.pod:5442 ../fish/guestfish-actions.pod:3645
16340 "Return the canonicalized absolute pathname of C<path>. The returned path "
16341 "has no C<.>, C<..> or symbolic link path elements."
16346 #: ../src/guestfs-actions.pod:5450
16347 msgid "guestfs_removexattr"
16352 #: ../src/guestfs-actions.pod:5452
16356 " guestfs_removexattr (guestfs_h *g,\n"
16357 " const char *xattr,\n"
16358 " const char *path);\n"
16364 #: ../src/guestfs-actions.pod:5457 ../fish/guestfish-actions.pod:3652
16366 "This call removes the extended attribute named C<xattr> of the file C<path>."
16371 #: ../src/guestfs-actions.pod:5460
16372 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
16377 #: ../src/guestfs-actions.pod:5466
16378 msgid "guestfs_resize2fs"
16383 #: ../src/guestfs-actions.pod:5468
16387 " guestfs_resize2fs (guestfs_h *g,\n"
16388 " const char *device);\n"
16394 #: ../src/guestfs-actions.pod:5472 ../fish/guestfish-actions.pod:3661
16396 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
16397 "underlying device."
16402 #: ../src/guestfs-actions.pod:5475
16404 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
16405 "C<device> before calling this command. For unknown reasons C<resize2fs> "
16406 "sometimes gives an error about this and sometimes not. In any case, it is "
16407 "always safe to call C<guestfs_e2fsck_f> before calling this function."
16411 #: ../src/guestfs-actions.pod:5485
16412 msgid "guestfs_resize2fs_M"
16416 #: ../src/guestfs-actions.pod:5487
16420 " guestfs_resize2fs_M (guestfs_h *g,\n"
16421 " const char *device);\n"
16426 #: ../src/guestfs-actions.pod:5491
16428 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
16429 "resized to its minimum size. This works like the C<-M> option to the "
16430 "C<resize2fs> command."
16434 #: ../src/guestfs-actions.pod:5495
16436 "To get the resulting size of the filesystem you should call "
16437 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
16438 "These two numbers, multiplied together, give the resulting size of the "
16439 "minimal filesystem in bytes."
16444 #: ../src/guestfs-actions.pod:5502
16445 msgid "guestfs_resize2fs_size"
16450 #: ../src/guestfs-actions.pod:5504
16454 " guestfs_resize2fs_size (guestfs_h *g,\n"
16455 " const char *device,\n"
16456 " int64_t size);\n"
16462 #: ../src/guestfs-actions.pod:5509
16464 "This command is the same as C<guestfs_resize2fs> except that it allows you "
16465 "to specify the new size (in bytes) explicitly."
16470 #: ../src/guestfs-actions.pod:5516
16476 #: ../src/guestfs-actions.pod:5518
16480 " guestfs_rm (guestfs_h *g,\n"
16481 " const char *path);\n"
16487 #: ../src/guestfs-actions.pod:5522 ../fish/guestfish-actions.pod:3694
16488 msgid "Remove the single file C<path>."
16493 #: ../src/guestfs-actions.pod:5528
16494 msgid "guestfs_rm_rf"
16499 #: ../src/guestfs-actions.pod:5530
16503 " guestfs_rm_rf (guestfs_h *g,\n"
16504 " const char *path);\n"
16510 #: ../src/guestfs-actions.pod:5534 ../fish/guestfish-actions.pod:3700
16512 "Remove the file or directory C<path>, recursively removing the contents if "
16513 "its a directory. This is like the C<rm -rf> shell command."
16518 #: ../src/guestfs-actions.pod:5542
16519 msgid "guestfs_rmdir"
16524 #: ../src/guestfs-actions.pod:5544
16528 " guestfs_rmdir (guestfs_h *g,\n"
16529 " const char *path);\n"
16535 #: ../src/guestfs-actions.pod:5548 ../fish/guestfish-actions.pod:3708
16536 msgid "Remove the single directory C<path>."
16541 #: ../src/guestfs-actions.pod:5554
16542 msgid "guestfs_rmmountpoint"
16547 #: ../src/guestfs-actions.pod:5556
16551 " guestfs_rmmountpoint (guestfs_h *g,\n"
16552 " const char *exemptpath);\n"
16558 #: ../src/guestfs-actions.pod:5560
16560 "This calls removes a mountpoint that was previously created with "
16561 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
16566 #: ../src/guestfs-actions.pod:5568
16567 msgid "guestfs_scrub_device"
16572 #: ../src/guestfs-actions.pod:5570
16576 " guestfs_scrub_device (guestfs_h *g,\n"
16577 " const char *device);\n"
16583 #: ../src/guestfs-actions.pod:5574 ../fish/guestfish-actions.pod:3722
16585 "This command writes patterns over C<device> to make data retrieval more "
16591 #: ../src/guestfs-actions.pod:5577 ../src/guestfs-actions.pod:5598
16592 #: ../src/guestfs-actions.pod:5617 ../fish/guestfish-actions.pod:3725
16593 #: ../fish/guestfish-actions.pod:3740 ../fish/guestfish-actions.pod:3753
16595 "It is an interface to the L<scrub(1)> program. See that manual page for "
16601 #: ../src/guestfs-actions.pod:5585 ../src/guestfs-actions.pod:5603
16602 #: ../src/guestfs-actions.pod:5622
16603 msgid "(Added in 1.0.52)"
16608 #: ../src/guestfs-actions.pod:5587
16609 msgid "guestfs_scrub_file"
16614 #: ../src/guestfs-actions.pod:5589
16618 " guestfs_scrub_file (guestfs_h *g,\n"
16619 " const char *file);\n"
16625 #: ../src/guestfs-actions.pod:5593 ../fish/guestfish-actions.pod:3735
16627 "This command writes patterns over a file to make data retrieval more "
16633 #: ../src/guestfs-actions.pod:5596 ../fish/guestfish-actions.pod:3738
16634 msgid "The file is I<removed> after scrubbing."
16639 #: ../src/guestfs-actions.pod:5605
16640 msgid "guestfs_scrub_freespace"
16645 #: ../src/guestfs-actions.pod:5607
16649 " guestfs_scrub_freespace (guestfs_h *g,\n"
16650 " const char *dir);\n"
16656 #: ../src/guestfs-actions.pod:5611
16658 "This command creates the directory C<dir> and then fills it with files until "
16659 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
16660 "and deletes them. The intention is to scrub any free space on the partition "
16661 "containing C<dir>."
16666 #: ../src/guestfs-actions.pod:5624
16667 msgid "guestfs_set_append"
16672 #: ../src/guestfs-actions.pod:5626
16676 " guestfs_set_append (guestfs_h *g,\n"
16677 " const char *append);\n"
16683 #: ../src/guestfs-actions.pod:5630 ../fish/guestfish-actions.pod:3762
16685 "This function is used to add additional options to the guest kernel command "
16691 #: ../src/guestfs-actions.pod:5633 ../fish/guestfish-actions.pod:3765
16693 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
16694 "environment variable."
16699 #: ../src/guestfs-actions.pod:5636 ../fish/guestfish-actions.pod:3768
16701 "Setting C<append> to C<NULL> means I<no> additional options are passed "
16702 "(libguestfs always adds a few of its own)."
16707 #: ../src/guestfs-actions.pod:5643
16708 msgid "guestfs_set_autosync"
16713 #: ../src/guestfs-actions.pod:5645
16717 " guestfs_set_autosync (guestfs_h *g,\n"
16718 " int autosync);\n"
16724 #: ../src/guestfs-actions.pod:5649
16726 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
16727 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
16728 "the handle is closed (also if the program exits without closing handles)."
16733 #: ../src/guestfs-actions.pod:5654 ../fish/guestfish-actions.pod:3782
16735 "This is enabled by default (since libguestfs 1.5.24, previously it was "
16736 "disabled by default)."
16741 #: ../src/guestfs-actions.pod:5661
16742 msgid "guestfs_set_direct"
16747 #: ../src/guestfs-actions.pod:5663
16751 " guestfs_set_direct (guestfs_h *g,\n"
16758 #: ../src/guestfs-actions.pod:5667 ../fish/guestfish-actions.pod:3791
16760 "If the direct appliance mode flag is enabled, then stdin and stdout are "
16761 "passed directly through to the appliance once it is launched."
16766 #: ../src/guestfs-actions.pod:5671
16768 "One consequence of this is that log messages aren't caught by the library "
16769 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
16775 #: ../src/guestfs-actions.pod:5675 ../fish/guestfish-actions.pod:3799
16776 msgid "You probably don't want to use this unless you know what you are doing."
16781 #: ../src/guestfs-actions.pod:5678 ../fish/guestfish-actions.pod:3802
16782 msgid "The default is disabled."
16787 #: ../src/guestfs-actions.pod:5684
16788 msgid "guestfs_set_e2label"
16793 #: ../src/guestfs-actions.pod:5686
16797 " guestfs_set_e2label (guestfs_h *g,\n"
16798 " const char *device,\n"
16799 " const char *label);\n"
16805 #: ../src/guestfs-actions.pod:5691 ../fish/guestfish-actions.pod:3808
16807 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
16808 "C<label>. Filesystem labels are limited to 16 characters."
16813 #: ../src/guestfs-actions.pod:5695
16815 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
16816 "the existing label on a filesystem."
16821 #: ../src/guestfs-actions.pod:5702
16822 msgid "guestfs_set_e2uuid"
16827 #: ../src/guestfs-actions.pod:5704
16831 " guestfs_set_e2uuid (guestfs_h *g,\n"
16832 " const char *device,\n"
16833 " const char *uuid);\n"
16839 #: ../src/guestfs-actions.pod:5709 ../fish/guestfish-actions.pod:3819
16841 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
16842 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
16843 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
16848 #: ../src/guestfs-actions.pod:5714
16850 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
16851 "the existing UUID of a filesystem."
16856 #: ../src/guestfs-actions.pod:5721
16857 msgid "guestfs_set_memsize"
16862 #: ../src/guestfs-actions.pod:5723
16866 " guestfs_set_memsize (guestfs_h *g,\n"
16873 #: ../src/guestfs-actions.pod:5727
16875 "This sets the memory size in megabytes allocated to the qemu subprocess. "
16876 "This only has any effect if called before C<guestfs_launch>."
16881 #: ../src/guestfs-actions.pod:5731 ../fish/guestfish-actions.pod:3837
16883 "You can also change this by setting the environment variable "
16884 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
16889 #: ../src/guestfs-actions.pod:5742
16890 msgid "guestfs_set_network"
16895 #: ../src/guestfs-actions.pod:5744
16899 " guestfs_set_network (guestfs_h *g,\n"
16906 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:3850
16908 "If C<network> is true, then the network is enabled in the libguestfs "
16909 "appliance. The default is false."
16914 #: ../src/guestfs-actions.pod:5751 ../fish/guestfish-actions.pod:3853
16916 "This affects whether commands are able to access the network (see L<guestfs"
16917 "(3)/RUNNING COMMANDS>)."
16922 #: ../src/guestfs-actions.pod:5754
16924 "You must call this before calling C<guestfs_launch>, otherwise it has no "
16930 #: ../src/guestfs-actions.pod:5761
16931 msgid "guestfs_set_path"
16936 #: ../src/guestfs-actions.pod:5763
16940 " guestfs_set_path (guestfs_h *g,\n"
16941 " const char *searchpath);\n"
16947 #: ../src/guestfs-actions.pod:5767 ../fish/guestfish-actions.pod:3865
16948 msgid "Set the path that libguestfs searches for kernel and initrd.img."
16953 #: ../src/guestfs-actions.pod:5769 ../fish/guestfish-actions.pod:3867
16955 "The default is C<$libdir/guestfs> unless overridden by setting "
16956 "C<LIBGUESTFS_PATH> environment variable."
16961 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:3870
16962 msgid "Setting C<path> to C<NULL> restores the default path."
16967 #: ../src/guestfs-actions.pod:5778
16968 msgid "guestfs_set_qemu"
16973 #: ../src/guestfs-actions.pod:5780
16977 " guestfs_set_qemu (guestfs_h *g,\n"
16978 " const char *qemu);\n"
16984 #: ../src/guestfs-actions.pod:5784 ../fish/guestfish-actions.pod:3878
16985 msgid "Set the qemu binary that we will use."
16990 #: ../src/guestfs-actions.pod:5786 ../fish/guestfish-actions.pod:3880
16992 "The default is chosen when the library was compiled by the configure script."
16997 #: ../src/guestfs-actions.pod:5789 ../fish/guestfish-actions.pod:3883
16999 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
17005 #: ../src/guestfs-actions.pod:5792 ../fish/guestfish-actions.pod:3886
17006 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
17011 #: ../src/guestfs-actions.pod:5794 ../fish/guestfish-actions.pod:3888
17013 "Note that you should call this function as early as possible after creating "
17014 "the handle. This is because some pre-launch operations depend on testing "
17015 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
17016 "don't retest features, and so you might see inconsistent results. Using the "
17017 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
17018 "the qemu binary at the same time as the handle is created."
17023 #: ../src/guestfs-actions.pod:5806
17024 msgid "guestfs_set_recovery_proc"
17029 #: ../src/guestfs-actions.pod:5808
17033 " guestfs_set_recovery_proc (guestfs_h *g,\n"
17034 " int recoveryproc);\n"
17040 #: ../src/guestfs-actions.pod:5812
17042 "If this is called with the parameter C<false> then C<guestfs_launch> does "
17043 "not create a recovery process. The purpose of the recovery process is to "
17044 "stop runaway qemu processes in the case where the main program aborts "
17050 #: ../src/guestfs-actions.pod:5817
17052 "This only has any effect if called before C<guestfs_launch>, and the default "
17058 #: ../src/guestfs-actions.pod:5820 ../fish/guestfish-actions.pod:3910
17060 "About the only time when you would want to disable this is if the main "
17061 "process will fork itself into the background (\"daemonize\" itself). In "
17062 "this case the recovery process thinks that the main program has disappeared "
17063 "and so kills qemu, which is not very helpful."
17068 #: ../src/guestfs-actions.pod:5830
17069 msgid "guestfs_set_selinux"
17074 #: ../src/guestfs-actions.pod:5832
17078 " guestfs_set_selinux (guestfs_h *g,\n"
17085 #: ../src/guestfs-actions.pod:5836 ../fish/guestfish-actions.pod:3922
17087 "This sets the selinux flag that is passed to the appliance at boot time. "
17088 "The default is C<selinux=0> (disabled)."
17093 #: ../src/guestfs-actions.pod:5839 ../fish/guestfish-actions.pod:3925
17095 "Note that if SELinux is enabled, it is always in Permissive mode "
17096 "(C<enforcing=0>)."
17101 #: ../src/guestfs-actions.pod:5849
17102 msgid "guestfs_set_trace"
17107 #: ../src/guestfs-actions.pod:5851
17111 " guestfs_set_trace (guestfs_h *g,\n"
17118 #: ../src/guestfs-actions.pod:5855 ../fish/guestfish-actions.pod:3937
17120 "If the command trace flag is set to 1, then commands are printed on stderr "
17121 "before they are executed in a format which is very similar to the one used "
17122 "by guestfish. In other words, you can run a program with this enabled, and "
17123 "you will get out a script which you can feed to guestfish to perform the "
17124 "same set of actions."
17129 #: ../src/guestfs-actions.pod:5862 ../fish/guestfish-actions.pod:3944
17131 "If you want to trace C API calls into libguestfs (and other libraries) then "
17132 "possibly a better way is to use the external ltrace(1) command."
17137 #: ../src/guestfs-actions.pod:5866 ../fish/guestfish-actions.pod:3948
17139 "Command traces are disabled unless the environment variable "
17140 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
17145 #: ../src/guestfs-actions.pod:5873
17146 msgid "guestfs_set_verbose"
17151 #: ../src/guestfs-actions.pod:5875
17155 " guestfs_set_verbose (guestfs_h *g,\n"
17162 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3957
17163 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
17168 #: ../src/guestfs-actions.pod:5881 ../fish/guestfish-actions.pod:3959
17170 "Verbose messages are disabled unless the environment variable "
17171 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
17176 #: ../src/guestfs-actions.pod:5888
17177 msgid "guestfs_setcon"
17182 #: ../src/guestfs-actions.pod:5890
17186 " guestfs_setcon (guestfs_h *g,\n"
17187 " const char *context);\n"
17193 #: ../src/guestfs-actions.pod:5894 ../fish/guestfish-actions.pod:3966
17195 "This sets the SELinux security context of the daemon to the string "
17201 #: ../src/guestfs-actions.pod:5897 ../fish/guestfish-actions.pod:3969
17202 msgid "See the documentation about SELINUX in L<guestfs(3)>."
17207 #: ../src/guestfs-actions.pod:5903
17208 msgid "guestfs_setxattr"
17213 #: ../src/guestfs-actions.pod:5905
17217 " guestfs_setxattr (guestfs_h *g,\n"
17218 " const char *xattr,\n"
17219 " const char *val,\n"
17221 " const char *path);\n"
17227 #: ../src/guestfs-actions.pod:5912 ../fish/guestfish-actions.pod:3975
17229 "This call sets the extended attribute named C<xattr> of the file C<path> to "
17230 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
17235 #: ../src/guestfs-actions.pod:5916
17236 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
17241 #: ../src/guestfs-actions.pod:5922
17242 msgid "guestfs_sfdisk"
17247 #: ../src/guestfs-actions.pod:5924
17251 " guestfs_sfdisk (guestfs_h *g,\n"
17252 " const char *device,\n"
17256 " char *const *lines);\n"
17262 #: ../src/guestfs-actions.pod:5932 ../fish/guestfish-actions.pod:3985
17264 "This is a direct interface to the L<sfdisk(8)> program for creating "
17265 "partitions on block devices."
17270 #: ../src/guestfs-actions.pod:5935 ../fish/guestfish-actions.pod:3988
17271 msgid "C<device> should be a block device, for example C</dev/sda>."
17276 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:3990
17278 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
17279 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
17280 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
17281 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
17282 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
17283 "the kernel) cannot work out the right geometry and you will need to tell it."
17288 #: ../src/guestfs-actions.pod:5945 ../fish/guestfish-actions.pod:3998
17290 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
17291 "refer to the L<sfdisk(8)> manpage."
17296 #: ../src/guestfs-actions.pod:5948 ../fish/guestfish-actions.pod:4001
17298 "To create a single partition occupying the whole disk, you would pass "
17299 "C<lines> as a single element list, when the single element being the string "
17305 #: ../src/guestfs-actions.pod:5952
17307 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
17312 #: ../src/guestfs-actions.pod:5962
17313 msgid "guestfs_sfdiskM"
17318 #: ../src/guestfs-actions.pod:5964
17322 " guestfs_sfdiskM (guestfs_h *g,\n"
17323 " const char *device,\n"
17324 " char *const *lines);\n"
17330 #: ../src/guestfs-actions.pod:5969
17332 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
17333 "partition sizes are specified in megabytes only (rounded to the nearest "
17334 "cylinder) and you don't need to specify the cyls, heads and sectors "
17335 "parameters which were rarely if ever used anyway."
17340 #: ../src/guestfs-actions.pod:5975
17342 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
17343 "C<guestfs_part_disk>"
17348 #: ../src/guestfs-actions.pod:5985
17349 msgid "guestfs_sfdisk_N"
17354 #: ../src/guestfs-actions.pod:5987
17358 " guestfs_sfdisk_N (guestfs_h *g,\n"
17359 " const char *device,\n"
17364 " const char *line);\n"
17370 #: ../src/guestfs-actions.pod:5996 ../fish/guestfish-actions.pod:4031
17372 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
17373 "(note: C<n> counts from 1)."
17378 #: ../src/guestfs-actions.pod:5999
17380 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
17381 "for the cyls/heads/sectors parameters."
17386 #: ../src/guestfs-actions.pod:6002
17387 msgid "See also: C<guestfs_part_add>"
17392 #: ../src/guestfs-actions.pod:6011
17393 msgid "guestfs_sfdisk_disk_geometry"
17398 #: ../src/guestfs-actions.pod:6013
17402 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
17403 " const char *device);\n"
17409 #: ../src/guestfs-actions.pod:6017
17411 "This displays the disk geometry of C<device> read from the partition table. "
17412 "Especially in the case where the underlying block device has been resized, "
17413 "this can be different from the kernel's idea of the geometry (see "
17414 "C<guestfs_sfdisk_kernel_geometry>)."
17419 #: ../src/guestfs-actions.pod:6022 ../src/guestfs-actions.pod:6038
17420 #: ../fish/guestfish-actions.pod:4051 ../fish/guestfish-actions.pod:4060
17421 msgid "The result is in human-readable format, and not designed to be parsed."
17426 #: ../src/guestfs-actions.pod:6030
17427 msgid "guestfs_sfdisk_kernel_geometry"
17432 #: ../src/guestfs-actions.pod:6032
17436 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
17437 " const char *device);\n"
17443 #: ../src/guestfs-actions.pod:6036 ../fish/guestfish-actions.pod:4058
17444 msgid "This displays the kernel's idea of the geometry of C<device>."
17449 #: ../src/guestfs-actions.pod:6046
17450 msgid "guestfs_sfdisk_l"
17455 #: ../src/guestfs-actions.pod:6048
17459 " guestfs_sfdisk_l (guestfs_h *g,\n"
17460 " const char *device);\n"
17466 #: ../src/guestfs-actions.pod:6052 ../fish/guestfish-actions.pod:4067
17468 "This displays the partition table on C<device>, in the human-readable output "
17469 "of the L<sfdisk(8)> command. It is not intended to be parsed."
17474 #: ../src/guestfs-actions.pod:6056
17475 msgid "See also: C<guestfs_part_list>"
17480 #: ../src/guestfs-actions.pod:6063
17486 #: ../src/guestfs-actions.pod:6065
17490 " guestfs_sh (guestfs_h *g,\n"
17491 " const char *command);\n"
17497 #: ../src/guestfs-actions.pod:6069 ../fish/guestfish-actions.pod:4077
17499 "This call runs a command from the guest filesystem via the guest's C</bin/"
17505 #: ../src/guestfs-actions.pod:6072
17506 msgid "This is like C<guestfs_command>, but passes the command to:"
17511 #: ../src/guestfs-actions.pod:6074 ../fish/guestfish-actions.pod:4082
17514 " /bin/sh -c \"command\"\n"
17520 #: ../src/guestfs-actions.pod:6076 ../fish/guestfish-actions.pod:4084
17522 "Depending on the guest's shell, this usually results in wildcards being "
17523 "expanded, shell expressions being interpolated and so on."
17528 #: ../src/guestfs-actions.pod:6080
17529 msgid "All the provisos about C<guestfs_command> apply to this call."
17534 #: ../src/guestfs-actions.pod:6087
17535 msgid "guestfs_sh_lines"
17540 #: ../src/guestfs-actions.pod:6089
17544 " guestfs_sh_lines (guestfs_h *g,\n"
17545 " const char *command);\n"
17551 #: ../src/guestfs-actions.pod:6093
17553 "This is the same as C<guestfs_sh>, but splits the result into a list of "
17559 #: ../src/guestfs-actions.pod:6096
17560 msgid "See also: C<guestfs_command_lines>"
17565 #: ../src/guestfs-actions.pod:6104
17566 msgid "guestfs_sleep"
17571 #: ../src/guestfs-actions.pod:6106
17575 " guestfs_sleep (guestfs_h *g,\n"
17582 #: ../src/guestfs-actions.pod:6110 ../fish/guestfish-actions.pod:4103
17583 msgid "Sleep for C<secs> seconds."
17588 #: ../src/guestfs-actions.pod:6114
17589 msgid "(Added in 1.0.41)"
17594 #: ../src/guestfs-actions.pod:6116 ../src/guestfs-structs.pod:109
17595 msgid "guestfs_stat"
17600 #: ../src/guestfs-actions.pod:6118
17603 " struct guestfs_stat *\n"
17604 " guestfs_stat (guestfs_h *g,\n"
17605 " const char *path);\n"
17611 #: ../src/guestfs-actions.pod:6124 ../fish/guestfish-actions.pod:4111
17612 msgid "This is the same as the C<stat(2)> system call."
17617 #: ../src/guestfs-actions.pod:6132 ../src/guestfs-structs.pod:135
17618 msgid "guestfs_statvfs"
17623 #: ../src/guestfs-actions.pod:6134
17626 " struct guestfs_statvfs *\n"
17627 " guestfs_statvfs (guestfs_h *g,\n"
17628 " const char *path);\n"
17634 #: ../src/guestfs-actions.pod:6138 ../fish/guestfish-actions.pod:4117
17636 "Returns file system statistics for any mounted file system. C<path> should "
17637 "be a file or directory in the mounted file system (typically it is the mount "
17638 "point itself, but it doesn't need to be)."
17643 #: ../src/guestfs-actions.pod:6142 ../fish/guestfish-actions.pod:4121
17644 msgid "This is the same as the C<statvfs(2)> system call."
17649 #: ../src/guestfs-actions.pod:6144
17651 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
17652 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
17657 #: ../src/guestfs-actions.pod:6150
17658 msgid "guestfs_strings"
17663 #: ../src/guestfs-actions.pod:6152
17667 " guestfs_strings (guestfs_h *g,\n"
17668 " const char *path);\n"
17674 #: ../src/guestfs-actions.pod:6156 ../fish/guestfish-actions.pod:4127
17676 "This runs the L<strings(1)> command on a file and returns the list of "
17677 "printable strings found."
17682 #: ../src/guestfs-actions.pod:6168
17683 msgid "guestfs_strings_e"
17688 #: ../src/guestfs-actions.pod:6170
17692 " guestfs_strings_e (guestfs_h *g,\n"
17693 " const char *encoding,\n"
17694 " const char *path);\n"
17700 #: ../src/guestfs-actions.pod:6175
17702 "This is like the C<guestfs_strings> command, but allows you to specify the "
17703 "encoding of strings that are looked for in the source file C<path>."
17708 #: ../src/guestfs-actions.pod:6179 ../fish/guestfish-actions.pod:4141
17709 msgid "Allowed encodings are:"
17714 #: ../src/guestfs-actions.pod:6183 ../fish/guestfish-actions.pod:4145
17720 #: ../src/guestfs-actions.pod:6185
17722 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
17723 "ISO-8859-X (this is what C<guestfs_strings> uses)."
17728 #: ../src/guestfs-actions.pod:6188 ../fish/guestfish-actions.pod:4150
17734 #: ../src/guestfs-actions.pod:6190 ../fish/guestfish-actions.pod:4152
17735 msgid "Single 8-bit-byte characters."
17740 #: ../src/guestfs-actions.pod:6192 ../fish/guestfish-actions.pod:4154
17746 #: ../src/guestfs-actions.pod:6194 ../fish/guestfish-actions.pod:4156
17747 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
17752 #: ../src/guestfs-actions.pod:6197 ../fish/guestfish-actions.pod:4159
17753 msgid "l (lower case letter L)"
17758 #: ../src/guestfs-actions.pod:6199 ../fish/guestfish-actions.pod:4161
17760 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
17761 "examining binaries in Windows guests."
17766 #: ../src/guestfs-actions.pod:6202 ../fish/guestfish-actions.pod:4164
17772 #: ../src/guestfs-actions.pod:6204 ../fish/guestfish-actions.pod:4166
17773 msgid "32-bit big endian such as UCS-4BE."
17778 #: ../src/guestfs-actions.pod:6206 ../fish/guestfish-actions.pod:4168
17784 #: ../src/guestfs-actions.pod:6208 ../fish/guestfish-actions.pod:4170
17785 msgid "32-bit little endian such as UCS-4LE."
17790 #: ../src/guestfs-actions.pod:6212 ../fish/guestfish-actions.pod:4174
17791 msgid "The returned strings are transcoded to UTF-8."
17796 #: ../src/guestfs-actions.pod:6223
17797 msgid "guestfs_swapoff_device"
17802 #: ../src/guestfs-actions.pod:6225
17806 " guestfs_swapoff_device (guestfs_h *g,\n"
17807 " const char *device);\n"
17813 #: ../src/guestfs-actions.pod:6229
17815 "This command disables the libguestfs appliance swap device or partition "
17816 "named C<device>. See C<guestfs_swapon_device>."
17821 #: ../src/guestfs-actions.pod:6237
17822 msgid "guestfs_swapoff_file"
17827 #: ../src/guestfs-actions.pod:6239
17831 " guestfs_swapoff_file (guestfs_h *g,\n"
17832 " const char *file);\n"
17838 #: ../src/guestfs-actions.pod:6243 ../fish/guestfish-actions.pod:4191
17839 msgid "This command disables the libguestfs appliance swap on file."
17844 #: ../src/guestfs-actions.pod:6249
17845 msgid "guestfs_swapoff_label"
17850 #: ../src/guestfs-actions.pod:6251
17854 " guestfs_swapoff_label (guestfs_h *g,\n"
17855 " const char *label);\n"
17861 #: ../src/guestfs-actions.pod:6255 ../fish/guestfish-actions.pod:4197
17863 "This command disables the libguestfs appliance swap on labeled swap "
17869 #: ../src/guestfs-actions.pod:6262
17870 msgid "guestfs_swapoff_uuid"
17875 #: ../src/guestfs-actions.pod:6264
17879 " guestfs_swapoff_uuid (guestfs_h *g,\n"
17880 " const char *uuid);\n"
17886 #: ../src/guestfs-actions.pod:6268 ../fish/guestfish-actions.pod:4204
17888 "This command disables the libguestfs appliance swap partition with the given "
17894 #: ../src/guestfs-actions.pod:6275
17895 msgid "guestfs_swapon_device"
17900 #: ../src/guestfs-actions.pod:6277
17904 " guestfs_swapon_device (guestfs_h *g,\n"
17905 " const char *device);\n"
17911 #: ../src/guestfs-actions.pod:6281
17913 "This command enables the libguestfs appliance to use the swap device or "
17914 "partition named C<device>. The increased memory is made available for all "
17915 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
17920 #: ../src/guestfs-actions.pod:6286 ../fish/guestfish-actions.pod:4216
17922 "Note that you should not swap to existing guest swap partitions unless you "
17923 "know what you are doing. They may contain hibernation information, or other "
17924 "information that the guest doesn't want you to trash. You also risk leaking "
17925 "information about the host to the guest this way. Instead, attach a new "
17926 "host device to the guest and swap on that."
17931 #: ../src/guestfs-actions.pod:6297
17932 msgid "guestfs_swapon_file"
17937 #: ../src/guestfs-actions.pod:6299
17941 " guestfs_swapon_file (guestfs_h *g,\n"
17942 " const char *file);\n"
17948 #: ../src/guestfs-actions.pod:6303
17950 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
17956 #: ../src/guestfs-actions.pod:6310
17957 msgid "guestfs_swapon_label"
17962 #: ../src/guestfs-actions.pod:6312
17966 " guestfs_swapon_label (guestfs_h *g,\n"
17967 " const char *label);\n"
17973 #: ../src/guestfs-actions.pod:6316
17975 "This command enables swap to a labeled swap partition. See "
17976 "C<guestfs_swapon_device> for other notes."
17981 #: ../src/guestfs-actions.pod:6323
17982 msgid "guestfs_swapon_uuid"
17987 #: ../src/guestfs-actions.pod:6325
17991 " guestfs_swapon_uuid (guestfs_h *g,\n"
17992 " const char *uuid);\n"
17998 #: ../src/guestfs-actions.pod:6329
18000 "This command enables swap to a swap partition with the given UUID. See "
18001 "C<guestfs_swapon_device> for other notes."
18006 #: ../src/guestfs-actions.pod:6336
18007 msgid "guestfs_sync"
18012 #: ../src/guestfs-actions.pod:6338
18016 " guestfs_sync (guestfs_h *g);\n"
18022 #: ../src/guestfs-actions.pod:6341 ../fish/guestfish-actions.pod:4248
18024 "This syncs the disk, so that any writes are flushed through to the "
18025 "underlying disk image."
18030 #: ../src/guestfs-actions.pod:6344 ../fish/guestfish-actions.pod:4251
18032 "You should always call this if you have modified a disk image, before "
18033 "closing the handle."
18038 #: ../src/guestfs-actions.pod:6351
18039 msgid "guestfs_tail"
18044 #: ../src/guestfs-actions.pod:6353
18048 " guestfs_tail (guestfs_h *g,\n"
18049 " const char *path);\n"
18055 #: ../src/guestfs-actions.pod:6357 ../fish/guestfish-actions.pod:4258
18057 "This command returns up to the last 10 lines of a file as a list of strings."
18062 #: ../src/guestfs-actions.pod:6369
18063 msgid "guestfs_tail_n"
18068 #: ../src/guestfs-actions.pod:6371
18072 " guestfs_tail_n (guestfs_h *g,\n"
18074 " const char *path);\n"
18080 #: ../src/guestfs-actions.pod:6376 ../fish/guestfish-actions.pod:4268
18082 "If the parameter C<nrlines> is a positive number, this returns the last "
18083 "C<nrlines> lines of the file C<path>."
18088 #: ../src/guestfs-actions.pod:6379 ../fish/guestfish-actions.pod:4271
18090 "If the parameter C<nrlines> is a negative number, this returns lines from "
18091 "the file C<path>, starting with the C<-nrlines>th line."
18096 #: ../src/guestfs-actions.pod:6393
18097 msgid "guestfs_tar_in"
18102 #: ../src/guestfs-actions.pod:6395
18106 " guestfs_tar_in (guestfs_h *g,\n"
18107 " const char *tarfile,\n"
18108 " const char *directory);\n"
18114 #: ../src/guestfs-actions.pod:6400 ../fish/guestfish-actions.pod:4283
18116 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
18117 "tar file) into C<directory>."
18122 #: ../src/guestfs-actions.pod:6403
18124 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
18129 #: ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6425
18130 #: ../src/guestfs-actions.pod:6441 ../src/guestfs-actions.pod:6457
18131 msgid "(Added in 1.0.3)"
18136 #: ../src/guestfs-actions.pod:6410
18137 msgid "guestfs_tar_out"
18142 #: ../src/guestfs-actions.pod:6412
18146 " guestfs_tar_out (guestfs_h *g,\n"
18147 " const char *directory,\n"
18148 " const char *tarfile);\n"
18154 #: ../src/guestfs-actions.pod:6417 ../fish/guestfish-actions.pod:4295
18156 "This command packs the contents of C<directory> and downloads it to local "
18162 #: ../src/guestfs-actions.pod:6420
18164 "To download a compressed tarball, use C<guestfs_tgz_out> or "
18165 "C<guestfs_txz_out>."
18170 #: ../src/guestfs-actions.pod:6427
18171 msgid "guestfs_tgz_in"
18176 #: ../src/guestfs-actions.pod:6429
18180 " guestfs_tgz_in (guestfs_h *g,\n"
18181 " const char *tarball,\n"
18182 " const char *directory);\n"
18188 #: ../src/guestfs-actions.pod:6434 ../fish/guestfish-actions.pod:4307
18190 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
18191 "tar file) into C<directory>."
18196 #: ../src/guestfs-actions.pod:6437
18197 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
18202 #: ../src/guestfs-actions.pod:6443
18203 msgid "guestfs_tgz_out"
18208 #: ../src/guestfs-actions.pod:6445
18212 " guestfs_tgz_out (guestfs_h *g,\n"
18213 " const char *directory,\n"
18214 " const char *tarball);\n"
18220 #: ../src/guestfs-actions.pod:6450 ../fish/guestfish-actions.pod:4318
18222 "This command packs the contents of C<directory> and downloads it to local "
18228 #: ../src/guestfs-actions.pod:6453
18229 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
18234 #: ../src/guestfs-actions.pod:6459
18235 msgid "guestfs_touch"
18240 #: ../src/guestfs-actions.pod:6461
18244 " guestfs_touch (guestfs_h *g,\n"
18245 " const char *path);\n"
18251 #: ../src/guestfs-actions.pod:6465 ../fish/guestfish-actions.pod:4329
18253 "Touch acts like the L<touch(1)> command. It can be used to update the "
18254 "timestamps on a file, or, if the file does not exist, to create a new zero-"
18260 #: ../src/guestfs-actions.pod:6469 ../fish/guestfish-actions.pod:4333
18262 "This command only works on regular files, and will fail on other file types "
18263 "such as directories, symbolic links, block special etc."
18268 #: ../src/guestfs-actions.pod:6476
18269 msgid "guestfs_truncate"
18274 #: ../src/guestfs-actions.pod:6478
18278 " guestfs_truncate (guestfs_h *g,\n"
18279 " const char *path);\n"
18285 #: ../src/guestfs-actions.pod:6482 ../fish/guestfish-actions.pod:4340
18287 "This command truncates C<path> to a zero-length file. The file must exist "
18293 #: ../src/guestfs-actions.pod:6489
18294 msgid "guestfs_truncate_size"
18299 #: ../src/guestfs-actions.pod:6491
18303 " guestfs_truncate_size (guestfs_h *g,\n"
18304 " const char *path,\n"
18305 " int64_t size);\n"
18311 #: ../src/guestfs-actions.pod:6496 ../fish/guestfish-actions.pod:4347
18313 "This command truncates C<path> to size C<size> bytes. The file must exist "
18319 #: ../src/guestfs-actions.pod:6499
18321 "If the current file size is less than C<size> then the file is extended to "
18322 "the required size with zero bytes. This creates a sparse file (ie. disk "
18323 "blocks are not allocated for the file until you write to it). To create a "
18324 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
18329 #: ../src/guestfs-actions.pod:6509
18330 msgid "guestfs_tune2fs_l"
18335 #: ../src/guestfs-actions.pod:6511
18339 " guestfs_tune2fs_l (guestfs_h *g,\n"
18340 " const char *device);\n"
18346 #: ../src/guestfs-actions.pod:6515 ../fish/guestfish-actions.pod:4360
18348 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
18354 #: ../src/guestfs-actions.pod:6518 ../fish/guestfish-actions.pod:4363
18356 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
18357 "for more details. The list of fields returned isn't clearly defined, and "
18358 "depends on both the version of C<tune2fs> that libguestfs was built against, "
18359 "and the filesystem itself."
18364 #: ../src/guestfs-actions.pod:6531
18365 msgid "guestfs_txz_in"
18370 #: ../src/guestfs-actions.pod:6533
18374 " guestfs_txz_in (guestfs_h *g,\n"
18375 " const char *tarball,\n"
18376 " const char *directory);\n"
18382 #: ../src/guestfs-actions.pod:6538 ../fish/guestfish-actions.pod:4372
18384 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
18385 "tar file) into C<directory>."
18390 #: ../src/guestfs-actions.pod:6545
18391 msgid "guestfs_txz_out"
18396 #: ../src/guestfs-actions.pod:6547
18400 " guestfs_txz_out (guestfs_h *g,\n"
18401 " const char *directory,\n"
18402 " const char *tarball);\n"
18408 #: ../src/guestfs-actions.pod:6552 ../fish/guestfish-actions.pod:4381
18410 "This command packs the contents of C<directory> and downloads it to local "
18411 "file C<tarball> (as an xz compressed tar archive)."
18416 #: ../src/guestfs-actions.pod:6559
18417 msgid "guestfs_umask"
18422 #: ../src/guestfs-actions.pod:6561
18426 " guestfs_umask (guestfs_h *g,\n"
18433 #: ../src/guestfs-actions.pod:6565 ../fish/guestfish-actions.pod:4390
18435 "This function sets the mask used for creating new files and device nodes to "
18441 #: ../src/guestfs-actions.pod:6568 ../fish/guestfish-actions.pod:4393
18443 "Typical umask values would be C<022> which creates new files with "
18444 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
18445 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
18450 #: ../src/guestfs-actions.pod:6573 ../fish/guestfish-actions.pod:4398
18452 "The default umask is C<022>. This is important because it means that "
18453 "directories and device nodes will be created with C<0644> or C<0755> mode "
18454 "even if you specify C<0777>."
18459 #: ../src/guestfs-actions.pod:6577
18461 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
18462 "C<guestfs_mkdir>."
18467 #: ../src/guestfs-actions.pod:6580 ../fish/guestfish-actions.pod:4405
18468 msgid "This call returns the previous umask."
18473 #: ../src/guestfs-actions.pod:6586
18474 msgid "guestfs_umount"
18479 #: ../src/guestfs-actions.pod:6588
18483 " guestfs_umount (guestfs_h *g,\n"
18484 " const char *pathordevice);\n"
18490 #: ../src/guestfs-actions.pod:6592 ../fish/guestfish-actions.pod:4413
18492 "This unmounts the given filesystem. The filesystem may be specified either "
18493 "by its mountpoint (path) or the device which contains the filesystem."
18498 #: ../src/guestfs-actions.pod:6600
18499 msgid "guestfs_umount_all"
18504 #: ../src/guestfs-actions.pod:6602
18508 " guestfs_umount_all (guestfs_h *g);\n"
18514 #: ../src/guestfs-actions.pod:6605 ../fish/guestfish-actions.pod:4423
18515 msgid "This unmounts all mounted filesystems."
18520 #: ../src/guestfs-actions.pod:6607 ../fish/guestfish-actions.pod:4425
18521 msgid "Some internal mounts are not unmounted by this call."
18526 #: ../src/guestfs-actions.pod:6613
18527 msgid "guestfs_upload"
18532 #: ../src/guestfs-actions.pod:6615
18536 " guestfs_upload (guestfs_h *g,\n"
18537 " const char *filename,\n"
18538 " const char *remotefilename);\n"
18544 #: ../src/guestfs-actions.pod:6620 ../src/guestfs-actions.pod:6644
18545 #: ../fish/guestfish-actions.pod:4431 ../fish/guestfish-actions.pod:4444
18546 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
18551 #: ../src/guestfs-actions.pod:6625
18552 msgid "See also C<guestfs_download>."
18557 #: ../src/guestfs-actions.pod:6636
18558 msgid "guestfs_upload_offset"
18563 #: ../src/guestfs-actions.pod:6638
18567 " guestfs_upload_offset (guestfs_h *g,\n"
18568 " const char *filename,\n"
18569 " const char *remotefilename,\n"
18570 " int64_t offset);\n"
18576 #: ../src/guestfs-actions.pod:6647 ../fish/guestfish-actions.pod:4447
18578 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
18579 "The intention is to overwrite parts of existing files or devices, although "
18580 "if a non-existant file is specified then it is created with a \"hole\" "
18581 "before C<offset>. The size of the data written is implicit in the size of "
18582 "the source C<filename>."
18587 #: ../src/guestfs-actions.pod:6654
18589 "Note that there is no limit on the amount of data that can be uploaded with "
18590 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
18591 "full amount unless an error occurs."
18596 #: ../src/guestfs-actions.pod:6659
18597 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
18602 #: ../src/guestfs-actions.pod:6670
18603 msgid "guestfs_utimens"
18608 #: ../src/guestfs-actions.pod:6672
18612 " guestfs_utimens (guestfs_h *g,\n"
18613 " const char *path,\n"
18614 " int64_t atsecs,\n"
18615 " int64_t atnsecs,\n"
18616 " int64_t mtsecs,\n"
18617 " int64_t mtnsecs);\n"
18623 #: ../src/guestfs-actions.pod:6680 ../fish/guestfish-actions.pod:4467
18624 msgid "This command sets the timestamps of a file with nanosecond precision."
18629 #: ../src/guestfs-actions.pod:6683 ../fish/guestfish-actions.pod:4470
18631 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
18637 #: ../src/guestfs-actions.pod:6686 ../fish/guestfish-actions.pod:4473
18639 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
18640 "nanoseconds from the epoch."
18645 #: ../src/guestfs-actions.pod:6689 ../fish/guestfish-actions.pod:4476
18647 "If the C<*nsecs> field contains the special value C<-1> then the "
18648 "corresponding timestamp is set to the current time. (The C<*secs> field is "
18649 "ignored in this case)."
18654 #: ../src/guestfs-actions.pod:6693 ../fish/guestfish-actions.pod:4480
18656 "If the C<*nsecs> field contains the special value C<-2> then the "
18657 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
18663 #: ../src/guestfs-actions.pod:6701 ../src/guestfs-structs.pod:175
18664 msgid "guestfs_version"
18669 #: ../src/guestfs-actions.pod:6703
18672 " struct guestfs_version *\n"
18673 " guestfs_version (guestfs_h *g);\n"
18679 #: ../src/guestfs-actions.pod:6706 ../fish/guestfish-actions.pod:4488
18681 "Return the libguestfs version number that the program is linked against."
18686 #: ../src/guestfs-actions.pod:6709 ../fish/guestfish-actions.pod:4491
18688 "Note that because of dynamic linking this is not necessarily the version of "
18689 "libguestfs that you compiled against. You can compile the program, and then "
18690 "at runtime dynamically link against a completely different C<libguestfs.so> "
18696 #: ../src/guestfs-actions.pod:6714 ../fish/guestfish-actions.pod:4496
18698 "This call was added in version C<1.0.58>. In previous versions of "
18699 "libguestfs there was no way to get the version number. From C code you can "
18700 "use dynamic linker functions to find out if this symbol exists (if it "
18701 "doesn't, then it's an earlier version)."
18706 #: ../src/guestfs-actions.pod:6720 ../fish/guestfish-actions.pod:4502
18708 "The call returns a structure with four elements. The first three (C<major>, "
18709 "C<minor> and C<release>) are numbers and correspond to the usual version "
18710 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
18711 "but may be used for distro-specific information."
18716 #: ../src/guestfs-actions.pod:6726 ../fish/guestfish-actions.pod:4508
18718 "To construct the original version string: C<$major.$minor.$release$extra>"
18723 #: ../src/guestfs-actions.pod:6729 ../fish/guestfish-actions.pod:4511
18724 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
18729 #: ../src/guestfs-actions.pod:6731
18731 "I<Note:> Don't use this call to test for availability of features. In "
18732 "enterprise distributions we backport features from later versions into "
18733 "earlier versions, making this an unreliable way to test for features. Use "
18734 "C<guestfs_available> instead."
18739 #: ../src/guestfs-actions.pod:6737
18741 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
18742 "error. I<The caller must call C<guestfs_free_version> after use>."
18747 #: ../src/guestfs-actions.pod:6741
18748 msgid "(Added in 1.0.58)"
18753 #: ../src/guestfs-actions.pod:6743
18754 msgid "guestfs_vfs_label"
18759 #: ../src/guestfs-actions.pod:6745
18763 " guestfs_vfs_label (guestfs_h *g,\n"
18764 " const char *device);\n"
18770 #: ../src/guestfs-actions.pod:6749 ../fish/guestfish-actions.pod:4523
18771 msgid "This returns the filesystem label of the filesystem on C<device>."
18776 #: ../src/guestfs-actions.pod:6752 ../fish/guestfish-actions.pod:4526
18777 msgid "If the filesystem is unlabeled, this returns the empty string."
18782 #: ../src/guestfs-actions.pod:6754
18783 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
18788 #: ../src/guestfs-actions.pod:6759 ../src/guestfs-actions.pod:6796
18789 msgid "(Added in 1.3.18)"
18794 #: ../src/guestfs-actions.pod:6761
18795 msgid "guestfs_vfs_type"
18800 #: ../src/guestfs-actions.pod:6763
18804 " guestfs_vfs_type (guestfs_h *g,\n"
18805 " const char *device);\n"
18811 #: ../src/guestfs-actions.pod:6767 ../fish/guestfish-actions.pod:4534
18813 "This command gets the filesystem type corresponding to the filesystem on "
18819 #: ../src/guestfs-actions.pod:6770 ../fish/guestfish-actions.pod:4537
18821 "For most filesystems, the result is the name of the Linux VFS module which "
18822 "would be used to mount this filesystem if you mounted it without specifying "
18823 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
18828 #: ../src/guestfs-actions.pod:6780
18829 msgid "guestfs_vfs_uuid"
18834 #: ../src/guestfs-actions.pod:6782
18838 " guestfs_vfs_uuid (guestfs_h *g,\n"
18839 " const char *device);\n"
18845 #: ../src/guestfs-actions.pod:6786 ../fish/guestfish-actions.pod:4546
18846 msgid "This returns the filesystem UUID of the filesystem on C<device>."
18851 #: ../src/guestfs-actions.pod:6789 ../fish/guestfish-actions.pod:4549
18852 msgid "If the filesystem does not have a UUID, this returns the empty string."
18857 #: ../src/guestfs-actions.pod:6791
18858 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
18863 #: ../src/guestfs-actions.pod:6798
18864 msgid "guestfs_vg_activate"
18869 #: ../src/guestfs-actions.pod:6800
18873 " guestfs_vg_activate (guestfs_h *g,\n"
18875 " char *const *volgroups);\n"
18881 #: ../src/guestfs-actions.pod:6805 ../fish/guestfish-actions.pod:4557
18883 "This command activates or (if C<activate> is false) deactivates all logical "
18884 "volumes in the listed volume groups C<volgroups>. If activated, then they "
18885 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
18886 "deactivated, then those devices disappear."
18891 #: ../src/guestfs-actions.pod:6811 ../fish/guestfish-actions.pod:4563
18892 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
18897 #: ../src/guestfs-actions.pod:6813 ../fish/guestfish-actions.pod:4565
18899 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
18900 "activated or deactivated."
18905 #: ../src/guestfs-actions.pod:6820
18906 msgid "guestfs_vg_activate_all"
18911 #: ../src/guestfs-actions.pod:6822
18915 " guestfs_vg_activate_all (guestfs_h *g,\n"
18916 " int activate);\n"
18922 #: ../src/guestfs-actions.pod:6826 ../fish/guestfish-actions.pod:4572
18924 "This command activates or (if C<activate> is false) deactivates all logical "
18925 "volumes in all volume groups. If activated, then they are made known to the "
18926 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
18927 "those devices disappear."
18932 #: ../src/guestfs-actions.pod:6832 ../fish/guestfish-actions.pod:4578
18933 msgid "This command is the same as running C<vgchange -a y|n>"
18938 #: ../src/guestfs-actions.pod:6838
18939 msgid "guestfs_vgcreate"
18944 #: ../src/guestfs-actions.pod:6840
18948 " guestfs_vgcreate (guestfs_h *g,\n"
18949 " const char *volgroup,\n"
18950 " char *const *physvols);\n"
18956 #: ../src/guestfs-actions.pod:6845 ../fish/guestfish-actions.pod:4584
18958 "This creates an LVM volume group called C<volgroup> from the non-empty list "
18959 "of physical volumes C<physvols>."
18964 #: ../src/guestfs-actions.pod:6852
18965 msgid "guestfs_vglvuuids"
18970 #: ../src/guestfs-actions.pod:6854
18974 " guestfs_vglvuuids (guestfs_h *g,\n"
18975 " const char *vgname);\n"
18981 #: ../src/guestfs-actions.pod:6858 ../fish/guestfish-actions.pod:4591
18983 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
18984 "volumes created in this volume group."
18989 #: ../src/guestfs-actions.pod:6861
18991 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
18992 "associate logical volumes and volume groups."
18997 #: ../src/guestfs-actions.pod:6864
18998 msgid "See also C<guestfs_vgpvuuids>."
19003 #: ../src/guestfs-actions.pod:6872
19004 msgid "guestfs_vgpvuuids"
19009 #: ../src/guestfs-actions.pod:6874
19013 " guestfs_vgpvuuids (guestfs_h *g,\n"
19014 " const char *vgname);\n"
19020 #: ../src/guestfs-actions.pod:6878 ../fish/guestfish-actions.pod:4603
19022 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
19023 "volumes that this volume group resides on."
19028 #: ../src/guestfs-actions.pod:6881
19030 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
19031 "associate physical volumes and volume groups."
19036 #: ../src/guestfs-actions.pod:6884
19037 msgid "See also C<guestfs_vglvuuids>."
19042 #: ../src/guestfs-actions.pod:6892
19043 msgid "guestfs_vgremove"
19048 #: ../src/guestfs-actions.pod:6894
19052 " guestfs_vgremove (guestfs_h *g,\n"
19053 " const char *vgname);\n"
19059 #: ../src/guestfs-actions.pod:6898 ../fish/guestfish-actions.pod:4615
19060 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
19065 #: ../src/guestfs-actions.pod:6900 ../fish/guestfish-actions.pod:4617
19067 "This also forcibly removes all logical volumes in the volume group (if any)."
19072 #: ../src/guestfs-actions.pod:6907
19073 msgid "guestfs_vgrename"
19078 #: ../src/guestfs-actions.pod:6909
19082 " guestfs_vgrename (guestfs_h *g,\n"
19083 " const char *volgroup,\n"
19084 " const char *newvolgroup);\n"
19090 #: ../src/guestfs-actions.pod:6914 ../fish/guestfish-actions.pod:4624
19091 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
19096 #: ../src/guestfs-actions.pod:6920
19097 msgid "guestfs_vgs"
19102 #: ../src/guestfs-actions.pod:6922
19106 " guestfs_vgs (guestfs_h *g);\n"
19112 #: ../src/guestfs-actions.pod:6925 ../fish/guestfish-actions.pod:4630
19114 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19120 #: ../src/guestfs-actions.pod:6928 ../fish/guestfish-actions.pod:4633
19122 "This returns a list of just the volume group names that were detected (eg. "
19128 #: ../src/guestfs-actions.pod:6931
19129 msgid "See also C<guestfs_vgs_full>."
19134 #: ../src/guestfs-actions.pod:6939
19135 msgid "guestfs_vgs_full"
19140 #: ../src/guestfs-actions.pod:6941
19143 " struct guestfs_lvm_vg_list *\n"
19144 " guestfs_vgs_full (guestfs_h *g);\n"
19150 #: ../src/guestfs-actions.pod:6944 ../fish/guestfish-actions.pod:4642
19152 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19153 "> command. The \"full\" version includes all fields."
19158 #: ../src/guestfs-actions.pod:6947
19160 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
19161 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
19166 #: ../src/guestfs-actions.pod:6953
19167 msgid "guestfs_vgscan"
19172 #: ../src/guestfs-actions.pod:6955
19176 " guestfs_vgscan (guestfs_h *g);\n"
19182 #: ../src/guestfs-actions.pod:6958 ../fish/guestfish-actions.pod:4649
19184 "This rescans all block devices and rebuilds the list of LVM physical "
19185 "volumes, volume groups and logical volumes."
19190 #: ../src/guestfs-actions.pod:6965
19191 msgid "guestfs_vguuid"
19196 #: ../src/guestfs-actions.pod:6967
19200 " guestfs_vguuid (guestfs_h *g,\n"
19201 " const char *vgname);\n"
19207 #: ../src/guestfs-actions.pod:6971 ../fish/guestfish-actions.pod:4656
19208 msgid "This command returns the UUID of the LVM VG named C<vgname>."
19213 #: ../src/guestfs-actions.pod:6978
19214 msgid "guestfs_wait_ready"
19219 #: ../src/guestfs-actions.pod:6980
19223 " guestfs_wait_ready (guestfs_h *g);\n"
19229 #: ../src/guestfs-actions.pod:6983
19230 msgid "This function is a no op."
19235 #: ../src/guestfs-actions.pod:6985
19237 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
19238 "calling C<guestfs_launch> to wait for the launch to complete. However this "
19239 "is no longer necessary because C<guestfs_launch> now does the waiting."
19244 #: ../src/guestfs-actions.pod:6990
19246 "If you see any calls to this function in code then you can just remove them, "
19247 "unless you want to retain compatibility with older versions of the API."
19252 #: ../src/guestfs-actions.pod:6998
19253 msgid "guestfs_wc_c"
19258 #: ../src/guestfs-actions.pod:7000
19262 " guestfs_wc_c (guestfs_h *g,\n"
19263 " const char *path);\n"
19269 #: ../src/guestfs-actions.pod:7004 ../fish/guestfish-actions.pod:4662
19271 "This command counts the characters in a file, using the C<wc -c> external "
19277 #: ../src/guestfs-actions.pod:7011
19278 msgid "guestfs_wc_l"
19283 #: ../src/guestfs-actions.pod:7013
19287 " guestfs_wc_l (guestfs_h *g,\n"
19288 " const char *path);\n"
19294 #: ../src/guestfs-actions.pod:7017 ../fish/guestfish-actions.pod:4669
19296 "This command counts the lines in a file, using the C<wc -l> external command."
19301 #: ../src/guestfs-actions.pod:7024
19302 msgid "guestfs_wc_w"
19307 #: ../src/guestfs-actions.pod:7026
19311 " guestfs_wc_w (guestfs_h *g,\n"
19312 " const char *path);\n"
19318 #: ../src/guestfs-actions.pod:7030 ../fish/guestfish-actions.pod:4676
19320 "This command counts the words in a file, using the C<wc -w> external command."
19325 #: ../src/guestfs-actions.pod:7037
19326 msgid "guestfs_write"
19331 #: ../src/guestfs-actions.pod:7039
19335 " guestfs_write (guestfs_h *g,\n"
19336 " const char *path,\n"
19337 " const char *content,\n"
19338 " size_t content_size);\n"
19344 #: ../src/guestfs-actions.pod:7045 ../fish/guestfish-actions.pod:4683
19346 "This call creates a file called C<path>. The content of the file is the "
19347 "string C<content> (which can contain any 8 bit data)."
19352 #: ../src/guestfs-actions.pod:7055
19353 msgid "guestfs_write_file"
19358 #: ../src/guestfs-actions.pod:7057
19362 " guestfs_write_file (guestfs_h *g,\n"
19363 " const char *path,\n"
19364 " const char *content,\n"
19371 #: ../src/guestfs-actions.pod:7063 ../fish/guestfish-actions.pod:4693
19373 "This call creates a file called C<path>. The contents of the file is the "
19374 "string C<content> (which can contain any 8 bit data), with length C<size>."
19379 #: ../src/guestfs-actions.pod:7067 ../fish/guestfish-actions.pod:4697
19381 "As a special case, if C<size> is C<0> then the length is calculated using "
19382 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
19387 #: ../src/guestfs-actions.pod:7071 ../fish/guestfish-actions.pod:4701
19389 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
19390 "I<not> work, even if the length is specified."
19395 #: ../src/guestfs-actions.pod:7079 ../fish/guestfish-actions.pod:4707
19397 "This function is deprecated. In new code, use the C<write> call instead."
19402 #: ../src/guestfs-actions.pod:7088
19403 msgid "guestfs_zegrep"
19408 #: ../src/guestfs-actions.pod:7090
19412 " guestfs_zegrep (guestfs_h *g,\n"
19413 " const char *regex,\n"
19414 " const char *path);\n"
19420 #: ../src/guestfs-actions.pod:7095 ../fish/guestfish-actions.pod:4718
19422 "This calls the external C<zegrep> program and returns the matching lines."
19427 #: ../src/guestfs-actions.pod:7107
19428 msgid "guestfs_zegrepi"
19433 #: ../src/guestfs-actions.pod:7109
19437 " guestfs_zegrepi (guestfs_h *g,\n"
19438 " const char *regex,\n"
19439 " const char *path);\n"
19445 #: ../src/guestfs-actions.pod:7114 ../fish/guestfish-actions.pod:4728
19447 "This calls the external C<zegrep -i> program and returns the matching lines."
19452 #: ../src/guestfs-actions.pod:7126
19453 msgid "guestfs_zero"
19458 #: ../src/guestfs-actions.pod:7128
19462 " guestfs_zero (guestfs_h *g,\n"
19463 " const char *device);\n"
19469 #: ../src/guestfs-actions.pod:7132 ../fish/guestfish-actions.pod:4738
19470 msgid "This command writes zeroes over the first few blocks of C<device>."
19475 #: ../src/guestfs-actions.pod:7134 ../fish/guestfish-actions.pod:4740
19477 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
19478 "securely wipe the device). It should be sufficient to remove any partition "
19479 "tables, filesystem superblocks and so on."
19484 #: ../src/guestfs-actions.pod:7138
19485 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
19490 #: ../src/guestfs-actions.pod:7149
19491 msgid "guestfs_zero_device"
19496 #: ../src/guestfs-actions.pod:7151
19500 " guestfs_zero_device (guestfs_h *g,\n"
19501 " const char *device);\n"
19507 #: ../src/guestfs-actions.pod:7155
19509 "This command writes zeroes over the entire C<device>. Compare with "
19510 "C<guestfs_zero> which just zeroes the first few blocks of a device."
19515 #: ../src/guestfs-actions.pod:7169
19516 msgid "(Added in 1.3.1)"
19521 #: ../src/guestfs-actions.pod:7171
19522 msgid "guestfs_zerofree"
19527 #: ../src/guestfs-actions.pod:7173
19531 " guestfs_zerofree (guestfs_h *g,\n"
19532 " const char *device);\n"
19538 #: ../src/guestfs-actions.pod:7177 ../fish/guestfish-actions.pod:4761
19540 "This runs the I<zerofree> program on C<device>. This program claims to zero "
19541 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
19542 "possible to compress the filesystem more effectively."
19547 #: ../src/guestfs-actions.pod:7182 ../fish/guestfish-actions.pod:4766
19548 msgid "You should B<not> run this program if the filesystem is mounted."
19553 #: ../src/guestfs-actions.pod:7185 ../fish/guestfish-actions.pod:4769
19555 "It is possible that using this program can damage the filesystem or data on "
19561 #: ../src/guestfs-actions.pod:7192
19562 msgid "guestfs_zfgrep"
19567 #: ../src/guestfs-actions.pod:7194
19571 " guestfs_zfgrep (guestfs_h *g,\n"
19572 " const char *pattern,\n"
19573 " const char *path);\n"
19579 #: ../src/guestfs-actions.pod:7199 ../fish/guestfish-actions.pod:4776
19581 "This calls the external C<zfgrep> program and returns the matching lines."
19586 #: ../src/guestfs-actions.pod:7211
19587 msgid "guestfs_zfgrepi"
19592 #: ../src/guestfs-actions.pod:7213
19596 " guestfs_zfgrepi (guestfs_h *g,\n"
19597 " const char *pattern,\n"
19598 " const char *path);\n"
19604 #: ../src/guestfs-actions.pod:7218 ../fish/guestfish-actions.pod:4786
19606 "This calls the external C<zfgrep -i> program and returns the matching lines."
19611 #: ../src/guestfs-actions.pod:7230
19612 msgid "guestfs_zfile"
19617 #: ../src/guestfs-actions.pod:7232
19621 " guestfs_zfile (guestfs_h *g,\n"
19622 " const char *meth,\n"
19623 " const char *path);\n"
19629 #: ../src/guestfs-actions.pod:7237 ../fish/guestfish-actions.pod:4796
19631 "This command runs C<file> after first decompressing C<path> using C<method>."
19636 #: ../src/guestfs-actions.pod:7240 ../fish/guestfish-actions.pod:4799
19637 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
19642 #: ../src/guestfs-actions.pod:7242
19644 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
19650 #: ../src/guestfs-actions.pod:7248 ../fish/guestfish-actions.pod:4804
19652 "This function is deprecated. In new code, use the C<file> call instead."
19657 #: ../src/guestfs-actions.pod:7257
19658 msgid "guestfs_zgrep"
19663 #: ../src/guestfs-actions.pod:7259
19667 " guestfs_zgrep (guestfs_h *g,\n"
19668 " const char *regex,\n"
19669 " const char *path);\n"
19675 #: ../src/guestfs-actions.pod:7264 ../fish/guestfish-actions.pod:4815
19677 "This calls the external C<zgrep> program and returns the matching lines."
19682 #: ../src/guestfs-actions.pod:7276
19683 msgid "guestfs_zgrepi"
19688 #: ../src/guestfs-actions.pod:7278
19692 " guestfs_zgrepi (guestfs_h *g,\n"
19693 " const char *regex,\n"
19694 " const char *path);\n"
19700 #: ../src/guestfs-actions.pod:7283 ../fish/guestfish-actions.pod:4825
19702 "This calls the external C<zgrep -i> program and returns the matching lines."
19707 #: ../src/guestfs-availability.pod:3
19713 #: ../src/guestfs-availability.pod:5
19715 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
19716 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
19717 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
19718 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
19719 "L</guestfs_aug_save> L</guestfs_aug_set>"
19724 #: ../src/guestfs-availability.pod:21
19730 #: ../src/guestfs-availability.pod:23
19732 "The following functions: L</guestfs_inotify_add_watch> L</"
19733 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
19734 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
19739 #: ../src/guestfs-availability.pod:31
19740 msgid "B<linuxfsuuid>"
19745 #: ../src/guestfs-availability.pod:33
19747 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
19748 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
19753 #: ../src/guestfs-availability.pod:40
19754 msgid "B<linuxmodules>"
19759 #: ../src/guestfs-availability.pod:42
19760 msgid "The following functions: L</guestfs_modprobe>"
19765 #: ../src/guestfs-availability.pod:45
19766 msgid "B<linuxxattrs>"
19771 #: ../src/guestfs-availability.pod:47
19773 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
19774 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
19775 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
19776 "guestfs_setxattr>"
19781 #: ../src/guestfs-availability.pod:58
19787 #: ../src/guestfs-availability.pod:60
19789 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
19790 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
19791 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
19796 #: ../src/guestfs-availability.pod:69
19802 #: ../src/guestfs-availability.pod:71
19804 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
19805 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
19806 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
19807 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
19808 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
19809 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
19810 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
19815 #: ../src/guestfs-availability.pod:94
19821 #: ../src/guestfs-availability.pod:96
19823 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
19824 "guestfs_mknod_b> L</guestfs_mknod_c>"
19829 #: ../src/guestfs-availability.pod:102
19835 #: ../src/guestfs-availability.pod:104
19836 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
19841 #: ../src/guestfs-availability.pod:107
19842 msgid "B<ntfsprogs>"
19847 #: ../src/guestfs-availability.pod:109
19849 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
19854 #: ../src/guestfs-availability.pod:113
19855 msgid "B<realpath>"
19860 #: ../src/guestfs-availability.pod:115
19861 msgid "The following functions: L</guestfs_realpath>"
19866 #: ../src/guestfs-availability.pod:118
19872 #: ../src/guestfs-availability.pod:120
19874 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
19875 "guestfs_scrub_freespace>"
19880 #: ../src/guestfs-availability.pod:125
19886 #: ../src/guestfs-availability.pod:127
19887 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
19892 #: ../src/guestfs-availability.pod:131
19898 #: ../src/guestfs-availability.pod:133
19899 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
19904 #: ../src/guestfs-availability.pod:137
19905 msgid "B<zerofree>"
19910 #: ../src/guestfs-availability.pod:139
19911 msgid "The following functions: L</guestfs_zerofree>"
19916 #: ../src/guestfs-structs.pod:1
19917 msgid "guestfs_int_bool"
19922 #: ../src/guestfs-structs.pod:3
19925 " struct guestfs_int_bool {\n"
19934 #: ../src/guestfs-structs.pod:8
19937 " struct guestfs_int_bool_list {\n"
19938 " uint32_t len; /* Number of elements in list. */\n"
19939 " struct guestfs_int_bool *val; /* Elements. */\n"
19946 #: ../src/guestfs-structs.pod:13
19949 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
19950 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
19956 #: ../src/guestfs-structs.pod:16
19957 msgid "guestfs_lvm_pv"
19962 #: ../src/guestfs-structs.pod:18
19965 " struct guestfs_lvm_pv {\n"
19966 " char *pv_name;\n"
19967 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
19968 " char pv_uuid[32];\n"
19970 " uint64_t pv_size;\n"
19971 " uint64_t dev_size;\n"
19972 " uint64_t pv_free;\n"
19973 " uint64_t pv_used;\n"
19974 " char *pv_attr;\n"
19975 " int64_t pv_pe_count;\n"
19976 " int64_t pv_pe_alloc_count;\n"
19977 " char *pv_tags;\n"
19978 " uint64_t pe_start;\n"
19979 " int64_t pv_mda_count;\n"
19980 " uint64_t pv_mda_free;\n"
19987 #: ../src/guestfs-structs.pod:36
19990 " struct guestfs_lvm_pv_list {\n"
19991 " uint32_t len; /* Number of elements in list. */\n"
19992 " struct guestfs_lvm_pv *val; /* Elements. */\n"
19999 #: ../src/guestfs-structs.pod:41
20002 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
20003 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
20009 #: ../src/guestfs-structs.pod:44
20010 msgid "guestfs_lvm_vg"
20015 #: ../src/guestfs-structs.pod:46
20018 " struct guestfs_lvm_vg {\n"
20019 " char *vg_name;\n"
20020 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20021 " char vg_uuid[32];\n"
20023 " char *vg_attr;\n"
20024 " uint64_t vg_size;\n"
20025 " uint64_t vg_free;\n"
20026 " char *vg_sysid;\n"
20027 " uint64_t vg_extent_size;\n"
20028 " int64_t vg_extent_count;\n"
20029 " int64_t vg_free_count;\n"
20030 " int64_t max_lv;\n"
20031 " int64_t max_pv;\n"
20032 " int64_t pv_count;\n"
20033 " int64_t lv_count;\n"
20034 " int64_t snap_count;\n"
20035 " int64_t vg_seqno;\n"
20036 " char *vg_tags;\n"
20037 " int64_t vg_mda_count;\n"
20038 " uint64_t vg_mda_free;\n"
20045 #: ../src/guestfs-structs.pod:69
20048 " struct guestfs_lvm_vg_list {\n"
20049 " uint32_t len; /* Number of elements in list. */\n"
20050 " struct guestfs_lvm_vg *val; /* Elements. */\n"
20057 #: ../src/guestfs-structs.pod:74
20060 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
20061 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
20067 #: ../src/guestfs-structs.pod:77
20068 msgid "guestfs_lvm_lv"
20073 #: ../src/guestfs-structs.pod:79
20076 " struct guestfs_lvm_lv {\n"
20077 " char *lv_name;\n"
20078 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20079 " char lv_uuid[32];\n"
20080 " char *lv_attr;\n"
20081 " int64_t lv_major;\n"
20082 " int64_t lv_minor;\n"
20083 " int64_t lv_kernel_major;\n"
20084 " int64_t lv_kernel_minor;\n"
20085 " uint64_t lv_size;\n"
20086 " int64_t seg_count;\n"
20088 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20089 " float snap_percent;\n"
20090 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20091 " float copy_percent;\n"
20092 " char *move_pv;\n"
20093 " char *lv_tags;\n"
20094 " char *mirror_log;\n"
20095 " char *modules;\n"
20102 #: ../src/guestfs-structs.pod:101
20105 " struct guestfs_lvm_lv_list {\n"
20106 " uint32_t len; /* Number of elements in list. */\n"
20107 " struct guestfs_lvm_lv *val; /* Elements. */\n"
20114 #: ../src/guestfs-structs.pod:106
20117 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
20118 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
20124 #: ../src/guestfs-structs.pod:111
20127 " struct guestfs_stat {\n"
20131 " int64_t nlink;\n"
20136 " int64_t blksize;\n"
20137 " int64_t blocks;\n"
20138 " int64_t atime;\n"
20139 " int64_t mtime;\n"
20140 " int64_t ctime;\n"
20147 #: ../src/guestfs-structs.pod:127
20150 " struct guestfs_stat_list {\n"
20151 " uint32_t len; /* Number of elements in list. */\n"
20152 " struct guestfs_stat *val; /* Elements. */\n"
20159 #: ../src/guestfs-structs.pod:132
20162 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
20163 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
20169 #: ../src/guestfs-structs.pod:137
20172 " struct guestfs_statvfs {\n"
20173 " int64_t bsize;\n"
20174 " int64_t frsize;\n"
20175 " int64_t blocks;\n"
20176 " int64_t bfree;\n"
20177 " int64_t bavail;\n"
20178 " int64_t files;\n"
20179 " int64_t ffree;\n"
20180 " int64_t favail;\n"
20183 " int64_t namemax;\n"
20190 #: ../src/guestfs-structs.pod:151
20193 " struct guestfs_statvfs_list {\n"
20194 " uint32_t len; /* Number of elements in list. */\n"
20195 " struct guestfs_statvfs *val; /* Elements. */\n"
20202 #: ../src/guestfs-structs.pod:156
20205 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
20206 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
20212 #: ../src/guestfs-structs.pod:159
20213 msgid "guestfs_dirent"
20218 #: ../src/guestfs-structs.pod:161
20221 " struct guestfs_dirent {\n"
20231 #: ../src/guestfs-structs.pod:167
20234 " struct guestfs_dirent_list {\n"
20235 " uint32_t len; /* Number of elements in list. */\n"
20236 " struct guestfs_dirent *val; /* Elements. */\n"
20243 #: ../src/guestfs-structs.pod:172
20246 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
20247 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
20253 #: ../src/guestfs-structs.pod:177
20256 " struct guestfs_version {\n"
20257 " int64_t major;\n"
20258 " int64_t minor;\n"
20259 " int64_t release;\n"
20267 #: ../src/guestfs-structs.pod:184
20270 " struct guestfs_version_list {\n"
20271 " uint32_t len; /* Number of elements in list. */\n"
20272 " struct guestfs_version *val; /* Elements. */\n"
20279 #: ../src/guestfs-structs.pod:189
20282 " void guestfs_free_version (struct guestfs_free_version *);\n"
20283 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
20289 #: ../src/guestfs-structs.pod:192
20290 msgid "guestfs_xattr"
20295 #: ../src/guestfs-structs.pod:194
20298 " struct guestfs_xattr {\n"
20299 " char *attrname;\n"
20300 " /* The next two fields describe a byte array. */\n"
20301 " uint32_t attrval_len;\n"
20302 " char *attrval;\n"
20309 #: ../src/guestfs-structs.pod:201
20312 " struct guestfs_xattr_list {\n"
20313 " uint32_t len; /* Number of elements in list. */\n"
20314 " struct guestfs_xattr *val; /* Elements. */\n"
20321 #: ../src/guestfs-structs.pod:206
20324 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
20325 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
20331 #: ../src/guestfs-structs.pod:209
20332 msgid "guestfs_inotify_event"
20337 #: ../src/guestfs-structs.pod:211
20340 " struct guestfs_inotify_event {\n"
20341 " int64_t in_wd;\n"
20342 " uint32_t in_mask;\n"
20343 " uint32_t in_cookie;\n"
20344 " char *in_name;\n"
20351 #: ../src/guestfs-structs.pod:218
20354 " struct guestfs_inotify_event_list {\n"
20355 " uint32_t len; /* Number of elements in list. */\n"
20356 " struct guestfs_inotify_event *val; /* Elements. */\n"
20363 #: ../src/guestfs-structs.pod:223
20366 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
20367 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
20373 #: ../src/guestfs-structs.pod:226
20374 msgid "guestfs_partition"
20379 #: ../src/guestfs-structs.pod:228
20382 " struct guestfs_partition {\n"
20383 " int32_t part_num;\n"
20384 " uint64_t part_start;\n"
20385 " uint64_t part_end;\n"
20386 " uint64_t part_size;\n"
20393 #: ../src/guestfs-structs.pod:235
20396 " struct guestfs_partition_list {\n"
20397 " uint32_t len; /* Number of elements in list. */\n"
20398 " struct guestfs_partition *val; /* Elements. */\n"
20405 #: ../src/guestfs-structs.pod:240
20408 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
20409 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
20415 #: ../src/guestfs-structs.pod:243
20416 msgid "guestfs_application"
20421 #: ../src/guestfs-structs.pod:245
20424 " struct guestfs_application {\n"
20425 " char *app_name;\n"
20426 " char *app_display_name;\n"
20427 " int32_t app_epoch;\n"
20428 " char *app_version;\n"
20429 " char *app_release;\n"
20430 " char *app_install_path;\n"
20431 " char *app_trans_path;\n"
20432 " char *app_publisher;\n"
20433 " char *app_url;\n"
20434 " char *app_source_package;\n"
20435 " char *app_summary;\n"
20436 " char *app_description;\n"
20443 #: ../src/guestfs-structs.pod:260
20446 " struct guestfs_application_list {\n"
20447 " uint32_t len; /* Number of elements in list. */\n"
20448 " struct guestfs_application *val; /* Elements. */\n"
20455 #: ../src/guestfs-structs.pod:265
20458 " void guestfs_free_application (struct guestfs_free_application *);\n"
20459 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
20465 #: ../fish/guestfish.pod:5
20466 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
20471 #: ../fish/guestfish.pod:9
20474 " guestfish [--options] [commands]\n"
20480 #: ../fish/guestfish.pod:11
20489 #: ../fish/guestfish.pod:13
20492 " guestfish [--ro|--rw] -a disk.img\n"
20498 #: ../fish/guestfish.pod:15
20501 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
20507 #: ../fish/guestfish.pod:17
20510 " guestfish -d libvirt-domain\n"
20516 #: ../fish/guestfish.pod:19
20519 " guestfish [--ro|--rw] -a disk.img -i\n"
20525 #: ../fish/guestfish.pod:21
20528 " guestfish -d libvirt-domain -i\n"
20534 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
20535 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
20541 #: ../fish/guestfish.pod:25
20543 "Using guestfish in read/write mode on live virtual machines can be "
20544 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
20545 "option to use guestfish safely if the disk image or virtual machine might be "
20551 #: ../fish/guestfish.pod:32
20553 "Guestfish is a shell and command-line tool for examining and modifying "
20554 "virtual machine filesystems. It uses libguestfs and exposes all of the "
20555 "functionality of the guestfs API, see L<guestfs(3)>."
20560 #: ../fish/guestfish.pod:36
20562 "Guestfish gives you structured access to the libguestfs API, from shell "
20563 "scripts or the command line or interactively. If you want to rescue a "
20564 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
20570 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:923
20571 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
20572 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:50
20578 #: ../fish/guestfish.pod:43
20579 msgid "As an interactive shell"
20584 #: ../fish/guestfish.pod:45
20593 #: ../fish/guestfish.pod:47
20596 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
20597 " editing virtual machine filesystems.\n"
20603 #: ../fish/guestfish.pod:50
20606 " Type: 'help' for a list of commands\n"
20607 " 'man' to read the manual\n"
20608 " 'quit' to quit the shell\n"
20614 #: ../fish/guestfish.pod:54
20617 " ><fs> add-ro disk.img\n"
20619 " ><fs> list-filesystems\n"
20620 " /dev/sda1: ext4\n"
20621 " /dev/vg_guest/lv_root: ext4\n"
20622 " /dev/vg_guest/lv_swap: swap\n"
20623 " ><fs> mount /dev/vg_guest/lv_root /\n"
20624 " ><fs> cat /etc/fstab\n"
20626 " # Created by anaconda\n"
20634 #: ../fish/guestfish.pod:67
20635 msgid "From shell scripts"
20640 #: ../fish/guestfish.pod:69
20641 msgid "Create a new C</etc/motd> file in a guest or disk image:"
20646 #: ../fish/guestfish.pod:71
20649 " guestfish <<_EOF_\n"
20652 " mount /dev/vg_guest/lv_root /\n"
20653 " write /etc/motd \"Welcome, new users\"\n"
20660 #: ../fish/guestfish.pod:78
20661 msgid "List the LVM logical volumes in a disk image:"
20666 #: ../fish/guestfish.pod:80
20669 " guestfish -a disk.img --ro <<_EOF_\n"
20678 #: ../fish/guestfish.pod:85
20679 msgid "List all the filesystems in a disk image:"
20684 #: ../fish/guestfish.pod:87
20687 " guestfish -a disk.img --ro <<_EOF_\n"
20689 " list-filesystems\n"
20696 #: ../fish/guestfish.pod:92
20697 msgid "On one command line"
20702 #: ../fish/guestfish.pod:94
20703 msgid "Update C</etc/resolv.conf> in a guest:"
20708 #: ../fish/guestfish.pod:96
20712 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
20713 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
20719 #: ../fish/guestfish.pod:100
20720 msgid "Edit C</boot/grub/grub.conf> interactively:"
20725 #: ../fish/guestfish.pod:102
20728 " guestfish --rw --add disk.img \\\n"
20729 " --mount /dev/vg_guest/lv_root \\\n"
20730 " --mount /dev/sda1:/boot \\\n"
20731 " edit /boot/grub/grub.conf\n"
20737 #: ../fish/guestfish.pod:107
20738 msgid "Mount disks automatically"
20743 #: ../fish/guestfish.pod:109
20745 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
20750 #: ../fish/guestfish.pod:112
20753 " guestfish --ro -a disk.img -i cat /etc/group\n"
20759 #: ../fish/guestfish.pod:114
20762 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
20768 #: ../fish/guestfish.pod:116
20769 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
20774 #: ../fish/guestfish.pod:118
20777 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
20783 #: ../fish/guestfish.pod:120
20784 msgid "As a script interpreter"
20789 #: ../fish/guestfish.pod:122
20790 msgid "Create a 100MB disk containing an ext2-formatted partition:"
20795 #: ../fish/guestfish.pod:124
20798 " #!/usr/bin/guestfish -f\n"
20799 " sparse test1.img 100M\n"
20801 " part-disk /dev/sda mbr\n"
20802 " mkfs ext2 /dev/sda1\n"
20808 #: ../fish/guestfish.pod:130
20809 msgid "Start with a prepared disk"
20814 #: ../fish/guestfish.pod:132
20816 "An alternate way to create a 100MB disk called C<test1.img> containing a "
20817 "single ext2-formatted partition:"
20822 #: ../fish/guestfish.pod:135
20825 " guestfish -N fs\n"
20831 #: ../fish/guestfish.pod:137
20832 msgid "To list what is available do:"
20837 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:914
20840 " guestfish -N help | less\n"
20846 #: ../fish/guestfish.pod:141
20847 msgid "Remote control"
20852 #: ../fish/guestfish.pod:143
20855 " eval \"`guestfish --listen`\"\n"
20856 " guestfish --remote add-ro disk.img\n"
20857 " guestfish --remote run\n"
20858 " guestfish --remote lvs\n"
20864 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
20865 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
20866 #: ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254
20867 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103
20868 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
20874 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
20875 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104
20876 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
20877 #: ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161
20878 #: ../tools/virt-list-partitions.pl:62
20884 #: ../fish/guestfish.pod:154
20885 msgid "Displays general help on options."
20890 #: ../fish/guestfish.pod:156
20896 #: ../fish/guestfish.pod:158
20897 msgid "B<--cmd-help>"
20902 #: ../fish/guestfish.pod:160
20903 msgid "Lists all available guestfish commands."
20908 #: ../fish/guestfish.pod:162
20914 #: ../fish/guestfish.pod:164
20915 msgid "B<--cmd-help cmd>"
20920 #: ../fish/guestfish.pod:166
20921 msgid "Displays detailed help on a single command C<cmd>."
20926 #: ../fish/guestfish.pod:168
20927 msgid "B<-a image>"
20932 #: ../fish/guestfish.pod:170
20933 msgid "B<--add image>"
20938 #: ../fish/guestfish.pod:172
20939 msgid "Add a block device or virtual machine image to the shell."
20944 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
20946 "The format of the disk image is auto-detected. To override this and force a "
20947 "particular format use the I<--format=..> option."
20952 #: ../fish/guestfish.pod:177
20954 "Using this flag is mostly equivalent to using the C<add> command, with "
20955 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
20956 "the I<--format:...> flag was given."
20961 #: ../fish/guestfish.pod:181
20967 #: ../fish/guestfish.pod:183
20968 msgid "B<--connect URI>"
20973 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
20975 "When used in conjunction with the I<-d> option, this specifies the libvirt "
20976 "URI to use. The default is to use the default libvirt connection."
20981 #: ../fish/guestfish.pod:189
20987 #: ../fish/guestfish.pod:191
20989 "If using the I<--listen> option and a csh-like shell, use this option. See "
20990 "section L</REMOTE CONTROL AND CSH> below."
20995 #: ../fish/guestfish.pod:194
20996 msgid "B<-d libvirt-domain>"
21001 #: ../fish/guestfish.pod:196
21002 msgid "B<--domain libvirt-domain>"
21007 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
21009 "Add disks from the named libvirt domain. If the I<--ro> option is also "
21010 "used, then any libvirt domain can be used. However in write mode, only "
21011 "libvirt domains which are shut down can be named here."
21016 #: ../fish/guestfish.pod:202
21018 "Using this flag is mostly equivalent to using the C<add-domain> command, "
21019 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
21020 "if the I<--format:...> flag was given."
21025 #: ../fish/guestfish.pod:206
21031 #: ../fish/guestfish.pod:208
21032 msgid "B<--no-dest-paths>"
21037 #: ../fish/guestfish.pod:210
21039 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
21040 "to hit the tab key to complete paths on the guest filesystem, but this "
21041 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
21042 "allow this feature to be disabled."
21047 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
21048 msgid "B<--echo-keys>"
21053 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
21055 "When prompting for keys and passphrases, guestfish normally turns echoing "
21056 "off so you cannot see what you are typing. If you are not worried about "
21057 "Tempest attacks and there is no one else in the room you can specify this "
21058 "flag to see what you are typing."
21063 #: ../fish/guestfish.pod:222
21069 #: ../fish/guestfish.pod:224
21070 msgid "B<--file file>"
21075 #: ../fish/guestfish.pod:226
21076 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
21081 #: ../fish/guestfish.pod:229
21084 " #!/usr/bin/guestfish -f\n"
21090 #: ../fish/guestfish.pod:231
21091 msgid "B<--format=raw|qcow2|..>"
21096 #: ../fish/guestfish.pod:233
21097 msgid "B<--format>"
21102 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
21104 "The default for the I<-a> option is to auto-detect the format of the disk "
21105 "image. Using this forces the disk format for I<-a> options which follow on "
21106 "the command line. Using I<--format> with no argument switches back to auto-"
21107 "detection for subsequent I<-a> options."
21112 #: ../fish/guestfish.pod:242
21115 " guestfish --format=raw -a disk.img\n"
21121 #: ../fish/guestfish.pod:244
21122 msgid "forces raw format (no auto-detection) for C<disk.img>."
21127 #: ../fish/guestfish.pod:246
21130 " guestfish --format=raw -a disk.img --format -a another.img\n"
21136 #: ../fish/guestfish.pod:248
21138 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
21139 "detection for C<another.img>."
21144 #: ../fish/guestfish.pod:251
21146 "If you have untrusted raw-format guest disk images, you should use this "
21147 "option to specify the disk format. This avoids a possible security problem "
21148 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
21153 #: ../fish/guestfish.pod:256
21159 #: ../fish/guestfish.pod:258
21160 msgid "B<--inspector>"
21165 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
21167 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
21168 "system and mount filesystems as they would be mounted on the real virtual "
21174 #: ../fish/guestfish.pod:264
21175 msgid "Typical usage is either:"
21180 #: ../fish/guestfish.pod:266
21183 " guestfish -d myguest -i\n"
21189 #: ../fish/guestfish.pod:268
21190 msgid "(for an inactive libvirt domain called I<myguest>), or:"
21195 #: ../fish/guestfish.pod:270
21198 " guestfish --ro -d myguest -i\n"
21204 #: ../fish/guestfish.pod:272
21205 msgid "(for active domains, readonly), or specify the block device directly:"
21210 #: ../fish/guestfish.pod:274
21213 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
21219 #: ../fish/guestfish.pod:276
21221 "Note that the command line syntax changed slightly over older versions of "
21222 "guestfish. You can still use the old syntax:"
21227 #: ../fish/guestfish.pod:279
21230 " guestfish [--ro] -i disk.img\n"
21236 #: ../fish/guestfish.pod:281
21239 " guestfish [--ro] -i libvirt-domain\n"
21245 #: ../fish/guestfish.pod:283
21247 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
21248 "then using other commands to mount the filesystems that were found."
21253 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
21254 msgid "B<--keys-from-stdin>"
21259 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
21261 "Read key or passphrase parameters from stdin. The default is to try to read "
21262 "passphrases from the user by opening C</dev/tty>."
21267 #: ../fish/guestfish.pod:292
21268 msgid "B<--listen>"
21273 #: ../fish/guestfish.pod:294
21275 "Fork into the background and listen for remote commands. See section L</"
21276 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
21281 #: ../fish/guestfish.pod:297
21282 msgid "B<-m dev[:mountpoint]>"
21287 #: ../fish/guestfish.pod:299
21288 msgid "B<--mount dev[:mountpoint]>"
21293 #: ../fish/guestfish.pod:301
21294 msgid "Mount the named partition or logical volume on the given mountpoint."
21299 #: ../fish/guestfish.pod:303
21300 msgid "If the mountpoint is omitted, it defaults to C</>."
21305 #: ../fish/guestfish.pod:305
21306 msgid "You have to mount something on C</> before most commands will work."
21311 #: ../fish/guestfish.pod:307
21313 "If any I<-m> or I<--mount> options are given, the guest is automatically "
21319 #: ../fish/guestfish.pod:310
21321 "If you don't know what filesystems a disk image contains, you can either run "
21322 "guestfish without this option, then list the partitions, filesystems and LVs "
21323 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
21324 "commands), or you can use the L<virt-filesystems(1)> program."
21329 #: ../fish/guestfish.pod:316
21331 "Using this flag is mostly equivalent to using the C<mount-options> command "
21332 "or the C<mount-ro> command if the I<--ro> flag was given."
21337 #: ../fish/guestfish.pod:319
21343 #: ../fish/guestfish.pod:321
21344 msgid "B<--no-sync>"
21349 #: ../fish/guestfish.pod:323
21351 "Disable autosync. This is enabled by default. See the discussion of "
21352 "autosync in the L<guestfs(3)> manpage."
21357 #: ../fish/guestfish.pod:326
21363 #: ../fish/guestfish.pod:328
21364 msgid "B<--new type>"
21369 #: ../fish/guestfish.pod:330
21375 #: ../fish/guestfish.pod:332
21377 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
21378 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
21379 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
21385 #: ../fish/guestfish.pod:337
21386 msgid "B<--progress-bars>"
21391 #: ../fish/guestfish.pod:339
21392 msgid "Enable progress bars, even when guestfish is used non-interactively."
21397 #: ../fish/guestfish.pod:341
21399 "Progress bars are enabled by default when guestfish is used as an "
21400 "interactive shell."
21405 #: ../fish/guestfish.pod:344
21406 msgid "B<--no-progress-bars>"
21411 #: ../fish/guestfish.pod:346
21412 msgid "Disable progress bars."
21417 #: ../fish/guestfish.pod:348
21418 msgid "B<--remote[=pid]>"
21423 #: ../fish/guestfish.pod:350
21425 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
21426 "CONTROL GUESTFISH OVER A SOCKET> below."
21431 #: ../fish/guestfish.pod:353
21437 #: ../fish/guestfish.pod:355
21443 #: ../fish/guestfish.pod:357
21445 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
21446 "mounts are done read-only."
21451 #: ../fish/guestfish.pod:360
21453 "The option must always be used if the disk image or virtual machine might be "
21454 "running, and is generally recommended in cases where you don't need write "
21455 "access to the disk."
21460 #: ../fish/guestfish.pod:364
21462 "Note that prepared disk images created with I<-N> are not affected by this "
21463 "option. Also commands like C<add> are not affected - you have to specify "
21464 "the C<readonly:true> option explicitly if you need it."
21469 #: ../fish/guestfish.pod:368
21470 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
21475 #: ../fish/guestfish.pod:370 ../fuse/guestmount.pod:208
21476 msgid "B<--selinux>"
21481 #: ../fish/guestfish.pod:372
21482 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
21487 #: ../fish/guestfish.pod:374
21493 #: ../fish/guestfish.pod:376
21494 msgid "B<--verbose>"
21499 #: ../fish/guestfish.pod:378
21501 "Enable very verbose messages. This is particularly useful if you find a bug."
21506 #: ../fish/guestfish.pod:381
21512 #: ../fish/guestfish.pod:383 ../tools/virt-edit.pl:88
21513 #: ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270
21514 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119
21515 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
21516 msgid "B<--version>"
21521 #: ../fish/guestfish.pod:385
21522 msgid "Display the guestfish / libguestfs version number and exit."
21527 #: ../fish/guestfish.pod:387
21533 #: ../fish/guestfish.pod:389
21539 #: ../fish/guestfish.pod:391
21541 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
21547 #: ../fish/guestfish.pod:394
21553 #: ../fish/guestfish.pod:396
21554 msgid "Echo each command before executing it."
21559 #: ../fish/guestfish.pod:400
21560 msgid "COMMANDS ON COMMAND LINE"
21565 #: ../fish/guestfish.pod:402
21567 "Any additional (non-option) arguments are treated as commands to execute."
21572 #: ../fish/guestfish.pod:405
21574 "Commands to execute should be separated by a colon (C<:>), where the colon "
21575 "is a separate parameter. Thus:"
21580 #: ../fish/guestfish.pod:408
21583 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
21589 #: ../fish/guestfish.pod:410
21591 "If there are no additional arguments, then we enter a shell, either an "
21592 "interactive shell with a prompt (if the input is a terminal) or a non-"
21593 "interactive shell."
21598 #: ../fish/guestfish.pod:414
21600 "In either command line mode or non-interactive shell, the first command that "
21601 "gives an error causes the whole shell to exit. In interactive mode (with a "
21602 "prompt) if a command fails, you can continue to enter commands."
21607 #: ../fish/guestfish.pod:419
21608 msgid "USING launch (OR run)"
21613 #: ../fish/guestfish.pod:421
21615 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
21616 "then launch it, then mount any disks you need, and finally issue actions/"
21617 "commands. So the general order of the day is:"
21622 #: ../fish/guestfish.pod:429
21623 msgid "add or -a/--add"
21628 #: ../fish/guestfish.pod:433
21629 msgid "launch (aka run)"
21634 #: ../fish/guestfish.pod:437
21635 msgid "mount or -m/--mount"
21640 #: ../fish/guestfish.pod:441
21641 msgid "any other commands"
21646 #: ../fish/guestfish.pod:445
21648 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
21649 "guest before mounting or performing any other commands."
21654 #: ../fish/guestfish.pod:448
21656 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
21657 "I<--new> options were given then C<run> is done automatically, simply "
21658 "because guestfish can't perform the action you asked for without doing this."
21663 #: ../fish/guestfish.pod:453
21664 msgid "OPENING DISKS FOR READ AND WRITE"
21669 #: ../fish/guestfish.pod:455
21671 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
21672 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
21673 "open disk images read-only or for writing."
21678 #: ../fish/guestfish.pod:459
21680 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
21681 "disk images supplied on the command line for write. To open a disk image "
21682 "read-only you have to do I<-a image --ro>."
21687 #: ../fish/guestfish.pod:463
21689 "This matters: If you accidentally open a live VM disk image writable then "
21690 "you will cause irreversible disk corruption."
21694 #: ../fish/guestfish.pod:466
21696 "By libguestfs 1.10 we intend to change the default the other way. Disk "
21697 "images will be opened read-only. You will have to either specify "
21698 "I<guestfish --rw> or change a configuration file in order to get write "
21699 "access for disk images specified by those other command line options."
21704 #: ../fish/guestfish.pod:471
21706 "This version of guestfish has a I<--rw> option which does nothing (it is "
21707 "already the default). However it is highly recommended that you use this "
21708 "option to indicate that guestfish needs write access, and to prepare your "
21709 "scripts for the day when this option will be required for write access."
21714 #: ../fish/guestfish.pod:477
21716 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
21717 "other libguestfs program apart from guestfish and guestmount."
21722 #: ../fish/guestfish.pod:480
21728 #: ../fish/guestfish.pod:482
21730 "You can quote ordinary parameters using either single or double quotes. For "
21736 #: ../fish/guestfish.pod:485
21739 " add \"file with a space.img\"\n"
21745 #: ../fish/guestfish.pod:487
21748 " rm '/file name'\n"
21754 #: ../fish/guestfish.pod:489
21763 #: ../fish/guestfish.pod:491
21765 "A few commands require a list of strings to be passed. For these, use a "
21766 "whitespace-separated list, enclosed in quotes. Strings containing "
21767 "whitespace to be passed through must be enclosed in single quotes. A "
21768 "literal single quote must be escaped with a backslash."
21773 #: ../fish/guestfish.pod:496
21776 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
21777 " command \"/bin/echo 'foo bar'\"\n"
21778 " command \"/bin/echo \\'foo\\'\"\n"
21784 #: ../fish/guestfish.pod:500
21785 msgid "OPTIONAL ARGUMENTS"
21790 #: ../fish/guestfish.pod:502
21792 "Some commands take optional arguments. These arguments appear in this "
21793 "documentation as C<[argname:..]>. You can use them as in these examples:"
21798 #: ../fish/guestfish.pod:506
21801 " add-drive-opts filename\n"
21807 #: ../fish/guestfish.pod:508
21810 " add-drive-opts filename readonly:true\n"
21816 #: ../fish/guestfish.pod:510
21819 " add-drive-opts filename format:qcow2 readonly:false\n"
21825 #: ../fish/guestfish.pod:512
21827 "Each optional argument can appear at most once. All optional arguments must "
21828 "appear after the required ones."
21833 #: ../fish/guestfish.pod:515
21839 #: ../fish/guestfish.pod:517
21841 "This section applies to all commands which can take integers as parameters."
21846 #: ../fish/guestfish.pod:520
21847 msgid "SIZE SUFFIX"
21852 #: ../fish/guestfish.pod:522
21854 "When the command takes a parameter measured in bytes, you can use one of the "
21855 "following suffixes to specify kilobytes, megabytes and larger sizes:"
21860 #: ../fish/guestfish.pod:528
21861 msgid "B<k> or B<K> or B<KiB>"
21866 #: ../fish/guestfish.pod:530
21867 msgid "The size in kilobytes (multiplied by 1024)."
21872 #: ../fish/guestfish.pod:532
21878 #: ../fish/guestfish.pod:534
21879 msgid "The size in SI 1000 byte units."
21884 #: ../fish/guestfish.pod:536
21885 msgid "B<M> or B<MiB>"
21890 #: ../fish/guestfish.pod:538
21891 msgid "The size in megabytes (multiplied by 1048576)."
21896 #: ../fish/guestfish.pod:540
21902 #: ../fish/guestfish.pod:542
21903 msgid "The size in SI 1000000 byte units."
21908 #: ../fish/guestfish.pod:544
21909 msgid "B<G> or B<GiB>"
21914 #: ../fish/guestfish.pod:546
21915 msgid "The size in gigabytes (multiplied by 2**30)."
21920 #: ../fish/guestfish.pod:548
21926 #: ../fish/guestfish.pod:550
21927 msgid "The size in SI 10**9 byte units."
21932 #: ../fish/guestfish.pod:552
21933 msgid "B<T> or B<TiB>"
21938 #: ../fish/guestfish.pod:554
21939 msgid "The size in terabytes (multiplied by 2**40)."
21944 #: ../fish/guestfish.pod:556
21950 #: ../fish/guestfish.pod:558
21951 msgid "The size in SI 10**12 byte units."
21956 #: ../fish/guestfish.pod:560
21957 msgid "B<P> or B<PiB>"
21962 #: ../fish/guestfish.pod:562
21963 msgid "The size in petabytes (multiplied by 2**50)."
21968 #: ../fish/guestfish.pod:564
21974 #: ../fish/guestfish.pod:566
21975 msgid "The size in SI 10**15 byte units."
21980 #: ../fish/guestfish.pod:568
21981 msgid "B<E> or B<EiB>"
21986 #: ../fish/guestfish.pod:570
21987 msgid "The size in exabytes (multiplied by 2**60)."
21992 #: ../fish/guestfish.pod:572
21998 #: ../fish/guestfish.pod:574
21999 msgid "The size in SI 10**18 byte units."
22004 #: ../fish/guestfish.pod:576
22005 msgid "B<Z> or B<ZiB>"
22010 #: ../fish/guestfish.pod:578
22011 msgid "The size in zettabytes (multiplied by 2**70)."
22016 #: ../fish/guestfish.pod:580
22022 #: ../fish/guestfish.pod:582
22023 msgid "The size in SI 10**21 byte units."
22028 #: ../fish/guestfish.pod:584
22029 msgid "B<Y> or B<YiB>"
22034 #: ../fish/guestfish.pod:586
22035 msgid "The size in yottabytes (multiplied by 2**80)."
22040 #: ../fish/guestfish.pod:588
22046 #: ../fish/guestfish.pod:590
22047 msgid "The size in SI 10**24 byte units."
22052 #: ../fish/guestfish.pod:596
22055 " truncate-size /file 1G\n"
22061 #: ../fish/guestfish.pod:598
22062 msgid "would truncate the file to 1 gigabyte."
22067 #: ../fish/guestfish.pod:600
22069 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
22070 "the parameter to L</memsize> is specified in megabytes already). Adding a "
22071 "suffix will probably not do what you expect."
22076 #: ../fish/guestfish.pod:604
22077 msgid "OCTAL AND HEXADECIMAL NUMBERS"
22082 #: ../fish/guestfish.pod:606
22084 "For specifying the radix (base) use the C convention: C<0> to prefix an "
22085 "octal number or C<0x> to prefix a hexadecimal number. For example:"
22090 #: ../fish/guestfish.pod:609
22093 " 1234 decimal number 1234\n"
22094 " 02322 octal number, equivalent to decimal 1234\n"
22095 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
22101 #: ../fish/guestfish.pod:613
22103 "When using the C<chmod> command, you almost always want to specify an octal "
22104 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
22105 "L<chmod(1)> program):"
22110 #: ../fish/guestfish.pod:617
22113 " chmod 0777 /public # OK\n"
22114 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
22120 #: ../fish/guestfish.pod:620
22122 "Commands that return numbers usually print them in decimal, but some "
22123 "commands print numbers in other radices (eg. C<umask> prints the mode in "
22124 "octal, preceeded by C<0>)."
22129 #: ../fish/guestfish.pod:624
22130 msgid "WILDCARDS AND GLOBBING"
22135 #: ../fish/guestfish.pod:626
22137 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
22138 "(globbing) by default. So for example the following will not do what you "
22144 #: ../fish/guestfish.pod:630
22153 #: ../fish/guestfish.pod:632
22155 "Assuming you don't have a directory called literally C</home/*> then the "
22156 "above command will return an error."
22161 #: ../fish/guestfish.pod:635
22162 msgid "To perform wildcard expansion, use the C<glob> command."
22167 #: ../fish/guestfish.pod:637
22170 " glob rm-rf /home/*\n"
22176 #: ../fish/guestfish.pod:639
22178 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
22179 "many times), equivalent to:"
22184 #: ../fish/guestfish.pod:642
22187 " rm-rf /home/jim\n"
22188 " rm-rf /home/joe\n"
22189 " rm-rf /home/mary\n"
22195 #: ../fish/guestfish.pod:646
22196 msgid "C<glob> only works on simple guest paths and not on device names."
22201 #: ../fish/guestfish.pod:648
22203 "If you have several parameters, each containing a wildcard, then glob will "
22204 "perform a Cartesian product."
22209 #: ../fish/guestfish.pod:651
22215 #: ../fish/guestfish.pod:653
22217 "Any line which starts with a I<#> character is treated as a comment and "
22218 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
22219 "a command. For example:"
22224 #: ../fish/guestfish.pod:657
22227 " # this is a comment\n"
22228 " # this is a comment\n"
22229 " foo # NOT a comment\n"
22235 #: ../fish/guestfish.pod:661
22236 msgid "Blank lines are also ignored."
22241 #: ../fish/guestfish.pod:663
22242 msgid "RUNNING COMMANDS LOCALLY"
22247 #: ../fish/guestfish.pod:665
22249 "Any line which starts with a I<!> character is treated as a command sent to "
22250 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
22255 #: ../fish/guestfish.pod:669
22259 " tgz-out /remote local/remote-data.tar.gz\n"
22265 #: ../fish/guestfish.pod:672
22267 "will create a directory C<local> on the host, and then export the contents "
22268 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
22269 "(See C<tgz-out>)."
22274 #: ../fish/guestfish.pod:676
22276 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
22277 "effect, due to the way that subprocesses work in Unix."
22281 #: ../fish/guestfish.pod:679
22282 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
22286 #: ../fish/guestfish.pod:681
22288 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
22289 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
22290 "and executed as guestfish commands."
22294 #: ../fish/guestfish.pod:685
22296 "Thus you can use shell script to construct arbitrary guestfish commands "
22297 "which are then parsed by guestfish."
22301 #: ../fish/guestfish.pod:688
22303 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
22304 "through C</foo.100>) using guestfish commands alone. However this is simple "
22305 "if we use a shell script to create the guestfish commands for us:"
22309 #: ../fish/guestfish.pod:693
22312 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
22317 #: ../fish/guestfish.pod:695
22318 msgid "or with names like C</foo.001>:"
22322 #: ../fish/guestfish.pod:697
22325 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
22330 #: ../fish/guestfish.pod:699
22332 "When using guestfish interactively it can be helpful to just run the shell "
22333 "script first (ie. remove the initial C<E<lt>> character so it is just an "
22334 "ordinary I<!> local command), see what guestfish commands it would run, and "
22335 "when you are happy with those prepend the C<E<lt>> character to run the "
22336 "guestfish commands for real."
22341 #: ../fish/guestfish.pod:705
22347 #: ../fish/guestfish.pod:707
22349 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
22350 "command (a guestfish command) to the second command (any host command). For "
22356 #: ../fish/guestfish.pod:711
22359 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
22365 #: ../fish/guestfish.pod:713
22367 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
22368 "program). The above command would list all accounts in the guest filesystem "
22369 "which have UID 0, ie. root accounts including backdoors. Other examples:"
22374 #: ../fish/guestfish.pod:718
22377 " hexdump /bin/ls | head\n"
22378 " list-devices | tail -1\n"
22379 " tgz-out / - | tar ztf -\n"
22385 #: ../fish/guestfish.pod:722
22387 "The space before the pipe symbol is required, any space after the pipe "
22388 "symbol is optional. Everything after the pipe symbol is just passed "
22389 "straight to the host shell, so it can contain redirections, globs and "
22390 "anything else that makes sense on the host side."
22395 #: ../fish/guestfish.pod:727
22397 "To use a literal argument which begins with a pipe symbol, you have to quote "
22403 #: ../fish/guestfish.pod:730
22412 #: ../fish/guestfish.pod:732
22413 msgid "HOME DIRECTORIES"
22418 #: ../fish/guestfish.pod:734
22420 "If a parameter starts with the character C<~> then the tilde may be expanded "
22421 "as a home directory path (either C<~> for the current user's home directory, "
22422 "or C<~user> for another user)."
22427 #: ../fish/guestfish.pod:738
22429 "Note that home directory expansion happens for users known I<on the host>, "
22430 "not in the guest filesystem."
22435 #: ../fish/guestfish.pod:741
22437 "To use a literal argument which begins with a tilde, you have to quote it, "
22443 #: ../fish/guestfish.pod:744
22452 #: ../fish/guestfish.pod:748
22454 "Libguestfs has some support for Linux guests encrypted according to the "
22455 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
22456 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
22457 "LUKS is supported."
22462 #: ../fish/guestfish.pod:753
22463 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
22468 #: ../fish/guestfish.pod:755
22471 " ><fs> vfs-type /dev/sda2\n"
22478 #: ../fish/guestfish.pod:758
22480 "Then open those devices using L</luks-open>. This creates a device-mapper "
22481 "device called C</dev/mapper/luksdev>."
22486 #: ../fish/guestfish.pod:761
22489 " ><fs> luks-open /dev/sda2 luksdev\n"
22490 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
22496 #: ../fish/guestfish.pod:764
22498 "Finally you have to tell LVM to scan for volume groups on the newly created "
22504 #: ../fish/guestfish.pod:767
22508 " vg-activate-all true\n"
22514 #: ../fish/guestfish.pod:770
22515 msgid "The logical volume(s) can now be mounted in the usual way."
22520 #: ../fish/guestfish.pod:772
22522 "Before closing a LUKS device you must unmount any logical volumes on it and "
22523 "deactivate the volume groups by calling C<vg-activate false VG> on each "
22524 "one. Then you can close the mapper device:"
22529 #: ../fish/guestfish.pod:776
22532 " vg-activate false /dev/VG\n"
22533 " luks-close /dev/mapper/luksdev\n"
22539 #: ../fish/guestfish.pod:779
22540 msgid "WINDOWS PATHS"
22545 #: ../fish/guestfish.pod:781
22547 "If a path is prefixed with C<win:> then you can use Windows-style paths "
22548 "(with some limitations). The following commands are equivalent:"
22553 #: ../fish/guestfish.pod:784
22556 " file /WINDOWS/system32/config/system.LOG\n"
22562 #: ../fish/guestfish.pod:786
22565 " file win:/windows/system32/config/system.log\n"
22571 #: ../fish/guestfish.pod:788
22574 " file win:\\windows\\system32\\config\\system.log\n"
22580 #: ../fish/guestfish.pod:790
22583 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
22589 #: ../fish/guestfish.pod:792
22591 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
22592 "handles case insensitivity like Windows would. This only works in argument "
22593 "positions that expect a path."
22598 #: ../fish/guestfish.pod:796
22599 msgid "UPLOADING AND DOWNLOADING FILES"
22604 #: ../fish/guestfish.pod:798
22606 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
22607 "others which upload from or download to a local file, you can use the "
22608 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
22613 #: ../fish/guestfish.pod:802
22622 #: ../fish/guestfish.pod:804
22624 "reads stdin and creates from that a file C</foo> in the disk image, and:"
22629 #: ../fish/guestfish.pod:807
22632 " tar-out /etc - | tar tf -\n"
22638 #: ../fish/guestfish.pod:809
22640 "writes the tarball to stdout and then pipes that into the external \"tar\" "
22641 "command (see L</PIPES>)."
22646 #: ../fish/guestfish.pod:812
22648 "When using C<-> to read from stdin, the input is read up to the end of "
22649 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
22650 "some arbitrary end marker:"
22655 #: ../fish/guestfish.pod:816
22658 " upload -<<END /foo\n"
22668 #: ../fish/guestfish.pod:822
22670 "Any string of characters can be used instead of C<END>. The end marker must "
22671 "appear on a line of its own, without any preceeding or following characters "
22672 "(not even spaces)."
22677 #: ../fish/guestfish.pod:826
22679 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
22680 "upload local files (so-called \"FileIn\" parameters in the generator)."
22685 #: ../fish/guestfish.pod:829
22686 msgid "EXIT ON ERROR BEHAVIOUR"
22691 #: ../fish/guestfish.pod:831
22693 "By default, guestfish will ignore any errors when in interactive mode (ie. "
22694 "taking commands from a human over a tty), and will exit on the first error "
22695 "in non-interactive mode (scripts, commands given on the command line)."
22700 #: ../fish/guestfish.pod:836
22702 "If you prefix a command with a I<-> character, then that command will not "
22703 "cause guestfish to exit, even if that (one) command returns an error."
22708 #: ../fish/guestfish.pod:840
22709 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
22714 #: ../fish/guestfish.pod:842
22716 "Guestfish can be remote-controlled over a socket. This is useful "
22717 "particularly in shell scripts where you want to make several different "
22718 "changes to a filesystem, but you don't want the overhead of starting up a "
22719 "guestfish process each time."
22724 #: ../fish/guestfish.pod:847
22725 msgid "Start a guestfish server process using:"
22730 #: ../fish/guestfish.pod:849
22733 " eval \"`guestfish --listen`\"\n"
22739 #: ../fish/guestfish.pod:851
22740 msgid "and then send it commands by doing:"
22745 #: ../fish/guestfish.pod:853
22748 " guestfish --remote cmd [...]\n"
22754 #: ../fish/guestfish.pod:855
22755 msgid "To cause the server to exit, send it the exit command:"
22760 #: ../fish/guestfish.pod:857
22763 " guestfish --remote exit\n"
22769 #: ../fish/guestfish.pod:859
22771 "Note that the server will normally exit if there is an error in a command. "
22772 "You can change this in the usual way. See section L</EXIT ON ERROR "
22778 #: ../fish/guestfish.pod:863
22779 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
22784 #: ../fish/guestfish.pod:865
22786 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
22787 "is how the I<--remote> option knows where to send the commands. You can "
22788 "have several guestfish listener processes running using:"
22793 #: ../fish/guestfish.pod:869
22796 " eval \"`guestfish --listen`\"\n"
22797 " pid1=$GUESTFISH_PID\n"
22798 " eval \"`guestfish --listen`\"\n"
22799 " pid2=$GUESTFISH_PID\n"
22801 " guestfish --remote=$pid1 cmd\n"
22802 " guestfish --remote=$pid2 cmd\n"
22808 #: ../fish/guestfish.pod:877
22809 msgid "REMOTE CONTROL AND CSH"
22814 #: ../fish/guestfish.pod:879
22816 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
22822 #: ../fish/guestfish.pod:882
22825 " eval \"`guestfish --listen --csh`\"\n"
22831 #: ../fish/guestfish.pod:884
22832 msgid "REMOTE CONTROL DETAILS"
22837 #: ../fish/guestfish.pod:886
22839 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
22840 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
22841 "and C<$PID> is the process ID of the server."
22846 #: ../fish/guestfish.pod:890
22847 msgid "Guestfish client and server versions must match exactly."
22852 #: ../fish/guestfish.pod:892
22853 msgid "PREPARED DISK IMAGES"
22858 #: ../fish/guestfish.pod:894
22860 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
22861 "preformatted disk images that guestfish can make for you to save typing. "
22862 "This is particularly useful for testing purposes. This option is used "
22863 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
22864 "can be mixed with I<-a>)."
22869 #: ../fish/guestfish.pod:900
22871 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
22872 "the second and so on. Existing files in the current directory are "
22878 #: ../fish/guestfish.pod:904
22880 "The type briefly describes how the disk should be sized, partitioned, how "
22881 "filesystem(s) should be created, and how content should be added. "
22882 "Optionally the type can be followed by extra parameters, separated by C<:> "
22883 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
22884 "allocated disk, containing a single partition, with the partition formatted "
22885 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
22891 #: ../fish/guestfish.pod:912
22892 msgid "To list the available types and any extra parameters they take, run:"
22897 #: ../fish/guestfish.pod:916
22899 "Note that the prepared filesystem is not mounted. You would usually have to "
22900 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
22905 #: ../fish/guestfish.pod:920
22907 "If any I<-N> or I<--new> options are given, the guest is automatically "
22913 #: ../fish/guestfish.pod:925
22914 msgid "Create a 100MB disk with an ext4-formatted partition:"
22919 #: ../fish/guestfish.pod:927
22922 " guestfish -N fs:ext4\n"
22928 #: ../fish/guestfish.pod:929
22929 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
22934 #: ../fish/guestfish.pod:931
22937 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
22943 #: ../fish/guestfish.pod:933
22944 msgid "Create a blank 200MB disk:"
22949 #: ../fish/guestfish.pod:935
22952 " guestfish -N disk:200M\n"
22958 #: ../fish/guestfish.pod:937
22959 msgid "PROGRESS BARS"
22964 #: ../fish/guestfish.pod:939
22966 "Some (not all) long-running commands send progress notification messages as "
22967 "they are running. Guestfish turns these messages into progress bars."
22972 #: ../fish/guestfish.pod:943
22974 "When a command that supports progress bars takes longer than two seconds to "
22975 "run, and if progress bars are enabled, then you will see one appearing below "
22981 #: ../fish/guestfish.pod:947
22984 " ><fs> copy-size /large-file /another-file 2048M\n"
22985 " / 10% [#####-----------------------------------------] 00:30\n"
22991 #: ../fish/guestfish.pod:950
22993 "The spinner on the left hand side moves round once for every progress "
22994 "notification received from the backend. This is a (reasonably) golden "
22995 "assurance that the command is \"doing something\" even if the progress bar "
22996 "is not moving, because the command is able to send the progress "
22997 "notifications. When the bar reaches 100% and the command finishes, the "
22998 "spinner disappears."
23003 #: ../fish/guestfish.pod:957
23005 "Progress bars are enabled by default when guestfish is used interactively. "
23006 "You can enable them even for non-interactive modes using I<--progress-bars>, "
23007 "and you can disable them completely using I<--no-progress-bars>."
23012 #: ../fish/guestfish.pod:962
23013 msgid "GUESTFISH COMMANDS"
23018 #: ../fish/guestfish.pod:964
23020 "The commands in this section are guestfish convenience commands, in other "
23021 "words, they are not part of the L<guestfs(3)> API."
23026 #: ../fish/guestfish.pod:967
23032 #: ../fish/guestfish.pod:969
23042 #: ../fish/guestfish.pod:972
23043 msgid "Without any parameter, this provides general help."
23048 #: ../fish/guestfish.pod:974
23049 msgid "With a C<cmd> parameter, this displays detailed help for that command."
23054 #: ../fish/guestfish.pod:976
23055 msgid "quit | exit"
23060 #: ../fish/guestfish.pod:978
23061 msgid "This exits guestfish. You can also use C<^D> key."
23066 #: ../fish/guestfish.pod:980
23067 msgid "@FISH_COMMANDS@"
23072 #: ../fish/guestfish.pod:982
23078 #: ../fish/guestfish.pod:986 ../test-tool/libguestfs-test-tool.pod:83
23084 #: ../fish/guestfish.pod:988
23086 "guestfish returns 0 if the commands completed without error, or 1 if there "
23092 #: ../fish/guestfish.pod:995
23098 #: ../fish/guestfish.pod:997
23100 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
23106 #: ../fish/guestfish.pod:1000
23107 msgid "GUESTFISH_PID"
23112 #: ../fish/guestfish.pod:1002
23114 "Used with the I<--remote> option to specify the remote guestfish process to "
23115 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
23120 #: ../fish/guestfish.pod:1006
23126 #: ../fish/guestfish.pod:1008
23128 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
23129 "not specified, the external L<hexedit(1)> program is used."
23134 #: ../fish/guestfish.pod:1012
23140 #: ../fish/guestfish.pod:1014
23142 "If compiled with GNU readline support, various files in the home directory "
23143 "can be used. See L</FILES>."
23148 #: ../fish/guestfish.pod:1023
23150 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
23151 "effect as using the B<-v> option."
23156 #: ../fish/guestfish.pod:1035
23158 "Set the path that guestfish uses to search for kernel and initrd.img. See "
23159 "the discussion of paths in L<guestfs(3)>."
23164 #: ../fish/guestfish.pod:1046
23165 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
23170 #: ../fish/guestfish.pod:1048
23176 #: ../fish/guestfish.pod:1050
23178 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
23184 #: ../fish/guestfish.pod:1065 ../test-tool/libguestfs-test-tool.pod:88
23190 #: ../fish/guestfish.pod:1069
23191 msgid "$HOME/.guestfish"
23196 #: ../fish/guestfish.pod:1071
23198 "If compiled with GNU readline support, then the command history is saved in "
23204 #: ../fish/guestfish.pod:1074
23205 msgid "$HOME/.inputrc"
23210 #: ../fish/guestfish.pod:1076
23211 msgid "/etc/inputrc"
23216 #: ../fish/guestfish.pod:1078
23218 "If compiled with GNU readline support, then these files can be used to "
23219 "configure readline. For further information, please see L<readline(3)/"
23220 "INITIALIZATION FILE>."
23225 #: ../fish/guestfish.pod:1082
23226 msgid "To write rules which only apply to guestfish, use:"
23231 #: ../fish/guestfish.pod:1084
23242 #: ../fish/guestfish.pod:1088
23244 "Variables that you can set in inputrc that change the behaviour of guestfish "
23245 "in useful ways include:"
23250 #: ../fish/guestfish.pod:1093
23251 msgid "completion-ignore-case (default: on)"
23256 #: ../fish/guestfish.pod:1095
23258 "By default, guestfish will ignore case when tab-completing paths on the "
23264 #: ../fish/guestfish.pod:1098
23267 " set completion-ignore-case off\n"
23273 #: ../fish/guestfish.pod:1100
23274 msgid "to make guestfish case sensitive."
23279 #: ../fish/guestfish.pod:1104
23285 #: ../fish/guestfish.pod:1106
23286 msgid "test2.img (etc)"
23291 #: ../fish/guestfish.pod:1108
23293 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
23294 "will be created in the file C<test1.img> in the current directory. The "
23295 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
23296 "the same name will be overwritten."
23300 #: ../fish/guestfish.pod:1117
23302 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
23303 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
23304 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
23305 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
23306 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
23307 ">, L<hexedit(1)>."
23312 #: ../fish/guestfish.pod:1147 ../test-tool/libguestfs-test-tool.pod:124
23313 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:372
23314 #: ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1512
23315 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309
23316 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
23318 "This program is free software; you can redistribute it and/or modify it "
23319 "under the terms of the GNU General Public License as published by the Free "
23320 "Software Foundation; either version 2 of the License, or (at your option) "
23321 "any later version."
23326 #: ../fish/guestfish.pod:1152 ../test-tool/libguestfs-test-tool.pod:129
23327 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:377
23328 #: ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1517
23329 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314
23330 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
23332 "This program is distributed in the hope that it will be useful, but WITHOUT "
23333 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
23334 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
23340 #: ../fish/guestfish.pod:1157 ../test-tool/libguestfs-test-tool.pod:134
23341 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:382
23342 #: ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1522
23343 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319
23344 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
23346 "You should have received a copy of the GNU General Public License along with "
23347 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
23348 "Ave, Cambridge, MA 02139, USA."
23353 #: ../fish/guestfish-actions.pod:1
23359 #: ../fish/guestfish-actions.pod:3
23362 " add-cdrom filename\n"
23368 #: ../fish/guestfish-actions.pod:15
23370 "This call checks for the existence of C<filename>. This stops you from "
23371 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23372 "and C<http:> URLs. To specify those, use the general L</config> call "
23378 #: ../fish/guestfish-actions.pod:22
23380 "If you just want to add an ISO file (often you use this as an efficient way "
23381 "to transfer large files into the guest), then you should probably use L</add-"
23382 "drive-ro> instead."
23387 #: ../fish/guestfish-actions.pod:35
23393 #: ../fish/guestfish-actions.pod:37
23399 #: ../fish/guestfish-actions.pod:39
23402 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
23408 #: ../fish/guestfish-actions.pod:41
23410 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23411 "It works by connecting to libvirt, requesting the domain and domain XML from "
23412 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
23417 #: ../fish/guestfish-actions.pod:64
23419 "The other optional parameters are passed directly through to L</add-drive-"
23425 #: ../fish/guestfish-actions.pod:67 ../fish/guestfish-actions.pod:131
23426 #: ../fish/guestfish-actions.pod:2921
23428 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
23433 #: ../fish/guestfish-actions.pod:69
23439 #: ../fish/guestfish-actions.pod:71
23442 " add-drive filename\n"
23448 #: ../fish/guestfish-actions.pod:73
23450 "This function is the equivalent of calling L</add-drive-opts> with no "
23451 "optional parameters, so the disk is added writable, with the format being "
23452 "detected automatically."
23457 #: ../fish/guestfish-actions.pod:77
23459 "Automatic detection of the format opens you up to a potential security hole "
23460 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23461 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23462 "you should think about replacing calls to this function with calls to L</add-"
23463 "drive-opts>, and specifying the format."
23468 #: ../fish/guestfish-actions.pod:84
23469 msgid "add-drive-opts"
23474 #: ../fish/guestfish-actions.pod:86
23480 #: ../fish/guestfish-actions.pod:88
23483 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
23489 #: ../fish/guestfish-actions.pod:115
23491 "This forces the image format. If you omit this (or use L</add-drive> or L</"
23492 "add-drive-ro>) then the format is automatically detected. Possible formats "
23493 "include C<raw> and C<qcow2>."
23498 #: ../fish/guestfish-actions.pod:126
23500 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
23501 "add-drive-with-if> call (q.v.)"
23506 #: ../fish/guestfish-actions.pod:133
23507 msgid "add-drive-ro"
23512 #: ../fish/guestfish-actions.pod:135
23518 #: ../fish/guestfish-actions.pod:137
23521 " add-drive-ro filename\n"
23527 #: ../fish/guestfish-actions.pod:139
23529 "This function is the equivalent of calling L</add-drive-opts> with the "
23530 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
23531 "is added read-only, with the format being detected automatically."
23536 #: ../fish/guestfish-actions.pod:144
23537 msgid "add-drive-ro-with-if"
23542 #: ../fish/guestfish-actions.pod:146
23545 " add-drive-ro-with-if filename iface\n"
23551 #: ../fish/guestfish-actions.pod:148
23553 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
23554 "interface emulation to use at run time."
23559 #: ../fish/guestfish-actions.pod:158
23560 msgid "add-drive-with-if"
23565 #: ../fish/guestfish-actions.pod:160
23568 " add-drive-with-if filename iface\n"
23574 #: ../fish/guestfish-actions.pod:162
23576 "This is the same as L</add-drive> but it allows you to specify the QEMU "
23577 "interface emulation to use at run time."
23582 #: ../fish/guestfish-actions.pod:172
23588 #: ../fish/guestfish-actions.pod:174
23591 " aug-clear augpath\n"
23597 #: ../fish/guestfish-actions.pod:179
23603 #: ../fish/guestfish-actions.pod:181
23612 #: ../fish/guestfish-actions.pod:183
23614 "Close the current Augeas handle and free up any resources used by it. After "
23615 "calling this, you have to call L</aug-init> again before you can use any "
23616 "other Augeas functions."
23621 #: ../fish/guestfish-actions.pod:188
23622 msgid "aug-defnode"
23627 #: ../fish/guestfish-actions.pod:190
23630 " aug-defnode name expr val\n"
23636 #: ../fish/guestfish-actions.pod:195
23638 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23639 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
23640 "containing that single node."
23645 #: ../fish/guestfish-actions.pod:203
23651 #: ../fish/guestfish-actions.pod:205
23654 " aug-defvar name expr\n"
23660 #: ../fish/guestfish-actions.pod:214
23666 #: ../fish/guestfish-actions.pod:216
23669 " aug-get augpath\n"
23675 #: ../fish/guestfish-actions.pod:221
23681 #: ../fish/guestfish-actions.pod:223
23684 " aug-init root flags\n"
23690 #: ../fish/guestfish-actions.pod:229
23691 msgid "You must call this before using any other L</aug-*> commands."
23696 #: ../fish/guestfish-actions.pod:264
23697 msgid "Do not load the tree in L</aug-init>."
23702 #: ../fish/guestfish-actions.pod:268
23703 msgid "To close the handle, you can call L</aug-close>."
23708 #: ../fish/guestfish-actions.pod:272
23714 #: ../fish/guestfish-actions.pod:274
23717 " aug-insert augpath label true|false\n"
23723 #: ../fish/guestfish-actions.pod:284
23729 #: ../fish/guestfish-actions.pod:286
23738 #: ../fish/guestfish-actions.pod:293
23744 #: ../fish/guestfish-actions.pod:295
23747 " aug-ls augpath\n"
23753 #: ../fish/guestfish-actions.pod:297
23755 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
23756 "resulting nodes into alphabetical order."
23761 #: ../fish/guestfish-actions.pod:300
23767 #: ../fish/guestfish-actions.pod:302
23770 " aug-match augpath\n"
23776 #: ../fish/guestfish-actions.pod:308
23782 #: ../fish/guestfish-actions.pod:310
23785 " aug-mv src dest\n"
23791 #: ../fish/guestfish-actions.pod:315
23797 #: ../fish/guestfish-actions.pod:317
23800 " aug-rm augpath\n"
23806 #: ../fish/guestfish-actions.pod:323
23812 #: ../fish/guestfish-actions.pod:325
23821 #: ../fish/guestfish-actions.pod:329
23823 "The flags which were passed to L</aug-init> affect exactly how files are "
23829 #: ../fish/guestfish-actions.pod:332
23835 #: ../fish/guestfish-actions.pod:334
23838 " aug-set augpath val\n"
23844 #: ../fish/guestfish-actions.pod:338
23846 "In the Augeas API, it is possible to clear a node by setting the value to "
23847 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
23848 "this call. Instead you must use the L</aug-clear> call."
23853 #: ../fish/guestfish-actions.pod:343
23859 #: ../fish/guestfish-actions.pod:345
23862 " available 'groups ...'\n"
23868 #: ../fish/guestfish-actions.pod:351
23870 "The libguestfs groups, and the functions that those groups correspond to, "
23871 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
23872 "runtime by calling L</available-all-groups>."
23877 #: ../fish/guestfish-actions.pod:375
23878 msgid "You must call L</launch> before calling this function."
23883 #: ../fish/guestfish-actions.pod:397
23885 "This call was added in version C<1.0.80>. In previous versions of "
23886 "libguestfs all you could do would be to speculatively execute a command to "
23887 "find out if the daemon implemented it. See also L</version>."
23892 #: ../fish/guestfish-actions.pod:404
23893 msgid "available-all-groups"
23898 #: ../fish/guestfish-actions.pod:406
23901 " available-all-groups\n"
23907 #: ../fish/guestfish-actions.pod:408
23909 "This command returns a list of all optional groups that this daemon knows "
23910 "about. Note this returns both supported and unsupported groups. To find "
23911 "out which ones the daemon can actually support you have to call L</"
23912 "available> on each member of the returned list."
23917 #: ../fish/guestfish-actions.pod:414
23918 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
23923 #: ../fish/guestfish-actions.pod:416
23929 #: ../fish/guestfish-actions.pod:418
23932 " base64-in (base64file|-) filename\n"
23938 #: ../fish/guestfish-actions.pod:423 ../fish/guestfish-actions.pod:432
23939 #: ../fish/guestfish-actions.pod:656 ../fish/guestfish-actions.pod:825
23940 #: ../fish/guestfish-actions.pod:844 ../fish/guestfish-actions.pod:1221
23941 #: ../fish/guestfish-actions.pod:4289 ../fish/guestfish-actions.pod:4301
23942 #: ../fish/guestfish-actions.pod:4312 ../fish/guestfish-actions.pod:4323
23943 #: ../fish/guestfish-actions.pod:4375 ../fish/guestfish-actions.pod:4384
23944 #: ../fish/guestfish-actions.pod:4438 ../fish/guestfish-actions.pod:4461
23945 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
23950 #: ../fish/guestfish-actions.pod:425
23956 #: ../fish/guestfish-actions.pod:427
23959 " base64-out filename (base64file|-)\n"
23965 #: ../fish/guestfish-actions.pod:434
23966 msgid "blockdev-flushbufs"
23971 #: ../fish/guestfish-actions.pod:436
23974 " blockdev-flushbufs device\n"
23980 #: ../fish/guestfish-actions.pod:443
23981 msgid "blockdev-getbsz"
23986 #: ../fish/guestfish-actions.pod:445
23989 " blockdev-getbsz device\n"
23995 #: ../fish/guestfish-actions.pod:454
23996 msgid "blockdev-getro"
24001 #: ../fish/guestfish-actions.pod:456
24004 " blockdev-getro device\n"
24010 #: ../fish/guestfish-actions.pod:463
24011 msgid "blockdev-getsize64"
24016 #: ../fish/guestfish-actions.pod:465
24019 " blockdev-getsize64 device\n"
24025 #: ../fish/guestfish-actions.pod:469
24026 msgid "See also L</blockdev-getsz>."
24031 #: ../fish/guestfish-actions.pod:473
24032 msgid "blockdev-getss"
24037 #: ../fish/guestfish-actions.pod:475
24040 " blockdev-getss device\n"
24046 #: ../fish/guestfish-actions.pod:480
24048 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
24053 #: ../fish/guestfish-actions.pod:485
24054 msgid "blockdev-getsz"
24059 #: ../fish/guestfish-actions.pod:487
24062 " blockdev-getsz device\n"
24068 #: ../fish/guestfish-actions.pod:492
24070 "See also L</blockdev-getss> for the real sector size of the device, and L</"
24071 "blockdev-getsize64> for the more useful I<size in bytes>."
24076 #: ../fish/guestfish-actions.pod:498
24077 msgid "blockdev-rereadpt"
24082 #: ../fish/guestfish-actions.pod:500
24085 " blockdev-rereadpt device\n"
24091 #: ../fish/guestfish-actions.pod:506
24092 msgid "blockdev-setbsz"
24097 #: ../fish/guestfish-actions.pod:508
24100 " blockdev-setbsz device blocksize\n"
24106 #: ../fish/guestfish-actions.pod:517
24107 msgid "blockdev-setro"
24112 #: ../fish/guestfish-actions.pod:519
24115 " blockdev-setro device\n"
24121 #: ../fish/guestfish-actions.pod:525
24122 msgid "blockdev-setrw"
24127 #: ../fish/guestfish-actions.pod:527
24130 " blockdev-setrw device\n"
24136 #: ../fish/guestfish-actions.pod:533
24137 msgid "case-sensitive-path"
24142 #: ../fish/guestfish-actions.pod:535
24145 " case-sensitive-path path\n"
24151 #: ../fish/guestfish-actions.pod:559
24153 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
24154 "WINDOWS/system32\"> (the exact return value would depend on details of how "
24155 "the directories were originally created under Windows)."
24160 #: ../fish/guestfish-actions.pod:567
24161 msgid "See also L</realpath>."
24166 #: ../fish/guestfish-actions.pod:569
24172 #: ../fish/guestfish-actions.pod:571
24181 #: ../fish/guestfish-actions.pod:575
24183 "Note that this function cannot correctly handle binary files (specifically, "
24184 "files containing C<\\0> character which is treated as end of string). For "
24185 "those you need to use the L</read-file> or L</download> functions which have "
24186 "a more complex interface."
24191 #: ../fish/guestfish-actions.pod:583
24197 #: ../fish/guestfish-actions.pod:585
24200 " checksum csumtype path\n"
24206 #: ../fish/guestfish-actions.pod:628
24207 msgid "To get the checksum for a device, use L</checksum-device>."
24212 #: ../fish/guestfish-actions.pod:630
24213 msgid "To get the checksums for many files, use L</checksums-out>."
24218 #: ../fish/guestfish-actions.pod:632
24219 msgid "checksum-device"
24224 #: ../fish/guestfish-actions.pod:634
24227 " checksum-device csumtype device\n"
24233 #: ../fish/guestfish-actions.pod:636
24235 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24236 "device named C<device>. For the types of checksums supported see the L</"
24237 "checksum> command."
24242 #: ../fish/guestfish-actions.pod:640
24243 msgid "checksums-out"
24248 #: ../fish/guestfish-actions.pod:642
24251 " checksums-out csumtype directory (sumsfile|-)\n"
24257 #: ../fish/guestfish-actions.pod:658
24263 #: ../fish/guestfish-actions.pod:660
24266 " chmod mode path\n"
24272 #: ../fish/guestfish-actions.pod:671
24278 #: ../fish/guestfish-actions.pod:673
24281 " chown owner group path\n"
24287 #: ../fish/guestfish-actions.pod:681
24293 #: ../fish/guestfish-actions.pod:683
24296 " command 'arguments ...'\n"
24302 #: ../fish/guestfish-actions.pod:690
24304 "The single parameter is an argv-style list of arguments. The first element "
24305 "is the name of the program to run. Subsequent elements are parameters. The "
24306 "list must be non-empty (ie. must contain a program name). Note that the "
24307 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
24312 #: ../fish/guestfish-actions.pod:718
24313 msgid "command-lines"
24318 #: ../fish/guestfish-actions.pod:720
24321 " command-lines 'arguments ...'\n"
24327 #: ../fish/guestfish-actions.pod:722
24329 "This is the same as L</command>, but splits the result into a list of lines."
24334 #: ../fish/guestfish-actions.pod:725
24335 msgid "See also: L</sh-lines>"
24340 #: ../fish/guestfish-actions.pod:730
24346 #: ../fish/guestfish-actions.pod:732
24349 " config qemuparam qemuvalue\n"
24355 #: ../fish/guestfish-actions.pod:743
24361 #: ../fish/guestfish-actions.pod:745
24364 " copy-size src dest size\n"
24370 #: ../fish/guestfish-actions.pod:753
24376 #: ../fish/guestfish-actions.pod:755
24385 #: ../fish/guestfish-actions.pod:760
24391 #: ../fish/guestfish-actions.pod:762
24400 #: ../fish/guestfish-actions.pod:767
24406 #: ../fish/guestfish-actions.pod:769
24415 #: ../fish/guestfish-actions.pod:776
24417 "If the destination is a device, it must be as large or larger than the "
24418 "source file or device, otherwise the copy will fail. This command cannot do "
24419 "partial copies (see L</copy-size>)."
24424 #: ../fish/guestfish-actions.pod:780
24430 #: ../fish/guestfish-actions.pod:782
24439 #: ../fish/guestfish-actions.pod:786 ../fish/guestfish-actions.pod:797
24441 "This command is mostly useful for interactive sessions. It is I<not> "
24442 "intended that you try to parse the output string. Use L</statvfs> from "
24448 #: ../fish/guestfish-actions.pod:790
24454 #: ../fish/guestfish-actions.pod:792
24463 #: ../fish/guestfish-actions.pod:801
24469 #: ../fish/guestfish-actions.pod:803
24478 #: ../fish/guestfish-actions.pod:809
24480 "Another way to get the same information is to enable verbose messages with "
24481 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
24482 "before running the program."
24487 #: ../fish/guestfish-actions.pod:814
24493 #: ../fish/guestfish-actions.pod:816
24496 " download remotefilename (filename|-)\n"
24502 #: ../fish/guestfish-actions.pod:823
24503 msgid "See also L</upload>, L</cat>."
24508 #: ../fish/guestfish-actions.pod:827
24509 msgid "download-offset"
24514 #: ../fish/guestfish-actions.pod:829
24517 " download-offset remotefilename (filename|-) offset size\n"
24523 #: ../fish/guestfish-actions.pod:837
24525 "Note that there is no limit on the amount of data that can be downloaded "
24526 "with this call, unlike with L</pread>, and this call always reads the full "
24527 "amount unless an error occurs."
24532 #: ../fish/guestfish-actions.pod:842
24533 msgid "See also L</download>, L</pread>."
24538 #: ../fish/guestfish-actions.pod:846
24539 msgid "drop-caches"
24544 #: ../fish/guestfish-actions.pod:848
24547 " drop-caches whattodrop\n"
24553 #: ../fish/guestfish-actions.pod:860
24559 #: ../fish/guestfish-actions.pod:862
24568 #: ../fish/guestfish-actions.pod:874
24574 #: ../fish/guestfish-actions.pod:876
24577 " e2fsck-f device\n"
24583 #: ../fish/guestfish-actions.pod:882
24585 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
24586 "should use L</fsck>."
24591 #: ../fish/guestfish-actions.pod:885
24592 msgid "echo-daemon"
24597 #: ../fish/guestfish-actions.pod:887
24600 " echo-daemon 'words ...'\n"
24606 #: ../fish/guestfish-actions.pod:894
24607 msgid "See also L</ping-daemon>."
24612 #: ../fish/guestfish-actions.pod:896
24618 #: ../fish/guestfish-actions.pod:898
24621 " egrep regex path\n"
24627 #: ../fish/guestfish-actions.pod:906
24633 #: ../fish/guestfish-actions.pod:908
24636 " egrepi regex path\n"
24642 #: ../fish/guestfish-actions.pod:916
24648 #: ../fish/guestfish-actions.pod:918
24651 " equal file1 file2\n"
24657 #: ../fish/guestfish-actions.pod:925
24663 #: ../fish/guestfish-actions.pod:927
24672 #: ../fish/guestfish-actions.pod:932
24673 msgid "See also L</is-file>, L</is-dir>, L</stat>."
24678 #: ../fish/guestfish-actions.pod:934
24684 #: ../fish/guestfish-actions.pod:936
24687 " fallocate path len\n"
24693 #: ../fish/guestfish-actions.pod:953
24694 msgid "fallocate64"
24699 #: ../fish/guestfish-actions.pod:955
24702 " fallocate64 path len\n"
24708 #: ../fish/guestfish-actions.pod:961
24710 "Note that this call allocates disk blocks for the file. To create a sparse "
24711 "file use L</truncate-size> instead."
24716 #: ../fish/guestfish-actions.pod:964
24718 "The deprecated call L</fallocate> does the same, but owing to an oversight "
24719 "it only allowed 30 bit lengths to be specified, effectively limiting the "
24720 "maximum size of files created through that call to 1GB."
24725 #: ../fish/guestfish-actions.pod:973
24731 #: ../fish/guestfish-actions.pod:975
24734 " fgrep pattern path\n"
24740 #: ../fish/guestfish-actions.pod:983
24746 #: ../fish/guestfish-actions.pod:985
24749 " fgrepi pattern path\n"
24755 #: ../fish/guestfish-actions.pod:993
24761 #: ../fish/guestfish-actions.pod:995
24770 #: ../fish/guestfish-actions.pod:1007
24772 "This command can also be used on C</dev/> devices (and partitions, LV "
24773 "names). You can for example use this to determine if a device contains a "
24774 "filesystem, although it's usually better to use L</vfs-type>."
24779 #: ../fish/guestfish-actions.pod:1017
24780 msgid "file-architecture"
24785 #: ../fish/guestfish-actions.pod:1019
24788 " file-architecture filename\n"
24794 #: ../fish/guestfish-actions.pod:1122
24800 #: ../fish/guestfish-actions.pod:1124
24809 #: ../fish/guestfish-actions.pod:1128
24811 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
24812 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
24817 #: ../fish/guestfish-actions.pod:1132
24823 #: ../fish/guestfish-actions.pod:1134
24826 " fill c len path\n"
24832 #: ../fish/guestfish-actions.pod:1140
24834 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
24835 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
24836 "L</fill-pattern>."
24841 #: ../fish/guestfish-actions.pod:1145
24842 msgid "fill-pattern"
24847 #: ../fish/guestfish-actions.pod:1147
24850 " fill-pattern pattern len path\n"
24856 #: ../fish/guestfish-actions.pod:1149
24858 "This function is like L</fill> except that it creates a new file of length "
24859 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
24860 "is truncated if necessary to ensure the length of the file is exactly C<len> "
24866 #: ../fish/guestfish-actions.pod:1154
24872 #: ../fish/guestfish-actions.pod:1156
24875 " find directory\n"
24881 #: ../fish/guestfish-actions.pod:1170
24882 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
24887 #: ../fish/guestfish-actions.pod:1183
24888 msgid "See also L</find0>."
24893 #: ../fish/guestfish-actions.pod:1188
24899 #: ../fish/guestfish-actions.pod:1190
24902 " find0 directory (files|-)\n"
24908 #: ../fish/guestfish-actions.pod:1196
24910 "This command works the same way as L</find> with the following exceptions:"
24915 #: ../fish/guestfish-actions.pod:1223
24916 msgid "findfs-label"
24921 #: ../fish/guestfish-actions.pod:1225
24924 " findfs-label label\n"
24930 #: ../fish/guestfish-actions.pod:1231
24931 msgid "To find the label of a filesystem, use L</vfs-label>."
24936 #: ../fish/guestfish-actions.pod:1233
24937 msgid "findfs-uuid"
24942 #: ../fish/guestfish-actions.pod:1235
24945 " findfs-uuid uuid\n"
24951 #: ../fish/guestfish-actions.pod:1241
24952 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
24957 #: ../fish/guestfish-actions.pod:1243
24963 #: ../fish/guestfish-actions.pod:1245
24966 " fsck fstype device\n"
24972 #: ../fish/guestfish-actions.pod:1275
24978 #: ../fish/guestfish-actions.pod:1277
24987 #: ../fish/guestfish-actions.pod:1284
24988 msgid "get-autosync"
24993 #: ../fish/guestfish-actions.pod:1286
25002 #: ../fish/guestfish-actions.pod:1290
25008 #: ../fish/guestfish-actions.pod:1292
25017 #: ../fish/guestfish-actions.pod:1296
25018 msgid "get-e2label"
25023 #: ../fish/guestfish-actions.pod:1298
25026 " get-e2label device\n"
25032 #: ../fish/guestfish-actions.pod:1310
25038 #: ../fish/guestfish-actions.pod:1312
25041 " get-e2uuid device\n"
25047 #: ../fish/guestfish-actions.pod:1324
25048 msgid "get-memsize"
25053 #: ../fish/guestfish-actions.pod:1326
25062 #: ../fish/guestfish-actions.pod:1331
25064 "If L</set-memsize> was not called on this handle, and if "
25065 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25066 "value for memsize."
25071 #: ../fish/guestfish-actions.pod:1338
25072 msgid "get-network"
25077 #: ../fish/guestfish-actions.pod:1340
25086 #: ../fish/guestfish-actions.pod:1344
25092 #: ../fish/guestfish-actions.pod:1346
25101 #: ../fish/guestfish-actions.pod:1353
25107 #: ../fish/guestfish-actions.pod:1355
25113 #: ../fish/guestfish-actions.pod:1357
25122 #: ../fish/guestfish-actions.pod:1364
25128 #: ../fish/guestfish-actions.pod:1366
25137 #: ../fish/guestfish-actions.pod:1373
25138 msgid "get-recovery-proc"
25143 #: ../fish/guestfish-actions.pod:1375
25146 " get-recovery-proc\n"
25152 #: ../fish/guestfish-actions.pod:1379
25153 msgid "get-selinux"
25158 #: ../fish/guestfish-actions.pod:1381
25167 #: ../fish/guestfish-actions.pod:1383
25169 "This returns the current setting of the selinux flag which is passed to the "
25170 "appliance at boot time. See L</set-selinux>."
25175 #: ../fish/guestfish-actions.pod:1389
25181 #: ../fish/guestfish-actions.pod:1391
25190 #: ../fish/guestfish-actions.pod:1398
25196 #: ../fish/guestfish-actions.pod:1400
25205 #: ../fish/guestfish-actions.pod:1404
25211 #: ../fish/guestfish-actions.pod:1406
25220 #: ../fish/guestfish-actions.pod:1408
25222 "Return the current umask. By default the umask is C<022> unless it has been "
25223 "set by calling L</umask>."
25228 #: ../fish/guestfish-actions.pod:1411
25229 msgid "get-verbose"
25234 #: ../fish/guestfish-actions.pod:1413
25243 #: ../fish/guestfish-actions.pod:1417
25249 #: ../fish/guestfish-actions.pod:1419
25258 #: ../fish/guestfish-actions.pod:1423
25259 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
25264 #: ../fish/guestfish-actions.pod:1426
25270 #: ../fish/guestfish-actions.pod:1428
25273 " getxattr path name\n"
25279 #: ../fish/guestfish-actions.pod:1430
25281 "Get a single extended attribute from file C<path> named C<name>. This call "
25282 "follows symlinks. If you want to lookup an extended attribute for the "
25283 "symlink itself, use L</lgetxattr>."
25288 #: ../fish/guestfish-actions.pod:1434 ../fish/guestfish-actions.pod:2340
25290 "Normally it is better to get all extended attributes from a file in one go "
25291 "by calling L</getxattrs>. However some Linux filesystem implementations are "
25292 "buggy and do not provide a way to list out attributes. For these "
25293 "filesystems (notably ntfs-3g) you have to know the names of the extended "
25294 "attributes you want in advance and call this function."
25299 #: ../fish/guestfish-actions.pod:1444
25300 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
25305 #: ../fish/guestfish-actions.pod:1446
25311 #: ../fish/guestfish-actions.pod:1448
25314 " getxattrs path\n"
25320 #: ../fish/guestfish-actions.pod:1456
25321 msgid "See also: L</lgetxattrs>, L<attr(5)>."
25326 #: ../fish/guestfish-actions.pod:1458
25327 msgid "glob-expand"
25332 #: ../fish/guestfish-actions.pod:1460
25335 " glob-expand pattern\n"
25341 #: ../fish/guestfish-actions.pod:1473
25347 #: ../fish/guestfish-actions.pod:1475
25350 " grep regex path\n"
25356 #: ../fish/guestfish-actions.pod:1483
25362 #: ../fish/guestfish-actions.pod:1485
25365 " grepi regex path\n"
25371 #: ../fish/guestfish-actions.pod:1493
25372 msgid "grub-install"
25377 #: ../fish/guestfish-actions.pod:1495
25380 " grub-install root device\n"
25386 #: ../fish/guestfish-actions.pod:1511
25392 #: ../fish/guestfish-actions.pod:1513
25401 #: ../fish/guestfish-actions.pod:1521
25407 #: ../fish/guestfish-actions.pod:1523
25410 " head-n nrlines path\n"
25416 #: ../fish/guestfish-actions.pod:1536
25422 #: ../fish/guestfish-actions.pod:1538
25431 #: ../fish/guestfish-actions.pod:1546
25437 #: ../fish/guestfish-actions.pod:1548
25440 " initrd-cat initrdpath filename\n"
25446 #: ../fish/guestfish-actions.pod:1560
25447 msgid "See also L</initrd-list>."
25452 #: ../fish/guestfish-actions.pod:1565
25453 msgid "initrd-list"
25458 #: ../fish/guestfish-actions.pod:1567
25461 " initrd-list path\n"
25467 #: ../fish/guestfish-actions.pod:1579
25468 msgid "inotify-add-watch"
25473 #: ../fish/guestfish-actions.pod:1581
25476 " inotify-add-watch path mask\n"
25482 #: ../fish/guestfish-actions.pod:1593
25483 msgid "inotify-close"
25488 #: ../fish/guestfish-actions.pod:1595
25497 #: ../fish/guestfish-actions.pod:1601
25498 msgid "inotify-files"
25503 #: ../fish/guestfish-actions.pod:1603
25512 #: ../fish/guestfish-actions.pod:1605
25514 "This function is a helpful wrapper around L</inotify-read> which just "
25515 "returns a list of pathnames of objects that were touched. The returned "
25516 "pathnames are sorted and deduplicated."
25521 #: ../fish/guestfish-actions.pod:1609
25522 msgid "inotify-init"
25527 #: ../fish/guestfish-actions.pod:1611
25530 " inotify-init maxevents\n"
25536 #: ../fish/guestfish-actions.pod:1617
25538 "C<maxevents> is the maximum number of events which will be queued up between "
25539 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
25540 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
25541 "default was 16384 events. Beyond this limit, the kernel throws away events, "
25542 "but records the fact that it threw them away by setting a flag "
25543 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
25548 #: ../fish/guestfish-actions.pod:1627
25550 "Before any events are generated, you have to add some watches to the "
25551 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
25552 "L</inotify-watch-all>."
25557 #: ../fish/guestfish-actions.pod:1633
25559 "Queued up events should be read periodically by calling L</inotify-read> (or "
25560 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
25561 "If you don't read the events out often enough then you risk the internal "
25562 "queue overflowing."
25567 #: ../fish/guestfish-actions.pod:1640
25569 "The handle should be closed after use by calling L</inotify-close>. This "
25570 "also removes any watches automatically."
25575 #: ../fish/guestfish-actions.pod:1649
25576 msgid "inotify-read"
25581 #: ../fish/guestfish-actions.pod:1651
25590 #: ../fish/guestfish-actions.pod:1664
25591 msgid "inotify-rm-watch"
25596 #: ../fish/guestfish-actions.pod:1666
25599 " inotify-rm-watch wd\n"
25605 #: ../fish/guestfish-actions.pod:1668
25606 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
25611 #: ../fish/guestfish-actions.pod:1671
25612 msgid "inspect-get-arch"
25617 #: ../fish/guestfish-actions.pod:1673
25620 " inspect-get-arch root\n"
25626 #: ../fish/guestfish-actions.pod:1675 ../fish/guestfish-actions.pod:1691
25627 #: ../fish/guestfish-actions.pod:1765 ../fish/guestfish-actions.pod:1783
25628 #: ../fish/guestfish-actions.pod:1817 ../fish/guestfish-actions.pod:1832
25629 #: ../fish/guestfish-actions.pod:1853 ../fish/guestfish-actions.pod:1868
25630 #: ../fish/guestfish-actions.pod:1895 ../fish/guestfish-actions.pod:1917
25631 #: ../fish/guestfish-actions.pod:1941 ../fish/guestfish-actions.pod:1971
25632 #: ../fish/guestfish-actions.pod:2006 ../fish/guestfish-actions.pod:2022
25633 #: ../fish/guestfish-actions.pod:2035 ../fish/guestfish-actions.pod:2048
25634 #: ../fish/guestfish-actions.pod:2063
25636 "This function should only be called with a root device string as returned by "
25642 #: ../fish/guestfish-actions.pod:1678
25644 "This returns the architecture of the inspected operating system. The "
25645 "possible return values are listed under L</file-architecture>."
25650 #: ../fish/guestfish-actions.pod:1687
25651 msgid "inspect-get-distro"
25656 #: ../fish/guestfish-actions.pod:1689
25659 " inspect-get-distro root\n"
25665 #: ../fish/guestfish-actions.pod:1761
25666 msgid "inspect-get-filesystems"
25671 #: ../fish/guestfish-actions.pod:1763
25674 " inspect-get-filesystems root\n"
25680 #: ../fish/guestfish-actions.pod:1776
25682 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25683 "get-mountpoints>."
25687 #: ../fish/guestfish-actions.pod:1779
25688 msgid "inspect-get-format"
25692 #: ../fish/guestfish-actions.pod:1781
25695 " inspect-get-format root\n"
25701 #: ../fish/guestfish-actions.pod:1813
25702 msgid "inspect-get-hostname"
25707 #: ../fish/guestfish-actions.pod:1815
25710 " inspect-get-hostname root\n"
25716 #: ../fish/guestfish-actions.pod:1828
25717 msgid "inspect-get-major-version"
25722 #: ../fish/guestfish-actions.pod:1830
25725 " inspect-get-major-version root\n"
25731 #: ../fish/guestfish-actions.pod:1849
25732 msgid "inspect-get-minor-version"
25737 #: ../fish/guestfish-actions.pod:1851
25740 " inspect-get-minor-version root\n"
25746 #: ../fish/guestfish-actions.pod:1861
25748 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25749 "get-major-version>."
25754 #: ../fish/guestfish-actions.pod:1864
25755 msgid "inspect-get-mountpoints"
25760 #: ../fish/guestfish-actions.pod:1866
25763 " inspect-get-mountpoints root\n"
25769 #: ../fish/guestfish-actions.pod:1888
25771 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
25772 "get-filesystems>."
25777 #: ../fish/guestfish-actions.pod:1891
25778 msgid "inspect-get-package-format"
25783 #: ../fish/guestfish-actions.pod:1893
25786 " inspect-get-package-format root\n"
25792 #: ../fish/guestfish-actions.pod:1898
25794 "This function and L</inspect-get-package-management> return the package "
25795 "format and package management tool used by the inspected operating system. "
25796 "For example for Fedora these functions would return C<rpm> (package format) "
25797 "and C<yum> (package management)."
25802 #: ../fish/guestfish-actions.pod:1913
25803 msgid "inspect-get-package-management"
25808 #: ../fish/guestfish-actions.pod:1915
25811 " inspect-get-package-management root\n"
25817 #: ../fish/guestfish-actions.pod:1920
25819 "L</inspect-get-package-format> and this function return the package format "
25820 "and package management tool used by the inspected operating system. For "
25821 "example for Fedora these functions would return C<rpm> (package format) and "
25822 "C<yum> (package management)."
25827 #: ../fish/guestfish-actions.pod:1937
25828 msgid "inspect-get-product-name"
25833 #: ../fish/guestfish-actions.pod:1939
25836 " inspect-get-product-name root\n"
25842 #: ../fish/guestfish-actions.pod:1954
25843 msgid "inspect-get-roots"
25848 #: ../fish/guestfish-actions.pod:1956
25851 " inspect-get-roots\n"
25857 #: ../fish/guestfish-actions.pod:1958
25859 "This function is a convenient way to get the list of root devices, as "
25860 "returned from a previous call to L</inspect-os>, but without redoing the "
25861 "whole inspection process."
25866 #: ../fish/guestfish-actions.pod:1962
25868 "This returns an empty list if either no root devices were found or the "
25869 "caller has not called L</inspect-os>."
25874 #: ../fish/guestfish-actions.pod:1967
25875 msgid "inspect-get-type"
25880 #: ../fish/guestfish-actions.pod:1969
25883 " inspect-get-type root\n"
25889 #: ../fish/guestfish-actions.pod:2002
25890 msgid "inspect-get-windows-systemroot"
25895 #: ../fish/guestfish-actions.pod:2004
25898 " inspect-get-windows-systemroot root\n"
25903 #: ../fish/guestfish-actions.pod:2018
25904 msgid "inspect-is-live"
25908 #: ../fish/guestfish-actions.pod:2020
25911 " inspect-is-live root\n"
25916 #: ../fish/guestfish-actions.pod:2025
25918 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
25919 "then this returns true if a live image was detected on the disk."
25923 #: ../fish/guestfish-actions.pod:2031
25924 msgid "inspect-is-multipart"
25928 #: ../fish/guestfish-actions.pod:2033
25931 " inspect-is-multipart root\n"
25936 #: ../fish/guestfish-actions.pod:2038
25938 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
25939 "then this returns true if the disk is part of a set."
25943 #: ../fish/guestfish-actions.pod:2044
25944 msgid "inspect-is-netinst"
25948 #: ../fish/guestfish-actions.pod:2046
25951 " inspect-is-netinst root\n"
25956 #: ../fish/guestfish-actions.pod:2051
25958 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
25959 "then this returns true if the disk is a network installer, ie. not a self-"
25960 "contained install CD but one which is likely to require network access to "
25961 "complete the install."
25966 #: ../fish/guestfish-actions.pod:2059
25967 msgid "inspect-list-applications"
25972 #: ../fish/guestfish-actions.pod:2061
25975 " inspect-list-applications root\n"
25981 #: ../fish/guestfish-actions.pod:2068
25983 "I<Note:> This call works differently from other parts of the inspection "
25984 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
25985 "then mount up the disks, before calling this. Listing applications is a "
25986 "significantly more difficult operation which requires access to the full "
25987 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
25988 "are just returning data cached in the libguestfs handle, this call actually "
25989 "reads parts of the mounted filesystems during the call."
25994 #: ../fish/guestfish-actions.pod:2158
26000 #: ../fish/guestfish-actions.pod:2160
26009 #: ../fish/guestfish-actions.pod:2175
26011 "You can pass the root string(s) returned to other L</inspect-get-*> "
26012 "functions in order to query further information about each operating system, "
26013 "such as the name and version."
26018 #: ../fish/guestfish-actions.pod:2180
26020 "This function uses other libguestfs features such as L</mount-ro> and L</"
26021 "umount-all> in order to mount and unmount filesystems and look at the "
26022 "contents. This should be called with no disks currently mounted. The "
26023 "function may also use Augeas, so any existing Augeas handle will be closed."
26028 #: ../fish/guestfish-actions.pod:2192 ../fish/guestfish-actions.pod:2368
26029 #: ../fish/guestfish-actions.pod:2414
26030 msgid "See also L</list-filesystems>."
26035 #: ../fish/guestfish-actions.pod:2194
26036 msgid "is-blockdev"
26041 #: ../fish/guestfish-actions.pod:2196
26044 " is-blockdev path\n"
26050 #: ../fish/guestfish-actions.pod:2201 ../fish/guestfish-actions.pod:2219
26051 #: ../fish/guestfish-actions.pod:2238 ../fish/guestfish-actions.pod:2247
26052 #: ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2291
26053 #: ../fish/guestfish-actions.pod:2300
26054 msgid "See also L</stat>."
26059 #: ../fish/guestfish-actions.pod:2203
26065 #: ../fish/guestfish-actions.pod:2205
26074 #: ../fish/guestfish-actions.pod:2212
26080 #: ../fish/guestfish-actions.pod:2214
26083 " is-chardev path\n"
26089 #: ../fish/guestfish-actions.pod:2221
26095 #: ../fish/guestfish-actions.pod:2223
26104 #: ../fish/guestfish-actions.pod:2230
26110 #: ../fish/guestfish-actions.pod:2232
26119 #: ../fish/guestfish-actions.pod:2240
26125 #: ../fish/guestfish-actions.pod:2242
26134 #: ../fish/guestfish-actions.pod:2249
26140 #: ../fish/guestfish-actions.pod:2251
26149 #: ../fish/guestfish-actions.pod:2259
26150 msgid "is-launching"
26155 #: ../fish/guestfish-actions.pod:2261
26164 #: ../fish/guestfish-actions.pod:2268
26170 #: ../fish/guestfish-actions.pod:2270
26179 #: ../fish/guestfish-actions.pod:2275
26185 #: ../fish/guestfish-actions.pod:2277
26194 #: ../fish/guestfish-actions.pod:2284
26200 #: ../fish/guestfish-actions.pod:2286
26203 " is-socket path\n"
26209 #: ../fish/guestfish-actions.pod:2293
26215 #: ../fish/guestfish-actions.pod:2295
26218 " is-symlink path\n"
26224 #: ../fish/guestfish-actions.pod:2302
26225 msgid "kill-subprocess"
26230 #: ../fish/guestfish-actions.pod:2304
26233 " kill-subprocess\n"
26239 #: ../fish/guestfish-actions.pod:2308
26245 #: ../fish/guestfish-actions.pod:2310
26251 #: ../fish/guestfish-actions.pod:2312
26260 #: ../fish/guestfish-actions.pod:2320
26266 #: ../fish/guestfish-actions.pod:2322
26269 " lchown owner group path\n"
26275 #: ../fish/guestfish-actions.pod:2324
26277 "Change the file owner to C<owner> and group to C<group>. This is like L</"
26278 "chown> but if C<path> is a symlink then the link itself is changed, not the "
26284 #: ../fish/guestfish-actions.pod:2332
26290 #: ../fish/guestfish-actions.pod:2334
26293 " lgetxattr path name\n"
26299 #: ../fish/guestfish-actions.pod:2350
26300 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
26305 #: ../fish/guestfish-actions.pod:2352
26311 #: ../fish/guestfish-actions.pod:2354
26314 " lgetxattrs path\n"
26320 #: ../fish/guestfish-actions.pod:2356
26322 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
26323 "it returns the extended attributes of the link itself."
26328 #: ../fish/guestfish-actions.pod:2360
26329 msgid "list-devices"
26334 #: ../fish/guestfish-actions.pod:2362
26343 #: ../fish/guestfish-actions.pod:2370
26344 msgid "list-filesystems"
26349 #: ../fish/guestfish-actions.pod:2372
26352 " list-filesystems\n"
26358 #: ../fish/guestfish-actions.pod:2391
26360 "This command runs other libguestfs commands, which might include L</mount> "
26361 "and L</umount>, and therefore you should use this soon after launch and only "
26362 "when nothing is mounted."
26367 #: ../fish/guestfish-actions.pod:2395
26369 "Not all of the filesystems returned will be mountable. In particular, swap "
26370 "partitions are returned in the list. Also this command does not check that "
26371 "each filesystem found is valid and mountable, and some filesystems might be "
26372 "mountable but require special options. Filesystems may not all belong to a "
26373 "single logical operating system (use L</inspect-os> to look for OSes)."
26378 #: ../fish/guestfish-actions.pod:2403
26379 msgid "list-partitions"
26384 #: ../fish/guestfish-actions.pod:2405
26387 " list-partitions\n"
26393 #: ../fish/guestfish-actions.pod:2411
26395 "This does not return logical volumes. For that you will need to call L</"
26401 #: ../fish/guestfish-actions.pod:2416
26407 #: ../fish/guestfish-actions.pod:2418
26416 #: ../fish/guestfish-actions.pod:2426
26422 #: ../fish/guestfish-actions.pod:2428
26425 " ln target linkname\n"
26431 #: ../fish/guestfish-actions.pod:2432
26437 #: ../fish/guestfish-actions.pod:2434
26440 " ln-f target linkname\n"
26446 #: ../fish/guestfish-actions.pod:2439
26452 #: ../fish/guestfish-actions.pod:2441
26455 " ln-s target linkname\n"
26461 #: ../fish/guestfish-actions.pod:2445
26467 #: ../fish/guestfish-actions.pod:2447
26470 " ln-sf target linkname\n"
26476 #: ../fish/guestfish-actions.pod:2452
26477 msgid "lremovexattr"
26482 #: ../fish/guestfish-actions.pod:2454
26485 " lremovexattr xattr path\n"
26491 #: ../fish/guestfish-actions.pod:2456
26493 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
26494 "it removes an extended attribute of the link itself."
26499 #: ../fish/guestfish-actions.pod:2460
26505 #: ../fish/guestfish-actions.pod:2462
26514 #: ../fish/guestfish-actions.pod:2468
26516 "This command is mostly useful for interactive sessions. Programs should "
26517 "probably use L</readdir> instead."
26522 #: ../fish/guestfish-actions.pod:2471
26528 #: ../fish/guestfish-actions.pod:2473
26531 " lsetxattr xattr val vallen path\n"
26537 #: ../fish/guestfish-actions.pod:2475
26539 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
26540 "sets an extended attribute of the link itself."
26545 #: ../fish/guestfish-actions.pod:2479
26551 #: ../fish/guestfish-actions.pod:2481
26560 #: ../fish/guestfish-actions.pod:2485
26562 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
26563 "the link is stat-ed, not the file it refers to."
26568 #: ../fish/guestfish-actions.pod:2491
26574 #: ../fish/guestfish-actions.pod:2493
26577 " lstatlist path 'names ...'\n"
26583 #: ../fish/guestfish-actions.pod:2495
26585 "This call allows you to perform the L</lstat> operation on multiple files, "
26586 "where all files are in the directory C<path>. C<names> is the list of files "
26587 "from this directory."
26592 #: ../fish/guestfish-actions.pod:2504
26594 "This call is intended for programs that want to efficiently list a directory "
26595 "contents without making many round-trips. See also L</lxattrlist> for a "
26596 "similarly efficient call for getting extended attributes. Very long "
26597 "directory listings might cause the protocol message size to be exceeded, "
26598 "causing this call to fail. The caller must split up such requests into "
26599 "smaller groups of names."
26604 #: ../fish/guestfish-actions.pod:2512
26605 msgid "luks-add-key"
26610 #: ../fish/guestfish-actions.pod:2514
26613 " luks-add-key device keyslot\n"
26619 #: ../fish/guestfish-actions.pod:2521
26621 "Note that if C<keyslot> already contains a key, then this command will "
26622 "fail. You have to use L</luks-kill-slot> first to remove that key."
26627 #: ../fish/guestfish-actions.pod:2525 ../fish/guestfish-actions.pod:2547
26628 #: ../fish/guestfish-actions.pod:2560 ../fish/guestfish-actions.pod:2574
26629 #: ../fish/guestfish-actions.pod:2597 ../fish/guestfish-actions.pod:2607
26631 "This command has one or more key or passphrase parameters. Guestfish will "
26632 "prompt for these separately."
26637 #: ../fish/guestfish-actions.pod:2528
26643 #: ../fish/guestfish-actions.pod:2530
26646 " luks-close device\n"
26652 #: ../fish/guestfish-actions.pod:2532
26654 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
26655 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
26656 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
26662 #: ../fish/guestfish-actions.pod:2538
26663 msgid "luks-format"
26668 #: ../fish/guestfish-actions.pod:2540
26671 " luks-format device keyslot\n"
26677 #: ../fish/guestfish-actions.pod:2553
26678 msgid "luks-format-cipher"
26683 #: ../fish/guestfish-actions.pod:2555
26686 " luks-format-cipher device keyslot cipher\n"
26692 #: ../fish/guestfish-actions.pod:2557
26694 "This command is the same as L</luks-format> but it also allows you to set "
26695 "the C<cipher> used."
26700 #: ../fish/guestfish-actions.pod:2566
26701 msgid "luks-kill-slot"
26706 #: ../fish/guestfish-actions.pod:2568
26709 " luks-kill-slot device keyslot\n"
26715 #: ../fish/guestfish-actions.pod:2577
26721 #: ../fish/guestfish-actions.pod:2579
26724 " luks-open device mapname\n"
26730 #: ../fish/guestfish-actions.pod:2593
26732 "If this block device contains LVM volume groups, then calling L</vgscan> "
26733 "followed by L</vg-activate-all> will make them visible."
26738 #: ../fish/guestfish-actions.pod:2600
26739 msgid "luks-open-ro"
26744 #: ../fish/guestfish-actions.pod:2602
26747 " luks-open-ro device mapname\n"
26753 #: ../fish/guestfish-actions.pod:2604
26755 "This is the same as L</luks-open> except that a read-only mapping is created."
26760 #: ../fish/guestfish-actions.pod:2610
26766 #: ../fish/guestfish-actions.pod:2612
26769 " lvcreate logvol volgroup mbytes\n"
26775 #: ../fish/guestfish-actions.pod:2617
26776 msgid "lvm-canonical-lv-name"
26781 #: ../fish/guestfish-actions.pod:2619
26784 " lvm-canonical-lv-name lvname\n"
26790 #: ../fish/guestfish-actions.pod:2628
26791 msgid "See also L</is-lv>."
26796 #: ../fish/guestfish-actions.pod:2630
26797 msgid "lvm-clear-filter"
26802 #: ../fish/guestfish-actions.pod:2632
26805 " lvm-clear-filter\n"
26811 #: ../fish/guestfish-actions.pod:2634
26813 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
26819 #: ../fish/guestfish-actions.pod:2640
26820 msgid "lvm-remove-all"
26825 #: ../fish/guestfish-actions.pod:2642
26828 " lvm-remove-all\n"
26834 #: ../fish/guestfish-actions.pod:2650
26835 msgid "lvm-set-filter"
26840 #: ../fish/guestfish-actions.pod:2652
26843 " lvm-set-filter 'devices ...'\n"
26849 #: ../fish/guestfish-actions.pod:2677
26855 #: ../fish/guestfish-actions.pod:2679
26858 " lvremove device\n"
26864 #: ../fish/guestfish-actions.pod:2687
26870 #: ../fish/guestfish-actions.pod:2689
26873 " lvrename logvol newlogvol\n"
26879 #: ../fish/guestfish-actions.pod:2693
26885 #: ../fish/guestfish-actions.pod:2695
26888 " lvresize device mbytes\n"
26894 #: ../fish/guestfish-actions.pod:2701
26895 msgid "lvresize-free"
26900 #: ../fish/guestfish-actions.pod:2703
26903 " lvresize-free lv percent\n"
26909 #: ../fish/guestfish-actions.pod:2711
26915 #: ../fish/guestfish-actions.pod:2713
26924 #: ../fish/guestfish-actions.pod:2721
26925 msgid "See also L</lvs-full>, L</list-filesystems>."
26930 #: ../fish/guestfish-actions.pod:2723
26936 #: ../fish/guestfish-actions.pod:2725
26945 #: ../fish/guestfish-actions.pod:2730
26951 #: ../fish/guestfish-actions.pod:2732
26960 #: ../fish/guestfish-actions.pod:2736
26966 #: ../fish/guestfish-actions.pod:2738
26969 " lxattrlist path 'names ...'\n"
26975 #: ../fish/guestfish-actions.pod:2754
26977 "This call is intended for programs that want to efficiently list a directory "
26978 "contents without making many round-trips. See also L</lstatlist> for a "
26979 "similarly efficient call for getting standard stats. Very long directory "
26980 "listings might cause the protocol message size to be exceeded, causing this "
26981 "call to fail. The caller must split up such requests into smaller groups of "
26987 #: ../fish/guestfish-actions.pod:2762
26993 #: ../fish/guestfish-actions.pod:2764
27002 #: ../fish/guestfish-actions.pod:2768
27008 #: ../fish/guestfish-actions.pod:2770
27011 " mkdir-mode path mode\n"
27017 #: ../fish/guestfish-actions.pod:2779
27018 msgid "See also L</mkdir>, L</umask>"
27023 #: ../fish/guestfish-actions.pod:2781
27029 #: ../fish/guestfish-actions.pod:2783
27038 #: ../fish/guestfish-actions.pod:2788
27044 #: ../fish/guestfish-actions.pod:2790
27047 " mkdtemp template\n"
27053 #: ../fish/guestfish-actions.pod:2811
27059 #: ../fish/guestfish-actions.pod:2813
27062 " mke2fs-J fstype blocksize device journal\n"
27068 #: ../fish/guestfish-actions.pod:2821
27069 msgid "See also L</mke2journal>."
27074 #: ../fish/guestfish-actions.pod:2823
27080 #: ../fish/guestfish-actions.pod:2825
27083 " mke2fs-JL fstype blocksize device label\n"
27089 #: ../fish/guestfish-actions.pod:2830
27090 msgid "See also L</mke2journal-L>."
27095 #: ../fish/guestfish-actions.pod:2832
27101 #: ../fish/guestfish-actions.pod:2834
27104 " mke2fs-JU fstype blocksize device uuid\n"
27110 #: ../fish/guestfish-actions.pod:2839
27111 msgid "See also L</mke2journal-U>."
27116 #: ../fish/guestfish-actions.pod:2841
27117 msgid "mke2journal"
27122 #: ../fish/guestfish-actions.pod:2843
27125 " mke2journal blocksize device\n"
27131 #: ../fish/guestfish-actions.pod:2850
27132 msgid "mke2journal-L"
27137 #: ../fish/guestfish-actions.pod:2852
27140 " mke2journal-L blocksize label device\n"
27146 #: ../fish/guestfish-actions.pod:2856
27147 msgid "mke2journal-U"
27152 #: ../fish/guestfish-actions.pod:2858
27155 " mke2journal-U blocksize uuid device\n"
27161 #: ../fish/guestfish-actions.pod:2862
27167 #: ../fish/guestfish-actions.pod:2864
27170 " mkfifo mode path\n"
27176 #: ../fish/guestfish-actions.pod:2866
27178 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
27179 "is just a convenient wrapper around L</mknod>."
27184 #: ../fish/guestfish-actions.pod:2872
27190 #: ../fish/guestfish-actions.pod:2874
27193 " mkfs fstype device\n"
27199 #: ../fish/guestfish-actions.pod:2880
27205 #: ../fish/guestfish-actions.pod:2882
27208 " mkfs-b fstype blocksize device\n"
27214 #: ../fish/guestfish-actions.pod:2884
27216 "This call is similar to L</mkfs>, but it allows you to control the block "
27217 "size of the resulting filesystem. Supported block sizes depend on the "
27218 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
27223 #: ../fish/guestfish-actions.pod:2899
27229 #: ../fish/guestfish-actions.pod:2901
27232 " mkfs-opts fstype device [blocksize:..]\n"
27238 #: ../fish/guestfish-actions.pod:2923
27239 msgid "mkmountpoint"
27244 #: ../fish/guestfish-actions.pod:2925
27247 " mkmountpoint exemptpath\n"
27253 #: ../fish/guestfish-actions.pod:2927
27255 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
27256 "to create extra mountpoints before mounting the first filesystem."
27261 #: ../fish/guestfish-actions.pod:2951
27263 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
27264 "unexpected errors if you try to mix these calls. It is safest to manually "
27265 "unmount filesystems and remove mountpoints after use."
27270 #: ../fish/guestfish-actions.pod:2955
27272 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
27273 "for this to work for manual mountpoints, you must ensure that the innermost "
27274 "mountpoints have the longest pathnames, as in the example code above."
27279 #: ../fish/guestfish-actions.pod:2962
27281 "Autosync [see L</set-autosync>, this is set by default on handles] means "
27282 "that L</umount-all> is called when the handle is closed which can also "
27283 "trigger these issues."
27288 #: ../fish/guestfish-actions.pod:2966
27294 #: ../fish/guestfish-actions.pod:2968
27297 " mknod mode devmajor devminor path\n"
27303 #: ../fish/guestfish-actions.pod:2978
27305 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
27306 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
27307 "regular file). These constants are available in the standard Linux header "
27308 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
27309 "wrappers around this command which bitwise OR in the appropriate constant "
27315 #: ../fish/guestfish-actions.pod:2988
27321 #: ../fish/guestfish-actions.pod:2990
27324 " mknod-b mode devmajor devminor path\n"
27330 #: ../fish/guestfish-actions.pod:2992
27332 "This call creates a block device node called C<path> with mode C<mode> and "
27333 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27334 "wrapper around L</mknod>."
27339 #: ../fish/guestfish-actions.pod:2998
27345 #: ../fish/guestfish-actions.pod:3000
27348 " mknod-c mode devmajor devminor path\n"
27354 #: ../fish/guestfish-actions.pod:3002
27356 "This call creates a char device node called C<path> with mode C<mode> and "
27357 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
27358 "wrapper around L</mknod>."
27363 #: ../fish/guestfish-actions.pod:3008
27369 #: ../fish/guestfish-actions.pod:3010
27378 #: ../fish/guestfish-actions.pod:3014
27384 #: ../fish/guestfish-actions.pod:3016
27387 " mkswap-L label device\n"
27393 #: ../fish/guestfish-actions.pod:3024
27399 #: ../fish/guestfish-actions.pod:3026
27402 " mkswap-U uuid device\n"
27408 #: ../fish/guestfish-actions.pod:3030
27409 msgid "mkswap-file"
27414 #: ../fish/guestfish-actions.pod:3032
27417 " mkswap-file path\n"
27423 #: ../fish/guestfish-actions.pod:3036
27425 "This command just writes a swap file signature to an existing file. To "
27426 "create the file itself, use something like L</fallocate>."
27431 #: ../fish/guestfish-actions.pod:3039
27437 #: ../fish/guestfish-actions.pod:3041
27440 " modprobe modulename\n"
27446 #: ../fish/guestfish-actions.pod:3048
27452 #: ../fish/guestfish-actions.pod:3050
27455 " mount device mountpoint\n"
27461 #: ../fish/guestfish-actions.pod:3066
27463 "B<Important note:> When you use this call, the filesystem options C<sync> "
27464 "and C<noatime> are set implicitly. This was originally done because we "
27465 "thought it would improve reliability, but it turns out that I<-o sync> has a "
27466 "very large negative performance impact and negligible effect on "
27467 "reliability. Therefore we recommend that you avoid using L</mount> in any "
27468 "code that needs performance, and instead use L</mount-options> (use an empty "
27469 "string for the first parameter if you don't want any options)."
27474 #: ../fish/guestfish-actions.pod:3076
27480 #: ../fish/guestfish-actions.pod:3078
27483 " mount-loop file mountpoint\n"
27489 #: ../fish/guestfish-actions.pod:3084
27490 msgid "mount-options"
27495 #: ../fish/guestfish-actions.pod:3086
27498 " mount-options options device mountpoint\n"
27504 #: ../fish/guestfish-actions.pod:3088
27506 "This is the same as the L</mount> command, but it allows you to set the "
27507 "mount options as for the L<mount(8)> I<-o> flag."
27512 #: ../fish/guestfish-actions.pod:3096
27518 #: ../fish/guestfish-actions.pod:3098
27521 " mount-ro device mountpoint\n"
27527 #: ../fish/guestfish-actions.pod:3100
27529 "This is the same as the L</mount> command, but it mounts the filesystem with "
27530 "the read-only (I<-o ro>) flag."
27535 #: ../fish/guestfish-actions.pod:3103
27541 #: ../fish/guestfish-actions.pod:3105
27544 " mount-vfs options vfstype device mountpoint\n"
27550 #: ../fish/guestfish-actions.pod:3107
27552 "This is the same as the L</mount> command, but it allows you to set both the "
27553 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
27558 #: ../fish/guestfish-actions.pod:3111
27559 msgid "mountpoints"
27564 #: ../fish/guestfish-actions.pod:3113
27573 #: ../fish/guestfish-actions.pod:3115
27575 "This call is similar to L</mounts>. That call returns a list of devices. "
27576 "This one returns a hash table (map) of device name to directory where the "
27577 "device is mounted."
27582 #: ../fish/guestfish-actions.pod:3119
27588 #: ../fish/guestfish-actions.pod:3121
27597 #: ../fish/guestfish-actions.pod:3128
27598 msgid "See also: L</mountpoints>"
27603 #: ../fish/guestfish-actions.pod:3130
27609 #: ../fish/guestfish-actions.pod:3132
27618 #: ../fish/guestfish-actions.pod:3137
27619 msgid "ntfs-3g-probe"
27624 #: ../fish/guestfish-actions.pod:3139
27627 " ntfs-3g-probe true|false device\n"
27633 #: ../fish/guestfish-actions.pod:3153
27639 #: ../fish/guestfish-actions.pod:3155
27642 " ntfsresize device\n"
27648 #: ../fish/guestfish-actions.pod:3161
27649 msgid "ntfsresize-size"
27654 #: ../fish/guestfish-actions.pod:3163
27657 " ntfsresize-size device size\n"
27663 #: ../fish/guestfish-actions.pod:3165
27665 "This command is the same as L</ntfsresize> except that it allows you to "
27666 "specify the new size (in bytes) explicitly."
27671 #: ../fish/guestfish-actions.pod:3168
27677 #: ../fish/guestfish-actions.pod:3170
27680 " part-add device prlogex startsect endsect\n"
27686 #: ../fish/guestfish-actions.pod:3172
27688 "This command adds a partition to C<device>. If there is no partition table "
27689 "on the device, call L</part-init> first."
27694 #: ../fish/guestfish-actions.pod:3184
27696 "Creating a partition which covers the whole disk is not so easy. Use L</"
27697 "part-disk> to do that."
27702 #: ../fish/guestfish-actions.pod:3187
27708 #: ../fish/guestfish-actions.pod:3189
27711 " part-del device partnum\n"
27717 #: ../fish/guestfish-actions.pod:3197
27723 #: ../fish/guestfish-actions.pod:3199
27726 " part-disk device parttype\n"
27732 #: ../fish/guestfish-actions.pod:3201
27734 "This command is simply a combination of L</part-init> followed by L</part-"
27735 "add> to create a single primary partition covering the whole disk."
27740 #: ../fish/guestfish-actions.pod:3205
27742 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
27743 "possible values are described in L</part-init>."
27748 #: ../fish/guestfish-actions.pod:3211
27749 msgid "part-get-bootable"
27754 #: ../fish/guestfish-actions.pod:3213
27757 " part-get-bootable device partnum\n"
27763 #: ../fish/guestfish-actions.pod:3218
27764 msgid "See also L</part-set-bootable>."
27769 #: ../fish/guestfish-actions.pod:3220
27770 msgid "part-get-mbr-id"
27775 #: ../fish/guestfish-actions.pod:3222
27778 " part-get-mbr-id device partnum\n"
27784 #: ../fish/guestfish-actions.pod:3227 ../fish/guestfish-actions.pod:3365
27786 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
27787 "undefined results for other partition table types (see L</part-get-"
27793 #: ../fish/guestfish-actions.pod:3231
27794 msgid "part-get-parttype"
27799 #: ../fish/guestfish-actions.pod:3233
27802 " part-get-parttype device\n"
27808 #: ../fish/guestfish-actions.pod:3238
27810 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
27811 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
27812 "possible, although unusual. See L</part-init> for a full list."
27817 #: ../fish/guestfish-actions.pod:3243
27823 #: ../fish/guestfish-actions.pod:3245
27826 " part-init device parttype\n"
27832 #: ../fish/guestfish-actions.pod:3251
27834 "Initially there are no partitions. Following this, you should call L</part-"
27835 "add> for each partition required."
27840 #: ../fish/guestfish-actions.pod:3314
27846 #: ../fish/guestfish-actions.pod:3316
27849 " part-list device\n"
27855 #: ../fish/guestfish-actions.pod:3331
27857 "Start of the partition I<in bytes>. To get sectors you have to divide by "
27858 "the device's sector size, see L</blockdev-getss>."
27863 #: ../fish/guestfish-actions.pod:3344
27864 msgid "part-set-bootable"
27869 #: ../fish/guestfish-actions.pod:3346
27872 " part-set-bootable device partnum true|false\n"
27878 #: ../fish/guestfish-actions.pod:3355
27879 msgid "part-set-mbr-id"
27884 #: ../fish/guestfish-actions.pod:3357
27887 " part-set-mbr-id device partnum idbyte\n"
27893 #: ../fish/guestfish-actions.pod:3369
27894 msgid "part-set-name"
27899 #: ../fish/guestfish-actions.pod:3371
27902 " part-set-name device partnum name\n"
27908 #: ../fish/guestfish-actions.pod:3379
27909 msgid "part-to-dev"
27914 #: ../fish/guestfish-actions.pod:3381
27917 " part-to-dev partition\n"
27923 #: ../fish/guestfish-actions.pod:3387
27925 "The named partition must exist, for example as a string returned from L</"
27926 "list-partitions>."
27931 #: ../fish/guestfish-actions.pod:3390
27932 msgid "ping-daemon"
27937 #: ../fish/guestfish-actions.pod:3392
27946 #: ../fish/guestfish-actions.pod:3399
27952 #: ../fish/guestfish-actions.pod:3401
27955 " pread path count offset\n"
27961 #: ../fish/guestfish-actions.pod:3409
27962 msgid "See also L</pwrite>, L</pread-device>."
27967 #: ../fish/guestfish-actions.pod:3414
27968 msgid "pread-device"
27973 #: ../fish/guestfish-actions.pod:3416
27976 " pread-device device count offset\n"
27982 #: ../fish/guestfish-actions.pod:3424
27983 msgid "See also L</pread>."
27988 #: ../fish/guestfish-actions.pod:3429
27994 #: ../fish/guestfish-actions.pod:3431
27997 " pvcreate device\n"
28003 #: ../fish/guestfish-actions.pod:3437
28009 #: ../fish/guestfish-actions.pod:3439
28012 " pvremove device\n"
28018 #: ../fish/guestfish-actions.pod:3448
28024 #: ../fish/guestfish-actions.pod:3450
28027 " pvresize device\n"
28033 #: ../fish/guestfish-actions.pod:3455
28034 msgid "pvresize-size"
28039 #: ../fish/guestfish-actions.pod:3457
28042 " pvresize-size device size\n"
28048 #: ../fish/guestfish-actions.pod:3459
28050 "This command is the same as L</pvresize> except that it allows you to "
28051 "specify the new size (in bytes) explicitly."
28056 #: ../fish/guestfish-actions.pod:3462
28062 #: ../fish/guestfish-actions.pod:3464
28071 #: ../fish/guestfish-actions.pod:3472
28072 msgid "See also L</pvs-full>."
28077 #: ../fish/guestfish-actions.pod:3474
28083 #: ../fish/guestfish-actions.pod:3476
28092 #: ../fish/guestfish-actions.pod:3481
28098 #: ../fish/guestfish-actions.pod:3483
28107 #: ../fish/guestfish-actions.pod:3487
28113 #: ../fish/guestfish-actions.pod:3489
28116 " pwrite path content offset\n"
28122 #: ../fish/guestfish-actions.pod:3500
28123 msgid "See also L</pread>, L</pwrite-device>."
28128 #: ../fish/guestfish-actions.pod:3505
28129 msgid "pwrite-device"
28134 #: ../fish/guestfish-actions.pod:3507
28137 " pwrite-device device content offset\n"
28143 #: ../fish/guestfish-actions.pod:3517
28144 msgid "See also L</pwrite>."
28149 #: ../fish/guestfish-actions.pod:3522
28155 #: ../fish/guestfish-actions.pod:3524
28158 " read-file path\n"
28164 #: ../fish/guestfish-actions.pod:3529
28166 "Unlike L</cat>, this function can correctly handle files that contain "
28167 "embedded ASCII NUL characters. However unlike L</download>, this function "
28168 "is limited in the total size of file that can be handled."
28173 #: ../fish/guestfish-actions.pod:3537
28179 #: ../fish/guestfish-actions.pod:3539
28182 " read-lines path\n"
28188 #: ../fish/guestfish-actions.pod:3546
28190 "Note that this function cannot correctly handle binary files (specifically, "
28191 "files containing C<\\0> character which is treated as end of line). For "
28192 "those you need to use the L</read-file> function which has a more complex "
28198 #: ../fish/guestfish-actions.pod:3551
28204 #: ../fish/guestfish-actions.pod:3553
28213 #: ../fish/guestfish-actions.pod:3605
28215 "This function is primarily intended for use by programs. To get a simple "
28216 "list of names, use L</ls>. To get a printable directory for human "
28217 "consumption, use L</ll>."
28222 #: ../fish/guestfish-actions.pod:3609
28228 #: ../fish/guestfish-actions.pod:3611
28237 #: ../fish/guestfish-actions.pod:3615
28238 msgid "readlinklist"
28243 #: ../fish/guestfish-actions.pod:3617
28246 " readlinklist path 'names ...'\n"
28252 #: ../fish/guestfish-actions.pod:3641
28258 #: ../fish/guestfish-actions.pod:3643
28267 #: ../fish/guestfish-actions.pod:3648
28268 msgid "removexattr"
28273 #: ../fish/guestfish-actions.pod:3650
28276 " removexattr xattr path\n"
28282 #: ../fish/guestfish-actions.pod:3655
28283 msgid "See also: L</lremovexattr>, L<attr(5)>."
28288 #: ../fish/guestfish-actions.pod:3657
28294 #: ../fish/guestfish-actions.pod:3659
28297 " resize2fs device\n"
28303 #: ../fish/guestfish-actions.pod:3664
28305 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
28306 "before calling this command. For unknown reasons C<resize2fs> sometimes "
28307 "gives an error about this and sometimes not. In any case, it is always safe "
28308 "to call L</e2fsck-f> before calling this function."
28312 #: ../fish/guestfish-actions.pod:3670
28313 msgid "resize2fs-M"
28317 #: ../fish/guestfish-actions.pod:3672
28320 " resize2fs-M device\n"
28325 #: ../fish/guestfish-actions.pod:3674
28327 "This command is the same as L</resize2fs>, but the filesystem is resized to "
28328 "its minimum size. This works like the C<-M> option to the C<resize2fs> "
28333 #: ../fish/guestfish-actions.pod:3678
28335 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
28336 "and read the C<Block size> and C<Block count> values. These two numbers, "
28337 "multiplied together, give the resulting size of the minimal filesystem in "
28343 #: ../fish/guestfish-actions.pod:3683
28344 msgid "resize2fs-size"
28349 #: ../fish/guestfish-actions.pod:3685
28352 " resize2fs-size device size\n"
28358 #: ../fish/guestfish-actions.pod:3687
28360 "This command is the same as L</resize2fs> except that it allows you to "
28361 "specify the new size (in bytes) explicitly."
28366 #: ../fish/guestfish-actions.pod:3690
28372 #: ../fish/guestfish-actions.pod:3692
28381 #: ../fish/guestfish-actions.pod:3696
28387 #: ../fish/guestfish-actions.pod:3698
28396 #: ../fish/guestfish-actions.pod:3704
28402 #: ../fish/guestfish-actions.pod:3706
28411 #: ../fish/guestfish-actions.pod:3710
28412 msgid "rmmountpoint"
28417 #: ../fish/guestfish-actions.pod:3712
28420 " rmmountpoint exemptpath\n"
28426 #: ../fish/guestfish-actions.pod:3714
28428 "This calls removes a mountpoint that was previously created with L</"
28429 "mkmountpoint>. See L</mkmountpoint> for full details."
28434 #: ../fish/guestfish-actions.pod:3718
28435 msgid "scrub-device"
28440 #: ../fish/guestfish-actions.pod:3720
28443 " scrub-device device\n"
28449 #: ../fish/guestfish-actions.pod:3731
28455 #: ../fish/guestfish-actions.pod:3733
28458 " scrub-file file\n"
28464 #: ../fish/guestfish-actions.pod:3743
28465 msgid "scrub-freespace"
28470 #: ../fish/guestfish-actions.pod:3745
28473 " scrub-freespace dir\n"
28479 #: ../fish/guestfish-actions.pod:3747
28481 "This command creates the directory C<dir> and then fills it with files until "
28482 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
28483 "deletes them. The intention is to scrub any free space on the partition "
28484 "containing C<dir>."
28489 #: ../fish/guestfish-actions.pod:3756
28495 #: ../fish/guestfish-actions.pod:3758
28501 #: ../fish/guestfish-actions.pod:3760
28504 " set-append append\n"
28510 #: ../fish/guestfish-actions.pod:3771
28511 msgid "set-autosync"
28516 #: ../fish/guestfish-actions.pod:3773
28522 #: ../fish/guestfish-actions.pod:3775
28525 " set-autosync true|false\n"
28531 #: ../fish/guestfish-actions.pod:3777
28533 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
28534 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
28535 "closed (also if the program exits without closing handles)."
28540 #: ../fish/guestfish-actions.pod:3785
28546 #: ../fish/guestfish-actions.pod:3787
28552 #: ../fish/guestfish-actions.pod:3789
28555 " set-direct true|false\n"
28561 #: ../fish/guestfish-actions.pod:3795
28563 "One consequence of this is that log messages aren't caught by the library "
28564 "and handled by L</set-log-message-callback>, but go straight to stdout."
28569 #: ../fish/guestfish-actions.pod:3804
28570 msgid "set-e2label"
28575 #: ../fish/guestfish-actions.pod:3806
28578 " set-e2label device label\n"
28584 #: ../fish/guestfish-actions.pod:3812
28586 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
28587 "label on a filesystem."
28592 #: ../fish/guestfish-actions.pod:3815
28598 #: ../fish/guestfish-actions.pod:3817
28601 " set-e2uuid device uuid\n"
28607 #: ../fish/guestfish-actions.pod:3824
28609 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
28610 "UUID of a filesystem."
28615 #: ../fish/guestfish-actions.pod:3827
28616 msgid "set-memsize"
28621 #: ../fish/guestfish-actions.pod:3829
28627 #: ../fish/guestfish-actions.pod:3831
28630 " set-memsize memsize\n"
28636 #: ../fish/guestfish-actions.pod:3833
28638 "This sets the memory size in megabytes allocated to the qemu subprocess. "
28639 "This only has any effect if called before L</launch>."
28644 #: ../fish/guestfish-actions.pod:3844
28645 msgid "set-network"
28650 #: ../fish/guestfish-actions.pod:3846
28656 #: ../fish/guestfish-actions.pod:3848
28659 " set-network true|false\n"
28665 #: ../fish/guestfish-actions.pod:3856
28667 "You must call this before calling L</launch>, otherwise it has no effect."
28672 #: ../fish/guestfish-actions.pod:3859
28678 #: ../fish/guestfish-actions.pod:3861
28684 #: ../fish/guestfish-actions.pod:3863
28687 " set-path searchpath\n"
28693 #: ../fish/guestfish-actions.pod:3872
28699 #: ../fish/guestfish-actions.pod:3874
28705 #: ../fish/guestfish-actions.pod:3876
28714 #: ../fish/guestfish-actions.pod:3896
28715 msgid "set-recovery-proc"
28720 #: ../fish/guestfish-actions.pod:3898
28721 msgid "recovery-proc"
28726 #: ../fish/guestfish-actions.pod:3900
28729 " set-recovery-proc true|false\n"
28735 #: ../fish/guestfish-actions.pod:3902
28737 "If this is called with the parameter C<false> then L</launch> does not "
28738 "create a recovery process. The purpose of the recovery process is to stop "
28739 "runaway qemu processes in the case where the main program aborts abruptly."
28744 #: ../fish/guestfish-actions.pod:3907
28746 "This only has any effect if called before L</launch>, and the default is "
28752 #: ../fish/guestfish-actions.pod:3916
28753 msgid "set-selinux"
28758 #: ../fish/guestfish-actions.pod:3918
28764 #: ../fish/guestfish-actions.pod:3920
28767 " set-selinux true|false\n"
28773 #: ../fish/guestfish-actions.pod:3931
28779 #: ../fish/guestfish-actions.pod:3933
28785 #: ../fish/guestfish-actions.pod:3935
28788 " set-trace true|false\n"
28794 #: ../fish/guestfish-actions.pod:3951
28795 msgid "set-verbose"
28800 #: ../fish/guestfish-actions.pod:3953
28806 #: ../fish/guestfish-actions.pod:3955
28809 " set-verbose true|false\n"
28815 #: ../fish/guestfish-actions.pod:3962
28821 #: ../fish/guestfish-actions.pod:3964
28824 " setcon context\n"
28830 #: ../fish/guestfish-actions.pod:3971
28836 #: ../fish/guestfish-actions.pod:3973
28839 " setxattr xattr val vallen path\n"
28845 #: ../fish/guestfish-actions.pod:3979
28846 msgid "See also: L</lsetxattr>, L<attr(5)>."
28851 #: ../fish/guestfish-actions.pod:3981
28857 #: ../fish/guestfish-actions.pod:3983
28860 " sfdisk device cyls heads sectors 'lines ...'\n"
28866 #: ../fish/guestfish-actions.pod:4005
28867 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
28872 #: ../fish/guestfish-actions.pod:4011
28878 #: ../fish/guestfish-actions.pod:4013
28881 " sfdiskM device 'lines ...'\n"
28887 #: ../fish/guestfish-actions.pod:4015
28889 "This is a simplified interface to the L</sfdisk> command, where partition "
28890 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
28891 "you don't need to specify the cyls, heads and sectors parameters which were "
28892 "rarely if ever used anyway."
28897 #: ../fish/guestfish-actions.pod:4021
28898 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
28903 #: ../fish/guestfish-actions.pod:4027
28909 #: ../fish/guestfish-actions.pod:4029
28912 " sfdisk-N device partnum cyls heads sectors line\n"
28918 #: ../fish/guestfish-actions.pod:4034
28920 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
28921 "cyls/heads/sectors parameters."
28926 #: ../fish/guestfish-actions.pod:4037
28927 msgid "See also: L</part-add>"
28932 #: ../fish/guestfish-actions.pod:4042
28933 msgid "sfdisk-disk-geometry"
28938 #: ../fish/guestfish-actions.pod:4044
28941 " sfdisk-disk-geometry device\n"
28947 #: ../fish/guestfish-actions.pod:4046
28949 "This displays the disk geometry of C<device> read from the partition table. "
28950 "Especially in the case where the underlying block device has been resized, "
28951 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
28952 "kernel-geometry>)."
28957 #: ../fish/guestfish-actions.pod:4054
28958 msgid "sfdisk-kernel-geometry"
28963 #: ../fish/guestfish-actions.pod:4056
28966 " sfdisk-kernel-geometry device\n"
28972 #: ../fish/guestfish-actions.pod:4063
28978 #: ../fish/guestfish-actions.pod:4065
28981 " sfdisk-l device\n"
28987 #: ../fish/guestfish-actions.pod:4071
28988 msgid "See also: L</part-list>"
28993 #: ../fish/guestfish-actions.pod:4073
28999 #: ../fish/guestfish-actions.pod:4075
29008 #: ../fish/guestfish-actions.pod:4080
29009 msgid "This is like L</command>, but passes the command to:"
29014 #: ../fish/guestfish-actions.pod:4088
29015 msgid "All the provisos about L</command> apply to this call."
29020 #: ../fish/guestfish-actions.pod:4090
29026 #: ../fish/guestfish-actions.pod:4092
29029 " sh-lines command\n"
29035 #: ../fish/guestfish-actions.pod:4094
29036 msgid "This is the same as L</sh>, but splits the result into a list of lines."
29041 #: ../fish/guestfish-actions.pod:4097
29042 msgid "See also: L</command-lines>"
29047 #: ../fish/guestfish-actions.pod:4099
29053 #: ../fish/guestfish-actions.pod:4101
29062 #: ../fish/guestfish-actions.pod:4105
29068 #: ../fish/guestfish-actions.pod:4107
29077 #: ../fish/guestfish-actions.pod:4113
29083 #: ../fish/guestfish-actions.pod:4115
29092 #: ../fish/guestfish-actions.pod:4123
29098 #: ../fish/guestfish-actions.pod:4125
29107 #: ../fish/guestfish-actions.pod:4133
29113 #: ../fish/guestfish-actions.pod:4135
29116 " strings-e encoding path\n"
29122 #: ../fish/guestfish-actions.pod:4137
29124 "This is like the L</strings> command, but allows you to specify the encoding "
29125 "of strings that are looked for in the source file C<path>."
29130 #: ../fish/guestfish-actions.pod:4147
29132 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29133 "ISO-8859-X (this is what L</strings> uses)."
29138 #: ../fish/guestfish-actions.pod:4179
29139 msgid "swapoff-device"
29144 #: ../fish/guestfish-actions.pod:4181
29147 " swapoff-device device\n"
29153 #: ../fish/guestfish-actions.pod:4183
29155 "This command disables the libguestfs appliance swap device or partition "
29156 "named C<device>. See L</swapon-device>."
29161 #: ../fish/guestfish-actions.pod:4187
29162 msgid "swapoff-file"
29167 #: ../fish/guestfish-actions.pod:4189
29170 " swapoff-file file\n"
29176 #: ../fish/guestfish-actions.pod:4193
29177 msgid "swapoff-label"
29182 #: ../fish/guestfish-actions.pod:4195
29185 " swapoff-label label\n"
29191 #: ../fish/guestfish-actions.pod:4200
29192 msgid "swapoff-uuid"
29197 #: ../fish/guestfish-actions.pod:4202
29200 " swapoff-uuid uuid\n"
29206 #: ../fish/guestfish-actions.pod:4207
29207 msgid "swapon-device"
29212 #: ../fish/guestfish-actions.pod:4209
29215 " swapon-device device\n"
29221 #: ../fish/guestfish-actions.pod:4211
29223 "This command enables the libguestfs appliance to use the swap device or "
29224 "partition named C<device>. The increased memory is made available for all "
29225 "commands, for example those run using L</command> or L</sh>."
29230 #: ../fish/guestfish-actions.pod:4223
29231 msgid "swapon-file"
29236 #: ../fish/guestfish-actions.pod:4225
29239 " swapon-file file\n"
29245 #: ../fish/guestfish-actions.pod:4227
29247 "This command enables swap to a file. See L</swapon-device> for other notes."
29252 #: ../fish/guestfish-actions.pod:4230
29253 msgid "swapon-label"
29258 #: ../fish/guestfish-actions.pod:4232
29261 " swapon-label label\n"
29267 #: ../fish/guestfish-actions.pod:4234
29269 "This command enables swap to a labeled swap partition. See L</swapon-"
29270 "device> for other notes."
29275 #: ../fish/guestfish-actions.pod:4237
29276 msgid "swapon-uuid"
29281 #: ../fish/guestfish-actions.pod:4239
29284 " swapon-uuid uuid\n"
29290 #: ../fish/guestfish-actions.pod:4241
29292 "This command enables swap to a swap partition with the given UUID. See L</"
29293 "swapon-device> for other notes."
29298 #: ../fish/guestfish-actions.pod:4244
29304 #: ../fish/guestfish-actions.pod:4246
29313 #: ../fish/guestfish-actions.pod:4254
29319 #: ../fish/guestfish-actions.pod:4256
29328 #: ../fish/guestfish-actions.pod:4264
29334 #: ../fish/guestfish-actions.pod:4266
29337 " tail-n nrlines path\n"
29343 #: ../fish/guestfish-actions.pod:4279
29349 #: ../fish/guestfish-actions.pod:4281
29352 " tar-in (tarfile|-) directory\n"
29358 #: ../fish/guestfish-actions.pod:4286
29359 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
29364 #: ../fish/guestfish-actions.pod:4291
29370 #: ../fish/guestfish-actions.pod:4293
29373 " tar-out directory (tarfile|-)\n"
29379 #: ../fish/guestfish-actions.pod:4298
29380 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
29385 #: ../fish/guestfish-actions.pod:4303
29391 #: ../fish/guestfish-actions.pod:4305
29394 " tgz-in (tarball|-) directory\n"
29400 #: ../fish/guestfish-actions.pod:4310
29401 msgid "To upload an uncompressed tarball, use L</tar-in>."
29406 #: ../fish/guestfish-actions.pod:4314
29412 #: ../fish/guestfish-actions.pod:4316
29415 " tgz-out directory (tarball|-)\n"
29421 #: ../fish/guestfish-actions.pod:4321
29422 msgid "To download an uncompressed tarball, use L</tar-out>."
29427 #: ../fish/guestfish-actions.pod:4325
29433 #: ../fish/guestfish-actions.pod:4327
29442 #: ../fish/guestfish-actions.pod:4336
29448 #: ../fish/guestfish-actions.pod:4338
29457 #: ../fish/guestfish-actions.pod:4343
29458 msgid "truncate-size"
29463 #: ../fish/guestfish-actions.pod:4345
29466 " truncate-size path size\n"
29472 #: ../fish/guestfish-actions.pod:4350
29474 "If the current file size is less than C<size> then the file is extended to "
29475 "the required size with zero bytes. This creates a sparse file (ie. disk "
29476 "blocks are not allocated for the file until you write to it). To create a "
29477 "non-sparse file of zeroes, use L</fallocate64> instead."
29482 #: ../fish/guestfish-actions.pod:4356
29488 #: ../fish/guestfish-actions.pod:4358
29491 " tune2fs-l device\n"
29497 #: ../fish/guestfish-actions.pod:4368
29503 #: ../fish/guestfish-actions.pod:4370
29506 " txz-in (tarball|-) directory\n"
29512 #: ../fish/guestfish-actions.pod:4377
29518 #: ../fish/guestfish-actions.pod:4379
29521 " txz-out directory (tarball|-)\n"
29527 #: ../fish/guestfish-actions.pod:4386
29533 #: ../fish/guestfish-actions.pod:4388
29542 #: ../fish/guestfish-actions.pod:4402
29543 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
29548 #: ../fish/guestfish-actions.pod:4407
29554 #: ../fish/guestfish-actions.pod:4409
29560 #: ../fish/guestfish-actions.pod:4411
29563 " umount pathordevice\n"
29569 #: ../fish/guestfish-actions.pod:4417
29575 #: ../fish/guestfish-actions.pod:4419
29576 msgid "unmount-all"
29581 #: ../fish/guestfish-actions.pod:4421
29590 #: ../fish/guestfish-actions.pod:4427
29596 #: ../fish/guestfish-actions.pod:4429
29599 " upload (filename|-) remotefilename\n"
29605 #: ../fish/guestfish-actions.pod:4436
29606 msgid "See also L</download>."
29611 #: ../fish/guestfish-actions.pod:4440
29612 msgid "upload-offset"
29617 #: ../fish/guestfish-actions.pod:4442
29620 " upload-offset (filename|-) remotefilename offset\n"
29626 #: ../fish/guestfish-actions.pod:4454
29628 "Note that there is no limit on the amount of data that can be uploaded with "
29629 "this call, unlike with L</pwrite>, and this call always writes the full "
29630 "amount unless an error occurs."
29635 #: ../fish/guestfish-actions.pod:4459
29636 msgid "See also L</upload>, L</pwrite>."
29641 #: ../fish/guestfish-actions.pod:4463
29647 #: ../fish/guestfish-actions.pod:4465
29650 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
29656 #: ../fish/guestfish-actions.pod:4484
29662 #: ../fish/guestfish-actions.pod:4486
29671 #: ../fish/guestfish-actions.pod:4513
29673 "I<Note:> Don't use this call to test for availability of features. In "
29674 "enterprise distributions we backport features from later versions into "
29675 "earlier versions, making this an unreliable way to test for features. Use "
29676 "L</available> instead."
29681 #: ../fish/guestfish-actions.pod:4519
29687 #: ../fish/guestfish-actions.pod:4521
29690 " vfs-label device\n"
29696 #: ../fish/guestfish-actions.pod:4528
29697 msgid "To find a filesystem from the label, use L</findfs-label>."
29702 #: ../fish/guestfish-actions.pod:4530
29708 #: ../fish/guestfish-actions.pod:4532
29711 " vfs-type device\n"
29717 #: ../fish/guestfish-actions.pod:4542
29723 #: ../fish/guestfish-actions.pod:4544
29726 " vfs-uuid device\n"
29732 #: ../fish/guestfish-actions.pod:4551
29733 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
29738 #: ../fish/guestfish-actions.pod:4553
29739 msgid "vg-activate"
29744 #: ../fish/guestfish-actions.pod:4555
29747 " vg-activate true|false 'volgroups ...'\n"
29753 #: ../fish/guestfish-actions.pod:4568
29754 msgid "vg-activate-all"
29759 #: ../fish/guestfish-actions.pod:4570
29762 " vg-activate-all true|false\n"
29768 #: ../fish/guestfish-actions.pod:4580
29774 #: ../fish/guestfish-actions.pod:4582
29777 " vgcreate volgroup 'physvols ...'\n"
29783 #: ../fish/guestfish-actions.pod:4587
29789 #: ../fish/guestfish-actions.pod:4589
29792 " vglvuuids vgname\n"
29798 #: ../fish/guestfish-actions.pod:4594
29800 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
29801 "logical volumes and volume groups."
29806 #: ../fish/guestfish-actions.pod:4597
29807 msgid "See also L</vgpvuuids>."
29812 #: ../fish/guestfish-actions.pod:4599
29818 #: ../fish/guestfish-actions.pod:4601
29821 " vgpvuuids vgname\n"
29827 #: ../fish/guestfish-actions.pod:4606
29829 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
29830 "physical volumes and volume groups."
29835 #: ../fish/guestfish-actions.pod:4609
29836 msgid "See also L</vglvuuids>."
29841 #: ../fish/guestfish-actions.pod:4611
29847 #: ../fish/guestfish-actions.pod:4613
29850 " vgremove vgname\n"
29856 #: ../fish/guestfish-actions.pod:4620
29862 #: ../fish/guestfish-actions.pod:4622
29865 " vgrename volgroup newvolgroup\n"
29871 #: ../fish/guestfish-actions.pod:4626
29877 #: ../fish/guestfish-actions.pod:4628
29886 #: ../fish/guestfish-actions.pod:4636
29887 msgid "See also L</vgs-full>."
29892 #: ../fish/guestfish-actions.pod:4638
29898 #: ../fish/guestfish-actions.pod:4640
29907 #: ../fish/guestfish-actions.pod:4645
29913 #: ../fish/guestfish-actions.pod:4647
29922 #: ../fish/guestfish-actions.pod:4652
29928 #: ../fish/guestfish-actions.pod:4654
29937 #: ../fish/guestfish-actions.pod:4658
29943 #: ../fish/guestfish-actions.pod:4660
29952 #: ../fish/guestfish-actions.pod:4665
29958 #: ../fish/guestfish-actions.pod:4667
29967 #: ../fish/guestfish-actions.pod:4672
29973 #: ../fish/guestfish-actions.pod:4674
29982 #: ../fish/guestfish-actions.pod:4679
29988 #: ../fish/guestfish-actions.pod:4681
29991 " write path content\n"
29997 #: ../fish/guestfish-actions.pod:4689
30003 #: ../fish/guestfish-actions.pod:4691
30006 " write-file path content size\n"
30012 #: ../fish/guestfish-actions.pod:4714
30018 #: ../fish/guestfish-actions.pod:4716
30021 " zegrep regex path\n"
30027 #: ../fish/guestfish-actions.pod:4724
30033 #: ../fish/guestfish-actions.pod:4726
30036 " zegrepi regex path\n"
30042 #: ../fish/guestfish-actions.pod:4734
30048 #: ../fish/guestfish-actions.pod:4736
30057 #: ../fish/guestfish-actions.pod:4744
30058 msgid "See also: L</zero-device>, L</scrub-device>."
30063 #: ../fish/guestfish-actions.pod:4746
30064 msgid "zero-device"
30069 #: ../fish/guestfish-actions.pod:4748
30072 " zero-device device\n"
30078 #: ../fish/guestfish-actions.pod:4750
30080 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
30081 "which just zeroes the first few blocks of a device."
30086 #: ../fish/guestfish-actions.pod:4757
30092 #: ../fish/guestfish-actions.pod:4759
30095 " zerofree device\n"
30101 #: ../fish/guestfish-actions.pod:4772
30107 #: ../fish/guestfish-actions.pod:4774
30110 " zfgrep pattern path\n"
30116 #: ../fish/guestfish-actions.pod:4782
30122 #: ../fish/guestfish-actions.pod:4784
30125 " zfgrepi pattern path\n"
30131 #: ../fish/guestfish-actions.pod:4792
30137 #: ../fish/guestfish-actions.pod:4794
30140 " zfile meth path\n"
30146 #: ../fish/guestfish-actions.pod:4801
30148 "Since 1.0.63, use L</file> instead which can now process compressed files."
30153 #: ../fish/guestfish-actions.pod:4811
30159 #: ../fish/guestfish-actions.pod:4813
30162 " zgrep regex path\n"
30168 #: ../fish/guestfish-actions.pod:4821
30174 #: ../fish/guestfish-actions.pod:4823
30177 " zgrepi regex path\n"
30183 #: ../fish/guestfish-commands.pod:1
30189 #: ../fish/guestfish-commands.pod:3
30195 #: ../fish/guestfish-commands.pod:5
30198 " alloc filename size\n"
30204 #: ../fish/guestfish-commands.pod:7
30206 "This creates an empty (zeroed) file of the given size, and then adds so it "
30207 "can be further examined."
30212 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
30213 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
30218 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
30219 msgid "Size can be specified using standard suffixes, eg. C<1M>."
30224 #: ../fish/guestfish-commands.pod:14
30226 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
30227 "image, see L</PREPARED DISK IMAGES>."
30232 #: ../fish/guestfish-commands.pod:17
30238 #: ../fish/guestfish-commands.pod:19
30241 " copy-in local [local ...] /remotedir\n"
30247 #: ../fish/guestfish-commands.pod:21
30249 "C<copy-in> copies local files or directories recursively into the disk "
30250 "image, placing them in the directory called C</remotedir> (which must "
30251 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
30252 "other commands as necessary."
30257 #: ../fish/guestfish-commands.pod:26
30259 "Multiple local files and directories can be specified, but the last "
30260 "parameter must always be a remote directory. Wildcards cannot be used."
30265 #: ../fish/guestfish-commands.pod:30
30271 #: ../fish/guestfish-commands.pod:32
30274 " copy-out remote [remote ...] localdir\n"
30280 #: ../fish/guestfish-commands.pod:34
30282 "C<copy-out> copies remote files or directories recursively out of the disk "
30283 "image, placing them on the host disk in a local directory called C<localdir> "
30284 "(which must exist). This guestfish meta-command turns into a sequence of L</"
30285 "download>, L</tar-out> and other commands as necessary."
30290 #: ../fish/guestfish-commands.pod:40
30292 "Multiple remote files and directories can be specified, but the last "
30293 "parameter must always be a local directory. To download to the current "
30294 "directory, use C<.> as in:"
30299 #: ../fish/guestfish-commands.pod:44
30302 " copy-out /home .\n"
30308 #: ../fish/guestfish-commands.pod:46
30310 "Wildcards cannot be used in the ordinary command, but you can use them with "
30311 "the help of L</glob> like this:"
30316 #: ../fish/guestfish-commands.pod:49
30319 " glob copy-out /home/* .\n"
30325 #: ../fish/guestfish-commands.pod:51
30331 #: ../fish/guestfish-commands.pod:53
30334 " echo [params ...]\n"
30340 #: ../fish/guestfish-commands.pod:55
30341 msgid "This echos the parameters to the terminal."
30346 #: ../fish/guestfish-commands.pod:57
30352 #: ../fish/guestfish-commands.pod:59
30358 #: ../fish/guestfish-commands.pod:61
30364 #: ../fish/guestfish-commands.pod:63
30373 #: ../fish/guestfish-commands.pod:65
30375 "This is used to edit a file. It downloads the file, edits it locally using "
30376 "your editor, then uploads the result."
30381 #: ../fish/guestfish-commands.pod:68
30383 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
30384 "or C<emacs> you will get those corresponding editors."
30389 #: ../fish/guestfish-commands.pod:72
30395 #: ../fish/guestfish-commands.pod:74
30398 " glob command args...\n"
30404 #: ../fish/guestfish-commands.pod:76
30406 "Expand wildcards in any paths in the args list, and run C<command> "
30407 "repeatedly on each matching path."
30412 #: ../fish/guestfish-commands.pod:79
30413 msgid "See L</WILDCARDS AND GLOBBING>."
30418 #: ../fish/guestfish-commands.pod:81
30424 #: ../fish/guestfish-commands.pod:83
30427 " hexedit <filename|device>\n"
30428 " hexedit <filename|device> <max>\n"
30429 " hexedit <filename|device> <start> <max>\n"
30435 #: ../fish/guestfish-commands.pod:87
30437 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
30443 #: ../fish/guestfish-commands.pod:90
30445 "This command works by downloading potentially the whole file or device, "
30446 "editing it locally, then uploading it. If the file or device is large, you "
30447 "have to specify which part you wish to edit by using C<max> and/or C<start> "
30448 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
30449 "usual modifiers allowed such as C<1M> (1 megabyte)."
30454 #: ../fish/guestfish-commands.pod:97
30455 msgid "For example to edit the first few sectors of a disk you might do:"
30460 #: ../fish/guestfish-commands.pod:100
30463 " hexedit /dev/sda 1M\n"
30469 #: ../fish/guestfish-commands.pod:102
30471 "which would allow you to edit anywhere within the first megabyte of the disk."
30476 #: ../fish/guestfish-commands.pod:105
30477 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
30482 #: ../fish/guestfish-commands.pod:107
30485 " hexedit /dev/sda1 0x400 0x400\n"
30491 #: ../fish/guestfish-commands.pod:109
30492 msgid "(assuming the superblock is in the standard location)."
30497 #: ../fish/guestfish-commands.pod:111
30499 "This command requires the external L<hexedit(1)> program. You can specify "
30500 "another program to use by setting the C<HEXEDITOR> environment variable."
30505 #: ../fish/guestfish-commands.pod:115
30506 msgid "See also L</hexdump>."
30511 #: ../fish/guestfish-commands.pod:117
30517 #: ../fish/guestfish-commands.pod:119
30526 #: ../fish/guestfish-commands.pod:121
30528 "Change the local directory, ie. the current directory of guestfish itself."
30533 #: ../fish/guestfish-commands.pod:124
30534 msgid "Note that C<!cd> won't do what you might expect."
30539 #: ../fish/guestfish-commands.pod:126
30545 #: ../fish/guestfish-commands.pod:128
30551 #: ../fish/guestfish-commands.pod:130
30560 #: ../fish/guestfish-commands.pod:132
30561 msgid "Opens the manual page for guestfish."
30566 #: ../fish/guestfish-commands.pod:134
30572 #: ../fish/guestfish-commands.pod:136
30578 #: ../fish/guestfish-commands.pod:138
30587 #: ../fish/guestfish-commands.pod:140
30596 #: ../fish/guestfish-commands.pod:142
30597 msgid "This is used to view a file."
30602 #: ../fish/guestfish-commands.pod:144
30604 "The default viewer is C<$PAGER>. However if you use the alternate command "
30605 "C<less> you will get the C<less> command specifically."
30610 #: ../fish/guestfish-commands.pod:147
30616 #: ../fish/guestfish-commands.pod:149
30625 #: ../fish/guestfish-commands.pod:151
30627 "Close and reopen the libguestfs handle. It is not necessary to use this "
30628 "normally, because the handle is closed properly when guestfish exits. "
30629 "However this is occasionally useful for testing."
30634 #: ../fish/guestfish-commands.pod:155
30640 #: ../fish/guestfish-commands.pod:157
30643 " sparse filename size\n"
30649 #: ../fish/guestfish-commands.pod:159
30651 "This creates an empty sparse file of the given size, and then adds so it can "
30652 "be further examined."
30657 #: ../fish/guestfish-commands.pod:162
30659 "In all respects it works the same as the L</alloc> command, except that the "
30660 "image file is allocated sparsely, which means that disk blocks are not "
30661 "assigned to the file until they are needed. Sparse disk files only use "
30662 "space when written to, but they are slower and there is a danger you could "
30663 "run out of real disk space during a write operation."
30668 #: ../fish/guestfish-commands.pod:172
30674 #: ../fish/guestfish-commands.pod:174
30683 #: ../fish/guestfish-commands.pod:176
30685 "This command returns a list of the optional groups known to the daemon, and "
30686 "indicates which ones are supported by this build of the libguestfs appliance."
30691 #: ../fish/guestfish-commands.pod:180
30692 msgid "See also L<guestfs(3)/AVAILABILITY>."
30697 #: ../fish/guestfish-commands.pod:182
30703 #: ../fish/guestfish-commands.pod:184
30706 " time command args...\n"
30712 #: ../fish/guestfish-commands.pod:186
30714 "Run the command as usual, but print the elapsed time afterwards. This can "
30715 "be useful for benchmarking operations."
30720 #: ../test-tool/libguestfs-test-tool.pod:5
30721 msgid "libguestfs-test-tool - End user tests for libguestfs"
30726 #: ../test-tool/libguestfs-test-tool.pod:9
30729 " libguestfs-test-tool [--options]\n"
30735 #: ../test-tool/libguestfs-test-tool.pod:13
30737 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
30738 "and developers, to allow them to check basic libguestfs functionality is "
30739 "working. This is needed because libguestfs occasionally breaks for reasons "
30740 "beyond our control: usually because of changes in the underlying qemu or "
30741 "kernel packages, or the host environment."
30746 #: ../test-tool/libguestfs-test-tool.pod:20
30747 msgid "If you suspect a problem in libguestfs, then just run:"
30752 #: ../test-tool/libguestfs-test-tool.pod:22
30755 " libguestfs-test-tool\n"
30761 #: ../test-tool/libguestfs-test-tool.pod:24
30762 msgid "It will print lots of diagnostic messages."
30767 #: ../test-tool/libguestfs-test-tool.pod:26
30768 msgid "If it runs to completion successfully, you will see this near the end:"
30773 #: ../test-tool/libguestfs-test-tool.pod:28
30776 " ===== TEST FINISHED OK =====\n"
30782 #: ../test-tool/libguestfs-test-tool.pod:30
30783 msgid "and the test tool will exit with code 0."
30788 #: ../test-tool/libguestfs-test-tool.pod:32
30790 "If it fails (and/or exits with non-zero error code), please paste the "
30791 "B<complete, unedited> output of the test tool into a bug report. More "
30792 "information about reporting bugs can be found on the L<http://libguestfs.org/"
30798 #: ../test-tool/libguestfs-test-tool.pod:41
30804 #: ../test-tool/libguestfs-test-tool.pod:43
30805 msgid "Display short usage information and exit."
30810 #: ../test-tool/libguestfs-test-tool.pod:45
30811 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
30816 #: ../test-tool/libguestfs-test-tool.pod:47
30818 "Pass an alternate name for the helper program. libguestfs-test-tool will "
30819 "normally look in the C<$libexec> directory that was configured when the tool "
30825 #: ../test-tool/libguestfs-test-tool.pod:51
30826 msgid "I<--qemu qemu_binary>"
30831 #: ../test-tool/libguestfs-test-tool.pod:53
30833 "If you have downloaded another qemu binary, point this option at the full "
30834 "path of the binary to try it."
30839 #: ../test-tool/libguestfs-test-tool.pod:56
30840 msgid "I<--qemudir qemu_source_dir>"
30845 #: ../test-tool/libguestfs-test-tool.pod:58
30847 "If you have compiled qemu from source, point this option at the source "
30848 "directory to try it."
30853 #: ../test-tool/libguestfs-test-tool.pod:61
30854 msgid "I<--timeout N>"
30859 #: ../test-tool/libguestfs-test-tool.pod:63
30861 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
30862 "does not usually need to be adjusted unless your machine is very slow."
30867 #: ../test-tool/libguestfs-test-tool.pod:69
30868 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
30873 #: ../test-tool/libguestfs-test-tool.pod:71
30875 "If you have compiled another version of qemu from source and would like to "
30876 "try that, then you can use the I<--qemudir> option to point to the qemu "
30877 "source directory."
30882 #: ../test-tool/libguestfs-test-tool.pod:75
30884 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
30885 "option to point to the binary."
30890 #: ../test-tool/libguestfs-test-tool.pod:78
30892 "When using an alternate qemu with libguestfs, usually you would need to "
30893 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
30894 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
30895 "use either of the I<--qemudir> or I<--qemu> options."
30900 #: ../test-tool/libguestfs-test-tool.pod:85
30902 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
30903 "I<1> if there was an error."
30908 #: ../test-tool/libguestfs-test-tool.pod:92
30909 msgid "/usr/libexec/libguestfs-test-tool-helper"
30914 #: ../test-tool/libguestfs-test-tool.pod:94
30916 "This helper program is run inside the appliance and provides additional "
30922 #: ../test-tool/libguestfs-test-tool.pod:97
30923 msgid "/usr/bin/mkisofs"
30928 #: ../test-tool/libguestfs-test-tool.pod:99
30930 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
30931 "which is used as part of the tests."
30936 #: ../test-tool/libguestfs-test-tool.pod:106
30938 "For the full list of environment variables which may affect libguestfs, "
30939 "please see the L<guestfs(3)> manual page."
30944 #: ../test-tool/libguestfs-test-tool.pod:111
30945 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
30950 #: ../test-tool/libguestfs-test-tool.pod:121
30951 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
30956 #: ../fuse/guestmount.pod:5
30958 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
30963 #: ../fuse/guestmount.pod:9
30966 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
30972 #: ../fuse/guestmount.pod:11
30975 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
30981 #: ../fuse/guestmount.pod:13
30984 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
30990 #: ../fuse/guestmount.pod:17
30992 "You must I<not> use C<guestmount> in read-write mode on live virtual "
30993 "machines. If you do this, you risk disk corruption in the VM."
30998 #: ../fuse/guestmount.pod:22
31000 "The guestmount program can be used to mount virtual machine filesystems and "
31001 "other disk images on the host. It uses libguestfs for access to the guest "
31002 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
31003 "a mountable device."
31008 #: ../fuse/guestmount.pod:27
31010 "Along with other options, you have to give at least one device (I<-a> "
31011 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
31012 "option) or use the I<-i> inspection option. How this works is better "
31013 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
31019 #: ../fuse/guestmount.pod:33
31021 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
31022 "by you, and the filesystem will not be visible to any other users unless you "
31023 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
31024 "the filesystem, use the C<fusermount -u> command."
31029 #: ../fuse/guestmount.pod:41
31031 "For a typical Windows guest which has its main filesystem on the first "
31037 #: ../fuse/guestmount.pod:44
31040 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
31046 #: ../fuse/guestmount.pod:46
31048 "For a typical Linux guest which has a /boot filesystem on the first "
31049 "partition, and the root filesystem on a logical volume:"
31054 #: ../fuse/guestmount.pod:49
31057 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
31063 #: ../fuse/guestmount.pod:51
31064 msgid "To get libguestfs to detect guest mountpoints for you:"
31069 #: ../fuse/guestmount.pod:53
31072 " guestmount -a guest.img -i --ro /mnt\n"
31078 #: ../fuse/guestmount.pod:55
31079 msgid "For a libvirt guest called \"Guest\" you could do:"
31084 #: ../fuse/guestmount.pod:57
31087 " guestmount -d Guest -i --ro /mnt\n"
31093 #: ../fuse/guestmount.pod:59
31095 "If you don't know what filesystems are contained in a guest or disk image, "
31096 "use L<virt-filesystems(1)> first:"
31101 #: ../fuse/guestmount.pod:62
31104 " virt-filesystems MyGuest\n"
31110 #: ../fuse/guestmount.pod:64
31112 "If you want to trace the libguestfs calls but without excessive debugging "
31113 "information, we recommend:"
31118 #: ../fuse/guestmount.pod:67
31121 " guestmount [...] --trace /mnt\n"
31127 #: ../fuse/guestmount.pod:69
31128 msgid "If you want to debug the program, we recommend:"
31133 #: ../fuse/guestmount.pod:71
31136 " guestmount [...] --trace --verbose /mnt\n"
31142 #: ../fuse/guestmount.pod:77
31143 msgid "B<-a image> | B<--add image>"
31148 #: ../fuse/guestmount.pod:79
31149 msgid "Add a block device or virtual machine image."
31154 #: ../fuse/guestmount.pod:84
31155 msgid "B<-c URI> | B<--connect URI>"
31160 #: ../fuse/guestmount.pod:90
31161 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
31166 #: ../fuse/guestmount.pod:96
31167 msgid "B<--dir-cache-timeout N>"
31172 #: ../fuse/guestmount.pod:98
31174 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
31175 "seconds. The readdir cache [actually, there are several semi-independent "
31176 "caches] is populated after a readdir(2) call with the stat and extended "
31177 "attributes of the files in the directory, in anticipation that they will be "
31178 "requested soon after."
31183 #: ../fuse/guestmount.pod:104
31185 "There is also a different attribute cache implemented by FUSE (see the FUSE "
31186 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
31187 "requests, only cache existing ones."
31192 #: ../fuse/guestmount.pod:115
31193 msgid "B<--format=raw|qcow2|..> | B<--format>"
31198 #: ../fuse/guestmount.pod:122
31200 "If you have untrusted raw-format guest disk images, you should use this "
31201 "option to specify the disk format. This avoids a possible security problem "
31202 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
31203 "guestfs_add_drive_opts>."
31208 #: ../fuse/guestmount.pod:127
31209 msgid "B<--fuse-help>"
31214 #: ../fuse/guestmount.pod:129
31215 msgid "Display help on special FUSE options (see I<-o> below)."
31220 #: ../fuse/guestmount.pod:133
31221 msgid "Display brief help and exit."
31226 #: ../fuse/guestmount.pod:135
31227 msgid "B<-i> | B<--inspector>"
31232 #: ../fuse/guestmount.pod:146
31233 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
31238 #: ../fuse/guestmount.pod:148
31240 "Mount the named partition or logical volume on the given mountpoint B<in the "
31241 "guest> (this has nothing to do with mountpoints in the host)."
31246 #: ../fuse/guestmount.pod:151
31248 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
31249 "something on C</>."
31254 #: ../fuse/guestmount.pod:154
31255 msgid "B<-n> | B<--no-sync>"
31260 #: ../fuse/guestmount.pod:156
31262 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
31263 "unmounted. If you specify this option, then we don't attempt to sync the "
31264 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
31269 #: ../fuse/guestmount.pod:161
31270 msgid "B<-o option> | B<--option option>"
31275 #: ../fuse/guestmount.pod:163
31276 msgid "Pass extra options to FUSE."
31281 #: ../fuse/guestmount.pod:165
31283 "To get a list of all the extra options supported by FUSE, use the command "
31284 "below. Note that only the FUSE I<-o> options can be passed, and only some "
31285 "of them are a good idea."
31290 #: ../fuse/guestmount.pod:169
31293 " guestmount --fuse-help\n"
31299 #: ../fuse/guestmount.pod:171
31300 msgid "Some potentially useful FUSE options:"
31305 #: ../fuse/guestmount.pod:175
31306 msgid "B<-o allow_other>"
31311 #: ../fuse/guestmount.pod:177
31312 msgid "Allow other users to see the filesystem."
31317 #: ../fuse/guestmount.pod:179
31318 msgid "B<-o attr_timeout=N>"
31323 #: ../fuse/guestmount.pod:181
31324 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
31329 #: ../fuse/guestmount.pod:183
31330 msgid "B<-o kernel_cache>"
31335 #: ../fuse/guestmount.pod:185
31337 "Allow the kernel to cache files (reduces the number of reads that have to go "
31338 "through the L<guestfs(3)> API). This is generally a good idea if you can "
31339 "afford the extra memory usage."
31344 #: ../fuse/guestmount.pod:189
31345 msgid "B<-o uid=N> B<-o gid=N>"
31350 #: ../fuse/guestmount.pod:191
31352 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
31353 "the chosen values."
31358 #: ../fuse/guestmount.pod:196
31359 msgid "B<-r> | B<--ro>"
31364 #: ../fuse/guestmount.pod:198
31366 "Add devices and mount everything read-only. Also disallow writes and make "
31367 "the disk appear read-only to FUSE."
31372 #: ../fuse/guestmount.pod:201
31374 "This is highly recommended if you are not going to edit the guest disk. If "
31375 "the guest is running and this option is I<not> supplied, then there is a "
31376 "strong risk of disk corruption in the guest. We try to prevent this from "
31377 "happening, but it is not always possible."
31382 #: ../fuse/guestmount.pod:206
31383 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
31388 #: ../fuse/guestmount.pod:210
31389 msgid "Enable SELinux support for the guest."
31394 #: ../fuse/guestmount.pod:212
31395 msgid "B<-v> | B<--verbose>"
31400 #: ../fuse/guestmount.pod:214
31401 msgid "Enable verbose messages from underlying libguestfs."
31406 #: ../fuse/guestmount.pod:216
31407 msgid "B<-V> | B<--version>"
31412 #: ../fuse/guestmount.pod:218
31413 msgid "Display the program version and exit."
31418 #: ../fuse/guestmount.pod:220
31419 msgid "B<-w> | B<--rw>"
31424 #: ../fuse/guestmount.pod:222
31426 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
31427 "FOR READ AND WRITE>."
31432 #: ../fuse/guestmount.pod:225
31433 msgid "B<-x> | B<--trace>"
31438 #: ../fuse/guestmount.pod:227
31439 msgid "Trace libguestfs calls and entry into each FUSE function."
31444 #: ../fuse/guestmount.pod:229
31445 msgid "This also stops the daemon from forking into the background."
31450 #: ../fuse/guestmount.pod:235
31452 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
31453 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
31459 #: ../tools/virt-edit.pl:34
31460 msgid "virt-edit - Edit a file in a virtual machine"
31465 #: ../tools/virt-edit.pl:38
31468 " virt-edit [--options] domname file\n"
31474 #: ../tools/virt-edit.pl:40
31477 " virt-edit [--options] disk.img [disk.img ...] file\n"
31483 #: ../tools/virt-edit.pl:42
31486 " virt-edit [domname|disk.img] file -e 'expr'\n"
31492 #: ../tools/virt-edit.pl:46
31494 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
31495 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
31496 "doing this, but doesn't catch all cases."
31501 #: ../tools/virt-edit.pl:52
31503 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
31504 "the named virtual machine (or disk image)."
31509 #: ../tools/virt-edit.pl:55
31511 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
31512 "you should look at the L<guestfish(1)> tool."
31517 #: ../tools/virt-edit.pl:60
31518 msgid "Edit the named files interactively:"
31523 #: ../tools/virt-edit.pl:62
31526 " virt-edit mydomain /boot/grub/grub.conf\n"
31532 #: ../tools/virt-edit.pl:64
31535 " virt-edit mydomain /etc/passwd\n"
31541 #: ../tools/virt-edit.pl:66
31543 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
31544 "below). To change the init default level to 5:"
31549 #: ../tools/virt-edit.pl:70
31552 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
31558 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:106
31559 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113
31560 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
31561 msgid "Display brief help."
31566 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114
31567 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
31568 #: ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171
31569 #: ../tools/virt-list-partitions.pl:72
31570 msgid "Display version number and exit."
31575 #: ../tools/virt-edit.pl:96
31576 msgid "B<--backup extension> | B<-b extension>"
31581 #: ../tools/virt-edit.pl:98
31583 "Create a backup of the original file I<in the guest disk image>. The backup "
31584 "has the original filename with C<extension> added."
31589 #: ../tools/virt-edit.pl:101
31591 "Usually the first character of C<extension> would be a dot C<.> so you would "
31597 #: ../tools/virt-edit.pl:104
31600 " virt-edit -b .orig [etc]\n"
31606 #: ../tools/virt-edit.pl:106
31607 msgid "By default, no backup file is made."
31612 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128
31613 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127
31614 #: ../tools/virt-list-partitions.pl:78
31615 msgid "B<--connect URI> | B<-c URI>"
31620 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130
31621 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129
31622 #: ../tools/virt-list-partitions.pl:80
31624 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
31625 "to the default libvirt hypervisor."
31630 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133
31631 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132
31632 #: ../tools/virt-list-partitions.pl:83
31634 "If you specify guest block devices directly, then libvirt is not used at all."
31639 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140
31640 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
31641 #: ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
31642 msgid "B<--format> raw"
31647 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142
31648 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141
31649 #: ../tools/virt-list-partitions.pl:92
31651 "Specify the format of disk images given on the command line. If this is "
31652 "omitted then the format is autodetected from the content of the disk image."
31657 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146
31658 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145
31659 #: ../tools/virt-list-partitions.pl:96
31661 "If disk images are requested from libvirt, then this program asks libvirt "
31662 "for this information. In this case, the value of the format parameter is "
31668 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150
31669 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
31670 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149
31671 #: ../tools/virt-list-partitions.pl:100
31673 "If working with untrusted raw-format guest disk images, you should ensure "
31674 "the format is always specified."
31679 #: ../tools/virt-edit.pl:141
31680 msgid "B<--expr EXPR> | B<-e EXPR>"
31685 #: ../tools/virt-edit.pl:143
31687 "Instead of launching the external editor, non-interactively apply the Perl "
31688 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
31694 #: ../tools/virt-edit.pl:147
31696 "Be careful to properly quote the expression to prevent it from being altered "
31702 #: ../tools/virt-edit.pl:268
31703 msgid "NON-INTERACTIVE EDITING"
31708 #: ../tools/virt-edit.pl:270
31710 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
31711 "administrator can interactively edit the file."
31716 #: ../tools/virt-edit.pl:273
31718 "There are two ways also to use C<virt-edit> from scripts in order to make "
31719 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
31720 "like this, it's less error-prone to write scripts directly using the "
31721 "libguestfs API and Augeas for configuration file editing.)"
31726 #: ../tools/virt-edit.pl:279
31728 "The first method is to temporarily set C<$EDITOR> to any script or program "
31729 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
31730 "update C<tmpfile> in place however it likes."
31735 #: ../tools/virt-edit.pl:283
31737 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
31738 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
31739 "instances of C<foo> with C<bar> in a file:"
31744 #: ../tools/virt-edit.pl:287
31747 " virt-edit domname filename -e 's/foo/bar/'\n"
31753 #: ../tools/virt-edit.pl:289
31755 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
31756 "For example to delete root's password you could do:"
31761 #: ../tools/virt-edit.pl:292
31764 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
31770 #: ../tools/virt-edit.pl:294
31772 "What really happens is that the snippet is evaluated as a Perl expression "
31773 "for each line of the file. The line, including the final C<\\n>, is passed "
31774 "in C<$_> and the expression should update C<$_> or leave it unchanged."
31779 #: ../tools/virt-edit.pl:299
31781 "To delete a line, set C<$_> to the empty string. For example, to delete the "
31782 "C<apache> user account from the password file you can do:"
31787 #: ../tools/virt-edit.pl:302
31790 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
31796 #: ../tools/virt-edit.pl:304
31798 "To insert a line, prepend or append it to C<$_>. However appending lines to "
31799 "the end of the file is rather difficult this way since there is no concept "
31800 "of \"last line of the file\" - your expression just doesn't get called "
31801 "again. You might want to use the first method (setting C<$EDITOR>) if you "
31807 #: ../tools/virt-edit.pl:310
31809 "The variable C<$lineno> contains the current line number. As is "
31810 "traditional, the first line in the file is number C<1>."
31815 #: ../tools/virt-edit.pl:313
31817 "The return value from the expression is ignored, but the expression may call "
31818 "C<die> in order to abort the whole program, leaving the original file "
31824 #: ../tools/virt-edit.pl:317
31826 "Remember when matching the end of a line that C<$_> may contain the final C<"
31827 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
31828 "newline then neither of these. Thus to match or substitute some text at the "
31829 "end of a line, use this regular expression:"
31834 #: ../tools/virt-edit.pl:322
31837 " /some text(\\r?\\n)?$/\n"
31843 #: ../tools/virt-edit.pl:324
31845 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
31846 "$_> itself (since that would remove all newlines from the file):"
31851 #: ../tools/virt-edit.pl:328
31854 " my $m = $_; chomp $m; $m =~ /some text$/\n"
31860 #: ../tools/virt-edit.pl:334
31866 #: ../tools/virt-edit.pl:336
31868 "If set, this string is used as the editor. It may contain arguments, eg. C<"
31874 #: ../tools/virt-edit.pl:339
31875 msgid "If not set, C<vi> is used."
31880 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559
31881 #: ../tools/virt-resize.pl:1476 ../tools/virt-list-filesystems.pl:182
31882 #: ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:527
31883 #: ../tools/virt-list-partitions.pl:250
31884 msgid "SHELL QUOTING"
31889 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567
31890 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
31891 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:529
31892 #: ../tools/virt-list-partitions.pl:252
31894 "Libvirt guest names can contain arbitrary characters, some of which have "
31895 "meaning to the shell such as C<#> and space. You may need to quote or "
31896 "escape these characters on the command line. See the shell manual page L<sh"
31897 "(1)> for details."
31901 #: ../tools/virt-edit.pl:352
31903 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
31904 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
31905 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
31910 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:598
31911 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
31912 #: ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:559
31913 #: ../tools/virt-list-partitions.pl:269
31919 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:600
31920 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
31921 #: ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:561
31922 #: ../tools/virt-list-partitions.pl:271
31923 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
31928 #: ../tools/virt-edit.pl:370 ../tools/virt-list-partitions.pl:275
31929 msgid "Copyright (C) 2009-2010 Red Hat Inc."
31934 #: ../tools/virt-win-reg.pl:37
31936 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
31941 #: ../tools/virt-win-reg.pl:41
31944 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
31950 #: ../tools/virt-win-reg.pl:43
31953 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
31959 #: ../tools/virt-win-reg.pl:45
31962 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
31968 #: ../tools/virt-win-reg.pl:47
31971 " virt-win-reg --merge domname [input.reg ...]\n"
31977 #: ../tools/virt-win-reg.pl:49
31980 " virt-win-reg [--options] disk.img ... # instead of domname\n"
31986 #: ../tools/virt-win-reg.pl:53
31988 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
31989 "virtual machines. If you do this, you I<will> get irreversible disk "
31990 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
31991 "but doesn't catch all cases."
31996 #: ../tools/virt-win-reg.pl:58
31998 "Modifying the Windows Registry is an inherently risky operation. The format "
31999 "is deliberately obscure and undocumented, and Registry changes can leave the "
32000 "system unbootable. Therefore when using the C<--merge> option, make sure "
32001 "you have a reliable backup first."
32006 #: ../tools/virt-win-reg.pl:65
32008 "This program can export and merge Windows Registry entries from a Windows "
32014 #: ../tools/virt-win-reg.pl:68
32016 "The first parameter is the libvirt guest name or the raw disk image of a "
32022 #: ../tools/virt-win-reg.pl:71
32024 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
32025 "exported (recursively). For example:"
32030 #: ../tools/virt-win-reg.pl:74
32033 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
32039 #: ../tools/virt-win-reg.pl:76
32041 "You can also display single values from within registry keys, for example:"
32046 #: ../tools/virt-win-reg.pl:79
32049 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
32050 " $ virt-win-reg Windows7 $cvkey ProductName\n"
32051 " Windows 7 Enterprise\n"
32057 #: ../tools/virt-win-reg.pl:83
32059 "With C<--merge>, you can merge a textual regedit file into the Windows "
32065 #: ../tools/virt-win-reg.pl:86
32068 " $ virt-win-reg --merge Windows7 changes.reg\n"
32074 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
32080 #: ../tools/virt-win-reg.pl:90
32082 "This program is only meant for simple access to the registry. If you want "
32083 "to do complicated things with the registry, we suggest you download the "
32084 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
32085 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
32086 "L<hivexregedit(1)>."
32091 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
32097 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
32098 msgid "Enable debugging messages."
32103 #: ../tools/virt-win-reg.pl:157
32109 #: ../tools/virt-win-reg.pl:159
32111 "In merge mode, this merges a textual regedit file into the Windows Registry "
32112 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
32113 "displays or exports Registry entries instead."
32118 #: ../tools/virt-win-reg.pl:163
32120 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
32121 "result in disk corruption. However exporting (without this flag) is always "
32127 #: ../tools/virt-win-reg.pl:171
32128 msgid "B<--encoding> UTF-16LE|ASCII"
32133 #: ../tools/virt-win-reg.pl:173
32135 "When merging (only), you may need to specify the encoding for strings to be "
32136 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
32137 "(3)/ENCODING STRINGS>."
32142 #: ../tools/virt-win-reg.pl:177
32144 "The default is to use UTF-16LE, which should work with recent versions of "
32150 #: ../tools/virt-win-reg.pl:402
32151 msgid "SUPPORTED SYSTEMS"
32156 #: ../tools/virt-win-reg.pl:404
32158 "The program currently supports Windows NT-derived guests starting with "
32159 "Windows XP through to at least Windows 7."
32164 #: ../tools/virt-win-reg.pl:407
32166 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
32167 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
32168 "and C<HKEY_USERS\\.DEFAULT>."
32173 #: ../tools/virt-win-reg.pl:411
32175 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
32181 #: ../tools/virt-win-reg.pl:414
32183 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
32189 #: ../tools/virt-win-reg.pl:417
32195 #: ../tools/virt-win-reg.pl:419
32197 "C<virt-win-reg> expects that regedit files have already been reencoded in "
32198 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
32199 "style line endings. Since Windows regedit files are often in UTF-16LE with "
32200 "Windows-style line endings, you may need to reencode the whole file before "
32201 "or after processing."
32206 #: ../tools/virt-win-reg.pl:425
32208 "To reencode a file from Windows format to Linux (before processing it with "
32209 "the C<--merge> option), you would do something like this:"
32214 #: ../tools/virt-win-reg.pl:428
32217 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
32223 #: ../tools/virt-win-reg.pl:430
32225 "To go in the opposite direction, after exporting and before sending the file "
32226 "to a Windows user, do something like this:"
32231 #: ../tools/virt-win-reg.pl:433
32234 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
32240 #: ../tools/virt-win-reg.pl:435
32241 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
32246 #: ../tools/virt-win-reg.pl:437
32248 "If you are unsure about the current encoding, use the L<file(1)> command. "
32249 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
32250 "style (CRLF) line endings, like this:"
32255 #: ../tools/virt-win-reg.pl:441
32258 " $ file software.reg\n"
32259 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
32260 " with CRLF line terminators\n"
32266 #: ../tools/virt-win-reg.pl:445
32267 msgid "This file would need conversion before you could C<--merge> it."
32272 #: ../tools/virt-win-reg.pl:447
32273 msgid "CurrentControlSet etc."
32278 #: ../tools/virt-win-reg.pl:449
32280 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
32281 "Registry at the level of the hive file, and therefore you cannot modify "
32287 #: ../tools/virt-win-reg.pl:453
32289 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
32290 "circumstances it might refer to another control set. The way to find out is "
32291 "to look at the C<HKLM\\SYSTEM\\Select> key:"
32296 #: ../tools/virt-win-reg.pl:457
32299 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
32300 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
32301 " \"Current\"=dword:00000001\n"
32302 " \"Default\"=dword:00000001\n"
32303 " \"Failed\"=dword:00000000\n"
32304 " \"LastKnownGood\"=dword:00000002\n"
32310 #: ../tools/virt-win-reg.pl:464
32311 msgid "\"Current\" is the one which Windows will choose when it boots."
32316 #: ../tools/virt-win-reg.pl:466
32318 "Similarly, other C<Current...> keys in the path may need to be replaced."
32323 #: ../tools/virt-win-reg.pl:469
32324 msgid "WINDOWS TIPS"
32329 #: ../tools/virt-win-reg.pl:471
32331 "Note that some of these tips modify the guest disk image. The guest I<must> "
32332 "be shut off, else you will get disk corruption."
32337 #: ../tools/virt-win-reg.pl:474
32338 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
32343 #: ../tools/virt-win-reg.pl:476
32345 "Prepare a DOS batch script, VBScript or executable. Upload this using "
32346 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
32347 "is uploaded into C<C:\\>:"
32352 #: ../tools/virt-win-reg.pl:480
32355 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
32361 #: ../tools/virt-win-reg.pl:482
32362 msgid "Prepare a regedit file containing the registry change:"
32367 #: ../tools/virt-win-reg.pl:484
32370 " cat > test.reg <<'EOF'\n"
32371 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
32372 " \"Test\"=\"c:\\\\test.bat\"\n"
32379 #: ../tools/virt-win-reg.pl:489
32381 "In this example we use the key C<RunOnce> which means that the script will "
32382 "run precisely once when the first user logs in. If you want it to run every "
32383 "time a user logs in, replace C<RunOnce> with C<Run>."
32388 #: ../tools/virt-win-reg.pl:493
32389 msgid "Now update the registry:"
32394 #: ../tools/virt-win-reg.pl:495
32397 " virt-win-reg --merge WindowsGuest test.reg\n"
32403 #: ../tools/virt-win-reg.pl:497
32404 msgid "INSTALLING A SERVICE"
32409 #: ../tools/virt-win-reg.pl:499
32411 "This section assumes you are familiar with Windows services, and you either "
32412 "have a program which handles the Windows Service Control Protocol directly "
32413 "or you want to run any program using a service wrapper like SrvAny or the "
32419 #: ../tools/virt-win-reg.pl:504
32421 "First upload the program and optionally the service wrapper. In this case "
32422 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
32427 #: ../tools/virt-win-reg.pl:508
32430 " guestfish -i -d WindowsGuest <<EOF\n"
32431 " upload rhsrvany.exe /rhsrvany.exe\n"
32432 " upload test.exe /test.exe\n"
32439 #: ../tools/virt-win-reg.pl:513
32441 "Prepare a regedit file containing the registry changes. In this example, "
32442 "the first registry change is needed for the service itself or the service "
32443 "wrapper (if used). The second registry change is only needed because I am "
32444 "using the RHSrvAny service wrapper."
32449 #: ../tools/virt-win-reg.pl:518
32452 " cat > service.reg <<'EOF'\n"
32453 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
32454 " \"Type\"=dword:00000010\n"
32455 " \"Start\"=dword:00000002\n"
32456 " \"ErrorControl\"=dword:00000001\n"
32457 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
32458 " \"DisplayName\"=\"RHSrvAny\"\n"
32459 " \"ObjectName\"=\"NetworkService\"\n"
32465 #: ../tools/virt-win-reg.pl:527
32468 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
32469 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
32470 " \"PWD\"=\"c:\\\\Temp\"\n"
32477 #: ../tools/virt-win-reg.pl:538
32479 "For use of C<ControlSet001> see the section above in this manual page. You "
32480 "may need to adjust this according to the control set that is in use by the "
32486 #: ../tools/virt-win-reg.pl:544
32488 "C<\"ObjectName\"> controls the privileges that the service will have. An "
32489 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
32490 "privileged account."
32495 #: ../tools/virt-win-reg.pl:550
32497 "For the meaning of the magic numbers, see this Microsoft KB article: "
32498 "L<http://support.microsoft.com/kb/103000>."
32503 #: ../tools/virt-win-reg.pl:555
32504 msgid "Update the registry:"
32509 #: ../tools/virt-win-reg.pl:557
32512 " virt-win-reg --merge WindowsGuest service.reg\n"
32518 #: ../tools/virt-win-reg.pl:561
32520 "Be careful when passing parameters containing C<\\> (backslash) in the "
32521 "shell. Usually you will have to use 'single quotes' or double backslashes "
32522 "(but not both) to protect them from the shell."
32527 #: ../tools/virt-win-reg.pl:565
32528 msgid "Paths and value names are case-insensitive."
32533 #: ../tools/virt-win-reg.pl:574
32535 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
32536 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
32537 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
32542 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:550
32544 "When reporting bugs, please enable debugging and capture the I<complete> "
32550 #: ../tools/virt-win-reg.pl:592
32553 " export LIBGUESTFS_DEBUG=1\n"
32554 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
32560 #: ../tools/virt-win-reg.pl:595
32562 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
32568 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1510
32569 #: ../tools/virt-make-fs.pl:565
32570 msgid "Copyright (C) 2010 Red Hat Inc."
32575 #: ../tools/virt-resize.pl:42
32576 msgid "virt-resize - Resize a virtual machine disk"
32581 #: ../tools/virt-resize.pl:46
32584 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
32585 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
32586 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
32592 #: ../tools/virt-resize.pl:52
32594 "Virt-resize is a tool which can resize a virtual machine disk, making it "
32595 "larger or smaller overall, and resizing or deleting any partitions contained "
32601 #: ../tools/virt-resize.pl:56
32603 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
32604 "not> be used on live virtual machines - for consistent results, shut the "
32605 "virtual machine down before resizing it."
32610 #: ../tools/virt-resize.pl:60
32612 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
32613 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
32618 #: ../tools/virt-resize.pl:66
32620 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
32621 "fill the extra 5GB of space."
32625 #: ../tools/virt-resize.pl:69
32628 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
32629 " virt-filesystems --long -h --all -a olddisk\n"
32630 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
32631 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
32637 #: ../tools/virt-resize.pl:74
32639 "As above, but make the /boot partition 200MB bigger, while giving the "
32640 "remaining space to /dev/sda2:"
32645 #: ../tools/virt-resize.pl:77
32648 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
32654 #: ../tools/virt-resize.pl:79
32655 msgid "As above, but the output format will be uncompressed qcow2:"
32660 #: ../tools/virt-resize.pl:81
32663 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
32664 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
32670 #: ../tools/virt-resize.pl:84
32671 msgid "DETAILED USAGE"
32676 #: ../tools/virt-resize.pl:86
32677 msgid "EXPANDING A VIRTUAL MACHINE DISK"
32682 #: ../tools/virt-resize.pl:90
32683 msgid "1. Shut down the virtual machine"
32688 #: ../tools/virt-resize.pl:92
32689 msgid "2. Locate input disk image"
32694 #: ../tools/virt-resize.pl:94
32696 "Locate the input disk image (ie. the file or device on the host containing "
32697 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
32698 "dumpxml> like this to find the disk image name:"
32703 #: ../tools/virt-resize.pl:98
32706 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
32707 " Found 1 nodes:\n"
32709 " <source dev=\"/dev/vg/lv_guest\" />\n"
32715 #: ../tools/virt-resize.pl:103
32716 msgid "3. Look at current sizing"
32721 #: ../tools/virt-resize.pl:105
32722 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
32727 #: ../tools/virt-resize.pl:108
32730 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
32731 " Name Type Size Parent\n"
32732 " /dev/sda1 partition 101M /dev/sda\n"
32733 " /dev/sda2 partition 7.9G /dev/sda\n"
32734 " /dev/sda device 8.0G -\n"
32740 #: ../tools/virt-resize.pl:114
32742 "(This example is a virtual machine with an 8 GB disk which we would like to "
32743 "expand up to 10 GB)."
32748 #: ../tools/virt-resize.pl:117
32749 msgid "4. Create output disk"
32754 #: ../tools/virt-resize.pl:119
32756 "Virt-resize cannot do in-place disk modifications. You have to have space "
32757 "to store the resized output disk."
32762 #: ../tools/virt-resize.pl:122
32764 "To store the resized disk image in a file, create a file of a suitable size:"
32769 #: ../tools/virt-resize.pl:125
32772 " # rm -f outdisk\n"
32773 " # truncate -s 10G outdisk\n"
32779 #: ../tools/virt-resize.pl:128
32780 msgid "Or use L<lvcreate(1)> to create a logical volume:"
32785 #: ../tools/virt-resize.pl:130
32788 " # lvcreate -L 10G -n lv_name vg_name\n"
32794 #: ../tools/virt-resize.pl:132
32795 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
32800 #: ../tools/virt-resize.pl:134
32803 " # virsh pool-list\n"
32804 " # virsh vol-create-as poolname newvol 10G\n"
32810 #: ../tools/virt-resize.pl:137
32816 #: ../tools/virt-resize.pl:139
32818 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
32819 "file) and the output disk. The output disk is the one created in the "
32825 #: ../tools/virt-resize.pl:143
32828 " # virt-resize indisk outdisk\n"
32834 #: ../tools/virt-resize.pl:145
32836 "This command just copies disk image C<indisk> to disk image C<outdisk> "
32837 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
32838 "larger, then an extra, empty partition is created at the end of the disk "
32839 "covering the extra space. If C<outdisk> is smaller, then it will give an "
32845 #: ../tools/virt-resize.pl:151
32847 "More realistically you'd want to expand existing partitions in the disk "
32848 "image by passing extra options (for the full list see the L</OPTIONS> "
32854 #: ../tools/virt-resize.pl:155
32856 "L</--expand> is the most useful option. It expands the named partition "
32857 "within the disk to fill any extra space:"
32862 #: ../tools/virt-resize.pl:158
32865 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
32871 #: ../tools/virt-resize.pl:160
32873 "(In this case, an extra partition is I<not> created at the end of the disk, "
32874 "because there will be no unused space)."
32879 #: ../tools/virt-resize.pl:163
32881 "L</--resize> is the other commonly used option. The following would "
32882 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
32883 "rest of the available space:"
32888 #: ../tools/virt-resize.pl:167
32891 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
32892 " indisk outdisk\n"
32898 #: ../tools/virt-resize.pl:170
32900 "If the expanded partition in the image contains a filesystem or LVM PV, then "
32901 "if virt-resize knows how, it will resize the contents, the equivalent of "
32902 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
32903 ">. However virt-resize does not know how to resize some filesystems, so you "
32904 "would have to online resize them after booting the guest."
32909 #: ../tools/virt-resize.pl:177
32910 msgid "Other options are covered below."
32915 #: ../tools/virt-resize.pl:179
32921 #: ../tools/virt-resize.pl:181
32922 msgid "Thoroughly test the new disk image I<before> discarding the old one."
32927 #: ../tools/virt-resize.pl:183
32928 msgid "If you are using libvirt, edit the XML to point at the new disk:"
32933 #: ../tools/virt-resize.pl:185
32936 " # virsh edit guestname\n"
32942 #: ../tools/virt-resize.pl:187
32944 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
32945 "html#elementsDisks>"
32950 #: ../tools/virt-resize.pl:190
32951 msgid "Then start up the domain with the new, resized disk:"
32956 #: ../tools/virt-resize.pl:192
32959 " # virsh start guestname\n"
32965 #: ../tools/virt-resize.pl:194
32967 "and check that it still works. See also the L</NOTES> section below for "
32968 "additional information."
32973 #: ../tools/virt-resize.pl:197
32974 msgid "7. Resize LVs etc inside the guest"
32979 #: ../tools/virt-resize.pl:199
32980 msgid "(This can also be done offline using L<guestfish(1)>)"
32985 #: ../tools/virt-resize.pl:201
32987 "Once the guest has booted you should see the new space available, at least "
32988 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
32989 "may need to resize LVs inside PVs, and also resize filesystem types that "
32990 "virt-resize does not know how to expand."
32995 #: ../tools/virt-resize.pl:208
32996 msgid "SHRINKING A VIRTUAL MACHINE DISK"
33001 #: ../tools/virt-resize.pl:210
33003 "Shrinking is somewhat more complex than expanding, and only an overview is "
33009 #: ../tools/virt-resize.pl:213
33011 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
33012 "filesystems). The user has to shrink content before passing the disk image "
33013 "to virt-resize, and virt-resize will check that the content has been shrunk "
33019 #: ../tools/virt-resize.pl:218
33020 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
33025 #: ../tools/virt-resize.pl:220
33027 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
33028 "steps 3 and 4 above to allocate a new disk image."
33033 #: ../tools/virt-resize.pl:223
33035 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
33040 #: ../tools/virt-resize.pl:226
33041 msgid "IGNORING OR DELETING PARTITIONS"
33046 #: ../tools/virt-resize.pl:228
33048 "virt-resize also gives a convenient way to ignore or delete partitions when "
33049 "copying from the input disk to the output disk. Ignoring a partition speeds "
33050 "up the copy where you don't care about the existing contents of a "
33051 "partition. Deleting a partition removes it completely, but note that it "
33052 "also renumbers any partitions after the one which is deleted, which can "
33053 "leave some guests unbootable."
33058 #: ../tools/virt-resize.pl:235
33059 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
33064 #: ../tools/virt-resize.pl:237
33066 "If the input disk is in qcow2 format, then you may prefer that the output is "
33067 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
33068 "the fly. The output format is simply determined by the format of the empty "
33069 "output container that you provide. Thus to create qcow2 output, use:"
33074 #: ../tools/virt-resize.pl:243
33077 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
33083 #: ../tools/virt-resize.pl:245
33084 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
33089 #: ../tools/virt-resize.pl:247
33090 msgid "Similarly, to get non-sparse raw output use:"
33095 #: ../tools/virt-resize.pl:249
33098 " fallocate -l size outdisk\n"
33104 #: ../tools/virt-resize.pl:251
33106 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
33107 "dev/zero of=outdisk bs=1M count=..>)"
33112 #: ../tools/virt-resize.pl:264
33113 msgid "Display help."
33118 #: ../tools/virt-resize.pl:278
33119 msgid "B<--resize part=size>"
33124 #: ../tools/virt-resize.pl:280
33126 "Resize the named partition (expanding or shrinking it) so that it has the "
33132 #: ../tools/virt-resize.pl:283
33134 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
33135 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
33136 "Exabytes; or as a percentage of the current size; or as a relative number or "
33137 "percentage. For example:"
33142 #: ../tools/virt-resize.pl:288
33145 " --resize /dev/sda2=10G\n"
33151 #: ../tools/virt-resize.pl:290
33154 " --resize /dev/sda4=90%\n"
33160 #: ../tools/virt-resize.pl:292
33163 " --resize /dev/sda2=+1G\n"
33169 #: ../tools/virt-resize.pl:294
33172 " --resize /dev/sda2=-200M\n"
33178 #: ../tools/virt-resize.pl:296
33181 " --resize /dev/sda1=+128K\n"
33187 #: ../tools/virt-resize.pl:298
33190 " --resize /dev/sda1=+10%\n"
33196 #: ../tools/virt-resize.pl:300
33199 " --resize /dev/sda1=-10%\n"
33205 #: ../tools/virt-resize.pl:302
33207 "You can increase the size of any partition. Virt-resize will expand the "
33208 "direct content of the partition if it knows how (see C<--expand> below)."
33213 #: ../tools/virt-resize.pl:306
33215 "You can only I<decrease> the size of partitions that contain filesystems or "
33216 "PVs which have already been shrunk. Virt-resize will check this has been "
33217 "done before proceeding, or else will print an error (see also C<--resize-"
33223 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
33224 #: ../tools/virt-resize.pl:420
33225 msgid "You can give this option multiple times."
33230 #: ../tools/virt-resize.pl:317
33231 msgid "B<--resize-force part=size>"
33236 #: ../tools/virt-resize.pl:319
33238 "This is the same as C<--resize> except that it will let you decrease the "
33239 "size of any partition. Generally this means you will lose any data which "
33240 "was at the end of the partition you shrink, but you may not care about that "
33241 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
33242 "as a swap partition)."
33247 #: ../tools/virt-resize.pl:325
33248 msgid "See also the C<--ignore> option."
33253 #: ../tools/virt-resize.pl:331
33254 msgid "B<--expand part>"
33259 #: ../tools/virt-resize.pl:333
33261 "Expand the named partition so it uses up all extra space (space left over "
33262 "after any other resize changes that you request have been done)."
33267 #: ../tools/virt-resize.pl:336
33269 "If virt-resize knows how, it will expand the direct content of the "
33270 "partition. For example, if the partition is an LVM PV, it will expand the "
33271 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
33272 "content it doesn't know about alone."
33277 #: ../tools/virt-resize.pl:341
33278 msgid "Currently virt-resize can resize:"
33283 #: ../tools/virt-resize.pl:347
33285 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
33291 #: ../tools/virt-resize.pl:352
33293 "NTFS filesystems contained directly in a partition, if libguestfs was "
33294 "compiled with support for NTFS."
33299 #: ../tools/virt-resize.pl:355
33301 "The filesystem must have been shut down consistently last time it was used. "
33302 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
33303 "consistency check, so at the first boot after resizing Windows will check "
33309 #: ../tools/virt-resize.pl:362
33311 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
33312 "inside the PV, but see the C<--LV-expand> option. The user could also "
33313 "resize LVs as desired after boot."
33318 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
33319 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
33324 #: ../tools/virt-resize.pl:374
33325 msgid "B<--shrink part>"
33330 #: ../tools/virt-resize.pl:376
33332 "Shrink the named partition until the overall disk image fits in the "
33333 "destination. The named partition B<must> contain a filesystem or PV which "
33334 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
33335 "online tools). Virt-resize will check this and give an error if it has not "
33341 #: ../tools/virt-resize.pl:382
33343 "The amount by which the overall disk must be shrunk (after carrying out all "
33344 "other operations requested by the user) is called the \"deficit\". For "
33345 "example, a straight copy (assume no other operations) from a 5GB disk image "
33346 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
33347 "would give an error unless the user specified a partition to shrink and that "
33348 "partition had more than a gigabyte of free space."
33353 #: ../tools/virt-resize.pl:396
33354 msgid "B<--ignore part>"
33359 #: ../tools/virt-resize.pl:398
33361 "Ignore the named partition. Effectively this means the partition is "
33362 "allocated on the destination disk, but the content is not copied across from "
33363 "the source disk. The content of the partition will be blank (all zero "
33369 #: ../tools/virt-resize.pl:409
33370 msgid "B<--delete part>"
33375 #: ../tools/virt-resize.pl:411
33377 "Delete the named partition. It would be more accurate to describe this as "
33378 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
33379 "the original disk image is left intact."
33384 #: ../tools/virt-resize.pl:415
33386 "Note that when you delete a partition, then anything contained in the "
33387 "partition is also deleted. Furthermore, this causes any partitions that "
33388 "come after to be I<renumbered>, which can easily make your guest unbootable."
33393 #: ../tools/virt-resize.pl:426
33394 msgid "B<--LV-expand logvol>"
33399 #: ../tools/virt-resize.pl:428
33401 "This takes the logical volume and, as a final step, expands it to fill all "
33402 "the space available in its volume group. A typical usage, assuming a Linux "
33403 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
33404 "lv_root> would be:"
33409 #: ../tools/virt-resize.pl:433
33412 " virt-resize indisk outdisk \\\n"
33413 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
33419 #: ../tools/virt-resize.pl:436
33421 "This would first expand the partition (and PV), and then expand the root "
33422 "device to fill the extra space in the PV."
33427 #: ../tools/virt-resize.pl:439
33429 "The contents of the LV are also resized if virt-resize knows how to do "
33430 "that. You can stop virt-resize from trying to expand the content by using "
33431 "the option C<--no-expand-content>."
33436 #: ../tools/virt-resize.pl:443
33437 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
33442 #: ../tools/virt-resize.pl:446
33444 "You can give this option multiple times, I<but> it doesn't make sense to do "
33445 "this unless the logical volumes you specify are all in different volume "
33451 #: ../tools/virt-resize.pl:454
33452 msgid "B<--no-copy-boot-loader>"
33457 #: ../tools/virt-resize.pl:456
33459 "By default, virt-resize copies over some sectors at the start of the disk "
33460 "(up to the beginning of the first partition). Commonly these sectors "
33461 "contain the Master Boot Record (MBR) and the boot loader, and are required "
33462 "in order for the guest to boot correctly."
33467 #: ../tools/virt-resize.pl:461
33469 "If you specify this flag, then this initial copy is not done. You may need "
33470 "to reinstall the boot loader in this case."
33475 #: ../tools/virt-resize.pl:469
33476 msgid "B<--no-extra-partition>"
33481 #: ../tools/virt-resize.pl:471
33483 "By default, virt-resize creates an extra partition if there is any extra, "
33484 "unused space after all resizing has happened. Use this option to prevent "
33485 "the extra partition from being created. If you do this then the extra space "
33486 "will be inaccessible until you run fdisk, parted, or some other partitioning "
33487 "tool in the guest."
33492 #: ../tools/virt-resize.pl:477
33494 "Note that if the surplus space is smaller than 10 MB, no extra partition "
33500 #: ../tools/virt-resize.pl:484
33501 msgid "B<--no-expand-content>"
33506 #: ../tools/virt-resize.pl:486
33508 "By default, virt-resize will try to expand the direct contents of "
33509 "partitions, if it knows how (see C<--expand> option above)."
33514 #: ../tools/virt-resize.pl:489
33516 "If you give the C<--no-expand-content> option then virt-resize will not "
33522 #: ../tools/virt-resize.pl:496
33523 msgid "B<-d> | B<--debug>"
33528 #: ../tools/virt-resize.pl:504
33529 msgid "B<-n> | B<--dryrun>"
33534 #: ../tools/virt-resize.pl:506
33535 msgid "Print a summary of what would be done, but don't do anything."
33540 #: ../tools/virt-resize.pl:512
33541 msgid "B<-q> | B<--quiet>"
33546 #: ../tools/virt-resize.pl:514
33547 msgid "Don't print the summary."
33552 #: ../tools/virt-resize.pl:522
33554 "Specify the format of the input disk image. If this flag is not given then "
33555 "it is auto-detected from the image itself."
33560 #: ../tools/virt-resize.pl:528
33562 "Note that this option I<does not> affect the output format. See L</QCOW2 "
33563 "AND NON-SPARSE RAW FORMATS>."
33568 #: ../tools/virt-resize.pl:535
33569 msgid "B<--output-format> raw"
33574 #: ../tools/virt-resize.pl:537
33576 "Specify the format of the output disk image. If this flag is not given then "
33577 "it is auto-detected from the image itself."
33582 #: ../tools/virt-resize.pl:543
33584 "Note that you still need to create the output disk with the right format. "
33585 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
33590 #: ../tools/virt-resize.pl:1419
33596 #: ../tools/virt-resize.pl:1421
33597 msgid "\"Partition 1 does not end on cylinder boundary.\""
33602 #: ../tools/virt-resize.pl:1423
33604 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
33605 "means the partitions will not be aligned to the ancient CHS geometry. "
33606 "However CHS geometry is meaningless for disks manufactured since the early "
33607 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
33608 "cylinders is not required by any modern operating system."
33613 #: ../tools/virt-resize.pl:1430
33614 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
33619 #: ../tools/virt-resize.pl:1432
33621 "In Windows Vista and later versions, Microsoft switched to using a separate "
33622 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
33623 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
33624 "the boot partition. Doing so seems to break the guest completely. However "
33625 "expanding the second partition (ie. C: drive) should work."
33630 #: ../tools/virt-resize.pl:1439
33632 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
33633 "NTFS partitions have been expanded. This is just a safety check and (unless "
33634 "it find errors) is nothing to worry about."
33639 #: ../tools/virt-resize.pl:1443
33640 msgid "GUEST BOOT STUCK AT \"GRUB\""
33645 #: ../tools/virt-resize.pl:1445
33647 "If a Linux guest does not boot after resizing, and the boot is stuck after "
33648 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
33649 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
33650 "although we think is to do with partition alignment."
33655 #: ../tools/virt-resize.pl:1450
33658 " guestfish -i -a newdisk\n"
33659 " ><fs> cat /boot/grub/device.map\n"
33660 " # check the contents of this file are sensible or\n"
33661 " # edit the file if necessary\n"
33662 " ><fs> grub-install / /dev/vda\n"
33669 #: ../tools/virt-resize.pl:1457
33671 "For more flexible guest reconfiguration, including if you need to specify "
33672 "other parameters to grub-install, use L<virt-rescue(1)>."
33677 #: ../tools/virt-resize.pl:1460
33678 msgid "ALTERNATIVE TOOLS"
33683 #: ../tools/virt-resize.pl:1462
33685 "There are several proprietary tools for resizing partitions. We won't "
33686 "mention any here."
33691 #: ../tools/virt-resize.pl:1465
33693 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
33694 "operations on disk images. They can resize and move partitions, but I don't "
33695 "think they can do anything with the contents, and they certainly don't "
33701 #: ../tools/virt-resize.pl:1470
33703 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
33704 "but at a much lower level. You will probably end up hand-calculating sector "
33705 "offsets, which is something that virt-resize was designed to avoid. If you "
33706 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
33712 #: ../tools/virt-resize.pl:1485
33714 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
33715 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
33716 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
33717 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
33718 "libguestfs.org/>."
33723 #: ../tools/virt-list-filesystems.pl:32
33725 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
33730 #: ../tools/virt-list-filesystems.pl:36
33733 " virt-list-filesystems [--options] domname\n"
33739 #: ../tools/virt-list-filesystems.pl:38
33742 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
33748 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
33750 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
33756 #: ../tools/virt-list-filesystems.pl:45
33758 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
33759 "are contained in a virtual machine or disk image."
33764 #: ../tools/virt-list-filesystems.pl:49
33766 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
33767 "functionality. For more complex cases you should look at the L<guestfish(1)"
33773 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
33774 msgid "B<-l> | B<--long>"
33779 #: ../tools/virt-list-filesystems.pl:108
33781 "With this option, C<virt-list-filesystems> displays the type of each "
33782 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
33787 #: ../tools/virt-list-filesystems.pl:115
33788 msgid "B<-a> | B<--all>"
33793 #: ../tools/virt-list-filesystems.pl:117
33795 "Normally we only show mountable filesystems. If this option is given then "
33796 "swap devices are shown too."
33801 #: ../tools/virt-list-filesystems.pl:191
33803 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
33804 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
33805 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
33810 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
33811 msgid "Copyright (C) 2009 Red Hat Inc."
33816 #: ../tools/virt-tar.pl:33
33817 msgid "virt-tar - Extract or upload files to a virtual machine"
33822 #: ../tools/virt-tar.pl:37
33825 " virt-tar [--options] -x domname directory tarball\n"
33831 #: ../tools/virt-tar.pl:39
33834 " virt-tar [--options] -u domname tarball directory\n"
33840 #: ../tools/virt-tar.pl:41
33843 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
33849 #: ../tools/virt-tar.pl:43
33852 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
33857 #: ../tools/virt-tar.pl:47
33859 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
33860 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
33865 #: ../tools/virt-tar.pl:52
33866 msgid "Download C</home> from the VM into a local tarball:"
33871 #: ../tools/virt-tar.pl:54
33874 " virt-tar -x domname /home home.tar\n"
33880 #: ../tools/virt-tar.pl:56
33883 " virt-tar -zx domname /home home.tar.gz\n"
33889 #: ../tools/virt-tar.pl:58
33890 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
33895 #: ../tools/virt-tar.pl:60
33898 " virt-tar -u domname uploadstuff.tar /tmp\n"
33904 #: ../tools/virt-tar.pl:62
33907 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
33913 #: ../tools/virt-tar.pl:66
33915 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
33916 "virtual machines. If you do this, you risk disk corruption in the VM. "
33917 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
33922 #: ../tools/virt-tar.pl:71
33924 "You can use C<-x> (extract) on live virtual machines, but you might get "
33925 "inconsistent results or errors if there is filesystem activity inside the "
33926 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
33927 "work, but the only way to guarantee consistent results is if the virtual "
33928 "machine is shut down."
33933 #: ../tools/virt-tar.pl:79
33935 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
33936 "parts of a guest filesystem. There are many possibilities: making backups, "
33937 "uploading data files, snooping on guest activity, fixing or customizing "
33943 #: ../tools/virt-tar.pl:84
33945 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
33946 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
33947 "should look at the L<guestfish(1)> tool."
33952 #: ../tools/virt-tar.pl:88
33954 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
33955 "its contents (recursively) from the virtual machine into a local tarball. "
33956 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
33957 "virtual machine. You cannot use these two options together."
33962 #: ../tools/virt-tar.pl:94
33964 "In addition, you may need to use the C<-z> (gZip) option to enable "
33965 "compression. When uploading, you have to specify C<-z> if the upload file "
33966 "is compressed because virt-tar won't detect this on its own."
33971 #: ../tools/virt-tar.pl:98
33973 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
33974 "example it cannot do PKZip files or bzip2 compression. If you want that "
33975 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
33976 "the L<libguestfs(3)> API)."
33981 #: ../tools/virt-tar.pl:156
33982 msgid "B<-x> | B<--extract> | B<--download>"
33987 #: ../tools/virt-tar.pl:158
33988 msgid "B<-u> | B<--upload>"
33993 #: ../tools/virt-tar.pl:160
33995 "Use C<-x> to extract (download) a directory from a virtual machine to a "
34001 #: ../tools/virt-tar.pl:163
34003 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
34004 "Please read the L</WARNING> section above before using this option."
34009 #: ../tools/virt-tar.pl:167
34010 msgid "You must specify exactly one of these options."
34015 #: ../tools/virt-tar.pl:173
34016 msgid "B<-z> | B<--gzip>"
34021 #: ../tools/virt-tar.pl:175
34022 msgid "Specify that the input or output tarball is gzip-compressed."
34026 #: ../tools/virt-tar.pl:288
34028 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
34029 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
34030 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
34036 #: ../tools/virt-make-fs.pl:37
34037 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
34042 #: ../tools/virt-make-fs.pl:41
34045 " virt-make-fs [--options] input.tar output.img\n"
34051 #: ../tools/virt-make-fs.pl:43
34054 " virt-make-fs [--options] input.tar.gz output.img\n"
34060 #: ../tools/virt-make-fs.pl:45
34063 " virt-make-fs [--options] directory output.img\n"
34069 #: ../tools/virt-make-fs.pl:49
34071 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
34072 "archive or some files in a directory. It is similar to tools like L<mkisofs"
34073 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
34074 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
34075 "you want to attach these filesystems to existing virtual machines (eg. to "
34076 "import large amounts of read-only data to a VM)."
34081 #: ../tools/virt-make-fs.pl:57
34082 msgid "Basic usage is:"
34087 #: ../tools/virt-make-fs.pl:59
34090 " virt-make-fs input output\n"
34096 #: ../tools/virt-make-fs.pl:61
34098 "where C<input> is either a directory containing files that you want to add, "
34099 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
34100 "C<output> is a disk image. The input type is detected automatically. The "
34101 "output disk image defaults to a raw ext2 image unless you specify extra "
34102 "flags (see L</OPTIONS> below)."
34107 #: ../tools/virt-make-fs.pl:67
34108 msgid "EXTRA SPACE"
34113 #: ../tools/virt-make-fs.pl:69
34115 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
34116 "the files that it contains, but might have extra space. Depending on how "
34117 "you are going to use the output, you might think this extra space is wasted "
34118 "and want to minimize it, or you might want to leave space so that more files "
34119 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
34120 "but you can use the C<--size> flag to leave space in the filesystem if you "
34126 #: ../tools/virt-make-fs.pl:77
34128 "An alternative way to leave extra space but not make the output image any "
34129 "bigger is to use an alternative disk image format (instead of the default "
34130 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
34131 "image format (check your hypervisor supports this before using it). This "
34132 "allows you to choose a large C<--size> but the extra space won't actually be "
34133 "allocated in the image until you try to store something in it."
34138 #: ../tools/virt-make-fs.pl:85
34140 "Don't forget that you can also use local commands including L<resize2fs(8)> "
34141 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
34142 "resize to build another image from scratch."
34147 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
34148 #: ../tools/virt-make-fs.pl:142
34154 #: ../tools/virt-make-fs.pl:91
34157 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
34163 #: ../tools/virt-make-fs.pl:93
34164 msgid "FILESYSTEM TYPE"
34169 #: ../tools/virt-make-fs.pl:95
34171 "The default filesystem type is C<ext2>. Just about any filesystem type that "
34172 "libguestfs supports can be used (but I<not> read-only formats like "
34173 "ISO9660). Here are some of the more common choices:"
34178 #: ../tools/virt-make-fs.pl:101
34184 #: ../tools/virt-make-fs.pl:103
34186 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
34187 "you are not going to use the filesystem in a way that requires the journal, "
34188 "then this is just wasted overhead."
34193 #: ../tools/virt-make-fs.pl:107
34194 msgid "I<ntfs> or I<vfat>"
34199 #: ../tools/virt-make-fs.pl:109
34200 msgid "Useful if exporting data to a Windows guest."
34205 #: ../tools/virt-make-fs.pl:111
34207 "I<Note for vfat>: The tar archive or local directory must only contain files "
34208 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
34209 "program running within libguestfs is unable to change the ownership of non-"
34210 "root files, since vfat itself does not support this."
34215 #: ../tools/virt-make-fs.pl:116
34221 #: ../tools/virt-make-fs.pl:118
34223 "Lower overhead than C<ext2>, but certain limitations on filename length and "
34224 "total filesystem size."
34229 #: ../tools/virt-make-fs.pl:125
34232 " virt-make-fs --type=minix input minixfs.img\n"
34238 #: ../tools/virt-make-fs.pl:127
34239 msgid "TO PARTITION OR NOT TO PARTITION"
34244 #: ../tools/virt-make-fs.pl:129
34245 msgid "Optionally virt-make-fs can add a partition table to the output disk."
34250 #: ../tools/virt-make-fs.pl:131
34252 "Adding a partition can make the disk image more compatible with certain "
34253 "virtualized operating systems which don't expect to see a filesystem "
34254 "directly located on a block device (Linux doesn't care and will happily "
34255 "handle both types)."
34260 #: ../tools/virt-make-fs.pl:136
34262 "On the other hand, if you have a partition table then the output image is no "
34263 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
34264 "directly on a partitioned disk image. (However libguestfs tools such as "
34265 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
34270 #: ../tools/virt-make-fs.pl:144
34271 msgid "Add an MBR partition:"
34276 #: ../tools/virt-make-fs.pl:146
34279 " virt-make-fs --partition -- input disk.img\n"
34285 #: ../tools/virt-make-fs.pl:148
34287 "If the output disk image could be terabyte-sized or larger, it's better to "
34288 "use an EFI/GPT-compatible partition table:"
34293 #: ../tools/virt-make-fs.pl:151
34296 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
34302 #: ../tools/virt-make-fs.pl:179
34303 msgid "Enable debugging information."
34308 #: ../tools/virt-make-fs.pl:185
34309 msgid "B<--size=E<lt>NE<gt>>"
34314 #: ../tools/virt-make-fs.pl:187
34315 msgid "B<--size=+E<lt>NE<gt>>"
34320 #: ../tools/virt-make-fs.pl:189
34321 msgid "B<-s E<lt>NE<gt>>"
34326 #: ../tools/virt-make-fs.pl:191
34327 msgid "B<-s +E<lt>NE<gt>>"
34332 #: ../tools/virt-make-fs.pl:193
34334 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
34339 #: ../tools/virt-make-fs.pl:196
34341 "If this option is I<not> given, then the output image will be just large "
34342 "enough to contain all the files, with not much wasted space."
34347 #: ../tools/virt-make-fs.pl:199
34349 "To choose a fixed size output disk, specify an absolute number followed by b/"
34350 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34351 "Petabytes or Exabytes. This must be large enough to contain all the input "
34352 "files, else you will get an error."
34357 #: ../tools/virt-make-fs.pl:204
34359 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
34360 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34361 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
34362 "the input files, and (approximately) an extra 200 MB free space."
34367 #: ../tools/virt-make-fs.pl:210
34369 "Note that virt-make-fs estimates free space, and therefore will not produce "
34370 "filesystems containing precisely the free space requested. (It is much more "
34371 "expensive and time-consuming to produce a filesystem which has precisely the "
34372 "desired free space)."
34377 #: ../tools/virt-make-fs.pl:219
34378 msgid "B<--format=E<lt>fmtE<gt>>"
34383 #: ../tools/virt-make-fs.pl:221
34384 msgid "B<-F E<lt>fmtE<gt>>"
34389 #: ../tools/virt-make-fs.pl:223
34390 msgid "Choose the output disk image format."
34395 #: ../tools/virt-make-fs.pl:225
34396 msgid "The default is C<raw> (raw disk image)."
34401 #: ../tools/virt-make-fs.pl:227
34403 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
34404 "that would really make sense here is C<qcow2>."
34409 #: ../tools/virt-make-fs.pl:234
34410 msgid "B<--type=E<lt>fsE<gt>>"
34415 #: ../tools/virt-make-fs.pl:236
34416 msgid "B<-t E<lt>fsE<gt>>"
34421 #: ../tools/virt-make-fs.pl:238
34422 msgid "Choose the output filesystem type."
34427 #: ../tools/virt-make-fs.pl:240
34428 msgid "The default is C<ext2>."
34433 #: ../tools/virt-make-fs.pl:242
34435 "Any filesystem which is supported read-write by libguestfs can be used here."
34440 #: ../tools/virt-make-fs.pl:249
34441 msgid "B<--partition>"
34446 #: ../tools/virt-make-fs.pl:251
34447 msgid "B<--partition=E<lt>parttypeE<gt>>"
34452 #: ../tools/virt-make-fs.pl:253
34454 "If specified, this flag adds an MBR partition table to the output disk image."
34459 #: ../tools/virt-make-fs.pl:256
34461 "You can change the partition table type, eg. C<--partition=gpt> for large "
34467 #: ../tools/virt-make-fs.pl:259
34469 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
34470 "might consider the next parameter to be the partition type. For example:"
34475 #: ../tools/virt-make-fs.pl:263
34478 " virt-make-fs --partition input.tar ...\n"
34484 #: ../tools/virt-make-fs.pl:265
34486 "would cause virt-make-fs to think you wanted to use a partition type of "
34487 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
34488 "dash) between options and the input file argument:"
34493 #: ../tools/virt-make-fs.pl:269
34496 " virt-make-fs --partition -- input.tar ...\n"
34501 #: ../tools/virt-make-fs.pl:536
34503 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
34504 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
34505 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
34510 #: ../tools/virt-make-fs.pl:553
34513 " export LIBGUESTFS_DEBUG=1\n"
34514 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
34520 #: ../tools/virt-make-fs.pl:556
34522 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
34528 #: ../tools/virt-list-partitions.pl:32
34530 "virt-list-partitions - List partitions in a virtual machine or disk image"
34535 #: ../tools/virt-list-partitions.pl:36
34538 " virt-list-partitions [--options] domname\n"
34544 #: ../tools/virt-list-partitions.pl:38
34547 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
34553 #: ../tools/virt-list-partitions.pl:45
34555 "C<virt-list-partitions> is a command line tool to list the partitions that "
34556 "are contained in a virtual machine or disk image. It is mainly useful as a "
34557 "first step to using L<virt-resize(1)>."
34562 #: ../tools/virt-list-partitions.pl:50
34564 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
34565 "functionality. For more complex cases you should look at the L<guestfish(1)"
34571 #: ../tools/virt-list-partitions.pl:107
34572 msgid "B<-h> | B<--human-readable>"
34577 #: ../tools/virt-list-partitions.pl:109
34578 msgid "Show sizes in human-readable form (eg. \"1G\")."
34583 #: ../tools/virt-list-partitions.pl:117
34585 "With this option, C<virt-list-partitions> displays the type and size of each "
34586 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
34591 #: ../tools/virt-list-partitions.pl:124
34592 msgid "B<-t> | B<--total>"
34597 #: ../tools/virt-list-partitions.pl:126
34599 "Display the total size of each block device (as a separate row or rows)."
34604 #: ../tools/virt-list-partitions.pl:259
34606 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
34607 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
34608 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."