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-09-16 16:55+0200\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-list-filesystems.pl:30 ../tools/virt-tar.pl:31
25 #: ../tools/virt-make-fs.pl:35 ../tools/virt-list-partitions.pl:30
31 #: ../src/guestfs.pod:5
32 msgid "guestfs - Library for accessing and modifying virtual machine images"
37 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
38 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
39 #: ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39
40 #: ../tools/virt-list-filesystems.pl:34 ../tools/virt-tar.pl:35
41 #: ../tools/virt-make-fs.pl:39 ../tools/virt-list-partitions.pl:34
47 #: ../src/guestfs.pod:9
50 " #include <guestfs.h>\n"
56 #: ../src/guestfs.pod:11
59 " guestfs_h *g = guestfs_create ();\n"
60 " guestfs_add_drive (g, \"guest.img\");\n"
61 " guestfs_launch (g);\n"
62 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
63 " guestfs_touch (g, \"/hello\");\n"
64 " guestfs_umount (g, \"/\");\n"
65 " guestfs_close (g);\n"
71 #: ../src/guestfs.pod:19
74 " cc prog.c -o prog -lguestfs\n"
76 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
82 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30
83 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
84 #: ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63
85 #: ../tools/virt-list-filesystems.pl:40 ../tools/virt-tar.pl:77
86 #: ../tools/virt-make-fs.pl:47 ../tools/virt-list-partitions.pl:40
92 #: ../src/guestfs.pod:25
94 "Libguestfs is a library for accessing and modifying guest disk images. "
95 "Amongst the things this is good for: making batch configuration changes to "
96 "guests, getting disk used/free statistics (see also: virt-df), migrating "
97 "between virtualization systems (see also: virt-p2v), performing partial "
98 "backups, performing partial guest clones, cloning guests and changing "
99 "registry/UUID/hostname info, and much else besides."
104 #: ../src/guestfs.pod:33
106 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
107 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
108 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
114 #: ../src/guestfs.pod:38
116 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
117 "what filesystem is in each LV, etc.). It can also run commands in the "
118 "context of the guest. Also you can access filesystems over FUSE."
123 #: ../src/guestfs.pod:43
125 "Libguestfs is a library that can be linked with C and C++ management "
126 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
127 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
133 #: ../src/guestfs.pod:48
135 "You don't need to be root to use libguestfs, although obviously you do need "
136 "enough permissions to access the disk images."
141 #: ../src/guestfs.pod:51
143 "Libguestfs is a large API because it can do many things. For a gentle "
144 "introduction, please read the L</API OVERVIEW> section next."
149 #: ../src/guestfs.pod:54
151 "There are also some example programs in the L<guestfs-examples(3)> manual "
157 #: ../src/guestfs.pod:57
163 #: ../src/guestfs.pod:59
165 "This section provides a gentler overview of the libguestfs API. We also try "
166 "to group API calls together, where that may not be obvious from reading "
167 "about the individual calls in the main section of this manual."
172 #: ../src/guestfs.pod:64
178 #: ../src/guestfs.pod:66
180 "Before you can use libguestfs calls, you have to create a handle. Then you "
181 "must add at least one disk image to the handle, followed by launching the "
182 "handle, then performing whatever operations you want, and finally closing "
183 "the handle. By convention we use the single letter C<g> for the name of the "
184 "handle variable, although of course you can use any name you want."
189 #: ../src/guestfs.pod:73
190 msgid "The general structure of all libguestfs-using programs looks like this:"
195 #: ../src/guestfs.pod:76
198 " guestfs_h *g = guestfs_create ();\n"
204 #: ../src/guestfs.pod:78
207 " /* Call guestfs_add_drive additional times if there are\n"
208 " * multiple disk images.\n"
210 " guestfs_add_drive (g, \"guest.img\");\n"
216 #: ../src/guestfs.pod:83
219 " /* Most manipulation calls won't work until you've launched\n"
220 " * the handle 'g'. You have to do this _after_ adding drives\n"
221 " * and _before_ other commands.\n"
223 " guestfs_launch (g);\n"
229 #: ../src/guestfs.pod:89
232 " /* Now you can examine what partitions, LVs etc are available.\n"
234 " char **partitions = guestfs_list_partitions (g);\n"
235 " char **logvols = guestfs_lvs (g);\n"
241 #: ../src/guestfs.pod:94
244 " /* To access a filesystem in the image, you must mount it.\n"
246 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
251 #: ../src/guestfs.pod:98
254 " /* Now you can perform filesystem actions on the guest\n"
257 " guestfs_touch (g, \"/hello\");\n"
263 #: ../src/guestfs.pod:103
266 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
267 " * it is done automatically when you close the handle. See\n"
268 " * discussion of autosync in this page.\n"
270 " guestfs_sync (g);\n"
276 #: ../src/guestfs.pod:109
279 " /* Close the handle 'g'. */\n"
280 " guestfs_close (g);\n"
286 #: ../src/guestfs.pod:112
288 "The code above doesn't include any error checking. In real code you should "
289 "check return values carefully for errors. In general all functions that "
290 "return integers return C<-1> on error, and all functions that return "
291 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
292 "how to handle errors, and consult the documentation for each function call "
293 "below to see precisely how they return error indications. See L<guestfs-"
294 "examples(3)> for fully worked examples."
299 #: ../src/guestfs.pod:121
305 #: ../src/guestfs.pod:123
307 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
308 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
309 "actual block device, or simply an empty file of zeroes that you have created "
310 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
316 #: ../src/guestfs.pod:129
318 "The call you should use in modern code for adding drives is L</"
319 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
320 "specifying that the format is raw, do:"
325 #: ../src/guestfs.pod:133
328 " guestfs_add_drive_opts (g, filename,\n"
329 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
336 #: ../src/guestfs.pod:137
337 msgid "You can add a disk read-only using:"
342 #: ../src/guestfs.pod:139
345 " guestfs_add_drive_opts (g, filename,\n"
346 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
347 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
354 #: ../src/guestfs.pod:144
356 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
357 "libguestfs won't modify the file."
362 #: ../src/guestfs.pod:147
364 "Be extremely cautious if the disk image is in use, eg. if it is being used "
365 "by a virtual machine. Adding it read-write will almost certainly cause disk "
366 "corruption, but adding it read-only is safe."
371 #: ../src/guestfs.pod:151
373 "You must add at least one disk image, and you may add multiple disk images. "
374 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
375 "first one you added), C</dev/sdb> (for the second one you added), etc."
380 #: ../src/guestfs.pod:156
382 "Once L</guestfs_launch> has been called you cannot add any more images. You "
383 "can call L</guestfs_list_devices> to get a list of the device names, in the "
384 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
389 #: ../src/guestfs.pod:161
394 #: ../src/guestfs.pod:163
396 "Before you can read or write files, create directories and so on in a disk "
397 "image that contains filesystems, you have to mount those filesystems using "
398 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
399 "a disk image contains (for example) one partition with a filesystem on that "
400 "partition, then you can mount it directly:"
404 #: ../src/guestfs.pod:170
407 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
412 #: ../src/guestfs.pod:172
414 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
415 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
416 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
417 "that these are libguestfs virtual devices, and are nothing to do with host "
422 #: ../src/guestfs.pod:178
424 "If you are given a disk image and you don't know what it contains then you "
425 "have to find out. Libguestfs can do that too: use L</"
426 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
427 "LVs, and either try mounting each to see what is mountable, or else examine "
428 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
429 "filesystems, use L</guestfs_list_filesystems>."
433 #: ../src/guestfs.pod:186
435 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
436 "L</INSPECTION> below). But you might find it easier to look at higher level "
437 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
441 #: ../src/guestfs.pod:191
443 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
444 "several other variations of the C<guestfs_mount_*> call."
449 #: ../src/guestfs.pod:194
450 msgid "FILESYSTEM ACCESS AND MODIFICATION"
455 #: ../src/guestfs.pod:196
457 "The majority of the libguestfs API consists of fairly low-level calls for "
458 "accessing and modifying the files, directories, symlinks etc on mounted "
459 "filesystems. There are over a hundred such calls which you can find listed "
460 "in detail below in this man page, and we don't even pretend to cover them "
461 "all in this overview."
466 #: ../src/guestfs.pod:202
468 "Specify filenames as full paths, starting with C<\"/\"> and including the "
474 #: ../src/guestfs.pod:205
476 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
477 "the file called C<\"etc/passwd\"> then you could do:"
482 #: ../src/guestfs.pod:208
485 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
491 #: ../src/guestfs.pod:210
493 "This would return C<data> as a newly allocated buffer containing the full "
494 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
495 "or C<NULL> if there was an error."
500 #: ../src/guestfs.pod:214
502 "As another example, to create a top-level directory on that filesystem "
503 "called C<\"var\"> you would do:"
508 #: ../src/guestfs.pod:217
511 " guestfs_mkdir (g, \"/var\");\n"
517 #: ../src/guestfs.pod:219
518 msgid "To create a symlink you could do:"
523 #: ../src/guestfs.pod:221
526 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
527 " \"/etc/rc3.d/S30portmap\");\n"
533 #: ../src/guestfs.pod:224
535 "Libguestfs will reject attempts to use relative paths and there is no "
536 "concept of a current working directory."
541 #: ../src/guestfs.pod:227
543 "Libguestfs can return errors in many situations: for example if the "
544 "filesystem isn't writable, or if a file or directory that you requested "
545 "doesn't exist. If you are using the C API (documented here) you have to "
546 "check for those error conditions after each call. (Other language bindings "
547 "turn these errors into exceptions)."
552 #: ../src/guestfs.pod:233
554 "File writes are affected by the per-handle umask, set by calling L</"
555 "guestfs_umask> and defaulting to 022. See L</UMASK>."
560 #: ../src/guestfs.pod:236
566 #: ../src/guestfs.pod:238
568 "Libguestfs contains API calls to read, create and modify partition tables on "
574 #: ../src/guestfs.pod:241
576 "In the common case where you want to create a single partition covering the "
577 "whole disk, you should use the L</guestfs_part_disk> call:"
582 #: ../src/guestfs.pod:245
585 " const char *parttype = \"mbr\";\n"
586 " if (disk_is_larger_than_2TB)\n"
587 " parttype = \"gpt\";\n"
588 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
594 #: ../src/guestfs.pod:250
596 "Obviously this effectively wipes anything that was on that disk image before."
601 #: ../src/guestfs.pod:253
607 #: ../src/guestfs.pod:255
609 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
610 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
611 "you familiarize yourself with the concepts of physical volumes, volume "
612 "groups and logical volumes."
617 #: ../src/guestfs.pod:260
619 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
620 "tldp.org/HOWTO/LVM-HOWTO/>."
625 #: ../src/guestfs.pod:263
630 #: ../src/guestfs.pod:265
632 "Use L</guestfs_cat> to download small, text only files. This call is "
633 "limited to files which are less than 2 MB and which cannot contain any ASCII "
634 "NUL (C<\\0>) characters. However the API is very simple to use."
639 #: ../src/guestfs.pod:269
641 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
642 "bit data, since it returns a (pointer, size) pair. However it is still "
643 "limited to \"small\" files, less than 2 MB."
648 #: ../src/guestfs.pod:273
650 "L</guestfs_download> can be used to download any file, with no limits on "
651 "content or size (even files larger than 4 GB)."
656 #: ../src/guestfs.pod:276
658 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
663 #: ../src/guestfs.pod:279
669 #: ../src/guestfs.pod:281
671 "It's often the case that you want to write a file or files to the disk image."
676 #: ../src/guestfs.pod:284
678 "To write a small file with fixed content, use L</guestfs_write>. To create "
679 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
680 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
681 "of other functions for creating test files, for example L</guestfs_fill> and "
682 "L</guestfs_fill_pattern>."
687 #: ../src/guestfs.pod:290
689 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
690 "file content or size (even files larger than 4 GB)."
695 #: ../src/guestfs.pod:293
697 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
702 #: ../src/guestfs.pod:295
704 "However the fastest way to upload I<large numbers of arbitrary files> is to "
705 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
706 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
707 "in a predictable way (eg. adding it last after all other drives) then you "
708 "can get the device name from L</guestfs_list_devices> and mount it directly "
709 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
710 "portable between kernel versions, and they don't support labels or UUIDs. "
711 "If you want to pre-build an image or you need to mount it using a label or "
712 "UUID, use an ISO image instead."
717 #: ../src/guestfs.pod:306
723 #: ../src/guestfs.pod:308
725 "There are various different commands for copying between files and devices "
726 "and in and out of the guest filesystem. These are summarised in the table "
732 #: ../src/guestfs.pod:314
733 msgid "B<file> to B<file>"
738 #: ../src/guestfs.pod:316
740 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
741 "directories recursively."
746 #: ../src/guestfs.pod:319
747 msgid "B<file or device> to B<file or device>"
752 #: ../src/guestfs.pod:321
754 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
755 "devices in the guest."
760 #: ../src/guestfs.pod:324
761 msgid "Example: duplicate the contents of an LV:"
766 #: ../src/guestfs.pod:326
769 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
775 #: ../src/guestfs.pod:328
777 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
778 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
779 "guestfs_copy_size>."
784 #: ../src/guestfs.pod:332
785 msgid "B<file on the host> to B<file or device>"
790 #: ../src/guestfs.pod:334
791 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
796 #: ../src/guestfs.pod:336
797 msgid "B<file or device> to B<file on the host>"
802 #: ../src/guestfs.pod:338
803 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
808 #: ../src/guestfs.pod:342
809 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
814 #: ../src/guestfs.pod:344
816 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
817 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
818 "appears you can only upload and download to files. However many Un*x-like "
819 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
820 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
821 "and arbitrary file descriptor N."
826 #: ../src/guestfs.pod:352
827 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
831 #: ../src/guestfs.pod:355
834 " guestfs_download (g, filename, \"/dev/stdout\");\n"
839 #: ../src/guestfs.pod:357
840 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
844 #: ../src/guestfs.pod:359
848 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
849 " guestfs_tar_out (g, \"/\", devfd);\n"
855 #: ../src/guestfs.pod:363
856 msgid "LISTING FILES"
861 #: ../src/guestfs.pod:365
863 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
864 "L<guestfish(1)>-equivalent command C<ll>)."
869 #: ../src/guestfs.pod:368
871 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
872 "programs, as a flat list of strings."
877 #: ../src/guestfs.pod:371
879 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
880 "directory, plus additional information about each one. It is more "
881 "equivalent to using the L<readdir(3)> call on a local filesystem."
886 #: ../src/guestfs.pod:375
888 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
893 #: ../src/guestfs.pod:378
894 msgid "RUNNING COMMANDS"
899 #: ../src/guestfs.pod:380
901 "Although libguestfs is primarily an API for manipulating files inside guest "
902 "images, we also provide some limited facilities for running commands inside "
908 #: ../src/guestfs.pod:384
909 msgid "There are many limitations to this:"
914 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398
915 #: ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411
916 #: ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1064
917 #: ../src/guestfs.pod:1068 ../src/guestfs.pod:1072 ../src/guestfs.pod:1077
918 #: ../src/guestfs.pod:1085 ../src/guestfs.pod:1104 ../src/guestfs.pod:1112
919 #: ../src/guestfs.pod:1134 ../src/guestfs.pod:1138 ../src/guestfs.pod:1142
920 #: ../src/guestfs.pod:1146 ../src/guestfs.pod:1150 ../src/guestfs.pod:1154
921 #: ../src/guestfs.pod:1643 ../src/guestfs.pod:1648 ../src/guestfs.pod:1652
922 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1758 ../src/guestfs.pod:1762
923 #: ../src/guestfs.pod:1772 ../src/guestfs.pod:2007 ../src/guestfs.pod:2012
924 #: ../src/guestfs.pod:2018 ../src/guestfs.pod:2026 ../src/guestfs.pod:2380
925 #: ../src/guestfs.pod:2386 ../src/guestfs.pod:2391 ../src/guestfs.pod:2397
926 #: ../src/guestfs.pod:2968 ../src/guestfs.pod:2972 ../src/guestfs.pod:2976
927 #: ../src/guestfs.pod:2980 ../src/guestfs-actions.pod:15
928 #: ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:582
929 #: ../src/guestfs-actions.pod:590 ../src/guestfs-actions.pod:597
930 #: ../src/guestfs-actions.pod:604 ../src/guestfs-actions.pod:1602
931 #: ../src/guestfs-actions.pod:1606 ../src/guestfs-actions.pod:1610
932 #: ../src/guestfs-actions.pod:1614 ../src/guestfs-actions.pod:1622
933 #: ../src/guestfs-actions.pod:1626 ../src/guestfs-actions.pod:1630
934 #: ../src/guestfs-actions.pod:1640 ../src/guestfs-actions.pod:1644
935 #: ../src/guestfs-actions.pod:1648 ../src/guestfs-actions.pod:1786
936 #: ../src/guestfs-actions.pod:1790 ../src/guestfs-actions.pod:1795
937 #: ../src/guestfs-actions.pod:1800 ../src/guestfs-actions.pod:1861
938 #: ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:1870
939 #: ../src/guestfs-actions.pod:2261 ../src/guestfs-actions.pod:2268
940 #: ../src/guestfs-actions.pod:2275 ../fish/guestfish.pod:443
941 #: ../fish/guestfish.pod:447 ../fish/guestfish.pod:451
942 #: ../fish/guestfish.pod:455 ../fish/guestfish-actions.pod:13
943 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:385
944 #: ../fish/guestfish-actions.pod:393 ../fish/guestfish-actions.pod:400
945 #: ../fish/guestfish-actions.pod:407 ../fish/guestfish-actions.pod:1074
946 #: ../fish/guestfish-actions.pod:1078 ../fish/guestfish-actions.pod:1082
947 #: ../fish/guestfish-actions.pod:1086 ../fish/guestfish-actions.pod:1094
948 #: ../fish/guestfish-actions.pod:1098 ../fish/guestfish-actions.pod:1102
949 #: ../fish/guestfish-actions.pod:1112 ../fish/guestfish-actions.pod:1116
950 #: ../fish/guestfish-actions.pod:1120 ../fish/guestfish-actions.pod:1210
951 #: ../fish/guestfish-actions.pod:1214 ../fish/guestfish-actions.pod:1219
952 #: ../fish/guestfish-actions.pod:1224 ../fish/guestfish-actions.pod:1266
953 #: ../fish/guestfish-actions.pod:1270 ../fish/guestfish-actions.pod:1275
954 #: ../fish/guestfish-actions.pod:1519 ../fish/guestfish-actions.pod:1526
955 #: ../fish/guestfish-actions.pod:1533 ../tools/virt-edit.pl:351
956 #: ../tools/virt-edit.pl:356 ../tools/virt-edit.pl:361
957 #: ../tools/virt-edit.pl:372 ../tools/virt-edit.pl:376
958 #: ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542
959 #: ../tools/virt-win-reg.pl:548
965 #: ../src/guestfs.pod:390
967 "The kernel version that the command runs under will be different from what "
973 #: ../src/guestfs.pod:395
975 "If the command needs to communicate with daemons, then most likely they "
981 #: ../src/guestfs.pod:400
982 msgid "The command will be running in limited memory."
987 #: ../src/guestfs.pod:404
989 "The network may not be available unless you enable it (see L</"
990 "guestfs_set_network>)."
995 #: ../src/guestfs.pod:409
996 msgid "Only supports Linux guests (not Windows, BSD, etc)."
1001 #: ../src/guestfs.pod:413
1003 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
1008 #: ../src/guestfs.pod:418
1010 "For SELinux guests, you may need to enable SELinux and load policy first. "
1011 "See L</SELINUX> in this manpage."
1016 #: ../src/guestfs.pod:423
1018 "I<Security:> It is not safe to run commands from untrusted, possibly "
1019 "malicious guests. These commands may attempt to exploit your program by "
1020 "sending unexpected output. They could also try to exploit the Linux kernel "
1021 "or qemu provided by the libguestfs appliance. They could use the network "
1022 "provided by the libguestfs appliance to bypass ordinary network partitions "
1023 "and firewalls. They could use the elevated privileges or different SELinux "
1024 "context of your program to their advantage."
1029 #: ../src/guestfs.pod:432
1031 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
1032 "(a script which runs when the guest next boots normally), and to have this "
1033 "script run the commands you want in the normal context of the running guest, "
1034 "network security and so on. For information about other security issues, "
1040 #: ../src/guestfs.pod:440
1042 "The two main API calls to run commands are L</guestfs_command> and L</"
1043 "guestfs_sh> (there are also variations)."
1048 #: ../src/guestfs.pod:443
1050 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
1051 "shell globs, redirections, etc will work."
1056 #: ../src/guestfs.pod:446
1057 msgid "CONFIGURATION FILES"
1062 #: ../src/guestfs.pod:448
1064 "To read and write configuration files in Linux guest filesystems, we "
1065 "strongly recommend using Augeas. For example, Augeas understands how to "
1066 "read and write, say, a Linux shadow password file or X.org configuration "
1067 "file, and so avoids you having to write that code."
1072 #: ../src/guestfs.pod:453
1074 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
1075 "document Augeas itself here because there is excellent documentation on the "
1076 "L<http://augeas.net/> website."
1081 #: ../src/guestfs.pod:457
1083 "If you don't want to use Augeas (you fool!) then try calling L</"
1084 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
1090 #: ../src/guestfs.pod:461
1096 #: ../src/guestfs.pod:463
1098 "We support SELinux guests. To ensure that labeling happens correctly in "
1099 "SELinux guests, you need to enable SELinux and load the guest's policy:"
1104 #: ../src/guestfs.pod:469 ../src/guestfs.pod:1257 ../src/guestfs.pod:1395
1105 #: ../src/guestfs.pod:2425
1111 #: ../src/guestfs.pod:471
1112 msgid "Before launching, do:"
1117 #: ../src/guestfs.pod:473
1120 " guestfs_set_selinux (g, 1);\n"
1126 #: ../src/guestfs.pod:475 ../src/guestfs.pod:1261 ../src/guestfs.pod:1399
1127 #: ../src/guestfs.pod:2450
1133 #: ../src/guestfs.pod:477
1135 "After mounting the guest's filesystem(s), load the policy. This is best "
1136 "done by running the L<load_policy(8)> command in the guest itself:"
1141 #: ../src/guestfs.pod:481
1144 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
1150 #: ../src/guestfs.pod:483
1152 "(Older versions of C<load_policy> require you to specify the name of the "
1158 #: ../src/guestfs.pod:486 ../src/guestfs.pod:1405
1164 #: ../src/guestfs.pod:488
1166 "Optionally, set the security context for the API. The correct security "
1167 "context to use can only be known by inspecting the guest. As an example:"
1172 #: ../src/guestfs.pod:492
1175 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1181 #: ../src/guestfs.pod:496
1182 msgid "This will work for running commands and editing existing files."
1187 #: ../src/guestfs.pod:498
1189 "When new files are created, you may need to label them explicitly, for "
1190 "example by running the external command C<restorecon pathname>."
1195 #: ../src/guestfs.pod:502
1201 #: ../src/guestfs.pod:504
1203 "Certain calls are affected by the current file mode creation mask (the "
1204 "\"umask\"). In particular ones which create files or directories, such as "
1205 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1206 "either the default mode that the file is created with or modifies the mode "
1212 #: ../src/guestfs.pod:510
1214 "The default umask is C<022>, so files are created with modes such as C<0644> "
1215 "and directories with C<0755>."
1220 #: ../src/guestfs.pod:513
1222 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1223 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1224 "guestfs_chmod> after creating each file or directory."
1229 #: ../src/guestfs.pod:517
1230 msgid "For more information about umask, see L<umask(2)>."
1235 #: ../src/guestfs.pod:519 ../fish/guestfish.pod:765
1236 msgid "ENCRYPTED DISKS"
1241 #: ../src/guestfs.pod:521
1243 "Libguestfs allows you to access Linux guests which have been encrypted using "
1244 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1245 "standard. This includes nearly all whole disk encryption systems used by "
1246 "modern Linux guests."
1251 #: ../src/guestfs.pod:527
1253 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1254 "returns the string C<crypto_LUKS>)."
1259 #: ../src/guestfs.pod:530
1261 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1262 "will require the passphrase!"
1267 #: ../src/guestfs.pod:533
1269 "Opening a LUKS device creates a new device mapper device called C</dev/"
1270 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1271 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1272 "from and encrypted to the underlying block device respectively."
1277 #: ../src/guestfs.pod:539
1279 "LVM volume groups on the device can be made visible by calling L</"
1280 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1281 "(s) can now be mounted in the usual way."
1286 #: ../src/guestfs.pod:543
1288 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1289 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1290 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1291 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1292 "underlying encrypted block device)."
1297 #: ../src/guestfs.pod:550
1302 #: ../src/guestfs.pod:552
1304 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1305 "contains operating systems, an install CD or a live CD. (These APIs used to "
1306 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
1307 "version 1.5.3 the most frequently used part of this library has been "
1308 "rewritten in C and moved into the core code)."
1313 #: ../src/guestfs.pod:559
1315 "Add all disks belonging to the unknown virtual machine and call L</"
1316 "guestfs_launch> in the usual way."
1321 #: ../src/guestfs.pod:562
1323 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1324 "and certain heuristics, and returns a list of operating systems that were "
1325 "found. An empty list means none were found. A single element is the root "
1326 "filesystem of the operating system. For dual- or multi-boot guests, "
1327 "multiple roots can be returned, each one corresponding to a separate "
1328 "operating system. (Multi-boot virtual machines are extremely rare in the "
1329 "world of virtualization, but since this scenario can happen, we have built "
1330 "libguestfs to deal with it.)"
1335 #: ../src/guestfs.pod:571
1337 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1338 "to get additional details about that operating system. For example, call L</"
1339 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1340 "Windows and Linux-based operating systems respectively."
1345 #: ../src/guestfs.pod:577
1347 "Un*x-like and Linux-based operating systems usually consist of several "
1348 "filesystems which are mounted at boot time (for example, a separate boot "
1349 "partition mounted on C</boot>). The inspection rules are able to detect how "
1350 "filesystems correspond to mount points. Call "
1351 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1352 "hash table like this example:"
1357 #: ../src/guestfs.pod:584
1360 " /boot => /dev/sda1\n"
1361 " / => /dev/vg_guest/lv_root\n"
1362 " /usr => /dev/vg_guest/lv_usr\n"
1368 #: ../src/guestfs.pod:588
1370 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1371 "filesystems as suggested."
1376 #: ../src/guestfs.pod:591
1378 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1379 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1384 #: ../src/guestfs.pod:595
1386 "Inspection currently only works for some common operating systems. "
1387 "Contributors are welcome to send patches for other operating systems that we "
1388 "currently cannot detect."
1393 #: ../src/guestfs.pod:599
1395 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1396 "for more details. The L</guestfs_inspect_os> function just ignores any "
1397 "encrypted devices."
1402 #: ../src/guestfs.pod:603
1404 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1405 "inspection and caches the results in the guest handle. Subsequent calls to "
1406 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1407 "read the disks. If you change the content of the guest disks, you can redo "
1408 "inspection by calling L</guestfs_inspect_os> again. (L</"
1409 "guestfs_inspect_list_applications> works a little differently from the other "
1410 "calls and does read the disks. See documentation for that function for "
1415 #: ../src/guestfs.pod:612
1416 msgid "INSPECTING INSTALL DISKS"
1420 #: ../src/guestfs.pod:614
1422 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
1427 #: ../src/guestfs.pod:617
1429 "Call L</guestfs_inspect_get_format> to return the format of the operating "
1430 "system, which currently can be C<installed> (a regular operating system) or "
1431 "C<installer> (some sort of install disk)."
1435 #: ../src/guestfs.pod:621
1437 "Further information is available about the operating system that can be "
1438 "installed using the regular inspection APIs like L</"
1439 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
1443 #: ../src/guestfs.pod:626
1445 "Some additional information specific to installer disks is also available "
1446 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
1447 "guestfs_inspect_is_multipart> calls."
1452 #: ../src/guestfs.pod:631
1453 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1458 #: ../src/guestfs.pod:633
1460 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1461 "ntfs-3g.org/> driver."
1466 #: ../src/guestfs.pod:636
1467 msgid "DRIVE LETTERS AND PATHS"
1472 #: ../src/guestfs.pod:638
1474 "DOS and Windows still use drive letters, and the filesystems are always "
1475 "treated as case insensitive by Windows itself, and therefore you might find "
1476 "a Windows configuration file referring to a path like C<c:\\windows"
1477 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1478 "might be referred to as C</WINDOWS/System32>."
1482 #: ../src/guestfs.pod:644
1484 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
1485 "L</guestfs_inspect_get_drive_mappings>)"
1489 #: ../src/guestfs.pod:647
1491 "Dealing with separator characters (backslash vs forward slash) is outside "
1492 "the scope of libguestfs, but usually a simple character replacement will "
1497 #: ../src/guestfs.pod:651
1499 "To resolve the case insensitivity of paths, call L</"
1500 "guestfs_case_sensitive_path>."
1505 #: ../src/guestfs.pod:654
1506 msgid "ACCESSING THE WINDOWS REGISTRY"
1511 #: ../src/guestfs.pod:656
1513 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1514 "files, through the library C<hivex> which is part of the libguestfs project "
1515 "although ships as a separate tarball. You have to locate and download the "
1516 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1517 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1518 "reg(1)> for more help on this issue."
1523 #: ../src/guestfs.pod:664
1524 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1529 #: ../src/guestfs.pod:666
1531 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1532 "provide something which looks like a Linux symlink. The way it tries to do "
1533 "the rewriting is described here:"
1538 #: ../src/guestfs.pod:670
1540 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
1546 #: ../src/guestfs.pod:672
1548 "The essential problem is that ntfs-3g simply does not have enough "
1549 "information to do a correct job. NTFS links can contain drive letters and "
1550 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1551 "It is almost certainly the case that libguestfs callers should ignore what "
1552 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1557 #: ../src/guestfs.pod:679
1559 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
1560 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1561 "attribute, and read the raw reparse data from that (you can find the format "
1562 "documented in various places around the web)."
1567 #: ../src/guestfs.pod:684
1568 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1573 #: ../src/guestfs.pod:686
1575 "There are other useful extended attributes that can be read from ntfs-3g "
1576 "filesystems (using L</guestfs_getxattr>). See:"
1581 #: ../src/guestfs.pod:689
1583 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1588 #: ../src/guestfs.pod:691
1589 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1594 #: ../src/guestfs.pod:693
1596 "Although we don't want to discourage you from using the C API, we will "
1597 "mention here that the same API is also available in other languages."
1601 #: ../src/guestfs.pod:696
1603 "The API is broadly identical in all supported languages. This means that "
1604 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
1605 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
1606 "OCaml. In other words, a straightforward, predictable isomorphism between "
1612 #: ../src/guestfs.pod:702
1614 "Error messages are automatically transformed into exceptions if the language "
1620 #: ../src/guestfs.pod:705
1622 "We don't try to \"object orientify\" parts of the API in OO languages, "
1623 "although contributors are welcome to write higher level APIs above what we "
1624 "provide in their favourite languages if they wish."
1629 #: ../src/guestfs.pod:711
1635 #: ../src/guestfs.pod:713
1637 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1638 "identical to the C API. C++ classes and exceptions are not used."
1643 #: ../src/guestfs.pod:717
1649 #: ../src/guestfs.pod:719
1651 "The C# bindings are highly experimental. Please read the warnings at the "
1652 "top of C<csharp/Libguestfs.cs>."
1657 #: ../src/guestfs.pod:722
1663 #: ../src/guestfs.pod:724
1665 "This is the only language binding that is working but incomplete. Only "
1666 "calls which return simple integers have been bound in Haskell, and we are "
1667 "looking for help to complete this binding."
1672 #: ../src/guestfs.pod:728
1678 #: ../src/guestfs.pod:730
1680 "Full documentation is contained in the Javadoc which is distributed with "
1686 #: ../src/guestfs.pod:733
1691 #: ../src/guestfs.pod:735
1692 msgid "See L<guestfs-ocaml(3)>."
1697 #: ../src/guestfs.pod:737
1702 #: ../src/guestfs.pod:739
1703 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
1708 #: ../src/guestfs.pod:741
1714 #: ../src/guestfs.pod:743
1716 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1717 "the php-libguestfs package for your distribution."
1722 #: ../src/guestfs.pod:746
1723 msgid "The PHP binding only works correctly on 64 bit machines."
1728 #: ../src/guestfs.pod:748
1733 #: ../src/guestfs.pod:750
1734 msgid "See L<guestfs-python(3)>."
1739 #: ../src/guestfs.pod:752
1744 #: ../src/guestfs.pod:754
1745 msgid "See L<guestfs-ruby(3)>."
1750 #: ../src/guestfs.pod:756
1751 msgid "B<shell scripts>"
1755 #: ../src/guestfs.pod:758
1756 msgid "See L<guestfish(1)>."
1761 #: ../src/guestfs.pod:762
1762 msgid "LIBGUESTFS GOTCHAS"
1767 #: ../src/guestfs.pod:764
1769 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1770 "system [...] that works in the way it is documented but is counterintuitive "
1771 "and almost invites mistakes.\""
1776 #: ../src/guestfs.pod:768
1778 "Since we developed libguestfs and the associated tools, there are several "
1779 "things we would have designed differently, but are now stuck with for "
1780 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1781 "release, you can expect these to change. Beware of them."
1786 #: ../src/guestfs.pod:776
1787 msgid "Autosync / forgetting to sync."
1791 #: ../src/guestfs.pod:778
1793 "I<Update:> Autosync is enabled by default for all API users starting from "
1794 "libguestfs 1.5.24. This section only applies to older versions."
1799 #: ../src/guestfs.pod:781
1801 "When modifying a filesystem from C or another language, you B<must> unmount "
1802 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1803 "libguestfs handle. You can also call:"
1808 #: ../src/guestfs.pod:785
1811 " guestfs_set_autosync (g, 1);\n"
1817 #: ../src/guestfs.pod:787
1819 "to have the unmount/sync done automatically for you when the handle 'g' is "
1820 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1825 #: ../src/guestfs.pod:791
1827 "If you forget to do this, then it is entirely possible that your changes "
1828 "won't be written out, or will be partially written, or (very rarely) that "
1829 "you'll get disk corruption."
1834 #: ../src/guestfs.pod:795
1836 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1837 "guestfish scripts that forget to sync will work just fine, which can make "
1838 "this very puzzling if you are trying to debug a problem."
1843 #: ../src/guestfs.pod:799
1844 msgid "Mount option C<-o sync> should not be the default."
1849 #: ../src/guestfs.pod:801
1851 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1852 "However C<-o sync> does not add any reliability benefit, but does have a "
1853 "very large performance impact."
1858 #: ../src/guestfs.pod:805
1860 "The work around is to use L</guestfs_mount_options> and set the mount "
1861 "options that you actually want to use."
1866 #: ../src/guestfs.pod:808
1867 msgid "Read-only should be the default."
1872 #: ../src/guestfs.pod:810
1874 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1875 "specify I<--rw> if you want to make changes to the image."
1880 #: ../src/guestfs.pod:813
1881 msgid "This would reduce the potential to corrupt live VM images."
1886 #: ../src/guestfs.pod:815
1888 "Note that many filesystems change the disk when you just mount and unmount, "
1889 "even if you didn't perform any writes. You need to use L</"
1890 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1895 #: ../src/guestfs.pod:819
1896 msgid "guestfish command line is hard to use."
1901 #: ../src/guestfs.pod:821
1903 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1904 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1905 "exist, so it fails. In earlier versions of guestfish the error message was "
1906 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1907 "we should have used C<guestfish -c command> to run commands."
1912 #: ../src/guestfs.pod:828
1913 msgid "guestfish megabyte modifiers don't work right on all commands"
1918 #: ../src/guestfs.pod:830
1920 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1921 "other modifiers). What guestfish actually does is to multiply the number "
1922 "part by the modifier part and pass the result to the C API. However this "
1923 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1924 "expecting some other unit (eg. megabytes)."
1929 #: ../src/guestfs.pod:837
1930 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1935 #: ../src/guestfs.pod:839
1938 " lvcreate LV VG 100M\n"
1944 #: ../src/guestfs.pod:841
1946 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1947 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1948 "megabytes * megabytes) logical volume. The error message you get from this "
1949 "is also a little obscure."
1954 #: ../src/guestfs.pod:846
1956 "This could be fixed in the generator by specially marking parameters and "
1957 "return values which take bytes or other units."
1962 #: ../src/guestfs.pod:849
1963 msgid "Ambiguity between devices and paths"
1968 #: ../src/guestfs.pod:851
1970 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1971 "sdb2>) and a similar pathname. A file might just happen to be called "
1972 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1977 #: ../src/guestfs.pod:856
1979 "In the current API we usually resolve this ambiguity by having two separate "
1980 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1981 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1982 "detecting if the path supplied begins with C</dev/>."
1987 #: ../src/guestfs.pod:862
1989 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1990 "make paths/devices into structured names. One way to do this would be to "
1991 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1992 "aspect of grub. Another way would be to use a structured type, equivalent "
1993 "to this OCaml type:"
1998 #: ../src/guestfs.pod:868
2001 " type path = Path of string | Device of int | Partition of int * int\n"
2007 #: ../src/guestfs.pod:870
2008 msgid "which would allow you to pass arguments like:"
2013 #: ../src/guestfs.pod:872
2016 " Path \"/foo/bar\"\n"
2017 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
2018 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
2019 " Path \"/dev/sdb2\" (* not a device *)\n"
2025 #: ../src/guestfs.pod:877
2027 "As you can see there are still problems to resolve even with this "
2028 "representation. Also consider how it might work in guestfish."
2033 #: ../src/guestfs.pod:882
2034 msgid "KEYS AND PASSPHRASES"
2039 #: ../src/guestfs.pod:884
2041 "Certain libguestfs calls take a parameter that contains sensitive key "
2042 "material, passed in as a C string."
2047 #: ../src/guestfs.pod:887
2049 "In the future we would hope to change the libguestfs implementation so that "
2050 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
2051 "swap. However this is I<not> done at the moment, because of the complexity "
2052 "of such an implementation."
2057 #: ../src/guestfs.pod:892
2059 "Therefore you should be aware that any key parameter you pass to libguestfs "
2060 "might end up being written out to the swap partition. If this is a concern, "
2061 "scrub the swap partition or don't use libguestfs on encrypted devices."
2066 #: ../src/guestfs.pod:897
2067 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
2072 #: ../src/guestfs.pod:899
2074 "All high-level libguestfs actions are synchronous. If you want to use "
2075 "libguestfs asynchronously then you must create a thread."
2080 #: ../src/guestfs.pod:902
2082 "Only use the handle from a single thread. Either use the handle exclusively "
2083 "from one thread, or provide your own mutex so that two threads cannot issue "
2084 "calls on the same handle at the same time."
2089 #: ../src/guestfs.pod:906
2091 "See the graphical program guestfs-browser for one possible architecture for "
2092 "multithreaded programs using libvirt and libguestfs."
2097 #: ../src/guestfs.pod:909
2102 #: ../src/guestfs.pod:911
2104 "Libguestfs needs a supermin appliance, which it finds by looking along an "
2110 #: ../src/guestfs.pod:914
2112 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
2113 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
2118 #: ../src/guestfs.pod:917
2120 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
2121 "to change the directories that libguestfs will search in. The value is a "
2122 "colon-separated list of paths. The current directory is I<not> searched "
2123 "unless the path contains an empty element or C<.>. For example "
2124 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
2125 "then C</usr/lib/guestfs>."
2130 #: ../src/guestfs.pod:924
2131 msgid "QEMU WRAPPERS"
2136 #: ../src/guestfs.pod:926
2138 "If you want to compile your own qemu, run qemu from a non-standard location, "
2139 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
2145 #: ../src/guestfs.pod:930
2147 "There is one important rule to remember: you I<must C<exec qemu>> as the "
2148 "last command in the shell script (so that qemu replaces the shell and "
2149 "becomes the direct child of the libguestfs-using program). If you don't do "
2150 "this, then the qemu process won't be cleaned up correctly."
2155 #: ../src/guestfs.pod:935
2157 "Here is an example of a wrapper, where I have built my own copy of qemu from "
2163 #: ../src/guestfs.pod:938
2167 " qemudir=/home/rjones/d/qemu\n"
2168 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
2174 #: ../src/guestfs.pod:942
2176 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
2177 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
2183 #: ../src/guestfs.pod:946
2186 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
2192 #: ../src/guestfs.pod:948
2194 "Note that libguestfs also calls qemu with the -help and -version options in "
2195 "order to determine features."
2199 #: ../src/guestfs.pod:951
2200 msgid "ATTACHING TO RUNNING DAEMONS"
2204 #: ../src/guestfs.pod:953
2206 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
2207 "babies. Use with caution."
2211 #: ../src/guestfs.pod:956
2213 "I<Note (2):> This section explains how to attach to a running daemon from a "
2214 "low level perspective. For most users, simply using virt tools such as "
2215 "L<guestfish(1)> with the I<--live> option will \"just work\"."
2219 #: ../src/guestfs.pod:960
2220 msgid "Using guestfs_set_attach_method"
2224 #: ../src/guestfs.pod:962
2226 "By calling L</guestfs_set_attach_method> you can change how the library "
2227 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
2228 "ARCHITECTURE> for some background)."
2232 #: ../src/guestfs.pod:966
2234 "The normal attach method is C<appliance>, where a small appliance is created "
2235 "containing the daemon, and then the library connects to this."
2239 #: ../src/guestfs.pod:969
2241 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
2242 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
2243 "daemon over the Unix domain socket."
2247 #: ../src/guestfs.pod:973
2249 "The normal use for this is to connect to a running virtual machine that "
2250 "contains a C<guestfsd> daemon, and send commands so you can read and write "
2251 "files inside the live virtual machine."
2255 #: ../src/guestfs.pod:977
2256 msgid "Using guestfs_add_domain with live flag"
2260 #: ../src/guestfs.pod:979
2262 "L</guestfs_add_domain> provides some help for getting the correct attach "
2263 "method. If you pass the C<live> option to this function, then (if the "
2264 "virtual machine is running) it will examine the libvirt XML looking for a "
2265 "virtio-serial channel to connect to:"
2269 #: ../src/guestfs.pod:985
2276 " <channel type='unix'>\n"
2277 " <source mode='bind' path='/path/to/socket'/>\n"
2278 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
2287 #: ../src/guestfs.pod:997
2289 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
2290 "method to C<unix:/path/to/socket>."
2294 #: ../src/guestfs.pod:1000
2296 "Some of the libguestfs tools (including guestfish) support a I<--live> "
2297 "option which is passed through to L</guestfs_add_domain> thus allowing you "
2298 "to attach to and modify live virtual machines."
2302 #: ../src/guestfs.pod:1004
2304 "The virtual machine needs to have been set up beforehand so that it has the "
2305 "virtio-serial channel and so that guestfsd is running inside it."
2310 #: ../src/guestfs.pod:1008
2311 msgid "ABI GUARANTEE"
2316 #: ../src/guestfs.pod:1010
2318 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2319 "actions as outlined in this section. Although we will deprecate some "
2320 "actions, for example if they get replaced by newer calls, we will keep the "
2321 "old actions forever. This allows you the developer to program in confidence "
2322 "against the libguestfs API."
2327 #: ../src/guestfs.pod:1016
2328 msgid "BLOCK DEVICE NAMING"
2333 #: ../src/guestfs.pod:1018
2335 "In the kernel there is now quite a profusion of schemata for naming block "
2336 "devices (in this context, by I<block device> I mean a physical or virtual "
2337 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2338 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2339 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2340 "for the old IDE driver (particularly for SATA devices) those devices also "
2341 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2342 "paravirtualized drivers. This has created several different naming systems, "
2343 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2348 #: ../src/guestfs.pod:1030
2350 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2351 "Linux kernel to access block devices. We can run a variety of appliances "
2352 "based on a variety of Linux kernels."
2357 #: ../src/guestfs.pod:1034
2359 "This causes a problem for libguestfs because many API calls use device or "
2360 "partition names. Working scripts and the recipe (example) scripts that we "
2361 "make available over the internet could fail if the naming scheme changes."
2366 #: ../src/guestfs.pod:1039
2368 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2369 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2370 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2371 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2376 #: ../src/guestfs.pod:1045
2378 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2379 "L</guestfs_list_partitions> and similar calls return the true names of the "
2380 "devices and partitions as known to the appliance."
2385 #: ../src/guestfs.pod:1050
2386 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2391 #: ../src/guestfs.pod:1052
2393 "Usually this translation is transparent. However in some (very rare) cases "
2394 "you may need to know the exact algorithm. Such cases include where you use "
2395 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2396 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2401 #: ../src/guestfs.pod:1058
2403 "The algorithm is applied only to I<parameters> which are known to be either "
2404 "device or partition names. Return values from functions such as L</"
2405 "guestfs_list_devices> are never changed."
2410 #: ../src/guestfs.pod:1066
2411 msgid "Is the string a parameter which is a device or partition name?"
2416 #: ../src/guestfs.pod:1070
2417 msgid "Does the string begin with C</dev/sd>?"
2422 #: ../src/guestfs.pod:1074
2424 "Does the named device exist? If so, we use that device. However if I<not> "
2425 "then we continue with this algorithm."
2430 #: ../src/guestfs.pod:1079
2431 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2436 #: ../src/guestfs.pod:1081
2437 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2442 #: ../src/guestfs.pod:1083
2443 msgid "If that named device exists, use it. If not, continue."
2448 #: ../src/guestfs.pod:1087
2449 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2454 #: ../src/guestfs.pod:1089
2455 msgid "If that named device exists, use it. If not, return an error."
2460 #: ../src/guestfs.pod:1093
2461 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2466 #: ../src/guestfs.pod:1095
2468 "Although the standard naming scheme and automatic translation is useful for "
2469 "simple programs and guestfish scripts, for larger programs it is best not to "
2470 "rely on this mechanism."
2475 #: ../src/guestfs.pod:1099
2477 "Where possible for maximum future portability programs using libguestfs "
2478 "should use these future-proof techniques:"
2483 #: ../src/guestfs.pod:1106
2485 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2486 "device names, and then use those names directly."
2491 #: ../src/guestfs.pod:1109
2493 "Since those device names exist by definition, they will never be translated."
2498 #: ../src/guestfs.pod:1114
2500 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2501 "filesystem labels."
2506 #: ../src/guestfs.pod:1119
2512 #: ../src/guestfs.pod:1121
2514 "This section discusses security implications of using libguestfs, "
2515 "particularly with untrusted or malicious guests or disk images."
2520 #: ../src/guestfs.pod:1124
2521 msgid "GENERAL SECURITY CONSIDERATIONS"
2526 #: ../src/guestfs.pod:1126
2528 "Be careful with any files or data that you download from a guest (by "
2529 "\"download\" we mean not just the L</guestfs_download> command but any "
2530 "command that reads files, filenames, directories or anything else from a "
2531 "disk image). An attacker could manipulate the data to fool your program "
2532 "into doing the wrong thing. Consider cases such as:"
2537 #: ../src/guestfs.pod:1136
2538 msgid "the data (file etc) not being present"
2543 #: ../src/guestfs.pod:1140
2544 msgid "being present but empty"
2549 #: ../src/guestfs.pod:1144
2550 msgid "being much larger than normal"
2555 #: ../src/guestfs.pod:1148
2556 msgid "containing arbitrary 8 bit data"
2561 #: ../src/guestfs.pod:1152
2562 msgid "being in an unexpected character encoding"
2567 #: ../src/guestfs.pod:1156
2568 msgid "containing homoglyphs."
2573 #: ../src/guestfs.pod:1160
2574 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2579 #: ../src/guestfs.pod:1162
2581 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2582 "(VFS) module can sometimes be escalated into exploits by deliberately "
2583 "creating a malicious, malformed filesystem. These exploits are very severe "
2584 "for two reasons. Firstly there are very many filesystem drivers in the "
2585 "kernel, and many of them are infrequently used and not much developer "
2586 "attention has been paid to the code. Linux userspace helps potential "
2587 "crackers by detecting the filesystem type and automatically choosing the "
2588 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2589 "the administrator. Secondly, a kernel-level exploit is like a local root "
2590 "exploit (worse in some ways), giving immediate and total access to the "
2591 "system right down to the hardware level."
2596 #: ../src/guestfs.pod:1175
2598 "That explains why you should never mount a filesystem from an untrusted "
2599 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2600 "inside a qemu virtual machine, usually running as a non-root user. The "
2601 "attacker would need to write a filesystem which first exploited the kernel, "
2602 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2603 "the libguestfs protocol, and finally to be as serious as the host kernel "
2604 "exploit it would need to escalate its privileges to root. This multi-step "
2605 "escalation, performed by a static piece of data, is thought to be extremely "
2606 "hard to do, although we never say 'never' about security issues."
2611 #: ../src/guestfs.pod:1186
2613 "In any case callers can reduce the attack surface by forcing the filesystem "
2614 "type when mounting (use L</guestfs_mount_vfs>)."
2619 #: ../src/guestfs.pod:1189
2620 msgid "PROTOCOL SECURITY"
2625 #: ../src/guestfs.pod:1191
2627 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2628 "defined upper message size. However a program that uses libguestfs must "
2629 "also take care - for example you can write a program that downloads a binary "
2630 "from a disk image and executes it locally, and no amount of protocol "
2631 "security will save you from the consequences."
2636 #: ../src/guestfs.pod:1197
2637 msgid "INSPECTION SECURITY"
2642 #: ../src/guestfs.pod:1199
2644 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2645 "directly from the guest, and these could contain any 8 bit data. Callers "
2646 "should be careful to escape these before printing them to a structured file "
2647 "(for example, use HTML escaping if creating a web page)."
2652 #: ../src/guestfs.pod:1205
2654 "Guest configuration may be altered in unusual ways by the administrator of "
2655 "the virtual machine, and may not reflect reality (particularly for untrusted "
2656 "or actively malicious guests). For example we parse the hostname from "
2657 "configuration files like C</etc/sysconfig/network> that we find in the "
2658 "guest, but the guest administrator can easily manipulate these files to "
2659 "provide the wrong hostname."
2664 #: ../src/guestfs.pod:1213
2666 "The inspection API parses guest configuration using two external libraries: "
2667 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2668 "designed to be robust in the face of malicious data, although denial of "
2669 "service attacks are still possible, for example with oversized configuration "
2675 #: ../src/guestfs.pod:1219
2676 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2681 #: ../src/guestfs.pod:1221
2683 "Be very cautious about running commands from the guest. By running a "
2684 "command in the guest, you are giving CPU time to a binary that you do not "
2685 "control, under the same user account as the library, albeit wrapped in qemu "
2686 "virtualization. More information and alternatives can be found in the "
2687 "section L</RUNNING COMMANDS>."
2692 #: ../src/guestfs.pod:1227
2693 msgid "CVE-2010-3851"
2698 #: ../src/guestfs.pod:1229
2699 msgid "https://bugzilla.redhat.com/642934"
2704 #: ../src/guestfs.pod:1231
2706 "This security bug concerns the automatic disk format detection that qemu "
2707 "does on disk images."
2712 #: ../src/guestfs.pod:1234
2714 "A raw disk image is just the raw bytes, there is no header. Other disk "
2715 "images like qcow2 contain a special header. Qemu deals with this by looking "
2716 "for one of the known headers, and if none is found then assuming the disk "
2717 "image must be raw."
2722 #: ../src/guestfs.pod:1239
2724 "This allows a guest which has been given a raw disk image to write some "
2725 "other header. At next boot (or when the disk image is accessed by "
2726 "libguestfs) qemu would do autodetection and think the disk image format was, "
2727 "say, qcow2 based on the header written by the guest."
2732 #: ../src/guestfs.pod:1244
2734 "This in itself would not be a problem, but qcow2 offers many features, one "
2735 "of which is to allow a disk image to refer to another image (called the "
2736 "\"backing disk\"). It does this by placing the path to the backing disk "
2737 "into the qcow2 header. This path is not validated and could point to any "
2738 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2739 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2740 "control of the attacker."
2745 #: ../src/guestfs.pod:1252
2747 "In libguestfs this is rather hard to exploit except under two circumstances:"
2752 #: ../src/guestfs.pod:1259
2753 msgid "You have enabled the network or have opened the disk in write mode."
2758 #: ../src/guestfs.pod:1263
2760 "You are also running untrusted code from the guest (see L</RUNNING "
2766 #: ../src/guestfs.pod:1268
2768 "The way to avoid this is to specify the expected disk format when adding "
2769 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2770 "should always do this if the disk is raw format, and it's a good idea for "
2776 #: ../src/guestfs.pod:1273
2778 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2779 "format is fetched from libvirt and passed through."
2784 #: ../src/guestfs.pod:1276
2786 "For libguestfs tools, use the I<--format> command line parameter as "
2792 #: ../src/guestfs.pod:1279
2793 msgid "CONNECTION MANAGEMENT"
2798 #: ../src/guestfs.pod:1281
2804 #: ../src/guestfs.pod:1283
2806 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2807 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2808 "handle and release all resources used."
2812 #: ../src/guestfs.pod:1287
2814 "For information on using multiple handles and threads, see the section L</"
2815 "MULTIPLE HANDLES AND MULTIPLE THREADS> above."
2820 #: ../src/guestfs.pod:1290
2821 msgid "guestfs_create"
2826 #: ../src/guestfs.pod:1292
2829 " guestfs_h *guestfs_create (void);\n"
2835 #: ../src/guestfs.pod:1294
2836 msgid "Create a connection handle."
2840 #: ../src/guestfs.pod:1296
2842 "On success this returns a non-NULL pointer to a handle. On error it returns "
2847 #: ../src/guestfs.pod:1299
2849 "You have to \"configure\" the handle after creating it. This includes "
2850 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
2851 "handle at least once."
2856 #: ../src/guestfs.pod:1303
2857 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2861 #: ../src/guestfs.pod:1305
2863 "You may also want to configure error handling for the handle. See the L</"
2864 "ERROR HANDLING> section below."
2869 #: ../src/guestfs.pod:1308
2870 msgid "guestfs_close"
2875 #: ../src/guestfs.pod:1310
2878 " void guestfs_close (guestfs_h *g);\n"
2884 #: ../src/guestfs.pod:1312
2885 msgid "This closes the connection handle and frees up all resources used."
2889 #: ../src/guestfs.pod:1314
2891 "If autosync was set on the handle and the handle was launched, then this "
2892 "implicitly calls various functions to unmount filesystems and sync the "
2893 "disk. See L</guestfs_set_autosync> for more details."
2897 #: ../src/guestfs.pod:1318
2898 msgid "If a close callback was set on the handle, then it is called."
2903 #: ../src/guestfs.pod:1320
2904 msgid "ERROR HANDLING"
2909 #: ../src/guestfs.pod:1322
2911 "API functions can return errors. For example, almost all functions that "
2912 "return C<int> will return C<-1> to indicate an error."
2917 #: ../src/guestfs.pod:1325
2919 "Additional information is available for errors: an error message string and "
2920 "optionally an error number (errno) if the thing that failed was a system "
2926 #: ../src/guestfs.pod:1329
2928 "You can get at the additional information about the last error on the handle "
2929 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2930 "up an error handler with L</guestfs_set_error_handler>."
2935 #: ../src/guestfs.pod:1334
2937 "When the handle is created, a default error handler is installed which "
2938 "prints the error message string to C<stderr>. For small short-running "
2939 "command line programs it is sufficient to do:"
2944 #: ../src/guestfs.pod:1338
2947 " if (guestfs_launch (g) == -1)\n"
2948 " exit (EXIT_FAILURE);\n"
2954 #: ../src/guestfs.pod:1341
2956 "since the default error handler will ensure that an error message has been "
2957 "printed to C<stderr> before the program exits."
2962 #: ../src/guestfs.pod:1344
2964 "For other programs the caller will almost certainly want to install an "
2965 "alternate error handler or do error handling in-line like this:"
2970 #: ../src/guestfs.pod:1347
2973 " g = guestfs_create ();\n"
2979 #: ../src/guestfs.pod:1349
2982 " /* This disables the default behaviour of printing errors\n"
2984 " guestfs_set_error_handler (g, NULL, NULL);\n"
2990 #: ../src/guestfs.pod:1353
2993 " if (guestfs_launch (g) == -1) {\n"
2994 " /* Examine the error message and print it etc. */\n"
2995 " char *msg = guestfs_last_error (g);\n"
2996 " int errnum = guestfs_last_errno (g);\n"
2997 " fprintf (stderr, \"%s\\n\", msg);\n"
3005 #: ../src/guestfs.pod:1361
3007 "Out of memory errors are handled differently. The default action is to call "
3008 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
3009 "guestfs_set_out_of_memory_handler>."
3014 #: ../src/guestfs.pod:1365
3016 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
3017 "because there is no handle if this happens there is no way to get additional "
3018 "error information. However L</guestfs_create> is supposed to be a "
3019 "lightweight operation which can only fail because of insufficient memory (it "
3020 "returns NULL in this case)."
3025 #: ../src/guestfs.pod:1371
3026 msgid "guestfs_last_error"
3031 #: ../src/guestfs.pod:1373
3034 " const char *guestfs_last_error (guestfs_h *g);\n"
3040 #: ../src/guestfs.pod:1375
3042 "This returns the last error message that happened on C<g>. If there has not "
3043 "been an error since the handle was created, then this returns C<NULL>."
3048 #: ../src/guestfs.pod:1379
3050 "The lifetime of the returned string is until the next error occurs, or L</"
3051 "guestfs_close> is called."
3056 #: ../src/guestfs.pod:1382
3057 msgid "guestfs_last_errno"
3062 #: ../src/guestfs.pod:1384
3065 " int guestfs_last_errno (guestfs_h *g);\n"
3071 #: ../src/guestfs.pod:1386
3072 msgid "This returns the last error number (errno) that happened on C<g>."
3077 #: ../src/guestfs.pod:1388
3078 msgid "If successful, an errno integer not equal to zero is returned."
3083 #: ../src/guestfs.pod:1390
3085 "If no error, this returns 0. This call can return 0 in three situations:"
3090 #: ../src/guestfs.pod:1397
3091 msgid "There has not been any error on the handle."
3096 #: ../src/guestfs.pod:1401
3098 "There has been an error but the errno was meaningless. This corresponds to "
3099 "the case where the error did not come from a failed system call, but for "
3100 "some other reason."
3105 #: ../src/guestfs.pod:1407
3107 "There was an error from a failed system call, but for some reason the errno "
3108 "was not captured and returned. This usually indicates a bug in libguestfs."
3113 #: ../src/guestfs.pod:1413
3115 "Libguestfs tries to convert the errno from inside the applicance into a "
3116 "corresponding errno for the caller (not entirely trivial: the appliance "
3117 "might be running a completely different operating system from the library "
3118 "and error numbers are not standardized across Un*xen). If this could not be "
3119 "done, then the error is translated to C<EINVAL>. In practice this should "
3120 "only happen in very rare circumstances."
3125 #: ../src/guestfs.pod:1421
3126 msgid "guestfs_set_error_handler"
3131 #: ../src/guestfs.pod:1423
3134 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
3136 " const char *msg);\n"
3137 " void guestfs_set_error_handler (guestfs_h *g,\n"
3138 " guestfs_error_handler_cb cb,\n"
3145 #: ../src/guestfs.pod:1430
3147 "The callback C<cb> will be called if there is an error. The parameters "
3148 "passed to the callback are an opaque data pointer and the error message "
3154 #: ../src/guestfs.pod:1434
3156 "C<errno> is not passed to the callback. To get that the callback must call "
3157 "L</guestfs_last_errno>."
3162 #: ../src/guestfs.pod:1437
3164 "Note that the message string C<msg> is freed as soon as the callback "
3165 "function returns, so if you want to stash it somewhere you must make your "
3171 #: ../src/guestfs.pod:1441
3172 msgid "The default handler prints messages on C<stderr>."
3177 #: ../src/guestfs.pod:1443
3178 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
3183 #: ../src/guestfs.pod:1445
3184 msgid "guestfs_get_error_handler"
3189 #: ../src/guestfs.pod:1447
3192 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
3193 " void **opaque_rtn);\n"
3199 #: ../src/guestfs.pod:1450
3200 msgid "Returns the current error handler callback."
3205 #: ../src/guestfs.pod:1452
3206 msgid "guestfs_set_out_of_memory_handler"
3210 #: ../src/guestfs.pod:1454
3213 " typedef void (*guestfs_abort_cb) (void);\n"
3214 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
3215 " guestfs_abort_cb);\n"
3221 #: ../src/guestfs.pod:1458
3223 "The callback C<cb> will be called if there is an out of memory situation. "
3224 "I<Note this callback must not return>."
3229 #: ../src/guestfs.pod:1461
3230 msgid "The default is to call L<abort(3)>."
3235 #: ../src/guestfs.pod:1463
3237 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
3242 #: ../src/guestfs.pod:1466
3243 msgid "guestfs_get_out_of_memory_handler"
3248 #: ../src/guestfs.pod:1468
3251 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
3257 #: ../src/guestfs.pod:1470
3258 msgid "This returns the current out of memory handler."
3263 #: ../src/guestfs.pod:1472
3269 #: ../src/guestfs.pod:1474 ../fish/guestfish.pod:1019
3275 #: ../src/guestfs.pod:1476
3281 #: ../src/guestfs.pod:1478
3287 #: ../src/guestfs.pod:1480
3288 msgid "AVAILABILITY"
3293 #: ../src/guestfs.pod:1482
3294 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
3299 #: ../src/guestfs.pod:1484
3301 "Using L</guestfs_available> you can test availability of the following "
3302 "groups of functions. This test queries the appliance to see if the "
3303 "appliance you are currently using supports the functionality."
3308 #: ../src/guestfs.pod:1489
3309 msgid "@AVAILABILITY@"
3314 #: ../src/guestfs.pod:1491
3315 msgid "GUESTFISH supported COMMAND"
3320 #: ../src/guestfs.pod:1493
3322 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
3323 "prints out the available groups and whether they are supported by this build "
3324 "of libguestfs. Note however that you have to do C<run> first."
3329 #: ../src/guestfs.pod:1498
3330 msgid "SINGLE CALLS AT COMPILE TIME"
3335 #: ../src/guestfs.pod:1500
3337 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
3338 "function, such as:"
3343 #: ../src/guestfs.pod:1503
3346 " #define LIBGUESTFS_HAVE_DD 1\n"
3352 #: ../src/guestfs.pod:1505
3353 msgid "if L</guestfs_dd> is available."
3358 #: ../src/guestfs.pod:1507
3360 "Before version 1.5.8, if you needed to test whether a single libguestfs "
3361 "function is available at compile time, we recommended using build tools such "
3362 "as autoconf or cmake. For example in autotools you could use:"
3367 #: ../src/guestfs.pod:1512
3370 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
3371 " AC_CHECK_FUNCS([guestfs_dd])\n"
3377 #: ../src/guestfs.pod:1515
3379 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
3385 #: ../src/guestfs.pod:1518
3386 msgid "SINGLE CALLS AT RUN TIME"
3391 #: ../src/guestfs.pod:1520
3393 "Testing at compile time doesn't guarantee that a function really exists in "
3394 "the library. The reason is that you might be dynamically linked against a "
3395 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
3396 "This situation unfortunately results in a segmentation fault, which is a "
3397 "shortcoming of the C dynamic linking system itself."
3402 #: ../src/guestfs.pod:1527
3404 "You can use L<dlopen(3)> to test if a function is available at run time, as "
3405 "in this example program (note that you still need the compile time check as "
3411 #: ../src/guestfs.pod:1531
3414 " #include <stdio.h>\n"
3415 " #include <stdlib.h>\n"
3416 " #include <unistd.h>\n"
3417 " #include <dlfcn.h>\n"
3418 " #include <guestfs.h>\n"
3424 #: ../src/guestfs.pod:1537
3429 " #ifdef LIBGUESTFS_HAVE_DD\n"
3431 " int has_function;\n"
3437 #: ../src/guestfs.pod:1543
3440 " /* Test if the function guestfs_dd is really available. */\n"
3441 " dl = dlopen (NULL, RTLD_LAZY);\n"
3443 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
3444 " exit (EXIT_FAILURE);\n"
3446 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
3453 #: ../src/guestfs.pod:1552
3456 " if (!has_function)\n"
3457 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
3459 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
3460 " /* Now it's safe to call\n"
3461 " guestfs_dd (g, \"foo\", \"bar\");\n"
3465 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
3473 #: ../src/guestfs.pod:1565
3475 "You may think the above is an awful lot of hassle, and it is. There are "
3476 "other ways outside of the C linking system to ensure that this kind of "
3477 "incompatibility never arises, such as using package versioning:"
3482 #: ../src/guestfs.pod:1570
3485 " Requires: libguestfs >= 1.0.80\n"
3491 #: ../src/guestfs.pod:1572
3492 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3497 #: ../src/guestfs.pod:1574
3499 "A recent feature of the API is the introduction of calls which take optional "
3500 "arguments. In C these are declared 3 ways. The main way is as a call which "
3501 "takes variable arguments (ie. C<...>), as in this example:"
3506 #: ../src/guestfs.pod:1579
3509 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3515 #: ../src/guestfs.pod:1581
3517 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3518 "call with no optional arguments specified:"
3523 #: ../src/guestfs.pod:1584
3526 " guestfs_add_drive_opts (g, filename, -1);\n"
3532 #: ../src/guestfs.pod:1586
3533 msgid "With a single optional argument:"
3538 #: ../src/guestfs.pod:1588
3541 " guestfs_add_drive_opts (g, filename,\n"
3542 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3549 #: ../src/guestfs.pod:1592
3555 #: ../src/guestfs.pod:1594
3558 " guestfs_add_drive_opts (g, filename,\n"
3559 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3560 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3567 #: ../src/guestfs.pod:1599
3569 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3575 #: ../src/guestfs.pod:1602
3576 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3581 #: ../src/guestfs.pod:1604
3583 "The second variant has the same name with the suffix C<_va>, which works the "
3584 "same way but takes a C<va_list>. See the C manual for details. For the "
3585 "example function, this is declared:"
3590 #: ../src/guestfs.pod:1608
3593 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3600 #: ../src/guestfs.pod:1611
3601 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3606 #: ../src/guestfs.pod:1613
3608 "The third variant is useful where you need to construct these calls. You "
3609 "pass in a structure where you fill in the optional fields. The structure "
3610 "has a bitmask as the first element which you must set to indicate which "
3611 "fields you have filled in. For our example function the structure and call "
3617 #: ../src/guestfs.pod:1619
3620 " struct guestfs_add_drive_opts_argv {\n"
3621 " uint64_t bitmask;\n"
3623 " const char *format;\n"
3626 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3627 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3633 #: ../src/guestfs.pod:1628
3634 msgid "You could call it like this:"
3639 #: ../src/guestfs.pod:1630
3642 " struct guestfs_add_drive_opts_argv optargs = {\n"
3643 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3644 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3646 " .format = \"qcow2\"\n"
3653 #: ../src/guestfs.pod:1637
3656 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3662 #: ../src/guestfs.pod:1639 ../src/guestfs-actions.pod:11
3663 #: ../src/guestfs-actions.pod:1857 ../src/guestfs-actions.pod:2257
3664 #: ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1262
3665 #: ../fish/guestfish-actions.pod:1515 ../tools/virt-win-reg.pl:532
3671 #: ../src/guestfs.pod:1645
3672 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3677 #: ../src/guestfs.pod:1650
3678 msgid "You do not need to fill in all fields of the structure."
3683 #: ../src/guestfs.pod:1654
3685 "There must be a one-to-one correspondence between fields of the structure "
3686 "that are filled in, and bits set in the bitmask."
3691 #: ../src/guestfs.pod:1659
3692 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3697 #: ../src/guestfs.pod:1661
3699 "In other languages, optional arguments are expressed in the way that is "
3700 "natural for that language. We refer you to the language-specific "
3701 "documentation for more details on that."
3706 #: ../src/guestfs.pod:1665
3707 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3712 #: ../src/guestfs.pod:1667
3713 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3717 #: ../src/guestfs.pod:1669
3719 "B<Note:> This section documents the generic event mechanism introduced in "
3720 "libguestfs 1.10, which you should use in new code if possible. The old "
3721 "functions C<guestfs_set_log_message_callback>, "
3722 "C<guestfs_set_subprocess_quit_callback>, "
3723 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
3724 "C<guestfs_set_progress_callback> are no longer documented in this manual "
3729 #: ../src/guestfs.pod:1677
3731 "Handles generate events when certain things happen, such as log messages "
3732 "being generated, progress messages during long-running operations, or the "
3733 "handle being closed. The API calls described below let you register a "
3734 "callback to be called when events happen. You can register multiple "
3735 "callbacks (for the same, different or overlapping sets of events), and "
3736 "individually remove callbacks. If callbacks are not removed, then they "
3737 "remain in force until the handle is closed."
3741 #: ../src/guestfs.pod:1685
3743 "In the current implementation, events are only generated synchronously: that "
3744 "means that events (and hence callbacks) can only happen while you are in the "
3745 "middle of making another libguestfs call. The callback is called in the "
3750 #: ../src/guestfs.pod:1690
3752 "Events may contain a payload, usually nothing (void), an array of 64 bit "
3753 "unsigned integers, or a message buffer. Payloads are discussed later on."
3757 #: ../src/guestfs.pod:1694
3758 msgid "CLASSES OF EVENTS"
3762 #: ../src/guestfs.pod:1698
3763 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
3767 #: ../src/guestfs.pod:1701
3769 "The callback function will be called while the handle is being closed "
3770 "(synchronously from L</guestfs_close>)."
3775 #: ../src/guestfs.pod:1704
3777 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3778 "handles that are open when the program exits. This means that this callback "
3779 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3780 "problems in higher-level languages (eg. if your HLL interpreter has already "
3781 "been cleaned up by the time this is called, and if your callback then jumps "
3782 "into some HLL function)."
3786 #: ../src/guestfs.pod:1711
3788 "If no callback is registered: the handle is closed without any callback "
3793 #: ../src/guestfs.pod:1714
3794 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
3798 #: ../src/guestfs.pod:1717
3800 "The callback function will be called when the child process quits, either "
3801 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3802 "corresponds to a transition from any state to the CONFIG state)."
3806 #: ../src/guestfs.pod:1721 ../src/guestfs.pod:1730
3807 msgid "If no callback is registered: the event is ignored."
3811 #: ../src/guestfs.pod:1723
3812 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
3816 #: ../src/guestfs.pod:1726
3818 "The callback function will be called when the child process becomes ready "
3819 "first time after it has been launched. (This corresponds to a transition "
3820 "from LAUNCHING to the READY state)."
3824 #: ../src/guestfs.pod:1732
3825 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
3830 #: ../src/guestfs.pod:1735
3832 "Some long-running operations can generate progress messages. If this "
3833 "callback is registered, then it will be called each time a progress message "
3834 "is generated (usually two seconds after the operation started, and three "
3835 "times per second thereafter until it completes, although the frequency may "
3836 "change in future versions)."
3840 #: ../src/guestfs.pod:1741
3842 "The callback receives in the payload four unsigned 64 bit numbers which are "
3843 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
3847 #: ../src/guestfs.pod:1744
3849 "The units of C<total> are not defined, although for some operations C<total> "
3850 "may relate in some way to the amount of data to be transferred (eg. in bytes "
3851 "or megabytes), and C<position> may be the portion which has been transferred."
3856 #: ../src/guestfs.pod:1749
3857 msgid "The only defined and stable parts of the API are:"
3862 #: ../src/guestfs.pod:1755
3864 "The callback can display to the user some type of progress bar or indicator "
3865 "which shows the ratio of C<position>:C<total>."
3870 #: ../src/guestfs.pod:1760
3871 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3875 #: ../src/guestfs.pod:1764
3877 "If any progress notification is sent during a call, then a final progress "
3878 "notification is always sent when C<position> = C<total> (I<unless> the call "
3879 "fails with an error)."
3884 #: ../src/guestfs.pod:1768
3886 "This is to simplify caller code, so callers can easily set the progress "
3887 "indicator to \"100%\" at the end of the operation, without requiring special "
3888 "code to detect this case."
3892 #: ../src/guestfs.pod:1774
3894 "For some calls we are unable to estimate the progress of the call, but we "
3895 "can still generate progress messages to indicate activity. This is known as "
3896 "\"pulse mode\", and is directly supported by certain progress bar "
3897 "implementations (eg. GtkProgressBar)."
3901 #: ../src/guestfs.pod:1779
3903 "For these calls, zero or more progress messages are generated with "
3904 "C<position = 0> and C<total = 1>, followed by a final message with "
3905 "C<position = total = 1>."
3909 #: ../src/guestfs.pod:1783
3911 "As noted above, if the call fails with an error then the final message may "
3916 #: ../src/guestfs.pod:1788
3918 "The callback also receives the procedure number (C<proc_nr>) and serial "
3919 "number (C<serial>) of the call. These are only useful for debugging "
3920 "protocol issues, and the callback can normally ignore them. The callback "
3921 "may want to print these numbers in error messages or debugging messages."
3925 #: ../src/guestfs.pod:1794
3926 msgid "If no callback is registered: progress messages are discarded."
3930 #: ../src/guestfs.pod:1796
3931 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
3935 #: ../src/guestfs.pod:1799
3937 "The callback function is called whenever a log message is generated by qemu, "
3938 "the appliance kernel, guestfsd (daemon), or utility programs."
3942 #: ../src/guestfs.pod:1802
3944 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
3945 "guestfs_launch>) then additional debug messages are generated."
3949 #: ../src/guestfs.pod:1805 ../src/guestfs.pod:1819
3951 "If no callback is registered: the messages are discarded unless the verbose "
3952 "flag is set in which case they are sent to stderr. You can override the "
3953 "printing of verbose messages to stderr by setting up a callback."
3957 #: ../src/guestfs.pod:1810
3958 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
3962 #: ../src/guestfs.pod:1813
3964 "The callback function is called whenever a log message is generated by the "
3965 "library part of libguestfs."
3969 #: ../src/guestfs.pod:1816
3971 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
3972 "messages are generated."
3976 #: ../src/guestfs.pod:1824
3977 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
3981 #: ../src/guestfs.pod:1827
3983 "The callback function is called whenever a trace message is generated. This "
3984 "only applies if the trace flag (L</guestfs_set_trace>) is set."
3988 #: ../src/guestfs.pod:1830
3990 "If no callback is registered: the messages are sent to stderr. You can "
3991 "override the printing of trace messages to stderr by setting up a callback."
3995 #: ../src/guestfs.pod:1836
3996 msgid "guestfs_set_event_callback"
4000 #: ../src/guestfs.pod:1838
4003 " int guestfs_set_event_callback (guestfs_h *g,\n"
4004 " guestfs_event_callback cb,\n"
4005 " uint64_t event_bitmask,\n"
4012 #: ../src/guestfs.pod:1844
4014 "This function registers a callback (C<cb>) for all event classes in the "
4019 #: ../src/guestfs.pod:1847
4021 "For example, to register for all log message events, you could call this "
4022 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
4023 "To register a single callback for all possible classes of events, use "
4024 "C<GUESTFS_EVENT_ALL>."
4028 #: ../src/guestfs.pod:1853
4029 msgid "C<flags> should always be passed as 0."
4033 #: ../src/guestfs.pod:1855
4035 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
4036 "it for any purpose."
4040 #: ../src/guestfs.pod:1858
4042 "The return value is the event handle (an integer) which you can use to "
4043 "delete the callback (see below)."
4047 #: ../src/guestfs.pod:1861
4049 "If there is an error, this function returns C<-1>, and sets the error in the "
4050 "handle in the usual way (see L</guestfs_last_error> etc.)"
4054 #: ../src/guestfs.pod:1864
4056 "Callbacks remain in effect until they are deleted, or until the handle is "
4061 #: ../src/guestfs.pod:1867
4063 "In the case where multiple callbacks are registered for a particular event "
4064 "class, all of the callbacks are called. The order in which multiple "
4065 "callbacks are called is not defined."
4069 #: ../src/guestfs.pod:1871
4070 msgid "guestfs_delete_event_callback"
4074 #: ../src/guestfs.pod:1873
4077 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
4082 #: ../src/guestfs.pod:1875
4084 "Delete a callback that was previously registered. C<event_handle> should be "
4085 "the integer that was returned by a previous call to "
4086 "C<guestfs_set_event_callback> on the same handle."
4090 #: ../src/guestfs.pod:1879
4091 msgid "guestfs_event_callback"
4095 #: ../src/guestfs.pod:1881
4098 " typedef void (*guestfs_event_callback) (\n"
4101 " uint64_t event,\n"
4102 " int event_handle,\n"
4104 " const char *buf, size_t buf_len,\n"
4105 " const uint64_t *array, size_t array_len);\n"
4110 #: ../src/guestfs.pod:1890
4112 "This is the type of the event callback function that you have to provide."
4116 #: ../src/guestfs.pod:1893
4118 "The basic parameters are: the handle (C<g>), the opaque user pointer "
4119 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
4120 "handle, and C<flags> which in the current API you should ignore."
4124 #: ../src/guestfs.pod:1897
4126 "The remaining parameters contain the event payload (if any). Each event may "
4127 "contain a payload, which usually relates to the event class, but for future "
4128 "proofing your code should be written to handle any payload for any event "
4133 #: ../src/guestfs.pod:1902
4135 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
4136 "there is no message buffer). Note that this message buffer can contain "
4137 "arbitrary 8 bit data, including NUL bytes."
4141 #: ../src/guestfs.pod:1906
4143 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
4144 "moment this is only used for progress messages."
4148 #: ../src/guestfs.pod:1909
4149 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
4153 #: ../src/guestfs.pod:1911
4155 "One motivation for the generic event API was to allow GUI programs to "
4156 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
4157 "unconditionally to C<stderr>."
4161 #: ../src/guestfs.pod:1915
4163 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
4164 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
4165 "messages are not events; you must capture error messages separately)."
4169 #: ../src/guestfs.pod:1920
4171 "Programs have to set up a callback to capture the classes of events of "
4176 #: ../src/guestfs.pod:1923
4180 " guestfs_set_event_callback\n"
4181 " (g, message_callback,\n"
4182 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
4183 " GUESTFS_EVENT_TRACE,\n"
4184 " 0, NULL) == -1)\n"
4185 " if (eh == -1) {\n"
4186 " // handle error in the usual way\n"
4192 #: ../src/guestfs.pod:1933
4194 "The callback can then direct messages to the appropriate place. In this "
4195 "example, messages are directed to syslog:"
4199 #: ../src/guestfs.pod:1936
4203 " message_callback (\n"
4206 " uint64_t event,\n"
4207 " int event_handle,\n"
4209 " const char *buf, size_t buf_len,\n"
4210 " const uint64_t *array, size_t array_len)\n"
4212 " const int priority = LOG_USER|LOG_INFO;\n"
4213 " if (buf_len > 0)\n"
4214 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
4221 #: ../src/guestfs.pod:1951
4222 msgid "PRIVATE DATA AREA"
4226 #: ../src/guestfs.pod:1953
4228 "You can attach named pieces of private data to the libguestfs handle, fetch "
4229 "them by name, and walk over them, for the lifetime of the handle. This is "
4230 "called the private data area and is only available from the C API."
4235 #: ../src/guestfs.pod:1958
4236 msgid "To attach a named piece of data, use the following call:"
4241 #: ../src/guestfs.pod:1960
4244 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
4249 #: ../src/guestfs.pod:1962
4251 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
4252 "pointer (which can be C<NULL>). Any previous item with the same key is "
4257 #: ../src/guestfs.pod:1966
4259 "You can use any C<key> you want, but your key should I<not> start with an "
4260 "underscore character. Keys beginning with an underscore character are "
4261 "reserved for internal libguestfs purposes (eg. for implementing language "
4262 "bindings). It is recommended that you prefix the key with some unique "
4263 "string to avoid collisions with other users."
4268 #: ../src/guestfs.pod:1972
4269 msgid "To retrieve the pointer, use:"
4274 #: ../src/guestfs.pod:1974
4277 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
4283 #: ../src/guestfs.pod:1976
4285 "This function returns C<NULL> if either no data is found associated with "
4286 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
4291 #: ../src/guestfs.pod:1980
4293 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
4294 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
4295 "all. In particular, libguestfs does I<not> try to free the data when the "
4296 "handle is closed. If the data must be freed, then the caller must either "
4297 "free it before calling L</guestfs_close> or must set up a close callback to "
4298 "do it (see L</GUESTFS_EVENT_CLOSE>)."
4302 #: ../src/guestfs.pod:1987
4303 msgid "To walk over all entries, use these two functions:"
4307 #: ../src/guestfs.pod:1989
4310 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
4315 #: ../src/guestfs.pod:1991
4318 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
4323 #: ../src/guestfs.pod:1993
4325 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
4326 "not have any particular meaning -- keys are not returned in any defined "
4327 "order). A pointer to the key is returned in C<*key_rtn> and the "
4328 "corresponding data pointer is returned from the function. C<NULL> is "
4329 "returned if there are no keys stored in the handle."
4333 #: ../src/guestfs.pod:1999
4335 "C<guestfs_next_private> returns the next key, pointer pair. The return "
4336 "value of this function is also C<NULL> is there are no further entries to "
4341 #: ../src/guestfs.pod:2003
4342 msgid "Notes about walking over entries:"
4346 #: ../src/guestfs.pod:2009
4348 "You must not call C<guestfs_set_private> while walking over the entries."
4352 #: ../src/guestfs.pod:2014
4354 "The handle maintains an internal iterator which is reset when you call "
4355 "C<guestfs_first_private>. This internal iterator is invalidated when you "
4356 "call C<guestfs_set_private>."
4360 #: ../src/guestfs.pod:2020
4361 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
4365 #: ../src/guestfs.pod:2022
4368 " guestfs_set_private (g, key, NULL);\n"
4373 #: ../src/guestfs.pod:2024
4374 msgid "then that C<key> is not returned when walking."
4378 #: ../src/guestfs.pod:2028
4380 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
4381 "C<guestfs_next_private> or C<guestfs_set_private>."
4385 #: ../src/guestfs.pod:2034
4387 "The following example code shows how to print all keys and data pointers "
4388 "that are associated with the handle C<g>:"
4392 #: ../src/guestfs.pod:2037
4395 " const char *key;\n"
4396 " void *data = guestfs_first_private (g, &key);\n"
4397 " while (data != NULL)\n"
4399 " printf (\"key = %s, data = %p\\n\", key, data);\n"
4400 " data = guestfs_next_private (g, &key);\n"
4406 #: ../src/guestfs.pod:2045
4408 "More commonly you are only interested in keys that begin with an application-"
4409 "specific prefix C<foo_>. Modify the loop like so:"
4413 #: ../src/guestfs.pod:2048
4416 " const char *key;\n"
4417 " void *data = guestfs_first_private (g, &key);\n"
4418 " while (data != NULL)\n"
4420 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
4421 " printf (\"key = %s, data = %p\\n\", key, data);\n"
4422 " data = guestfs_next_private (g, &key);\n"
4428 #: ../src/guestfs.pod:2057
4430 "If you need to modify keys while walking, then you have to jump back to the "
4431 "beginning of the loop. For example, to delete all keys prefixed with "
4436 #: ../src/guestfs.pod:2061
4439 " const char *key;\n"
4442 " data = guestfs_first_private (g, &key);\n"
4443 " while (data != NULL)\n"
4445 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
4447 " guestfs_set_private (g, key, NULL);\n"
4448 " /* note that 'key' pointer is now invalid, and so is\n"
4449 " the internal iterator */\n"
4452 " data = guestfs_next_private (g, &key);\n"
4458 #: ../src/guestfs.pod:2077
4460 "Note that the above loop is guaranteed to terminate because the keys are "
4461 "being deleted, but other manipulations of keys within the loop might not "
4462 "terminate unless you also maintain an indication of which keys have been "
4468 #: ../src/guestfs.pod:2082 ../src/guestfs.pod:2087
4474 #: ../src/guestfs.pod:2084
4476 "<!-- old anchor for the next section --> <a name="
4477 "\"state_machine_and_low_level_event_api\"/>"
4482 #: ../src/guestfs.pod:2089
4483 msgid "ARCHITECTURE"
4488 #: ../src/guestfs.pod:2091
4490 "Internally, libguestfs is implemented by running an appliance (a special "
4491 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
4492 "process of the main program."
4497 #: ../src/guestfs.pod:2095
4500 " ___________________\n"
4502 " | main program |\n"
4504 " | | child process / appliance\n"
4505 " | | __________________________\n"
4507 " +-------------------+ RPC | +-----------------+ |\n"
4508 " | libguestfs <--------------------> guestfsd | |\n"
4509 " | | | +-----------------+ |\n"
4510 " \\___________________/ | | Linux kernel | |\n"
4511 " | +--^--------------+ |\n"
4512 " \\_________|________________/\n"
4518 " \\______________/\n"
4524 #: ../src/guestfs.pod:2115
4526 "The library, linked to the main program, creates the child process and hence "
4527 "the appliance in the L</guestfs_launch> function."
4532 #: ../src/guestfs.pod:2118
4534 "Inside the appliance is a Linux kernel and a complete stack of userspace "
4535 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
4536 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
4537 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
4538 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
4539 "attached to the qemu process which translates device access by the "
4540 "appliance's Linux kernel into accesses to the image."
4545 #: ../src/guestfs.pod:2127
4547 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
4548 "Although the disk image you are attached to might also be used by some "
4549 "virtual machine, libguestfs doesn't know or care about this. (But you will "
4550 "care if both libguestfs's qemu process and your virtual machine are trying "
4551 "to update the disk image at the same time, since these usually results in "
4552 "massive disk corruption)."
4557 #: ../src/guestfs.pod:2134
4558 msgid "STATE MACHINE"
4563 #: ../src/guestfs.pod:2136
4564 msgid "libguestfs uses a state machine to model the child process:"
4569 #: ../src/guestfs.pod:2138
4581 " / | \\ \\ guestfs_launch\n"
4582 " / | _\\__V______\n"
4584 " / | | LAUNCHING |\n"
4585 " / | \\___________/\n"
4587 " / | guestfs_launch\n"
4589 " ______ / __|____V\n"
4590 " / \\ ------> / \\\n"
4591 " | BUSY | | READY |\n"
4592 " \\______/ <------ \\________/\n"
4598 #: ../src/guestfs.pod:2160
4600 "The normal transitions are (1) CONFIG (when the handle is created, but there "
4601 "is no child process), (2) LAUNCHING (when the child process is booting up), "
4602 "(3) alternating between READY and BUSY as commands are issued to, and "
4603 "carried out by, the child process."
4608 #: ../src/guestfs.pod:2165
4610 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
4611 "asynchronously at any time (eg. due to some internal error), and that causes "
4612 "the state to transition back to CONFIG."
4617 #: ../src/guestfs.pod:2169
4619 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
4620 "issued when in the CONFIG state."
4625 #: ../src/guestfs.pod:2172
4627 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
4628 "L</guestfs_launch> blocks until the child process is READY to accept "
4629 "commands (or until some failure or timeout). L</guestfs_launch> internally "
4630 "moves the state from CONFIG to LAUNCHING while it is running."
4635 #: ../src/guestfs.pod:2178
4637 "API actions such as L</guestfs_mount> can only be issued when in the READY "
4638 "state. These API calls block waiting for the command to be carried out (ie. "
4639 "the state to transition to BUSY and then back to READY). There are no non-"
4640 "blocking versions, and no way to issue more than one command per handle at "
4646 #: ../src/guestfs.pod:2184
4648 "Finally, the child process sends asynchronous messages back to the main "
4649 "program, such as kernel log messages. You can register a callback to "
4650 "receive these messages."
4655 #: ../src/guestfs.pod:2188
4661 #: ../src/guestfs.pod:2190
4662 msgid "COMMUNICATION PROTOCOL"
4667 #: ../src/guestfs.pod:2192
4669 "Don't rely on using this protocol directly. This section documents how it "
4670 "currently works, but it may change at any time."
4675 #: ../src/guestfs.pod:2195
4677 "The protocol used to talk between the library and the daemon running inside "
4678 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
4679 "1014, RFC 1832, RFC 4506)."
4684 #: ../src/guestfs.pod:2199
4686 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
4687 "this file is automatically generated)."
4692 #: ../src/guestfs.pod:2202
4694 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
4695 "and C<FileOut> parameters, which are handled with very simple request/reply "
4696 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
4697 "parameters, which use the same request and reply messages, but they may also "
4698 "be followed by files sent using a chunked encoding."
4703 #: ../src/guestfs.pod:2209
4704 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
4709 #: ../src/guestfs.pod:2211
4710 msgid "For ordinary functions, the request message is:"
4715 #: ../src/guestfs.pod:2213
4718 " total length (header + arguments,\n"
4719 " but not including the length word itself)\n"
4720 " struct guestfs_message_header (encoded as XDR)\n"
4721 " struct guestfs_<foo>_args (encoded as XDR)\n"
4727 #: ../src/guestfs.pod:2218
4729 "The total length field allows the daemon to allocate a fixed size buffer "
4730 "into which it slurps the rest of the message. As a result, the total length "
4731 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
4732 "effective size of any request is limited to somewhere under this size."
4737 #: ../src/guestfs.pod:2224
4739 "Note also that many functions don't take any arguments, in which case the "
4740 "C<guestfs_I<foo>_args> is completely omitted."
4745 #: ../src/guestfs.pod:2227
4747 "The header contains the procedure number (C<guestfs_proc>) which is how the "
4748 "receiver knows what type of args structure to expect, or none at all."
4753 #: ../src/guestfs.pod:2231
4755 "For functions that take optional arguments, the optional arguments are "
4756 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
4757 "arguments. A bitmask in the header indicates which optional arguments are "
4758 "meaningful. The bitmask is also checked to see if it contains bits set "
4759 "which the daemon does not know about (eg. if more optional arguments were "
4760 "added in a later version of the library), and this causes the call to be "
4766 #: ../src/guestfs.pod:2239
4767 msgid "The reply message for ordinary functions is:"
4772 #: ../src/guestfs.pod:2241
4775 " total length (header + ret,\n"
4776 " but not including the length word itself)\n"
4777 " struct guestfs_message_header (encoded as XDR)\n"
4778 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4784 #: ../src/guestfs.pod:2246
4786 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
4787 "functions that return no formal return values."
4792 #: ../src/guestfs.pod:2249
4794 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
4799 #: ../src/guestfs.pod:2252
4801 "In the case of an error, a flag is set in the header, and the reply message "
4802 "is slightly changed:"
4807 #: ../src/guestfs.pod:2255
4810 " total length (header + error,\n"
4811 " but not including the length word itself)\n"
4812 " struct guestfs_message_header (encoded as XDR)\n"
4813 " struct guestfs_message_error (encoded as XDR)\n"
4819 #: ../src/guestfs.pod:2260
4821 "The C<guestfs_message_error> structure contains the error message as a "
4827 #: ../src/guestfs.pod:2263
4828 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
4833 #: ../src/guestfs.pod:2265
4835 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
4836 "The normal request message is sent (see above). However this is followed by "
4837 "a sequence of file chunks."
4842 #: ../src/guestfs.pod:2269
4845 " total length (header + arguments,\n"
4846 " but not including the length word itself,\n"
4847 " and not including the chunks)\n"
4848 " struct guestfs_message_header (encoded as XDR)\n"
4849 " struct guestfs_<foo>_args (encoded as XDR)\n"
4850 " sequence of chunks for FileIn param #0\n"
4851 " sequence of chunks for FileIn param #1 etc.\n"
4857 #: ../src/guestfs.pod:2277
4858 msgid "The \"sequence of chunks\" is:"
4863 #: ../src/guestfs.pod:2279
4866 " length of chunk (not including length word itself)\n"
4867 " struct guestfs_chunk (encoded as XDR)\n"
4868 " length of chunk\n"
4869 " struct guestfs_chunk (encoded as XDR)\n"
4871 " length of chunk\n"
4872 " struct guestfs_chunk (with data.data_len == 0)\n"
4878 #: ../src/guestfs.pod:2287
4880 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
4881 "is set in the final chunk to indicate either successful completion or early "
4887 #: ../src/guestfs.pod:2291
4889 "At time of writing there are no functions that have more than one FileIn "
4890 "parameter. However this is (theoretically) supported, by sending the "
4891 "sequence of chunks for each FileIn parameter one after another (from left to "
4897 #: ../src/guestfs.pod:2296
4899 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
4900 "transfer. The library does this by sending a chunk with a special flag set "
4901 "to indicate cancellation. When the daemon sees this, it cancels the whole "
4902 "RPC, does I<not> send any reply, and goes back to reading the next request."
4907 #: ../src/guestfs.pod:2302
4909 "The daemon may also cancel. It does this by writing a special word "
4910 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
4911 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
4912 "cancel chunk). The special word is chosen so that even if cancellation "
4913 "happens right at the end of the transfer (after the library has finished "
4914 "writing and has started listening for the reply), the \"spurious\" cancel "
4915 "flag will not be confused with the reply message."
4920 #: ../src/guestfs.pod:2311
4922 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
4923 "limit), and also files where the size is not known in advance (eg. from "
4924 "pipes or sockets). However the chunks are rather small "
4925 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
4926 "to keep much in memory."
4931 #: ../src/guestfs.pod:2317
4932 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
4937 #: ../src/guestfs.pod:2319
4939 "The protocol for FileOut parameters is exactly the same as for FileIn "
4940 "parameters, but with the roles of daemon and library reversed."
4945 #: ../src/guestfs.pod:2322
4948 " total length (header + ret,\n"
4949 " but not including the length word itself,\n"
4950 " and not including the chunks)\n"
4951 " struct guestfs_message_header (encoded as XDR)\n"
4952 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4953 " sequence of chunks for FileOut param #0\n"
4954 " sequence of chunks for FileOut param #1 etc.\n"
4960 #: ../src/guestfs.pod:2330
4961 msgid "INITIAL MESSAGE"
4966 #: ../src/guestfs.pod:2332
4968 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
4969 "which indicates that the guest and daemon is alive. This is what L</"
4970 "guestfs_launch> waits for."
4975 #: ../src/guestfs.pod:2336
4976 msgid "PROGRESS NOTIFICATION MESSAGES"
4981 #: ../src/guestfs.pod:2338
4983 "The daemon may send progress notification messages at any time. These are "
4984 "distinguished by the normal length word being replaced by "
4985 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
4989 #: ../src/guestfs.pod:2342
4991 "The library turns them into progress callbacks (see L</"
4992 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
4998 #: ../src/guestfs.pod:2346
5000 "The daemon self-limits the frequency of progress messages it sends (see "
5001 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
5007 #: ../src/guestfs.pod:2350
5008 msgid "LIBGUESTFS VERSION NUMBERS"
5013 #: ../src/guestfs.pod:2352
5015 "Since April 2010, libguestfs has started to make separate development and "
5016 "stable releases, along with corresponding branches in our git repository. "
5017 "These separate releases can be identified by version number:"
5022 #: ../src/guestfs.pod:2357
5025 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
5026 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
5032 " | `-------- sub-version\n"
5034 " `------ always '1' because we don't change the ABI\n"
5040 #: ../src/guestfs.pod:2368
5041 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
5046 #: ../src/guestfs.pod:2370
5048 "As time passes we cherry pick fixes from the development branch and backport "
5049 "those into the stable branch, the effect being that the stable branch should "
5050 "get more stable and less buggy over time. So the stable releases are ideal "
5051 "for people who don't need new features but would just like the software to "
5057 #: ../src/guestfs.pod:2376
5058 msgid "Our criteria for backporting changes are:"
5063 #: ../src/guestfs.pod:2382
5065 "Documentation changes which don't affect any code are backported unless the "
5066 "documentation refers to a future feature which is not in stable."
5071 #: ../src/guestfs.pod:2388
5073 "Bug fixes which are not controversial, fix obvious problems, and have been "
5074 "well tested are backported."
5079 #: ../src/guestfs.pod:2393
5081 "Simple rearrangements of code which shouldn't affect how it works get "
5082 "backported. This is so that the code in the two branches doesn't get too "
5083 "far out of step, allowing us to backport future fixes more easily."
5088 #: ../src/guestfs.pod:2399
5090 "We I<don't> backport new features, new APIs, new tools etc, except in one "
5091 "exceptional case: the new feature is required in order to implement an "
5092 "important bug fix."
5097 #: ../src/guestfs.pod:2405
5099 "A new stable branch starts when we think the new features in development are "
5100 "substantial and compelling enough over the current stable branch to warrant "
5101 "it. When that happens we create new stable and development versions 1.N.0 "
5102 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
5103 "stable at this point, but by backporting fixes from development, that branch "
5104 "will stabilize over time."
5108 #: ../src/guestfs.pod:2413
5109 msgid "EXTENDING LIBGUESTFS"
5113 #: ../src/guestfs.pod:2415
5114 msgid "ADDING A NEW API ACTION"
5118 #: ../src/guestfs.pod:2417
5120 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
5121 "documentation) are generated, and this makes it easy to extend the "
5126 #: ../src/guestfs.pod:2421
5127 msgid "To add a new API action there are two changes:"
5131 #: ../src/guestfs.pod:2427
5133 "You need to add a description of the call (name, parameters, return type, "
5134 "tests, documentation) to C<generator/generator_actions.ml>."
5138 #: ../src/guestfs.pod:2430
5140 "There are two sorts of API action, depending on whether the call goes "
5141 "through to the daemon in the appliance, or is serviced entirely by the "
5142 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
5143 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
5144 "an example of the latter, since a trace flag is maintained in the handle and "
5145 "all tracing is done on the library side."
5149 #: ../src/guestfs.pod:2438
5151 "Most new actions are of the first type, and get added to the "
5152 "C<daemon_functions> list. Each function has a unique procedure number used "
5153 "in the RPC protocol which is assigned to that action when we publish "
5154 "libguestfs and cannot be reused. Take the latest procedure number and "
5159 #: ../src/guestfs.pod:2444
5161 "For library-only actions of the second type, add to the "
5162 "C<non_daemon_functions> list. Since these functions are serviced by the "
5163 "library and do not travel over the RPC mechanism to the daemon, these "
5164 "functions do not need a procedure number, and so the procedure number is set "
5169 #: ../src/guestfs.pod:2452
5170 msgid "Implement the action (in C):"
5174 #: ../src/guestfs.pod:2454
5176 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
5177 "C<daemon/> directory."
5181 #: ../src/guestfs.pod:2457
5183 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
5184 "(note: double underscore) in the C<src/> directory."
5188 #: ../src/guestfs.pod:2460
5189 msgid "In either case, use another function as an example of what to do."
5193 #: ../src/guestfs.pod:2464
5194 msgid "After making these changes, use C<make> to compile."
5198 #: ../src/guestfs.pod:2466
5200 "Note that you don't need to implement the RPC, language bindings, manual "
5201 "pages or anything else. It's all automatically generated from the OCaml "
5206 #: ../src/guestfs.pod:2470
5207 msgid "ADDING TESTS FOR AN API ACTION"
5211 #: ../src/guestfs.pod:2472
5213 "You can supply zero or as many tests as you want per API call. The tests "
5214 "can either be added as part of the API description (C<generator/"
5215 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
5216 "into C<regressions/>. Note that adding a script to C<regressions/> is "
5217 "slower, so if possible use the first method."
5221 #: ../src/guestfs.pod:2478
5223 "The following describes the test environment used when you add an API test "
5224 "in C<generator_actions.ml>."
5228 #: ../src/guestfs.pod:2481
5229 msgid "The test environment has 4 block devices:"
5233 #: ../src/guestfs.pod:2485
5234 msgid "C</dev/sda> 500MB"
5238 #: ../src/guestfs.pod:2487
5239 msgid "General block device for testing."
5243 #: ../src/guestfs.pod:2489
5244 msgid "C</dev/sdb> 50MB"
5248 #: ../src/guestfs.pod:2491
5250 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
5255 #: ../src/guestfs.pod:2494
5256 msgid "C</dev/sdc> 10MB"
5260 #: ../src/guestfs.pod:2496
5261 msgid "Used in a few tests where two block devices are needed."
5265 #: ../src/guestfs.pod:2498
5270 #: ../src/guestfs.pod:2500
5271 msgid "ISO with fixed content (see C<images/test.iso>)."
5275 #: ../src/guestfs.pod:2504
5277 "To be able to run the tests in a reasonable amount of time, the libguestfs "
5278 "appliance and block devices are reused between tests. So don't try testing "
5279 "L</guestfs_kill_subprocess> :-x"
5283 #: ../src/guestfs.pod:2508
5285 "Each test starts with an initial scenario, selected using one of the "
5286 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
5287 "initialize the disks mentioned above in a particular way as documented in "
5288 "C<generator_types.ml>. You should not assume anything about the previous "
5289 "contents of other disks that are not initialized."
5293 #: ../src/guestfs.pod:2514
5295 "You can add a prerequisite clause to any individual test. This is a run-"
5296 "time check, which, if it fails, causes the test to be skipped. Useful if "
5297 "testing a command which might not work on all variations of libguestfs "
5298 "builds. A test that has prerequisite of C<Always> means to run "
5303 #: ../src/guestfs.pod:2520
5305 "In addition, packagers can skip individual tests by setting environment "
5306 "variables before running C<make check>."
5310 #: ../src/guestfs.pod:2523
5313 " SKIP_TEST_<CMD>_<NUM>=1\n"
5318 #: ../src/guestfs.pod:2525
5319 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
5323 #: ../src/guestfs.pod:2527
5328 #: ../src/guestfs.pod:2529
5331 " SKIP_TEST_<CMD>=1\n"
5336 #: ../src/guestfs.pod:2531
5337 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
5341 #: ../src/guestfs.pod:2533
5342 msgid "Packagers can run only certain tests by setting for example:"
5346 #: ../src/guestfs.pod:2535
5349 " TEST_ONLY=\"vfs_type zerofree\"\n"
5354 #: ../src/guestfs.pod:2537
5356 "See C<capitests/tests.c> for more details of how these environment variables "
5361 #: ../src/guestfs.pod:2540
5362 msgid "DEBUGGING NEW API ACTIONS"
5366 #: ../src/guestfs.pod:2542
5367 msgid "Test new actions work before submitting them."
5371 #: ../src/guestfs.pod:2544
5372 msgid "You can use guestfish to try out new commands."
5376 #: ../src/guestfs.pod:2546
5378 "Debugging the daemon is a problem because it runs inside a minimal "
5379 "environment. However you can fprintf messages in the daemon to stderr, and "
5380 "they will show up if you use C<guestfish -v>."
5384 #: ../src/guestfs.pod:2550
5385 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
5389 #: ../src/guestfs.pod:2552
5391 "Our C source code generally adheres to some basic code-formatting "
5392 "conventions. The existing code base is not totally consistent on this "
5393 "front, but we do prefer that contributed code be formatted similarly. In "
5394 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
5395 "indentation level, and other than that, follow the K&R style."
5399 #: ../src/guestfs.pod:2558
5401 "If you use Emacs, add the following to one of one of your start-up files (e."
5402 "g., ~/.emacs), to help ensure that you get indentation right:"
5406 #: ../src/guestfs.pod:2561
5409 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
5410 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
5411 " (add-hook 'find-file-hook\n"
5412 " '(lambda () (if (and buffer-file-name\n"
5413 " (string-match \"/libguestfs\\\\>\"\n"
5414 " (buffer-file-name))\n"
5415 " (not (string-equal mode-name \"Change Log\"))\n"
5416 " (not (string-equal mode-name \"Makefile\")))\n"
5417 " (setq indent-tabs-mode nil))))\n"
5422 #: ../src/guestfs.pod:2571
5425 " ;;; When editing C sources in libguestfs, use this style.\n"
5426 " (defun libguestfs-c-mode ()\n"
5427 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
5429 " (c-set-style \"K&R\")\n"
5430 " (setq c-indent-level 2)\n"
5431 " (setq c-basic-offset 2))\n"
5432 " (add-hook 'c-mode-hook\n"
5433 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
5434 " (buffer-file-name))\n"
5435 " (libguestfs-c-mode))))\n"
5440 #: ../src/guestfs.pod:2583
5441 msgid "Enable warnings when compiling (and fix any problems this finds):"
5445 #: ../src/guestfs.pod:2586
5448 " ./configure --enable-gcc-warnings\n"
5453 #: ../src/guestfs.pod:2588
5454 msgid "Useful targets are:"
5458 #: ../src/guestfs.pod:2590
5461 " make syntax-check # checks the syntax of the C code\n"
5462 " make check # runs the test suite\n"
5467 #: ../src/guestfs.pod:2593
5468 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
5472 #: ../src/guestfs.pod:2595
5474 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
5475 "which are used to do shell quoting."
5479 #: ../src/guestfs.pod:2600
5484 #: ../src/guestfs.pod:2602
5486 "Simple shell quoted string. Any spaces or other shell characters are "
5491 #: ../src/guestfs.pod:2605
5496 #: ../src/guestfs.pod:2607
5498 "Same as C<%Q> except the string is treated as a path which is prefixed by "
5504 #: ../src/guestfs.pod:2612 ../fish/guestfish.pod:240 ../fish/guestfish.pod:613
5505 msgid "For example:"
5509 #: ../src/guestfs.pod:2614
5512 " asprintf (&cmd, \"cat %R\", path);\n"
5517 #: ../src/guestfs.pod:2616
5518 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
5522 #: ../src/guestfs.pod:2618
5524 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
5525 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
5526 "they are not passed via the shell (instead, straight to exec). You probably "
5527 "want to use the C<sysroot_path()> function however."
5531 #: ../src/guestfs.pod:2624
5532 msgid "SUBMITTING YOUR NEW API ACTIONS"
5536 #: ../src/guestfs.pod:2626
5538 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
5539 "libguestfs> and CC to L<rjones@redhat.com>."
5543 #: ../src/guestfs.pod:2630
5544 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
5548 #: ../src/guestfs.pod:2632
5549 msgid "We support i18n (gettext anyhow) in the library."
5553 #: ../src/guestfs.pod:2634
5555 "However many messages come from the daemon, and we don't translate those at "
5556 "the moment. One reason is that the appliance generally has all locale files "
5557 "removed from it, because they take up a lot of space. So we'd have to readd "
5558 "some of those, as well as copying our PO files into the appliance."
5562 #: ../src/guestfs.pod:2640
5564 "Debugging messages are never translated, since they are intended for the "
5569 #: ../src/guestfs.pod:2643
5570 msgid "SOURCE CODE SUBDIRECTORIES"
5574 #: ../src/guestfs.pod:2647 ../src/guestfs-actions.pod:5854
5575 #: ../fish/guestfish-actions.pod:3948
5576 msgid "C<appliance>"
5580 #: ../src/guestfs.pod:2649
5581 msgid "The libguestfs appliance, build scripts and so on."
5585 #: ../src/guestfs.pod:2651
5586 msgid "C<capitests>"
5590 #: ../src/guestfs.pod:2653
5591 msgid "Automated tests of the C API."
5595 #: ../src/guestfs.pod:2655
5600 #: ../src/guestfs.pod:2657
5602 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
5607 #: ../src/guestfs.pod:2660
5612 #: ../src/guestfs.pod:2662
5614 "Safety and liveness tests of components that libguestfs depends upon (not of "
5615 "libguestfs itself). Mainly this is for qemu and the kernel."
5619 #: ../src/guestfs.pod:2665
5624 #: ../src/guestfs.pod:2667
5625 msgid "Outside contributions, experimental parts."
5629 #: ../src/guestfs.pod:2669
5634 #: ../src/guestfs.pod:2671
5636 "The daemon that runs inside the libguestfs appliance and carries out actions."
5640 #: ../src/guestfs.pod:2674
5645 #: ../src/guestfs.pod:2676
5646 msgid "L<virt-df(1)> command and documentation."
5650 #: ../src/guestfs.pod:2678
5655 #: ../src/guestfs.pod:2680
5656 msgid "C API example code."
5660 #: ../src/guestfs.pod:2682
5665 #: ../src/guestfs.pod:2684
5667 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
5668 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
5669 "L<virt-tar-out(1)>."
5673 #: ../src/guestfs.pod:2688
5678 #: ../src/guestfs.pod:2690
5680 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
5684 #: ../src/guestfs.pod:2692
5685 msgid "C<generator>"
5689 #: ../src/guestfs.pod:2694
5691 "The crucially important generator, used to automatically generate large "
5692 "amounts of boilerplate C code for things like RPC and bindings."
5696 #: ../src/guestfs.pod:2697
5701 #: ../src/guestfs.pod:2699
5702 msgid "Files used by the test suite."
5706 #: ../src/guestfs.pod:2701
5707 msgid "Some \"phony\" guest images which we test against."
5711 #: ../src/guestfs.pod:2703
5712 msgid "C<inspector>"
5716 #: ../src/guestfs.pod:2705
5717 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
5721 #: ../src/guestfs.pod:2707
5726 #: ../src/guestfs.pod:2709
5727 msgid "Logo used on the website. The fish is called Arthur by the way."
5731 #: ../src/guestfs.pod:2711
5736 #: ../src/guestfs.pod:2713
5737 msgid "M4 macros used by autoconf."
5741 #: ../src/guestfs.pod:2715
5746 #: ../src/guestfs.pod:2717
5747 msgid "Translations of simple gettext strings."
5751 #: ../src/guestfs.pod:2719
5756 #: ../src/guestfs.pod:2721
5758 "The build infrastructure and PO files for translations of manpages and POD "
5759 "files. Eventually this will be combined with the C<po> directory, but that "
5760 "is rather complicated."
5764 #: ../src/guestfs.pod:2725
5765 msgid "C<regressions>"
5769 #: ../src/guestfs.pod:2727
5770 msgid "Regression tests."
5774 #: ../src/guestfs.pod:2729
5779 #: ../src/guestfs.pod:2731
5780 msgid "L<virt-rescue(1)> command and documentation."
5784 #: ../src/guestfs.pod:2733
5789 #: ../src/guestfs.pod:2735
5790 msgid "Source code to the C library."
5794 #: ../src/guestfs.pod:2737
5799 #: ../src/guestfs.pod:2739
5800 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
5804 #: ../src/guestfs.pod:2741
5805 msgid "C<test-tool>"
5809 #: ../src/guestfs.pod:2743
5811 "Test tool for end users to test if their qemu/kernel combination will work "
5816 #: ../src/guestfs.pod:2746
5821 #: ../src/guestfs.pod:2748
5826 #: ../src/guestfs.pod:2750
5831 #: ../src/guestfs.pod:2752
5836 #: ../src/guestfs.pod:2754
5841 #: ../src/guestfs.pod:2756
5846 #: ../src/guestfs.pod:2758
5851 #: ../src/guestfs.pod:2760
5856 #: ../src/guestfs.pod:2762
5857 msgid "Language bindings."
5861 #: ../src/guestfs.pod:2766
5867 #: ../src/guestfs.pod:2768
5868 msgid "PROTOCOL LIMITS"
5873 #: ../src/guestfs.pod:2770
5875 "Internally libguestfs uses a message-based protocol to pass API calls and "
5876 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
5877 "plenty more detail about this). The maximum message size used by the "
5878 "protocol is slightly less than 4 MB. For some API calls you may need to be "
5879 "aware of this limit. The API calls which may be affected are individually "
5880 "documented, with a link back to this section of the documentation."
5885 #: ../src/guestfs.pod:2778
5887 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
5888 "a simple string. Because this string is at some point internally encoded as "
5889 "a message, the maximum size that it can return is slightly under 4 MB. If "
5890 "the requested file is larger than this then you will get an error."
5895 #: ../src/guestfs.pod:2784
5897 "In order to transfer large files into and out of the guest filesystem, you "
5898 "need to use particular calls that support this. The sections L</UPLOADING> "
5899 "and L</DOWNLOADING> document how to do this."
5904 #: ../src/guestfs.pod:2788
5906 "You might also consider mounting the disk image using our FUSE filesystem "
5907 "support (L<guestmount(1)>)."
5911 #: ../src/guestfs.pod:2791
5912 msgid "MAXIMUM NUMBER OF DISKS"
5916 #: ../src/guestfs.pod:2793
5917 msgid "When using virtio disks (the default) the current limit is B<25> disks."
5921 #: ../src/guestfs.pod:2796
5923 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
5924 "slots. However febootstrap only understands disks with names C</dev/vda> "
5925 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
5930 #: ../src/guestfs.pod:2801
5932 "We are working to substantially raise this limit in future versions but it "
5933 "requires complex changes to qemu."
5937 #: ../src/guestfs.pod:2804
5939 "In future versions of libguestfs it should also be possible to \"hot plug\" "
5940 "disks (add and remove disks after calling L</guestfs_launch>). This also "
5941 "requires changes to qemu."
5945 #: ../src/guestfs.pod:2808
5946 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
5950 #: ../src/guestfs.pod:2810
5951 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
5955 #: ../src/guestfs.pod:2812
5957 "This is because it reserves 4 bits for the minor device number (thus C</dev/"
5958 "vda>, and C</dev/vda1> through C</dev/vda15>)."
5962 #: ../src/guestfs.pod:2815
5964 "If you attach a disk with more than 15 partitions, the extra partitions are "
5965 "ignored by libguestfs."
5969 #: ../src/guestfs.pod:2818
5970 msgid "MAXIMUM SIZE OF A DISK"
5974 #: ../src/guestfs.pod:2820
5975 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
5979 #: ../src/guestfs.pod:2822
5981 "We have tested block devices up to 1 exabyte (2**60 or "
5982 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
5987 #: ../src/guestfs.pod:2826
5989 "Although libguestfs probably does not impose any limit, the underlying host "
5990 "storage will. If you store disk images on a host ext4 filesystem, then the "
5991 "maximum size will be limited by the maximum ext4 file size (currently 16 "
5992 "TB). If you store disk images as host logical volumes then you are limited "
5993 "by the maximum size of an LV."
5997 #: ../src/guestfs.pod:2832
5999 "For the hugest disk image files, we recommend using XFS on the host for "
6004 #: ../src/guestfs.pod:2835
6005 msgid "MAXIMUM SIZE OF A PARTITION"
6009 #: ../src/guestfs.pod:2837
6011 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
6012 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
6013 "address a partition located beyond 2 TB on the disk."
6017 #: ../src/guestfs.pod:2841
6019 "It is recommended that you use GPT partitions on disks which are larger than "
6020 "this size. GPT uses 64 bit sector numbers and so can address partitions "
6021 "which are theoretically larger than the largest disk we could support."
6025 #: ../src/guestfs.pod:2846
6026 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
6030 #: ../src/guestfs.pod:2848
6032 "This depends on the filesystem type. libguestfs itself does not impose any "
6033 "known limit. Consult Wikipedia or the filesystem documentation to find out "
6034 "what these limits are."
6038 #: ../src/guestfs.pod:2852
6039 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
6043 #: ../src/guestfs.pod:2854
6045 "The API functions L</guestfs_upload>, L</guestfs_download>, L</"
6046 "guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
6047 "uploads and downloads."
6051 #: ../src/guestfs.pod:2858
6052 msgid "INSPECTION LIMITS"
6056 #: ../src/guestfs.pod:2860
6058 "The inspection code has several arbitrary limits on things like the size of "
6059 "Windows Registry hive it will read, and the length of product name. These "
6060 "are intended to stop a malicious guest from consuming arbitrary amounts of "
6061 "memory and disk space on the host, and should not be reached in practice. "
6062 "See the source code for more information."
6067 #: ../src/guestfs.pod:2866 ../fish/guestfish.pod:1026
6068 #: ../test-tool/libguestfs-test-tool.pod:82 ../tools/virt-edit.pl:476
6069 msgid "ENVIRONMENT VARIABLES"
6074 #: ../src/guestfs.pod:2870 ../fish/guestfish.pod:1052
6075 msgid "LIBGUESTFS_APPEND"
6080 #: ../src/guestfs.pod:2872 ../fish/guestfish.pod:1054
6081 msgid "Pass additional options to the guest kernel."
6086 #: ../src/guestfs.pod:2874 ../fish/guestfish.pod:1056
6087 msgid "LIBGUESTFS_DEBUG"
6092 #: ../src/guestfs.pod:2876
6094 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
6095 "effect as calling C<guestfs_set_verbose (g, 1)>."
6100 #: ../src/guestfs.pod:2879 ../fish/guestfish.pod:1061
6101 msgid "LIBGUESTFS_MEMSIZE"
6106 #: ../src/guestfs.pod:2881 ../fish/guestfish.pod:1063
6108 "Set the memory allocated to the qemu process, in megabytes. For example:"
6113 #: ../src/guestfs.pod:2884 ../fish/guestfish.pod:1066
6116 " LIBGUESTFS_MEMSIZE=700\n"
6122 #: ../src/guestfs.pod:2886 ../fish/guestfish.pod:1068
6123 msgid "LIBGUESTFS_PATH"
6127 #: ../src/guestfs.pod:2888
6129 "Set the path that libguestfs uses to search for a supermin appliance. See "
6130 "the discussion of paths in section L</PATH> above."
6135 #: ../src/guestfs.pod:2891 ../fish/guestfish.pod:1073
6136 msgid "LIBGUESTFS_QEMU"
6141 #: ../src/guestfs.pod:2893 ../fish/guestfish.pod:1075
6143 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
6144 "which was found at compile time by the configure script is used."
6149 #: ../src/guestfs.pod:2897
6150 msgid "See also L</QEMU WRAPPERS> above."
6155 #: ../src/guestfs.pod:2899 ../fish/guestfish.pod:1079
6156 msgid "LIBGUESTFS_TRACE"
6161 #: ../src/guestfs.pod:2901
6163 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
6164 "effect as calling C<guestfs_set_trace (g, 1)>."
6169 #: ../src/guestfs.pod:2904 ../fish/guestfish.pod:1088
6174 #: ../src/guestfs.pod:2906 ../fish/guestfish.pod:1090
6176 "Location of temporary directory, defaults to C</tmp> except for the cached "
6177 "supermin appliance which defaults to C</var/tmp>."
6181 #: ../src/guestfs.pod:2909 ../fish/guestfish.pod:1093
6183 "If libguestfs was compiled to use the supermin appliance then the real "
6184 "appliance is cached in this directory, shared between all handles belonging "
6185 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
6186 "use in case C</var/tmp> is not large enough."
6191 #: ../src/guestfs.pod:2917 ../fish/guestfish.pod:1160
6192 #: ../test-tool/libguestfs-test-tool.pod:87 ../fuse/guestmount.pod:277
6193 #: ../tools/virt-edit.pl:496 ../tools/virt-win-reg.pl:572
6194 #: ../tools/virt-list-filesystems.pl:189 ../tools/virt-tar.pl:286
6195 #: ../tools/virt-make-fs.pl:539 ../tools/virt-list-partitions.pl:257
6200 #: ../src/guestfs.pod:2919
6202 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-"
6203 "python(3)>, L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat"
6204 "(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)"
6205 ">, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)"
6206 ">, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-"
6207 "rescue(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-"
6208 "win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs."
6214 #: ../src/guestfs.pod:2947
6216 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
6217 "(8)>, L<disktype(1)>."
6222 #: ../src/guestfs.pod:2954 ../tools/virt-win-reg.pl:587
6223 #: ../tools/virt-make-fs.pl:553
6229 #: ../src/guestfs.pod:2956
6230 msgid "To get a list of bugs against libguestfs use this link:"
6235 #: ../src/guestfs.pod:2958
6237 "L<https://bugzilla.redhat.com/buglist.cgi?"
6238 "component=libguestfs&product=Virtualization+Tools>"
6243 #: ../src/guestfs.pod:2960
6244 msgid "To report a new bug against libguestfs use this link:"
6249 #: ../src/guestfs.pod:2962
6251 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
6252 "component=libguestfs&product=Virtualization+Tools>"
6257 #: ../src/guestfs.pod:2964
6258 msgid "When reporting a bug, please check:"
6263 #: ../src/guestfs.pod:2970
6264 msgid "That the bug hasn't been reported already."
6269 #: ../src/guestfs.pod:2974
6270 msgid "That you are testing a recent version."
6275 #: ../src/guestfs.pod:2978
6276 msgid "Describe the bug accurately, and give a way to reproduce it."
6281 #: ../src/guestfs.pod:2982
6283 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
6289 #: ../src/guestfs.pod:2987 ../fish/guestfish.pod:1183
6290 #: ../test-tool/libguestfs-test-tool.pod:93 ../fuse/guestmount.pod:288
6296 #: ../src/guestfs.pod:2989 ../fish/guestfish.pod:1185
6297 #: ../test-tool/libguestfs-test-tool.pod:95 ../fuse/guestmount.pod:290
6298 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
6303 #: ../src/guestfs.pod:2991 ../fish/guestfish.pod:1187
6304 #: ../test-tool/libguestfs-test-tool.pod:97 ../fuse/guestmount.pod:292
6305 #: ../tools/virt-edit.pl:514 ../tools/virt-win-reg.pl:602
6306 #: ../tools/virt-list-filesystems.pl:206 ../tools/virt-tar.pl:305
6307 #: ../tools/virt-make-fs.pl:568 ../tools/virt-list-partitions.pl:273
6312 #: ../src/guestfs.pod:2993 ../fish/guestfish.pod:1189
6313 #: ../test-tool/libguestfs-test-tool.pod:99
6314 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
6319 #: ../src/guestfs.pod:2996
6321 "This library is free software; you can redistribute it and/or modify it "
6322 "under the terms of the GNU Lesser General Public License as published by the "
6323 "Free Software Foundation; either version 2 of the License, or (at your "
6324 "option) any later version."
6329 #: ../src/guestfs.pod:3001
6331 "This library is distributed in the hope that it will be useful, but WITHOUT "
6332 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
6333 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
6339 #: ../src/guestfs.pod:3006
6341 "You should have received a copy of the GNU Lesser General Public License "
6342 "along with this library; if not, write to the Free Software Foundation, "
6343 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
6348 #: ../src/guestfs-actions.pod:1
6349 msgid "guestfs_add_cdrom"
6354 #: ../src/guestfs-actions.pod:3
6358 " guestfs_add_cdrom (guestfs_h *g,\n"
6359 " const char *filename);\n"
6365 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
6366 msgid "This function adds a virtual CD-ROM disk image to the guest."
6370 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
6371 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
6376 #: ../src/guestfs-actions.pod:17
6378 "This call checks for the existence of C<filename>. This stops you from "
6379 "specifying other types of drive which are supported by qemu such as C<nbd:> "
6380 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
6386 #: ../src/guestfs-actions.pod:24
6388 "If you just want to add an ISO file (often you use this as an efficient way "
6389 "to transfer large files into the guest), then you should probably use "
6390 "C<guestfs_add_drive_ro> instead."
6395 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:134
6396 #: ../src/guestfs-actions.pod:195 ../src/guestfs-actions.pod:232
6397 #: ../src/guestfs-actions.pod:246 ../src/guestfs-actions.pod:267
6398 #: ../src/guestfs-actions.pod:287 ../src/guestfs-actions.pod:301
6399 #: ../src/guestfs-actions.pod:421 ../src/guestfs-actions.pod:441
6400 #: ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:500
6401 #: ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:546
6402 #: ../src/guestfs-actions.pod:613 ../src/guestfs-actions.pod:646
6403 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:675
6404 #: ../src/guestfs-actions.pod:774 ../src/guestfs-actions.pod:792
6405 #: ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:820
6406 #: ../src/guestfs-actions.pod:981 ../src/guestfs-actions.pod:1001
6407 #: ../src/guestfs-actions.pod:1019 ../src/guestfs-actions.pod:1103
6408 #: ../src/guestfs-actions.pod:1121 ../src/guestfs-actions.pod:1140
6409 #: ../src/guestfs-actions.pod:1154 ../src/guestfs-actions.pod:1174
6410 #: ../src/guestfs-actions.pod:1244 ../src/guestfs-actions.pod:1275
6411 #: ../src/guestfs-actions.pod:1300 ../src/guestfs-actions.pod:1342
6412 #: ../src/guestfs-actions.pod:1448 ../src/guestfs-actions.pod:1482
6413 #: ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1719
6414 #: ../src/guestfs-actions.pod:1806 ../src/guestfs-actions.pod:2290
6415 #: ../src/guestfs-actions.pod:2434 ../src/guestfs-actions.pod:2495
6416 #: ../src/guestfs-actions.pod:2530 ../src/guestfs-actions.pod:3483
6417 #: ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3523
6418 #: ../src/guestfs-actions.pod:3678 ../src/guestfs-actions.pod:3692
6419 #: ../src/guestfs-actions.pod:3705 ../src/guestfs-actions.pod:3719
6420 #: ../src/guestfs-actions.pod:3734 ../src/guestfs-actions.pod:3770
6421 #: ../src/guestfs-actions.pod:3842 ../src/guestfs-actions.pod:3862
6422 #: ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3902
6423 #: ../src/guestfs-actions.pod:3925 ../src/guestfs-actions.pod:3957
6424 #: ../src/guestfs-actions.pod:3976 ../src/guestfs-actions.pod:3995
6425 #: ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4042
6426 #: ../src/guestfs-actions.pod:4078 ../src/guestfs-actions.pod:4094
6427 #: ../src/guestfs-actions.pod:4107 ../src/guestfs-actions.pod:4122
6428 #: ../src/guestfs-actions.pod:4139 ../src/guestfs-actions.pod:4232
6429 #: ../src/guestfs-actions.pod:4252 ../src/guestfs-actions.pod:4265
6430 #: ../src/guestfs-actions.pod:4316 ../src/guestfs-actions.pod:4334
6431 #: ../src/guestfs-actions.pod:4352 ../src/guestfs-actions.pod:4368
6432 #: ../src/guestfs-actions.pod:4382 ../src/guestfs-actions.pod:4396
6433 #: ../src/guestfs-actions.pod:4413 ../src/guestfs-actions.pod:4428
6434 #: ../src/guestfs-actions.pod:4448 ../src/guestfs-actions.pod:4506
6435 #: ../src/guestfs-actions.pod:4579 ../src/guestfs-actions.pod:4610
6436 #: ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4648
6437 #: ../src/guestfs-actions.pod:4660 ../src/guestfs-actions.pod:4677
6438 #: ../src/guestfs-actions.pod:4690 ../src/guestfs-actions.pod:4705
6439 #: ../src/guestfs-actions.pod:4720 ../src/guestfs-actions.pod:4755
6440 #: ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:4797
6441 #: ../src/guestfs-actions.pod:4811 ../src/guestfs-actions.pod:4828
6442 #: ../src/guestfs-actions.pod:4877 ../src/guestfs-actions.pod:4923
6443 #: ../src/guestfs-actions.pod:4937 ../src/guestfs-actions.pod:4965
6444 #: ../src/guestfs-actions.pod:4982 ../src/guestfs-actions.pod:5000
6445 #: ../src/guestfs-actions.pod:5134 ../src/guestfs-actions.pod:5191
6446 #: ../src/guestfs-actions.pod:5213 ../src/guestfs-actions.pod:5231
6447 #: ../src/guestfs-actions.pod:5263 ../src/guestfs-actions.pod:5329
6448 #: ../src/guestfs-actions.pod:5346 ../src/guestfs-actions.pod:5359
6449 #: ../src/guestfs-actions.pod:5373 ../src/guestfs-actions.pod:5662
6450 #: ../src/guestfs-actions.pod:5681 ../src/guestfs-actions.pod:5700
6451 #: ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:5724
6452 #: ../src/guestfs-actions.pod:5738 ../src/guestfs-actions.pod:5750
6453 #: ../src/guestfs-actions.pod:5764 ../src/guestfs-actions.pod:5780
6454 #: ../src/guestfs-actions.pod:5801 ../src/guestfs-actions.pod:5820
6455 #: ../src/guestfs-actions.pod:5839 ../src/guestfs-actions.pod:5869
6456 #: ../src/guestfs-actions.pod:5885 ../src/guestfs-actions.pod:5908
6457 #: ../src/guestfs-actions.pod:5926 ../src/guestfs-actions.pod:5945
6458 #: ../src/guestfs-actions.pod:5966 ../src/guestfs-actions.pod:5985
6459 #: ../src/guestfs-actions.pod:6002 ../src/guestfs-actions.pod:6030
6460 #: ../src/guestfs-actions.pod:6054 ../src/guestfs-actions.pod:6073
6461 #: ../src/guestfs-actions.pod:6097 ../src/guestfs-actions.pod:6116
6462 #: ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150
6463 #: ../src/guestfs-actions.pod:6187 ../src/guestfs-actions.pod:6217
6464 #: ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6372
6465 #: ../src/guestfs-actions.pod:6493 ../src/guestfs-actions.pod:6505
6466 #: ../src/guestfs-actions.pod:6518 ../src/guestfs-actions.pod:6531
6467 #: ../src/guestfs-actions.pod:6553 ../src/guestfs-actions.pod:6566
6468 #: ../src/guestfs-actions.pod:6579 ../src/guestfs-actions.pod:6592
6469 #: ../src/guestfs-actions.pod:6607 ../src/guestfs-actions.pod:6666
6470 #: ../src/guestfs-actions.pod:6683 ../src/guestfs-actions.pod:6699
6471 #: ../src/guestfs-actions.pod:6715 ../src/guestfs-actions.pod:6732
6472 #: ../src/guestfs-actions.pod:6745 ../src/guestfs-actions.pod:6765
6473 #: ../src/guestfs-actions.pod:6801 ../src/guestfs-actions.pod:6815
6474 #: ../src/guestfs-actions.pod:6856 ../src/guestfs-actions.pod:6869
6475 #: ../src/guestfs-actions.pod:6887 ../src/guestfs-actions.pod:6921
6476 #: ../src/guestfs-actions.pod:6957 ../src/guestfs-actions.pod:7076
6477 #: ../src/guestfs-actions.pod:7094 ../src/guestfs-actions.pod:7108
6478 #: ../src/guestfs-actions.pod:7163 ../src/guestfs-actions.pod:7176
6479 #: ../src/guestfs-actions.pod:7221 ../src/guestfs-actions.pod:7254
6480 #: ../src/guestfs-actions.pod:7315 ../src/guestfs-actions.pod:7341
6481 #: ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7426
6482 #: ../src/guestfs-actions.pod:7455
6483 msgid "This function returns 0 on success or -1 on error."
6487 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:248
6488 #: ../src/guestfs-actions.pod:269
6490 "This function is deprecated. In new code, use the L</"
6491 "guestfs_add_drive_opts> call instead."
6496 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:251
6497 #: ../src/guestfs-actions.pod:272 ../src/guestfs-actions.pod:1453
6498 #: ../src/guestfs-actions.pod:1946 ../src/guestfs-actions.pod:1967
6499 #: ../src/guestfs-actions.pod:4453 ../src/guestfs-actions.pod:4760
6500 #: ../src/guestfs-actions.pod:6195 ../src/guestfs-actions.pod:6225
6501 #: ../src/guestfs-actions.pod:6258 ../src/guestfs-actions.pod:6317
6502 #: ../src/guestfs-actions.pod:7259 ../src/guestfs-actions.pod:7349
6503 #: ../src/guestfs-actions.pod:7518 ../fish/guestfish-actions.pod:31
6504 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:175
6505 #: ../fish/guestfish-actions.pod:961 ../fish/guestfish-actions.pod:1321
6506 #: ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:3032
6507 #: ../fish/guestfish-actions.pod:3229 ../fish/guestfish-actions.pod:4210
6508 #: ../fish/guestfish-actions.pod:4233 ../fish/guestfish-actions.pod:4255
6509 #: ../fish/guestfish-actions.pod:4293 ../fish/guestfish-actions.pod:4934
6510 #: ../fish/guestfish-actions.pod:5031
6512 "Deprecated functions will not be removed from the API, but the fact that "
6513 "they are deprecated indicates that there are problems with correct use of "
6519 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:136
6520 #: ../src/guestfs-actions.pod:1105 ../src/guestfs-actions.pod:1918
6521 #: ../src/guestfs-actions.pod:2016 ../src/guestfs-actions.pod:2119
6522 #: ../src/guestfs-actions.pod:3485 ../src/guestfs-actions.pod:3505
6523 #: ../src/guestfs-actions.pod:4764 ../src/guestfs-actions.pod:5887
6524 #: ../src/guestfs-actions.pod:6004 ../src/guestfs-actions.pod:6118
6525 #: ../src/guestfs-actions.pod:6609 ../src/guestfs-actions.pod:6734
6526 #: ../src/guestfs-actions.pod:7263
6527 msgid "(Added in 0.3)"
6532 #: ../src/guestfs-actions.pod:41
6533 msgid "guestfs_add_domain"
6538 #: ../src/guestfs-actions.pod:43
6542 " guestfs_add_domain (guestfs_h *g,\n"
6543 " const char *dom,\n"
6550 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:145
6551 #: ../src/guestfs-actions.pod:4467
6553 "You may supply a list of optional arguments to this call. Use zero or more "
6554 "of the following pairs of parameters, and terminate the list with C<-1> on "
6555 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
6559 #: ../src/guestfs-actions.pod:53
6562 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
6563 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
6564 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
6565 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
6571 #: ../src/guestfs-actions.pod:58
6573 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
6574 "It works by connecting to libvirt, requesting the domain and domain XML from "
6575 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
6581 #: ../src/guestfs-actions.pod:63 ../fish/guestfish-actions.pod:46
6583 "The number of disks added is returned. This operation is atomic: if an "
6584 "error is returned, then no disks are added."
6589 #: ../src/guestfs-actions.pod:66 ../fish/guestfish-actions.pod:49
6591 "This function does some minimal checks to make sure the libvirt domain is "
6592 "not running (unless C<readonly> is true). In a future version we will try "
6593 "to acquire the libvirt lock on each disk."
6598 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:53
6600 "Disks must be accessible locally. This often means that adding disks from a "
6601 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
6602 "unless those disks are accessible via the same device path locally too."
6606 #: ../src/guestfs-actions.pod:75 ../fish/guestfish-actions.pod:58
6608 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
6609 "libvirt.org/uri.html>). If this is not set then we connect to the default "
6610 "libvirt URI (or one set through an environment variable, see the libvirt "
6611 "documentation for full details)."
6615 #: ../src/guestfs-actions.pod:81 ../fish/guestfish-actions.pod:64
6617 "The optional C<live> flag controls whether this call will try to connect to "
6618 "a running virtual machine C<guestfsd> process if it sees a suitable "
6619 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
6620 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
6621 "DAEMONS> for more information."
6626 #: ../src/guestfs-actions.pod:88
6628 "The other optional parameters are passed directly through to "
6629 "C<guestfs_add_drive_opts>."
6634 #: ../src/guestfs-actions.pod:91 ../src/guestfs-actions.pod:344
6635 #: ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:692
6636 #: ../src/guestfs-actions.pod:723 ../src/guestfs-actions.pod:741
6637 #: ../src/guestfs-actions.pod:760 ../src/guestfs-actions.pod:1320
6638 #: ../src/guestfs-actions.pod:1676 ../src/guestfs-actions.pod:1879
6639 #: ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2028
6640 #: ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2106
6641 #: ../src/guestfs-actions.pod:2421 ../src/guestfs-actions.pod:2804
6642 #: ../src/guestfs-actions.pod:2825 ../src/guestfs-actions.pod:4900
6643 #: ../src/guestfs-actions.pod:5037 ../src/guestfs-actions.pod:5443
6644 #: ../src/guestfs-actions.pod:5469 ../src/guestfs-actions.pod:6842
6645 #: ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7287
6646 #: ../src/guestfs-actions.pod:7300
6647 msgid "On error this function returns -1."
6652 #: ../src/guestfs-actions.pod:93
6653 msgid "(Added in 1.7.4)"
6658 #: ../src/guestfs-actions.pod:95
6659 msgid "guestfs_add_domain_va"
6664 #: ../src/guestfs-actions.pod:97
6668 " guestfs_add_domain_va (guestfs_h *g,\n"
6669 " const char *dom,\n"
6676 #: ../src/guestfs-actions.pod:102
6677 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
6682 #: ../src/guestfs-actions.pod:104 ../src/guestfs-actions.pod:115
6683 #: ../src/guestfs-actions.pod:208 ../src/guestfs-actions.pod:219
6684 #: ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4532
6685 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
6690 #: ../src/guestfs-actions.pod:106
6691 msgid "guestfs_add_domain_argv"
6696 #: ../src/guestfs-actions.pod:108
6700 " guestfs_add_domain_argv (guestfs_h *g,\n"
6701 " const char *dom,\n"
6702 " const struct guestfs_add_domain_argv *optargs);\n"
6708 #: ../src/guestfs-actions.pod:113
6709 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
6714 #: ../src/guestfs-actions.pod:117
6715 msgid "guestfs_add_drive"
6720 #: ../src/guestfs-actions.pod:119
6724 " guestfs_add_drive (guestfs_h *g,\n"
6725 " const char *filename);\n"
6731 #: ../src/guestfs-actions.pod:123
6733 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
6734 "optional parameters, so the disk is added writable, with the format being "
6735 "detected automatically."
6740 #: ../src/guestfs-actions.pod:127
6742 "Automatic detection of the format opens you up to a potential security hole "
6743 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6744 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6745 "you should think about replacing calls to this function with calls to "
6746 "C<guestfs_add_drive_opts>, and specifying the format."
6751 #: ../src/guestfs-actions.pod:138
6752 msgid "guestfs_add_drive_opts"
6757 #: ../src/guestfs-actions.pod:140
6761 " guestfs_add_drive_opts (guestfs_h *g,\n"
6762 " const char *filename,\n"
6769 #: ../src/guestfs-actions.pod:150
6772 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
6773 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
6774 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
6780 #: ../src/guestfs-actions.pod:154 ../fish/guestfish-actions.pod:97
6782 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6783 "The first time you call this function, the disk appears as C</dev/sda>, the "
6784 "second time as C</dev/sdb>, and so on."
6789 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:102
6791 "You don't necessarily need to be root when using libguestfs. However you "
6792 "obviously do need sufficient permissions to access the filename for whatever "
6793 "operations you want to perform (ie. read access if you just want to read the "
6794 "image or write access if you want to modify the image)."
6799 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:108
6800 msgid "This call checks that C<filename> exists."
6805 #: ../src/guestfs-actions.pod:167 ../src/guestfs-actions.pod:4478
6806 #: ../fish/guestfish-actions.pod:110 ../fish/guestfish-actions.pod:3043
6807 msgid "The optional arguments are:"
6812 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:114
6818 #: ../src/guestfs-actions.pod:173 ../fish/guestfish-actions.pod:116
6820 "If true then the image is treated as read-only. Writes are still allowed, "
6821 "but they are stored in a temporary snapshot overlay which is discarded at "
6822 "the end. The disk that you add is not modified."
6827 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:120
6833 #: ../src/guestfs-actions.pod:179
6835 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
6836 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
6837 "Possible formats include C<raw> and C<qcow2>."
6842 #: ../src/guestfs-actions.pod:183 ../fish/guestfish-actions.pod:126
6844 "Automatic detection of the format opens you up to a potential security hole "
6845 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6846 "RHBZ#642934. Specifying the format closes this security hole."
6851 #: ../src/guestfs-actions.pod:188 ../fish/guestfish-actions.pod:131
6857 #: ../src/guestfs-actions.pod:190
6859 "This rarely-used option lets you emulate the behaviour of the deprecated "
6860 "C<guestfs_add_drive_with_if> call (q.v.)"
6865 #: ../src/guestfs-actions.pod:197
6866 msgid "(Added in 1.5.23)"
6871 #: ../src/guestfs-actions.pod:199
6872 msgid "guestfs_add_drive_opts_va"
6877 #: ../src/guestfs-actions.pod:201
6881 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
6882 " const char *filename,\n"
6889 #: ../src/guestfs-actions.pod:206
6890 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
6895 #: ../src/guestfs-actions.pod:210
6896 msgid "guestfs_add_drive_opts_argv"
6901 #: ../src/guestfs-actions.pod:212
6905 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
6906 " const char *filename,\n"
6907 " const struct guestfs_add_drive_opts_argv *optargs);\n"
6913 #: ../src/guestfs-actions.pod:217
6914 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
6919 #: ../src/guestfs-actions.pod:221
6920 msgid "guestfs_add_drive_ro"
6925 #: ../src/guestfs-actions.pod:223
6929 " guestfs_add_drive_ro (guestfs_h *g,\n"
6930 " const char *filename);\n"
6936 #: ../src/guestfs-actions.pod:227
6938 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
6939 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
6940 "disk is added read-only, with the format being detected automatically."
6945 #: ../src/guestfs-actions.pod:234
6946 msgid "(Added in 1.0.38)"
6951 #: ../src/guestfs-actions.pod:236
6952 msgid "guestfs_add_drive_ro_with_if"
6957 #: ../src/guestfs-actions.pod:238
6961 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
6962 " const char *filename,\n"
6963 " const char *iface);\n"
6969 #: ../src/guestfs-actions.pod:243
6971 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
6972 "QEMU interface emulation to use at run time."
6977 #: ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276
6978 #: ../src/guestfs-actions.pod:2380
6979 msgid "(Added in 1.0.84)"
6984 #: ../src/guestfs-actions.pod:257
6985 msgid "guestfs_add_drive_with_if"
6990 #: ../src/guestfs-actions.pod:259
6994 " guestfs_add_drive_with_if (guestfs_h *g,\n"
6995 " const char *filename,\n"
6996 " const char *iface);\n"
7002 #: ../src/guestfs-actions.pod:264
7004 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
7005 "QEMU interface emulation to use at run time."
7010 #: ../src/guestfs-actions.pod:278
7011 msgid "guestfs_aug_clear"
7016 #: ../src/guestfs-actions.pod:280
7020 " guestfs_aug_clear (guestfs_h *g,\n"
7021 " const char *augpath);\n"
7027 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:183
7029 "Set the value associated with C<path> to C<NULL>. This is the same as the "
7030 "L<augtool(1)> C<clear> command."
7035 #: ../src/guestfs-actions.pod:289 ../src/guestfs-actions.pod:2108
7036 msgid "(Added in 1.3.4)"
7041 #: ../src/guestfs-actions.pod:291
7042 msgid "guestfs_aug_close"
7047 #: ../src/guestfs-actions.pod:293
7051 " guestfs_aug_close (guestfs_h *g);\n"
7057 #: ../src/guestfs-actions.pod:296
7059 "Close the current Augeas handle and free up any resources used by it. After "
7060 "calling this, you have to call C<guestfs_aug_init> again before you can use "
7061 "any other Augeas functions."
7066 #: ../src/guestfs-actions.pod:303 ../src/guestfs-actions.pod:328
7067 #: ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360
7068 #: ../src/guestfs-actions.pod:423 ../src/guestfs-actions.pod:443
7069 #: ../src/guestfs-actions.pod:457 ../src/guestfs-actions.pod:488
7070 #: ../src/guestfs-actions.pod:502 ../src/guestfs-actions.pod:516
7071 #: ../src/guestfs-actions.pod:530 ../src/guestfs-actions.pod:548
7072 #: ../src/guestfs-actions.pod:5520
7073 msgid "(Added in 0.7)"
7078 #: ../src/guestfs-actions.pod:305
7079 msgid "guestfs_aug_defnode"
7084 #: ../src/guestfs-actions.pod:307
7087 " struct guestfs_int_bool *\n"
7088 " guestfs_aug_defnode (guestfs_h *g,\n"
7089 " const char *name,\n"
7090 " const char *expr,\n"
7091 " const char *val);\n"
7097 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:199
7099 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
7104 #: ../src/guestfs-actions.pod:316
7106 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
7107 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
7108 "containing that single node."
7113 #: ../src/guestfs-actions.pod:320 ../fish/guestfish-actions.pod:206
7115 "On success this returns a pair containing the number of nodes in the "
7116 "nodeset, and a boolean flag if a node was created."
7121 #: ../src/guestfs-actions.pod:324
7123 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
7124 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
7129 #: ../src/guestfs-actions.pod:330
7130 msgid "guestfs_aug_defvar"
7135 #: ../src/guestfs-actions.pod:332
7139 " guestfs_aug_defvar (guestfs_h *g,\n"
7140 " const char *name,\n"
7141 " const char *expr);\n"
7147 #: ../src/guestfs-actions.pod:337 ../fish/guestfish-actions.pod:214
7149 "Defines an Augeas variable C<name> whose value is the result of evaluating "
7150 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
7155 #: ../src/guestfs-actions.pod:341 ../fish/guestfish-actions.pod:218
7157 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
7158 "evaluates to something which is not a nodeset."
7163 #: ../src/guestfs-actions.pod:348
7164 msgid "guestfs_aug_get"
7169 #: ../src/guestfs-actions.pod:350
7173 " guestfs_aug_get (guestfs_h *g,\n"
7174 " const char *augpath);\n"
7180 #: ../src/guestfs-actions.pod:354 ../fish/guestfish-actions.pod:225
7182 "Look up the value associated with C<path>. If C<path> matches exactly one "
7183 "node, the C<value> is returned."
7188 #: ../src/guestfs-actions.pod:357 ../src/guestfs-actions.pod:862
7189 #: ../src/guestfs-actions.pod:880 ../src/guestfs-actions.pod:940
7190 #: ../src/guestfs-actions.pod:956 ../src/guestfs-actions.pod:1059
7191 #: ../src/guestfs-actions.pod:1189 ../src/guestfs-actions.pod:1206
7192 #: ../src/guestfs-actions.pod:1225 ../src/guestfs-actions.pod:1359
7193 #: ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1659
7194 #: ../src/guestfs-actions.pod:1822 ../src/guestfs-actions.pod:1839
7195 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:1940
7196 #: ../src/guestfs-actions.pod:1961 ../src/guestfs-actions.pod:2131
7197 #: ../src/guestfs-actions.pod:2345 ../src/guestfs-actions.pod:2552
7198 #: ../src/guestfs-actions.pod:2645 ../src/guestfs-actions.pod:2756
7199 #: ../src/guestfs-actions.pod:2776 ../src/guestfs-actions.pod:2896
7200 #: ../src/guestfs-actions.pod:2927 ../src/guestfs-actions.pod:2951
7201 #: ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3048
7202 #: ../src/guestfs-actions.pod:3071 ../src/guestfs-actions.pod:3092
7203 #: ../src/guestfs-actions.pod:3664 ../src/guestfs-actions.pod:4014
7204 #: ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4294
7205 #: ../src/guestfs-actions.pod:5055 ../src/guestfs-actions.pod:5248
7206 #: ../src/guestfs-actions.pod:5418 ../src/guestfs-actions.pod:5596
7207 #: ../src/guestfs-actions.pod:5645 ../src/guestfs-actions.pod:6278
7208 #: ../src/guestfs-actions.pod:6294 ../src/guestfs-actions.pod:6311
7209 #: ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:7016
7210 #: ../src/guestfs-actions.pod:7035 ../src/guestfs-actions.pod:7053
7211 #: ../src/guestfs-actions.pod:7233 ../src/guestfs-actions.pod:7512
7213 "This function returns a string, or NULL on error. I<The caller must free "
7214 "the returned string after use>."
7219 #: ../src/guestfs-actions.pod:362
7220 msgid "guestfs_aug_init"
7225 #: ../src/guestfs-actions.pod:364
7229 " guestfs_aug_init (guestfs_h *g,\n"
7230 " const char *root,\n"
7237 #: ../src/guestfs-actions.pod:369 ../fish/guestfish-actions.pod:232
7239 "Create a new Augeas handle for editing configuration files. If there was "
7240 "any previous Augeas handle associated with this guestfs session, then it is "
7246 #: ../src/guestfs-actions.pod:373
7247 msgid "You must call this before using any other C<guestfs_aug_*> commands."
7252 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:239
7254 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
7259 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:242
7261 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
7262 "logical I<or> of the following integers:"
7267 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:248
7268 msgid "C<AUG_SAVE_BACKUP> = 1"
7273 #: ../src/guestfs-actions.pod:387 ../fish/guestfish-actions.pod:250
7274 msgid "Keep the original file with a C<.augsave> extension."
7279 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:252
7280 msgid "C<AUG_SAVE_NEWFILE> = 2"
7285 #: ../src/guestfs-actions.pod:391 ../fish/guestfish-actions.pod:254
7287 "Save changes into a file with extension C<.augnew>, and do not overwrite "
7288 "original. Overrides C<AUG_SAVE_BACKUP>."
7293 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:257
7294 msgid "C<AUG_TYPE_CHECK> = 4"
7298 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:259
7299 msgid "Typecheck lenses."
7303 #: ../src/guestfs-actions.pod:398
7305 "This option is only useful when debugging Augeas lenses. Use of this option "
7306 "may require additional memory for the libguestfs appliance. You may need to "
7307 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
7308 "C<guestfs_set_memsize>."
7313 #: ../src/guestfs-actions.pod:403 ../fish/guestfish-actions.pod:266
7314 msgid "C<AUG_NO_STDINC> = 8"
7319 #: ../src/guestfs-actions.pod:405 ../fish/guestfish-actions.pod:268
7320 msgid "Do not use standard load path for modules."
7325 #: ../src/guestfs-actions.pod:407 ../fish/guestfish-actions.pod:270
7326 msgid "C<AUG_SAVE_NOOP> = 16"
7331 #: ../src/guestfs-actions.pod:409 ../fish/guestfish-actions.pod:272
7332 msgid "Make save a no-op, just record what would have been changed."
7337 #: ../src/guestfs-actions.pod:411 ../fish/guestfish-actions.pod:274
7338 msgid "C<AUG_NO_LOAD> = 32"
7343 #: ../src/guestfs-actions.pod:413
7344 msgid "Do not load the tree in C<guestfs_aug_init>."
7349 #: ../src/guestfs-actions.pod:417
7350 msgid "To close the handle, you can call C<guestfs_aug_close>."
7355 #: ../src/guestfs-actions.pod:419 ../fish/guestfish-actions.pod:282
7356 msgid "To find out more about Augeas, see L<http://augeas.net/>."
7361 #: ../src/guestfs-actions.pod:425
7362 msgid "guestfs_aug_insert"
7367 #: ../src/guestfs-actions.pod:427
7371 " guestfs_aug_insert (guestfs_h *g,\n"
7372 " const char *augpath,\n"
7373 " const char *label,\n"
7380 #: ../src/guestfs-actions.pod:433 ../fish/guestfish-actions.pod:288
7382 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
7383 "or after C<path> (depending on the boolean flag C<before>)."
7388 #: ../src/guestfs-actions.pod:437 ../fish/guestfish-actions.pod:292
7390 "C<path> must match exactly one existing node in the tree, and C<label> must "
7391 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
7396 #: ../src/guestfs-actions.pod:445
7397 msgid "guestfs_aug_load"
7402 #: ../src/guestfs-actions.pod:447
7406 " guestfs_aug_load (guestfs_h *g);\n"
7412 #: ../src/guestfs-actions.pod:450 ../fish/guestfish-actions.pod:300
7413 msgid "Load files into the tree."
7418 #: ../src/guestfs-actions.pod:452 ../fish/guestfish-actions.pod:302
7419 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
7424 #: ../src/guestfs-actions.pod:459
7425 msgid "guestfs_aug_ls"
7430 #: ../src/guestfs-actions.pod:461
7434 " guestfs_aug_ls (guestfs_h *g,\n"
7435 " const char *augpath);\n"
7441 #: ../src/guestfs-actions.pod:465
7443 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
7444 "sorting the resulting nodes into alphabetical order."
7449 #: ../src/guestfs-actions.pod:468 ../src/guestfs-actions.pod:484
7450 #: ../src/guestfs-actions.pod:630 ../src/guestfs-actions.pod:1078
7451 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1393
7452 #: ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:1515
7453 #: ../src/guestfs-actions.pod:1761 ../src/guestfs-actions.pod:2203
7454 #: ../src/guestfs-actions.pod:2219 ../src/guestfs-actions.pod:2238
7455 #: ../src/guestfs-actions.pod:2303 ../src/guestfs-actions.pod:2327
7456 #: ../src/guestfs-actions.pod:2398 ../src/guestfs-actions.pod:2447
7457 #: ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:3005
7458 #: ../src/guestfs-actions.pod:3294 ../src/guestfs-actions.pod:3584
7459 #: ../src/guestfs-actions.pod:3646 ../src/guestfs-actions.pod:3751
7460 #: ../src/guestfs-actions.pod:4156 ../src/guestfs-actions.pod:4861
7461 #: ../src/guestfs-actions.pod:5390 ../src/guestfs-actions.pod:5516
7462 #: ../src/guestfs-actions.pod:5630 ../src/guestfs-actions.pod:6358
7463 #: ../src/guestfs-actions.pod:6419 ../src/guestfs-actions.pod:6474
7464 #: ../src/guestfs-actions.pod:6620 ../src/guestfs-actions.pod:6644
7465 #: ../src/guestfs-actions.pod:7126 ../src/guestfs-actions.pod:7146
7466 #: ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7365
7467 #: ../src/guestfs-actions.pod:7384 ../src/guestfs-actions.pod:7469
7468 #: ../src/guestfs-actions.pod:7488 ../src/guestfs-actions.pod:7534
7469 #: ../src/guestfs-actions.pod:7553
7471 "This function returns a NULL-terminated array of strings (like L<environ(3)"
7472 ">), or NULL if there was an error. I<The caller must free the strings and "
7473 "the array after use>."
7478 #: ../src/guestfs-actions.pod:472 ../src/guestfs-actions.pod:1003
7479 #: ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1431
7480 #: ../src/guestfs-actions.pod:3372 ../src/guestfs-actions.pod:3403
7481 #: ../src/guestfs-actions.pod:3997 ../src/guestfs-actions.pod:4047
7482 #: ../src/guestfs-actions.pod:4234 ../src/guestfs-actions.pod:4267
7483 #: ../src/guestfs-actions.pod:4430 ../src/guestfs-actions.pod:4865
7484 #: ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5726
7485 #: ../src/guestfs-actions.pod:5740 ../src/guestfs-actions.pod:5752
7486 #: ../src/guestfs-actions.pod:6199 ../src/guestfs-actions.pod:6858
7487 #: ../src/guestfs-actions.pod:6871 ../src/guestfs-actions.pod:7110
7488 #: ../src/guestfs-actions.pod:7353
7489 msgid "(Added in 0.8)"
7494 #: ../src/guestfs-actions.pod:474
7495 msgid "guestfs_aug_match"
7500 #: ../src/guestfs-actions.pod:476
7504 " guestfs_aug_match (guestfs_h *g,\n"
7505 " const char *augpath);\n"
7511 #: ../src/guestfs-actions.pod:480 ../fish/guestfish-actions.pod:316
7513 "Returns a list of paths which match the path expression C<path>. The "
7514 "returned paths are sufficiently qualified so that they match exactly one "
7515 "node in the current tree."
7520 #: ../src/guestfs-actions.pod:490
7521 msgid "guestfs_aug_mv"
7526 #: ../src/guestfs-actions.pod:492
7530 " guestfs_aug_mv (guestfs_h *g,\n"
7531 " const char *src,\n"
7532 " const char *dest);\n"
7538 #: ../src/guestfs-actions.pod:497 ../fish/guestfish-actions.pod:324
7540 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
7541 "C<dest> is overwritten if it exists."
7546 #: ../src/guestfs-actions.pod:504
7547 msgid "guestfs_aug_rm"
7552 #: ../src/guestfs-actions.pod:506
7556 " guestfs_aug_rm (guestfs_h *g,\n"
7557 " const char *augpath);\n"
7563 #: ../src/guestfs-actions.pod:510 ../fish/guestfish-actions.pod:331
7564 msgid "Remove C<path> and all of its children."
7569 #: ../src/guestfs-actions.pod:512 ../fish/guestfish-actions.pod:333
7570 msgid "On success this returns the number of entries which were removed."
7575 #: ../src/guestfs-actions.pod:518
7576 msgid "guestfs_aug_save"
7581 #: ../src/guestfs-actions.pod:520
7585 " guestfs_aug_save (guestfs_h *g);\n"
7591 #: ../src/guestfs-actions.pod:523 ../fish/guestfish-actions.pod:339
7592 msgid "This writes all pending changes to disk."
7597 #: ../src/guestfs-actions.pod:525
7599 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
7605 #: ../src/guestfs-actions.pod:532
7606 msgid "guestfs_aug_set"
7611 #: ../src/guestfs-actions.pod:534
7615 " guestfs_aug_set (guestfs_h *g,\n"
7616 " const char *augpath,\n"
7617 " const char *val);\n"
7623 #: ../src/guestfs-actions.pod:539 ../fish/guestfish-actions.pod:348
7624 msgid "Set the value associated with C<path> to C<val>."
7629 #: ../src/guestfs-actions.pod:541
7631 "In the Augeas API, it is possible to clear a node by setting the value to "
7632 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
7633 "this call. Instead you must use the C<guestfs_aug_clear> call."
7638 #: ../src/guestfs-actions.pod:550
7639 msgid "guestfs_available"
7644 #: ../src/guestfs-actions.pod:552
7648 " guestfs_available (guestfs_h *g,\n"
7649 " char *const *groups);\n"
7655 #: ../src/guestfs-actions.pod:556 ../fish/guestfish-actions.pod:359
7657 "This command is used to check the availability of some groups of "
7658 "functionality in the appliance, which not all builds of the libguestfs "
7659 "appliance will be able to provide."
7664 #: ../src/guestfs-actions.pod:560
7666 "The libguestfs groups, and the functions that those groups correspond to, "
7667 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
7668 "runtime by calling C<guestfs_available_all_groups>."
7673 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:368
7675 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
7676 "\"]> would check for the availability of the Linux inotify functions and "
7677 "Augeas (configuration file editing) functions."
7682 #: ../src/guestfs-actions.pod:570 ../fish/guestfish-actions.pod:373
7683 msgid "The command returns no error if I<all> requested groups are available."
7688 #: ../src/guestfs-actions.pod:572 ../fish/guestfish-actions.pod:375
7690 "It fails with an error if one or more of the requested groups is unavailable "
7696 #: ../src/guestfs-actions.pod:575 ../fish/guestfish-actions.pod:378
7698 "If an unknown group name is included in the list of groups then an error is "
7704 #: ../src/guestfs-actions.pod:578 ../fish/guestfish-actions.pod:381
7710 #: ../src/guestfs-actions.pod:584
7711 msgid "You must call C<guestfs_launch> before calling this function."
7716 #: ../src/guestfs-actions.pod:586 ../fish/guestfish-actions.pod:389
7718 "The reason is because we don't know what groups are supported by the "
7719 "appliance/daemon until it is running and can be queried."
7724 #: ../src/guestfs-actions.pod:592 ../fish/guestfish-actions.pod:395
7726 "If a group of functions is available, this does not necessarily mean that "
7727 "they will work. You still have to check for errors when calling individual "
7728 "API functions even if they are available."
7733 #: ../src/guestfs-actions.pod:599 ../fish/guestfish-actions.pod:402
7735 "It is usually the job of distro packagers to build complete functionality "
7736 "into the libguestfs appliance. Upstream libguestfs, if built from source "
7737 "with all requirements satisfied, will support everything."
7742 #: ../src/guestfs-actions.pod:606
7744 "This call was added in version C<1.0.80>. In previous versions of "
7745 "libguestfs all you could do would be to speculatively execute a command to "
7746 "find out if the daemon implemented it. See also C<guestfs_version>."
7751 #: ../src/guestfs-actions.pod:615 ../src/guestfs-actions.pod:1176
7752 msgid "(Added in 1.0.80)"
7757 #: ../src/guestfs-actions.pod:617
7758 msgid "guestfs_available_all_groups"
7763 #: ../src/guestfs-actions.pod:619
7767 " guestfs_available_all_groups (guestfs_h *g);\n"
7773 #: ../src/guestfs-actions.pod:622
7775 "This command returns a list of all optional groups that this daemon knows "
7776 "about. Note this returns both supported and unsupported groups. To find "
7777 "out which ones the daemon can actually support you have to call "
7778 "C<guestfs_available> on each member of the returned list."
7783 #: ../src/guestfs-actions.pod:628
7784 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
7789 #: ../src/guestfs-actions.pod:634
7790 msgid "(Added in 1.3.15)"
7795 #: ../src/guestfs-actions.pod:636
7796 msgid "guestfs_base64_in"
7801 #: ../src/guestfs-actions.pod:638
7805 " guestfs_base64_in (guestfs_h *g,\n"
7806 " const char *base64file,\n"
7807 " const char *filename);\n"
7813 #: ../src/guestfs-actions.pod:643 ../fish/guestfish-actions.pod:432
7815 "This command uploads base64-encoded data from C<base64file> to C<filename>."
7820 #: ../src/guestfs-actions.pod:648 ../src/guestfs-actions.pod:662
7821 msgid "(Added in 1.3.5)"
7826 #: ../src/guestfs-actions.pod:650
7827 msgid "guestfs_base64_out"
7832 #: ../src/guestfs-actions.pod:652
7836 " guestfs_base64_out (guestfs_h *g,\n"
7837 " const char *filename,\n"
7838 " const char *base64file);\n"
7844 #: ../src/guestfs-actions.pod:657 ../fish/guestfish-actions.pod:441
7846 "This command downloads the contents of C<filename>, writing it out to local "
7847 "file C<base64file> encoded as base64."
7852 #: ../src/guestfs-actions.pod:664
7853 msgid "guestfs_blockdev_flushbufs"
7858 #: ../src/guestfs-actions.pod:666
7862 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
7863 " const char *device);\n"
7869 #: ../src/guestfs-actions.pod:670 ../fish/guestfish-actions.pod:450
7871 "This tells the kernel to flush internal buffers associated with C<device>."
7876 #: ../src/guestfs-actions.pod:673 ../src/guestfs-actions.pod:690
7877 #: ../src/guestfs-actions.pod:705 ../src/guestfs-actions.pod:721
7878 #: ../src/guestfs-actions.pod:739 ../src/guestfs-actions.pod:758
7879 #: ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:790
7880 #: ../src/guestfs-actions.pod:804 ../src/guestfs-actions.pod:818
7881 #: ../fish/guestfish-actions.pod:453 ../fish/guestfish-actions.pod:464
7882 #: ../fish/guestfish-actions.pod:473 ../fish/guestfish-actions.pod:483
7883 #: ../fish/guestfish-actions.pod:495 ../fish/guestfish-actions.pod:508
7884 #: ../fish/guestfish-actions.pod:516 ../fish/guestfish-actions.pod:527
7885 #: ../fish/guestfish-actions.pod:535 ../fish/guestfish-actions.pod:543
7886 msgid "This uses the L<blockdev(8)> command."
7891 #: ../src/guestfs-actions.pod:677 ../src/guestfs-actions.pod:694
7892 #: ../src/guestfs-actions.pod:709 ../src/guestfs-actions.pod:725
7893 #: ../src/guestfs-actions.pod:743 ../src/guestfs-actions.pod:762
7894 #: ../src/guestfs-actions.pod:776 ../src/guestfs-actions.pod:794
7895 #: ../src/guestfs-actions.pod:808 ../src/guestfs-actions.pod:822
7896 msgid "(Added in 0.9.3)"
7901 #: ../src/guestfs-actions.pod:679
7902 msgid "guestfs_blockdev_getbsz"
7907 #: ../src/guestfs-actions.pod:681
7911 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
7912 " const char *device);\n"
7918 #: ../src/guestfs-actions.pod:685 ../fish/guestfish-actions.pod:459
7919 msgid "This returns the block size of a device."
7924 #: ../src/guestfs-actions.pod:687 ../src/guestfs-actions.pod:787
7925 #: ../fish/guestfish-actions.pod:461 ../fish/guestfish-actions.pod:524
7927 "(Note this is different from both I<size in blocks> and I<filesystem block "
7933 #: ../src/guestfs-actions.pod:696
7934 msgid "guestfs_blockdev_getro"
7939 #: ../src/guestfs-actions.pod:698
7943 " guestfs_blockdev_getro (guestfs_h *g,\n"
7944 " const char *device);\n"
7950 #: ../src/guestfs-actions.pod:702 ../fish/guestfish-actions.pod:470
7952 "Returns a boolean indicating if the block device is read-only (true if read-"
7953 "only, false if not)."
7958 #: ../src/guestfs-actions.pod:707 ../src/guestfs-actions.pod:1414
7959 #: ../src/guestfs-actions.pod:1429 ../src/guestfs-actions.pod:1916
7960 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:1999
7961 #: ../src/guestfs-actions.pod:2054 ../src/guestfs-actions.pod:2069
7962 #: ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:2117
7963 #: ../src/guestfs-actions.pod:3112 ../src/guestfs-actions.pod:3129
7964 #: ../src/guestfs-actions.pod:3148 ../src/guestfs-actions.pod:3311
7965 #: ../src/guestfs-actions.pod:3325 ../src/guestfs-actions.pod:3340
7966 #: ../src/guestfs-actions.pod:3354 ../src/guestfs-actions.pod:3370
7967 #: ../src/guestfs-actions.pod:3385 ../src/guestfs-actions.pod:3401
7968 #: ../src/guestfs-actions.pod:3415 ../src/guestfs-actions.pod:3428
7969 #: ../src/guestfs-actions.pod:3442 ../src/guestfs-actions.pod:3457
7970 #: ../src/guestfs-actions.pod:3472 ../src/guestfs-actions.pod:5019
7971 msgid "This function returns a C truth value on success or -1 on error."
7976 #: ../src/guestfs-actions.pod:711
7977 msgid "guestfs_blockdev_getsize64"
7982 #: ../src/guestfs-actions.pod:713
7986 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
7987 " const char *device);\n"
7993 #: ../src/guestfs-actions.pod:717 ../fish/guestfish-actions.pod:479
7994 msgid "This returns the size of the device in bytes."
7999 #: ../src/guestfs-actions.pod:719
8000 msgid "See also C<guestfs_blockdev_getsz>."
8005 #: ../src/guestfs-actions.pod:727
8006 msgid "guestfs_blockdev_getss"
8011 #: ../src/guestfs-actions.pod:729
8015 " guestfs_blockdev_getss (guestfs_h *g,\n"
8016 " const char *device);\n"
8022 #: ../src/guestfs-actions.pod:733 ../fish/guestfish-actions.pod:489
8024 "This returns the size of sectors on a block device. Usually 512, but can be "
8025 "larger for modern devices."
8030 #: ../src/guestfs-actions.pod:736
8032 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
8038 #: ../src/guestfs-actions.pod:745
8039 msgid "guestfs_blockdev_getsz"
8044 #: ../src/guestfs-actions.pod:747
8048 " guestfs_blockdev_getsz (guestfs_h *g,\n"
8049 " const char *device);\n"
8055 #: ../src/guestfs-actions.pod:751 ../fish/guestfish-actions.pod:501
8057 "This returns the size of the device in units of 512-byte sectors (even if "
8058 "the sectorsize isn't 512 bytes ... weird)."
8063 #: ../src/guestfs-actions.pod:754
8065 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
8066 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
8071 #: ../src/guestfs-actions.pod:764
8072 msgid "guestfs_blockdev_rereadpt"
8077 #: ../src/guestfs-actions.pod:766
8081 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
8082 " const char *device);\n"
8088 #: ../src/guestfs-actions.pod:770 ../fish/guestfish-actions.pod:514
8089 msgid "Reread the partition table on C<device>."
8094 #: ../src/guestfs-actions.pod:778
8095 msgid "guestfs_blockdev_setbsz"
8100 #: ../src/guestfs-actions.pod:780
8104 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
8105 " const char *device,\n"
8106 " int blocksize);\n"
8112 #: ../src/guestfs-actions.pod:785 ../fish/guestfish-actions.pod:522
8113 msgid "This sets the block size of a device."
8118 #: ../src/guestfs-actions.pod:796
8119 msgid "guestfs_blockdev_setro"
8124 #: ../src/guestfs-actions.pod:798
8128 " guestfs_blockdev_setro (guestfs_h *g,\n"
8129 " const char *device);\n"
8135 #: ../src/guestfs-actions.pod:802 ../fish/guestfish-actions.pod:533
8136 msgid "Sets the block device named C<device> to read-only."
8141 #: ../src/guestfs-actions.pod:810
8142 msgid "guestfs_blockdev_setrw"
8147 #: ../src/guestfs-actions.pod:812
8151 " guestfs_blockdev_setrw (guestfs_h *g,\n"
8152 " const char *device);\n"
8158 #: ../src/guestfs-actions.pod:816 ../fish/guestfish-actions.pod:541
8159 msgid "Sets the block device named C<device> to read-write."
8164 #: ../src/guestfs-actions.pod:824
8165 msgid "guestfs_case_sensitive_path"
8170 #: ../src/guestfs-actions.pod:826
8174 " guestfs_case_sensitive_path (guestfs_h *g,\n"
8175 " const char *path);\n"
8181 #: ../src/guestfs-actions.pod:830 ../fish/guestfish-actions.pod:549
8183 "This can be used to resolve case insensitive paths on a filesystem which is "
8184 "case sensitive. The use case is to resolve paths which you have read from "
8185 "Windows configuration files or the Windows Registry, to the true path."
8190 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:554
8192 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
8193 "(and probably others), which is that although the underlying filesystem is "
8194 "case-insensitive, the driver exports the filesystem to Linux as case-"
8200 #: ../src/guestfs-actions.pod:840 ../fish/guestfish-actions.pod:559
8202 "One consequence of this is that special directories such as C<c:\\windows> "
8203 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
8204 "precise details of how they were created. In Windows itself this would not "
8210 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:565
8212 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
8218 #: ../src/guestfs-actions.pod:849 ../fish/guestfish-actions.pod:568
8220 "This function resolves the true case of each element in the path and returns "
8221 "the case-sensitive path."
8226 #: ../src/guestfs-actions.pod:852
8228 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
8229 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
8230 "how the directories were originally created under Windows)."
8235 #: ../src/guestfs-actions.pod:857 ../fish/guestfish-actions.pod:576
8236 msgid "I<Note>: This function does not handle drive names, backslashes etc."
8241 #: ../src/guestfs-actions.pod:860
8242 msgid "See also C<guestfs_realpath>."
8247 #: ../src/guestfs-actions.pod:865 ../src/guestfs-actions.pod:7038
8248 msgid "(Added in 1.0.75)"
8253 #: ../src/guestfs-actions.pod:867
8259 #: ../src/guestfs-actions.pod:869
8263 " guestfs_cat (guestfs_h *g,\n"
8264 " const char *path);\n"
8270 #: ../src/guestfs-actions.pod:873 ../src/guestfs-actions.pod:5506
8271 #: ../fish/guestfish-actions.pod:585 ../fish/guestfish-actions.pod:3707
8272 msgid "Return the contents of the file named C<path>."
8277 #: ../src/guestfs-actions.pod:875
8279 "Note that this function cannot correctly handle binary files (specifically, "
8280 "files containing C<\\0> character which is treated as end of string). For "
8281 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
8282 "functions which have a more complex interface."
8287 #: ../src/guestfs-actions.pod:883 ../src/guestfs-actions.pod:1062
8288 #: ../src/guestfs-actions.pod:1082 ../src/guestfs-actions.pod:1378
8289 #: ../src/guestfs-actions.pod:1397 ../src/guestfs-actions.pod:1500
8290 #: ../src/guestfs-actions.pod:1519 ../src/guestfs-actions.pod:1765
8291 #: ../src/guestfs-actions.pod:2223 ../src/guestfs-actions.pod:2242
8292 #: ../src/guestfs-actions.pod:2307 ../src/guestfs-actions.pod:2331
8293 #: ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:2377
8294 #: ../src/guestfs-actions.pod:5288 ../src/guestfs-actions.pod:5314
8295 #: ../src/guestfs-actions.pod:5445 ../src/guestfs-actions.pod:5471
8296 #: ../src/guestfs-actions.pod:5495 ../src/guestfs-actions.pod:6423
8297 #: ../src/guestfs-actions.pod:6478 ../src/guestfs-actions.pod:6624
8298 #: ../src/guestfs-actions.pod:6648 ../src/guestfs-actions.pod:7317
8299 #: ../src/guestfs-actions.pod:7343 ../src/guestfs-actions.pod:7369
8300 #: ../src/guestfs-actions.pod:7388 ../src/guestfs-actions.pod:7473
8301 #: ../src/guestfs-actions.pod:7492 ../src/guestfs-actions.pod:7538
8302 #: ../src/guestfs-actions.pod:7557 ../fish/guestfish-actions.pod:592
8303 #: ../fish/guestfish-actions.pod:727 ../fish/guestfish-actions.pod:739
8304 #: ../fish/guestfish-actions.pod:915 ../fish/guestfish-actions.pod:925
8305 #: ../fish/guestfish-actions.pod:992 ../fish/guestfish-actions.pod:1002
8306 #: ../fish/guestfish-actions.pod:1194 ../fish/guestfish-actions.pod:1495
8307 #: ../fish/guestfish-actions.pod:1505 ../fish/guestfish-actions.pod:1555
8308 #: ../fish/guestfish-actions.pod:1570 ../fish/guestfish-actions.pod:1580
8309 #: ../fish/guestfish-actions.pod:1599 ../fish/guestfish-actions.pod:3577
8310 #: ../fish/guestfish-actions.pod:3592 ../fish/guestfish-actions.pod:3668
8311 #: ../fish/guestfish-actions.pod:3685 ../fish/guestfish-actions.pod:3700
8312 #: ../fish/guestfish-actions.pod:4354 ../fish/guestfish-actions.pod:4400
8313 #: ../fish/guestfish-actions.pod:4485 ../fish/guestfish-actions.pod:4500
8314 #: ../fish/guestfish-actions.pod:4910 ../fish/guestfish-actions.pod:4928
8315 #: ../fish/guestfish-actions.pod:4945 ../fish/guestfish-actions.pod:4955
8316 #: ../fish/guestfish-actions.pod:5003 ../fish/guestfish-actions.pod:5013
8317 #: ../fish/guestfish-actions.pod:5042 ../fish/guestfish-actions.pod:5052
8319 "Because of the message protocol, there is a transfer limit of somewhere "
8320 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
8325 #: ../src/guestfs-actions.pod:886 ../src/guestfs-actions.pod:3588
8326 #: ../src/guestfs-actions.pod:3650 ../src/guestfs-actions.pod:3667
8327 #: ../src/guestfs-actions.pod:3755 ../src/guestfs-actions.pod:4160
8328 #: ../src/guestfs-actions.pod:4174 ../src/guestfs-actions.pod:5394
8329 #: ../src/guestfs-actions.pod:5408 ../src/guestfs-actions.pod:7197
8330 #: ../src/guestfs-actions.pod:7211
8331 msgid "(Added in 0.4)"
8336 #: ../src/guestfs-actions.pod:888
8337 msgid "guestfs_checksum"
8342 #: ../src/guestfs-actions.pod:890
8346 " guestfs_checksum (guestfs_h *g,\n"
8347 " const char *csumtype,\n"
8348 " const char *path);\n"
8354 #: ../src/guestfs-actions.pod:895 ../fish/guestfish-actions.pod:599
8356 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
8361 #: ../src/guestfs-actions.pod:898 ../fish/guestfish-actions.pod:602
8363 "The type of checksum to compute is given by the C<csumtype> parameter which "
8364 "must have one of the following values:"
8369 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:607
8375 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:609
8377 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
8383 #: ../src/guestfs-actions.pod:908 ../fish/guestfish-actions.pod:612
8389 #: ../src/guestfs-actions.pod:910 ../fish/guestfish-actions.pod:614
8390 msgid "Compute the MD5 hash (using the C<md5sum> program)."
8395 #: ../src/guestfs-actions.pod:912 ../fish/guestfish-actions.pod:616
8401 #: ../src/guestfs-actions.pod:914 ../fish/guestfish-actions.pod:618
8402 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
8407 #: ../src/guestfs-actions.pod:916 ../fish/guestfish-actions.pod:620
8413 #: ../src/guestfs-actions.pod:918 ../fish/guestfish-actions.pod:622
8414 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
8419 #: ../src/guestfs-actions.pod:920 ../fish/guestfish-actions.pod:624
8425 #: ../src/guestfs-actions.pod:922 ../fish/guestfish-actions.pod:626
8426 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
8431 #: ../src/guestfs-actions.pod:924 ../fish/guestfish-actions.pod:628
8437 #: ../src/guestfs-actions.pod:926 ../fish/guestfish-actions.pod:630
8438 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
8443 #: ../src/guestfs-actions.pod:928 ../fish/guestfish-actions.pod:632
8449 #: ../src/guestfs-actions.pod:930 ../fish/guestfish-actions.pod:634
8450 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
8455 #: ../src/guestfs-actions.pod:934 ../fish/guestfish-actions.pod:638
8456 msgid "The checksum is returned as a printable string."
8461 #: ../src/guestfs-actions.pod:936
8462 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
8467 #: ../src/guestfs-actions.pod:938
8468 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
8473 #: ../src/guestfs-actions.pod:943 ../src/guestfs-actions.pod:1251
8474 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:3327
8475 #: ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:3417
8476 #: ../src/guestfs-actions.pod:3444 ../src/guestfs-actions.pod:6894
8477 msgid "(Added in 1.0.2)"
8482 #: ../src/guestfs-actions.pod:945
8483 msgid "guestfs_checksum_device"
8488 #: ../src/guestfs-actions.pod:947
8492 " guestfs_checksum_device (guestfs_h *g,\n"
8493 " const char *csumtype,\n"
8494 " const char *device);\n"
8500 #: ../src/guestfs-actions.pod:952
8502 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
8503 "device named C<device>. For the types of checksums supported see the "
8504 "C<guestfs_checksum> command."
8509 #: ../src/guestfs-actions.pod:959 ../src/guestfs-actions.pod:4925
8510 #: ../src/guestfs-actions.pod:4984 ../src/guestfs-actions.pod:5021
8511 #: ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5215
8512 #: ../src/guestfs-actions.pod:6803 ../src/guestfs-actions.pod:6817
8513 #: ../src/guestfs-actions.pod:7223
8514 msgid "(Added in 1.3.2)"
8519 #: ../src/guestfs-actions.pod:961
8520 msgid "guestfs_checksums_out"
8525 #: ../src/guestfs-actions.pod:963
8529 " guestfs_checksums_out (guestfs_h *g,\n"
8530 " const char *csumtype,\n"
8531 " const char *directory,\n"
8532 " const char *sumsfile);\n"
8538 #: ../src/guestfs-actions.pod:969 ../fish/guestfish-actions.pod:656
8540 "This command computes the checksums of all regular files in C<directory> and "
8541 "then emits a list of those checksums to the local output file C<sumsfile>."
8546 #: ../src/guestfs-actions.pod:973 ../fish/guestfish-actions.pod:660
8548 "This can be used for verifying the integrity of a virtual machine. However "
8549 "to be properly secure you should pay attention to the output of the checksum "
8550 "command (it uses the ones from GNU coreutils). In particular when the "
8551 "filename is not printable, coreutils uses a special backslash syntax. For "
8552 "more information, see the GNU coreutils info file."
8557 #: ../src/guestfs-actions.pod:983
8558 msgid "(Added in 1.3.7)"
8563 #: ../src/guestfs-actions.pod:985
8564 msgid "guestfs_chmod"
8569 #: ../src/guestfs-actions.pod:987
8573 " guestfs_chmod (guestfs_h *g,\n"
8575 " const char *path);\n"
8581 #: ../src/guestfs-actions.pod:992 ../fish/guestfish-actions.pod:674
8583 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
8589 #: ../src/guestfs-actions.pod:995 ../fish/guestfish-actions.pod:677
8591 "I<Note>: When using this command from guestfish, C<mode> by default would be "
8592 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
8598 #: ../src/guestfs-actions.pod:999 ../src/guestfs-actions.pod:4411
8599 #: ../src/guestfs-actions.pod:4608 ../src/guestfs-actions.pod:4627
8600 #: ../src/guestfs-actions.pod:4646 ../fish/guestfish-actions.pod:681
8601 #: ../fish/guestfish-actions.pod:3007 ../fish/guestfish-actions.pod:3136
8602 #: ../fish/guestfish-actions.pod:3146 ../fish/guestfish-actions.pod:3156
8603 msgid "The mode actually set is affected by the umask."
8608 #: ../src/guestfs-actions.pod:1005
8609 msgid "guestfs_chown"
8614 #: ../src/guestfs-actions.pod:1007
8618 " guestfs_chown (guestfs_h *g,\n"
8621 " const char *path);\n"
8627 #: ../src/guestfs-actions.pod:1013 ../fish/guestfish-actions.pod:687
8628 msgid "Change the file owner to C<owner> and group to C<group>."
8633 #: ../src/guestfs-actions.pod:1015 ../src/guestfs-actions.pod:3519
8634 #: ../fish/guestfish-actions.pod:689 ../fish/guestfish-actions.pod:2465
8636 "Only numeric uid and gid are supported. If you want to use names, you will "
8637 "need to locate and parse the password file yourself (Augeas support makes "
8638 "this relatively easy)."
8643 #: ../src/guestfs-actions.pod:1023
8644 msgid "guestfs_command"
8649 #: ../src/guestfs-actions.pod:1025
8653 " guestfs_command (guestfs_h *g,\n"
8654 " char *const *arguments);\n"
8660 #: ../src/guestfs-actions.pod:1029 ../fish/guestfish-actions.pod:697
8662 "This call runs a command from the guest filesystem. The filesystem must be "
8663 "mounted, and must contain a compatible operating system (ie. something "
8664 "Linux, with the same or compatible processor architecture)."
8669 #: ../src/guestfs-actions.pod:1034
8671 "The single parameter is an argv-style list of arguments. The first element "
8672 "is the name of the program to run. Subsequent elements are parameters. The "
8673 "list must be non-empty (ie. must contain a program name). Note that the "
8674 "command runs directly, and is I<not> invoked via the shell (see "
8680 #: ../src/guestfs-actions.pod:1041 ../fish/guestfish-actions.pod:709
8681 msgid "The return value is anything printed to I<stdout> by the command."
8686 #: ../src/guestfs-actions.pod:1044 ../fish/guestfish-actions.pod:712
8688 "If the command returns a non-zero exit status, then this function returns an "
8689 "error message. The error message string is the content of I<stderr> from "
8695 #: ../src/guestfs-actions.pod:1048 ../fish/guestfish-actions.pod:716
8697 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
8698 "bin>. If you require a program from another location, you should provide "
8699 "the full path in the first parameter."
8704 #: ../src/guestfs-actions.pod:1053 ../fish/guestfish-actions.pod:721
8706 "Shared libraries and data files required by the program must be available on "
8707 "filesystems which are mounted in the correct places. It is the caller's "
8708 "responsibility to ensure all filesystems that are needed are mounted at the "
8714 #: ../src/guestfs-actions.pod:1065 ../src/guestfs-actions.pod:1085
8715 #: ../src/guestfs-actions.pod:1550
8716 msgid "(Added in 0.9.1)"
8721 #: ../src/guestfs-actions.pod:1067
8722 msgid "guestfs_command_lines"
8727 #: ../src/guestfs-actions.pod:1069
8731 " guestfs_command_lines (guestfs_h *g,\n"
8732 " char *const *arguments);\n"
8738 #: ../src/guestfs-actions.pod:1073
8740 "This is the same as C<guestfs_command>, but splits the result into a list of "
8746 #: ../src/guestfs-actions.pod:1076
8747 msgid "See also: C<guestfs_sh_lines>"
8752 #: ../src/guestfs-actions.pod:1087
8753 msgid "guestfs_config"
8758 #: ../src/guestfs-actions.pod:1089
8762 " guestfs_config (guestfs_h *g,\n"
8763 " const char *qemuparam,\n"
8764 " const char *qemuvalue);\n"
8769 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:746
8771 "This can be used to add arbitrary qemu command line parameters of the form "
8772 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
8773 "setting some parameters which would interfere with parameters that we use."
8778 #: ../src/guestfs-actions.pod:1099 ../fish/guestfish-actions.pod:751
8779 msgid "The first character of C<param> string must be a C<-> (dash)."
8784 #: ../src/guestfs-actions.pod:1101 ../fish/guestfish-actions.pod:753
8785 msgid "C<value> can be NULL."
8790 #: ../src/guestfs-actions.pod:1107
8791 msgid "guestfs_copy_size"
8796 #: ../src/guestfs-actions.pod:1109
8800 " guestfs_copy_size (guestfs_h *g,\n"
8801 " const char *src,\n"
8802 " const char *dest,\n"
8809 #: ../src/guestfs-actions.pod:1115 ../fish/guestfish-actions.pod:759
8811 "This command copies exactly C<size> bytes from one source device or file "
8812 "C<src> to another destination device or file C<dest>."
8817 #: ../src/guestfs-actions.pod:1118 ../fish/guestfish-actions.pod:762
8819 "Note this will fail if the source is too short or if the destination is not "
8824 #: ../src/guestfs-actions.pod:1123 ../src/guestfs-actions.pod:1246
8825 #: ../src/guestfs-actions.pod:1277 ../src/guestfs-actions.pod:1322
8826 #: ../src/guestfs-actions.pod:1699 ../src/guestfs-actions.pod:1721
8827 #: ../src/guestfs-actions.pod:3500 ../src/guestfs-actions.pod:6889
8828 #: ../src/guestfs-actions.pod:6923 ../src/guestfs-actions.pod:7409
8829 #: ../src/guestfs-actions.pod:7428
8831 "This long-running command can generate progress notification messages so "
8832 "that the caller can display a progress bar or indicator. To receive these "
8833 "messages, the caller must register a progress event callback. See L<guestfs"
8834 "(3)/GUESTFS_EVENT_PROGRESS>."
8839 #: ../src/guestfs-actions.pod:1128 ../src/guestfs-actions.pod:4187
8840 #: ../src/guestfs-actions.pod:5421 ../src/guestfs-actions.pod:7130
8841 #: ../src/guestfs-actions.pod:7150 ../src/guestfs-actions.pod:7236
8842 msgid "(Added in 1.0.87)"
8847 #: ../src/guestfs-actions.pod:1130
8853 #: ../src/guestfs-actions.pod:1132
8857 " guestfs_cp (guestfs_h *g,\n"
8858 " const char *src,\n"
8859 " const char *dest);\n"
8865 #: ../src/guestfs-actions.pod:1137 ../fish/guestfish-actions.pod:769
8867 "This copies a file from C<src> to C<dest> where C<dest> is either a "
8868 "destination filename or destination directory."
8873 #: ../src/guestfs-actions.pod:1142 ../src/guestfs-actions.pod:1156
8874 #: ../src/guestfs-actions.pod:1228 ../src/guestfs-actions.pod:1302
8875 #: ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:4879
8876 #: ../src/guestfs-actions.pod:5265
8877 msgid "(Added in 1.0.18)"
8882 #: ../src/guestfs-actions.pod:1144
8883 msgid "guestfs_cp_a"
8888 #: ../src/guestfs-actions.pod:1146
8892 " guestfs_cp_a (guestfs_h *g,\n"
8893 " const char *src,\n"
8894 " const char *dest);\n"
8900 #: ../src/guestfs-actions.pod:1151 ../fish/guestfish-actions.pod:776
8902 "This copies a file or directory from C<src> to C<dest> recursively using the "
8908 #: ../src/guestfs-actions.pod:1158
8914 #: ../src/guestfs-actions.pod:1160
8918 " guestfs_dd (guestfs_h *g,\n"
8919 " const char *src,\n"
8920 " const char *dest);\n"
8926 #: ../src/guestfs-actions.pod:1165 ../fish/guestfish-actions.pod:783
8928 "This command copies from one source device or file C<src> to another "
8929 "destination device or file C<dest>. Normally you would use this to copy to "
8930 "or from a device or partition, for example to duplicate a filesystem."
8935 #: ../src/guestfs-actions.pod:1170
8937 "If the destination is a device, it must be as large or larger than the "
8938 "source file or device, otherwise the copy will fail. This command cannot do "
8939 "partial copies (see C<guestfs_copy_size>)."
8944 #: ../src/guestfs-actions.pod:1178
8950 #: ../src/guestfs-actions.pod:1180
8954 " guestfs_df (guestfs_h *g);\n"
8960 #: ../src/guestfs-actions.pod:1183 ../fish/guestfish-actions.pod:796
8961 msgid "This command runs the C<df> command to report disk space used."
8966 #: ../src/guestfs-actions.pod:1185 ../src/guestfs-actions.pod:1202
8968 "This command is mostly useful for interactive sessions. It is I<not> "
8969 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
8975 #: ../src/guestfs-actions.pod:1192 ../src/guestfs-actions.pod:1209
8976 #: ../src/guestfs-actions.pod:1327 ../src/guestfs-actions.pod:2310
8977 #: ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:2402
8978 #: ../src/guestfs-actions.pod:4297 ../src/guestfs-actions.pod:4779
8979 #: ../src/guestfs-actions.pod:6627 ../src/guestfs-actions.pod:6651
8980 #: ../src/guestfs-actions.pod:7276 ../src/guestfs-actions.pod:7289
8981 #: ../src/guestfs-actions.pod:7302
8982 msgid "(Added in 1.0.54)"
8987 #: ../src/guestfs-actions.pod:1194
8988 msgid "guestfs_df_h"
8993 #: ../src/guestfs-actions.pod:1196
8997 " guestfs_df_h (guestfs_h *g);\n"
9003 #: ../src/guestfs-actions.pod:1199 ../fish/guestfish-actions.pod:806
9005 "This command runs the C<df -h> command to report disk space used in human-"
9011 #: ../src/guestfs-actions.pod:1211
9012 msgid "guestfs_dmesg"
9017 #: ../src/guestfs-actions.pod:1213
9021 " guestfs_dmesg (guestfs_h *g);\n"
9027 #: ../src/guestfs-actions.pod:1216 ../fish/guestfish-actions.pod:817
9029 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
9030 "This is sometimes useful for extended debugging of problems."
9035 #: ../src/guestfs-actions.pod:1220
9037 "Another way to get the same information is to enable verbose messages with "
9038 "C<guestfs_set_verbose> or by setting the environment variable "
9039 "C<LIBGUESTFS_DEBUG=1> before running the program."
9044 #: ../src/guestfs-actions.pod:1230
9045 msgid "guestfs_download"
9050 #: ../src/guestfs-actions.pod:1232
9054 " guestfs_download (guestfs_h *g,\n"
9055 " const char *remotefilename,\n"
9056 " const char *filename);\n"
9062 #: ../src/guestfs-actions.pod:1237 ../src/guestfs-actions.pod:1262
9063 #: ../fish/guestfish-actions.pod:830 ../fish/guestfish-actions.pod:843
9065 "Download file C<remotefilename> and save it as C<filename> on the local "
9071 #: ../src/guestfs-actions.pod:1240 ../src/guestfs-actions.pod:6883
9072 #: ../fish/guestfish-actions.pod:833 ../fish/guestfish-actions.pod:4658
9073 msgid "C<filename> can also be a named pipe."
9078 #: ../src/guestfs-actions.pod:1242
9079 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
9084 #: ../src/guestfs-actions.pod:1253
9085 msgid "guestfs_download_offset"
9090 #: ../src/guestfs-actions.pod:1255
9094 " guestfs_download_offset (guestfs_h *g,\n"
9095 " const char *remotefilename,\n"
9096 " const char *filename,\n"
9097 " int64_t offset,\n"
9104 #: ../src/guestfs-actions.pod:1265 ../fish/guestfish-actions.pod:846
9106 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
9107 "region must be within the file or device)."
9112 #: ../src/guestfs-actions.pod:1268
9114 "Note that there is no limit on the amount of data that can be downloaded "
9115 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
9116 "full amount unless an error occurs."
9121 #: ../src/guestfs-actions.pod:1273
9122 msgid "See also C<guestfs_download>, C<guestfs_pread>."
9127 #: ../src/guestfs-actions.pod:1282 ../src/guestfs-actions.pod:6928
9128 msgid "(Added in 1.5.17)"
9133 #: ../src/guestfs-actions.pod:1284
9134 msgid "guestfs_drop_caches"
9139 #: ../src/guestfs-actions.pod:1286
9143 " guestfs_drop_caches (guestfs_h *g,\n"
9144 " int whattodrop);\n"
9150 #: ../src/guestfs-actions.pod:1290 ../fish/guestfish-actions.pod:862
9152 "This instructs the guest kernel to drop its page cache, and/or dentries and "
9153 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
9154 "to drop, see L<http://linux-mm.org/Drop_Caches>"
9159 #: ../src/guestfs-actions.pod:1295 ../fish/guestfish-actions.pod:867
9160 msgid "Setting C<whattodrop> to 3 should drop everything."
9165 #: ../src/guestfs-actions.pod:1297 ../fish/guestfish-actions.pod:869
9167 "This automatically calls L<sync(2)> before the operation, so that the "
9168 "maximum guest memory is freed."
9173 #: ../src/guestfs-actions.pod:1304
9179 #: ../src/guestfs-actions.pod:1306
9183 " guestfs_du (guestfs_h *g,\n"
9184 " const char *path);\n"
9190 #: ../src/guestfs-actions.pod:1310 ../fish/guestfish-actions.pod:876
9192 "This command runs the C<du -s> command to estimate file space usage for "
9198 #: ../src/guestfs-actions.pod:1313 ../fish/guestfish-actions.pod:879
9200 "C<path> can be a file or a directory. If C<path> is a directory then the "
9201 "estimate includes the contents of the directory and all subdirectories "
9207 #: ../src/guestfs-actions.pod:1317 ../fish/guestfish-actions.pod:883
9209 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
9214 #: ../src/guestfs-actions.pod:1329
9215 msgid "guestfs_e2fsck_f"
9220 #: ../src/guestfs-actions.pod:1331
9224 " guestfs_e2fsck_f (guestfs_h *g,\n"
9225 " const char *device);\n"
9230 #: ../src/guestfs-actions.pod:1335 ../fish/guestfish-actions.pod:890
9232 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
9233 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
9239 #: ../src/guestfs-actions.pod:1339
9241 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
9242 "Normally you should use C<guestfs_fsck>."
9247 #: ../src/guestfs-actions.pod:1344
9248 msgid "(Added in 1.0.29)"
9253 #: ../src/guestfs-actions.pod:1346
9254 msgid "guestfs_echo_daemon"
9259 #: ../src/guestfs-actions.pod:1348
9263 " guestfs_echo_daemon (guestfs_h *g,\n"
9264 " char *const *words);\n"
9270 #: ../src/guestfs-actions.pod:1352 ../fish/guestfish-actions.pod:901
9272 "This command concatenates the list of C<words> passed with single spaces "
9273 "between them and returns the resulting string."
9278 #: ../src/guestfs-actions.pod:1355 ../fish/guestfish-actions.pod:904
9279 msgid "You can use this command to test the connection through to the daemon."
9284 #: ../src/guestfs-actions.pod:1357
9285 msgid "See also C<guestfs_ping_daemon>."
9290 #: ../src/guestfs-actions.pod:1362 ../src/guestfs-actions.pod:2096
9291 #: ../src/guestfs-actions.pod:6099
9292 msgid "(Added in 1.0.69)"
9297 #: ../src/guestfs-actions.pod:1364
9298 msgid "guestfs_egrep"
9303 #: ../src/guestfs-actions.pod:1366
9307 " guestfs_egrep (guestfs_h *g,\n"
9308 " const char *regex,\n"
9309 " const char *path);\n"
9315 #: ../src/guestfs-actions.pod:1371 ../fish/guestfish-actions.pod:912
9317 "This calls the external C<egrep> program and returns the matching lines."
9322 #: ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1400
9323 #: ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1503
9324 #: ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:2226
9325 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:2423
9326 #: ../src/guestfs-actions.pod:2436 ../src/guestfs-actions.pod:2451
9327 #: ../src/guestfs-actions.pod:2497 ../src/guestfs-actions.pod:2519
9328 #: ../src/guestfs-actions.pod:2532 ../src/guestfs-actions.pod:3680
9329 #: ../src/guestfs-actions.pod:3694 ../src/guestfs-actions.pod:3707
9330 #: ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:4707
9331 #: ../src/guestfs-actions.pod:5599 ../src/guestfs-actions.pod:5648
9332 #: ../src/guestfs-actions.pod:6495 ../src/guestfs-actions.pod:6507
9333 #: ../src/guestfs-actions.pod:6520 ../src/guestfs-actions.pod:6533
9334 #: ../src/guestfs-actions.pod:6555 ../src/guestfs-actions.pod:6568
9335 #: ../src/guestfs-actions.pod:6581 ../src/guestfs-actions.pod:6594
9336 #: ../src/guestfs-actions.pod:7372 ../src/guestfs-actions.pod:7391
9337 #: ../src/guestfs-actions.pod:7476 ../src/guestfs-actions.pod:7495
9338 #: ../src/guestfs-actions.pod:7541 ../src/guestfs-actions.pod:7560
9339 msgid "(Added in 1.0.66)"
9344 #: ../src/guestfs-actions.pod:1383
9345 msgid "guestfs_egrepi"
9350 #: ../src/guestfs-actions.pod:1385
9354 " guestfs_egrepi (guestfs_h *g,\n"
9355 " const char *regex,\n"
9356 " const char *path);\n"
9362 #: ../src/guestfs-actions.pod:1390 ../fish/guestfish-actions.pod:922
9364 "This calls the external C<egrep -i> program and returns the matching lines."
9369 #: ../src/guestfs-actions.pod:1402
9370 msgid "guestfs_equal"
9375 #: ../src/guestfs-actions.pod:1404
9379 " guestfs_equal (guestfs_h *g,\n"
9380 " const char *file1,\n"
9381 " const char *file2);\n"
9387 #: ../src/guestfs-actions.pod:1409 ../fish/guestfish-actions.pod:932
9389 "This compares the two files C<file1> and C<file2> and returns true if their "
9390 "content is exactly equal, or false otherwise."
9395 #: ../src/guestfs-actions.pod:1412 ../fish/guestfish-actions.pod:935
9396 msgid "The external L<cmp(1)> program is used for the comparison."
9401 #: ../src/guestfs-actions.pod:1418
9402 msgid "guestfs_exists"
9407 #: ../src/guestfs-actions.pod:1420
9411 " guestfs_exists (guestfs_h *g,\n"
9412 " const char *path);\n"
9418 #: ../src/guestfs-actions.pod:1424 ../fish/guestfish-actions.pod:941
9420 "This returns C<true> if and only if there is a file, directory (or anything) "
9421 "with the given C<path> name."
9426 #: ../src/guestfs-actions.pod:1427
9427 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
9432 #: ../src/guestfs-actions.pod:1433
9433 msgid "guestfs_fallocate"
9438 #: ../src/guestfs-actions.pod:1435
9442 " guestfs_fallocate (guestfs_h *g,\n"
9443 " const char *path,\n"
9450 #: ../src/guestfs-actions.pod:1440 ../src/guestfs-actions.pod:1466
9451 #: ../fish/guestfish-actions.pod:950 ../fish/guestfish-actions.pod:969
9453 "This command preallocates a file (containing zero bytes) named C<path> of "
9454 "size C<len> bytes. If the file exists already, it is overwritten."
9459 #: ../src/guestfs-actions.pod:1444 ../fish/guestfish-actions.pod:954
9461 "Do not confuse this with the guestfish-specific C<alloc> command which "
9462 "allocates a file in the host and attaches it as a device."
9466 #: ../src/guestfs-actions.pod:1450
9468 "This function is deprecated. In new code, use the L</guestfs_fallocate64> "
9474 #: ../src/guestfs-actions.pod:1459
9475 msgid "guestfs_fallocate64"
9480 #: ../src/guestfs-actions.pod:1461
9484 " guestfs_fallocate64 (guestfs_h *g,\n"
9485 " const char *path,\n"
9492 #: ../src/guestfs-actions.pod:1470
9494 "Note that this call allocates disk blocks for the file. To create a sparse "
9495 "file use C<guestfs_truncate_size> instead."
9500 #: ../src/guestfs-actions.pod:1473
9502 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
9503 "oversight it only allowed 30 bit lengths to be specified, effectively "
9504 "limiting the maximum size of files created through that call to 1GB."
9509 #: ../src/guestfs-actions.pod:1478 ../fish/guestfish-actions.pod:981
9511 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
9512 "commands which create a file in the host and attach it as a device."
9517 #: ../src/guestfs-actions.pod:1484
9518 msgid "(Added in 1.3.17)"
9523 #: ../src/guestfs-actions.pod:1486
9524 msgid "guestfs_fgrep"
9529 #: ../src/guestfs-actions.pod:1488
9533 " guestfs_fgrep (guestfs_h *g,\n"
9534 " const char *pattern,\n"
9535 " const char *path);\n"
9541 #: ../src/guestfs-actions.pod:1493 ../fish/guestfish-actions.pod:989
9543 "This calls the external C<fgrep> program and returns the matching lines."
9548 #: ../src/guestfs-actions.pod:1505
9549 msgid "guestfs_fgrepi"
9554 #: ../src/guestfs-actions.pod:1507
9558 " guestfs_fgrepi (guestfs_h *g,\n"
9559 " const char *pattern,\n"
9560 " const char *path);\n"
9566 #: ../src/guestfs-actions.pod:1512 ../fish/guestfish-actions.pod:999
9568 "This calls the external C<fgrep -i> program and returns the matching lines."
9573 #: ../src/guestfs-actions.pod:1524
9574 msgid "guestfs_file"
9579 #: ../src/guestfs-actions.pod:1526
9583 " guestfs_file (guestfs_h *g,\n"
9584 " const char *path);\n"
9590 #: ../src/guestfs-actions.pod:1530 ../fish/guestfish-actions.pod:1009
9592 "This call uses the standard L<file(1)> command to determine the type or "
9593 "contents of the file."
9598 #: ../src/guestfs-actions.pod:1533 ../fish/guestfish-actions.pod:1012
9600 "This call will also transparently look inside various types of compressed "
9605 #: ../src/guestfs-actions.pod:1536 ../fish/guestfish-actions.pod:1015
9607 "The exact command which runs is C<file -zb path>. Note in particular that "
9608 "the filename is not prepended to the output (the I<-b> option)."
9612 #: ../src/guestfs-actions.pod:1540 ../fish/guestfish-actions.pod:1019
9614 "The output depends on the output of the underlying L<file(1)> command and it "
9615 "can change in future in ways beyond our control. In other words, the output "
9616 "is not guaranteed by the ABI."
9620 #: ../src/guestfs-actions.pod:1544
9622 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
9623 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc)."
9628 #: ../src/guestfs-actions.pod:1552
9629 msgid "guestfs_file_architecture"
9634 #: ../src/guestfs-actions.pod:1554
9638 " guestfs_file_architecture (guestfs_h *g,\n"
9639 " const char *filename);\n"
9645 #: ../src/guestfs-actions.pod:1558 ../fish/guestfish-actions.pod:1030
9647 "This detects the architecture of the binary C<filename>, and returns it if "
9653 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1033
9654 msgid "Currently defined architectures are:"
9659 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1037
9665 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1039
9667 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
9668 "irrespective of the precise processor requirements of the binary."
9673 #: ../src/guestfs-actions.pod:1570 ../fish/guestfish-actions.pod:1042
9679 #: ../src/guestfs-actions.pod:1572 ../fish/guestfish-actions.pod:1044
9680 msgid "64 bit x86-64."
9685 #: ../src/guestfs-actions.pod:1574 ../fish/guestfish-actions.pod:1046
9691 #: ../src/guestfs-actions.pod:1576 ../fish/guestfish-actions.pod:1048
9692 msgid "32 bit SPARC."
9697 #: ../src/guestfs-actions.pod:1578 ../fish/guestfish-actions.pod:1050
9703 #: ../src/guestfs-actions.pod:1580 ../fish/guestfish-actions.pod:1052
9704 msgid "64 bit SPARC V9 and above."
9709 #: ../src/guestfs-actions.pod:1582 ../fish/guestfish-actions.pod:1054
9715 #: ../src/guestfs-actions.pod:1584 ../fish/guestfish-actions.pod:1056
9716 msgid "Intel Itanium."
9721 #: ../src/guestfs-actions.pod:1586 ../fish/guestfish-actions.pod:1058
9727 #: ../src/guestfs-actions.pod:1588 ../fish/guestfish-actions.pod:1060
9728 msgid "32 bit Power PC."
9733 #: ../src/guestfs-actions.pod:1590 ../fish/guestfish-actions.pod:1062
9739 #: ../src/guestfs-actions.pod:1592 ../fish/guestfish-actions.pod:1064
9740 msgid "64 bit Power PC."
9745 #: ../src/guestfs-actions.pod:1596 ../fish/guestfish-actions.pod:1068
9746 msgid "Libguestfs may return other architecture strings in future."
9751 #: ../src/guestfs-actions.pod:1598 ../fish/guestfish-actions.pod:1070
9752 msgid "The function works on at least the following types of files:"
9757 #: ../src/guestfs-actions.pod:1604 ../fish/guestfish-actions.pod:1076
9758 msgid "many types of Un*x and Linux binary"
9763 #: ../src/guestfs-actions.pod:1608 ../fish/guestfish-actions.pod:1080
9764 msgid "many types of Un*x and Linux shared library"
9769 #: ../src/guestfs-actions.pod:1612 ../fish/guestfish-actions.pod:1084
9770 msgid "Windows Win32 and Win64 binaries"
9775 #: ../src/guestfs-actions.pod:1616 ../fish/guestfish-actions.pod:1088
9776 msgid "Windows Win32 and Win64 DLLs"
9781 #: ../src/guestfs-actions.pod:1618 ../fish/guestfish-actions.pod:1090
9782 msgid "Win32 binaries and DLLs return C<i386>."
9787 #: ../src/guestfs-actions.pod:1620 ../fish/guestfish-actions.pod:1092
9788 msgid "Win64 binaries and DLLs return C<x86_64>."
9793 #: ../src/guestfs-actions.pod:1624 ../fish/guestfish-actions.pod:1096
9794 msgid "Linux kernel modules"
9799 #: ../src/guestfs-actions.pod:1628 ../fish/guestfish-actions.pod:1100
9800 msgid "Linux new-style initrd images"
9805 #: ../src/guestfs-actions.pod:1632 ../fish/guestfish-actions.pod:1104
9806 msgid "some non-x86 Linux vmlinuz kernels"
9811 #: ../src/guestfs-actions.pod:1636 ../fish/guestfish-actions.pod:1108
9812 msgid "What it can't do currently:"
9817 #: ../src/guestfs-actions.pod:1642 ../fish/guestfish-actions.pod:1114
9818 msgid "static libraries (libfoo.a)"
9823 #: ../src/guestfs-actions.pod:1646 ../fish/guestfish-actions.pod:1118
9824 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
9829 #: ../src/guestfs-actions.pod:1650 ../fish/guestfish-actions.pod:1122
9830 msgid "x86 Linux vmlinuz kernels"
9835 #: ../src/guestfs-actions.pod:1652 ../fish/guestfish-actions.pod:1124
9837 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
9838 "compressed code, and are horribly hard to unpack. If you want to find the "
9839 "architecture of a kernel, use the architecture of the associated initrd or "
9840 "kernel module(s) instead."
9845 #: ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1825
9846 #: ../src/guestfs-actions.pod:1842 ../src/guestfs-actions.pod:2555
9847 #: ../src/guestfs-actions.pod:2648 ../src/guestfs-actions.pod:2718
9848 #: ../src/guestfs-actions.pod:2806 ../src/guestfs-actions.pod:2827
9849 #: ../src/guestfs-actions.pod:2870 ../src/guestfs-actions.pod:2954
9850 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3298
9851 #: ../src/guestfs-actions.pod:3430
9852 msgid "(Added in 1.5.3)"
9857 #: ../src/guestfs-actions.pod:1664
9858 msgid "guestfs_filesize"
9863 #: ../src/guestfs-actions.pod:1666
9867 " guestfs_filesize (guestfs_h *g,\n"
9868 " const char *file);\n"
9874 #: ../src/guestfs-actions.pod:1670 ../fish/guestfish-actions.pod:1135
9875 msgid "This command returns the size of C<file> in bytes."
9880 #: ../src/guestfs-actions.pod:1672
9882 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
9883 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
9884 "devices, use C<guestfs_blockdev_getsize64>."
9889 #: ../src/guestfs-actions.pod:1678
9890 msgid "(Added in 1.0.82)"
9895 #: ../src/guestfs-actions.pod:1680
9896 msgid "guestfs_fill"
9901 #: ../src/guestfs-actions.pod:1682
9905 " guestfs_fill (guestfs_h *g,\n"
9908 " const char *path);\n"
9914 #: ../src/guestfs-actions.pod:1688 ../fish/guestfish-actions.pod:1145
9916 "This command creates a new file called C<path>. The initial content of the "
9917 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
9923 #: ../src/guestfs-actions.pod:1692
9925 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
9926 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
9927 "bytes use C<guestfs_fill_pattern>."
9932 #: ../src/guestfs-actions.pod:1704
9933 msgid "(Added in 1.0.79)"
9938 #: ../src/guestfs-actions.pod:1706
9939 msgid "guestfs_fill_pattern"
9944 #: ../src/guestfs-actions.pod:1708
9948 " guestfs_fill_pattern (guestfs_h *g,\n"
9949 " const char *pattern,\n"
9951 " const char *path);\n"
9957 #: ../src/guestfs-actions.pod:1714
9959 "This function is like C<guestfs_fill> except that it creates a new file of "
9960 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
9961 "pattern is truncated if necessary to ensure the length of the file is "
9962 "exactly C<len> bytes."
9967 #: ../src/guestfs-actions.pod:1726
9968 msgid "(Added in 1.3.12)"
9973 #: ../src/guestfs-actions.pod:1728
9974 msgid "guestfs_find"
9979 #: ../src/guestfs-actions.pod:1730
9983 " guestfs_find (guestfs_h *g,\n"
9984 " const char *directory);\n"
9990 #: ../src/guestfs-actions.pod:1734 ../fish/guestfish-actions.pod:1167
9992 "This command lists out all files and directories, recursively, starting at "
9993 "C<directory>. It is essentially equivalent to running the shell command "
9994 "C<find directory -print> but some post-processing happens on the output, "
10000 #: ../src/guestfs-actions.pod:1739 ../fish/guestfish-actions.pod:1172
10002 "This returns a list of strings I<without any prefix>. Thus if the directory "
10008 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1175
10019 #: ../src/guestfs-actions.pod:1746
10021 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
10026 #: ../src/guestfs-actions.pod:1749 ../fish/guestfish-actions.pod:1182
10038 #: ../src/guestfs-actions.pod:1754 ../fish/guestfish-actions.pod:1187
10039 msgid "If C<directory> is not a directory, then this command returns an error."
10044 #: ../src/guestfs-actions.pod:1757 ../fish/guestfish-actions.pod:1190
10045 msgid "The returned list is sorted."
10050 #: ../src/guestfs-actions.pod:1759
10051 msgid "See also C<guestfs_find0>."
10056 #: ../src/guestfs-actions.pod:1768 ../src/guestfs-actions.pod:4124
10057 #: ../src/guestfs-actions.pod:5683
10058 msgid "(Added in 1.0.27)"
10063 #: ../src/guestfs-actions.pod:1770
10064 msgid "guestfs_find0"
10069 #: ../src/guestfs-actions.pod:1772
10073 " guestfs_find0 (guestfs_h *g,\n"
10074 " const char *directory,\n"
10075 " const char *files);\n"
10081 #: ../src/guestfs-actions.pod:1777 ../fish/guestfish-actions.pod:1201
10083 "This command lists out all files and directories, recursively, starting at "
10084 "C<directory>, placing the resulting list in the external file called "
10090 #: ../src/guestfs-actions.pod:1781
10092 "This command works the same way as C<guestfs_find> with the following "
10098 #: ../src/guestfs-actions.pod:1788 ../fish/guestfish-actions.pod:1212
10099 msgid "The resulting list is written to an external file."
10104 #: ../src/guestfs-actions.pod:1792 ../fish/guestfish-actions.pod:1216
10106 "Items (filenames) in the result are separated by C<\\0> characters. See "
10107 "L<find(1)> option I<-print0>."
10112 #: ../src/guestfs-actions.pod:1797 ../fish/guestfish-actions.pod:1221
10113 msgid "This command is not limited in the number of names that it can return."
10118 #: ../src/guestfs-actions.pod:1802 ../fish/guestfish-actions.pod:1226
10119 msgid "The result list is not sorted."
10124 #: ../src/guestfs-actions.pod:1808
10125 msgid "(Added in 1.0.74)"
10130 #: ../src/guestfs-actions.pod:1810
10131 msgid "guestfs_findfs_label"
10136 #: ../src/guestfs-actions.pod:1812
10140 " guestfs_findfs_label (guestfs_h *g,\n"
10141 " const char *label);\n"
10147 #: ../src/guestfs-actions.pod:1816 ../fish/guestfish-actions.pod:1236
10149 "This command searches the filesystems and returns the one which has the "
10150 "given label. An error is returned if no such filesystem can be found."
10155 #: ../src/guestfs-actions.pod:1820
10156 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
10161 #: ../src/guestfs-actions.pod:1827
10162 msgid "guestfs_findfs_uuid"
10167 #: ../src/guestfs-actions.pod:1829
10171 " guestfs_findfs_uuid (guestfs_h *g,\n"
10172 " const char *uuid);\n"
10178 #: ../src/guestfs-actions.pod:1833 ../fish/guestfish-actions.pod:1246
10180 "This command searches the filesystems and returns the one which has the "
10181 "given UUID. An error is returned if no such filesystem can be found."
10186 #: ../src/guestfs-actions.pod:1837
10187 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
10192 #: ../src/guestfs-actions.pod:1844
10193 msgid "guestfs_fsck"
10198 #: ../src/guestfs-actions.pod:1846
10202 " guestfs_fsck (guestfs_h *g,\n"
10203 " const char *fstype,\n"
10204 " const char *device);\n"
10210 #: ../src/guestfs-actions.pod:1851 ../fish/guestfish-actions.pod:1256
10212 "This runs the filesystem checker (fsck) on C<device> which should have "
10213 "filesystem type C<fstype>."
10218 #: ../src/guestfs-actions.pod:1854 ../fish/guestfish-actions.pod:1259
10220 "The returned integer is the status. See L<fsck(8)> for the list of status "
10221 "codes from C<fsck>."
10226 #: ../src/guestfs-actions.pod:1863 ../fish/guestfish-actions.pod:1268
10227 msgid "Multiple status codes can be summed together."
10232 #: ../src/guestfs-actions.pod:1867 ../fish/guestfish-actions.pod:1272
10234 "A non-zero return code can mean \"success\", for example if errors have been "
10235 "corrected on the filesystem."
10240 #: ../src/guestfs-actions.pod:1872 ../fish/guestfish-actions.pod:1277
10241 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
10246 #: ../src/guestfs-actions.pod:1877 ../fish/guestfish-actions.pod:1282
10248 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
10253 #: ../src/guestfs-actions.pod:1881 ../src/guestfs-actions.pod:7414
10254 msgid "(Added in 1.0.16)"
10259 #: ../src/guestfs-actions.pod:1883
10260 msgid "guestfs_get_append"
10265 #: ../src/guestfs-actions.pod:1885
10269 " guestfs_get_append (guestfs_h *g);\n"
10275 #: ../src/guestfs-actions.pod:1888 ../fish/guestfish-actions.pod:1288
10277 "Return the additional kernel options which are added to the guest kernel "
10283 #: ../src/guestfs-actions.pod:1891 ../fish/guestfish-actions.pod:1291
10284 msgid "If C<NULL> then no options are added."
10289 #: ../src/guestfs-actions.pod:1893
10291 "This function returns a string which may be NULL. There is no way to return "
10292 "an error from this function. The string is owned by the guest handle and "
10293 "must I<not> be freed."
10298 #: ../src/guestfs-actions.pod:1897 ../src/guestfs-actions.pod:5361
10299 #: ../src/guestfs-actions.pod:5841 ../src/guestfs-actions.pod:6262
10300 #: ../src/guestfs-actions.pod:6281 ../src/guestfs-actions.pod:6297
10301 #: ../src/guestfs-actions.pod:6321 ../src/guestfs-actions.pod:7078
10302 #: ../src/guestfs-actions.pod:7096 ../src/guestfs-actions.pod:7457
10303 msgid "(Added in 1.0.26)"
10307 #: ../src/guestfs-actions.pod:1899
10308 msgid "guestfs_get_attach_method"
10312 #: ../src/guestfs-actions.pod:1901
10316 " guestfs_get_attach_method (guestfs_h *g);\n"
10321 #: ../src/guestfs-actions.pod:1904
10322 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
10327 #: ../src/guestfs-actions.pod:1909
10328 msgid "guestfs_get_autosync"
10333 #: ../src/guestfs-actions.pod:1911
10337 " guestfs_get_autosync (guestfs_h *g);\n"
10343 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1303
10344 msgid "Get the autosync flag."
10349 #: ../src/guestfs-actions.pod:1920
10350 msgid "guestfs_get_direct"
10355 #: ../src/guestfs-actions.pod:1922
10359 " guestfs_get_direct (guestfs_h *g);\n"
10365 #: ../src/guestfs-actions.pod:1925 ../fish/guestfish-actions.pod:1309
10366 msgid "Return the direct appliance mode flag."
10371 #: ../src/guestfs-actions.pod:1929 ../src/guestfs-actions.pod:5910
10372 msgid "(Added in 1.0.72)"
10377 #: ../src/guestfs-actions.pod:1931
10378 msgid "guestfs_get_e2label"
10383 #: ../src/guestfs-actions.pod:1933
10387 " guestfs_get_e2label (guestfs_h *g,\n"
10388 " const char *device);\n"
10394 #: ../src/guestfs-actions.pod:1937 ../fish/guestfish-actions.pod:1315
10396 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
10400 #: ../src/guestfs-actions.pod:1943
10402 "This function is deprecated. In new code, use the L</guestfs_vfs_label> "
10408 #: ../src/guestfs-actions.pod:1950 ../src/guestfs-actions.pod:1971
10409 #: ../src/guestfs-actions.pod:5928 ../src/guestfs-actions.pod:5947
10410 msgid "(Added in 1.0.15)"
10415 #: ../src/guestfs-actions.pod:1952
10416 msgid "guestfs_get_e2uuid"
10421 #: ../src/guestfs-actions.pod:1954
10425 " guestfs_get_e2uuid (guestfs_h *g,\n"
10426 " const char *device);\n"
10432 #: ../src/guestfs-actions.pod:1958 ../fish/guestfish-actions.pod:1329
10434 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
10438 #: ../src/guestfs-actions.pod:1964
10440 "This function is deprecated. In new code, use the L</guestfs_vfs_uuid> call "
10446 #: ../src/guestfs-actions.pod:1973
10447 msgid "guestfs_get_memsize"
10452 #: ../src/guestfs-actions.pod:1975
10456 " guestfs_get_memsize (guestfs_h *g);\n"
10462 #: ../src/guestfs-actions.pod:1978 ../fish/guestfish-actions.pod:1343
10464 "This gets the memory size in megabytes allocated to the qemu subprocess."
10469 #: ../src/guestfs-actions.pod:1981
10471 "If C<guestfs_set_memsize> was not called on this handle, and if "
10472 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
10473 "value for memsize."
10478 #: ../src/guestfs-actions.pod:1985 ../src/guestfs-actions.pod:2066
10479 #: ../src/guestfs-actions.pod:5963 ../src/guestfs-actions.pod:6070
10480 #: ../fish/guestfish-actions.pod:1350 ../fish/guestfish-actions.pod:1401
10481 #: ../fish/guestfish-actions.pod:4033 ../fish/guestfish-actions.pod:4120
10483 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
10488 #: ../src/guestfs-actions.pod:1990 ../src/guestfs-actions.pod:4415
10489 #: ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4631
10490 #: ../src/guestfs-actions.pod:4650 ../src/guestfs-actions.pod:4662
10491 #: ../src/guestfs-actions.pod:4679 ../src/guestfs-actions.pod:4692
10492 #: ../src/guestfs-actions.pod:5586 ../src/guestfs-actions.pod:5968
10493 #: ../src/guestfs-actions.pod:6229 ../src/guestfs-actions.pod:6844
10494 msgid "(Added in 1.0.55)"
10499 #: ../src/guestfs-actions.pod:1992
10500 msgid "guestfs_get_network"
10505 #: ../src/guestfs-actions.pod:1994
10509 " guestfs_get_network (guestfs_h *g);\n"
10515 #: ../src/guestfs-actions.pod:1997 ../fish/guestfish-actions.pod:1357
10516 msgid "This returns the enable network flag."
10521 #: ../src/guestfs-actions.pod:2001 ../src/guestfs-actions.pod:5987
10522 msgid "(Added in 1.5.4)"
10527 #: ../src/guestfs-actions.pod:2003
10528 msgid "guestfs_get_path"
10533 #: ../src/guestfs-actions.pod:2005
10537 " guestfs_get_path (guestfs_h *g);\n"
10543 #: ../src/guestfs-actions.pod:2008 ../fish/guestfish-actions.pod:1363
10544 msgid "Return the current search path."
10549 #: ../src/guestfs-actions.pod:2010 ../fish/guestfish-actions.pod:1365
10551 "This is always non-NULL. If it wasn't set already, then this will return "
10552 "the default path."
10557 #: ../src/guestfs-actions.pod:2013 ../src/guestfs-actions.pod:2042
10559 "This function returns a string, or NULL on error. The string is owned by "
10560 "the guest handle and must I<not> be freed."
10565 #: ../src/guestfs-actions.pod:2018
10566 msgid "guestfs_get_pid"
10571 #: ../src/guestfs-actions.pod:2020
10575 " guestfs_get_pid (guestfs_h *g);\n"
10581 #: ../src/guestfs-actions.pod:2023 ../fish/guestfish-actions.pod:1374
10583 "Return the process ID of the qemu subprocess. If there is no qemu "
10584 "subprocess, then this will return an error."
10589 #: ../src/guestfs-actions.pod:2026 ../fish/guestfish-actions.pod:1377
10590 msgid "This is an internal call used for debugging and testing."
10595 #: ../src/guestfs-actions.pod:2030
10596 msgid "(Added in 1.0.56)"
10601 #: ../src/guestfs-actions.pod:2032
10602 msgid "guestfs_get_qemu"
10607 #: ../src/guestfs-actions.pod:2034
10611 " guestfs_get_qemu (guestfs_h *g);\n"
10617 #: ../src/guestfs-actions.pod:2037 ../fish/guestfish-actions.pod:1383
10618 msgid "Return the current qemu binary."
10623 #: ../src/guestfs-actions.pod:2039 ../fish/guestfish-actions.pod:1385
10625 "This is always non-NULL. If it wasn't set already, then this will return "
10626 "the default qemu binary name."
10631 #: ../src/guestfs-actions.pod:2045 ../src/guestfs-actions.pod:6032
10632 msgid "(Added in 1.0.6)"
10637 #: ../src/guestfs-actions.pod:2047
10638 msgid "guestfs_get_recovery_proc"
10643 #: ../src/guestfs-actions.pod:2049
10647 " guestfs_get_recovery_proc (guestfs_h *g);\n"
10653 #: ../src/guestfs-actions.pod:2052 ../fish/guestfish-actions.pod:1392
10654 msgid "Return the recovery process enabled flag."
10659 #: ../src/guestfs-actions.pod:2056 ../src/guestfs-actions.pod:3525
10660 #: ../src/guestfs-actions.pod:3822 ../src/guestfs-actions.pod:4222
10661 #: ../src/guestfs-actions.pod:4254 ../src/guestfs-actions.pod:5291
10662 #: ../src/guestfs-actions.pod:5634 ../src/guestfs-actions.pod:6056
10663 #: ../src/guestfs-actions.pod:6747 ../src/guestfs-actions.pod:6767
10664 #: ../src/guestfs-actions.pod:6959
10665 msgid "(Added in 1.0.77)"
10670 #: ../src/guestfs-actions.pod:2058
10671 msgid "guestfs_get_selinux"
10676 #: ../src/guestfs-actions.pod:2060
10680 " guestfs_get_selinux (guestfs_h *g);\n"
10686 #: ../src/guestfs-actions.pod:2063
10688 "This returns the current setting of the selinux flag which is passed to the "
10689 "appliance at boot time. See C<guestfs_set_selinux>."
10694 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2134
10695 #: ../src/guestfs-actions.pod:6075 ../src/guestfs-actions.pod:6133
10696 msgid "(Added in 1.0.67)"
10701 #: ../src/guestfs-actions.pod:2073
10702 msgid "guestfs_get_state"
10707 #: ../src/guestfs-actions.pod:2075
10711 " guestfs_get_state (guestfs_h *g);\n"
10717 #: ../src/guestfs-actions.pod:2078 ../fish/guestfish-actions.pod:1408
10719 "This returns the current state as an opaque integer. This is only useful "
10720 "for printing debug and internal error messages."
10725 #: ../src/guestfs-actions.pod:2081 ../src/guestfs-actions.pod:3323
10726 #: ../src/guestfs-actions.pod:3352 ../src/guestfs-actions.pod:3413
10727 #: ../src/guestfs-actions.pod:3440 ../fish/guestfish-actions.pod:1411
10728 #: ../fish/guestfish-actions.pod:2347 ../fish/guestfish-actions.pod:2365
10729 #: ../fish/guestfish-actions.pod:2403 ../fish/guestfish-actions.pod:2419
10730 msgid "For more information on states, see L<guestfs(3)>."
10735 #: ../src/guestfs-actions.pod:2087
10736 msgid "guestfs_get_trace"
10741 #: ../src/guestfs-actions.pod:2089
10745 " guestfs_get_trace (guestfs_h *g);\n"
10751 #: ../src/guestfs-actions.pod:2092 ../fish/guestfish-actions.pod:1417
10752 msgid "Return the command trace flag."
10757 #: ../src/guestfs-actions.pod:2098
10758 msgid "guestfs_get_umask"
10763 #: ../src/guestfs-actions.pod:2100
10767 " guestfs_get_umask (guestfs_h *g);\n"
10773 #: ../src/guestfs-actions.pod:2103
10775 "Return the current umask. By default the umask is C<022> unless it has been "
10776 "set by calling C<guestfs_umask>."
10781 #: ../src/guestfs-actions.pod:2110
10782 msgid "guestfs_get_verbose"
10787 #: ../src/guestfs-actions.pod:2112
10791 " guestfs_get_verbose (guestfs_h *g);\n"
10797 #: ../src/guestfs-actions.pod:2115 ../fish/guestfish-actions.pod:1430
10798 msgid "This returns the verbose messages flag."
10803 #: ../src/guestfs-actions.pod:2121
10804 msgid "guestfs_getcon"
10809 #: ../src/guestfs-actions.pod:2123
10813 " guestfs_getcon (guestfs_h *g);\n"
10819 #: ../src/guestfs-actions.pod:2126 ../fish/guestfish-actions.pod:1436
10820 msgid "This gets the SELinux security context of the daemon."
10825 #: ../src/guestfs-actions.pod:2128
10827 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
10832 #: ../src/guestfs-actions.pod:2136
10833 msgid "guestfs_getxattr"
10838 #: ../src/guestfs-actions.pod:2138
10842 " guestfs_getxattr (guestfs_h *g,\n"
10843 " const char *path,\n"
10844 " const char *name,\n"
10845 " size_t *size_r);\n"
10851 #: ../src/guestfs-actions.pod:2144
10853 "Get a single extended attribute from file C<path> named C<name>. This call "
10854 "follows symlinks. If you want to lookup an extended attribute for the "
10855 "symlink itself, use C<guestfs_lgetxattr>."
10860 #: ../src/guestfs-actions.pod:2148 ../src/guestfs-actions.pod:3539
10862 "Normally it is better to get all extended attributes from a file in one go "
10863 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
10864 "implementations are buggy and do not provide a way to list out attributes. "
10865 "For these filesystems (notably ntfs-3g) you have to know the names of the "
10866 "extended attributes you want in advance and call this function."
10871 #: ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:3546
10872 #: ../fish/guestfish-actions.pod:1456 ../fish/guestfish-actions.pod:2484
10874 "Extended attribute values are blobs of binary data. If there is no extended "
10875 "attribute named C<name>, this returns an error."
10880 #: ../src/guestfs-actions.pod:2158
10881 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
10886 #: ../src/guestfs-actions.pod:2160 ../src/guestfs-actions.pod:2373
10887 #: ../src/guestfs-actions.pod:3551 ../src/guestfs-actions.pod:5284
10888 #: ../src/guestfs-actions.pod:5310 ../src/guestfs-actions.pod:5491
10890 "This function returns a buffer, or NULL on error. The size of the returned "
10891 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
10896 #: ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:3555
10897 msgid "(Added in 1.7.24)"
10902 #: ../src/guestfs-actions.pod:2166
10903 msgid "guestfs_getxattrs"
10908 #: ../src/guestfs-actions.pod:2168
10911 " struct guestfs_xattr_list *\n"
10912 " guestfs_getxattrs (guestfs_h *g,\n"
10913 " const char *path);\n"
10919 #: ../src/guestfs-actions.pod:2172 ../fish/guestfish-actions.pod:1465
10921 "This call lists the extended attributes of the file or directory C<path>."
10926 #: ../src/guestfs-actions.pod:2175 ../fish/guestfish-actions.pod:1468
10928 "At the system call level, this is a combination of the L<listxattr(2)> and "
10929 "L<getxattr(2)> calls."
10934 #: ../src/guestfs-actions.pod:2178
10935 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
10940 #: ../src/guestfs-actions.pod:2180 ../src/guestfs-actions.pod:3567
10941 #: ../src/guestfs-actions.pod:4218
10943 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
10944 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
10949 #: ../src/guestfs-actions.pod:2184 ../src/guestfs-actions.pod:3571
10950 #: ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3772
10951 #: ../src/guestfs-actions.pod:5664 ../src/guestfs-actions.pod:6152
10952 #: ../src/guestfs-actions.pod:7522
10953 msgid "(Added in 1.0.59)"
10958 #: ../src/guestfs-actions.pod:2186
10959 msgid "guestfs_glob_expand"
10964 #: ../src/guestfs-actions.pod:2188
10968 " guestfs_glob_expand (guestfs_h *g,\n"
10969 " const char *pattern);\n"
10975 #: ../src/guestfs-actions.pod:2192 ../fish/guestfish-actions.pod:1477
10977 "This command searches for all the pathnames matching C<pattern> according to "
10978 "the wildcard expansion rules used by the shell."
10983 #: ../src/guestfs-actions.pod:2196 ../fish/guestfish-actions.pod:1481
10985 "If no paths match, then this returns an empty list (note: not an error)."
10990 #: ../src/guestfs-actions.pod:2199 ../fish/guestfish-actions.pod:1484
10992 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
10993 "GLOB_BRACE>. See that manual page for more details."
10998 #: ../src/guestfs-actions.pod:2207 ../src/guestfs-actions.pod:6345
10999 #: ../src/guestfs-actions.pod:6362
11000 msgid "(Added in 1.0.50)"
11005 #: ../src/guestfs-actions.pod:2209
11006 msgid "guestfs_grep"
11011 #: ../src/guestfs-actions.pod:2211
11015 " guestfs_grep (guestfs_h *g,\n"
11016 " const char *regex,\n"
11017 " const char *path);\n"
11023 #: ../src/guestfs-actions.pod:2216 ../fish/guestfish-actions.pod:1492
11024 msgid "This calls the external C<grep> program and returns the matching lines."
11029 #: ../src/guestfs-actions.pod:2228
11030 msgid "guestfs_grepi"
11035 #: ../src/guestfs-actions.pod:2230
11039 " guestfs_grepi (guestfs_h *g,\n"
11040 " const char *regex,\n"
11041 " const char *path);\n"
11047 #: ../src/guestfs-actions.pod:2235 ../fish/guestfish-actions.pod:1502
11049 "This calls the external C<grep -i> program and returns the matching lines."
11054 #: ../src/guestfs-actions.pod:2247
11055 msgid "guestfs_grub_install"
11060 #: ../src/guestfs-actions.pod:2249
11064 " guestfs_grub_install (guestfs_h *g,\n"
11065 " const char *root,\n"
11066 " const char *device);\n"
11071 #: ../src/guestfs-actions.pod:2254 ../fish/guestfish-actions.pod:1512
11073 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
11074 "with the root directory being C<root>."
11078 #: ../src/guestfs-actions.pod:2263 ../fish/guestfish-actions.pod:1521
11080 "There is currently no way in the API to install grub2, which is used by most "
11081 "modern Linux guests. It is possible to run the grub2 command from the "
11082 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
11086 #: ../src/guestfs-actions.pod:2270 ../fish/guestfish-actions.pod:1528
11088 "This uses C<grub-install> from the host. Unfortunately grub is not always "
11089 "compatible with itself, so this only works in rather narrow circumstances. "
11090 "Careful testing with each guest version is advisable."
11094 #: ../src/guestfs-actions.pod:2277 ../fish/guestfish-actions.pod:1535
11096 "If grub-install reports the error \"No suitable drive was found in the "
11097 "generated device map.\" it may be that you need to create a C</boot/grub/"
11098 "device.map> file first that contains the mapping between grub device names "
11099 "and Linux device names. It is usually sufficient to create a file "
11105 #: ../src/guestfs-actions.pod:2284 ../fish/guestfish-actions.pod:1542
11108 " (hd0) /dev/vda\n"
11114 #: ../src/guestfs-actions.pod:2286 ../fish/guestfish-actions.pod:1544
11115 msgid "replacing C</dev/vda> with the name of the installation device."
11120 #: ../src/guestfs-actions.pod:2292
11121 msgid "(Added in 1.0.17)"
11126 #: ../src/guestfs-actions.pod:2294
11127 msgid "guestfs_head"
11132 #: ../src/guestfs-actions.pod:2296
11136 " guestfs_head (guestfs_h *g,\n"
11137 " const char *path);\n"
11143 #: ../src/guestfs-actions.pod:2300 ../fish/guestfish-actions.pod:1552
11145 "This command returns up to the first 10 lines of a file as a list of strings."
11150 #: ../src/guestfs-actions.pod:2312
11151 msgid "guestfs_head_n"
11156 #: ../src/guestfs-actions.pod:2314
11160 " guestfs_head_n (guestfs_h *g,\n"
11162 " const char *path);\n"
11168 #: ../src/guestfs-actions.pod:2319 ../fish/guestfish-actions.pod:1562
11170 "If the parameter C<nrlines> is a positive number, this returns the first "
11171 "C<nrlines> lines of the file C<path>."
11176 #: ../src/guestfs-actions.pod:2322 ../fish/guestfish-actions.pod:1565
11178 "If the parameter C<nrlines> is a negative number, this returns lines from "
11179 "the file C<path>, excluding the last C<nrlines> lines."
11184 #: ../src/guestfs-actions.pod:2325 ../src/guestfs-actions.pod:6642
11185 #: ../fish/guestfish-actions.pod:1568 ../fish/guestfish-actions.pod:4498
11186 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
11191 #: ../src/guestfs-actions.pod:2336
11192 msgid "guestfs_hexdump"
11197 #: ../src/guestfs-actions.pod:2338
11201 " guestfs_hexdump (guestfs_h *g,\n"
11202 " const char *path);\n"
11208 #: ../src/guestfs-actions.pod:2342 ../fish/guestfish-actions.pod:1577
11210 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
11211 "readable, canonical hex dump of the file."
11216 #: ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:6426
11217 #: ../src/guestfs-actions.pod:6481
11218 msgid "(Added in 1.0.22)"
11223 #: ../src/guestfs-actions.pod:2353
11224 msgid "guestfs_initrd_cat"
11229 #: ../src/guestfs-actions.pod:2355
11233 " guestfs_initrd_cat (guestfs_h *g,\n"
11234 " const char *initrdpath,\n"
11235 " const char *filename,\n"
11236 " size_t *size_r);\n"
11242 #: ../src/guestfs-actions.pod:2361 ../fish/guestfish-actions.pod:1587
11244 "This command unpacks the file C<filename> from the initrd file called "
11245 "C<initrdpath>. The filename must be given I<without> the initial C</> "
11251 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1591
11253 "For example, in guestfish you could use the following command to examine the "
11254 "boot script (usually called C</init>) contained in a Linux initrd or "
11260 #: ../src/guestfs-actions.pod:2369 ../fish/guestfish-actions.pod:1595
11263 " initrd-cat /boot/initrd-<version>.img init\n"
11269 #: ../src/guestfs-actions.pod:2371
11270 msgid "See also C<guestfs_initrd_list>."
11275 #: ../src/guestfs-actions.pod:2382
11276 msgid "guestfs_initrd_list"
11281 #: ../src/guestfs-actions.pod:2384
11285 " guestfs_initrd_list (guestfs_h *g,\n"
11286 " const char *path);\n"
11292 #: ../src/guestfs-actions.pod:2388 ../fish/guestfish-actions.pod:1606
11293 msgid "This command lists out files contained in an initrd."
11298 #: ../src/guestfs-actions.pod:2390 ../fish/guestfish-actions.pod:1608
11300 "The files are listed without any initial C</> character. The files are "
11301 "listed in the order they appear (not necessarily alphabetical). Directory "
11302 "names are listed as separate items."
11307 #: ../src/guestfs-actions.pod:2394 ../fish/guestfish-actions.pod:1612
11309 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
11310 "initrd. We I<only> support the newer initramfs format (compressed cpio "
11316 #: ../src/guestfs-actions.pod:2404
11317 msgid "guestfs_inotify_add_watch"
11322 #: ../src/guestfs-actions.pod:2406
11326 " guestfs_inotify_add_watch (guestfs_h *g,\n"
11327 " const char *path,\n"
11334 #: ../src/guestfs-actions.pod:2411 ../fish/guestfish-actions.pod:1620
11335 msgid "Watch C<path> for the events listed in C<mask>."
11340 #: ../src/guestfs-actions.pod:2413 ../fish/guestfish-actions.pod:1622
11342 "Note that if C<path> is a directory then events within that directory are "
11343 "watched, but this does I<not> happen recursively (in subdirectories)."
11348 #: ../src/guestfs-actions.pod:2417 ../fish/guestfish-actions.pod:1626
11350 "Note for non-C or non-Linux callers: the inotify events are defined by the "
11351 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
11356 #: ../src/guestfs-actions.pod:2425
11357 msgid "guestfs_inotify_close"
11362 #: ../src/guestfs-actions.pod:2427
11366 " guestfs_inotify_close (guestfs_h *g);\n"
11372 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1634
11374 "This closes the inotify handle which was previously opened by inotify_init. "
11375 "It removes all watches, throws away any pending events, and deallocates all "
11381 #: ../src/guestfs-actions.pod:2438
11382 msgid "guestfs_inotify_files"
11387 #: ../src/guestfs-actions.pod:2440
11391 " guestfs_inotify_files (guestfs_h *g);\n"
11397 #: ../src/guestfs-actions.pod:2443
11399 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
11400 "returns a list of pathnames of objects that were touched. The returned "
11401 "pathnames are sorted and deduplicated."
11406 #: ../src/guestfs-actions.pod:2453
11407 msgid "guestfs_inotify_init"
11412 #: ../src/guestfs-actions.pod:2455
11416 " guestfs_inotify_init (guestfs_h *g,\n"
11417 " int maxevents);\n"
11423 #: ../src/guestfs-actions.pod:2459 ../fish/guestfish-actions.pod:1650
11425 "This command creates a new inotify handle. The inotify subsystem can be "
11426 "used to notify events which happen to objects in the guest filesystem."
11431 #: ../src/guestfs-actions.pod:2463
11433 "C<maxevents> is the maximum number of events which will be queued up between "
11434 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
11435 "passed as C<0>, then the kernel (or previously set) default is used. For "
11436 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
11437 "throws away events, but records the fact that it threw them away by setting "
11438 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
11439 "C<guestfs_inotify_read>)."
11444 #: ../src/guestfs-actions.pod:2473
11446 "Before any events are generated, you have to add some watches to the "
11447 "internal watch list. See: C<guestfs_inotify_add_watch>, "
11448 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
11453 #: ../src/guestfs-actions.pod:2479
11455 "Queued up events should be read periodically by calling "
11456 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
11457 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
11458 "often enough then you risk the internal queue overflowing."
11463 #: ../src/guestfs-actions.pod:2486
11465 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
11466 "This also removes any watches automatically."
11471 #: ../src/guestfs-actions.pod:2490 ../fish/guestfish-actions.pod:1681
11473 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
11474 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
11475 "that there is one global inotify handle per libguestfs instance."
11480 #: ../src/guestfs-actions.pod:2499
11481 msgid "guestfs_inotify_read"
11486 #: ../src/guestfs-actions.pod:2501
11489 " struct guestfs_inotify_event_list *\n"
11490 " guestfs_inotify_read (guestfs_h *g);\n"
11496 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1690
11498 "Return the complete queue of events that have happened since the previous "
11504 #: ../src/guestfs-actions.pod:2507 ../fish/guestfish-actions.pod:1693
11505 msgid "If no events have happened, this returns an empty list."
11510 #: ../src/guestfs-actions.pod:2509 ../fish/guestfish-actions.pod:1695
11512 "I<Note>: In order to make sure that all events have been read, you must call "
11513 "this function repeatedly until it returns an empty list. The reason is that "
11514 "the call will read events up to the maximum appliance-to-host message size "
11515 "and leave remaining events in the queue."
11520 #: ../src/guestfs-actions.pod:2515
11522 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
11523 "there was an error. I<The caller must call "
11524 "C<guestfs_free_inotify_event_list> after use>."
11529 #: ../src/guestfs-actions.pod:2521
11530 msgid "guestfs_inotify_rm_watch"
11535 #: ../src/guestfs-actions.pod:2523
11539 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
11546 #: ../src/guestfs-actions.pod:2527
11548 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
11553 #: ../src/guestfs-actions.pod:2534
11554 msgid "guestfs_inspect_get_arch"
11559 #: ../src/guestfs-actions.pod:2536
11563 " guestfs_inspect_get_arch (guestfs_h *g,\n"
11564 " const char *root);\n"
11570 #: ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2563
11571 #: ../src/guestfs-actions.pod:2656 ../src/guestfs-actions.pod:2700
11572 #: ../src/guestfs-actions.pod:2726 ../src/guestfs-actions.pod:2765
11573 #: ../src/guestfs-actions.pod:2787 ../src/guestfs-actions.pod:2814
11574 #: ../src/guestfs-actions.pod:2835 ../src/guestfs-actions.pod:2878
11575 #: ../src/guestfs-actions.pod:2907 ../src/guestfs-actions.pod:2938
11576 #: ../src/guestfs-actions.pod:2962 ../src/guestfs-actions.pod:3017
11577 #: ../src/guestfs-actions.pod:3059 ../src/guestfs-actions.pod:3080
11578 #: ../src/guestfs-actions.pod:3103 ../src/guestfs-actions.pod:3120
11579 #: ../src/guestfs-actions.pod:3137 ../src/guestfs-actions.pod:3156
11581 "This function should only be called with a root device string as returned by "
11582 "C<guestfs_inspect_os>."
11587 #: ../src/guestfs-actions.pod:2543
11589 "This returns the architecture of the inspected operating system. The "
11590 "possible return values are listed under C<guestfs_file_architecture>."
11595 #: ../src/guestfs-actions.pod:2547 ../fish/guestfish-actions.pod:1719
11597 "If the architecture could not be determined, then the string C<unknown> is "
11603 #: ../src/guestfs-actions.pod:2550 ../src/guestfs-actions.pod:2643
11604 #: ../src/guestfs-actions.pod:2754 ../src/guestfs-actions.pod:2774
11605 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2894
11606 #: ../src/guestfs-actions.pod:2925 ../src/guestfs-actions.pod:2949
11607 #: ../src/guestfs-actions.pod:3003 ../src/guestfs-actions.pod:3046
11608 #: ../src/guestfs-actions.pod:3069 ../src/guestfs-actions.pod:3090
11609 #: ../src/guestfs-actions.pod:3110 ../src/guestfs-actions.pod:3127
11610 #: ../src/guestfs-actions.pod:3146 ../src/guestfs-actions.pod:3249
11611 #: ../src/guestfs-actions.pod:3290 ../fish/guestfish-actions.pod:1722
11612 #: ../fish/guestfish-actions.pod:1808 ../fish/guestfish-actions.pod:1896
11613 #: ../fish/guestfish-actions.pod:1911 ../fish/guestfish-actions.pod:1932
11614 #: ../fish/guestfish-actions.pod:2002 ../fish/guestfish-actions.pod:2026
11615 #: ../fish/guestfish-actions.pod:2043 ../fish/guestfish-actions.pod:2086
11616 #: ../fish/guestfish-actions.pod:2121 ../fish/guestfish-actions.pod:2137
11617 #: ../fish/guestfish-actions.pod:2153 ../fish/guestfish-actions.pod:2166
11618 #: ../fish/guestfish-actions.pod:2179 ../fish/guestfish-actions.pod:2194
11619 #: ../fish/guestfish-actions.pod:2293 ../fish/guestfish-actions.pod:2327
11620 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
11625 #: ../src/guestfs-actions.pod:2557
11626 msgid "guestfs_inspect_get_distro"
11631 #: ../src/guestfs-actions.pod:2559
11635 " guestfs_inspect_get_distro (guestfs_h *g,\n"
11636 " const char *root);\n"
11642 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1731
11644 "This returns the distro (distribution) of the inspected operating system."
11649 #: ../src/guestfs-actions.pod:2569 ../fish/guestfish-actions.pod:1734
11650 msgid "Currently defined distros are:"
11655 #: ../src/guestfs-actions.pod:2573 ../fish/guestfish-actions.pod:1738
11656 msgid "\"archlinux\""
11661 #: ../src/guestfs-actions.pod:2575 ../fish/guestfish-actions.pod:1740
11662 msgid "Arch Linux."
11666 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:1742
11671 #: ../src/guestfs-actions.pod:2579 ../fish/guestfish-actions.pod:1744
11677 #: ../src/guestfs-actions.pod:2581 ../fish/guestfish-actions.pod:1746
11683 #: ../src/guestfs-actions.pod:2583 ../fish/guestfish-actions.pod:1748
11689 #: ../src/guestfs-actions.pod:2585 ../fish/guestfish-actions.pod:1750
11695 #: ../src/guestfs-actions.pod:2587 ../fish/guestfish-actions.pod:1752
11701 #: ../src/guestfs-actions.pod:2589 ../fish/guestfish-actions.pod:1754
11707 #: ../src/guestfs-actions.pod:2591 ../fish/guestfish-actions.pod:1756
11713 #: ../src/guestfs-actions.pod:2593 ../fish/guestfish-actions.pod:1758
11714 msgid "\"linuxmint\""
11719 #: ../src/guestfs-actions.pod:2595 ../fish/guestfish-actions.pod:1760
11720 msgid "Linux Mint."
11725 #: ../src/guestfs-actions.pod:2597 ../fish/guestfish-actions.pod:1762
11726 msgid "\"mandriva\""
11731 #: ../src/guestfs-actions.pod:2599 ../fish/guestfish-actions.pod:1764
11737 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:1766
11743 #: ../src/guestfs-actions.pod:2603 ../fish/guestfish-actions.pod:1768
11749 #: ../src/guestfs-actions.pod:2605 ../fish/guestfish-actions.pod:1770
11755 #: ../src/guestfs-actions.pod:2607 ../fish/guestfish-actions.pod:1772
11761 #: ../src/guestfs-actions.pod:2609 ../fish/guestfish-actions.pod:1774
11762 msgid "\"redhat-based\""
11767 #: ../src/guestfs-actions.pod:2611 ../fish/guestfish-actions.pod:1776
11768 msgid "Some Red Hat-derived distro."
11773 #: ../src/guestfs-actions.pod:2613 ../fish/guestfish-actions.pod:1778
11778 #: ../src/guestfs-actions.pod:2615 ../fish/guestfish-actions.pod:1780
11779 msgid "Red Hat Enterprise Linux."
11783 #: ../src/guestfs-actions.pod:2617 ../fish/guestfish-actions.pod:1782
11784 msgid "\"scientificlinux\""
11788 #: ../src/guestfs-actions.pod:2619 ../fish/guestfish-actions.pod:1784
11789 msgid "Scientific Linux."
11793 #: ../src/guestfs-actions.pod:2621 ../fish/guestfish-actions.pod:1786
11794 msgid "\"slackware\""
11798 #: ../src/guestfs-actions.pod:2623 ../fish/guestfish-actions.pod:1788
11804 #: ../src/guestfs-actions.pod:2625 ../fish/guestfish-actions.pod:1790
11810 #: ../src/guestfs-actions.pod:2627 ../fish/guestfish-actions.pod:1792
11816 #: ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:2745
11817 #: ../src/guestfs-actions.pod:3037 ../fish/guestfish-actions.pod:1794
11818 #: ../fish/guestfish-actions.pod:1887 ../fish/guestfish-actions.pod:2112
11819 msgid "\"unknown\""
11824 #: ../src/guestfs-actions.pod:2631 ../fish/guestfish-actions.pod:1796
11825 msgid "The distro could not be determined."
11830 #: ../src/guestfs-actions.pod:2633 ../src/guestfs-actions.pod:3029
11831 #: ../fish/guestfish-actions.pod:1798 ../fish/guestfish-actions.pod:2104
11832 msgid "\"windows\""
11837 #: ../src/guestfs-actions.pod:2635 ../fish/guestfish-actions.pod:1800
11839 "Windows does not have distributions. This string is returned if the OS type "
11845 #: ../src/guestfs-actions.pod:2640 ../src/guestfs-actions.pod:2751
11846 #: ../src/guestfs-actions.pod:3043 ../fish/guestfish-actions.pod:1805
11847 #: ../fish/guestfish-actions.pod:1893 ../fish/guestfish-actions.pod:2118
11849 "Future versions of libguestfs may return other strings here. The caller "
11850 "should be prepared to handle any string."
11854 #: ../src/guestfs-actions.pod:2650
11855 msgid "guestfs_inspect_get_drive_mappings"
11859 #: ../src/guestfs-actions.pod:2652
11863 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
11864 " const char *root);\n"
11869 #: ../src/guestfs-actions.pod:2659 ../fish/guestfish-actions.pod:1817
11871 "This call is useful for Windows which uses a primitive system of assigning "
11872 "drive letters (like \"C:\") to partitions. This inspection API examines the "
11873 "Windows Registry to find out how disks/partitions are mapped to drive "
11874 "letters, and returns a hash table as in the example below:"
11878 #: ../src/guestfs-actions.pod:2665 ../fish/guestfish-actions.pod:1823
11881 " C => /dev/vda2\n"
11882 " E => /dev/vdb1\n"
11883 " F => /dev/vdc1\n"
11888 #: ../src/guestfs-actions.pod:2669 ../fish/guestfish-actions.pod:1827
11890 "Note that keys are drive letters. For Windows, the key is case insensitive "
11891 "and just contains the drive letter, without the customary colon separator "
11896 #: ../src/guestfs-actions.pod:2673 ../fish/guestfish-actions.pod:1831
11898 "In future we may support other operating systems that also used drive "
11899 "letters, but the keys for those might not be case insensitive and might be "
11900 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
11905 #: ../src/guestfs-actions.pod:2678 ../fish/guestfish-actions.pod:1836
11907 "For Windows guests, currently only hard drive mappings are returned. "
11908 "Removable disks (eg. DVD-ROMs) are ignored."
11912 #: ../src/guestfs-actions.pod:2681 ../fish/guestfish-actions.pod:1839
11914 "For guests that do not use drive mappings, or if the drive mappings could "
11915 "not be determined, this returns an empty hash table."
11919 #: ../src/guestfs-actions.pod:2684
11921 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11922 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
11927 #: ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2864
11928 #: ../src/guestfs-actions.pod:3624 ../src/guestfs-actions.pod:4841
11929 #: ../src/guestfs-actions.pod:6783
11931 "This function returns a NULL-terminated array of strings, or NULL if there "
11932 "was an error. The array of strings will always have length C<2n+1>, where "
11933 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
11934 "caller must free the strings and the array after use>."
11939 #: ../src/guestfs-actions.pod:2694
11940 msgid "guestfs_inspect_get_filesystems"
11945 #: ../src/guestfs-actions.pod:2696
11949 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
11950 " const char *root);\n"
11956 #: ../src/guestfs-actions.pod:2703 ../fish/guestfish-actions.pod:1853
11958 "This returns a list of all the filesystems that we think are associated with "
11959 "this operating system. This includes the root filesystem, other ordinary "
11960 "filesystems, and non-mounted devices like swap partitions."
11965 #: ../src/guestfs-actions.pod:2708 ../fish/guestfish-actions.pod:1858
11967 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
11968 "to be shared between operating systems."
11973 #: ../src/guestfs-actions.pod:2711
11975 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11976 "C<guestfs_inspect_get_mountpoints>."
11980 #: ../src/guestfs-actions.pod:2720
11981 msgid "guestfs_inspect_get_format"
11985 #: ../src/guestfs-actions.pod:2722
11989 " guestfs_inspect_get_format (guestfs_h *g,\n"
11990 " const char *root);\n"
11995 #: ../src/guestfs-actions.pod:2729 ../fish/guestfish-actions.pod:1871
11997 "This returns the format of the inspected operating system. You can use it "
11998 "to detect install images, live CDs and similar."
12002 #: ../src/guestfs-actions.pod:2732 ../fish/guestfish-actions.pod:1874
12003 msgid "Currently defined formats are:"
12007 #: ../src/guestfs-actions.pod:2736 ../fish/guestfish-actions.pod:1878
12008 msgid "\"installed\""
12012 #: ../src/guestfs-actions.pod:2738 ../fish/guestfish-actions.pod:1880
12013 msgid "This is an installed operating system."
12017 #: ../src/guestfs-actions.pod:2740 ../fish/guestfish-actions.pod:1882
12018 msgid "\"installer\""
12022 #: ../src/guestfs-actions.pod:2742 ../fish/guestfish-actions.pod:1884
12024 "The disk image being inspected is not an installed operating system, but a "
12025 "I<bootable> install disk, live CD, or similar."
12029 #: ../src/guestfs-actions.pod:2747 ../fish/guestfish-actions.pod:1889
12030 msgid "The format of this disk image is not known."
12035 #: ../src/guestfs-actions.pod:2759
12036 msgid "guestfs_inspect_get_hostname"
12041 #: ../src/guestfs-actions.pod:2761
12045 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
12046 " const char *root);\n"
12052 #: ../src/guestfs-actions.pod:2768 ../fish/guestfish-actions.pod:1905
12054 "This function returns the hostname of the operating system as found by "
12055 "inspection of the guest's configuration files."
12060 #: ../src/guestfs-actions.pod:2771 ../fish/guestfish-actions.pod:1908
12062 "If the hostname could not be determined, then the string C<unknown> is "
12068 #: ../src/guestfs-actions.pod:2779
12069 msgid "(Added in 1.7.9)"
12074 #: ../src/guestfs-actions.pod:2781
12075 msgid "guestfs_inspect_get_major_version"
12080 #: ../src/guestfs-actions.pod:2783
12084 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
12085 " const char *root);\n"
12091 #: ../src/guestfs-actions.pod:2790 ../fish/guestfish-actions.pod:1920
12093 "This returns the major version number of the inspected operating system."
12098 #: ../src/guestfs-actions.pod:2793 ../fish/guestfish-actions.pod:1923
12100 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
12101 "popular public names used by the operating system. Notably the operating "
12102 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
12103 "1). You can find out the real versions corresponding to releases of Windows "
12104 "by consulting Wikipedia or MSDN."
12109 #: ../src/guestfs-actions.pod:2800 ../src/guestfs-actions.pod:2820
12110 #: ../fish/guestfish-actions.pod:1930 ../fish/guestfish-actions.pod:1944
12111 msgid "If the version could not be determined, then C<0> is returned."
12116 #: ../src/guestfs-actions.pod:2808
12117 msgid "guestfs_inspect_get_minor_version"
12122 #: ../src/guestfs-actions.pod:2810
12126 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
12127 " const char *root);\n"
12133 #: ../src/guestfs-actions.pod:2817 ../fish/guestfish-actions.pod:1941
12135 "This returns the minor version number of the inspected operating system."
12140 #: ../src/guestfs-actions.pod:2822
12142 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
12143 "C<guestfs_inspect_get_major_version>."
12148 #: ../src/guestfs-actions.pod:2829
12149 msgid "guestfs_inspect_get_mountpoints"
12154 #: ../src/guestfs-actions.pod:2831
12158 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
12159 " const char *root);\n"
12164 #: ../src/guestfs-actions.pod:2838 ../fish/guestfish-actions.pod:1956
12166 "This returns a hash of where we think the filesystems associated with this "
12167 "operating system should be mounted. Callers should note that this is at "
12168 "best an educated guess made by reading configuration files such as C</etc/"
12169 "fstab>. I<In particular note> that this may return filesystems which are "
12170 "non-existent or not mountable and callers should be prepared to handle or "
12171 "ignore failures if they try to mount them."
12176 #: ../src/guestfs-actions.pod:2847 ../fish/guestfish-actions.pod:1965
12178 "Each element in the returned hashtable has a key which is the path of the "
12179 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
12180 "mounted there (eg. C</dev/sda1>)."
12185 #: ../src/guestfs-actions.pod:2852 ../fish/guestfish-actions.pod:1970
12187 "Non-mounted devices such as swap devices are I<not> returned in this list."
12191 #: ../src/guestfs-actions.pod:2855
12193 "For operating systems like Windows which still use drive letters, this call "
12194 "will only return an entry for the first drive \"mounted on\" C</>. For "
12195 "information about the mapping of drive letters to partitions, see "
12196 "C<guestfs_inspect_get_drive_mappings>."
12201 #: ../src/guestfs-actions.pod:2861
12203 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
12204 "C<guestfs_inspect_get_filesystems>."
12209 #: ../src/guestfs-actions.pod:2872
12210 msgid "guestfs_inspect_get_package_format"
12215 #: ../src/guestfs-actions.pod:2874
12219 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
12220 " const char *root);\n"
12226 #: ../src/guestfs-actions.pod:2881
12228 "This function and C<guestfs_inspect_get_package_management> return the "
12229 "package format and package management tool used by the inspected operating "
12230 "system. For example for Fedora these functions would return C<rpm> (package "
12231 "format) and C<yum> (package management)."
12236 #: ../src/guestfs-actions.pod:2887 ../fish/guestfish-actions.pod:1995
12238 "This returns the string C<unknown> if we could not determine the package "
12239 "format I<or> if the operating system does not have a real packaging system "
12245 #: ../src/guestfs-actions.pod:2891 ../fish/guestfish-actions.pod:1999
12247 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
12248 "Future versions of libguestfs may return other strings."
12253 #: ../src/guestfs-actions.pod:2899 ../src/guestfs-actions.pod:2930
12254 msgid "(Added in 1.7.5)"
12259 #: ../src/guestfs-actions.pod:2901
12260 msgid "guestfs_inspect_get_package_management"
12265 #: ../src/guestfs-actions.pod:2903
12269 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
12270 " const char *root);\n"
12276 #: ../src/guestfs-actions.pod:2910
12278 "C<guestfs_inspect_get_package_format> and this function return the package "
12279 "format and package management tool used by the inspected operating system. "
12280 "For example for Fedora these functions would return C<rpm> (package format) "
12281 "and C<yum> (package management)."
12286 #: ../src/guestfs-actions.pod:2916 ../fish/guestfish-actions.pod:2017
12288 "This returns the string C<unknown> if we could not determine the package "
12289 "management tool I<or> if the operating system does not have a real packaging "
12290 "system (eg. Windows)."
12295 #: ../src/guestfs-actions.pod:2920 ../fish/guestfish-actions.pod:2021
12297 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
12298 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
12299 "libguestfs may return other strings."
12304 #: ../src/guestfs-actions.pod:2932
12305 msgid "guestfs_inspect_get_product_name"
12310 #: ../src/guestfs-actions.pod:2934
12314 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
12315 " const char *root);\n"
12321 #: ../src/guestfs-actions.pod:2941 ../fish/guestfish-actions.pod:2035
12323 "This returns the product name of the inspected operating system. The "
12324 "product name is generally some freeform string which can be displayed to the "
12325 "user, but should not be parsed by programs."
12330 #: ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:2040
12332 "If the product name could not be determined, then the string C<unknown> is "
12337 #: ../src/guestfs-actions.pod:2956
12338 msgid "guestfs_inspect_get_product_variant"
12342 #: ../src/guestfs-actions.pod:2958
12346 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
12347 " const char *root);\n"
12352 #: ../src/guestfs-actions.pod:2965 ../fish/guestfish-actions.pod:2052
12353 msgid "This returns the product variant of the inspected operating system."
12357 #: ../src/guestfs-actions.pod:2968 ../fish/guestfish-actions.pod:2055
12359 "For Windows guests, this returns the contents of the Registry key C<HKLM"
12360 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
12361 "is usually a string such as C<Client> or C<Server> (other values are "
12362 "possible). This can be used to distinguish consumer and enterprise versions "
12363 "of Windows that have the same version number (for example, Windows 7 and "
12364 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
12365 "the latter is C<Server>)."
12369 #: ../src/guestfs-actions.pod:2977 ../fish/guestfish-actions.pod:2064
12371 "For enterprise Linux guests, in future we intend this to return the product "
12372 "variant such as C<Desktop>, C<Server> and so on. But this is not "
12373 "implemented at present."
12377 #: ../src/guestfs-actions.pod:2981 ../fish/guestfish-actions.pod:2068
12379 "If the product variant could not be determined, then the string C<unknown> "
12384 #: ../src/guestfs-actions.pod:2984
12386 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
12387 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
12392 #: ../src/guestfs-actions.pod:2991
12393 msgid "guestfs_inspect_get_roots"
12398 #: ../src/guestfs-actions.pod:2993
12402 " guestfs_inspect_get_roots (guestfs_h *g);\n"
12408 #: ../src/guestfs-actions.pod:2996
12410 "This function is a convenient way to get the list of root devices, as "
12411 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
12412 "the whole inspection process."
12417 #: ../src/guestfs-actions.pod:3000
12419 "This returns an empty list if either no root devices were found or the "
12420 "caller has not called C<guestfs_inspect_os>."
12425 #: ../src/guestfs-actions.pod:3009
12426 msgid "(Added in 1.7.3)"
12431 #: ../src/guestfs-actions.pod:3011
12432 msgid "guestfs_inspect_get_type"
12437 #: ../src/guestfs-actions.pod:3013
12441 " guestfs_inspect_get_type (guestfs_h *g,\n"
12442 " const char *root);\n"
12448 #: ../src/guestfs-actions.pod:3020 ../fish/guestfish-actions.pod:2095
12450 "This returns the type of the inspected operating system. Currently defined "
12456 #: ../src/guestfs-actions.pod:3025 ../fish/guestfish-actions.pod:2100
12462 #: ../src/guestfs-actions.pod:3027 ../fish/guestfish-actions.pod:2102
12463 msgid "Any Linux-based operating system."
12468 #: ../src/guestfs-actions.pod:3031 ../fish/guestfish-actions.pod:2106
12469 msgid "Any Microsoft Windows operating system."
12474 #: ../src/guestfs-actions.pod:3033 ../fish/guestfish-actions.pod:2108
12475 msgid "\"freebsd\""
12480 #: ../src/guestfs-actions.pod:3035 ../fish/guestfish-actions.pod:2110
12486 #: ../src/guestfs-actions.pod:3039 ../fish/guestfish-actions.pod:2114
12487 msgid "The operating system type could not be determined."
12491 #: ../src/guestfs-actions.pod:3053
12492 msgid "guestfs_inspect_get_windows_current_control_set"
12496 #: ../src/guestfs-actions.pod:3055
12500 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
12501 " const char *root);\n"
12506 #: ../src/guestfs-actions.pod:3062 ../fish/guestfish-actions.pod:2130
12508 "This returns the Windows CurrentControlSet of the inspected guest. The "
12509 "CurrentControlSet is a registry key name such as C<ControlSet001>."
12513 #: ../src/guestfs-actions.pod:3065 ../fish/guestfish-actions.pod:2133
12515 "This call assumes that the guest is Windows and that the Registry could be "
12516 "examined by inspection. If this is not the case then an error is returned."
12521 #: ../src/guestfs-actions.pod:3074
12522 msgid "guestfs_inspect_get_windows_systemroot"
12527 #: ../src/guestfs-actions.pod:3076
12531 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
12532 " const char *root);\n"
12538 #: ../src/guestfs-actions.pod:3083 ../fish/guestfish-actions.pod:2146
12540 "This returns the Windows systemroot of the inspected guest. The systemroot "
12541 "is a directory path such as C</WINDOWS>."
12546 #: ../src/guestfs-actions.pod:3086 ../fish/guestfish-actions.pod:2149
12548 "This call assumes that the guest is Windows and that the systemroot could be "
12549 "determined by inspection. If this is not the case then an error is returned."
12554 #: ../src/guestfs-actions.pod:3095
12555 msgid "(Added in 1.5.25)"
12559 #: ../src/guestfs-actions.pod:3097
12560 msgid "guestfs_inspect_is_live"
12564 #: ../src/guestfs-actions.pod:3099
12568 " guestfs_inspect_is_live (guestfs_h *g,\n"
12569 " const char *root);\n"
12574 #: ../src/guestfs-actions.pod:3106
12576 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
12577 "disk), then this returns true if a live image was detected on the disk."
12581 #: ../src/guestfs-actions.pod:3114
12582 msgid "guestfs_inspect_is_multipart"
12586 #: ../src/guestfs-actions.pod:3116
12590 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
12591 " const char *root);\n"
12596 #: ../src/guestfs-actions.pod:3123
12598 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
12599 "disk), then this returns true if the disk is part of a set."
12603 #: ../src/guestfs-actions.pod:3131
12604 msgid "guestfs_inspect_is_netinst"
12608 #: ../src/guestfs-actions.pod:3133
12612 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
12613 " const char *root);\n"
12618 #: ../src/guestfs-actions.pod:3140
12620 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
12621 "disk), then this returns true if the disk is a network installer, ie. not a "
12622 "self-contained install CD but one which is likely to require network access "
12623 "to complete the install."
12628 #: ../src/guestfs-actions.pod:3150
12629 msgid "guestfs_inspect_list_applications"
12634 #: ../src/guestfs-actions.pod:3152
12637 " struct guestfs_application_list *\n"
12638 " guestfs_inspect_list_applications (guestfs_h *g,\n"
12639 " const char *root);\n"
12645 #: ../src/guestfs-actions.pod:3159 ../fish/guestfish-actions.pod:2203
12646 msgid "Return the list of applications installed in the operating system."
12651 #: ../src/guestfs-actions.pod:3161
12653 "I<Note:> This call works differently from other parts of the inspection "
12654 "API. You have to call C<guestfs_inspect_os>, then "
12655 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
12656 "this. Listing applications is a significantly more difficult operation "
12657 "which requires access to the full filesystem. Also note that unlike the "
12658 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
12659 "the libguestfs handle, this call actually reads parts of the mounted "
12660 "filesystems during the call."
12665 #: ../src/guestfs-actions.pod:3171 ../fish/guestfish-actions.pod:2215
12667 "This returns an empty list if the inspection code was not able to determine "
12668 "the list of applications."
12673 #: ../src/guestfs-actions.pod:3174 ../fish/guestfish-actions.pod:2218
12674 msgid "The application structure contains the following fields:"
12679 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2222
12680 msgid "C<app_name>"
12685 #: ../src/guestfs-actions.pod:3180 ../fish/guestfish-actions.pod:2224
12687 "The name of the application. For Red Hat-derived and Debian-derived Linux "
12688 "guests, this is the package name."
12693 #: ../src/guestfs-actions.pod:3183 ../fish/guestfish-actions.pod:2227
12694 msgid "C<app_display_name>"
12699 #: ../src/guestfs-actions.pod:3185 ../fish/guestfish-actions.pod:2229
12701 "The display name of the application, sometimes localized to the install "
12702 "language of the guest operating system."
12707 #: ../src/guestfs-actions.pod:3188 ../fish/guestfish-actions.pod:2232
12709 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
12710 "to display something can use C<app_name> instead."
12715 #: ../src/guestfs-actions.pod:3191 ../fish/guestfish-actions.pod:2235
12716 msgid "C<app_epoch>"
12721 #: ../src/guestfs-actions.pod:3193 ../fish/guestfish-actions.pod:2237
12723 "For package managers which use epochs, this contains the epoch of the "
12724 "package (an integer). If unavailable, this is returned as C<0>."
12729 #: ../src/guestfs-actions.pod:3196 ../fish/guestfish-actions.pod:2240
12730 msgid "C<app_version>"
12735 #: ../src/guestfs-actions.pod:3198 ../fish/guestfish-actions.pod:2242
12737 "The version string of the application or package. If unavailable this is "
12738 "returned as an empty string C<\"\">."
12743 #: ../src/guestfs-actions.pod:3201 ../fish/guestfish-actions.pod:2245
12744 msgid "C<app_release>"
12749 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2247
12751 "The release string of the application or package, for package managers that "
12752 "use this. If unavailable this is returned as an empty string C<\"\">."
12757 #: ../src/guestfs-actions.pod:3207 ../fish/guestfish-actions.pod:2251
12758 msgid "C<app_install_path>"
12763 #: ../src/guestfs-actions.pod:3209 ../fish/guestfish-actions.pod:2253
12765 "The installation path of the application (on operating systems such as "
12766 "Windows which use installation paths). This path is in the format used by "
12767 "the guest operating system, it is not a libguestfs path."
12772 #: ../src/guestfs-actions.pod:3214 ../fish/guestfish-actions.pod:2258
12773 msgid "If unavailable this is returned as an empty string C<\"\">."
12778 #: ../src/guestfs-actions.pod:3216 ../fish/guestfish-actions.pod:2260
12779 msgid "C<app_trans_path>"
12784 #: ../src/guestfs-actions.pod:3218 ../fish/guestfish-actions.pod:2262
12786 "The install path translated into a libguestfs path. If unavailable this is "
12787 "returned as an empty string C<\"\">."
12792 #: ../src/guestfs-actions.pod:3221 ../fish/guestfish-actions.pod:2265
12793 msgid "C<app_publisher>"
12798 #: ../src/guestfs-actions.pod:3223 ../fish/guestfish-actions.pod:2267
12800 "The name of the publisher of the application, for package managers that use "
12801 "this. If unavailable this is returned as an empty string C<\"\">."
12806 #: ../src/guestfs-actions.pod:3227 ../fish/guestfish-actions.pod:2271
12812 #: ../src/guestfs-actions.pod:3229 ../fish/guestfish-actions.pod:2273
12814 "The URL (eg. upstream URL) of the application. If unavailable this is "
12815 "returned as an empty string C<\"\">."
12820 #: ../src/guestfs-actions.pod:3232 ../fish/guestfish-actions.pod:2276
12821 msgid "C<app_source_package>"
12826 #: ../src/guestfs-actions.pod:3234 ../fish/guestfish-actions.pod:2278
12828 "For packaging systems which support this, the name of the source package. "
12829 "If unavailable this is returned as an empty string C<\"\">."
12834 #: ../src/guestfs-actions.pod:3237 ../fish/guestfish-actions.pod:2281
12835 msgid "C<app_summary>"
12840 #: ../src/guestfs-actions.pod:3239 ../fish/guestfish-actions.pod:2283
12842 "A short (usually one line) description of the application or package. If "
12843 "unavailable this is returned as an empty string C<\"\">."
12848 #: ../src/guestfs-actions.pod:3242 ../fish/guestfish-actions.pod:2286
12849 msgid "C<app_description>"
12854 #: ../src/guestfs-actions.pod:3244 ../fish/guestfish-actions.pod:2288
12856 "A longer description of the application or package. If unavailable this is "
12857 "returned as an empty string C<\"\">."
12862 #: ../src/guestfs-actions.pod:3251
12864 "This function returns a C<struct guestfs_application_list *>, or NULL if "
12865 "there was an error. I<The caller must call C<guestfs_free_application_list> "
12871 #: ../src/guestfs-actions.pod:3255
12872 msgid "(Added in 1.7.8)"
12877 #: ../src/guestfs-actions.pod:3257
12878 msgid "guestfs_inspect_os"
12883 #: ../src/guestfs-actions.pod:3259
12887 " guestfs_inspect_os (guestfs_h *g);\n"
12893 #: ../src/guestfs-actions.pod:3262 ../fish/guestfish-actions.pod:2299
12895 "This function uses other libguestfs functions and certain heuristics to "
12896 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
12897 "for operating systems."
12902 #: ../src/guestfs-actions.pod:3266 ../fish/guestfish-actions.pod:2303
12903 msgid "The list returned is empty if no operating systems were found."
12908 #: ../src/guestfs-actions.pod:3268 ../fish/guestfish-actions.pod:2305
12910 "If one operating system was found, then this returns a list with a single "
12911 "element, which is the name of the root filesystem of this operating system. "
12912 "It is also possible for this function to return a list containing more than "
12913 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
12914 "element being the root filesystem of one of the operating systems."
12919 #: ../src/guestfs-actions.pod:3275
12921 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
12922 "functions in order to query further information about each operating system, "
12923 "such as the name and version."
12928 #: ../src/guestfs-actions.pod:3280
12930 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
12931 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
12932 "the contents. This should be called with no disks currently mounted. The "
12933 "function may also use Augeas, so any existing Augeas handle will be closed."
12938 #: ../src/guestfs-actions.pod:3286 ../fish/guestfish-actions.pod:2323
12940 "This function cannot decrypt encrypted disks. The caller must do that first "
12941 "(supplying the necessary keys) if the disk is encrypted."
12946 #: ../src/guestfs-actions.pod:3292 ../src/guestfs-actions.pod:3582
12947 #: ../src/guestfs-actions.pod:3644
12948 msgid "See also C<guestfs_list_filesystems>."
12953 #: ../src/guestfs-actions.pod:3300
12954 msgid "guestfs_is_blockdev"
12959 #: ../src/guestfs-actions.pod:3302
12963 " guestfs_is_blockdev (guestfs_h *g,\n"
12964 " const char *path);\n"
12970 #: ../src/guestfs-actions.pod:3306 ../fish/guestfish-actions.pod:2335
12972 "This returns C<true> if and only if there is a block device with the given "
12978 #: ../src/guestfs-actions.pod:3309 ../src/guestfs-actions.pod:3338
12979 #: ../src/guestfs-actions.pod:3368 ../src/guestfs-actions.pod:3383
12980 #: ../src/guestfs-actions.pod:3399 ../src/guestfs-actions.pod:3455
12981 #: ../src/guestfs-actions.pod:3470
12982 msgid "See also C<guestfs_stat>."
12987 #: ../src/guestfs-actions.pod:3313 ../src/guestfs-actions.pod:3342
12988 #: ../src/guestfs-actions.pod:3387 ../src/guestfs-actions.pod:3459
12989 #: ../src/guestfs-actions.pod:3474
12990 msgid "(Added in 1.5.10)"
12995 #: ../src/guestfs-actions.pod:3315
12996 msgid "guestfs_is_busy"
13001 #: ../src/guestfs-actions.pod:3317
13005 " guestfs_is_busy (guestfs_h *g);\n"
13011 #: ../src/guestfs-actions.pod:3320 ../fish/guestfish-actions.pod:2344
13013 "This returns true iff this handle is busy processing a command (in the "
13019 #: ../src/guestfs-actions.pod:3329
13020 msgid "guestfs_is_chardev"
13025 #: ../src/guestfs-actions.pod:3331
13029 " guestfs_is_chardev (guestfs_h *g,\n"
13030 " const char *path);\n"
13036 #: ../src/guestfs-actions.pod:3335 ../fish/guestfish-actions.pod:2353
13038 "This returns C<true> if and only if there is a character device with the "
13039 "given C<path> name."
13044 #: ../src/guestfs-actions.pod:3344
13045 msgid "guestfs_is_config"
13050 #: ../src/guestfs-actions.pod:3346
13054 " guestfs_is_config (guestfs_h *g);\n"
13060 #: ../src/guestfs-actions.pod:3349 ../fish/guestfish-actions.pod:2362
13062 "This returns true iff this handle is being configured (in the C<CONFIG> "
13068 #: ../src/guestfs-actions.pod:3358
13069 msgid "guestfs_is_dir"
13074 #: ../src/guestfs-actions.pod:3360
13078 " guestfs_is_dir (guestfs_h *g,\n"
13079 " const char *path);\n"
13085 #: ../src/guestfs-actions.pod:3364 ../fish/guestfish-actions.pod:2371
13087 "This returns C<true> if and only if there is a directory with the given "
13088 "C<path> name. Note that it returns false for other objects like files."
13093 #: ../src/guestfs-actions.pod:3374
13094 msgid "guestfs_is_fifo"
13099 #: ../src/guestfs-actions.pod:3376
13103 " guestfs_is_fifo (guestfs_h *g,\n"
13104 " const char *path);\n"
13110 #: ../src/guestfs-actions.pod:3380 ../fish/guestfish-actions.pod:2381
13112 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
13113 "given C<path> name."
13118 #: ../src/guestfs-actions.pod:3389
13119 msgid "guestfs_is_file"
13124 #: ../src/guestfs-actions.pod:3391
13128 " guestfs_is_file (guestfs_h *g,\n"
13129 " const char *path);\n"
13135 #: ../src/guestfs-actions.pod:3395 ../fish/guestfish-actions.pod:2390
13137 "This returns C<true> if and only if there is a regular file with the given "
13138 "C<path> name. Note that it returns false for other objects like directories."
13143 #: ../src/guestfs-actions.pod:3405
13144 msgid "guestfs_is_launching"
13149 #: ../src/guestfs-actions.pod:3407
13153 " guestfs_is_launching (guestfs_h *g);\n"
13159 #: ../src/guestfs-actions.pod:3410 ../fish/guestfish-actions.pod:2400
13161 "This returns true iff this handle is launching the subprocess (in the "
13162 "C<LAUNCHING> state)."
13167 #: ../src/guestfs-actions.pod:3419
13168 msgid "guestfs_is_lv"
13173 #: ../src/guestfs-actions.pod:3421
13177 " guestfs_is_lv (guestfs_h *g,\n"
13178 " const char *device);\n"
13184 #: ../src/guestfs-actions.pod:3425 ../fish/guestfish-actions.pod:2409
13186 "This command tests whether C<device> is a logical volume, and returns true "
13187 "iff this is the case."
13192 #: ../src/guestfs-actions.pod:3432
13193 msgid "guestfs_is_ready"
13198 #: ../src/guestfs-actions.pod:3434
13202 " guestfs_is_ready (guestfs_h *g);\n"
13208 #: ../src/guestfs-actions.pod:3437 ../fish/guestfish-actions.pod:2416
13210 "This returns true iff this handle is ready to accept commands (in the "
13216 #: ../src/guestfs-actions.pod:3446
13217 msgid "guestfs_is_socket"
13222 #: ../src/guestfs-actions.pod:3448
13226 " guestfs_is_socket (guestfs_h *g,\n"
13227 " const char *path);\n"
13233 #: ../src/guestfs-actions.pod:3452 ../fish/guestfish-actions.pod:2425
13235 "This returns C<true> if and only if there is a Unix domain socket with the "
13236 "given C<path> name."
13241 #: ../src/guestfs-actions.pod:3461
13242 msgid "guestfs_is_symlink"
13247 #: ../src/guestfs-actions.pod:3463
13251 " guestfs_is_symlink (guestfs_h *g,\n"
13252 " const char *path);\n"
13258 #: ../src/guestfs-actions.pod:3467 ../fish/guestfish-actions.pod:2434
13260 "This returns C<true> if and only if there is a symbolic link with the given "
13266 #: ../src/guestfs-actions.pod:3476
13267 msgid "guestfs_kill_subprocess"
13272 #: ../src/guestfs-actions.pod:3478
13276 " guestfs_kill_subprocess (guestfs_h *g);\n"
13282 #: ../src/guestfs-actions.pod:3481 ../fish/guestfish-actions.pod:2443
13283 msgid "This kills the qemu subprocess. You should never need to call this."
13288 #: ../src/guestfs-actions.pod:3487
13289 msgid "guestfs_launch"
13294 #: ../src/guestfs-actions.pod:3489
13298 " guestfs_launch (guestfs_h *g);\n"
13304 #: ../src/guestfs-actions.pod:3492 ../fish/guestfish-actions.pod:2451
13306 "Internally libguestfs is implemented by running a virtual machine using "
13312 #: ../src/guestfs-actions.pod:3495 ../fish/guestfish-actions.pod:2454
13314 "You should call this after configuring the handle (eg. adding drives) but "
13315 "before performing any actions."
13320 #: ../src/guestfs-actions.pod:3507
13321 msgid "guestfs_lchown"
13326 #: ../src/guestfs-actions.pod:3509
13330 " guestfs_lchown (guestfs_h *g,\n"
13333 " const char *path);\n"
13339 #: ../src/guestfs-actions.pod:3515
13341 "Change the file owner to C<owner> and group to C<group>. This is like "
13342 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
13343 "changed, not the target."
13348 #: ../src/guestfs-actions.pod:3527
13349 msgid "guestfs_lgetxattr"
13354 #: ../src/guestfs-actions.pod:3529
13358 " guestfs_lgetxattr (guestfs_h *g,\n"
13359 " const char *path,\n"
13360 " const char *name,\n"
13361 " size_t *size_r);\n"
13367 #: ../src/guestfs-actions.pod:3535 ../fish/guestfish-actions.pod:2473
13369 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
13370 "is a symlink, then this call returns an extended attribute from the symlink."
13375 #: ../src/guestfs-actions.pod:3549
13376 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
13381 #: ../src/guestfs-actions.pod:3557
13382 msgid "guestfs_lgetxattrs"
13387 #: ../src/guestfs-actions.pod:3559
13390 " struct guestfs_xattr_list *\n"
13391 " guestfs_lgetxattrs (guestfs_h *g,\n"
13392 " const char *path);\n"
13398 #: ../src/guestfs-actions.pod:3563
13400 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
13401 "then it returns the extended attributes of the link itself."
13406 #: ../src/guestfs-actions.pod:3573
13407 msgid "guestfs_list_devices"
13412 #: ../src/guestfs-actions.pod:3575
13416 " guestfs_list_devices (guestfs_h *g);\n"
13422 #: ../src/guestfs-actions.pod:3578 ../fish/guestfish-actions.pod:2501
13423 msgid "List all the block devices."
13428 #: ../src/guestfs-actions.pod:3580 ../fish/guestfish-actions.pod:2503
13429 msgid "The full block device names are returned, eg. C</dev/sda>."
13434 #: ../src/guestfs-actions.pod:3590
13435 msgid "guestfs_list_filesystems"
13440 #: ../src/guestfs-actions.pod:3592
13444 " guestfs_list_filesystems (guestfs_h *g);\n"
13450 #: ../src/guestfs-actions.pod:3595 ../fish/guestfish-actions.pod:2511
13452 "This inspection command looks for filesystems on partitions, block devices "
13453 "and logical volumes, returning a list of devices containing filesystems and "
13459 #: ../src/guestfs-actions.pod:3599 ../fish/guestfish-actions.pod:2515
13461 "The return value is a hash, where the keys are the devices containing "
13462 "filesystems, and the values are the filesystem types. For example:"
13467 #: ../src/guestfs-actions.pod:3603 ../fish/guestfish-actions.pod:2519
13470 " \"/dev/sda1\" => \"ntfs\"\n"
13471 " \"/dev/sda2\" => \"ext2\"\n"
13472 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
13473 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
13479 #: ../src/guestfs-actions.pod:3608 ../fish/guestfish-actions.pod:2524
13481 "The value can have the special value \"unknown\", meaning the content of the "
13482 "device is undetermined or empty. \"swap\" means a Linux swap partition."
13487 #: ../src/guestfs-actions.pod:3612
13489 "This command runs other libguestfs commands, which might include "
13490 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
13491 "soon after launch and only when nothing is mounted."
13496 #: ../src/guestfs-actions.pod:3616
13498 "Not all of the filesystems returned will be mountable. In particular, swap "
13499 "partitions are returned in the list. Also this command does not check that "
13500 "each filesystem found is valid and mountable, and some filesystems might be "
13501 "mountable but require special options. Filesystems may not all belong to a "
13502 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
13507 #: ../src/guestfs-actions.pod:3630 ../src/guestfs-actions.pod:5251
13508 msgid "(Added in 1.5.15)"
13513 #: ../src/guestfs-actions.pod:3632
13514 msgid "guestfs_list_partitions"
13519 #: ../src/guestfs-actions.pod:3634
13523 " guestfs_list_partitions (guestfs_h *g);\n"
13529 #: ../src/guestfs-actions.pod:3637 ../fish/guestfish-actions.pod:2544
13530 msgid "List all the partitions detected on all block devices."
13535 #: ../src/guestfs-actions.pod:3639 ../fish/guestfish-actions.pod:2546
13536 msgid "The full partition device names are returned, eg. C</dev/sda1>"
13541 #: ../src/guestfs-actions.pod:3641
13543 "This does not return logical volumes. For that you will need to call "
13549 #: ../src/guestfs-actions.pod:3652
13555 #: ../src/guestfs-actions.pod:3654
13559 " guestfs_ll (guestfs_h *g,\n"
13560 " const char *directory);\n"
13566 #: ../src/guestfs-actions.pod:3658 ../fish/guestfish-actions.pod:2557
13568 "List the files in C<directory> (relative to the root directory, there is no "
13569 "cwd) in the format of 'ls -la'."
13574 #: ../src/guestfs-actions.pod:3661 ../fish/guestfish-actions.pod:2560
13576 "This command is mostly useful for interactive sessions. It is I<not> "
13577 "intended that you try to parse the output string."
13582 #: ../src/guestfs-actions.pod:3669
13588 #: ../src/guestfs-actions.pod:3671
13592 " guestfs_ln (guestfs_h *g,\n"
13593 " const char *target,\n"
13594 " const char *linkname);\n"
13600 #: ../src/guestfs-actions.pod:3676 ../fish/guestfish-actions.pod:2567
13601 msgid "This command creates a hard link using the C<ln> command."
13606 #: ../src/guestfs-actions.pod:3682
13607 msgid "guestfs_ln_f"
13612 #: ../src/guestfs-actions.pod:3684
13616 " guestfs_ln_f (guestfs_h *g,\n"
13617 " const char *target,\n"
13618 " const char *linkname);\n"
13623 #: ../src/guestfs-actions.pod:3689 ../fish/guestfish-actions.pod:2573
13625 "This command creates a hard link using the C<ln -f> command. The I<-f> "
13626 "option removes the link (C<linkname>) if it exists already."
13631 #: ../src/guestfs-actions.pod:3696
13632 msgid "guestfs_ln_s"
13637 #: ../src/guestfs-actions.pod:3698
13641 " guestfs_ln_s (guestfs_h *g,\n"
13642 " const char *target,\n"
13643 " const char *linkname);\n"
13649 #: ../src/guestfs-actions.pod:3703 ../fish/guestfish-actions.pod:2580
13650 msgid "This command creates a symbolic link using the C<ln -s> command."
13655 #: ../src/guestfs-actions.pod:3709
13656 msgid "guestfs_ln_sf"
13661 #: ../src/guestfs-actions.pod:3711
13665 " guestfs_ln_sf (guestfs_h *g,\n"
13666 " const char *target,\n"
13667 " const char *linkname);\n"
13672 #: ../src/guestfs-actions.pod:3716 ../fish/guestfish-actions.pod:2586
13674 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
13675 "option removes the link (C<linkname>) if it exists already."
13680 #: ../src/guestfs-actions.pod:3723
13681 msgid "guestfs_lremovexattr"
13686 #: ../src/guestfs-actions.pod:3725
13690 " guestfs_lremovexattr (guestfs_h *g,\n"
13691 " const char *xattr,\n"
13692 " const char *path);\n"
13698 #: ../src/guestfs-actions.pod:3730
13700 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
13701 "link, then it removes an extended attribute of the link itself."
13706 #: ../src/guestfs-actions.pod:3738
13712 #: ../src/guestfs-actions.pod:3740
13716 " guestfs_ls (guestfs_h *g,\n"
13717 " const char *directory);\n"
13723 #: ../src/guestfs-actions.pod:3744 ../fish/guestfish-actions.pod:2601
13725 "List the files in C<directory> (relative to the root directory, there is no "
13726 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
13731 #: ../src/guestfs-actions.pod:3748
13733 "This command is mostly useful for interactive sessions. Programs should "
13734 "probably use C<guestfs_readdir> instead."
13739 #: ../src/guestfs-actions.pod:3757
13740 msgid "guestfs_lsetxattr"
13745 #: ../src/guestfs-actions.pod:3759
13749 " guestfs_lsetxattr (guestfs_h *g,\n"
13750 " const char *xattr,\n"
13751 " const char *val,\n"
13753 " const char *path);\n"
13759 #: ../src/guestfs-actions.pod:3766
13761 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
13762 "then it sets an extended attribute of the link itself."
13767 #: ../src/guestfs-actions.pod:3774
13768 msgid "guestfs_lstat"
13773 #: ../src/guestfs-actions.pod:3776
13776 " struct guestfs_stat *\n"
13777 " guestfs_lstat (guestfs_h *g,\n"
13778 " const char *path);\n"
13784 #: ../src/guestfs-actions.pod:3780 ../src/guestfs-actions.pod:6382
13785 #: ../fish/guestfish-actions.pod:2620 ../fish/guestfish-actions.pod:4333
13786 msgid "Returns file information for the given C<path>."
13791 #: ../src/guestfs-actions.pod:3782
13793 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
13794 "link, then the link is stat-ed, not the file it refers to."
13799 #: ../src/guestfs-actions.pod:3786 ../fish/guestfish-actions.pod:2626
13800 msgid "This is the same as the C<lstat(2)> system call."
13805 #: ../src/guestfs-actions.pod:3788 ../src/guestfs-actions.pod:6386
13807 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
13808 "error. I<The caller must call C<guestfs_free_stat> after use>."
13813 #: ../src/guestfs-actions.pod:3792 ../src/guestfs-actions.pod:6390
13814 #: ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6789
13815 msgid "(Added in 0.9.2)"
13820 #: ../src/guestfs-actions.pod:3794
13821 msgid "guestfs_lstatlist"
13826 #: ../src/guestfs-actions.pod:3796
13829 " struct guestfs_stat_list *\n"
13830 " guestfs_lstatlist (guestfs_h *g,\n"
13831 " const char *path,\n"
13832 " char *const *names);\n"
13838 #: ../src/guestfs-actions.pod:3801
13840 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
13841 "files, where all files are in the directory C<path>. C<names> is the list "
13842 "of files from this directory."
13847 #: ../src/guestfs-actions.pod:3805 ../fish/guestfish-actions.pod:2636
13849 "On return you get a list of stat structs, with a one-to-one correspondence "
13850 "to the C<names> list. If any name did not exist or could not be lstat'd, "
13851 "then the C<ino> field of that structure is set to C<-1>."
13856 #: ../src/guestfs-actions.pod:3810
13858 "This call is intended for programs that want to efficiently list a directory "
13859 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
13860 "for a similarly efficient call for getting extended attributes. Very long "
13861 "directory listings might cause the protocol message size to be exceeded, "
13862 "causing this call to fail. The caller must split up such requests into "
13863 "smaller groups of names."
13868 #: ../src/guestfs-actions.pod:3818
13870 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
13871 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
13876 #: ../src/guestfs-actions.pod:3824
13877 msgid "guestfs_luks_add_key"
13882 #: ../src/guestfs-actions.pod:3826
13886 " guestfs_luks_add_key (guestfs_h *g,\n"
13887 " const char *device,\n"
13888 " const char *key,\n"
13889 " const char *newkey,\n"
13896 #: ../src/guestfs-actions.pod:3833 ../fish/guestfish-actions.pod:2653
13898 "This command adds a new key on LUKS device C<device>. C<key> is any "
13899 "existing key, and is used to access the device. C<newkey> is the new key to "
13900 "add. C<keyslot> is the key slot that will be replaced."
13905 #: ../src/guestfs-actions.pod:3838
13907 "Note that if C<keyslot> already contains a key, then this command will "
13908 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
13913 #: ../src/guestfs-actions.pod:3844 ../src/guestfs-actions.pod:3884
13914 #: ../src/guestfs-actions.pod:3907 ../src/guestfs-actions.pod:3927
13915 #: ../src/guestfs-actions.pod:3959 ../src/guestfs-actions.pod:3978
13917 "This function takes a key or passphrase parameter which could contain "
13918 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
13924 #: ../src/guestfs-actions.pod:3848 ../src/guestfs-actions.pod:3888
13925 #: ../src/guestfs-actions.pod:3911 ../src/guestfs-actions.pod:3931
13926 msgid "(Added in 1.5.2)"
13931 #: ../src/guestfs-actions.pod:3850
13932 msgid "guestfs_luks_close"
13937 #: ../src/guestfs-actions.pod:3852
13941 " guestfs_luks_close (guestfs_h *g,\n"
13942 " const char *device);\n"
13948 #: ../src/guestfs-actions.pod:3856
13950 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
13951 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
13952 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
13953 "underlying block device."
13958 #: ../src/guestfs-actions.pod:3864 ../src/guestfs-actions.pod:3963
13959 #: ../src/guestfs-actions.pod:3982 ../src/guestfs-actions.pod:4032
13960 #: ../src/guestfs-actions.pod:4080
13961 msgid "(Added in 1.5.1)"
13966 #: ../src/guestfs-actions.pod:3866
13967 msgid "guestfs_luks_format"
13972 #: ../src/guestfs-actions.pod:3868
13976 " guestfs_luks_format (guestfs_h *g,\n"
13977 " const char *device,\n"
13978 " const char *key,\n"
13985 #: ../src/guestfs-actions.pod:3874 ../fish/guestfish-actions.pod:2679
13987 "This command erases existing data on C<device> and formats the device as a "
13988 "LUKS encrypted device. C<key> is the initial key, which is added to key "
13989 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
13994 #: ../src/guestfs-actions.pod:3881 ../src/guestfs-actions.pod:3904
13995 #: ../src/guestfs-actions.pod:4044 ../src/guestfs-actions.pod:5002
13996 #: ../src/guestfs-actions.pod:5782 ../src/guestfs-actions.pod:6189
13997 #: ../src/guestfs-actions.pod:6219 ../src/guestfs-actions.pod:6252
13998 #: ../src/guestfs-actions.pod:7433 ../fish/guestfish-actions.pod:2687
13999 #: ../fish/guestfish-actions.pod:2700 ../fish/guestfish-actions.pod:2784
14000 #: ../fish/guestfish-actions.pod:3374 ../fish/guestfish-actions.pod:3894
14001 #: ../fish/guestfish-actions.pod:4204 ../fish/guestfish-actions.pod:4227
14002 #: ../fish/guestfish-actions.pod:4249 ../fish/guestfish-actions.pod:4978
14004 "B<This command is dangerous. Without careful use you can easily destroy all "
14010 #: ../src/guestfs-actions.pod:3890
14011 msgid "guestfs_luks_format_cipher"
14016 #: ../src/guestfs-actions.pod:3892
14020 " guestfs_luks_format_cipher (guestfs_h *g,\n"
14021 " const char *device,\n"
14022 " const char *key,\n"
14024 " const char *cipher);\n"
14030 #: ../src/guestfs-actions.pod:3899
14032 "This command is the same as C<guestfs_luks_format> but it also allows you to "
14033 "set the C<cipher> used."
14038 #: ../src/guestfs-actions.pod:3913
14039 msgid "guestfs_luks_kill_slot"
14044 #: ../src/guestfs-actions.pod:3915
14048 " guestfs_luks_kill_slot (guestfs_h *g,\n"
14049 " const char *device,\n"
14050 " const char *key,\n"
14057 #: ../src/guestfs-actions.pod:3921 ../fish/guestfish-actions.pod:2707
14059 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
14060 "device C<device>. C<key> must be one of the I<other> keys."
14065 #: ../src/guestfs-actions.pod:3933
14066 msgid "guestfs_luks_open"
14071 #: ../src/guestfs-actions.pod:3935
14075 " guestfs_luks_open (guestfs_h *g,\n"
14076 " const char *device,\n"
14077 " const char *key,\n"
14078 " const char *mapname);\n"
14084 #: ../src/guestfs-actions.pod:3941 ../fish/guestfish-actions.pod:2718
14086 "This command opens a block device which has been encrypted according to the "
14087 "Linux Unified Key Setup (LUKS) standard."
14092 #: ../src/guestfs-actions.pod:3944 ../fish/guestfish-actions.pod:2721
14093 msgid "C<device> is the encrypted block device or partition."
14098 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:2723
14100 "The caller must supply one of the keys associated with the LUKS block "
14101 "device, in the C<key> parameter."
14106 #: ../src/guestfs-actions.pod:3949 ../fish/guestfish-actions.pod:2726
14108 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
14109 "writes to this block device are decrypted from and encrypted to the "
14110 "underlying C<device> respectively."
14115 #: ../src/guestfs-actions.pod:3953
14117 "If this block device contains LVM volume groups, then calling "
14118 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
14124 #: ../src/guestfs-actions.pod:3965
14125 msgid "guestfs_luks_open_ro"
14130 #: ../src/guestfs-actions.pod:3967
14134 " guestfs_luks_open_ro (guestfs_h *g,\n"
14135 " const char *device,\n"
14136 " const char *key,\n"
14137 " const char *mapname);\n"
14143 #: ../src/guestfs-actions.pod:3973
14145 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
14151 #: ../src/guestfs-actions.pod:3984
14152 msgid "guestfs_lvcreate"
14157 #: ../src/guestfs-actions.pod:3986
14161 " guestfs_lvcreate (guestfs_h *g,\n"
14162 " const char *logvol,\n"
14163 " const char *volgroup,\n"
14170 #: ../src/guestfs-actions.pod:3992 ../fish/guestfish-actions.pod:2751
14172 "This creates an LVM logical volume called C<logvol> on the volume group "
14173 "C<volgroup>, with C<size> megabytes."
14178 #: ../src/guestfs-actions.pod:3999
14179 msgid "guestfs_lvm_canonical_lv_name"
14184 #: ../src/guestfs-actions.pod:4001
14188 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
14189 " const char *lvname);\n"
14195 #: ../src/guestfs-actions.pod:4005 ../fish/guestfish-actions.pod:2758
14197 "This converts alternative naming schemes for LVs that you might find to the "
14198 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
14204 #: ../src/guestfs-actions.pod:4009 ../fish/guestfish-actions.pod:2762
14206 "This command returns an error if the C<lvname> parameter does not refer to a "
14212 #: ../src/guestfs-actions.pod:4012
14213 msgid "See also C<guestfs_is_lv>."
14218 #: ../src/guestfs-actions.pod:4017
14219 msgid "(Added in 1.5.24)"
14224 #: ../src/guestfs-actions.pod:4019
14225 msgid "guestfs_lvm_clear_filter"
14230 #: ../src/guestfs-actions.pod:4021
14234 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
14240 #: ../src/guestfs-actions.pod:4024
14242 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
14243 "see every block device."
14248 #: ../src/guestfs-actions.pod:4027 ../src/guestfs-actions.pod:4069
14249 #: ../fish/guestfish-actions.pod:2774 ../fish/guestfish-actions.pod:2805
14251 "This command also clears the LVM cache and performs a volume group scan."
14256 #: ../src/guestfs-actions.pod:4034
14257 msgid "guestfs_lvm_remove_all"
14262 #: ../src/guestfs-actions.pod:4036
14266 " guestfs_lvm_remove_all (guestfs_h *g);\n"
14272 #: ../src/guestfs-actions.pod:4039 ../fish/guestfish-actions.pod:2781
14274 "This command removes all LVM logical volumes, volume groups and physical "
14280 #: ../src/guestfs-actions.pod:4049
14281 msgid "guestfs_lvm_set_filter"
14286 #: ../src/guestfs-actions.pod:4051
14290 " guestfs_lvm_set_filter (guestfs_h *g,\n"
14291 " char *const *devices);\n"
14297 #: ../src/guestfs-actions.pod:4055 ../fish/guestfish-actions.pod:2791
14299 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
14300 "block devices in the list C<devices>, and will ignore all other attached "
14306 #: ../src/guestfs-actions.pod:4059 ../fish/guestfish-actions.pod:2795
14308 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
14309 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
14310 "there are two types of duplication possible: either cloned PVs/VGs which "
14311 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
14312 "same name. In normal operation you cannot create this situation, but you "
14313 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
14314 "inside the LVM metadata."
14319 #: ../src/guestfs-actions.pod:4072 ../fish/guestfish-actions.pod:2808
14320 msgid "You can filter whole block devices or individual partitions."
14325 #: ../src/guestfs-actions.pod:4074 ../fish/guestfish-actions.pod:2810
14327 "You cannot use this if any VG is currently in use (eg. contains a mounted "
14328 "filesystem), even if you are not filtering out that VG."
14333 #: ../src/guestfs-actions.pod:4082
14334 msgid "guestfs_lvremove"
14339 #: ../src/guestfs-actions.pod:4084
14343 " guestfs_lvremove (guestfs_h *g,\n"
14344 " const char *device);\n"
14350 #: ../src/guestfs-actions.pod:4088 ../fish/guestfish-actions.pod:2818
14352 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
14353 "LV, such as C</dev/VG/LV>."
14358 #: ../src/guestfs-actions.pod:4091 ../fish/guestfish-actions.pod:2821
14360 "You can also remove all LVs in a volume group by specifying the VG name, C</"
14366 #: ../src/guestfs-actions.pod:4096 ../src/guestfs-actions.pod:5348
14367 #: ../src/guestfs-actions.pod:7165
14368 msgid "(Added in 1.0.13)"
14373 #: ../src/guestfs-actions.pod:4098
14374 msgid "guestfs_lvrename"
14379 #: ../src/guestfs-actions.pod:4100
14383 " guestfs_lvrename (guestfs_h *g,\n"
14384 " const char *logvol,\n"
14385 " const char *newlogvol);\n"
14391 #: ../src/guestfs-actions.pod:4105 ../fish/guestfish-actions.pod:2828
14392 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
14397 #: ../src/guestfs-actions.pod:4109 ../src/guestfs-actions.pod:7178
14398 msgid "(Added in 1.0.83)"
14403 #: ../src/guestfs-actions.pod:4111
14404 msgid "guestfs_lvresize"
14409 #: ../src/guestfs-actions.pod:4113
14413 " guestfs_lvresize (guestfs_h *g,\n"
14414 " const char *device,\n"
14421 #: ../src/guestfs-actions.pod:4118 ../fish/guestfish-actions.pod:2834
14423 "This resizes (expands or shrinks) an existing LVM logical volume to "
14424 "C<mbytes>. When reducing, data in the reduced part is lost."
14429 #: ../src/guestfs-actions.pod:4126
14430 msgid "guestfs_lvresize_free"
14435 #: ../src/guestfs-actions.pod:4128
14439 " guestfs_lvresize_free (guestfs_h *g,\n"
14440 " const char *lv,\n"
14447 #: ../src/guestfs-actions.pod:4133 ../fish/guestfish-actions.pod:2842
14449 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
14450 "remaining free space in the volume group. Commonly you would call this with "
14451 "pc = 100 which expands the logical volume as much as possible, using all "
14452 "remaining free space in the volume group."
14457 #: ../src/guestfs-actions.pod:4141
14458 msgid "(Added in 1.3.3)"
14463 #: ../src/guestfs-actions.pod:4143
14464 msgid "guestfs_lvs"
14469 #: ../src/guestfs-actions.pod:4145
14473 " guestfs_lvs (guestfs_h *g);\n"
14479 #: ../src/guestfs-actions.pod:4148 ../fish/guestfish-actions.pod:2852
14481 "List all the logical volumes detected. This is the equivalent of the L<lvs"
14487 #: ../src/guestfs-actions.pod:4151 ../fish/guestfish-actions.pod:2855
14489 "This returns a list of the logical volume device names (eg. C</dev/"
14490 "VolGroup00/LogVol00>)."
14495 #: ../src/guestfs-actions.pod:4154
14496 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
14501 #: ../src/guestfs-actions.pod:4162
14502 msgid "guestfs_lvs_full"
14507 #: ../src/guestfs-actions.pod:4164
14510 " struct guestfs_lvm_lv_list *\n"
14511 " guestfs_lvs_full (guestfs_h *g);\n"
14517 #: ../src/guestfs-actions.pod:4167 ../fish/guestfish-actions.pod:2864
14519 "List all the logical volumes detected. This is the equivalent of the L<lvs"
14520 "(8)> command. The \"full\" version includes all fields."
14525 #: ../src/guestfs-actions.pod:4170
14527 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
14528 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
14533 #: ../src/guestfs-actions.pod:4176
14534 msgid "guestfs_lvuuid"
14539 #: ../src/guestfs-actions.pod:4178
14543 " guestfs_lvuuid (guestfs_h *g,\n"
14544 " const char *device);\n"
14550 #: ../src/guestfs-actions.pod:4182 ../fish/guestfish-actions.pod:2871
14551 msgid "This command returns the UUID of the LVM LV C<device>."
14556 #: ../src/guestfs-actions.pod:4189
14557 msgid "guestfs_lxattrlist"
14562 #: ../src/guestfs-actions.pod:4191
14565 " struct guestfs_xattr_list *\n"
14566 " guestfs_lxattrlist (guestfs_h *g,\n"
14567 " const char *path,\n"
14568 " char *const *names);\n"
14574 #: ../src/guestfs-actions.pod:4196 ../fish/guestfish-actions.pod:2877
14576 "This call allows you to get the extended attributes of multiple files, where "
14577 "all files are in the directory C<path>. C<names> is the list of files from "
14583 #: ../src/guestfs-actions.pod:4200 ../fish/guestfish-actions.pod:2881
14585 "On return you get a flat list of xattr structs which must be interpreted "
14586 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
14587 "C<attrval> in this struct is zero-length to indicate there was an error "
14588 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
14589 "number (the number of following attributes for this file, which could be C<"
14590 "\"0\">). Then after the first xattr struct are the zero or more attributes "
14591 "for the first named file. This repeats for the second and subsequent files."
14596 #: ../src/guestfs-actions.pod:4210
14598 "This call is intended for programs that want to efficiently list a directory "
14599 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
14600 "a similarly efficient call for getting standard stats. Very long directory "
14601 "listings might cause the protocol message size to be exceeded, causing this "
14602 "call to fail. The caller must split up such requests into smaller groups of "
14608 #: ../src/guestfs-actions.pod:4224
14609 msgid "guestfs_mkdir"
14614 #: ../src/guestfs-actions.pod:4226
14618 " guestfs_mkdir (guestfs_h *g,\n"
14619 " const char *path);\n"
14625 #: ../src/guestfs-actions.pod:4230 ../fish/guestfish-actions.pod:2903
14626 msgid "Create a directory named C<path>."
14631 #: ../src/guestfs-actions.pod:4236
14632 msgid "guestfs_mkdir_mode"
14637 #: ../src/guestfs-actions.pod:4238
14641 " guestfs_mkdir_mode (guestfs_h *g,\n"
14642 " const char *path,\n"
14649 #: ../src/guestfs-actions.pod:4243 ../fish/guestfish-actions.pod:2909
14651 "This command creates a directory, setting the initial permissions of the "
14652 "directory to C<mode>."
14657 #: ../src/guestfs-actions.pod:4246 ../fish/guestfish-actions.pod:2912
14659 "For common Linux filesystems, the actual mode which is set will be C<mode & "
14660 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
14666 #: ../src/guestfs-actions.pod:4250
14667 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
14672 #: ../src/guestfs-actions.pod:4256
14673 msgid "guestfs_mkdir_p"
14678 #: ../src/guestfs-actions.pod:4258
14682 " guestfs_mkdir_p (guestfs_h *g,\n"
14683 " const char *path);\n"
14689 #: ../src/guestfs-actions.pod:4262 ../fish/guestfish-actions.pod:2922
14691 "Create a directory named C<path>, creating any parent directories as "
14692 "necessary. This is like the C<mkdir -p> shell command."
14697 #: ../src/guestfs-actions.pod:4269
14698 msgid "guestfs_mkdtemp"
14703 #: ../src/guestfs-actions.pod:4271
14707 " guestfs_mkdtemp (guestfs_h *g,\n"
14708 " const char *template);\n"
14714 #: ../src/guestfs-actions.pod:4275 ../fish/guestfish-actions.pod:2929
14716 "This command creates a temporary directory. The C<template> parameter "
14717 "should be a full pathname for the temporary directory name with the final "
14718 "six characters being \"XXXXXX\"."
14723 #: ../src/guestfs-actions.pod:4280 ../fish/guestfish-actions.pod:2934
14725 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
14726 "being suitable for Windows filesystems."
14731 #: ../src/guestfs-actions.pod:4283 ../fish/guestfish-actions.pod:2937
14732 msgid "The name of the temporary directory that was created is returned."
14737 #: ../src/guestfs-actions.pod:4286 ../fish/guestfish-actions.pod:2940
14738 msgid "The temporary directory is created with mode 0700 and is owned by root."
14743 #: ../src/guestfs-actions.pod:4289 ../fish/guestfish-actions.pod:2943
14745 "The caller is responsible for deleting the temporary directory and its "
14746 "contents after use."
14751 #: ../src/guestfs-actions.pod:4292 ../fish/guestfish-actions.pod:2946
14752 msgid "See also: L<mkdtemp(3)>"
14757 #: ../src/guestfs-actions.pod:4299
14758 msgid "guestfs_mke2fs_J"
14763 #: ../src/guestfs-actions.pod:4301
14767 " guestfs_mke2fs_J (guestfs_h *g,\n"
14768 " const char *fstype,\n"
14769 " int blocksize,\n"
14770 " const char *device,\n"
14771 " const char *journal);\n"
14777 #: ../src/guestfs-actions.pod:4308 ../fish/guestfish-actions.pod:2952
14779 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14780 "C<journal>. It is equivalent to the command:"
14785 #: ../src/guestfs-actions.pod:4312 ../fish/guestfish-actions.pod:2956
14788 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
14794 #: ../src/guestfs-actions.pod:4314
14795 msgid "See also C<guestfs_mke2journal>."
14800 #: ../src/guestfs-actions.pod:4318 ../src/guestfs-actions.pod:4336
14801 #: ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:4370
14802 #: ../src/guestfs-actions.pod:4384 ../src/guestfs-actions.pod:4398
14803 #: ../src/guestfs-actions.pod:4457 ../src/guestfs-actions.pod:4722
14804 msgid "(Added in 1.0.68)"
14809 #: ../src/guestfs-actions.pod:4320
14810 msgid "guestfs_mke2fs_JL"
14815 #: ../src/guestfs-actions.pod:4322
14819 " guestfs_mke2fs_JL (guestfs_h *g,\n"
14820 " const char *fstype,\n"
14821 " int blocksize,\n"
14822 " const char *device,\n"
14823 " const char *label);\n"
14829 #: ../src/guestfs-actions.pod:4329 ../fish/guestfish-actions.pod:2964
14831 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14832 "the journal labeled C<label>."
14837 #: ../src/guestfs-actions.pod:4332
14838 msgid "See also C<guestfs_mke2journal_L>."
14843 #: ../src/guestfs-actions.pod:4338
14844 msgid "guestfs_mke2fs_JU"
14849 #: ../src/guestfs-actions.pod:4340
14853 " guestfs_mke2fs_JU (guestfs_h *g,\n"
14854 " const char *fstype,\n"
14855 " int blocksize,\n"
14856 " const char *device,\n"
14857 " const char *uuid);\n"
14863 #: ../src/guestfs-actions.pod:4347 ../fish/guestfish-actions.pod:2973
14865 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14866 "the journal with UUID C<uuid>."
14871 #: ../src/guestfs-actions.pod:4350
14872 msgid "See also C<guestfs_mke2journal_U>."
14877 #: ../src/guestfs-actions.pod:4356
14878 msgid "guestfs_mke2journal"
14883 #: ../src/guestfs-actions.pod:4358
14887 " guestfs_mke2journal (guestfs_h *g,\n"
14888 " int blocksize,\n"
14889 " const char *device);\n"
14895 #: ../src/guestfs-actions.pod:4363 ../fish/guestfish-actions.pod:2982
14897 "This creates an ext2 external journal on C<device>. It is equivalent to the "
14903 #: ../src/guestfs-actions.pod:4366 ../fish/guestfish-actions.pod:2985
14906 " mke2fs -O journal_dev -b blocksize device\n"
14912 #: ../src/guestfs-actions.pod:4372
14913 msgid "guestfs_mke2journal_L"
14918 #: ../src/guestfs-actions.pod:4374
14922 " guestfs_mke2journal_L (guestfs_h *g,\n"
14923 " int blocksize,\n"
14924 " const char *label,\n"
14925 " const char *device);\n"
14931 #: ../src/guestfs-actions.pod:4380 ../fish/guestfish-actions.pod:2991
14932 msgid "This creates an ext2 external journal on C<device> with label C<label>."
14937 #: ../src/guestfs-actions.pod:4386
14938 msgid "guestfs_mke2journal_U"
14943 #: ../src/guestfs-actions.pod:4388
14947 " guestfs_mke2journal_U (guestfs_h *g,\n"
14948 " int blocksize,\n"
14949 " const char *uuid,\n"
14950 " const char *device);\n"
14956 #: ../src/guestfs-actions.pod:4394 ../fish/guestfish-actions.pod:2997
14957 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
14962 #: ../src/guestfs-actions.pod:4400
14963 msgid "guestfs_mkfifo"
14968 #: ../src/guestfs-actions.pod:4402
14972 " guestfs_mkfifo (guestfs_h *g,\n"
14974 " const char *path);\n"
14980 #: ../src/guestfs-actions.pod:4407
14982 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
14983 "is just a convenient wrapper around C<guestfs_mknod>."
14988 #: ../src/guestfs-actions.pod:4417
14989 msgid "guestfs_mkfs"
14994 #: ../src/guestfs-actions.pod:4419
14998 " guestfs_mkfs (guestfs_h *g,\n"
14999 " const char *fstype,\n"
15000 " const char *device);\n"
15006 #: ../src/guestfs-actions.pod:4424 ../fish/guestfish-actions.pod:3013
15008 "This creates a filesystem on C<device> (usually a partition or LVM logical "
15009 "volume). The filesystem type is C<fstype>, for example C<ext3>."
15014 #: ../src/guestfs-actions.pod:4432
15015 msgid "guestfs_mkfs_b"
15020 #: ../src/guestfs-actions.pod:4434
15024 " guestfs_mkfs_b (guestfs_h *g,\n"
15025 " const char *fstype,\n"
15026 " int blocksize,\n"
15027 " const char *device);\n"
15033 #: ../src/guestfs-actions.pod:4440
15035 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
15036 "block size of the resulting filesystem. Supported block sizes depend on the "
15037 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
15042 #: ../src/guestfs-actions.pod:4445 ../src/guestfs-actions.pod:4488
15043 #: ../fish/guestfish-actions.pod:3026 ../fish/guestfish-actions.pod:3053
15045 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
15050 #: ../src/guestfs-actions.pod:4450
15052 "This function is deprecated. In new code, use the L</guestfs_mkfs_opts> "
15058 #: ../src/guestfs-actions.pod:4459
15059 msgid "guestfs_mkfs_opts"
15064 #: ../src/guestfs-actions.pod:4461
15068 " guestfs_mkfs_opts (guestfs_h *g,\n"
15069 " const char *fstype,\n"
15070 " const char *device,\n"
15076 #: ../src/guestfs-actions.pod:4472
15079 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
15080 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
15086 #: ../src/guestfs-actions.pod:4475 ../fish/guestfish-actions.pod:3040
15088 "This function creates a filesystem on C<device>. The filesystem type is "
15089 "C<fstype>, for example C<ext3>."
15094 #: ../src/guestfs-actions.pod:4482 ../fish/guestfish-actions.pod:3047
15095 msgid "C<blocksize>"
15100 #: ../src/guestfs-actions.pod:4484 ../fish/guestfish-actions.pod:3049
15102 "The filesystem block size. Supported block sizes depend on the filesystem "
15103 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
15108 #: ../src/guestfs-actions.pod:4491 ../fish/guestfish-actions.pod:3056
15109 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
15113 #: ../src/guestfs-actions.pod:4493 ../fish/guestfish-actions.pod:3058
15114 msgid "C<features>"
15118 #: ../src/guestfs-actions.pod:4495 ../fish/guestfish-actions.pod:3060
15119 msgid "This passes the I<-O> parameter to the external mkfs program."
15123 #: ../src/guestfs-actions.pod:4497 ../fish/guestfish-actions.pod:3062
15125 "For certain filesystem types, this allows extra filesystem features to be "
15126 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
15130 #: ../src/guestfs-actions.pod:4501 ../fish/guestfish-actions.pod:3066
15132 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
15137 #: ../src/guestfs-actions.pod:4508
15138 msgid "(Added in 1.7.19)"
15143 #: ../src/guestfs-actions.pod:4510
15144 msgid "guestfs_mkfs_opts_va"
15149 #: ../src/guestfs-actions.pod:4512
15153 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
15154 " const char *fstype,\n"
15155 " const char *device,\n"
15156 " va_list args);\n"
15162 #: ../src/guestfs-actions.pod:4518
15163 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
15168 #: ../src/guestfs-actions.pod:4522
15169 msgid "guestfs_mkfs_opts_argv"
15174 #: ../src/guestfs-actions.pod:4524
15178 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
15179 " const char *fstype,\n"
15180 " const char *device,\n"
15181 " const struct guestfs_mkfs_opts_argv *optargs);\n"
15187 #: ../src/guestfs-actions.pod:4530
15188 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
15193 #: ../src/guestfs-actions.pod:4534
15194 msgid "guestfs_mkmountpoint"
15199 #: ../src/guestfs-actions.pod:4536
15203 " guestfs_mkmountpoint (guestfs_h *g,\n"
15204 " const char *exemptpath);\n"
15210 #: ../src/guestfs-actions.pod:4540
15212 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
15213 "that can be used to create extra mountpoints before mounting the first "
15219 #: ../src/guestfs-actions.pod:4544 ../fish/guestfish-actions.pod:3081
15221 "These calls are I<only> necessary in some very limited circumstances, mainly "
15222 "the case where you want to mount a mix of unrelated and/or read-only "
15223 "filesystems together."
15228 #: ../src/guestfs-actions.pod:4548 ../fish/guestfish-actions.pod:3085
15230 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
15231 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
15232 "inside that. You can unpack this as follows in guestfish:"
15237 #: ../src/guestfs-actions.pod:4553 ../fish/guestfish-actions.pod:3090
15240 " add-ro Fedora-11-i686-Live.iso\n"
15242 " mkmountpoint /cd\n"
15243 " mkmountpoint /sqsh\n"
15244 " mkmountpoint /ext3fs\n"
15245 " mount /dev/sda /cd\n"
15246 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
15247 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
15253 #: ../src/guestfs-actions.pod:4562 ../fish/guestfish-actions.pod:3099
15254 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
15259 #: ../src/guestfs-actions.pod:4564
15261 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
15262 "may get unexpected errors if you try to mix these calls. It is safest to "
15263 "manually unmount filesystems and remove mountpoints after use."
15268 #: ../src/guestfs-actions.pod:4568
15270 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
15271 "first, so for this to work for manual mountpoints, you must ensure that the "
15272 "innermost mountpoints have the longest pathnames, as in the example code "
15278 #: ../src/guestfs-actions.pod:4573 ../fish/guestfish-actions.pod:3110
15280 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
15284 #: ../src/guestfs-actions.pod:4575
15286 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
15287 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
15288 "can also trigger these issues."
15293 #: ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4847
15294 #: ../src/guestfs-actions.pod:5766
15295 msgid "(Added in 1.0.62)"
15300 #: ../src/guestfs-actions.pod:4583
15301 msgid "guestfs_mknod"
15306 #: ../src/guestfs-actions.pod:4585
15310 " guestfs_mknod (guestfs_h *g,\n"
15314 " const char *path);\n"
15320 #: ../src/guestfs-actions.pod:4592 ../fish/guestfish-actions.pod:3120
15322 "This call creates block or character special devices, or named pipes (FIFOs)."
15327 #: ../src/guestfs-actions.pod:4595 ../fish/guestfish-actions.pod:3123
15329 "The C<mode> parameter should be the mode, using the standard constants. "
15330 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
15331 "used when creating block and character special devices."
15336 #: ../src/guestfs-actions.pod:4600
15338 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
15339 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
15340 "regular file). These constants are available in the standard Linux header "
15341 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
15342 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
15343 "the appropriate constant for you."
15348 #: ../src/guestfs-actions.pod:4614
15349 msgid "guestfs_mknod_b"
15354 #: ../src/guestfs-actions.pod:4616
15358 " guestfs_mknod_b (guestfs_h *g,\n"
15362 " const char *path);\n"
15368 #: ../src/guestfs-actions.pod:4623
15370 "This call creates a block device node called C<path> with mode C<mode> and "
15371 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
15372 "wrapper around C<guestfs_mknod>."
15377 #: ../src/guestfs-actions.pod:4633
15378 msgid "guestfs_mknod_c"
15383 #: ../src/guestfs-actions.pod:4635
15387 " guestfs_mknod_c (guestfs_h *g,\n"
15391 " const char *path);\n"
15397 #: ../src/guestfs-actions.pod:4642
15399 "This call creates a char device node called C<path> with mode C<mode> and "
15400 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
15401 "wrapper around C<guestfs_mknod>."
15406 #: ../src/guestfs-actions.pod:4652
15407 msgid "guestfs_mkswap"
15412 #: ../src/guestfs-actions.pod:4654
15416 " guestfs_mkswap (guestfs_h *g,\n"
15417 " const char *device);\n"
15423 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3162
15424 msgid "Create a swap partition on C<device>."
15429 #: ../src/guestfs-actions.pod:4664
15430 msgid "guestfs_mkswap_L"
15435 #: ../src/guestfs-actions.pod:4666
15439 " guestfs_mkswap_L (guestfs_h *g,\n"
15440 " const char *label,\n"
15441 " const char *device);\n"
15447 #: ../src/guestfs-actions.pod:4671 ../fish/guestfish-actions.pod:3168
15448 msgid "Create a swap partition on C<device> with label C<label>."
15453 #: ../src/guestfs-actions.pod:4673 ../fish/guestfish-actions.pod:3170
15455 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
15456 "sda>), just to a partition. This appears to be a limitation of the kernel "
15462 #: ../src/guestfs-actions.pod:4681
15463 msgid "guestfs_mkswap_U"
15468 #: ../src/guestfs-actions.pod:4683
15472 " guestfs_mkswap_U (guestfs_h *g,\n"
15473 " const char *uuid,\n"
15474 " const char *device);\n"
15480 #: ../src/guestfs-actions.pod:4688 ../fish/guestfish-actions.pod:3178
15481 msgid "Create a swap partition on C<device> with UUID C<uuid>."
15486 #: ../src/guestfs-actions.pod:4694
15487 msgid "guestfs_mkswap_file"
15492 #: ../src/guestfs-actions.pod:4696
15496 " guestfs_mkswap_file (guestfs_h *g,\n"
15497 " const char *path);\n"
15503 #: ../src/guestfs-actions.pod:4700 ../fish/guestfish-actions.pod:3184
15504 msgid "Create a swap file."
15509 #: ../src/guestfs-actions.pod:4702
15511 "This command just writes a swap file signature to an existing file. To "
15512 "create the file itself, use something like C<guestfs_fallocate>."
15517 #: ../src/guestfs-actions.pod:4709
15518 msgid "guestfs_modprobe"
15523 #: ../src/guestfs-actions.pod:4711
15527 " guestfs_modprobe (guestfs_h *g,\n"
15528 " const char *modulename);\n"
15534 #: ../src/guestfs-actions.pod:4715 ../fish/guestfish-actions.pod:3193
15535 msgid "This loads a kernel module in the appliance."
15540 #: ../src/guestfs-actions.pod:4717 ../fish/guestfish-actions.pod:3195
15542 "The kernel module must have been whitelisted when libguestfs was built (see "
15543 "C<appliance/kmod.whitelist.in> in the source)."
15548 #: ../src/guestfs-actions.pod:4724
15549 msgid "guestfs_mount"
15554 #: ../src/guestfs-actions.pod:4726
15558 " guestfs_mount (guestfs_h *g,\n"
15559 " const char *device,\n"
15560 " const char *mountpoint);\n"
15566 #: ../src/guestfs-actions.pod:4731 ../fish/guestfish-actions.pod:3202
15568 "Mount a guest disk at a position in the filesystem. Block devices are named "
15569 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
15570 "those block devices contain partitions, they will have the usual names (eg. "
15571 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
15576 #: ../src/guestfs-actions.pod:4737 ../fish/guestfish-actions.pod:3208
15578 "The rules are the same as for L<mount(2)>: A filesystem must first be "
15579 "mounted on C</> before others can be mounted. Other filesystems can only be "
15580 "mounted on directories which already exist."
15585 #: ../src/guestfs-actions.pod:4742 ../fish/guestfish-actions.pod:3213
15587 "The mounted filesystem is writable, if we have sufficient permissions on the "
15588 "underlying device."
15593 #: ../src/guestfs-actions.pod:4745
15595 "B<Important note:> When you use this call, the filesystem options C<sync> "
15596 "and C<noatime> are set implicitly. This was originally done because we "
15597 "thought it would improve reliability, but it turns out that I<-o sync> has a "
15598 "very large negative performance impact and negligible effect on "
15599 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
15600 "in any code that needs performance, and instead use C<guestfs_mount_options> "
15601 "(use an empty string for the first parameter if you don't want any options)."
15605 #: ../src/guestfs-actions.pod:4757
15607 "This function is deprecated. In new code, use the L</guestfs_mount_options> "
15613 #: ../src/guestfs-actions.pod:4766
15614 msgid "guestfs_mount_loop"
15619 #: ../src/guestfs-actions.pod:4768
15623 " guestfs_mount_loop (guestfs_h *g,\n"
15624 " const char *file,\n"
15625 " const char *mountpoint);\n"
15631 #: ../src/guestfs-actions.pod:4773 ../fish/guestfish-actions.pod:3237
15633 "This command lets you mount C<file> (a filesystem image in a file) on a "
15634 "mount point. It is entirely equivalent to the command C<mount -o loop file "
15640 #: ../src/guestfs-actions.pod:4781
15641 msgid "guestfs_mount_options"
15646 #: ../src/guestfs-actions.pod:4783
15650 " guestfs_mount_options (guestfs_h *g,\n"
15651 " const char *options,\n"
15652 " const char *device,\n"
15653 " const char *mountpoint);\n"
15659 #: ../src/guestfs-actions.pod:4789
15661 "This is the same as the C<guestfs_mount> command, but it allows you to set "
15662 "the mount options as for the L<mount(8)> I<-o> flag."
15667 #: ../src/guestfs-actions.pod:4793 ../fish/guestfish-actions.pod:3249
15669 "If the C<options> parameter is an empty string, then no options are passed "
15670 "(all options default to whatever the filesystem uses)."
15675 #: ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4813
15676 #: ../src/guestfs-actions.pod:4830
15677 msgid "(Added in 1.0.10)"
15682 #: ../src/guestfs-actions.pod:4801
15683 msgid "guestfs_mount_ro"
15688 #: ../src/guestfs-actions.pod:4803
15692 " guestfs_mount_ro (guestfs_h *g,\n"
15693 " const char *device,\n"
15694 " const char *mountpoint);\n"
15700 #: ../src/guestfs-actions.pod:4808
15702 "This is the same as the C<guestfs_mount> command, but it mounts the "
15703 "filesystem with the read-only (I<-o ro>) flag."
15708 #: ../src/guestfs-actions.pod:4815
15709 msgid "guestfs_mount_vfs"
15714 #: ../src/guestfs-actions.pod:4817
15718 " guestfs_mount_vfs (guestfs_h *g,\n"
15719 " const char *options,\n"
15720 " const char *vfstype,\n"
15721 " const char *device,\n"
15722 " const char *mountpoint);\n"
15728 #: ../src/guestfs-actions.pod:4824
15730 "This is the same as the C<guestfs_mount> command, but it allows you to set "
15731 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
15737 #: ../src/guestfs-actions.pod:4832
15738 msgid "guestfs_mountpoints"
15743 #: ../src/guestfs-actions.pod:4834
15747 " guestfs_mountpoints (guestfs_h *g);\n"
15753 #: ../src/guestfs-actions.pod:4837
15755 "This call is similar to C<guestfs_mounts>. That call returns a list of "
15756 "devices. This one returns a hash table (map) of device name to directory "
15757 "where the device is mounted."
15762 #: ../src/guestfs-actions.pod:4849
15763 msgid "guestfs_mounts"
15768 #: ../src/guestfs-actions.pod:4851
15772 " guestfs_mounts (guestfs_h *g);\n"
15778 #: ../src/guestfs-actions.pod:4854 ../fish/guestfish-actions.pod:3280
15780 "This returns the list of currently mounted filesystems. It returns the list "
15781 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
15786 #: ../src/guestfs-actions.pod:4857 ../fish/guestfish-actions.pod:3283
15787 msgid "Some internal mounts are not shown."
15792 #: ../src/guestfs-actions.pod:4859
15793 msgid "See also: C<guestfs_mountpoints>"
15798 #: ../src/guestfs-actions.pod:4867
15804 #: ../src/guestfs-actions.pod:4869
15808 " guestfs_mv (guestfs_h *g,\n"
15809 " const char *src,\n"
15810 " const char *dest);\n"
15816 #: ../src/guestfs-actions.pod:4874 ../fish/guestfish-actions.pod:3291
15818 "This moves a file from C<src> to C<dest> where C<dest> is either a "
15819 "destination filename or destination directory."
15824 #: ../src/guestfs-actions.pod:4881
15825 msgid "guestfs_ntfs_3g_probe"
15830 #: ../src/guestfs-actions.pod:4883
15834 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
15836 " const char *device);\n"
15842 #: ../src/guestfs-actions.pod:4888 ../fish/guestfish-actions.pod:3298
15844 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
15845 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
15846 "write, and some cannot be mounted at all)."
15851 #: ../src/guestfs-actions.pod:4892 ../fish/guestfish-actions.pod:3302
15853 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
15854 "can be mounted read-write. Set it to false if you want to test if the "
15855 "volume can be mounted read-only."
15860 #: ../src/guestfs-actions.pod:4896 ../fish/guestfish-actions.pod:3306
15862 "The return value is an integer which C<0> if the operation would succeed, or "
15863 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
15868 #: ../src/guestfs-actions.pod:4902
15869 msgid "(Added in 1.0.43)"
15874 #: ../src/guestfs-actions.pod:4904
15875 msgid "guestfs_ntfsresize"
15880 #: ../src/guestfs-actions.pod:4906
15884 " guestfs_ntfsresize (guestfs_h *g,\n"
15885 " const char *device);\n"
15890 #: ../src/guestfs-actions.pod:4910 ../fish/guestfish-actions.pod:3314
15892 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
15893 "size of the underlying device."
15897 #: ../src/guestfs-actions.pod:4913 ../fish/guestfish-actions.pod:3317
15899 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
15900 "consistency check (for safety). You have to boot into Windows to perform "
15901 "this check and clear this condition. Furthermore, ntfsresize refuses to "
15902 "resize filesystems which have been marked in this way. So in effect it is "
15903 "not possible to call ntfsresize multiple times on a single filesystem "
15904 "without booting into Windows between each resize."
15908 #: ../src/guestfs-actions.pod:4921 ../fish/guestfish-actions.pod:3325
15909 msgid "See also L<ntfsresize(8)>."
15914 #: ../src/guestfs-actions.pod:4927
15915 msgid "guestfs_ntfsresize_size"
15920 #: ../src/guestfs-actions.pod:4929
15924 " guestfs_ntfsresize_size (guestfs_h *g,\n"
15925 " const char *device,\n"
15926 " int64_t size);\n"
15932 #: ../src/guestfs-actions.pod:4934
15934 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
15935 "to specify the new size (in bytes) explicitly."
15940 #: ../src/guestfs-actions.pod:4939 ../src/guestfs-actions.pod:5375
15941 #: ../src/guestfs-actions.pod:5448 ../src/guestfs-actions.pod:5714
15942 #: ../src/guestfs-actions.pod:7320
15943 msgid "(Added in 1.3.14)"
15948 #: ../src/guestfs-actions.pod:4941
15949 msgid "guestfs_part_add"
15954 #: ../src/guestfs-actions.pod:4943
15958 " guestfs_part_add (guestfs_h *g,\n"
15959 " const char *device,\n"
15960 " const char *prlogex,\n"
15961 " int64_t startsect,\n"
15962 " int64_t endsect);\n"
15968 #: ../src/guestfs-actions.pod:4950
15970 "This command adds a partition to C<device>. If there is no partition table "
15971 "on the device, call C<guestfs_part_init> first."
15976 #: ../src/guestfs-actions.pod:4953 ../fish/guestfish-actions.pod:3341
15978 "The C<prlogex> parameter is the type of partition. Normally you should pass "
15979 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
15980 "C<logical>) and C<e> (or C<extended>) partition types."
15985 #: ../src/guestfs-actions.pod:4958 ../fish/guestfish-actions.pod:3346
15987 "C<startsect> and C<endsect> are the start and end of the partition in "
15988 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
15989 "from the end of the disk (C<-1> is the last sector)."
15994 #: ../src/guestfs-actions.pod:4962
15996 "Creating a partition which covers the whole disk is not so easy. Use "
15997 "C<guestfs_part_disk> to do that."
16002 #: ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:5005
16003 #: ../src/guestfs-actions.pod:5058 ../src/guestfs-actions.pod:5136
16004 #: ../src/guestfs-actions.pod:5174 ../src/guestfs-actions.pod:5193
16005 #: ../src/guestfs-actions.pod:5233
16006 msgid "(Added in 1.0.78)"
16011 #: ../src/guestfs-actions.pod:4969
16012 msgid "guestfs_part_del"
16017 #: ../src/guestfs-actions.pod:4971
16021 " guestfs_part_del (guestfs_h *g,\n"
16022 " const char *device,\n"
16029 #: ../src/guestfs-actions.pod:4976 ../fish/guestfish-actions.pod:3357
16030 msgid "This command deletes the partition numbered C<partnum> on C<device>."
16035 #: ../src/guestfs-actions.pod:4978 ../fish/guestfish-actions.pod:3359
16037 "Note that in the case of MBR partitioning, deleting an extended partition "
16038 "also deletes any logical partitions it contains."
16043 #: ../src/guestfs-actions.pod:4986
16044 msgid "guestfs_part_disk"
16049 #: ../src/guestfs-actions.pod:4988
16053 " guestfs_part_disk (guestfs_h *g,\n"
16054 " const char *device,\n"
16055 " const char *parttype);\n"
16061 #: ../src/guestfs-actions.pod:4993
16063 "This command is simply a combination of C<guestfs_part_init> followed by "
16064 "C<guestfs_part_add> to create a single primary partition covering the whole "
16070 #: ../src/guestfs-actions.pod:4997
16072 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
16073 "possible values are described in C<guestfs_part_init>."
16078 #: ../src/guestfs-actions.pod:5007
16079 msgid "guestfs_part_get_bootable"
16084 #: ../src/guestfs-actions.pod:5009
16088 " guestfs_part_get_bootable (guestfs_h *g,\n"
16089 " const char *device,\n"
16096 #: ../src/guestfs-actions.pod:5014 ../fish/guestfish-actions.pod:3381
16098 "This command returns true if the partition C<partnum> on C<device> has the "
16099 "bootable flag set."
16104 #: ../src/guestfs-actions.pod:5017
16105 msgid "See also C<guestfs_part_set_bootable>."
16110 #: ../src/guestfs-actions.pod:5023
16111 msgid "guestfs_part_get_mbr_id"
16116 #: ../src/guestfs-actions.pod:5025
16120 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
16121 " const char *device,\n"
16128 #: ../src/guestfs-actions.pod:5030 ../fish/guestfish-actions.pod:3390
16130 "Returns the MBR type byte (also known as the ID byte) from the numbered "
16131 "partition C<partnum>."
16136 #: ../src/guestfs-actions.pod:5033 ../src/guestfs-actions.pod:5209
16138 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
16139 "undefined results for other partition table types (see "
16140 "C<guestfs_part_get_parttype>)."
16145 #: ../src/guestfs-actions.pod:5041
16146 msgid "guestfs_part_get_parttype"
16151 #: ../src/guestfs-actions.pod:5043
16155 " guestfs_part_get_parttype (guestfs_h *g,\n"
16156 " const char *device);\n"
16162 #: ../src/guestfs-actions.pod:5047 ../fish/guestfish-actions.pod:3401
16164 "This command examines the partition table on C<device> and returns the "
16165 "partition table type (format) being used."
16170 #: ../src/guestfs-actions.pod:5050
16172 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
16173 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
16174 "possible, although unusual. See C<guestfs_part_init> for a full list."
16179 #: ../src/guestfs-actions.pod:5060
16180 msgid "guestfs_part_init"
16185 #: ../src/guestfs-actions.pod:5062
16189 " guestfs_part_init (guestfs_h *g,\n"
16190 " const char *device,\n"
16191 " const char *parttype);\n"
16197 #: ../src/guestfs-actions.pod:5067 ../fish/guestfish-actions.pod:3413
16199 "This creates an empty partition table on C<device> of one of the partition "
16200 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
16201 "(for large disks)."
16206 #: ../src/guestfs-actions.pod:5071
16208 "Initially there are no partitions. Following this, you should call "
16209 "C<guestfs_part_add> for each partition required."
16214 #: ../src/guestfs-actions.pod:5074 ../fish/guestfish-actions.pod:3420
16215 msgid "Possible values for C<parttype> are:"
16220 #: ../src/guestfs-actions.pod:5078 ../fish/guestfish-actions.pod:3424
16221 msgid "B<efi> | B<gpt>"
16226 #: ../src/guestfs-actions.pod:5080 ../fish/guestfish-actions.pod:3426
16227 msgid "Intel EFI / GPT partition table."
16232 #: ../src/guestfs-actions.pod:5082 ../fish/guestfish-actions.pod:3428
16234 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
16235 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
16236 "the C<mbr> format."
16241 #: ../src/guestfs-actions.pod:5086 ../fish/guestfish-actions.pod:3432
16242 msgid "B<mbr> | B<msdos>"
16247 #: ../src/guestfs-actions.pod:5088 ../fish/guestfish-actions.pod:3434
16249 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
16250 "Windows. This partition type will B<only> work for device sizes up to 2 "
16251 "TB. For large disks we recommend using C<gpt>."
16256 #: ../src/guestfs-actions.pod:5095 ../fish/guestfish-actions.pod:3441
16258 "Other partition table types that may work but are not supported include:"
16263 #: ../src/guestfs-actions.pod:5100 ../fish/guestfish-actions.pod:3446
16269 #: ../src/guestfs-actions.pod:5102 ../fish/guestfish-actions.pod:3448
16270 msgid "AIX disk labels."
16275 #: ../src/guestfs-actions.pod:5104 ../fish/guestfish-actions.pod:3450
16276 msgid "B<amiga> | B<rdb>"
16281 #: ../src/guestfs-actions.pod:5106 ../fish/guestfish-actions.pod:3452
16282 msgid "Amiga \"Rigid Disk Block\" format."
16287 #: ../src/guestfs-actions.pod:5108 ../fish/guestfish-actions.pod:3454
16293 #: ../src/guestfs-actions.pod:5110 ../fish/guestfish-actions.pod:3456
16294 msgid "BSD disk labels."
16299 #: ../src/guestfs-actions.pod:5112 ../fish/guestfish-actions.pod:3458
16305 #: ../src/guestfs-actions.pod:5114 ../fish/guestfish-actions.pod:3460
16306 msgid "DASD, used on IBM mainframes."
16311 #: ../src/guestfs-actions.pod:5116 ../fish/guestfish-actions.pod:3462
16317 #: ../src/guestfs-actions.pod:5118 ../fish/guestfish-actions.pod:3464
16318 msgid "MIPS/SGI volumes."
16323 #: ../src/guestfs-actions.pod:5120 ../fish/guestfish-actions.pod:3466
16329 #: ../src/guestfs-actions.pod:5122 ../fish/guestfish-actions.pod:3468
16330 msgid "Old Mac partition format. Modern Macs use C<gpt>."
16335 #: ../src/guestfs-actions.pod:5124 ../fish/guestfish-actions.pod:3470
16341 #: ../src/guestfs-actions.pod:5126 ../fish/guestfish-actions.pod:3472
16342 msgid "NEC PC-98 format, common in Japan apparently."
16347 #: ../src/guestfs-actions.pod:5128 ../fish/guestfish-actions.pod:3474
16353 #: ../src/guestfs-actions.pod:5130 ../fish/guestfish-actions.pod:3476
16354 msgid "Sun disk labels."
16359 #: ../src/guestfs-actions.pod:5138
16360 msgid "guestfs_part_list"
16365 #: ../src/guestfs-actions.pod:5140
16368 " struct guestfs_partition_list *\n"
16369 " guestfs_part_list (guestfs_h *g,\n"
16370 " const char *device);\n"
16376 #: ../src/guestfs-actions.pod:5144 ../fish/guestfish-actions.pod:3484
16378 "This command parses the partition table on C<device> and returns the list of "
16379 "partitions found."
16384 #: ../src/guestfs-actions.pod:5147 ../fish/guestfish-actions.pod:3487
16385 msgid "The fields in the returned structure are:"
16390 #: ../src/guestfs-actions.pod:5151 ../fish/guestfish-actions.pod:3491
16391 msgid "B<part_num>"
16396 #: ../src/guestfs-actions.pod:5153 ../fish/guestfish-actions.pod:3493
16397 msgid "Partition number, counting from 1."
16402 #: ../src/guestfs-actions.pod:5155 ../fish/guestfish-actions.pod:3495
16403 msgid "B<part_start>"
16408 #: ../src/guestfs-actions.pod:5157
16410 "Start of the partition I<in bytes>. To get sectors you have to divide by "
16411 "the device's sector size, see C<guestfs_blockdev_getss>."
16416 #: ../src/guestfs-actions.pod:5160 ../fish/guestfish-actions.pod:3500
16417 msgid "B<part_end>"
16422 #: ../src/guestfs-actions.pod:5162 ../fish/guestfish-actions.pod:3502
16423 msgid "End of the partition in bytes."
16428 #: ../src/guestfs-actions.pod:5164 ../fish/guestfish-actions.pod:3504
16429 msgid "B<part_size>"
16434 #: ../src/guestfs-actions.pod:5166 ../fish/guestfish-actions.pod:3506
16435 msgid "Size of the partition in bytes."
16440 #: ../src/guestfs-actions.pod:5170
16442 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
16443 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
16449 #: ../src/guestfs-actions.pod:5176
16450 msgid "guestfs_part_set_bootable"
16455 #: ../src/guestfs-actions.pod:5178
16459 " guestfs_part_set_bootable (guestfs_h *g,\n"
16460 " const char *device,\n"
16462 " int bootable);\n"
16468 #: ../src/guestfs-actions.pod:5184 ../fish/guestfish-actions.pod:3514
16470 "This sets the bootable flag on partition numbered C<partnum> on device "
16471 "C<device>. Note that partitions are numbered from 1."
16476 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:3517
16478 "The bootable flag is used by some operating systems (notably Windows) to "
16479 "determine which partition to boot from. It is by no means universally "
16485 #: ../src/guestfs-actions.pod:5195
16486 msgid "guestfs_part_set_mbr_id"
16491 #: ../src/guestfs-actions.pod:5197
16495 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
16496 " const char *device,\n"
16504 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:3525
16506 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
16507 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
16508 "documentation are in fact hexadecimal numbers, but usually documented "
16509 "without any leading \"0x\" which might be confusing."
16514 #: ../src/guestfs-actions.pod:5217
16515 msgid "guestfs_part_set_name"
16520 #: ../src/guestfs-actions.pod:5219
16524 " guestfs_part_set_name (guestfs_h *g,\n"
16525 " const char *device,\n"
16527 " const char *name);\n"
16533 #: ../src/guestfs-actions.pod:5225 ../fish/guestfish-actions.pod:3539
16535 "This sets the partition name on partition numbered C<partnum> on device "
16536 "C<device>. Note that partitions are numbered from 1."
16541 #: ../src/guestfs-actions.pod:5228 ../fish/guestfish-actions.pod:3542
16543 "The partition name can only be set on certain types of partition table. "
16544 "This works on C<gpt> but not on C<mbr> partitions."
16549 #: ../src/guestfs-actions.pod:5235
16550 msgid "guestfs_part_to_dev"
16555 #: ../src/guestfs-actions.pod:5237
16559 " guestfs_part_to_dev (guestfs_h *g,\n"
16560 " const char *partition);\n"
16566 #: ../src/guestfs-actions.pod:5241 ../fish/guestfish-actions.pod:3549
16568 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
16569 "partition number, returning the device name (eg. \"/dev/sdb\")."
16574 #: ../src/guestfs-actions.pod:5245
16576 "The named partition must exist, for example as a string returned from "
16577 "C<guestfs_list_partitions>."
16582 #: ../src/guestfs-actions.pod:5253
16583 msgid "guestfs_ping_daemon"
16588 #: ../src/guestfs-actions.pod:5255
16592 " guestfs_ping_daemon (guestfs_h *g);\n"
16598 #: ../src/guestfs-actions.pod:5258 ../fish/guestfish-actions.pod:3560
16600 "This is a test probe into the guestfs daemon running inside the qemu "
16601 "subprocess. Calling this function checks that the daemon responds to the "
16602 "ping message, without affecting the daemon or attached block device(s) in "
16608 #: ../src/guestfs-actions.pod:5267
16609 msgid "guestfs_pread"
16614 #: ../src/guestfs-actions.pod:5269
16618 " guestfs_pread (guestfs_h *g,\n"
16619 " const char *path,\n"
16621 " int64_t offset,\n"
16622 " size_t *size_r);\n"
16628 #: ../src/guestfs-actions.pod:5276 ../fish/guestfish-actions.pod:3569
16630 "This command lets you read part of a file. It reads C<count> bytes of the "
16631 "file, starting at C<offset>, from file C<path>."
16636 #: ../src/guestfs-actions.pod:5279 ../src/guestfs-actions.pod:5305
16637 #: ../fish/guestfish-actions.pod:3572 ../fish/guestfish-actions.pod:3587
16639 "This may read fewer bytes than requested. For further details see the "
16640 "L<pread(2)> system call."
16645 #: ../src/guestfs-actions.pod:5282
16646 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
16651 #: ../src/guestfs-actions.pod:5293
16652 msgid "guestfs_pread_device"
16657 #: ../src/guestfs-actions.pod:5295
16661 " guestfs_pread_device (guestfs_h *g,\n"
16662 " const char *device,\n"
16664 " int64_t offset,\n"
16665 " size_t *size_r);\n"
16671 #: ../src/guestfs-actions.pod:5302 ../fish/guestfish-actions.pod:3584
16673 "This command lets you read part of a file. It reads C<count> bytes of "
16674 "C<device>, starting at C<offset>."
16679 #: ../src/guestfs-actions.pod:5308
16680 msgid "See also C<guestfs_pread>."
16685 #: ../src/guestfs-actions.pod:5317
16686 msgid "(Added in 1.5.21)"
16691 #: ../src/guestfs-actions.pod:5319
16692 msgid "guestfs_pvcreate"
16697 #: ../src/guestfs-actions.pod:5321
16701 " guestfs_pvcreate (guestfs_h *g,\n"
16702 " const char *device);\n"
16708 #: ../src/guestfs-actions.pod:5325 ../fish/guestfish-actions.pod:3599
16710 "This creates an LVM physical volume on the named C<device>, where C<device> "
16711 "should usually be a partition name such as C</dev/sda1>."
16716 #: ../src/guestfs-actions.pod:5333
16717 msgid "guestfs_pvremove"
16722 #: ../src/guestfs-actions.pod:5335
16726 " guestfs_pvremove (guestfs_h *g,\n"
16727 " const char *device);\n"
16733 #: ../src/guestfs-actions.pod:5339 ../fish/guestfish-actions.pod:3607
16735 "This wipes a physical volume C<device> so that LVM will no longer recognise "
16741 #: ../src/guestfs-actions.pod:5342 ../fish/guestfish-actions.pod:3610
16743 "The implementation uses the C<pvremove> command which refuses to wipe "
16744 "physical volumes that contain any volume groups, so you have to remove those "
16750 #: ../src/guestfs-actions.pod:5350
16751 msgid "guestfs_pvresize"
16756 #: ../src/guestfs-actions.pod:5352
16760 " guestfs_pvresize (guestfs_h *g,\n"
16761 " const char *device);\n"
16767 #: ../src/guestfs-actions.pod:5356 ../fish/guestfish-actions.pod:3618
16769 "This resizes (expands or shrinks) an existing LVM physical volume to match "
16770 "the new size of the underlying device."
16775 #: ../src/guestfs-actions.pod:5363
16776 msgid "guestfs_pvresize_size"
16781 #: ../src/guestfs-actions.pod:5365
16785 " guestfs_pvresize_size (guestfs_h *g,\n"
16786 " const char *device,\n"
16787 " int64_t size);\n"
16793 #: ../src/guestfs-actions.pod:5370
16795 "This command is the same as C<guestfs_pvresize> except that it allows you to "
16796 "specify the new size (in bytes) explicitly."
16801 #: ../src/guestfs-actions.pod:5377
16802 msgid "guestfs_pvs"
16807 #: ../src/guestfs-actions.pod:5379
16811 " guestfs_pvs (guestfs_h *g);\n"
16817 #: ../src/guestfs-actions.pod:5382 ../fish/guestfish-actions.pod:3632
16819 "List all the physical volumes detected. This is the equivalent of the L<pvs"
16825 #: ../src/guestfs-actions.pod:5385 ../fish/guestfish-actions.pod:3635
16827 "This returns a list of just the device names that contain PVs (eg. C</dev/"
16833 #: ../src/guestfs-actions.pod:5388
16834 msgid "See also C<guestfs_pvs_full>."
16839 #: ../src/guestfs-actions.pod:5396
16840 msgid "guestfs_pvs_full"
16845 #: ../src/guestfs-actions.pod:5398
16848 " struct guestfs_lvm_pv_list *\n"
16849 " guestfs_pvs_full (guestfs_h *g);\n"
16855 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3644
16857 "List all the physical volumes detected. This is the equivalent of the L<pvs"
16858 "(8)> command. The \"full\" version includes all fields."
16863 #: ../src/guestfs-actions.pod:5404
16865 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
16866 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
16871 #: ../src/guestfs-actions.pod:5410
16872 msgid "guestfs_pvuuid"
16877 #: ../src/guestfs-actions.pod:5412
16881 " guestfs_pvuuid (guestfs_h *g,\n"
16882 " const char *device);\n"
16888 #: ../src/guestfs-actions.pod:5416 ../fish/guestfish-actions.pod:3651
16889 msgid "This command returns the UUID of the LVM PV C<device>."
16894 #: ../src/guestfs-actions.pod:5423
16895 msgid "guestfs_pwrite"
16900 #: ../src/guestfs-actions.pod:5425
16904 " guestfs_pwrite (guestfs_h *g,\n"
16905 " const char *path,\n"
16906 " const char *content,\n"
16907 " size_t content_size,\n"
16908 " int64_t offset);\n"
16914 #: ../src/guestfs-actions.pod:5432 ../fish/guestfish-actions.pod:3657
16916 "This command writes to part of a file. It writes the data buffer C<content> "
16917 "to the file C<path> starting at offset C<offset>."
16922 #: ../src/guestfs-actions.pod:5435 ../fish/guestfish-actions.pod:3660
16924 "This command implements the L<pwrite(2)> system call, and like that system "
16925 "call it may not write the full data requested. The return value is the "
16926 "number of bytes that were actually written to the file. This could even be "
16927 "0, although short writes are unlikely for regular files in ordinary "
16933 #: ../src/guestfs-actions.pod:5441
16934 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
16939 #: ../src/guestfs-actions.pod:5450
16940 msgid "guestfs_pwrite_device"
16945 #: ../src/guestfs-actions.pod:5452
16949 " guestfs_pwrite_device (guestfs_h *g,\n"
16950 " const char *device,\n"
16951 " const char *content,\n"
16952 " size_t content_size,\n"
16953 " int64_t offset);\n"
16959 #: ../src/guestfs-actions.pod:5459 ../fish/guestfish-actions.pod:3675
16961 "This command writes to part of a device. It writes the data buffer "
16962 "C<content> to C<device> starting at offset C<offset>."
16967 #: ../src/guestfs-actions.pod:5462 ../fish/guestfish-actions.pod:3678
16969 "This command implements the L<pwrite(2)> system call, and like that system "
16970 "call it may not write the full data requested (although short writes to disk "
16971 "devices and partitions are probably impossible with standard Linux kernels)."
16976 #: ../src/guestfs-actions.pod:5467
16977 msgid "See also C<guestfs_pwrite>."
16982 #: ../src/guestfs-actions.pod:5474
16983 msgid "(Added in 1.5.20)"
16988 #: ../src/guestfs-actions.pod:5476
16989 msgid "guestfs_read_file"
16994 #: ../src/guestfs-actions.pod:5478
16998 " guestfs_read_file (guestfs_h *g,\n"
16999 " const char *path,\n"
17000 " size_t *size_r);\n"
17006 #: ../src/guestfs-actions.pod:5483 ../fish/guestfish-actions.pod:3692
17007 msgid "This calls returns the contents of the file C<path> as a buffer."
17012 #: ../src/guestfs-actions.pod:5486
17014 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
17015 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
17016 "function is limited in the total size of file that can be handled."
17021 #: ../src/guestfs-actions.pod:5498
17022 msgid "(Added in 1.0.63)"
17027 #: ../src/guestfs-actions.pod:5500
17028 msgid "guestfs_read_lines"
17033 #: ../src/guestfs-actions.pod:5502
17037 " guestfs_read_lines (guestfs_h *g,\n"
17038 " const char *path);\n"
17044 #: ../src/guestfs-actions.pod:5508 ../fish/guestfish-actions.pod:3709
17046 "The file contents are returned as a list of lines. Trailing C<LF> and "
17047 "C<CRLF> character sequences are I<not> returned."
17052 #: ../src/guestfs-actions.pod:5511
17054 "Note that this function cannot correctly handle binary files (specifically, "
17055 "files containing C<\\0> character which is treated as end of line). For "
17056 "those you need to use the C<guestfs_read_file> function which has a more "
17057 "complex interface."
17062 #: ../src/guestfs-actions.pod:5522
17063 msgid "guestfs_readdir"
17068 #: ../src/guestfs-actions.pod:5524
17071 " struct guestfs_dirent_list *\n"
17072 " guestfs_readdir (guestfs_h *g,\n"
17073 " const char *dir);\n"
17079 #: ../src/guestfs-actions.pod:5528 ../fish/guestfish-actions.pod:3721
17080 msgid "This returns the list of directory entries in directory C<dir>."
17085 #: ../src/guestfs-actions.pod:5530 ../fish/guestfish-actions.pod:3723
17087 "All entries in the directory are returned, including C<.> and C<..>. The "
17088 "entries are I<not> sorted, but returned in the same order as the underlying "
17094 #: ../src/guestfs-actions.pod:5534 ../fish/guestfish-actions.pod:3727
17096 "Also this call returns basic file type information about each file. The "
17097 "C<ftyp> field will contain one of the following characters:"
17102 #: ../src/guestfs-actions.pod:5539 ../fish/guestfish-actions.pod:3732
17108 #: ../src/guestfs-actions.pod:5541 ../fish/guestfish-actions.pod:3734
17109 msgid "Block special"
17114 #: ../src/guestfs-actions.pod:5543 ../fish/guestfish-actions.pod:3736
17120 #: ../src/guestfs-actions.pod:5545 ../fish/guestfish-actions.pod:3738
17121 msgid "Char special"
17126 #: ../src/guestfs-actions.pod:5547 ../fish/guestfish-actions.pod:3740
17132 #: ../src/guestfs-actions.pod:5549 ../fish/guestfish-actions.pod:3742
17138 #: ../src/guestfs-actions.pod:5551 ../fish/guestfish-actions.pod:3744
17144 #: ../src/guestfs-actions.pod:5553 ../fish/guestfish-actions.pod:3746
17145 msgid "FIFO (named pipe)"
17150 #: ../src/guestfs-actions.pod:5555 ../fish/guestfish-actions.pod:3748
17156 #: ../src/guestfs-actions.pod:5557 ../fish/guestfish-actions.pod:3750
17157 msgid "Symbolic link"
17162 #: ../src/guestfs-actions.pod:5559 ../fish/guestfish-actions.pod:3752
17168 #: ../src/guestfs-actions.pod:5561 ../fish/guestfish-actions.pod:3754
17169 msgid "Regular file"
17174 #: ../src/guestfs-actions.pod:5563 ../fish/guestfish-actions.pod:3756
17180 #: ../src/guestfs-actions.pod:5565 ../fish/guestfish-actions.pod:3758
17186 #: ../src/guestfs-actions.pod:5567 ../fish/guestfish-actions.pod:3760
17192 #: ../src/guestfs-actions.pod:5569 ../fish/guestfish-actions.pod:3762
17193 msgid "Unknown file type"
17198 #: ../src/guestfs-actions.pod:5571 ../fish/guestfish-actions.pod:3764
17204 #: ../src/guestfs-actions.pod:5573 ../fish/guestfish-actions.pod:3766
17206 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
17211 #: ../src/guestfs-actions.pod:5578
17213 "This function is primarily intended for use by programs. To get a simple "
17214 "list of names, use C<guestfs_ls>. To get a printable directory for human "
17215 "consumption, use C<guestfs_ll>."
17220 #: ../src/guestfs-actions.pod:5582
17222 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
17223 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
17228 #: ../src/guestfs-actions.pod:5588
17229 msgid "guestfs_readlink"
17234 #: ../src/guestfs-actions.pod:5590
17238 " guestfs_readlink (guestfs_h *g,\n"
17239 " const char *path);\n"
17245 #: ../src/guestfs-actions.pod:5594 ../fish/guestfish-actions.pod:3779
17246 msgid "This command reads the target of a symbolic link."
17251 #: ../src/guestfs-actions.pod:5601
17252 msgid "guestfs_readlinklist"
17257 #: ../src/guestfs-actions.pod:5603
17261 " guestfs_readlinklist (guestfs_h *g,\n"
17262 " const char *path,\n"
17263 " char *const *names);\n"
17269 #: ../src/guestfs-actions.pod:5608 ../fish/guestfish-actions.pod:3785
17271 "This call allows you to do a C<readlink> operation on multiple files, where "
17272 "all files are in the directory C<path>. C<names> is the list of files from "
17278 #: ../src/guestfs-actions.pod:5612 ../fish/guestfish-actions.pod:3789
17280 "On return you get a list of strings, with a one-to-one correspondence to the "
17281 "C<names> list. Each string is the value of the symbolic link."
17286 #: ../src/guestfs-actions.pod:5616 ../fish/guestfish-actions.pod:3793
17288 "If the C<readlink(2)> operation fails on any name, then the corresponding "
17289 "result string is the empty string C<\"\">. However the whole operation is "
17290 "completed even if there were C<readlink(2)> errors, and so you can call this "
17291 "function with names where you don't know if they are symbolic links already "
17292 "(albeit slightly less efficient)."
17297 #: ../src/guestfs-actions.pod:5623 ../fish/guestfish-actions.pod:3800
17299 "This call is intended for programs that want to efficiently list a directory "
17300 "contents without making many round-trips. Very long directory listings "
17301 "might cause the protocol message size to be exceeded, causing this call to "
17302 "fail. The caller must split up such requests into smaller groups of names."
17307 #: ../src/guestfs-actions.pod:5636
17308 msgid "guestfs_realpath"
17313 #: ../src/guestfs-actions.pod:5638
17317 " guestfs_realpath (guestfs_h *g,\n"
17318 " const char *path);\n"
17324 #: ../src/guestfs-actions.pod:5642 ../fish/guestfish-actions.pod:3811
17326 "Return the canonicalized absolute pathname of C<path>. The returned path "
17327 "has no C<.>, C<..> or symbolic link path elements."
17332 #: ../src/guestfs-actions.pod:5650
17333 msgid "guestfs_removexattr"
17338 #: ../src/guestfs-actions.pod:5652
17342 " guestfs_removexattr (guestfs_h *g,\n"
17343 " const char *xattr,\n"
17344 " const char *path);\n"
17350 #: ../src/guestfs-actions.pod:5657 ../fish/guestfish-actions.pod:3818
17352 "This call removes the extended attribute named C<xattr> of the file C<path>."
17357 #: ../src/guestfs-actions.pod:5660
17358 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
17363 #: ../src/guestfs-actions.pod:5666
17364 msgid "guestfs_resize2fs"
17369 #: ../src/guestfs-actions.pod:5668
17373 " guestfs_resize2fs (guestfs_h *g,\n"
17374 " const char *device);\n"
17380 #: ../src/guestfs-actions.pod:5672 ../fish/guestfish-actions.pod:3827
17382 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
17383 "underlying device."
17388 #: ../src/guestfs-actions.pod:5675
17390 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
17391 "C<device> before calling this command. For unknown reasons C<resize2fs> "
17392 "sometimes gives an error about this and sometimes not. In any case, it is "
17393 "always safe to call C<guestfs_e2fsck_f> before calling this function."
17397 #: ../src/guestfs-actions.pod:5685
17398 msgid "guestfs_resize2fs_M"
17402 #: ../src/guestfs-actions.pod:5687
17406 " guestfs_resize2fs_M (guestfs_h *g,\n"
17407 " const char *device);\n"
17412 #: ../src/guestfs-actions.pod:5691
17414 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
17415 "resized to its minimum size. This works like the I<-M> option to the "
17416 "C<resize2fs> command."
17420 #: ../src/guestfs-actions.pod:5695
17422 "To get the resulting size of the filesystem you should call "
17423 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
17424 "These two numbers, multiplied together, give the resulting size of the "
17425 "minimal filesystem in bytes."
17430 #: ../src/guestfs-actions.pod:5702
17431 msgid "guestfs_resize2fs_size"
17436 #: ../src/guestfs-actions.pod:5704
17440 " guestfs_resize2fs_size (guestfs_h *g,\n"
17441 " const char *device,\n"
17442 " int64_t size);\n"
17448 #: ../src/guestfs-actions.pod:5709
17450 "This command is the same as C<guestfs_resize2fs> except that it allows you "
17451 "to specify the new size (in bytes) explicitly."
17456 #: ../src/guestfs-actions.pod:5716
17462 #: ../src/guestfs-actions.pod:5718
17466 " guestfs_rm (guestfs_h *g,\n"
17467 " const char *path);\n"
17473 #: ../src/guestfs-actions.pod:5722 ../fish/guestfish-actions.pod:3860
17474 msgid "Remove the single file C<path>."
17479 #: ../src/guestfs-actions.pod:5728
17480 msgid "guestfs_rm_rf"
17485 #: ../src/guestfs-actions.pod:5730
17489 " guestfs_rm_rf (guestfs_h *g,\n"
17490 " const char *path);\n"
17496 #: ../src/guestfs-actions.pod:5734 ../fish/guestfish-actions.pod:3866
17498 "Remove the file or directory C<path>, recursively removing the contents if "
17499 "its a directory. This is like the C<rm -rf> shell command."
17504 #: ../src/guestfs-actions.pod:5742
17505 msgid "guestfs_rmdir"
17510 #: ../src/guestfs-actions.pod:5744
17514 " guestfs_rmdir (guestfs_h *g,\n"
17515 " const char *path);\n"
17521 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:3874
17522 msgid "Remove the single directory C<path>."
17527 #: ../src/guestfs-actions.pod:5754
17528 msgid "guestfs_rmmountpoint"
17533 #: ../src/guestfs-actions.pod:5756
17537 " guestfs_rmmountpoint (guestfs_h *g,\n"
17538 " const char *exemptpath);\n"
17544 #: ../src/guestfs-actions.pod:5760
17546 "This calls removes a mountpoint that was previously created with "
17547 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
17552 #: ../src/guestfs-actions.pod:5768
17553 msgid "guestfs_scrub_device"
17558 #: ../src/guestfs-actions.pod:5770
17562 " guestfs_scrub_device (guestfs_h *g,\n"
17563 " const char *device);\n"
17569 #: ../src/guestfs-actions.pod:5774 ../fish/guestfish-actions.pod:3888
17571 "This command writes patterns over C<device> to make data retrieval more "
17577 #: ../src/guestfs-actions.pod:5777 ../src/guestfs-actions.pod:5798
17578 #: ../src/guestfs-actions.pod:5817 ../fish/guestfish-actions.pod:3891
17579 #: ../fish/guestfish-actions.pod:3906 ../fish/guestfish-actions.pod:3919
17581 "It is an interface to the L<scrub(1)> program. See that manual page for "
17587 #: ../src/guestfs-actions.pod:5785 ../src/guestfs-actions.pod:5803
17588 #: ../src/guestfs-actions.pod:5822
17589 msgid "(Added in 1.0.52)"
17594 #: ../src/guestfs-actions.pod:5787
17595 msgid "guestfs_scrub_file"
17600 #: ../src/guestfs-actions.pod:5789
17604 " guestfs_scrub_file (guestfs_h *g,\n"
17605 " const char *file);\n"
17611 #: ../src/guestfs-actions.pod:5793 ../fish/guestfish-actions.pod:3901
17613 "This command writes patterns over a file to make data retrieval more "
17619 #: ../src/guestfs-actions.pod:5796 ../fish/guestfish-actions.pod:3904
17620 msgid "The file is I<removed> after scrubbing."
17625 #: ../src/guestfs-actions.pod:5805
17626 msgid "guestfs_scrub_freespace"
17631 #: ../src/guestfs-actions.pod:5807
17635 " guestfs_scrub_freespace (guestfs_h *g,\n"
17636 " const char *dir);\n"
17642 #: ../src/guestfs-actions.pod:5811
17644 "This command creates the directory C<dir> and then fills it with files until "
17645 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
17646 "and deletes them. The intention is to scrub any free space on the partition "
17647 "containing C<dir>."
17652 #: ../src/guestfs-actions.pod:5824
17653 msgid "guestfs_set_append"
17658 #: ../src/guestfs-actions.pod:5826
17662 " guestfs_set_append (guestfs_h *g,\n"
17663 " const char *append);\n"
17669 #: ../src/guestfs-actions.pod:5830 ../fish/guestfish-actions.pod:3928
17671 "This function is used to add additional options to the guest kernel command "
17677 #: ../src/guestfs-actions.pod:5833 ../fish/guestfish-actions.pod:3931
17679 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
17680 "environment variable."
17685 #: ../src/guestfs-actions.pod:5836 ../fish/guestfish-actions.pod:3934
17687 "Setting C<append> to C<NULL> means I<no> additional options are passed "
17688 "(libguestfs always adds a few of its own)."
17692 #: ../src/guestfs-actions.pod:5843
17693 msgid "guestfs_set_attach_method"
17697 #: ../src/guestfs-actions.pod:5845
17701 " guestfs_set_attach_method (guestfs_h *g,\n"
17702 " const char *attachmethod);\n"
17707 #: ../src/guestfs-actions.pod:5849 ../fish/guestfish-actions.pod:3943
17709 "Set the method that libguestfs uses to connect to the back end guestfsd "
17710 "daemon. Possible methods are:"
17714 #: ../src/guestfs-actions.pod:5856 ../fish/guestfish-actions.pod:3950
17716 "Launch an appliance and connect to it. This is the ordinary method and the "
17721 #: ../src/guestfs-actions.pod:5859 ../fish/guestfish-actions.pod:3953
17722 msgid "C<unix:I<path>>"
17726 #: ../src/guestfs-actions.pod:5861 ../fish/guestfish-actions.pod:3955
17727 msgid "Connect to the Unix domain socket I<path>."
17731 #: ../src/guestfs-actions.pod:5863 ../fish/guestfish-actions.pod:3957
17733 "This method lets you connect to an existing daemon or (using virtio-serial) "
17734 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
17735 "RUNNING DAEMONS>."
17740 #: ../src/guestfs-actions.pod:5871
17741 msgid "guestfs_set_autosync"
17746 #: ../src/guestfs-actions.pod:5873
17750 " guestfs_set_autosync (guestfs_h *g,\n"
17751 " int autosync);\n"
17756 #: ../src/guestfs-actions.pod:5877 ../fish/guestfish-actions.pod:3969
17758 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
17759 "effort attempt to make filesystems consistent and synchronized when the "
17760 "handle is closed (also if the program exits without closing handles)."
17765 #: ../src/guestfs-actions.pod:5882 ../fish/guestfish-actions.pod:3974
17767 "This is enabled by default (since libguestfs 1.5.24, previously it was "
17768 "disabled by default)."
17773 #: ../src/guestfs-actions.pod:5889
17774 msgid "guestfs_set_direct"
17779 #: ../src/guestfs-actions.pod:5891
17783 " guestfs_set_direct (guestfs_h *g,\n"
17790 #: ../src/guestfs-actions.pod:5895 ../fish/guestfish-actions.pod:3983
17792 "If the direct appliance mode flag is enabled, then stdin and stdout are "
17793 "passed directly through to the appliance once it is launched."
17798 #: ../src/guestfs-actions.pod:5899
17800 "One consequence of this is that log messages aren't caught by the library "
17801 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
17807 #: ../src/guestfs-actions.pod:5903 ../fish/guestfish-actions.pod:3991
17808 msgid "You probably don't want to use this unless you know what you are doing."
17813 #: ../src/guestfs-actions.pod:5906 ../fish/guestfish-actions.pod:3994
17814 msgid "The default is disabled."
17819 #: ../src/guestfs-actions.pod:5912
17820 msgid "guestfs_set_e2label"
17825 #: ../src/guestfs-actions.pod:5914
17829 " guestfs_set_e2label (guestfs_h *g,\n"
17830 " const char *device,\n"
17831 " const char *label);\n"
17837 #: ../src/guestfs-actions.pod:5919 ../fish/guestfish-actions.pod:4000
17839 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
17840 "C<label>. Filesystem labels are limited to 16 characters."
17845 #: ../src/guestfs-actions.pod:5923
17847 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
17848 "the existing label on a filesystem."
17853 #: ../src/guestfs-actions.pod:5930
17854 msgid "guestfs_set_e2uuid"
17859 #: ../src/guestfs-actions.pod:5932
17863 " guestfs_set_e2uuid (guestfs_h *g,\n"
17864 " const char *device,\n"
17865 " const char *uuid);\n"
17871 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:4011
17873 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
17874 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
17875 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
17880 #: ../src/guestfs-actions.pod:5942
17882 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
17883 "the existing UUID of a filesystem."
17888 #: ../src/guestfs-actions.pod:5949
17889 msgid "guestfs_set_memsize"
17894 #: ../src/guestfs-actions.pod:5951
17898 " guestfs_set_memsize (guestfs_h *g,\n"
17905 #: ../src/guestfs-actions.pod:5955
17907 "This sets the memory size in megabytes allocated to the qemu subprocess. "
17908 "This only has any effect if called before C<guestfs_launch>."
17913 #: ../src/guestfs-actions.pod:5959 ../fish/guestfish-actions.pod:4029
17915 "You can also change this by setting the environment variable "
17916 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
17921 #: ../src/guestfs-actions.pod:5970
17922 msgid "guestfs_set_network"
17927 #: ../src/guestfs-actions.pod:5972
17931 " guestfs_set_network (guestfs_h *g,\n"
17938 #: ../src/guestfs-actions.pod:5976 ../fish/guestfish-actions.pod:4042
17940 "If C<network> is true, then the network is enabled in the libguestfs "
17941 "appliance. The default is false."
17946 #: ../src/guestfs-actions.pod:5979 ../fish/guestfish-actions.pod:4045
17948 "This affects whether commands are able to access the network (see L<guestfs"
17949 "(3)/RUNNING COMMANDS>)."
17954 #: ../src/guestfs-actions.pod:5982
17956 "You must call this before calling C<guestfs_launch>, otherwise it has no "
17962 #: ../src/guestfs-actions.pod:5989
17963 msgid "guestfs_set_path"
17968 #: ../src/guestfs-actions.pod:5991
17972 " guestfs_set_path (guestfs_h *g,\n"
17973 " const char *searchpath);\n"
17979 #: ../src/guestfs-actions.pod:5995 ../fish/guestfish-actions.pod:4057
17980 msgid "Set the path that libguestfs searches for kernel and initrd.img."
17985 #: ../src/guestfs-actions.pod:5997 ../fish/guestfish-actions.pod:4059
17987 "The default is C<$libdir/guestfs> unless overridden by setting "
17988 "C<LIBGUESTFS_PATH> environment variable."
17993 #: ../src/guestfs-actions.pod:6000 ../fish/guestfish-actions.pod:4062
17994 msgid "Setting C<path> to C<NULL> restores the default path."
17999 #: ../src/guestfs-actions.pod:6006
18000 msgid "guestfs_set_qemu"
18005 #: ../src/guestfs-actions.pod:6008
18009 " guestfs_set_qemu (guestfs_h *g,\n"
18010 " const char *qemu);\n"
18016 #: ../src/guestfs-actions.pod:6012 ../fish/guestfish-actions.pod:4070
18017 msgid "Set the qemu binary that we will use."
18022 #: ../src/guestfs-actions.pod:6014 ../fish/guestfish-actions.pod:4072
18024 "The default is chosen when the library was compiled by the configure script."
18029 #: ../src/guestfs-actions.pod:6017 ../fish/guestfish-actions.pod:4075
18031 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
18037 #: ../src/guestfs-actions.pod:6020 ../fish/guestfish-actions.pod:4078
18038 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
18043 #: ../src/guestfs-actions.pod:6022 ../fish/guestfish-actions.pod:4080
18045 "Note that you should call this function as early as possible after creating "
18046 "the handle. This is because some pre-launch operations depend on testing "
18047 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
18048 "don't retest features, and so you might see inconsistent results. Using the "
18049 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
18050 "the qemu binary at the same time as the handle is created."
18055 #: ../src/guestfs-actions.pod:6034
18056 msgid "guestfs_set_recovery_proc"
18061 #: ../src/guestfs-actions.pod:6036
18065 " guestfs_set_recovery_proc (guestfs_h *g,\n"
18066 " int recoveryproc);\n"
18072 #: ../src/guestfs-actions.pod:6040
18074 "If this is called with the parameter C<false> then C<guestfs_launch> does "
18075 "not create a recovery process. The purpose of the recovery process is to "
18076 "stop runaway qemu processes in the case where the main program aborts "
18082 #: ../src/guestfs-actions.pod:6045
18084 "This only has any effect if called before C<guestfs_launch>, and the default "
18090 #: ../src/guestfs-actions.pod:6048 ../fish/guestfish-actions.pod:4102
18092 "About the only time when you would want to disable this is if the main "
18093 "process will fork itself into the background (\"daemonize\" itself). In "
18094 "this case the recovery process thinks that the main program has disappeared "
18095 "and so kills qemu, which is not very helpful."
18100 #: ../src/guestfs-actions.pod:6058
18101 msgid "guestfs_set_selinux"
18106 #: ../src/guestfs-actions.pod:6060
18110 " guestfs_set_selinux (guestfs_h *g,\n"
18117 #: ../src/guestfs-actions.pod:6064 ../fish/guestfish-actions.pod:4114
18119 "This sets the selinux flag that is passed to the appliance at boot time. "
18120 "The default is C<selinux=0> (disabled)."
18125 #: ../src/guestfs-actions.pod:6067 ../fish/guestfish-actions.pod:4117
18127 "Note that if SELinux is enabled, it is always in Permissive mode "
18128 "(C<enforcing=0>)."
18133 #: ../src/guestfs-actions.pod:6077
18134 msgid "guestfs_set_trace"
18139 #: ../src/guestfs-actions.pod:6079
18143 " guestfs_set_trace (guestfs_h *g,\n"
18149 #: ../src/guestfs-actions.pod:6083 ../fish/guestfish-actions.pod:4129
18151 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
18152 "return values are traced."
18157 #: ../src/guestfs-actions.pod:6086 ../fish/guestfish-actions.pod:4132
18159 "If you want to trace C API calls into libguestfs (and other libraries) then "
18160 "possibly a better way is to use the external ltrace(1) command."
18165 #: ../src/guestfs-actions.pod:6090 ../fish/guestfish-actions.pod:4136
18167 "Command traces are disabled unless the environment variable "
18168 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
18172 #: ../src/guestfs-actions.pod:6093
18174 "Trace messages are normally sent to C<stderr>, unless you register a "
18175 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
18180 #: ../src/guestfs-actions.pod:6101
18181 msgid "guestfs_set_verbose"
18186 #: ../src/guestfs-actions.pod:6103
18190 " guestfs_set_verbose (guestfs_h *g,\n"
18196 #: ../src/guestfs-actions.pod:6107 ../fish/guestfish-actions.pod:4149
18197 msgid "If C<verbose> is true, this turns on verbose messages."
18202 #: ../src/guestfs-actions.pod:6109 ../fish/guestfish-actions.pod:4151
18204 "Verbose messages are disabled unless the environment variable "
18205 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
18209 #: ../src/guestfs-actions.pod:6112
18211 "Verbose messages are normally sent to C<stderr>, unless you register a "
18212 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
18217 #: ../src/guestfs-actions.pod:6120
18218 msgid "guestfs_setcon"
18223 #: ../src/guestfs-actions.pod:6122
18227 " guestfs_setcon (guestfs_h *g,\n"
18228 " const char *context);\n"
18234 #: ../src/guestfs-actions.pod:6126 ../fish/guestfish-actions.pod:4162
18236 "This sets the SELinux security context of the daemon to the string "
18242 #: ../src/guestfs-actions.pod:6129 ../fish/guestfish-actions.pod:4165
18243 msgid "See the documentation about SELINUX in L<guestfs(3)>."
18248 #: ../src/guestfs-actions.pod:6135
18249 msgid "guestfs_setxattr"
18254 #: ../src/guestfs-actions.pod:6137
18258 " guestfs_setxattr (guestfs_h *g,\n"
18259 " const char *xattr,\n"
18260 " const char *val,\n"
18262 " const char *path);\n"
18268 #: ../src/guestfs-actions.pod:6144 ../fish/guestfish-actions.pod:4171
18270 "This call sets the extended attribute named C<xattr> of the file C<path> to "
18271 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
18276 #: ../src/guestfs-actions.pod:6148
18277 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
18282 #: ../src/guestfs-actions.pod:6154
18283 msgid "guestfs_sfdisk"
18288 #: ../src/guestfs-actions.pod:6156
18292 " guestfs_sfdisk (guestfs_h *g,\n"
18293 " const char *device,\n"
18297 " char *const *lines);\n"
18303 #: ../src/guestfs-actions.pod:6164 ../fish/guestfish-actions.pod:4181
18305 "This is a direct interface to the L<sfdisk(8)> program for creating "
18306 "partitions on block devices."
18311 #: ../src/guestfs-actions.pod:6167 ../fish/guestfish-actions.pod:4184
18312 msgid "C<device> should be a block device, for example C</dev/sda>."
18317 #: ../src/guestfs-actions.pod:6169 ../fish/guestfish-actions.pod:4186
18319 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
18320 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
18321 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
18322 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
18323 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
18324 "the kernel) cannot work out the right geometry and you will need to tell it."
18329 #: ../src/guestfs-actions.pod:6177 ../fish/guestfish-actions.pod:4194
18331 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
18332 "refer to the L<sfdisk(8)> manpage."
18337 #: ../src/guestfs-actions.pod:6180 ../fish/guestfish-actions.pod:4197
18339 "To create a single partition occupying the whole disk, you would pass "
18340 "C<lines> as a single element list, when the single element being the string "
18346 #: ../src/guestfs-actions.pod:6184
18348 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
18352 #: ../src/guestfs-actions.pod:6192 ../src/guestfs-actions.pod:6222
18353 #: ../src/guestfs-actions.pod:6255
18355 "This function is deprecated. In new code, use the L</guestfs_part_add> call "
18361 #: ../src/guestfs-actions.pod:6201
18362 msgid "guestfs_sfdiskM"
18367 #: ../src/guestfs-actions.pod:6203
18371 " guestfs_sfdiskM (guestfs_h *g,\n"
18372 " const char *device,\n"
18373 " char *const *lines);\n"
18379 #: ../src/guestfs-actions.pod:6208
18381 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
18382 "partition sizes are specified in megabytes only (rounded to the nearest "
18383 "cylinder) and you don't need to specify the cyls, heads and sectors "
18384 "parameters which were rarely if ever used anyway."
18389 #: ../src/guestfs-actions.pod:6214
18391 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
18392 "C<guestfs_part_disk>"
18397 #: ../src/guestfs-actions.pod:6231
18398 msgid "guestfs_sfdisk_N"
18403 #: ../src/guestfs-actions.pod:6233
18407 " guestfs_sfdisk_N (guestfs_h *g,\n"
18408 " const char *device,\n"
18413 " const char *line);\n"
18419 #: ../src/guestfs-actions.pod:6242 ../fish/guestfish-actions.pod:4241
18421 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
18422 "(note: C<n> counts from 1)."
18427 #: ../src/guestfs-actions.pod:6245
18429 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
18430 "for the cyls/heads/sectors parameters."
18435 #: ../src/guestfs-actions.pod:6248
18436 msgid "See also: C<guestfs_part_add>"
18441 #: ../src/guestfs-actions.pod:6264
18442 msgid "guestfs_sfdisk_disk_geometry"
18447 #: ../src/guestfs-actions.pod:6266
18451 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
18452 " const char *device);\n"
18458 #: ../src/guestfs-actions.pod:6270
18460 "This displays the disk geometry of C<device> read from the partition table. "
18461 "Especially in the case where the underlying block device has been resized, "
18462 "this can be different from the kernel's idea of the geometry (see "
18463 "C<guestfs_sfdisk_kernel_geometry>)."
18468 #: ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6291
18469 #: ../fish/guestfish-actions.pod:4268 ../fish/guestfish-actions.pod:4277
18470 msgid "The result is in human-readable format, and not designed to be parsed."
18475 #: ../src/guestfs-actions.pod:6283
18476 msgid "guestfs_sfdisk_kernel_geometry"
18481 #: ../src/guestfs-actions.pod:6285
18485 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
18486 " const char *device);\n"
18492 #: ../src/guestfs-actions.pod:6289 ../fish/guestfish-actions.pod:4275
18493 msgid "This displays the kernel's idea of the geometry of C<device>."
18498 #: ../src/guestfs-actions.pod:6299
18499 msgid "guestfs_sfdisk_l"
18504 #: ../src/guestfs-actions.pod:6301
18508 " guestfs_sfdisk_l (guestfs_h *g,\n"
18509 " const char *device);\n"
18515 #: ../src/guestfs-actions.pod:6305 ../fish/guestfish-actions.pod:4284
18517 "This displays the partition table on C<device>, in the human-readable output "
18518 "of the L<sfdisk(8)> command. It is not intended to be parsed."
18523 #: ../src/guestfs-actions.pod:6309
18524 msgid "See also: C<guestfs_part_list>"
18528 #: ../src/guestfs-actions.pod:6314
18530 "This function is deprecated. In new code, use the L</guestfs_part_list> "
18536 #: ../src/guestfs-actions.pod:6323
18542 #: ../src/guestfs-actions.pod:6325
18546 " guestfs_sh (guestfs_h *g,\n"
18547 " const char *command);\n"
18553 #: ../src/guestfs-actions.pod:6329 ../fish/guestfish-actions.pod:4301
18555 "This call runs a command from the guest filesystem via the guest's C</bin/"
18561 #: ../src/guestfs-actions.pod:6332
18562 msgid "This is like C<guestfs_command>, but passes the command to:"
18567 #: ../src/guestfs-actions.pod:6334 ../fish/guestfish-actions.pod:4306
18570 " /bin/sh -c \"command\"\n"
18576 #: ../src/guestfs-actions.pod:6336 ../fish/guestfish-actions.pod:4308
18578 "Depending on the guest's shell, this usually results in wildcards being "
18579 "expanded, shell expressions being interpolated and so on."
18584 #: ../src/guestfs-actions.pod:6340
18585 msgid "All the provisos about C<guestfs_command> apply to this call."
18590 #: ../src/guestfs-actions.pod:6347
18591 msgid "guestfs_sh_lines"
18596 #: ../src/guestfs-actions.pod:6349
18600 " guestfs_sh_lines (guestfs_h *g,\n"
18601 " const char *command);\n"
18607 #: ../src/guestfs-actions.pod:6353
18609 "This is the same as C<guestfs_sh>, but splits the result into a list of "
18615 #: ../src/guestfs-actions.pod:6356
18616 msgid "See also: C<guestfs_command_lines>"
18621 #: ../src/guestfs-actions.pod:6364
18622 msgid "guestfs_sleep"
18627 #: ../src/guestfs-actions.pod:6366
18631 " guestfs_sleep (guestfs_h *g,\n"
18638 #: ../src/guestfs-actions.pod:6370 ../fish/guestfish-actions.pod:4327
18639 msgid "Sleep for C<secs> seconds."
18644 #: ../src/guestfs-actions.pod:6374
18645 msgid "(Added in 1.0.41)"
18650 #: ../src/guestfs-actions.pod:6376 ../src/guestfs-structs.pod:109
18651 msgid "guestfs_stat"
18656 #: ../src/guestfs-actions.pod:6378
18659 " struct guestfs_stat *\n"
18660 " guestfs_stat (guestfs_h *g,\n"
18661 " const char *path);\n"
18667 #: ../src/guestfs-actions.pod:6384 ../fish/guestfish-actions.pod:4335
18668 msgid "This is the same as the C<stat(2)> system call."
18673 #: ../src/guestfs-actions.pod:6392 ../src/guestfs-structs.pod:135
18674 msgid "guestfs_statvfs"
18679 #: ../src/guestfs-actions.pod:6394
18682 " struct guestfs_statvfs *\n"
18683 " guestfs_statvfs (guestfs_h *g,\n"
18684 " const char *path);\n"
18690 #: ../src/guestfs-actions.pod:6398 ../fish/guestfish-actions.pod:4341
18692 "Returns file system statistics for any mounted file system. C<path> should "
18693 "be a file or directory in the mounted file system (typically it is the mount "
18694 "point itself, but it doesn't need to be)."
18699 #: ../src/guestfs-actions.pod:6402 ../fish/guestfish-actions.pod:4345
18700 msgid "This is the same as the C<statvfs(2)> system call."
18705 #: ../src/guestfs-actions.pod:6404
18707 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
18708 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
18713 #: ../src/guestfs-actions.pod:6410
18714 msgid "guestfs_strings"
18719 #: ../src/guestfs-actions.pod:6412
18723 " guestfs_strings (guestfs_h *g,\n"
18724 " const char *path);\n"
18730 #: ../src/guestfs-actions.pod:6416 ../fish/guestfish-actions.pod:4351
18732 "This runs the L<strings(1)> command on a file and returns the list of "
18733 "printable strings found."
18738 #: ../src/guestfs-actions.pod:6428
18739 msgid "guestfs_strings_e"
18744 #: ../src/guestfs-actions.pod:6430
18748 " guestfs_strings_e (guestfs_h *g,\n"
18749 " const char *encoding,\n"
18750 " const char *path);\n"
18756 #: ../src/guestfs-actions.pod:6435
18758 "This is like the C<guestfs_strings> command, but allows you to specify the "
18759 "encoding of strings that are looked for in the source file C<path>."
18764 #: ../src/guestfs-actions.pod:6439 ../fish/guestfish-actions.pod:4365
18765 msgid "Allowed encodings are:"
18770 #: ../src/guestfs-actions.pod:6443 ../fish/guestfish-actions.pod:4369
18776 #: ../src/guestfs-actions.pod:6445
18778 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
18779 "ISO-8859-X (this is what C<guestfs_strings> uses)."
18784 #: ../src/guestfs-actions.pod:6448 ../fish/guestfish-actions.pod:4374
18790 #: ../src/guestfs-actions.pod:6450 ../fish/guestfish-actions.pod:4376
18791 msgid "Single 8-bit-byte characters."
18796 #: ../src/guestfs-actions.pod:6452 ../fish/guestfish-actions.pod:4378
18802 #: ../src/guestfs-actions.pod:6454 ../fish/guestfish-actions.pod:4380
18803 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
18808 #: ../src/guestfs-actions.pod:6457 ../fish/guestfish-actions.pod:4383
18809 msgid "l (lower case letter L)"
18814 #: ../src/guestfs-actions.pod:6459 ../fish/guestfish-actions.pod:4385
18816 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
18817 "examining binaries in Windows guests."
18822 #: ../src/guestfs-actions.pod:6462 ../fish/guestfish-actions.pod:4388
18828 #: ../src/guestfs-actions.pod:6464 ../fish/guestfish-actions.pod:4390
18829 msgid "32-bit big endian such as UCS-4BE."
18834 #: ../src/guestfs-actions.pod:6466 ../fish/guestfish-actions.pod:4392
18840 #: ../src/guestfs-actions.pod:6468 ../fish/guestfish-actions.pod:4394
18841 msgid "32-bit little endian such as UCS-4LE."
18846 #: ../src/guestfs-actions.pod:6472 ../fish/guestfish-actions.pod:4398
18847 msgid "The returned strings are transcoded to UTF-8."
18852 #: ../src/guestfs-actions.pod:6483
18853 msgid "guestfs_swapoff_device"
18858 #: ../src/guestfs-actions.pod:6485
18862 " guestfs_swapoff_device (guestfs_h *g,\n"
18863 " const char *device);\n"
18869 #: ../src/guestfs-actions.pod:6489
18871 "This command disables the libguestfs appliance swap device or partition "
18872 "named C<device>. See C<guestfs_swapon_device>."
18877 #: ../src/guestfs-actions.pod:6497
18878 msgid "guestfs_swapoff_file"
18883 #: ../src/guestfs-actions.pod:6499
18887 " guestfs_swapoff_file (guestfs_h *g,\n"
18888 " const char *file);\n"
18894 #: ../src/guestfs-actions.pod:6503 ../fish/guestfish-actions.pod:4415
18895 msgid "This command disables the libguestfs appliance swap on file."
18900 #: ../src/guestfs-actions.pod:6509
18901 msgid "guestfs_swapoff_label"
18906 #: ../src/guestfs-actions.pod:6511
18910 " guestfs_swapoff_label (guestfs_h *g,\n"
18911 " const char *label);\n"
18917 #: ../src/guestfs-actions.pod:6515 ../fish/guestfish-actions.pod:4421
18919 "This command disables the libguestfs appliance swap on labeled swap "
18925 #: ../src/guestfs-actions.pod:6522
18926 msgid "guestfs_swapoff_uuid"
18931 #: ../src/guestfs-actions.pod:6524
18935 " guestfs_swapoff_uuid (guestfs_h *g,\n"
18936 " const char *uuid);\n"
18942 #: ../src/guestfs-actions.pod:6528 ../fish/guestfish-actions.pod:4428
18944 "This command disables the libguestfs appliance swap partition with the given "
18950 #: ../src/guestfs-actions.pod:6535
18951 msgid "guestfs_swapon_device"
18956 #: ../src/guestfs-actions.pod:6537
18960 " guestfs_swapon_device (guestfs_h *g,\n"
18961 " const char *device);\n"
18967 #: ../src/guestfs-actions.pod:6541
18969 "This command enables the libguestfs appliance to use the swap device or "
18970 "partition named C<device>. The increased memory is made available for all "
18971 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
18976 #: ../src/guestfs-actions.pod:6546 ../fish/guestfish-actions.pod:4440
18978 "Note that you should not swap to existing guest swap partitions unless you "
18979 "know what you are doing. They may contain hibernation information, or other "
18980 "information that the guest doesn't want you to trash. You also risk leaking "
18981 "information about the host to the guest this way. Instead, attach a new "
18982 "host device to the guest and swap on that."
18987 #: ../src/guestfs-actions.pod:6557
18988 msgid "guestfs_swapon_file"
18993 #: ../src/guestfs-actions.pod:6559
18997 " guestfs_swapon_file (guestfs_h *g,\n"
18998 " const char *file);\n"
19004 #: ../src/guestfs-actions.pod:6563
19006 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
19012 #: ../src/guestfs-actions.pod:6570
19013 msgid "guestfs_swapon_label"
19018 #: ../src/guestfs-actions.pod:6572
19022 " guestfs_swapon_label (guestfs_h *g,\n"
19023 " const char *label);\n"
19029 #: ../src/guestfs-actions.pod:6576
19031 "This command enables swap to a labeled swap partition. See "
19032 "C<guestfs_swapon_device> for other notes."
19037 #: ../src/guestfs-actions.pod:6583
19038 msgid "guestfs_swapon_uuid"
19043 #: ../src/guestfs-actions.pod:6585
19047 " guestfs_swapon_uuid (guestfs_h *g,\n"
19048 " const char *uuid);\n"
19054 #: ../src/guestfs-actions.pod:6589
19056 "This command enables swap to a swap partition with the given UUID. See "
19057 "C<guestfs_swapon_device> for other notes."
19062 #: ../src/guestfs-actions.pod:6596
19063 msgid "guestfs_sync"
19068 #: ../src/guestfs-actions.pod:6598
19072 " guestfs_sync (guestfs_h *g);\n"
19078 #: ../src/guestfs-actions.pod:6601 ../fish/guestfish-actions.pod:4472
19080 "This syncs the disk, so that any writes are flushed through to the "
19081 "underlying disk image."
19086 #: ../src/guestfs-actions.pod:6604 ../fish/guestfish-actions.pod:4475
19088 "You should always call this if you have modified a disk image, before "
19089 "closing the handle."
19094 #: ../src/guestfs-actions.pod:6611
19095 msgid "guestfs_tail"
19100 #: ../src/guestfs-actions.pod:6613
19104 " guestfs_tail (guestfs_h *g,\n"
19105 " const char *path);\n"
19111 #: ../src/guestfs-actions.pod:6617 ../fish/guestfish-actions.pod:4482
19113 "This command returns up to the last 10 lines of a file as a list of strings."
19118 #: ../src/guestfs-actions.pod:6629
19119 msgid "guestfs_tail_n"
19124 #: ../src/guestfs-actions.pod:6631
19128 " guestfs_tail_n (guestfs_h *g,\n"
19130 " const char *path);\n"
19136 #: ../src/guestfs-actions.pod:6636 ../fish/guestfish-actions.pod:4492
19138 "If the parameter C<nrlines> is a positive number, this returns the last "
19139 "C<nrlines> lines of the file C<path>."
19144 #: ../src/guestfs-actions.pod:6639 ../fish/guestfish-actions.pod:4495
19146 "If the parameter C<nrlines> is a negative number, this returns lines from "
19147 "the file C<path>, starting with the C<-nrlines>th line."
19152 #: ../src/guestfs-actions.pod:6653
19153 msgid "guestfs_tar_in"
19158 #: ../src/guestfs-actions.pod:6655
19162 " guestfs_tar_in (guestfs_h *g,\n"
19163 " const char *tarfile,\n"
19164 " const char *directory);\n"
19170 #: ../src/guestfs-actions.pod:6660 ../fish/guestfish-actions.pod:4507
19172 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
19173 "tar file) into C<directory>."
19178 #: ../src/guestfs-actions.pod:6663
19180 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
19185 #: ../src/guestfs-actions.pod:6668 ../src/guestfs-actions.pod:6685
19186 #: ../src/guestfs-actions.pod:6701 ../src/guestfs-actions.pod:6717
19187 msgid "(Added in 1.0.3)"
19192 #: ../src/guestfs-actions.pod:6670
19193 msgid "guestfs_tar_out"
19198 #: ../src/guestfs-actions.pod:6672
19202 " guestfs_tar_out (guestfs_h *g,\n"
19203 " const char *directory,\n"
19204 " const char *tarfile);\n"
19210 #: ../src/guestfs-actions.pod:6677 ../fish/guestfish-actions.pod:4519
19212 "This command packs the contents of C<directory> and downloads it to local "
19218 #: ../src/guestfs-actions.pod:6680
19220 "To download a compressed tarball, use C<guestfs_tgz_out> or "
19221 "C<guestfs_txz_out>."
19226 #: ../src/guestfs-actions.pod:6687
19227 msgid "guestfs_tgz_in"
19232 #: ../src/guestfs-actions.pod:6689
19236 " guestfs_tgz_in (guestfs_h *g,\n"
19237 " const char *tarball,\n"
19238 " const char *directory);\n"
19244 #: ../src/guestfs-actions.pod:6694 ../fish/guestfish-actions.pod:4531
19246 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
19247 "tar file) into C<directory>."
19252 #: ../src/guestfs-actions.pod:6697
19253 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
19258 #: ../src/guestfs-actions.pod:6703
19259 msgid "guestfs_tgz_out"
19264 #: ../src/guestfs-actions.pod:6705
19268 " guestfs_tgz_out (guestfs_h *g,\n"
19269 " const char *directory,\n"
19270 " const char *tarball);\n"
19276 #: ../src/guestfs-actions.pod:6710 ../fish/guestfish-actions.pod:4542
19278 "This command packs the contents of C<directory> and downloads it to local "
19284 #: ../src/guestfs-actions.pod:6713
19285 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
19290 #: ../src/guestfs-actions.pod:6719
19291 msgid "guestfs_touch"
19296 #: ../src/guestfs-actions.pod:6721
19300 " guestfs_touch (guestfs_h *g,\n"
19301 " const char *path);\n"
19307 #: ../src/guestfs-actions.pod:6725 ../fish/guestfish-actions.pod:4553
19309 "Touch acts like the L<touch(1)> command. It can be used to update the "
19310 "timestamps on a file, or, if the file does not exist, to create a new zero-"
19316 #: ../src/guestfs-actions.pod:6729 ../fish/guestfish-actions.pod:4557
19318 "This command only works on regular files, and will fail on other file types "
19319 "such as directories, symbolic links, block special etc."
19324 #: ../src/guestfs-actions.pod:6736
19325 msgid "guestfs_truncate"
19330 #: ../src/guestfs-actions.pod:6738
19334 " guestfs_truncate (guestfs_h *g,\n"
19335 " const char *path);\n"
19341 #: ../src/guestfs-actions.pod:6742 ../fish/guestfish-actions.pod:4564
19343 "This command truncates C<path> to a zero-length file. The file must exist "
19349 #: ../src/guestfs-actions.pod:6749
19350 msgid "guestfs_truncate_size"
19355 #: ../src/guestfs-actions.pod:6751
19359 " guestfs_truncate_size (guestfs_h *g,\n"
19360 " const char *path,\n"
19361 " int64_t size);\n"
19367 #: ../src/guestfs-actions.pod:6756 ../fish/guestfish-actions.pod:4571
19369 "This command truncates C<path> to size C<size> bytes. The file must exist "
19375 #: ../src/guestfs-actions.pod:6759
19377 "If the current file size is less than C<size> then the file is extended to "
19378 "the required size with zero bytes. This creates a sparse file (ie. disk "
19379 "blocks are not allocated for the file until you write to it). To create a "
19380 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
19385 #: ../src/guestfs-actions.pod:6769
19386 msgid "guestfs_tune2fs_l"
19391 #: ../src/guestfs-actions.pod:6771
19395 " guestfs_tune2fs_l (guestfs_h *g,\n"
19396 " const char *device);\n"
19402 #: ../src/guestfs-actions.pod:6775 ../fish/guestfish-actions.pod:4584
19404 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
19410 #: ../src/guestfs-actions.pod:6778 ../fish/guestfish-actions.pod:4587
19412 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
19413 "for more details. The list of fields returned isn't clearly defined, and "
19414 "depends on both the version of C<tune2fs> that libguestfs was built against, "
19415 "and the filesystem itself."
19420 #: ../src/guestfs-actions.pod:6791
19421 msgid "guestfs_txz_in"
19426 #: ../src/guestfs-actions.pod:6793
19430 " guestfs_txz_in (guestfs_h *g,\n"
19431 " const char *tarball,\n"
19432 " const char *directory);\n"
19438 #: ../src/guestfs-actions.pod:6798 ../fish/guestfish-actions.pod:4596
19440 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
19441 "tar file) into C<directory>."
19446 #: ../src/guestfs-actions.pod:6805
19447 msgid "guestfs_txz_out"
19452 #: ../src/guestfs-actions.pod:6807
19456 " guestfs_txz_out (guestfs_h *g,\n"
19457 " const char *directory,\n"
19458 " const char *tarball);\n"
19464 #: ../src/guestfs-actions.pod:6812 ../fish/guestfish-actions.pod:4605
19466 "This command packs the contents of C<directory> and downloads it to local "
19467 "file C<tarball> (as an xz compressed tar archive)."
19472 #: ../src/guestfs-actions.pod:6819
19473 msgid "guestfs_umask"
19478 #: ../src/guestfs-actions.pod:6821
19482 " guestfs_umask (guestfs_h *g,\n"
19489 #: ../src/guestfs-actions.pod:6825 ../fish/guestfish-actions.pod:4614
19491 "This function sets the mask used for creating new files and device nodes to "
19497 #: ../src/guestfs-actions.pod:6828 ../fish/guestfish-actions.pod:4617
19499 "Typical umask values would be C<022> which creates new files with "
19500 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
19501 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
19506 #: ../src/guestfs-actions.pod:6833 ../fish/guestfish-actions.pod:4622
19508 "The default umask is C<022>. This is important because it means that "
19509 "directories and device nodes will be created with C<0644> or C<0755> mode "
19510 "even if you specify C<0777>."
19515 #: ../src/guestfs-actions.pod:6837
19517 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
19518 "C<guestfs_mkdir>."
19523 #: ../src/guestfs-actions.pod:6840 ../fish/guestfish-actions.pod:4629
19524 msgid "This call returns the previous umask."
19529 #: ../src/guestfs-actions.pod:6846
19530 msgid "guestfs_umount"
19535 #: ../src/guestfs-actions.pod:6848
19539 " guestfs_umount (guestfs_h *g,\n"
19540 " const char *pathordevice);\n"
19546 #: ../src/guestfs-actions.pod:6852 ../fish/guestfish-actions.pod:4637
19548 "This unmounts the given filesystem. The filesystem may be specified either "
19549 "by its mountpoint (path) or the device which contains the filesystem."
19554 #: ../src/guestfs-actions.pod:6860
19555 msgid "guestfs_umount_all"
19560 #: ../src/guestfs-actions.pod:6862
19564 " guestfs_umount_all (guestfs_h *g);\n"
19570 #: ../src/guestfs-actions.pod:6865 ../fish/guestfish-actions.pod:4647
19571 msgid "This unmounts all mounted filesystems."
19576 #: ../src/guestfs-actions.pod:6867 ../fish/guestfish-actions.pod:4649
19577 msgid "Some internal mounts are not unmounted by this call."
19582 #: ../src/guestfs-actions.pod:6873
19583 msgid "guestfs_upload"
19588 #: ../src/guestfs-actions.pod:6875
19592 " guestfs_upload (guestfs_h *g,\n"
19593 " const char *filename,\n"
19594 " const char *remotefilename);\n"
19600 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6904
19601 #: ../fish/guestfish-actions.pod:4655 ../fish/guestfish-actions.pod:4668
19602 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
19607 #: ../src/guestfs-actions.pod:6885
19608 msgid "See also C<guestfs_download>."
19613 #: ../src/guestfs-actions.pod:6896
19614 msgid "guestfs_upload_offset"
19619 #: ../src/guestfs-actions.pod:6898
19623 " guestfs_upload_offset (guestfs_h *g,\n"
19624 " const char *filename,\n"
19625 " const char *remotefilename,\n"
19626 " int64_t offset);\n"
19632 #: ../src/guestfs-actions.pod:6907 ../fish/guestfish-actions.pod:4671
19634 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
19635 "The intention is to overwrite parts of existing files or devices, although "
19636 "if a non-existant file is specified then it is created with a \"hole\" "
19637 "before C<offset>. The size of the data written is implicit in the size of "
19638 "the source C<filename>."
19643 #: ../src/guestfs-actions.pod:6914
19645 "Note that there is no limit on the amount of data that can be uploaded with "
19646 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
19647 "full amount unless an error occurs."
19652 #: ../src/guestfs-actions.pod:6919
19653 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
19658 #: ../src/guestfs-actions.pod:6930
19659 msgid "guestfs_utimens"
19664 #: ../src/guestfs-actions.pod:6932
19668 " guestfs_utimens (guestfs_h *g,\n"
19669 " const char *path,\n"
19670 " int64_t atsecs,\n"
19671 " int64_t atnsecs,\n"
19672 " int64_t mtsecs,\n"
19673 " int64_t mtnsecs);\n"
19679 #: ../src/guestfs-actions.pod:6940 ../fish/guestfish-actions.pod:4691
19680 msgid "This command sets the timestamps of a file with nanosecond precision."
19685 #: ../src/guestfs-actions.pod:6943 ../fish/guestfish-actions.pod:4694
19687 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
19693 #: ../src/guestfs-actions.pod:6946 ../fish/guestfish-actions.pod:4697
19695 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
19696 "nanoseconds from the epoch."
19701 #: ../src/guestfs-actions.pod:6949 ../fish/guestfish-actions.pod:4700
19703 "If the C<*nsecs> field contains the special value C<-1> then the "
19704 "corresponding timestamp is set to the current time. (The C<*secs> field is "
19705 "ignored in this case)."
19710 #: ../src/guestfs-actions.pod:6953 ../fish/guestfish-actions.pod:4704
19712 "If the C<*nsecs> field contains the special value C<-2> then the "
19713 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
19719 #: ../src/guestfs-actions.pod:6961 ../src/guestfs-structs.pod:175
19720 msgid "guestfs_version"
19725 #: ../src/guestfs-actions.pod:6963
19728 " struct guestfs_version *\n"
19729 " guestfs_version (guestfs_h *g);\n"
19735 #: ../src/guestfs-actions.pod:6966 ../fish/guestfish-actions.pod:4712
19737 "Return the libguestfs version number that the program is linked against."
19742 #: ../src/guestfs-actions.pod:6969 ../fish/guestfish-actions.pod:4715
19744 "Note that because of dynamic linking this is not necessarily the version of "
19745 "libguestfs that you compiled against. You can compile the program, and then "
19746 "at runtime dynamically link against a completely different C<libguestfs.so> "
19752 #: ../src/guestfs-actions.pod:6974 ../fish/guestfish-actions.pod:4720
19754 "This call was added in version C<1.0.58>. In previous versions of "
19755 "libguestfs there was no way to get the version number. From C code you can "
19756 "use dynamic linker functions to find out if this symbol exists (if it "
19757 "doesn't, then it's an earlier version)."
19762 #: ../src/guestfs-actions.pod:6980 ../fish/guestfish-actions.pod:4726
19764 "The call returns a structure with four elements. The first three (C<major>, "
19765 "C<minor> and C<release>) are numbers and correspond to the usual version "
19766 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
19767 "but may be used for distro-specific information."
19772 #: ../src/guestfs-actions.pod:6986 ../fish/guestfish-actions.pod:4732
19774 "To construct the original version string: C<$major.$minor.$release$extra>"
19779 #: ../src/guestfs-actions.pod:6989 ../fish/guestfish-actions.pod:4735
19780 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
19785 #: ../src/guestfs-actions.pod:6991
19787 "I<Note:> Don't use this call to test for availability of features. In "
19788 "enterprise distributions we backport features from later versions into "
19789 "earlier versions, making this an unreliable way to test for features. Use "
19790 "C<guestfs_available> instead."
19795 #: ../src/guestfs-actions.pod:6997
19797 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
19798 "error. I<The caller must call C<guestfs_free_version> after use>."
19803 #: ../src/guestfs-actions.pod:7001
19804 msgid "(Added in 1.0.58)"
19809 #: ../src/guestfs-actions.pod:7003
19810 msgid "guestfs_vfs_label"
19815 #: ../src/guestfs-actions.pod:7005
19819 " guestfs_vfs_label (guestfs_h *g,\n"
19820 " const char *device);\n"
19826 #: ../src/guestfs-actions.pod:7009 ../fish/guestfish-actions.pod:4747
19827 msgid "This returns the filesystem label of the filesystem on C<device>."
19832 #: ../src/guestfs-actions.pod:7012 ../fish/guestfish-actions.pod:4750
19833 msgid "If the filesystem is unlabeled, this returns the empty string."
19838 #: ../src/guestfs-actions.pod:7014
19839 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
19844 #: ../src/guestfs-actions.pod:7019 ../src/guestfs-actions.pod:7056
19845 msgid "(Added in 1.3.18)"
19850 #: ../src/guestfs-actions.pod:7021
19851 msgid "guestfs_vfs_type"
19856 #: ../src/guestfs-actions.pod:7023
19860 " guestfs_vfs_type (guestfs_h *g,\n"
19861 " const char *device);\n"
19867 #: ../src/guestfs-actions.pod:7027 ../fish/guestfish-actions.pod:4758
19869 "This command gets the filesystem type corresponding to the filesystem on "
19875 #: ../src/guestfs-actions.pod:7030 ../fish/guestfish-actions.pod:4761
19877 "For most filesystems, the result is the name of the Linux VFS module which "
19878 "would be used to mount this filesystem if you mounted it without specifying "
19879 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
19884 #: ../src/guestfs-actions.pod:7040
19885 msgid "guestfs_vfs_uuid"
19890 #: ../src/guestfs-actions.pod:7042
19894 " guestfs_vfs_uuid (guestfs_h *g,\n"
19895 " const char *device);\n"
19901 #: ../src/guestfs-actions.pod:7046 ../fish/guestfish-actions.pod:4770
19902 msgid "This returns the filesystem UUID of the filesystem on C<device>."
19907 #: ../src/guestfs-actions.pod:7049 ../fish/guestfish-actions.pod:4773
19908 msgid "If the filesystem does not have a UUID, this returns the empty string."
19913 #: ../src/guestfs-actions.pod:7051
19914 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
19919 #: ../src/guestfs-actions.pod:7058
19920 msgid "guestfs_vg_activate"
19925 #: ../src/guestfs-actions.pod:7060
19929 " guestfs_vg_activate (guestfs_h *g,\n"
19931 " char *const *volgroups);\n"
19937 #: ../src/guestfs-actions.pod:7065 ../fish/guestfish-actions.pod:4781
19939 "This command activates or (if C<activate> is false) deactivates all logical "
19940 "volumes in the listed volume groups C<volgroups>. If activated, then they "
19941 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
19942 "deactivated, then those devices disappear."
19947 #: ../src/guestfs-actions.pod:7071 ../fish/guestfish-actions.pod:4787
19948 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
19953 #: ../src/guestfs-actions.pod:7073 ../fish/guestfish-actions.pod:4789
19955 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
19956 "activated or deactivated."
19961 #: ../src/guestfs-actions.pod:7080
19962 msgid "guestfs_vg_activate_all"
19967 #: ../src/guestfs-actions.pod:7082
19971 " guestfs_vg_activate_all (guestfs_h *g,\n"
19972 " int activate);\n"
19978 #: ../src/guestfs-actions.pod:7086 ../fish/guestfish-actions.pod:4796
19980 "This command activates or (if C<activate> is false) deactivates all logical "
19981 "volumes in all volume groups. If activated, then they are made known to the "
19982 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
19983 "those devices disappear."
19988 #: ../src/guestfs-actions.pod:7092 ../fish/guestfish-actions.pod:4802
19989 msgid "This command is the same as running C<vgchange -a y|n>"
19994 #: ../src/guestfs-actions.pod:7098
19995 msgid "guestfs_vgcreate"
20000 #: ../src/guestfs-actions.pod:7100
20004 " guestfs_vgcreate (guestfs_h *g,\n"
20005 " const char *volgroup,\n"
20006 " char *const *physvols);\n"
20012 #: ../src/guestfs-actions.pod:7105 ../fish/guestfish-actions.pod:4808
20014 "This creates an LVM volume group called C<volgroup> from the non-empty list "
20015 "of physical volumes C<physvols>."
20020 #: ../src/guestfs-actions.pod:7112
20021 msgid "guestfs_vglvuuids"
20026 #: ../src/guestfs-actions.pod:7114
20030 " guestfs_vglvuuids (guestfs_h *g,\n"
20031 " const char *vgname);\n"
20037 #: ../src/guestfs-actions.pod:7118 ../fish/guestfish-actions.pod:4815
20039 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
20040 "volumes created in this volume group."
20045 #: ../src/guestfs-actions.pod:7121
20047 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
20048 "associate logical volumes and volume groups."
20053 #: ../src/guestfs-actions.pod:7124
20054 msgid "See also C<guestfs_vgpvuuids>."
20059 #: ../src/guestfs-actions.pod:7132
20060 msgid "guestfs_vgpvuuids"
20065 #: ../src/guestfs-actions.pod:7134
20069 " guestfs_vgpvuuids (guestfs_h *g,\n"
20070 " const char *vgname);\n"
20076 #: ../src/guestfs-actions.pod:7138 ../fish/guestfish-actions.pod:4827
20078 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
20079 "volumes that this volume group resides on."
20084 #: ../src/guestfs-actions.pod:7141
20086 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
20087 "associate physical volumes and volume groups."
20092 #: ../src/guestfs-actions.pod:7144
20093 msgid "See also C<guestfs_vglvuuids>."
20098 #: ../src/guestfs-actions.pod:7152
20099 msgid "guestfs_vgremove"
20104 #: ../src/guestfs-actions.pod:7154
20108 " guestfs_vgremove (guestfs_h *g,\n"
20109 " const char *vgname);\n"
20115 #: ../src/guestfs-actions.pod:7158 ../fish/guestfish-actions.pod:4839
20116 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
20121 #: ../src/guestfs-actions.pod:7160 ../fish/guestfish-actions.pod:4841
20123 "This also forcibly removes all logical volumes in the volume group (if any)."
20128 #: ../src/guestfs-actions.pod:7167
20129 msgid "guestfs_vgrename"
20134 #: ../src/guestfs-actions.pod:7169
20138 " guestfs_vgrename (guestfs_h *g,\n"
20139 " const char *volgroup,\n"
20140 " const char *newvolgroup);\n"
20146 #: ../src/guestfs-actions.pod:7174 ../fish/guestfish-actions.pod:4848
20147 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
20152 #: ../src/guestfs-actions.pod:7180
20153 msgid "guestfs_vgs"
20158 #: ../src/guestfs-actions.pod:7182
20162 " guestfs_vgs (guestfs_h *g);\n"
20168 #: ../src/guestfs-actions.pod:7185 ../fish/guestfish-actions.pod:4854
20170 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
20176 #: ../src/guestfs-actions.pod:7188 ../fish/guestfish-actions.pod:4857
20178 "This returns a list of just the volume group names that were detected (eg. "
20184 #: ../src/guestfs-actions.pod:7191
20185 msgid "See also C<guestfs_vgs_full>."
20190 #: ../src/guestfs-actions.pod:7199
20191 msgid "guestfs_vgs_full"
20196 #: ../src/guestfs-actions.pod:7201
20199 " struct guestfs_lvm_vg_list *\n"
20200 " guestfs_vgs_full (guestfs_h *g);\n"
20206 #: ../src/guestfs-actions.pod:7204 ../fish/guestfish-actions.pod:4866
20208 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
20209 "> command. The \"full\" version includes all fields."
20214 #: ../src/guestfs-actions.pod:7207
20216 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
20217 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
20222 #: ../src/guestfs-actions.pod:7213
20223 msgid "guestfs_vgscan"
20228 #: ../src/guestfs-actions.pod:7215
20232 " guestfs_vgscan (guestfs_h *g);\n"
20238 #: ../src/guestfs-actions.pod:7218 ../fish/guestfish-actions.pod:4873
20240 "This rescans all block devices and rebuilds the list of LVM physical "
20241 "volumes, volume groups and logical volumes."
20246 #: ../src/guestfs-actions.pod:7225
20247 msgid "guestfs_vguuid"
20252 #: ../src/guestfs-actions.pod:7227
20256 " guestfs_vguuid (guestfs_h *g,\n"
20257 " const char *vgname);\n"
20263 #: ../src/guestfs-actions.pod:7231 ../fish/guestfish-actions.pod:4880
20264 msgid "This command returns the UUID of the LVM VG named C<vgname>."
20269 #: ../src/guestfs-actions.pod:7238
20270 msgid "guestfs_wait_ready"
20275 #: ../src/guestfs-actions.pod:7240
20279 " guestfs_wait_ready (guestfs_h *g);\n"
20285 #: ../src/guestfs-actions.pod:7243
20286 msgid "This function is a no op."
20291 #: ../src/guestfs-actions.pod:7245
20293 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
20294 "calling C<guestfs_launch> to wait for the launch to complete. However this "
20295 "is no longer necessary because C<guestfs_launch> now does the waiting."
20300 #: ../src/guestfs-actions.pod:7250
20302 "If you see any calls to this function in code then you can just remove them, "
20303 "unless you want to retain compatibility with older versions of the API."
20307 #: ../src/guestfs-actions.pod:7256
20309 "This function is deprecated. In new code, use the L</guestfs_launch> call "
20315 #: ../src/guestfs-actions.pod:7265
20316 msgid "guestfs_wc_c"
20321 #: ../src/guestfs-actions.pod:7267
20325 " guestfs_wc_c (guestfs_h *g,\n"
20326 " const char *path);\n"
20332 #: ../src/guestfs-actions.pod:7271 ../fish/guestfish-actions.pod:4886
20334 "This command counts the characters in a file, using the C<wc -c> external "
20340 #: ../src/guestfs-actions.pod:7278
20341 msgid "guestfs_wc_l"
20346 #: ../src/guestfs-actions.pod:7280
20350 " guestfs_wc_l (guestfs_h *g,\n"
20351 " const char *path);\n"
20357 #: ../src/guestfs-actions.pod:7284 ../fish/guestfish-actions.pod:4893
20359 "This command counts the lines in a file, using the C<wc -l> external command."
20364 #: ../src/guestfs-actions.pod:7291
20365 msgid "guestfs_wc_w"
20370 #: ../src/guestfs-actions.pod:7293
20374 " guestfs_wc_w (guestfs_h *g,\n"
20375 " const char *path);\n"
20381 #: ../src/guestfs-actions.pod:7297 ../fish/guestfish-actions.pod:4900
20383 "This command counts the words in a file, using the C<wc -w> external command."
20388 #: ../src/guestfs-actions.pod:7304
20389 msgid "guestfs_write"
20394 #: ../src/guestfs-actions.pod:7306
20398 " guestfs_write (guestfs_h *g,\n"
20399 " const char *path,\n"
20400 " const char *content,\n"
20401 " size_t content_size);\n"
20407 #: ../src/guestfs-actions.pod:7312 ../fish/guestfish-actions.pod:4907
20409 "This call creates a file called C<path>. The content of the file is the "
20410 "string C<content> (which can contain any 8 bit data)."
20415 #: ../src/guestfs-actions.pod:7322
20416 msgid "guestfs_write_file"
20421 #: ../src/guestfs-actions.pod:7324
20425 " guestfs_write_file (guestfs_h *g,\n"
20426 " const char *path,\n"
20427 " const char *content,\n"
20434 #: ../src/guestfs-actions.pod:7330 ../fish/guestfish-actions.pod:4917
20436 "This call creates a file called C<path>. The contents of the file is the "
20437 "string C<content> (which can contain any 8 bit data), with length C<size>."
20442 #: ../src/guestfs-actions.pod:7334 ../fish/guestfish-actions.pod:4921
20444 "As a special case, if C<size> is C<0> then the length is calculated using "
20445 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
20450 #: ../src/guestfs-actions.pod:7338 ../fish/guestfish-actions.pod:4925
20452 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
20453 "I<not> work, even if the length is specified."
20457 #: ../src/guestfs-actions.pod:7346
20459 "This function is deprecated. In new code, use the L</guestfs_write> call "
20465 #: ../src/guestfs-actions.pod:7355
20466 msgid "guestfs_zegrep"
20471 #: ../src/guestfs-actions.pod:7357
20475 " guestfs_zegrep (guestfs_h *g,\n"
20476 " const char *regex,\n"
20477 " const char *path);\n"
20483 #: ../src/guestfs-actions.pod:7362 ../fish/guestfish-actions.pod:4942
20485 "This calls the external C<zegrep> program and returns the matching lines."
20490 #: ../src/guestfs-actions.pod:7374
20491 msgid "guestfs_zegrepi"
20496 #: ../src/guestfs-actions.pod:7376
20500 " guestfs_zegrepi (guestfs_h *g,\n"
20501 " const char *regex,\n"
20502 " const char *path);\n"
20508 #: ../src/guestfs-actions.pod:7381 ../fish/guestfish-actions.pod:4952
20510 "This calls the external C<zegrep -i> program and returns the matching lines."
20515 #: ../src/guestfs-actions.pod:7393
20516 msgid "guestfs_zero"
20521 #: ../src/guestfs-actions.pod:7395
20525 " guestfs_zero (guestfs_h *g,\n"
20526 " const char *device);\n"
20532 #: ../src/guestfs-actions.pod:7399 ../fish/guestfish-actions.pod:4962
20533 msgid "This command writes zeroes over the first few blocks of C<device>."
20538 #: ../src/guestfs-actions.pod:7401 ../fish/guestfish-actions.pod:4964
20540 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
20541 "securely wipe the device). It should be sufficient to remove any partition "
20542 "tables, filesystem superblocks and so on."
20547 #: ../src/guestfs-actions.pod:7405
20548 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
20553 #: ../src/guestfs-actions.pod:7416
20554 msgid "guestfs_zero_device"
20559 #: ../src/guestfs-actions.pod:7418
20563 " guestfs_zero_device (guestfs_h *g,\n"
20564 " const char *device);\n"
20570 #: ../src/guestfs-actions.pod:7422
20572 "This command writes zeroes over the entire C<device>. Compare with "
20573 "C<guestfs_zero> which just zeroes the first few blocks of a device."
20578 #: ../src/guestfs-actions.pod:7436
20579 msgid "(Added in 1.3.1)"
20584 #: ../src/guestfs-actions.pod:7438
20585 msgid "guestfs_zerofree"
20590 #: ../src/guestfs-actions.pod:7440
20594 " guestfs_zerofree (guestfs_h *g,\n"
20595 " const char *device);\n"
20601 #: ../src/guestfs-actions.pod:7444 ../fish/guestfish-actions.pod:4985
20603 "This runs the I<zerofree> program on C<device>. This program claims to zero "
20604 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
20605 "possible to compress the filesystem more effectively."
20610 #: ../src/guestfs-actions.pod:7449 ../fish/guestfish-actions.pod:4990
20611 msgid "You should B<not> run this program if the filesystem is mounted."
20616 #: ../src/guestfs-actions.pod:7452 ../fish/guestfish-actions.pod:4993
20618 "It is possible that using this program can damage the filesystem or data on "
20624 #: ../src/guestfs-actions.pod:7459
20625 msgid "guestfs_zfgrep"
20630 #: ../src/guestfs-actions.pod:7461
20634 " guestfs_zfgrep (guestfs_h *g,\n"
20635 " const char *pattern,\n"
20636 " const char *path);\n"
20642 #: ../src/guestfs-actions.pod:7466 ../fish/guestfish-actions.pod:5000
20644 "This calls the external C<zfgrep> program and returns the matching lines."
20649 #: ../src/guestfs-actions.pod:7478
20650 msgid "guestfs_zfgrepi"
20655 #: ../src/guestfs-actions.pod:7480
20659 " guestfs_zfgrepi (guestfs_h *g,\n"
20660 " const char *pattern,\n"
20661 " const char *path);\n"
20667 #: ../src/guestfs-actions.pod:7485 ../fish/guestfish-actions.pod:5010
20669 "This calls the external C<zfgrep -i> program and returns the matching lines."
20674 #: ../src/guestfs-actions.pod:7497
20675 msgid "guestfs_zfile"
20680 #: ../src/guestfs-actions.pod:7499
20684 " guestfs_zfile (guestfs_h *g,\n"
20685 " const char *meth,\n"
20686 " const char *path);\n"
20692 #: ../src/guestfs-actions.pod:7504 ../fish/guestfish-actions.pod:5020
20694 "This command runs C<file> after first decompressing C<path> using C<method>."
20699 #: ../src/guestfs-actions.pod:7507 ../fish/guestfish-actions.pod:5023
20700 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
20705 #: ../src/guestfs-actions.pod:7509
20707 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
20712 #: ../src/guestfs-actions.pod:7515
20714 "This function is deprecated. In new code, use the L</guestfs_file> call "
20720 #: ../src/guestfs-actions.pod:7524
20721 msgid "guestfs_zgrep"
20726 #: ../src/guestfs-actions.pod:7526
20730 " guestfs_zgrep (guestfs_h *g,\n"
20731 " const char *regex,\n"
20732 " const char *path);\n"
20738 #: ../src/guestfs-actions.pod:7531 ../fish/guestfish-actions.pod:5039
20740 "This calls the external C<zgrep> program and returns the matching lines."
20745 #: ../src/guestfs-actions.pod:7543
20746 msgid "guestfs_zgrepi"
20751 #: ../src/guestfs-actions.pod:7545
20755 " guestfs_zgrepi (guestfs_h *g,\n"
20756 " const char *regex,\n"
20757 " const char *path);\n"
20763 #: ../src/guestfs-actions.pod:7550 ../fish/guestfish-actions.pod:5049
20765 "This calls the external C<zgrep -i> program and returns the matching lines."
20770 #: ../src/guestfs-availability.pod:3
20776 #: ../src/guestfs-availability.pod:5
20778 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
20779 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
20780 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
20781 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
20782 "L</guestfs_aug_save> L</guestfs_aug_set>"
20786 #: ../src/guestfs-availability.pod:21
20791 #: ../src/guestfs-availability.pod:23
20792 msgid "The following functions: L</guestfs_grub_install>"
20797 #: ../src/guestfs-availability.pod:26
20803 #: ../src/guestfs-availability.pod:28
20805 "The following functions: L</guestfs_inotify_add_watch> L</"
20806 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
20807 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
20812 #: ../src/guestfs-availability.pod:36
20813 msgid "B<linuxfsuuid>"
20818 #: ../src/guestfs-availability.pod:38
20820 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
20821 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
20826 #: ../src/guestfs-availability.pod:45
20827 msgid "B<linuxmodules>"
20832 #: ../src/guestfs-availability.pod:47
20833 msgid "The following functions: L</guestfs_modprobe>"
20838 #: ../src/guestfs-availability.pod:50
20839 msgid "B<linuxxattrs>"
20844 #: ../src/guestfs-availability.pod:52
20846 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
20847 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
20848 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
20849 "guestfs_setxattr>"
20854 #: ../src/guestfs-availability.pod:63
20860 #: ../src/guestfs-availability.pod:65
20862 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
20863 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
20864 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
20869 #: ../src/guestfs-availability.pod:74
20875 #: ../src/guestfs-availability.pod:76
20877 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
20878 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
20879 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
20880 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
20881 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
20882 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
20883 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
20888 #: ../src/guestfs-availability.pod:99
20894 #: ../src/guestfs-availability.pod:101
20896 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
20897 "guestfs_mknod_b> L</guestfs_mknod_c>"
20902 #: ../src/guestfs-availability.pod:107
20908 #: ../src/guestfs-availability.pod:109
20909 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
20914 #: ../src/guestfs-availability.pod:112
20915 msgid "B<ntfsprogs>"
20920 #: ../src/guestfs-availability.pod:114
20922 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
20927 #: ../src/guestfs-availability.pod:118
20928 msgid "B<realpath>"
20933 #: ../src/guestfs-availability.pod:120
20934 msgid "The following functions: L</guestfs_realpath>"
20939 #: ../src/guestfs-availability.pod:123
20945 #: ../src/guestfs-availability.pod:125
20947 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
20948 "guestfs_scrub_freespace>"
20953 #: ../src/guestfs-availability.pod:130
20959 #: ../src/guestfs-availability.pod:132
20960 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
20965 #: ../src/guestfs-availability.pod:136
20971 #: ../src/guestfs-availability.pod:138
20972 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
20977 #: ../src/guestfs-availability.pod:142
20978 msgid "B<zerofree>"
20983 #: ../src/guestfs-availability.pod:144
20984 msgid "The following functions: L</guestfs_zerofree>"
20989 #: ../src/guestfs-structs.pod:1
20990 msgid "guestfs_int_bool"
20995 #: ../src/guestfs-structs.pod:3
20998 " struct guestfs_int_bool {\n"
21007 #: ../src/guestfs-structs.pod:8
21010 " struct guestfs_int_bool_list {\n"
21011 " uint32_t len; /* Number of elements in list. */\n"
21012 " struct guestfs_int_bool *val; /* Elements. */\n"
21019 #: ../src/guestfs-structs.pod:13
21022 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
21023 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
21029 #: ../src/guestfs-structs.pod:16
21030 msgid "guestfs_lvm_pv"
21035 #: ../src/guestfs-structs.pod:18
21038 " struct guestfs_lvm_pv {\n"
21039 " char *pv_name;\n"
21040 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
21041 " char pv_uuid[32];\n"
21043 " uint64_t pv_size;\n"
21044 " uint64_t dev_size;\n"
21045 " uint64_t pv_free;\n"
21046 " uint64_t pv_used;\n"
21047 " char *pv_attr;\n"
21048 " int64_t pv_pe_count;\n"
21049 " int64_t pv_pe_alloc_count;\n"
21050 " char *pv_tags;\n"
21051 " uint64_t pe_start;\n"
21052 " int64_t pv_mda_count;\n"
21053 " uint64_t pv_mda_free;\n"
21060 #: ../src/guestfs-structs.pod:36
21063 " struct guestfs_lvm_pv_list {\n"
21064 " uint32_t len; /* Number of elements in list. */\n"
21065 " struct guestfs_lvm_pv *val; /* Elements. */\n"
21072 #: ../src/guestfs-structs.pod:41
21075 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
21076 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
21082 #: ../src/guestfs-structs.pod:44
21083 msgid "guestfs_lvm_vg"
21088 #: ../src/guestfs-structs.pod:46
21091 " struct guestfs_lvm_vg {\n"
21092 " char *vg_name;\n"
21093 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
21094 " char vg_uuid[32];\n"
21096 " char *vg_attr;\n"
21097 " uint64_t vg_size;\n"
21098 " uint64_t vg_free;\n"
21099 " char *vg_sysid;\n"
21100 " uint64_t vg_extent_size;\n"
21101 " int64_t vg_extent_count;\n"
21102 " int64_t vg_free_count;\n"
21103 " int64_t max_lv;\n"
21104 " int64_t max_pv;\n"
21105 " int64_t pv_count;\n"
21106 " int64_t lv_count;\n"
21107 " int64_t snap_count;\n"
21108 " int64_t vg_seqno;\n"
21109 " char *vg_tags;\n"
21110 " int64_t vg_mda_count;\n"
21111 " uint64_t vg_mda_free;\n"
21118 #: ../src/guestfs-structs.pod:69
21121 " struct guestfs_lvm_vg_list {\n"
21122 " uint32_t len; /* Number of elements in list. */\n"
21123 " struct guestfs_lvm_vg *val; /* Elements. */\n"
21130 #: ../src/guestfs-structs.pod:74
21133 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
21134 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
21140 #: ../src/guestfs-structs.pod:77
21141 msgid "guestfs_lvm_lv"
21146 #: ../src/guestfs-structs.pod:79
21149 " struct guestfs_lvm_lv {\n"
21150 " char *lv_name;\n"
21151 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
21152 " char lv_uuid[32];\n"
21153 " char *lv_attr;\n"
21154 " int64_t lv_major;\n"
21155 " int64_t lv_minor;\n"
21156 " int64_t lv_kernel_major;\n"
21157 " int64_t lv_kernel_minor;\n"
21158 " uint64_t lv_size;\n"
21159 " int64_t seg_count;\n"
21161 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
21162 " float snap_percent;\n"
21163 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
21164 " float copy_percent;\n"
21165 " char *move_pv;\n"
21166 " char *lv_tags;\n"
21167 " char *mirror_log;\n"
21168 " char *modules;\n"
21175 #: ../src/guestfs-structs.pod:101
21178 " struct guestfs_lvm_lv_list {\n"
21179 " uint32_t len; /* Number of elements in list. */\n"
21180 " struct guestfs_lvm_lv *val; /* Elements. */\n"
21187 #: ../src/guestfs-structs.pod:106
21190 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
21191 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
21197 #: ../src/guestfs-structs.pod:111
21200 " struct guestfs_stat {\n"
21204 " int64_t nlink;\n"
21209 " int64_t blksize;\n"
21210 " int64_t blocks;\n"
21211 " int64_t atime;\n"
21212 " int64_t mtime;\n"
21213 " int64_t ctime;\n"
21220 #: ../src/guestfs-structs.pod:127
21223 " struct guestfs_stat_list {\n"
21224 " uint32_t len; /* Number of elements in list. */\n"
21225 " struct guestfs_stat *val; /* Elements. */\n"
21232 #: ../src/guestfs-structs.pod:132
21235 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
21236 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
21242 #: ../src/guestfs-structs.pod:137
21245 " struct guestfs_statvfs {\n"
21246 " int64_t bsize;\n"
21247 " int64_t frsize;\n"
21248 " int64_t blocks;\n"
21249 " int64_t bfree;\n"
21250 " int64_t bavail;\n"
21251 " int64_t files;\n"
21252 " int64_t ffree;\n"
21253 " int64_t favail;\n"
21256 " int64_t namemax;\n"
21263 #: ../src/guestfs-structs.pod:151
21266 " struct guestfs_statvfs_list {\n"
21267 " uint32_t len; /* Number of elements in list. */\n"
21268 " struct guestfs_statvfs *val; /* Elements. */\n"
21275 #: ../src/guestfs-structs.pod:156
21278 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
21279 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
21285 #: ../src/guestfs-structs.pod:159
21286 msgid "guestfs_dirent"
21291 #: ../src/guestfs-structs.pod:161
21294 " struct guestfs_dirent {\n"
21304 #: ../src/guestfs-structs.pod:167
21307 " struct guestfs_dirent_list {\n"
21308 " uint32_t len; /* Number of elements in list. */\n"
21309 " struct guestfs_dirent *val; /* Elements. */\n"
21316 #: ../src/guestfs-structs.pod:172
21319 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
21320 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
21326 #: ../src/guestfs-structs.pod:177
21329 " struct guestfs_version {\n"
21330 " int64_t major;\n"
21331 " int64_t minor;\n"
21332 " int64_t release;\n"
21340 #: ../src/guestfs-structs.pod:184
21343 " struct guestfs_version_list {\n"
21344 " uint32_t len; /* Number of elements in list. */\n"
21345 " struct guestfs_version *val; /* Elements. */\n"
21352 #: ../src/guestfs-structs.pod:189
21355 " void guestfs_free_version (struct guestfs_free_version *);\n"
21356 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
21362 #: ../src/guestfs-structs.pod:192
21363 msgid "guestfs_xattr"
21368 #: ../src/guestfs-structs.pod:194
21371 " struct guestfs_xattr {\n"
21372 " char *attrname;\n"
21373 " /* The next two fields describe a byte array. */\n"
21374 " uint32_t attrval_len;\n"
21375 " char *attrval;\n"
21382 #: ../src/guestfs-structs.pod:201
21385 " struct guestfs_xattr_list {\n"
21386 " uint32_t len; /* Number of elements in list. */\n"
21387 " struct guestfs_xattr *val; /* Elements. */\n"
21394 #: ../src/guestfs-structs.pod:206
21397 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
21398 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
21404 #: ../src/guestfs-structs.pod:209
21405 msgid "guestfs_inotify_event"
21410 #: ../src/guestfs-structs.pod:211
21413 " struct guestfs_inotify_event {\n"
21414 " int64_t in_wd;\n"
21415 " uint32_t in_mask;\n"
21416 " uint32_t in_cookie;\n"
21417 " char *in_name;\n"
21424 #: ../src/guestfs-structs.pod:218
21427 " struct guestfs_inotify_event_list {\n"
21428 " uint32_t len; /* Number of elements in list. */\n"
21429 " struct guestfs_inotify_event *val; /* Elements. */\n"
21436 #: ../src/guestfs-structs.pod:223
21439 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
21440 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
21446 #: ../src/guestfs-structs.pod:226
21447 msgid "guestfs_partition"
21452 #: ../src/guestfs-structs.pod:228
21455 " struct guestfs_partition {\n"
21456 " int32_t part_num;\n"
21457 " uint64_t part_start;\n"
21458 " uint64_t part_end;\n"
21459 " uint64_t part_size;\n"
21466 #: ../src/guestfs-structs.pod:235
21469 " struct guestfs_partition_list {\n"
21470 " uint32_t len; /* Number of elements in list. */\n"
21471 " struct guestfs_partition *val; /* Elements. */\n"
21478 #: ../src/guestfs-structs.pod:240
21481 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
21482 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
21488 #: ../src/guestfs-structs.pod:243
21489 msgid "guestfs_application"
21494 #: ../src/guestfs-structs.pod:245
21497 " struct guestfs_application {\n"
21498 " char *app_name;\n"
21499 " char *app_display_name;\n"
21500 " int32_t app_epoch;\n"
21501 " char *app_version;\n"
21502 " char *app_release;\n"
21503 " char *app_install_path;\n"
21504 " char *app_trans_path;\n"
21505 " char *app_publisher;\n"
21506 " char *app_url;\n"
21507 " char *app_source_package;\n"
21508 " char *app_summary;\n"
21509 " char *app_description;\n"
21516 #: ../src/guestfs-structs.pod:260
21519 " struct guestfs_application_list {\n"
21520 " uint32_t len; /* Number of elements in list. */\n"
21521 " struct guestfs_application *val; /* Elements. */\n"
21528 #: ../src/guestfs-structs.pod:265
21531 " void guestfs_free_application (struct guestfs_free_application *);\n"
21532 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
21538 #: ../fish/guestfish.pod:5
21539 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
21544 #: ../fish/guestfish.pod:9
21547 " guestfish [--options] [commands]\n"
21553 #: ../fish/guestfish.pod:11
21562 #: ../fish/guestfish.pod:13
21565 " guestfish [--ro|--rw] -a disk.img\n"
21571 #: ../fish/guestfish.pod:15
21574 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
21580 #: ../fish/guestfish.pod:17
21583 " guestfish -d libvirt-domain\n"
21589 #: ../fish/guestfish.pod:19
21592 " guestfish [--ro|--rw] -a disk.img -i\n"
21598 #: ../fish/guestfish.pod:21
21601 " guestfish -d libvirt-domain -i\n"
21607 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
21608 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
21614 #: ../fish/guestfish.pod:25
21616 "Using guestfish in read/write mode on live virtual machines can be "
21617 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
21618 "option to use guestfish safely if the disk image or virtual machine might be "
21624 #: ../fish/guestfish.pod:32
21626 "Guestfish is a shell and command-line tool for examining and modifying "
21627 "virtual machine filesystems. It uses libguestfs and exposes all of the "
21628 "functionality of the guestfs API, see L<guestfs(3)>."
21633 #: ../fish/guestfish.pod:36
21635 "Guestfish gives you structured access to the libguestfs API, from shell "
21636 "scripts or the command line or interactively. If you want to rescue a "
21637 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
21643 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:958
21644 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:63 ../tools/virt-tar.pl:50
21650 #: ../fish/guestfish.pod:43
21651 msgid "As an interactive shell"
21656 #: ../fish/guestfish.pod:45
21665 #: ../fish/guestfish.pod:47
21668 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
21669 " editing virtual machine filesystems.\n"
21675 #: ../fish/guestfish.pod:50
21678 " Type: 'help' for a list of commands\n"
21679 " 'man' to read the manual\n"
21680 " 'quit' to quit the shell\n"
21686 #: ../fish/guestfish.pod:54
21689 " ><fs> add-ro disk.img\n"
21691 " ><fs> list-filesystems\n"
21692 " /dev/sda1: ext4\n"
21693 " /dev/vg_guest/lv_root: ext4\n"
21694 " /dev/vg_guest/lv_swap: swap\n"
21695 " ><fs> mount /dev/vg_guest/lv_root /\n"
21696 " ><fs> cat /etc/fstab\n"
21698 " # Created by anaconda\n"
21706 #: ../fish/guestfish.pod:67
21707 msgid "From shell scripts"
21712 #: ../fish/guestfish.pod:69
21713 msgid "Create a new C</etc/motd> file in a guest or disk image:"
21718 #: ../fish/guestfish.pod:71
21721 " guestfish <<_EOF_\n"
21724 " mount /dev/vg_guest/lv_root /\n"
21725 " write /etc/motd \"Welcome, new users\"\n"
21732 #: ../fish/guestfish.pod:78
21733 msgid "List the LVM logical volumes in a disk image:"
21738 #: ../fish/guestfish.pod:80
21741 " guestfish -a disk.img --ro <<_EOF_\n"
21750 #: ../fish/guestfish.pod:85
21751 msgid "List all the filesystems in a disk image:"
21756 #: ../fish/guestfish.pod:87
21759 " guestfish -a disk.img --ro <<_EOF_\n"
21761 " list-filesystems\n"
21768 #: ../fish/guestfish.pod:92
21769 msgid "On one command line"
21774 #: ../fish/guestfish.pod:94
21775 msgid "Update C</etc/resolv.conf> in a guest:"
21780 #: ../fish/guestfish.pod:96
21784 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
21785 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
21791 #: ../fish/guestfish.pod:100
21792 msgid "Edit C</boot/grub/grub.conf> interactively:"
21797 #: ../fish/guestfish.pod:102
21800 " guestfish --rw --add disk.img \\\n"
21801 " --mount /dev/vg_guest/lv_root \\\n"
21802 " --mount /dev/sda1:/boot \\\n"
21803 " edit /boot/grub/grub.conf\n"
21809 #: ../fish/guestfish.pod:107
21810 msgid "Mount disks automatically"
21815 #: ../fish/guestfish.pod:109
21817 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
21822 #: ../fish/guestfish.pod:112
21825 " guestfish --ro -a disk.img -i cat /etc/group\n"
21831 #: ../fish/guestfish.pod:114
21834 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
21840 #: ../fish/guestfish.pod:116
21841 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
21846 #: ../fish/guestfish.pod:118
21849 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
21855 #: ../fish/guestfish.pod:120
21856 msgid "As a script interpreter"
21861 #: ../fish/guestfish.pod:122
21862 msgid "Create a 100MB disk containing an ext2-formatted partition:"
21867 #: ../fish/guestfish.pod:124
21870 " #!/usr/bin/guestfish -f\n"
21871 " sparse test1.img 100M\n"
21873 " part-disk /dev/sda mbr\n"
21874 " mkfs ext2 /dev/sda1\n"
21880 #: ../fish/guestfish.pod:130
21881 msgid "Start with a prepared disk"
21886 #: ../fish/guestfish.pod:132
21888 "An alternate way to create a 100MB disk called C<test1.img> containing a "
21889 "single ext2-formatted partition:"
21894 #: ../fish/guestfish.pod:135
21897 " guestfish -N fs\n"
21903 #: ../fish/guestfish.pod:137
21904 msgid "To list what is available do:"
21909 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:949
21912 " guestfish -N help | less\n"
21918 #: ../fish/guestfish.pod:141
21919 msgid "Remote control"
21924 #: ../fish/guestfish.pod:143
21927 " eval \"`guestfish --listen`\"\n"
21928 " guestfish --remote add-ro disk.img\n"
21929 " guestfish --remote run\n"
21930 " guestfish --remote lvs\n"
21936 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
21937 #: ../fuse/guestmount.pod:83 ../tools/virt-edit.pl:81
21938 #: ../tools/virt-win-reg.pl:96 ../tools/virt-list-filesystems.pl:53
21939 #: ../tools/virt-tar.pl:103 ../tools/virt-make-fs.pl:153
21940 #: ../tools/virt-list-partitions.pl:54
21946 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:141
21947 #: ../tools/virt-edit.pl:89 ../tools/virt-win-reg.pl:104
21948 #: ../tools/virt-list-filesystems.pl:61 ../tools/virt-tar.pl:111
21949 #: ../tools/virt-make-fs.pl:161 ../tools/virt-list-partitions.pl:62
21955 #: ../fish/guestfish.pod:154
21956 msgid "Displays general help on options."
21961 #: ../fish/guestfish.pod:156
21967 #: ../fish/guestfish.pod:158
21968 msgid "B<--cmd-help>"
21973 #: ../fish/guestfish.pod:160
21974 msgid "Lists all available guestfish commands."
21979 #: ../fish/guestfish.pod:162
21985 #: ../fish/guestfish.pod:164
21986 msgid "B<--cmd-help cmd>"
21991 #: ../fish/guestfish.pod:166
21992 msgid "Displays detailed help on a single command C<cmd>."
21997 #: ../fish/guestfish.pod:168
21998 msgid "B<-a image>"
22003 #: ../fish/guestfish.pod:170
22004 msgid "B<--add image>"
22009 #: ../fish/guestfish.pod:172
22010 msgid "Add a block device or virtual machine image to the shell."
22015 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:91
22017 "The format of the disk image is auto-detected. To override this and force a "
22018 "particular format use the I<--format=..> option."
22022 #: ../fish/guestfish.pod:177
22024 "Using this flag is mostly equivalent to using the C<add> command, with "
22025 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
22026 "the I<--format=...> flag was given."
22031 #: ../fish/guestfish.pod:181
22037 #: ../fish/guestfish.pod:183
22038 msgid "B<--connect URI>"
22043 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:96
22045 "When used in conjunction with the I<-d> option, this specifies the libvirt "
22046 "URI to use. The default is to use the default libvirt connection."
22051 #: ../fish/guestfish.pod:189
22057 #: ../fish/guestfish.pod:191
22059 "If using the I<--listen> option and a csh-like shell, use this option. See "
22060 "section L</REMOTE CONTROL AND CSH> below."
22065 #: ../fish/guestfish.pod:194
22066 msgid "B<-d libvirt-domain>"
22071 #: ../fish/guestfish.pod:196
22072 msgid "B<--domain libvirt-domain>"
22077 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:102
22079 "Add disks from the named libvirt domain. If the I<--ro> option is also "
22080 "used, then any libvirt domain can be used. However in write mode, only "
22081 "libvirt domains which are shut down can be named here."
22086 #: ../fish/guestfish.pod:202
22088 "Using this flag is mostly equivalent to using the C<add-domain> command, "
22089 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
22090 "if the I<--format:...> flag was given."
22095 #: ../fish/guestfish.pod:206
22101 #: ../fish/guestfish.pod:208
22102 msgid "B<--no-dest-paths>"
22107 #: ../fish/guestfish.pod:210
22109 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
22110 "to hit the tab key to complete paths on the guest filesystem, but this "
22111 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
22112 "allow this feature to be disabled."
22117 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:118
22118 msgid "B<--echo-keys>"
22123 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:120
22125 "When prompting for keys and passphrases, guestfish normally turns echoing "
22126 "off so you cannot see what you are typing. If you are not worried about "
22127 "Tempest attacks and there is no one else in the room you can specify this "
22128 "flag to see what you are typing."
22133 #: ../fish/guestfish.pod:222
22139 #: ../fish/guestfish.pod:224
22140 msgid "B<--file file>"
22145 #: ../fish/guestfish.pod:226
22146 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
22151 #: ../fish/guestfish.pod:229
22154 " #!/usr/bin/guestfish -f\n"
22160 #: ../fish/guestfish.pod:231
22161 msgid "B<--format=raw|qcow2|..>"
22166 #: ../fish/guestfish.pod:233
22167 msgid "B<--format>"
22172 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:127
22174 "The default for the I<-a> option is to auto-detect the format of the disk "
22175 "image. Using this forces the disk format for I<-a> options which follow on "
22176 "the command line. Using I<--format> with no argument switches back to auto-"
22177 "detection for subsequent I<-a> options."
22182 #: ../fish/guestfish.pod:242
22185 " guestfish --format=raw -a disk.img\n"
22191 #: ../fish/guestfish.pod:244
22192 msgid "forces raw format (no auto-detection) for C<disk.img>."
22197 #: ../fish/guestfish.pod:246
22200 " guestfish --format=raw -a disk.img --format -a another.img\n"
22206 #: ../fish/guestfish.pod:248
22208 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
22209 "detection for C<another.img>."
22214 #: ../fish/guestfish.pod:251
22216 "If you have untrusted raw-format guest disk images, you should use this "
22217 "option to specify the disk format. This avoids a possible security problem "
22218 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
22223 #: ../fish/guestfish.pod:256
22229 #: ../fish/guestfish.pod:258
22230 msgid "B<--inspector>"
22235 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:147
22237 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
22238 "system and mount filesystems as they would be mounted on the real virtual "
22244 #: ../fish/guestfish.pod:264
22245 msgid "Typical usage is either:"
22250 #: ../fish/guestfish.pod:266
22253 " guestfish -d myguest -i\n"
22259 #: ../fish/guestfish.pod:268
22260 msgid "(for an inactive libvirt domain called I<myguest>), or:"
22265 #: ../fish/guestfish.pod:270
22268 " guestfish --ro -d myguest -i\n"
22274 #: ../fish/guestfish.pod:272
22275 msgid "(for active domains, readonly), or specify the block device directly:"
22280 #: ../fish/guestfish.pod:274
22283 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
22289 #: ../fish/guestfish.pod:276
22291 "Note that the command line syntax changed slightly over older versions of "
22292 "guestfish. You can still use the old syntax:"
22297 #: ../fish/guestfish.pod:279
22300 " guestfish [--ro] -i disk.img\n"
22306 #: ../fish/guestfish.pod:281
22309 " guestfish [--ro] -i libvirt-domain\n"
22315 #: ../fish/guestfish.pod:283
22317 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
22318 "then using other commands to mount the filesystems that were found."
22323 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:151
22324 msgid "B<--keys-from-stdin>"
22329 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:153
22331 "Read key or passphrase parameters from stdin. The default is to try to read "
22332 "passphrases from the user by opening C</dev/tty>."
22337 #: ../fish/guestfish.pod:292
22338 msgid "B<--listen>"
22343 #: ../fish/guestfish.pod:294
22345 "Fork into the background and listen for remote commands. See section L</"
22346 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
22350 #: ../fish/guestfish.pod:297 ../fuse/guestmount.pod:156
22355 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:158
22357 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
22358 "ATTACHING TO RUNNING DAEMONS>)."
22362 #: ../fish/guestfish.pod:302 ../fuse/guestmount.pod:161
22363 msgid "B<-m dev[:mountpoint[:options]]>"
22367 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:163
22368 msgid "B<--mount dev[:mountpoint[:options]]>"
22373 #: ../fish/guestfish.pod:306
22374 msgid "Mount the named partition or logical volume on the given mountpoint."
22379 #: ../fish/guestfish.pod:308
22380 msgid "If the mountpoint is omitted, it defaults to C</>."
22385 #: ../fish/guestfish.pod:310
22386 msgid "You have to mount something on C</> before most commands will work."
22391 #: ../fish/guestfish.pod:312
22393 "If any I<-m> or I<--mount> options are given, the guest is automatically "
22399 #: ../fish/guestfish.pod:315
22401 "If you don't know what filesystems a disk image contains, you can either run "
22402 "guestfish without this option, then list the partitions, filesystems and LVs "
22403 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
22404 "commands), or you can use the L<virt-filesystems(1)> program."
22408 #: ../fish/guestfish.pod:321 ../fuse/guestmount.pod:171
22410 "The third (and rarely used) part of the mount parameter is the list of mount "
22411 "options used to mount the underlying filesystem. If this is not given, then "
22412 "the mount options are either the empty string or C<ro> (the latter if the "
22413 "I<--ro> flag is used). By specifying the mount options, you override this "
22414 "default choice. Probably the only time you would use this is to enable ACLs "
22415 "and/or extended attributes if the filesystem can support them:"
22419 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:179
22422 " -m /dev/sda1:/:acl,user_xattr\n"
22427 #: ../fish/guestfish.pod:331
22428 msgid "Using this flag is equivalent to using the C<mount-options> command."
22433 #: ../fish/guestfish.pod:333
22439 #: ../fish/guestfish.pod:335
22440 msgid "B<--no-sync>"
22445 #: ../fish/guestfish.pod:337
22447 "Disable autosync. This is enabled by default. See the discussion of "
22448 "autosync in the L<guestfs(3)> manpage."
22453 #: ../fish/guestfish.pod:340
22459 #: ../fish/guestfish.pod:342
22460 msgid "B<--new type>"
22465 #: ../fish/guestfish.pod:344
22471 #: ../fish/guestfish.pod:346
22473 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
22474 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
22475 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
22481 #: ../fish/guestfish.pod:351
22482 msgid "B<--progress-bars>"
22487 #: ../fish/guestfish.pod:353
22488 msgid "Enable progress bars, even when guestfish is used non-interactively."
22493 #: ../fish/guestfish.pod:355
22495 "Progress bars are enabled by default when guestfish is used as an "
22496 "interactive shell."
22501 #: ../fish/guestfish.pod:358
22502 msgid "B<--no-progress-bars>"
22507 #: ../fish/guestfish.pod:360
22508 msgid "Disable progress bars."
22513 #: ../fish/guestfish.pod:362
22514 msgid "B<--remote[=pid]>"
22519 #: ../fish/guestfish.pod:364
22521 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
22522 "CONTROL GUESTFISH OVER A SOCKET> below."
22527 #: ../fish/guestfish.pod:367
22533 #: ../fish/guestfish.pod:369
22539 #: ../fish/guestfish.pod:371
22541 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
22542 "mounts are done read-only."
22547 #: ../fish/guestfish.pod:374
22549 "The option must always be used if the disk image or virtual machine might be "
22550 "running, and is generally recommended in cases where you don't need write "
22551 "access to the disk."
22556 #: ../fish/guestfish.pod:378
22558 "Note that prepared disk images created with I<-N> are not affected by this "
22559 "option. Also commands like C<add> are not affected - you have to specify "
22560 "the C<readonly:true> option explicitly if you need it."
22565 #: ../fish/guestfish.pod:382
22566 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
22571 #: ../fish/guestfish.pod:384 ../fuse/guestmount.pod:235
22572 msgid "B<--selinux>"
22577 #: ../fish/guestfish.pod:386
22578 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
22583 #: ../fish/guestfish.pod:388
22589 #: ../fish/guestfish.pod:390
22590 msgid "B<--verbose>"
22595 #: ../fish/guestfish.pod:392
22597 "Enable very verbose messages. This is particularly useful if you find a bug."
22602 #: ../fish/guestfish.pod:395
22608 #: ../fish/guestfish.pod:397 ../tools/virt-edit.pl:97
22609 #: ../tools/virt-win-reg.pl:112 ../tools/virt-list-filesystems.pl:69
22610 #: ../tools/virt-tar.pl:119 ../tools/virt-make-fs.pl:169
22611 #: ../tools/virt-list-partitions.pl:70
22612 msgid "B<--version>"
22617 #: ../fish/guestfish.pod:399
22618 msgid "Display the guestfish / libguestfs version number and exit."
22623 #: ../fish/guestfish.pod:401
22629 #: ../fish/guestfish.pod:403
22634 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:249
22636 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
22637 "mounts are done read-write."
22641 #: ../fish/guestfish.pod:408
22642 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
22647 #: ../fish/guestfish.pod:410
22653 #: ../fish/guestfish.pod:412
22654 msgid "Echo each command before executing it."
22659 #: ../fish/guestfish.pod:416
22660 msgid "COMMANDS ON COMMAND LINE"
22665 #: ../fish/guestfish.pod:418
22667 "Any additional (non-option) arguments are treated as commands to execute."
22672 #: ../fish/guestfish.pod:421
22674 "Commands to execute should be separated by a colon (C<:>), where the colon "
22675 "is a separate parameter. Thus:"
22680 #: ../fish/guestfish.pod:424
22683 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
22689 #: ../fish/guestfish.pod:426
22691 "If there are no additional arguments, then we enter a shell, either an "
22692 "interactive shell with a prompt (if the input is a terminal) or a non-"
22693 "interactive shell."
22698 #: ../fish/guestfish.pod:430
22700 "In either command line mode or non-interactive shell, the first command that "
22701 "gives an error causes the whole shell to exit. In interactive mode (with a "
22702 "prompt) if a command fails, you can continue to enter commands."
22707 #: ../fish/guestfish.pod:435
22708 msgid "USING launch (OR run)"
22713 #: ../fish/guestfish.pod:437
22715 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
22716 "then launch it, then mount any disks you need, and finally issue actions/"
22717 "commands. So the general order of the day is:"
22722 #: ../fish/guestfish.pod:445
22723 msgid "add or -a/--add"
22728 #: ../fish/guestfish.pod:449
22729 msgid "launch (aka run)"
22734 #: ../fish/guestfish.pod:453
22735 msgid "mount or -m/--mount"
22740 #: ../fish/guestfish.pod:457
22741 msgid "any other commands"
22746 #: ../fish/guestfish.pod:461
22748 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
22749 "guest before mounting or performing any other commands."
22754 #: ../fish/guestfish.pod:464
22756 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
22757 "I<--new> options were given then C<run> is done automatically, simply "
22758 "because guestfish can't perform the action you asked for without doing this."
22763 #: ../fish/guestfish.pod:469
22764 msgid "OPENING DISKS FOR READ AND WRITE"
22768 #: ../fish/guestfish.pod:471
22770 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
22771 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
22772 "I<-i> and I<-m> open disk images read-only or for writing."
22776 #: ../fish/guestfish.pod:476
22778 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
22779 "opening disk images supplied on the command line for write. To open a disk "
22780 "image read-only you have to do I<-a image --ro>."
22785 #: ../fish/guestfish.pod:480
22787 "This matters: If you accidentally open a live VM disk image writable then "
22788 "you will cause irreversible disk corruption."
22792 #: ../fish/guestfish.pod:483
22794 "By libguestfs 1.12 we intend to change the default the other way. Disk "
22795 "images will be opened read-only. You will have to either specify "
22796 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
22797 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
22798 "access for disk images specified by those other command line options."
22802 #: ../fish/guestfish.pod:490
22804 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
22805 "which does nothing (it is already the default). However it is highly "
22806 "recommended that you use this option to indicate that you need write access, "
22807 "and prepare your scripts for the day when this option will be required for "
22813 #: ../fish/guestfish.pod:496
22815 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
22816 "other libguestfs program apart from guestfish and guestmount."
22821 #: ../fish/guestfish.pod:499
22827 #: ../fish/guestfish.pod:501
22829 "You can quote ordinary parameters using either single or double quotes. For "
22835 #: ../fish/guestfish.pod:504
22838 " add \"file with a space.img\"\n"
22844 #: ../fish/guestfish.pod:506
22847 " rm '/file name'\n"
22853 #: ../fish/guestfish.pod:508
22862 #: ../fish/guestfish.pod:510
22864 "A few commands require a list of strings to be passed. For these, use a "
22865 "whitespace-separated list, enclosed in quotes. Strings containing "
22866 "whitespace to be passed through must be enclosed in single quotes. A "
22867 "literal single quote must be escaped with a backslash."
22872 #: ../fish/guestfish.pod:515
22875 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
22876 " command \"/bin/echo 'foo bar'\"\n"
22877 " command \"/bin/echo \\'foo\\'\"\n"
22883 #: ../fish/guestfish.pod:519
22884 msgid "OPTIONAL ARGUMENTS"
22889 #: ../fish/guestfish.pod:521
22891 "Some commands take optional arguments. These arguments appear in this "
22892 "documentation as C<[argname:..]>. You can use them as in these examples:"
22897 #: ../fish/guestfish.pod:525
22900 " add-drive-opts filename\n"
22906 #: ../fish/guestfish.pod:527
22909 " add-drive-opts filename readonly:true\n"
22915 #: ../fish/guestfish.pod:529
22918 " add-drive-opts filename format:qcow2 readonly:false\n"
22924 #: ../fish/guestfish.pod:531
22926 "Each optional argument can appear at most once. All optional arguments must "
22927 "appear after the required ones."
22932 #: ../fish/guestfish.pod:534
22938 #: ../fish/guestfish.pod:536
22940 "This section applies to all commands which can take integers as parameters."
22945 #: ../fish/guestfish.pod:539
22946 msgid "SIZE SUFFIX"
22951 #: ../fish/guestfish.pod:541
22953 "When the command takes a parameter measured in bytes, you can use one of the "
22954 "following suffixes to specify kilobytes, megabytes and larger sizes:"
22959 #: ../fish/guestfish.pod:547
22960 msgid "B<k> or B<K> or B<KiB>"
22965 #: ../fish/guestfish.pod:549
22966 msgid "The size in kilobytes (multiplied by 1024)."
22971 #: ../fish/guestfish.pod:551
22977 #: ../fish/guestfish.pod:553
22978 msgid "The size in SI 1000 byte units."
22983 #: ../fish/guestfish.pod:555
22984 msgid "B<M> or B<MiB>"
22989 #: ../fish/guestfish.pod:557
22990 msgid "The size in megabytes (multiplied by 1048576)."
22995 #: ../fish/guestfish.pod:559
23001 #: ../fish/guestfish.pod:561
23002 msgid "The size in SI 1000000 byte units."
23007 #: ../fish/guestfish.pod:563
23008 msgid "B<G> or B<GiB>"
23013 #: ../fish/guestfish.pod:565
23014 msgid "The size in gigabytes (multiplied by 2**30)."
23019 #: ../fish/guestfish.pod:567
23025 #: ../fish/guestfish.pod:569
23026 msgid "The size in SI 10**9 byte units."
23031 #: ../fish/guestfish.pod:571
23032 msgid "B<T> or B<TiB>"
23037 #: ../fish/guestfish.pod:573
23038 msgid "The size in terabytes (multiplied by 2**40)."
23043 #: ../fish/guestfish.pod:575
23049 #: ../fish/guestfish.pod:577
23050 msgid "The size in SI 10**12 byte units."
23055 #: ../fish/guestfish.pod:579
23056 msgid "B<P> or B<PiB>"
23061 #: ../fish/guestfish.pod:581
23062 msgid "The size in petabytes (multiplied by 2**50)."
23067 #: ../fish/guestfish.pod:583
23073 #: ../fish/guestfish.pod:585
23074 msgid "The size in SI 10**15 byte units."
23079 #: ../fish/guestfish.pod:587
23080 msgid "B<E> or B<EiB>"
23085 #: ../fish/guestfish.pod:589
23086 msgid "The size in exabytes (multiplied by 2**60)."
23091 #: ../fish/guestfish.pod:591
23097 #: ../fish/guestfish.pod:593
23098 msgid "The size in SI 10**18 byte units."
23103 #: ../fish/guestfish.pod:595
23104 msgid "B<Z> or B<ZiB>"
23109 #: ../fish/guestfish.pod:597
23110 msgid "The size in zettabytes (multiplied by 2**70)."
23115 #: ../fish/guestfish.pod:599
23121 #: ../fish/guestfish.pod:601
23122 msgid "The size in SI 10**21 byte units."
23127 #: ../fish/guestfish.pod:603
23128 msgid "B<Y> or B<YiB>"
23133 #: ../fish/guestfish.pod:605
23134 msgid "The size in yottabytes (multiplied by 2**80)."
23139 #: ../fish/guestfish.pod:607
23145 #: ../fish/guestfish.pod:609
23146 msgid "The size in SI 10**24 byte units."
23151 #: ../fish/guestfish.pod:615
23154 " truncate-size /file 1G\n"
23160 #: ../fish/guestfish.pod:617
23161 msgid "would truncate the file to 1 gigabyte."
23166 #: ../fish/guestfish.pod:619
23168 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
23169 "the parameter to L</memsize> is specified in megabytes already). Adding a "
23170 "suffix will probably not do what you expect."
23175 #: ../fish/guestfish.pod:623
23176 msgid "OCTAL AND HEXADECIMAL NUMBERS"
23181 #: ../fish/guestfish.pod:625
23183 "For specifying the radix (base) use the C convention: C<0> to prefix an "
23184 "octal number or C<0x> to prefix a hexadecimal number. For example:"
23189 #: ../fish/guestfish.pod:628
23192 " 1234 decimal number 1234\n"
23193 " 02322 octal number, equivalent to decimal 1234\n"
23194 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
23200 #: ../fish/guestfish.pod:632
23202 "When using the C<chmod> command, you almost always want to specify an octal "
23203 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
23204 "L<chmod(1)> program):"
23209 #: ../fish/guestfish.pod:636
23212 " chmod 0777 /public # OK\n"
23213 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
23219 #: ../fish/guestfish.pod:639
23221 "Commands that return numbers usually print them in decimal, but some "
23222 "commands print numbers in other radices (eg. C<umask> prints the mode in "
23223 "octal, preceeded by C<0>)."
23228 #: ../fish/guestfish.pod:643
23229 msgid "WILDCARDS AND GLOBBING"
23234 #: ../fish/guestfish.pod:645
23236 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
23237 "(globbing) by default. So for example the following will not do what you "
23243 #: ../fish/guestfish.pod:649
23252 #: ../fish/guestfish.pod:651
23254 "Assuming you don't have a directory called literally C</home/*> then the "
23255 "above command will return an error."
23260 #: ../fish/guestfish.pod:654
23261 msgid "To perform wildcard expansion, use the C<glob> command."
23266 #: ../fish/guestfish.pod:656
23269 " glob rm-rf /home/*\n"
23275 #: ../fish/guestfish.pod:658
23277 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
23278 "many times), equivalent to:"
23283 #: ../fish/guestfish.pod:661
23286 " rm-rf /home/jim\n"
23287 " rm-rf /home/joe\n"
23288 " rm-rf /home/mary\n"
23294 #: ../fish/guestfish.pod:665
23295 msgid "C<glob> only works on simple guest paths and not on device names."
23300 #: ../fish/guestfish.pod:667
23302 "If you have several parameters, each containing a wildcard, then glob will "
23303 "perform a Cartesian product."
23308 #: ../fish/guestfish.pod:670
23314 #: ../fish/guestfish.pod:672
23316 "Any line which starts with a I<#> character is treated as a comment and "
23317 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
23318 "a command. For example:"
23323 #: ../fish/guestfish.pod:676
23326 " # this is a comment\n"
23327 " # this is a comment\n"
23328 " foo # NOT a comment\n"
23334 #: ../fish/guestfish.pod:680
23335 msgid "Blank lines are also ignored."
23340 #: ../fish/guestfish.pod:682
23341 msgid "RUNNING COMMANDS LOCALLY"
23346 #: ../fish/guestfish.pod:684
23348 "Any line which starts with a I<!> character is treated as a command sent to "
23349 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
23354 #: ../fish/guestfish.pod:688
23358 " tgz-out /remote local/remote-data.tar.gz\n"
23364 #: ../fish/guestfish.pod:691
23366 "will create a directory C<local> on the host, and then export the contents "
23367 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
23368 "(See C<tgz-out>)."
23373 #: ../fish/guestfish.pod:695
23375 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
23376 "effect, due to the way that subprocesses work in Unix."
23380 #: ../fish/guestfish.pod:698
23381 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
23385 #: ../fish/guestfish.pod:700
23387 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
23388 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
23389 "and executed as guestfish commands."
23393 #: ../fish/guestfish.pod:704
23395 "Thus you can use shell script to construct arbitrary guestfish commands "
23396 "which are then parsed by guestfish."
23400 #: ../fish/guestfish.pod:707
23402 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
23403 "through C</foo.100>) using guestfish commands alone. However this is simple "
23404 "if we use a shell script to create the guestfish commands for us:"
23408 #: ../fish/guestfish.pod:712
23411 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
23416 #: ../fish/guestfish.pod:714
23417 msgid "or with names like C</foo.001>:"
23421 #: ../fish/guestfish.pod:716
23424 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
23429 #: ../fish/guestfish.pod:718
23431 "When using guestfish interactively it can be helpful to just run the shell "
23432 "script first (ie. remove the initial C<E<lt>> character so it is just an "
23433 "ordinary I<!> local command), see what guestfish commands it would run, and "
23434 "when you are happy with those prepend the C<E<lt>> character to run the "
23435 "guestfish commands for real."
23440 #: ../fish/guestfish.pod:724
23446 #: ../fish/guestfish.pod:726
23448 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
23449 "command (a guestfish command) to the second command (any host command). For "
23455 #: ../fish/guestfish.pod:730
23458 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
23464 #: ../fish/guestfish.pod:732
23466 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
23467 "program). The above command would list all accounts in the guest filesystem "
23468 "which have UID 0, ie. root accounts including backdoors. Other examples:"
23473 #: ../fish/guestfish.pod:737
23476 " hexdump /bin/ls | head\n"
23477 " list-devices | tail -1\n"
23478 " tgz-out / - | tar ztf -\n"
23484 #: ../fish/guestfish.pod:741
23486 "The space before the pipe symbol is required, any space after the pipe "
23487 "symbol is optional. Everything after the pipe symbol is just passed "
23488 "straight to the host shell, so it can contain redirections, globs and "
23489 "anything else that makes sense on the host side."
23494 #: ../fish/guestfish.pod:746
23496 "To use a literal argument which begins with a pipe symbol, you have to quote "
23502 #: ../fish/guestfish.pod:749
23511 #: ../fish/guestfish.pod:751
23512 msgid "HOME DIRECTORIES"
23517 #: ../fish/guestfish.pod:753
23519 "If a parameter starts with the character C<~> then the tilde may be expanded "
23520 "as a home directory path (either C<~> for the current user's home directory, "
23521 "or C<~user> for another user)."
23526 #: ../fish/guestfish.pod:757
23528 "Note that home directory expansion happens for users known I<on the host>, "
23529 "not in the guest filesystem."
23534 #: ../fish/guestfish.pod:760
23536 "To use a literal argument which begins with a tilde, you have to quote it, "
23542 #: ../fish/guestfish.pod:763
23551 #: ../fish/guestfish.pod:767
23553 "Libguestfs has some support for Linux guests encrypted according to the "
23554 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
23555 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
23556 "LUKS is supported."
23561 #: ../fish/guestfish.pod:772
23562 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
23567 #: ../fish/guestfish.pod:774
23570 " ><fs> vfs-type /dev/sda2\n"
23577 #: ../fish/guestfish.pod:777
23579 "Then open those devices using L</luks-open>. This creates a device-mapper "
23580 "device called C</dev/mapper/luksdev>."
23585 #: ../fish/guestfish.pod:780
23588 " ><fs> luks-open /dev/sda2 luksdev\n"
23589 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
23595 #: ../fish/guestfish.pod:783
23597 "Finally you have to tell LVM to scan for volume groups on the newly created "
23603 #: ../fish/guestfish.pod:786
23607 " vg-activate-all true\n"
23613 #: ../fish/guestfish.pod:789
23614 msgid "The logical volume(s) can now be mounted in the usual way."
23619 #: ../fish/guestfish.pod:791
23621 "Before closing a LUKS device you must unmount any logical volumes on it and "
23622 "deactivate the volume groups by calling C<vg-activate false VG> on each "
23623 "one. Then you can close the mapper device:"
23628 #: ../fish/guestfish.pod:795
23631 " vg-activate false /dev/VG\n"
23632 " luks-close /dev/mapper/luksdev\n"
23638 #: ../fish/guestfish.pod:798 ../tools/virt-edit.pl:342
23639 msgid "WINDOWS PATHS"
23643 #: ../fish/guestfish.pod:800
23645 "If a path is prefixed with C<win:> then you can use Windows-style drive "
23646 "letters and paths (with some limitations). The following commands are "
23652 #: ../fish/guestfish.pod:804
23655 " file /WINDOWS/system32/config/system.LOG\n"
23661 #: ../fish/guestfish.pod:806
23664 " file win:\\windows\\system32\\config\\system.log\n"
23669 #: ../fish/guestfish.pod:808
23672 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
23677 #: ../fish/guestfish.pod:810
23679 "The parameter is rewritten \"behind the scenes\" by looking up the position "
23680 "where the drive is mounted, prepending that to the path, changing all "
23681 "backslash characters to forward slash, then resolving the result using L</"
23682 "case-sensitive-path>. For example if the E: drive was mounted on C</e> then "
23683 "the parameter might be rewritten like this:"
23687 #: ../fish/guestfish.pod:816
23690 " win:e:\\foo\\bar => /e/FOO/bar\n"
23695 #: ../fish/guestfish.pod:818
23696 msgid "This only works in argument positions that expect a path."
23701 #: ../fish/guestfish.pod:820
23702 msgid "UPLOADING AND DOWNLOADING FILES"
23707 #: ../fish/guestfish.pod:822
23709 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
23710 "others which upload from or download to a local file, you can use the "
23711 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
23716 #: ../fish/guestfish.pod:826
23725 #: ../fish/guestfish.pod:828
23727 "reads stdin and creates from that a file C</foo> in the disk image, and:"
23732 #: ../fish/guestfish.pod:831
23735 " tar-out /etc - | tar tf -\n"
23741 #: ../fish/guestfish.pod:833
23743 "writes the tarball to stdout and then pipes that into the external \"tar\" "
23744 "command (see L</PIPES>)."
23749 #: ../fish/guestfish.pod:836
23751 "When using C<-> to read from stdin, the input is read up to the end of "
23752 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
23753 "some arbitrary end marker:"
23758 #: ../fish/guestfish.pod:840
23761 " upload -<<END /foo\n"
23771 #: ../fish/guestfish.pod:846
23773 "Any string of characters can be used instead of C<END>. The end marker must "
23774 "appear on a line of its own, without any preceeding or following characters "
23775 "(not even spaces)."
23780 #: ../fish/guestfish.pod:850
23782 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
23783 "upload local files (so-called \"FileIn\" parameters in the generator)."
23788 #: ../fish/guestfish.pod:853
23789 msgid "EXIT ON ERROR BEHAVIOUR"
23794 #: ../fish/guestfish.pod:855
23796 "By default, guestfish will ignore any errors when in interactive mode (ie. "
23797 "taking commands from a human over a tty), and will exit on the first error "
23798 "in non-interactive mode (scripts, commands given on the command line)."
23803 #: ../fish/guestfish.pod:860
23805 "If you prefix a command with a I<-> character, then that command will not "
23806 "cause guestfish to exit, even if that (one) command returns an error."
23811 #: ../fish/guestfish.pod:864
23812 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
23817 #: ../fish/guestfish.pod:866
23819 "Guestfish can be remote-controlled over a socket. This is useful "
23820 "particularly in shell scripts where you want to make several different "
23821 "changes to a filesystem, but you don't want the overhead of starting up a "
23822 "guestfish process each time."
23827 #: ../fish/guestfish.pod:871
23828 msgid "Start a guestfish server process using:"
23833 #: ../fish/guestfish.pod:873
23836 " eval \"`guestfish --listen`\"\n"
23842 #: ../fish/guestfish.pod:875
23843 msgid "and then send it commands by doing:"
23848 #: ../fish/guestfish.pod:877
23851 " guestfish --remote cmd [...]\n"
23857 #: ../fish/guestfish.pod:879
23858 msgid "To cause the server to exit, send it the exit command:"
23863 #: ../fish/guestfish.pod:881
23866 " guestfish --remote exit\n"
23872 #: ../fish/guestfish.pod:883
23874 "Note that the server will normally exit if there is an error in a command. "
23875 "You can change this in the usual way. See section L</EXIT ON ERROR "
23881 #: ../fish/guestfish.pod:887
23882 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
23887 #: ../fish/guestfish.pod:889
23889 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
23890 "is how the I<--remote> option knows where to send the commands. You can "
23891 "have several guestfish listener processes running using:"
23896 #: ../fish/guestfish.pod:893
23899 " eval \"`guestfish --listen`\"\n"
23900 " pid1=$GUESTFISH_PID\n"
23901 " eval \"`guestfish --listen`\"\n"
23902 " pid2=$GUESTFISH_PID\n"
23904 " guestfish --remote=$pid1 cmd\n"
23905 " guestfish --remote=$pid2 cmd\n"
23911 #: ../fish/guestfish.pod:901
23912 msgid "REMOTE CONTROL AND CSH"
23917 #: ../fish/guestfish.pod:903
23919 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
23925 #: ../fish/guestfish.pod:906
23928 " eval \"`guestfish --listen --csh`\"\n"
23934 #: ../fish/guestfish.pod:908
23935 msgid "REMOTE CONTROL DETAILS"
23940 #: ../fish/guestfish.pod:910
23942 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
23943 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
23944 "and C<$PID> is the process ID of the server."
23949 #: ../fish/guestfish.pod:914
23950 msgid "Guestfish client and server versions must match exactly."
23954 #: ../fish/guestfish.pod:916
23955 msgid "REMOTE CONTROL RUN COMMAND HANGING"
23959 #: ../fish/guestfish.pod:918
23961 "Using the C<run> (or C<launch>) command remotely in a command substitution "
23962 "context hangs, ie. don't do (note the backquotes):"
23966 #: ../fish/guestfish.pod:921
23969 " a=`guestfish --remote run`\n"
23974 #: ../fish/guestfish.pod:923
23976 "Since the C<run> command produces no output on stdout, this is not useful "
23977 "anyway. For further information see L<https://bugzilla.redhat.com/show_bug."
23983 #: ../fish/guestfish.pod:927
23984 msgid "PREPARED DISK IMAGES"
23989 #: ../fish/guestfish.pod:929
23991 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
23992 "preformatted disk images that guestfish can make for you to save typing. "
23993 "This is particularly useful for testing purposes. This option is used "
23994 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
23995 "can be mixed with I<-a>)."
24000 #: ../fish/guestfish.pod:935
24002 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
24003 "the second and so on. Existing files in the current directory are "
24009 #: ../fish/guestfish.pod:939
24011 "The type briefly describes how the disk should be sized, partitioned, how "
24012 "filesystem(s) should be created, and how content should be added. "
24013 "Optionally the type can be followed by extra parameters, separated by C<:> "
24014 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
24015 "allocated disk, containing a single partition, with the partition formatted "
24016 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
24022 #: ../fish/guestfish.pod:947
24023 msgid "To list the available types and any extra parameters they take, run:"
24028 #: ../fish/guestfish.pod:951
24030 "Note that the prepared filesystem is not mounted. You would usually have to "
24031 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
24036 #: ../fish/guestfish.pod:955
24038 "If any I<-N> or I<--new> options are given, the guest is automatically "
24044 #: ../fish/guestfish.pod:960
24045 msgid "Create a 100MB disk with an ext4-formatted partition:"
24050 #: ../fish/guestfish.pod:962
24053 " guestfish -N fs:ext4\n"
24059 #: ../fish/guestfish.pod:964
24060 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
24065 #: ../fish/guestfish.pod:966
24068 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
24074 #: ../fish/guestfish.pod:968
24075 msgid "Create a blank 200MB disk:"
24080 #: ../fish/guestfish.pod:970
24083 " guestfish -N disk:200M\n"
24089 #: ../fish/guestfish.pod:972
24090 msgid "PROGRESS BARS"
24095 #: ../fish/guestfish.pod:974
24097 "Some (not all) long-running commands send progress notification messages as "
24098 "they are running. Guestfish turns these messages into progress bars."
24103 #: ../fish/guestfish.pod:978
24105 "When a command that supports progress bars takes longer than two seconds to "
24106 "run, and if progress bars are enabled, then you will see one appearing below "
24112 #: ../fish/guestfish.pod:982
24115 " ><fs> copy-size /large-file /another-file 2048M\n"
24116 " / 10% [#####-----------------------------------------] 00:30\n"
24122 #: ../fish/guestfish.pod:985
24124 "The spinner on the left hand side moves round once for every progress "
24125 "notification received from the backend. This is a (reasonably) golden "
24126 "assurance that the command is \"doing something\" even if the progress bar "
24127 "is not moving, because the command is able to send the progress "
24128 "notifications. When the bar reaches 100% and the command finishes, the "
24129 "spinner disappears."
24134 #: ../fish/guestfish.pod:992
24136 "Progress bars are enabled by default when guestfish is used interactively. "
24137 "You can enable them even for non-interactive modes using I<--progress-bars>, "
24138 "and you can disable them completely using I<--no-progress-bars>."
24143 #: ../fish/guestfish.pod:997
24144 msgid "GUESTFISH COMMANDS"
24149 #: ../fish/guestfish.pod:999
24151 "The commands in this section are guestfish convenience commands, in other "
24152 "words, they are not part of the L<guestfs(3)> API."
24157 #: ../fish/guestfish.pod:1002
24163 #: ../fish/guestfish.pod:1004
24173 #: ../fish/guestfish.pod:1007
24174 msgid "Without any parameter, this provides general help."
24179 #: ../fish/guestfish.pod:1009
24180 msgid "With a C<cmd> parameter, this displays detailed help for that command."
24185 #: ../fish/guestfish.pod:1011
24186 msgid "quit | exit"
24191 #: ../fish/guestfish.pod:1013
24192 msgid "This exits guestfish. You can also use C<^D> key."
24197 #: ../fish/guestfish.pod:1015
24198 msgid "@FISH_COMMANDS@"
24203 #: ../fish/guestfish.pod:1017
24209 #: ../fish/guestfish.pod:1021 ../test-tool/libguestfs-test-tool.pod:77
24215 #: ../fish/guestfish.pod:1023
24217 "guestfish returns 0 if the commands completed without error, or 1 if there "
24223 #: ../fish/guestfish.pod:1030
24229 #: ../fish/guestfish.pod:1032
24231 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
24237 #: ../fish/guestfish.pod:1035
24238 msgid "GUESTFISH_PID"
24243 #: ../fish/guestfish.pod:1037
24245 "Used with the I<--remote> option to specify the remote guestfish process to "
24246 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
24251 #: ../fish/guestfish.pod:1041
24257 #: ../fish/guestfish.pod:1043
24259 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
24260 "not specified, the external L<hexedit(1)> program is used."
24265 #: ../fish/guestfish.pod:1047
24271 #: ../fish/guestfish.pod:1049
24273 "If compiled with GNU readline support, various files in the home directory "
24274 "can be used. See L</FILES>."
24279 #: ../fish/guestfish.pod:1058
24281 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
24282 "effect as using the B<-v> option."
24287 #: ../fish/guestfish.pod:1070
24289 "Set the path that guestfish uses to search for kernel and initrd.img. See "
24290 "the discussion of paths in L<guestfs(3)>."
24295 #: ../fish/guestfish.pod:1081
24296 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
24301 #: ../fish/guestfish.pod:1083
24307 #: ../fish/guestfish.pod:1085
24309 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
24315 #: ../fish/guestfish.pod:1101 ../fuse/guestmount.pod:262
24320 #: ../fish/guestfish.pod:1105 ../fuse/guestmount.pod:266
24321 msgid "$HOME/.libguestfs-tools.rc"
24325 #: ../fish/guestfish.pod:1107 ../fuse/guestmount.pod:268
24326 msgid "/etc/libguestfs-tools.conf"
24330 #: ../fish/guestfish.pod:1109 ../fuse/guestmount.pod:270
24332 "This configuration file controls the default read-only or read-write mode "
24333 "(I<--ro> or I<--rw>)."
24337 #: ../fish/guestfish.pod:1112
24338 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
24343 #: ../fish/guestfish.pod:1114
24344 msgid "$HOME/.guestfish"
24349 #: ../fish/guestfish.pod:1116
24351 "If compiled with GNU readline support, then the command history is saved in "
24357 #: ../fish/guestfish.pod:1119
24358 msgid "$HOME/.inputrc"
24363 #: ../fish/guestfish.pod:1121
24364 msgid "/etc/inputrc"
24369 #: ../fish/guestfish.pod:1123
24371 "If compiled with GNU readline support, then these files can be used to "
24372 "configure readline. For further information, please see L<readline(3)/"
24373 "INITIALIZATION FILE>."
24378 #: ../fish/guestfish.pod:1127
24379 msgid "To write rules which only apply to guestfish, use:"
24384 #: ../fish/guestfish.pod:1129
24395 #: ../fish/guestfish.pod:1133
24397 "Variables that you can set in inputrc that change the behaviour of guestfish "
24398 "in useful ways include:"
24403 #: ../fish/guestfish.pod:1138
24404 msgid "completion-ignore-case (default: on)"
24409 #: ../fish/guestfish.pod:1140
24411 "By default, guestfish will ignore case when tab-completing paths on the "
24417 #: ../fish/guestfish.pod:1143
24420 " set completion-ignore-case off\n"
24426 #: ../fish/guestfish.pod:1145
24427 msgid "to make guestfish case sensitive."
24432 #: ../fish/guestfish.pod:1149
24438 #: ../fish/guestfish.pod:1151
24439 msgid "test2.img (etc)"
24443 #: ../fish/guestfish.pod:1153
24445 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
24446 "will be created in the file C<test1.img> in the current directory. The "
24447 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
24448 "the same name will be overwritten."
24452 #: ../fish/guestfish.pod:1162
24454 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
24455 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
24456 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
24457 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
24458 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
24459 ">, L<hexedit(1)>."
24464 #: ../fish/guestfish.pod:1192 ../test-tool/libguestfs-test-tool.pod:102
24465 #: ../fuse/guestmount.pod:297 ../tools/virt-edit.pl:518
24466 #: ../tools/virt-win-reg.pl:606 ../tools/virt-list-filesystems.pl:210
24467 #: ../tools/virt-tar.pl:309 ../tools/virt-make-fs.pl:572
24468 #: ../tools/virt-list-partitions.pl:277
24470 "This program is free software; you can redistribute it and/or modify it "
24471 "under the terms of the GNU General Public License as published by the Free "
24472 "Software Foundation; either version 2 of the License, or (at your option) "
24473 "any later version."
24478 #: ../fish/guestfish.pod:1197 ../test-tool/libguestfs-test-tool.pod:107
24479 #: ../fuse/guestmount.pod:302 ../tools/virt-edit.pl:523
24480 #: ../tools/virt-win-reg.pl:611 ../tools/virt-list-filesystems.pl:215
24481 #: ../tools/virt-tar.pl:314 ../tools/virt-make-fs.pl:577
24482 #: ../tools/virt-list-partitions.pl:282
24484 "This program is distributed in the hope that it will be useful, but WITHOUT "
24485 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
24486 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
24492 #: ../fish/guestfish.pod:1202 ../test-tool/libguestfs-test-tool.pod:112
24493 #: ../fuse/guestmount.pod:307 ../tools/virt-edit.pl:528
24494 #: ../tools/virt-win-reg.pl:616 ../tools/virt-list-filesystems.pl:220
24495 #: ../tools/virt-tar.pl:319 ../tools/virt-make-fs.pl:582
24496 #: ../tools/virt-list-partitions.pl:287
24498 "You should have received a copy of the GNU General Public License along with "
24499 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
24500 "Ave, Cambridge, MA 02139, USA."
24505 #: ../fish/guestfish-actions.pod:1
24511 #: ../fish/guestfish-actions.pod:3
24514 " add-cdrom filename\n"
24520 #: ../fish/guestfish-actions.pod:15
24522 "This call checks for the existence of C<filename>. This stops you from "
24523 "specifying other types of drive which are supported by qemu such as C<nbd:> "
24524 "and C<http:> URLs. To specify those, use the general L</config> call "
24530 #: ../fish/guestfish-actions.pod:22
24532 "If you just want to add an ISO file (often you use this as an efficient way "
24533 "to transfer large files into the guest), then you should probably use L</add-"
24534 "drive-ro> instead."
24538 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:158
24539 #: ../fish/guestfish-actions.pod:172
24541 "This function is deprecated. In new code, use the L</add_drive_opts> call "
24547 #: ../fish/guestfish-actions.pod:35
24553 #: ../fish/guestfish-actions.pod:37
24558 #: ../fish/guestfish-actions.pod:39
24561 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..]\n"
24567 #: ../fish/guestfish-actions.pod:41
24569 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
24570 "It works by connecting to libvirt, requesting the domain and domain XML from "
24571 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
24576 #: ../fish/guestfish-actions.pod:71
24578 "The other optional parameters are passed directly through to L</add-drive-"
24584 #: ../fish/guestfish-actions.pod:74 ../fish/guestfish-actions.pod:138
24585 #: ../fish/guestfish-actions.pod:3071
24587 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
24592 #: ../fish/guestfish-actions.pod:76
24598 #: ../fish/guestfish-actions.pod:78
24601 " add-drive filename\n"
24607 #: ../fish/guestfish-actions.pod:80
24609 "This function is the equivalent of calling L</add-drive-opts> with no "
24610 "optional parameters, so the disk is added writable, with the format being "
24611 "detected automatically."
24616 #: ../fish/guestfish-actions.pod:84
24618 "Automatic detection of the format opens you up to a potential security hole "
24619 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24620 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24621 "you should think about replacing calls to this function with calls to L</add-"
24622 "drive-opts>, and specifying the format."
24627 #: ../fish/guestfish-actions.pod:91
24628 msgid "add-drive-opts"
24633 #: ../fish/guestfish-actions.pod:93
24639 #: ../fish/guestfish-actions.pod:95
24642 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
24648 #: ../fish/guestfish-actions.pod:122
24650 "This forces the image format. If you omit this (or use L</add-drive> or L</"
24651 "add-drive-ro>) then the format is automatically detected. Possible formats "
24652 "include C<raw> and C<qcow2>."
24657 #: ../fish/guestfish-actions.pod:133
24659 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
24660 "add-drive-with-if> call (q.v.)"
24665 #: ../fish/guestfish-actions.pod:140
24666 msgid "add-drive-ro"
24671 #: ../fish/guestfish-actions.pod:142
24677 #: ../fish/guestfish-actions.pod:144
24680 " add-drive-ro filename\n"
24686 #: ../fish/guestfish-actions.pod:146
24688 "This function is the equivalent of calling L</add-drive-opts> with the "
24689 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
24690 "is added read-only, with the format being detected automatically."
24695 #: ../fish/guestfish-actions.pod:151
24696 msgid "add-drive-ro-with-if"
24701 #: ../fish/guestfish-actions.pod:153
24704 " add-drive-ro-with-if filename iface\n"
24710 #: ../fish/guestfish-actions.pod:155
24712 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
24713 "interface emulation to use at run time."
24718 #: ../fish/guestfish-actions.pod:165
24719 msgid "add-drive-with-if"
24724 #: ../fish/guestfish-actions.pod:167
24727 " add-drive-with-if filename iface\n"
24733 #: ../fish/guestfish-actions.pod:169
24735 "This is the same as L</add-drive> but it allows you to specify the QEMU "
24736 "interface emulation to use at run time."
24741 #: ../fish/guestfish-actions.pod:179
24747 #: ../fish/guestfish-actions.pod:181
24750 " aug-clear augpath\n"
24756 #: ../fish/guestfish-actions.pod:186
24762 #: ../fish/guestfish-actions.pod:188
24771 #: ../fish/guestfish-actions.pod:190
24773 "Close the current Augeas handle and free up any resources used by it. After "
24774 "calling this, you have to call L</aug-init> again before you can use any "
24775 "other Augeas functions."
24780 #: ../fish/guestfish-actions.pod:195
24781 msgid "aug-defnode"
24786 #: ../fish/guestfish-actions.pod:197
24789 " aug-defnode name expr val\n"
24795 #: ../fish/guestfish-actions.pod:202
24797 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24798 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
24799 "containing that single node."
24804 #: ../fish/guestfish-actions.pod:210
24810 #: ../fish/guestfish-actions.pod:212
24813 " aug-defvar name expr\n"
24819 #: ../fish/guestfish-actions.pod:221
24825 #: ../fish/guestfish-actions.pod:223
24828 " aug-get augpath\n"
24834 #: ../fish/guestfish-actions.pod:228
24840 #: ../fish/guestfish-actions.pod:230
24843 " aug-init root flags\n"
24849 #: ../fish/guestfish-actions.pod:236
24850 msgid "You must call this before using any other L</aug-*> commands."
24854 #: ../fish/guestfish-actions.pod:261
24856 "This option is only useful when debugging Augeas lenses. Use of this option "
24857 "may require additional memory for the libguestfs appliance. You may need to "
24858 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
24863 #: ../fish/guestfish-actions.pod:276
24864 msgid "Do not load the tree in L</aug-init>."
24869 #: ../fish/guestfish-actions.pod:280
24870 msgid "To close the handle, you can call L</aug-close>."
24875 #: ../fish/guestfish-actions.pod:284
24881 #: ../fish/guestfish-actions.pod:286
24884 " aug-insert augpath label true|false\n"
24890 #: ../fish/guestfish-actions.pod:296
24896 #: ../fish/guestfish-actions.pod:298
24905 #: ../fish/guestfish-actions.pod:305
24911 #: ../fish/guestfish-actions.pod:307
24914 " aug-ls augpath\n"
24920 #: ../fish/guestfish-actions.pod:309
24922 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
24923 "resulting nodes into alphabetical order."
24928 #: ../fish/guestfish-actions.pod:312
24934 #: ../fish/guestfish-actions.pod:314
24937 " aug-match augpath\n"
24943 #: ../fish/guestfish-actions.pod:320
24949 #: ../fish/guestfish-actions.pod:322
24952 " aug-mv src dest\n"
24958 #: ../fish/guestfish-actions.pod:327
24964 #: ../fish/guestfish-actions.pod:329
24967 " aug-rm augpath\n"
24973 #: ../fish/guestfish-actions.pod:335
24979 #: ../fish/guestfish-actions.pod:337
24988 #: ../fish/guestfish-actions.pod:341
24990 "The flags which were passed to L</aug-init> affect exactly how files are "
24996 #: ../fish/guestfish-actions.pod:344
25002 #: ../fish/guestfish-actions.pod:346
25005 " aug-set augpath val\n"
25011 #: ../fish/guestfish-actions.pod:350
25013 "In the Augeas API, it is possible to clear a node by setting the value to "
25014 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
25015 "this call. Instead you must use the L</aug-clear> call."
25020 #: ../fish/guestfish-actions.pod:355
25026 #: ../fish/guestfish-actions.pod:357
25029 " available 'groups ...'\n"
25035 #: ../fish/guestfish-actions.pod:363
25037 "The libguestfs groups, and the functions that those groups correspond to, "
25038 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
25039 "runtime by calling L</available-all-groups>."
25044 #: ../fish/guestfish-actions.pod:387
25045 msgid "You must call L</launch> before calling this function."
25050 #: ../fish/guestfish-actions.pod:409
25052 "This call was added in version C<1.0.80>. In previous versions of "
25053 "libguestfs all you could do would be to speculatively execute a command to "
25054 "find out if the daemon implemented it. See also L</version>."
25059 #: ../fish/guestfish-actions.pod:416
25060 msgid "available-all-groups"
25065 #: ../fish/guestfish-actions.pod:418
25068 " available-all-groups\n"
25074 #: ../fish/guestfish-actions.pod:420
25076 "This command returns a list of all optional groups that this daemon knows "
25077 "about. Note this returns both supported and unsupported groups. To find "
25078 "out which ones the daemon can actually support you have to call L</"
25079 "available> on each member of the returned list."
25084 #: ../fish/guestfish-actions.pod:426
25085 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
25090 #: ../fish/guestfish-actions.pod:428
25096 #: ../fish/guestfish-actions.pod:430
25099 " base64-in (base64file|-) filename\n"
25105 #: ../fish/guestfish-actions.pod:435 ../fish/guestfish-actions.pod:444
25106 #: ../fish/guestfish-actions.pod:668 ../fish/guestfish-actions.pod:837
25107 #: ../fish/guestfish-actions.pod:856 ../fish/guestfish-actions.pod:1230
25108 #: ../fish/guestfish-actions.pod:4513 ../fish/guestfish-actions.pod:4525
25109 #: ../fish/guestfish-actions.pod:4536 ../fish/guestfish-actions.pod:4547
25110 #: ../fish/guestfish-actions.pod:4599 ../fish/guestfish-actions.pod:4608
25111 #: ../fish/guestfish-actions.pod:4662 ../fish/guestfish-actions.pod:4685
25112 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
25117 #: ../fish/guestfish-actions.pod:437
25123 #: ../fish/guestfish-actions.pod:439
25126 " base64-out filename (base64file|-)\n"
25132 #: ../fish/guestfish-actions.pod:446
25133 msgid "blockdev-flushbufs"
25138 #: ../fish/guestfish-actions.pod:448
25141 " blockdev-flushbufs device\n"
25147 #: ../fish/guestfish-actions.pod:455
25148 msgid "blockdev-getbsz"
25153 #: ../fish/guestfish-actions.pod:457
25156 " blockdev-getbsz device\n"
25162 #: ../fish/guestfish-actions.pod:466
25163 msgid "blockdev-getro"
25168 #: ../fish/guestfish-actions.pod:468
25171 " blockdev-getro device\n"
25177 #: ../fish/guestfish-actions.pod:475
25178 msgid "blockdev-getsize64"
25183 #: ../fish/guestfish-actions.pod:477
25186 " blockdev-getsize64 device\n"
25192 #: ../fish/guestfish-actions.pod:481
25193 msgid "See also L</blockdev-getsz>."
25198 #: ../fish/guestfish-actions.pod:485
25199 msgid "blockdev-getss"
25204 #: ../fish/guestfish-actions.pod:487
25207 " blockdev-getss device\n"
25213 #: ../fish/guestfish-actions.pod:492
25215 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
25220 #: ../fish/guestfish-actions.pod:497
25221 msgid "blockdev-getsz"
25226 #: ../fish/guestfish-actions.pod:499
25229 " blockdev-getsz device\n"
25235 #: ../fish/guestfish-actions.pod:504
25237 "See also L</blockdev-getss> for the real sector size of the device, and L</"
25238 "blockdev-getsize64> for the more useful I<size in bytes>."
25243 #: ../fish/guestfish-actions.pod:510
25244 msgid "blockdev-rereadpt"
25249 #: ../fish/guestfish-actions.pod:512
25252 " blockdev-rereadpt device\n"
25258 #: ../fish/guestfish-actions.pod:518
25259 msgid "blockdev-setbsz"
25264 #: ../fish/guestfish-actions.pod:520
25267 " blockdev-setbsz device blocksize\n"
25273 #: ../fish/guestfish-actions.pod:529
25274 msgid "blockdev-setro"
25279 #: ../fish/guestfish-actions.pod:531
25282 " blockdev-setro device\n"
25288 #: ../fish/guestfish-actions.pod:537
25289 msgid "blockdev-setrw"
25294 #: ../fish/guestfish-actions.pod:539
25297 " blockdev-setrw device\n"
25303 #: ../fish/guestfish-actions.pod:545
25304 msgid "case-sensitive-path"
25309 #: ../fish/guestfish-actions.pod:547
25312 " case-sensitive-path path\n"
25318 #: ../fish/guestfish-actions.pod:571
25320 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
25321 "WINDOWS/system32\"> (the exact return value would depend on details of how "
25322 "the directories were originally created under Windows)."
25327 #: ../fish/guestfish-actions.pod:579
25328 msgid "See also L</realpath>."
25333 #: ../fish/guestfish-actions.pod:581
25339 #: ../fish/guestfish-actions.pod:583
25348 #: ../fish/guestfish-actions.pod:587
25350 "Note that this function cannot correctly handle binary files (specifically, "
25351 "files containing C<\\0> character which is treated as end of string). For "
25352 "those you need to use the L</read-file> or L</download> functions which have "
25353 "a more complex interface."
25358 #: ../fish/guestfish-actions.pod:595
25364 #: ../fish/guestfish-actions.pod:597
25367 " checksum csumtype path\n"
25373 #: ../fish/guestfish-actions.pod:640
25374 msgid "To get the checksum for a device, use L</checksum-device>."
25379 #: ../fish/guestfish-actions.pod:642
25380 msgid "To get the checksums for many files, use L</checksums-out>."
25385 #: ../fish/guestfish-actions.pod:644
25386 msgid "checksum-device"
25391 #: ../fish/guestfish-actions.pod:646
25394 " checksum-device csumtype device\n"
25400 #: ../fish/guestfish-actions.pod:648
25402 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
25403 "device named C<device>. For the types of checksums supported see the L</"
25404 "checksum> command."
25409 #: ../fish/guestfish-actions.pod:652
25410 msgid "checksums-out"
25415 #: ../fish/guestfish-actions.pod:654
25418 " checksums-out csumtype directory (sumsfile|-)\n"
25424 #: ../fish/guestfish-actions.pod:670
25430 #: ../fish/guestfish-actions.pod:672
25433 " chmod mode path\n"
25439 #: ../fish/guestfish-actions.pod:683
25445 #: ../fish/guestfish-actions.pod:685
25448 " chown owner group path\n"
25454 #: ../fish/guestfish-actions.pod:693
25460 #: ../fish/guestfish-actions.pod:695
25463 " command 'arguments ...'\n"
25469 #: ../fish/guestfish-actions.pod:702
25471 "The single parameter is an argv-style list of arguments. The first element "
25472 "is the name of the program to run. Subsequent elements are parameters. The "
25473 "list must be non-empty (ie. must contain a program name). Note that the "
25474 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
25479 #: ../fish/guestfish-actions.pod:730
25480 msgid "command-lines"
25485 #: ../fish/guestfish-actions.pod:732
25488 " command-lines 'arguments ...'\n"
25494 #: ../fish/guestfish-actions.pod:734
25496 "This is the same as L</command>, but splits the result into a list of lines."
25501 #: ../fish/guestfish-actions.pod:737
25502 msgid "See also: L</sh-lines>"
25507 #: ../fish/guestfish-actions.pod:742
25513 #: ../fish/guestfish-actions.pod:744
25516 " config qemuparam qemuvalue\n"
25522 #: ../fish/guestfish-actions.pod:755
25528 #: ../fish/guestfish-actions.pod:757
25531 " copy-size src dest size\n"
25537 #: ../fish/guestfish-actions.pod:765
25543 #: ../fish/guestfish-actions.pod:767
25552 #: ../fish/guestfish-actions.pod:772
25558 #: ../fish/guestfish-actions.pod:774
25567 #: ../fish/guestfish-actions.pod:779
25573 #: ../fish/guestfish-actions.pod:781
25582 #: ../fish/guestfish-actions.pod:788
25584 "If the destination is a device, it must be as large or larger than the "
25585 "source file or device, otherwise the copy will fail. This command cannot do "
25586 "partial copies (see L</copy-size>)."
25591 #: ../fish/guestfish-actions.pod:792
25597 #: ../fish/guestfish-actions.pod:794
25606 #: ../fish/guestfish-actions.pod:798 ../fish/guestfish-actions.pod:809
25608 "This command is mostly useful for interactive sessions. It is I<not> "
25609 "intended that you try to parse the output string. Use L</statvfs> from "
25615 #: ../fish/guestfish-actions.pod:802
25621 #: ../fish/guestfish-actions.pod:804
25630 #: ../fish/guestfish-actions.pod:813
25636 #: ../fish/guestfish-actions.pod:815
25645 #: ../fish/guestfish-actions.pod:821
25647 "Another way to get the same information is to enable verbose messages with "
25648 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
25649 "before running the program."
25654 #: ../fish/guestfish-actions.pod:826
25660 #: ../fish/guestfish-actions.pod:828
25663 " download remotefilename (filename|-)\n"
25669 #: ../fish/guestfish-actions.pod:835
25670 msgid "See also L</upload>, L</cat>."
25675 #: ../fish/guestfish-actions.pod:839
25676 msgid "download-offset"
25681 #: ../fish/guestfish-actions.pod:841
25684 " download-offset remotefilename (filename|-) offset size\n"
25690 #: ../fish/guestfish-actions.pod:849
25692 "Note that there is no limit on the amount of data that can be downloaded "
25693 "with this call, unlike with L</pread>, and this call always reads the full "
25694 "amount unless an error occurs."
25699 #: ../fish/guestfish-actions.pod:854
25700 msgid "See also L</download>, L</pread>."
25705 #: ../fish/guestfish-actions.pod:858
25706 msgid "drop-caches"
25711 #: ../fish/guestfish-actions.pod:860
25714 " drop-caches whattodrop\n"
25720 #: ../fish/guestfish-actions.pod:872
25726 #: ../fish/guestfish-actions.pod:874
25735 #: ../fish/guestfish-actions.pod:886
25741 #: ../fish/guestfish-actions.pod:888
25744 " e2fsck-f device\n"
25750 #: ../fish/guestfish-actions.pod:894
25752 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
25753 "should use L</fsck>."
25758 #: ../fish/guestfish-actions.pod:897
25759 msgid "echo-daemon"
25764 #: ../fish/guestfish-actions.pod:899
25767 " echo-daemon 'words ...'\n"
25773 #: ../fish/guestfish-actions.pod:906
25774 msgid "See also L</ping-daemon>."
25779 #: ../fish/guestfish-actions.pod:908
25785 #: ../fish/guestfish-actions.pod:910
25788 " egrep regex path\n"
25794 #: ../fish/guestfish-actions.pod:918
25800 #: ../fish/guestfish-actions.pod:920
25803 " egrepi regex path\n"
25809 #: ../fish/guestfish-actions.pod:928
25815 #: ../fish/guestfish-actions.pod:930
25818 " equal file1 file2\n"
25824 #: ../fish/guestfish-actions.pod:937
25830 #: ../fish/guestfish-actions.pod:939
25839 #: ../fish/guestfish-actions.pod:944
25840 msgid "See also L</is-file>, L</is-dir>, L</stat>."
25845 #: ../fish/guestfish-actions.pod:946
25851 #: ../fish/guestfish-actions.pod:948
25854 " fallocate path len\n"
25859 #: ../fish/guestfish-actions.pod:958
25861 "This function is deprecated. In new code, use the L</fallocate64> call "
25867 #: ../fish/guestfish-actions.pod:965
25868 msgid "fallocate64"
25873 #: ../fish/guestfish-actions.pod:967
25876 " fallocate64 path len\n"
25882 #: ../fish/guestfish-actions.pod:973
25884 "Note that this call allocates disk blocks for the file. To create a sparse "
25885 "file use L</truncate-size> instead."
25890 #: ../fish/guestfish-actions.pod:976
25892 "The deprecated call L</fallocate> does the same, but owing to an oversight "
25893 "it only allowed 30 bit lengths to be specified, effectively limiting the "
25894 "maximum size of files created through that call to 1GB."
25899 #: ../fish/guestfish-actions.pod:985
25905 #: ../fish/guestfish-actions.pod:987
25908 " fgrep pattern path\n"
25914 #: ../fish/guestfish-actions.pod:995
25920 #: ../fish/guestfish-actions.pod:997
25923 " fgrepi pattern path\n"
25929 #: ../fish/guestfish-actions.pod:1005
25935 #: ../fish/guestfish-actions.pod:1007
25943 #: ../fish/guestfish-actions.pod:1023
25945 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
25951 #: ../fish/guestfish-actions.pod:1026
25952 msgid "file-architecture"
25957 #: ../fish/guestfish-actions.pod:1028
25960 " file-architecture filename\n"
25966 #: ../fish/guestfish-actions.pod:1131
25972 #: ../fish/guestfish-actions.pod:1133
25981 #: ../fish/guestfish-actions.pod:1137
25983 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
25984 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
25989 #: ../fish/guestfish-actions.pod:1141
25995 #: ../fish/guestfish-actions.pod:1143
25998 " fill c len path\n"
26004 #: ../fish/guestfish-actions.pod:1149
26006 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26007 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
26008 "L</fill-pattern>."
26013 #: ../fish/guestfish-actions.pod:1154
26014 msgid "fill-pattern"
26019 #: ../fish/guestfish-actions.pod:1156
26022 " fill-pattern pattern len path\n"
26028 #: ../fish/guestfish-actions.pod:1158
26030 "This function is like L</fill> except that it creates a new file of length "
26031 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
26032 "is truncated if necessary to ensure the length of the file is exactly C<len> "
26038 #: ../fish/guestfish-actions.pod:1163
26044 #: ../fish/guestfish-actions.pod:1165
26047 " find directory\n"
26053 #: ../fish/guestfish-actions.pod:1179
26054 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
26059 #: ../fish/guestfish-actions.pod:1192
26060 msgid "See also L</find0>."
26065 #: ../fish/guestfish-actions.pod:1197
26071 #: ../fish/guestfish-actions.pod:1199
26074 " find0 directory (files|-)\n"
26080 #: ../fish/guestfish-actions.pod:1205
26082 "This command works the same way as L</find> with the following exceptions:"
26087 #: ../fish/guestfish-actions.pod:1232
26088 msgid "findfs-label"
26093 #: ../fish/guestfish-actions.pod:1234
26096 " findfs-label label\n"
26102 #: ../fish/guestfish-actions.pod:1240
26103 msgid "To find the label of a filesystem, use L</vfs-label>."
26108 #: ../fish/guestfish-actions.pod:1242
26109 msgid "findfs-uuid"
26114 #: ../fish/guestfish-actions.pod:1244
26117 " findfs-uuid uuid\n"
26123 #: ../fish/guestfish-actions.pod:1250
26124 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
26129 #: ../fish/guestfish-actions.pod:1252
26135 #: ../fish/guestfish-actions.pod:1254
26138 " fsck fstype device\n"
26144 #: ../fish/guestfish-actions.pod:1284
26150 #: ../fish/guestfish-actions.pod:1286
26158 #: ../fish/guestfish-actions.pod:1293
26159 msgid "get-attach-method"
26163 #: ../fish/guestfish-actions.pod:1295
26166 " get-attach-method\n"
26171 #: ../fish/guestfish-actions.pod:1297
26172 msgid "Return the current attach method. See L</set-attach-method>."
26177 #: ../fish/guestfish-actions.pod:1299
26178 msgid "get-autosync"
26183 #: ../fish/guestfish-actions.pod:1301
26192 #: ../fish/guestfish-actions.pod:1305
26198 #: ../fish/guestfish-actions.pod:1307
26207 #: ../fish/guestfish-actions.pod:1311
26208 msgid "get-e2label"
26213 #: ../fish/guestfish-actions.pod:1313
26216 " get-e2label device\n"
26221 #: ../fish/guestfish-actions.pod:1318
26223 "This function is deprecated. In new code, use the L</vfs_label> call "
26229 #: ../fish/guestfish-actions.pod:1325
26235 #: ../fish/guestfish-actions.pod:1327
26238 " get-e2uuid device\n"
26243 #: ../fish/guestfish-actions.pod:1332
26245 "This function is deprecated. In new code, use the L</vfs_uuid> call instead."
26250 #: ../fish/guestfish-actions.pod:1339
26251 msgid "get-memsize"
26256 #: ../fish/guestfish-actions.pod:1341
26265 #: ../fish/guestfish-actions.pod:1346
26267 "If L</set-memsize> was not called on this handle, and if "
26268 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26269 "value for memsize."
26274 #: ../fish/guestfish-actions.pod:1353
26275 msgid "get-network"
26280 #: ../fish/guestfish-actions.pod:1355
26289 #: ../fish/guestfish-actions.pod:1359
26295 #: ../fish/guestfish-actions.pod:1361
26304 #: ../fish/guestfish-actions.pod:1368
26310 #: ../fish/guestfish-actions.pod:1370
26316 #: ../fish/guestfish-actions.pod:1372
26325 #: ../fish/guestfish-actions.pod:1379
26331 #: ../fish/guestfish-actions.pod:1381
26340 #: ../fish/guestfish-actions.pod:1388
26341 msgid "get-recovery-proc"
26346 #: ../fish/guestfish-actions.pod:1390
26349 " get-recovery-proc\n"
26355 #: ../fish/guestfish-actions.pod:1394
26356 msgid "get-selinux"
26361 #: ../fish/guestfish-actions.pod:1396
26370 #: ../fish/guestfish-actions.pod:1398
26372 "This returns the current setting of the selinux flag which is passed to the "
26373 "appliance at boot time. See L</set-selinux>."
26378 #: ../fish/guestfish-actions.pod:1404
26384 #: ../fish/guestfish-actions.pod:1406
26393 #: ../fish/guestfish-actions.pod:1413
26399 #: ../fish/guestfish-actions.pod:1415
26408 #: ../fish/guestfish-actions.pod:1419
26414 #: ../fish/guestfish-actions.pod:1421
26423 #: ../fish/guestfish-actions.pod:1423
26425 "Return the current umask. By default the umask is C<022> unless it has been "
26426 "set by calling L</umask>."
26431 #: ../fish/guestfish-actions.pod:1426
26432 msgid "get-verbose"
26437 #: ../fish/guestfish-actions.pod:1428
26446 #: ../fish/guestfish-actions.pod:1432
26452 #: ../fish/guestfish-actions.pod:1434
26461 #: ../fish/guestfish-actions.pod:1438
26462 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
26467 #: ../fish/guestfish-actions.pod:1441
26473 #: ../fish/guestfish-actions.pod:1443
26476 " getxattr path name\n"
26482 #: ../fish/guestfish-actions.pod:1445
26484 "Get a single extended attribute from file C<path> named C<name>. This call "
26485 "follows symlinks. If you want to lookup an extended attribute for the "
26486 "symlink itself, use L</lgetxattr>."
26491 #: ../fish/guestfish-actions.pod:1449 ../fish/guestfish-actions.pod:2477
26493 "Normally it is better to get all extended attributes from a file in one go "
26494 "by calling L</getxattrs>. However some Linux filesystem implementations are "
26495 "buggy and do not provide a way to list out attributes. For these "
26496 "filesystems (notably ntfs-3g) you have to know the names of the extended "
26497 "attributes you want in advance and call this function."
26502 #: ../fish/guestfish-actions.pod:1459
26503 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
26508 #: ../fish/guestfish-actions.pod:1461
26514 #: ../fish/guestfish-actions.pod:1463
26517 " getxattrs path\n"
26523 #: ../fish/guestfish-actions.pod:1471
26524 msgid "See also: L</lgetxattrs>, L<attr(5)>."
26529 #: ../fish/guestfish-actions.pod:1473
26530 msgid "glob-expand"
26535 #: ../fish/guestfish-actions.pod:1475
26538 " glob-expand pattern\n"
26544 #: ../fish/guestfish-actions.pod:1488
26550 #: ../fish/guestfish-actions.pod:1490
26553 " grep regex path\n"
26559 #: ../fish/guestfish-actions.pod:1498
26565 #: ../fish/guestfish-actions.pod:1500
26568 " grepi regex path\n"
26574 #: ../fish/guestfish-actions.pod:1508
26575 msgid "grub-install"
26580 #: ../fish/guestfish-actions.pod:1510
26583 " grub-install root device\n"
26589 #: ../fish/guestfish-actions.pod:1548
26595 #: ../fish/guestfish-actions.pod:1550
26604 #: ../fish/guestfish-actions.pod:1558
26610 #: ../fish/guestfish-actions.pod:1560
26613 " head-n nrlines path\n"
26619 #: ../fish/guestfish-actions.pod:1573
26625 #: ../fish/guestfish-actions.pod:1575
26634 #: ../fish/guestfish-actions.pod:1583
26640 #: ../fish/guestfish-actions.pod:1585
26643 " initrd-cat initrdpath filename\n"
26649 #: ../fish/guestfish-actions.pod:1597
26650 msgid "See also L</initrd-list>."
26655 #: ../fish/guestfish-actions.pod:1602
26656 msgid "initrd-list"
26661 #: ../fish/guestfish-actions.pod:1604
26664 " initrd-list path\n"
26670 #: ../fish/guestfish-actions.pod:1616
26671 msgid "inotify-add-watch"
26676 #: ../fish/guestfish-actions.pod:1618
26679 " inotify-add-watch path mask\n"
26685 #: ../fish/guestfish-actions.pod:1630
26686 msgid "inotify-close"
26691 #: ../fish/guestfish-actions.pod:1632
26700 #: ../fish/guestfish-actions.pod:1638
26701 msgid "inotify-files"
26706 #: ../fish/guestfish-actions.pod:1640
26715 #: ../fish/guestfish-actions.pod:1642
26717 "This function is a helpful wrapper around L</inotify-read> which just "
26718 "returns a list of pathnames of objects that were touched. The returned "
26719 "pathnames are sorted and deduplicated."
26724 #: ../fish/guestfish-actions.pod:1646
26725 msgid "inotify-init"
26730 #: ../fish/guestfish-actions.pod:1648
26733 " inotify-init maxevents\n"
26739 #: ../fish/guestfish-actions.pod:1654
26741 "C<maxevents> is the maximum number of events which will be queued up between "
26742 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
26743 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
26744 "default was 16384 events. Beyond this limit, the kernel throws away events, "
26745 "but records the fact that it threw them away by setting a flag "
26746 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
26751 #: ../fish/guestfish-actions.pod:1664
26753 "Before any events are generated, you have to add some watches to the "
26754 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
26755 "L</inotify-watch-all>."
26760 #: ../fish/guestfish-actions.pod:1670
26762 "Queued up events should be read periodically by calling L</inotify-read> (or "
26763 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
26764 "If you don't read the events out often enough then you risk the internal "
26765 "queue overflowing."
26770 #: ../fish/guestfish-actions.pod:1677
26772 "The handle should be closed after use by calling L</inotify-close>. This "
26773 "also removes any watches automatically."
26778 #: ../fish/guestfish-actions.pod:1686
26779 msgid "inotify-read"
26784 #: ../fish/guestfish-actions.pod:1688
26793 #: ../fish/guestfish-actions.pod:1701
26794 msgid "inotify-rm-watch"
26799 #: ../fish/guestfish-actions.pod:1703
26802 " inotify-rm-watch wd\n"
26808 #: ../fish/guestfish-actions.pod:1705
26809 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
26814 #: ../fish/guestfish-actions.pod:1708
26815 msgid "inspect-get-arch"
26820 #: ../fish/guestfish-actions.pod:1710
26823 " inspect-get-arch root\n"
26829 #: ../fish/guestfish-actions.pod:1712 ../fish/guestfish-actions.pod:1728
26830 #: ../fish/guestfish-actions.pod:1814 ../fish/guestfish-actions.pod:1850
26831 #: ../fish/guestfish-actions.pod:1868 ../fish/guestfish-actions.pod:1902
26832 #: ../fish/guestfish-actions.pod:1917 ../fish/guestfish-actions.pod:1938
26833 #: ../fish/guestfish-actions.pod:1953 ../fish/guestfish-actions.pod:1986
26834 #: ../fish/guestfish-actions.pod:2008 ../fish/guestfish-actions.pod:2032
26835 #: ../fish/guestfish-actions.pod:2049 ../fish/guestfish-actions.pod:2092
26836 #: ../fish/guestfish-actions.pod:2127 ../fish/guestfish-actions.pod:2143
26837 #: ../fish/guestfish-actions.pod:2159 ../fish/guestfish-actions.pod:2172
26838 #: ../fish/guestfish-actions.pod:2185 ../fish/guestfish-actions.pod:2200
26840 "This function should only be called with a root device string as returned by "
26846 #: ../fish/guestfish-actions.pod:1715
26848 "This returns the architecture of the inspected operating system. The "
26849 "possible return values are listed under L</file-architecture>."
26854 #: ../fish/guestfish-actions.pod:1724
26855 msgid "inspect-get-distro"
26860 #: ../fish/guestfish-actions.pod:1726
26863 " inspect-get-distro root\n"
26868 #: ../fish/guestfish-actions.pod:1810
26869 msgid "inspect-get-drive-mappings"
26873 #: ../fish/guestfish-actions.pod:1812
26876 " inspect-get-drive-mappings root\n"
26881 #: ../fish/guestfish-actions.pod:1842
26883 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26884 "get-mountpoints>, L</inspect-get-filesystems>."
26889 #: ../fish/guestfish-actions.pod:1846
26890 msgid "inspect-get-filesystems"
26895 #: ../fish/guestfish-actions.pod:1848
26898 " inspect-get-filesystems root\n"
26904 #: ../fish/guestfish-actions.pod:1861
26906 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26907 "get-mountpoints>."
26911 #: ../fish/guestfish-actions.pod:1864
26912 msgid "inspect-get-format"
26916 #: ../fish/guestfish-actions.pod:1866
26919 " inspect-get-format root\n"
26925 #: ../fish/guestfish-actions.pod:1898
26926 msgid "inspect-get-hostname"
26931 #: ../fish/guestfish-actions.pod:1900
26934 " inspect-get-hostname root\n"
26940 #: ../fish/guestfish-actions.pod:1913
26941 msgid "inspect-get-major-version"
26946 #: ../fish/guestfish-actions.pod:1915
26949 " inspect-get-major-version root\n"
26955 #: ../fish/guestfish-actions.pod:1934
26956 msgid "inspect-get-minor-version"
26961 #: ../fish/guestfish-actions.pod:1936
26964 " inspect-get-minor-version root\n"
26970 #: ../fish/guestfish-actions.pod:1946
26972 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26973 "get-major-version>."
26978 #: ../fish/guestfish-actions.pod:1949
26979 msgid "inspect-get-mountpoints"
26984 #: ../fish/guestfish-actions.pod:1951
26987 " inspect-get-mountpoints root\n"
26992 #: ../fish/guestfish-actions.pod:1973
26994 "For operating systems like Windows which still use drive letters, this call "
26995 "will only return an entry for the first drive \"mounted on\" C</>. For "
26996 "information about the mapping of drive letters to partitions, see L</inspect-"
26997 "get-drive-mappings>."
27002 #: ../fish/guestfish-actions.pod:1979
27004 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
27005 "get-filesystems>."
27010 #: ../fish/guestfish-actions.pod:1982
27011 msgid "inspect-get-package-format"
27016 #: ../fish/guestfish-actions.pod:1984
27019 " inspect-get-package-format root\n"
27025 #: ../fish/guestfish-actions.pod:1989
27027 "This function and L</inspect-get-package-management> return the package "
27028 "format and package management tool used by the inspected operating system. "
27029 "For example for Fedora these functions would return C<rpm> (package format) "
27030 "and C<yum> (package management)."
27035 #: ../fish/guestfish-actions.pod:2004
27036 msgid "inspect-get-package-management"
27041 #: ../fish/guestfish-actions.pod:2006
27044 " inspect-get-package-management root\n"
27050 #: ../fish/guestfish-actions.pod:2011
27052 "L</inspect-get-package-format> and this function return the package format "
27053 "and package management tool used by the inspected operating system. For "
27054 "example for Fedora these functions would return C<rpm> (package format) and "
27055 "C<yum> (package management)."
27060 #: ../fish/guestfish-actions.pod:2028
27061 msgid "inspect-get-product-name"
27066 #: ../fish/guestfish-actions.pod:2030
27069 " inspect-get-product-name root\n"
27074 #: ../fish/guestfish-actions.pod:2045
27075 msgid "inspect-get-product-variant"
27079 #: ../fish/guestfish-actions.pod:2047
27082 " inspect-get-product-variant root\n"
27087 #: ../fish/guestfish-actions.pod:2071
27089 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
27090 "get-product-name>, L</inspect-get-major-version>."
27095 #: ../fish/guestfish-actions.pod:2075
27096 msgid "inspect-get-roots"
27101 #: ../fish/guestfish-actions.pod:2077
27104 " inspect-get-roots\n"
27110 #: ../fish/guestfish-actions.pod:2079
27112 "This function is a convenient way to get the list of root devices, as "
27113 "returned from a previous call to L</inspect-os>, but without redoing the "
27114 "whole inspection process."
27119 #: ../fish/guestfish-actions.pod:2083
27121 "This returns an empty list if either no root devices were found or the "
27122 "caller has not called L</inspect-os>."
27127 #: ../fish/guestfish-actions.pod:2088
27128 msgid "inspect-get-type"
27133 #: ../fish/guestfish-actions.pod:2090
27136 " inspect-get-type root\n"
27141 #: ../fish/guestfish-actions.pod:2123
27142 msgid "inspect-get-windows-current-control-set"
27146 #: ../fish/guestfish-actions.pod:2125
27149 " inspect-get-windows-current-control-set root\n"
27155 #: ../fish/guestfish-actions.pod:2139
27156 msgid "inspect-get-windows-systemroot"
27161 #: ../fish/guestfish-actions.pod:2141
27164 " inspect-get-windows-systemroot root\n"
27169 #: ../fish/guestfish-actions.pod:2155
27170 msgid "inspect-is-live"
27174 #: ../fish/guestfish-actions.pod:2157
27177 " inspect-is-live root\n"
27182 #: ../fish/guestfish-actions.pod:2162
27184 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
27185 "then this returns true if a live image was detected on the disk."
27189 #: ../fish/guestfish-actions.pod:2168
27190 msgid "inspect-is-multipart"
27194 #: ../fish/guestfish-actions.pod:2170
27197 " inspect-is-multipart root\n"
27202 #: ../fish/guestfish-actions.pod:2175
27204 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
27205 "then this returns true if the disk is part of a set."
27209 #: ../fish/guestfish-actions.pod:2181
27210 msgid "inspect-is-netinst"
27214 #: ../fish/guestfish-actions.pod:2183
27217 " inspect-is-netinst root\n"
27222 #: ../fish/guestfish-actions.pod:2188
27224 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
27225 "then this returns true if the disk is a network installer, ie. not a self-"
27226 "contained install CD but one which is likely to require network access to "
27227 "complete the install."
27232 #: ../fish/guestfish-actions.pod:2196
27233 msgid "inspect-list-applications"
27238 #: ../fish/guestfish-actions.pod:2198
27241 " inspect-list-applications root\n"
27247 #: ../fish/guestfish-actions.pod:2205
27249 "I<Note:> This call works differently from other parts of the inspection "
27250 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
27251 "then mount up the disks, before calling this. Listing applications is a "
27252 "significantly more difficult operation which requires access to the full "
27253 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
27254 "are just returning data cached in the libguestfs handle, this call actually "
27255 "reads parts of the mounted filesystems during the call."
27260 #: ../fish/guestfish-actions.pod:2295
27266 #: ../fish/guestfish-actions.pod:2297
27275 #: ../fish/guestfish-actions.pod:2312
27277 "You can pass the root string(s) returned to other L</inspect-get-*> "
27278 "functions in order to query further information about each operating system, "
27279 "such as the name and version."
27284 #: ../fish/guestfish-actions.pod:2317
27286 "This function uses other libguestfs features such as L</mount-ro> and L</"
27287 "umount-all> in order to mount and unmount filesystems and look at the "
27288 "contents. This should be called with no disks currently mounted. The "
27289 "function may also use Augeas, so any existing Augeas handle will be closed."
27294 #: ../fish/guestfish-actions.pod:2329 ../fish/guestfish-actions.pod:2505
27295 #: ../fish/guestfish-actions.pod:2551
27296 msgid "See also L</list-filesystems>."
27301 #: ../fish/guestfish-actions.pod:2331
27302 msgid "is-blockdev"
27307 #: ../fish/guestfish-actions.pod:2333
27310 " is-blockdev path\n"
27316 #: ../fish/guestfish-actions.pod:2338 ../fish/guestfish-actions.pod:2356
27317 #: ../fish/guestfish-actions.pod:2375 ../fish/guestfish-actions.pod:2384
27318 #: ../fish/guestfish-actions.pod:2394 ../fish/guestfish-actions.pod:2428
27319 #: ../fish/guestfish-actions.pod:2437
27320 msgid "See also L</stat>."
27325 #: ../fish/guestfish-actions.pod:2340
27331 #: ../fish/guestfish-actions.pod:2342
27340 #: ../fish/guestfish-actions.pod:2349
27346 #: ../fish/guestfish-actions.pod:2351
27349 " is-chardev path\n"
27355 #: ../fish/guestfish-actions.pod:2358
27361 #: ../fish/guestfish-actions.pod:2360
27370 #: ../fish/guestfish-actions.pod:2367
27376 #: ../fish/guestfish-actions.pod:2369
27385 #: ../fish/guestfish-actions.pod:2377
27391 #: ../fish/guestfish-actions.pod:2379
27400 #: ../fish/guestfish-actions.pod:2386
27406 #: ../fish/guestfish-actions.pod:2388
27415 #: ../fish/guestfish-actions.pod:2396
27416 msgid "is-launching"
27421 #: ../fish/guestfish-actions.pod:2398
27430 #: ../fish/guestfish-actions.pod:2405
27436 #: ../fish/guestfish-actions.pod:2407
27445 #: ../fish/guestfish-actions.pod:2412
27451 #: ../fish/guestfish-actions.pod:2414
27460 #: ../fish/guestfish-actions.pod:2421
27466 #: ../fish/guestfish-actions.pod:2423
27469 " is-socket path\n"
27475 #: ../fish/guestfish-actions.pod:2430
27481 #: ../fish/guestfish-actions.pod:2432
27484 " is-symlink path\n"
27490 #: ../fish/guestfish-actions.pod:2439
27491 msgid "kill-subprocess"
27496 #: ../fish/guestfish-actions.pod:2441
27499 " kill-subprocess\n"
27505 #: ../fish/guestfish-actions.pod:2445
27511 #: ../fish/guestfish-actions.pod:2447
27517 #: ../fish/guestfish-actions.pod:2449
27526 #: ../fish/guestfish-actions.pod:2457
27532 #: ../fish/guestfish-actions.pod:2459
27535 " lchown owner group path\n"
27541 #: ../fish/guestfish-actions.pod:2461
27543 "Change the file owner to C<owner> and group to C<group>. This is like L</"
27544 "chown> but if C<path> is a symlink then the link itself is changed, not the "
27550 #: ../fish/guestfish-actions.pod:2469
27556 #: ../fish/guestfish-actions.pod:2471
27559 " lgetxattr path name\n"
27565 #: ../fish/guestfish-actions.pod:2487
27566 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
27571 #: ../fish/guestfish-actions.pod:2489
27577 #: ../fish/guestfish-actions.pod:2491
27580 " lgetxattrs path\n"
27586 #: ../fish/guestfish-actions.pod:2493
27588 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
27589 "it returns the extended attributes of the link itself."
27594 #: ../fish/guestfish-actions.pod:2497
27595 msgid "list-devices"
27600 #: ../fish/guestfish-actions.pod:2499
27609 #: ../fish/guestfish-actions.pod:2507
27610 msgid "list-filesystems"
27615 #: ../fish/guestfish-actions.pod:2509
27618 " list-filesystems\n"
27624 #: ../fish/guestfish-actions.pod:2528
27626 "This command runs other libguestfs commands, which might include L</mount> "
27627 "and L</umount>, and therefore you should use this soon after launch and only "
27628 "when nothing is mounted."
27633 #: ../fish/guestfish-actions.pod:2532
27635 "Not all of the filesystems returned will be mountable. In particular, swap "
27636 "partitions are returned in the list. Also this command does not check that "
27637 "each filesystem found is valid and mountable, and some filesystems might be "
27638 "mountable but require special options. Filesystems may not all belong to a "
27639 "single logical operating system (use L</inspect-os> to look for OSes)."
27644 #: ../fish/guestfish-actions.pod:2540
27645 msgid "list-partitions"
27650 #: ../fish/guestfish-actions.pod:2542
27653 " list-partitions\n"
27659 #: ../fish/guestfish-actions.pod:2548
27661 "This does not return logical volumes. For that you will need to call L</"
27667 #: ../fish/guestfish-actions.pod:2553
27673 #: ../fish/guestfish-actions.pod:2555
27682 #: ../fish/guestfish-actions.pod:2563
27688 #: ../fish/guestfish-actions.pod:2565
27691 " ln target linkname\n"
27697 #: ../fish/guestfish-actions.pod:2569
27703 #: ../fish/guestfish-actions.pod:2571
27706 " ln-f target linkname\n"
27712 #: ../fish/guestfish-actions.pod:2576
27718 #: ../fish/guestfish-actions.pod:2578
27721 " ln-s target linkname\n"
27727 #: ../fish/guestfish-actions.pod:2582
27733 #: ../fish/guestfish-actions.pod:2584
27736 " ln-sf target linkname\n"
27742 #: ../fish/guestfish-actions.pod:2589
27743 msgid "lremovexattr"
27748 #: ../fish/guestfish-actions.pod:2591
27751 " lremovexattr xattr path\n"
27757 #: ../fish/guestfish-actions.pod:2593
27759 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
27760 "it removes an extended attribute of the link itself."
27765 #: ../fish/guestfish-actions.pod:2597
27771 #: ../fish/guestfish-actions.pod:2599
27780 #: ../fish/guestfish-actions.pod:2605
27782 "This command is mostly useful for interactive sessions. Programs should "
27783 "probably use L</readdir> instead."
27788 #: ../fish/guestfish-actions.pod:2608
27794 #: ../fish/guestfish-actions.pod:2610
27797 " lsetxattr xattr val vallen path\n"
27803 #: ../fish/guestfish-actions.pod:2612
27805 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
27806 "sets an extended attribute of the link itself."
27811 #: ../fish/guestfish-actions.pod:2616
27817 #: ../fish/guestfish-actions.pod:2618
27826 #: ../fish/guestfish-actions.pod:2622
27828 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
27829 "the link is stat-ed, not the file it refers to."
27834 #: ../fish/guestfish-actions.pod:2628
27840 #: ../fish/guestfish-actions.pod:2630
27843 " lstatlist path 'names ...'\n"
27849 #: ../fish/guestfish-actions.pod:2632
27851 "This call allows you to perform the L</lstat> operation on multiple files, "
27852 "where all files are in the directory C<path>. C<names> is the list of files "
27853 "from this directory."
27858 #: ../fish/guestfish-actions.pod:2641
27860 "This call is intended for programs that want to efficiently list a directory "
27861 "contents without making many round-trips. See also L</lxattrlist> for a "
27862 "similarly efficient call for getting extended attributes. Very long "
27863 "directory listings might cause the protocol message size to be exceeded, "
27864 "causing this call to fail. The caller must split up such requests into "
27865 "smaller groups of names."
27870 #: ../fish/guestfish-actions.pod:2649
27871 msgid "luks-add-key"
27876 #: ../fish/guestfish-actions.pod:2651
27879 " luks-add-key device keyslot\n"
27885 #: ../fish/guestfish-actions.pod:2658
27887 "Note that if C<keyslot> already contains a key, then this command will "
27888 "fail. You have to use L</luks-kill-slot> first to remove that key."
27893 #: ../fish/guestfish-actions.pod:2662 ../fish/guestfish-actions.pod:2684
27894 #: ../fish/guestfish-actions.pod:2697 ../fish/guestfish-actions.pod:2711
27895 #: ../fish/guestfish-actions.pod:2734 ../fish/guestfish-actions.pod:2744
27897 "This command has one or more key or passphrase parameters. Guestfish will "
27898 "prompt for these separately."
27903 #: ../fish/guestfish-actions.pod:2665
27909 #: ../fish/guestfish-actions.pod:2667
27912 " luks-close device\n"
27918 #: ../fish/guestfish-actions.pod:2669
27920 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
27921 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
27922 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
27928 #: ../fish/guestfish-actions.pod:2675
27929 msgid "luks-format"
27934 #: ../fish/guestfish-actions.pod:2677
27937 " luks-format device keyslot\n"
27943 #: ../fish/guestfish-actions.pod:2690
27944 msgid "luks-format-cipher"
27949 #: ../fish/guestfish-actions.pod:2692
27952 " luks-format-cipher device keyslot cipher\n"
27958 #: ../fish/guestfish-actions.pod:2694
27960 "This command is the same as L</luks-format> but it also allows you to set "
27961 "the C<cipher> used."
27966 #: ../fish/guestfish-actions.pod:2703
27967 msgid "luks-kill-slot"
27972 #: ../fish/guestfish-actions.pod:2705
27975 " luks-kill-slot device keyslot\n"
27981 #: ../fish/guestfish-actions.pod:2714
27987 #: ../fish/guestfish-actions.pod:2716
27990 " luks-open device mapname\n"
27996 #: ../fish/guestfish-actions.pod:2730
27998 "If this block device contains LVM volume groups, then calling L</vgscan> "
27999 "followed by L</vg-activate-all> will make them visible."
28004 #: ../fish/guestfish-actions.pod:2737
28005 msgid "luks-open-ro"
28010 #: ../fish/guestfish-actions.pod:2739
28013 " luks-open-ro device mapname\n"
28019 #: ../fish/guestfish-actions.pod:2741
28021 "This is the same as L</luks-open> except that a read-only mapping is created."
28026 #: ../fish/guestfish-actions.pod:2747
28032 #: ../fish/guestfish-actions.pod:2749
28035 " lvcreate logvol volgroup mbytes\n"
28041 #: ../fish/guestfish-actions.pod:2754
28042 msgid "lvm-canonical-lv-name"
28047 #: ../fish/guestfish-actions.pod:2756
28050 " lvm-canonical-lv-name lvname\n"
28056 #: ../fish/guestfish-actions.pod:2765
28057 msgid "See also L</is-lv>."
28062 #: ../fish/guestfish-actions.pod:2767
28063 msgid "lvm-clear-filter"
28068 #: ../fish/guestfish-actions.pod:2769
28071 " lvm-clear-filter\n"
28077 #: ../fish/guestfish-actions.pod:2771
28079 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
28085 #: ../fish/guestfish-actions.pod:2777
28086 msgid "lvm-remove-all"
28091 #: ../fish/guestfish-actions.pod:2779
28094 " lvm-remove-all\n"
28100 #: ../fish/guestfish-actions.pod:2787
28101 msgid "lvm-set-filter"
28106 #: ../fish/guestfish-actions.pod:2789
28109 " lvm-set-filter 'devices ...'\n"
28115 #: ../fish/guestfish-actions.pod:2814
28121 #: ../fish/guestfish-actions.pod:2816
28124 " lvremove device\n"
28130 #: ../fish/guestfish-actions.pod:2824
28136 #: ../fish/guestfish-actions.pod:2826
28139 " lvrename logvol newlogvol\n"
28145 #: ../fish/guestfish-actions.pod:2830
28151 #: ../fish/guestfish-actions.pod:2832
28154 " lvresize device mbytes\n"
28160 #: ../fish/guestfish-actions.pod:2838
28161 msgid "lvresize-free"
28166 #: ../fish/guestfish-actions.pod:2840
28169 " lvresize-free lv percent\n"
28175 #: ../fish/guestfish-actions.pod:2848
28181 #: ../fish/guestfish-actions.pod:2850
28190 #: ../fish/guestfish-actions.pod:2858
28191 msgid "See also L</lvs-full>, L</list-filesystems>."
28196 #: ../fish/guestfish-actions.pod:2860
28202 #: ../fish/guestfish-actions.pod:2862
28211 #: ../fish/guestfish-actions.pod:2867
28217 #: ../fish/guestfish-actions.pod:2869
28226 #: ../fish/guestfish-actions.pod:2873
28232 #: ../fish/guestfish-actions.pod:2875
28235 " lxattrlist path 'names ...'\n"
28241 #: ../fish/guestfish-actions.pod:2891
28243 "This call is intended for programs that want to efficiently list a directory "
28244 "contents without making many round-trips. See also L</lstatlist> for a "
28245 "similarly efficient call for getting standard stats. Very long directory "
28246 "listings might cause the protocol message size to be exceeded, causing this "
28247 "call to fail. The caller must split up such requests into smaller groups of "
28253 #: ../fish/guestfish-actions.pod:2899
28259 #: ../fish/guestfish-actions.pod:2901
28268 #: ../fish/guestfish-actions.pod:2905
28274 #: ../fish/guestfish-actions.pod:2907
28277 " mkdir-mode path mode\n"
28283 #: ../fish/guestfish-actions.pod:2916
28284 msgid "See also L</mkdir>, L</umask>"
28289 #: ../fish/guestfish-actions.pod:2918
28295 #: ../fish/guestfish-actions.pod:2920
28304 #: ../fish/guestfish-actions.pod:2925
28310 #: ../fish/guestfish-actions.pod:2927
28313 " mkdtemp template\n"
28319 #: ../fish/guestfish-actions.pod:2948
28325 #: ../fish/guestfish-actions.pod:2950
28328 " mke2fs-J fstype blocksize device journal\n"
28334 #: ../fish/guestfish-actions.pod:2958
28335 msgid "See also L</mke2journal>."
28340 #: ../fish/guestfish-actions.pod:2960
28346 #: ../fish/guestfish-actions.pod:2962
28349 " mke2fs-JL fstype blocksize device label\n"
28355 #: ../fish/guestfish-actions.pod:2967
28356 msgid "See also L</mke2journal-L>."
28361 #: ../fish/guestfish-actions.pod:2969
28367 #: ../fish/guestfish-actions.pod:2971
28370 " mke2fs-JU fstype blocksize device uuid\n"
28376 #: ../fish/guestfish-actions.pod:2976
28377 msgid "See also L</mke2journal-U>."
28382 #: ../fish/guestfish-actions.pod:2978
28383 msgid "mke2journal"
28388 #: ../fish/guestfish-actions.pod:2980
28391 " mke2journal blocksize device\n"
28397 #: ../fish/guestfish-actions.pod:2987
28398 msgid "mke2journal-L"
28403 #: ../fish/guestfish-actions.pod:2989
28406 " mke2journal-L blocksize label device\n"
28412 #: ../fish/guestfish-actions.pod:2993
28413 msgid "mke2journal-U"
28418 #: ../fish/guestfish-actions.pod:2995
28421 " mke2journal-U blocksize uuid device\n"
28427 #: ../fish/guestfish-actions.pod:2999
28433 #: ../fish/guestfish-actions.pod:3001
28436 " mkfifo mode path\n"
28442 #: ../fish/guestfish-actions.pod:3003
28444 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28445 "is just a convenient wrapper around L</mknod>."
28450 #: ../fish/guestfish-actions.pod:3009
28456 #: ../fish/guestfish-actions.pod:3011
28459 " mkfs fstype device\n"
28465 #: ../fish/guestfish-actions.pod:3017
28471 #: ../fish/guestfish-actions.pod:3019
28474 " mkfs-b fstype blocksize device\n"
28480 #: ../fish/guestfish-actions.pod:3021
28482 "This call is similar to L</mkfs>, but it allows you to control the block "
28483 "size of the resulting filesystem. Supported block sizes depend on the "
28484 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28488 #: ../fish/guestfish-actions.pod:3029
28490 "This function is deprecated. In new code, use the L</mkfs_opts> call "
28496 #: ../fish/guestfish-actions.pod:3036
28501 #: ../fish/guestfish-actions.pod:3038
28504 " mkfs-opts fstype device [blocksize:..] [features:..]\n"
28510 #: ../fish/guestfish-actions.pod:3073
28511 msgid "mkmountpoint"
28516 #: ../fish/guestfish-actions.pod:3075
28519 " mkmountpoint exemptpath\n"
28525 #: ../fish/guestfish-actions.pod:3077
28527 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
28528 "to create extra mountpoints before mounting the first filesystem."
28533 #: ../fish/guestfish-actions.pod:3101
28535 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
28536 "unexpected errors if you try to mix these calls. It is safest to manually "
28537 "unmount filesystems and remove mountpoints after use."
28542 #: ../fish/guestfish-actions.pod:3105
28544 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
28545 "for this to work for manual mountpoints, you must ensure that the innermost "
28546 "mountpoints have the longest pathnames, as in the example code above."
28550 #: ../fish/guestfish-actions.pod:3112
28552 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
28553 "L</umount-all> to be called when the handle is closed which can also trigger "
28559 #: ../fish/guestfish-actions.pod:3116
28565 #: ../fish/guestfish-actions.pod:3118
28568 " mknod mode devmajor devminor path\n"
28574 #: ../fish/guestfish-actions.pod:3128
28576 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28577 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28578 "regular file). These constants are available in the standard Linux header "
28579 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
28580 "wrappers around this command which bitwise OR in the appropriate constant "
28586 #: ../fish/guestfish-actions.pod:3138
28592 #: ../fish/guestfish-actions.pod:3140
28595 " mknod-b mode devmajor devminor path\n"
28601 #: ../fish/guestfish-actions.pod:3142
28603 "This call creates a block device node called C<path> with mode C<mode> and "
28604 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28605 "wrapper around L</mknod>."
28610 #: ../fish/guestfish-actions.pod:3148
28616 #: ../fish/guestfish-actions.pod:3150
28619 " mknod-c mode devmajor devminor path\n"
28625 #: ../fish/guestfish-actions.pod:3152
28627 "This call creates a char device node called C<path> with mode C<mode> and "
28628 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28629 "wrapper around L</mknod>."
28634 #: ../fish/guestfish-actions.pod:3158
28640 #: ../fish/guestfish-actions.pod:3160
28649 #: ../fish/guestfish-actions.pod:3164
28655 #: ../fish/guestfish-actions.pod:3166
28658 " mkswap-L label device\n"
28664 #: ../fish/guestfish-actions.pod:3174
28670 #: ../fish/guestfish-actions.pod:3176
28673 " mkswap-U uuid device\n"
28679 #: ../fish/guestfish-actions.pod:3180
28680 msgid "mkswap-file"
28685 #: ../fish/guestfish-actions.pod:3182
28688 " mkswap-file path\n"
28694 #: ../fish/guestfish-actions.pod:3186
28696 "This command just writes a swap file signature to an existing file. To "
28697 "create the file itself, use something like L</fallocate>."
28702 #: ../fish/guestfish-actions.pod:3189
28708 #: ../fish/guestfish-actions.pod:3191
28711 " modprobe modulename\n"
28717 #: ../fish/guestfish-actions.pod:3198
28723 #: ../fish/guestfish-actions.pod:3200
28726 " mount device mountpoint\n"
28732 #: ../fish/guestfish-actions.pod:3216
28734 "B<Important note:> When you use this call, the filesystem options C<sync> "
28735 "and C<noatime> are set implicitly. This was originally done because we "
28736 "thought it would improve reliability, but it turns out that I<-o sync> has a "
28737 "very large negative performance impact and negligible effect on "
28738 "reliability. Therefore we recommend that you avoid using L</mount> in any "
28739 "code that needs performance, and instead use L</mount-options> (use an empty "
28740 "string for the first parameter if you don't want any options)."
28744 #: ../fish/guestfish-actions.pod:3226
28746 "This function is deprecated. In new code, use the L</mount_options> call "
28752 #: ../fish/guestfish-actions.pod:3233
28758 #: ../fish/guestfish-actions.pod:3235
28761 " mount-loop file mountpoint\n"
28767 #: ../fish/guestfish-actions.pod:3241
28768 msgid "mount-options"
28773 #: ../fish/guestfish-actions.pod:3243
28776 " mount-options options device mountpoint\n"
28782 #: ../fish/guestfish-actions.pod:3245
28784 "This is the same as the L</mount> command, but it allows you to set the "
28785 "mount options as for the L<mount(8)> I<-o> flag."
28790 #: ../fish/guestfish-actions.pod:3253
28796 #: ../fish/guestfish-actions.pod:3255
28799 " mount-ro device mountpoint\n"
28805 #: ../fish/guestfish-actions.pod:3257
28807 "This is the same as the L</mount> command, but it mounts the filesystem with "
28808 "the read-only (I<-o ro>) flag."
28813 #: ../fish/guestfish-actions.pod:3260
28819 #: ../fish/guestfish-actions.pod:3262
28822 " mount-vfs options vfstype device mountpoint\n"
28828 #: ../fish/guestfish-actions.pod:3264
28830 "This is the same as the L</mount> command, but it allows you to set both the "
28831 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
28836 #: ../fish/guestfish-actions.pod:3268
28837 msgid "mountpoints"
28842 #: ../fish/guestfish-actions.pod:3270
28851 #: ../fish/guestfish-actions.pod:3272
28853 "This call is similar to L</mounts>. That call returns a list of devices. "
28854 "This one returns a hash table (map) of device name to directory where the "
28855 "device is mounted."
28860 #: ../fish/guestfish-actions.pod:3276
28866 #: ../fish/guestfish-actions.pod:3278
28875 #: ../fish/guestfish-actions.pod:3285
28876 msgid "See also: L</mountpoints>"
28881 #: ../fish/guestfish-actions.pod:3287
28887 #: ../fish/guestfish-actions.pod:3289
28896 #: ../fish/guestfish-actions.pod:3294
28897 msgid "ntfs-3g-probe"
28902 #: ../fish/guestfish-actions.pod:3296
28905 " ntfs-3g-probe true|false device\n"
28911 #: ../fish/guestfish-actions.pod:3310
28917 #: ../fish/guestfish-actions.pod:3312
28920 " ntfsresize device\n"
28926 #: ../fish/guestfish-actions.pod:3327
28927 msgid "ntfsresize-size"
28932 #: ../fish/guestfish-actions.pod:3329
28935 " ntfsresize-size device size\n"
28941 #: ../fish/guestfish-actions.pod:3331
28943 "This command is the same as L</ntfsresize> except that it allows you to "
28944 "specify the new size (in bytes) explicitly."
28949 #: ../fish/guestfish-actions.pod:3334
28955 #: ../fish/guestfish-actions.pod:3336
28958 " part-add device prlogex startsect endsect\n"
28964 #: ../fish/guestfish-actions.pod:3338
28966 "This command adds a partition to C<device>. If there is no partition table "
28967 "on the device, call L</part-init> first."
28972 #: ../fish/guestfish-actions.pod:3350
28974 "Creating a partition which covers the whole disk is not so easy. Use L</"
28975 "part-disk> to do that."
28980 #: ../fish/guestfish-actions.pod:3353
28986 #: ../fish/guestfish-actions.pod:3355
28989 " part-del device partnum\n"
28995 #: ../fish/guestfish-actions.pod:3363
29001 #: ../fish/guestfish-actions.pod:3365
29004 " part-disk device parttype\n"
29010 #: ../fish/guestfish-actions.pod:3367
29012 "This command is simply a combination of L</part-init> followed by L</part-"
29013 "add> to create a single primary partition covering the whole disk."
29018 #: ../fish/guestfish-actions.pod:3371
29020 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29021 "possible values are described in L</part-init>."
29026 #: ../fish/guestfish-actions.pod:3377
29027 msgid "part-get-bootable"
29032 #: ../fish/guestfish-actions.pod:3379
29035 " part-get-bootable device partnum\n"
29041 #: ../fish/guestfish-actions.pod:3384
29042 msgid "See also L</part-set-bootable>."
29047 #: ../fish/guestfish-actions.pod:3386
29048 msgid "part-get-mbr-id"
29053 #: ../fish/guestfish-actions.pod:3388
29056 " part-get-mbr-id device partnum\n"
29062 #: ../fish/guestfish-actions.pod:3393 ../fish/guestfish-actions.pod:3531
29064 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29065 "undefined results for other partition table types (see L</part-get-"
29071 #: ../fish/guestfish-actions.pod:3397
29072 msgid "part-get-parttype"
29077 #: ../fish/guestfish-actions.pod:3399
29080 " part-get-parttype device\n"
29086 #: ../fish/guestfish-actions.pod:3404
29088 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29089 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29090 "possible, although unusual. See L</part-init> for a full list."
29095 #: ../fish/guestfish-actions.pod:3409
29101 #: ../fish/guestfish-actions.pod:3411
29104 " part-init device parttype\n"
29110 #: ../fish/guestfish-actions.pod:3417
29112 "Initially there are no partitions. Following this, you should call L</part-"
29113 "add> for each partition required."
29118 #: ../fish/guestfish-actions.pod:3480
29124 #: ../fish/guestfish-actions.pod:3482
29127 " part-list device\n"
29133 #: ../fish/guestfish-actions.pod:3497
29135 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29136 "the device's sector size, see L</blockdev-getss>."
29141 #: ../fish/guestfish-actions.pod:3510
29142 msgid "part-set-bootable"
29147 #: ../fish/guestfish-actions.pod:3512
29150 " part-set-bootable device partnum true|false\n"
29156 #: ../fish/guestfish-actions.pod:3521
29157 msgid "part-set-mbr-id"
29162 #: ../fish/guestfish-actions.pod:3523
29165 " part-set-mbr-id device partnum idbyte\n"
29171 #: ../fish/guestfish-actions.pod:3535
29172 msgid "part-set-name"
29177 #: ../fish/guestfish-actions.pod:3537
29180 " part-set-name device partnum name\n"
29186 #: ../fish/guestfish-actions.pod:3545
29187 msgid "part-to-dev"
29192 #: ../fish/guestfish-actions.pod:3547
29195 " part-to-dev partition\n"
29201 #: ../fish/guestfish-actions.pod:3553
29203 "The named partition must exist, for example as a string returned from L</"
29204 "list-partitions>."
29209 #: ../fish/guestfish-actions.pod:3556
29210 msgid "ping-daemon"
29215 #: ../fish/guestfish-actions.pod:3558
29224 #: ../fish/guestfish-actions.pod:3565
29230 #: ../fish/guestfish-actions.pod:3567
29233 " pread path count offset\n"
29239 #: ../fish/guestfish-actions.pod:3575
29240 msgid "See also L</pwrite>, L</pread-device>."
29245 #: ../fish/guestfish-actions.pod:3580
29246 msgid "pread-device"
29251 #: ../fish/guestfish-actions.pod:3582
29254 " pread-device device count offset\n"
29260 #: ../fish/guestfish-actions.pod:3590
29261 msgid "See also L</pread>."
29266 #: ../fish/guestfish-actions.pod:3595
29272 #: ../fish/guestfish-actions.pod:3597
29275 " pvcreate device\n"
29281 #: ../fish/guestfish-actions.pod:3603
29287 #: ../fish/guestfish-actions.pod:3605
29290 " pvremove device\n"
29296 #: ../fish/guestfish-actions.pod:3614
29302 #: ../fish/guestfish-actions.pod:3616
29305 " pvresize device\n"
29311 #: ../fish/guestfish-actions.pod:3621
29312 msgid "pvresize-size"
29317 #: ../fish/guestfish-actions.pod:3623
29320 " pvresize-size device size\n"
29326 #: ../fish/guestfish-actions.pod:3625
29328 "This command is the same as L</pvresize> except that it allows you to "
29329 "specify the new size (in bytes) explicitly."
29334 #: ../fish/guestfish-actions.pod:3628
29340 #: ../fish/guestfish-actions.pod:3630
29349 #: ../fish/guestfish-actions.pod:3638
29350 msgid "See also L</pvs-full>."
29355 #: ../fish/guestfish-actions.pod:3640
29361 #: ../fish/guestfish-actions.pod:3642
29370 #: ../fish/guestfish-actions.pod:3647
29376 #: ../fish/guestfish-actions.pod:3649
29385 #: ../fish/guestfish-actions.pod:3653
29391 #: ../fish/guestfish-actions.pod:3655
29394 " pwrite path content offset\n"
29400 #: ../fish/guestfish-actions.pod:3666
29401 msgid "See also L</pread>, L</pwrite-device>."
29406 #: ../fish/guestfish-actions.pod:3671
29407 msgid "pwrite-device"
29412 #: ../fish/guestfish-actions.pod:3673
29415 " pwrite-device device content offset\n"
29421 #: ../fish/guestfish-actions.pod:3683
29422 msgid "See also L</pwrite>."
29427 #: ../fish/guestfish-actions.pod:3688
29433 #: ../fish/guestfish-actions.pod:3690
29436 " read-file path\n"
29442 #: ../fish/guestfish-actions.pod:3695
29444 "Unlike L</cat>, this function can correctly handle files that contain "
29445 "embedded ASCII NUL characters. However unlike L</download>, this function "
29446 "is limited in the total size of file that can be handled."
29451 #: ../fish/guestfish-actions.pod:3703
29457 #: ../fish/guestfish-actions.pod:3705
29460 " read-lines path\n"
29466 #: ../fish/guestfish-actions.pod:3712
29468 "Note that this function cannot correctly handle binary files (specifically, "
29469 "files containing C<\\0> character which is treated as end of line). For "
29470 "those you need to use the L</read-file> function which has a more complex "
29476 #: ../fish/guestfish-actions.pod:3717
29482 #: ../fish/guestfish-actions.pod:3719
29491 #: ../fish/guestfish-actions.pod:3771
29493 "This function is primarily intended for use by programs. To get a simple "
29494 "list of names, use L</ls>. To get a printable directory for human "
29495 "consumption, use L</ll>."
29500 #: ../fish/guestfish-actions.pod:3775
29506 #: ../fish/guestfish-actions.pod:3777
29515 #: ../fish/guestfish-actions.pod:3781
29516 msgid "readlinklist"
29521 #: ../fish/guestfish-actions.pod:3783
29524 " readlinklist path 'names ...'\n"
29530 #: ../fish/guestfish-actions.pod:3807
29536 #: ../fish/guestfish-actions.pod:3809
29545 #: ../fish/guestfish-actions.pod:3814
29546 msgid "removexattr"
29551 #: ../fish/guestfish-actions.pod:3816
29554 " removexattr xattr path\n"
29560 #: ../fish/guestfish-actions.pod:3821
29561 msgid "See also: L</lremovexattr>, L<attr(5)>."
29566 #: ../fish/guestfish-actions.pod:3823
29572 #: ../fish/guestfish-actions.pod:3825
29575 " resize2fs device\n"
29581 #: ../fish/guestfish-actions.pod:3830
29583 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
29584 "before calling this command. For unknown reasons C<resize2fs> sometimes "
29585 "gives an error about this and sometimes not. In any case, it is always safe "
29586 "to call L</e2fsck-f> before calling this function."
29590 #: ../fish/guestfish-actions.pod:3836
29591 msgid "resize2fs-M"
29595 #: ../fish/guestfish-actions.pod:3838
29598 " resize2fs-M device\n"
29603 #: ../fish/guestfish-actions.pod:3840
29605 "This command is the same as L</resize2fs>, but the filesystem is resized to "
29606 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
29611 #: ../fish/guestfish-actions.pod:3844
29613 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
29614 "and read the C<Block size> and C<Block count> values. These two numbers, "
29615 "multiplied together, give the resulting size of the minimal filesystem in "
29621 #: ../fish/guestfish-actions.pod:3849
29622 msgid "resize2fs-size"
29627 #: ../fish/guestfish-actions.pod:3851
29630 " resize2fs-size device size\n"
29636 #: ../fish/guestfish-actions.pod:3853
29638 "This command is the same as L</resize2fs> except that it allows you to "
29639 "specify the new size (in bytes) explicitly."
29644 #: ../fish/guestfish-actions.pod:3856
29650 #: ../fish/guestfish-actions.pod:3858
29659 #: ../fish/guestfish-actions.pod:3862
29665 #: ../fish/guestfish-actions.pod:3864
29674 #: ../fish/guestfish-actions.pod:3870
29680 #: ../fish/guestfish-actions.pod:3872
29689 #: ../fish/guestfish-actions.pod:3876
29690 msgid "rmmountpoint"
29695 #: ../fish/guestfish-actions.pod:3878
29698 " rmmountpoint exemptpath\n"
29704 #: ../fish/guestfish-actions.pod:3880
29706 "This calls removes a mountpoint that was previously created with L</"
29707 "mkmountpoint>. See L</mkmountpoint> for full details."
29712 #: ../fish/guestfish-actions.pod:3884
29713 msgid "scrub-device"
29718 #: ../fish/guestfish-actions.pod:3886
29721 " scrub-device device\n"
29727 #: ../fish/guestfish-actions.pod:3897
29733 #: ../fish/guestfish-actions.pod:3899
29736 " scrub-file file\n"
29742 #: ../fish/guestfish-actions.pod:3909
29743 msgid "scrub-freespace"
29748 #: ../fish/guestfish-actions.pod:3911
29751 " scrub-freespace dir\n"
29757 #: ../fish/guestfish-actions.pod:3913
29759 "This command creates the directory C<dir> and then fills it with files until "
29760 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
29761 "deletes them. The intention is to scrub any free space on the partition "
29762 "containing C<dir>."
29767 #: ../fish/guestfish-actions.pod:3922
29773 #: ../fish/guestfish-actions.pod:3924
29779 #: ../fish/guestfish-actions.pod:3926
29782 " set-append append\n"
29787 #: ../fish/guestfish-actions.pod:3937
29788 msgid "set-attach-method"
29792 #: ../fish/guestfish-actions.pod:3939
29793 msgid "attach-method"
29797 #: ../fish/guestfish-actions.pod:3941
29800 " set-attach-method attachmethod\n"
29806 #: ../fish/guestfish-actions.pod:3963
29807 msgid "set-autosync"
29812 #: ../fish/guestfish-actions.pod:3965
29818 #: ../fish/guestfish-actions.pod:3967
29821 " set-autosync true|false\n"
29827 #: ../fish/guestfish-actions.pod:3977
29833 #: ../fish/guestfish-actions.pod:3979
29839 #: ../fish/guestfish-actions.pod:3981
29842 " set-direct true|false\n"
29848 #: ../fish/guestfish-actions.pod:3987
29850 "One consequence of this is that log messages aren't caught by the library "
29851 "and handled by L</set-log-message-callback>, but go straight to stdout."
29856 #: ../fish/guestfish-actions.pod:3996
29857 msgid "set-e2label"
29862 #: ../fish/guestfish-actions.pod:3998
29865 " set-e2label device label\n"
29871 #: ../fish/guestfish-actions.pod:4004
29873 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
29874 "label on a filesystem."
29879 #: ../fish/guestfish-actions.pod:4007
29885 #: ../fish/guestfish-actions.pod:4009
29888 " set-e2uuid device uuid\n"
29894 #: ../fish/guestfish-actions.pod:4016
29896 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
29897 "UUID of a filesystem."
29902 #: ../fish/guestfish-actions.pod:4019
29903 msgid "set-memsize"
29908 #: ../fish/guestfish-actions.pod:4021
29914 #: ../fish/guestfish-actions.pod:4023
29917 " set-memsize memsize\n"
29923 #: ../fish/guestfish-actions.pod:4025
29925 "This sets the memory size in megabytes allocated to the qemu subprocess. "
29926 "This only has any effect if called before L</launch>."
29931 #: ../fish/guestfish-actions.pod:4036
29932 msgid "set-network"
29937 #: ../fish/guestfish-actions.pod:4038
29943 #: ../fish/guestfish-actions.pod:4040
29946 " set-network true|false\n"
29952 #: ../fish/guestfish-actions.pod:4048
29954 "You must call this before calling L</launch>, otherwise it has no effect."
29959 #: ../fish/guestfish-actions.pod:4051
29965 #: ../fish/guestfish-actions.pod:4053
29971 #: ../fish/guestfish-actions.pod:4055
29974 " set-path searchpath\n"
29980 #: ../fish/guestfish-actions.pod:4064
29986 #: ../fish/guestfish-actions.pod:4066
29992 #: ../fish/guestfish-actions.pod:4068
30001 #: ../fish/guestfish-actions.pod:4088
30002 msgid "set-recovery-proc"
30007 #: ../fish/guestfish-actions.pod:4090
30008 msgid "recovery-proc"
30013 #: ../fish/guestfish-actions.pod:4092
30016 " set-recovery-proc true|false\n"
30022 #: ../fish/guestfish-actions.pod:4094
30024 "If this is called with the parameter C<false> then L</launch> does not "
30025 "create a recovery process. The purpose of the recovery process is to stop "
30026 "runaway qemu processes in the case where the main program aborts abruptly."
30031 #: ../fish/guestfish-actions.pod:4099
30033 "This only has any effect if called before L</launch>, and the default is "
30039 #: ../fish/guestfish-actions.pod:4108
30040 msgid "set-selinux"
30045 #: ../fish/guestfish-actions.pod:4110
30051 #: ../fish/guestfish-actions.pod:4112
30054 " set-selinux true|false\n"
30060 #: ../fish/guestfish-actions.pod:4123
30066 #: ../fish/guestfish-actions.pod:4125
30072 #: ../fish/guestfish-actions.pod:4127
30075 " set-trace true|false\n"
30080 #: ../fish/guestfish-actions.pod:4139
30082 "Trace messages are normally sent to C<stderr>, unless you register a "
30083 "callback to send them somewhere else (see L</set-event-callback>)."
30088 #: ../fish/guestfish-actions.pod:4143
30089 msgid "set-verbose"
30094 #: ../fish/guestfish-actions.pod:4145
30100 #: ../fish/guestfish-actions.pod:4147
30103 " set-verbose true|false\n"
30108 #: ../fish/guestfish-actions.pod:4154
30110 "Verbose messages are normally sent to C<stderr>, unless you register a "
30111 "callback to send them somewhere else (see L</set-event-callback>)."
30116 #: ../fish/guestfish-actions.pod:4158
30122 #: ../fish/guestfish-actions.pod:4160
30125 " setcon context\n"
30131 #: ../fish/guestfish-actions.pod:4167
30137 #: ../fish/guestfish-actions.pod:4169
30140 " setxattr xattr val vallen path\n"
30146 #: ../fish/guestfish-actions.pod:4175
30147 msgid "See also: L</lsetxattr>, L<attr(5)>."
30152 #: ../fish/guestfish-actions.pod:4177
30158 #: ../fish/guestfish-actions.pod:4179
30161 " sfdisk device cyls heads sectors 'lines ...'\n"
30167 #: ../fish/guestfish-actions.pod:4201
30168 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
30172 #: ../fish/guestfish-actions.pod:4207 ../fish/guestfish-actions.pod:4230
30173 #: ../fish/guestfish-actions.pod:4252
30175 "This function is deprecated. In new code, use the L</part_add> call instead."
30180 #: ../fish/guestfish-actions.pod:4214
30186 #: ../fish/guestfish-actions.pod:4216
30189 " sfdiskM device 'lines ...'\n"
30195 #: ../fish/guestfish-actions.pod:4218
30197 "This is a simplified interface to the L</sfdisk> command, where partition "
30198 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
30199 "you don't need to specify the cyls, heads and sectors parameters which were "
30200 "rarely if ever used anyway."
30205 #: ../fish/guestfish-actions.pod:4224
30206 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
30211 #: ../fish/guestfish-actions.pod:4237
30217 #: ../fish/guestfish-actions.pod:4239
30220 " sfdisk-N device partnum cyls heads sectors line\n"
30226 #: ../fish/guestfish-actions.pod:4244
30228 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
30229 "cyls/heads/sectors parameters."
30234 #: ../fish/guestfish-actions.pod:4247
30235 msgid "See also: L</part-add>"
30240 #: ../fish/guestfish-actions.pod:4259
30241 msgid "sfdisk-disk-geometry"
30246 #: ../fish/guestfish-actions.pod:4261
30249 " sfdisk-disk-geometry device\n"
30255 #: ../fish/guestfish-actions.pod:4263
30257 "This displays the disk geometry of C<device> read from the partition table. "
30258 "Especially in the case where the underlying block device has been resized, "
30259 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
30260 "kernel-geometry>)."
30265 #: ../fish/guestfish-actions.pod:4271
30266 msgid "sfdisk-kernel-geometry"
30271 #: ../fish/guestfish-actions.pod:4273
30274 " sfdisk-kernel-geometry device\n"
30280 #: ../fish/guestfish-actions.pod:4280
30286 #: ../fish/guestfish-actions.pod:4282
30289 " sfdisk-l device\n"
30295 #: ../fish/guestfish-actions.pod:4288
30296 msgid "See also: L</part-list>"
30300 #: ../fish/guestfish-actions.pod:4290
30302 "This function is deprecated. In new code, use the L</part_list> call "
30308 #: ../fish/guestfish-actions.pod:4297
30314 #: ../fish/guestfish-actions.pod:4299
30323 #: ../fish/guestfish-actions.pod:4304
30324 msgid "This is like L</command>, but passes the command to:"
30329 #: ../fish/guestfish-actions.pod:4312
30330 msgid "All the provisos about L</command> apply to this call."
30335 #: ../fish/guestfish-actions.pod:4314
30341 #: ../fish/guestfish-actions.pod:4316
30344 " sh-lines command\n"
30350 #: ../fish/guestfish-actions.pod:4318
30351 msgid "This is the same as L</sh>, but splits the result into a list of lines."
30356 #: ../fish/guestfish-actions.pod:4321
30357 msgid "See also: L</command-lines>"
30362 #: ../fish/guestfish-actions.pod:4323
30368 #: ../fish/guestfish-actions.pod:4325
30377 #: ../fish/guestfish-actions.pod:4329
30383 #: ../fish/guestfish-actions.pod:4331
30392 #: ../fish/guestfish-actions.pod:4337
30398 #: ../fish/guestfish-actions.pod:4339
30407 #: ../fish/guestfish-actions.pod:4347
30413 #: ../fish/guestfish-actions.pod:4349
30422 #: ../fish/guestfish-actions.pod:4357
30428 #: ../fish/guestfish-actions.pod:4359
30431 " strings-e encoding path\n"
30437 #: ../fish/guestfish-actions.pod:4361
30439 "This is like the L</strings> command, but allows you to specify the encoding "
30440 "of strings that are looked for in the source file C<path>."
30445 #: ../fish/guestfish-actions.pod:4371
30447 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30448 "ISO-8859-X (this is what L</strings> uses)."
30453 #: ../fish/guestfish-actions.pod:4403
30454 msgid "swapoff-device"
30459 #: ../fish/guestfish-actions.pod:4405
30462 " swapoff-device device\n"
30468 #: ../fish/guestfish-actions.pod:4407
30470 "This command disables the libguestfs appliance swap device or partition "
30471 "named C<device>. See L</swapon-device>."
30476 #: ../fish/guestfish-actions.pod:4411
30477 msgid "swapoff-file"
30482 #: ../fish/guestfish-actions.pod:4413
30485 " swapoff-file file\n"
30491 #: ../fish/guestfish-actions.pod:4417
30492 msgid "swapoff-label"
30497 #: ../fish/guestfish-actions.pod:4419
30500 " swapoff-label label\n"
30506 #: ../fish/guestfish-actions.pod:4424
30507 msgid "swapoff-uuid"
30512 #: ../fish/guestfish-actions.pod:4426
30515 " swapoff-uuid uuid\n"
30521 #: ../fish/guestfish-actions.pod:4431
30522 msgid "swapon-device"
30527 #: ../fish/guestfish-actions.pod:4433
30530 " swapon-device device\n"
30536 #: ../fish/guestfish-actions.pod:4435
30538 "This command enables the libguestfs appliance to use the swap device or "
30539 "partition named C<device>. The increased memory is made available for all "
30540 "commands, for example those run using L</command> or L</sh>."
30545 #: ../fish/guestfish-actions.pod:4447
30546 msgid "swapon-file"
30551 #: ../fish/guestfish-actions.pod:4449
30554 " swapon-file file\n"
30560 #: ../fish/guestfish-actions.pod:4451
30562 "This command enables swap to a file. See L</swapon-device> for other notes."
30567 #: ../fish/guestfish-actions.pod:4454
30568 msgid "swapon-label"
30573 #: ../fish/guestfish-actions.pod:4456
30576 " swapon-label label\n"
30582 #: ../fish/guestfish-actions.pod:4458
30584 "This command enables swap to a labeled swap partition. See L</swapon-"
30585 "device> for other notes."
30590 #: ../fish/guestfish-actions.pod:4461
30591 msgid "swapon-uuid"
30596 #: ../fish/guestfish-actions.pod:4463
30599 " swapon-uuid uuid\n"
30605 #: ../fish/guestfish-actions.pod:4465
30607 "This command enables swap to a swap partition with the given UUID. See L</"
30608 "swapon-device> for other notes."
30613 #: ../fish/guestfish-actions.pod:4468
30619 #: ../fish/guestfish-actions.pod:4470
30628 #: ../fish/guestfish-actions.pod:4478
30634 #: ../fish/guestfish-actions.pod:4480
30643 #: ../fish/guestfish-actions.pod:4488
30649 #: ../fish/guestfish-actions.pod:4490
30652 " tail-n nrlines path\n"
30658 #: ../fish/guestfish-actions.pod:4503
30664 #: ../fish/guestfish-actions.pod:4505
30667 " tar-in (tarfile|-) directory\n"
30673 #: ../fish/guestfish-actions.pod:4510
30674 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
30679 #: ../fish/guestfish-actions.pod:4515
30685 #: ../fish/guestfish-actions.pod:4517
30688 " tar-out directory (tarfile|-)\n"
30694 #: ../fish/guestfish-actions.pod:4522
30695 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
30700 #: ../fish/guestfish-actions.pod:4527
30706 #: ../fish/guestfish-actions.pod:4529
30709 " tgz-in (tarball|-) directory\n"
30715 #: ../fish/guestfish-actions.pod:4534
30716 msgid "To upload an uncompressed tarball, use L</tar-in>."
30721 #: ../fish/guestfish-actions.pod:4538
30727 #: ../fish/guestfish-actions.pod:4540
30730 " tgz-out directory (tarball|-)\n"
30736 #: ../fish/guestfish-actions.pod:4545
30737 msgid "To download an uncompressed tarball, use L</tar-out>."
30742 #: ../fish/guestfish-actions.pod:4549
30748 #: ../fish/guestfish-actions.pod:4551
30757 #: ../fish/guestfish-actions.pod:4560
30763 #: ../fish/guestfish-actions.pod:4562
30772 #: ../fish/guestfish-actions.pod:4567
30773 msgid "truncate-size"
30778 #: ../fish/guestfish-actions.pod:4569
30781 " truncate-size path size\n"
30787 #: ../fish/guestfish-actions.pod:4574
30789 "If the current file size is less than C<size> then the file is extended to "
30790 "the required size with zero bytes. This creates a sparse file (ie. disk "
30791 "blocks are not allocated for the file until you write to it). To create a "
30792 "non-sparse file of zeroes, use L</fallocate64> instead."
30797 #: ../fish/guestfish-actions.pod:4580
30803 #: ../fish/guestfish-actions.pod:4582
30806 " tune2fs-l device\n"
30812 #: ../fish/guestfish-actions.pod:4592
30818 #: ../fish/guestfish-actions.pod:4594
30821 " txz-in (tarball|-) directory\n"
30827 #: ../fish/guestfish-actions.pod:4601
30833 #: ../fish/guestfish-actions.pod:4603
30836 " txz-out directory (tarball|-)\n"
30842 #: ../fish/guestfish-actions.pod:4610
30848 #: ../fish/guestfish-actions.pod:4612
30857 #: ../fish/guestfish-actions.pod:4626
30858 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
30863 #: ../fish/guestfish-actions.pod:4631
30869 #: ../fish/guestfish-actions.pod:4633
30875 #: ../fish/guestfish-actions.pod:4635
30878 " umount pathordevice\n"
30884 #: ../fish/guestfish-actions.pod:4641
30890 #: ../fish/guestfish-actions.pod:4643
30891 msgid "unmount-all"
30896 #: ../fish/guestfish-actions.pod:4645
30905 #: ../fish/guestfish-actions.pod:4651
30911 #: ../fish/guestfish-actions.pod:4653
30914 " upload (filename|-) remotefilename\n"
30920 #: ../fish/guestfish-actions.pod:4660
30921 msgid "See also L</download>."
30926 #: ../fish/guestfish-actions.pod:4664
30927 msgid "upload-offset"
30932 #: ../fish/guestfish-actions.pod:4666
30935 " upload-offset (filename|-) remotefilename offset\n"
30941 #: ../fish/guestfish-actions.pod:4678
30943 "Note that there is no limit on the amount of data that can be uploaded with "
30944 "this call, unlike with L</pwrite>, and this call always writes the full "
30945 "amount unless an error occurs."
30950 #: ../fish/guestfish-actions.pod:4683
30951 msgid "See also L</upload>, L</pwrite>."
30956 #: ../fish/guestfish-actions.pod:4687
30962 #: ../fish/guestfish-actions.pod:4689
30965 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
30971 #: ../fish/guestfish-actions.pod:4708
30977 #: ../fish/guestfish-actions.pod:4710
30986 #: ../fish/guestfish-actions.pod:4737
30988 "I<Note:> Don't use this call to test for availability of features. In "
30989 "enterprise distributions we backport features from later versions into "
30990 "earlier versions, making this an unreliable way to test for features. Use "
30991 "L</available> instead."
30996 #: ../fish/guestfish-actions.pod:4743
31002 #: ../fish/guestfish-actions.pod:4745
31005 " vfs-label device\n"
31011 #: ../fish/guestfish-actions.pod:4752
31012 msgid "To find a filesystem from the label, use L</findfs-label>."
31017 #: ../fish/guestfish-actions.pod:4754
31023 #: ../fish/guestfish-actions.pod:4756
31026 " vfs-type device\n"
31032 #: ../fish/guestfish-actions.pod:4766
31038 #: ../fish/guestfish-actions.pod:4768
31041 " vfs-uuid device\n"
31047 #: ../fish/guestfish-actions.pod:4775
31048 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
31053 #: ../fish/guestfish-actions.pod:4777
31054 msgid "vg-activate"
31059 #: ../fish/guestfish-actions.pod:4779
31062 " vg-activate true|false 'volgroups ...'\n"
31068 #: ../fish/guestfish-actions.pod:4792
31069 msgid "vg-activate-all"
31074 #: ../fish/guestfish-actions.pod:4794
31077 " vg-activate-all true|false\n"
31083 #: ../fish/guestfish-actions.pod:4804
31089 #: ../fish/guestfish-actions.pod:4806
31092 " vgcreate volgroup 'physvols ...'\n"
31098 #: ../fish/guestfish-actions.pod:4811
31104 #: ../fish/guestfish-actions.pod:4813
31107 " vglvuuids vgname\n"
31113 #: ../fish/guestfish-actions.pod:4818
31115 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
31116 "logical volumes and volume groups."
31121 #: ../fish/guestfish-actions.pod:4821
31122 msgid "See also L</vgpvuuids>."
31127 #: ../fish/guestfish-actions.pod:4823
31133 #: ../fish/guestfish-actions.pod:4825
31136 " vgpvuuids vgname\n"
31142 #: ../fish/guestfish-actions.pod:4830
31144 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
31145 "physical volumes and volume groups."
31150 #: ../fish/guestfish-actions.pod:4833
31151 msgid "See also L</vglvuuids>."
31156 #: ../fish/guestfish-actions.pod:4835
31162 #: ../fish/guestfish-actions.pod:4837
31165 " vgremove vgname\n"
31171 #: ../fish/guestfish-actions.pod:4844
31177 #: ../fish/guestfish-actions.pod:4846
31180 " vgrename volgroup newvolgroup\n"
31186 #: ../fish/guestfish-actions.pod:4850
31192 #: ../fish/guestfish-actions.pod:4852
31201 #: ../fish/guestfish-actions.pod:4860
31202 msgid "See also L</vgs-full>."
31207 #: ../fish/guestfish-actions.pod:4862
31213 #: ../fish/guestfish-actions.pod:4864
31222 #: ../fish/guestfish-actions.pod:4869
31228 #: ../fish/guestfish-actions.pod:4871
31237 #: ../fish/guestfish-actions.pod:4876
31243 #: ../fish/guestfish-actions.pod:4878
31252 #: ../fish/guestfish-actions.pod:4882
31258 #: ../fish/guestfish-actions.pod:4884
31267 #: ../fish/guestfish-actions.pod:4889
31273 #: ../fish/guestfish-actions.pod:4891
31282 #: ../fish/guestfish-actions.pod:4896
31288 #: ../fish/guestfish-actions.pod:4898
31297 #: ../fish/guestfish-actions.pod:4903
31303 #: ../fish/guestfish-actions.pod:4905
31306 " write path content\n"
31312 #: ../fish/guestfish-actions.pod:4913
31318 #: ../fish/guestfish-actions.pod:4915
31321 " write-file path content size\n"
31326 #: ../fish/guestfish-actions.pod:4931
31328 "This function is deprecated. In new code, use the L</write> call instead."
31333 #: ../fish/guestfish-actions.pod:4938
31339 #: ../fish/guestfish-actions.pod:4940
31342 " zegrep regex path\n"
31348 #: ../fish/guestfish-actions.pod:4948
31354 #: ../fish/guestfish-actions.pod:4950
31357 " zegrepi regex path\n"
31363 #: ../fish/guestfish-actions.pod:4958
31369 #: ../fish/guestfish-actions.pod:4960
31378 #: ../fish/guestfish-actions.pod:4968
31379 msgid "See also: L</zero-device>, L</scrub-device>."
31384 #: ../fish/guestfish-actions.pod:4970
31385 msgid "zero-device"
31390 #: ../fish/guestfish-actions.pod:4972
31393 " zero-device device\n"
31399 #: ../fish/guestfish-actions.pod:4974
31401 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
31402 "which just zeroes the first few blocks of a device."
31407 #: ../fish/guestfish-actions.pod:4981
31413 #: ../fish/guestfish-actions.pod:4983
31416 " zerofree device\n"
31422 #: ../fish/guestfish-actions.pod:4996
31428 #: ../fish/guestfish-actions.pod:4998
31431 " zfgrep pattern path\n"
31437 #: ../fish/guestfish-actions.pod:5006
31443 #: ../fish/guestfish-actions.pod:5008
31446 " zfgrepi pattern path\n"
31452 #: ../fish/guestfish-actions.pod:5016
31458 #: ../fish/guestfish-actions.pod:5018
31461 " zfile meth path\n"
31467 #: ../fish/guestfish-actions.pod:5025
31469 "Since 1.0.63, use L</file> instead which can now process compressed files."
31473 #: ../fish/guestfish-actions.pod:5028
31475 "This function is deprecated. In new code, use the L</file> call instead."
31480 #: ../fish/guestfish-actions.pod:5035
31486 #: ../fish/guestfish-actions.pod:5037
31489 " zgrep regex path\n"
31495 #: ../fish/guestfish-actions.pod:5045
31501 #: ../fish/guestfish-actions.pod:5047
31504 " zgrepi regex path\n"
31510 #: ../fish/guestfish-commands.pod:1
31516 #: ../fish/guestfish-commands.pod:3
31522 #: ../fish/guestfish-commands.pod:5
31525 " alloc filename size\n"
31531 #: ../fish/guestfish-commands.pod:7
31533 "This creates an empty (zeroed) file of the given size, and then adds so it "
31534 "can be further examined."
31539 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
31540 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
31545 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
31546 msgid "Size can be specified using standard suffixes, eg. C<1M>."
31551 #: ../fish/guestfish-commands.pod:14
31553 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
31554 "image, see L</PREPARED DISK IMAGES>."
31559 #: ../fish/guestfish-commands.pod:17
31565 #: ../fish/guestfish-commands.pod:19
31568 " copy-in local [local ...] /remotedir\n"
31574 #: ../fish/guestfish-commands.pod:21
31576 "C<copy-in> copies local files or directories recursively into the disk "
31577 "image, placing them in the directory called C</remotedir> (which must "
31578 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
31579 "other commands as necessary."
31584 #: ../fish/guestfish-commands.pod:26
31586 "Multiple local files and directories can be specified, but the last "
31587 "parameter must always be a remote directory. Wildcards cannot be used."
31592 #: ../fish/guestfish-commands.pod:30
31598 #: ../fish/guestfish-commands.pod:32
31601 " copy-out remote [remote ...] localdir\n"
31607 #: ../fish/guestfish-commands.pod:34
31609 "C<copy-out> copies remote files or directories recursively out of the disk "
31610 "image, placing them on the host disk in a local directory called C<localdir> "
31611 "(which must exist). This guestfish meta-command turns into a sequence of L</"
31612 "download>, L</tar-out> and other commands as necessary."
31617 #: ../fish/guestfish-commands.pod:40
31619 "Multiple remote files and directories can be specified, but the last "
31620 "parameter must always be a local directory. To download to the current "
31621 "directory, use C<.> as in:"
31626 #: ../fish/guestfish-commands.pod:44
31629 " copy-out /home .\n"
31635 #: ../fish/guestfish-commands.pod:46
31637 "Wildcards cannot be used in the ordinary command, but you can use them with "
31638 "the help of L</glob> like this:"
31643 #: ../fish/guestfish-commands.pod:49
31646 " glob copy-out /home/* .\n"
31652 #: ../fish/guestfish-commands.pod:51
31658 #: ../fish/guestfish-commands.pod:53
31661 " echo [params ...]\n"
31667 #: ../fish/guestfish-commands.pod:55
31668 msgid "This echos the parameters to the terminal."
31673 #: ../fish/guestfish-commands.pod:57
31679 #: ../fish/guestfish-commands.pod:59
31685 #: ../fish/guestfish-commands.pod:61
31691 #: ../fish/guestfish-commands.pod:63
31700 #: ../fish/guestfish-commands.pod:65
31702 "This is used to edit a file. It downloads the file, edits it locally using "
31703 "your editor, then uploads the result."
31708 #: ../fish/guestfish-commands.pod:68
31710 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
31711 "or C<emacs> you will get those corresponding editors."
31716 #: ../fish/guestfish-commands.pod:72
31722 #: ../fish/guestfish-commands.pod:74
31725 " glob command args...\n"
31731 #: ../fish/guestfish-commands.pod:76
31733 "Expand wildcards in any paths in the args list, and run C<command> "
31734 "repeatedly on each matching path."
31739 #: ../fish/guestfish-commands.pod:79
31740 msgid "See L</WILDCARDS AND GLOBBING>."
31745 #: ../fish/guestfish-commands.pod:81
31751 #: ../fish/guestfish-commands.pod:83
31754 " hexedit <filename|device>\n"
31755 " hexedit <filename|device> <max>\n"
31756 " hexedit <filename|device> <start> <max>\n"
31762 #: ../fish/guestfish-commands.pod:87
31764 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
31770 #: ../fish/guestfish-commands.pod:90
31772 "This command works by downloading potentially the whole file or device, "
31773 "editing it locally, then uploading it. If the file or device is large, you "
31774 "have to specify which part you wish to edit by using C<max> and/or C<start> "
31775 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
31776 "usual modifiers allowed such as C<1M> (1 megabyte)."
31781 #: ../fish/guestfish-commands.pod:97
31782 msgid "For example to edit the first few sectors of a disk you might do:"
31787 #: ../fish/guestfish-commands.pod:100
31790 " hexedit /dev/sda 1M\n"
31796 #: ../fish/guestfish-commands.pod:102
31798 "which would allow you to edit anywhere within the first megabyte of the disk."
31803 #: ../fish/guestfish-commands.pod:105
31804 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
31809 #: ../fish/guestfish-commands.pod:107
31812 " hexedit /dev/sda1 0x400 0x400\n"
31818 #: ../fish/guestfish-commands.pod:109
31819 msgid "(assuming the superblock is in the standard location)."
31824 #: ../fish/guestfish-commands.pod:111
31826 "This command requires the external L<hexedit(1)> program. You can specify "
31827 "another program to use by setting the C<HEXEDITOR> environment variable."
31832 #: ../fish/guestfish-commands.pod:115
31833 msgid "See also L</hexdump>."
31838 #: ../fish/guestfish-commands.pod:117
31844 #: ../fish/guestfish-commands.pod:119
31853 #: ../fish/guestfish-commands.pod:121
31855 "Change the local directory, ie. the current directory of guestfish itself."
31860 #: ../fish/guestfish-commands.pod:124
31861 msgid "Note that C<!cd> won't do what you might expect."
31866 #: ../fish/guestfish-commands.pod:126
31872 #: ../fish/guestfish-commands.pod:128
31878 #: ../fish/guestfish-commands.pod:130
31887 #: ../fish/guestfish-commands.pod:132
31888 msgid "Opens the manual page for guestfish."
31893 #: ../fish/guestfish-commands.pod:134
31899 #: ../fish/guestfish-commands.pod:136
31905 #: ../fish/guestfish-commands.pod:138
31914 #: ../fish/guestfish-commands.pod:140
31923 #: ../fish/guestfish-commands.pod:142
31924 msgid "This is used to view a file."
31929 #: ../fish/guestfish-commands.pod:144
31931 "The default viewer is C<$PAGER>. However if you use the alternate command "
31932 "C<less> you will get the C<less> command specifically."
31937 #: ../fish/guestfish-commands.pod:147
31943 #: ../fish/guestfish-commands.pod:149
31952 #: ../fish/guestfish-commands.pod:151
31954 "Close and reopen the libguestfs handle. It is not necessary to use this "
31955 "normally, because the handle is closed properly when guestfish exits. "
31956 "However this is occasionally useful for testing."
31961 #: ../fish/guestfish-commands.pod:155
31967 #: ../fish/guestfish-commands.pod:157
31970 " sparse filename size\n"
31976 #: ../fish/guestfish-commands.pod:159
31978 "This creates an empty sparse file of the given size, and then adds so it can "
31979 "be further examined."
31984 #: ../fish/guestfish-commands.pod:162
31986 "In all respects it works the same as the L</alloc> command, except that the "
31987 "image file is allocated sparsely, which means that disk blocks are not "
31988 "assigned to the file until they are needed. Sparse disk files only use "
31989 "space when written to, but they are slower and there is a danger you could "
31990 "run out of real disk space during a write operation."
31995 #: ../fish/guestfish-commands.pod:172
32001 #: ../fish/guestfish-commands.pod:174
32010 #: ../fish/guestfish-commands.pod:176
32012 "This command returns a list of the optional groups known to the daemon, and "
32013 "indicates which ones are supported by this build of the libguestfs appliance."
32018 #: ../fish/guestfish-commands.pod:180
32019 msgid "See also L<guestfs(3)/AVAILABILITY>."
32024 #: ../fish/guestfish-commands.pod:182
32030 #: ../fish/guestfish-commands.pod:184
32033 " time command args...\n"
32039 #: ../fish/guestfish-commands.pod:186
32041 "Run the command as usual, but print the elapsed time afterwards. This can "
32042 "be useful for benchmarking operations."
32047 #: ../test-tool/libguestfs-test-tool.pod:5
32048 msgid "libguestfs-test-tool - End user tests for libguestfs"
32053 #: ../test-tool/libguestfs-test-tool.pod:9
32056 " libguestfs-test-tool [--options]\n"
32062 #: ../test-tool/libguestfs-test-tool.pod:13
32064 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
32065 "and developers, to allow them to check basic libguestfs functionality is "
32066 "working. This is needed because libguestfs occasionally breaks for reasons "
32067 "beyond our control: usually because of changes in the underlying qemu or "
32068 "kernel packages, or the host environment."
32073 #: ../test-tool/libguestfs-test-tool.pod:20
32074 msgid "If you suspect a problem in libguestfs, then just run:"
32079 #: ../test-tool/libguestfs-test-tool.pod:22
32082 " libguestfs-test-tool\n"
32088 #: ../test-tool/libguestfs-test-tool.pod:24
32089 msgid "It will print lots of diagnostic messages."
32094 #: ../test-tool/libguestfs-test-tool.pod:26
32095 msgid "If it runs to completion successfully, you will see this near the end:"
32100 #: ../test-tool/libguestfs-test-tool.pod:28
32103 " ===== TEST FINISHED OK =====\n"
32109 #: ../test-tool/libguestfs-test-tool.pod:30
32110 msgid "and the test tool will exit with code 0."
32115 #: ../test-tool/libguestfs-test-tool.pod:32
32117 "If it fails (and/or exits with non-zero error code), please paste the "
32118 "B<complete, unedited> output of the test tool into a bug report. More "
32119 "information about reporting bugs can be found on the L<http://libguestfs.org/"
32125 #: ../test-tool/libguestfs-test-tool.pod:41
32131 #: ../test-tool/libguestfs-test-tool.pod:43
32132 msgid "Display short usage information and exit."
32137 #: ../test-tool/libguestfs-test-tool.pod:45
32138 msgid "I<--qemu qemu_binary>"
32143 #: ../test-tool/libguestfs-test-tool.pod:47
32145 "If you have downloaded another qemu binary, point this option at the full "
32146 "path of the binary to try it."
32151 #: ../test-tool/libguestfs-test-tool.pod:50
32152 msgid "I<--qemudir qemu_source_dir>"
32157 #: ../test-tool/libguestfs-test-tool.pod:52
32159 "If you have compiled qemu from source, point this option at the source "
32160 "directory to try it."
32165 #: ../test-tool/libguestfs-test-tool.pod:55
32166 msgid "I<--timeout N>"
32171 #: ../test-tool/libguestfs-test-tool.pod:57
32173 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
32174 "does not usually need to be adjusted unless your machine is very slow."
32179 #: ../test-tool/libguestfs-test-tool.pod:63
32180 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
32185 #: ../test-tool/libguestfs-test-tool.pod:65
32187 "If you have compiled another version of qemu from source and would like to "
32188 "try that, then you can use the I<--qemudir> option to point to the qemu "
32189 "source directory."
32194 #: ../test-tool/libguestfs-test-tool.pod:69
32196 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
32197 "option to point to the binary."
32202 #: ../test-tool/libguestfs-test-tool.pod:72
32204 "When using an alternate qemu with libguestfs, usually you would need to "
32205 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
32206 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
32207 "use either of the I<--qemudir> or I<--qemu> options."
32212 #: ../test-tool/libguestfs-test-tool.pod:79
32214 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
32215 "I<1> if there was an error."
32220 #: ../test-tool/libguestfs-test-tool.pod:84
32222 "For the full list of environment variables which may affect libguestfs, "
32223 "please see the L<guestfs(3)> manual page."
32228 #: ../test-tool/libguestfs-test-tool.pod:89
32229 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
32234 #: ../fuse/guestmount.pod:5
32236 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
32241 #: ../fuse/guestmount.pod:9
32244 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
32250 #: ../fuse/guestmount.pod:11
32253 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
32259 #: ../fuse/guestmount.pod:13
32262 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
32268 #: ../fuse/guestmount.pod:17
32270 "You must I<not> use C<guestmount> in read-write mode on live virtual "
32271 "machines. If you do this, you risk disk corruption in the VM."
32276 #: ../fuse/guestmount.pod:22
32278 "The guestmount program can be used to mount virtual machine filesystems and "
32279 "other disk images on the host. It uses libguestfs for access to the guest "
32280 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
32281 "a mountable device."
32286 #: ../fuse/guestmount.pod:27
32288 "Along with other options, you have to give at least one device (I<-a> "
32289 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
32290 "option) or use the I<-i> inspection option. How this works is better "
32291 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
32297 #: ../fuse/guestmount.pod:33
32299 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
32300 "by you, and the filesystem will not be visible to any other users unless you "
32301 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
32302 "the filesystem, use the C<fusermount -u> command."
32307 #: ../fuse/guestmount.pod:41
32309 "For a typical Windows guest which has its main filesystem on the first "
32315 #: ../fuse/guestmount.pod:44
32318 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
32324 #: ../fuse/guestmount.pod:46
32326 "For a typical Linux guest which has a /boot filesystem on the first "
32327 "partition, and the root filesystem on a logical volume:"
32332 #: ../fuse/guestmount.pod:49
32335 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
32341 #: ../fuse/guestmount.pod:51
32342 msgid "To get libguestfs to detect guest mountpoints for you:"
32347 #: ../fuse/guestmount.pod:53
32350 " guestmount -a guest.img -i --ro /mnt\n"
32356 #: ../fuse/guestmount.pod:55
32357 msgid "For a libvirt guest called \"Guest\" you could do:"
32362 #: ../fuse/guestmount.pod:57
32365 " guestmount -d Guest -i --ro /mnt\n"
32371 #: ../fuse/guestmount.pod:59
32373 "If you don't know what filesystems are contained in a guest or disk image, "
32374 "use L<virt-filesystems(1)> first:"
32379 #: ../fuse/guestmount.pod:62
32382 " virt-filesystems MyGuest\n"
32388 #: ../fuse/guestmount.pod:64
32390 "If you want to trace the libguestfs calls but without excessive debugging "
32391 "information, we recommend:"
32396 #: ../fuse/guestmount.pod:67
32399 " guestmount [...] --trace /mnt\n"
32405 #: ../fuse/guestmount.pod:69
32406 msgid "If you want to debug the program, we recommend:"
32411 #: ../fuse/guestmount.pod:71
32414 " guestmount [...] --trace --verbose /mnt\n"
32419 #: ../fuse/guestmount.pod:73
32424 #: ../fuse/guestmount.pod:75
32425 msgid "Other users cannot see the filesystem by default"
32429 #: ../fuse/guestmount.pod:77
32431 "If you mount a filesystem as one user (eg. root), then other users will not "
32432 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
32433 "option when mounting:"
32437 #: ../fuse/guestmount.pod:81
32440 " sudo guestmount [...] -o allow_other /mnt\n"
32446 #: ../fuse/guestmount.pod:87
32447 msgid "B<-a image> | B<--add image>"
32452 #: ../fuse/guestmount.pod:89
32453 msgid "Add a block device or virtual machine image."
32458 #: ../fuse/guestmount.pod:94
32459 msgid "B<-c URI> | B<--connect URI>"
32464 #: ../fuse/guestmount.pod:100
32465 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
32470 #: ../fuse/guestmount.pod:106
32471 msgid "B<--dir-cache-timeout N>"
32476 #: ../fuse/guestmount.pod:108
32478 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
32479 "seconds. The readdir cache [actually, there are several semi-independent "
32480 "caches] is populated after a readdir(2) call with the stat and extended "
32481 "attributes of the files in the directory, in anticipation that they will be "
32482 "requested soon after."
32487 #: ../fuse/guestmount.pod:114
32489 "There is also a different attribute cache implemented by FUSE (see the FUSE "
32490 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
32491 "requests, only cache existing ones."
32496 #: ../fuse/guestmount.pod:125
32497 msgid "B<--format=raw|qcow2|..> | B<--format>"
32502 #: ../fuse/guestmount.pod:132
32504 "If you have untrusted raw-format guest disk images, you should use this "
32505 "option to specify the disk format. This avoids a possible security problem "
32506 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
32507 "guestfs_add_drive_opts>."
32512 #: ../fuse/guestmount.pod:137
32513 msgid "B<--fuse-help>"
32518 #: ../fuse/guestmount.pod:139
32519 msgid "Display help on special FUSE options (see I<-o> below)."
32524 #: ../fuse/guestmount.pod:143
32525 msgid "Display brief help and exit."
32530 #: ../fuse/guestmount.pod:145
32531 msgid "B<-i> | B<--inspector>"
32536 #: ../fuse/guestmount.pod:165
32538 "Mount the named partition or logical volume on the given mountpoint B<in the "
32539 "guest> (this has nothing to do with mountpoints in the host)."
32544 #: ../fuse/guestmount.pod:168
32546 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
32547 "something on C</>."
32552 #: ../fuse/guestmount.pod:181
32553 msgid "B<-n> | B<--no-sync>"
32558 #: ../fuse/guestmount.pod:183
32560 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
32561 "unmounted. If you specify this option, then we don't attempt to sync the "
32562 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
32567 #: ../fuse/guestmount.pod:188
32568 msgid "B<-o option> | B<--option option>"
32573 #: ../fuse/guestmount.pod:190
32574 msgid "Pass extra options to FUSE."
32579 #: ../fuse/guestmount.pod:192
32581 "To get a list of all the extra options supported by FUSE, use the command "
32582 "below. Note that only the FUSE I<-o> options can be passed, and only some "
32583 "of them are a good idea."
32588 #: ../fuse/guestmount.pod:196
32591 " guestmount --fuse-help\n"
32597 #: ../fuse/guestmount.pod:198
32598 msgid "Some potentially useful FUSE options:"
32603 #: ../fuse/guestmount.pod:202
32604 msgid "B<-o allow_other>"
32609 #: ../fuse/guestmount.pod:204
32610 msgid "Allow other users to see the filesystem."
32615 #: ../fuse/guestmount.pod:206
32616 msgid "B<-o attr_timeout=N>"
32621 #: ../fuse/guestmount.pod:208
32622 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
32627 #: ../fuse/guestmount.pod:210
32628 msgid "B<-o kernel_cache>"
32633 #: ../fuse/guestmount.pod:212
32635 "Allow the kernel to cache files (reduces the number of reads that have to go "
32636 "through the L<guestfs(3)> API). This is generally a good idea if you can "
32637 "afford the extra memory usage."
32642 #: ../fuse/guestmount.pod:216
32643 msgid "B<-o uid=N> B<-o gid=N>"
32648 #: ../fuse/guestmount.pod:218
32650 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
32651 "the chosen values."
32656 #: ../fuse/guestmount.pod:223
32657 msgid "B<-r> | B<--ro>"
32662 #: ../fuse/guestmount.pod:225
32664 "Add devices and mount everything read-only. Also disallow writes and make "
32665 "the disk appear read-only to FUSE."
32670 #: ../fuse/guestmount.pod:228
32672 "This is highly recommended if you are not going to edit the guest disk. If "
32673 "the guest is running and this option is I<not> supplied, then there is a "
32674 "strong risk of disk corruption in the guest. We try to prevent this from "
32675 "happening, but it is not always possible."
32680 #: ../fuse/guestmount.pod:233
32681 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
32686 #: ../fuse/guestmount.pod:237
32687 msgid "Enable SELinux support for the guest."
32692 #: ../fuse/guestmount.pod:239
32693 msgid "B<-v> | B<--verbose>"
32698 #: ../fuse/guestmount.pod:241
32699 msgid "Enable verbose messages from underlying libguestfs."
32704 #: ../fuse/guestmount.pod:243
32705 msgid "B<-V> | B<--version>"
32710 #: ../fuse/guestmount.pod:245
32711 msgid "Display the program version and exit."
32716 #: ../fuse/guestmount.pod:247
32717 msgid "B<-w> | B<--rw>"
32721 #: ../fuse/guestmount.pod:252 ../fuse/guestmount.pod:273
32722 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
32727 #: ../fuse/guestmount.pod:254
32728 msgid "B<-x> | B<--trace>"
32733 #: ../fuse/guestmount.pod:256
32734 msgid "Trace libguestfs calls and entry into each FUSE function."
32739 #: ../fuse/guestmount.pod:258
32740 msgid "This also stops the daemon from forking into the background."
32745 #: ../fuse/guestmount.pod:279
32747 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
32748 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
32754 #: ../fuse/guestmount.pod:294
32755 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
32760 #: ../tools/virt-edit.pl:34
32761 msgid "virt-edit - Edit a file in a virtual machine"
32766 #: ../tools/virt-edit.pl:38
32769 " virt-edit [--options] domname file\n"
32775 #: ../tools/virt-edit.pl:40
32778 " virt-edit [--options] disk.img [disk.img ...] file\n"
32784 #: ../tools/virt-edit.pl:42
32787 " virt-edit [domname|disk.img] file -e 'expr'\n"
32793 #: ../tools/virt-edit.pl:46
32795 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
32796 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
32797 "doing this, but doesn't catch all cases."
32802 #: ../tools/virt-edit.pl:52
32804 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
32805 "the named virtual machine (or disk image)."
32809 #: ../tools/virt-edit.pl:55
32810 msgid "If you want to just view a file, use L<virt-cat(1)>."
32814 #: ../tools/virt-edit.pl:57
32816 "For more complex cases you should look at the L<guestfish(1)> tool (see L</"
32817 "USING GUESTFISH> below)."
32821 #: ../tools/virt-edit.pl:60
32823 "C<virt-edit> cannot be used to create a new file, nor to edit multiple "
32824 "files. L<guestfish(1)> can do that and much more."
32829 #: ../tools/virt-edit.pl:65
32830 msgid "Edit the named files interactively:"
32835 #: ../tools/virt-edit.pl:67
32838 " virt-edit mydomain /boot/grub/grub.conf\n"
32844 #: ../tools/virt-edit.pl:69
32847 " virt-edit mydomain /etc/passwd\n"
32852 #: ../tools/virt-edit.pl:71
32853 msgid "For Windows guests, some Windows paths are understood:"
32857 #: ../tools/virt-edit.pl:73
32860 " virt-edit mywindomain 'c:\\autoexec.bat'\n"
32866 #: ../tools/virt-edit.pl:75
32868 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
32869 "below). To change the init default level to 5:"
32874 #: ../tools/virt-edit.pl:79
32877 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
32883 #: ../tools/virt-edit.pl:91 ../tools/virt-win-reg.pl:106
32884 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113
32885 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
32886 msgid "Display brief help."
32891 #: ../tools/virt-edit.pl:99 ../tools/virt-win-reg.pl:114
32892 #: ../tools/virt-list-filesystems.pl:71 ../tools/virt-tar.pl:121
32893 #: ../tools/virt-make-fs.pl:171 ../tools/virt-list-partitions.pl:72
32894 msgid "Display version number and exit."
32899 #: ../tools/virt-edit.pl:105
32900 msgid "B<--backup extension> | B<-b extension>"
32905 #: ../tools/virt-edit.pl:107
32907 "Create a backup of the original file I<in the guest disk image>. The backup "
32908 "has the original filename with C<extension> added."
32913 #: ../tools/virt-edit.pl:110
32915 "Usually the first character of C<extension> would be a dot C<.> so you would "
32921 #: ../tools/virt-edit.pl:113
32924 " virt-edit -b .orig [etc]\n"
32930 #: ../tools/virt-edit.pl:115
32931 msgid "By default, no backup file is made."
32936 #: ../tools/virt-edit.pl:121 ../tools/virt-win-reg.pl:128
32937 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127
32938 #: ../tools/virt-list-partitions.pl:78
32939 msgid "B<--connect URI> | B<-c URI>"
32944 #: ../tools/virt-edit.pl:123 ../tools/virt-win-reg.pl:130
32945 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129
32946 #: ../tools/virt-list-partitions.pl:80
32948 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
32949 "to the default libvirt hypervisor."
32954 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:133
32955 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132
32956 #: ../tools/virt-list-partitions.pl:83
32958 "If you specify guest block devices directly, then libvirt is not used at all."
32963 #: ../tools/virt-edit.pl:133 ../tools/virt-win-reg.pl:140
32964 #: ../tools/virt-list-filesystems.pl:89 ../tools/virt-tar.pl:139
32965 #: ../tools/virt-list-partitions.pl:90
32966 msgid "B<--format> raw"
32971 #: ../tools/virt-edit.pl:135 ../tools/virt-win-reg.pl:142
32972 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141
32973 #: ../tools/virt-list-partitions.pl:92
32975 "Specify the format of disk images given on the command line. If this is "
32976 "omitted then the format is autodetected from the content of the disk image."
32981 #: ../tools/virt-edit.pl:139 ../tools/virt-win-reg.pl:146
32982 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145
32983 #: ../tools/virt-list-partitions.pl:96
32985 "If disk images are requested from libvirt, then this program asks libvirt "
32986 "for this information. In this case, the value of the format parameter is "
32992 #: ../tools/virt-edit.pl:143 ../tools/virt-win-reg.pl:150
32993 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149
32994 #: ../tools/virt-list-partitions.pl:100
32996 "If working with untrusted raw-format guest disk images, you should ensure "
32997 "the format is always specified."
33002 #: ../tools/virt-edit.pl:150
33003 msgid "B<--expr EXPR> | B<-e EXPR>"
33008 #: ../tools/virt-edit.pl:152
33010 "Instead of launching the external editor, non-interactively apply the Perl "
33011 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
33017 #: ../tools/virt-edit.pl:156
33019 "Be careful to properly quote the expression to prevent it from being altered "
33025 #: ../tools/virt-edit.pl:280
33026 msgid "NON-INTERACTIVE EDITING"
33031 #: ../tools/virt-edit.pl:282
33033 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
33034 "administrator can interactively edit the file."
33039 #: ../tools/virt-edit.pl:285
33041 "There are two ways also to use C<virt-edit> from scripts in order to make "
33042 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
33043 "like this, it's less error-prone to write scripts directly using the "
33044 "libguestfs API and Augeas for configuration file editing.)"
33049 #: ../tools/virt-edit.pl:291
33051 "The first method is to temporarily set C<$EDITOR> to any script or program "
33052 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
33053 "update C<tmpfile> in place however it likes."
33057 #: ../tools/virt-edit.pl:295
33059 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
33060 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
33061 "instances of C<foo> with C<bar> in a file:"
33066 #: ../tools/virt-edit.pl:299
33069 " virt-edit domname filename -e 's/foo/bar/'\n"
33075 #: ../tools/virt-edit.pl:301
33077 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
33078 "For example to delete root's password you could do:"
33083 #: ../tools/virt-edit.pl:304
33086 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
33092 #: ../tools/virt-edit.pl:306
33094 "What really happens is that the snippet is evaluated as a Perl expression "
33095 "for each line of the file. The line, including the final C<\\n>, is passed "
33096 "in C<$_> and the expression should update C<$_> or leave it unchanged."
33101 #: ../tools/virt-edit.pl:311
33103 "To delete a line, set C<$_> to the empty string. For example, to delete the "
33104 "C<apache> user account from the password file you can do:"
33109 #: ../tools/virt-edit.pl:314
33112 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
33118 #: ../tools/virt-edit.pl:316
33120 "To insert a line, prepend or append it to C<$_>. However appending lines to "
33121 "the end of the file is rather difficult this way since there is no concept "
33122 "of \"last line of the file\" - your expression just doesn't get called "
33123 "again. You might want to use the first method (setting C<$EDITOR>) if you "
33129 #: ../tools/virt-edit.pl:322
33131 "The variable C<$lineno> contains the current line number. As is "
33132 "traditional, the first line in the file is number C<1>."
33137 #: ../tools/virt-edit.pl:325
33139 "The return value from the expression is ignored, but the expression may call "
33140 "C<die> in order to abort the whole program, leaving the original file "
33146 #: ../tools/virt-edit.pl:329
33148 "Remember when matching the end of a line that C<$_> may contain the final C<"
33149 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
33150 "newline then neither of these. Thus to match or substitute some text at the "
33151 "end of a line, use this regular expression:"
33156 #: ../tools/virt-edit.pl:334
33159 " /some text(\\r?\\n)?$/\n"
33165 #: ../tools/virt-edit.pl:336
33167 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
33168 "$_> itself (since that would remove all newlines from the file):"
33173 #: ../tools/virt-edit.pl:340
33176 " my $m = $_; chomp $m; $m =~ /some text$/\n"
33181 #: ../tools/virt-edit.pl:344
33183 "C<virt-edit> has a limited ability to understand Windows drive letters and "
33184 "paths (eg. C<E:\\foo\\bar.txt>)."
33188 #: ../tools/virt-edit.pl:347
33189 msgid "If and only if the guest is running Windows then:"
33193 #: ../tools/virt-edit.pl:353
33195 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
33196 "to the correct filesystem."
33200 #: ../tools/virt-edit.pl:358
33202 "Any backslash (C<\\>) characters in the path are replaced with forward "
33203 "slashes so that libguestfs can process it."
33207 #: ../tools/virt-edit.pl:363
33209 "The path is resolved case insensitively to locate the file that should be "
33214 #: ../tools/virt-edit.pl:368
33215 msgid "There are some known shortcomings:"
33219 #: ../tools/virt-edit.pl:374
33220 msgid "Some NTFS symbolic links may not be followed correctly."
33224 #: ../tools/virt-edit.pl:378
33225 msgid "NTFS junction points that cross filesystems are not followed."
33229 #: ../tools/virt-edit.pl:435
33230 msgid "USING GUESTFISH"
33234 #: ../tools/virt-edit.pl:437
33236 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
33237 "C<virt-edit> doesn't work."
33241 #: ../tools/virt-edit.pl:440
33242 msgid "Using C<virt-edit> is approximately equivalent to doing:"
33246 #: ../tools/virt-edit.pl:442
33249 " guestfish --rw -i -d domname edit /file\n"
33254 #: ../tools/virt-edit.pl:444
33256 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
33257 "path to the file."
33261 #: ../tools/virt-edit.pl:447
33263 "The command above uses libguestfs's guest inspection feature and so does not "
33264 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
33265 "disk images that don't contain guests. To edit a file on a disk image "
33270 #: ../tools/virt-edit.pl:452
33273 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
33278 #: ../tools/virt-edit.pl:454
33280 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
33281 "the disk image to edit, and C</file> is the full path to the file."
33285 #: ../tools/virt-edit.pl:458
33287 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
33288 "C<write> or C<upload> instead:"
33292 #: ../tools/virt-edit.pl:461
33295 " guestfish --rw -i -d domname touch /newfile\n"
33300 #: ../tools/virt-edit.pl:463
33303 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
33308 #: ../tools/virt-edit.pl:465
33311 " guestfish --rw -i -d domname upload localfile /newfile\n"
33316 #: ../tools/virt-edit.pl:467
33318 "C<virt-edit> cannot edit multiple files, but guestfish can do it like this:"
33322 #: ../tools/virt-edit.pl:470
33325 " guestfish --rw -i -d domname edit /file1 : edit /file2\n"
33331 #: ../tools/virt-edit.pl:480
33337 #: ../tools/virt-edit.pl:482
33339 "If set, this string is used as the editor. It may contain arguments, eg. C<"
33345 #: ../tools/virt-edit.pl:485
33346 msgid "If not set, C<vi> is used."
33351 #: ../tools/virt-edit.pl:489 ../tools/virt-win-reg.pl:559
33352 #: ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:279
33353 #: ../tools/virt-make-fs.pl:532 ../tools/virt-list-partitions.pl:250
33354 msgid "SHELL QUOTING"
33359 #: ../tools/virt-edit.pl:491 ../tools/virt-win-reg.pl:567
33360 #: ../tools/virt-list-filesystems.pl:184 ../tools/virt-tar.pl:281
33361 #: ../tools/virt-make-fs.pl:534 ../tools/virt-list-partitions.pl:252
33363 "Libvirt guest names can contain arbitrary characters, some of which have "
33364 "meaning to the shell such as C<#> and space. You may need to quote or "
33365 "escape these characters on the command line. See the shell manual page L<sh"
33366 "(1)> for details."
33370 #: ../tools/virt-edit.pl:498
33372 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
33373 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
33374 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
33379 #: ../tools/virt-edit.pl:510 ../tools/virt-win-reg.pl:598
33380 #: ../tools/virt-list-filesystems.pl:202 ../tools/virt-tar.pl:301
33381 #: ../tools/virt-make-fs.pl:564 ../tools/virt-list-partitions.pl:269
33387 #: ../tools/virt-edit.pl:512 ../tools/virt-win-reg.pl:600
33388 #: ../tools/virt-list-filesystems.pl:204 ../tools/virt-tar.pl:303
33389 #: ../tools/virt-make-fs.pl:566 ../tools/virt-list-partitions.pl:271
33390 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
33394 #: ../tools/virt-edit.pl:516
33395 msgid "Copyright (C) 2009-2011 Red Hat Inc."
33400 #: ../tools/virt-win-reg.pl:37
33402 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
33407 #: ../tools/virt-win-reg.pl:41
33410 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
33416 #: ../tools/virt-win-reg.pl:43
33419 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
33425 #: ../tools/virt-win-reg.pl:45
33428 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
33434 #: ../tools/virt-win-reg.pl:47
33437 " virt-win-reg --merge domname [input.reg ...]\n"
33443 #: ../tools/virt-win-reg.pl:49
33446 " virt-win-reg [--options] disk.img ... # instead of domname\n"
33451 #: ../tools/virt-win-reg.pl:53
33453 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
33454 "virtual machines. If you do this, you I<will> get irreversible disk "
33455 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
33456 "but doesn't catch all cases."
33460 #: ../tools/virt-win-reg.pl:58
33462 "Modifying the Windows Registry is an inherently risky operation. The format "
33463 "is deliberately obscure and undocumented, and Registry changes can leave the "
33464 "system unbootable. Therefore when using the I<--merge> option, make sure "
33465 "you have a reliable backup first."
33470 #: ../tools/virt-win-reg.pl:65
33472 "This program can export and merge Windows Registry entries from a Windows "
33478 #: ../tools/virt-win-reg.pl:68
33480 "The first parameter is the libvirt guest name or the raw disk image of a "
33485 #: ../tools/virt-win-reg.pl:71
33487 "If I<--merge> is I<not> specified, then the chosen registry key is displayed/"
33488 "exported (recursively). For example:"
33493 #: ../tools/virt-win-reg.pl:74
33496 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
33502 #: ../tools/virt-win-reg.pl:76
33504 "You can also display single values from within registry keys, for example:"
33509 #: ../tools/virt-win-reg.pl:79
33512 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
33513 " $ virt-win-reg Windows7 $cvkey ProductName\n"
33514 " Windows 7 Enterprise\n"
33519 #: ../tools/virt-win-reg.pl:83
33521 "With I<--merge>, you can merge a textual regedit file into the Windows "
33527 #: ../tools/virt-win-reg.pl:86
33530 " $ virt-win-reg --merge Windows7 changes.reg\n"
33536 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
33542 #: ../tools/virt-win-reg.pl:90
33544 "This program is only meant for simple access to the registry. If you want "
33545 "to do complicated things with the registry, we suggest you download the "
33546 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
33547 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
33548 "L<hivexregedit(1)>."
33553 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
33559 #: ../tools/virt-win-reg.pl:122
33560 msgid "Enable debugging messages."
33565 #: ../tools/virt-win-reg.pl:157
33571 #: ../tools/virt-win-reg.pl:159
33573 "In merge mode, this merges a textual regedit file into the Windows Registry "
33574 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
33575 "displays or exports Registry entries instead."
33579 #: ../tools/virt-win-reg.pl:163
33581 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
33582 "result in disk corruption. However exporting (without this flag) is always "
33588 #: ../tools/virt-win-reg.pl:171
33589 msgid "B<--encoding> UTF-16LE|ASCII"
33594 #: ../tools/virt-win-reg.pl:173
33596 "When merging (only), you may need to specify the encoding for strings to be "
33597 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
33598 "(3)/ENCODING STRINGS>."
33603 #: ../tools/virt-win-reg.pl:177
33605 "The default is to use UTF-16LE, which should work with recent versions of "
33611 #: ../tools/virt-win-reg.pl:402
33612 msgid "SUPPORTED SYSTEMS"
33617 #: ../tools/virt-win-reg.pl:404
33619 "The program currently supports Windows NT-derived guests starting with "
33620 "Windows XP through to at least Windows 7."
33625 #: ../tools/virt-win-reg.pl:407
33627 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
33628 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
33629 "and C<HKEY_USERS\\.DEFAULT>."
33634 #: ../tools/virt-win-reg.pl:411
33636 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
33642 #: ../tools/virt-win-reg.pl:414
33644 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
33650 #: ../tools/virt-win-reg.pl:417
33656 #: ../tools/virt-win-reg.pl:419
33658 "C<virt-win-reg> expects that regedit files have already been reencoded in "
33659 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
33660 "style line endings. Since Windows regedit files are often in UTF-16LE with "
33661 "Windows-style line endings, you may need to reencode the whole file before "
33662 "or after processing."
33666 #: ../tools/virt-win-reg.pl:425
33668 "To reencode a file from Windows format to Linux (before processing it with "
33669 "the I<--merge> option), you would do something like this:"
33674 #: ../tools/virt-win-reg.pl:428
33677 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
33683 #: ../tools/virt-win-reg.pl:430
33685 "To go in the opposite direction, after exporting and before sending the file "
33686 "to a Windows user, do something like this:"
33691 #: ../tools/virt-win-reg.pl:433
33694 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
33700 #: ../tools/virt-win-reg.pl:435
33701 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
33706 #: ../tools/virt-win-reg.pl:437
33708 "If you are unsure about the current encoding, use the L<file(1)> command. "
33709 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
33710 "style (CRLF) line endings, like this:"
33715 #: ../tools/virt-win-reg.pl:441
33718 " $ file software.reg\n"
33719 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
33720 " with CRLF line terminators\n"
33725 #: ../tools/virt-win-reg.pl:445
33726 msgid "This file would need conversion before you could I<--merge> it."
33731 #: ../tools/virt-win-reg.pl:447
33732 msgid "CurrentControlSet etc."
33737 #: ../tools/virt-win-reg.pl:449
33739 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
33740 "Registry at the level of the hive file, and therefore you cannot modify "
33746 #: ../tools/virt-win-reg.pl:453
33748 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
33749 "circumstances it might refer to another control set. The way to find out is "
33750 "to look at the C<HKLM\\SYSTEM\\Select> key:"
33755 #: ../tools/virt-win-reg.pl:457
33758 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
33759 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
33760 " \"Current\"=dword:00000001\n"
33761 " \"Default\"=dword:00000001\n"
33762 " \"Failed\"=dword:00000000\n"
33763 " \"LastKnownGood\"=dword:00000002\n"
33769 #: ../tools/virt-win-reg.pl:464
33770 msgid "\"Current\" is the one which Windows will choose when it boots."
33775 #: ../tools/virt-win-reg.pl:466
33777 "Similarly, other C<Current...> keys in the path may need to be replaced."
33782 #: ../tools/virt-win-reg.pl:469
33783 msgid "WINDOWS TIPS"
33788 #: ../tools/virt-win-reg.pl:471
33790 "Note that some of these tips modify the guest disk image. The guest I<must> "
33791 "be shut off, else you will get disk corruption."
33796 #: ../tools/virt-win-reg.pl:474
33797 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
33802 #: ../tools/virt-win-reg.pl:476
33804 "Prepare a DOS batch script, VBScript or executable. Upload this using "
33805 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
33806 "is uploaded into C<C:\\>:"
33811 #: ../tools/virt-win-reg.pl:480
33814 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
33820 #: ../tools/virt-win-reg.pl:482
33821 msgid "Prepare a regedit file containing the registry change:"
33826 #: ../tools/virt-win-reg.pl:484
33829 " cat > test.reg <<'EOF'\n"
33830 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
33831 " \"Test\"=\"c:\\\\test.bat\"\n"
33838 #: ../tools/virt-win-reg.pl:489
33840 "In this example we use the key C<RunOnce> which means that the script will "
33841 "run precisely once when the first user logs in. If you want it to run every "
33842 "time a user logs in, replace C<RunOnce> with C<Run>."
33847 #: ../tools/virt-win-reg.pl:493
33848 msgid "Now update the registry:"
33853 #: ../tools/virt-win-reg.pl:495
33856 " virt-win-reg --merge WindowsGuest test.reg\n"
33862 #: ../tools/virt-win-reg.pl:497
33863 msgid "INSTALLING A SERVICE"
33868 #: ../tools/virt-win-reg.pl:499
33870 "This section assumes you are familiar with Windows services, and you either "
33871 "have a program which handles the Windows Service Control Protocol directly "
33872 "or you want to run any program using a service wrapper like SrvAny or the "
33878 #: ../tools/virt-win-reg.pl:504
33880 "First upload the program and optionally the service wrapper. In this case "
33881 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
33886 #: ../tools/virt-win-reg.pl:508
33889 " guestfish -i -d WindowsGuest <<EOF\n"
33890 " upload rhsrvany.exe /rhsrvany.exe\n"
33891 " upload test.exe /test.exe\n"
33898 #: ../tools/virt-win-reg.pl:513
33900 "Prepare a regedit file containing the registry changes. In this example, "
33901 "the first registry change is needed for the service itself or the service "
33902 "wrapper (if used). The second registry change is only needed because I am "
33903 "using the RHSrvAny service wrapper."
33908 #: ../tools/virt-win-reg.pl:518
33911 " cat > service.reg <<'EOF'\n"
33912 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
33913 " \"Type\"=dword:00000010\n"
33914 " \"Start\"=dword:00000002\n"
33915 " \"ErrorControl\"=dword:00000001\n"
33916 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
33917 " \"DisplayName\"=\"RHSrvAny\"\n"
33918 " \"ObjectName\"=\"NetworkService\"\n"
33924 #: ../tools/virt-win-reg.pl:527
33927 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
33928 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
33929 " \"PWD\"=\"c:\\\\Temp\"\n"
33936 #: ../tools/virt-win-reg.pl:538
33938 "For use of C<ControlSet001> see the section above in this manual page. You "
33939 "may need to adjust this according to the control set that is in use by the "
33945 #: ../tools/virt-win-reg.pl:544
33947 "C<\"ObjectName\"> controls the privileges that the service will have. An "
33948 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
33949 "privileged account."
33954 #: ../tools/virt-win-reg.pl:550
33956 "For the meaning of the magic numbers, see this Microsoft KB article: "
33957 "L<http://support.microsoft.com/kb/103000>."
33962 #: ../tools/virt-win-reg.pl:555
33963 msgid "Update the registry:"
33968 #: ../tools/virt-win-reg.pl:557
33971 " virt-win-reg --merge WindowsGuest service.reg\n"
33977 #: ../tools/virt-win-reg.pl:561
33979 "Be careful when passing parameters containing C<\\> (backslash) in the "
33980 "shell. Usually you will have to use 'single quotes' or double backslashes "
33981 "(but not both) to protect them from the shell."
33986 #: ../tools/virt-win-reg.pl:565
33987 msgid "Paths and value names are case-insensitive."
33992 #: ../tools/virt-win-reg.pl:574
33994 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
33995 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
33996 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
34001 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:555
34003 "When reporting bugs, please enable debugging and capture the I<complete> "
34009 #: ../tools/virt-win-reg.pl:592
34012 " export LIBGUESTFS_DEBUG=1\n"
34013 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
34019 #: ../tools/virt-win-reg.pl:595
34021 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
34027 #: ../tools/virt-win-reg.pl:604 ../tools/virt-make-fs.pl:570
34028 msgid "Copyright (C) 2010 Red Hat Inc."
34033 #: ../tools/virt-list-filesystems.pl:32
34035 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
34040 #: ../tools/virt-list-filesystems.pl:36
34043 " virt-list-filesystems [--options] domname\n"
34049 #: ../tools/virt-list-filesystems.pl:38
34052 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
34058 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
34060 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
34066 #: ../tools/virt-list-filesystems.pl:45
34068 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
34069 "are contained in a virtual machine or disk image."
34074 #: ../tools/virt-list-filesystems.pl:49
34076 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
34077 "functionality. For more complex cases you should look at the L<guestfish(1)"
34083 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
34084 msgid "B<-l> | B<--long>"
34089 #: ../tools/virt-list-filesystems.pl:108
34091 "With this option, C<virt-list-filesystems> displays the type of each "
34092 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
34097 #: ../tools/virt-list-filesystems.pl:115
34098 msgid "B<-a> | B<--all>"
34103 #: ../tools/virt-list-filesystems.pl:117
34105 "Normally we only show mountable filesystems. If this option is given then "
34106 "swap devices are shown too."
34111 #: ../tools/virt-list-filesystems.pl:191
34113 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
34114 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
34115 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
34120 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
34121 msgid "Copyright (C) 2009 Red Hat Inc."
34126 #: ../tools/virt-tar.pl:33
34127 msgid "virt-tar - Extract or upload files to a virtual machine"
34132 #: ../tools/virt-tar.pl:37
34135 " virt-tar [--options] -x domname directory tarball\n"
34141 #: ../tools/virt-tar.pl:39
34144 " virt-tar [--options] -u domname tarball directory\n"
34150 #: ../tools/virt-tar.pl:41
34153 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
34159 #: ../tools/virt-tar.pl:43
34162 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
34167 #: ../tools/virt-tar.pl:47
34169 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
34170 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
34175 #: ../tools/virt-tar.pl:52
34176 msgid "Download C</home> from the VM into a local tarball:"
34181 #: ../tools/virt-tar.pl:54
34184 " virt-tar -x domname /home home.tar\n"
34190 #: ../tools/virt-tar.pl:56
34193 " virt-tar -zx domname /home home.tar.gz\n"
34199 #: ../tools/virt-tar.pl:58
34200 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
34205 #: ../tools/virt-tar.pl:60
34208 " virt-tar -u domname uploadstuff.tar /tmp\n"
34214 #: ../tools/virt-tar.pl:62
34217 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
34222 #: ../tools/virt-tar.pl:66
34224 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
34225 "virtual machines. If you do this, you risk disk corruption in the VM. "
34226 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
34230 #: ../tools/virt-tar.pl:71
34232 "You can use I<-x> (extract) on live virtual machines, but you might get "
34233 "inconsistent results or errors if there is filesystem activity inside the "
34234 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
34235 "work, but the only way to guarantee consistent results is if the virtual "
34236 "machine is shut down."
34241 #: ../tools/virt-tar.pl:79
34243 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
34244 "parts of a guest filesystem. There are many possibilities: making backups, "
34245 "uploading data files, snooping on guest activity, fixing or customizing "
34251 #: ../tools/virt-tar.pl:84
34253 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
34254 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
34255 "should look at the L<guestfish(1)> tool."
34259 #: ../tools/virt-tar.pl:88
34261 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
34262 "its contents (recursively) from the virtual machine into a local tarball. "
34263 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
34264 "virtual machine. You cannot use these two options together."
34268 #: ../tools/virt-tar.pl:94
34270 "In addition, you may need to use the I<-z> (gZip) option to enable "
34271 "compression. When uploading, you have to specify I<-z> if the upload file "
34272 "is compressed because virt-tar won't detect this on its own."
34277 #: ../tools/virt-tar.pl:98
34279 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
34280 "example it cannot do PKZip files or bzip2 compression. If you want that "
34281 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
34282 "the L<libguestfs(3)> API)."
34287 #: ../tools/virt-tar.pl:156
34288 msgid "B<-x> | B<--extract> | B<--download>"
34293 #: ../tools/virt-tar.pl:158
34294 msgid "B<-u> | B<--upload>"
34298 #: ../tools/virt-tar.pl:160
34300 "Use I<-x> to extract (download) a directory from a virtual machine to a "
34305 #: ../tools/virt-tar.pl:163
34307 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
34308 "Please read the L</WARNING> section above before using this option."
34313 #: ../tools/virt-tar.pl:167
34314 msgid "You must specify exactly one of these options."
34319 #: ../tools/virt-tar.pl:173
34320 msgid "B<-z> | B<--gzip>"
34325 #: ../tools/virt-tar.pl:175
34326 msgid "Specify that the input or output tarball is gzip-compressed."
34330 #: ../tools/virt-tar.pl:288
34332 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
34333 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
34334 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
34340 #: ../tools/virt-make-fs.pl:37
34341 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
34346 #: ../tools/virt-make-fs.pl:41
34349 " virt-make-fs [--options] input.tar output.img\n"
34355 #: ../tools/virt-make-fs.pl:43
34358 " virt-make-fs [--options] input.tar.gz output.img\n"
34364 #: ../tools/virt-make-fs.pl:45
34367 " virt-make-fs [--options] directory output.img\n"
34373 #: ../tools/virt-make-fs.pl:49
34375 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
34376 "archive or some files in a directory. It is similar to tools like L<mkisofs"
34377 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
34378 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
34379 "you want to attach these filesystems to existing virtual machines (eg. to "
34380 "import large amounts of read-only data to a VM)."
34385 #: ../tools/virt-make-fs.pl:57
34386 msgid "Basic usage is:"
34391 #: ../tools/virt-make-fs.pl:59
34394 " virt-make-fs input output\n"
34400 #: ../tools/virt-make-fs.pl:61
34402 "where C<input> is either a directory containing files that you want to add, "
34403 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
34404 "C<output> is a disk image. The input type is detected automatically. The "
34405 "output disk image defaults to a raw ext2 image unless you specify extra "
34406 "flags (see L</OPTIONS> below)."
34411 #: ../tools/virt-make-fs.pl:67
34412 msgid "EXTRA SPACE"
34416 #: ../tools/virt-make-fs.pl:69
34418 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
34419 "the files that it contains, but might have extra space. Depending on how "
34420 "you are going to use the output, you might think this extra space is wasted "
34421 "and want to minimize it, or you might want to leave space so that more files "
34422 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
34423 "but you can use the I<--size> flag to leave space in the filesystem if you "
34428 #: ../tools/virt-make-fs.pl:77
34430 "An alternative way to leave extra space but not make the output image any "
34431 "bigger is to use an alternative disk image format (instead of the default "
34432 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
34433 "image format (check your hypervisor supports this before using it). This "
34434 "allows you to choose a large I<--size> but the extra space won't actually be "
34435 "allocated in the image until you try to store something in it."
34439 #: ../tools/virt-make-fs.pl:85
34441 "Don't forget that you can also use local commands including L<resize2fs(8)> "
34442 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
34443 "to build another image from scratch."
34448 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
34449 #: ../tools/virt-make-fs.pl:142
34455 #: ../tools/virt-make-fs.pl:91
34458 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
34464 #: ../tools/virt-make-fs.pl:93
34465 msgid "FILESYSTEM TYPE"
34470 #: ../tools/virt-make-fs.pl:95
34472 "The default filesystem type is C<ext2>. Just about any filesystem type that "
34473 "libguestfs supports can be used (but I<not> read-only formats like "
34474 "ISO9660). Here are some of the more common choices:"
34479 #: ../tools/virt-make-fs.pl:101
34485 #: ../tools/virt-make-fs.pl:103
34487 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
34488 "you are not going to use the filesystem in a way that requires the journal, "
34489 "then this is just wasted overhead."
34494 #: ../tools/virt-make-fs.pl:107
34495 msgid "I<ntfs> or I<vfat>"
34500 #: ../tools/virt-make-fs.pl:109
34501 msgid "Useful if exporting data to a Windows guest."
34506 #: ../tools/virt-make-fs.pl:111
34508 "I<Note for vfat>: The tar archive or local directory must only contain files "
34509 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
34510 "program running within libguestfs is unable to change the ownership of non-"
34511 "root files, since vfat itself does not support this."
34516 #: ../tools/virt-make-fs.pl:116
34522 #: ../tools/virt-make-fs.pl:118
34524 "Lower overhead than C<ext2>, but certain limitations on filename length and "
34525 "total filesystem size."
34530 #: ../tools/virt-make-fs.pl:125
34533 " virt-make-fs --type=minix input minixfs.img\n"
34539 #: ../tools/virt-make-fs.pl:127
34540 msgid "TO PARTITION OR NOT TO PARTITION"
34545 #: ../tools/virt-make-fs.pl:129
34546 msgid "Optionally virt-make-fs can add a partition table to the output disk."
34551 #: ../tools/virt-make-fs.pl:131
34553 "Adding a partition can make the disk image more compatible with certain "
34554 "virtualized operating systems which don't expect to see a filesystem "
34555 "directly located on a block device (Linux doesn't care and will happily "
34556 "handle both types)."
34561 #: ../tools/virt-make-fs.pl:136
34563 "On the other hand, if you have a partition table then the output image is no "
34564 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
34565 "directly on a partitioned disk image. (However libguestfs tools such as "
34566 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
34571 #: ../tools/virt-make-fs.pl:144
34572 msgid "Add an MBR partition:"
34577 #: ../tools/virt-make-fs.pl:146
34580 " virt-make-fs --partition -- input disk.img\n"
34586 #: ../tools/virt-make-fs.pl:148
34588 "If the output disk image could be terabyte-sized or larger, it's better to "
34589 "use an EFI/GPT-compatible partition table:"
34594 #: ../tools/virt-make-fs.pl:151
34597 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
34603 #: ../tools/virt-make-fs.pl:179
34604 msgid "Enable debugging information."
34609 #: ../tools/virt-make-fs.pl:185
34610 msgid "B<--size=E<lt>NE<gt>>"
34615 #: ../tools/virt-make-fs.pl:187
34616 msgid "B<--size=+E<lt>NE<gt>>"
34621 #: ../tools/virt-make-fs.pl:189
34622 msgid "B<-s E<lt>NE<gt>>"
34627 #: ../tools/virt-make-fs.pl:191
34628 msgid "B<-s +E<lt>NE<gt>>"
34632 #: ../tools/virt-make-fs.pl:193
34634 "Use the I<--size> (or I<-s>) option to choose the size of the output image."
34639 #: ../tools/virt-make-fs.pl:196
34641 "If this option is I<not> given, then the output image will be just large "
34642 "enough to contain all the files, with not much wasted space."
34647 #: ../tools/virt-make-fs.pl:199
34649 "To choose a fixed size output disk, specify an absolute number followed by b/"
34650 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34651 "Petabytes or Exabytes. This must be large enough to contain all the input "
34652 "files, else you will get an error."
34656 #: ../tools/virt-make-fs.pl:204
34658 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
34659 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
34660 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
34661 "the input files, and (approximately) an extra 200 MB free space."
34666 #: ../tools/virt-make-fs.pl:210
34668 "Note that virt-make-fs estimates free space, and therefore will not produce "
34669 "filesystems containing precisely the free space requested. (It is much more "
34670 "expensive and time-consuming to produce a filesystem which has precisely the "
34671 "desired free space)."
34676 #: ../tools/virt-make-fs.pl:219
34677 msgid "B<--format=E<lt>fmtE<gt>>"
34682 #: ../tools/virt-make-fs.pl:221
34683 msgid "B<-F E<lt>fmtE<gt>>"
34688 #: ../tools/virt-make-fs.pl:223
34689 msgid "Choose the output disk image format."
34694 #: ../tools/virt-make-fs.pl:225
34695 msgid "The default is C<raw> (raw disk image)."
34700 #: ../tools/virt-make-fs.pl:227
34702 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
34703 "that would really make sense here is C<qcow2>."
34708 #: ../tools/virt-make-fs.pl:234
34709 msgid "B<--type=E<lt>fsE<gt>>"
34714 #: ../tools/virt-make-fs.pl:236
34715 msgid "B<-t E<lt>fsE<gt>>"
34720 #: ../tools/virt-make-fs.pl:238
34721 msgid "Choose the output filesystem type."
34726 #: ../tools/virt-make-fs.pl:240
34727 msgid "The default is C<ext2>."
34732 #: ../tools/virt-make-fs.pl:242
34734 "Any filesystem which is supported read-write by libguestfs can be used here."
34739 #: ../tools/virt-make-fs.pl:249
34740 msgid "B<--partition>"
34745 #: ../tools/virt-make-fs.pl:251
34746 msgid "B<--partition=E<lt>parttypeE<gt>>"
34751 #: ../tools/virt-make-fs.pl:253
34753 "If specified, this flag adds an MBR partition table to the output disk image."
34757 #: ../tools/virt-make-fs.pl:256
34759 "You can change the partition table type, eg. I<--partition=gpt> for large "
34764 #: ../tools/virt-make-fs.pl:259
34766 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
34767 "might consider the next parameter to be the partition type. For example:"
34772 #: ../tools/virt-make-fs.pl:263
34775 " virt-make-fs --partition input.tar ...\n"
34780 #: ../tools/virt-make-fs.pl:265
34782 "would cause virt-make-fs to think you wanted to use a partition type of "
34783 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
34784 "dash) between options and the input file argument:"
34789 #: ../tools/virt-make-fs.pl:269
34792 " virt-make-fs --partition -- input.tar ...\n"
34797 #: ../tools/virt-make-fs.pl:541
34799 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
34800 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
34801 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
34806 #: ../tools/virt-make-fs.pl:558
34809 " export LIBGUESTFS_DEBUG=1\n"
34810 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
34816 #: ../tools/virt-make-fs.pl:561
34818 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
34824 #: ../tools/virt-list-partitions.pl:32
34826 "virt-list-partitions - List partitions in a virtual machine or disk image"
34831 #: ../tools/virt-list-partitions.pl:36
34834 " virt-list-partitions [--options] domname\n"
34840 #: ../tools/virt-list-partitions.pl:38
34843 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
34849 #: ../tools/virt-list-partitions.pl:45
34851 "C<virt-list-partitions> is a command line tool to list the partitions that "
34852 "are contained in a virtual machine or disk image. It is mainly useful as a "
34853 "first step to using L<virt-resize(1)>."
34858 #: ../tools/virt-list-partitions.pl:50
34860 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
34861 "functionality. For more complex cases you should look at the L<guestfish(1)"
34867 #: ../tools/virt-list-partitions.pl:107
34868 msgid "B<-h> | B<--human-readable>"
34873 #: ../tools/virt-list-partitions.pl:109
34874 msgid "Show sizes in human-readable form (eg. \"1G\")."
34879 #: ../tools/virt-list-partitions.pl:117
34881 "With this option, C<virt-list-partitions> displays the type and size of each "
34882 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
34887 #: ../tools/virt-list-partitions.pl:124
34888 msgid "B<-t> | B<--total>"
34893 #: ../tools/virt-list-partitions.pl:126
34895 "Display the total size of each block device (as a separate row or rows)."
34900 #: ../tools/virt-list-partitions.pl:259
34902 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
34903 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
34904 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
34909 #: ../tools/virt-list-partitions.pl:275
34910 msgid "Copyright (C) 2009-2010 Red Hat Inc."