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-03-28 17:11+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-resize.pl:40 ../tools/virt-list-filesystems.pl:30
25 #: ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35
26 #: ../tools/virt-list-partitions.pl:30
32 #: ../src/guestfs.pod:5
33 msgid "guestfs - Library for accessing and modifying virtual machine images"
38 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
39 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
40 #: ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39
41 #: ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34
42 #: ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39
43 #: ../tools/virt-list-partitions.pl:34
49 #: ../src/guestfs.pod:9
52 " #include <guestfs.h>\n"
58 #: ../src/guestfs.pod:11
61 " guestfs_h *g = guestfs_create ();\n"
62 " guestfs_add_drive (g, \"guest.img\");\n"
63 " guestfs_launch (g);\n"
64 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
65 " guestfs_touch (g, \"/hello\");\n"
66 " guestfs_umount (g, \"/\");\n"
67 " guestfs_close (g);\n"
73 #: ../src/guestfs.pod:19
76 " cc prog.c -o prog -lguestfs\n"
78 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
84 #: ../src/guestfs.pod:23 ../fish/guestfish.pod:30
85 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
86 #: ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63
87 #: ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40
88 #: ../tools/virt-tar.pl:77 ../tools/virt-make-fs.pl:47
89 #: ../tools/virt-list-partitions.pl:40
95 #: ../src/guestfs.pod:25
97 "Libguestfs is a library for accessing and modifying guest disk images. "
98 "Amongst the things this is good for: making batch configuration changes to "
99 "guests, getting disk used/free statistics (see also: virt-df), migrating "
100 "between virtualization systems (see also: virt-p2v), performing partial "
101 "backups, performing partial guest clones, cloning guests and changing "
102 "registry/UUID/hostname info, and much else besides."
107 #: ../src/guestfs.pod:33
109 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
110 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
111 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
117 #: ../src/guestfs.pod:38
119 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
120 "what filesystem is in each LV, etc.). It can also run commands in the "
121 "context of the guest. Also you can access filesystems over FUSE."
126 #: ../src/guestfs.pod:43
128 "Libguestfs is a library that can be linked with C and C++ management "
129 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
130 "PHP, Haskell or C#). You can also use it from shell scripts or the command "
136 #: ../src/guestfs.pod:48
138 "You don't need to be root to use libguestfs, although obviously you do need "
139 "enough permissions to access the disk images."
144 #: ../src/guestfs.pod:51
146 "Libguestfs is a large API because it can do many things. For a gentle "
147 "introduction, please read the L</API OVERVIEW> section next."
152 #: ../src/guestfs.pod:54
154 "There are also some example programs in the L<guestfs-examples(3)> manual "
160 #: ../src/guestfs.pod:57
166 #: ../src/guestfs.pod:59
168 "This section provides a gentler overview of the libguestfs API. We also try "
169 "to group API calls together, where that may not be obvious from reading "
170 "about the individual calls in the main section of this manual."
175 #: ../src/guestfs.pod:64
181 #: ../src/guestfs.pod:66
183 "Before you can use libguestfs calls, you have to create a handle. Then you "
184 "must add at least one disk image to the handle, followed by launching the "
185 "handle, then performing whatever operations you want, and finally closing "
186 "the handle. By convention we use the single letter C<g> for the name of the "
187 "handle variable, although of course you can use any name you want."
192 #: ../src/guestfs.pod:73
193 msgid "The general structure of all libguestfs-using programs looks like this:"
198 #: ../src/guestfs.pod:76
201 " guestfs_h *g = guestfs_create ();\n"
207 #: ../src/guestfs.pod:78
210 " /* Call guestfs_add_drive additional times if there are\n"
211 " * multiple disk images.\n"
213 " guestfs_add_drive (g, \"guest.img\");\n"
219 #: ../src/guestfs.pod:83
222 " /* Most manipulation calls won't work until you've launched\n"
223 " * the handle 'g'. You have to do this _after_ adding drives\n"
224 " * and _before_ other commands.\n"
226 " guestfs_launch (g);\n"
232 #: ../src/guestfs.pod:89
235 " /* Now you can examine what partitions, LVs etc are available.\n"
237 " char **partitions = guestfs_list_partitions (g);\n"
238 " char **logvols = guestfs_lvs (g);\n"
244 #: ../src/guestfs.pod:94
247 " /* To access a filesystem in the image, you must mount it.\n"
249 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
254 #: ../src/guestfs.pod:98
257 " /* Now you can perform filesystem actions on the guest\n"
260 " guestfs_touch (g, \"/hello\");\n"
266 #: ../src/guestfs.pod:103
269 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
270 " * it is done automatically when you close the handle. See\n"
271 " * discussion of autosync in this page.\n"
273 " guestfs_sync (g);\n"
279 #: ../src/guestfs.pod:109
282 " /* Close the handle 'g'. */\n"
283 " guestfs_close (g);\n"
289 #: ../src/guestfs.pod:112
291 "The code above doesn't include any error checking. In real code you should "
292 "check return values carefully for errors. In general all functions that "
293 "return integers return C<-1> on error, and all functions that return "
294 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
295 "how to handle errors, and consult the documentation for each function call "
296 "below to see precisely how they return error indications. See L<guestfs-"
297 "examples(3)> for fully worked examples."
302 #: ../src/guestfs.pod:121
308 #: ../src/guestfs.pod:123
310 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
311 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
312 "actual block device, or simply an empty file of zeroes that you have created "
313 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
319 #: ../src/guestfs.pod:129
321 "The call you should use in modern code for adding drives is L</"
322 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
323 "specifying that the format is raw, do:"
328 #: ../src/guestfs.pod:133
331 " guestfs_add_drive_opts (g, filename,\n"
332 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
339 #: ../src/guestfs.pod:137
340 msgid "You can add a disk read-only using:"
345 #: ../src/guestfs.pod:139
348 " guestfs_add_drive_opts (g, filename,\n"
349 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
350 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
357 #: ../src/guestfs.pod:144
359 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
360 "libguestfs won't modify the file."
365 #: ../src/guestfs.pod:147
367 "Be extremely cautious if the disk image is in use, eg. if it is being used "
368 "by a virtual machine. Adding it read-write will almost certainly cause disk "
369 "corruption, but adding it read-only is safe."
374 #: ../src/guestfs.pod:151
376 "You must add at least one disk image, and you may add multiple disk images. "
377 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
378 "first one you added), C</dev/sdb> (for the second one you added), etc."
383 #: ../src/guestfs.pod:156
385 "Once L</guestfs_launch> has been called you cannot add any more images. You "
386 "can call L</guestfs_list_devices> to get a list of the device names, in the "
387 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
392 #: ../src/guestfs.pod:161
397 #: ../src/guestfs.pod:163
399 "Before you can read or write files, create directories and so on in a disk "
400 "image that contains filesystems, you have to mount those filesystems using "
401 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
402 "a disk image contains (for example) one partition with a filesystem on that "
403 "partition, then you can mount it directly:"
407 #: ../src/guestfs.pod:170
410 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
415 #: ../src/guestfs.pod:172
417 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
418 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
419 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
420 "that these are libguestfs virtual devices, and are nothing to do with host "
425 #: ../src/guestfs.pod:178
427 "If you are given a disk image and you don't know what it contains then you "
428 "have to find out. Libguestfs can do that too: use L</"
429 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
430 "LVs, and either try mounting each to see what is mountable, or else examine "
431 "them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
432 "filesystems, use L</guestfs_list_filesystems>."
436 #: ../src/guestfs.pod:186
438 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
439 "L</INSPECTION> below). But you might find it easier to look at higher level "
440 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
444 #: ../src/guestfs.pod:191
446 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
447 "several other variations of the C<guestfs_mount_*> call."
452 #: ../src/guestfs.pod:194
453 msgid "FILESYSTEM ACCESS AND MODIFICATION"
458 #: ../src/guestfs.pod:196
460 "The majority of the libguestfs API consists of fairly low-level calls for "
461 "accessing and modifying the files, directories, symlinks etc on mounted "
462 "filesystems. There are over a hundred such calls which you can find listed "
463 "in detail below in this man page, and we don't even pretend to cover them "
464 "all in this overview."
469 #: ../src/guestfs.pod:202
471 "Specify filenames as full paths, starting with C<\"/\"> and including the "
477 #: ../src/guestfs.pod:205
479 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
480 "the file called C<\"etc/passwd\"> then you could do:"
485 #: ../src/guestfs.pod:208
488 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
494 #: ../src/guestfs.pod:210
496 "This would return C<data> as a newly allocated buffer containing the full "
497 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
498 "or C<NULL> if there was an error."
503 #: ../src/guestfs.pod:214
505 "As another example, to create a top-level directory on that filesystem "
506 "called C<\"var\"> you would do:"
511 #: ../src/guestfs.pod:217
514 " guestfs_mkdir (g, \"/var\");\n"
520 #: ../src/guestfs.pod:219
521 msgid "To create a symlink you could do:"
526 #: ../src/guestfs.pod:221
529 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
530 " \"/etc/rc3.d/S30portmap\");\n"
536 #: ../src/guestfs.pod:224
538 "Libguestfs will reject attempts to use relative paths and there is no "
539 "concept of a current working directory."
544 #: ../src/guestfs.pod:227
546 "Libguestfs can return errors in many situations: for example if the "
547 "filesystem isn't writable, or if a file or directory that you requested "
548 "doesn't exist. If you are using the C API (documented here) you have to "
549 "check for those error conditions after each call. (Other language bindings "
550 "turn these errors into exceptions)."
555 #: ../src/guestfs.pod:233
557 "File writes are affected by the per-handle umask, set by calling L</"
558 "guestfs_umask> and defaulting to 022. See L</UMASK>."
563 #: ../src/guestfs.pod:236
569 #: ../src/guestfs.pod:238
571 "Libguestfs contains API calls to read, create and modify partition tables on "
577 #: ../src/guestfs.pod:241
579 "In the common case where you want to create a single partition covering the "
580 "whole disk, you should use the L</guestfs_part_disk> call:"
585 #: ../src/guestfs.pod:245
588 " const char *parttype = \"mbr\";\n"
589 " if (disk_is_larger_than_2TB)\n"
590 " parttype = \"gpt\";\n"
591 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
597 #: ../src/guestfs.pod:250
599 "Obviously this effectively wipes anything that was on that disk image before."
604 #: ../src/guestfs.pod:253
610 #: ../src/guestfs.pod:255
612 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
613 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
614 "you familiarize yourself with the concepts of physical volumes, volume "
615 "groups and logical volumes."
620 #: ../src/guestfs.pod:260
622 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
623 "tldp.org/HOWTO/LVM-HOWTO/>."
628 #: ../src/guestfs.pod:263
633 #: ../src/guestfs.pod:265
635 "Use L</guestfs_cat> to download small, text only files. This call is "
636 "limited to files which are less than 2 MB and which cannot contain any ASCII "
637 "NUL (C<\\0>) characters. However the API is very simple to use."
642 #: ../src/guestfs.pod:269
644 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
645 "bit data, since it returns a (pointer, size) pair. However it is still "
646 "limited to \"small\" files, less than 2 MB."
651 #: ../src/guestfs.pod:273
653 "L</guestfs_download> can be used to download any file, with no limits on "
654 "content or size (even files larger than 4 GB)."
659 #: ../src/guestfs.pod:276
661 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
666 #: ../src/guestfs.pod:279
672 #: ../src/guestfs.pod:281
674 "It's often the case that you want to write a file or files to the disk image."
679 #: ../src/guestfs.pod:284
681 "To write a small file with fixed content, use L</guestfs_write>. To create "
682 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
683 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
684 "of other functions for creating test files, for example L</guestfs_fill> and "
685 "L</guestfs_fill_pattern>."
690 #: ../src/guestfs.pod:290
692 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
693 "file content or size (even files larger than 4 GB)."
698 #: ../src/guestfs.pod:293
700 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
705 #: ../src/guestfs.pod:295
707 "However the fastest way to upload I<large numbers of arbitrary files> is to "
708 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
709 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
710 "in a predictable way (eg. adding it last after all other drives) then you "
711 "can get the device name from L</guestfs_list_devices> and mount it directly "
712 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
713 "portable between kernel versions, and they don't support labels or UUIDs. "
714 "If you want to pre-build an image or you need to mount it using a label or "
715 "UUID, use an ISO image instead."
720 #: ../src/guestfs.pod:306
726 #: ../src/guestfs.pod:308
728 "There are various different commands for copying between files and devices "
729 "and in and out of the guest filesystem. These are summarised in the table "
735 #: ../src/guestfs.pod:314
736 msgid "B<file> to B<file>"
741 #: ../src/guestfs.pod:316
743 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
744 "directories recursively."
749 #: ../src/guestfs.pod:319
750 msgid "B<file or device> to B<file or device>"
755 #: ../src/guestfs.pod:321
757 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
758 "devices in the guest."
763 #: ../src/guestfs.pod:324
764 msgid "Example: duplicate the contents of an LV:"
769 #: ../src/guestfs.pod:326
772 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
778 #: ../src/guestfs.pod:328
780 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
781 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
782 "guestfs_copy_size>."
787 #: ../src/guestfs.pod:332
788 msgid "B<file on the host> to B<file or device>"
793 #: ../src/guestfs.pod:334
794 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
799 #: ../src/guestfs.pod:336
800 msgid "B<file or device> to B<file on the host>"
805 #: ../src/guestfs.pod:338
806 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
811 #: ../src/guestfs.pod:342
812 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
817 #: ../src/guestfs.pod:344
819 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, L</"
820 "guestfs_tar_out> etc appear to only take filenames as arguments, so it "
821 "appears you can only upload and download to files. However many Un*x-like "
822 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, C</"
823 "dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, stderr, "
824 "and arbitrary file descriptor N."
829 #: ../src/guestfs.pod:352
830 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
834 #: ../src/guestfs.pod:355
837 " guestfs_download (g, filename, \"/dev/stdout\");\n"
843 #: ../src/guestfs.pod:357
844 msgid "and you can write tar output to a pipe C<fd> by doing:"
848 #: ../src/guestfs.pod:359
852 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
853 " guestfs_tar_out (g, \"/\", devfd);\n"
859 #: ../src/guestfs.pod:363
860 msgid "LISTING FILES"
865 #: ../src/guestfs.pod:365
867 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
868 "L<guestfish(1)>-equivalent command C<ll>)."
873 #: ../src/guestfs.pod:368
875 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
876 "programs, as a flat list of strings."
881 #: ../src/guestfs.pod:371
883 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
884 "directory, plus additional information about each one. It is more "
885 "equivalent to using the L<readdir(3)> call on a local filesystem."
890 #: ../src/guestfs.pod:375
892 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
897 #: ../src/guestfs.pod:378
898 msgid "RUNNING COMMANDS"
903 #: ../src/guestfs.pod:380
905 "Although libguestfs is primarily an API for manipulating files inside guest "
906 "images, we also provide some limited facilities for running commands inside "
912 #: ../src/guestfs.pod:384
913 msgid "There are many limitations to this:"
918 #: ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398
919 #: ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411
920 #: ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1088
921 #: ../src/guestfs.pod:1092 ../src/guestfs.pod:1096 ../src/guestfs.pod:1101
922 #: ../src/guestfs.pod:1109 ../src/guestfs.pod:1128 ../src/guestfs.pod:1136
923 #: ../src/guestfs.pod:1158 ../src/guestfs.pod:1162 ../src/guestfs.pod:1166
924 #: ../src/guestfs.pod:1170 ../src/guestfs.pod:1174 ../src/guestfs.pod:1178
925 #: ../src/guestfs.pod:1660 ../src/guestfs.pod:1665 ../src/guestfs.pod:1669
926 #: ../src/guestfs.pod:1770 ../src/guestfs.pod:1775 ../src/guestfs.pod:1779
927 #: ../src/guestfs.pod:2008 ../src/guestfs.pod:2013 ../src/guestfs.pod:2019
928 #: ../src/guestfs.pod:2027 ../src/guestfs.pod:2381 ../src/guestfs.pod:2387
929 #: ../src/guestfs.pod:2392 ../src/guestfs.pod:2398 ../src/guestfs.pod:2863
930 #: ../src/guestfs.pod:2867 ../src/guestfs.pod:2871 ../src/guestfs.pod:2875
931 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
932 #: ../src/guestfs-actions.pod:577 ../src/guestfs-actions.pod:585
933 #: ../src/guestfs-actions.pod:592 ../src/guestfs-actions.pod:599
934 #: ../src/guestfs-actions.pod:1595 ../src/guestfs-actions.pod:1599
935 #: ../src/guestfs-actions.pod:1603 ../src/guestfs-actions.pod:1607
936 #: ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1619
937 #: ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1633
938 #: ../src/guestfs-actions.pod:1637 ../src/guestfs-actions.pod:1641
939 #: ../src/guestfs-actions.pod:1779 ../src/guestfs-actions.pod:1783
940 #: ../src/guestfs-actions.pod:1788 ../src/guestfs-actions.pod:1793
941 #: ../src/guestfs-actions.pod:1854 ../src/guestfs-actions.pod:1858
942 #: ../src/guestfs-actions.pod:1863 ../fish/guestfish.pod:441
943 #: ../fish/guestfish.pod:445 ../fish/guestfish.pod:449
944 #: ../fish/guestfish.pod:453 ../fish/guestfish-actions.pod:13
945 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:380
946 #: ../fish/guestfish-actions.pod:388 ../fish/guestfish-actions.pod:395
947 #: ../fish/guestfish-actions.pod:402 ../fish/guestfish-actions.pod:1072
948 #: ../fish/guestfish-actions.pod:1076 ../fish/guestfish-actions.pod:1080
949 #: ../fish/guestfish-actions.pod:1084 ../fish/guestfish-actions.pod:1092
950 #: ../fish/guestfish-actions.pod:1096 ../fish/guestfish-actions.pod:1100
951 #: ../fish/guestfish-actions.pod:1110 ../fish/guestfish-actions.pod:1114
952 #: ../fish/guestfish-actions.pod:1118 ../fish/guestfish-actions.pod:1208
953 #: ../fish/guestfish-actions.pod:1212 ../fish/guestfish-actions.pod:1217
954 #: ../fish/guestfish-actions.pod:1222 ../fish/guestfish-actions.pod:1264
955 #: ../fish/guestfish-actions.pod:1268 ../fish/guestfish-actions.pod:1273
956 #: ../tools/virt-win-reg.pl:536 ../tools/virt-win-reg.pl:542
957 #: ../tools/virt-win-reg.pl:548 ../tools/virt-resize.pl:345
958 #: ../tools/virt-resize.pl:350 ../tools/virt-resize.pl:360
964 #: ../src/guestfs.pod:390
966 "The kernel version that the command runs under will be different from what "
972 #: ../src/guestfs.pod:395
974 "If the command needs to communicate with daemons, then most likely they "
980 #: ../src/guestfs.pod:400
981 msgid "The command will be running in limited memory."
986 #: ../src/guestfs.pod:404
988 "The network may not be available unless you enable it (see L</"
989 "guestfs_set_network>)."
994 #: ../src/guestfs.pod:409
995 msgid "Only supports Linux guests (not Windows, BSD, etc)."
1000 #: ../src/guestfs.pod:413
1002 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
1007 #: ../src/guestfs.pod:418
1009 "For SELinux guests, you may need to enable SELinux and load policy first. "
1010 "See L</SELINUX> in this manpage."
1015 #: ../src/guestfs.pod:423
1017 "I<Security:> It is not safe to run commands from untrusted, possibly "
1018 "malicious guests. These commands may attempt to exploit your program by "
1019 "sending unexpected output. They could also try to exploit the Linux kernel "
1020 "or qemu provided by the libguestfs appliance. They could use the network "
1021 "provided by the libguestfs appliance to bypass ordinary network partitions "
1022 "and firewalls. They could use the elevated privileges or different SELinux "
1023 "context of your program to their advantage."
1028 #: ../src/guestfs.pod:432
1030 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
1031 "(a script which runs when the guest next boots normally), and to have this "
1032 "script run the commands you want in the normal context of the running guest, "
1033 "network security and so on. For information about other security issues, "
1039 #: ../src/guestfs.pod:440
1041 "The two main API calls to run commands are L</guestfs_command> and L</"
1042 "guestfs_sh> (there are also variations)."
1047 #: ../src/guestfs.pod:443
1049 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
1050 "shell globs, redirections, etc will work."
1055 #: ../src/guestfs.pod:446
1056 msgid "CONFIGURATION FILES"
1061 #: ../src/guestfs.pod:448
1063 "To read and write configuration files in Linux guest filesystems, we "
1064 "strongly recommend using Augeas. For example, Augeas understands how to "
1065 "read and write, say, a Linux shadow password file or X.org configuration "
1066 "file, and so avoids you having to write that code."
1071 #: ../src/guestfs.pod:453
1073 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
1074 "document Augeas itself here because there is excellent documentation on the "
1075 "L<http://augeas.net/> website."
1080 #: ../src/guestfs.pod:457
1082 "If you don't want to use Augeas (you fool!) then try calling L</"
1083 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
1089 #: ../src/guestfs.pod:461
1095 #: ../src/guestfs.pod:463
1097 "We support SELinux guests. To ensure that labeling happens correctly in "
1098 "SELinux guests, you need to enable SELinux and load the guest's policy:"
1103 #: ../src/guestfs.pod:469 ../src/guestfs.pod:1281 ../src/guestfs.pod:1412
1104 #: ../src/guestfs.pod:2426
1110 #: ../src/guestfs.pod:471
1111 msgid "Before launching, do:"
1116 #: ../src/guestfs.pod:473
1119 " guestfs_set_selinux (g, 1);\n"
1125 #: ../src/guestfs.pod:475 ../src/guestfs.pod:1285 ../src/guestfs.pod:1416
1126 #: ../src/guestfs.pod:2451
1132 #: ../src/guestfs.pod:477
1134 "After mounting the guest's filesystem(s), load the policy. This is best "
1135 "done by running the L<load_policy(8)> command in the guest itself:"
1140 #: ../src/guestfs.pod:481
1143 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
1149 #: ../src/guestfs.pod:483
1151 "(Older versions of C<load_policy> require you to specify the name of the "
1157 #: ../src/guestfs.pod:486 ../src/guestfs.pod:1422
1163 #: ../src/guestfs.pod:488
1165 "Optionally, set the security context for the API. The correct security "
1166 "context to use can only be known by inspecting the guest. As an example:"
1171 #: ../src/guestfs.pod:492
1174 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1180 #: ../src/guestfs.pod:496
1181 msgid "This will work for running commands and editing existing files."
1186 #: ../src/guestfs.pod:498
1188 "When new files are created, you may need to label them explicitly, for "
1189 "example by running the external command C<restorecon pathname>."
1194 #: ../src/guestfs.pod:502
1200 #: ../src/guestfs.pod:504
1202 "Certain calls are affected by the current file mode creation mask (the "
1203 "\"umask\"). In particular ones which create files or directories, such as "
1204 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1205 "either the default mode that the file is created with or modifies the mode "
1211 #: ../src/guestfs.pod:510
1213 "The default umask is C<022>, so files are created with modes such as C<0644> "
1214 "and directories with C<0755>."
1219 #: ../src/guestfs.pod:513
1221 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1222 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1223 "guestfs_chmod> after creating each file or directory."
1228 #: ../src/guestfs.pod:517
1229 msgid "For more information about umask, see L<umask(2)>."
1234 #: ../src/guestfs.pod:519 ../fish/guestfish.pod:760
1235 msgid "ENCRYPTED DISKS"
1240 #: ../src/guestfs.pod:521
1242 "Libguestfs allows you to access Linux guests which have been encrypted using "
1243 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1244 "standard. This includes nearly all whole disk encryption systems used by "
1245 "modern Linux guests."
1250 #: ../src/guestfs.pod:527
1252 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1253 "returns the string C<crypto_LUKS>)."
1258 #: ../src/guestfs.pod:530
1260 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1261 "will require the passphrase!"
1266 #: ../src/guestfs.pod:533
1268 "Opening a LUKS device creates a new device mapper device called C</dev/"
1269 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1270 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1271 "from and encrypted to the underlying block device respectively."
1276 #: ../src/guestfs.pod:539
1278 "LVM volume groups on the device can be made visible by calling L</"
1279 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1280 "(s) can now be mounted in the usual way."
1285 #: ../src/guestfs.pod:543
1287 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1288 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1289 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1290 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1291 "underlying encrypted block device)."
1296 #: ../src/guestfs.pod:550
1301 #: ../src/guestfs.pod:552
1303 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1304 "contains operating systems, an install CD or a live CD. (These APIs used to "
1305 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
1306 "version 1.5.3 the most frequently used part of this library has been "
1307 "rewritten in C and moved into the core code)."
1312 #: ../src/guestfs.pod:559
1314 "Add all disks belonging to the unknown virtual machine and call L</"
1315 "guestfs_launch> in the usual way."
1320 #: ../src/guestfs.pod:562
1322 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1323 "and certain heuristics, and returns a list of operating systems that were "
1324 "found. An empty list means none were found. A single element is the root "
1325 "filesystem of the operating system. For dual- or multi-boot guests, "
1326 "multiple roots can be returned, each one corresponding to a separate "
1327 "operating system. (Multi-boot virtual machines are extremely rare in the "
1328 "world of virtualization, but since this scenario can happen, we have built "
1329 "libguestfs to deal with it.)"
1334 #: ../src/guestfs.pod:571
1336 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1337 "to get additional details about that operating system. For example, call L</"
1338 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1339 "Windows and Linux-based operating systems respectively."
1344 #: ../src/guestfs.pod:577
1346 "Un*x-like and Linux-based operating systems usually consist of several "
1347 "filesystems which are mounted at boot time (for example, a separate boot "
1348 "partition mounted on C</boot>). The inspection rules are able to detect how "
1349 "filesystems correspond to mount points. Call "
1350 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1351 "hash table like this example:"
1356 #: ../src/guestfs.pod:584
1359 " /boot => /dev/sda1\n"
1360 " / => /dev/vg_guest/lv_root\n"
1361 " /usr => /dev/vg_guest/lv_usr\n"
1367 #: ../src/guestfs.pod:588
1369 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1370 "filesystems as suggested."
1375 #: ../src/guestfs.pod:591
1377 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1378 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1383 #: ../src/guestfs.pod:595
1385 "Inspection currently only works for some common operating systems. "
1386 "Contributors are welcome to send patches for other operating systems that we "
1387 "currently cannot detect."
1392 #: ../src/guestfs.pod:599
1394 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1395 "for more details. The L</guestfs_inspect_os> function just ignores any "
1396 "encrypted devices."
1401 #: ../src/guestfs.pod:603
1403 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1404 "inspection and caches the results in the guest handle. Subsequent calls to "
1405 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1406 "read the disks. If you change the content of the guest disks, you can redo "
1407 "inspection by calling L</guestfs_inspect_os> again. (L</"
1408 "guestfs_inspect_list_applications> works a little differently from the other "
1409 "calls and does read the disks. See documentation for that function for "
1414 #: ../src/guestfs.pod:612
1415 msgid "INSPECTING INSTALL DISKS"
1419 #: ../src/guestfs.pod:614
1421 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
1426 #: ../src/guestfs.pod:617
1428 "Call L</guestfs_inspect_get_format> to return the format of the operating "
1429 "system, which currently can be C<installed> (a regular operating system) or "
1430 "C<installer> (some sort of install disk)."
1434 #: ../src/guestfs.pod:621
1436 "Further information is available about the operating system that can be "
1437 "installed using the regular inspection APIs like L</"
1438 "guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> etc."
1442 #: ../src/guestfs.pod:626
1444 "Some additional information specific to installer disks is also available "
1445 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and L</"
1446 "guestfs_inspect_is_multipart> calls."
1451 #: ../src/guestfs.pod:631
1452 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1457 #: ../src/guestfs.pod:633
1459 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1460 "ntfs-3g.org/> driver."
1465 #: ../src/guestfs.pod:636
1466 msgid "DRIVE LETTERS AND PATHS"
1471 #: ../src/guestfs.pod:638
1473 "DOS and Windows still use drive letters, and the filesystems are always "
1474 "treated as case insensitive by Windows itself, and therefore you might find "
1475 "a Windows configuration file referring to a path like C<c:\\windows"
1476 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1477 "might be referred to as C</WINDOWS/System32>."
1482 #: ../src/guestfs.pod:644
1484 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1485 "libguestfs to read the appropriate Windows Registry and configuration files, "
1486 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1492 #: ../src/guestfs.pod:649
1494 "Replacing backslash characters with forward slash characters is also outside "
1495 "the scope of libguestfs, but something that you can easily do."
1500 #: ../src/guestfs.pod:652
1502 "Where we can help is in resolving the case insensitivity of paths. For "
1503 "this, call L</guestfs_case_sensitive_path>."
1508 #: ../src/guestfs.pod:655
1509 msgid "ACCESSING THE WINDOWS REGISTRY"
1514 #: ../src/guestfs.pod:657
1516 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1517 "files, through the library C<hivex> which is part of the libguestfs project "
1518 "although ships as a separate tarball. You have to locate and download the "
1519 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1520 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1521 "reg(1)> for more help on this issue."
1526 #: ../src/guestfs.pod:665
1527 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
1532 #: ../src/guestfs.pod:667
1534 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
1535 "provide something which looks like a Linux symlink. The way it tries to do "
1536 "the rewriting is described here:"
1541 #: ../src/guestfs.pod:671
1543 "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-"
1549 #: ../src/guestfs.pod:673
1551 "The essential problem is that ntfs-3g simply does not have enough "
1552 "information to do a correct job. NTFS links can contain drive letters and "
1553 "references to external device GUIDs that ntfs-3g has no way of resolving. "
1554 "It is almost certainly the case that libguestfs callers should ignore what "
1555 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
1560 #: ../src/guestfs.pod:680
1562 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use L</"
1563 "guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
1564 "attribute, and read the raw reparse data from that (you can find the format "
1565 "documented in various places around the web)."
1570 #: ../src/guestfs.pod:685
1571 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
1576 #: ../src/guestfs.pod:687
1578 "There are other useful extended attributes that can be read from ntfs-3g "
1579 "filesystems (using L</guestfs_getxattr>). See:"
1584 #: ../src/guestfs.pod:690
1586 "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
1591 #: ../src/guestfs.pod:692
1592 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1597 #: ../src/guestfs.pod:694
1599 "Although we don't want to discourage you from using the C API, we will "
1600 "mention here that the same API is also available in other languages."
1604 #: ../src/guestfs.pod:697
1606 "The API is broadly identical in all supported languages. This means that "
1607 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
1608 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
1609 "OCaml. In other words, a straightforward, predictable isomorphism between "
1615 #: ../src/guestfs.pod:703
1617 "Error messages are automatically transformed into exceptions if the language "
1623 #: ../src/guestfs.pod:706
1625 "We don't try to \"object orientify\" parts of the API in OO languages, "
1626 "although contributors are welcome to write higher level APIs above what we "
1627 "provide in their favourite languages if they wish."
1632 #: ../src/guestfs.pod:712
1638 #: ../src/guestfs.pod:714
1640 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1641 "identical to the C API. C++ classes and exceptions are not used."
1646 #: ../src/guestfs.pod:718
1652 #: ../src/guestfs.pod:720
1654 "The C# bindings are highly experimental. Please read the warnings at the "
1655 "top of C<csharp/Libguestfs.cs>."
1660 #: ../src/guestfs.pod:723
1666 #: ../src/guestfs.pod:725
1668 "This is the only language binding that is working but incomplete. Only "
1669 "calls which return simple integers have been bound in Haskell, and we are "
1670 "looking for help to complete this binding."
1675 #: ../src/guestfs.pod:729
1681 #: ../src/guestfs.pod:731
1683 "Full documentation is contained in the Javadoc which is distributed with "
1689 #: ../src/guestfs.pod:734
1694 #: ../src/guestfs.pod:736
1695 msgid "See L<guestfs-ocaml(3)>."
1700 #: ../src/guestfs.pod:738
1705 #: ../src/guestfs.pod:740
1706 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
1711 #: ../src/guestfs.pod:742
1717 #: ../src/guestfs.pod:744
1719 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1720 "the php-libguestfs package for your distribution."
1725 #: ../src/guestfs.pod:747
1726 msgid "The PHP binding only works correctly on 64 bit machines."
1731 #: ../src/guestfs.pod:749
1736 #: ../src/guestfs.pod:751
1737 msgid "See L<guestfs-python(3)>."
1742 #: ../src/guestfs.pod:753
1747 #: ../src/guestfs.pod:755
1748 msgid "See L<guestfs-ruby(3)>."
1753 #: ../src/guestfs.pod:757
1754 msgid "B<shell scripts>"
1758 #: ../src/guestfs.pod:759
1759 msgid "See L<guestfish(1)>."
1764 #: ../src/guestfs.pod:763
1765 msgid "LIBGUESTFS GOTCHAS"
1770 #: ../src/guestfs.pod:765
1772 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1773 "system [...] that works in the way it is documented but is counterintuitive "
1774 "and almost invites mistakes.\""
1779 #: ../src/guestfs.pod:769
1781 "Since we developed libguestfs and the associated tools, there are several "
1782 "things we would have designed differently, but are now stuck with for "
1783 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1784 "release, you can expect these to change. Beware of them."
1789 #: ../src/guestfs.pod:777
1790 msgid "Autosync / forgetting to sync."
1795 #: ../src/guestfs.pod:779
1797 "When modifying a filesystem from C or another language, you B<must> unmount "
1798 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1799 "libguestfs handle. You can also call:"
1804 #: ../src/guestfs.pod:783
1807 " guestfs_set_autosync (g, 1);\n"
1813 #: ../src/guestfs.pod:785
1815 "to have the unmount/sync done automatically for you when the handle 'g' is "
1816 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1821 #: ../src/guestfs.pod:789
1823 "If you forget to do this, then it is entirely possible that your changes "
1824 "won't be written out, or will be partially written, or (very rarely) that "
1825 "you'll get disk corruption."
1830 #: ../src/guestfs.pod:793
1832 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1833 "guestfish scripts that forget to sync will work just fine, which can make "
1834 "this very puzzling if you are trying to debug a problem."
1839 #: ../src/guestfs.pod:797
1841 "Update: Autosync is enabled by default for all API users starting from "
1842 "libguestfs 1.5.24."
1847 #: ../src/guestfs.pod:800
1848 msgid "Mount option C<-o sync> should not be the default."
1853 #: ../src/guestfs.pod:802
1855 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1856 "However C<-o sync> does not add any reliability benefit, but does have a "
1857 "very large performance impact."
1862 #: ../src/guestfs.pod:806
1864 "The work around is to use L</guestfs_mount_options> and set the mount "
1865 "options that you actually want to use."
1870 #: ../src/guestfs.pod:809
1871 msgid "Read-only should be the default."
1876 #: ../src/guestfs.pod:811
1878 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1879 "specify I<--rw> if you want to make changes to the image."
1884 #: ../src/guestfs.pod:814
1885 msgid "This would reduce the potential to corrupt live VM images."
1890 #: ../src/guestfs.pod:816
1892 "Note that many filesystems change the disk when you just mount and unmount, "
1893 "even if you didn't perform any writes. You need to use L</"
1894 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1899 #: ../src/guestfs.pod:820
1900 msgid "guestfish command line is hard to use."
1905 #: ../src/guestfs.pod:822
1907 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1908 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1909 "exist, so it fails. In earlier versions of guestfish the error message was "
1910 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1911 "we should have used C<guestfish -c command> to run commands."
1916 #: ../src/guestfs.pod:829
1917 msgid "guestfish megabyte modifiers don't work right on all commands"
1922 #: ../src/guestfs.pod:831
1924 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1925 "other modifiers). What guestfish actually does is to multiply the number "
1926 "part by the modifier part and pass the result to the C API. However this "
1927 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1928 "expecting some other unit (eg. megabytes)."
1933 #: ../src/guestfs.pod:838
1934 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1939 #: ../src/guestfs.pod:840
1942 " lvcreate LV VG 100M\n"
1948 #: ../src/guestfs.pod:842
1950 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1951 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1952 "megabytes * megabytes) logical volume. The error message you get from this "
1953 "is also a little obscure."
1958 #: ../src/guestfs.pod:847
1960 "This could be fixed in the generator by specially marking parameters and "
1961 "return values which take bytes or other units."
1966 #: ../src/guestfs.pod:850
1967 msgid "Ambiguity between devices and paths"
1972 #: ../src/guestfs.pod:852
1974 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1975 "sdb2>) and a similar pathname. A file might just happen to be called "
1976 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1981 #: ../src/guestfs.pod:857
1983 "In the current API we usually resolve this ambiguity by having two separate "
1984 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1985 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1986 "detecting if the path supplied begins with C</dev/>."
1991 #: ../src/guestfs.pod:863
1993 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1994 "make paths/devices into structured names. One way to do this would be to "
1995 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1996 "aspect of grub. Another way would be to use a structured type, equivalent "
1997 "to this OCaml type:"
2002 #: ../src/guestfs.pod:869
2005 " type path = Path of string | Device of int | Partition of int * int\n"
2011 #: ../src/guestfs.pod:871
2012 msgid "which would allow you to pass arguments like:"
2017 #: ../src/guestfs.pod:873
2020 " Path \"/foo/bar\"\n"
2021 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
2022 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
2023 " Path \"/dev/sdb2\" (* not a device *)\n"
2029 #: ../src/guestfs.pod:878
2031 "As you can see there are still problems to resolve even with this "
2032 "representation. Also consider how it might work in guestfish."
2037 #: ../src/guestfs.pod:883
2038 msgid "PROTOCOL LIMITS"
2043 #: ../src/guestfs.pod:885
2045 "Internally libguestfs uses a message-based protocol to pass API calls and "
2046 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
2047 "plenty more detail about this). The maximum message size used by the "
2048 "protocol is slightly less than 4 MB. For some API calls you may need to be "
2049 "aware of this limit. The API calls which may be affected are individually "
2050 "documented, with a link back to this section of the documentation."
2055 #: ../src/guestfs.pod:893
2057 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
2058 "a simple string. Because this string is at some point internally encoded as "
2059 "a message, the maximum size that it can return is slightly under 4 MB. If "
2060 "the requested file is larger than this then you will get an error."
2065 #: ../src/guestfs.pod:899
2067 "In order to transfer large files into and out of the guest filesystem, you "
2068 "need to use particular calls that support this. The sections L</UPLOADING> "
2069 "and L</DOWNLOADING> document how to do this."
2074 #: ../src/guestfs.pod:903
2076 "You might also consider mounting the disk image using our FUSE filesystem "
2077 "support (L<guestmount(1)>)."
2082 #: ../src/guestfs.pod:906
2083 msgid "KEYS AND PASSPHRASES"
2088 #: ../src/guestfs.pod:908
2090 "Certain libguestfs calls take a parameter that contains sensitive key "
2091 "material, passed in as a C string."
2096 #: ../src/guestfs.pod:911
2098 "In the future we would hope to change the libguestfs implementation so that "
2099 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
2100 "swap. However this is I<not> done at the moment, because of the complexity "
2101 "of such an implementation."
2106 #: ../src/guestfs.pod:916
2108 "Therefore you should be aware that any key parameter you pass to libguestfs "
2109 "might end up being written out to the swap partition. If this is a concern, "
2110 "scrub the swap partition or don't use libguestfs on encrypted devices."
2115 #: ../src/guestfs.pod:921
2116 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
2121 #: ../src/guestfs.pod:923
2123 "All high-level libguestfs actions are synchronous. If you want to use "
2124 "libguestfs asynchronously then you must create a thread."
2129 #: ../src/guestfs.pod:926
2131 "Only use the handle from a single thread. Either use the handle exclusively "
2132 "from one thread, or provide your own mutex so that two threads cannot issue "
2133 "calls on the same handle at the same time."
2138 #: ../src/guestfs.pod:930
2140 "See the graphical program guestfs-browser for one possible architecture for "
2141 "multithreaded programs using libvirt and libguestfs."
2146 #: ../src/guestfs.pod:933
2151 #: ../src/guestfs.pod:935
2153 "Libguestfs needs a supermin appliance, which it finds by looking along an "
2159 #: ../src/guestfs.pod:938
2161 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
2162 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
2167 #: ../src/guestfs.pod:941
2169 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
2170 "to change the directories that libguestfs will search in. The value is a "
2171 "colon-separated list of paths. The current directory is I<not> searched "
2172 "unless the path contains an empty element or C<.>. For example "
2173 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
2174 "then C</usr/lib/guestfs>."
2179 #: ../src/guestfs.pod:948
2180 msgid "QEMU WRAPPERS"
2185 #: ../src/guestfs.pod:950
2187 "If you want to compile your own qemu, run qemu from a non-standard location, "
2188 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
2194 #: ../src/guestfs.pod:954
2196 "There is one important rule to remember: you I<must C<exec qemu>> as the "
2197 "last command in the shell script (so that qemu replaces the shell and "
2198 "becomes the direct child of the libguestfs-using program). If you don't do "
2199 "this, then the qemu process won't be cleaned up correctly."
2204 #: ../src/guestfs.pod:959
2206 "Here is an example of a wrapper, where I have built my own copy of qemu from "
2212 #: ../src/guestfs.pod:962
2216 " qemudir=/home/rjones/d/qemu\n"
2217 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
2223 #: ../src/guestfs.pod:966
2225 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
2226 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
2232 #: ../src/guestfs.pod:970
2235 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
2241 #: ../src/guestfs.pod:972
2243 "Note that libguestfs also calls qemu with the -help and -version options in "
2244 "order to determine features."
2248 #: ../src/guestfs.pod:975
2249 msgid "ATTACHING TO RUNNING DAEMONS"
2253 #: ../src/guestfs.pod:977
2255 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
2256 "babies. Use with caution."
2260 #: ../src/guestfs.pod:980
2262 "I<Note (2):> This section explains how to attach to a running daemon from a "
2263 "low level perspective. For most users, simply using virt tools such as "
2264 "L<guestfish(1)> with the I<--live> option will \"just work\"."
2268 #: ../src/guestfs.pod:984
2269 msgid "Using guestfs_set_attach_method"
2273 #: ../src/guestfs.pod:986
2275 "By calling L</guestfs_set_attach_method> you can change how the library "
2276 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read L</"
2277 "ARCHITECTURE> for some background)."
2281 #: ../src/guestfs.pod:990
2283 "The normal attach method is C<appliance>, where a small appliance is created "
2284 "containing the daemon, and then the library connects to this."
2288 #: ../src/guestfs.pod:993
2290 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
2291 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
2292 "daemon over the Unix domain socket."
2296 #: ../src/guestfs.pod:997
2298 "The normal use for this is to connect to a running virtual machine that "
2299 "contains a C<guestfsd> daemon, and send commands so you can read and write "
2300 "files inside the live virtual machine."
2304 #: ../src/guestfs.pod:1001
2305 msgid "Using guestfs_add_domain with live flag"
2309 #: ../src/guestfs.pod:1003
2311 "L</guestfs_add_domain> provides some help for getting the correct attach "
2312 "method. If you pass the C<live> option to this function, then (if the "
2313 "virtual machine is running) it will examine the libvirt XML looking for a "
2314 "virtio-serial channel to connect to:"
2318 #: ../src/guestfs.pod:1009
2325 " <channel type='unix'>\n"
2326 " <source mode='bind' path='/path/to/socket'/>\n"
2327 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
2336 #: ../src/guestfs.pod:1021
2338 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
2339 "method to C<unix:/path/to/socket>."
2343 #: ../src/guestfs.pod:1024
2345 "Some of the libguestfs tools (including guestfish) support a I<--live> "
2346 "option which is passed through to L</guestfs_add_domain> thus allowing you "
2347 "to attach to and modify live virtual machines."
2351 #: ../src/guestfs.pod:1028
2353 "The virtual machine needs to have been set up beforehand so that it has the "
2354 "virtio-serial channel and so that guestfsd is running inside it."
2359 #: ../src/guestfs.pod:1032
2360 msgid "ABI GUARANTEE"
2365 #: ../src/guestfs.pod:1034
2367 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
2368 "actions as outlined in this section. Although we will deprecate some "
2369 "actions, for example if they get replaced by newer calls, we will keep the "
2370 "old actions forever. This allows you the developer to program in confidence "
2371 "against the libguestfs API."
2376 #: ../src/guestfs.pod:1040
2377 msgid "BLOCK DEVICE NAMING"
2382 #: ../src/guestfs.pod:1042
2384 "In the kernel there is now quite a profusion of schemata for naming block "
2385 "devices (in this context, by I<block device> I mean a physical or virtual "
2386 "hard drive). The original Linux IDE driver used names starting with C</dev/"
2387 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
2388 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
2389 "for the old IDE driver (particularly for SATA devices) those devices also "
2390 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
2391 "paravirtualized drivers. This has created several different naming systems, "
2392 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
2397 #: ../src/guestfs.pod:1054
2399 "As discussed above, libguestfs uses a qemu appliance running an embedded "
2400 "Linux kernel to access block devices. We can run a variety of appliances "
2401 "based on a variety of Linux kernels."
2406 #: ../src/guestfs.pod:1058
2408 "This causes a problem for libguestfs because many API calls use device or "
2409 "partition names. Working scripts and the recipe (example) scripts that we "
2410 "make available over the internet could fail if the naming scheme changes."
2415 #: ../src/guestfs.pod:1063
2417 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
2418 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
2419 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
2420 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
2425 #: ../src/guestfs.pod:1069
2427 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
2428 "L</guestfs_list_partitions> and similar calls return the true names of the "
2429 "devices and partitions as known to the appliance."
2434 #: ../src/guestfs.pod:1074
2435 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
2440 #: ../src/guestfs.pod:1076
2442 "Usually this translation is transparent. However in some (very rare) cases "
2443 "you may need to know the exact algorithm. Such cases include where you use "
2444 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
2445 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
2450 #: ../src/guestfs.pod:1082
2452 "The algorithm is applied only to I<parameters> which are known to be either "
2453 "device or partition names. Return values from functions such as L</"
2454 "guestfs_list_devices> are never changed."
2459 #: ../src/guestfs.pod:1090
2460 msgid "Is the string a parameter which is a device or partition name?"
2465 #: ../src/guestfs.pod:1094
2466 msgid "Does the string begin with C</dev/sd>?"
2471 #: ../src/guestfs.pod:1098
2473 "Does the named device exist? If so, we use that device. However if I<not> "
2474 "then we continue with this algorithm."
2479 #: ../src/guestfs.pod:1103
2480 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
2485 #: ../src/guestfs.pod:1105
2486 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
2491 #: ../src/guestfs.pod:1107
2492 msgid "If that named device exists, use it. If not, continue."
2497 #: ../src/guestfs.pod:1111
2498 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
2503 #: ../src/guestfs.pod:1113
2504 msgid "If that named device exists, use it. If not, return an error."
2509 #: ../src/guestfs.pod:1117
2510 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
2515 #: ../src/guestfs.pod:1119
2517 "Although the standard naming scheme and automatic translation is useful for "
2518 "simple programs and guestfish scripts, for larger programs it is best not to "
2519 "rely on this mechanism."
2524 #: ../src/guestfs.pod:1123
2526 "Where possible for maximum future portability programs using libguestfs "
2527 "should use these future-proof techniques:"
2532 #: ../src/guestfs.pod:1130
2534 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2535 "device names, and then use those names directly."
2540 #: ../src/guestfs.pod:1133
2542 "Since those device names exist by definition, they will never be translated."
2547 #: ../src/guestfs.pod:1138
2549 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2550 "filesystem labels."
2555 #: ../src/guestfs.pod:1143
2561 #: ../src/guestfs.pod:1145
2563 "This section discusses security implications of using libguestfs, "
2564 "particularly with untrusted or malicious guests or disk images."
2569 #: ../src/guestfs.pod:1148
2570 msgid "GENERAL SECURITY CONSIDERATIONS"
2575 #: ../src/guestfs.pod:1150
2577 "Be careful with any files or data that you download from a guest (by "
2578 "\"download\" we mean not just the L</guestfs_download> command but any "
2579 "command that reads files, filenames, directories or anything else from a "
2580 "disk image). An attacker could manipulate the data to fool your program "
2581 "into doing the wrong thing. Consider cases such as:"
2586 #: ../src/guestfs.pod:1160
2587 msgid "the data (file etc) not being present"
2592 #: ../src/guestfs.pod:1164
2593 msgid "being present but empty"
2598 #: ../src/guestfs.pod:1168
2599 msgid "being much larger than normal"
2604 #: ../src/guestfs.pod:1172
2605 msgid "containing arbitrary 8 bit data"
2610 #: ../src/guestfs.pod:1176
2611 msgid "being in an unexpected character encoding"
2616 #: ../src/guestfs.pod:1180
2617 msgid "containing homoglyphs."
2622 #: ../src/guestfs.pod:1184
2623 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2628 #: ../src/guestfs.pod:1186
2630 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2631 "(VFS) module can sometimes be escalated into exploits by deliberately "
2632 "creating a malicious, malformed filesystem. These exploits are very severe "
2633 "for two reasons. Firstly there are very many filesystem drivers in the "
2634 "kernel, and many of them are infrequently used and not much developer "
2635 "attention has been paid to the code. Linux userspace helps potential "
2636 "crackers by detecting the filesystem type and automatically choosing the "
2637 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2638 "the administrator. Secondly, a kernel-level exploit is like a local root "
2639 "exploit (worse in some ways), giving immediate and total access to the "
2640 "system right down to the hardware level."
2645 #: ../src/guestfs.pod:1199
2647 "That explains why you should never mount a filesystem from an untrusted "
2648 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2649 "inside a qemu virtual machine, usually running as a non-root user. The "
2650 "attacker would need to write a filesystem which first exploited the kernel, "
2651 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2652 "the libguestfs protocol, and finally to be as serious as the host kernel "
2653 "exploit it would need to escalate its privileges to root. This multi-step "
2654 "escalation, performed by a static piece of data, is thought to be extremely "
2655 "hard to do, although we never say 'never' about security issues."
2660 #: ../src/guestfs.pod:1210
2662 "In any case callers can reduce the attack surface by forcing the filesystem "
2663 "type when mounting (use L</guestfs_mount_vfs>)."
2668 #: ../src/guestfs.pod:1213
2669 msgid "PROTOCOL SECURITY"
2674 #: ../src/guestfs.pod:1215
2676 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2677 "defined upper message size. However a program that uses libguestfs must "
2678 "also take care - for example you can write a program that downloads a binary "
2679 "from a disk image and executes it locally, and no amount of protocol "
2680 "security will save you from the consequences."
2685 #: ../src/guestfs.pod:1221
2686 msgid "INSPECTION SECURITY"
2691 #: ../src/guestfs.pod:1223
2693 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2694 "directly from the guest, and these could contain any 8 bit data. Callers "
2695 "should be careful to escape these before printing them to a structured file "
2696 "(for example, use HTML escaping if creating a web page)."
2701 #: ../src/guestfs.pod:1229
2703 "Guest configuration may be altered in unusual ways by the administrator of "
2704 "the virtual machine, and may not reflect reality (particularly for untrusted "
2705 "or actively malicious guests). For example we parse the hostname from "
2706 "configuration files like C</etc/sysconfig/network> that we find in the "
2707 "guest, but the guest administrator can easily manipulate these files to "
2708 "provide the wrong hostname."
2713 #: ../src/guestfs.pod:1237
2715 "The inspection API parses guest configuration using two external libraries: "
2716 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2717 "designed to be robust in the face of malicious data, although denial of "
2718 "service attacks are still possible, for example with oversized configuration "
2724 #: ../src/guestfs.pod:1243
2725 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2730 #: ../src/guestfs.pod:1245
2732 "Be very cautious about running commands from the guest. By running a "
2733 "command in the guest, you are giving CPU time to a binary that you do not "
2734 "control, under the same user account as the library, albeit wrapped in qemu "
2735 "virtualization. More information and alternatives can be found in the "
2736 "section L</RUNNING COMMANDS>."
2741 #: ../src/guestfs.pod:1251
2742 msgid "CVE-2010-3851"
2747 #: ../src/guestfs.pod:1253
2748 msgid "https://bugzilla.redhat.com/642934"
2753 #: ../src/guestfs.pod:1255
2755 "This security bug concerns the automatic disk format detection that qemu "
2756 "does on disk images."
2761 #: ../src/guestfs.pod:1258
2763 "A raw disk image is just the raw bytes, there is no header. Other disk "
2764 "images like qcow2 contain a special header. Qemu deals with this by looking "
2765 "for one of the known headers, and if none is found then assuming the disk "
2766 "image must be raw."
2771 #: ../src/guestfs.pod:1263
2773 "This allows a guest which has been given a raw disk image to write some "
2774 "other header. At next boot (or when the disk image is accessed by "
2775 "libguestfs) qemu would do autodetection and think the disk image format was, "
2776 "say, qcow2 based on the header written by the guest."
2781 #: ../src/guestfs.pod:1268
2783 "This in itself would not be a problem, but qcow2 offers many features, one "
2784 "of which is to allow a disk image to refer to another image (called the "
2785 "\"backing disk\"). It does this by placing the path to the backing disk "
2786 "into the qcow2 header. This path is not validated and could point to any "
2787 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2788 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2789 "control of the attacker."
2794 #: ../src/guestfs.pod:1276
2796 "In libguestfs this is rather hard to exploit except under two circumstances:"
2801 #: ../src/guestfs.pod:1283
2802 msgid "You have enabled the network or have opened the disk in write mode."
2807 #: ../src/guestfs.pod:1287
2809 "You are also running untrusted code from the guest (see L</RUNNING "
2815 #: ../src/guestfs.pod:1292
2817 "The way to avoid this is to specify the expected disk format when adding "
2818 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2819 "should always do this if the disk is raw format, and it's a good idea for "
2825 #: ../src/guestfs.pod:1297
2827 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2828 "format is fetched from libvirt and passed through."
2833 #: ../src/guestfs.pod:1300
2835 "For libguestfs tools, use the I<--format> command line parameter as "
2841 #: ../src/guestfs.pod:1303
2842 msgid "CONNECTION MANAGEMENT"
2847 #: ../src/guestfs.pod:1305
2853 #: ../src/guestfs.pod:1307
2855 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2856 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2857 "handle and release all resources used."
2862 #: ../src/guestfs.pod:1311
2864 "For information on using multiple handles and threads, see the section L</"
2865 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2870 #: ../src/guestfs.pod:1314
2871 msgid "guestfs_create"
2876 #: ../src/guestfs.pod:1316
2879 " guestfs_h *guestfs_create (void);\n"
2885 #: ../src/guestfs.pod:1318
2886 msgid "Create a connection handle."
2891 #: ../src/guestfs.pod:1320
2893 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2894 "on the handle at least once."
2899 #: ../src/guestfs.pod:1323
2901 "This function returns a non-NULL pointer to a handle on success or NULL on "
2907 #: ../src/guestfs.pod:1326
2908 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2913 #: ../src/guestfs.pod:1328
2915 "You may also want to configure error handling for the handle. See L</ERROR "
2916 "HANDLING> section below."
2921 #: ../src/guestfs.pod:1331
2922 msgid "guestfs_close"
2927 #: ../src/guestfs.pod:1333
2930 " void guestfs_close (guestfs_h *g);\n"
2936 #: ../src/guestfs.pod:1335
2937 msgid "This closes the connection handle and frees up all resources used."
2942 #: ../src/guestfs.pod:1337
2943 msgid "ERROR HANDLING"
2948 #: ../src/guestfs.pod:1339
2950 "API functions can return errors. For example, almost all functions that "
2951 "return C<int> will return C<-1> to indicate an error."
2956 #: ../src/guestfs.pod:1342
2958 "Additional information is available for errors: an error message string and "
2959 "optionally an error number (errno) if the thing that failed was a system "
2965 #: ../src/guestfs.pod:1346
2967 "You can get at the additional information about the last error on the handle "
2968 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2969 "up an error handler with L</guestfs_set_error_handler>."
2974 #: ../src/guestfs.pod:1351
2976 "When the handle is created, a default error handler is installed which "
2977 "prints the error message string to C<stderr>. For small short-running "
2978 "command line programs it is sufficient to do:"
2983 #: ../src/guestfs.pod:1355
2986 " if (guestfs_launch (g) == -1)\n"
2987 " exit (EXIT_FAILURE);\n"
2993 #: ../src/guestfs.pod:1358
2995 "since the default error handler will ensure that an error message has been "
2996 "printed to C<stderr> before the program exits."
3001 #: ../src/guestfs.pod:1361
3003 "For other programs the caller will almost certainly want to install an "
3004 "alternate error handler or do error handling in-line like this:"
3009 #: ../src/guestfs.pod:1364
3012 " g = guestfs_create ();\n"
3018 #: ../src/guestfs.pod:1366
3021 " /* This disables the default behaviour of printing errors\n"
3023 " guestfs_set_error_handler (g, NULL, NULL);\n"
3029 #: ../src/guestfs.pod:1370
3032 " if (guestfs_launch (g) == -1) {\n"
3033 " /* Examine the error message and print it etc. */\n"
3034 " char *msg = guestfs_last_error (g);\n"
3035 " int errnum = guestfs_last_errno (g);\n"
3036 " fprintf (stderr, \"%s\\n\", msg);\n"
3044 #: ../src/guestfs.pod:1378
3046 "Out of memory errors are handled differently. The default action is to call "
3047 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
3048 "guestfs_set_out_of_memory_handler>."
3053 #: ../src/guestfs.pod:1382
3055 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
3056 "because there is no handle if this happens there is no way to get additional "
3057 "error information. However L</guestfs_create> is supposed to be a "
3058 "lightweight operation which can only fail because of insufficient memory (it "
3059 "returns NULL in this case)."
3064 #: ../src/guestfs.pod:1388
3065 msgid "guestfs_last_error"
3070 #: ../src/guestfs.pod:1390
3073 " const char *guestfs_last_error (guestfs_h *g);\n"
3079 #: ../src/guestfs.pod:1392
3081 "This returns the last error message that happened on C<g>. If there has not "
3082 "been an error since the handle was created, then this returns C<NULL>."
3087 #: ../src/guestfs.pod:1396
3089 "The lifetime of the returned string is until the next error occurs, or L</"
3090 "guestfs_close> is called."
3095 #: ../src/guestfs.pod:1399
3096 msgid "guestfs_last_errno"
3101 #: ../src/guestfs.pod:1401
3104 " int guestfs_last_errno (guestfs_h *g);\n"
3110 #: ../src/guestfs.pod:1403
3111 msgid "This returns the last error number (errno) that happened on C<g>."
3116 #: ../src/guestfs.pod:1405
3117 msgid "If successful, an errno integer not equal to zero is returned."
3122 #: ../src/guestfs.pod:1407
3124 "If no error, this returns 0. This call can return 0 in three situations:"
3129 #: ../src/guestfs.pod:1414
3130 msgid "There has not been any error on the handle."
3135 #: ../src/guestfs.pod:1418
3137 "There has been an error but the errno was meaningless. This corresponds to "
3138 "the case where the error did not come from a failed system call, but for "
3139 "some other reason."
3144 #: ../src/guestfs.pod:1424
3146 "There was an error from a failed system call, but for some reason the errno "
3147 "was not captured and returned. This usually indicates a bug in libguestfs."
3152 #: ../src/guestfs.pod:1430
3154 "Libguestfs tries to convert the errno from inside the applicance into a "
3155 "corresponding errno for the caller (not entirely trivial: the appliance "
3156 "might be running a completely different operating system from the library "
3157 "and error numbers are not standardized across Un*xen). If this could not be "
3158 "done, then the error is translated to C<EINVAL>. In practice this should "
3159 "only happen in very rare circumstances."
3164 #: ../src/guestfs.pod:1438
3165 msgid "guestfs_set_error_handler"
3170 #: ../src/guestfs.pod:1440
3173 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
3175 " const char *msg);\n"
3176 " void guestfs_set_error_handler (guestfs_h *g,\n"
3177 " guestfs_error_handler_cb cb,\n"
3184 #: ../src/guestfs.pod:1447
3186 "The callback C<cb> will be called if there is an error. The parameters "
3187 "passed to the callback are an opaque data pointer and the error message "
3193 #: ../src/guestfs.pod:1451
3195 "C<errno> is not passed to the callback. To get that the callback must call "
3196 "L</guestfs_last_errno>."
3201 #: ../src/guestfs.pod:1454
3203 "Note that the message string C<msg> is freed as soon as the callback "
3204 "function returns, so if you want to stash it somewhere you must make your "
3210 #: ../src/guestfs.pod:1458
3211 msgid "The default handler prints messages on C<stderr>."
3216 #: ../src/guestfs.pod:1460
3217 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
3222 #: ../src/guestfs.pod:1462
3223 msgid "guestfs_get_error_handler"
3228 #: ../src/guestfs.pod:1464
3231 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
3232 " void **opaque_rtn);\n"
3238 #: ../src/guestfs.pod:1467
3239 msgid "Returns the current error handler callback."
3244 #: ../src/guestfs.pod:1469
3245 msgid "guestfs_set_out_of_memory_handler"
3250 #: ../src/guestfs.pod:1471
3253 " typedef void (*guestfs_abort_cb) (void);\n"
3254 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
3255 " guestfs_abort_cb);\n"
3261 #: ../src/guestfs.pod:1475
3263 "The callback C<cb> will be called if there is an out of memory situation. "
3264 "I<Note this callback must not return>."
3269 #: ../src/guestfs.pod:1478
3270 msgid "The default is to call L<abort(3)>."
3275 #: ../src/guestfs.pod:1480
3277 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
3282 #: ../src/guestfs.pod:1483
3283 msgid "guestfs_get_out_of_memory_handler"
3288 #: ../src/guestfs.pod:1485
3291 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
3297 #: ../src/guestfs.pod:1487
3298 msgid "This returns the current out of memory handler."
3303 #: ../src/guestfs.pod:1489
3309 #: ../src/guestfs.pod:1491 ../fish/guestfish.pod:998
3315 #: ../src/guestfs.pod:1493
3321 #: ../src/guestfs.pod:1495
3327 #: ../src/guestfs.pod:1497
3328 msgid "AVAILABILITY"
3333 #: ../src/guestfs.pod:1499
3334 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
3339 #: ../src/guestfs.pod:1501
3341 "Using L</guestfs_available> you can test availability of the following "
3342 "groups of functions. This test queries the appliance to see if the "
3343 "appliance you are currently using supports the functionality."
3348 #: ../src/guestfs.pod:1506
3349 msgid "@AVAILABILITY@"
3354 #: ../src/guestfs.pod:1508
3355 msgid "GUESTFISH supported COMMAND"
3360 #: ../src/guestfs.pod:1510
3362 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
3363 "prints out the available groups and whether they are supported by this build "
3364 "of libguestfs. Note however that you have to do C<run> first."
3369 #: ../src/guestfs.pod:1515
3370 msgid "SINGLE CALLS AT COMPILE TIME"
3375 #: ../src/guestfs.pod:1517
3377 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
3378 "function, such as:"
3383 #: ../src/guestfs.pod:1520
3386 " #define LIBGUESTFS_HAVE_DD 1\n"
3392 #: ../src/guestfs.pod:1522
3393 msgid "if L</guestfs_dd> is available."
3398 #: ../src/guestfs.pod:1524
3400 "Before version 1.5.8, if you needed to test whether a single libguestfs "
3401 "function is available at compile time, we recommended using build tools such "
3402 "as autoconf or cmake. For example in autotools you could use:"
3407 #: ../src/guestfs.pod:1529
3410 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
3411 " AC_CHECK_FUNCS([guestfs_dd])\n"
3417 #: ../src/guestfs.pod:1532
3419 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
3425 #: ../src/guestfs.pod:1535
3426 msgid "SINGLE CALLS AT RUN TIME"
3431 #: ../src/guestfs.pod:1537
3433 "Testing at compile time doesn't guarantee that a function really exists in "
3434 "the library. The reason is that you might be dynamically linked against a "
3435 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
3436 "This situation unfortunately results in a segmentation fault, which is a "
3437 "shortcoming of the C dynamic linking system itself."
3442 #: ../src/guestfs.pod:1544
3444 "You can use L<dlopen(3)> to test if a function is available at run time, as "
3445 "in this example program (note that you still need the compile time check as "
3451 #: ../src/guestfs.pod:1548
3454 " #include <stdio.h>\n"
3455 " #include <stdlib.h>\n"
3456 " #include <unistd.h>\n"
3457 " #include <dlfcn.h>\n"
3458 " #include <guestfs.h>\n"
3464 #: ../src/guestfs.pod:1554
3469 " #ifdef LIBGUESTFS_HAVE_DD\n"
3471 " int has_function;\n"
3477 #: ../src/guestfs.pod:1560
3480 " /* Test if the function guestfs_dd is really available. */\n"
3481 " dl = dlopen (NULL, RTLD_LAZY);\n"
3483 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
3484 " exit (EXIT_FAILURE);\n"
3486 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
3493 #: ../src/guestfs.pod:1569
3496 " if (!has_function)\n"
3497 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
3499 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
3500 " /* Now it's safe to call\n"
3501 " guestfs_dd (g, \"foo\", \"bar\");\n"
3505 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
3513 #: ../src/guestfs.pod:1582
3515 "You may think the above is an awful lot of hassle, and it is. There are "
3516 "other ways outside of the C linking system to ensure that this kind of "
3517 "incompatibility never arises, such as using package versioning:"
3522 #: ../src/guestfs.pod:1587
3525 " Requires: libguestfs >= 1.0.80\n"
3531 #: ../src/guestfs.pod:1589
3532 msgid "CALLS WITH OPTIONAL ARGUMENTS"
3537 #: ../src/guestfs.pod:1591
3539 "A recent feature of the API is the introduction of calls which take optional "
3540 "arguments. In C these are declared 3 ways. The main way is as a call which "
3541 "takes variable arguments (ie. C<...>), as in this example:"
3546 #: ../src/guestfs.pod:1596
3549 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
3555 #: ../src/guestfs.pod:1598
3557 "Call this with a list of optional arguments, terminated by C<-1>. So to "
3558 "call with no optional arguments specified:"
3563 #: ../src/guestfs.pod:1601
3566 " guestfs_add_drive_opts (g, filename, -1);\n"
3572 #: ../src/guestfs.pod:1603
3573 msgid "With a single optional argument:"
3578 #: ../src/guestfs.pod:1605
3581 " guestfs_add_drive_opts (g, filename,\n"
3582 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3589 #: ../src/guestfs.pod:1609
3595 #: ../src/guestfs.pod:1611
3598 " guestfs_add_drive_opts (g, filename,\n"
3599 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
3600 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
3607 #: ../src/guestfs.pod:1616
3609 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
3615 #: ../src/guestfs.pod:1619
3616 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
3621 #: ../src/guestfs.pod:1621
3623 "The second variant has the same name with the suffix C<_va>, which works the "
3624 "same way but takes a C<va_list>. See the C manual for details. For the "
3625 "example function, this is declared:"
3630 #: ../src/guestfs.pod:1625
3633 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
3640 #: ../src/guestfs.pod:1628
3641 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
3646 #: ../src/guestfs.pod:1630
3648 "The third variant is useful where you need to construct these calls. You "
3649 "pass in a structure where you fill in the optional fields. The structure "
3650 "has a bitmask as the first element which you must set to indicate which "
3651 "fields you have filled in. For our example function the structure and call "
3657 #: ../src/guestfs.pod:1636
3660 " struct guestfs_add_drive_opts_argv {\n"
3661 " uint64_t bitmask;\n"
3663 " const char *format;\n"
3666 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3667 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3673 #: ../src/guestfs.pod:1645
3674 msgid "You could call it like this:"
3679 #: ../src/guestfs.pod:1647
3682 " struct guestfs_add_drive_opts_argv optargs = {\n"
3683 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3684 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3686 " .format = \"qcow2\"\n"
3693 #: ../src/guestfs.pod:1654
3696 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3702 #: ../src/guestfs.pod:1656 ../src/guestfs-actions.pod:11
3703 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:9
3704 #: ../fish/guestfish-actions.pod:1260 ../tools/virt-win-reg.pl:532
3710 #: ../src/guestfs.pod:1662
3711 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3716 #: ../src/guestfs.pod:1667
3717 msgid "You do not need to fill in all fields of the structure."
3722 #: ../src/guestfs.pod:1671
3724 "There must be a one-to-one correspondence between fields of the structure "
3725 "that are filled in, and bits set in the bitmask."
3730 #: ../src/guestfs.pod:1676
3731 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3736 #: ../src/guestfs.pod:1678
3738 "In other languages, optional arguments are expressed in the way that is "
3739 "natural for that language. We refer you to the language-specific "
3740 "documentation for more details on that."
3745 #: ../src/guestfs.pod:1682
3746 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3751 #: ../src/guestfs.pod:1684
3752 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3756 #: ../src/guestfs.pod:1686
3758 "B<Note:> This section documents the generic event mechanism introduced in "
3759 "libguestfs 1.10, which you should use in new code if possible. The old "
3760 "functions C<guestfs_set_log_message_callback>, "
3761 "C<guestfs_set_subprocess_quit_callback>, "
3762 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
3763 "C<guestfs_set_progress_callback> are no longer documented in this manual "
3768 #: ../src/guestfs.pod:1694
3770 "Handles generate events when certain things happen, such as log messages "
3771 "being generated, progress messages during long-running operations, or the "
3772 "handle being closed. The API calls described below let you register a "
3773 "callback to be called when events happen. You can register multiple "
3774 "callbacks (for the same, different or overlapping sets of events), and "
3775 "individually remove callbacks. If callbacks are not removed, then they "
3776 "remain in force until the handle is closed."
3780 #: ../src/guestfs.pod:1702
3782 "In the current implementation, events are only generated synchronously: that "
3783 "means that events (and hence callbacks) can only happen while you are in the "
3784 "middle of making another libguestfs call. The callback is called in the "
3789 #: ../src/guestfs.pod:1707
3791 "Events may contain a payload, usually nothing (void), an array of 64 bit "
3792 "unsigned integers, or a message buffer. Payloads are discussed later on."
3796 #: ../src/guestfs.pod:1711
3797 msgid "CLASSES OF EVENTS"
3801 #: ../src/guestfs.pod:1715
3802 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
3806 #: ../src/guestfs.pod:1718
3808 "The callback function will be called while the handle is being closed "
3809 "(synchronously from L</guestfs_close>)."
3814 #: ../src/guestfs.pod:1721
3816 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3817 "handles that are open when the program exits. This means that this callback "
3818 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3819 "problems in higher-level languages (eg. if your HLL interpreter has already "
3820 "been cleaned up by the time this is called, and if your callback then jumps "
3821 "into some HLL function)."
3825 #: ../src/guestfs.pod:1728
3827 "If no callback is registered: the handle is closed without any callback "
3832 #: ../src/guestfs.pod:1731
3833 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
3837 #: ../src/guestfs.pod:1734
3839 "The callback function will be called when the child process quits, either "
3840 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3841 "corresponds to a transition from any state to the CONFIG state)."
3845 #: ../src/guestfs.pod:1738 ../src/guestfs.pod:1747
3846 msgid "If no callback is registered: the event is ignored."
3850 #: ../src/guestfs.pod:1740
3851 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
3855 #: ../src/guestfs.pod:1743
3857 "The callback function will be called when the child process becomes ready "
3858 "first time after it has been launched. (This corresponds to a transition "
3859 "from LAUNCHING to the READY state)."
3863 #: ../src/guestfs.pod:1749
3864 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
3869 #: ../src/guestfs.pod:1752
3871 "Some long-running operations can generate progress messages. If this "
3872 "callback is registered, then it will be called each time a progress message "
3873 "is generated (usually two seconds after the operation started, and three "
3874 "times per second thereafter until it completes, although the frequency may "
3875 "change in future versions)."
3879 #: ../src/guestfs.pod:1758
3881 "The callback receives in the payload four unsigned 64 bit numbers which are "
3882 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
3886 #: ../src/guestfs.pod:1761
3888 "The units of C<total> are not defined, although for some operations C<total> "
3889 "may relate in some way to the amount of data to be transferred (eg. in bytes "
3890 "or megabytes), and C<position> may be the portion which has been transferred."
3895 #: ../src/guestfs.pod:1766
3896 msgid "The only defined and stable parts of the API are:"
3901 #: ../src/guestfs.pod:1772
3903 "The callback can display to the user some type of progress bar or indicator "
3904 "which shows the ratio of C<position>:C<total>."
3909 #: ../src/guestfs.pod:1777
3910 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3915 #: ../src/guestfs.pod:1781
3917 "If any progress notification is sent during a call, then a final progress "
3918 "notification is always sent when C<position> = C<total>."
3923 #: ../src/guestfs.pod:1784
3925 "This is to simplify caller code, so callers can easily set the progress "
3926 "indicator to \"100%\" at the end of the operation, without requiring special "
3927 "code to detect this case."
3931 #: ../src/guestfs.pod:1790
3933 "The callback also receives the procedure number (C<proc_nr>) and serial "
3934 "number (C<serial>) of the call. These are only useful for debugging "
3935 "protocol issues, and the callback can normally ignore them. The callback "
3936 "may want to print these numbers in error messages or debugging messages."
3940 #: ../src/guestfs.pod:1796
3941 msgid "If no callback is registered: progress messages are discarded."
3945 #: ../src/guestfs.pod:1798
3946 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
3950 #: ../src/guestfs.pod:1801
3952 "The callback function is called whenever a log message is generated by qemu, "
3953 "the appliance kernel, guestfsd (daemon), or utility programs."
3957 #: ../src/guestfs.pod:1804
3959 "If the verbose flag (L</guestfs_set_verbose>) is set before launch (L</"
3960 "guestfs_launch>) then additional debug messages are generated."
3964 #: ../src/guestfs.pod:1807 ../src/guestfs.pod:1821
3966 "If no callback is registered: the messages are discarded unless the verbose "
3967 "flag is set in which case they are sent to stderr. You can override the "
3968 "printing of verbose messages to stderr by setting up a callback."
3972 #: ../src/guestfs.pod:1812
3973 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
3977 #: ../src/guestfs.pod:1815
3979 "The callback function is called whenever a log message is generated by the "
3980 "library part of libguestfs."
3984 #: ../src/guestfs.pod:1818
3986 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
3987 "messages are generated."
3991 #: ../src/guestfs.pod:1826
3992 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
3996 #: ../src/guestfs.pod:1829
3998 "The callback function is called whenever a trace message is generated. This "
3999 "only applies if the trace flag (L</guestfs_set_trace>) is set."
4003 #: ../src/guestfs.pod:1832
4005 "If no callback is registered: the messages are sent to stderr. You can "
4006 "override the printing of trace messages to stderr by setting up a callback."
4010 #: ../src/guestfs.pod:1838
4011 msgid "guestfs_set_event_callback"
4015 #: ../src/guestfs.pod:1840
4018 " int guestfs_set_event_callback (guestfs_h *g,\n"
4019 " guestfs_event_callback cb,\n"
4020 " uint64_t event_bitmask,\n"
4027 #: ../src/guestfs.pod:1846
4029 "This function registers a callback (C<cb>) for all event classes in the "
4034 #: ../src/guestfs.pod:1849
4036 "For example, to register for all log message events, you could call this "
4037 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
4038 "To register a single callback for all possible classes of events, use "
4039 "C<GUESTFS_EVENT_ALL>."
4043 #: ../src/guestfs.pod:1855
4044 msgid "C<flags> should always be passed as 0."
4048 #: ../src/guestfs.pod:1857
4050 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
4051 "it for any purpose."
4055 #: ../src/guestfs.pod:1860
4057 "The return value is the event handle (an integer) which you can use to "
4058 "delete the callback (see below)."
4062 #: ../src/guestfs.pod:1863
4064 "If there is an error, this function returns C<-1>, and sets the error in the "
4065 "handle in the usual way (see L</guestfs_last_error> etc.)"
4069 #: ../src/guestfs.pod:1866
4071 "Callbacks remain in effect until they are deleted, or until the handle is "
4076 #: ../src/guestfs.pod:1869
4078 "In the case where multiple callbacks are registered for a particular event "
4079 "class, all of the callbacks are called. The order in which multiple "
4080 "callbacks are called is not defined."
4084 #: ../src/guestfs.pod:1873
4085 msgid "guestfs_delete_event_callback"
4089 #: ../src/guestfs.pod:1875
4092 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
4097 #: ../src/guestfs.pod:1877
4099 "Delete a callback that was previously registered. C<event_handle> should be "
4100 "the integer that was returned by a previous call to "
4101 "C<guestfs_set_event_callback> on the same handle."
4105 #: ../src/guestfs.pod:1881
4106 msgid "guestfs_event_callback"
4110 #: ../src/guestfs.pod:1883
4113 " typedef void (*guestfs_event_callback) (\n"
4116 " uint64_t event,\n"
4117 " int event_handle,\n"
4119 " const char *buf, size_t buf_len,\n"
4120 " const uint64_t *array, size_t array_len);\n"
4125 #: ../src/guestfs.pod:1892
4127 "This is the type of the event callback function that you have to provide."
4131 #: ../src/guestfs.pod:1895
4133 "The basic parameters are: the handle (C<g>), the opaque user pointer "
4134 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
4135 "handle, and C<flags> which in the current API you should ignore."
4139 #: ../src/guestfs.pod:1899
4141 "The remaining parameters contain the event payload (if any). Each event may "
4142 "contain a payload, which usually relates to the event class, but for future "
4143 "proofing your code should be written to handle any payload for any event "
4148 #: ../src/guestfs.pod:1904
4150 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
4151 "there is no message buffer). Note that this message buffer can contain "
4152 "arbitrary 8 bit data, including NUL bytes."
4156 #: ../src/guestfs.pod:1908
4158 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
4159 "moment this is only used for progress messages."
4163 #: ../src/guestfs.pod:1911
4164 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
4168 #: ../src/guestfs.pod:1913
4170 "One motivation for the generic event API was to allow GUI programs to "
4171 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
4172 "unconditionally to C<stderr>."
4176 #: ../src/guestfs.pod:1917
4178 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
4179 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
4180 "messages are not events; you must capture error messages separately)."
4184 #: ../src/guestfs.pod:1922
4186 "Programs have to set up a callback to capture the classes of events of "
4191 #: ../src/guestfs.pod:1925
4195 " guestfs_set_event_callback\n"
4196 " (g, message_callback,\n"
4197 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
4198 " GUESTFS_EVENT_TRACE,\n"
4199 " 0, NULL) == -1)\n"
4200 " if (eh == -1) {\n"
4201 " // handle error in the usual way\n"
4207 #: ../src/guestfs.pod:1935
4209 "The callback can then direct messages to the appropriate place. In this "
4210 "example, messages are directed to syslog:"
4214 #: ../src/guestfs.pod:1938
4218 " message_callback (\n"
4221 " uint64_t event,\n"
4222 " int event_handle,\n"
4224 " const char *buf, size_t buf_len,\n"
4225 " const uint64_t *array, size_t array_len)\n"
4227 " const int priority = LOG_USER|LOG_INFO;\n"
4228 " if (buf_len > 0)\n"
4229 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
4236 #: ../src/guestfs.pod:1953
4237 msgid "PRIVATE DATA AREA"
4241 #: ../src/guestfs.pod:1955
4243 "You can attach named pieces of private data to the libguestfs handle, fetch "
4244 "them by name, and walk over them, for the lifetime of the handle. This is "
4245 "called the private data area and is only available from the C API."
4250 #: ../src/guestfs.pod:1960
4251 msgid "To attach a named piece of data, use the following call:"
4256 #: ../src/guestfs.pod:1962
4259 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
4265 #: ../src/guestfs.pod:1964
4267 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
4268 "pointer (which can be C<NULL>). Any previous item with the same name is "
4274 #: ../src/guestfs.pod:1968
4276 "You can use any C<key> you want, but names beginning with an underscore "
4277 "character are reserved for internal libguestfs purposes (for implementing "
4278 "language bindings). It is recommended to prefix the name with some unique "
4279 "string to avoid collisions with other users."
4284 #: ../src/guestfs.pod:1973
4285 msgid "To retrieve the pointer, use:"
4290 #: ../src/guestfs.pod:1975
4293 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
4299 #: ../src/guestfs.pod:1977
4301 "This function returns C<NULL> if either no data is found associated with "
4302 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
4307 #: ../src/guestfs.pod:1981
4309 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
4310 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
4311 "all. In particular, libguestfs does I<not> try to free the data when the "
4312 "handle is closed. If the data must be freed, then the caller must either "
4313 "free it before calling L</guestfs_close> or must set up a close callback to "
4314 "do it (see L</GUESTFS_EVENT_CLOSE>)."
4318 #: ../src/guestfs.pod:1988
4319 msgid "To walk over all entries, use these two functions:"
4323 #: ../src/guestfs.pod:1990
4326 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
4331 #: ../src/guestfs.pod:1992
4334 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
4339 #: ../src/guestfs.pod:1994
4341 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
4342 "not have any particular meaning -- keys are not returned in any defined "
4343 "order). A pointer to the key is returned in C<*key_rtn> and the "
4344 "corresponding data pointer is returned from the function. C<NULL> is "
4345 "returned if there are no keys stored in the handle."
4349 #: ../src/guestfs.pod:2000
4351 "C<guestfs_next_private> returns the next key, pointer pair. The return "
4352 "value of this function is also C<NULL> is there are no further entries to "
4357 #: ../src/guestfs.pod:2004
4358 msgid "Notes about walking over entries:"
4362 #: ../src/guestfs.pod:2010
4364 "You must not call C<guestfs_set_private> while walking over the entries."
4368 #: ../src/guestfs.pod:2015
4370 "The handle maintains an internal iterator which is reset when you call "
4371 "C<guestfs_first_private>. This internal iterator is invalidated when you "
4372 "call C<guestfs_set_private>."
4376 #: ../src/guestfs.pod:2021
4377 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
4381 #: ../src/guestfs.pod:2023
4384 " guestfs_set_private (g, key, NULL);\n"
4389 #: ../src/guestfs.pod:2025
4390 msgid "then that C<key> is not returned when walking."
4394 #: ../src/guestfs.pod:2029
4396 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
4397 "C<guestfs_next_private> or C<guestfs_set_private>."
4401 #: ../src/guestfs.pod:2035
4403 "The following example code shows how to print all keys and data pointers "
4404 "that are associated with the handle C<g>:"
4408 #: ../src/guestfs.pod:2038
4411 " const char *key;\n"
4412 " void *data = guestfs_first_private (g, &key);\n"
4413 " while (data != NULL)\n"
4415 " printf (\"key = %s, data = %p\\n\", key, data);\n"
4416 " data = guestfs_next_private (g, &key);\n"
4422 #: ../src/guestfs.pod:2046
4424 "More commonly you are only interested in keys that begin with an application-"
4425 "specific prefix C<foo_>. Modify the loop like so:"
4429 #: ../src/guestfs.pod:2049
4432 " const char *key;\n"
4433 " void *data = guestfs_first_private (g, &key);\n"
4434 " while (data != NULL)\n"
4436 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
4437 " printf (\"key = %s, data = %p\\n\", key, data);\n"
4438 " data = guestfs_next_private (g, &key);\n"
4444 #: ../src/guestfs.pod:2058
4446 "If you need to modify keys while walking, then you have to jump back to the "
4447 "beginning of the loop. For example, to delete all keys prefixed with "
4452 #: ../src/guestfs.pod:2062
4455 " const char *key;\n"
4458 " data = guestfs_first_private (g, &key);\n"
4459 " while (data != NULL)\n"
4461 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
4463 " guestfs_set_private (g, key, NULL);\n"
4464 " /* note that 'key' pointer is now invalid, and so is\n"
4465 " the internal iterator */\n"
4468 " data = guestfs_next_private (g, &key);\n"
4474 #: ../src/guestfs.pod:2078
4476 "Note that the above loop is guaranteed to terminate because the keys are "
4477 "being deleted, but other manipulations of keys within the loop might not "
4478 "terminate unless you also maintain an indication of which keys have been "
4484 #: ../src/guestfs.pod:2083 ../src/guestfs.pod:2088
4490 #: ../src/guestfs.pod:2085
4492 "<!-- old anchor for the next section --> <a name="
4493 "\"state_machine_and_low_level_event_api\"/>"
4498 #: ../src/guestfs.pod:2090
4499 msgid "ARCHITECTURE"
4504 #: ../src/guestfs.pod:2092
4506 "Internally, libguestfs is implemented by running an appliance (a special "
4507 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
4508 "process of the main program."
4513 #: ../src/guestfs.pod:2096
4516 " ___________________\n"
4518 " | main program |\n"
4520 " | | child process / appliance\n"
4521 " | | __________________________\n"
4523 " +-------------------+ RPC | +-----------------+ |\n"
4524 " | libguestfs <--------------------> guestfsd | |\n"
4525 " | | | +-----------------+ |\n"
4526 " \\___________________/ | | Linux kernel | |\n"
4527 " | +--^--------------+ |\n"
4528 " \\_________|________________/\n"
4534 " \\______________/\n"
4540 #: ../src/guestfs.pod:2116
4542 "The library, linked to the main program, creates the child process and hence "
4543 "the appliance in the L</guestfs_launch> function."
4548 #: ../src/guestfs.pod:2119
4550 "Inside the appliance is a Linux kernel and a complete stack of userspace "
4551 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
4552 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
4553 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
4554 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
4555 "attached to the qemu process which translates device access by the "
4556 "appliance's Linux kernel into accesses to the image."
4561 #: ../src/guestfs.pod:2128
4563 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
4564 "Although the disk image you are attached to might also be used by some "
4565 "virtual machine, libguestfs doesn't know or care about this. (But you will "
4566 "care if both libguestfs's qemu process and your virtual machine are trying "
4567 "to update the disk image at the same time, since these usually results in "
4568 "massive disk corruption)."
4573 #: ../src/guestfs.pod:2135
4574 msgid "STATE MACHINE"
4579 #: ../src/guestfs.pod:2137
4580 msgid "libguestfs uses a state machine to model the child process:"
4585 #: ../src/guestfs.pod:2139
4597 " / | \\ \\ guestfs_launch\n"
4598 " / | _\\__V______\n"
4600 " / | | LAUNCHING |\n"
4601 " / | \\___________/\n"
4603 " / | guestfs_launch\n"
4605 " ______ / __|____V\n"
4606 " / \\ ------> / \\\n"
4607 " | BUSY | | READY |\n"
4608 " \\______/ <------ \\________/\n"
4614 #: ../src/guestfs.pod:2161
4616 "The normal transitions are (1) CONFIG (when the handle is created, but there "
4617 "is no child process), (2) LAUNCHING (when the child process is booting up), "
4618 "(3) alternating between READY and BUSY as commands are issued to, and "
4619 "carried out by, the child process."
4624 #: ../src/guestfs.pod:2166
4626 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
4627 "asynchronously at any time (eg. due to some internal error), and that causes "
4628 "the state to transition back to CONFIG."
4633 #: ../src/guestfs.pod:2170
4635 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
4636 "issued when in the CONFIG state."
4641 #: ../src/guestfs.pod:2173
4643 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
4644 "L</guestfs_launch> blocks until the child process is READY to accept "
4645 "commands (or until some failure or timeout). L</guestfs_launch> internally "
4646 "moves the state from CONFIG to LAUNCHING while it is running."
4651 #: ../src/guestfs.pod:2179
4653 "API actions such as L</guestfs_mount> can only be issued when in the READY "
4654 "state. These API calls block waiting for the command to be carried out (ie. "
4655 "the state to transition to BUSY and then back to READY). There are no non-"
4656 "blocking versions, and no way to issue more than one command per handle at "
4662 #: ../src/guestfs.pod:2185
4664 "Finally, the child process sends asynchronous messages back to the main "
4665 "program, such as kernel log messages. You can register a callback to "
4666 "receive these messages."
4671 #: ../src/guestfs.pod:2189
4677 #: ../src/guestfs.pod:2191
4678 msgid "COMMUNICATION PROTOCOL"
4683 #: ../src/guestfs.pod:2193
4685 "Don't rely on using this protocol directly. This section documents how it "
4686 "currently works, but it may change at any time."
4691 #: ../src/guestfs.pod:2196
4693 "The protocol used to talk between the library and the daemon running inside "
4694 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
4695 "1014, RFC 1832, RFC 4506)."
4700 #: ../src/guestfs.pod:2200
4702 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
4703 "this file is automatically generated)."
4708 #: ../src/guestfs.pod:2203
4710 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
4711 "and C<FileOut> parameters, which are handled with very simple request/reply "
4712 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
4713 "parameters, which use the same request and reply messages, but they may also "
4714 "be followed by files sent using a chunked encoding."
4719 #: ../src/guestfs.pod:2210
4720 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
4725 #: ../src/guestfs.pod:2212
4726 msgid "For ordinary functions, the request message is:"
4731 #: ../src/guestfs.pod:2214
4734 " total length (header + arguments,\n"
4735 " but not including the length word itself)\n"
4736 " struct guestfs_message_header (encoded as XDR)\n"
4737 " struct guestfs_<foo>_args (encoded as XDR)\n"
4743 #: ../src/guestfs.pod:2219
4745 "The total length field allows the daemon to allocate a fixed size buffer "
4746 "into which it slurps the rest of the message. As a result, the total length "
4747 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
4748 "effective size of any request is limited to somewhere under this size."
4753 #: ../src/guestfs.pod:2225
4755 "Note also that many functions don't take any arguments, in which case the "
4756 "C<guestfs_I<foo>_args> is completely omitted."
4761 #: ../src/guestfs.pod:2228
4763 "The header contains the procedure number (C<guestfs_proc>) which is how the "
4764 "receiver knows what type of args structure to expect, or none at all."
4769 #: ../src/guestfs.pod:2232
4771 "For functions that take optional arguments, the optional arguments are "
4772 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
4773 "arguments. A bitmask in the header indicates which optional arguments are "
4774 "meaningful. The bitmask is also checked to see if it contains bits set "
4775 "which the daemon does not know about (eg. if more optional arguments were "
4776 "added in a later version of the library), and this causes the call to be "
4782 #: ../src/guestfs.pod:2240
4783 msgid "The reply message for ordinary functions is:"
4788 #: ../src/guestfs.pod:2242
4791 " total length (header + ret,\n"
4792 " but not including the length word itself)\n"
4793 " struct guestfs_message_header (encoded as XDR)\n"
4794 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4800 #: ../src/guestfs.pod:2247
4802 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
4803 "functions that return no formal return values."
4808 #: ../src/guestfs.pod:2250
4810 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
4815 #: ../src/guestfs.pod:2253
4817 "In the case of an error, a flag is set in the header, and the reply message "
4818 "is slightly changed:"
4823 #: ../src/guestfs.pod:2256
4826 " total length (header + error,\n"
4827 " but not including the length word itself)\n"
4828 " struct guestfs_message_header (encoded as XDR)\n"
4829 " struct guestfs_message_error (encoded as XDR)\n"
4835 #: ../src/guestfs.pod:2261
4837 "The C<guestfs_message_error> structure contains the error message as a "
4843 #: ../src/guestfs.pod:2264
4844 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
4849 #: ../src/guestfs.pod:2266
4851 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
4852 "The normal request message is sent (see above). However this is followed by "
4853 "a sequence of file chunks."
4858 #: ../src/guestfs.pod:2270
4861 " total length (header + arguments,\n"
4862 " but not including the length word itself,\n"
4863 " and not including the chunks)\n"
4864 " struct guestfs_message_header (encoded as XDR)\n"
4865 " struct guestfs_<foo>_args (encoded as XDR)\n"
4866 " sequence of chunks for FileIn param #0\n"
4867 " sequence of chunks for FileIn param #1 etc.\n"
4873 #: ../src/guestfs.pod:2278
4874 msgid "The \"sequence of chunks\" is:"
4879 #: ../src/guestfs.pod:2280
4882 " length of chunk (not including length word itself)\n"
4883 " struct guestfs_chunk (encoded as XDR)\n"
4884 " length of chunk\n"
4885 " struct guestfs_chunk (encoded as XDR)\n"
4887 " length of chunk\n"
4888 " struct guestfs_chunk (with data.data_len == 0)\n"
4894 #: ../src/guestfs.pod:2288
4896 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
4897 "is set in the final chunk to indicate either successful completion or early "
4903 #: ../src/guestfs.pod:2292
4905 "At time of writing there are no functions that have more than one FileIn "
4906 "parameter. However this is (theoretically) supported, by sending the "
4907 "sequence of chunks for each FileIn parameter one after another (from left to "
4913 #: ../src/guestfs.pod:2297
4915 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
4916 "transfer. The library does this by sending a chunk with a special flag set "
4917 "to indicate cancellation. When the daemon sees this, it cancels the whole "
4918 "RPC, does I<not> send any reply, and goes back to reading the next request."
4923 #: ../src/guestfs.pod:2303
4925 "The daemon may also cancel. It does this by writing a special word "
4926 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
4927 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
4928 "cancel chunk). The special word is chosen so that even if cancellation "
4929 "happens right at the end of the transfer (after the library has finished "
4930 "writing and has started listening for the reply), the \"spurious\" cancel "
4931 "flag will not be confused with the reply message."
4936 #: ../src/guestfs.pod:2312
4938 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
4939 "limit), and also files where the size is not known in advance (eg. from "
4940 "pipes or sockets). However the chunks are rather small "
4941 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
4942 "to keep much in memory."
4947 #: ../src/guestfs.pod:2318
4948 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
4953 #: ../src/guestfs.pod:2320
4955 "The protocol for FileOut parameters is exactly the same as for FileIn "
4956 "parameters, but with the roles of daemon and library reversed."
4961 #: ../src/guestfs.pod:2323
4964 " total length (header + ret,\n"
4965 " but not including the length word itself,\n"
4966 " and not including the chunks)\n"
4967 " struct guestfs_message_header (encoded as XDR)\n"
4968 " struct guestfs_<foo>_ret (encoded as XDR)\n"
4969 " sequence of chunks for FileOut param #0\n"
4970 " sequence of chunks for FileOut param #1 etc.\n"
4976 #: ../src/guestfs.pod:2331
4977 msgid "INITIAL MESSAGE"
4982 #: ../src/guestfs.pod:2333
4984 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
4985 "which indicates that the guest and daemon is alive. This is what L</"
4986 "guestfs_launch> waits for."
4991 #: ../src/guestfs.pod:2337
4992 msgid "PROGRESS NOTIFICATION MESSAGES"
4997 #: ../src/guestfs.pod:2339
4999 "The daemon may send progress notification messages at any time. These are "
5000 "distinguished by the normal length word being replaced by "
5001 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
5005 #: ../src/guestfs.pod:2343
5007 "The library turns them into progress callbacks (see L</"
5008 "GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards them "
5014 #: ../src/guestfs.pod:2347
5016 "The daemon self-limits the frequency of progress messages it sends (see "
5017 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
5023 #: ../src/guestfs.pod:2351
5024 msgid "LIBGUESTFS VERSION NUMBERS"
5029 #: ../src/guestfs.pod:2353
5031 "Since April 2010, libguestfs has started to make separate development and "
5032 "stable releases, along with corresponding branches in our git repository. "
5033 "These separate releases can be identified by version number:"
5038 #: ../src/guestfs.pod:2358
5041 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
5042 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
5048 " | `-------- sub-version\n"
5050 " `------ always '1' because we don't change the ABI\n"
5056 #: ../src/guestfs.pod:2369
5057 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
5062 #: ../src/guestfs.pod:2371
5064 "As time passes we cherry pick fixes from the development branch and backport "
5065 "those into the stable branch, the effect being that the stable branch should "
5066 "get more stable and less buggy over time. So the stable releases are ideal "
5067 "for people who don't need new features but would just like the software to "
5073 #: ../src/guestfs.pod:2377
5074 msgid "Our criteria for backporting changes are:"
5079 #: ../src/guestfs.pod:2383
5081 "Documentation changes which don't affect any code are backported unless the "
5082 "documentation refers to a future feature which is not in stable."
5087 #: ../src/guestfs.pod:2389
5089 "Bug fixes which are not controversial, fix obvious problems, and have been "
5090 "well tested are backported."
5095 #: ../src/guestfs.pod:2394
5097 "Simple rearrangements of code which shouldn't affect how it works get "
5098 "backported. This is so that the code in the two branches doesn't get too "
5099 "far out of step, allowing us to backport future fixes more easily."
5104 #: ../src/guestfs.pod:2400
5106 "We I<don't> backport new features, new APIs, new tools etc, except in one "
5107 "exceptional case: the new feature is required in order to implement an "
5108 "important bug fix."
5113 #: ../src/guestfs.pod:2406
5115 "A new stable branch starts when we think the new features in development are "
5116 "substantial and compelling enough over the current stable branch to warrant "
5117 "it. When that happens we create new stable and development versions 1.N.0 "
5118 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
5119 "stable at this point, but by backporting fixes from development, that branch "
5120 "will stabilize over time."
5124 #: ../src/guestfs.pod:2414
5125 msgid "EXTENDING LIBGUESTFS"
5129 #: ../src/guestfs.pod:2416
5130 msgid "ADDING A NEW API ACTION"
5134 #: ../src/guestfs.pod:2418
5136 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
5137 "documentation) are generated, and this makes it easy to extend the "
5142 #: ../src/guestfs.pod:2422
5143 msgid "To add a new API action there are two changes:"
5147 #: ../src/guestfs.pod:2428
5149 "You need to add a description of the call (name, parameters, return type, "
5150 "tests, documentation) to C<generator/generator_actions.ml>."
5154 #: ../src/guestfs.pod:2431
5156 "There are two sorts of API action, depending on whether the call goes "
5157 "through to the daemon in the appliance, or is serviced entirely by the "
5158 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
5159 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
5160 "an example of the latter, since a trace flag is maintained in the handle and "
5161 "all tracing is done on the library side."
5165 #: ../src/guestfs.pod:2439
5167 "Most new actions are of the first type, and get added to the "
5168 "C<daemon_functions> list. Each function has a unique procedure number used "
5169 "in the RPC protocol which is assigned to that action when we publish "
5170 "libguestfs and cannot be reused. Take the latest procedure number and "
5175 #: ../src/guestfs.pod:2445
5177 "For library-only actions of the second type, add to the "
5178 "C<non_daemon_functions> list. Since these functions are serviced by the "
5179 "library and do not travel over the RPC mechanism to the daemon, these "
5180 "functions do not need a procedure number, and so the procedure number is set "
5185 #: ../src/guestfs.pod:2453
5186 msgid "Implement the action (in C):"
5190 #: ../src/guestfs.pod:2455
5192 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
5193 "C<daemon/> directory."
5197 #: ../src/guestfs.pod:2458
5199 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
5200 "(note: double underscore) in the C<src/> directory."
5204 #: ../src/guestfs.pod:2461
5205 msgid "In either case, use another function as an example of what to do."
5209 #: ../src/guestfs.pod:2465
5210 msgid "After making these changes, use C<make> to compile."
5214 #: ../src/guestfs.pod:2467
5216 "Note that you don't need to implement the RPC, language bindings, manual "
5217 "pages or anything else. It's all automatically generated from the OCaml "
5222 #: ../src/guestfs.pod:2471
5223 msgid "ADDING TESTS FOR AN API ACTION"
5227 #: ../src/guestfs.pod:2473
5229 "You can supply zero or as many tests as you want per API call. The tests "
5230 "can either be added as part of the API description (C<generator/"
5231 "generator_actions.ml>), or in some rarer cases you may want to drop a script "
5232 "into C<regressions/>. Note that adding a script to C<regressions/> is "
5233 "slower, so if possible use the first method."
5237 #: ../src/guestfs.pod:2479
5239 "The following describes the test environment used when you add an API test "
5240 "in C<generator_actions.ml>."
5244 #: ../src/guestfs.pod:2482
5245 msgid "The test environment has 4 block devices:"
5249 #: ../src/guestfs.pod:2486
5250 msgid "C</dev/sda> 500MB"
5254 #: ../src/guestfs.pod:2488
5255 msgid "General block device for testing."
5259 #: ../src/guestfs.pod:2490
5260 msgid "C</dev/sdb> 50MB"
5264 #: ../src/guestfs.pod:2492
5266 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
5271 #: ../src/guestfs.pod:2495
5272 msgid "C</dev/sdc> 10MB"
5276 #: ../src/guestfs.pod:2497
5277 msgid "Used in a few tests where two block devices are needed."
5281 #: ../src/guestfs.pod:2499
5286 #: ../src/guestfs.pod:2501
5287 msgid "ISO with fixed content (see C<images/test.iso>)."
5291 #: ../src/guestfs.pod:2505
5293 "To be able to run the tests in a reasonable amount of time, the libguestfs "
5294 "appliance and block devices are reused between tests. So don't try testing "
5295 "L</guestfs_kill_subprocess> :-x"
5299 #: ../src/guestfs.pod:2509
5301 "Each test starts with an initial scenario, selected using one of the "
5302 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
5303 "initialize the disks mentioned above in a particular way as documented in "
5304 "C<generator_types.ml>. You should not assume anything about the previous "
5305 "contents of other disks that are not initialized."
5309 #: ../src/guestfs.pod:2515
5311 "You can add a prerequisite clause to any individual test. This is a run-"
5312 "time check, which, if it fails, causes the test to be skipped. Useful if "
5313 "testing a command which might not work on all variations of libguestfs "
5314 "builds. A test that has prerequisite of C<Always> means to run "
5319 #: ../src/guestfs.pod:2521
5321 "In addition, packagers can skip individual tests by setting environment "
5322 "variables before running C<make check>."
5326 #: ../src/guestfs.pod:2524
5329 " SKIP_TEST_<CMD>_<NUM>=1\n"
5334 #: ../src/guestfs.pod:2526
5335 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
5339 #: ../src/guestfs.pod:2528
5344 #: ../src/guestfs.pod:2530
5347 " SKIP_TEST_<CMD>=1\n"
5352 #: ../src/guestfs.pod:2532
5353 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
5357 #: ../src/guestfs.pod:2534
5358 msgid "Packagers can run only certain tests by setting for example:"
5362 #: ../src/guestfs.pod:2536
5365 " TEST_ONLY=\"vfs_type zerofree\"\n"
5370 #: ../src/guestfs.pod:2538
5372 "See C<capitests/tests.c> for more details of how these environment variables "
5377 #: ../src/guestfs.pod:2541
5378 msgid "DEBUGGING NEW API ACTIONS"
5382 #: ../src/guestfs.pod:2543
5383 msgid "Test new actions work before submitting them."
5387 #: ../src/guestfs.pod:2545
5388 msgid "You can use guestfish to try out new commands."
5392 #: ../src/guestfs.pod:2547
5394 "Debugging the daemon is a problem because it runs inside a minimal "
5395 "environment. However you can fprintf messages in the daemon to stderr, and "
5396 "they will show up if you use C<guestfish -v>."
5400 #: ../src/guestfs.pod:2551
5401 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
5405 #: ../src/guestfs.pod:2553
5407 "Our C source code generally adheres to some basic code-formatting "
5408 "conventions. The existing code base is not totally consistent on this "
5409 "front, but we do prefer that contributed code be formatted similarly. In "
5410 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
5411 "indentation level, and other than that, follow the K&R style."
5415 #: ../src/guestfs.pod:2559
5417 "If you use Emacs, add the following to one of one of your start-up files (e."
5418 "g., ~/.emacs), to help ensure that you get indentation right:"
5422 #: ../src/guestfs.pod:2562
5425 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
5426 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
5427 " (add-hook 'find-file-hook\n"
5428 " '(lambda () (if (and buffer-file-name\n"
5429 " (string-match \"/libguestfs\\\\>\"\n"
5430 " (buffer-file-name))\n"
5431 " (not (string-equal mode-name \"Change Log\"))\n"
5432 " (not (string-equal mode-name \"Makefile\")))\n"
5433 " (setq indent-tabs-mode nil))))\n"
5438 #: ../src/guestfs.pod:2572
5441 " ;;; When editing C sources in libguestfs, use this style.\n"
5442 " (defun libguestfs-c-mode ()\n"
5443 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
5445 " (c-set-style \"K&R\")\n"
5446 " (setq c-indent-level 2)\n"
5447 " (setq c-basic-offset 2))\n"
5448 " (add-hook 'c-mode-hook\n"
5449 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
5450 " (buffer-file-name))\n"
5451 " (libguestfs-c-mode))))\n"
5456 #: ../src/guestfs.pod:2584
5457 msgid "Enable warnings when compiling (and fix any problems this finds):"
5461 #: ../src/guestfs.pod:2587
5464 " ./configure --enable-gcc-warnings\n"
5469 #: ../src/guestfs.pod:2589
5470 msgid "Useful targets are:"
5474 #: ../src/guestfs.pod:2591
5477 " make syntax-check # checks the syntax of the C code\n"
5478 " make check # runs the test suite\n"
5483 #: ../src/guestfs.pod:2594
5484 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
5488 #: ../src/guestfs.pod:2596
5490 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
5491 "which are used to do shell quoting."
5495 #: ../src/guestfs.pod:2601
5500 #: ../src/guestfs.pod:2603
5502 "Simple shell quoted string. Any spaces or other shell characters are "
5507 #: ../src/guestfs.pod:2606
5512 #: ../src/guestfs.pod:2608
5514 "Same as C<%Q> except the string is treated as a path which is prefixed by "
5520 #: ../src/guestfs.pod:2613 ../fish/guestfish.pod:240 ../fish/guestfish.pod:608
5521 msgid "For example:"
5525 #: ../src/guestfs.pod:2615
5528 " asprintf (&cmd, \"cat %R\", path);\n"
5533 #: ../src/guestfs.pod:2617
5534 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
5538 #: ../src/guestfs.pod:2619
5540 "I<Note:> Do I<not> use these when you are passing parameters to the C<command"
5541 "{,r,v,rv}()> functions. These parameters do NOT need to be quoted because "
5542 "they are not passed via the shell (instead, straight to exec). You probably "
5543 "want to use the C<sysroot_path()> function however."
5547 #: ../src/guestfs.pod:2625
5548 msgid "SUBMITTING YOUR NEW API ACTIONS"
5552 #: ../src/guestfs.pod:2627
5554 "Submit patches to the mailing list: L<http://www.redhat.com/mailman/listinfo/"
5555 "libguestfs> and CC to L<rjones@redhat.com>."
5559 #: ../src/guestfs.pod:2631
5560 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
5564 #: ../src/guestfs.pod:2633
5565 msgid "We support i18n (gettext anyhow) in the library."
5569 #: ../src/guestfs.pod:2635
5571 "However many messages come from the daemon, and we don't translate those at "
5572 "the moment. One reason is that the appliance generally has all locale files "
5573 "removed from it, because they take up a lot of space. So we'd have to readd "
5574 "some of those, as well as copying our PO files into the appliance."
5578 #: ../src/guestfs.pod:2641
5580 "Debugging messages are never translated, since they are intended for the "
5585 #: ../src/guestfs.pod:2644
5586 msgid "SOURCE CODE SUBDIRECTORIES"
5590 #: ../src/guestfs.pod:2648 ../src/guestfs-actions.pod:5725
5591 #: ../fish/guestfish-actions.pod:3842
5592 msgid "C<appliance>"
5596 #: ../src/guestfs.pod:2650
5597 msgid "The libguestfs appliance, build scripts and so on."
5601 #: ../src/guestfs.pod:2652
5602 msgid "C<capitests>"
5606 #: ../src/guestfs.pod:2654
5607 msgid "Automated tests of the C API."
5611 #: ../src/guestfs.pod:2656
5616 #: ../src/guestfs.pod:2658
5618 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
5623 #: ../src/guestfs.pod:2661
5628 #: ../src/guestfs.pod:2663
5629 msgid "Outside contributions, experimental parts."
5633 #: ../src/guestfs.pod:2665
5638 #: ../src/guestfs.pod:2667
5640 "The daemon that runs inside the libguestfs appliance and carries out actions."
5644 #: ../src/guestfs.pod:2670
5649 #: ../src/guestfs.pod:2672
5650 msgid "L<virt-df(1)> command and documentation."
5654 #: ../src/guestfs.pod:2674
5659 #: ../src/guestfs.pod:2676
5660 msgid "C API example code."
5664 #: ../src/guestfs.pod:2678
5669 #: ../src/guestfs.pod:2680
5671 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
5672 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
5673 "L<virt-tar-out(1)>."
5677 #: ../src/guestfs.pod:2684
5682 #: ../src/guestfs.pod:2686
5684 "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
5688 #: ../src/guestfs.pod:2688
5689 msgid "C<generator>"
5693 #: ../src/guestfs.pod:2690
5695 "The crucially important generator, used to automatically generate large "
5696 "amounts of boilerplate C code for things like RPC and bindings."
5700 #: ../src/guestfs.pod:2693
5705 #: ../src/guestfs.pod:2695
5706 msgid "Files used by the test suite."
5710 #: ../src/guestfs.pod:2697
5711 msgid "Some \"phony\" guest images which we test against."
5715 #: ../src/guestfs.pod:2699
5716 msgid "C<inspector>"
5720 #: ../src/guestfs.pod:2701
5721 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
5725 #: ../src/guestfs.pod:2703
5730 #: ../src/guestfs.pod:2705
5731 msgid "Logo used on the website. The fish is called Arthur by the way."
5735 #: ../src/guestfs.pod:2707
5740 #: ../src/guestfs.pod:2709
5741 msgid "M4 macros used by autoconf."
5745 #: ../src/guestfs.pod:2711
5750 #: ../src/guestfs.pod:2713
5751 msgid "Translations of simple gettext strings."
5755 #: ../src/guestfs.pod:2715
5760 #: ../src/guestfs.pod:2717
5762 "The build infrastructure and PO files for translations of manpages and POD "
5763 "files. Eventually this will be combined with the C<po> directory, but that "
5764 "is rather complicated."
5768 #: ../src/guestfs.pod:2721
5769 msgid "C<regressions>"
5773 #: ../src/guestfs.pod:2723
5774 msgid "Regression tests."
5778 #: ../src/guestfs.pod:2725
5783 #: ../src/guestfs.pod:2727
5784 msgid "L<virt-rescue(1)> command and documentation."
5788 #: ../src/guestfs.pod:2729
5793 #: ../src/guestfs.pod:2731
5794 msgid "Source code to the C library."
5798 #: ../src/guestfs.pod:2733
5803 #: ../src/guestfs.pod:2735
5804 msgid "Command line tools written in Perl (L<virt-resize(1)> and many others)."
5808 #: ../src/guestfs.pod:2737
5809 msgid "C<test-tool>"
5813 #: ../src/guestfs.pod:2739
5815 "Test tool for end users to test if their qemu/kernel combination will work "
5820 #: ../src/guestfs.pod:2742
5825 #: ../src/guestfs.pod:2744
5830 #: ../src/guestfs.pod:2746
5835 #: ../src/guestfs.pod:2748
5840 #: ../src/guestfs.pod:2750
5845 #: ../src/guestfs.pod:2752
5850 #: ../src/guestfs.pod:2754
5855 #: ../src/guestfs.pod:2756
5860 #: ../src/guestfs.pod:2758
5861 msgid "Language bindings."
5866 #: ../src/guestfs.pod:2762 ../fish/guestfish.pod:1005
5867 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
5868 msgid "ENVIRONMENT VARIABLES"
5873 #: ../src/guestfs.pod:2766 ../fish/guestfish.pod:1031
5874 msgid "LIBGUESTFS_APPEND"
5879 #: ../src/guestfs.pod:2768 ../fish/guestfish.pod:1033
5880 msgid "Pass additional options to the guest kernel."
5885 #: ../src/guestfs.pod:2770 ../fish/guestfish.pod:1035
5886 msgid "LIBGUESTFS_DEBUG"
5891 #: ../src/guestfs.pod:2772
5893 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
5894 "effect as calling C<guestfs_set_verbose (g, 1)>."
5899 #: ../src/guestfs.pod:2775 ../fish/guestfish.pod:1040
5900 msgid "LIBGUESTFS_MEMSIZE"
5905 #: ../src/guestfs.pod:2777 ../fish/guestfish.pod:1042
5907 "Set the memory allocated to the qemu process, in megabytes. For example:"
5912 #: ../src/guestfs.pod:2780 ../fish/guestfish.pod:1045
5915 " LIBGUESTFS_MEMSIZE=700\n"
5921 #: ../src/guestfs.pod:2782 ../fish/guestfish.pod:1047
5922 msgid "LIBGUESTFS_PATH"
5926 #: ../src/guestfs.pod:2784
5928 "Set the path that libguestfs uses to search for a supermin appliance. See "
5929 "the discussion of paths in section L</PATH> above."
5934 #: ../src/guestfs.pod:2787 ../fish/guestfish.pod:1052
5935 msgid "LIBGUESTFS_QEMU"
5940 #: ../src/guestfs.pod:2789 ../fish/guestfish.pod:1054
5942 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
5943 "which was found at compile time by the configure script is used."
5948 #: ../src/guestfs.pod:2793
5949 msgid "See also L</QEMU WRAPPERS> above."
5954 #: ../src/guestfs.pod:2795 ../fish/guestfish.pod:1058
5955 msgid "LIBGUESTFS_TRACE"
5960 #: ../src/guestfs.pod:2797
5962 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
5963 "effect as calling C<guestfs_set_trace (g, 1)>."
5968 #: ../src/guestfs.pod:2800 ../fish/guestfish.pod:1067
5973 #: ../src/guestfs.pod:2802 ../fish/guestfish.pod:1069
5975 "Location of temporary directory, defaults to C</tmp> except for the cached "
5976 "supermin appliance which defaults to C</var/tmp>."
5980 #: ../src/guestfs.pod:2805 ../fish/guestfish.pod:1072
5982 "If libguestfs was compiled to use the supermin appliance then the real "
5983 "appliance is cached in this directory, shared between all handles belonging "
5984 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
5985 "use in case C</var/tmp> is not large enough."
5990 #: ../src/guestfs.pod:2813 ../fish/guestfish.pod:1130
5991 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:250
5992 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:572
5993 #: ../tools/virt-resize.pl:1489 ../tools/virt-list-filesystems.pl:189
5994 #: ../tools/virt-tar.pl:286 ../tools/virt-make-fs.pl:539
5995 #: ../tools/virt-list-partitions.pl:257
6000 #: ../src/guestfs.pod:2815
6002 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
6003 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-copy-in"
6004 "(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems"
6005 "(1)>, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-"
6006 "partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-"
6007 "tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<qemu(1)"
6008 ">, L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
6013 #: ../src/guestfs.pod:2842
6015 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
6016 "(8)>, L<disktype(1)>."
6021 #: ../src/guestfs.pod:2849 ../tools/virt-win-reg.pl:587
6022 #: ../tools/virt-make-fs.pl:553
6028 #: ../src/guestfs.pod:2851
6029 msgid "To get a list of bugs against libguestfs use this link:"
6034 #: ../src/guestfs.pod:2853
6036 "L<https://bugzilla.redhat.com/buglist.cgi?"
6037 "component=libguestfs&product=Virtualization+Tools>"
6042 #: ../src/guestfs.pod:2855
6043 msgid "To report a new bug against libguestfs use this link:"
6048 #: ../src/guestfs.pod:2857
6050 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
6051 "component=libguestfs&product=Virtualization+Tools>"
6056 #: ../src/guestfs.pod:2859
6057 msgid "When reporting a bug, please check:"
6062 #: ../src/guestfs.pod:2865
6063 msgid "That the bug hasn't been reported already."
6068 #: ../src/guestfs.pod:2869
6069 msgid "That you are testing a recent version."
6074 #: ../src/guestfs.pod:2873
6075 msgid "Describe the bug accurately, and give a way to reproduce it."
6080 #: ../src/guestfs.pod:2877
6082 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
6088 #: ../src/guestfs.pod:2882 ../fish/guestfish.pod:1153
6089 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:261
6095 #: ../src/guestfs.pod:2884 ../fish/guestfish.pod:1155
6096 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:263
6097 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
6102 #: ../src/guestfs.pod:2886 ../fish/guestfish.pod:1157
6103 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:265
6104 #: ../tools/virt-edit.pl:368 ../tools/virt-win-reg.pl:602
6105 #: ../tools/virt-resize.pl:1514 ../tools/virt-list-filesystems.pl:206
6106 #: ../tools/virt-tar.pl:305 ../tools/virt-make-fs.pl:568
6107 #: ../tools/virt-list-partitions.pl:273
6113 #: ../src/guestfs.pod:2888 ../fish/guestfish.pod:1159
6114 #: ../fuse/guestmount.pod:267
6115 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
6120 #: ../src/guestfs.pod:2891
6122 "This library is free software; you can redistribute it and/or modify it "
6123 "under the terms of the GNU Lesser General Public License as published by the "
6124 "Free Software Foundation; either version 2 of the License, or (at your "
6125 "option) any later version."
6130 #: ../src/guestfs.pod:2896
6132 "This library is distributed in the hope that it will be useful, but WITHOUT "
6133 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
6134 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
6140 #: ../src/guestfs.pod:2901
6142 "You should have received a copy of the GNU Lesser General Public License "
6143 "along with this library; if not, write to the Free Software Foundation, "
6144 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
6149 #: ../src/guestfs-actions.pod:1
6150 msgid "guestfs_add_cdrom"
6155 #: ../src/guestfs-actions.pod:3
6159 " guestfs_add_cdrom (guestfs_h *g,\n"
6160 " const char *filename);\n"
6166 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
6167 msgid "This function adds a virtual CD-ROM disk image to the guest."
6172 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
6173 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
6178 #: ../src/guestfs-actions.pod:17
6180 "This call checks for the existence of C<filename>. This stops you from "
6181 "specifying other types of drive which are supported by qemu such as C<nbd:> "
6182 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
6188 #: ../src/guestfs-actions.pod:24
6190 "If you just want to add an ISO file (often you use this as an efficient way "
6191 "to transfer large files into the guest), then you should probably use "
6192 "C<guestfs_add_drive_ro> instead."
6197 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:134
6198 #: ../src/guestfs-actions.pod:195 ../src/guestfs-actions.pod:232
6199 #: ../src/guestfs-actions.pod:246 ../src/guestfs-actions.pod:267
6200 #: ../src/guestfs-actions.pod:287 ../src/guestfs-actions.pod:301
6201 #: ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:436
6202 #: ../src/guestfs-actions.pod:450 ../src/guestfs-actions.pod:495
6203 #: ../src/guestfs-actions.pod:523 ../src/guestfs-actions.pod:541
6204 #: ../src/guestfs-actions.pod:608 ../src/guestfs-actions.pod:641
6205 #: ../src/guestfs-actions.pod:655 ../src/guestfs-actions.pod:670
6206 #: ../src/guestfs-actions.pod:769 ../src/guestfs-actions.pod:787
6207 #: ../src/guestfs-actions.pod:801 ../src/guestfs-actions.pod:815
6208 #: ../src/guestfs-actions.pod:976 ../src/guestfs-actions.pod:996
6209 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1098
6210 #: ../src/guestfs-actions.pod:1116 ../src/guestfs-actions.pod:1135
6211 #: ../src/guestfs-actions.pod:1149 ../src/guestfs-actions.pod:1169
6212 #: ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1270
6213 #: ../src/guestfs-actions.pod:1295 ../src/guestfs-actions.pod:1332
6214 #: ../src/guestfs-actions.pod:1438 ../src/guestfs-actions.pod:1472
6215 #: ../src/guestfs-actions.pod:1690 ../src/guestfs-actions.pod:1712
6216 #: ../src/guestfs-actions.pod:1799 ../src/guestfs-actions.pod:2261
6217 #: ../src/guestfs-actions.pod:2405 ../src/guestfs-actions.pod:2466
6218 #: ../src/guestfs-actions.pod:2501 ../src/guestfs-actions.pod:3375
6219 #: ../src/guestfs-actions.pod:3390 ../src/guestfs-actions.pod:3410
6220 #: ../src/guestfs-actions.pod:3565 ../src/guestfs-actions.pod:3579
6221 #: ../src/guestfs-actions.pod:3592 ../src/guestfs-actions.pod:3606
6222 #: ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3657
6223 #: ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:3749
6224 #: ../src/guestfs-actions.pod:3766 ../src/guestfs-actions.pod:3789
6225 #: ../src/guestfs-actions.pod:3812 ../src/guestfs-actions.pod:3844
6226 #: ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:3882
6227 #: ../src/guestfs-actions.pod:3917 ../src/guestfs-actions.pod:3929
6228 #: ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:3981
6229 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4009
6230 #: ../src/guestfs-actions.pod:4026 ../src/guestfs-actions.pod:4119
6231 #: ../src/guestfs-actions.pod:4139 ../src/guestfs-actions.pod:4152
6232 #: ../src/guestfs-actions.pod:4203 ../src/guestfs-actions.pod:4221
6233 #: ../src/guestfs-actions.pod:4239 ../src/guestfs-actions.pod:4255
6234 #: ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:4283
6235 #: ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4315
6236 #: ../src/guestfs-actions.pod:4335 ../src/guestfs-actions.pod:4393
6237 #: ../src/guestfs-actions.pod:4466 ../src/guestfs-actions.pod:4497
6238 #: ../src/guestfs-actions.pod:4516 ../src/guestfs-actions.pod:4535
6239 #: ../src/guestfs-actions.pod:4547 ../src/guestfs-actions.pod:4564
6240 #: ../src/guestfs-actions.pod:4577 ../src/guestfs-actions.pod:4592
6241 #: ../src/guestfs-actions.pod:4607 ../src/guestfs-actions.pod:4642
6242 #: ../src/guestfs-actions.pod:4657 ../src/guestfs-actions.pod:4677
6243 #: ../src/guestfs-actions.pod:4691 ../src/guestfs-actions.pod:4708
6244 #: ../src/guestfs-actions.pod:4757 ../src/guestfs-actions.pod:4794
6245 #: ../src/guestfs-actions.pod:4808 ../src/guestfs-actions.pod:4836
6246 #: ../src/guestfs-actions.pod:4853 ../src/guestfs-actions.pod:4871
6247 #: ../src/guestfs-actions.pod:5005 ../src/guestfs-actions.pod:5062
6248 #: ../src/guestfs-actions.pod:5084 ../src/guestfs-actions.pod:5102
6249 #: ../src/guestfs-actions.pod:5134 ../src/guestfs-actions.pod:5200
6250 #: ../src/guestfs-actions.pod:5217 ../src/guestfs-actions.pod:5230
6251 #: ../src/guestfs-actions.pod:5244 ../src/guestfs-actions.pod:5533
6252 #: ../src/guestfs-actions.pod:5552 ../src/guestfs-actions.pod:5571
6253 #: ../src/guestfs-actions.pod:5583 ../src/guestfs-actions.pod:5595
6254 #: ../src/guestfs-actions.pod:5609 ../src/guestfs-actions.pod:5621
6255 #: ../src/guestfs-actions.pod:5635 ../src/guestfs-actions.pod:5651
6256 #: ../src/guestfs-actions.pod:5672 ../src/guestfs-actions.pod:5691
6257 #: ../src/guestfs-actions.pod:5710 ../src/guestfs-actions.pod:5740
6258 #: ../src/guestfs-actions.pod:5756 ../src/guestfs-actions.pod:5779
6259 #: ../src/guestfs-actions.pod:5797 ../src/guestfs-actions.pod:5816
6260 #: ../src/guestfs-actions.pod:5837 ../src/guestfs-actions.pod:5856
6261 #: ../src/guestfs-actions.pod:5873 ../src/guestfs-actions.pod:5901
6262 #: ../src/guestfs-actions.pod:5925 ../src/guestfs-actions.pod:5944
6263 #: ../src/guestfs-actions.pod:5968 ../src/guestfs-actions.pod:5987
6264 #: ../src/guestfs-actions.pod:6002 ../src/guestfs-actions.pod:6021
6265 #: ../src/guestfs-actions.pod:6058 ../src/guestfs-actions.pod:6081
6266 #: ../src/guestfs-actions.pod:6107 ../src/guestfs-actions.pod:6215
6267 #: ../src/guestfs-actions.pod:6336 ../src/guestfs-actions.pod:6348
6268 #: ../src/guestfs-actions.pod:6361 ../src/guestfs-actions.pod:6374
6269 #: ../src/guestfs-actions.pod:6396 ../src/guestfs-actions.pod:6409
6270 #: ../src/guestfs-actions.pod:6422 ../src/guestfs-actions.pod:6435
6271 #: ../src/guestfs-actions.pod:6450 ../src/guestfs-actions.pod:6509
6272 #: ../src/guestfs-actions.pod:6526 ../src/guestfs-actions.pod:6542
6273 #: ../src/guestfs-actions.pod:6558 ../src/guestfs-actions.pod:6575
6274 #: ../src/guestfs-actions.pod:6588 ../src/guestfs-actions.pod:6608
6275 #: ../src/guestfs-actions.pod:6644 ../src/guestfs-actions.pod:6658
6276 #: ../src/guestfs-actions.pod:6699 ../src/guestfs-actions.pod:6712
6277 #: ../src/guestfs-actions.pod:6730 ../src/guestfs-actions.pod:6764
6278 #: ../src/guestfs-actions.pod:6800 ../src/guestfs-actions.pod:6919
6279 #: ../src/guestfs-actions.pod:6937 ../src/guestfs-actions.pod:6951
6280 #: ../src/guestfs-actions.pod:7006 ../src/guestfs-actions.pod:7019
6281 #: ../src/guestfs-actions.pod:7064 ../src/guestfs-actions.pod:7097
6282 #: ../src/guestfs-actions.pod:7151 ../src/guestfs-actions.pod:7177
6283 #: ../src/guestfs-actions.pod:7243 ../src/guestfs-actions.pod:7262
6284 #: ../src/guestfs-actions.pod:7291
6285 msgid "This function returns 0 on success or -1 on error."
6290 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:248
6291 #: ../src/guestfs-actions.pod:269 ../fish/guestfish-actions.pod:28
6292 #: ../fish/guestfish-actions.pod:158 ../fish/guestfish-actions.pod:172
6294 "This function is deprecated. In new code, use the C<add_drive_opts> call "
6300 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:251
6301 #: ../src/guestfs-actions.pod:272 ../src/guestfs-actions.pod:1443
6302 #: ../src/guestfs-actions.pod:1939 ../src/guestfs-actions.pod:1960
6303 #: ../src/guestfs-actions.pod:4340 ../src/guestfs-actions.pod:7185
6304 #: ../src/guestfs-actions.pod:7354 ../fish/guestfish-actions.pod:31
6305 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:175
6306 #: ../fish/guestfish-actions.pod:956 ../fish/guestfish-actions.pod:1319
6307 #: ../fish/guestfish-actions.pod:1333 ../fish/guestfish-actions.pod:2942
6308 #: ../fish/guestfish-actions.pod:4800 ../fish/guestfish-actions.pod:4897
6310 "Deprecated functions will not be removed from the API, but the fact that "
6311 "they are deprecated indicates that there are problems with correct use of "
6317 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:136
6318 #: ../src/guestfs-actions.pod:1100 ../src/guestfs-actions.pod:1911
6319 #: ../src/guestfs-actions.pod:2009 ../src/guestfs-actions.pod:2112
6320 #: ../src/guestfs-actions.pod:3377 ../src/guestfs-actions.pod:3392
6321 #: ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:5758
6322 #: ../src/guestfs-actions.pod:5875 ../src/guestfs-actions.pod:5989
6323 #: ../src/guestfs-actions.pod:6452 ../src/guestfs-actions.pod:6577
6324 #: ../src/guestfs-actions.pod:7099
6325 msgid "(Added in 0.3)"
6330 #: ../src/guestfs-actions.pod:41
6331 msgid "guestfs_add_domain"
6336 #: ../src/guestfs-actions.pod:43
6340 " guestfs_add_domain (guestfs_h *g,\n"
6341 " const char *dom,\n"
6348 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:145
6349 #: ../src/guestfs-actions.pod:4354
6351 "You may supply a list of optional arguments to this call. Use zero or more "
6352 "of the following pairs of parameters, and terminate the list with C<-1> on "
6353 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
6357 #: ../src/guestfs-actions.pod:53
6360 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
6361 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
6362 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
6363 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
6369 #: ../src/guestfs-actions.pod:58
6371 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
6372 "It works by connecting to libvirt, requesting the domain and domain XML from "
6373 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
6379 #: ../src/guestfs-actions.pod:63 ../fish/guestfish-actions.pod:46
6381 "The number of disks added is returned. This operation is atomic: if an "
6382 "error is returned, then no disks are added."
6387 #: ../src/guestfs-actions.pod:66 ../fish/guestfish-actions.pod:49
6389 "This function does some minimal checks to make sure the libvirt domain is "
6390 "not running (unless C<readonly> is true). In a future version we will try "
6391 "to acquire the libvirt lock on each disk."
6396 #: ../src/guestfs-actions.pod:70 ../fish/guestfish-actions.pod:53
6398 "Disks must be accessible locally. This often means that adding disks from a "
6399 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
6400 "unless those disks are accessible via the same device path locally too."
6404 #: ../src/guestfs-actions.pod:75 ../fish/guestfish-actions.pod:58
6406 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
6407 "libvirt.org/uri.html>). If this is not set then we connect to the default "
6408 "libvirt URI (or one set through an environment variable, see the libvirt "
6409 "documentation for full details)."
6413 #: ../src/guestfs-actions.pod:81 ../fish/guestfish-actions.pod:64
6415 "The optional C<live> flag controls whether this call will try to connect to "
6416 "a running virtual machine C<guestfsd> process if it sees a suitable "
6417 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
6418 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
6419 "DAEMONS> for more information."
6424 #: ../src/guestfs-actions.pod:88
6426 "The other optional parameters are passed directly through to "
6427 "C<guestfs_add_drive_opts>."
6432 #: ../src/guestfs-actions.pod:91 ../src/guestfs-actions.pod:344
6433 #: ../src/guestfs-actions.pod:509 ../src/guestfs-actions.pod:687
6434 #: ../src/guestfs-actions.pod:718 ../src/guestfs-actions.pod:736
6435 #: ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:1315
6436 #: ../src/guestfs-actions.pod:1669 ../src/guestfs-actions.pod:1872
6437 #: ../src/guestfs-actions.pod:1981 ../src/guestfs-actions.pod:2021
6438 #: ../src/guestfs-actions.pod:2076 ../src/guestfs-actions.pod:2099
6439 #: ../src/guestfs-actions.pod:2392 ../src/guestfs-actions.pod:2723
6440 #: ../src/guestfs-actions.pod:2744 ../src/guestfs-actions.pod:4780
6441 #: ../src/guestfs-actions.pod:4908 ../src/guestfs-actions.pod:5314
6442 #: ../src/guestfs-actions.pod:5340 ../src/guestfs-actions.pod:6685
6443 #: ../src/guestfs-actions.pod:7110 ../src/guestfs-actions.pod:7123
6444 #: ../src/guestfs-actions.pod:7136
6445 msgid "On error this function returns -1."
6450 #: ../src/guestfs-actions.pod:93
6451 msgid "(Added in 1.7.4)"
6456 #: ../src/guestfs-actions.pod:95
6457 msgid "guestfs_add_domain_va"
6462 #: ../src/guestfs-actions.pod:97
6466 " guestfs_add_domain_va (guestfs_h *g,\n"
6467 " const char *dom,\n"
6474 #: ../src/guestfs-actions.pod:102
6475 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
6480 #: ../src/guestfs-actions.pod:104 ../src/guestfs-actions.pod:115
6481 #: ../src/guestfs-actions.pod:208 ../src/guestfs-actions.pod:219
6482 #: ../src/guestfs-actions.pod:4407 ../src/guestfs-actions.pod:4419
6483 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
6488 #: ../src/guestfs-actions.pod:106
6489 msgid "guestfs_add_domain_argv"
6494 #: ../src/guestfs-actions.pod:108
6498 " guestfs_add_domain_argv (guestfs_h *g,\n"
6499 " const char *dom,\n"
6500 " const struct guestfs_add_domain_argv *optargs);\n"
6506 #: ../src/guestfs-actions.pod:113
6507 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
6512 #: ../src/guestfs-actions.pod:117
6513 msgid "guestfs_add_drive"
6518 #: ../src/guestfs-actions.pod:119
6522 " guestfs_add_drive (guestfs_h *g,\n"
6523 " const char *filename);\n"
6529 #: ../src/guestfs-actions.pod:123
6531 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
6532 "optional parameters, so the disk is added writable, with the format being "
6533 "detected automatically."
6538 #: ../src/guestfs-actions.pod:127
6540 "Automatic detection of the format opens you up to a potential security hole "
6541 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6542 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6543 "you should think about replacing calls to this function with calls to "
6544 "C<guestfs_add_drive_opts>, and specifying the format."
6549 #: ../src/guestfs-actions.pod:138
6550 msgid "guestfs_add_drive_opts"
6555 #: ../src/guestfs-actions.pod:140
6559 " guestfs_add_drive_opts (guestfs_h *g,\n"
6560 " const char *filename,\n"
6567 #: ../src/guestfs-actions.pod:150
6570 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
6571 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
6572 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
6578 #: ../src/guestfs-actions.pod:154 ../fish/guestfish-actions.pod:97
6580 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6581 "The first time you call this function, the disk appears as C</dev/sda>, the "
6582 "second time as C</dev/sdb>, and so on."
6587 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:102
6589 "You don't necessarily need to be root when using libguestfs. However you "
6590 "obviously do need sufficient permissions to access the filename for whatever "
6591 "operations you want to perform (ie. read access if you just want to read the "
6592 "image or write access if you want to modify the image)."
6597 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:108
6598 msgid "This call checks that C<filename> exists."
6603 #: ../src/guestfs-actions.pod:167 ../src/guestfs-actions.pod:4365
6604 #: ../fish/guestfish-actions.pod:110 ../fish/guestfish-actions.pod:2953
6605 msgid "The optional arguments are:"
6610 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:114
6616 #: ../src/guestfs-actions.pod:173 ../fish/guestfish-actions.pod:116
6618 "If true then the image is treated as read-only. Writes are still allowed, "
6619 "but they are stored in a temporary snapshot overlay which is discarded at "
6620 "the end. The disk that you add is not modified."
6625 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:120
6631 #: ../src/guestfs-actions.pod:179
6633 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
6634 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
6635 "Possible formats include C<raw> and C<qcow2>."
6640 #: ../src/guestfs-actions.pod:183 ../fish/guestfish-actions.pod:126
6642 "Automatic detection of the format opens you up to a potential security hole "
6643 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6644 "RHBZ#642934. Specifying the format closes this security hole."
6649 #: ../src/guestfs-actions.pod:188 ../fish/guestfish-actions.pod:131
6655 #: ../src/guestfs-actions.pod:190
6657 "This rarely-used option lets you emulate the behaviour of the deprecated "
6658 "C<guestfs_add_drive_with_if> call (q.v.)"
6663 #: ../src/guestfs-actions.pod:197
6664 msgid "(Added in 1.5.23)"
6669 #: ../src/guestfs-actions.pod:199
6670 msgid "guestfs_add_drive_opts_va"
6675 #: ../src/guestfs-actions.pod:201
6679 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
6680 " const char *filename,\n"
6687 #: ../src/guestfs-actions.pod:206
6688 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
6693 #: ../src/guestfs-actions.pod:210
6694 msgid "guestfs_add_drive_opts_argv"
6699 #: ../src/guestfs-actions.pod:212
6703 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
6704 " const char *filename,\n"
6705 " const struct guestfs_add_drive_opts_argv *optargs);\n"
6711 #: ../src/guestfs-actions.pod:217
6712 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
6717 #: ../src/guestfs-actions.pod:221
6718 msgid "guestfs_add_drive_ro"
6723 #: ../src/guestfs-actions.pod:223
6727 " guestfs_add_drive_ro (guestfs_h *g,\n"
6728 " const char *filename);\n"
6734 #: ../src/guestfs-actions.pod:227
6736 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
6737 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
6738 "disk is added read-only, with the format being detected automatically."
6743 #: ../src/guestfs-actions.pod:234
6744 msgid "(Added in 1.0.38)"
6749 #: ../src/guestfs-actions.pod:236
6750 msgid "guestfs_add_drive_ro_with_if"
6755 #: ../src/guestfs-actions.pod:238
6759 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
6760 " const char *filename,\n"
6761 " const char *iface);\n"
6767 #: ../src/guestfs-actions.pod:243
6769 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
6770 "QEMU interface emulation to use at run time."
6775 #: ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276
6776 #: ../src/guestfs-actions.pod:2351
6777 msgid "(Added in 1.0.84)"
6782 #: ../src/guestfs-actions.pod:257
6783 msgid "guestfs_add_drive_with_if"
6788 #: ../src/guestfs-actions.pod:259
6792 " guestfs_add_drive_with_if (guestfs_h *g,\n"
6793 " const char *filename,\n"
6794 " const char *iface);\n"
6800 #: ../src/guestfs-actions.pod:264
6802 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
6803 "QEMU interface emulation to use at run time."
6808 #: ../src/guestfs-actions.pod:278
6809 msgid "guestfs_aug_clear"
6814 #: ../src/guestfs-actions.pod:280
6818 " guestfs_aug_clear (guestfs_h *g,\n"
6819 " const char *augpath);\n"
6825 #: ../src/guestfs-actions.pod:284 ../fish/guestfish-actions.pod:183
6827 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6828 "L<augtool(1)> C<clear> command."
6833 #: ../src/guestfs-actions.pod:289 ../src/guestfs-actions.pod:2101
6834 msgid "(Added in 1.3.4)"
6839 #: ../src/guestfs-actions.pod:291
6840 msgid "guestfs_aug_close"
6845 #: ../src/guestfs-actions.pod:293
6849 " guestfs_aug_close (guestfs_h *g);\n"
6855 #: ../src/guestfs-actions.pod:296
6857 "Close the current Augeas handle and free up any resources used by it. After "
6858 "calling this, you have to call C<guestfs_aug_init> again before you can use "
6859 "any other Augeas functions."
6864 #: ../src/guestfs-actions.pod:303 ../src/guestfs-actions.pod:328
6865 #: ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360
6866 #: ../src/guestfs-actions.pod:418 ../src/guestfs-actions.pod:438
6867 #: ../src/guestfs-actions.pod:452 ../src/guestfs-actions.pod:483
6868 #: ../src/guestfs-actions.pod:497 ../src/guestfs-actions.pod:511
6869 #: ../src/guestfs-actions.pod:525 ../src/guestfs-actions.pod:543
6870 #: ../src/guestfs-actions.pod:5391
6871 msgid "(Added in 0.7)"
6876 #: ../src/guestfs-actions.pod:305
6877 msgid "guestfs_aug_defnode"
6882 #: ../src/guestfs-actions.pod:307
6885 " struct guestfs_int_bool *\n"
6886 " guestfs_aug_defnode (guestfs_h *g,\n"
6887 " const char *name,\n"
6888 " const char *expr,\n"
6889 " const char *val);\n"
6895 #: ../src/guestfs-actions.pod:313 ../fish/guestfish-actions.pod:199
6897 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6902 #: ../src/guestfs-actions.pod:316
6904 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6905 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
6906 "containing that single node."
6911 #: ../src/guestfs-actions.pod:320 ../fish/guestfish-actions.pod:206
6913 "On success this returns a pair containing the number of nodes in the "
6914 "nodeset, and a boolean flag if a node was created."
6919 #: ../src/guestfs-actions.pod:324
6921 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
6922 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
6927 #: ../src/guestfs-actions.pod:330
6928 msgid "guestfs_aug_defvar"
6933 #: ../src/guestfs-actions.pod:332
6937 " guestfs_aug_defvar (guestfs_h *g,\n"
6938 " const char *name,\n"
6939 " const char *expr);\n"
6945 #: ../src/guestfs-actions.pod:337 ../fish/guestfish-actions.pod:214
6947 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6948 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6953 #: ../src/guestfs-actions.pod:341 ../fish/guestfish-actions.pod:218
6955 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6956 "evaluates to something which is not a nodeset."
6961 #: ../src/guestfs-actions.pod:348
6962 msgid "guestfs_aug_get"
6967 #: ../src/guestfs-actions.pod:350
6971 " guestfs_aug_get (guestfs_h *g,\n"
6972 " const char *augpath);\n"
6978 #: ../src/guestfs-actions.pod:354 ../fish/guestfish-actions.pod:225
6980 "Look up the value associated with C<path>. If C<path> matches exactly one "
6981 "node, the C<value> is returned."
6986 #: ../src/guestfs-actions.pod:357 ../src/guestfs-actions.pod:857
6987 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:935
6988 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1054
6989 #: ../src/guestfs-actions.pod:1184 ../src/guestfs-actions.pod:1201
6990 #: ../src/guestfs-actions.pod:1220 ../src/guestfs-actions.pod:1349
6991 #: ../src/guestfs-actions.pod:1540 ../src/guestfs-actions.pod:1652
6992 #: ../src/guestfs-actions.pod:1815 ../src/guestfs-actions.pod:1832
6993 #: ../src/guestfs-actions.pod:1899 ../src/guestfs-actions.pod:1933
6994 #: ../src/guestfs-actions.pod:1954 ../src/guestfs-actions.pod:2124
6995 #: ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2523
6996 #: ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:2675
6997 #: ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2809
6998 #: ../src/guestfs-actions.pod:2840 ../src/guestfs-actions.pod:2864
6999 #: ../src/guestfs-actions.pod:2901 ../src/guestfs-actions.pod:2961
7000 #: ../src/guestfs-actions.pod:2984 ../src/guestfs-actions.pod:3551
7001 #: ../src/guestfs-actions.pod:3901 ../src/guestfs-actions.pod:4071
7002 #: ../src/guestfs-actions.pod:4181 ../src/guestfs-actions.pod:4926
7003 #: ../src/guestfs-actions.pod:5119 ../src/guestfs-actions.pod:5289
7004 #: ../src/guestfs-actions.pod:5467 ../src/guestfs-actions.pod:5516
7005 #: ../src/guestfs-actions.pod:6128 ../src/guestfs-actions.pod:6144
7006 #: ../src/guestfs-actions.pod:6161 ../src/guestfs-actions.pod:6185
7007 #: ../src/guestfs-actions.pod:6859 ../src/guestfs-actions.pod:6878
7008 #: ../src/guestfs-actions.pod:6896 ../src/guestfs-actions.pod:7076
7009 #: ../src/guestfs-actions.pod:7348
7011 "This function returns a string, or NULL on error. I<The caller must free "
7012 "the returned string after use>."
7017 #: ../src/guestfs-actions.pod:362
7018 msgid "guestfs_aug_init"
7023 #: ../src/guestfs-actions.pod:364
7027 " guestfs_aug_init (guestfs_h *g,\n"
7028 " const char *root,\n"
7035 #: ../src/guestfs-actions.pod:369 ../fish/guestfish-actions.pod:232
7037 "Create a new Augeas handle for editing configuration files. If there was "
7038 "any previous Augeas handle associated with this guestfs session, then it is "
7044 #: ../src/guestfs-actions.pod:373
7045 msgid "You must call this before using any other C<guestfs_aug_*> commands."
7050 #: ../src/guestfs-actions.pod:376 ../fish/guestfish-actions.pod:239
7052 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
7057 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:242
7059 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
7060 "logical I<or> of the following integers:"
7065 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:248
7066 msgid "C<AUG_SAVE_BACKUP> = 1"
7071 #: ../src/guestfs-actions.pod:387 ../fish/guestfish-actions.pod:250
7072 msgid "Keep the original file with a C<.augsave> extension."
7077 #: ../src/guestfs-actions.pod:389 ../fish/guestfish-actions.pod:252
7078 msgid "C<AUG_SAVE_NEWFILE> = 2"
7083 #: ../src/guestfs-actions.pod:391 ../fish/guestfish-actions.pod:254
7085 "Save changes into a file with extension C<.augnew>, and do not overwrite "
7086 "original. Overrides C<AUG_SAVE_BACKUP>."
7091 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:257
7092 msgid "C<AUG_TYPE_CHECK> = 4"
7097 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:259
7098 msgid "Typecheck lenses (can be expensive)."
7103 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:261
7104 msgid "C<AUG_NO_STDINC> = 8"
7109 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:263
7110 msgid "Do not use standard load path for modules."
7115 #: ../src/guestfs-actions.pod:402 ../fish/guestfish-actions.pod:265
7116 msgid "C<AUG_SAVE_NOOP> = 16"
7121 #: ../src/guestfs-actions.pod:404 ../fish/guestfish-actions.pod:267
7122 msgid "Make save a no-op, just record what would have been changed."
7127 #: ../src/guestfs-actions.pod:406 ../fish/guestfish-actions.pod:269
7128 msgid "C<AUG_NO_LOAD> = 32"
7133 #: ../src/guestfs-actions.pod:408
7134 msgid "Do not load the tree in C<guestfs_aug_init>."
7139 #: ../src/guestfs-actions.pod:412
7140 msgid "To close the handle, you can call C<guestfs_aug_close>."
7145 #: ../src/guestfs-actions.pod:414 ../fish/guestfish-actions.pod:277
7146 msgid "To find out more about Augeas, see L<http://augeas.net/>."
7151 #: ../src/guestfs-actions.pod:420
7152 msgid "guestfs_aug_insert"
7157 #: ../src/guestfs-actions.pod:422
7161 " guestfs_aug_insert (guestfs_h *g,\n"
7162 " const char *augpath,\n"
7163 " const char *label,\n"
7170 #: ../src/guestfs-actions.pod:428 ../fish/guestfish-actions.pod:283
7172 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
7173 "or after C<path> (depending on the boolean flag C<before>)."
7178 #: ../src/guestfs-actions.pod:432 ../fish/guestfish-actions.pod:287
7180 "C<path> must match exactly one existing node in the tree, and C<label> must "
7181 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
7186 #: ../src/guestfs-actions.pod:440
7187 msgid "guestfs_aug_load"
7192 #: ../src/guestfs-actions.pod:442
7196 " guestfs_aug_load (guestfs_h *g);\n"
7202 #: ../src/guestfs-actions.pod:445 ../fish/guestfish-actions.pod:295
7203 msgid "Load files into the tree."
7208 #: ../src/guestfs-actions.pod:447 ../fish/guestfish-actions.pod:297
7209 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
7214 #: ../src/guestfs-actions.pod:454
7215 msgid "guestfs_aug_ls"
7220 #: ../src/guestfs-actions.pod:456
7224 " guestfs_aug_ls (guestfs_h *g,\n"
7225 " const char *augpath);\n"
7231 #: ../src/guestfs-actions.pod:460
7233 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
7234 "sorting the resulting nodes into alphabetical order."
7239 #: ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:479
7240 #: ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:1073
7241 #: ../src/guestfs-actions.pod:1364 ../src/guestfs-actions.pod:1383
7242 #: ../src/guestfs-actions.pod:1486 ../src/guestfs-actions.pod:1505
7243 #: ../src/guestfs-actions.pod:1754 ../src/guestfs-actions.pod:2196
7244 #: ../src/guestfs-actions.pod:2212 ../src/guestfs-actions.pod:2231
7245 #: ../src/guestfs-actions.pod:2274 ../src/guestfs-actions.pod:2298
7246 #: ../src/guestfs-actions.pod:2369 ../src/guestfs-actions.pod:2418
7247 #: ../src/guestfs-actions.pod:2633 ../src/guestfs-actions.pod:2918
7248 #: ../src/guestfs-actions.pod:3186 ../src/guestfs-actions.pod:3471
7249 #: ../src/guestfs-actions.pod:3533 ../src/guestfs-actions.pod:3638
7250 #: ../src/guestfs-actions.pod:4043 ../src/guestfs-actions.pod:4741
7251 #: ../src/guestfs-actions.pod:5261 ../src/guestfs-actions.pod:5387
7252 #: ../src/guestfs-actions.pod:5501 ../src/guestfs-actions.pod:6201
7253 #: ../src/guestfs-actions.pod:6262 ../src/guestfs-actions.pod:6317
7254 #: ../src/guestfs-actions.pod:6463 ../src/guestfs-actions.pod:6487
7255 #: ../src/guestfs-actions.pod:6969 ../src/guestfs-actions.pod:6989
7256 #: ../src/guestfs-actions.pod:7036 ../src/guestfs-actions.pod:7201
7257 #: ../src/guestfs-actions.pod:7220 ../src/guestfs-actions.pod:7305
7258 #: ../src/guestfs-actions.pod:7324 ../src/guestfs-actions.pod:7370
7259 #: ../src/guestfs-actions.pod:7389
7261 "This function returns a NULL-terminated array of strings (like L<environ(3)"
7262 ">), or NULL if there was an error. I<The caller must free the strings and "
7263 "the array after use>."
7268 #: ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:998
7269 #: ../src/guestfs-actions.pod:1016 ../src/guestfs-actions.pod:1421
7270 #: ../src/guestfs-actions.pod:3264 ../src/guestfs-actions.pod:3295
7271 #: ../src/guestfs-actions.pod:3884 ../src/guestfs-actions.pod:3934
7272 #: ../src/guestfs-actions.pod:4121 ../src/guestfs-actions.pod:4154
7273 #: ../src/guestfs-actions.pod:4317 ../src/guestfs-actions.pod:4745
7274 #: ../src/guestfs-actions.pod:5202 ../src/guestfs-actions.pod:5597
7275 #: ../src/guestfs-actions.pod:5611 ../src/guestfs-actions.pod:5623
7276 #: ../src/guestfs-actions.pod:6063 ../src/guestfs-actions.pod:6701
7277 #: ../src/guestfs-actions.pod:6714 ../src/guestfs-actions.pod:6953
7278 #: ../src/guestfs-actions.pod:7189
7279 msgid "(Added in 0.8)"
7284 #: ../src/guestfs-actions.pod:469
7285 msgid "guestfs_aug_match"
7290 #: ../src/guestfs-actions.pod:471
7294 " guestfs_aug_match (guestfs_h *g,\n"
7295 " const char *augpath);\n"
7301 #: ../src/guestfs-actions.pod:475 ../fish/guestfish-actions.pod:311
7303 "Returns a list of paths which match the path expression C<path>. The "
7304 "returned paths are sufficiently qualified so that they match exactly one "
7305 "node in the current tree."
7310 #: ../src/guestfs-actions.pod:485
7311 msgid "guestfs_aug_mv"
7316 #: ../src/guestfs-actions.pod:487
7320 " guestfs_aug_mv (guestfs_h *g,\n"
7321 " const char *src,\n"
7322 " const char *dest);\n"
7328 #: ../src/guestfs-actions.pod:492 ../fish/guestfish-actions.pod:319
7330 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
7331 "C<dest> is overwritten if it exists."
7336 #: ../src/guestfs-actions.pod:499
7337 msgid "guestfs_aug_rm"
7342 #: ../src/guestfs-actions.pod:501
7346 " guestfs_aug_rm (guestfs_h *g,\n"
7347 " const char *augpath);\n"
7353 #: ../src/guestfs-actions.pod:505 ../fish/guestfish-actions.pod:326
7354 msgid "Remove C<path> and all of its children."
7359 #: ../src/guestfs-actions.pod:507 ../fish/guestfish-actions.pod:328
7360 msgid "On success this returns the number of entries which were removed."
7365 #: ../src/guestfs-actions.pod:513
7366 msgid "guestfs_aug_save"
7371 #: ../src/guestfs-actions.pod:515
7375 " guestfs_aug_save (guestfs_h *g);\n"
7381 #: ../src/guestfs-actions.pod:518 ../fish/guestfish-actions.pod:334
7382 msgid "This writes all pending changes to disk."
7387 #: ../src/guestfs-actions.pod:520
7389 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
7395 #: ../src/guestfs-actions.pod:527
7396 msgid "guestfs_aug_set"
7401 #: ../src/guestfs-actions.pod:529
7405 " guestfs_aug_set (guestfs_h *g,\n"
7406 " const char *augpath,\n"
7407 " const char *val);\n"
7413 #: ../src/guestfs-actions.pod:534 ../fish/guestfish-actions.pod:343
7414 msgid "Set the value associated with C<path> to C<val>."
7419 #: ../src/guestfs-actions.pod:536
7421 "In the Augeas API, it is possible to clear a node by setting the value to "
7422 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
7423 "this call. Instead you must use the C<guestfs_aug_clear> call."
7428 #: ../src/guestfs-actions.pod:545
7429 msgid "guestfs_available"
7434 #: ../src/guestfs-actions.pod:547
7438 " guestfs_available (guestfs_h *g,\n"
7439 " char *const *groups);\n"
7445 #: ../src/guestfs-actions.pod:551 ../fish/guestfish-actions.pod:354
7447 "This command is used to check the availability of some groups of "
7448 "functionality in the appliance, which not all builds of the libguestfs "
7449 "appliance will be able to provide."
7454 #: ../src/guestfs-actions.pod:555
7456 "The libguestfs groups, and the functions that those groups correspond to, "
7457 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
7458 "runtime by calling C<guestfs_available_all_groups>."
7463 #: ../src/guestfs-actions.pod:560 ../fish/guestfish-actions.pod:363
7465 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
7466 "\"]> would check for the availability of the Linux inotify functions and "
7467 "Augeas (configuration file editing) functions."
7472 #: ../src/guestfs-actions.pod:565 ../fish/guestfish-actions.pod:368
7473 msgid "The command returns no error if I<all> requested groups are available."
7478 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:370
7480 "It fails with an error if one or more of the requested groups is unavailable "
7486 #: ../src/guestfs-actions.pod:570 ../fish/guestfish-actions.pod:373
7488 "If an unknown group name is included in the list of groups then an error is "
7494 #: ../src/guestfs-actions.pod:573 ../fish/guestfish-actions.pod:376
7500 #: ../src/guestfs-actions.pod:579
7501 msgid "You must call C<guestfs_launch> before calling this function."
7506 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:384
7508 "The reason is because we don't know what groups are supported by the "
7509 "appliance/daemon until it is running and can be queried."
7514 #: ../src/guestfs-actions.pod:587 ../fish/guestfish-actions.pod:390
7516 "If a group of functions is available, this does not necessarily mean that "
7517 "they will work. You still have to check for errors when calling individual "
7518 "API functions even if they are available."
7523 #: ../src/guestfs-actions.pod:594 ../fish/guestfish-actions.pod:397
7525 "It is usually the job of distro packagers to build complete functionality "
7526 "into the libguestfs appliance. Upstream libguestfs, if built from source "
7527 "with all requirements satisfied, will support everything."
7532 #: ../src/guestfs-actions.pod:601
7534 "This call was added in version C<1.0.80>. In previous versions of "
7535 "libguestfs all you could do would be to speculatively execute a command to "
7536 "find out if the daemon implemented it. See also C<guestfs_version>."
7541 #: ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1171
7542 msgid "(Added in 1.0.80)"
7547 #: ../src/guestfs-actions.pod:612
7548 msgid "guestfs_available_all_groups"
7553 #: ../src/guestfs-actions.pod:614
7557 " guestfs_available_all_groups (guestfs_h *g);\n"
7563 #: ../src/guestfs-actions.pod:617
7565 "This command returns a list of all optional groups that this daemon knows "
7566 "about. Note this returns both supported and unsupported groups. To find "
7567 "out which ones the daemon can actually support you have to call "
7568 "C<guestfs_available> on each member of the returned list."
7573 #: ../src/guestfs-actions.pod:623
7574 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
7579 #: ../src/guestfs-actions.pod:629
7580 msgid "(Added in 1.3.15)"
7585 #: ../src/guestfs-actions.pod:631
7586 msgid "guestfs_base64_in"
7591 #: ../src/guestfs-actions.pod:633
7595 " guestfs_base64_in (guestfs_h *g,\n"
7596 " const char *base64file,\n"
7597 " const char *filename);\n"
7603 #: ../src/guestfs-actions.pod:638 ../fish/guestfish-actions.pod:427
7605 "This command uploads base64-encoded data from C<base64file> to C<filename>."
7610 #: ../src/guestfs-actions.pod:643 ../src/guestfs-actions.pod:657
7611 msgid "(Added in 1.3.5)"
7616 #: ../src/guestfs-actions.pod:645
7617 msgid "guestfs_base64_out"
7622 #: ../src/guestfs-actions.pod:647
7626 " guestfs_base64_out (guestfs_h *g,\n"
7627 " const char *filename,\n"
7628 " const char *base64file);\n"
7634 #: ../src/guestfs-actions.pod:652 ../fish/guestfish-actions.pod:436
7636 "This command downloads the contents of C<filename>, writing it out to local "
7637 "file C<base64file> encoded as base64."
7642 #: ../src/guestfs-actions.pod:659
7643 msgid "guestfs_blockdev_flushbufs"
7648 #: ../src/guestfs-actions.pod:661
7652 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
7653 " const char *device);\n"
7659 #: ../src/guestfs-actions.pod:665 ../fish/guestfish-actions.pod:445
7661 "This tells the kernel to flush internal buffers associated with C<device>."
7666 #: ../src/guestfs-actions.pod:668 ../src/guestfs-actions.pod:685
7667 #: ../src/guestfs-actions.pod:700 ../src/guestfs-actions.pod:716
7668 #: ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:753
7669 #: ../src/guestfs-actions.pod:767 ../src/guestfs-actions.pod:785
7670 #: ../src/guestfs-actions.pod:799 ../src/guestfs-actions.pod:813
7671 #: ../fish/guestfish-actions.pod:448 ../fish/guestfish-actions.pod:459
7672 #: ../fish/guestfish-actions.pod:468 ../fish/guestfish-actions.pod:478
7673 #: ../fish/guestfish-actions.pod:490 ../fish/guestfish-actions.pod:503
7674 #: ../fish/guestfish-actions.pod:511 ../fish/guestfish-actions.pod:522
7675 #: ../fish/guestfish-actions.pod:530 ../fish/guestfish-actions.pod:538
7676 msgid "This uses the L<blockdev(8)> command."
7681 #: ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:689
7682 #: ../src/guestfs-actions.pod:704 ../src/guestfs-actions.pod:720
7683 #: ../src/guestfs-actions.pod:738 ../src/guestfs-actions.pod:757
7684 #: ../src/guestfs-actions.pod:771 ../src/guestfs-actions.pod:789
7685 #: ../src/guestfs-actions.pod:803 ../src/guestfs-actions.pod:817
7686 msgid "(Added in 0.9.3)"
7691 #: ../src/guestfs-actions.pod:674
7692 msgid "guestfs_blockdev_getbsz"
7697 #: ../src/guestfs-actions.pod:676
7701 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
7702 " const char *device);\n"
7708 #: ../src/guestfs-actions.pod:680 ../fish/guestfish-actions.pod:454
7709 msgid "This returns the block size of a device."
7714 #: ../src/guestfs-actions.pod:682 ../src/guestfs-actions.pod:782
7715 #: ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:519
7717 "(Note this is different from both I<size in blocks> and I<filesystem block "
7723 #: ../src/guestfs-actions.pod:691
7724 msgid "guestfs_blockdev_getro"
7729 #: ../src/guestfs-actions.pod:693
7733 " guestfs_blockdev_getro (guestfs_h *g,\n"
7734 " const char *device);\n"
7740 #: ../src/guestfs-actions.pod:697 ../fish/guestfish-actions.pod:465
7742 "Returns a boolean indicating if the block device is read-only (true if read-"
7743 "only, false if not)."
7748 #: ../src/guestfs-actions.pod:702 ../src/guestfs-actions.pod:1404
7749 #: ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1909
7750 #: ../src/guestfs-actions.pod:1920 ../src/guestfs-actions.pod:1992
7751 #: ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2062
7752 #: ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2110
7753 #: ../src/guestfs-actions.pod:3004 ../src/guestfs-actions.pod:3021
7754 #: ../src/guestfs-actions.pod:3040 ../src/guestfs-actions.pod:3203
7755 #: ../src/guestfs-actions.pod:3217 ../src/guestfs-actions.pod:3232
7756 #: ../src/guestfs-actions.pod:3246 ../src/guestfs-actions.pod:3262
7757 #: ../src/guestfs-actions.pod:3277 ../src/guestfs-actions.pod:3293
7758 #: ../src/guestfs-actions.pod:3307 ../src/guestfs-actions.pod:3320
7759 #: ../src/guestfs-actions.pod:3334 ../src/guestfs-actions.pod:3349
7760 #: ../src/guestfs-actions.pod:3364 ../src/guestfs-actions.pod:4890
7761 msgid "This function returns a C truth value on success or -1 on error."
7766 #: ../src/guestfs-actions.pod:706
7767 msgid "guestfs_blockdev_getsize64"
7772 #: ../src/guestfs-actions.pod:708
7776 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
7777 " const char *device);\n"
7783 #: ../src/guestfs-actions.pod:712 ../fish/guestfish-actions.pod:474
7784 msgid "This returns the size of the device in bytes."
7789 #: ../src/guestfs-actions.pod:714
7790 msgid "See also C<guestfs_blockdev_getsz>."
7795 #: ../src/guestfs-actions.pod:722
7796 msgid "guestfs_blockdev_getss"
7801 #: ../src/guestfs-actions.pod:724
7805 " guestfs_blockdev_getss (guestfs_h *g,\n"
7806 " const char *device);\n"
7812 #: ../src/guestfs-actions.pod:728 ../fish/guestfish-actions.pod:484
7814 "This returns the size of sectors on a block device. Usually 512, but can be "
7815 "larger for modern devices."
7820 #: ../src/guestfs-actions.pod:731
7822 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
7828 #: ../src/guestfs-actions.pod:740
7829 msgid "guestfs_blockdev_getsz"
7834 #: ../src/guestfs-actions.pod:742
7838 " guestfs_blockdev_getsz (guestfs_h *g,\n"
7839 " const char *device);\n"
7845 #: ../src/guestfs-actions.pod:746 ../fish/guestfish-actions.pod:496
7847 "This returns the size of the device in units of 512-byte sectors (even if "
7848 "the sectorsize isn't 512 bytes ... weird)."
7853 #: ../src/guestfs-actions.pod:749
7855 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
7856 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
7861 #: ../src/guestfs-actions.pod:759
7862 msgid "guestfs_blockdev_rereadpt"
7867 #: ../src/guestfs-actions.pod:761
7871 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
7872 " const char *device);\n"
7878 #: ../src/guestfs-actions.pod:765 ../fish/guestfish-actions.pod:509
7879 msgid "Reread the partition table on C<device>."
7884 #: ../src/guestfs-actions.pod:773
7885 msgid "guestfs_blockdev_setbsz"
7890 #: ../src/guestfs-actions.pod:775
7894 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
7895 " const char *device,\n"
7896 " int blocksize);\n"
7902 #: ../src/guestfs-actions.pod:780 ../fish/guestfish-actions.pod:517
7903 msgid "This sets the block size of a device."
7908 #: ../src/guestfs-actions.pod:791
7909 msgid "guestfs_blockdev_setro"
7914 #: ../src/guestfs-actions.pod:793
7918 " guestfs_blockdev_setro (guestfs_h *g,\n"
7919 " const char *device);\n"
7925 #: ../src/guestfs-actions.pod:797 ../fish/guestfish-actions.pod:528
7926 msgid "Sets the block device named C<device> to read-only."
7931 #: ../src/guestfs-actions.pod:805
7932 msgid "guestfs_blockdev_setrw"
7937 #: ../src/guestfs-actions.pod:807
7941 " guestfs_blockdev_setrw (guestfs_h *g,\n"
7942 " const char *device);\n"
7948 #: ../src/guestfs-actions.pod:811 ../fish/guestfish-actions.pod:536
7949 msgid "Sets the block device named C<device> to read-write."
7954 #: ../src/guestfs-actions.pod:819
7955 msgid "guestfs_case_sensitive_path"
7960 #: ../src/guestfs-actions.pod:821
7964 " guestfs_case_sensitive_path (guestfs_h *g,\n"
7965 " const char *path);\n"
7971 #: ../src/guestfs-actions.pod:825 ../fish/guestfish-actions.pod:544
7973 "This can be used to resolve case insensitive paths on a filesystem which is "
7974 "case sensitive. The use case is to resolve paths which you have read from "
7975 "Windows configuration files or the Windows Registry, to the true path."
7980 #: ../src/guestfs-actions.pod:830 ../fish/guestfish-actions.pod:549
7982 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7983 "(and probably others), which is that although the underlying filesystem is "
7984 "case-insensitive, the driver exports the filesystem to Linux as case-"
7990 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:554
7992 "One consequence of this is that special directories such as C<c:\\windows> "
7993 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7994 "precise details of how they were created. In Windows itself this would not "
8000 #: ../src/guestfs-actions.pod:841 ../fish/guestfish-actions.pod:560
8002 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
8008 #: ../src/guestfs-actions.pod:844 ../fish/guestfish-actions.pod:563
8010 "This function resolves the true case of each element in the path and returns "
8011 "the case-sensitive path."
8016 #: ../src/guestfs-actions.pod:847
8018 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
8019 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
8020 "how the directories were originally created under Windows)."
8025 #: ../src/guestfs-actions.pod:852 ../fish/guestfish-actions.pod:571
8026 msgid "I<Note>: This function does not handle drive names, backslashes etc."
8031 #: ../src/guestfs-actions.pod:855
8032 msgid "See also C<guestfs_realpath>."
8037 #: ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:6881
8038 msgid "(Added in 1.0.75)"
8043 #: ../src/guestfs-actions.pod:862
8049 #: ../src/guestfs-actions.pod:864
8053 " guestfs_cat (guestfs_h *g,\n"
8054 " const char *path);\n"
8060 #: ../src/guestfs-actions.pod:868 ../src/guestfs-actions.pod:5377
8061 #: ../fish/guestfish-actions.pod:580 ../fish/guestfish-actions.pod:3601
8062 msgid "Return the contents of the file named C<path>."
8067 #: ../src/guestfs-actions.pod:870
8069 "Note that this function cannot correctly handle binary files (specifically, "
8070 "files containing C<\\0> character which is treated as end of string). For "
8071 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
8072 "functions which have a more complex interface."
8077 #: ../src/guestfs-actions.pod:878 ../src/guestfs-actions.pod:1057
8078 #: ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:1368
8079 #: ../src/guestfs-actions.pod:1387 ../src/guestfs-actions.pod:1490
8080 #: ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:1758
8081 #: ../src/guestfs-actions.pod:2216 ../src/guestfs-actions.pod:2235
8082 #: ../src/guestfs-actions.pod:2278 ../src/guestfs-actions.pod:2302
8083 #: ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:2348
8084 #: ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:5185
8085 #: ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5342
8086 #: ../src/guestfs-actions.pod:5366 ../src/guestfs-actions.pod:6266
8087 #: ../src/guestfs-actions.pod:6321 ../src/guestfs-actions.pod:6467
8088 #: ../src/guestfs-actions.pod:6491 ../src/guestfs-actions.pod:7153
8089 #: ../src/guestfs-actions.pod:7179 ../src/guestfs-actions.pod:7205
8090 #: ../src/guestfs-actions.pod:7224 ../src/guestfs-actions.pod:7309
8091 #: ../src/guestfs-actions.pod:7328 ../src/guestfs-actions.pod:7374
8092 #: ../src/guestfs-actions.pod:7393 ../fish/guestfish-actions.pod:587
8093 #: ../fish/guestfish-actions.pod:722 ../fish/guestfish-actions.pod:734
8094 #: ../fish/guestfish-actions.pod:910 ../fish/guestfish-actions.pod:920
8095 #: ../fish/guestfish-actions.pod:987 ../fish/guestfish-actions.pod:997
8096 #: ../fish/guestfish-actions.pod:1192 ../fish/guestfish-actions.pod:1493
8097 #: ../fish/guestfish-actions.pod:1503 ../fish/guestfish-actions.pod:1531
8098 #: ../fish/guestfish-actions.pod:1546 ../fish/guestfish-actions.pod:1556
8099 #: ../fish/guestfish-actions.pod:1575 ../fish/guestfish-actions.pod:3471
8100 #: ../fish/guestfish-actions.pod:3486 ../fish/guestfish-actions.pod:3562
8101 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3594
8102 #: ../fish/guestfish-actions.pod:4220 ../fish/guestfish-actions.pod:4266
8103 #: ../fish/guestfish-actions.pod:4351 ../fish/guestfish-actions.pod:4366
8104 #: ../fish/guestfish-actions.pod:4776 ../fish/guestfish-actions.pod:4794
8105 #: ../fish/guestfish-actions.pod:4811 ../fish/guestfish-actions.pod:4821
8106 #: ../fish/guestfish-actions.pod:4869 ../fish/guestfish-actions.pod:4879
8107 #: ../fish/guestfish-actions.pod:4908 ../fish/guestfish-actions.pod:4918
8109 "Because of the message protocol, there is a transfer limit of somewhere "
8110 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
8115 #: ../src/guestfs-actions.pod:881 ../src/guestfs-actions.pod:3475
8116 #: ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3554
8117 #: ../src/guestfs-actions.pod:3642 ../src/guestfs-actions.pod:4047
8118 #: ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:5265
8119 #: ../src/guestfs-actions.pod:5279 ../src/guestfs-actions.pod:7040
8120 #: ../src/guestfs-actions.pod:7054
8121 msgid "(Added in 0.4)"
8126 #: ../src/guestfs-actions.pod:883
8127 msgid "guestfs_checksum"
8132 #: ../src/guestfs-actions.pod:885
8136 " guestfs_checksum (guestfs_h *g,\n"
8137 " const char *csumtype,\n"
8138 " const char *path);\n"
8144 #: ../src/guestfs-actions.pod:890 ../fish/guestfish-actions.pod:594
8146 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
8151 #: ../src/guestfs-actions.pod:893 ../fish/guestfish-actions.pod:597
8153 "The type of checksum to compute is given by the C<csumtype> parameter which "
8154 "must have one of the following values:"
8159 #: ../src/guestfs-actions.pod:898 ../fish/guestfish-actions.pod:602
8165 #: ../src/guestfs-actions.pod:900 ../fish/guestfish-actions.pod:604
8167 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
8173 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:607
8179 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:609
8180 msgid "Compute the MD5 hash (using the C<md5sum> program)."
8185 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:611
8191 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:613
8192 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
8197 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:615
8203 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:617
8204 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
8209 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:619
8215 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:621
8216 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
8221 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:623
8227 #: ../src/guestfs-actions.pod:921 ../fish/guestfish-actions.pod:625
8228 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
8233 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:627
8239 #: ../src/guestfs-actions.pod:925 ../fish/guestfish-actions.pod:629
8240 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
8245 #: ../src/guestfs-actions.pod:929 ../fish/guestfish-actions.pod:633
8246 msgid "The checksum is returned as a printable string."
8251 #: ../src/guestfs-actions.pod:931
8252 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
8257 #: ../src/guestfs-actions.pod:933
8258 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
8263 #: ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:1246
8264 #: ../src/guestfs-actions.pod:2078 ../src/guestfs-actions.pod:3219
8265 #: ../src/guestfs-actions.pod:3248 ../src/guestfs-actions.pod:3309
8266 #: ../src/guestfs-actions.pod:3336 ../src/guestfs-actions.pod:6737
8267 msgid "(Added in 1.0.2)"
8272 #: ../src/guestfs-actions.pod:940
8273 msgid "guestfs_checksum_device"
8278 #: ../src/guestfs-actions.pod:942
8282 " guestfs_checksum_device (guestfs_h *g,\n"
8283 " const char *csumtype,\n"
8284 " const char *device);\n"
8290 #: ../src/guestfs-actions.pod:947
8292 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
8293 "device named C<device>. For the types of checksums supported see the "
8294 "C<guestfs_checksum> command."
8299 #: ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:4796
8300 #: ../src/guestfs-actions.pod:4855 ../src/guestfs-actions.pod:4892
8301 #: ../src/guestfs-actions.pod:4910 ../src/guestfs-actions.pod:5086
8302 #: ../src/guestfs-actions.pod:6646 ../src/guestfs-actions.pod:6660
8303 #: ../src/guestfs-actions.pod:7066
8304 msgid "(Added in 1.3.2)"
8309 #: ../src/guestfs-actions.pod:956
8310 msgid "guestfs_checksums_out"
8315 #: ../src/guestfs-actions.pod:958
8319 " guestfs_checksums_out (guestfs_h *g,\n"
8320 " const char *csumtype,\n"
8321 " const char *directory,\n"
8322 " const char *sumsfile);\n"
8328 #: ../src/guestfs-actions.pod:964 ../fish/guestfish-actions.pod:651
8330 "This command computes the checksums of all regular files in C<directory> and "
8331 "then emits a list of those checksums to the local output file C<sumsfile>."
8336 #: ../src/guestfs-actions.pod:968 ../fish/guestfish-actions.pod:655
8338 "This can be used for verifying the integrity of a virtual machine. However "
8339 "to be properly secure you should pay attention to the output of the checksum "
8340 "command (it uses the ones from GNU coreutils). In particular when the "
8341 "filename is not printable, coreutils uses a special backslash syntax. For "
8342 "more information, see the GNU coreutils info file."
8347 #: ../src/guestfs-actions.pod:978
8348 msgid "(Added in 1.3.7)"
8353 #: ../src/guestfs-actions.pod:980
8354 msgid "guestfs_chmod"
8359 #: ../src/guestfs-actions.pod:982
8363 " guestfs_chmod (guestfs_h *g,\n"
8365 " const char *path);\n"
8371 #: ../src/guestfs-actions.pod:987 ../fish/guestfish-actions.pod:669
8373 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
8379 #: ../src/guestfs-actions.pod:990 ../fish/guestfish-actions.pod:672
8381 "I<Note>: When using this command from guestfish, C<mode> by default would be "
8382 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
8388 #: ../src/guestfs-actions.pod:994 ../src/guestfs-actions.pod:4298
8389 #: ../src/guestfs-actions.pod:4495 ../src/guestfs-actions.pod:4514
8390 #: ../src/guestfs-actions.pod:4533 ../fish/guestfish-actions.pod:676
8391 #: ../fish/guestfish-actions.pod:2917 ../fish/guestfish-actions.pod:3046
8392 #: ../fish/guestfish-actions.pod:3056 ../fish/guestfish-actions.pod:3066
8393 msgid "The mode actually set is affected by the umask."
8398 #: ../src/guestfs-actions.pod:1000
8399 msgid "guestfs_chown"
8404 #: ../src/guestfs-actions.pod:1002
8408 " guestfs_chown (guestfs_h *g,\n"
8411 " const char *path);\n"
8417 #: ../src/guestfs-actions.pod:1008 ../fish/guestfish-actions.pod:682
8418 msgid "Change the file owner to C<owner> and group to C<group>."
8423 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:3406
8424 #: ../fish/guestfish-actions.pod:684 ../fish/guestfish-actions.pod:2375
8426 "Only numeric uid and gid are supported. If you want to use names, you will "
8427 "need to locate and parse the password file yourself (Augeas support makes "
8428 "this relatively easy)."
8433 #: ../src/guestfs-actions.pod:1018
8434 msgid "guestfs_command"
8439 #: ../src/guestfs-actions.pod:1020
8443 " guestfs_command (guestfs_h *g,\n"
8444 " char *const *arguments);\n"
8450 #: ../src/guestfs-actions.pod:1024 ../fish/guestfish-actions.pod:692
8452 "This call runs a command from the guest filesystem. The filesystem must be "
8453 "mounted, and must contain a compatible operating system (ie. something "
8454 "Linux, with the same or compatible processor architecture)."
8459 #: ../src/guestfs-actions.pod:1029
8461 "The single parameter is an argv-style list of arguments. The first element "
8462 "is the name of the program to run. Subsequent elements are parameters. The "
8463 "list must be non-empty (ie. must contain a program name). Note that the "
8464 "command runs directly, and is I<not> invoked via the shell (see "
8470 #: ../src/guestfs-actions.pod:1036 ../fish/guestfish-actions.pod:704
8471 msgid "The return value is anything printed to I<stdout> by the command."
8476 #: ../src/guestfs-actions.pod:1039 ../fish/guestfish-actions.pod:707
8478 "If the command returns a non-zero exit status, then this function returns an "
8479 "error message. The error message string is the content of I<stderr> from "
8485 #: ../src/guestfs-actions.pod:1043 ../fish/guestfish-actions.pod:711
8487 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
8488 "bin>. If you require a program from another location, you should provide "
8489 "the full path in the first parameter."
8494 #: ../src/guestfs-actions.pod:1048 ../fish/guestfish-actions.pod:716
8496 "Shared libraries and data files required by the program must be available on "
8497 "filesystems which are mounted in the correct places. It is the caller's "
8498 "responsibility to ensure all filesystems that are needed are mounted at the "
8504 #: ../src/guestfs-actions.pod:1060 ../src/guestfs-actions.pod:1080
8505 #: ../src/guestfs-actions.pod:1543
8506 msgid "(Added in 0.9.1)"
8511 #: ../src/guestfs-actions.pod:1062
8512 msgid "guestfs_command_lines"
8517 #: ../src/guestfs-actions.pod:1064
8521 " guestfs_command_lines (guestfs_h *g,\n"
8522 " char *const *arguments);\n"
8528 #: ../src/guestfs-actions.pod:1068
8530 "This is the same as C<guestfs_command>, but splits the result into a list of "
8536 #: ../src/guestfs-actions.pod:1071
8537 msgid "See also: C<guestfs_sh_lines>"
8542 #: ../src/guestfs-actions.pod:1082
8543 msgid "guestfs_config"
8548 #: ../src/guestfs-actions.pod:1084
8552 " guestfs_config (guestfs_h *g,\n"
8553 " const char *qemuparam,\n"
8554 " const char *qemuvalue);\n"
8560 #: ../src/guestfs-actions.pod:1089 ../fish/guestfish-actions.pod:741
8562 "This can be used to add arbitrary qemu command line parameters of the form "
8563 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
8564 "setting some parameters which would interfere with parameters that we use."
8569 #: ../src/guestfs-actions.pod:1094 ../fish/guestfish-actions.pod:746
8570 msgid "The first character of C<param> string must be a C<-> (dash)."
8575 #: ../src/guestfs-actions.pod:1096 ../fish/guestfish-actions.pod:748
8576 msgid "C<value> can be NULL."
8581 #: ../src/guestfs-actions.pod:1102
8582 msgid "guestfs_copy_size"
8587 #: ../src/guestfs-actions.pod:1104
8591 " guestfs_copy_size (guestfs_h *g,\n"
8592 " const char *src,\n"
8593 " const char *dest,\n"
8600 #: ../src/guestfs-actions.pod:1110 ../fish/guestfish-actions.pod:754
8602 "This command copies exactly C<size> bytes from one source device or file "
8603 "C<src> to another destination device or file C<dest>."
8608 #: ../src/guestfs-actions.pod:1113 ../fish/guestfish-actions.pod:757
8610 "Note this will fail if the source is too short or if the destination is not "
8616 #: ../src/guestfs-actions.pod:1118 ../src/guestfs-actions.pod:1241
8617 #: ../src/guestfs-actions.pod:1272 ../src/guestfs-actions.pod:1692
8618 #: ../src/guestfs-actions.pod:1714 ../src/guestfs-actions.pod:6732
8619 #: ../src/guestfs-actions.pod:6766 ../src/guestfs-actions.pod:7245
8620 #: ../src/guestfs-actions.pod:7264
8622 "This long-running command can generate progress notification messages so "
8623 "that the caller can display a progress bar or indicator. To receive these "
8624 "messages, the caller must register a progress callback. See L<guestfs(3)/"
8625 "guestfs_set_progress_callback>."
8630 #: ../src/guestfs-actions.pod:1123 ../src/guestfs-actions.pod:4074
8631 #: ../src/guestfs-actions.pod:5292 ../src/guestfs-actions.pod:6973
8632 #: ../src/guestfs-actions.pod:6993 ../src/guestfs-actions.pod:7079
8633 msgid "(Added in 1.0.87)"
8638 #: ../src/guestfs-actions.pod:1125
8644 #: ../src/guestfs-actions.pod:1127
8648 " guestfs_cp (guestfs_h *g,\n"
8649 " const char *src,\n"
8650 " const char *dest);\n"
8656 #: ../src/guestfs-actions.pod:1132 ../fish/guestfish-actions.pod:764
8658 "This copies a file from C<src> to C<dest> where C<dest> is either a "
8659 "destination filename or destination directory."
8664 #: ../src/guestfs-actions.pod:1137 ../src/guestfs-actions.pod:1151
8665 #: ../src/guestfs-actions.pod:1223 ../src/guestfs-actions.pod:1297
8666 #: ../src/guestfs-actions.pod:1406 ../src/guestfs-actions.pod:4759
8667 #: ../src/guestfs-actions.pod:5136
8668 msgid "(Added in 1.0.18)"
8673 #: ../src/guestfs-actions.pod:1139
8674 msgid "guestfs_cp_a"
8679 #: ../src/guestfs-actions.pod:1141
8683 " guestfs_cp_a (guestfs_h *g,\n"
8684 " const char *src,\n"
8685 " const char *dest);\n"
8691 #: ../src/guestfs-actions.pod:1146 ../fish/guestfish-actions.pod:771
8693 "This copies a file or directory from C<src> to C<dest> recursively using the "
8699 #: ../src/guestfs-actions.pod:1153
8705 #: ../src/guestfs-actions.pod:1155
8709 " guestfs_dd (guestfs_h *g,\n"
8710 " const char *src,\n"
8711 " const char *dest);\n"
8717 #: ../src/guestfs-actions.pod:1160 ../fish/guestfish-actions.pod:778
8719 "This command copies from one source device or file C<src> to another "
8720 "destination device or file C<dest>. Normally you would use this to copy to "
8721 "or from a device or partition, for example to duplicate a filesystem."
8726 #: ../src/guestfs-actions.pod:1165
8728 "If the destination is a device, it must be as large or larger than the "
8729 "source file or device, otherwise the copy will fail. This command cannot do "
8730 "partial copies (see C<guestfs_copy_size>)."
8735 #: ../src/guestfs-actions.pod:1173
8741 #: ../src/guestfs-actions.pod:1175
8745 " guestfs_df (guestfs_h *g);\n"
8751 #: ../src/guestfs-actions.pod:1178 ../fish/guestfish-actions.pod:791
8752 msgid "This command runs the C<df> command to report disk space used."
8757 #: ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1197
8759 "This command is mostly useful for interactive sessions. It is I<not> "
8760 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
8766 #: ../src/guestfs-actions.pod:1187 ../src/guestfs-actions.pod:1204
8767 #: ../src/guestfs-actions.pod:1317 ../src/guestfs-actions.pod:2281
8768 #: ../src/guestfs-actions.pod:2305 ../src/guestfs-actions.pod:2373
8769 #: ../src/guestfs-actions.pod:4184 ../src/guestfs-actions.pod:4659
8770 #: ../src/guestfs-actions.pod:6470 ../src/guestfs-actions.pod:6494
8771 #: ../src/guestfs-actions.pod:7112 ../src/guestfs-actions.pod:7125
8772 #: ../src/guestfs-actions.pod:7138
8773 msgid "(Added in 1.0.54)"
8778 #: ../src/guestfs-actions.pod:1189
8779 msgid "guestfs_df_h"
8784 #: ../src/guestfs-actions.pod:1191
8788 " guestfs_df_h (guestfs_h *g);\n"
8794 #: ../src/guestfs-actions.pod:1194 ../fish/guestfish-actions.pod:801
8796 "This command runs the C<df -h> command to report disk space used in human-"
8802 #: ../src/guestfs-actions.pod:1206
8803 msgid "guestfs_dmesg"
8808 #: ../src/guestfs-actions.pod:1208
8812 " guestfs_dmesg (guestfs_h *g);\n"
8818 #: ../src/guestfs-actions.pod:1211 ../fish/guestfish-actions.pod:812
8820 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
8821 "This is sometimes useful for extended debugging of problems."
8826 #: ../src/guestfs-actions.pod:1215
8828 "Another way to get the same information is to enable verbose messages with "
8829 "C<guestfs_set_verbose> or by setting the environment variable "
8830 "C<LIBGUESTFS_DEBUG=1> before running the program."
8835 #: ../src/guestfs-actions.pod:1225
8836 msgid "guestfs_download"
8841 #: ../src/guestfs-actions.pod:1227
8845 " guestfs_download (guestfs_h *g,\n"
8846 " const char *remotefilename,\n"
8847 " const char *filename);\n"
8853 #: ../src/guestfs-actions.pod:1232 ../src/guestfs-actions.pod:1257
8854 #: ../fish/guestfish-actions.pod:825 ../fish/guestfish-actions.pod:838
8856 "Download file C<remotefilename> and save it as C<filename> on the local "
8862 #: ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:6726
8863 #: ../fish/guestfish-actions.pod:828 ../fish/guestfish-actions.pod:4524
8864 msgid "C<filename> can also be a named pipe."
8869 #: ../src/guestfs-actions.pod:1237
8870 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
8875 #: ../src/guestfs-actions.pod:1248
8876 msgid "guestfs_download_offset"
8881 #: ../src/guestfs-actions.pod:1250
8885 " guestfs_download_offset (guestfs_h *g,\n"
8886 " const char *remotefilename,\n"
8887 " const char *filename,\n"
8888 " int64_t offset,\n"
8895 #: ../src/guestfs-actions.pod:1260 ../fish/guestfish-actions.pod:841
8897 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
8898 "region must be within the file or device)."
8903 #: ../src/guestfs-actions.pod:1263
8905 "Note that there is no limit on the amount of data that can be downloaded "
8906 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
8907 "full amount unless an error occurs."
8912 #: ../src/guestfs-actions.pod:1268
8913 msgid "See also C<guestfs_download>, C<guestfs_pread>."
8918 #: ../src/guestfs-actions.pod:1277 ../src/guestfs-actions.pod:6771
8919 msgid "(Added in 1.5.17)"
8924 #: ../src/guestfs-actions.pod:1279
8925 msgid "guestfs_drop_caches"
8930 #: ../src/guestfs-actions.pod:1281
8934 " guestfs_drop_caches (guestfs_h *g,\n"
8935 " int whattodrop);\n"
8941 #: ../src/guestfs-actions.pod:1285 ../fish/guestfish-actions.pod:857
8943 "This instructs the guest kernel to drop its page cache, and/or dentries and "
8944 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
8945 "to drop, see L<http://linux-mm.org/Drop_Caches>"
8950 #: ../src/guestfs-actions.pod:1290 ../fish/guestfish-actions.pod:862
8951 msgid "Setting C<whattodrop> to 3 should drop everything."
8956 #: ../src/guestfs-actions.pod:1292 ../fish/guestfish-actions.pod:864
8958 "This automatically calls L<sync(2)> before the operation, so that the "
8959 "maximum guest memory is freed."
8964 #: ../src/guestfs-actions.pod:1299
8970 #: ../src/guestfs-actions.pod:1301
8974 " guestfs_du (guestfs_h *g,\n"
8975 " const char *path);\n"
8981 #: ../src/guestfs-actions.pod:1305 ../fish/guestfish-actions.pod:871
8983 "This command runs the C<du -s> command to estimate file space usage for "
8989 #: ../src/guestfs-actions.pod:1308 ../fish/guestfish-actions.pod:874
8991 "C<path> can be a file or a directory. If C<path> is a directory then the "
8992 "estimate includes the contents of the directory and all subdirectories "
8998 #: ../src/guestfs-actions.pod:1312 ../fish/guestfish-actions.pod:878
9000 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
9005 #: ../src/guestfs-actions.pod:1319
9006 msgid "guestfs_e2fsck_f"
9011 #: ../src/guestfs-actions.pod:1321
9015 " guestfs_e2fsck_f (guestfs_h *g,\n"
9016 " const char *device);\n"
9022 #: ../src/guestfs-actions.pod:1325 ../fish/guestfish-actions.pod:885
9024 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
9025 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
9031 #: ../src/guestfs-actions.pod:1329
9033 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
9034 "Normally you should use C<guestfs_fsck>."
9039 #: ../src/guestfs-actions.pod:1334
9040 msgid "(Added in 1.0.29)"
9045 #: ../src/guestfs-actions.pod:1336
9046 msgid "guestfs_echo_daemon"
9051 #: ../src/guestfs-actions.pod:1338
9055 " guestfs_echo_daemon (guestfs_h *g,\n"
9056 " char *const *words);\n"
9062 #: ../src/guestfs-actions.pod:1342 ../fish/guestfish-actions.pod:896
9064 "This command concatenates the list of C<words> passed with single spaces "
9065 "between them and returns the resulting string."
9070 #: ../src/guestfs-actions.pod:1345 ../fish/guestfish-actions.pod:899
9071 msgid "You can use this command to test the connection through to the daemon."
9076 #: ../src/guestfs-actions.pod:1347
9077 msgid "See also C<guestfs_ping_daemon>."
9082 #: ../src/guestfs-actions.pod:1352 ../src/guestfs-actions.pod:2089
9083 #: ../src/guestfs-actions.pod:5970
9084 msgid "(Added in 1.0.69)"
9089 #: ../src/guestfs-actions.pod:1354
9090 msgid "guestfs_egrep"
9095 #: ../src/guestfs-actions.pod:1356
9099 " guestfs_egrep (guestfs_h *g,\n"
9100 " const char *regex,\n"
9101 " const char *path);\n"
9107 #: ../src/guestfs-actions.pod:1361 ../fish/guestfish-actions.pod:907
9109 "This calls the external C<egrep> program and returns the matching lines."
9114 #: ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1390
9115 #: ../src/guestfs-actions.pod:1447 ../src/guestfs-actions.pod:1493
9116 #: ../src/guestfs-actions.pod:1512 ../src/guestfs-actions.pod:2219
9117 #: ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2394
9118 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:2422
9119 #: ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2490
9120 #: ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:3567
9121 #: ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:3594
9122 #: ../src/guestfs-actions.pod:3608 ../src/guestfs-actions.pod:4594
9123 #: ../src/guestfs-actions.pod:5470 ../src/guestfs-actions.pod:5519
9124 #: ../src/guestfs-actions.pod:6338 ../src/guestfs-actions.pod:6350
9125 #: ../src/guestfs-actions.pod:6363 ../src/guestfs-actions.pod:6376
9126 #: ../src/guestfs-actions.pod:6398 ../src/guestfs-actions.pod:6411
9127 #: ../src/guestfs-actions.pod:6424 ../src/guestfs-actions.pod:6437
9128 #: ../src/guestfs-actions.pod:7208 ../src/guestfs-actions.pod:7227
9129 #: ../src/guestfs-actions.pod:7312 ../src/guestfs-actions.pod:7331
9130 #: ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7396
9131 msgid "(Added in 1.0.66)"
9136 #: ../src/guestfs-actions.pod:1373
9137 msgid "guestfs_egrepi"
9142 #: ../src/guestfs-actions.pod:1375
9146 " guestfs_egrepi (guestfs_h *g,\n"
9147 " const char *regex,\n"
9148 " const char *path);\n"
9154 #: ../src/guestfs-actions.pod:1380 ../fish/guestfish-actions.pod:917
9156 "This calls the external C<egrep -i> program and returns the matching lines."
9161 #: ../src/guestfs-actions.pod:1392
9162 msgid "guestfs_equal"
9167 #: ../src/guestfs-actions.pod:1394
9171 " guestfs_equal (guestfs_h *g,\n"
9172 " const char *file1,\n"
9173 " const char *file2);\n"
9179 #: ../src/guestfs-actions.pod:1399 ../fish/guestfish-actions.pod:927
9181 "This compares the two files C<file1> and C<file2> and returns true if their "
9182 "content is exactly equal, or false otherwise."
9187 #: ../src/guestfs-actions.pod:1402 ../fish/guestfish-actions.pod:930
9188 msgid "The external L<cmp(1)> program is used for the comparison."
9193 #: ../src/guestfs-actions.pod:1408
9194 msgid "guestfs_exists"
9199 #: ../src/guestfs-actions.pod:1410
9203 " guestfs_exists (guestfs_h *g,\n"
9204 " const char *path);\n"
9210 #: ../src/guestfs-actions.pod:1414 ../fish/guestfish-actions.pod:936
9212 "This returns C<true> if and only if there is a file, directory (or anything) "
9213 "with the given C<path> name."
9218 #: ../src/guestfs-actions.pod:1417
9219 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
9224 #: ../src/guestfs-actions.pod:1423
9225 msgid "guestfs_fallocate"
9230 #: ../src/guestfs-actions.pod:1425
9234 " guestfs_fallocate (guestfs_h *g,\n"
9235 " const char *path,\n"
9242 #: ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1456
9243 #: ../fish/guestfish-actions.pod:945 ../fish/guestfish-actions.pod:964
9245 "This command preallocates a file (containing zero bytes) named C<path> of "
9246 "size C<len> bytes. If the file exists already, it is overwritten."
9251 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:949
9253 "Do not confuse this with the guestfish-specific C<alloc> command which "
9254 "allocates a file in the host and attaches it as a device."
9259 #: ../src/guestfs-actions.pod:1440 ../fish/guestfish-actions.pod:953
9261 "This function is deprecated. In new code, use the C<fallocate64> call "
9267 #: ../src/guestfs-actions.pod:1449
9268 msgid "guestfs_fallocate64"
9273 #: ../src/guestfs-actions.pod:1451
9277 " guestfs_fallocate64 (guestfs_h *g,\n"
9278 " const char *path,\n"
9285 #: ../src/guestfs-actions.pod:1460
9287 "Note that this call allocates disk blocks for the file. To create a sparse "
9288 "file use C<guestfs_truncate_size> instead."
9293 #: ../src/guestfs-actions.pod:1463
9295 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
9296 "oversight it only allowed 30 bit lengths to be specified, effectively "
9297 "limiting the maximum size of files created through that call to 1GB."
9302 #: ../src/guestfs-actions.pod:1468 ../fish/guestfish-actions.pod:976
9304 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
9305 "commands which create a file in the host and attach it as a device."
9310 #: ../src/guestfs-actions.pod:1474
9311 msgid "(Added in 1.3.17)"
9316 #: ../src/guestfs-actions.pod:1476
9317 msgid "guestfs_fgrep"
9322 #: ../src/guestfs-actions.pod:1478
9326 " guestfs_fgrep (guestfs_h *g,\n"
9327 " const char *pattern,\n"
9328 " const char *path);\n"
9334 #: ../src/guestfs-actions.pod:1483 ../fish/guestfish-actions.pod:984
9336 "This calls the external C<fgrep> program and returns the matching lines."
9341 #: ../src/guestfs-actions.pod:1495
9342 msgid "guestfs_fgrepi"
9347 #: ../src/guestfs-actions.pod:1497
9351 " guestfs_fgrepi (guestfs_h *g,\n"
9352 " const char *pattern,\n"
9353 " const char *path);\n"
9359 #: ../src/guestfs-actions.pod:1502 ../fish/guestfish-actions.pod:994
9361 "This calls the external C<fgrep -i> program and returns the matching lines."
9366 #: ../src/guestfs-actions.pod:1514
9367 msgid "guestfs_file"
9372 #: ../src/guestfs-actions.pod:1516
9376 " guestfs_file (guestfs_h *g,\n"
9377 " const char *path);\n"
9383 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1004
9385 "This call uses the standard L<file(1)> command to determine the type or "
9386 "contents of the file."
9391 #: ../src/guestfs-actions.pod:1523 ../fish/guestfish-actions.pod:1007
9393 "This call will also transparently look inside various types of compressed "
9399 #: ../src/guestfs-actions.pod:1526 ../fish/guestfish-actions.pod:1010
9401 "The exact command which runs is C<file -zb path>. Note in particular that "
9402 "the filename is not prepended to the output (the C<-b> option)."
9407 #: ../src/guestfs-actions.pod:1530
9409 "This command can also be used on C</dev/> devices (and partitions, LV "
9410 "names). You can for example use this to determine if a device contains a "
9411 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
9416 #: ../src/guestfs-actions.pod:1535 ../fish/guestfish-actions.pod:1019
9418 "If the C<path> does not begin with C</dev/> then this command only works for "
9419 "the content of regular files. For other file types (directory, symbolic "
9420 "link etc) it will just return the string C<directory> etc."
9425 #: ../src/guestfs-actions.pod:1545
9426 msgid "guestfs_file_architecture"
9431 #: ../src/guestfs-actions.pod:1547
9435 " guestfs_file_architecture (guestfs_h *g,\n"
9436 " const char *filename);\n"
9442 #: ../src/guestfs-actions.pod:1551 ../fish/guestfish-actions.pod:1028
9444 "This detects the architecture of the binary C<filename>, and returns it if "
9450 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1031
9451 msgid "Currently defined architectures are:"
9456 #: ../src/guestfs-actions.pod:1558 ../fish/guestfish-actions.pod:1035
9462 #: ../src/guestfs-actions.pod:1560 ../fish/guestfish-actions.pod:1037
9464 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
9465 "irrespective of the precise processor requirements of the binary."
9470 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1040
9476 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1042
9477 msgid "64 bit x86-64."
9482 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1044
9488 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1046
9489 msgid "32 bit SPARC."
9494 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1048
9500 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1050
9501 msgid "64 bit SPARC V9 and above."
9506 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1052
9512 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1054
9513 msgid "Intel Itanium."
9518 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1056
9524 #: ../src/guestfs-actions.pod:1581 ../fish/guestfish-actions.pod:1058
9525 msgid "32 bit Power PC."
9530 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1060
9536 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1062
9537 msgid "64 bit Power PC."
9542 #: ../src/guestfs-actions.pod:1589 ../fish/guestfish-actions.pod:1066
9543 msgid "Libguestfs may return other architecture strings in future."
9548 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1068
9549 msgid "The function works on at least the following types of files:"
9554 #: ../src/guestfs-actions.pod:1597 ../fish/guestfish-actions.pod:1074
9555 msgid "many types of Un*x and Linux binary"
9560 #: ../src/guestfs-actions.pod:1601 ../fish/guestfish-actions.pod:1078
9561 msgid "many types of Un*x and Linux shared library"
9566 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1082
9567 msgid "Windows Win32 and Win64 binaries"
9572 #: ../src/guestfs-actions.pod:1609 ../fish/guestfish-actions.pod:1086
9573 msgid "Windows Win32 and Win64 DLLs"
9578 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1088
9579 msgid "Win32 binaries and DLLs return C<i386>."
9584 #: ../src/guestfs-actions.pod:1613 ../fish/guestfish-actions.pod:1090
9585 msgid "Win64 binaries and DLLs return C<x86_64>."
9590 #: ../src/guestfs-actions.pod:1617 ../fish/guestfish-actions.pod:1094
9591 msgid "Linux kernel modules"
9596 #: ../src/guestfs-actions.pod:1621 ../fish/guestfish-actions.pod:1098
9597 msgid "Linux new-style initrd images"
9602 #: ../src/guestfs-actions.pod:1625 ../fish/guestfish-actions.pod:1102
9603 msgid "some non-x86 Linux vmlinuz kernels"
9608 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1106
9609 msgid "What it can't do currently:"
9614 #: ../src/guestfs-actions.pod:1635 ../fish/guestfish-actions.pod:1112
9615 msgid "static libraries (libfoo.a)"
9620 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1116
9621 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
9626 #: ../src/guestfs-actions.pod:1643 ../fish/guestfish-actions.pod:1120
9627 msgid "x86 Linux vmlinuz kernels"
9632 #: ../src/guestfs-actions.pod:1645 ../fish/guestfish-actions.pod:1122
9634 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
9635 "compressed code, and are horribly hard to unpack. If you want to find the "
9636 "architecture of a kernel, use the architecture of the associated initrd or "
9637 "kernel module(s) instead."
9642 #: ../src/guestfs-actions.pod:1655 ../src/guestfs-actions.pod:1818
9643 #: ../src/guestfs-actions.pod:1835 ../src/guestfs-actions.pod:2526
9644 #: ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:2637
9645 #: ../src/guestfs-actions.pod:2725 ../src/guestfs-actions.pod:2746
9646 #: ../src/guestfs-actions.pod:2783 ../src/guestfs-actions.pod:2867
9647 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3190
9648 #: ../src/guestfs-actions.pod:3322
9649 msgid "(Added in 1.5.3)"
9654 #: ../src/guestfs-actions.pod:1657
9655 msgid "guestfs_filesize"
9660 #: ../src/guestfs-actions.pod:1659
9664 " guestfs_filesize (guestfs_h *g,\n"
9665 " const char *file);\n"
9671 #: ../src/guestfs-actions.pod:1663 ../fish/guestfish-actions.pod:1133
9672 msgid "This command returns the size of C<file> in bytes."
9677 #: ../src/guestfs-actions.pod:1665
9679 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
9680 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
9681 "devices, use C<guestfs_blockdev_getsize64>."
9686 #: ../src/guestfs-actions.pod:1671
9687 msgid "(Added in 1.0.82)"
9692 #: ../src/guestfs-actions.pod:1673
9693 msgid "guestfs_fill"
9698 #: ../src/guestfs-actions.pod:1675
9702 " guestfs_fill (guestfs_h *g,\n"
9705 " const char *path);\n"
9711 #: ../src/guestfs-actions.pod:1681 ../fish/guestfish-actions.pod:1143
9713 "This command creates a new file called C<path>. The initial content of the "
9714 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
9720 #: ../src/guestfs-actions.pod:1685
9722 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
9723 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
9724 "bytes use C<guestfs_fill_pattern>."
9729 #: ../src/guestfs-actions.pod:1697
9730 msgid "(Added in 1.0.79)"
9735 #: ../src/guestfs-actions.pod:1699
9736 msgid "guestfs_fill_pattern"
9741 #: ../src/guestfs-actions.pod:1701
9745 " guestfs_fill_pattern (guestfs_h *g,\n"
9746 " const char *pattern,\n"
9748 " const char *path);\n"
9754 #: ../src/guestfs-actions.pod:1707
9756 "This function is like C<guestfs_fill> except that it creates a new file of "
9757 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
9758 "pattern is truncated if necessary to ensure the length of the file is "
9759 "exactly C<len> bytes."
9764 #: ../src/guestfs-actions.pod:1719
9765 msgid "(Added in 1.3.12)"
9770 #: ../src/guestfs-actions.pod:1721
9771 msgid "guestfs_find"
9776 #: ../src/guestfs-actions.pod:1723
9780 " guestfs_find (guestfs_h *g,\n"
9781 " const char *directory);\n"
9787 #: ../src/guestfs-actions.pod:1727 ../fish/guestfish-actions.pod:1165
9789 "This command lists out all files and directories, recursively, starting at "
9790 "C<directory>. It is essentially equivalent to running the shell command "
9791 "C<find directory -print> but some post-processing happens on the output, "
9797 #: ../src/guestfs-actions.pod:1732 ../fish/guestfish-actions.pod:1170
9799 "This returns a list of strings I<without any prefix>. Thus if the directory "
9805 #: ../src/guestfs-actions.pod:1735 ../fish/guestfish-actions.pod:1173
9816 #: ../src/guestfs-actions.pod:1739
9818 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
9823 #: ../src/guestfs-actions.pod:1742 ../fish/guestfish-actions.pod:1180
9835 #: ../src/guestfs-actions.pod:1747 ../fish/guestfish-actions.pod:1185
9836 msgid "If C<directory> is not a directory, then this command returns an error."
9841 #: ../src/guestfs-actions.pod:1750 ../fish/guestfish-actions.pod:1188
9842 msgid "The returned list is sorted."
9847 #: ../src/guestfs-actions.pod:1752
9848 msgid "See also C<guestfs_find0>."
9853 #: ../src/guestfs-actions.pod:1761 ../src/guestfs-actions.pod:4011
9854 #: ../src/guestfs-actions.pod:5554
9855 msgid "(Added in 1.0.27)"
9860 #: ../src/guestfs-actions.pod:1763
9861 msgid "guestfs_find0"
9866 #: ../src/guestfs-actions.pod:1765
9870 " guestfs_find0 (guestfs_h *g,\n"
9871 " const char *directory,\n"
9872 " const char *files);\n"
9878 #: ../src/guestfs-actions.pod:1770 ../fish/guestfish-actions.pod:1199
9880 "This command lists out all files and directories, recursively, starting at "
9881 "C<directory>, placing the resulting list in the external file called "
9887 #: ../src/guestfs-actions.pod:1774
9889 "This command works the same way as C<guestfs_find> with the following "
9895 #: ../src/guestfs-actions.pod:1781 ../fish/guestfish-actions.pod:1210
9896 msgid "The resulting list is written to an external file."
9901 #: ../src/guestfs-actions.pod:1785 ../fish/guestfish-actions.pod:1214
9903 "Items (filenames) in the result are separated by C<\\0> characters. See "
9904 "L<find(1)> option I<-print0>."
9909 #: ../src/guestfs-actions.pod:1790 ../fish/guestfish-actions.pod:1219
9910 msgid "This command is not limited in the number of names that it can return."
9915 #: ../src/guestfs-actions.pod:1795 ../fish/guestfish-actions.pod:1224
9916 msgid "The result list is not sorted."
9921 #: ../src/guestfs-actions.pod:1801
9922 msgid "(Added in 1.0.74)"
9927 #: ../src/guestfs-actions.pod:1803
9928 msgid "guestfs_findfs_label"
9933 #: ../src/guestfs-actions.pod:1805
9937 " guestfs_findfs_label (guestfs_h *g,\n"
9938 " const char *label);\n"
9944 #: ../src/guestfs-actions.pod:1809 ../fish/guestfish-actions.pod:1234
9946 "This command searches the filesystems and returns the one which has the "
9947 "given label. An error is returned if no such filesystem can be found."
9952 #: ../src/guestfs-actions.pod:1813
9953 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
9958 #: ../src/guestfs-actions.pod:1820
9959 msgid "guestfs_findfs_uuid"
9964 #: ../src/guestfs-actions.pod:1822
9968 " guestfs_findfs_uuid (guestfs_h *g,\n"
9969 " const char *uuid);\n"
9975 #: ../src/guestfs-actions.pod:1826 ../fish/guestfish-actions.pod:1244
9977 "This command searches the filesystems and returns the one which has the "
9978 "given UUID. An error is returned if no such filesystem can be found."
9983 #: ../src/guestfs-actions.pod:1830
9984 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
9989 #: ../src/guestfs-actions.pod:1837
9990 msgid "guestfs_fsck"
9995 #: ../src/guestfs-actions.pod:1839
9999 " guestfs_fsck (guestfs_h *g,\n"
10000 " const char *fstype,\n"
10001 " const char *device);\n"
10007 #: ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:1254
10009 "This runs the filesystem checker (fsck) on C<device> which should have "
10010 "filesystem type C<fstype>."
10015 #: ../src/guestfs-actions.pod:1847 ../fish/guestfish-actions.pod:1257
10017 "The returned integer is the status. See L<fsck(8)> for the list of status "
10018 "codes from C<fsck>."
10023 #: ../src/guestfs-actions.pod:1856 ../fish/guestfish-actions.pod:1266
10024 msgid "Multiple status codes can be summed together."
10029 #: ../src/guestfs-actions.pod:1860 ../fish/guestfish-actions.pod:1270
10031 "A non-zero return code can mean \"success\", for example if errors have been "
10032 "corrected on the filesystem."
10037 #: ../src/guestfs-actions.pod:1865 ../fish/guestfish-actions.pod:1275
10038 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
10043 #: ../src/guestfs-actions.pod:1870 ../fish/guestfish-actions.pod:1280
10045 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
10050 #: ../src/guestfs-actions.pod:1874 ../src/guestfs-actions.pod:7250
10051 msgid "(Added in 1.0.16)"
10056 #: ../src/guestfs-actions.pod:1876
10057 msgid "guestfs_get_append"
10062 #: ../src/guestfs-actions.pod:1878
10066 " guestfs_get_append (guestfs_h *g);\n"
10072 #: ../src/guestfs-actions.pod:1881 ../fish/guestfish-actions.pod:1286
10074 "Return the additional kernel options which are added to the guest kernel "
10080 #: ../src/guestfs-actions.pod:1884 ../fish/guestfish-actions.pod:1289
10081 msgid "If C<NULL> then no options are added."
10086 #: ../src/guestfs-actions.pod:1886
10088 "This function returns a string which may be NULL. There is no way to return "
10089 "an error from this function. The string is owned by the guest handle and "
10090 "must I<not> be freed."
10095 #: ../src/guestfs-actions.pod:1890 ../src/guestfs-actions.pod:5232
10096 #: ../src/guestfs-actions.pod:5712 ../src/guestfs-actions.pod:6112
10097 #: ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6147
10098 #: ../src/guestfs-actions.pod:6164 ../src/guestfs-actions.pod:6921
10099 #: ../src/guestfs-actions.pod:6939 ../src/guestfs-actions.pod:7293
10100 msgid "(Added in 1.0.26)"
10104 #: ../src/guestfs-actions.pod:1892
10105 msgid "guestfs_get_attach_method"
10109 #: ../src/guestfs-actions.pod:1894
10113 " guestfs_get_attach_method (guestfs_h *g);\n"
10118 #: ../src/guestfs-actions.pod:1897
10119 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
10124 #: ../src/guestfs-actions.pod:1902
10125 msgid "guestfs_get_autosync"
10130 #: ../src/guestfs-actions.pod:1904
10134 " guestfs_get_autosync (guestfs_h *g);\n"
10140 #: ../src/guestfs-actions.pod:1907 ../fish/guestfish-actions.pod:1301
10141 msgid "Get the autosync flag."
10146 #: ../src/guestfs-actions.pod:1913
10147 msgid "guestfs_get_direct"
10152 #: ../src/guestfs-actions.pod:1915
10156 " guestfs_get_direct (guestfs_h *g);\n"
10162 #: ../src/guestfs-actions.pod:1918 ../fish/guestfish-actions.pod:1307
10163 msgid "Return the direct appliance mode flag."
10168 #: ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:5781
10169 msgid "(Added in 1.0.72)"
10174 #: ../src/guestfs-actions.pod:1924
10175 msgid "guestfs_get_e2label"
10180 #: ../src/guestfs-actions.pod:1926
10184 " guestfs_get_e2label (guestfs_h *g,\n"
10185 " const char *device);\n"
10191 #: ../src/guestfs-actions.pod:1930 ../fish/guestfish-actions.pod:1313
10193 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
10198 #: ../src/guestfs-actions.pod:1936 ../fish/guestfish-actions.pod:1316
10200 "This function is deprecated. In new code, use the C<vfs_label> call instead."
10205 #: ../src/guestfs-actions.pod:1943 ../src/guestfs-actions.pod:1964
10206 #: ../src/guestfs-actions.pod:5799 ../src/guestfs-actions.pod:5818
10207 msgid "(Added in 1.0.15)"
10212 #: ../src/guestfs-actions.pod:1945
10213 msgid "guestfs_get_e2uuid"
10218 #: ../src/guestfs-actions.pod:1947
10222 " guestfs_get_e2uuid (guestfs_h *g,\n"
10223 " const char *device);\n"
10229 #: ../src/guestfs-actions.pod:1951 ../fish/guestfish-actions.pod:1327
10231 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
10236 #: ../src/guestfs-actions.pod:1957 ../fish/guestfish-actions.pod:1330
10238 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
10243 #: ../src/guestfs-actions.pod:1966
10244 msgid "guestfs_get_memsize"
10249 #: ../src/guestfs-actions.pod:1968
10253 " guestfs_get_memsize (guestfs_h *g);\n"
10259 #: ../src/guestfs-actions.pod:1971 ../fish/guestfish-actions.pod:1341
10261 "This gets the memory size in megabytes allocated to the qemu subprocess."
10266 #: ../src/guestfs-actions.pod:1974
10268 "If C<guestfs_set_memsize> was not called on this handle, and if "
10269 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
10270 "value for memsize."
10275 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:2059
10276 #: ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:5941
10277 #: ../fish/guestfish-actions.pod:1348 ../fish/guestfish-actions.pod:1399
10278 #: ../fish/guestfish-actions.pod:3927 ../fish/guestfish-actions.pod:4014
10280 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
10285 #: ../src/guestfs-actions.pod:1983 ../src/guestfs-actions.pod:4302
10286 #: ../src/guestfs-actions.pod:4499 ../src/guestfs-actions.pod:4518
10287 #: ../src/guestfs-actions.pod:4537 ../src/guestfs-actions.pod:4549
10288 #: ../src/guestfs-actions.pod:4566 ../src/guestfs-actions.pod:4579
10289 #: ../src/guestfs-actions.pod:5457 ../src/guestfs-actions.pod:5839
10290 #: ../src/guestfs-actions.pod:6086 ../src/guestfs-actions.pod:6687
10291 msgid "(Added in 1.0.55)"
10296 #: ../src/guestfs-actions.pod:1985
10297 msgid "guestfs_get_network"
10302 #: ../src/guestfs-actions.pod:1987
10306 " guestfs_get_network (guestfs_h *g);\n"
10312 #: ../src/guestfs-actions.pod:1990 ../fish/guestfish-actions.pod:1355
10313 msgid "This returns the enable network flag."
10318 #: ../src/guestfs-actions.pod:1994 ../src/guestfs-actions.pod:5858
10319 msgid "(Added in 1.5.4)"
10324 #: ../src/guestfs-actions.pod:1996
10325 msgid "guestfs_get_path"
10330 #: ../src/guestfs-actions.pod:1998
10334 " guestfs_get_path (guestfs_h *g);\n"
10340 #: ../src/guestfs-actions.pod:2001 ../fish/guestfish-actions.pod:1361
10341 msgid "Return the current search path."
10346 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1363
10348 "This is always non-NULL. If it wasn't set already, then this will return "
10349 "the default path."
10354 #: ../src/guestfs-actions.pod:2006 ../src/guestfs-actions.pod:2035
10356 "This function returns a string, or NULL on error. The string is owned by "
10357 "the guest handle and must I<not> be freed."
10362 #: ../src/guestfs-actions.pod:2011
10363 msgid "guestfs_get_pid"
10368 #: ../src/guestfs-actions.pod:2013
10372 " guestfs_get_pid (guestfs_h *g);\n"
10378 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
10380 "Return the process ID of the qemu subprocess. If there is no qemu "
10381 "subprocess, then this will return an error."
10386 #: ../src/guestfs-actions.pod:2019 ../fish/guestfish-actions.pod:1375
10387 msgid "This is an internal call used for debugging and testing."
10392 #: ../src/guestfs-actions.pod:2023
10393 msgid "(Added in 1.0.56)"
10398 #: ../src/guestfs-actions.pod:2025
10399 msgid "guestfs_get_qemu"
10404 #: ../src/guestfs-actions.pod:2027
10408 " guestfs_get_qemu (guestfs_h *g);\n"
10414 #: ../src/guestfs-actions.pod:2030 ../fish/guestfish-actions.pod:1381
10415 msgid "Return the current qemu binary."
10420 #: ../src/guestfs-actions.pod:2032 ../fish/guestfish-actions.pod:1383
10422 "This is always non-NULL. If it wasn't set already, then this will return "
10423 "the default qemu binary name."
10428 #: ../src/guestfs-actions.pod:2038 ../src/guestfs-actions.pod:5903
10429 msgid "(Added in 1.0.6)"
10434 #: ../src/guestfs-actions.pod:2040
10435 msgid "guestfs_get_recovery_proc"
10440 #: ../src/guestfs-actions.pod:2042
10444 " guestfs_get_recovery_proc (guestfs_h *g);\n"
10450 #: ../src/guestfs-actions.pod:2045 ../fish/guestfish-actions.pod:1390
10451 msgid "Return the recovery process enabled flag."
10456 #: ../src/guestfs-actions.pod:2049 ../src/guestfs-actions.pod:3412
10457 #: ../src/guestfs-actions.pod:3709 ../src/guestfs-actions.pod:4109
10458 #: ../src/guestfs-actions.pod:4141 ../src/guestfs-actions.pod:5162
10459 #: ../src/guestfs-actions.pod:5505 ../src/guestfs-actions.pod:5927
10460 #: ../src/guestfs-actions.pod:6590 ../src/guestfs-actions.pod:6610
10461 #: ../src/guestfs-actions.pod:6802
10462 msgid "(Added in 1.0.77)"
10467 #: ../src/guestfs-actions.pod:2051
10468 msgid "guestfs_get_selinux"
10473 #: ../src/guestfs-actions.pod:2053
10477 " guestfs_get_selinux (guestfs_h *g);\n"
10483 #: ../src/guestfs-actions.pod:2056
10485 "This returns the current setting of the selinux flag which is passed to the "
10486 "appliance at boot time. See C<guestfs_set_selinux>."
10491 #: ../src/guestfs-actions.pod:2064 ../src/guestfs-actions.pod:2127
10492 #: ../src/guestfs-actions.pod:5946 ../src/guestfs-actions.pod:6004
10493 msgid "(Added in 1.0.67)"
10498 #: ../src/guestfs-actions.pod:2066
10499 msgid "guestfs_get_state"
10504 #: ../src/guestfs-actions.pod:2068
10508 " guestfs_get_state (guestfs_h *g);\n"
10514 #: ../src/guestfs-actions.pod:2071 ../fish/guestfish-actions.pod:1406
10516 "This returns the current state as an opaque integer. This is only useful "
10517 "for printing debug and internal error messages."
10522 #: ../src/guestfs-actions.pod:2074 ../src/guestfs-actions.pod:3215
10523 #: ../src/guestfs-actions.pod:3244 ../src/guestfs-actions.pod:3305
10524 #: ../src/guestfs-actions.pod:3332 ../fish/guestfish-actions.pod:1409
10525 #: ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2275
10526 #: ../fish/guestfish-actions.pod:2313 ../fish/guestfish-actions.pod:2329
10527 msgid "For more information on states, see L<guestfs(3)>."
10532 #: ../src/guestfs-actions.pod:2080
10533 msgid "guestfs_get_trace"
10538 #: ../src/guestfs-actions.pod:2082
10542 " guestfs_get_trace (guestfs_h *g);\n"
10548 #: ../src/guestfs-actions.pod:2085 ../fish/guestfish-actions.pod:1415
10549 msgid "Return the command trace flag."
10554 #: ../src/guestfs-actions.pod:2091
10555 msgid "guestfs_get_umask"
10560 #: ../src/guestfs-actions.pod:2093
10564 " guestfs_get_umask (guestfs_h *g);\n"
10570 #: ../src/guestfs-actions.pod:2096
10572 "Return the current umask. By default the umask is C<022> unless it has been "
10573 "set by calling C<guestfs_umask>."
10578 #: ../src/guestfs-actions.pod:2103
10579 msgid "guestfs_get_verbose"
10584 #: ../src/guestfs-actions.pod:2105
10588 " guestfs_get_verbose (guestfs_h *g);\n"
10594 #: ../src/guestfs-actions.pod:2108 ../fish/guestfish-actions.pod:1428
10595 msgid "This returns the verbose messages flag."
10600 #: ../src/guestfs-actions.pod:2114
10601 msgid "guestfs_getcon"
10606 #: ../src/guestfs-actions.pod:2116
10610 " guestfs_getcon (guestfs_h *g);\n"
10616 #: ../src/guestfs-actions.pod:2119 ../fish/guestfish-actions.pod:1434
10617 msgid "This gets the SELinux security context of the daemon."
10622 #: ../src/guestfs-actions.pod:2121
10624 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
10629 #: ../src/guestfs-actions.pod:2129
10630 msgid "guestfs_getxattr"
10635 #: ../src/guestfs-actions.pod:2131
10639 " guestfs_getxattr (guestfs_h *g,\n"
10640 " const char *path,\n"
10641 " const char *name,\n"
10642 " size_t *size_r);\n"
10648 #: ../src/guestfs-actions.pod:2137
10650 "Get a single extended attribute from file C<path> named C<name>. This call "
10651 "follows symlinks. If you want to lookup an extended attribute for the "
10652 "symlink itself, use C<guestfs_lgetxattr>."
10657 #: ../src/guestfs-actions.pod:2141 ../src/guestfs-actions.pod:3426
10659 "Normally it is better to get all extended attributes from a file in one go "
10660 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
10661 "implementations are buggy and do not provide a way to list out attributes. "
10662 "For these filesystems (notably ntfs-3g) you have to know the names of the "
10663 "extended attributes you want in advance and call this function."
10668 #: ../src/guestfs-actions.pod:2148 ../src/guestfs-actions.pod:3433
10669 #: ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:2394
10671 "Extended attribute values are blobs of binary data. If there is no extended "
10672 "attribute named C<name>, this returns an error."
10677 #: ../src/guestfs-actions.pod:2151
10678 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
10683 #: ../src/guestfs-actions.pod:2153 ../src/guestfs-actions.pod:2344
10684 #: ../src/guestfs-actions.pod:3438 ../src/guestfs-actions.pod:5155
10685 #: ../src/guestfs-actions.pod:5181 ../src/guestfs-actions.pod:5362
10687 "This function returns a buffer, or NULL on error. The size of the returned "
10688 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
10693 #: ../src/guestfs-actions.pod:2157 ../src/guestfs-actions.pod:3442
10694 msgid "(Added in 1.7.24)"
10699 #: ../src/guestfs-actions.pod:2159
10700 msgid "guestfs_getxattrs"
10705 #: ../src/guestfs-actions.pod:2161
10708 " struct guestfs_xattr_list *\n"
10709 " guestfs_getxattrs (guestfs_h *g,\n"
10710 " const char *path);\n"
10716 #: ../src/guestfs-actions.pod:2165 ../fish/guestfish-actions.pod:1463
10718 "This call lists the extended attributes of the file or directory C<path>."
10723 #: ../src/guestfs-actions.pod:2168 ../fish/guestfish-actions.pod:1466
10725 "At the system call level, this is a combination of the L<listxattr(2)> and "
10726 "L<getxattr(2)> calls."
10731 #: ../src/guestfs-actions.pod:2171
10732 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
10737 #: ../src/guestfs-actions.pod:2173 ../src/guestfs-actions.pod:3454
10738 #: ../src/guestfs-actions.pod:4105
10740 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
10741 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
10746 #: ../src/guestfs-actions.pod:2177 ../src/guestfs-actions.pod:3458
10747 #: ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3659
10748 #: ../src/guestfs-actions.pod:5535 ../src/guestfs-actions.pod:6023
10749 #: ../src/guestfs-actions.pod:7358
10750 msgid "(Added in 1.0.59)"
10755 #: ../src/guestfs-actions.pod:2179
10756 msgid "guestfs_glob_expand"
10761 #: ../src/guestfs-actions.pod:2181
10765 " guestfs_glob_expand (guestfs_h *g,\n"
10766 " const char *pattern);\n"
10772 #: ../src/guestfs-actions.pod:2185 ../fish/guestfish-actions.pod:1475
10774 "This command searches for all the pathnames matching C<pattern> according to "
10775 "the wildcard expansion rules used by the shell."
10780 #: ../src/guestfs-actions.pod:2189 ../fish/guestfish-actions.pod:1479
10782 "If no paths match, then this returns an empty list (note: not an error)."
10787 #: ../src/guestfs-actions.pod:2192 ../fish/guestfish-actions.pod:1482
10789 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
10790 "GLOB_BRACE>. See that manual page for more details."
10795 #: ../src/guestfs-actions.pod:2200 ../src/guestfs-actions.pod:6188
10796 #: ../src/guestfs-actions.pod:6205
10797 msgid "(Added in 1.0.50)"
10802 #: ../src/guestfs-actions.pod:2202
10803 msgid "guestfs_grep"
10808 #: ../src/guestfs-actions.pod:2204
10812 " guestfs_grep (guestfs_h *g,\n"
10813 " const char *regex,\n"
10814 " const char *path);\n"
10820 #: ../src/guestfs-actions.pod:2209 ../fish/guestfish-actions.pod:1490
10821 msgid "This calls the external C<grep> program and returns the matching lines."
10826 #: ../src/guestfs-actions.pod:2221
10827 msgid "guestfs_grepi"
10832 #: ../src/guestfs-actions.pod:2223
10836 " guestfs_grepi (guestfs_h *g,\n"
10837 " const char *regex,\n"
10838 " const char *path);\n"
10844 #: ../src/guestfs-actions.pod:2228 ../fish/guestfish-actions.pod:1500
10846 "This calls the external C<grep -i> program and returns the matching lines."
10851 #: ../src/guestfs-actions.pod:2240
10852 msgid "guestfs_grub_install"
10857 #: ../src/guestfs-actions.pod:2242
10861 " guestfs_grub_install (guestfs_h *g,\n"
10862 " const char *root,\n"
10863 " const char *device);\n"
10869 #: ../src/guestfs-actions.pod:2247 ../fish/guestfish-actions.pod:1510
10871 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
10872 "the root directory being C<root>."
10877 #: ../src/guestfs-actions.pod:2250 ../fish/guestfish-actions.pod:1513
10879 "Note: If grub-install reports the error \"No suitable drive was found in the "
10880 "generated device map.\" it may be that you need to create a C</boot/grub/"
10881 "device.map> file first that contains the mapping between grub device names "
10882 "and Linux device names. It is usually sufficient to create a file "
10888 #: ../src/guestfs-actions.pod:2257 ../fish/guestfish-actions.pod:1520
10891 " (hd0) /dev/vda\n"
10897 #: ../src/guestfs-actions.pod:2259 ../fish/guestfish-actions.pod:1522
10898 msgid "replacing C</dev/vda> with the name of the installation device."
10903 #: ../src/guestfs-actions.pod:2263
10904 msgid "(Added in 1.0.17)"
10909 #: ../src/guestfs-actions.pod:2265
10910 msgid "guestfs_head"
10915 #: ../src/guestfs-actions.pod:2267
10919 " guestfs_head (guestfs_h *g,\n"
10920 " const char *path);\n"
10926 #: ../src/guestfs-actions.pod:2271 ../fish/guestfish-actions.pod:1528
10928 "This command returns up to the first 10 lines of a file as a list of strings."
10933 #: ../src/guestfs-actions.pod:2283
10934 msgid "guestfs_head_n"
10939 #: ../src/guestfs-actions.pod:2285
10943 " guestfs_head_n (guestfs_h *g,\n"
10945 " const char *path);\n"
10951 #: ../src/guestfs-actions.pod:2290 ../fish/guestfish-actions.pod:1538
10953 "If the parameter C<nrlines> is a positive number, this returns the first "
10954 "C<nrlines> lines of the file C<path>."
10959 #: ../src/guestfs-actions.pod:2293 ../fish/guestfish-actions.pod:1541
10961 "If the parameter C<nrlines> is a negative number, this returns lines from "
10962 "the file C<path>, excluding the last C<nrlines> lines."
10967 #: ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:6485
10968 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:4364
10969 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
10974 #: ../src/guestfs-actions.pod:2307
10975 msgid "guestfs_hexdump"
10980 #: ../src/guestfs-actions.pod:2309
10984 " guestfs_hexdump (guestfs_h *g,\n"
10985 " const char *path);\n"
10991 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1553
10993 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
10994 "readable, canonical hex dump of the file."
10999 #: ../src/guestfs-actions.pod:2322 ../src/guestfs-actions.pod:6269
11000 #: ../src/guestfs-actions.pod:6324
11001 msgid "(Added in 1.0.22)"
11006 #: ../src/guestfs-actions.pod:2324
11007 msgid "guestfs_initrd_cat"
11012 #: ../src/guestfs-actions.pod:2326
11016 " guestfs_initrd_cat (guestfs_h *g,\n"
11017 " const char *initrdpath,\n"
11018 " const char *filename,\n"
11019 " size_t *size_r);\n"
11025 #: ../src/guestfs-actions.pod:2332 ../fish/guestfish-actions.pod:1563
11027 "This command unpacks the file C<filename> from the initrd file called "
11028 "C<initrdpath>. The filename must be given I<without> the initial C</> "
11034 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1567
11036 "For example, in guestfish you could use the following command to examine the "
11037 "boot script (usually called C</init>) contained in a Linux initrd or "
11043 #: ../src/guestfs-actions.pod:2340 ../fish/guestfish-actions.pod:1571
11046 " initrd-cat /boot/initrd-<version>.img init\n"
11052 #: ../src/guestfs-actions.pod:2342
11053 msgid "See also C<guestfs_initrd_list>."
11058 #: ../src/guestfs-actions.pod:2353
11059 msgid "guestfs_initrd_list"
11064 #: ../src/guestfs-actions.pod:2355
11068 " guestfs_initrd_list (guestfs_h *g,\n"
11069 " const char *path);\n"
11075 #: ../src/guestfs-actions.pod:2359 ../fish/guestfish-actions.pod:1582
11076 msgid "This command lists out files contained in an initrd."
11081 #: ../src/guestfs-actions.pod:2361 ../fish/guestfish-actions.pod:1584
11083 "The files are listed without any initial C</> character. The files are "
11084 "listed in the order they appear (not necessarily alphabetical). Directory "
11085 "names are listed as separate items."
11090 #: ../src/guestfs-actions.pod:2365 ../fish/guestfish-actions.pod:1588
11092 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
11093 "initrd. We I<only> support the newer initramfs format (compressed cpio "
11099 #: ../src/guestfs-actions.pod:2375
11100 msgid "guestfs_inotify_add_watch"
11105 #: ../src/guestfs-actions.pod:2377
11109 " guestfs_inotify_add_watch (guestfs_h *g,\n"
11110 " const char *path,\n"
11117 #: ../src/guestfs-actions.pod:2382 ../fish/guestfish-actions.pod:1596
11118 msgid "Watch C<path> for the events listed in C<mask>."
11123 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1598
11125 "Note that if C<path> is a directory then events within that directory are "
11126 "watched, but this does I<not> happen recursively (in subdirectories)."
11131 #: ../src/guestfs-actions.pod:2388 ../fish/guestfish-actions.pod:1602
11133 "Note for non-C or non-Linux callers: the inotify events are defined by the "
11134 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
11139 #: ../src/guestfs-actions.pod:2396
11140 msgid "guestfs_inotify_close"
11145 #: ../src/guestfs-actions.pod:2398
11149 " guestfs_inotify_close (guestfs_h *g);\n"
11155 #: ../src/guestfs-actions.pod:2401 ../fish/guestfish-actions.pod:1610
11157 "This closes the inotify handle which was previously opened by inotify_init. "
11158 "It removes all watches, throws away any pending events, and deallocates all "
11164 #: ../src/guestfs-actions.pod:2409
11165 msgid "guestfs_inotify_files"
11170 #: ../src/guestfs-actions.pod:2411
11174 " guestfs_inotify_files (guestfs_h *g);\n"
11180 #: ../src/guestfs-actions.pod:2414
11182 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
11183 "returns a list of pathnames of objects that were touched. The returned "
11184 "pathnames are sorted and deduplicated."
11189 #: ../src/guestfs-actions.pod:2424
11190 msgid "guestfs_inotify_init"
11195 #: ../src/guestfs-actions.pod:2426
11199 " guestfs_inotify_init (guestfs_h *g,\n"
11200 " int maxevents);\n"
11206 #: ../src/guestfs-actions.pod:2430 ../fish/guestfish-actions.pod:1626
11208 "This command creates a new inotify handle. The inotify subsystem can be "
11209 "used to notify events which happen to objects in the guest filesystem."
11214 #: ../src/guestfs-actions.pod:2434
11216 "C<maxevents> is the maximum number of events which will be queued up between "
11217 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
11218 "passed as C<0>, then the kernel (or previously set) default is used. For "
11219 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
11220 "throws away events, but records the fact that it threw them away by setting "
11221 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
11222 "C<guestfs_inotify_read>)."
11227 #: ../src/guestfs-actions.pod:2444
11229 "Before any events are generated, you have to add some watches to the "
11230 "internal watch list. See: C<guestfs_inotify_add_watch>, "
11231 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
11236 #: ../src/guestfs-actions.pod:2450
11238 "Queued up events should be read periodically by calling "
11239 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
11240 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
11241 "often enough then you risk the internal queue overflowing."
11246 #: ../src/guestfs-actions.pod:2457
11248 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
11249 "This also removes any watches automatically."
11254 #: ../src/guestfs-actions.pod:2461 ../fish/guestfish-actions.pod:1657
11256 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
11257 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
11258 "that there is one global inotify handle per libguestfs instance."
11263 #: ../src/guestfs-actions.pod:2470
11264 msgid "guestfs_inotify_read"
11269 #: ../src/guestfs-actions.pod:2472
11272 " struct guestfs_inotify_event_list *\n"
11273 " guestfs_inotify_read (guestfs_h *g);\n"
11279 #: ../src/guestfs-actions.pod:2475 ../fish/guestfish-actions.pod:1666
11281 "Return the complete queue of events that have happened since the previous "
11287 #: ../src/guestfs-actions.pod:2478 ../fish/guestfish-actions.pod:1669
11288 msgid "If no events have happened, this returns an empty list."
11293 #: ../src/guestfs-actions.pod:2480 ../fish/guestfish-actions.pod:1671
11295 "I<Note>: In order to make sure that all events have been read, you must call "
11296 "this function repeatedly until it returns an empty list. The reason is that "
11297 "the call will read events up to the maximum appliance-to-host message size "
11298 "and leave remaining events in the queue."
11303 #: ../src/guestfs-actions.pod:2486
11305 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
11306 "there was an error. I<The caller must call "
11307 "C<guestfs_free_inotify_event_list> after use>."
11312 #: ../src/guestfs-actions.pod:2492
11313 msgid "guestfs_inotify_rm_watch"
11318 #: ../src/guestfs-actions.pod:2494
11322 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
11329 #: ../src/guestfs-actions.pod:2498
11331 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
11336 #: ../src/guestfs-actions.pod:2505
11337 msgid "guestfs_inspect_get_arch"
11342 #: ../src/guestfs-actions.pod:2507
11346 " guestfs_inspect_get_arch (guestfs_h *g,\n"
11347 " const char *root);\n"
11353 #: ../src/guestfs-actions.pod:2511 ../src/guestfs-actions.pod:2534
11354 #: ../src/guestfs-actions.pod:2619 ../src/guestfs-actions.pod:2645
11355 #: ../src/guestfs-actions.pod:2684 ../src/guestfs-actions.pod:2706
11356 #: ../src/guestfs-actions.pod:2733 ../src/guestfs-actions.pod:2754
11357 #: ../src/guestfs-actions.pod:2791 ../src/guestfs-actions.pod:2820
11358 #: ../src/guestfs-actions.pod:2851 ../src/guestfs-actions.pod:2875
11359 #: ../src/guestfs-actions.pod:2930 ../src/guestfs-actions.pod:2972
11360 #: ../src/guestfs-actions.pod:2995 ../src/guestfs-actions.pod:3012
11361 #: ../src/guestfs-actions.pod:3029 ../src/guestfs-actions.pod:3048
11363 "This function should only be called with a root device string as returned by "
11364 "C<guestfs_inspect_os>."
11369 #: ../src/guestfs-actions.pod:2514
11371 "This returns the architecture of the inspected operating system. The "
11372 "possible return values are listed under C<guestfs_file_architecture>."
11377 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1695
11379 "If the architecture could not be determined, then the string C<unknown> is "
11385 #: ../src/guestfs-actions.pod:2521 ../src/guestfs-actions.pod:2606
11386 #: ../src/guestfs-actions.pod:2673 ../src/guestfs-actions.pod:2693
11387 #: ../src/guestfs-actions.pod:2721 ../src/guestfs-actions.pod:2807
11388 #: ../src/guestfs-actions.pod:2838 ../src/guestfs-actions.pod:2862
11389 #: ../src/guestfs-actions.pod:2916 ../src/guestfs-actions.pod:2959
11390 #: ../src/guestfs-actions.pod:2982 ../src/guestfs-actions.pod:3002
11391 #: ../src/guestfs-actions.pod:3019 ../src/guestfs-actions.pod:3038
11392 #: ../src/guestfs-actions.pod:3141 ../src/guestfs-actions.pod:3182
11393 #: ../fish/guestfish-actions.pod:1698 ../fish/guestfish-actions.pod:1776
11394 #: ../fish/guestfish-actions.pod:1828 ../fish/guestfish-actions.pod:1843
11395 #: ../fish/guestfish-actions.pod:1864 ../fish/guestfish-actions.pod:1928
11396 #: ../fish/guestfish-actions.pod:1952 ../fish/guestfish-actions.pod:1969
11397 #: ../fish/guestfish-actions.pod:2012 ../fish/guestfish-actions.pod:2047
11398 #: ../fish/guestfish-actions.pod:2063 ../fish/guestfish-actions.pod:2076
11399 #: ../fish/guestfish-actions.pod:2089 ../fish/guestfish-actions.pod:2104
11400 #: ../fish/guestfish-actions.pod:2203 ../fish/guestfish-actions.pod:2237
11401 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
11406 #: ../src/guestfs-actions.pod:2528
11407 msgid "guestfs_inspect_get_distro"
11412 #: ../src/guestfs-actions.pod:2530
11416 " guestfs_inspect_get_distro (guestfs_h *g,\n"
11417 " const char *root);\n"
11423 #: ../src/guestfs-actions.pod:2537 ../fish/guestfish-actions.pod:1707
11425 "This returns the distro (distribution) of the inspected operating system."
11430 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1710
11431 msgid "Currently defined distros are:"
11436 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1714
11437 msgid "\"archlinux\""
11442 #: ../src/guestfs-actions.pod:2546 ../fish/guestfish-actions.pod:1716
11443 msgid "Arch Linux."
11448 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1718
11454 #: ../src/guestfs-actions.pod:2550 ../fish/guestfish-actions.pod:1720
11460 #: ../src/guestfs-actions.pod:2552 ../fish/guestfish-actions.pod:1722
11466 #: ../src/guestfs-actions.pod:2554 ../fish/guestfish-actions.pod:1724
11472 #: ../src/guestfs-actions.pod:2556 ../fish/guestfish-actions.pod:1726
11478 #: ../src/guestfs-actions.pod:2558 ../fish/guestfish-actions.pod:1728
11484 #: ../src/guestfs-actions.pod:2560 ../fish/guestfish-actions.pod:1730
11485 msgid "\"linuxmint\""
11490 #: ../src/guestfs-actions.pod:2562 ../fish/guestfish-actions.pod:1732
11491 msgid "Linux Mint."
11496 #: ../src/guestfs-actions.pod:2564 ../fish/guestfish-actions.pod:1734
11497 msgid "\"mandriva\""
11502 #: ../src/guestfs-actions.pod:2566 ../fish/guestfish-actions.pod:1736
11508 #: ../src/guestfs-actions.pod:2568 ../fish/guestfish-actions.pod:1738
11514 #: ../src/guestfs-actions.pod:2570 ../fish/guestfish-actions.pod:1740
11520 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1742
11526 #: ../src/guestfs-actions.pod:2574 ../fish/guestfish-actions.pod:1744
11532 #: ../src/guestfs-actions.pod:2576 ../fish/guestfish-actions.pod:1746
11533 msgid "\"redhat-based\""
11538 #: ../src/guestfs-actions.pod:2578 ../fish/guestfish-actions.pod:1748
11539 msgid "Some Red Hat-derived distro."
11544 #: ../src/guestfs-actions.pod:2580 ../fish/guestfish-actions.pod:1750
11550 #: ../src/guestfs-actions.pod:2582 ../fish/guestfish-actions.pod:1752
11551 msgid "Red Hat Enterprise Linux and some derivatives."
11555 #: ../src/guestfs-actions.pod:2584 ../fish/guestfish-actions.pod:1754
11556 msgid "\"slackware\""
11560 #: ../src/guestfs-actions.pod:2586 ../fish/guestfish-actions.pod:1756
11566 #: ../src/guestfs-actions.pod:2588 ../fish/guestfish-actions.pod:1758
11572 #: ../src/guestfs-actions.pod:2590 ../fish/guestfish-actions.pod:1760
11578 #: ../src/guestfs-actions.pod:2592 ../src/guestfs-actions.pod:2664
11579 #: ../src/guestfs-actions.pod:2950 ../fish/guestfish-actions.pod:1762
11580 #: ../fish/guestfish-actions.pod:1819 ../fish/guestfish-actions.pod:2038
11581 msgid "\"unknown\""
11586 #: ../src/guestfs-actions.pod:2594 ../fish/guestfish-actions.pod:1764
11587 msgid "The distro could not be determined."
11592 #: ../src/guestfs-actions.pod:2596 ../src/guestfs-actions.pod:2942
11593 #: ../fish/guestfish-actions.pod:1766 ../fish/guestfish-actions.pod:2030
11594 msgid "\"windows\""
11599 #: ../src/guestfs-actions.pod:2598 ../fish/guestfish-actions.pod:1768
11601 "Windows does not have distributions. This string is returned if the OS type "
11607 #: ../src/guestfs-actions.pod:2603 ../src/guestfs-actions.pod:2670
11608 #: ../src/guestfs-actions.pod:2956 ../fish/guestfish-actions.pod:1773
11609 #: ../fish/guestfish-actions.pod:1825 ../fish/guestfish-actions.pod:2044
11611 "Future versions of libguestfs may return other strings here. The caller "
11612 "should be prepared to handle any string."
11617 #: ../src/guestfs-actions.pod:2613
11618 msgid "guestfs_inspect_get_filesystems"
11623 #: ../src/guestfs-actions.pod:2615
11627 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
11628 " const char *root);\n"
11634 #: ../src/guestfs-actions.pod:2622 ../fish/guestfish-actions.pod:1785
11636 "This returns a list of all the filesystems that we think are associated with "
11637 "this operating system. This includes the root filesystem, other ordinary "
11638 "filesystems, and non-mounted devices like swap partitions."
11643 #: ../src/guestfs-actions.pod:2627 ../fish/guestfish-actions.pod:1790
11645 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
11646 "to be shared between operating systems."
11651 #: ../src/guestfs-actions.pod:2630
11653 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11654 "C<guestfs_inspect_get_mountpoints>."
11658 #: ../src/guestfs-actions.pod:2639
11659 msgid "guestfs_inspect_get_format"
11663 #: ../src/guestfs-actions.pod:2641
11667 " guestfs_inspect_get_format (guestfs_h *g,\n"
11668 " const char *root);\n"
11673 #: ../src/guestfs-actions.pod:2648 ../fish/guestfish-actions.pod:1803
11675 "This returns the format of the inspected operating system. You can use it "
11676 "to detect install images, live CDs and similar."
11680 #: ../src/guestfs-actions.pod:2651 ../fish/guestfish-actions.pod:1806
11681 msgid "Currently defined formats are:"
11685 #: ../src/guestfs-actions.pod:2655 ../fish/guestfish-actions.pod:1810
11686 msgid "\"installed\""
11690 #: ../src/guestfs-actions.pod:2657 ../fish/guestfish-actions.pod:1812
11691 msgid "This is an installed operating system."
11695 #: ../src/guestfs-actions.pod:2659 ../fish/guestfish-actions.pod:1814
11696 msgid "\"installer\""
11700 #: ../src/guestfs-actions.pod:2661 ../fish/guestfish-actions.pod:1816
11702 "The disk image being inspected is not an installed operating system, but a "
11703 "I<bootable> install disk, live CD, or similar."
11707 #: ../src/guestfs-actions.pod:2666 ../fish/guestfish-actions.pod:1821
11708 msgid "The format of this disk image is not known."
11713 #: ../src/guestfs-actions.pod:2678
11714 msgid "guestfs_inspect_get_hostname"
11719 #: ../src/guestfs-actions.pod:2680
11723 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
11724 " const char *root);\n"
11730 #: ../src/guestfs-actions.pod:2687 ../fish/guestfish-actions.pod:1837
11732 "This function returns the hostname of the operating system as found by "
11733 "inspection of the guest's configuration files."
11738 #: ../src/guestfs-actions.pod:2690 ../fish/guestfish-actions.pod:1840
11740 "If the hostname could not be determined, then the string C<unknown> is "
11746 #: ../src/guestfs-actions.pod:2698
11747 msgid "(Added in 1.7.9)"
11752 #: ../src/guestfs-actions.pod:2700
11753 msgid "guestfs_inspect_get_major_version"
11758 #: ../src/guestfs-actions.pod:2702
11762 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
11763 " const char *root);\n"
11769 #: ../src/guestfs-actions.pod:2709 ../fish/guestfish-actions.pod:1852
11771 "This returns the major version number of the inspected operating system."
11776 #: ../src/guestfs-actions.pod:2712 ../fish/guestfish-actions.pod:1855
11778 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
11779 "popular public names used by the operating system. Notably the operating "
11780 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
11781 "1). You can find out the real versions corresponding to releases of Windows "
11782 "by consulting Wikipedia or MSDN."
11787 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2739
11788 #: ../fish/guestfish-actions.pod:1862 ../fish/guestfish-actions.pod:1876
11789 msgid "If the version could not be determined, then C<0> is returned."
11794 #: ../src/guestfs-actions.pod:2727
11795 msgid "guestfs_inspect_get_minor_version"
11800 #: ../src/guestfs-actions.pod:2729
11804 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
11805 " const char *root);\n"
11811 #: ../src/guestfs-actions.pod:2736 ../fish/guestfish-actions.pod:1873
11813 "This returns the minor version number of the inspected operating system."
11818 #: ../src/guestfs-actions.pod:2741
11820 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11821 "C<guestfs_inspect_get_major_version>."
11826 #: ../src/guestfs-actions.pod:2748
11827 msgid "guestfs_inspect_get_mountpoints"
11832 #: ../src/guestfs-actions.pod:2750
11836 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
11837 " const char *root);\n"
11842 #: ../src/guestfs-actions.pod:2757 ../fish/guestfish-actions.pod:1888
11844 "This returns a hash of where we think the filesystems associated with this "
11845 "operating system should be mounted. Callers should note that this is at "
11846 "best an educated guess made by reading configuration files such as C</etc/"
11847 "fstab>. I<In particular note> that this may return filesystems which are "
11848 "non-existent or not mountable and callers should be prepared to handle or "
11849 "ignore failures if they try to mount them."
11854 #: ../src/guestfs-actions.pod:2766 ../fish/guestfish-actions.pod:1897
11856 "Each element in the returned hashtable has a key which is the path of the "
11857 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
11858 "mounted there (eg. C</dev/sda1>)."
11863 #: ../src/guestfs-actions.pod:2771 ../fish/guestfish-actions.pod:1902
11865 "Non-mounted devices such as swap devices are I<not> returned in this list."
11870 #: ../src/guestfs-actions.pod:2774
11872 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
11873 "C<guestfs_inspect_get_filesystems>."
11878 #: ../src/guestfs-actions.pod:2777 ../src/guestfs-actions.pod:3511
11879 #: ../src/guestfs-actions.pod:4721 ../src/guestfs-actions.pod:6626
11881 "This function returns a NULL-terminated array of strings, or NULL if there "
11882 "was an error. The array of strings will always have length C<2n+1>, where "
11883 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
11884 "caller must free the strings and the array after use>."
11889 #: ../src/guestfs-actions.pod:2785
11890 msgid "guestfs_inspect_get_package_format"
11895 #: ../src/guestfs-actions.pod:2787
11899 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
11900 " const char *root);\n"
11906 #: ../src/guestfs-actions.pod:2794
11908 "This function and C<guestfs_inspect_get_package_management> return the "
11909 "package format and package management tool used by the inspected operating "
11910 "system. For example for Fedora these functions would return C<rpm> (package "
11911 "format) and C<yum> (package management)."
11916 #: ../src/guestfs-actions.pod:2800 ../fish/guestfish-actions.pod:1921
11918 "This returns the string C<unknown> if we could not determine the package "
11919 "format I<or> if the operating system does not have a real packaging system "
11925 #: ../src/guestfs-actions.pod:2804 ../fish/guestfish-actions.pod:1925
11927 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
11928 "Future versions of libguestfs may return other strings."
11933 #: ../src/guestfs-actions.pod:2812 ../src/guestfs-actions.pod:2843
11934 msgid "(Added in 1.7.5)"
11939 #: ../src/guestfs-actions.pod:2814
11940 msgid "guestfs_inspect_get_package_management"
11945 #: ../src/guestfs-actions.pod:2816
11949 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
11950 " const char *root);\n"
11956 #: ../src/guestfs-actions.pod:2823
11958 "C<guestfs_inspect_get_package_format> and this function return the package "
11959 "format and package management tool used by the inspected operating system. "
11960 "For example for Fedora these functions would return C<rpm> (package format) "
11961 "and C<yum> (package management)."
11966 #: ../src/guestfs-actions.pod:2829 ../fish/guestfish-actions.pod:1943
11968 "This returns the string C<unknown> if we could not determine the package "
11969 "management tool I<or> if the operating system does not have a real packaging "
11970 "system (eg. Windows)."
11975 #: ../src/guestfs-actions.pod:2833 ../fish/guestfish-actions.pod:1947
11977 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
11978 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
11979 "libguestfs may return other strings."
11984 #: ../src/guestfs-actions.pod:2845
11985 msgid "guestfs_inspect_get_product_name"
11990 #: ../src/guestfs-actions.pod:2847
11994 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
11995 " const char *root);\n"
12001 #: ../src/guestfs-actions.pod:2854 ../fish/guestfish-actions.pod:1961
12003 "This returns the product name of the inspected operating system. The "
12004 "product name is generally some freeform string which can be displayed to the "
12005 "user, but should not be parsed by programs."
12010 #: ../src/guestfs-actions.pod:2859 ../fish/guestfish-actions.pod:1966
12012 "If the product name could not be determined, then the string C<unknown> is "
12017 #: ../src/guestfs-actions.pod:2869
12018 msgid "guestfs_inspect_get_product_variant"
12022 #: ../src/guestfs-actions.pod:2871
12026 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
12027 " const char *root);\n"
12032 #: ../src/guestfs-actions.pod:2878 ../fish/guestfish-actions.pod:1978
12033 msgid "This returns the product variant of the inspected operating system."
12037 #: ../src/guestfs-actions.pod:2881 ../fish/guestfish-actions.pod:1981
12039 "For Windows guests, this returns the contents of the Registry key C<HKLM"
12040 "\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> which "
12041 "is usually a string such as C<Client> or C<Server> (other values are "
12042 "possible). This can be used to distinguish consumer and enterprise versions "
12043 "of Windows that have the same version number (for example, Windows 7 and "
12044 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
12045 "the latter is C<Server>)."
12049 #: ../src/guestfs-actions.pod:2890 ../fish/guestfish-actions.pod:1990
12051 "For enterprise Linux guests, in future we intend this to return the product "
12052 "variant such as C<Desktop>, C<Server> and so on. But this is not "
12053 "implemented at present."
12057 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:1994
12059 "If the product variant could not be determined, then the string C<unknown> "
12064 #: ../src/guestfs-actions.pod:2897
12066 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
12067 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
12072 #: ../src/guestfs-actions.pod:2904
12073 msgid "guestfs_inspect_get_roots"
12078 #: ../src/guestfs-actions.pod:2906
12082 " guestfs_inspect_get_roots (guestfs_h *g);\n"
12088 #: ../src/guestfs-actions.pod:2909
12090 "This function is a convenient way to get the list of root devices, as "
12091 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
12092 "the whole inspection process."
12097 #: ../src/guestfs-actions.pod:2913
12099 "This returns an empty list if either no root devices were found or the "
12100 "caller has not called C<guestfs_inspect_os>."
12105 #: ../src/guestfs-actions.pod:2922
12106 msgid "(Added in 1.7.3)"
12111 #: ../src/guestfs-actions.pod:2924
12112 msgid "guestfs_inspect_get_type"
12117 #: ../src/guestfs-actions.pod:2926
12121 " guestfs_inspect_get_type (guestfs_h *g,\n"
12122 " const char *root);\n"
12128 #: ../src/guestfs-actions.pod:2933 ../fish/guestfish-actions.pod:2021
12130 "This returns the type of the inspected operating system. Currently defined "
12136 #: ../src/guestfs-actions.pod:2938 ../fish/guestfish-actions.pod:2026
12142 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2028
12143 msgid "Any Linux-based operating system."
12148 #: ../src/guestfs-actions.pod:2944 ../fish/guestfish-actions.pod:2032
12149 msgid "Any Microsoft Windows operating system."
12154 #: ../src/guestfs-actions.pod:2946 ../fish/guestfish-actions.pod:2034
12155 msgid "\"freebsd\""
12160 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2036
12166 #: ../src/guestfs-actions.pod:2952 ../fish/guestfish-actions.pod:2040
12167 msgid "The operating system type could not be determined."
12172 #: ../src/guestfs-actions.pod:2966
12173 msgid "guestfs_inspect_get_windows_systemroot"
12178 #: ../src/guestfs-actions.pod:2968
12182 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
12183 " const char *root);\n"
12189 #: ../src/guestfs-actions.pod:2975 ../fish/guestfish-actions.pod:2056
12191 "This returns the Windows systemroot of the inspected guest. The systemroot "
12192 "is a directory path such as C</WINDOWS>."
12197 #: ../src/guestfs-actions.pod:2978 ../fish/guestfish-actions.pod:2059
12199 "This call assumes that the guest is Windows and that the systemroot could be "
12200 "determined by inspection. If this is not the case then an error is returned."
12205 #: ../src/guestfs-actions.pod:2987
12206 msgid "(Added in 1.5.25)"
12210 #: ../src/guestfs-actions.pod:2989
12211 msgid "guestfs_inspect_is_live"
12215 #: ../src/guestfs-actions.pod:2991
12219 " guestfs_inspect_is_live (guestfs_h *g,\n"
12220 " const char *root);\n"
12225 #: ../src/guestfs-actions.pod:2998
12227 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
12228 "disk), then this returns true if a live image was detected on the disk."
12232 #: ../src/guestfs-actions.pod:3006
12233 msgid "guestfs_inspect_is_multipart"
12237 #: ../src/guestfs-actions.pod:3008
12241 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
12242 " const char *root);\n"
12247 #: ../src/guestfs-actions.pod:3015
12249 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
12250 "disk), then this returns true if the disk is part of a set."
12254 #: ../src/guestfs-actions.pod:3023
12255 msgid "guestfs_inspect_is_netinst"
12259 #: ../src/guestfs-actions.pod:3025
12263 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
12264 " const char *root);\n"
12269 #: ../src/guestfs-actions.pod:3032
12271 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
12272 "disk), then this returns true if the disk is a network installer, ie. not a "
12273 "self-contained install CD but one which is likely to require network access "
12274 "to complete the install."
12279 #: ../src/guestfs-actions.pod:3042
12280 msgid "guestfs_inspect_list_applications"
12285 #: ../src/guestfs-actions.pod:3044
12288 " struct guestfs_application_list *\n"
12289 " guestfs_inspect_list_applications (guestfs_h *g,\n"
12290 " const char *root);\n"
12296 #: ../src/guestfs-actions.pod:3051 ../fish/guestfish-actions.pod:2113
12297 msgid "Return the list of applications installed in the operating system."
12302 #: ../src/guestfs-actions.pod:3053
12304 "I<Note:> This call works differently from other parts of the inspection "
12305 "API. You have to call C<guestfs_inspect_os>, then "
12306 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
12307 "this. Listing applications is a significantly more difficult operation "
12308 "which requires access to the full filesystem. Also note that unlike the "
12309 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
12310 "the libguestfs handle, this call actually reads parts of the mounted "
12311 "filesystems during the call."
12316 #: ../src/guestfs-actions.pod:3063 ../fish/guestfish-actions.pod:2125
12318 "This returns an empty list if the inspection code was not able to determine "
12319 "the list of applications."
12324 #: ../src/guestfs-actions.pod:3066 ../fish/guestfish-actions.pod:2128
12325 msgid "The application structure contains the following fields:"
12330 #: ../src/guestfs-actions.pod:3070 ../fish/guestfish-actions.pod:2132
12331 msgid "C<app_name>"
12336 #: ../src/guestfs-actions.pod:3072 ../fish/guestfish-actions.pod:2134
12338 "The name of the application. For Red Hat-derived and Debian-derived Linux "
12339 "guests, this is the package name."
12344 #: ../src/guestfs-actions.pod:3075 ../fish/guestfish-actions.pod:2137
12345 msgid "C<app_display_name>"
12350 #: ../src/guestfs-actions.pod:3077 ../fish/guestfish-actions.pod:2139
12352 "The display name of the application, sometimes localized to the install "
12353 "language of the guest operating system."
12358 #: ../src/guestfs-actions.pod:3080 ../fish/guestfish-actions.pod:2142
12360 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
12361 "to display something can use C<app_name> instead."
12366 #: ../src/guestfs-actions.pod:3083 ../fish/guestfish-actions.pod:2145
12367 msgid "C<app_epoch>"
12372 #: ../src/guestfs-actions.pod:3085 ../fish/guestfish-actions.pod:2147
12374 "For package managers which use epochs, this contains the epoch of the "
12375 "package (an integer). If unavailable, this is returned as C<0>."
12380 #: ../src/guestfs-actions.pod:3088 ../fish/guestfish-actions.pod:2150
12381 msgid "C<app_version>"
12386 #: ../src/guestfs-actions.pod:3090 ../fish/guestfish-actions.pod:2152
12388 "The version string of the application or package. If unavailable this is "
12389 "returned as an empty string C<\"\">."
12394 #: ../src/guestfs-actions.pod:3093 ../fish/guestfish-actions.pod:2155
12395 msgid "C<app_release>"
12400 #: ../src/guestfs-actions.pod:3095 ../fish/guestfish-actions.pod:2157
12402 "The release string of the application or package, for package managers that "
12403 "use this. If unavailable this is returned as an empty string C<\"\">."
12408 #: ../src/guestfs-actions.pod:3099 ../fish/guestfish-actions.pod:2161
12409 msgid "C<app_install_path>"
12414 #: ../src/guestfs-actions.pod:3101 ../fish/guestfish-actions.pod:2163
12416 "The installation path of the application (on operating systems such as "
12417 "Windows which use installation paths). This path is in the format used by "
12418 "the guest operating system, it is not a libguestfs path."
12423 #: ../src/guestfs-actions.pod:3106 ../fish/guestfish-actions.pod:2168
12424 msgid "If unavailable this is returned as an empty string C<\"\">."
12429 #: ../src/guestfs-actions.pod:3108 ../fish/guestfish-actions.pod:2170
12430 msgid "C<app_trans_path>"
12435 #: ../src/guestfs-actions.pod:3110 ../fish/guestfish-actions.pod:2172
12437 "The install path translated into a libguestfs path. If unavailable this is "
12438 "returned as an empty string C<\"\">."
12443 #: ../src/guestfs-actions.pod:3113 ../fish/guestfish-actions.pod:2175
12444 msgid "C<app_publisher>"
12449 #: ../src/guestfs-actions.pod:3115 ../fish/guestfish-actions.pod:2177
12451 "The name of the publisher of the application, for package managers that use "
12452 "this. If unavailable this is returned as an empty string C<\"\">."
12457 #: ../src/guestfs-actions.pod:3119 ../fish/guestfish-actions.pod:2181
12463 #: ../src/guestfs-actions.pod:3121 ../fish/guestfish-actions.pod:2183
12465 "The URL (eg. upstream URL) of the application. If unavailable this is "
12466 "returned as an empty string C<\"\">."
12471 #: ../src/guestfs-actions.pod:3124 ../fish/guestfish-actions.pod:2186
12472 msgid "C<app_source_package>"
12477 #: ../src/guestfs-actions.pod:3126 ../fish/guestfish-actions.pod:2188
12479 "For packaging systems which support this, the name of the source package. "
12480 "If unavailable this is returned as an empty string C<\"\">."
12485 #: ../src/guestfs-actions.pod:3129 ../fish/guestfish-actions.pod:2191
12486 msgid "C<app_summary>"
12491 #: ../src/guestfs-actions.pod:3131 ../fish/guestfish-actions.pod:2193
12493 "A short (usually one line) description of the application or package. If "
12494 "unavailable this is returned as an empty string C<\"\">."
12499 #: ../src/guestfs-actions.pod:3134 ../fish/guestfish-actions.pod:2196
12500 msgid "C<app_description>"
12505 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2198
12507 "A longer description of the application or package. If unavailable this is "
12508 "returned as an empty string C<\"\">."
12513 #: ../src/guestfs-actions.pod:3143
12515 "This function returns a C<struct guestfs_application_list *>, or NULL if "
12516 "there was an error. I<The caller must call C<guestfs_free_application_list> "
12522 #: ../src/guestfs-actions.pod:3147
12523 msgid "(Added in 1.7.8)"
12528 #: ../src/guestfs-actions.pod:3149
12529 msgid "guestfs_inspect_os"
12534 #: ../src/guestfs-actions.pod:3151
12538 " guestfs_inspect_os (guestfs_h *g);\n"
12544 #: ../src/guestfs-actions.pod:3154 ../fish/guestfish-actions.pod:2209
12546 "This function uses other libguestfs functions and certain heuristics to "
12547 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
12548 "for operating systems."
12553 #: ../src/guestfs-actions.pod:3158 ../fish/guestfish-actions.pod:2213
12554 msgid "The list returned is empty if no operating systems were found."
12559 #: ../src/guestfs-actions.pod:3160 ../fish/guestfish-actions.pod:2215
12561 "If one operating system was found, then this returns a list with a single "
12562 "element, which is the name of the root filesystem of this operating system. "
12563 "It is also possible for this function to return a list containing more than "
12564 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
12565 "element being the root filesystem of one of the operating systems."
12570 #: ../src/guestfs-actions.pod:3167
12572 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
12573 "functions in order to query further information about each operating system, "
12574 "such as the name and version."
12579 #: ../src/guestfs-actions.pod:3172
12581 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
12582 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
12583 "the contents. This should be called with no disks currently mounted. The "
12584 "function may also use Augeas, so any existing Augeas handle will be closed."
12589 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2233
12591 "This function cannot decrypt encrypted disks. The caller must do that first "
12592 "(supplying the necessary keys) if the disk is encrypted."
12597 #: ../src/guestfs-actions.pod:3184 ../src/guestfs-actions.pod:3469
12598 #: ../src/guestfs-actions.pod:3531
12599 msgid "See also C<guestfs_list_filesystems>."
12604 #: ../src/guestfs-actions.pod:3192
12605 msgid "guestfs_is_blockdev"
12610 #: ../src/guestfs-actions.pod:3194
12614 " guestfs_is_blockdev (guestfs_h *g,\n"
12615 " const char *path);\n"
12621 #: ../src/guestfs-actions.pod:3198 ../fish/guestfish-actions.pod:2245
12623 "This returns C<true> if and only if there is a block device with the given "
12629 #: ../src/guestfs-actions.pod:3201 ../src/guestfs-actions.pod:3230
12630 #: ../src/guestfs-actions.pod:3260 ../src/guestfs-actions.pod:3275
12631 #: ../src/guestfs-actions.pod:3291 ../src/guestfs-actions.pod:3347
12632 #: ../src/guestfs-actions.pod:3362
12633 msgid "See also C<guestfs_stat>."
12638 #: ../src/guestfs-actions.pod:3205 ../src/guestfs-actions.pod:3234
12639 #: ../src/guestfs-actions.pod:3279 ../src/guestfs-actions.pod:3351
12640 #: ../src/guestfs-actions.pod:3366
12641 msgid "(Added in 1.5.10)"
12646 #: ../src/guestfs-actions.pod:3207
12647 msgid "guestfs_is_busy"
12652 #: ../src/guestfs-actions.pod:3209
12656 " guestfs_is_busy (guestfs_h *g);\n"
12662 #: ../src/guestfs-actions.pod:3212 ../fish/guestfish-actions.pod:2254
12664 "This returns true iff this handle is busy processing a command (in the "
12670 #: ../src/guestfs-actions.pod:3221
12671 msgid "guestfs_is_chardev"
12676 #: ../src/guestfs-actions.pod:3223
12680 " guestfs_is_chardev (guestfs_h *g,\n"
12681 " const char *path);\n"
12687 #: ../src/guestfs-actions.pod:3227 ../fish/guestfish-actions.pod:2263
12689 "This returns C<true> if and only if there is a character device with the "
12690 "given C<path> name."
12695 #: ../src/guestfs-actions.pod:3236
12696 msgid "guestfs_is_config"
12701 #: ../src/guestfs-actions.pod:3238
12705 " guestfs_is_config (guestfs_h *g);\n"
12711 #: ../src/guestfs-actions.pod:3241 ../fish/guestfish-actions.pod:2272
12713 "This returns true iff this handle is being configured (in the C<CONFIG> "
12719 #: ../src/guestfs-actions.pod:3250
12720 msgid "guestfs_is_dir"
12725 #: ../src/guestfs-actions.pod:3252
12729 " guestfs_is_dir (guestfs_h *g,\n"
12730 " const char *path);\n"
12736 #: ../src/guestfs-actions.pod:3256 ../fish/guestfish-actions.pod:2281
12738 "This returns C<true> if and only if there is a directory with the given "
12739 "C<path> name. Note that it returns false for other objects like files."
12744 #: ../src/guestfs-actions.pod:3266
12745 msgid "guestfs_is_fifo"
12750 #: ../src/guestfs-actions.pod:3268
12754 " guestfs_is_fifo (guestfs_h *g,\n"
12755 " const char *path);\n"
12761 #: ../src/guestfs-actions.pod:3272 ../fish/guestfish-actions.pod:2291
12763 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
12764 "given C<path> name."
12769 #: ../src/guestfs-actions.pod:3281
12770 msgid "guestfs_is_file"
12775 #: ../src/guestfs-actions.pod:3283
12779 " guestfs_is_file (guestfs_h *g,\n"
12780 " const char *path);\n"
12786 #: ../src/guestfs-actions.pod:3287 ../fish/guestfish-actions.pod:2300
12788 "This returns C<true> if and only if there is a regular file with the given "
12789 "C<path> name. Note that it returns false for other objects like directories."
12794 #: ../src/guestfs-actions.pod:3297
12795 msgid "guestfs_is_launching"
12800 #: ../src/guestfs-actions.pod:3299
12804 " guestfs_is_launching (guestfs_h *g);\n"
12810 #: ../src/guestfs-actions.pod:3302 ../fish/guestfish-actions.pod:2310
12812 "This returns true iff this handle is launching the subprocess (in the "
12813 "C<LAUNCHING> state)."
12818 #: ../src/guestfs-actions.pod:3311
12819 msgid "guestfs_is_lv"
12824 #: ../src/guestfs-actions.pod:3313
12828 " guestfs_is_lv (guestfs_h *g,\n"
12829 " const char *device);\n"
12835 #: ../src/guestfs-actions.pod:3317 ../fish/guestfish-actions.pod:2319
12837 "This command tests whether C<device> is a logical volume, and returns true "
12838 "iff this is the case."
12843 #: ../src/guestfs-actions.pod:3324
12844 msgid "guestfs_is_ready"
12849 #: ../src/guestfs-actions.pod:3326
12853 " guestfs_is_ready (guestfs_h *g);\n"
12859 #: ../src/guestfs-actions.pod:3329 ../fish/guestfish-actions.pod:2326
12861 "This returns true iff this handle is ready to accept commands (in the "
12867 #: ../src/guestfs-actions.pod:3338
12868 msgid "guestfs_is_socket"
12873 #: ../src/guestfs-actions.pod:3340
12877 " guestfs_is_socket (guestfs_h *g,\n"
12878 " const char *path);\n"
12884 #: ../src/guestfs-actions.pod:3344 ../fish/guestfish-actions.pod:2335
12886 "This returns C<true> if and only if there is a Unix domain socket with the "
12887 "given C<path> name."
12892 #: ../src/guestfs-actions.pod:3353
12893 msgid "guestfs_is_symlink"
12898 #: ../src/guestfs-actions.pod:3355
12902 " guestfs_is_symlink (guestfs_h *g,\n"
12903 " const char *path);\n"
12909 #: ../src/guestfs-actions.pod:3359 ../fish/guestfish-actions.pod:2344
12911 "This returns C<true> if and only if there is a symbolic link with the given "
12917 #: ../src/guestfs-actions.pod:3368
12918 msgid "guestfs_kill_subprocess"
12923 #: ../src/guestfs-actions.pod:3370
12927 " guestfs_kill_subprocess (guestfs_h *g);\n"
12933 #: ../src/guestfs-actions.pod:3373 ../fish/guestfish-actions.pod:2353
12934 msgid "This kills the qemu subprocess. You should never need to call this."
12939 #: ../src/guestfs-actions.pod:3379
12940 msgid "guestfs_launch"
12945 #: ../src/guestfs-actions.pod:3381
12949 " guestfs_launch (guestfs_h *g);\n"
12955 #: ../src/guestfs-actions.pod:3384 ../fish/guestfish-actions.pod:2361
12957 "Internally libguestfs is implemented by running a virtual machine using "
12963 #: ../src/guestfs-actions.pod:3387 ../fish/guestfish-actions.pod:2364
12965 "You should call this after configuring the handle (eg. adding drives) but "
12966 "before performing any actions."
12971 #: ../src/guestfs-actions.pod:3394
12972 msgid "guestfs_lchown"
12977 #: ../src/guestfs-actions.pod:3396
12981 " guestfs_lchown (guestfs_h *g,\n"
12984 " const char *path);\n"
12990 #: ../src/guestfs-actions.pod:3402
12992 "Change the file owner to C<owner> and group to C<group>. This is like "
12993 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
12994 "changed, not the target."
12999 #: ../src/guestfs-actions.pod:3414
13000 msgid "guestfs_lgetxattr"
13005 #: ../src/guestfs-actions.pod:3416
13009 " guestfs_lgetxattr (guestfs_h *g,\n"
13010 " const char *path,\n"
13011 " const char *name,\n"
13012 " size_t *size_r);\n"
13018 #: ../src/guestfs-actions.pod:3422 ../fish/guestfish-actions.pod:2383
13020 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
13021 "is a symlink, then this call returns an extended attribute from the symlink."
13026 #: ../src/guestfs-actions.pod:3436
13027 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
13032 #: ../src/guestfs-actions.pod:3444
13033 msgid "guestfs_lgetxattrs"
13038 #: ../src/guestfs-actions.pod:3446
13041 " struct guestfs_xattr_list *\n"
13042 " guestfs_lgetxattrs (guestfs_h *g,\n"
13043 " const char *path);\n"
13049 #: ../src/guestfs-actions.pod:3450
13051 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
13052 "then it returns the extended attributes of the link itself."
13057 #: ../src/guestfs-actions.pod:3460
13058 msgid "guestfs_list_devices"
13063 #: ../src/guestfs-actions.pod:3462
13067 " guestfs_list_devices (guestfs_h *g);\n"
13073 #: ../src/guestfs-actions.pod:3465 ../fish/guestfish-actions.pod:2411
13074 msgid "List all the block devices."
13079 #: ../src/guestfs-actions.pod:3467 ../fish/guestfish-actions.pod:2413
13080 msgid "The full block device names are returned, eg. C</dev/sda>."
13085 #: ../src/guestfs-actions.pod:3477
13086 msgid "guestfs_list_filesystems"
13091 #: ../src/guestfs-actions.pod:3479
13095 " guestfs_list_filesystems (guestfs_h *g);\n"
13101 #: ../src/guestfs-actions.pod:3482 ../fish/guestfish-actions.pod:2421
13103 "This inspection command looks for filesystems on partitions, block devices "
13104 "and logical volumes, returning a list of devices containing filesystems and "
13110 #: ../src/guestfs-actions.pod:3486 ../fish/guestfish-actions.pod:2425
13112 "The return value is a hash, where the keys are the devices containing "
13113 "filesystems, and the values are the filesystem types. For example:"
13118 #: ../src/guestfs-actions.pod:3490 ../fish/guestfish-actions.pod:2429
13121 " \"/dev/sda1\" => \"ntfs\"\n"
13122 " \"/dev/sda2\" => \"ext2\"\n"
13123 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
13124 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
13130 #: ../src/guestfs-actions.pod:3495 ../fish/guestfish-actions.pod:2434
13132 "The value can have the special value \"unknown\", meaning the content of the "
13133 "device is undetermined or empty. \"swap\" means a Linux swap partition."
13138 #: ../src/guestfs-actions.pod:3499
13140 "This command runs other libguestfs commands, which might include "
13141 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
13142 "soon after launch and only when nothing is mounted."
13147 #: ../src/guestfs-actions.pod:3503
13149 "Not all of the filesystems returned will be mountable. In particular, swap "
13150 "partitions are returned in the list. Also this command does not check that "
13151 "each filesystem found is valid and mountable, and some filesystems might be "
13152 "mountable but require special options. Filesystems may not all belong to a "
13153 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
13158 #: ../src/guestfs-actions.pod:3517 ../src/guestfs-actions.pod:5122
13159 msgid "(Added in 1.5.15)"
13164 #: ../src/guestfs-actions.pod:3519
13165 msgid "guestfs_list_partitions"
13170 #: ../src/guestfs-actions.pod:3521
13174 " guestfs_list_partitions (guestfs_h *g);\n"
13180 #: ../src/guestfs-actions.pod:3524 ../fish/guestfish-actions.pod:2454
13181 msgid "List all the partitions detected on all block devices."
13186 #: ../src/guestfs-actions.pod:3526 ../fish/guestfish-actions.pod:2456
13187 msgid "The full partition device names are returned, eg. C</dev/sda1>"
13192 #: ../src/guestfs-actions.pod:3528
13194 "This does not return logical volumes. For that you will need to call "
13200 #: ../src/guestfs-actions.pod:3539
13206 #: ../src/guestfs-actions.pod:3541
13210 " guestfs_ll (guestfs_h *g,\n"
13211 " const char *directory);\n"
13217 #: ../src/guestfs-actions.pod:3545 ../fish/guestfish-actions.pod:2467
13219 "List the files in C<directory> (relative to the root directory, there is no "
13220 "cwd) in the format of 'ls -la'."
13225 #: ../src/guestfs-actions.pod:3548 ../fish/guestfish-actions.pod:2470
13227 "This command is mostly useful for interactive sessions. It is I<not> "
13228 "intended that you try to parse the output string."
13233 #: ../src/guestfs-actions.pod:3556
13239 #: ../src/guestfs-actions.pod:3558
13243 " guestfs_ln (guestfs_h *g,\n"
13244 " const char *target,\n"
13245 " const char *linkname);\n"
13251 #: ../src/guestfs-actions.pod:3563 ../fish/guestfish-actions.pod:2477
13252 msgid "This command creates a hard link using the C<ln> command."
13257 #: ../src/guestfs-actions.pod:3569
13258 msgid "guestfs_ln_f"
13263 #: ../src/guestfs-actions.pod:3571
13267 " guestfs_ln_f (guestfs_h *g,\n"
13268 " const char *target,\n"
13269 " const char *linkname);\n"
13275 #: ../src/guestfs-actions.pod:3576 ../fish/guestfish-actions.pod:2483
13277 "This command creates a hard link using the C<ln -f> command. The C<-f> "
13278 "option removes the link (C<linkname>) if it exists already."
13283 #: ../src/guestfs-actions.pod:3583
13284 msgid "guestfs_ln_s"
13289 #: ../src/guestfs-actions.pod:3585
13293 " guestfs_ln_s (guestfs_h *g,\n"
13294 " const char *target,\n"
13295 " const char *linkname);\n"
13301 #: ../src/guestfs-actions.pod:3590 ../fish/guestfish-actions.pod:2490
13302 msgid "This command creates a symbolic link using the C<ln -s> command."
13307 #: ../src/guestfs-actions.pod:3596
13308 msgid "guestfs_ln_sf"
13313 #: ../src/guestfs-actions.pod:3598
13317 " guestfs_ln_sf (guestfs_h *g,\n"
13318 " const char *target,\n"
13319 " const char *linkname);\n"
13325 #: ../src/guestfs-actions.pod:3603 ../fish/guestfish-actions.pod:2496
13327 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
13328 "option removes the link (C<linkname>) if it exists already."
13333 #: ../src/guestfs-actions.pod:3610
13334 msgid "guestfs_lremovexattr"
13339 #: ../src/guestfs-actions.pod:3612
13343 " guestfs_lremovexattr (guestfs_h *g,\n"
13344 " const char *xattr,\n"
13345 " const char *path);\n"
13351 #: ../src/guestfs-actions.pod:3617
13353 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
13354 "link, then it removes an extended attribute of the link itself."
13359 #: ../src/guestfs-actions.pod:3625
13365 #: ../src/guestfs-actions.pod:3627
13369 " guestfs_ls (guestfs_h *g,\n"
13370 " const char *directory);\n"
13376 #: ../src/guestfs-actions.pod:3631 ../fish/guestfish-actions.pod:2511
13378 "List the files in C<directory> (relative to the root directory, there is no "
13379 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
13384 #: ../src/guestfs-actions.pod:3635
13386 "This command is mostly useful for interactive sessions. Programs should "
13387 "probably use C<guestfs_readdir> instead."
13392 #: ../src/guestfs-actions.pod:3644
13393 msgid "guestfs_lsetxattr"
13398 #: ../src/guestfs-actions.pod:3646
13402 " guestfs_lsetxattr (guestfs_h *g,\n"
13403 " const char *xattr,\n"
13404 " const char *val,\n"
13406 " const char *path);\n"
13412 #: ../src/guestfs-actions.pod:3653
13414 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
13415 "then it sets an extended attribute of the link itself."
13420 #: ../src/guestfs-actions.pod:3661
13421 msgid "guestfs_lstat"
13426 #: ../src/guestfs-actions.pod:3663
13429 " struct guestfs_stat *\n"
13430 " guestfs_lstat (guestfs_h *g,\n"
13431 " const char *path);\n"
13437 #: ../src/guestfs-actions.pod:3667 ../src/guestfs-actions.pod:6225
13438 #: ../fish/guestfish-actions.pod:2530 ../fish/guestfish-actions.pod:4199
13439 msgid "Returns file information for the given C<path>."
13444 #: ../src/guestfs-actions.pod:3669
13446 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
13447 "link, then the link is stat-ed, not the file it refers to."
13452 #: ../src/guestfs-actions.pod:3673 ../fish/guestfish-actions.pod:2536
13453 msgid "This is the same as the C<lstat(2)> system call."
13458 #: ../src/guestfs-actions.pod:3675 ../src/guestfs-actions.pod:6229
13460 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
13461 "error. I<The caller must call C<guestfs_free_stat> after use>."
13466 #: ../src/guestfs-actions.pod:3679 ../src/guestfs-actions.pod:6233
13467 #: ../src/guestfs-actions.pod:6251 ../src/guestfs-actions.pod:6632
13468 msgid "(Added in 0.9.2)"
13473 #: ../src/guestfs-actions.pod:3681
13474 msgid "guestfs_lstatlist"
13479 #: ../src/guestfs-actions.pod:3683
13482 " struct guestfs_stat_list *\n"
13483 " guestfs_lstatlist (guestfs_h *g,\n"
13484 " const char *path,\n"
13485 " char *const *names);\n"
13491 #: ../src/guestfs-actions.pod:3688
13493 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
13494 "files, where all files are in the directory C<path>. C<names> is the list "
13495 "of files from this directory."
13500 #: ../src/guestfs-actions.pod:3692 ../fish/guestfish-actions.pod:2546
13502 "On return you get a list of stat structs, with a one-to-one correspondence "
13503 "to the C<names> list. If any name did not exist or could not be lstat'd, "
13504 "then the C<ino> field of that structure is set to C<-1>."
13509 #: ../src/guestfs-actions.pod:3697
13511 "This call is intended for programs that want to efficiently list a directory "
13512 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
13513 "for a similarly efficient call for getting extended attributes. Very long "
13514 "directory listings might cause the protocol message size to be exceeded, "
13515 "causing this call to fail. The caller must split up such requests into "
13516 "smaller groups of names."
13521 #: ../src/guestfs-actions.pod:3705
13523 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
13524 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
13529 #: ../src/guestfs-actions.pod:3711
13530 msgid "guestfs_luks_add_key"
13535 #: ../src/guestfs-actions.pod:3713
13539 " guestfs_luks_add_key (guestfs_h *g,\n"
13540 " const char *device,\n"
13541 " const char *key,\n"
13542 " const char *newkey,\n"
13549 #: ../src/guestfs-actions.pod:3720 ../fish/guestfish-actions.pod:2563
13551 "This command adds a new key on LUKS device C<device>. C<key> is any "
13552 "existing key, and is used to access the device. C<newkey> is the new key to "
13553 "add. C<keyslot> is the key slot that will be replaced."
13558 #: ../src/guestfs-actions.pod:3725
13560 "Note that if C<keyslot> already contains a key, then this command will "
13561 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
13566 #: ../src/guestfs-actions.pod:3731 ../src/guestfs-actions.pod:3771
13567 #: ../src/guestfs-actions.pod:3794 ../src/guestfs-actions.pod:3814
13568 #: ../src/guestfs-actions.pod:3846 ../src/guestfs-actions.pod:3865
13570 "This function takes a key or passphrase parameter which could contain "
13571 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
13577 #: ../src/guestfs-actions.pod:3735 ../src/guestfs-actions.pod:3775
13578 #: ../src/guestfs-actions.pod:3798 ../src/guestfs-actions.pod:3818
13579 msgid "(Added in 1.5.2)"
13584 #: ../src/guestfs-actions.pod:3737
13585 msgid "guestfs_luks_close"
13590 #: ../src/guestfs-actions.pod:3739
13594 " guestfs_luks_close (guestfs_h *g,\n"
13595 " const char *device);\n"
13601 #: ../src/guestfs-actions.pod:3743
13603 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
13604 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
13605 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
13606 "underlying block device."
13611 #: ../src/guestfs-actions.pod:3751 ../src/guestfs-actions.pod:3850
13612 #: ../src/guestfs-actions.pod:3869 ../src/guestfs-actions.pod:3919
13613 #: ../src/guestfs-actions.pod:3967
13614 msgid "(Added in 1.5.1)"
13619 #: ../src/guestfs-actions.pod:3753
13620 msgid "guestfs_luks_format"
13625 #: ../src/guestfs-actions.pod:3755
13629 " guestfs_luks_format (guestfs_h *g,\n"
13630 " const char *device,\n"
13631 " const char *key,\n"
13638 #: ../src/guestfs-actions.pod:3761 ../fish/guestfish-actions.pod:2589
13640 "This command erases existing data on C<device> and formats the device as a "
13641 "LUKS encrypted device. C<key> is the initial key, which is added to key "
13642 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
13647 #: ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3791
13648 #: ../src/guestfs-actions.pod:3931 ../src/guestfs-actions.pod:4873
13649 #: ../src/guestfs-actions.pod:5653 ../src/guestfs-actions.pod:6060
13650 #: ../src/guestfs-actions.pod:6083 ../src/guestfs-actions.pod:6109
13651 #: ../src/guestfs-actions.pod:7269 ../fish/guestfish-actions.pod:2597
13652 #: ../fish/guestfish-actions.pod:2610 ../fish/guestfish-actions.pod:2694
13653 #: ../fish/guestfish-actions.pod:3268 ../fish/guestfish-actions.pod:3788
13654 #: ../fish/guestfish-actions.pod:4098 ../fish/guestfish-actions.pod:4114
13655 #: ../fish/guestfish-actions.pod:4129 ../fish/guestfish-actions.pod:4844
13657 "B<This command is dangerous. Without careful use you can easily destroy all "
13663 #: ../src/guestfs-actions.pod:3777
13664 msgid "guestfs_luks_format_cipher"
13669 #: ../src/guestfs-actions.pod:3779
13673 " guestfs_luks_format_cipher (guestfs_h *g,\n"
13674 " const char *device,\n"
13675 " const char *key,\n"
13677 " const char *cipher);\n"
13683 #: ../src/guestfs-actions.pod:3786
13685 "This command is the same as C<guestfs_luks_format> but it also allows you to "
13686 "set the C<cipher> used."
13691 #: ../src/guestfs-actions.pod:3800
13692 msgid "guestfs_luks_kill_slot"
13697 #: ../src/guestfs-actions.pod:3802
13701 " guestfs_luks_kill_slot (guestfs_h *g,\n"
13702 " const char *device,\n"
13703 " const char *key,\n"
13710 #: ../src/guestfs-actions.pod:3808 ../fish/guestfish-actions.pod:2617
13712 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
13713 "device C<device>. C<key> must be one of the I<other> keys."
13718 #: ../src/guestfs-actions.pod:3820
13719 msgid "guestfs_luks_open"
13724 #: ../src/guestfs-actions.pod:3822
13728 " guestfs_luks_open (guestfs_h *g,\n"
13729 " const char *device,\n"
13730 " const char *key,\n"
13731 " const char *mapname);\n"
13737 #: ../src/guestfs-actions.pod:3828 ../fish/guestfish-actions.pod:2628
13739 "This command opens a block device which has been encrypted according to the "
13740 "Linux Unified Key Setup (LUKS) standard."
13745 #: ../src/guestfs-actions.pod:3831 ../fish/guestfish-actions.pod:2631
13746 msgid "C<device> is the encrypted block device or partition."
13751 #: ../src/guestfs-actions.pod:3833 ../fish/guestfish-actions.pod:2633
13753 "The caller must supply one of the keys associated with the LUKS block "
13754 "device, in the C<key> parameter."
13759 #: ../src/guestfs-actions.pod:3836 ../fish/guestfish-actions.pod:2636
13761 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
13762 "writes to this block device are decrypted from and encrypted to the "
13763 "underlying C<device> respectively."
13768 #: ../src/guestfs-actions.pod:3840
13770 "If this block device contains LVM volume groups, then calling "
13771 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
13777 #: ../src/guestfs-actions.pod:3852
13778 msgid "guestfs_luks_open_ro"
13783 #: ../src/guestfs-actions.pod:3854
13787 " guestfs_luks_open_ro (guestfs_h *g,\n"
13788 " const char *device,\n"
13789 " const char *key,\n"
13790 " const char *mapname);\n"
13796 #: ../src/guestfs-actions.pod:3860
13798 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
13804 #: ../src/guestfs-actions.pod:3871
13805 msgid "guestfs_lvcreate"
13810 #: ../src/guestfs-actions.pod:3873
13814 " guestfs_lvcreate (guestfs_h *g,\n"
13815 " const char *logvol,\n"
13816 " const char *volgroup,\n"
13823 #: ../src/guestfs-actions.pod:3879 ../fish/guestfish-actions.pod:2661
13825 "This creates an LVM logical volume called C<logvol> on the volume group "
13826 "C<volgroup>, with C<size> megabytes."
13831 #: ../src/guestfs-actions.pod:3886
13832 msgid "guestfs_lvm_canonical_lv_name"
13837 #: ../src/guestfs-actions.pod:3888
13841 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
13842 " const char *lvname);\n"
13848 #: ../src/guestfs-actions.pod:3892 ../fish/guestfish-actions.pod:2668
13850 "This converts alternative naming schemes for LVs that you might find to the "
13851 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
13857 #: ../src/guestfs-actions.pod:3896 ../fish/guestfish-actions.pod:2672
13859 "This command returns an error if the C<lvname> parameter does not refer to a "
13865 #: ../src/guestfs-actions.pod:3899
13866 msgid "See also C<guestfs_is_lv>."
13871 #: ../src/guestfs-actions.pod:3904
13872 msgid "(Added in 1.5.24)"
13877 #: ../src/guestfs-actions.pod:3906
13878 msgid "guestfs_lvm_clear_filter"
13883 #: ../src/guestfs-actions.pod:3908
13887 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
13893 #: ../src/guestfs-actions.pod:3911
13895 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
13896 "see every block device."
13901 #: ../src/guestfs-actions.pod:3914 ../src/guestfs-actions.pod:3956
13902 #: ../fish/guestfish-actions.pod:2684 ../fish/guestfish-actions.pod:2715
13904 "This command also clears the LVM cache and performs a volume group scan."
13909 #: ../src/guestfs-actions.pod:3921
13910 msgid "guestfs_lvm_remove_all"
13915 #: ../src/guestfs-actions.pod:3923
13919 " guestfs_lvm_remove_all (guestfs_h *g);\n"
13925 #: ../src/guestfs-actions.pod:3926 ../fish/guestfish-actions.pod:2691
13927 "This command removes all LVM logical volumes, volume groups and physical "
13933 #: ../src/guestfs-actions.pod:3936
13934 msgid "guestfs_lvm_set_filter"
13939 #: ../src/guestfs-actions.pod:3938
13943 " guestfs_lvm_set_filter (guestfs_h *g,\n"
13944 " char *const *devices);\n"
13950 #: ../src/guestfs-actions.pod:3942 ../fish/guestfish-actions.pod:2701
13952 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
13953 "block devices in the list C<devices>, and will ignore all other attached "
13959 #: ../src/guestfs-actions.pod:3946 ../fish/guestfish-actions.pod:2705
13961 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
13962 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
13963 "there are two types of duplication possible: either cloned PVs/VGs which "
13964 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
13965 "same name. In normal operation you cannot create this situation, but you "
13966 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
13967 "inside the LVM metadata."
13972 #: ../src/guestfs-actions.pod:3959 ../fish/guestfish-actions.pod:2718
13973 msgid "You can filter whole block devices or individual partitions."
13978 #: ../src/guestfs-actions.pod:3961 ../fish/guestfish-actions.pod:2720
13980 "You cannot use this if any VG is currently in use (eg. contains a mounted "
13981 "filesystem), even if you are not filtering out that VG."
13986 #: ../src/guestfs-actions.pod:3969
13987 msgid "guestfs_lvremove"
13992 #: ../src/guestfs-actions.pod:3971
13996 " guestfs_lvremove (guestfs_h *g,\n"
13997 " const char *device);\n"
14003 #: ../src/guestfs-actions.pod:3975 ../fish/guestfish-actions.pod:2728
14005 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
14006 "LV, such as C</dev/VG/LV>."
14011 #: ../src/guestfs-actions.pod:3978 ../fish/guestfish-actions.pod:2731
14013 "You can also remove all LVs in a volume group by specifying the VG name, C</"
14019 #: ../src/guestfs-actions.pod:3983 ../src/guestfs-actions.pod:5219
14020 #: ../src/guestfs-actions.pod:7008
14021 msgid "(Added in 1.0.13)"
14026 #: ../src/guestfs-actions.pod:3985
14027 msgid "guestfs_lvrename"
14032 #: ../src/guestfs-actions.pod:3987
14036 " guestfs_lvrename (guestfs_h *g,\n"
14037 " const char *logvol,\n"
14038 " const char *newlogvol);\n"
14044 #: ../src/guestfs-actions.pod:3992 ../fish/guestfish-actions.pod:2738
14045 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
14050 #: ../src/guestfs-actions.pod:3996 ../src/guestfs-actions.pod:7021
14051 msgid "(Added in 1.0.83)"
14056 #: ../src/guestfs-actions.pod:3998
14057 msgid "guestfs_lvresize"
14062 #: ../src/guestfs-actions.pod:4000
14066 " guestfs_lvresize (guestfs_h *g,\n"
14067 " const char *device,\n"
14074 #: ../src/guestfs-actions.pod:4005 ../fish/guestfish-actions.pod:2744
14076 "This resizes (expands or shrinks) an existing LVM logical volume to "
14077 "C<mbytes>. When reducing, data in the reduced part is lost."
14082 #: ../src/guestfs-actions.pod:4013
14083 msgid "guestfs_lvresize_free"
14088 #: ../src/guestfs-actions.pod:4015
14092 " guestfs_lvresize_free (guestfs_h *g,\n"
14093 " const char *lv,\n"
14100 #: ../src/guestfs-actions.pod:4020 ../fish/guestfish-actions.pod:2752
14102 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
14103 "remaining free space in the volume group. Commonly you would call this with "
14104 "pc = 100 which expands the logical volume as much as possible, using all "
14105 "remaining free space in the volume group."
14110 #: ../src/guestfs-actions.pod:4028
14111 msgid "(Added in 1.3.3)"
14116 #: ../src/guestfs-actions.pod:4030
14117 msgid "guestfs_lvs"
14122 #: ../src/guestfs-actions.pod:4032
14126 " guestfs_lvs (guestfs_h *g);\n"
14132 #: ../src/guestfs-actions.pod:4035 ../fish/guestfish-actions.pod:2762
14134 "List all the logical volumes detected. This is the equivalent of the L<lvs"
14140 #: ../src/guestfs-actions.pod:4038 ../fish/guestfish-actions.pod:2765
14142 "This returns a list of the logical volume device names (eg. C</dev/"
14143 "VolGroup00/LogVol00>)."
14148 #: ../src/guestfs-actions.pod:4041
14149 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
14154 #: ../src/guestfs-actions.pod:4049
14155 msgid "guestfs_lvs_full"
14160 #: ../src/guestfs-actions.pod:4051
14163 " struct guestfs_lvm_lv_list *\n"
14164 " guestfs_lvs_full (guestfs_h *g);\n"
14170 #: ../src/guestfs-actions.pod:4054 ../fish/guestfish-actions.pod:2774
14172 "List all the logical volumes detected. This is the equivalent of the L<lvs"
14173 "(8)> command. The \"full\" version includes all fields."
14178 #: ../src/guestfs-actions.pod:4057
14180 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
14181 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
14186 #: ../src/guestfs-actions.pod:4063
14187 msgid "guestfs_lvuuid"
14192 #: ../src/guestfs-actions.pod:4065
14196 " guestfs_lvuuid (guestfs_h *g,\n"
14197 " const char *device);\n"
14203 #: ../src/guestfs-actions.pod:4069 ../fish/guestfish-actions.pod:2781
14204 msgid "This command returns the UUID of the LVM LV C<device>."
14209 #: ../src/guestfs-actions.pod:4076
14210 msgid "guestfs_lxattrlist"
14215 #: ../src/guestfs-actions.pod:4078
14218 " struct guestfs_xattr_list *\n"
14219 " guestfs_lxattrlist (guestfs_h *g,\n"
14220 " const char *path,\n"
14221 " char *const *names);\n"
14227 #: ../src/guestfs-actions.pod:4083 ../fish/guestfish-actions.pod:2787
14229 "This call allows you to get the extended attributes of multiple files, where "
14230 "all files are in the directory C<path>. C<names> is the list of files from "
14236 #: ../src/guestfs-actions.pod:4087 ../fish/guestfish-actions.pod:2791
14238 "On return you get a flat list of xattr structs which must be interpreted "
14239 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
14240 "C<attrval> in this struct is zero-length to indicate there was an error "
14241 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
14242 "number (the number of following attributes for this file, which could be C<"
14243 "\"0\">). Then after the first xattr struct are the zero or more attributes "
14244 "for the first named file. This repeats for the second and subsequent files."
14249 #: ../src/guestfs-actions.pod:4097
14251 "This call is intended for programs that want to efficiently list a directory "
14252 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
14253 "a similarly efficient call for getting standard stats. Very long directory "
14254 "listings might cause the protocol message size to be exceeded, causing this "
14255 "call to fail. The caller must split up such requests into smaller groups of "
14261 #: ../src/guestfs-actions.pod:4111
14262 msgid "guestfs_mkdir"
14267 #: ../src/guestfs-actions.pod:4113
14271 " guestfs_mkdir (guestfs_h *g,\n"
14272 " const char *path);\n"
14278 #: ../src/guestfs-actions.pod:4117 ../fish/guestfish-actions.pod:2813
14279 msgid "Create a directory named C<path>."
14284 #: ../src/guestfs-actions.pod:4123
14285 msgid "guestfs_mkdir_mode"
14290 #: ../src/guestfs-actions.pod:4125
14294 " guestfs_mkdir_mode (guestfs_h *g,\n"
14295 " const char *path,\n"
14302 #: ../src/guestfs-actions.pod:4130 ../fish/guestfish-actions.pod:2819
14304 "This command creates a directory, setting the initial permissions of the "
14305 "directory to C<mode>."
14310 #: ../src/guestfs-actions.pod:4133 ../fish/guestfish-actions.pod:2822
14312 "For common Linux filesystems, the actual mode which is set will be C<mode & "
14313 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
14319 #: ../src/guestfs-actions.pod:4137
14320 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
14325 #: ../src/guestfs-actions.pod:4143
14326 msgid "guestfs_mkdir_p"
14331 #: ../src/guestfs-actions.pod:4145
14335 " guestfs_mkdir_p (guestfs_h *g,\n"
14336 " const char *path);\n"
14342 #: ../src/guestfs-actions.pod:4149 ../fish/guestfish-actions.pod:2832
14344 "Create a directory named C<path>, creating any parent directories as "
14345 "necessary. This is like the C<mkdir -p> shell command."
14350 #: ../src/guestfs-actions.pod:4156
14351 msgid "guestfs_mkdtemp"
14356 #: ../src/guestfs-actions.pod:4158
14360 " guestfs_mkdtemp (guestfs_h *g,\n"
14361 " const char *template);\n"
14367 #: ../src/guestfs-actions.pod:4162 ../fish/guestfish-actions.pod:2839
14369 "This command creates a temporary directory. The C<template> parameter "
14370 "should be a full pathname for the temporary directory name with the final "
14371 "six characters being \"XXXXXX\"."
14376 #: ../src/guestfs-actions.pod:4167 ../fish/guestfish-actions.pod:2844
14378 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
14379 "being suitable for Windows filesystems."
14384 #: ../src/guestfs-actions.pod:4170 ../fish/guestfish-actions.pod:2847
14385 msgid "The name of the temporary directory that was created is returned."
14390 #: ../src/guestfs-actions.pod:4173 ../fish/guestfish-actions.pod:2850
14391 msgid "The temporary directory is created with mode 0700 and is owned by root."
14396 #: ../src/guestfs-actions.pod:4176 ../fish/guestfish-actions.pod:2853
14398 "The caller is responsible for deleting the temporary directory and its "
14399 "contents after use."
14404 #: ../src/guestfs-actions.pod:4179 ../fish/guestfish-actions.pod:2856
14405 msgid "See also: L<mkdtemp(3)>"
14410 #: ../src/guestfs-actions.pod:4186
14411 msgid "guestfs_mke2fs_J"
14416 #: ../src/guestfs-actions.pod:4188
14420 " guestfs_mke2fs_J (guestfs_h *g,\n"
14421 " const char *fstype,\n"
14422 " int blocksize,\n"
14423 " const char *device,\n"
14424 " const char *journal);\n"
14430 #: ../src/guestfs-actions.pod:4195 ../fish/guestfish-actions.pod:2862
14432 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14433 "C<journal>. It is equivalent to the command:"
14438 #: ../src/guestfs-actions.pod:4199 ../fish/guestfish-actions.pod:2866
14441 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
14447 #: ../src/guestfs-actions.pod:4201
14448 msgid "See also C<guestfs_mke2journal>."
14453 #: ../src/guestfs-actions.pod:4205 ../src/guestfs-actions.pod:4223
14454 #: ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4257
14455 #: ../src/guestfs-actions.pod:4271 ../src/guestfs-actions.pod:4285
14456 #: ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4609
14457 msgid "(Added in 1.0.68)"
14462 #: ../src/guestfs-actions.pod:4207
14463 msgid "guestfs_mke2fs_JL"
14468 #: ../src/guestfs-actions.pod:4209
14472 " guestfs_mke2fs_JL (guestfs_h *g,\n"
14473 " const char *fstype,\n"
14474 " int blocksize,\n"
14475 " const char *device,\n"
14476 " const char *label);\n"
14482 #: ../src/guestfs-actions.pod:4216 ../fish/guestfish-actions.pod:2874
14484 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14485 "the journal labeled C<label>."
14490 #: ../src/guestfs-actions.pod:4219
14491 msgid "See also C<guestfs_mke2journal_L>."
14496 #: ../src/guestfs-actions.pod:4225
14497 msgid "guestfs_mke2fs_JU"
14502 #: ../src/guestfs-actions.pod:4227
14506 " guestfs_mke2fs_JU (guestfs_h *g,\n"
14507 " const char *fstype,\n"
14508 " int blocksize,\n"
14509 " const char *device,\n"
14510 " const char *uuid);\n"
14516 #: ../src/guestfs-actions.pod:4234 ../fish/guestfish-actions.pod:2883
14518 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
14519 "the journal with UUID C<uuid>."
14524 #: ../src/guestfs-actions.pod:4237
14525 msgid "See also C<guestfs_mke2journal_U>."
14530 #: ../src/guestfs-actions.pod:4243
14531 msgid "guestfs_mke2journal"
14536 #: ../src/guestfs-actions.pod:4245
14540 " guestfs_mke2journal (guestfs_h *g,\n"
14541 " int blocksize,\n"
14542 " const char *device);\n"
14548 #: ../src/guestfs-actions.pod:4250 ../fish/guestfish-actions.pod:2892
14550 "This creates an ext2 external journal on C<device>. It is equivalent to the "
14556 #: ../src/guestfs-actions.pod:4253 ../fish/guestfish-actions.pod:2895
14559 " mke2fs -O journal_dev -b blocksize device\n"
14565 #: ../src/guestfs-actions.pod:4259
14566 msgid "guestfs_mke2journal_L"
14571 #: ../src/guestfs-actions.pod:4261
14575 " guestfs_mke2journal_L (guestfs_h *g,\n"
14576 " int blocksize,\n"
14577 " const char *label,\n"
14578 " const char *device);\n"
14584 #: ../src/guestfs-actions.pod:4267 ../fish/guestfish-actions.pod:2901
14585 msgid "This creates an ext2 external journal on C<device> with label C<label>."
14590 #: ../src/guestfs-actions.pod:4273
14591 msgid "guestfs_mke2journal_U"
14596 #: ../src/guestfs-actions.pod:4275
14600 " guestfs_mke2journal_U (guestfs_h *g,\n"
14601 " int blocksize,\n"
14602 " const char *uuid,\n"
14603 " const char *device);\n"
14609 #: ../src/guestfs-actions.pod:4281 ../fish/guestfish-actions.pod:2907
14610 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
14615 #: ../src/guestfs-actions.pod:4287
14616 msgid "guestfs_mkfifo"
14621 #: ../src/guestfs-actions.pod:4289
14625 " guestfs_mkfifo (guestfs_h *g,\n"
14627 " const char *path);\n"
14633 #: ../src/guestfs-actions.pod:4294
14635 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
14636 "is just a convenient wrapper around C<guestfs_mknod>."
14641 #: ../src/guestfs-actions.pod:4304
14642 msgid "guestfs_mkfs"
14647 #: ../src/guestfs-actions.pod:4306
14651 " guestfs_mkfs (guestfs_h *g,\n"
14652 " const char *fstype,\n"
14653 " const char *device);\n"
14659 #: ../src/guestfs-actions.pod:4311 ../fish/guestfish-actions.pod:2923
14661 "This creates a filesystem on C<device> (usually a partition or LVM logical "
14662 "volume). The filesystem type is C<fstype>, for example C<ext3>."
14667 #: ../src/guestfs-actions.pod:4319
14668 msgid "guestfs_mkfs_b"
14673 #: ../src/guestfs-actions.pod:4321
14677 " guestfs_mkfs_b (guestfs_h *g,\n"
14678 " const char *fstype,\n"
14679 " int blocksize,\n"
14680 " const char *device);\n"
14686 #: ../src/guestfs-actions.pod:4327
14688 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
14689 "block size of the resulting filesystem. Supported block sizes depend on the "
14690 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
14695 #: ../src/guestfs-actions.pod:4332 ../src/guestfs-actions.pod:4375
14696 #: ../fish/guestfish-actions.pod:2936 ../fish/guestfish-actions.pod:2963
14698 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
14704 #: ../src/guestfs-actions.pod:4337 ../fish/guestfish-actions.pod:2939
14706 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
14711 #: ../src/guestfs-actions.pod:4346
14712 msgid "guestfs_mkfs_opts"
14717 #: ../src/guestfs-actions.pod:4348
14721 " guestfs_mkfs_opts (guestfs_h *g,\n"
14722 " const char *fstype,\n"
14723 " const char *device,\n"
14729 #: ../src/guestfs-actions.pod:4359
14732 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
14733 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
14739 #: ../src/guestfs-actions.pod:4362 ../fish/guestfish-actions.pod:2950
14741 "This function creates a filesystem on C<device>. The filesystem type is "
14742 "C<fstype>, for example C<ext3>."
14747 #: ../src/guestfs-actions.pod:4369 ../fish/guestfish-actions.pod:2957
14748 msgid "C<blocksize>"
14753 #: ../src/guestfs-actions.pod:4371 ../fish/guestfish-actions.pod:2959
14755 "The filesystem block size. Supported block sizes depend on the filesystem "
14756 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
14761 #: ../src/guestfs-actions.pod:4378 ../fish/guestfish-actions.pod:2966
14762 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
14766 #: ../src/guestfs-actions.pod:4380 ../fish/guestfish-actions.pod:2968
14767 msgid "C<features>"
14771 #: ../src/guestfs-actions.pod:4382 ../fish/guestfish-actions.pod:2970
14772 msgid "This passes the C<-O> parameter to the external mkfs program."
14776 #: ../src/guestfs-actions.pod:4384 ../fish/guestfish-actions.pod:2972
14778 "For certain filesystem types, this allows extra filesystem features to be "
14779 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
14783 #: ../src/guestfs-actions.pod:4388 ../fish/guestfish-actions.pod:2976
14785 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
14790 #: ../src/guestfs-actions.pod:4395
14791 msgid "(Added in 1.7.19)"
14796 #: ../src/guestfs-actions.pod:4397
14797 msgid "guestfs_mkfs_opts_va"
14802 #: ../src/guestfs-actions.pod:4399
14806 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
14807 " const char *fstype,\n"
14808 " const char *device,\n"
14809 " va_list args);\n"
14815 #: ../src/guestfs-actions.pod:4405
14816 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
14821 #: ../src/guestfs-actions.pod:4409
14822 msgid "guestfs_mkfs_opts_argv"
14827 #: ../src/guestfs-actions.pod:4411
14831 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
14832 " const char *fstype,\n"
14833 " const char *device,\n"
14834 " const struct guestfs_mkfs_opts_argv *optargs);\n"
14840 #: ../src/guestfs-actions.pod:4417
14841 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
14846 #: ../src/guestfs-actions.pod:4421
14847 msgid "guestfs_mkmountpoint"
14852 #: ../src/guestfs-actions.pod:4423
14856 " guestfs_mkmountpoint (guestfs_h *g,\n"
14857 " const char *exemptpath);\n"
14863 #: ../src/guestfs-actions.pod:4427
14865 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
14866 "that can be used to create extra mountpoints before mounting the first "
14872 #: ../src/guestfs-actions.pod:4431 ../fish/guestfish-actions.pod:2991
14874 "These calls are I<only> necessary in some very limited circumstances, mainly "
14875 "the case where you want to mount a mix of unrelated and/or read-only "
14876 "filesystems together."
14881 #: ../src/guestfs-actions.pod:4435 ../fish/guestfish-actions.pod:2995
14883 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
14884 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
14885 "inside that. You can unpack this as follows in guestfish:"
14890 #: ../src/guestfs-actions.pod:4440 ../fish/guestfish-actions.pod:3000
14893 " add-ro Fedora-11-i686-Live.iso\n"
14895 " mkmountpoint /cd\n"
14896 " mkmountpoint /sqsh\n"
14897 " mkmountpoint /ext3fs\n"
14898 " mount /dev/sda /cd\n"
14899 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
14900 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
14906 #: ../src/guestfs-actions.pod:4449 ../fish/guestfish-actions.pod:3009
14907 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
14912 #: ../src/guestfs-actions.pod:4451
14914 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
14915 "may get unexpected errors if you try to mix these calls. It is safest to "
14916 "manually unmount filesystems and remove mountpoints after use."
14921 #: ../src/guestfs-actions.pod:4455
14923 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
14924 "first, so for this to work for manual mountpoints, you must ensure that the "
14925 "innermost mountpoints have the longest pathnames, as in the example code "
14931 #: ../src/guestfs-actions.pod:4460 ../fish/guestfish-actions.pod:3020
14933 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
14937 #: ../src/guestfs-actions.pod:4462
14939 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
14940 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
14941 "can also trigger these issues."
14946 #: ../src/guestfs-actions.pod:4468 ../src/guestfs-actions.pod:4727
14947 #: ../src/guestfs-actions.pod:5637
14948 msgid "(Added in 1.0.62)"
14953 #: ../src/guestfs-actions.pod:4470
14954 msgid "guestfs_mknod"
14959 #: ../src/guestfs-actions.pod:4472
14963 " guestfs_mknod (guestfs_h *g,\n"
14967 " const char *path);\n"
14973 #: ../src/guestfs-actions.pod:4479 ../fish/guestfish-actions.pod:3030
14975 "This call creates block or character special devices, or named pipes (FIFOs)."
14980 #: ../src/guestfs-actions.pod:4482 ../fish/guestfish-actions.pod:3033
14982 "The C<mode> parameter should be the mode, using the standard constants. "
14983 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
14984 "used when creating block and character special devices."
14989 #: ../src/guestfs-actions.pod:4487
14991 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
14992 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
14993 "regular file). These constants are available in the standard Linux header "
14994 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
14995 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
14996 "the appropriate constant for you."
15001 #: ../src/guestfs-actions.pod:4501
15002 msgid "guestfs_mknod_b"
15007 #: ../src/guestfs-actions.pod:4503
15011 " guestfs_mknod_b (guestfs_h *g,\n"
15015 " const char *path);\n"
15021 #: ../src/guestfs-actions.pod:4510
15023 "This call creates a block device node called C<path> with mode C<mode> and "
15024 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
15025 "wrapper around C<guestfs_mknod>."
15030 #: ../src/guestfs-actions.pod:4520
15031 msgid "guestfs_mknod_c"
15036 #: ../src/guestfs-actions.pod:4522
15040 " guestfs_mknod_c (guestfs_h *g,\n"
15044 " const char *path);\n"
15050 #: ../src/guestfs-actions.pod:4529
15052 "This call creates a char device node called C<path> with mode C<mode> and "
15053 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
15054 "wrapper around C<guestfs_mknod>."
15059 #: ../src/guestfs-actions.pod:4539
15060 msgid "guestfs_mkswap"
15065 #: ../src/guestfs-actions.pod:4541
15069 " guestfs_mkswap (guestfs_h *g,\n"
15070 " const char *device);\n"
15076 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3072
15077 msgid "Create a swap partition on C<device>."
15082 #: ../src/guestfs-actions.pod:4551
15083 msgid "guestfs_mkswap_L"
15088 #: ../src/guestfs-actions.pod:4553
15092 " guestfs_mkswap_L (guestfs_h *g,\n"
15093 " const char *label,\n"
15094 " const char *device);\n"
15100 #: ../src/guestfs-actions.pod:4558 ../fish/guestfish-actions.pod:3078
15101 msgid "Create a swap partition on C<device> with label C<label>."
15106 #: ../src/guestfs-actions.pod:4560 ../fish/guestfish-actions.pod:3080
15108 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
15109 "sda>), just to a partition. This appears to be a limitation of the kernel "
15115 #: ../src/guestfs-actions.pod:4568
15116 msgid "guestfs_mkswap_U"
15121 #: ../src/guestfs-actions.pod:4570
15125 " guestfs_mkswap_U (guestfs_h *g,\n"
15126 " const char *uuid,\n"
15127 " const char *device);\n"
15133 #: ../src/guestfs-actions.pod:4575 ../fish/guestfish-actions.pod:3088
15134 msgid "Create a swap partition on C<device> with UUID C<uuid>."
15139 #: ../src/guestfs-actions.pod:4581
15140 msgid "guestfs_mkswap_file"
15145 #: ../src/guestfs-actions.pod:4583
15149 " guestfs_mkswap_file (guestfs_h *g,\n"
15150 " const char *path);\n"
15156 #: ../src/guestfs-actions.pod:4587 ../fish/guestfish-actions.pod:3094
15157 msgid "Create a swap file."
15162 #: ../src/guestfs-actions.pod:4589
15164 "This command just writes a swap file signature to an existing file. To "
15165 "create the file itself, use something like C<guestfs_fallocate>."
15170 #: ../src/guestfs-actions.pod:4596
15171 msgid "guestfs_modprobe"
15176 #: ../src/guestfs-actions.pod:4598
15180 " guestfs_modprobe (guestfs_h *g,\n"
15181 " const char *modulename);\n"
15187 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3103
15188 msgid "This loads a kernel module in the appliance."
15193 #: ../src/guestfs-actions.pod:4604 ../fish/guestfish-actions.pod:3105
15195 "The kernel module must have been whitelisted when libguestfs was built (see "
15196 "C<appliance/kmod.whitelist.in> in the source)."
15201 #: ../src/guestfs-actions.pod:4611
15202 msgid "guestfs_mount"
15207 #: ../src/guestfs-actions.pod:4613
15211 " guestfs_mount (guestfs_h *g,\n"
15212 " const char *device,\n"
15213 " const char *mountpoint);\n"
15219 #: ../src/guestfs-actions.pod:4618 ../fish/guestfish-actions.pod:3112
15221 "Mount a guest disk at a position in the filesystem. Block devices are named "
15222 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
15223 "those block devices contain partitions, they will have the usual names (eg. "
15224 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
15229 #: ../src/guestfs-actions.pod:4624 ../fish/guestfish-actions.pod:3118
15231 "The rules are the same as for L<mount(2)>: A filesystem must first be "
15232 "mounted on C</> before others can be mounted. Other filesystems can only be "
15233 "mounted on directories which already exist."
15238 #: ../src/guestfs-actions.pod:4629 ../fish/guestfish-actions.pod:3123
15240 "The mounted filesystem is writable, if we have sufficient permissions on the "
15241 "underlying device."
15246 #: ../src/guestfs-actions.pod:4632
15248 "B<Important note:> When you use this call, the filesystem options C<sync> "
15249 "and C<noatime> are set implicitly. This was originally done because we "
15250 "thought it would improve reliability, but it turns out that I<-o sync> has a "
15251 "very large negative performance impact and negligible effect on "
15252 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
15253 "in any code that needs performance, and instead use C<guestfs_mount_options> "
15254 "(use an empty string for the first parameter if you don't want any options)."
15259 #: ../src/guestfs-actions.pod:4646
15260 msgid "guestfs_mount_loop"
15265 #: ../src/guestfs-actions.pod:4648
15269 " guestfs_mount_loop (guestfs_h *g,\n"
15270 " const char *file,\n"
15271 " const char *mountpoint);\n"
15277 #: ../src/guestfs-actions.pod:4653 ../fish/guestfish-actions.pod:3140
15279 "This command lets you mount C<file> (a filesystem image in a file) on a "
15280 "mount point. It is entirely equivalent to the command C<mount -o loop file "
15286 #: ../src/guestfs-actions.pod:4661
15287 msgid "guestfs_mount_options"
15292 #: ../src/guestfs-actions.pod:4663
15296 " guestfs_mount_options (guestfs_h *g,\n"
15297 " const char *options,\n"
15298 " const char *device,\n"
15299 " const char *mountpoint);\n"
15305 #: ../src/guestfs-actions.pod:4669
15307 "This is the same as the C<guestfs_mount> command, but it allows you to set "
15308 "the mount options as for the L<mount(8)> I<-o> flag."
15313 #: ../src/guestfs-actions.pod:4673 ../fish/guestfish-actions.pod:3152
15315 "If the C<options> parameter is an empty string, then no options are passed "
15316 "(all options default to whatever the filesystem uses)."
15321 #: ../src/guestfs-actions.pod:4679 ../src/guestfs-actions.pod:4693
15322 #: ../src/guestfs-actions.pod:4710
15323 msgid "(Added in 1.0.10)"
15328 #: ../src/guestfs-actions.pod:4681
15329 msgid "guestfs_mount_ro"
15334 #: ../src/guestfs-actions.pod:4683
15338 " guestfs_mount_ro (guestfs_h *g,\n"
15339 " const char *device,\n"
15340 " const char *mountpoint);\n"
15346 #: ../src/guestfs-actions.pod:4688
15348 "This is the same as the C<guestfs_mount> command, but it mounts the "
15349 "filesystem with the read-only (I<-o ro>) flag."
15354 #: ../src/guestfs-actions.pod:4695
15355 msgid "guestfs_mount_vfs"
15360 #: ../src/guestfs-actions.pod:4697
15364 " guestfs_mount_vfs (guestfs_h *g,\n"
15365 " const char *options,\n"
15366 " const char *vfstype,\n"
15367 " const char *device,\n"
15368 " const char *mountpoint);\n"
15374 #: ../src/guestfs-actions.pod:4704
15376 "This is the same as the C<guestfs_mount> command, but it allows you to set "
15377 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
15383 #: ../src/guestfs-actions.pod:4712
15384 msgid "guestfs_mountpoints"
15389 #: ../src/guestfs-actions.pod:4714
15393 " guestfs_mountpoints (guestfs_h *g);\n"
15399 #: ../src/guestfs-actions.pod:4717
15401 "This call is similar to C<guestfs_mounts>. That call returns a list of "
15402 "devices. This one returns a hash table (map) of device name to directory "
15403 "where the device is mounted."
15408 #: ../src/guestfs-actions.pod:4729
15409 msgid "guestfs_mounts"
15414 #: ../src/guestfs-actions.pod:4731
15418 " guestfs_mounts (guestfs_h *g);\n"
15424 #: ../src/guestfs-actions.pod:4734 ../fish/guestfish-actions.pod:3183
15426 "This returns the list of currently mounted filesystems. It returns the list "
15427 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
15432 #: ../src/guestfs-actions.pod:4737 ../fish/guestfish-actions.pod:3186
15433 msgid "Some internal mounts are not shown."
15438 #: ../src/guestfs-actions.pod:4739
15439 msgid "See also: C<guestfs_mountpoints>"
15444 #: ../src/guestfs-actions.pod:4747
15450 #: ../src/guestfs-actions.pod:4749
15454 " guestfs_mv (guestfs_h *g,\n"
15455 " const char *src,\n"
15456 " const char *dest);\n"
15462 #: ../src/guestfs-actions.pod:4754 ../fish/guestfish-actions.pod:3194
15464 "This moves a file from C<src> to C<dest> where C<dest> is either a "
15465 "destination filename or destination directory."
15470 #: ../src/guestfs-actions.pod:4761
15471 msgid "guestfs_ntfs_3g_probe"
15476 #: ../src/guestfs-actions.pod:4763
15480 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
15482 " const char *device);\n"
15488 #: ../src/guestfs-actions.pod:4768 ../fish/guestfish-actions.pod:3201
15490 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
15491 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
15492 "write, and some cannot be mounted at all)."
15497 #: ../src/guestfs-actions.pod:4772 ../fish/guestfish-actions.pod:3205
15499 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
15500 "can be mounted read-write. Set it to false if you want to test if the "
15501 "volume can be mounted read-only."
15506 #: ../src/guestfs-actions.pod:4776 ../fish/guestfish-actions.pod:3209
15508 "The return value is an integer which C<0> if the operation would succeed, or "
15509 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
15514 #: ../src/guestfs-actions.pod:4782
15515 msgid "(Added in 1.0.43)"
15520 #: ../src/guestfs-actions.pod:4784
15521 msgid "guestfs_ntfsresize"
15526 #: ../src/guestfs-actions.pod:4786
15530 " guestfs_ntfsresize (guestfs_h *g,\n"
15531 " const char *device);\n"
15537 #: ../src/guestfs-actions.pod:4790 ../fish/guestfish-actions.pod:3217
15539 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
15540 "size of the underlying device. See also L<ntfsresize(8)>."
15545 #: ../src/guestfs-actions.pod:4798
15546 msgid "guestfs_ntfsresize_size"
15551 #: ../src/guestfs-actions.pod:4800
15555 " guestfs_ntfsresize_size (guestfs_h *g,\n"
15556 " const char *device,\n"
15557 " int64_t size);\n"
15563 #: ../src/guestfs-actions.pod:4805
15565 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
15566 "to specify the new size (in bytes) explicitly."
15571 #: ../src/guestfs-actions.pod:4810 ../src/guestfs-actions.pod:5246
15572 #: ../src/guestfs-actions.pod:5319 ../src/guestfs-actions.pod:5585
15573 #: ../src/guestfs-actions.pod:7156
15574 msgid "(Added in 1.3.14)"
15579 #: ../src/guestfs-actions.pod:4812
15580 msgid "guestfs_part_add"
15585 #: ../src/guestfs-actions.pod:4814
15589 " guestfs_part_add (guestfs_h *g,\n"
15590 " const char *device,\n"
15591 " const char *prlogex,\n"
15592 " int64_t startsect,\n"
15593 " int64_t endsect);\n"
15599 #: ../src/guestfs-actions.pod:4821
15601 "This command adds a partition to C<device>. If there is no partition table "
15602 "on the device, call C<guestfs_part_init> first."
15607 #: ../src/guestfs-actions.pod:4824 ../fish/guestfish-actions.pod:3235
15609 "The C<prlogex> parameter is the type of partition. Normally you should pass "
15610 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
15611 "C<logical>) and C<e> (or C<extended>) partition types."
15616 #: ../src/guestfs-actions.pod:4829 ../fish/guestfish-actions.pod:3240
15618 "C<startsect> and C<endsect> are the start and end of the partition in "
15619 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
15620 "from the end of the disk (C<-1> is the last sector)."
15625 #: ../src/guestfs-actions.pod:4833
15627 "Creating a partition which covers the whole disk is not so easy. Use "
15628 "C<guestfs_part_disk> to do that."
15633 #: ../src/guestfs-actions.pod:4838 ../src/guestfs-actions.pod:4876
15634 #: ../src/guestfs-actions.pod:4929 ../src/guestfs-actions.pod:5007
15635 #: ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5064
15636 #: ../src/guestfs-actions.pod:5104
15637 msgid "(Added in 1.0.78)"
15642 #: ../src/guestfs-actions.pod:4840
15643 msgid "guestfs_part_del"
15648 #: ../src/guestfs-actions.pod:4842
15652 " guestfs_part_del (guestfs_h *g,\n"
15653 " const char *device,\n"
15660 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3251
15661 msgid "This command deletes the partition numbered C<partnum> on C<device>."
15666 #: ../src/guestfs-actions.pod:4849 ../fish/guestfish-actions.pod:3253
15668 "Note that in the case of MBR partitioning, deleting an extended partition "
15669 "also deletes any logical partitions it contains."
15674 #: ../src/guestfs-actions.pod:4857
15675 msgid "guestfs_part_disk"
15680 #: ../src/guestfs-actions.pod:4859
15684 " guestfs_part_disk (guestfs_h *g,\n"
15685 " const char *device,\n"
15686 " const char *parttype);\n"
15692 #: ../src/guestfs-actions.pod:4864
15694 "This command is simply a combination of C<guestfs_part_init> followed by "
15695 "C<guestfs_part_add> to create a single primary partition covering the whole "
15701 #: ../src/guestfs-actions.pod:4868
15703 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
15704 "possible values are described in C<guestfs_part_init>."
15709 #: ../src/guestfs-actions.pod:4878
15710 msgid "guestfs_part_get_bootable"
15715 #: ../src/guestfs-actions.pod:4880
15719 " guestfs_part_get_bootable (guestfs_h *g,\n"
15720 " const char *device,\n"
15727 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3275
15729 "This command returns true if the partition C<partnum> on C<device> has the "
15730 "bootable flag set."
15735 #: ../src/guestfs-actions.pod:4888
15736 msgid "See also C<guestfs_part_set_bootable>."
15741 #: ../src/guestfs-actions.pod:4894
15742 msgid "guestfs_part_get_mbr_id"
15747 #: ../src/guestfs-actions.pod:4896
15751 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
15752 " const char *device,\n"
15759 #: ../src/guestfs-actions.pod:4901 ../fish/guestfish-actions.pod:3284
15761 "Returns the MBR type byte (also known as the ID byte) from the numbered "
15762 "partition C<partnum>."
15767 #: ../src/guestfs-actions.pod:4904 ../src/guestfs-actions.pod:5080
15769 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
15770 "undefined results for other partition table types (see "
15771 "C<guestfs_part_get_parttype>)."
15776 #: ../src/guestfs-actions.pod:4912
15777 msgid "guestfs_part_get_parttype"
15782 #: ../src/guestfs-actions.pod:4914
15786 " guestfs_part_get_parttype (guestfs_h *g,\n"
15787 " const char *device);\n"
15793 #: ../src/guestfs-actions.pod:4918 ../fish/guestfish-actions.pod:3295
15795 "This command examines the partition table on C<device> and returns the "
15796 "partition table type (format) being used."
15801 #: ../src/guestfs-actions.pod:4921
15803 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
15804 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
15805 "possible, although unusual. See C<guestfs_part_init> for a full list."
15810 #: ../src/guestfs-actions.pod:4931
15811 msgid "guestfs_part_init"
15816 #: ../src/guestfs-actions.pod:4933
15820 " guestfs_part_init (guestfs_h *g,\n"
15821 " const char *device,\n"
15822 " const char *parttype);\n"
15828 #: ../src/guestfs-actions.pod:4938 ../fish/guestfish-actions.pod:3307
15830 "This creates an empty partition table on C<device> of one of the partition "
15831 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
15832 "(for large disks)."
15837 #: ../src/guestfs-actions.pod:4942
15839 "Initially there are no partitions. Following this, you should call "
15840 "C<guestfs_part_add> for each partition required."
15845 #: ../src/guestfs-actions.pod:4945 ../fish/guestfish-actions.pod:3314
15846 msgid "Possible values for C<parttype> are:"
15851 #: ../src/guestfs-actions.pod:4949 ../fish/guestfish-actions.pod:3318
15852 msgid "B<efi> | B<gpt>"
15857 #: ../src/guestfs-actions.pod:4951 ../fish/guestfish-actions.pod:3320
15858 msgid "Intel EFI / GPT partition table."
15863 #: ../src/guestfs-actions.pod:4953 ../fish/guestfish-actions.pod:3322
15865 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
15866 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
15867 "the C<mbr> format."
15872 #: ../src/guestfs-actions.pod:4957 ../fish/guestfish-actions.pod:3326
15873 msgid "B<mbr> | B<msdos>"
15878 #: ../src/guestfs-actions.pod:4959 ../fish/guestfish-actions.pod:3328
15880 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
15881 "Windows. This partition type will B<only> work for device sizes up to 2 "
15882 "TB. For large disks we recommend using C<gpt>."
15887 #: ../src/guestfs-actions.pod:4966 ../fish/guestfish-actions.pod:3335
15889 "Other partition table types that may work but are not supported include:"
15894 #: ../src/guestfs-actions.pod:4971 ../fish/guestfish-actions.pod:3340
15900 #: ../src/guestfs-actions.pod:4973 ../fish/guestfish-actions.pod:3342
15901 msgid "AIX disk labels."
15906 #: ../src/guestfs-actions.pod:4975 ../fish/guestfish-actions.pod:3344
15907 msgid "B<amiga> | B<rdb>"
15912 #: ../src/guestfs-actions.pod:4977 ../fish/guestfish-actions.pod:3346
15913 msgid "Amiga \"Rigid Disk Block\" format."
15918 #: ../src/guestfs-actions.pod:4979 ../fish/guestfish-actions.pod:3348
15924 #: ../src/guestfs-actions.pod:4981 ../fish/guestfish-actions.pod:3350
15925 msgid "BSD disk labels."
15930 #: ../src/guestfs-actions.pod:4983 ../fish/guestfish-actions.pod:3352
15936 #: ../src/guestfs-actions.pod:4985 ../fish/guestfish-actions.pod:3354
15937 msgid "DASD, used on IBM mainframes."
15942 #: ../src/guestfs-actions.pod:4987 ../fish/guestfish-actions.pod:3356
15948 #: ../src/guestfs-actions.pod:4989 ../fish/guestfish-actions.pod:3358
15949 msgid "MIPS/SGI volumes."
15954 #: ../src/guestfs-actions.pod:4991 ../fish/guestfish-actions.pod:3360
15960 #: ../src/guestfs-actions.pod:4993 ../fish/guestfish-actions.pod:3362
15961 msgid "Old Mac partition format. Modern Macs use C<gpt>."
15966 #: ../src/guestfs-actions.pod:4995 ../fish/guestfish-actions.pod:3364
15972 #: ../src/guestfs-actions.pod:4997 ../fish/guestfish-actions.pod:3366
15973 msgid "NEC PC-98 format, common in Japan apparently."
15978 #: ../src/guestfs-actions.pod:4999 ../fish/guestfish-actions.pod:3368
15984 #: ../src/guestfs-actions.pod:5001 ../fish/guestfish-actions.pod:3370
15985 msgid "Sun disk labels."
15990 #: ../src/guestfs-actions.pod:5009
15991 msgid "guestfs_part_list"
15996 #: ../src/guestfs-actions.pod:5011
15999 " struct guestfs_partition_list *\n"
16000 " guestfs_part_list (guestfs_h *g,\n"
16001 " const char *device);\n"
16007 #: ../src/guestfs-actions.pod:5015 ../fish/guestfish-actions.pod:3378
16009 "This command parses the partition table on C<device> and returns the list of "
16010 "partitions found."
16015 #: ../src/guestfs-actions.pod:5018 ../fish/guestfish-actions.pod:3381
16016 msgid "The fields in the returned structure are:"
16021 #: ../src/guestfs-actions.pod:5022 ../fish/guestfish-actions.pod:3385
16022 msgid "B<part_num>"
16027 #: ../src/guestfs-actions.pod:5024 ../fish/guestfish-actions.pod:3387
16028 msgid "Partition number, counting from 1."
16033 #: ../src/guestfs-actions.pod:5026 ../fish/guestfish-actions.pod:3389
16034 msgid "B<part_start>"
16039 #: ../src/guestfs-actions.pod:5028
16041 "Start of the partition I<in bytes>. To get sectors you have to divide by "
16042 "the device's sector size, see C<guestfs_blockdev_getss>."
16047 #: ../src/guestfs-actions.pod:5031 ../fish/guestfish-actions.pod:3394
16048 msgid "B<part_end>"
16053 #: ../src/guestfs-actions.pod:5033 ../fish/guestfish-actions.pod:3396
16054 msgid "End of the partition in bytes."
16059 #: ../src/guestfs-actions.pod:5035 ../fish/guestfish-actions.pod:3398
16060 msgid "B<part_size>"
16065 #: ../src/guestfs-actions.pod:5037 ../fish/guestfish-actions.pod:3400
16066 msgid "Size of the partition in bytes."
16071 #: ../src/guestfs-actions.pod:5041
16073 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
16074 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
16080 #: ../src/guestfs-actions.pod:5047
16081 msgid "guestfs_part_set_bootable"
16086 #: ../src/guestfs-actions.pod:5049
16090 " guestfs_part_set_bootable (guestfs_h *g,\n"
16091 " const char *device,\n"
16093 " int bootable);\n"
16099 #: ../src/guestfs-actions.pod:5055 ../fish/guestfish-actions.pod:3408
16101 "This sets the bootable flag on partition numbered C<partnum> on device "
16102 "C<device>. Note that partitions are numbered from 1."
16107 #: ../src/guestfs-actions.pod:5058 ../fish/guestfish-actions.pod:3411
16109 "The bootable flag is used by some operating systems (notably Windows) to "
16110 "determine which partition to boot from. It is by no means universally "
16116 #: ../src/guestfs-actions.pod:5066
16117 msgid "guestfs_part_set_mbr_id"
16122 #: ../src/guestfs-actions.pod:5068
16126 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
16127 " const char *device,\n"
16135 #: ../src/guestfs-actions.pod:5074 ../fish/guestfish-actions.pod:3419
16137 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
16138 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
16139 "documentation are in fact hexadecimal numbers, but usually documented "
16140 "without any leading \"0x\" which might be confusing."
16145 #: ../src/guestfs-actions.pod:5088
16146 msgid "guestfs_part_set_name"
16151 #: ../src/guestfs-actions.pod:5090
16155 " guestfs_part_set_name (guestfs_h *g,\n"
16156 " const char *device,\n"
16158 " const char *name);\n"
16164 #: ../src/guestfs-actions.pod:5096 ../fish/guestfish-actions.pod:3433
16166 "This sets the partition name on partition numbered C<partnum> on device "
16167 "C<device>. Note that partitions are numbered from 1."
16172 #: ../src/guestfs-actions.pod:5099 ../fish/guestfish-actions.pod:3436
16174 "The partition name can only be set on certain types of partition table. "
16175 "This works on C<gpt> but not on C<mbr> partitions."
16180 #: ../src/guestfs-actions.pod:5106
16181 msgid "guestfs_part_to_dev"
16186 #: ../src/guestfs-actions.pod:5108
16190 " guestfs_part_to_dev (guestfs_h *g,\n"
16191 " const char *partition);\n"
16197 #: ../src/guestfs-actions.pod:5112 ../fish/guestfish-actions.pod:3443
16199 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
16200 "partition number, returning the device name (eg. \"/dev/sdb\")."
16205 #: ../src/guestfs-actions.pod:5116
16207 "The named partition must exist, for example as a string returned from "
16208 "C<guestfs_list_partitions>."
16213 #: ../src/guestfs-actions.pod:5124
16214 msgid "guestfs_ping_daemon"
16219 #: ../src/guestfs-actions.pod:5126
16223 " guestfs_ping_daemon (guestfs_h *g);\n"
16229 #: ../src/guestfs-actions.pod:5129 ../fish/guestfish-actions.pod:3454
16231 "This is a test probe into the guestfs daemon running inside the qemu "
16232 "subprocess. Calling this function checks that the daemon responds to the "
16233 "ping message, without affecting the daemon or attached block device(s) in "
16239 #: ../src/guestfs-actions.pod:5138
16240 msgid "guestfs_pread"
16245 #: ../src/guestfs-actions.pod:5140
16249 " guestfs_pread (guestfs_h *g,\n"
16250 " const char *path,\n"
16252 " int64_t offset,\n"
16253 " size_t *size_r);\n"
16259 #: ../src/guestfs-actions.pod:5147 ../fish/guestfish-actions.pod:3463
16261 "This command lets you read part of a file. It reads C<count> bytes of the "
16262 "file, starting at C<offset>, from file C<path>."
16267 #: ../src/guestfs-actions.pod:5150 ../src/guestfs-actions.pod:5176
16268 #: ../fish/guestfish-actions.pod:3466 ../fish/guestfish-actions.pod:3481
16270 "This may read fewer bytes than requested. For further details see the "
16271 "L<pread(2)> system call."
16276 #: ../src/guestfs-actions.pod:5153
16277 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
16282 #: ../src/guestfs-actions.pod:5164
16283 msgid "guestfs_pread_device"
16288 #: ../src/guestfs-actions.pod:5166
16292 " guestfs_pread_device (guestfs_h *g,\n"
16293 " const char *device,\n"
16295 " int64_t offset,\n"
16296 " size_t *size_r);\n"
16302 #: ../src/guestfs-actions.pod:5173 ../fish/guestfish-actions.pod:3478
16304 "This command lets you read part of a file. It reads C<count> bytes of "
16305 "C<device>, starting at C<offset>."
16310 #: ../src/guestfs-actions.pod:5179
16311 msgid "See also C<guestfs_pread>."
16316 #: ../src/guestfs-actions.pod:5188
16317 msgid "(Added in 1.5.21)"
16322 #: ../src/guestfs-actions.pod:5190
16323 msgid "guestfs_pvcreate"
16328 #: ../src/guestfs-actions.pod:5192
16332 " guestfs_pvcreate (guestfs_h *g,\n"
16333 " const char *device);\n"
16339 #: ../src/guestfs-actions.pod:5196 ../fish/guestfish-actions.pod:3493
16341 "This creates an LVM physical volume on the named C<device>, where C<device> "
16342 "should usually be a partition name such as C</dev/sda1>."
16347 #: ../src/guestfs-actions.pod:5204
16348 msgid "guestfs_pvremove"
16353 #: ../src/guestfs-actions.pod:5206
16357 " guestfs_pvremove (guestfs_h *g,\n"
16358 " const char *device);\n"
16364 #: ../src/guestfs-actions.pod:5210 ../fish/guestfish-actions.pod:3501
16366 "This wipes a physical volume C<device> so that LVM will no longer recognise "
16372 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:3504
16374 "The implementation uses the C<pvremove> command which refuses to wipe "
16375 "physical volumes that contain any volume groups, so you have to remove those "
16381 #: ../src/guestfs-actions.pod:5221
16382 msgid "guestfs_pvresize"
16387 #: ../src/guestfs-actions.pod:5223
16391 " guestfs_pvresize (guestfs_h *g,\n"
16392 " const char *device);\n"
16398 #: ../src/guestfs-actions.pod:5227 ../fish/guestfish-actions.pod:3512
16400 "This resizes (expands or shrinks) an existing LVM physical volume to match "
16401 "the new size of the underlying device."
16406 #: ../src/guestfs-actions.pod:5234
16407 msgid "guestfs_pvresize_size"
16412 #: ../src/guestfs-actions.pod:5236
16416 " guestfs_pvresize_size (guestfs_h *g,\n"
16417 " const char *device,\n"
16418 " int64_t size);\n"
16424 #: ../src/guestfs-actions.pod:5241
16426 "This command is the same as C<guestfs_pvresize> except that it allows you to "
16427 "specify the new size (in bytes) explicitly."
16432 #: ../src/guestfs-actions.pod:5248
16433 msgid "guestfs_pvs"
16438 #: ../src/guestfs-actions.pod:5250
16442 " guestfs_pvs (guestfs_h *g);\n"
16448 #: ../src/guestfs-actions.pod:5253 ../fish/guestfish-actions.pod:3526
16450 "List all the physical volumes detected. This is the equivalent of the L<pvs"
16456 #: ../src/guestfs-actions.pod:5256 ../fish/guestfish-actions.pod:3529
16458 "This returns a list of just the device names that contain PVs (eg. C</dev/"
16464 #: ../src/guestfs-actions.pod:5259
16465 msgid "See also C<guestfs_pvs_full>."
16470 #: ../src/guestfs-actions.pod:5267
16471 msgid "guestfs_pvs_full"
16476 #: ../src/guestfs-actions.pod:5269
16479 " struct guestfs_lvm_pv_list *\n"
16480 " guestfs_pvs_full (guestfs_h *g);\n"
16486 #: ../src/guestfs-actions.pod:5272 ../fish/guestfish-actions.pod:3538
16488 "List all the physical volumes detected. This is the equivalent of the L<pvs"
16489 "(8)> command. The \"full\" version includes all fields."
16494 #: ../src/guestfs-actions.pod:5275
16496 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
16497 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
16502 #: ../src/guestfs-actions.pod:5281
16503 msgid "guestfs_pvuuid"
16508 #: ../src/guestfs-actions.pod:5283
16512 " guestfs_pvuuid (guestfs_h *g,\n"
16513 " const char *device);\n"
16519 #: ../src/guestfs-actions.pod:5287 ../fish/guestfish-actions.pod:3545
16520 msgid "This command returns the UUID of the LVM PV C<device>."
16525 #: ../src/guestfs-actions.pod:5294
16526 msgid "guestfs_pwrite"
16531 #: ../src/guestfs-actions.pod:5296
16535 " guestfs_pwrite (guestfs_h *g,\n"
16536 " const char *path,\n"
16537 " const char *content,\n"
16538 " size_t content_size,\n"
16539 " int64_t offset);\n"
16545 #: ../src/guestfs-actions.pod:5303 ../fish/guestfish-actions.pod:3551
16547 "This command writes to part of a file. It writes the data buffer C<content> "
16548 "to the file C<path> starting at offset C<offset>."
16553 #: ../src/guestfs-actions.pod:5306 ../fish/guestfish-actions.pod:3554
16555 "This command implements the L<pwrite(2)> system call, and like that system "
16556 "call it may not write the full data requested. The return value is the "
16557 "number of bytes that were actually written to the file. This could even be "
16558 "0, although short writes are unlikely for regular files in ordinary "
16564 #: ../src/guestfs-actions.pod:5312
16565 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
16570 #: ../src/guestfs-actions.pod:5321
16571 msgid "guestfs_pwrite_device"
16576 #: ../src/guestfs-actions.pod:5323
16580 " guestfs_pwrite_device (guestfs_h *g,\n"
16581 " const char *device,\n"
16582 " const char *content,\n"
16583 " size_t content_size,\n"
16584 " int64_t offset);\n"
16590 #: ../src/guestfs-actions.pod:5330 ../fish/guestfish-actions.pod:3569
16592 "This command writes to part of a device. It writes the data buffer "
16593 "C<content> to C<device> starting at offset C<offset>."
16598 #: ../src/guestfs-actions.pod:5333 ../fish/guestfish-actions.pod:3572
16600 "This command implements the L<pwrite(2)> system call, and like that system "
16601 "call it may not write the full data requested (although short writes to disk "
16602 "devices and partitions are probably impossible with standard Linux kernels)."
16607 #: ../src/guestfs-actions.pod:5338
16608 msgid "See also C<guestfs_pwrite>."
16613 #: ../src/guestfs-actions.pod:5345
16614 msgid "(Added in 1.5.20)"
16619 #: ../src/guestfs-actions.pod:5347
16620 msgid "guestfs_read_file"
16625 #: ../src/guestfs-actions.pod:5349
16629 " guestfs_read_file (guestfs_h *g,\n"
16630 " const char *path,\n"
16631 " size_t *size_r);\n"
16637 #: ../src/guestfs-actions.pod:5354 ../fish/guestfish-actions.pod:3586
16638 msgid "This calls returns the contents of the file C<path> as a buffer."
16643 #: ../src/guestfs-actions.pod:5357
16645 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
16646 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
16647 "function is limited in the total size of file that can be handled."
16652 #: ../src/guestfs-actions.pod:5369
16653 msgid "(Added in 1.0.63)"
16658 #: ../src/guestfs-actions.pod:5371
16659 msgid "guestfs_read_lines"
16664 #: ../src/guestfs-actions.pod:5373
16668 " guestfs_read_lines (guestfs_h *g,\n"
16669 " const char *path);\n"
16675 #: ../src/guestfs-actions.pod:5379 ../fish/guestfish-actions.pod:3603
16677 "The file contents are returned as a list of lines. Trailing C<LF> and "
16678 "C<CRLF> character sequences are I<not> returned."
16683 #: ../src/guestfs-actions.pod:5382
16685 "Note that this function cannot correctly handle binary files (specifically, "
16686 "files containing C<\\0> character which is treated as end of line). For "
16687 "those you need to use the C<guestfs_read_file> function which has a more "
16688 "complex interface."
16693 #: ../src/guestfs-actions.pod:5393
16694 msgid "guestfs_readdir"
16699 #: ../src/guestfs-actions.pod:5395
16702 " struct guestfs_dirent_list *\n"
16703 " guestfs_readdir (guestfs_h *g,\n"
16704 " const char *dir);\n"
16710 #: ../src/guestfs-actions.pod:5399 ../fish/guestfish-actions.pod:3615
16711 msgid "This returns the list of directory entries in directory C<dir>."
16716 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3617
16718 "All entries in the directory are returned, including C<.> and C<..>. The "
16719 "entries are I<not> sorted, but returned in the same order as the underlying "
16725 #: ../src/guestfs-actions.pod:5405 ../fish/guestfish-actions.pod:3621
16727 "Also this call returns basic file type information about each file. The "
16728 "C<ftyp> field will contain one of the following characters:"
16733 #: ../src/guestfs-actions.pod:5410 ../fish/guestfish-actions.pod:3626
16739 #: ../src/guestfs-actions.pod:5412 ../fish/guestfish-actions.pod:3628
16740 msgid "Block special"
16745 #: ../src/guestfs-actions.pod:5414 ../fish/guestfish-actions.pod:3630
16751 #: ../src/guestfs-actions.pod:5416 ../fish/guestfish-actions.pod:3632
16752 msgid "Char special"
16757 #: ../src/guestfs-actions.pod:5418 ../fish/guestfish-actions.pod:3634
16763 #: ../src/guestfs-actions.pod:5420 ../fish/guestfish-actions.pod:3636
16769 #: ../src/guestfs-actions.pod:5422 ../fish/guestfish-actions.pod:3638
16775 #: ../src/guestfs-actions.pod:5424 ../fish/guestfish-actions.pod:3640
16776 msgid "FIFO (named pipe)"
16781 #: ../src/guestfs-actions.pod:5426 ../fish/guestfish-actions.pod:3642
16787 #: ../src/guestfs-actions.pod:5428 ../fish/guestfish-actions.pod:3644
16788 msgid "Symbolic link"
16793 #: ../src/guestfs-actions.pod:5430 ../fish/guestfish-actions.pod:3646
16799 #: ../src/guestfs-actions.pod:5432 ../fish/guestfish-actions.pod:3648
16800 msgid "Regular file"
16805 #: ../src/guestfs-actions.pod:5434 ../fish/guestfish-actions.pod:3650
16811 #: ../src/guestfs-actions.pod:5436 ../fish/guestfish-actions.pod:3652
16817 #: ../src/guestfs-actions.pod:5438 ../fish/guestfish-actions.pod:3654
16823 #: ../src/guestfs-actions.pod:5440 ../fish/guestfish-actions.pod:3656
16824 msgid "Unknown file type"
16829 #: ../src/guestfs-actions.pod:5442 ../fish/guestfish-actions.pod:3658
16835 #: ../src/guestfs-actions.pod:5444 ../fish/guestfish-actions.pod:3660
16837 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
16842 #: ../src/guestfs-actions.pod:5449
16844 "This function is primarily intended for use by programs. To get a simple "
16845 "list of names, use C<guestfs_ls>. To get a printable directory for human "
16846 "consumption, use C<guestfs_ll>."
16851 #: ../src/guestfs-actions.pod:5453
16853 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
16854 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
16859 #: ../src/guestfs-actions.pod:5459
16860 msgid "guestfs_readlink"
16865 #: ../src/guestfs-actions.pod:5461
16869 " guestfs_readlink (guestfs_h *g,\n"
16870 " const char *path);\n"
16876 #: ../src/guestfs-actions.pod:5465 ../fish/guestfish-actions.pod:3673
16877 msgid "This command reads the target of a symbolic link."
16882 #: ../src/guestfs-actions.pod:5472
16883 msgid "guestfs_readlinklist"
16888 #: ../src/guestfs-actions.pod:5474
16892 " guestfs_readlinklist (guestfs_h *g,\n"
16893 " const char *path,\n"
16894 " char *const *names);\n"
16900 #: ../src/guestfs-actions.pod:5479 ../fish/guestfish-actions.pod:3679
16902 "This call allows you to do a C<readlink> operation on multiple files, where "
16903 "all files are in the directory C<path>. C<names> is the list of files from "
16909 #: ../src/guestfs-actions.pod:5483 ../fish/guestfish-actions.pod:3683
16911 "On return you get a list of strings, with a one-to-one correspondence to the "
16912 "C<names> list. Each string is the value of the symbolic link."
16917 #: ../src/guestfs-actions.pod:5487 ../fish/guestfish-actions.pod:3687
16919 "If the C<readlink(2)> operation fails on any name, then the corresponding "
16920 "result string is the empty string C<\"\">. However the whole operation is "
16921 "completed even if there were C<readlink(2)> errors, and so you can call this "
16922 "function with names where you don't know if they are symbolic links already "
16923 "(albeit slightly less efficient)."
16928 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:3694
16930 "This call is intended for programs that want to efficiently list a directory "
16931 "contents without making many round-trips. Very long directory listings "
16932 "might cause the protocol message size to be exceeded, causing this call to "
16933 "fail. The caller must split up such requests into smaller groups of names."
16938 #: ../src/guestfs-actions.pod:5507
16939 msgid "guestfs_realpath"
16944 #: ../src/guestfs-actions.pod:5509
16948 " guestfs_realpath (guestfs_h *g,\n"
16949 " const char *path);\n"
16955 #: ../src/guestfs-actions.pod:5513 ../fish/guestfish-actions.pod:3705
16957 "Return the canonicalized absolute pathname of C<path>. The returned path "
16958 "has no C<.>, C<..> or symbolic link path elements."
16963 #: ../src/guestfs-actions.pod:5521
16964 msgid "guestfs_removexattr"
16969 #: ../src/guestfs-actions.pod:5523
16973 " guestfs_removexattr (guestfs_h *g,\n"
16974 " const char *xattr,\n"
16975 " const char *path);\n"
16981 #: ../src/guestfs-actions.pod:5528 ../fish/guestfish-actions.pod:3712
16983 "This call removes the extended attribute named C<xattr> of the file C<path>."
16988 #: ../src/guestfs-actions.pod:5531
16989 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
16994 #: ../src/guestfs-actions.pod:5537
16995 msgid "guestfs_resize2fs"
17000 #: ../src/guestfs-actions.pod:5539
17004 " guestfs_resize2fs (guestfs_h *g,\n"
17005 " const char *device);\n"
17011 #: ../src/guestfs-actions.pod:5543 ../fish/guestfish-actions.pod:3721
17013 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
17014 "underlying device."
17019 #: ../src/guestfs-actions.pod:5546
17021 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
17022 "C<device> before calling this command. For unknown reasons C<resize2fs> "
17023 "sometimes gives an error about this and sometimes not. In any case, it is "
17024 "always safe to call C<guestfs_e2fsck_f> before calling this function."
17028 #: ../src/guestfs-actions.pod:5556
17029 msgid "guestfs_resize2fs_M"
17033 #: ../src/guestfs-actions.pod:5558
17037 " guestfs_resize2fs_M (guestfs_h *g,\n"
17038 " const char *device);\n"
17043 #: ../src/guestfs-actions.pod:5562
17045 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
17046 "resized to its minimum size. This works like the C<-M> option to the "
17047 "C<resize2fs> command."
17051 #: ../src/guestfs-actions.pod:5566
17053 "To get the resulting size of the filesystem you should call "
17054 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
17055 "These two numbers, multiplied together, give the resulting size of the "
17056 "minimal filesystem in bytes."
17061 #: ../src/guestfs-actions.pod:5573
17062 msgid "guestfs_resize2fs_size"
17067 #: ../src/guestfs-actions.pod:5575
17071 " guestfs_resize2fs_size (guestfs_h *g,\n"
17072 " const char *device,\n"
17073 " int64_t size);\n"
17079 #: ../src/guestfs-actions.pod:5580
17081 "This command is the same as C<guestfs_resize2fs> except that it allows you "
17082 "to specify the new size (in bytes) explicitly."
17087 #: ../src/guestfs-actions.pod:5587
17093 #: ../src/guestfs-actions.pod:5589
17097 " guestfs_rm (guestfs_h *g,\n"
17098 " const char *path);\n"
17104 #: ../src/guestfs-actions.pod:5593 ../fish/guestfish-actions.pod:3754
17105 msgid "Remove the single file C<path>."
17110 #: ../src/guestfs-actions.pod:5599
17111 msgid "guestfs_rm_rf"
17116 #: ../src/guestfs-actions.pod:5601
17120 " guestfs_rm_rf (guestfs_h *g,\n"
17121 " const char *path);\n"
17127 #: ../src/guestfs-actions.pod:5605 ../fish/guestfish-actions.pod:3760
17129 "Remove the file or directory C<path>, recursively removing the contents if "
17130 "its a directory. This is like the C<rm -rf> shell command."
17135 #: ../src/guestfs-actions.pod:5613
17136 msgid "guestfs_rmdir"
17141 #: ../src/guestfs-actions.pod:5615
17145 " guestfs_rmdir (guestfs_h *g,\n"
17146 " const char *path);\n"
17152 #: ../src/guestfs-actions.pod:5619 ../fish/guestfish-actions.pod:3768
17153 msgid "Remove the single directory C<path>."
17158 #: ../src/guestfs-actions.pod:5625
17159 msgid "guestfs_rmmountpoint"
17164 #: ../src/guestfs-actions.pod:5627
17168 " guestfs_rmmountpoint (guestfs_h *g,\n"
17169 " const char *exemptpath);\n"
17175 #: ../src/guestfs-actions.pod:5631
17177 "This calls removes a mountpoint that was previously created with "
17178 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
17183 #: ../src/guestfs-actions.pod:5639
17184 msgid "guestfs_scrub_device"
17189 #: ../src/guestfs-actions.pod:5641
17193 " guestfs_scrub_device (guestfs_h *g,\n"
17194 " const char *device);\n"
17200 #: ../src/guestfs-actions.pod:5645 ../fish/guestfish-actions.pod:3782
17202 "This command writes patterns over C<device> to make data retrieval more "
17208 #: ../src/guestfs-actions.pod:5648 ../src/guestfs-actions.pod:5669
17209 #: ../src/guestfs-actions.pod:5688 ../fish/guestfish-actions.pod:3785
17210 #: ../fish/guestfish-actions.pod:3800 ../fish/guestfish-actions.pod:3813
17212 "It is an interface to the L<scrub(1)> program. See that manual page for "
17218 #: ../src/guestfs-actions.pod:5656 ../src/guestfs-actions.pod:5674
17219 #: ../src/guestfs-actions.pod:5693
17220 msgid "(Added in 1.0.52)"
17225 #: ../src/guestfs-actions.pod:5658
17226 msgid "guestfs_scrub_file"
17231 #: ../src/guestfs-actions.pod:5660
17235 " guestfs_scrub_file (guestfs_h *g,\n"
17236 " const char *file);\n"
17242 #: ../src/guestfs-actions.pod:5664 ../fish/guestfish-actions.pod:3795
17244 "This command writes patterns over a file to make data retrieval more "
17250 #: ../src/guestfs-actions.pod:5667 ../fish/guestfish-actions.pod:3798
17251 msgid "The file is I<removed> after scrubbing."
17256 #: ../src/guestfs-actions.pod:5676
17257 msgid "guestfs_scrub_freespace"
17262 #: ../src/guestfs-actions.pod:5678
17266 " guestfs_scrub_freespace (guestfs_h *g,\n"
17267 " const char *dir);\n"
17273 #: ../src/guestfs-actions.pod:5682
17275 "This command creates the directory C<dir> and then fills it with files until "
17276 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
17277 "and deletes them. The intention is to scrub any free space on the partition "
17278 "containing C<dir>."
17283 #: ../src/guestfs-actions.pod:5695
17284 msgid "guestfs_set_append"
17289 #: ../src/guestfs-actions.pod:5697
17293 " guestfs_set_append (guestfs_h *g,\n"
17294 " const char *append);\n"
17300 #: ../src/guestfs-actions.pod:5701 ../fish/guestfish-actions.pod:3822
17302 "This function is used to add additional options to the guest kernel command "
17308 #: ../src/guestfs-actions.pod:5704 ../fish/guestfish-actions.pod:3825
17310 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
17311 "environment variable."
17316 #: ../src/guestfs-actions.pod:5707 ../fish/guestfish-actions.pod:3828
17318 "Setting C<append> to C<NULL> means I<no> additional options are passed "
17319 "(libguestfs always adds a few of its own)."
17323 #: ../src/guestfs-actions.pod:5714
17324 msgid "guestfs_set_attach_method"
17328 #: ../src/guestfs-actions.pod:5716
17332 " guestfs_set_attach_method (guestfs_h *g,\n"
17333 " const char *attachmethod);\n"
17338 #: ../src/guestfs-actions.pod:5720 ../fish/guestfish-actions.pod:3837
17340 "Set the method that libguestfs uses to connect to the back end guestfsd "
17341 "daemon. Possible methods are:"
17345 #: ../src/guestfs-actions.pod:5727 ../fish/guestfish-actions.pod:3844
17347 "Launch an appliance and connect to it. This is the ordinary method and the "
17352 #: ../src/guestfs-actions.pod:5730 ../fish/guestfish-actions.pod:3847
17353 msgid "C<unix:I<path>>"
17357 #: ../src/guestfs-actions.pod:5732 ../fish/guestfish-actions.pod:3849
17358 msgid "Connect to the Unix domain socket I<path>."
17362 #: ../src/guestfs-actions.pod:5734 ../fish/guestfish-actions.pod:3851
17364 "This method lets you connect to an existing daemon or (using virtio-serial) "
17365 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
17366 "RUNNING DAEMONS>."
17371 #: ../src/guestfs-actions.pod:5742
17372 msgid "guestfs_set_autosync"
17377 #: ../src/guestfs-actions.pod:5744
17381 " guestfs_set_autosync (guestfs_h *g,\n"
17382 " int autosync);\n"
17387 #: ../src/guestfs-actions.pod:5748 ../fish/guestfish-actions.pod:3863
17389 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
17390 "effort attempt to make filesystems consistent and synchronized when the "
17391 "handle is closed (also if the program exits without closing handles)."
17396 #: ../src/guestfs-actions.pod:5753 ../fish/guestfish-actions.pod:3868
17398 "This is enabled by default (since libguestfs 1.5.24, previously it was "
17399 "disabled by default)."
17404 #: ../src/guestfs-actions.pod:5760
17405 msgid "guestfs_set_direct"
17410 #: ../src/guestfs-actions.pod:5762
17414 " guestfs_set_direct (guestfs_h *g,\n"
17421 #: ../src/guestfs-actions.pod:5766 ../fish/guestfish-actions.pod:3877
17423 "If the direct appliance mode flag is enabled, then stdin and stdout are "
17424 "passed directly through to the appliance once it is launched."
17429 #: ../src/guestfs-actions.pod:5770
17431 "One consequence of this is that log messages aren't caught by the library "
17432 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
17438 #: ../src/guestfs-actions.pod:5774 ../fish/guestfish-actions.pod:3885
17439 msgid "You probably don't want to use this unless you know what you are doing."
17444 #: ../src/guestfs-actions.pod:5777 ../fish/guestfish-actions.pod:3888
17445 msgid "The default is disabled."
17450 #: ../src/guestfs-actions.pod:5783
17451 msgid "guestfs_set_e2label"
17456 #: ../src/guestfs-actions.pod:5785
17460 " guestfs_set_e2label (guestfs_h *g,\n"
17461 " const char *device,\n"
17462 " const char *label);\n"
17468 #: ../src/guestfs-actions.pod:5790 ../fish/guestfish-actions.pod:3894
17470 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
17471 "C<label>. Filesystem labels are limited to 16 characters."
17476 #: ../src/guestfs-actions.pod:5794
17478 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
17479 "the existing label on a filesystem."
17484 #: ../src/guestfs-actions.pod:5801
17485 msgid "guestfs_set_e2uuid"
17490 #: ../src/guestfs-actions.pod:5803
17494 " guestfs_set_e2uuid (guestfs_h *g,\n"
17495 " const char *device,\n"
17496 " const char *uuid);\n"
17502 #: ../src/guestfs-actions.pod:5808 ../fish/guestfish-actions.pod:3905
17504 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
17505 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
17506 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
17511 #: ../src/guestfs-actions.pod:5813
17513 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
17514 "the existing UUID of a filesystem."
17519 #: ../src/guestfs-actions.pod:5820
17520 msgid "guestfs_set_memsize"
17525 #: ../src/guestfs-actions.pod:5822
17529 " guestfs_set_memsize (guestfs_h *g,\n"
17536 #: ../src/guestfs-actions.pod:5826
17538 "This sets the memory size in megabytes allocated to the qemu subprocess. "
17539 "This only has any effect if called before C<guestfs_launch>."
17544 #: ../src/guestfs-actions.pod:5830 ../fish/guestfish-actions.pod:3923
17546 "You can also change this by setting the environment variable "
17547 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
17552 #: ../src/guestfs-actions.pod:5841
17553 msgid "guestfs_set_network"
17558 #: ../src/guestfs-actions.pod:5843
17562 " guestfs_set_network (guestfs_h *g,\n"
17569 #: ../src/guestfs-actions.pod:5847 ../fish/guestfish-actions.pod:3936
17571 "If C<network> is true, then the network is enabled in the libguestfs "
17572 "appliance. The default is false."
17577 #: ../src/guestfs-actions.pod:5850 ../fish/guestfish-actions.pod:3939
17579 "This affects whether commands are able to access the network (see L<guestfs"
17580 "(3)/RUNNING COMMANDS>)."
17585 #: ../src/guestfs-actions.pod:5853
17587 "You must call this before calling C<guestfs_launch>, otherwise it has no "
17593 #: ../src/guestfs-actions.pod:5860
17594 msgid "guestfs_set_path"
17599 #: ../src/guestfs-actions.pod:5862
17603 " guestfs_set_path (guestfs_h *g,\n"
17604 " const char *searchpath);\n"
17610 #: ../src/guestfs-actions.pod:5866 ../fish/guestfish-actions.pod:3951
17611 msgid "Set the path that libguestfs searches for kernel and initrd.img."
17616 #: ../src/guestfs-actions.pod:5868 ../fish/guestfish-actions.pod:3953
17618 "The default is C<$libdir/guestfs> unless overridden by setting "
17619 "C<LIBGUESTFS_PATH> environment variable."
17624 #: ../src/guestfs-actions.pod:5871 ../fish/guestfish-actions.pod:3956
17625 msgid "Setting C<path> to C<NULL> restores the default path."
17630 #: ../src/guestfs-actions.pod:5877
17631 msgid "guestfs_set_qemu"
17636 #: ../src/guestfs-actions.pod:5879
17640 " guestfs_set_qemu (guestfs_h *g,\n"
17641 " const char *qemu);\n"
17647 #: ../src/guestfs-actions.pod:5883 ../fish/guestfish-actions.pod:3964
17648 msgid "Set the qemu binary that we will use."
17653 #: ../src/guestfs-actions.pod:5885 ../fish/guestfish-actions.pod:3966
17655 "The default is chosen when the library was compiled by the configure script."
17660 #: ../src/guestfs-actions.pod:5888 ../fish/guestfish-actions.pod:3969
17662 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
17668 #: ../src/guestfs-actions.pod:5891 ../fish/guestfish-actions.pod:3972
17669 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
17674 #: ../src/guestfs-actions.pod:5893 ../fish/guestfish-actions.pod:3974
17676 "Note that you should call this function as early as possible after creating "
17677 "the handle. This is because some pre-launch operations depend on testing "
17678 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
17679 "don't retest features, and so you might see inconsistent results. Using the "
17680 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
17681 "the qemu binary at the same time as the handle is created."
17686 #: ../src/guestfs-actions.pod:5905
17687 msgid "guestfs_set_recovery_proc"
17692 #: ../src/guestfs-actions.pod:5907
17696 " guestfs_set_recovery_proc (guestfs_h *g,\n"
17697 " int recoveryproc);\n"
17703 #: ../src/guestfs-actions.pod:5911
17705 "If this is called with the parameter C<false> then C<guestfs_launch> does "
17706 "not create a recovery process. The purpose of the recovery process is to "
17707 "stop runaway qemu processes in the case where the main program aborts "
17713 #: ../src/guestfs-actions.pod:5916
17715 "This only has any effect if called before C<guestfs_launch>, and the default "
17721 #: ../src/guestfs-actions.pod:5919 ../fish/guestfish-actions.pod:3996
17723 "About the only time when you would want to disable this is if the main "
17724 "process will fork itself into the background (\"daemonize\" itself). In "
17725 "this case the recovery process thinks that the main program has disappeared "
17726 "and so kills qemu, which is not very helpful."
17731 #: ../src/guestfs-actions.pod:5929
17732 msgid "guestfs_set_selinux"
17737 #: ../src/guestfs-actions.pod:5931
17741 " guestfs_set_selinux (guestfs_h *g,\n"
17748 #: ../src/guestfs-actions.pod:5935 ../fish/guestfish-actions.pod:4008
17750 "This sets the selinux flag that is passed to the appliance at boot time. "
17751 "The default is C<selinux=0> (disabled)."
17756 #: ../src/guestfs-actions.pod:5938 ../fish/guestfish-actions.pod:4011
17758 "Note that if SELinux is enabled, it is always in Permissive mode "
17759 "(C<enforcing=0>)."
17764 #: ../src/guestfs-actions.pod:5948
17765 msgid "guestfs_set_trace"
17770 #: ../src/guestfs-actions.pod:5950
17774 " guestfs_set_trace (guestfs_h *g,\n"
17780 #: ../src/guestfs-actions.pod:5954 ../fish/guestfish-actions.pod:4023
17782 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
17783 "return values are traced."
17788 #: ../src/guestfs-actions.pod:5957 ../fish/guestfish-actions.pod:4026
17790 "If you want to trace C API calls into libguestfs (and other libraries) then "
17791 "possibly a better way is to use the external ltrace(1) command."
17796 #: ../src/guestfs-actions.pod:5961 ../fish/guestfish-actions.pod:4030
17798 "Command traces are disabled unless the environment variable "
17799 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
17803 #: ../src/guestfs-actions.pod:5964
17805 "Trace messages are normally sent to C<stderr>, unless you register a "
17806 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
17811 #: ../src/guestfs-actions.pod:5972
17812 msgid "guestfs_set_verbose"
17817 #: ../src/guestfs-actions.pod:5974
17821 " guestfs_set_verbose (guestfs_h *g,\n"
17827 #: ../src/guestfs-actions.pod:5978 ../fish/guestfish-actions.pod:4043
17828 msgid "If C<verbose> is true, this turns on verbose messages."
17833 #: ../src/guestfs-actions.pod:5980 ../fish/guestfish-actions.pod:4045
17835 "Verbose messages are disabled unless the environment variable "
17836 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
17840 #: ../src/guestfs-actions.pod:5983
17842 "Verbose messages are normally sent to C<stderr>, unless you register a "
17843 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
17848 #: ../src/guestfs-actions.pod:5991
17849 msgid "guestfs_setcon"
17854 #: ../src/guestfs-actions.pod:5993
17858 " guestfs_setcon (guestfs_h *g,\n"
17859 " const char *context);\n"
17865 #: ../src/guestfs-actions.pod:5997 ../fish/guestfish-actions.pod:4056
17867 "This sets the SELinux security context of the daemon to the string "
17873 #: ../src/guestfs-actions.pod:6000 ../fish/guestfish-actions.pod:4059
17874 msgid "See the documentation about SELINUX in L<guestfs(3)>."
17879 #: ../src/guestfs-actions.pod:6006
17880 msgid "guestfs_setxattr"
17885 #: ../src/guestfs-actions.pod:6008
17889 " guestfs_setxattr (guestfs_h *g,\n"
17890 " const char *xattr,\n"
17891 " const char *val,\n"
17893 " const char *path);\n"
17899 #: ../src/guestfs-actions.pod:6015 ../fish/guestfish-actions.pod:4065
17901 "This call sets the extended attribute named C<xattr> of the file C<path> to "
17902 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
17907 #: ../src/guestfs-actions.pod:6019
17908 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
17913 #: ../src/guestfs-actions.pod:6025
17914 msgid "guestfs_sfdisk"
17919 #: ../src/guestfs-actions.pod:6027
17923 " guestfs_sfdisk (guestfs_h *g,\n"
17924 " const char *device,\n"
17928 " char *const *lines);\n"
17934 #: ../src/guestfs-actions.pod:6035 ../fish/guestfish-actions.pod:4075
17936 "This is a direct interface to the L<sfdisk(8)> program for creating "
17937 "partitions on block devices."
17942 #: ../src/guestfs-actions.pod:6038 ../fish/guestfish-actions.pod:4078
17943 msgid "C<device> should be a block device, for example C</dev/sda>."
17948 #: ../src/guestfs-actions.pod:6040 ../fish/guestfish-actions.pod:4080
17950 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
17951 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
17952 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
17953 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
17954 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
17955 "the kernel) cannot work out the right geometry and you will need to tell it."
17960 #: ../src/guestfs-actions.pod:6048 ../fish/guestfish-actions.pod:4088
17962 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
17963 "refer to the L<sfdisk(8)> manpage."
17968 #: ../src/guestfs-actions.pod:6051 ../fish/guestfish-actions.pod:4091
17970 "To create a single partition occupying the whole disk, you would pass "
17971 "C<lines> as a single element list, when the single element being the string "
17977 #: ../src/guestfs-actions.pod:6055
17979 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
17984 #: ../src/guestfs-actions.pod:6065
17985 msgid "guestfs_sfdiskM"
17990 #: ../src/guestfs-actions.pod:6067
17994 " guestfs_sfdiskM (guestfs_h *g,\n"
17995 " const char *device,\n"
17996 " char *const *lines);\n"
18002 #: ../src/guestfs-actions.pod:6072
18004 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
18005 "partition sizes are specified in megabytes only (rounded to the nearest "
18006 "cylinder) and you don't need to specify the cyls, heads and sectors "
18007 "parameters which were rarely if ever used anyway."
18012 #: ../src/guestfs-actions.pod:6078
18014 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
18015 "C<guestfs_part_disk>"
18020 #: ../src/guestfs-actions.pod:6088
18021 msgid "guestfs_sfdisk_N"
18026 #: ../src/guestfs-actions.pod:6090
18030 " guestfs_sfdisk_N (guestfs_h *g,\n"
18031 " const char *device,\n"
18036 " const char *line);\n"
18042 #: ../src/guestfs-actions.pod:6099 ../fish/guestfish-actions.pod:4121
18044 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
18045 "(note: C<n> counts from 1)."
18050 #: ../src/guestfs-actions.pod:6102
18052 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
18053 "for the cyls/heads/sectors parameters."
18058 #: ../src/guestfs-actions.pod:6105
18059 msgid "See also: C<guestfs_part_add>"
18064 #: ../src/guestfs-actions.pod:6114
18065 msgid "guestfs_sfdisk_disk_geometry"
18070 #: ../src/guestfs-actions.pod:6116
18074 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
18075 " const char *device);\n"
18081 #: ../src/guestfs-actions.pod:6120
18083 "This displays the disk geometry of C<device> read from the partition table. "
18084 "Especially in the case where the underlying block device has been resized, "
18085 "this can be different from the kernel's idea of the geometry (see "
18086 "C<guestfs_sfdisk_kernel_geometry>)."
18091 #: ../src/guestfs-actions.pod:6125 ../src/guestfs-actions.pod:6141
18092 #: ../fish/guestfish-actions.pod:4141 ../fish/guestfish-actions.pod:4150
18093 msgid "The result is in human-readable format, and not designed to be parsed."
18098 #: ../src/guestfs-actions.pod:6133
18099 msgid "guestfs_sfdisk_kernel_geometry"
18104 #: ../src/guestfs-actions.pod:6135
18108 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
18109 " const char *device);\n"
18115 #: ../src/guestfs-actions.pod:6139 ../fish/guestfish-actions.pod:4148
18116 msgid "This displays the kernel's idea of the geometry of C<device>."
18121 #: ../src/guestfs-actions.pod:6149
18122 msgid "guestfs_sfdisk_l"
18127 #: ../src/guestfs-actions.pod:6151
18131 " guestfs_sfdisk_l (guestfs_h *g,\n"
18132 " const char *device);\n"
18138 #: ../src/guestfs-actions.pod:6155 ../fish/guestfish-actions.pod:4157
18140 "This displays the partition table on C<device>, in the human-readable output "
18141 "of the L<sfdisk(8)> command. It is not intended to be parsed."
18146 #: ../src/guestfs-actions.pod:6159
18147 msgid "See also: C<guestfs_part_list>"
18152 #: ../src/guestfs-actions.pod:6166
18158 #: ../src/guestfs-actions.pod:6168
18162 " guestfs_sh (guestfs_h *g,\n"
18163 " const char *command);\n"
18169 #: ../src/guestfs-actions.pod:6172 ../fish/guestfish-actions.pod:4167
18171 "This call runs a command from the guest filesystem via the guest's C</bin/"
18177 #: ../src/guestfs-actions.pod:6175
18178 msgid "This is like C<guestfs_command>, but passes the command to:"
18183 #: ../src/guestfs-actions.pod:6177 ../fish/guestfish-actions.pod:4172
18186 " /bin/sh -c \"command\"\n"
18192 #: ../src/guestfs-actions.pod:6179 ../fish/guestfish-actions.pod:4174
18194 "Depending on the guest's shell, this usually results in wildcards being "
18195 "expanded, shell expressions being interpolated and so on."
18200 #: ../src/guestfs-actions.pod:6183
18201 msgid "All the provisos about C<guestfs_command> apply to this call."
18206 #: ../src/guestfs-actions.pod:6190
18207 msgid "guestfs_sh_lines"
18212 #: ../src/guestfs-actions.pod:6192
18216 " guestfs_sh_lines (guestfs_h *g,\n"
18217 " const char *command);\n"
18223 #: ../src/guestfs-actions.pod:6196
18225 "This is the same as C<guestfs_sh>, but splits the result into a list of "
18231 #: ../src/guestfs-actions.pod:6199
18232 msgid "See also: C<guestfs_command_lines>"
18237 #: ../src/guestfs-actions.pod:6207
18238 msgid "guestfs_sleep"
18243 #: ../src/guestfs-actions.pod:6209
18247 " guestfs_sleep (guestfs_h *g,\n"
18254 #: ../src/guestfs-actions.pod:6213 ../fish/guestfish-actions.pod:4193
18255 msgid "Sleep for C<secs> seconds."
18260 #: ../src/guestfs-actions.pod:6217
18261 msgid "(Added in 1.0.41)"
18266 #: ../src/guestfs-actions.pod:6219 ../src/guestfs-structs.pod:109
18267 msgid "guestfs_stat"
18272 #: ../src/guestfs-actions.pod:6221
18275 " struct guestfs_stat *\n"
18276 " guestfs_stat (guestfs_h *g,\n"
18277 " const char *path);\n"
18283 #: ../src/guestfs-actions.pod:6227 ../fish/guestfish-actions.pod:4201
18284 msgid "This is the same as the C<stat(2)> system call."
18289 #: ../src/guestfs-actions.pod:6235 ../src/guestfs-structs.pod:135
18290 msgid "guestfs_statvfs"
18295 #: ../src/guestfs-actions.pod:6237
18298 " struct guestfs_statvfs *\n"
18299 " guestfs_statvfs (guestfs_h *g,\n"
18300 " const char *path);\n"
18306 #: ../src/guestfs-actions.pod:6241 ../fish/guestfish-actions.pod:4207
18308 "Returns file system statistics for any mounted file system. C<path> should "
18309 "be a file or directory in the mounted file system (typically it is the mount "
18310 "point itself, but it doesn't need to be)."
18315 #: ../src/guestfs-actions.pod:6245 ../fish/guestfish-actions.pod:4211
18316 msgid "This is the same as the C<statvfs(2)> system call."
18321 #: ../src/guestfs-actions.pod:6247
18323 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
18324 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
18329 #: ../src/guestfs-actions.pod:6253
18330 msgid "guestfs_strings"
18335 #: ../src/guestfs-actions.pod:6255
18339 " guestfs_strings (guestfs_h *g,\n"
18340 " const char *path);\n"
18346 #: ../src/guestfs-actions.pod:6259 ../fish/guestfish-actions.pod:4217
18348 "This runs the L<strings(1)> command on a file and returns the list of "
18349 "printable strings found."
18354 #: ../src/guestfs-actions.pod:6271
18355 msgid "guestfs_strings_e"
18360 #: ../src/guestfs-actions.pod:6273
18364 " guestfs_strings_e (guestfs_h *g,\n"
18365 " const char *encoding,\n"
18366 " const char *path);\n"
18372 #: ../src/guestfs-actions.pod:6278
18374 "This is like the C<guestfs_strings> command, but allows you to specify the "
18375 "encoding of strings that are looked for in the source file C<path>."
18380 #: ../src/guestfs-actions.pod:6282 ../fish/guestfish-actions.pod:4231
18381 msgid "Allowed encodings are:"
18386 #: ../src/guestfs-actions.pod:6286 ../fish/guestfish-actions.pod:4235
18392 #: ../src/guestfs-actions.pod:6288
18394 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
18395 "ISO-8859-X (this is what C<guestfs_strings> uses)."
18400 #: ../src/guestfs-actions.pod:6291 ../fish/guestfish-actions.pod:4240
18406 #: ../src/guestfs-actions.pod:6293 ../fish/guestfish-actions.pod:4242
18407 msgid "Single 8-bit-byte characters."
18412 #: ../src/guestfs-actions.pod:6295 ../fish/guestfish-actions.pod:4244
18418 #: ../src/guestfs-actions.pod:6297 ../fish/guestfish-actions.pod:4246
18419 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
18424 #: ../src/guestfs-actions.pod:6300 ../fish/guestfish-actions.pod:4249
18425 msgid "l (lower case letter L)"
18430 #: ../src/guestfs-actions.pod:6302 ../fish/guestfish-actions.pod:4251
18432 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
18433 "examining binaries in Windows guests."
18438 #: ../src/guestfs-actions.pod:6305 ../fish/guestfish-actions.pod:4254
18444 #: ../src/guestfs-actions.pod:6307 ../fish/guestfish-actions.pod:4256
18445 msgid "32-bit big endian such as UCS-4BE."
18450 #: ../src/guestfs-actions.pod:6309 ../fish/guestfish-actions.pod:4258
18456 #: ../src/guestfs-actions.pod:6311 ../fish/guestfish-actions.pod:4260
18457 msgid "32-bit little endian such as UCS-4LE."
18462 #: ../src/guestfs-actions.pod:6315 ../fish/guestfish-actions.pod:4264
18463 msgid "The returned strings are transcoded to UTF-8."
18468 #: ../src/guestfs-actions.pod:6326
18469 msgid "guestfs_swapoff_device"
18474 #: ../src/guestfs-actions.pod:6328
18478 " guestfs_swapoff_device (guestfs_h *g,\n"
18479 " const char *device);\n"
18485 #: ../src/guestfs-actions.pod:6332
18487 "This command disables the libguestfs appliance swap device or partition "
18488 "named C<device>. See C<guestfs_swapon_device>."
18493 #: ../src/guestfs-actions.pod:6340
18494 msgid "guestfs_swapoff_file"
18499 #: ../src/guestfs-actions.pod:6342
18503 " guestfs_swapoff_file (guestfs_h *g,\n"
18504 " const char *file);\n"
18510 #: ../src/guestfs-actions.pod:6346 ../fish/guestfish-actions.pod:4281
18511 msgid "This command disables the libguestfs appliance swap on file."
18516 #: ../src/guestfs-actions.pod:6352
18517 msgid "guestfs_swapoff_label"
18522 #: ../src/guestfs-actions.pod:6354
18526 " guestfs_swapoff_label (guestfs_h *g,\n"
18527 " const char *label);\n"
18533 #: ../src/guestfs-actions.pod:6358 ../fish/guestfish-actions.pod:4287
18535 "This command disables the libguestfs appliance swap on labeled swap "
18541 #: ../src/guestfs-actions.pod:6365
18542 msgid "guestfs_swapoff_uuid"
18547 #: ../src/guestfs-actions.pod:6367
18551 " guestfs_swapoff_uuid (guestfs_h *g,\n"
18552 " const char *uuid);\n"
18558 #: ../src/guestfs-actions.pod:6371 ../fish/guestfish-actions.pod:4294
18560 "This command disables the libguestfs appliance swap partition with the given "
18566 #: ../src/guestfs-actions.pod:6378
18567 msgid "guestfs_swapon_device"
18572 #: ../src/guestfs-actions.pod:6380
18576 " guestfs_swapon_device (guestfs_h *g,\n"
18577 " const char *device);\n"
18583 #: ../src/guestfs-actions.pod:6384
18585 "This command enables the libguestfs appliance to use the swap device or "
18586 "partition named C<device>. The increased memory is made available for all "
18587 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
18592 #: ../src/guestfs-actions.pod:6389 ../fish/guestfish-actions.pod:4306
18594 "Note that you should not swap to existing guest swap partitions unless you "
18595 "know what you are doing. They may contain hibernation information, or other "
18596 "information that the guest doesn't want you to trash. You also risk leaking "
18597 "information about the host to the guest this way. Instead, attach a new "
18598 "host device to the guest and swap on that."
18603 #: ../src/guestfs-actions.pod:6400
18604 msgid "guestfs_swapon_file"
18609 #: ../src/guestfs-actions.pod:6402
18613 " guestfs_swapon_file (guestfs_h *g,\n"
18614 " const char *file);\n"
18620 #: ../src/guestfs-actions.pod:6406
18622 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
18628 #: ../src/guestfs-actions.pod:6413
18629 msgid "guestfs_swapon_label"
18634 #: ../src/guestfs-actions.pod:6415
18638 " guestfs_swapon_label (guestfs_h *g,\n"
18639 " const char *label);\n"
18645 #: ../src/guestfs-actions.pod:6419
18647 "This command enables swap to a labeled swap partition. See "
18648 "C<guestfs_swapon_device> for other notes."
18653 #: ../src/guestfs-actions.pod:6426
18654 msgid "guestfs_swapon_uuid"
18659 #: ../src/guestfs-actions.pod:6428
18663 " guestfs_swapon_uuid (guestfs_h *g,\n"
18664 " const char *uuid);\n"
18670 #: ../src/guestfs-actions.pod:6432
18672 "This command enables swap to a swap partition with the given UUID. See "
18673 "C<guestfs_swapon_device> for other notes."
18678 #: ../src/guestfs-actions.pod:6439
18679 msgid "guestfs_sync"
18684 #: ../src/guestfs-actions.pod:6441
18688 " guestfs_sync (guestfs_h *g);\n"
18694 #: ../src/guestfs-actions.pod:6444 ../fish/guestfish-actions.pod:4338
18696 "This syncs the disk, so that any writes are flushed through to the "
18697 "underlying disk image."
18702 #: ../src/guestfs-actions.pod:6447 ../fish/guestfish-actions.pod:4341
18704 "You should always call this if you have modified a disk image, before "
18705 "closing the handle."
18710 #: ../src/guestfs-actions.pod:6454
18711 msgid "guestfs_tail"
18716 #: ../src/guestfs-actions.pod:6456
18720 " guestfs_tail (guestfs_h *g,\n"
18721 " const char *path);\n"
18727 #: ../src/guestfs-actions.pod:6460 ../fish/guestfish-actions.pod:4348
18729 "This command returns up to the last 10 lines of a file as a list of strings."
18734 #: ../src/guestfs-actions.pod:6472
18735 msgid "guestfs_tail_n"
18740 #: ../src/guestfs-actions.pod:6474
18744 " guestfs_tail_n (guestfs_h *g,\n"
18746 " const char *path);\n"
18752 #: ../src/guestfs-actions.pod:6479 ../fish/guestfish-actions.pod:4358
18754 "If the parameter C<nrlines> is a positive number, this returns the last "
18755 "C<nrlines> lines of the file C<path>."
18760 #: ../src/guestfs-actions.pod:6482 ../fish/guestfish-actions.pod:4361
18762 "If the parameter C<nrlines> is a negative number, this returns lines from "
18763 "the file C<path>, starting with the C<-nrlines>th line."
18768 #: ../src/guestfs-actions.pod:6496
18769 msgid "guestfs_tar_in"
18774 #: ../src/guestfs-actions.pod:6498
18778 " guestfs_tar_in (guestfs_h *g,\n"
18779 " const char *tarfile,\n"
18780 " const char *directory);\n"
18786 #: ../src/guestfs-actions.pod:6503 ../fish/guestfish-actions.pod:4373
18788 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
18789 "tar file) into C<directory>."
18794 #: ../src/guestfs-actions.pod:6506
18796 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
18801 #: ../src/guestfs-actions.pod:6511 ../src/guestfs-actions.pod:6528
18802 #: ../src/guestfs-actions.pod:6544 ../src/guestfs-actions.pod:6560
18803 msgid "(Added in 1.0.3)"
18808 #: ../src/guestfs-actions.pod:6513
18809 msgid "guestfs_tar_out"
18814 #: ../src/guestfs-actions.pod:6515
18818 " guestfs_tar_out (guestfs_h *g,\n"
18819 " const char *directory,\n"
18820 " const char *tarfile);\n"
18826 #: ../src/guestfs-actions.pod:6520 ../fish/guestfish-actions.pod:4385
18828 "This command packs the contents of C<directory> and downloads it to local "
18834 #: ../src/guestfs-actions.pod:6523
18836 "To download a compressed tarball, use C<guestfs_tgz_out> or "
18837 "C<guestfs_txz_out>."
18842 #: ../src/guestfs-actions.pod:6530
18843 msgid "guestfs_tgz_in"
18848 #: ../src/guestfs-actions.pod:6532
18852 " guestfs_tgz_in (guestfs_h *g,\n"
18853 " const char *tarball,\n"
18854 " const char *directory);\n"
18860 #: ../src/guestfs-actions.pod:6537 ../fish/guestfish-actions.pod:4397
18862 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
18863 "tar file) into C<directory>."
18868 #: ../src/guestfs-actions.pod:6540
18869 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
18874 #: ../src/guestfs-actions.pod:6546
18875 msgid "guestfs_tgz_out"
18880 #: ../src/guestfs-actions.pod:6548
18884 " guestfs_tgz_out (guestfs_h *g,\n"
18885 " const char *directory,\n"
18886 " const char *tarball);\n"
18892 #: ../src/guestfs-actions.pod:6553 ../fish/guestfish-actions.pod:4408
18894 "This command packs the contents of C<directory> and downloads it to local "
18900 #: ../src/guestfs-actions.pod:6556
18901 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
18906 #: ../src/guestfs-actions.pod:6562
18907 msgid "guestfs_touch"
18912 #: ../src/guestfs-actions.pod:6564
18916 " guestfs_touch (guestfs_h *g,\n"
18917 " const char *path);\n"
18923 #: ../src/guestfs-actions.pod:6568 ../fish/guestfish-actions.pod:4419
18925 "Touch acts like the L<touch(1)> command. It can be used to update the "
18926 "timestamps on a file, or, if the file does not exist, to create a new zero-"
18932 #: ../src/guestfs-actions.pod:6572 ../fish/guestfish-actions.pod:4423
18934 "This command only works on regular files, and will fail on other file types "
18935 "such as directories, symbolic links, block special etc."
18940 #: ../src/guestfs-actions.pod:6579
18941 msgid "guestfs_truncate"
18946 #: ../src/guestfs-actions.pod:6581
18950 " guestfs_truncate (guestfs_h *g,\n"
18951 " const char *path);\n"
18957 #: ../src/guestfs-actions.pod:6585 ../fish/guestfish-actions.pod:4430
18959 "This command truncates C<path> to a zero-length file. The file must exist "
18965 #: ../src/guestfs-actions.pod:6592
18966 msgid "guestfs_truncate_size"
18971 #: ../src/guestfs-actions.pod:6594
18975 " guestfs_truncate_size (guestfs_h *g,\n"
18976 " const char *path,\n"
18977 " int64_t size);\n"
18983 #: ../src/guestfs-actions.pod:6599 ../fish/guestfish-actions.pod:4437
18985 "This command truncates C<path> to size C<size> bytes. The file must exist "
18991 #: ../src/guestfs-actions.pod:6602
18993 "If the current file size is less than C<size> then the file is extended to "
18994 "the required size with zero bytes. This creates a sparse file (ie. disk "
18995 "blocks are not allocated for the file until you write to it). To create a "
18996 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
19001 #: ../src/guestfs-actions.pod:6612
19002 msgid "guestfs_tune2fs_l"
19007 #: ../src/guestfs-actions.pod:6614
19011 " guestfs_tune2fs_l (guestfs_h *g,\n"
19012 " const char *device);\n"
19018 #: ../src/guestfs-actions.pod:6618 ../fish/guestfish-actions.pod:4450
19020 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
19026 #: ../src/guestfs-actions.pod:6621 ../fish/guestfish-actions.pod:4453
19028 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
19029 "for more details. The list of fields returned isn't clearly defined, and "
19030 "depends on both the version of C<tune2fs> that libguestfs was built against, "
19031 "and the filesystem itself."
19036 #: ../src/guestfs-actions.pod:6634
19037 msgid "guestfs_txz_in"
19042 #: ../src/guestfs-actions.pod:6636
19046 " guestfs_txz_in (guestfs_h *g,\n"
19047 " const char *tarball,\n"
19048 " const char *directory);\n"
19054 #: ../src/guestfs-actions.pod:6641 ../fish/guestfish-actions.pod:4462
19056 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
19057 "tar file) into C<directory>."
19062 #: ../src/guestfs-actions.pod:6648
19063 msgid "guestfs_txz_out"
19068 #: ../src/guestfs-actions.pod:6650
19072 " guestfs_txz_out (guestfs_h *g,\n"
19073 " const char *directory,\n"
19074 " const char *tarball);\n"
19080 #: ../src/guestfs-actions.pod:6655 ../fish/guestfish-actions.pod:4471
19082 "This command packs the contents of C<directory> and downloads it to local "
19083 "file C<tarball> (as an xz compressed tar archive)."
19088 #: ../src/guestfs-actions.pod:6662
19089 msgid "guestfs_umask"
19094 #: ../src/guestfs-actions.pod:6664
19098 " guestfs_umask (guestfs_h *g,\n"
19105 #: ../src/guestfs-actions.pod:6668 ../fish/guestfish-actions.pod:4480
19107 "This function sets the mask used for creating new files and device nodes to "
19113 #: ../src/guestfs-actions.pod:6671 ../fish/guestfish-actions.pod:4483
19115 "Typical umask values would be C<022> which creates new files with "
19116 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
19117 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
19122 #: ../src/guestfs-actions.pod:6676 ../fish/guestfish-actions.pod:4488
19124 "The default umask is C<022>. This is important because it means that "
19125 "directories and device nodes will be created with C<0644> or C<0755> mode "
19126 "even if you specify C<0777>."
19131 #: ../src/guestfs-actions.pod:6680
19133 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
19134 "C<guestfs_mkdir>."
19139 #: ../src/guestfs-actions.pod:6683 ../fish/guestfish-actions.pod:4495
19140 msgid "This call returns the previous umask."
19145 #: ../src/guestfs-actions.pod:6689
19146 msgid "guestfs_umount"
19151 #: ../src/guestfs-actions.pod:6691
19155 " guestfs_umount (guestfs_h *g,\n"
19156 " const char *pathordevice);\n"
19162 #: ../src/guestfs-actions.pod:6695 ../fish/guestfish-actions.pod:4503
19164 "This unmounts the given filesystem. The filesystem may be specified either "
19165 "by its mountpoint (path) or the device which contains the filesystem."
19170 #: ../src/guestfs-actions.pod:6703
19171 msgid "guestfs_umount_all"
19176 #: ../src/guestfs-actions.pod:6705
19180 " guestfs_umount_all (guestfs_h *g);\n"
19186 #: ../src/guestfs-actions.pod:6708 ../fish/guestfish-actions.pod:4513
19187 msgid "This unmounts all mounted filesystems."
19192 #: ../src/guestfs-actions.pod:6710 ../fish/guestfish-actions.pod:4515
19193 msgid "Some internal mounts are not unmounted by this call."
19198 #: ../src/guestfs-actions.pod:6716
19199 msgid "guestfs_upload"
19204 #: ../src/guestfs-actions.pod:6718
19208 " guestfs_upload (guestfs_h *g,\n"
19209 " const char *filename,\n"
19210 " const char *remotefilename);\n"
19216 #: ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6747
19217 #: ../fish/guestfish-actions.pod:4521 ../fish/guestfish-actions.pod:4534
19218 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
19223 #: ../src/guestfs-actions.pod:6728
19224 msgid "See also C<guestfs_download>."
19229 #: ../src/guestfs-actions.pod:6739
19230 msgid "guestfs_upload_offset"
19235 #: ../src/guestfs-actions.pod:6741
19239 " guestfs_upload_offset (guestfs_h *g,\n"
19240 " const char *filename,\n"
19241 " const char *remotefilename,\n"
19242 " int64_t offset);\n"
19248 #: ../src/guestfs-actions.pod:6750 ../fish/guestfish-actions.pod:4537
19250 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
19251 "The intention is to overwrite parts of existing files or devices, although "
19252 "if a non-existant file is specified then it is created with a \"hole\" "
19253 "before C<offset>. The size of the data written is implicit in the size of "
19254 "the source C<filename>."
19259 #: ../src/guestfs-actions.pod:6757
19261 "Note that there is no limit on the amount of data that can be uploaded with "
19262 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
19263 "full amount unless an error occurs."
19268 #: ../src/guestfs-actions.pod:6762
19269 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
19274 #: ../src/guestfs-actions.pod:6773
19275 msgid "guestfs_utimens"
19280 #: ../src/guestfs-actions.pod:6775
19284 " guestfs_utimens (guestfs_h *g,\n"
19285 " const char *path,\n"
19286 " int64_t atsecs,\n"
19287 " int64_t atnsecs,\n"
19288 " int64_t mtsecs,\n"
19289 " int64_t mtnsecs);\n"
19295 #: ../src/guestfs-actions.pod:6783 ../fish/guestfish-actions.pod:4557
19296 msgid "This command sets the timestamps of a file with nanosecond precision."
19301 #: ../src/guestfs-actions.pod:6786 ../fish/guestfish-actions.pod:4560
19303 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
19309 #: ../src/guestfs-actions.pod:6789 ../fish/guestfish-actions.pod:4563
19311 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
19312 "nanoseconds from the epoch."
19317 #: ../src/guestfs-actions.pod:6792 ../fish/guestfish-actions.pod:4566
19319 "If the C<*nsecs> field contains the special value C<-1> then the "
19320 "corresponding timestamp is set to the current time. (The C<*secs> field is "
19321 "ignored in this case)."
19326 #: ../src/guestfs-actions.pod:6796 ../fish/guestfish-actions.pod:4570
19328 "If the C<*nsecs> field contains the special value C<-2> then the "
19329 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
19335 #: ../src/guestfs-actions.pod:6804 ../src/guestfs-structs.pod:175
19336 msgid "guestfs_version"
19341 #: ../src/guestfs-actions.pod:6806
19344 " struct guestfs_version *\n"
19345 " guestfs_version (guestfs_h *g);\n"
19351 #: ../src/guestfs-actions.pod:6809 ../fish/guestfish-actions.pod:4578
19353 "Return the libguestfs version number that the program is linked against."
19358 #: ../src/guestfs-actions.pod:6812 ../fish/guestfish-actions.pod:4581
19360 "Note that because of dynamic linking this is not necessarily the version of "
19361 "libguestfs that you compiled against. You can compile the program, and then "
19362 "at runtime dynamically link against a completely different C<libguestfs.so> "
19368 #: ../src/guestfs-actions.pod:6817 ../fish/guestfish-actions.pod:4586
19370 "This call was added in version C<1.0.58>. In previous versions of "
19371 "libguestfs there was no way to get the version number. From C code you can "
19372 "use dynamic linker functions to find out if this symbol exists (if it "
19373 "doesn't, then it's an earlier version)."
19378 #: ../src/guestfs-actions.pod:6823 ../fish/guestfish-actions.pod:4592
19380 "The call returns a structure with four elements. The first three (C<major>, "
19381 "C<minor> and C<release>) are numbers and correspond to the usual version "
19382 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
19383 "but may be used for distro-specific information."
19388 #: ../src/guestfs-actions.pod:6829 ../fish/guestfish-actions.pod:4598
19390 "To construct the original version string: C<$major.$minor.$release$extra>"
19395 #: ../src/guestfs-actions.pod:6832 ../fish/guestfish-actions.pod:4601
19396 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
19401 #: ../src/guestfs-actions.pod:6834
19403 "I<Note:> Don't use this call to test for availability of features. In "
19404 "enterprise distributions we backport features from later versions into "
19405 "earlier versions, making this an unreliable way to test for features. Use "
19406 "C<guestfs_available> instead."
19411 #: ../src/guestfs-actions.pod:6840
19413 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
19414 "error. I<The caller must call C<guestfs_free_version> after use>."
19419 #: ../src/guestfs-actions.pod:6844
19420 msgid "(Added in 1.0.58)"
19425 #: ../src/guestfs-actions.pod:6846
19426 msgid "guestfs_vfs_label"
19431 #: ../src/guestfs-actions.pod:6848
19435 " guestfs_vfs_label (guestfs_h *g,\n"
19436 " const char *device);\n"
19442 #: ../src/guestfs-actions.pod:6852 ../fish/guestfish-actions.pod:4613
19443 msgid "This returns the filesystem label of the filesystem on C<device>."
19448 #: ../src/guestfs-actions.pod:6855 ../fish/guestfish-actions.pod:4616
19449 msgid "If the filesystem is unlabeled, this returns the empty string."
19454 #: ../src/guestfs-actions.pod:6857
19455 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
19460 #: ../src/guestfs-actions.pod:6862 ../src/guestfs-actions.pod:6899
19461 msgid "(Added in 1.3.18)"
19466 #: ../src/guestfs-actions.pod:6864
19467 msgid "guestfs_vfs_type"
19472 #: ../src/guestfs-actions.pod:6866
19476 " guestfs_vfs_type (guestfs_h *g,\n"
19477 " const char *device);\n"
19483 #: ../src/guestfs-actions.pod:6870 ../fish/guestfish-actions.pod:4624
19485 "This command gets the filesystem type corresponding to the filesystem on "
19491 #: ../src/guestfs-actions.pod:6873 ../fish/guestfish-actions.pod:4627
19493 "For most filesystems, the result is the name of the Linux VFS module which "
19494 "would be used to mount this filesystem if you mounted it without specifying "
19495 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
19500 #: ../src/guestfs-actions.pod:6883
19501 msgid "guestfs_vfs_uuid"
19506 #: ../src/guestfs-actions.pod:6885
19510 " guestfs_vfs_uuid (guestfs_h *g,\n"
19511 " const char *device);\n"
19517 #: ../src/guestfs-actions.pod:6889 ../fish/guestfish-actions.pod:4636
19518 msgid "This returns the filesystem UUID of the filesystem on C<device>."
19523 #: ../src/guestfs-actions.pod:6892 ../fish/guestfish-actions.pod:4639
19524 msgid "If the filesystem does not have a UUID, this returns the empty string."
19529 #: ../src/guestfs-actions.pod:6894
19530 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
19535 #: ../src/guestfs-actions.pod:6901
19536 msgid "guestfs_vg_activate"
19541 #: ../src/guestfs-actions.pod:6903
19545 " guestfs_vg_activate (guestfs_h *g,\n"
19547 " char *const *volgroups);\n"
19553 #: ../src/guestfs-actions.pod:6908 ../fish/guestfish-actions.pod:4647
19555 "This command activates or (if C<activate> is false) deactivates all logical "
19556 "volumes in the listed volume groups C<volgroups>. If activated, then they "
19557 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
19558 "deactivated, then those devices disappear."
19563 #: ../src/guestfs-actions.pod:6914 ../fish/guestfish-actions.pod:4653
19564 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
19569 #: ../src/guestfs-actions.pod:6916 ../fish/guestfish-actions.pod:4655
19571 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
19572 "activated or deactivated."
19577 #: ../src/guestfs-actions.pod:6923
19578 msgid "guestfs_vg_activate_all"
19583 #: ../src/guestfs-actions.pod:6925
19587 " guestfs_vg_activate_all (guestfs_h *g,\n"
19588 " int activate);\n"
19594 #: ../src/guestfs-actions.pod:6929 ../fish/guestfish-actions.pod:4662
19596 "This command activates or (if C<activate> is false) deactivates all logical "
19597 "volumes in all volume groups. If activated, then they are made known to the "
19598 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
19599 "those devices disappear."
19604 #: ../src/guestfs-actions.pod:6935 ../fish/guestfish-actions.pod:4668
19605 msgid "This command is the same as running C<vgchange -a y|n>"
19610 #: ../src/guestfs-actions.pod:6941
19611 msgid "guestfs_vgcreate"
19616 #: ../src/guestfs-actions.pod:6943
19620 " guestfs_vgcreate (guestfs_h *g,\n"
19621 " const char *volgroup,\n"
19622 " char *const *physvols);\n"
19628 #: ../src/guestfs-actions.pod:6948 ../fish/guestfish-actions.pod:4674
19630 "This creates an LVM volume group called C<volgroup> from the non-empty list "
19631 "of physical volumes C<physvols>."
19636 #: ../src/guestfs-actions.pod:6955
19637 msgid "guestfs_vglvuuids"
19642 #: ../src/guestfs-actions.pod:6957
19646 " guestfs_vglvuuids (guestfs_h *g,\n"
19647 " const char *vgname);\n"
19653 #: ../src/guestfs-actions.pod:6961 ../fish/guestfish-actions.pod:4681
19655 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
19656 "volumes created in this volume group."
19661 #: ../src/guestfs-actions.pod:6964
19663 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
19664 "associate logical volumes and volume groups."
19669 #: ../src/guestfs-actions.pod:6967
19670 msgid "See also C<guestfs_vgpvuuids>."
19675 #: ../src/guestfs-actions.pod:6975
19676 msgid "guestfs_vgpvuuids"
19681 #: ../src/guestfs-actions.pod:6977
19685 " guestfs_vgpvuuids (guestfs_h *g,\n"
19686 " const char *vgname);\n"
19692 #: ../src/guestfs-actions.pod:6981 ../fish/guestfish-actions.pod:4693
19694 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
19695 "volumes that this volume group resides on."
19700 #: ../src/guestfs-actions.pod:6984
19702 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
19703 "associate physical volumes and volume groups."
19708 #: ../src/guestfs-actions.pod:6987
19709 msgid "See also C<guestfs_vglvuuids>."
19714 #: ../src/guestfs-actions.pod:6995
19715 msgid "guestfs_vgremove"
19720 #: ../src/guestfs-actions.pod:6997
19724 " guestfs_vgremove (guestfs_h *g,\n"
19725 " const char *vgname);\n"
19731 #: ../src/guestfs-actions.pod:7001 ../fish/guestfish-actions.pod:4705
19732 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
19737 #: ../src/guestfs-actions.pod:7003 ../fish/guestfish-actions.pod:4707
19739 "This also forcibly removes all logical volumes in the volume group (if any)."
19744 #: ../src/guestfs-actions.pod:7010
19745 msgid "guestfs_vgrename"
19750 #: ../src/guestfs-actions.pod:7012
19754 " guestfs_vgrename (guestfs_h *g,\n"
19755 " const char *volgroup,\n"
19756 " const char *newvolgroup);\n"
19762 #: ../src/guestfs-actions.pod:7017 ../fish/guestfish-actions.pod:4714
19763 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
19768 #: ../src/guestfs-actions.pod:7023
19769 msgid "guestfs_vgs"
19774 #: ../src/guestfs-actions.pod:7025
19778 " guestfs_vgs (guestfs_h *g);\n"
19784 #: ../src/guestfs-actions.pod:7028 ../fish/guestfish-actions.pod:4720
19786 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19792 #: ../src/guestfs-actions.pod:7031 ../fish/guestfish-actions.pod:4723
19794 "This returns a list of just the volume group names that were detected (eg. "
19800 #: ../src/guestfs-actions.pod:7034
19801 msgid "See also C<guestfs_vgs_full>."
19806 #: ../src/guestfs-actions.pod:7042
19807 msgid "guestfs_vgs_full"
19812 #: ../src/guestfs-actions.pod:7044
19815 " struct guestfs_lvm_vg_list *\n"
19816 " guestfs_vgs_full (guestfs_h *g);\n"
19822 #: ../src/guestfs-actions.pod:7047 ../fish/guestfish-actions.pod:4732
19824 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
19825 "> command. The \"full\" version includes all fields."
19830 #: ../src/guestfs-actions.pod:7050
19832 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
19833 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
19838 #: ../src/guestfs-actions.pod:7056
19839 msgid "guestfs_vgscan"
19844 #: ../src/guestfs-actions.pod:7058
19848 " guestfs_vgscan (guestfs_h *g);\n"
19854 #: ../src/guestfs-actions.pod:7061 ../fish/guestfish-actions.pod:4739
19856 "This rescans all block devices and rebuilds the list of LVM physical "
19857 "volumes, volume groups and logical volumes."
19862 #: ../src/guestfs-actions.pod:7068
19863 msgid "guestfs_vguuid"
19868 #: ../src/guestfs-actions.pod:7070
19872 " guestfs_vguuid (guestfs_h *g,\n"
19873 " const char *vgname);\n"
19879 #: ../src/guestfs-actions.pod:7074 ../fish/guestfish-actions.pod:4746
19880 msgid "This command returns the UUID of the LVM VG named C<vgname>."
19885 #: ../src/guestfs-actions.pod:7081
19886 msgid "guestfs_wait_ready"
19891 #: ../src/guestfs-actions.pod:7083
19895 " guestfs_wait_ready (guestfs_h *g);\n"
19901 #: ../src/guestfs-actions.pod:7086
19902 msgid "This function is a no op."
19907 #: ../src/guestfs-actions.pod:7088
19909 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
19910 "calling C<guestfs_launch> to wait for the launch to complete. However this "
19911 "is no longer necessary because C<guestfs_launch> now does the waiting."
19916 #: ../src/guestfs-actions.pod:7093
19918 "If you see any calls to this function in code then you can just remove them, "
19919 "unless you want to retain compatibility with older versions of the API."
19924 #: ../src/guestfs-actions.pod:7101
19925 msgid "guestfs_wc_c"
19930 #: ../src/guestfs-actions.pod:7103
19934 " guestfs_wc_c (guestfs_h *g,\n"
19935 " const char *path);\n"
19941 #: ../src/guestfs-actions.pod:7107 ../fish/guestfish-actions.pod:4752
19943 "This command counts the characters in a file, using the C<wc -c> external "
19949 #: ../src/guestfs-actions.pod:7114
19950 msgid "guestfs_wc_l"
19955 #: ../src/guestfs-actions.pod:7116
19959 " guestfs_wc_l (guestfs_h *g,\n"
19960 " const char *path);\n"
19966 #: ../src/guestfs-actions.pod:7120 ../fish/guestfish-actions.pod:4759
19968 "This command counts the lines in a file, using the C<wc -l> external command."
19973 #: ../src/guestfs-actions.pod:7127
19974 msgid "guestfs_wc_w"
19979 #: ../src/guestfs-actions.pod:7129
19983 " guestfs_wc_w (guestfs_h *g,\n"
19984 " const char *path);\n"
19990 #: ../src/guestfs-actions.pod:7133 ../fish/guestfish-actions.pod:4766
19992 "This command counts the words in a file, using the C<wc -w> external command."
19997 #: ../src/guestfs-actions.pod:7140
19998 msgid "guestfs_write"
20003 #: ../src/guestfs-actions.pod:7142
20007 " guestfs_write (guestfs_h *g,\n"
20008 " const char *path,\n"
20009 " const char *content,\n"
20010 " size_t content_size);\n"
20016 #: ../src/guestfs-actions.pod:7148 ../fish/guestfish-actions.pod:4773
20018 "This call creates a file called C<path>. The content of the file is the "
20019 "string C<content> (which can contain any 8 bit data)."
20024 #: ../src/guestfs-actions.pod:7158
20025 msgid "guestfs_write_file"
20030 #: ../src/guestfs-actions.pod:7160
20034 " guestfs_write_file (guestfs_h *g,\n"
20035 " const char *path,\n"
20036 " const char *content,\n"
20043 #: ../src/guestfs-actions.pod:7166 ../fish/guestfish-actions.pod:4783
20045 "This call creates a file called C<path>. The contents of the file is the "
20046 "string C<content> (which can contain any 8 bit data), with length C<size>."
20051 #: ../src/guestfs-actions.pod:7170 ../fish/guestfish-actions.pod:4787
20053 "As a special case, if C<size> is C<0> then the length is calculated using "
20054 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
20059 #: ../src/guestfs-actions.pod:7174 ../fish/guestfish-actions.pod:4791
20061 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
20062 "I<not> work, even if the length is specified."
20067 #: ../src/guestfs-actions.pod:7182 ../fish/guestfish-actions.pod:4797
20069 "This function is deprecated. In new code, use the C<write> call instead."
20074 #: ../src/guestfs-actions.pod:7191
20075 msgid "guestfs_zegrep"
20080 #: ../src/guestfs-actions.pod:7193
20084 " guestfs_zegrep (guestfs_h *g,\n"
20085 " const char *regex,\n"
20086 " const char *path);\n"
20092 #: ../src/guestfs-actions.pod:7198 ../fish/guestfish-actions.pod:4808
20094 "This calls the external C<zegrep> program and returns the matching lines."
20099 #: ../src/guestfs-actions.pod:7210
20100 msgid "guestfs_zegrepi"
20105 #: ../src/guestfs-actions.pod:7212
20109 " guestfs_zegrepi (guestfs_h *g,\n"
20110 " const char *regex,\n"
20111 " const char *path);\n"
20117 #: ../src/guestfs-actions.pod:7217 ../fish/guestfish-actions.pod:4818
20119 "This calls the external C<zegrep -i> program and returns the matching lines."
20124 #: ../src/guestfs-actions.pod:7229
20125 msgid "guestfs_zero"
20130 #: ../src/guestfs-actions.pod:7231
20134 " guestfs_zero (guestfs_h *g,\n"
20135 " const char *device);\n"
20141 #: ../src/guestfs-actions.pod:7235 ../fish/guestfish-actions.pod:4828
20142 msgid "This command writes zeroes over the first few blocks of C<device>."
20147 #: ../src/guestfs-actions.pod:7237 ../fish/guestfish-actions.pod:4830
20149 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
20150 "securely wipe the device). It should be sufficient to remove any partition "
20151 "tables, filesystem superblocks and so on."
20156 #: ../src/guestfs-actions.pod:7241
20157 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
20162 #: ../src/guestfs-actions.pod:7252
20163 msgid "guestfs_zero_device"
20168 #: ../src/guestfs-actions.pod:7254
20172 " guestfs_zero_device (guestfs_h *g,\n"
20173 " const char *device);\n"
20179 #: ../src/guestfs-actions.pod:7258
20181 "This command writes zeroes over the entire C<device>. Compare with "
20182 "C<guestfs_zero> which just zeroes the first few blocks of a device."
20187 #: ../src/guestfs-actions.pod:7272
20188 msgid "(Added in 1.3.1)"
20193 #: ../src/guestfs-actions.pod:7274
20194 msgid "guestfs_zerofree"
20199 #: ../src/guestfs-actions.pod:7276
20203 " guestfs_zerofree (guestfs_h *g,\n"
20204 " const char *device);\n"
20210 #: ../src/guestfs-actions.pod:7280 ../fish/guestfish-actions.pod:4851
20212 "This runs the I<zerofree> program on C<device>. This program claims to zero "
20213 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
20214 "possible to compress the filesystem more effectively."
20219 #: ../src/guestfs-actions.pod:7285 ../fish/guestfish-actions.pod:4856
20220 msgid "You should B<not> run this program if the filesystem is mounted."
20225 #: ../src/guestfs-actions.pod:7288 ../fish/guestfish-actions.pod:4859
20227 "It is possible that using this program can damage the filesystem or data on "
20233 #: ../src/guestfs-actions.pod:7295
20234 msgid "guestfs_zfgrep"
20239 #: ../src/guestfs-actions.pod:7297
20243 " guestfs_zfgrep (guestfs_h *g,\n"
20244 " const char *pattern,\n"
20245 " const char *path);\n"
20251 #: ../src/guestfs-actions.pod:7302 ../fish/guestfish-actions.pod:4866
20253 "This calls the external C<zfgrep> program and returns the matching lines."
20258 #: ../src/guestfs-actions.pod:7314
20259 msgid "guestfs_zfgrepi"
20264 #: ../src/guestfs-actions.pod:7316
20268 " guestfs_zfgrepi (guestfs_h *g,\n"
20269 " const char *pattern,\n"
20270 " const char *path);\n"
20276 #: ../src/guestfs-actions.pod:7321 ../fish/guestfish-actions.pod:4876
20278 "This calls the external C<zfgrep -i> program and returns the matching lines."
20283 #: ../src/guestfs-actions.pod:7333
20284 msgid "guestfs_zfile"
20289 #: ../src/guestfs-actions.pod:7335
20293 " guestfs_zfile (guestfs_h *g,\n"
20294 " const char *meth,\n"
20295 " const char *path);\n"
20301 #: ../src/guestfs-actions.pod:7340 ../fish/guestfish-actions.pod:4886
20303 "This command runs C<file> after first decompressing C<path> using C<method>."
20308 #: ../src/guestfs-actions.pod:7343 ../fish/guestfish-actions.pod:4889
20309 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
20314 #: ../src/guestfs-actions.pod:7345
20316 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
20322 #: ../src/guestfs-actions.pod:7351 ../fish/guestfish-actions.pod:4894
20324 "This function is deprecated. In new code, use the C<file> call instead."
20329 #: ../src/guestfs-actions.pod:7360
20330 msgid "guestfs_zgrep"
20335 #: ../src/guestfs-actions.pod:7362
20339 " guestfs_zgrep (guestfs_h *g,\n"
20340 " const char *regex,\n"
20341 " const char *path);\n"
20347 #: ../src/guestfs-actions.pod:7367 ../fish/guestfish-actions.pod:4905
20349 "This calls the external C<zgrep> program and returns the matching lines."
20354 #: ../src/guestfs-actions.pod:7379
20355 msgid "guestfs_zgrepi"
20360 #: ../src/guestfs-actions.pod:7381
20364 " guestfs_zgrepi (guestfs_h *g,\n"
20365 " const char *regex,\n"
20366 " const char *path);\n"
20372 #: ../src/guestfs-actions.pod:7386 ../fish/guestfish-actions.pod:4915
20374 "This calls the external C<zgrep -i> program and returns the matching lines."
20379 #: ../src/guestfs-availability.pod:3
20385 #: ../src/guestfs-availability.pod:5
20387 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
20388 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
20389 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
20390 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
20391 "L</guestfs_aug_save> L</guestfs_aug_set>"
20396 #: ../src/guestfs-availability.pod:21
20402 #: ../src/guestfs-availability.pod:23
20404 "The following functions: L</guestfs_inotify_add_watch> L</"
20405 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
20406 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
20411 #: ../src/guestfs-availability.pod:31
20412 msgid "B<linuxfsuuid>"
20417 #: ../src/guestfs-availability.pod:33
20419 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
20420 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
20425 #: ../src/guestfs-availability.pod:40
20426 msgid "B<linuxmodules>"
20431 #: ../src/guestfs-availability.pod:42
20432 msgid "The following functions: L</guestfs_modprobe>"
20437 #: ../src/guestfs-availability.pod:45
20438 msgid "B<linuxxattrs>"
20443 #: ../src/guestfs-availability.pod:47
20445 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> L</"
20446 "guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> L</"
20447 "guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> L</"
20448 "guestfs_setxattr>"
20453 #: ../src/guestfs-availability.pod:58
20459 #: ../src/guestfs-availability.pod:60
20461 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
20462 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
20463 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
20468 #: ../src/guestfs-availability.pod:69
20474 #: ../src/guestfs-availability.pod:71
20476 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
20477 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
20478 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
20479 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
20480 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
20481 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
20482 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
20487 #: ../src/guestfs-availability.pod:94
20493 #: ../src/guestfs-availability.pod:96
20495 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
20496 "guestfs_mknod_b> L</guestfs_mknod_c>"
20501 #: ../src/guestfs-availability.pod:102
20507 #: ../src/guestfs-availability.pod:104
20508 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
20513 #: ../src/guestfs-availability.pod:107
20514 msgid "B<ntfsprogs>"
20519 #: ../src/guestfs-availability.pod:109
20521 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
20526 #: ../src/guestfs-availability.pod:113
20527 msgid "B<realpath>"
20532 #: ../src/guestfs-availability.pod:115
20533 msgid "The following functions: L</guestfs_realpath>"
20538 #: ../src/guestfs-availability.pod:118
20544 #: ../src/guestfs-availability.pod:120
20546 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
20547 "guestfs_scrub_freespace>"
20552 #: ../src/guestfs-availability.pod:125
20558 #: ../src/guestfs-availability.pod:127
20559 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
20564 #: ../src/guestfs-availability.pod:131
20570 #: ../src/guestfs-availability.pod:133
20571 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
20576 #: ../src/guestfs-availability.pod:137
20577 msgid "B<zerofree>"
20582 #: ../src/guestfs-availability.pod:139
20583 msgid "The following functions: L</guestfs_zerofree>"
20588 #: ../src/guestfs-structs.pod:1
20589 msgid "guestfs_int_bool"
20594 #: ../src/guestfs-structs.pod:3
20597 " struct guestfs_int_bool {\n"
20606 #: ../src/guestfs-structs.pod:8
20609 " struct guestfs_int_bool_list {\n"
20610 " uint32_t len; /* Number of elements in list. */\n"
20611 " struct guestfs_int_bool *val; /* Elements. */\n"
20618 #: ../src/guestfs-structs.pod:13
20621 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
20622 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
20628 #: ../src/guestfs-structs.pod:16
20629 msgid "guestfs_lvm_pv"
20634 #: ../src/guestfs-structs.pod:18
20637 " struct guestfs_lvm_pv {\n"
20638 " char *pv_name;\n"
20639 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20640 " char pv_uuid[32];\n"
20642 " uint64_t pv_size;\n"
20643 " uint64_t dev_size;\n"
20644 " uint64_t pv_free;\n"
20645 " uint64_t pv_used;\n"
20646 " char *pv_attr;\n"
20647 " int64_t pv_pe_count;\n"
20648 " int64_t pv_pe_alloc_count;\n"
20649 " char *pv_tags;\n"
20650 " uint64_t pe_start;\n"
20651 " int64_t pv_mda_count;\n"
20652 " uint64_t pv_mda_free;\n"
20659 #: ../src/guestfs-structs.pod:36
20662 " struct guestfs_lvm_pv_list {\n"
20663 " uint32_t len; /* Number of elements in list. */\n"
20664 " struct guestfs_lvm_pv *val; /* Elements. */\n"
20671 #: ../src/guestfs-structs.pod:41
20674 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
20675 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
20681 #: ../src/guestfs-structs.pod:44
20682 msgid "guestfs_lvm_vg"
20687 #: ../src/guestfs-structs.pod:46
20690 " struct guestfs_lvm_vg {\n"
20691 " char *vg_name;\n"
20692 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20693 " char vg_uuid[32];\n"
20695 " char *vg_attr;\n"
20696 " uint64_t vg_size;\n"
20697 " uint64_t vg_free;\n"
20698 " char *vg_sysid;\n"
20699 " uint64_t vg_extent_size;\n"
20700 " int64_t vg_extent_count;\n"
20701 " int64_t vg_free_count;\n"
20702 " int64_t max_lv;\n"
20703 " int64_t max_pv;\n"
20704 " int64_t pv_count;\n"
20705 " int64_t lv_count;\n"
20706 " int64_t snap_count;\n"
20707 " int64_t vg_seqno;\n"
20708 " char *vg_tags;\n"
20709 " int64_t vg_mda_count;\n"
20710 " uint64_t vg_mda_free;\n"
20717 #: ../src/guestfs-structs.pod:69
20720 " struct guestfs_lvm_vg_list {\n"
20721 " uint32_t len; /* Number of elements in list. */\n"
20722 " struct guestfs_lvm_vg *val; /* Elements. */\n"
20729 #: ../src/guestfs-structs.pod:74
20732 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
20733 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
20739 #: ../src/guestfs-structs.pod:77
20740 msgid "guestfs_lvm_lv"
20745 #: ../src/guestfs-structs.pod:79
20748 " struct guestfs_lvm_lv {\n"
20749 " char *lv_name;\n"
20750 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
20751 " char lv_uuid[32];\n"
20752 " char *lv_attr;\n"
20753 " int64_t lv_major;\n"
20754 " int64_t lv_minor;\n"
20755 " int64_t lv_kernel_major;\n"
20756 " int64_t lv_kernel_minor;\n"
20757 " uint64_t lv_size;\n"
20758 " int64_t seg_count;\n"
20760 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20761 " float snap_percent;\n"
20762 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
20763 " float copy_percent;\n"
20764 " char *move_pv;\n"
20765 " char *lv_tags;\n"
20766 " char *mirror_log;\n"
20767 " char *modules;\n"
20774 #: ../src/guestfs-structs.pod:101
20777 " struct guestfs_lvm_lv_list {\n"
20778 " uint32_t len; /* Number of elements in list. */\n"
20779 " struct guestfs_lvm_lv *val; /* Elements. */\n"
20786 #: ../src/guestfs-structs.pod:106
20789 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
20790 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
20796 #: ../src/guestfs-structs.pod:111
20799 " struct guestfs_stat {\n"
20803 " int64_t nlink;\n"
20808 " int64_t blksize;\n"
20809 " int64_t blocks;\n"
20810 " int64_t atime;\n"
20811 " int64_t mtime;\n"
20812 " int64_t ctime;\n"
20819 #: ../src/guestfs-structs.pod:127
20822 " struct guestfs_stat_list {\n"
20823 " uint32_t len; /* Number of elements in list. */\n"
20824 " struct guestfs_stat *val; /* Elements. */\n"
20831 #: ../src/guestfs-structs.pod:132
20834 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
20835 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
20841 #: ../src/guestfs-structs.pod:137
20844 " struct guestfs_statvfs {\n"
20845 " int64_t bsize;\n"
20846 " int64_t frsize;\n"
20847 " int64_t blocks;\n"
20848 " int64_t bfree;\n"
20849 " int64_t bavail;\n"
20850 " int64_t files;\n"
20851 " int64_t ffree;\n"
20852 " int64_t favail;\n"
20855 " int64_t namemax;\n"
20862 #: ../src/guestfs-structs.pod:151
20865 " struct guestfs_statvfs_list {\n"
20866 " uint32_t len; /* Number of elements in list. */\n"
20867 " struct guestfs_statvfs *val; /* Elements. */\n"
20874 #: ../src/guestfs-structs.pod:156
20877 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
20878 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
20884 #: ../src/guestfs-structs.pod:159
20885 msgid "guestfs_dirent"
20890 #: ../src/guestfs-structs.pod:161
20893 " struct guestfs_dirent {\n"
20903 #: ../src/guestfs-structs.pod:167
20906 " struct guestfs_dirent_list {\n"
20907 " uint32_t len; /* Number of elements in list. */\n"
20908 " struct guestfs_dirent *val; /* Elements. */\n"
20915 #: ../src/guestfs-structs.pod:172
20918 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
20919 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
20925 #: ../src/guestfs-structs.pod:177
20928 " struct guestfs_version {\n"
20929 " int64_t major;\n"
20930 " int64_t minor;\n"
20931 " int64_t release;\n"
20939 #: ../src/guestfs-structs.pod:184
20942 " struct guestfs_version_list {\n"
20943 " uint32_t len; /* Number of elements in list. */\n"
20944 " struct guestfs_version *val; /* Elements. */\n"
20951 #: ../src/guestfs-structs.pod:189
20954 " void guestfs_free_version (struct guestfs_free_version *);\n"
20955 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
20961 #: ../src/guestfs-structs.pod:192
20962 msgid "guestfs_xattr"
20967 #: ../src/guestfs-structs.pod:194
20970 " struct guestfs_xattr {\n"
20971 " char *attrname;\n"
20972 " /* The next two fields describe a byte array. */\n"
20973 " uint32_t attrval_len;\n"
20974 " char *attrval;\n"
20981 #: ../src/guestfs-structs.pod:201
20984 " struct guestfs_xattr_list {\n"
20985 " uint32_t len; /* Number of elements in list. */\n"
20986 " struct guestfs_xattr *val; /* Elements. */\n"
20993 #: ../src/guestfs-structs.pod:206
20996 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
20997 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
21003 #: ../src/guestfs-structs.pod:209
21004 msgid "guestfs_inotify_event"
21009 #: ../src/guestfs-structs.pod:211
21012 " struct guestfs_inotify_event {\n"
21013 " int64_t in_wd;\n"
21014 " uint32_t in_mask;\n"
21015 " uint32_t in_cookie;\n"
21016 " char *in_name;\n"
21023 #: ../src/guestfs-structs.pod:218
21026 " struct guestfs_inotify_event_list {\n"
21027 " uint32_t len; /* Number of elements in list. */\n"
21028 " struct guestfs_inotify_event *val; /* Elements. */\n"
21035 #: ../src/guestfs-structs.pod:223
21038 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
21039 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
21045 #: ../src/guestfs-structs.pod:226
21046 msgid "guestfs_partition"
21051 #: ../src/guestfs-structs.pod:228
21054 " struct guestfs_partition {\n"
21055 " int32_t part_num;\n"
21056 " uint64_t part_start;\n"
21057 " uint64_t part_end;\n"
21058 " uint64_t part_size;\n"
21065 #: ../src/guestfs-structs.pod:235
21068 " struct guestfs_partition_list {\n"
21069 " uint32_t len; /* Number of elements in list. */\n"
21070 " struct guestfs_partition *val; /* Elements. */\n"
21077 #: ../src/guestfs-structs.pod:240
21080 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
21081 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
21087 #: ../src/guestfs-structs.pod:243
21088 msgid "guestfs_application"
21093 #: ../src/guestfs-structs.pod:245
21096 " struct guestfs_application {\n"
21097 " char *app_name;\n"
21098 " char *app_display_name;\n"
21099 " int32_t app_epoch;\n"
21100 " char *app_version;\n"
21101 " char *app_release;\n"
21102 " char *app_install_path;\n"
21103 " char *app_trans_path;\n"
21104 " char *app_publisher;\n"
21105 " char *app_url;\n"
21106 " char *app_source_package;\n"
21107 " char *app_summary;\n"
21108 " char *app_description;\n"
21115 #: ../src/guestfs-structs.pod:260
21118 " struct guestfs_application_list {\n"
21119 " uint32_t len; /* Number of elements in list. */\n"
21120 " struct guestfs_application *val; /* Elements. */\n"
21127 #: ../src/guestfs-structs.pod:265
21130 " void guestfs_free_application (struct guestfs_free_application *);\n"
21131 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
21137 #: ../fish/guestfish.pod:5
21138 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
21143 #: ../fish/guestfish.pod:9
21146 " guestfish [--options] [commands]\n"
21152 #: ../fish/guestfish.pod:11
21161 #: ../fish/guestfish.pod:13
21164 " guestfish [--ro|--rw] -a disk.img\n"
21170 #: ../fish/guestfish.pod:15
21173 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
21179 #: ../fish/guestfish.pod:17
21182 " guestfish -d libvirt-domain\n"
21188 #: ../fish/guestfish.pod:19
21191 " guestfish [--ro|--rw] -a disk.img -i\n"
21197 #: ../fish/guestfish.pod:21
21200 " guestfish -d libvirt-domain -i\n"
21206 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
21207 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:64
21213 #: ../fish/guestfish.pod:25
21215 "Using guestfish in read/write mode on live virtual machines can be "
21216 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
21217 "option to use guestfish safely if the disk image or virtual machine might be "
21223 #: ../fish/guestfish.pod:32
21225 "Guestfish is a shell and command-line tool for examining and modifying "
21226 "virtual machine filesystems. It uses libguestfs and exposes all of the "
21227 "functionality of the guestfs API, see L<guestfs(3)>."
21232 #: ../fish/guestfish.pod:36
21234 "Guestfish gives you structured access to the libguestfs API, from shell "
21235 "scripts or the command line or interactively. If you want to rescue a "
21236 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
21242 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:937
21243 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
21244 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:50
21250 #: ../fish/guestfish.pod:43
21251 msgid "As an interactive shell"
21256 #: ../fish/guestfish.pod:45
21265 #: ../fish/guestfish.pod:47
21268 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
21269 " editing virtual machine filesystems.\n"
21275 #: ../fish/guestfish.pod:50
21278 " Type: 'help' for a list of commands\n"
21279 " 'man' to read the manual\n"
21280 " 'quit' to quit the shell\n"
21286 #: ../fish/guestfish.pod:54
21289 " ><fs> add-ro disk.img\n"
21291 " ><fs> list-filesystems\n"
21292 " /dev/sda1: ext4\n"
21293 " /dev/vg_guest/lv_root: ext4\n"
21294 " /dev/vg_guest/lv_swap: swap\n"
21295 " ><fs> mount /dev/vg_guest/lv_root /\n"
21296 " ><fs> cat /etc/fstab\n"
21298 " # Created by anaconda\n"
21306 #: ../fish/guestfish.pod:67
21307 msgid "From shell scripts"
21312 #: ../fish/guestfish.pod:69
21313 msgid "Create a new C</etc/motd> file in a guest or disk image:"
21318 #: ../fish/guestfish.pod:71
21321 " guestfish <<_EOF_\n"
21324 " mount /dev/vg_guest/lv_root /\n"
21325 " write /etc/motd \"Welcome, new users\"\n"
21332 #: ../fish/guestfish.pod:78
21333 msgid "List the LVM logical volumes in a disk image:"
21338 #: ../fish/guestfish.pod:80
21341 " guestfish -a disk.img --ro <<_EOF_\n"
21350 #: ../fish/guestfish.pod:85
21351 msgid "List all the filesystems in a disk image:"
21356 #: ../fish/guestfish.pod:87
21359 " guestfish -a disk.img --ro <<_EOF_\n"
21361 " list-filesystems\n"
21368 #: ../fish/guestfish.pod:92
21369 msgid "On one command line"
21374 #: ../fish/guestfish.pod:94
21375 msgid "Update C</etc/resolv.conf> in a guest:"
21380 #: ../fish/guestfish.pod:96
21384 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
21385 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
21391 #: ../fish/guestfish.pod:100
21392 msgid "Edit C</boot/grub/grub.conf> interactively:"
21397 #: ../fish/guestfish.pod:102
21400 " guestfish --rw --add disk.img \\\n"
21401 " --mount /dev/vg_guest/lv_root \\\n"
21402 " --mount /dev/sda1:/boot \\\n"
21403 " edit /boot/grub/grub.conf\n"
21409 #: ../fish/guestfish.pod:107
21410 msgid "Mount disks automatically"
21415 #: ../fish/guestfish.pod:109
21417 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
21422 #: ../fish/guestfish.pod:112
21425 " guestfish --ro -a disk.img -i cat /etc/group\n"
21431 #: ../fish/guestfish.pod:114
21434 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
21440 #: ../fish/guestfish.pod:116
21441 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
21446 #: ../fish/guestfish.pod:118
21449 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
21455 #: ../fish/guestfish.pod:120
21456 msgid "As a script interpreter"
21461 #: ../fish/guestfish.pod:122
21462 msgid "Create a 100MB disk containing an ext2-formatted partition:"
21467 #: ../fish/guestfish.pod:124
21470 " #!/usr/bin/guestfish -f\n"
21471 " sparse test1.img 100M\n"
21473 " part-disk /dev/sda mbr\n"
21474 " mkfs ext2 /dev/sda1\n"
21480 #: ../fish/guestfish.pod:130
21481 msgid "Start with a prepared disk"
21486 #: ../fish/guestfish.pod:132
21488 "An alternate way to create a 100MB disk called C<test1.img> containing a "
21489 "single ext2-formatted partition:"
21494 #: ../fish/guestfish.pod:135
21497 " guestfish -N fs\n"
21503 #: ../fish/guestfish.pod:137
21504 msgid "To list what is available do:"
21509 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:928
21512 " guestfish -N help | less\n"
21518 #: ../fish/guestfish.pod:141
21519 msgid "Remote control"
21524 #: ../fish/guestfish.pod:143
21527 " eval \"`guestfish --listen`\"\n"
21528 " guestfish --remote add-ro disk.img\n"
21529 " guestfish --remote run\n"
21530 " guestfish --remote lvs\n"
21536 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
21537 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
21538 #: ../tools/virt-win-reg.pl:96 ../tools/virt-resize.pl:254
21539 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:103
21540 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
21546 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
21547 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:104
21548 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
21549 #: ../tools/virt-tar.pl:111 ../tools/virt-make-fs.pl:161
21550 #: ../tools/virt-list-partitions.pl:62
21556 #: ../fish/guestfish.pod:154
21557 msgid "Displays general help on options."
21562 #: ../fish/guestfish.pod:156
21568 #: ../fish/guestfish.pod:158
21569 msgid "B<--cmd-help>"
21574 #: ../fish/guestfish.pod:160
21575 msgid "Lists all available guestfish commands."
21580 #: ../fish/guestfish.pod:162
21586 #: ../fish/guestfish.pod:164
21587 msgid "B<--cmd-help cmd>"
21592 #: ../fish/guestfish.pod:166
21593 msgid "Displays detailed help on a single command C<cmd>."
21598 #: ../fish/guestfish.pod:168
21599 msgid "B<-a image>"
21604 #: ../fish/guestfish.pod:170
21605 msgid "B<--add image>"
21610 #: ../fish/guestfish.pod:172
21611 msgid "Add a block device or virtual machine image to the shell."
21616 #: ../fish/guestfish.pod:174 ../fuse/guestmount.pod:81
21618 "The format of the disk image is auto-detected. To override this and force a "
21619 "particular format use the I<--format=..> option."
21624 #: ../fish/guestfish.pod:177
21626 "Using this flag is mostly equivalent to using the C<add> command, with "
21627 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
21628 "the I<--format:...> flag was given."
21633 #: ../fish/guestfish.pod:181
21639 #: ../fish/guestfish.pod:183
21640 msgid "B<--connect URI>"
21645 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:86
21647 "When used in conjunction with the I<-d> option, this specifies the libvirt "
21648 "URI to use. The default is to use the default libvirt connection."
21653 #: ../fish/guestfish.pod:189
21659 #: ../fish/guestfish.pod:191
21661 "If using the I<--listen> option and a csh-like shell, use this option. See "
21662 "section L</REMOTE CONTROL AND CSH> below."
21667 #: ../fish/guestfish.pod:194
21668 msgid "B<-d libvirt-domain>"
21673 #: ../fish/guestfish.pod:196
21674 msgid "B<--domain libvirt-domain>"
21679 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:92
21681 "Add disks from the named libvirt domain. If the I<--ro> option is also "
21682 "used, then any libvirt domain can be used. However in write mode, only "
21683 "libvirt domains which are shut down can be named here."
21688 #: ../fish/guestfish.pod:202
21690 "Using this flag is mostly equivalent to using the C<add-domain> command, "
21691 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
21692 "if the I<--format:...> flag was given."
21697 #: ../fish/guestfish.pod:206
21703 #: ../fish/guestfish.pod:208
21704 msgid "B<--no-dest-paths>"
21709 #: ../fish/guestfish.pod:210
21711 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
21712 "to hit the tab key to complete paths on the guest filesystem, but this "
21713 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
21714 "allow this feature to be disabled."
21719 #: ../fish/guestfish.pod:215 ../fuse/guestmount.pod:108
21720 msgid "B<--echo-keys>"
21725 #: ../fish/guestfish.pod:217 ../fuse/guestmount.pod:110
21727 "When prompting for keys and passphrases, guestfish normally turns echoing "
21728 "off so you cannot see what you are typing. If you are not worried about "
21729 "Tempest attacks and there is no one else in the room you can specify this "
21730 "flag to see what you are typing."
21735 #: ../fish/guestfish.pod:222
21741 #: ../fish/guestfish.pod:224
21742 msgid "B<--file file>"
21747 #: ../fish/guestfish.pod:226
21748 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
21753 #: ../fish/guestfish.pod:229
21756 " #!/usr/bin/guestfish -f\n"
21762 #: ../fish/guestfish.pod:231
21763 msgid "B<--format=raw|qcow2|..>"
21768 #: ../fish/guestfish.pod:233
21769 msgid "B<--format>"
21774 #: ../fish/guestfish.pod:235 ../fuse/guestmount.pod:117
21776 "The default for the I<-a> option is to auto-detect the format of the disk "
21777 "image. Using this forces the disk format for I<-a> options which follow on "
21778 "the command line. Using I<--format> with no argument switches back to auto-"
21779 "detection for subsequent I<-a> options."
21784 #: ../fish/guestfish.pod:242
21787 " guestfish --format=raw -a disk.img\n"
21793 #: ../fish/guestfish.pod:244
21794 msgid "forces raw format (no auto-detection) for C<disk.img>."
21799 #: ../fish/guestfish.pod:246
21802 " guestfish --format=raw -a disk.img --format -a another.img\n"
21808 #: ../fish/guestfish.pod:248
21810 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
21811 "detection for C<another.img>."
21816 #: ../fish/guestfish.pod:251
21818 "If you have untrusted raw-format guest disk images, you should use this "
21819 "option to specify the disk format. This avoids a possible security problem "
21820 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
21825 #: ../fish/guestfish.pod:256
21831 #: ../fish/guestfish.pod:258
21832 msgid "B<--inspector>"
21837 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:137
21839 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
21840 "system and mount filesystems as they would be mounted on the real virtual "
21846 #: ../fish/guestfish.pod:264
21847 msgid "Typical usage is either:"
21852 #: ../fish/guestfish.pod:266
21855 " guestfish -d myguest -i\n"
21861 #: ../fish/guestfish.pod:268
21862 msgid "(for an inactive libvirt domain called I<myguest>), or:"
21867 #: ../fish/guestfish.pod:270
21870 " guestfish --ro -d myguest -i\n"
21876 #: ../fish/guestfish.pod:272
21877 msgid "(for active domains, readonly), or specify the block device directly:"
21882 #: ../fish/guestfish.pod:274
21885 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
21891 #: ../fish/guestfish.pod:276
21893 "Note that the command line syntax changed slightly over older versions of "
21894 "guestfish. You can still use the old syntax:"
21899 #: ../fish/guestfish.pod:279
21902 " guestfish [--ro] -i disk.img\n"
21908 #: ../fish/guestfish.pod:281
21911 " guestfish [--ro] -i libvirt-domain\n"
21917 #: ../fish/guestfish.pod:283
21919 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
21920 "then using other commands to mount the filesystems that were found."
21925 #: ../fish/guestfish.pod:287 ../fuse/guestmount.pod:141
21926 msgid "B<--keys-from-stdin>"
21931 #: ../fish/guestfish.pod:289 ../fuse/guestmount.pod:143
21933 "Read key or passphrase parameters from stdin. The default is to try to read "
21934 "passphrases from the user by opening C</dev/tty>."
21939 #: ../fish/guestfish.pod:292
21940 msgid "B<--listen>"
21945 #: ../fish/guestfish.pod:294
21947 "Fork into the background and listen for remote commands. See section L</"
21948 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
21952 #: ../fish/guestfish.pod:297 ../fuse/guestmount.pod:146
21957 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:148
21959 "Connect to a live virtual machine. (Experimental, see L<guestfs(3)/"
21960 "ATTACHING TO RUNNING DAEMONS>)."
21964 #: ../fish/guestfish.pod:302 ../fuse/guestmount.pod:151
21965 msgid "B<-m dev[:mountpoint[:options]]>"
21969 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:153
21970 msgid "B<--mount dev[:mountpoint[:options]]>"
21975 #: ../fish/guestfish.pod:306
21976 msgid "Mount the named partition or logical volume on the given mountpoint."
21981 #: ../fish/guestfish.pod:308
21982 msgid "If the mountpoint is omitted, it defaults to C</>."
21987 #: ../fish/guestfish.pod:310
21988 msgid "You have to mount something on C</> before most commands will work."
21993 #: ../fish/guestfish.pod:312
21995 "If any I<-m> or I<--mount> options are given, the guest is automatically "
22001 #: ../fish/guestfish.pod:315
22003 "If you don't know what filesystems a disk image contains, you can either run "
22004 "guestfish without this option, then list the partitions, filesystems and LVs "
22005 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
22006 "commands), or you can use the L<virt-filesystems(1)> program."
22010 #: ../fish/guestfish.pod:321 ../fuse/guestmount.pod:161
22012 "The third (and rarely used) part of the mount parameter is the list of mount "
22013 "options used to mount the underlying filesystem. If this is not given, then "
22014 "the mount options are either the empty string or C<ro> (the latter if the "
22015 "I<--ro> flag is used). By specifying the mount options, you override this "
22016 "default choice. Probably the only time you would use this is to enable ACLs "
22017 "and/or extended attributes if the filesystem can support them:"
22021 #: ../fish/guestfish.pod:329 ../fuse/guestmount.pod:169
22024 " -m /dev/sda1:/:acl,user_xattr\n"
22029 #: ../fish/guestfish.pod:331
22030 msgid "Using this flag is equivalent to using the C<mount-options> command."
22035 #: ../fish/guestfish.pod:333
22041 #: ../fish/guestfish.pod:335
22042 msgid "B<--no-sync>"
22047 #: ../fish/guestfish.pod:337
22049 "Disable autosync. This is enabled by default. See the discussion of "
22050 "autosync in the L<guestfs(3)> manpage."
22055 #: ../fish/guestfish.pod:340
22061 #: ../fish/guestfish.pod:342
22062 msgid "B<--new type>"
22067 #: ../fish/guestfish.pod:344
22073 #: ../fish/guestfish.pod:346
22075 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
22076 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
22077 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
22083 #: ../fish/guestfish.pod:351
22084 msgid "B<--progress-bars>"
22089 #: ../fish/guestfish.pod:353
22090 msgid "Enable progress bars, even when guestfish is used non-interactively."
22095 #: ../fish/guestfish.pod:355
22097 "Progress bars are enabled by default when guestfish is used as an "
22098 "interactive shell."
22103 #: ../fish/guestfish.pod:358
22104 msgid "B<--no-progress-bars>"
22109 #: ../fish/guestfish.pod:360
22110 msgid "Disable progress bars."
22115 #: ../fish/guestfish.pod:362
22116 msgid "B<--remote[=pid]>"
22121 #: ../fish/guestfish.pod:364
22123 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
22124 "CONTROL GUESTFISH OVER A SOCKET> below."
22129 #: ../fish/guestfish.pod:367
22135 #: ../fish/guestfish.pod:369
22141 #: ../fish/guestfish.pod:371
22143 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
22144 "mounts are done read-only."
22149 #: ../fish/guestfish.pod:374
22151 "The option must always be used if the disk image or virtual machine might be "
22152 "running, and is generally recommended in cases where you don't need write "
22153 "access to the disk."
22158 #: ../fish/guestfish.pod:378
22160 "Note that prepared disk images created with I<-N> are not affected by this "
22161 "option. Also commands like C<add> are not affected - you have to specify "
22162 "the C<readonly:true> option explicitly if you need it."
22167 #: ../fish/guestfish.pod:382
22168 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
22173 #: ../fish/guestfish.pod:384 ../fuse/guestmount.pod:225
22174 msgid "B<--selinux>"
22179 #: ../fish/guestfish.pod:386
22180 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
22185 #: ../fish/guestfish.pod:388
22191 #: ../fish/guestfish.pod:390
22192 msgid "B<--verbose>"
22197 #: ../fish/guestfish.pod:392
22199 "Enable very verbose messages. This is particularly useful if you find a bug."
22204 #: ../fish/guestfish.pod:395
22210 #: ../fish/guestfish.pod:397 ../tools/virt-edit.pl:88
22211 #: ../tools/virt-win-reg.pl:112 ../tools/virt-resize.pl:270
22212 #: ../tools/virt-list-filesystems.pl:69 ../tools/virt-tar.pl:119
22213 #: ../tools/virt-make-fs.pl:169 ../tools/virt-list-partitions.pl:70
22214 msgid "B<--version>"
22219 #: ../fish/guestfish.pod:399
22220 msgid "Display the guestfish / libguestfs version number and exit."
22225 #: ../fish/guestfish.pod:401
22231 #: ../fish/guestfish.pod:403
22237 #: ../fish/guestfish.pod:405
22239 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
22245 #: ../fish/guestfish.pod:408
22251 #: ../fish/guestfish.pod:410
22252 msgid "Echo each command before executing it."
22257 #: ../fish/guestfish.pod:414
22258 msgid "COMMANDS ON COMMAND LINE"
22263 #: ../fish/guestfish.pod:416
22265 "Any additional (non-option) arguments are treated as commands to execute."
22270 #: ../fish/guestfish.pod:419
22272 "Commands to execute should be separated by a colon (C<:>), where the colon "
22273 "is a separate parameter. Thus:"
22278 #: ../fish/guestfish.pod:422
22281 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
22287 #: ../fish/guestfish.pod:424
22289 "If there are no additional arguments, then we enter a shell, either an "
22290 "interactive shell with a prompt (if the input is a terminal) or a non-"
22291 "interactive shell."
22296 #: ../fish/guestfish.pod:428
22298 "In either command line mode or non-interactive shell, the first command that "
22299 "gives an error causes the whole shell to exit. In interactive mode (with a "
22300 "prompt) if a command fails, you can continue to enter commands."
22305 #: ../fish/guestfish.pod:433
22306 msgid "USING launch (OR run)"
22311 #: ../fish/guestfish.pod:435
22313 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
22314 "then launch it, then mount any disks you need, and finally issue actions/"
22315 "commands. So the general order of the day is:"
22320 #: ../fish/guestfish.pod:443
22321 msgid "add or -a/--add"
22326 #: ../fish/guestfish.pod:447
22327 msgid "launch (aka run)"
22332 #: ../fish/guestfish.pod:451
22333 msgid "mount or -m/--mount"
22338 #: ../fish/guestfish.pod:455
22339 msgid "any other commands"
22344 #: ../fish/guestfish.pod:459
22346 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
22347 "guest before mounting or performing any other commands."
22352 #: ../fish/guestfish.pod:462
22354 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
22355 "I<--new> options were given then C<run> is done automatically, simply "
22356 "because guestfish can't perform the action you asked for without doing this."
22361 #: ../fish/guestfish.pod:467
22362 msgid "OPENING DISKS FOR READ AND WRITE"
22367 #: ../fish/guestfish.pod:469
22369 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
22370 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
22371 "open disk images read-only or for writing."
22376 #: ../fish/guestfish.pod:473
22378 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
22379 "disk images supplied on the command line for write. To open a disk image "
22380 "read-only you have to do I<-a image --ro>."
22385 #: ../fish/guestfish.pod:477
22387 "This matters: If you accidentally open a live VM disk image writable then "
22388 "you will cause irreversible disk corruption."
22392 #: ../fish/guestfish.pod:480
22394 "By libguestfs 1.10 we intend to change the default the other way. Disk "
22395 "images will be opened read-only. You will have to either specify "
22396 "I<guestfish --rw> or change a configuration file in order to get write "
22397 "access for disk images specified by those other command line options."
22402 #: ../fish/guestfish.pod:485
22404 "This version of guestfish has a I<--rw> option which does nothing (it is "
22405 "already the default). However it is highly recommended that you use this "
22406 "option to indicate that guestfish needs write access, and to prepare your "
22407 "scripts for the day when this option will be required for write access."
22412 #: ../fish/guestfish.pod:491
22414 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
22415 "other libguestfs program apart from guestfish and guestmount."
22420 #: ../fish/guestfish.pod:494
22426 #: ../fish/guestfish.pod:496
22428 "You can quote ordinary parameters using either single or double quotes. For "
22434 #: ../fish/guestfish.pod:499
22437 " add \"file with a space.img\"\n"
22443 #: ../fish/guestfish.pod:501
22446 " rm '/file name'\n"
22452 #: ../fish/guestfish.pod:503
22461 #: ../fish/guestfish.pod:505
22463 "A few commands require a list of strings to be passed. For these, use a "
22464 "whitespace-separated list, enclosed in quotes. Strings containing "
22465 "whitespace to be passed through must be enclosed in single quotes. A "
22466 "literal single quote must be escaped with a backslash."
22471 #: ../fish/guestfish.pod:510
22474 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
22475 " command \"/bin/echo 'foo bar'\"\n"
22476 " command \"/bin/echo \\'foo\\'\"\n"
22482 #: ../fish/guestfish.pod:514
22483 msgid "OPTIONAL ARGUMENTS"
22488 #: ../fish/guestfish.pod:516
22490 "Some commands take optional arguments. These arguments appear in this "
22491 "documentation as C<[argname:..]>. You can use them as in these examples:"
22496 #: ../fish/guestfish.pod:520
22499 " add-drive-opts filename\n"
22505 #: ../fish/guestfish.pod:522
22508 " add-drive-opts filename readonly:true\n"
22514 #: ../fish/guestfish.pod:524
22517 " add-drive-opts filename format:qcow2 readonly:false\n"
22523 #: ../fish/guestfish.pod:526
22525 "Each optional argument can appear at most once. All optional arguments must "
22526 "appear after the required ones."
22531 #: ../fish/guestfish.pod:529
22537 #: ../fish/guestfish.pod:531
22539 "This section applies to all commands which can take integers as parameters."
22544 #: ../fish/guestfish.pod:534
22545 msgid "SIZE SUFFIX"
22550 #: ../fish/guestfish.pod:536
22552 "When the command takes a parameter measured in bytes, you can use one of the "
22553 "following suffixes to specify kilobytes, megabytes and larger sizes:"
22558 #: ../fish/guestfish.pod:542
22559 msgid "B<k> or B<K> or B<KiB>"
22564 #: ../fish/guestfish.pod:544
22565 msgid "The size in kilobytes (multiplied by 1024)."
22570 #: ../fish/guestfish.pod:546
22576 #: ../fish/guestfish.pod:548
22577 msgid "The size in SI 1000 byte units."
22582 #: ../fish/guestfish.pod:550
22583 msgid "B<M> or B<MiB>"
22588 #: ../fish/guestfish.pod:552
22589 msgid "The size in megabytes (multiplied by 1048576)."
22594 #: ../fish/guestfish.pod:554
22600 #: ../fish/guestfish.pod:556
22601 msgid "The size in SI 1000000 byte units."
22606 #: ../fish/guestfish.pod:558
22607 msgid "B<G> or B<GiB>"
22612 #: ../fish/guestfish.pod:560
22613 msgid "The size in gigabytes (multiplied by 2**30)."
22618 #: ../fish/guestfish.pod:562
22624 #: ../fish/guestfish.pod:564
22625 msgid "The size in SI 10**9 byte units."
22630 #: ../fish/guestfish.pod:566
22631 msgid "B<T> or B<TiB>"
22636 #: ../fish/guestfish.pod:568
22637 msgid "The size in terabytes (multiplied by 2**40)."
22642 #: ../fish/guestfish.pod:570
22648 #: ../fish/guestfish.pod:572
22649 msgid "The size in SI 10**12 byte units."
22654 #: ../fish/guestfish.pod:574
22655 msgid "B<P> or B<PiB>"
22660 #: ../fish/guestfish.pod:576
22661 msgid "The size in petabytes (multiplied by 2**50)."
22666 #: ../fish/guestfish.pod:578
22672 #: ../fish/guestfish.pod:580
22673 msgid "The size in SI 10**15 byte units."
22678 #: ../fish/guestfish.pod:582
22679 msgid "B<E> or B<EiB>"
22684 #: ../fish/guestfish.pod:584
22685 msgid "The size in exabytes (multiplied by 2**60)."
22690 #: ../fish/guestfish.pod:586
22696 #: ../fish/guestfish.pod:588
22697 msgid "The size in SI 10**18 byte units."
22702 #: ../fish/guestfish.pod:590
22703 msgid "B<Z> or B<ZiB>"
22708 #: ../fish/guestfish.pod:592
22709 msgid "The size in zettabytes (multiplied by 2**70)."
22714 #: ../fish/guestfish.pod:594
22720 #: ../fish/guestfish.pod:596
22721 msgid "The size in SI 10**21 byte units."
22726 #: ../fish/guestfish.pod:598
22727 msgid "B<Y> or B<YiB>"
22732 #: ../fish/guestfish.pod:600
22733 msgid "The size in yottabytes (multiplied by 2**80)."
22738 #: ../fish/guestfish.pod:602
22744 #: ../fish/guestfish.pod:604
22745 msgid "The size in SI 10**24 byte units."
22750 #: ../fish/guestfish.pod:610
22753 " truncate-size /file 1G\n"
22759 #: ../fish/guestfish.pod:612
22760 msgid "would truncate the file to 1 gigabyte."
22765 #: ../fish/guestfish.pod:614
22767 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
22768 "the parameter to L</memsize> is specified in megabytes already). Adding a "
22769 "suffix will probably not do what you expect."
22774 #: ../fish/guestfish.pod:618
22775 msgid "OCTAL AND HEXADECIMAL NUMBERS"
22780 #: ../fish/guestfish.pod:620
22782 "For specifying the radix (base) use the C convention: C<0> to prefix an "
22783 "octal number or C<0x> to prefix a hexadecimal number. For example:"
22788 #: ../fish/guestfish.pod:623
22791 " 1234 decimal number 1234\n"
22792 " 02322 octal number, equivalent to decimal 1234\n"
22793 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
22799 #: ../fish/guestfish.pod:627
22801 "When using the C<chmod> command, you almost always want to specify an octal "
22802 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
22803 "L<chmod(1)> program):"
22808 #: ../fish/guestfish.pod:631
22811 " chmod 0777 /public # OK\n"
22812 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
22818 #: ../fish/guestfish.pod:634
22820 "Commands that return numbers usually print them in decimal, but some "
22821 "commands print numbers in other radices (eg. C<umask> prints the mode in "
22822 "octal, preceeded by C<0>)."
22827 #: ../fish/guestfish.pod:638
22828 msgid "WILDCARDS AND GLOBBING"
22833 #: ../fish/guestfish.pod:640
22835 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
22836 "(globbing) by default. So for example the following will not do what you "
22842 #: ../fish/guestfish.pod:644
22851 #: ../fish/guestfish.pod:646
22853 "Assuming you don't have a directory called literally C</home/*> then the "
22854 "above command will return an error."
22859 #: ../fish/guestfish.pod:649
22860 msgid "To perform wildcard expansion, use the C<glob> command."
22865 #: ../fish/guestfish.pod:651
22868 " glob rm-rf /home/*\n"
22874 #: ../fish/guestfish.pod:653
22876 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
22877 "many times), equivalent to:"
22882 #: ../fish/guestfish.pod:656
22885 " rm-rf /home/jim\n"
22886 " rm-rf /home/joe\n"
22887 " rm-rf /home/mary\n"
22893 #: ../fish/guestfish.pod:660
22894 msgid "C<glob> only works on simple guest paths and not on device names."
22899 #: ../fish/guestfish.pod:662
22901 "If you have several parameters, each containing a wildcard, then glob will "
22902 "perform a Cartesian product."
22907 #: ../fish/guestfish.pod:665
22913 #: ../fish/guestfish.pod:667
22915 "Any line which starts with a I<#> character is treated as a comment and "
22916 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
22917 "a command. For example:"
22922 #: ../fish/guestfish.pod:671
22925 " # this is a comment\n"
22926 " # this is a comment\n"
22927 " foo # NOT a comment\n"
22933 #: ../fish/guestfish.pod:675
22934 msgid "Blank lines are also ignored."
22939 #: ../fish/guestfish.pod:677
22940 msgid "RUNNING COMMANDS LOCALLY"
22945 #: ../fish/guestfish.pod:679
22947 "Any line which starts with a I<!> character is treated as a command sent to "
22948 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
22953 #: ../fish/guestfish.pod:683
22957 " tgz-out /remote local/remote-data.tar.gz\n"
22963 #: ../fish/guestfish.pod:686
22965 "will create a directory C<local> on the host, and then export the contents "
22966 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
22967 "(See C<tgz-out>)."
22972 #: ../fish/guestfish.pod:690
22974 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
22975 "effect, due to the way that subprocesses work in Unix."
22979 #: ../fish/guestfish.pod:693
22980 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
22984 #: ../fish/guestfish.pod:695
22986 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
22987 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
22988 "and executed as guestfish commands."
22992 #: ../fish/guestfish.pod:699
22994 "Thus you can use shell script to construct arbitrary guestfish commands "
22995 "which are then parsed by guestfish."
22999 #: ../fish/guestfish.pod:702
23001 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
23002 "through C</foo.100>) using guestfish commands alone. However this is simple "
23003 "if we use a shell script to create the guestfish commands for us:"
23007 #: ../fish/guestfish.pod:707
23010 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
23015 #: ../fish/guestfish.pod:709
23016 msgid "or with names like C</foo.001>:"
23020 #: ../fish/guestfish.pod:711
23023 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
23028 #: ../fish/guestfish.pod:713
23030 "When using guestfish interactively it can be helpful to just run the shell "
23031 "script first (ie. remove the initial C<E<lt>> character so it is just an "
23032 "ordinary I<!> local command), see what guestfish commands it would run, and "
23033 "when you are happy with those prepend the C<E<lt>> character to run the "
23034 "guestfish commands for real."
23039 #: ../fish/guestfish.pod:719
23045 #: ../fish/guestfish.pod:721
23047 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
23048 "command (a guestfish command) to the second command (any host command). For "
23054 #: ../fish/guestfish.pod:725
23057 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
23063 #: ../fish/guestfish.pod:727
23065 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
23066 "program). The above command would list all accounts in the guest filesystem "
23067 "which have UID 0, ie. root accounts including backdoors. Other examples:"
23072 #: ../fish/guestfish.pod:732
23075 " hexdump /bin/ls | head\n"
23076 " list-devices | tail -1\n"
23077 " tgz-out / - | tar ztf -\n"
23083 #: ../fish/guestfish.pod:736
23085 "The space before the pipe symbol is required, any space after the pipe "
23086 "symbol is optional. Everything after the pipe symbol is just passed "
23087 "straight to the host shell, so it can contain redirections, globs and "
23088 "anything else that makes sense on the host side."
23093 #: ../fish/guestfish.pod:741
23095 "To use a literal argument which begins with a pipe symbol, you have to quote "
23101 #: ../fish/guestfish.pod:744
23110 #: ../fish/guestfish.pod:746
23111 msgid "HOME DIRECTORIES"
23116 #: ../fish/guestfish.pod:748
23118 "If a parameter starts with the character C<~> then the tilde may be expanded "
23119 "as a home directory path (either C<~> for the current user's home directory, "
23120 "or C<~user> for another user)."
23125 #: ../fish/guestfish.pod:752
23127 "Note that home directory expansion happens for users known I<on the host>, "
23128 "not in the guest filesystem."
23133 #: ../fish/guestfish.pod:755
23135 "To use a literal argument which begins with a tilde, you have to quote it, "
23141 #: ../fish/guestfish.pod:758
23150 #: ../fish/guestfish.pod:762
23152 "Libguestfs has some support for Linux guests encrypted according to the "
23153 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
23154 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
23155 "LUKS is supported."
23160 #: ../fish/guestfish.pod:767
23161 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
23166 #: ../fish/guestfish.pod:769
23169 " ><fs> vfs-type /dev/sda2\n"
23176 #: ../fish/guestfish.pod:772
23178 "Then open those devices using L</luks-open>. This creates a device-mapper "
23179 "device called C</dev/mapper/luksdev>."
23184 #: ../fish/guestfish.pod:775
23187 " ><fs> luks-open /dev/sda2 luksdev\n"
23188 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
23194 #: ../fish/guestfish.pod:778
23196 "Finally you have to tell LVM to scan for volume groups on the newly created "
23202 #: ../fish/guestfish.pod:781
23206 " vg-activate-all true\n"
23212 #: ../fish/guestfish.pod:784
23213 msgid "The logical volume(s) can now be mounted in the usual way."
23218 #: ../fish/guestfish.pod:786
23220 "Before closing a LUKS device you must unmount any logical volumes on it and "
23221 "deactivate the volume groups by calling C<vg-activate false VG> on each "
23222 "one. Then you can close the mapper device:"
23227 #: ../fish/guestfish.pod:790
23230 " vg-activate false /dev/VG\n"
23231 " luks-close /dev/mapper/luksdev\n"
23237 #: ../fish/guestfish.pod:793
23238 msgid "WINDOWS PATHS"
23243 #: ../fish/guestfish.pod:795
23245 "If a path is prefixed with C<win:> then you can use Windows-style paths "
23246 "(with some limitations). The following commands are equivalent:"
23251 #: ../fish/guestfish.pod:798
23254 " file /WINDOWS/system32/config/system.LOG\n"
23260 #: ../fish/guestfish.pod:800
23263 " file win:/windows/system32/config/system.log\n"
23269 #: ../fish/guestfish.pod:802
23272 " file win:\\windows\\system32\\config\\system.log\n"
23278 #: ../fish/guestfish.pod:804
23281 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
23287 #: ../fish/guestfish.pod:806
23289 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
23290 "handles case insensitivity like Windows would. This only works in argument "
23291 "positions that expect a path."
23296 #: ../fish/guestfish.pod:810
23297 msgid "UPLOADING AND DOWNLOADING FILES"
23302 #: ../fish/guestfish.pod:812
23304 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
23305 "others which upload from or download to a local file, you can use the "
23306 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
23311 #: ../fish/guestfish.pod:816
23320 #: ../fish/guestfish.pod:818
23322 "reads stdin and creates from that a file C</foo> in the disk image, and:"
23327 #: ../fish/guestfish.pod:821
23330 " tar-out /etc - | tar tf -\n"
23336 #: ../fish/guestfish.pod:823
23338 "writes the tarball to stdout and then pipes that into the external \"tar\" "
23339 "command (see L</PIPES>)."
23344 #: ../fish/guestfish.pod:826
23346 "When using C<-> to read from stdin, the input is read up to the end of "
23347 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
23348 "some arbitrary end marker:"
23353 #: ../fish/guestfish.pod:830
23356 " upload -<<END /foo\n"
23366 #: ../fish/guestfish.pod:836
23368 "Any string of characters can be used instead of C<END>. The end marker must "
23369 "appear on a line of its own, without any preceeding or following characters "
23370 "(not even spaces)."
23375 #: ../fish/guestfish.pod:840
23377 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
23378 "upload local files (so-called \"FileIn\" parameters in the generator)."
23383 #: ../fish/guestfish.pod:843
23384 msgid "EXIT ON ERROR BEHAVIOUR"
23389 #: ../fish/guestfish.pod:845
23391 "By default, guestfish will ignore any errors when in interactive mode (ie. "
23392 "taking commands from a human over a tty), and will exit on the first error "
23393 "in non-interactive mode (scripts, commands given on the command line)."
23398 #: ../fish/guestfish.pod:850
23400 "If you prefix a command with a I<-> character, then that command will not "
23401 "cause guestfish to exit, even if that (one) command returns an error."
23406 #: ../fish/guestfish.pod:854
23407 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
23412 #: ../fish/guestfish.pod:856
23414 "Guestfish can be remote-controlled over a socket. This is useful "
23415 "particularly in shell scripts where you want to make several different "
23416 "changes to a filesystem, but you don't want the overhead of starting up a "
23417 "guestfish process each time."
23422 #: ../fish/guestfish.pod:861
23423 msgid "Start a guestfish server process using:"
23428 #: ../fish/guestfish.pod:863
23431 " eval \"`guestfish --listen`\"\n"
23437 #: ../fish/guestfish.pod:865
23438 msgid "and then send it commands by doing:"
23443 #: ../fish/guestfish.pod:867
23446 " guestfish --remote cmd [...]\n"
23452 #: ../fish/guestfish.pod:869
23453 msgid "To cause the server to exit, send it the exit command:"
23458 #: ../fish/guestfish.pod:871
23461 " guestfish --remote exit\n"
23467 #: ../fish/guestfish.pod:873
23469 "Note that the server will normally exit if there is an error in a command. "
23470 "You can change this in the usual way. See section L</EXIT ON ERROR "
23476 #: ../fish/guestfish.pod:877
23477 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
23482 #: ../fish/guestfish.pod:879
23484 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
23485 "is how the I<--remote> option knows where to send the commands. You can "
23486 "have several guestfish listener processes running using:"
23491 #: ../fish/guestfish.pod:883
23494 " eval \"`guestfish --listen`\"\n"
23495 " pid1=$GUESTFISH_PID\n"
23496 " eval \"`guestfish --listen`\"\n"
23497 " pid2=$GUESTFISH_PID\n"
23499 " guestfish --remote=$pid1 cmd\n"
23500 " guestfish --remote=$pid2 cmd\n"
23506 #: ../fish/guestfish.pod:891
23507 msgid "REMOTE CONTROL AND CSH"
23512 #: ../fish/guestfish.pod:893
23514 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
23520 #: ../fish/guestfish.pod:896
23523 " eval \"`guestfish --listen --csh`\"\n"
23529 #: ../fish/guestfish.pod:898
23530 msgid "REMOTE CONTROL DETAILS"
23535 #: ../fish/guestfish.pod:900
23537 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
23538 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
23539 "and C<$PID> is the process ID of the server."
23544 #: ../fish/guestfish.pod:904
23545 msgid "Guestfish client and server versions must match exactly."
23550 #: ../fish/guestfish.pod:906
23551 msgid "PREPARED DISK IMAGES"
23556 #: ../fish/guestfish.pod:908
23558 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
23559 "preformatted disk images that guestfish can make for you to save typing. "
23560 "This is particularly useful for testing purposes. This option is used "
23561 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
23562 "can be mixed with I<-a>)."
23567 #: ../fish/guestfish.pod:914
23569 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
23570 "the second and so on. Existing files in the current directory are "
23576 #: ../fish/guestfish.pod:918
23578 "The type briefly describes how the disk should be sized, partitioned, how "
23579 "filesystem(s) should be created, and how content should be added. "
23580 "Optionally the type can be followed by extra parameters, separated by C<:> "
23581 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
23582 "allocated disk, containing a single partition, with the partition formatted "
23583 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
23589 #: ../fish/guestfish.pod:926
23590 msgid "To list the available types and any extra parameters they take, run:"
23595 #: ../fish/guestfish.pod:930
23597 "Note that the prepared filesystem is not mounted. You would usually have to "
23598 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
23603 #: ../fish/guestfish.pod:934
23605 "If any I<-N> or I<--new> options are given, the guest is automatically "
23611 #: ../fish/guestfish.pod:939
23612 msgid "Create a 100MB disk with an ext4-formatted partition:"
23617 #: ../fish/guestfish.pod:941
23620 " guestfish -N fs:ext4\n"
23626 #: ../fish/guestfish.pod:943
23627 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
23632 #: ../fish/guestfish.pod:945
23635 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
23641 #: ../fish/guestfish.pod:947
23642 msgid "Create a blank 200MB disk:"
23647 #: ../fish/guestfish.pod:949
23650 " guestfish -N disk:200M\n"
23656 #: ../fish/guestfish.pod:951
23657 msgid "PROGRESS BARS"
23662 #: ../fish/guestfish.pod:953
23664 "Some (not all) long-running commands send progress notification messages as "
23665 "they are running. Guestfish turns these messages into progress bars."
23670 #: ../fish/guestfish.pod:957
23672 "When a command that supports progress bars takes longer than two seconds to "
23673 "run, and if progress bars are enabled, then you will see one appearing below "
23679 #: ../fish/guestfish.pod:961
23682 " ><fs> copy-size /large-file /another-file 2048M\n"
23683 " / 10% [#####-----------------------------------------] 00:30\n"
23689 #: ../fish/guestfish.pod:964
23691 "The spinner on the left hand side moves round once for every progress "
23692 "notification received from the backend. This is a (reasonably) golden "
23693 "assurance that the command is \"doing something\" even if the progress bar "
23694 "is not moving, because the command is able to send the progress "
23695 "notifications. When the bar reaches 100% and the command finishes, the "
23696 "spinner disappears."
23701 #: ../fish/guestfish.pod:971
23703 "Progress bars are enabled by default when guestfish is used interactively. "
23704 "You can enable them even for non-interactive modes using I<--progress-bars>, "
23705 "and you can disable them completely using I<--no-progress-bars>."
23710 #: ../fish/guestfish.pod:976
23711 msgid "GUESTFISH COMMANDS"
23716 #: ../fish/guestfish.pod:978
23718 "The commands in this section are guestfish convenience commands, in other "
23719 "words, they are not part of the L<guestfs(3)> API."
23724 #: ../fish/guestfish.pod:981
23730 #: ../fish/guestfish.pod:983
23740 #: ../fish/guestfish.pod:986
23741 msgid "Without any parameter, this provides general help."
23746 #: ../fish/guestfish.pod:988
23747 msgid "With a C<cmd> parameter, this displays detailed help for that command."
23752 #: ../fish/guestfish.pod:990
23753 msgid "quit | exit"
23758 #: ../fish/guestfish.pod:992
23759 msgid "This exits guestfish. You can also use C<^D> key."
23764 #: ../fish/guestfish.pod:994
23765 msgid "@FISH_COMMANDS@"
23770 #: ../fish/guestfish.pod:996
23776 #: ../fish/guestfish.pod:1000 ../test-tool/libguestfs-test-tool.pod:83
23782 #: ../fish/guestfish.pod:1002
23784 "guestfish returns 0 if the commands completed without error, or 1 if there "
23790 #: ../fish/guestfish.pod:1009
23796 #: ../fish/guestfish.pod:1011
23798 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
23804 #: ../fish/guestfish.pod:1014
23805 msgid "GUESTFISH_PID"
23810 #: ../fish/guestfish.pod:1016
23812 "Used with the I<--remote> option to specify the remote guestfish process to "
23813 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
23818 #: ../fish/guestfish.pod:1020
23824 #: ../fish/guestfish.pod:1022
23826 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
23827 "not specified, the external L<hexedit(1)> program is used."
23832 #: ../fish/guestfish.pod:1026
23838 #: ../fish/guestfish.pod:1028
23840 "If compiled with GNU readline support, various files in the home directory "
23841 "can be used. See L</FILES>."
23846 #: ../fish/guestfish.pod:1037
23848 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
23849 "effect as using the B<-v> option."
23854 #: ../fish/guestfish.pod:1049
23856 "Set the path that guestfish uses to search for kernel and initrd.img. See "
23857 "the discussion of paths in L<guestfs(3)>."
23862 #: ../fish/guestfish.pod:1060
23863 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
23868 #: ../fish/guestfish.pod:1062
23874 #: ../fish/guestfish.pod:1064
23876 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
23882 #: ../fish/guestfish.pod:1080 ../test-tool/libguestfs-test-tool.pod:88
23888 #: ../fish/guestfish.pod:1084
23889 msgid "$HOME/.guestfish"
23894 #: ../fish/guestfish.pod:1086
23896 "If compiled with GNU readline support, then the command history is saved in "
23902 #: ../fish/guestfish.pod:1089
23903 msgid "$HOME/.inputrc"
23908 #: ../fish/guestfish.pod:1091
23909 msgid "/etc/inputrc"
23914 #: ../fish/guestfish.pod:1093
23916 "If compiled with GNU readline support, then these files can be used to "
23917 "configure readline. For further information, please see L<readline(3)/"
23918 "INITIALIZATION FILE>."
23923 #: ../fish/guestfish.pod:1097
23924 msgid "To write rules which only apply to guestfish, use:"
23929 #: ../fish/guestfish.pod:1099
23940 #: ../fish/guestfish.pod:1103
23942 "Variables that you can set in inputrc that change the behaviour of guestfish "
23943 "in useful ways include:"
23948 #: ../fish/guestfish.pod:1108
23949 msgid "completion-ignore-case (default: on)"
23954 #: ../fish/guestfish.pod:1110
23956 "By default, guestfish will ignore case when tab-completing paths on the "
23962 #: ../fish/guestfish.pod:1113
23965 " set completion-ignore-case off\n"
23971 #: ../fish/guestfish.pod:1115
23972 msgid "to make guestfish case sensitive."
23977 #: ../fish/guestfish.pod:1119
23983 #: ../fish/guestfish.pod:1121
23984 msgid "test2.img (etc)"
23989 #: ../fish/guestfish.pod:1123
23991 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
23992 "will be created in the file C<test1.img> in the current directory. The "
23993 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
23994 "the same name will be overwritten."
23998 #: ../fish/guestfish.pod:1132
24000 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-copy-in(1)"
24001 ">, L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)"
24002 ">, L<virt-inspector(1)>, L<virt-list-filesystems(1)>, L<virt-list-partitions"
24003 "(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)"
24004 ">, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<virt-win-reg(1)"
24005 ">, L<hexedit(1)>."
24010 #: ../fish/guestfish.pod:1162 ../test-tool/libguestfs-test-tool.pod:124
24011 #: ../fuse/guestmount.pod:270 ../tools/virt-edit.pl:372
24012 #: ../tools/virt-win-reg.pl:606 ../tools/virt-resize.pl:1518
24013 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:309
24014 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:277
24016 "This program is free software; you can redistribute it and/or modify it "
24017 "under the terms of the GNU General Public License as published by the Free "
24018 "Software Foundation; either version 2 of the License, or (at your option) "
24019 "any later version."
24024 #: ../fish/guestfish.pod:1167 ../test-tool/libguestfs-test-tool.pod:129
24025 #: ../fuse/guestmount.pod:275 ../tools/virt-edit.pl:377
24026 #: ../tools/virt-win-reg.pl:611 ../tools/virt-resize.pl:1523
24027 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:314
24028 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:282
24030 "This program is distributed in the hope that it will be useful, but WITHOUT "
24031 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
24032 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
24038 #: ../fish/guestfish.pod:1172 ../test-tool/libguestfs-test-tool.pod:134
24039 #: ../fuse/guestmount.pod:280 ../tools/virt-edit.pl:382
24040 #: ../tools/virt-win-reg.pl:616 ../tools/virt-resize.pl:1528
24041 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:319
24042 #: ../tools/virt-make-fs.pl:582 ../tools/virt-list-partitions.pl:287
24044 "You should have received a copy of the GNU General Public License along with "
24045 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
24046 "Ave, Cambridge, MA 02139, USA."
24051 #: ../fish/guestfish-actions.pod:1
24057 #: ../fish/guestfish-actions.pod:3
24060 " add-cdrom filename\n"
24066 #: ../fish/guestfish-actions.pod:15
24068 "This call checks for the existence of C<filename>. This stops you from "
24069 "specifying other types of drive which are supported by qemu such as C<nbd:> "
24070 "and C<http:> URLs. To specify those, use the general L</config> call "
24076 #: ../fish/guestfish-actions.pod:22
24078 "If you just want to add an ISO file (often you use this as an efficient way "
24079 "to transfer large files into the guest), then you should probably use L</add-"
24080 "drive-ro> instead."
24085 #: ../fish/guestfish-actions.pod:35
24091 #: ../fish/guestfish-actions.pod:37
24096 #: ../fish/guestfish-actions.pod:39
24099 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..]\n"
24105 #: ../fish/guestfish-actions.pod:41
24107 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
24108 "It works by connecting to libvirt, requesting the domain and domain XML from "
24109 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
24114 #: ../fish/guestfish-actions.pod:71
24116 "The other optional parameters are passed directly through to L</add-drive-"
24122 #: ../fish/guestfish-actions.pod:74 ../fish/guestfish-actions.pod:138
24123 #: ../fish/guestfish-actions.pod:2981
24125 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
24130 #: ../fish/guestfish-actions.pod:76
24136 #: ../fish/guestfish-actions.pod:78
24139 " add-drive filename\n"
24145 #: ../fish/guestfish-actions.pod:80
24147 "This function is the equivalent of calling L</add-drive-opts> with no "
24148 "optional parameters, so the disk is added writable, with the format being "
24149 "detected automatically."
24154 #: ../fish/guestfish-actions.pod:84
24156 "Automatic detection of the format opens you up to a potential security hole "
24157 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24158 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24159 "you should think about replacing calls to this function with calls to L</add-"
24160 "drive-opts>, and specifying the format."
24165 #: ../fish/guestfish-actions.pod:91
24166 msgid "add-drive-opts"
24171 #: ../fish/guestfish-actions.pod:93
24177 #: ../fish/guestfish-actions.pod:95
24180 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
24186 #: ../fish/guestfish-actions.pod:122
24188 "This forces the image format. If you omit this (or use L</add-drive> or L</"
24189 "add-drive-ro>) then the format is automatically detected. Possible formats "
24190 "include C<raw> and C<qcow2>."
24195 #: ../fish/guestfish-actions.pod:133
24197 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
24198 "add-drive-with-if> call (q.v.)"
24203 #: ../fish/guestfish-actions.pod:140
24204 msgid "add-drive-ro"
24209 #: ../fish/guestfish-actions.pod:142
24215 #: ../fish/guestfish-actions.pod:144
24218 " add-drive-ro filename\n"
24224 #: ../fish/guestfish-actions.pod:146
24226 "This function is the equivalent of calling L</add-drive-opts> with the "
24227 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
24228 "is added read-only, with the format being detected automatically."
24233 #: ../fish/guestfish-actions.pod:151
24234 msgid "add-drive-ro-with-if"
24239 #: ../fish/guestfish-actions.pod:153
24242 " add-drive-ro-with-if filename iface\n"
24248 #: ../fish/guestfish-actions.pod:155
24250 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
24251 "interface emulation to use at run time."
24256 #: ../fish/guestfish-actions.pod:165
24257 msgid "add-drive-with-if"
24262 #: ../fish/guestfish-actions.pod:167
24265 " add-drive-with-if filename iface\n"
24271 #: ../fish/guestfish-actions.pod:169
24273 "This is the same as L</add-drive> but it allows you to specify the QEMU "
24274 "interface emulation to use at run time."
24279 #: ../fish/guestfish-actions.pod:179
24285 #: ../fish/guestfish-actions.pod:181
24288 " aug-clear augpath\n"
24294 #: ../fish/guestfish-actions.pod:186
24300 #: ../fish/guestfish-actions.pod:188
24309 #: ../fish/guestfish-actions.pod:190
24311 "Close the current Augeas handle and free up any resources used by it. After "
24312 "calling this, you have to call L</aug-init> again before you can use any "
24313 "other Augeas functions."
24318 #: ../fish/guestfish-actions.pod:195
24319 msgid "aug-defnode"
24324 #: ../fish/guestfish-actions.pod:197
24327 " aug-defnode name expr val\n"
24333 #: ../fish/guestfish-actions.pod:202
24335 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24336 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
24337 "containing that single node."
24342 #: ../fish/guestfish-actions.pod:210
24348 #: ../fish/guestfish-actions.pod:212
24351 " aug-defvar name expr\n"
24357 #: ../fish/guestfish-actions.pod:221
24363 #: ../fish/guestfish-actions.pod:223
24366 " aug-get augpath\n"
24372 #: ../fish/guestfish-actions.pod:228
24378 #: ../fish/guestfish-actions.pod:230
24381 " aug-init root flags\n"
24387 #: ../fish/guestfish-actions.pod:236
24388 msgid "You must call this before using any other L</aug-*> commands."
24393 #: ../fish/guestfish-actions.pod:271
24394 msgid "Do not load the tree in L</aug-init>."
24399 #: ../fish/guestfish-actions.pod:275
24400 msgid "To close the handle, you can call L</aug-close>."
24405 #: ../fish/guestfish-actions.pod:279
24411 #: ../fish/guestfish-actions.pod:281
24414 " aug-insert augpath label true|false\n"
24420 #: ../fish/guestfish-actions.pod:291
24426 #: ../fish/guestfish-actions.pod:293
24435 #: ../fish/guestfish-actions.pod:300
24441 #: ../fish/guestfish-actions.pod:302
24444 " aug-ls augpath\n"
24450 #: ../fish/guestfish-actions.pod:304
24452 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
24453 "resulting nodes into alphabetical order."
24458 #: ../fish/guestfish-actions.pod:307
24464 #: ../fish/guestfish-actions.pod:309
24467 " aug-match augpath\n"
24473 #: ../fish/guestfish-actions.pod:315
24479 #: ../fish/guestfish-actions.pod:317
24482 " aug-mv src dest\n"
24488 #: ../fish/guestfish-actions.pod:322
24494 #: ../fish/guestfish-actions.pod:324
24497 " aug-rm augpath\n"
24503 #: ../fish/guestfish-actions.pod:330
24509 #: ../fish/guestfish-actions.pod:332
24518 #: ../fish/guestfish-actions.pod:336
24520 "The flags which were passed to L</aug-init> affect exactly how files are "
24526 #: ../fish/guestfish-actions.pod:339
24532 #: ../fish/guestfish-actions.pod:341
24535 " aug-set augpath val\n"
24541 #: ../fish/guestfish-actions.pod:345
24543 "In the Augeas API, it is possible to clear a node by setting the value to "
24544 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24545 "this call. Instead you must use the L</aug-clear> call."
24550 #: ../fish/guestfish-actions.pod:350
24556 #: ../fish/guestfish-actions.pod:352
24559 " available 'groups ...'\n"
24565 #: ../fish/guestfish-actions.pod:358
24567 "The libguestfs groups, and the functions that those groups correspond to, "
24568 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24569 "runtime by calling L</available-all-groups>."
24574 #: ../fish/guestfish-actions.pod:382
24575 msgid "You must call L</launch> before calling this function."
24580 #: ../fish/guestfish-actions.pod:404
24582 "This call was added in version C<1.0.80>. In previous versions of "
24583 "libguestfs all you could do would be to speculatively execute a command to "
24584 "find out if the daemon implemented it. See also L</version>."
24589 #: ../fish/guestfish-actions.pod:411
24590 msgid "available-all-groups"
24595 #: ../fish/guestfish-actions.pod:413
24598 " available-all-groups\n"
24604 #: ../fish/guestfish-actions.pod:415
24606 "This command returns a list of all optional groups that this daemon knows "
24607 "about. Note this returns both supported and unsupported groups. To find "
24608 "out which ones the daemon can actually support you have to call L</"
24609 "available> on each member of the returned list."
24614 #: ../fish/guestfish-actions.pod:421
24615 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
24620 #: ../fish/guestfish-actions.pod:423
24626 #: ../fish/guestfish-actions.pod:425
24629 " base64-in (base64file|-) filename\n"
24635 #: ../fish/guestfish-actions.pod:430 ../fish/guestfish-actions.pod:439
24636 #: ../fish/guestfish-actions.pod:663 ../fish/guestfish-actions.pod:832
24637 #: ../fish/guestfish-actions.pod:851 ../fish/guestfish-actions.pod:1228
24638 #: ../fish/guestfish-actions.pod:4379 ../fish/guestfish-actions.pod:4391
24639 #: ../fish/guestfish-actions.pod:4402 ../fish/guestfish-actions.pod:4413
24640 #: ../fish/guestfish-actions.pod:4465 ../fish/guestfish-actions.pod:4474
24641 #: ../fish/guestfish-actions.pod:4528 ../fish/guestfish-actions.pod:4551
24642 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
24647 #: ../fish/guestfish-actions.pod:432
24653 #: ../fish/guestfish-actions.pod:434
24656 " base64-out filename (base64file|-)\n"
24662 #: ../fish/guestfish-actions.pod:441
24663 msgid "blockdev-flushbufs"
24668 #: ../fish/guestfish-actions.pod:443
24671 " blockdev-flushbufs device\n"
24677 #: ../fish/guestfish-actions.pod:450
24678 msgid "blockdev-getbsz"
24683 #: ../fish/guestfish-actions.pod:452
24686 " blockdev-getbsz device\n"
24692 #: ../fish/guestfish-actions.pod:461
24693 msgid "blockdev-getro"
24698 #: ../fish/guestfish-actions.pod:463
24701 " blockdev-getro device\n"
24707 #: ../fish/guestfish-actions.pod:470
24708 msgid "blockdev-getsize64"
24713 #: ../fish/guestfish-actions.pod:472
24716 " blockdev-getsize64 device\n"
24722 #: ../fish/guestfish-actions.pod:476
24723 msgid "See also L</blockdev-getsz>."
24728 #: ../fish/guestfish-actions.pod:480
24729 msgid "blockdev-getss"
24734 #: ../fish/guestfish-actions.pod:482
24737 " blockdev-getss device\n"
24743 #: ../fish/guestfish-actions.pod:487
24745 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
24750 #: ../fish/guestfish-actions.pod:492
24751 msgid "blockdev-getsz"
24756 #: ../fish/guestfish-actions.pod:494
24759 " blockdev-getsz device\n"
24765 #: ../fish/guestfish-actions.pod:499
24767 "See also L</blockdev-getss> for the real sector size of the device, and L</"
24768 "blockdev-getsize64> for the more useful I<size in bytes>."
24773 #: ../fish/guestfish-actions.pod:505
24774 msgid "blockdev-rereadpt"
24779 #: ../fish/guestfish-actions.pod:507
24782 " blockdev-rereadpt device\n"
24788 #: ../fish/guestfish-actions.pod:513
24789 msgid "blockdev-setbsz"
24794 #: ../fish/guestfish-actions.pod:515
24797 " blockdev-setbsz device blocksize\n"
24803 #: ../fish/guestfish-actions.pod:524
24804 msgid "blockdev-setro"
24809 #: ../fish/guestfish-actions.pod:526
24812 " blockdev-setro device\n"
24818 #: ../fish/guestfish-actions.pod:532
24819 msgid "blockdev-setrw"
24824 #: ../fish/guestfish-actions.pod:534
24827 " blockdev-setrw device\n"
24833 #: ../fish/guestfish-actions.pod:540
24834 msgid "case-sensitive-path"
24839 #: ../fish/guestfish-actions.pod:542
24842 " case-sensitive-path path\n"
24848 #: ../fish/guestfish-actions.pod:566
24850 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
24851 "WINDOWS/system32\"> (the exact return value would depend on details of how "
24852 "the directories were originally created under Windows)."
24857 #: ../fish/guestfish-actions.pod:574
24858 msgid "See also L</realpath>."
24863 #: ../fish/guestfish-actions.pod:576
24869 #: ../fish/guestfish-actions.pod:578
24878 #: ../fish/guestfish-actions.pod:582
24880 "Note that this function cannot correctly handle binary files (specifically, "
24881 "files containing C<\\0> character which is treated as end of string). For "
24882 "those you need to use the L</read-file> or L</download> functions which have "
24883 "a more complex interface."
24888 #: ../fish/guestfish-actions.pod:590
24894 #: ../fish/guestfish-actions.pod:592
24897 " checksum csumtype path\n"
24903 #: ../fish/guestfish-actions.pod:635
24904 msgid "To get the checksum for a device, use L</checksum-device>."
24909 #: ../fish/guestfish-actions.pod:637
24910 msgid "To get the checksums for many files, use L</checksums-out>."
24915 #: ../fish/guestfish-actions.pod:639
24916 msgid "checksum-device"
24921 #: ../fish/guestfish-actions.pod:641
24924 " checksum-device csumtype device\n"
24930 #: ../fish/guestfish-actions.pod:643
24932 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24933 "device named C<device>. For the types of checksums supported see the L</"
24934 "checksum> command."
24939 #: ../fish/guestfish-actions.pod:647
24940 msgid "checksums-out"
24945 #: ../fish/guestfish-actions.pod:649
24948 " checksums-out csumtype directory (sumsfile|-)\n"
24954 #: ../fish/guestfish-actions.pod:665
24960 #: ../fish/guestfish-actions.pod:667
24963 " chmod mode path\n"
24969 #: ../fish/guestfish-actions.pod:678
24975 #: ../fish/guestfish-actions.pod:680
24978 " chown owner group path\n"
24984 #: ../fish/guestfish-actions.pod:688
24990 #: ../fish/guestfish-actions.pod:690
24993 " command 'arguments ...'\n"
24999 #: ../fish/guestfish-actions.pod:697
25001 "The single parameter is an argv-style list of arguments. The first element "
25002 "is the name of the program to run. Subsequent elements are parameters. The "
25003 "list must be non-empty (ie. must contain a program name). Note that the "
25004 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
25009 #: ../fish/guestfish-actions.pod:725
25010 msgid "command-lines"
25015 #: ../fish/guestfish-actions.pod:727
25018 " command-lines 'arguments ...'\n"
25024 #: ../fish/guestfish-actions.pod:729
25026 "This is the same as L</command>, but splits the result into a list of lines."
25031 #: ../fish/guestfish-actions.pod:732
25032 msgid "See also: L</sh-lines>"
25037 #: ../fish/guestfish-actions.pod:737
25043 #: ../fish/guestfish-actions.pod:739
25046 " config qemuparam qemuvalue\n"
25052 #: ../fish/guestfish-actions.pod:750
25058 #: ../fish/guestfish-actions.pod:752
25061 " copy-size src dest size\n"
25067 #: ../fish/guestfish-actions.pod:760
25073 #: ../fish/guestfish-actions.pod:762
25082 #: ../fish/guestfish-actions.pod:767
25088 #: ../fish/guestfish-actions.pod:769
25097 #: ../fish/guestfish-actions.pod:774
25103 #: ../fish/guestfish-actions.pod:776
25112 #: ../fish/guestfish-actions.pod:783
25114 "If the destination is a device, it must be as large or larger than the "
25115 "source file or device, otherwise the copy will fail. This command cannot do "
25116 "partial copies (see L</copy-size>)."
25121 #: ../fish/guestfish-actions.pod:787
25127 #: ../fish/guestfish-actions.pod:789
25136 #: ../fish/guestfish-actions.pod:793 ../fish/guestfish-actions.pod:804
25138 "This command is mostly useful for interactive sessions. It is I<not> "
25139 "intended that you try to parse the output string. Use L</statvfs> from "
25145 #: ../fish/guestfish-actions.pod:797
25151 #: ../fish/guestfish-actions.pod:799
25160 #: ../fish/guestfish-actions.pod:808
25166 #: ../fish/guestfish-actions.pod:810
25175 #: ../fish/guestfish-actions.pod:816
25177 "Another way to get the same information is to enable verbose messages with "
25178 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
25179 "before running the program."
25184 #: ../fish/guestfish-actions.pod:821
25190 #: ../fish/guestfish-actions.pod:823
25193 " download remotefilename (filename|-)\n"
25199 #: ../fish/guestfish-actions.pod:830
25200 msgid "See also L</upload>, L</cat>."
25205 #: ../fish/guestfish-actions.pod:834
25206 msgid "download-offset"
25211 #: ../fish/guestfish-actions.pod:836
25214 " download-offset remotefilename (filename|-) offset size\n"
25220 #: ../fish/guestfish-actions.pod:844
25222 "Note that there is no limit on the amount of data that can be downloaded "
25223 "with this call, unlike with L</pread>, and this call always reads the full "
25224 "amount unless an error occurs."
25229 #: ../fish/guestfish-actions.pod:849
25230 msgid "See also L</download>, L</pread>."
25235 #: ../fish/guestfish-actions.pod:853
25236 msgid "drop-caches"
25241 #: ../fish/guestfish-actions.pod:855
25244 " drop-caches whattodrop\n"
25250 #: ../fish/guestfish-actions.pod:867
25256 #: ../fish/guestfish-actions.pod:869
25265 #: ../fish/guestfish-actions.pod:881
25271 #: ../fish/guestfish-actions.pod:883
25274 " e2fsck-f device\n"
25280 #: ../fish/guestfish-actions.pod:889
25282 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
25283 "should use L</fsck>."
25288 #: ../fish/guestfish-actions.pod:892
25289 msgid "echo-daemon"
25294 #: ../fish/guestfish-actions.pod:894
25297 " echo-daemon 'words ...'\n"
25303 #: ../fish/guestfish-actions.pod:901
25304 msgid "See also L</ping-daemon>."
25309 #: ../fish/guestfish-actions.pod:903
25315 #: ../fish/guestfish-actions.pod:905
25318 " egrep regex path\n"
25324 #: ../fish/guestfish-actions.pod:913
25330 #: ../fish/guestfish-actions.pod:915
25333 " egrepi regex path\n"
25339 #: ../fish/guestfish-actions.pod:923
25345 #: ../fish/guestfish-actions.pod:925
25348 " equal file1 file2\n"
25354 #: ../fish/guestfish-actions.pod:932
25360 #: ../fish/guestfish-actions.pod:934
25369 #: ../fish/guestfish-actions.pod:939
25370 msgid "See also L</is-file>, L</is-dir>, L</stat>."
25375 #: ../fish/guestfish-actions.pod:941
25381 #: ../fish/guestfish-actions.pod:943
25384 " fallocate path len\n"
25390 #: ../fish/guestfish-actions.pod:960
25391 msgid "fallocate64"
25396 #: ../fish/guestfish-actions.pod:962
25399 " fallocate64 path len\n"
25405 #: ../fish/guestfish-actions.pod:968
25407 "Note that this call allocates disk blocks for the file. To create a sparse "
25408 "file use L</truncate-size> instead."
25413 #: ../fish/guestfish-actions.pod:971
25415 "The deprecated call L</fallocate> does the same, but owing to an oversight "
25416 "it only allowed 30 bit lengths to be specified, effectively limiting the "
25417 "maximum size of files created through that call to 1GB."
25422 #: ../fish/guestfish-actions.pod:980
25428 #: ../fish/guestfish-actions.pod:982
25431 " fgrep pattern path\n"
25437 #: ../fish/guestfish-actions.pod:990
25443 #: ../fish/guestfish-actions.pod:992
25446 " fgrepi pattern path\n"
25452 #: ../fish/guestfish-actions.pod:1000
25458 #: ../fish/guestfish-actions.pod:1002
25467 #: ../fish/guestfish-actions.pod:1014
25469 "This command can also be used on C</dev/> devices (and partitions, LV "
25470 "names). You can for example use this to determine if a device contains a "
25471 "filesystem, although it's usually better to use L</vfs-type>."
25476 #: ../fish/guestfish-actions.pod:1024
25477 msgid "file-architecture"
25482 #: ../fish/guestfish-actions.pod:1026
25485 " file-architecture filename\n"
25491 #: ../fish/guestfish-actions.pod:1129
25497 #: ../fish/guestfish-actions.pod:1131
25506 #: ../fish/guestfish-actions.pod:1135
25508 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
25509 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
25514 #: ../fish/guestfish-actions.pod:1139
25520 #: ../fish/guestfish-actions.pod:1141
25523 " fill c len path\n"
25529 #: ../fish/guestfish-actions.pod:1147
25531 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25532 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
25533 "L</fill-pattern>."
25538 #: ../fish/guestfish-actions.pod:1152
25539 msgid "fill-pattern"
25544 #: ../fish/guestfish-actions.pod:1154
25547 " fill-pattern pattern len path\n"
25553 #: ../fish/guestfish-actions.pod:1156
25555 "This function is like L</fill> except that it creates a new file of length "
25556 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
25557 "is truncated if necessary to ensure the length of the file is exactly C<len> "
25563 #: ../fish/guestfish-actions.pod:1161
25569 #: ../fish/guestfish-actions.pod:1163
25572 " find directory\n"
25578 #: ../fish/guestfish-actions.pod:1177
25579 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
25584 #: ../fish/guestfish-actions.pod:1190
25585 msgid "See also L</find0>."
25590 #: ../fish/guestfish-actions.pod:1195
25596 #: ../fish/guestfish-actions.pod:1197
25599 " find0 directory (files|-)\n"
25605 #: ../fish/guestfish-actions.pod:1203
25607 "This command works the same way as L</find> with the following exceptions:"
25612 #: ../fish/guestfish-actions.pod:1230
25613 msgid "findfs-label"
25618 #: ../fish/guestfish-actions.pod:1232
25621 " findfs-label label\n"
25627 #: ../fish/guestfish-actions.pod:1238
25628 msgid "To find the label of a filesystem, use L</vfs-label>."
25633 #: ../fish/guestfish-actions.pod:1240
25634 msgid "findfs-uuid"
25639 #: ../fish/guestfish-actions.pod:1242
25642 " findfs-uuid uuid\n"
25648 #: ../fish/guestfish-actions.pod:1248
25649 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
25654 #: ../fish/guestfish-actions.pod:1250
25660 #: ../fish/guestfish-actions.pod:1252
25663 " fsck fstype device\n"
25669 #: ../fish/guestfish-actions.pod:1282
25675 #: ../fish/guestfish-actions.pod:1284
25683 #: ../fish/guestfish-actions.pod:1291
25684 msgid "get-attach-method"
25688 #: ../fish/guestfish-actions.pod:1293
25691 " get-attach-method\n"
25696 #: ../fish/guestfish-actions.pod:1295
25697 msgid "Return the current attach method. See L</set-attach-method>."
25702 #: ../fish/guestfish-actions.pod:1297
25703 msgid "get-autosync"
25708 #: ../fish/guestfish-actions.pod:1299
25717 #: ../fish/guestfish-actions.pod:1303
25723 #: ../fish/guestfish-actions.pod:1305
25732 #: ../fish/guestfish-actions.pod:1309
25733 msgid "get-e2label"
25738 #: ../fish/guestfish-actions.pod:1311
25741 " get-e2label device\n"
25747 #: ../fish/guestfish-actions.pod:1323
25753 #: ../fish/guestfish-actions.pod:1325
25756 " get-e2uuid device\n"
25762 #: ../fish/guestfish-actions.pod:1337
25763 msgid "get-memsize"
25768 #: ../fish/guestfish-actions.pod:1339
25777 #: ../fish/guestfish-actions.pod:1344
25779 "If L</set-memsize> was not called on this handle, and if "
25780 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25781 "value for memsize."
25786 #: ../fish/guestfish-actions.pod:1351
25787 msgid "get-network"
25792 #: ../fish/guestfish-actions.pod:1353
25801 #: ../fish/guestfish-actions.pod:1357
25807 #: ../fish/guestfish-actions.pod:1359
25816 #: ../fish/guestfish-actions.pod:1366
25822 #: ../fish/guestfish-actions.pod:1368
25828 #: ../fish/guestfish-actions.pod:1370
25837 #: ../fish/guestfish-actions.pod:1377
25843 #: ../fish/guestfish-actions.pod:1379
25852 #: ../fish/guestfish-actions.pod:1386
25853 msgid "get-recovery-proc"
25858 #: ../fish/guestfish-actions.pod:1388
25861 " get-recovery-proc\n"
25867 #: ../fish/guestfish-actions.pod:1392
25868 msgid "get-selinux"
25873 #: ../fish/guestfish-actions.pod:1394
25882 #: ../fish/guestfish-actions.pod:1396
25884 "This returns the current setting of the selinux flag which is passed to the "
25885 "appliance at boot time. See L</set-selinux>."
25890 #: ../fish/guestfish-actions.pod:1402
25896 #: ../fish/guestfish-actions.pod:1404
25905 #: ../fish/guestfish-actions.pod:1411
25911 #: ../fish/guestfish-actions.pod:1413
25920 #: ../fish/guestfish-actions.pod:1417
25926 #: ../fish/guestfish-actions.pod:1419
25935 #: ../fish/guestfish-actions.pod:1421
25937 "Return the current umask. By default the umask is C<022> unless it has been "
25938 "set by calling L</umask>."
25943 #: ../fish/guestfish-actions.pod:1424
25944 msgid "get-verbose"
25949 #: ../fish/guestfish-actions.pod:1426
25958 #: ../fish/guestfish-actions.pod:1430
25964 #: ../fish/guestfish-actions.pod:1432
25973 #: ../fish/guestfish-actions.pod:1436
25974 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
25979 #: ../fish/guestfish-actions.pod:1439
25985 #: ../fish/guestfish-actions.pod:1441
25988 " getxattr path name\n"
25994 #: ../fish/guestfish-actions.pod:1443
25996 "Get a single extended attribute from file C<path> named C<name>. This call "
25997 "follows symlinks. If you want to lookup an extended attribute for the "
25998 "symlink itself, use L</lgetxattr>."
26003 #: ../fish/guestfish-actions.pod:1447 ../fish/guestfish-actions.pod:2387
26005 "Normally it is better to get all extended attributes from a file in one go "
26006 "by calling L</getxattrs>. However some Linux filesystem implementations are "
26007 "buggy and do not provide a way to list out attributes. For these "
26008 "filesystems (notably ntfs-3g) you have to know the names of the extended "
26009 "attributes you want in advance and call this function."
26014 #: ../fish/guestfish-actions.pod:1457
26015 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
26020 #: ../fish/guestfish-actions.pod:1459
26026 #: ../fish/guestfish-actions.pod:1461
26029 " getxattrs path\n"
26035 #: ../fish/guestfish-actions.pod:1469
26036 msgid "See also: L</lgetxattrs>, L<attr(5)>."
26041 #: ../fish/guestfish-actions.pod:1471
26042 msgid "glob-expand"
26047 #: ../fish/guestfish-actions.pod:1473
26050 " glob-expand pattern\n"
26056 #: ../fish/guestfish-actions.pod:1486
26062 #: ../fish/guestfish-actions.pod:1488
26065 " grep regex path\n"
26071 #: ../fish/guestfish-actions.pod:1496
26077 #: ../fish/guestfish-actions.pod:1498
26080 " grepi regex path\n"
26086 #: ../fish/guestfish-actions.pod:1506
26087 msgid "grub-install"
26092 #: ../fish/guestfish-actions.pod:1508
26095 " grub-install root device\n"
26101 #: ../fish/guestfish-actions.pod:1524
26107 #: ../fish/guestfish-actions.pod:1526
26116 #: ../fish/guestfish-actions.pod:1534
26122 #: ../fish/guestfish-actions.pod:1536
26125 " head-n nrlines path\n"
26131 #: ../fish/guestfish-actions.pod:1549
26137 #: ../fish/guestfish-actions.pod:1551
26146 #: ../fish/guestfish-actions.pod:1559
26152 #: ../fish/guestfish-actions.pod:1561
26155 " initrd-cat initrdpath filename\n"
26161 #: ../fish/guestfish-actions.pod:1573
26162 msgid "See also L</initrd-list>."
26167 #: ../fish/guestfish-actions.pod:1578
26168 msgid "initrd-list"
26173 #: ../fish/guestfish-actions.pod:1580
26176 " initrd-list path\n"
26182 #: ../fish/guestfish-actions.pod:1592
26183 msgid "inotify-add-watch"
26188 #: ../fish/guestfish-actions.pod:1594
26191 " inotify-add-watch path mask\n"
26197 #: ../fish/guestfish-actions.pod:1606
26198 msgid "inotify-close"
26203 #: ../fish/guestfish-actions.pod:1608
26212 #: ../fish/guestfish-actions.pod:1614
26213 msgid "inotify-files"
26218 #: ../fish/guestfish-actions.pod:1616
26227 #: ../fish/guestfish-actions.pod:1618
26229 "This function is a helpful wrapper around L</inotify-read> which just "
26230 "returns a list of pathnames of objects that were touched. The returned "
26231 "pathnames are sorted and deduplicated."
26236 #: ../fish/guestfish-actions.pod:1622
26237 msgid "inotify-init"
26242 #: ../fish/guestfish-actions.pod:1624
26245 " inotify-init maxevents\n"
26251 #: ../fish/guestfish-actions.pod:1630
26253 "C<maxevents> is the maximum number of events which will be queued up between "
26254 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
26255 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
26256 "default was 16384 events. Beyond this limit, the kernel throws away events, "
26257 "but records the fact that it threw them away by setting a flag "
26258 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
26263 #: ../fish/guestfish-actions.pod:1640
26265 "Before any events are generated, you have to add some watches to the "
26266 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
26267 "L</inotify-watch-all>."
26272 #: ../fish/guestfish-actions.pod:1646
26274 "Queued up events should be read periodically by calling L</inotify-read> (or "
26275 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
26276 "If you don't read the events out often enough then you risk the internal "
26277 "queue overflowing."
26282 #: ../fish/guestfish-actions.pod:1653
26284 "The handle should be closed after use by calling L</inotify-close>. This "
26285 "also removes any watches automatically."
26290 #: ../fish/guestfish-actions.pod:1662
26291 msgid "inotify-read"
26296 #: ../fish/guestfish-actions.pod:1664
26305 #: ../fish/guestfish-actions.pod:1677
26306 msgid "inotify-rm-watch"
26311 #: ../fish/guestfish-actions.pod:1679
26314 " inotify-rm-watch wd\n"
26320 #: ../fish/guestfish-actions.pod:1681
26321 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
26326 #: ../fish/guestfish-actions.pod:1684
26327 msgid "inspect-get-arch"
26332 #: ../fish/guestfish-actions.pod:1686
26335 " inspect-get-arch root\n"
26341 #: ../fish/guestfish-actions.pod:1688 ../fish/guestfish-actions.pod:1704
26342 #: ../fish/guestfish-actions.pod:1782 ../fish/guestfish-actions.pod:1800
26343 #: ../fish/guestfish-actions.pod:1834 ../fish/guestfish-actions.pod:1849
26344 #: ../fish/guestfish-actions.pod:1870 ../fish/guestfish-actions.pod:1885
26345 #: ../fish/guestfish-actions.pod:1912 ../fish/guestfish-actions.pod:1934
26346 #: ../fish/guestfish-actions.pod:1958 ../fish/guestfish-actions.pod:1975
26347 #: ../fish/guestfish-actions.pod:2018 ../fish/guestfish-actions.pod:2053
26348 #: ../fish/guestfish-actions.pod:2069 ../fish/guestfish-actions.pod:2082
26349 #: ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2110
26351 "This function should only be called with a root device string as returned by "
26357 #: ../fish/guestfish-actions.pod:1691
26359 "This returns the architecture of the inspected operating system. The "
26360 "possible return values are listed under L</file-architecture>."
26365 #: ../fish/guestfish-actions.pod:1700
26366 msgid "inspect-get-distro"
26371 #: ../fish/guestfish-actions.pod:1702
26374 " inspect-get-distro root\n"
26380 #: ../fish/guestfish-actions.pod:1778
26381 msgid "inspect-get-filesystems"
26386 #: ../fish/guestfish-actions.pod:1780
26389 " inspect-get-filesystems root\n"
26395 #: ../fish/guestfish-actions.pod:1793
26397 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26398 "get-mountpoints>."
26402 #: ../fish/guestfish-actions.pod:1796
26403 msgid "inspect-get-format"
26407 #: ../fish/guestfish-actions.pod:1798
26410 " inspect-get-format root\n"
26416 #: ../fish/guestfish-actions.pod:1830
26417 msgid "inspect-get-hostname"
26422 #: ../fish/guestfish-actions.pod:1832
26425 " inspect-get-hostname root\n"
26431 #: ../fish/guestfish-actions.pod:1845
26432 msgid "inspect-get-major-version"
26437 #: ../fish/guestfish-actions.pod:1847
26440 " inspect-get-major-version root\n"
26446 #: ../fish/guestfish-actions.pod:1866
26447 msgid "inspect-get-minor-version"
26452 #: ../fish/guestfish-actions.pod:1868
26455 " inspect-get-minor-version root\n"
26461 #: ../fish/guestfish-actions.pod:1878
26463 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26464 "get-major-version>."
26469 #: ../fish/guestfish-actions.pod:1881
26470 msgid "inspect-get-mountpoints"
26475 #: ../fish/guestfish-actions.pod:1883
26478 " inspect-get-mountpoints root\n"
26484 #: ../fish/guestfish-actions.pod:1905
26486 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26487 "get-filesystems>."
26492 #: ../fish/guestfish-actions.pod:1908
26493 msgid "inspect-get-package-format"
26498 #: ../fish/guestfish-actions.pod:1910
26501 " inspect-get-package-format root\n"
26507 #: ../fish/guestfish-actions.pod:1915
26509 "This function and L</inspect-get-package-management> return the package "
26510 "format and package management tool used by the inspected operating system. "
26511 "For example for Fedora these functions would return C<rpm> (package format) "
26512 "and C<yum> (package management)."
26517 #: ../fish/guestfish-actions.pod:1930
26518 msgid "inspect-get-package-management"
26523 #: ../fish/guestfish-actions.pod:1932
26526 " inspect-get-package-management root\n"
26532 #: ../fish/guestfish-actions.pod:1937
26534 "L</inspect-get-package-format> and this function return the package format "
26535 "and package management tool used by the inspected operating system. For "
26536 "example for Fedora these functions would return C<rpm> (package format) and "
26537 "C<yum> (package management)."
26542 #: ../fish/guestfish-actions.pod:1954
26543 msgid "inspect-get-product-name"
26548 #: ../fish/guestfish-actions.pod:1956
26551 " inspect-get-product-name root\n"
26556 #: ../fish/guestfish-actions.pod:1971
26557 msgid "inspect-get-product-variant"
26561 #: ../fish/guestfish-actions.pod:1973
26564 " inspect-get-product-variant root\n"
26569 #: ../fish/guestfish-actions.pod:1997
26571 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
26572 "get-product-name>, L</inspect-get-major-version>."
26577 #: ../fish/guestfish-actions.pod:2001
26578 msgid "inspect-get-roots"
26583 #: ../fish/guestfish-actions.pod:2003
26586 " inspect-get-roots\n"
26592 #: ../fish/guestfish-actions.pod:2005
26594 "This function is a convenient way to get the list of root devices, as "
26595 "returned from a previous call to L</inspect-os>, but without redoing the "
26596 "whole inspection process."
26601 #: ../fish/guestfish-actions.pod:2009
26603 "This returns an empty list if either no root devices were found or the "
26604 "caller has not called L</inspect-os>."
26609 #: ../fish/guestfish-actions.pod:2014
26610 msgid "inspect-get-type"
26615 #: ../fish/guestfish-actions.pod:2016
26618 " inspect-get-type root\n"
26624 #: ../fish/guestfish-actions.pod:2049
26625 msgid "inspect-get-windows-systemroot"
26630 #: ../fish/guestfish-actions.pod:2051
26633 " inspect-get-windows-systemroot root\n"
26638 #: ../fish/guestfish-actions.pod:2065
26639 msgid "inspect-is-live"
26643 #: ../fish/guestfish-actions.pod:2067
26646 " inspect-is-live root\n"
26651 #: ../fish/guestfish-actions.pod:2072
26653 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
26654 "then this returns true if a live image was detected on the disk."
26658 #: ../fish/guestfish-actions.pod:2078
26659 msgid "inspect-is-multipart"
26663 #: ../fish/guestfish-actions.pod:2080
26666 " inspect-is-multipart root\n"
26671 #: ../fish/guestfish-actions.pod:2085
26673 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
26674 "then this returns true if the disk is part of a set."
26678 #: ../fish/guestfish-actions.pod:2091
26679 msgid "inspect-is-netinst"
26683 #: ../fish/guestfish-actions.pod:2093
26686 " inspect-is-netinst root\n"
26691 #: ../fish/guestfish-actions.pod:2098
26693 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
26694 "then this returns true if the disk is a network installer, ie. not a self-"
26695 "contained install CD but one which is likely to require network access to "
26696 "complete the install."
26701 #: ../fish/guestfish-actions.pod:2106
26702 msgid "inspect-list-applications"
26707 #: ../fish/guestfish-actions.pod:2108
26710 " inspect-list-applications root\n"
26716 #: ../fish/guestfish-actions.pod:2115
26718 "I<Note:> This call works differently from other parts of the inspection "
26719 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
26720 "then mount up the disks, before calling this. Listing applications is a "
26721 "significantly more difficult operation which requires access to the full "
26722 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
26723 "are just returning data cached in the libguestfs handle, this call actually "
26724 "reads parts of the mounted filesystems during the call."
26729 #: ../fish/guestfish-actions.pod:2205
26735 #: ../fish/guestfish-actions.pod:2207
26744 #: ../fish/guestfish-actions.pod:2222
26746 "You can pass the root string(s) returned to other L</inspect-get-*> "
26747 "functions in order to query further information about each operating system, "
26748 "such as the name and version."
26753 #: ../fish/guestfish-actions.pod:2227
26755 "This function uses other libguestfs features such as L</mount-ro> and L</"
26756 "umount-all> in order to mount and unmount filesystems and look at the "
26757 "contents. This should be called with no disks currently mounted. The "
26758 "function may also use Augeas, so any existing Augeas handle will be closed."
26763 #: ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2415
26764 #: ../fish/guestfish-actions.pod:2461
26765 msgid "See also L</list-filesystems>."
26770 #: ../fish/guestfish-actions.pod:2241
26771 msgid "is-blockdev"
26776 #: ../fish/guestfish-actions.pod:2243
26779 " is-blockdev path\n"
26785 #: ../fish/guestfish-actions.pod:2248 ../fish/guestfish-actions.pod:2266
26786 #: ../fish/guestfish-actions.pod:2285 ../fish/guestfish-actions.pod:2294
26787 #: ../fish/guestfish-actions.pod:2304 ../fish/guestfish-actions.pod:2338
26788 #: ../fish/guestfish-actions.pod:2347
26789 msgid "See also L</stat>."
26794 #: ../fish/guestfish-actions.pod:2250
26800 #: ../fish/guestfish-actions.pod:2252
26809 #: ../fish/guestfish-actions.pod:2259
26815 #: ../fish/guestfish-actions.pod:2261
26818 " is-chardev path\n"
26824 #: ../fish/guestfish-actions.pod:2268
26830 #: ../fish/guestfish-actions.pod:2270
26839 #: ../fish/guestfish-actions.pod:2277
26845 #: ../fish/guestfish-actions.pod:2279
26854 #: ../fish/guestfish-actions.pod:2287
26860 #: ../fish/guestfish-actions.pod:2289
26869 #: ../fish/guestfish-actions.pod:2296
26875 #: ../fish/guestfish-actions.pod:2298
26884 #: ../fish/guestfish-actions.pod:2306
26885 msgid "is-launching"
26890 #: ../fish/guestfish-actions.pod:2308
26899 #: ../fish/guestfish-actions.pod:2315
26905 #: ../fish/guestfish-actions.pod:2317
26914 #: ../fish/guestfish-actions.pod:2322
26920 #: ../fish/guestfish-actions.pod:2324
26929 #: ../fish/guestfish-actions.pod:2331
26935 #: ../fish/guestfish-actions.pod:2333
26938 " is-socket path\n"
26944 #: ../fish/guestfish-actions.pod:2340
26950 #: ../fish/guestfish-actions.pod:2342
26953 " is-symlink path\n"
26959 #: ../fish/guestfish-actions.pod:2349
26960 msgid "kill-subprocess"
26965 #: ../fish/guestfish-actions.pod:2351
26968 " kill-subprocess\n"
26974 #: ../fish/guestfish-actions.pod:2355
26980 #: ../fish/guestfish-actions.pod:2357
26986 #: ../fish/guestfish-actions.pod:2359
26995 #: ../fish/guestfish-actions.pod:2367
27001 #: ../fish/guestfish-actions.pod:2369
27004 " lchown owner group path\n"
27010 #: ../fish/guestfish-actions.pod:2371
27012 "Change the file owner to C<owner> and group to C<group>. This is like L</"
27013 "chown> but if C<path> is a symlink then the link itself is changed, not the "
27019 #: ../fish/guestfish-actions.pod:2379
27025 #: ../fish/guestfish-actions.pod:2381
27028 " lgetxattr path name\n"
27034 #: ../fish/guestfish-actions.pod:2397
27035 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
27040 #: ../fish/guestfish-actions.pod:2399
27046 #: ../fish/guestfish-actions.pod:2401
27049 " lgetxattrs path\n"
27055 #: ../fish/guestfish-actions.pod:2403
27057 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
27058 "it returns the extended attributes of the link itself."
27063 #: ../fish/guestfish-actions.pod:2407
27064 msgid "list-devices"
27069 #: ../fish/guestfish-actions.pod:2409
27078 #: ../fish/guestfish-actions.pod:2417
27079 msgid "list-filesystems"
27084 #: ../fish/guestfish-actions.pod:2419
27087 " list-filesystems\n"
27093 #: ../fish/guestfish-actions.pod:2438
27095 "This command runs other libguestfs commands, which might include L</mount> "
27096 "and L</umount>, and therefore you should use this soon after launch and only "
27097 "when nothing is mounted."
27102 #: ../fish/guestfish-actions.pod:2442
27104 "Not all of the filesystems returned will be mountable. In particular, swap "
27105 "partitions are returned in the list. Also this command does not check that "
27106 "each filesystem found is valid and mountable, and some filesystems might be "
27107 "mountable but require special options. Filesystems may not all belong to a "
27108 "single logical operating system (use L</inspect-os> to look for OSes)."
27113 #: ../fish/guestfish-actions.pod:2450
27114 msgid "list-partitions"
27119 #: ../fish/guestfish-actions.pod:2452
27122 " list-partitions\n"
27128 #: ../fish/guestfish-actions.pod:2458
27130 "This does not return logical volumes. For that you will need to call L</"
27136 #: ../fish/guestfish-actions.pod:2463
27142 #: ../fish/guestfish-actions.pod:2465
27151 #: ../fish/guestfish-actions.pod:2473
27157 #: ../fish/guestfish-actions.pod:2475
27160 " ln target linkname\n"
27166 #: ../fish/guestfish-actions.pod:2479
27172 #: ../fish/guestfish-actions.pod:2481
27175 " ln-f target linkname\n"
27181 #: ../fish/guestfish-actions.pod:2486
27187 #: ../fish/guestfish-actions.pod:2488
27190 " ln-s target linkname\n"
27196 #: ../fish/guestfish-actions.pod:2492
27202 #: ../fish/guestfish-actions.pod:2494
27205 " ln-sf target linkname\n"
27211 #: ../fish/guestfish-actions.pod:2499
27212 msgid "lremovexattr"
27217 #: ../fish/guestfish-actions.pod:2501
27220 " lremovexattr xattr path\n"
27226 #: ../fish/guestfish-actions.pod:2503
27228 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
27229 "it removes an extended attribute of the link itself."
27234 #: ../fish/guestfish-actions.pod:2507
27240 #: ../fish/guestfish-actions.pod:2509
27249 #: ../fish/guestfish-actions.pod:2515
27251 "This command is mostly useful for interactive sessions. Programs should "
27252 "probably use L</readdir> instead."
27257 #: ../fish/guestfish-actions.pod:2518
27263 #: ../fish/guestfish-actions.pod:2520
27266 " lsetxattr xattr val vallen path\n"
27272 #: ../fish/guestfish-actions.pod:2522
27274 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
27275 "sets an extended attribute of the link itself."
27280 #: ../fish/guestfish-actions.pod:2526
27286 #: ../fish/guestfish-actions.pod:2528
27295 #: ../fish/guestfish-actions.pod:2532
27297 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
27298 "the link is stat-ed, not the file it refers to."
27303 #: ../fish/guestfish-actions.pod:2538
27309 #: ../fish/guestfish-actions.pod:2540
27312 " lstatlist path 'names ...'\n"
27318 #: ../fish/guestfish-actions.pod:2542
27320 "This call allows you to perform the L</lstat> operation on multiple files, "
27321 "where all files are in the directory C<path>. C<names> is the list of files "
27322 "from this directory."
27327 #: ../fish/guestfish-actions.pod:2551
27329 "This call is intended for programs that want to efficiently list a directory "
27330 "contents without making many round-trips. See also L</lxattrlist> for a "
27331 "similarly efficient call for getting extended attributes. Very long "
27332 "directory listings might cause the protocol message size to be exceeded, "
27333 "causing this call to fail. The caller must split up such requests into "
27334 "smaller groups of names."
27339 #: ../fish/guestfish-actions.pod:2559
27340 msgid "luks-add-key"
27345 #: ../fish/guestfish-actions.pod:2561
27348 " luks-add-key device keyslot\n"
27354 #: ../fish/guestfish-actions.pod:2568
27356 "Note that if C<keyslot> already contains a key, then this command will "
27357 "fail. You have to use L</luks-kill-slot> first to remove that key."
27362 #: ../fish/guestfish-actions.pod:2572 ../fish/guestfish-actions.pod:2594
27363 #: ../fish/guestfish-actions.pod:2607 ../fish/guestfish-actions.pod:2621
27364 #: ../fish/guestfish-actions.pod:2644 ../fish/guestfish-actions.pod:2654
27366 "This command has one or more key or passphrase parameters. Guestfish will "
27367 "prompt for these separately."
27372 #: ../fish/guestfish-actions.pod:2575
27378 #: ../fish/guestfish-actions.pod:2577
27381 " luks-close device\n"
27387 #: ../fish/guestfish-actions.pod:2579
27389 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
27390 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
27391 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
27397 #: ../fish/guestfish-actions.pod:2585
27398 msgid "luks-format"
27403 #: ../fish/guestfish-actions.pod:2587
27406 " luks-format device keyslot\n"
27412 #: ../fish/guestfish-actions.pod:2600
27413 msgid "luks-format-cipher"
27418 #: ../fish/guestfish-actions.pod:2602
27421 " luks-format-cipher device keyslot cipher\n"
27427 #: ../fish/guestfish-actions.pod:2604
27429 "This command is the same as L</luks-format> but it also allows you to set "
27430 "the C<cipher> used."
27435 #: ../fish/guestfish-actions.pod:2613
27436 msgid "luks-kill-slot"
27441 #: ../fish/guestfish-actions.pod:2615
27444 " luks-kill-slot device keyslot\n"
27450 #: ../fish/guestfish-actions.pod:2624
27456 #: ../fish/guestfish-actions.pod:2626
27459 " luks-open device mapname\n"
27465 #: ../fish/guestfish-actions.pod:2640
27467 "If this block device contains LVM volume groups, then calling L</vgscan> "
27468 "followed by L</vg-activate-all> will make them visible."
27473 #: ../fish/guestfish-actions.pod:2647
27474 msgid "luks-open-ro"
27479 #: ../fish/guestfish-actions.pod:2649
27482 " luks-open-ro device mapname\n"
27488 #: ../fish/guestfish-actions.pod:2651
27490 "This is the same as L</luks-open> except that a read-only mapping is created."
27495 #: ../fish/guestfish-actions.pod:2657
27501 #: ../fish/guestfish-actions.pod:2659
27504 " lvcreate logvol volgroup mbytes\n"
27510 #: ../fish/guestfish-actions.pod:2664
27511 msgid "lvm-canonical-lv-name"
27516 #: ../fish/guestfish-actions.pod:2666
27519 " lvm-canonical-lv-name lvname\n"
27525 #: ../fish/guestfish-actions.pod:2675
27526 msgid "See also L</is-lv>."
27531 #: ../fish/guestfish-actions.pod:2677
27532 msgid "lvm-clear-filter"
27537 #: ../fish/guestfish-actions.pod:2679
27540 " lvm-clear-filter\n"
27546 #: ../fish/guestfish-actions.pod:2681
27548 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
27554 #: ../fish/guestfish-actions.pod:2687
27555 msgid "lvm-remove-all"
27560 #: ../fish/guestfish-actions.pod:2689
27563 " lvm-remove-all\n"
27569 #: ../fish/guestfish-actions.pod:2697
27570 msgid "lvm-set-filter"
27575 #: ../fish/guestfish-actions.pod:2699
27578 " lvm-set-filter 'devices ...'\n"
27584 #: ../fish/guestfish-actions.pod:2724
27590 #: ../fish/guestfish-actions.pod:2726
27593 " lvremove device\n"
27599 #: ../fish/guestfish-actions.pod:2734
27605 #: ../fish/guestfish-actions.pod:2736
27608 " lvrename logvol newlogvol\n"
27614 #: ../fish/guestfish-actions.pod:2740
27620 #: ../fish/guestfish-actions.pod:2742
27623 " lvresize device mbytes\n"
27629 #: ../fish/guestfish-actions.pod:2748
27630 msgid "lvresize-free"
27635 #: ../fish/guestfish-actions.pod:2750
27638 " lvresize-free lv percent\n"
27644 #: ../fish/guestfish-actions.pod:2758
27650 #: ../fish/guestfish-actions.pod:2760
27659 #: ../fish/guestfish-actions.pod:2768
27660 msgid "See also L</lvs-full>, L</list-filesystems>."
27665 #: ../fish/guestfish-actions.pod:2770
27671 #: ../fish/guestfish-actions.pod:2772
27680 #: ../fish/guestfish-actions.pod:2777
27686 #: ../fish/guestfish-actions.pod:2779
27695 #: ../fish/guestfish-actions.pod:2783
27701 #: ../fish/guestfish-actions.pod:2785
27704 " lxattrlist path 'names ...'\n"
27710 #: ../fish/guestfish-actions.pod:2801
27712 "This call is intended for programs that want to efficiently list a directory "
27713 "contents without making many round-trips. See also L</lstatlist> for a "
27714 "similarly efficient call for getting standard stats. Very long directory "
27715 "listings might cause the protocol message size to be exceeded, causing this "
27716 "call to fail. The caller must split up such requests into smaller groups of "
27722 #: ../fish/guestfish-actions.pod:2809
27728 #: ../fish/guestfish-actions.pod:2811
27737 #: ../fish/guestfish-actions.pod:2815
27743 #: ../fish/guestfish-actions.pod:2817
27746 " mkdir-mode path mode\n"
27752 #: ../fish/guestfish-actions.pod:2826
27753 msgid "See also L</mkdir>, L</umask>"
27758 #: ../fish/guestfish-actions.pod:2828
27764 #: ../fish/guestfish-actions.pod:2830
27773 #: ../fish/guestfish-actions.pod:2835
27779 #: ../fish/guestfish-actions.pod:2837
27782 " mkdtemp template\n"
27788 #: ../fish/guestfish-actions.pod:2858
27794 #: ../fish/guestfish-actions.pod:2860
27797 " mke2fs-J fstype blocksize device journal\n"
27803 #: ../fish/guestfish-actions.pod:2868
27804 msgid "See also L</mke2journal>."
27809 #: ../fish/guestfish-actions.pod:2870
27815 #: ../fish/guestfish-actions.pod:2872
27818 " mke2fs-JL fstype blocksize device label\n"
27824 #: ../fish/guestfish-actions.pod:2877
27825 msgid "See also L</mke2journal-L>."
27830 #: ../fish/guestfish-actions.pod:2879
27836 #: ../fish/guestfish-actions.pod:2881
27839 " mke2fs-JU fstype blocksize device uuid\n"
27845 #: ../fish/guestfish-actions.pod:2886
27846 msgid "See also L</mke2journal-U>."
27851 #: ../fish/guestfish-actions.pod:2888
27852 msgid "mke2journal"
27857 #: ../fish/guestfish-actions.pod:2890
27860 " mke2journal blocksize device\n"
27866 #: ../fish/guestfish-actions.pod:2897
27867 msgid "mke2journal-L"
27872 #: ../fish/guestfish-actions.pod:2899
27875 " mke2journal-L blocksize label device\n"
27881 #: ../fish/guestfish-actions.pod:2903
27882 msgid "mke2journal-U"
27887 #: ../fish/guestfish-actions.pod:2905
27890 " mke2journal-U blocksize uuid device\n"
27896 #: ../fish/guestfish-actions.pod:2909
27902 #: ../fish/guestfish-actions.pod:2911
27905 " mkfifo mode path\n"
27911 #: ../fish/guestfish-actions.pod:2913
27913 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
27914 "is just a convenient wrapper around L</mknod>."
27919 #: ../fish/guestfish-actions.pod:2919
27925 #: ../fish/guestfish-actions.pod:2921
27928 " mkfs fstype device\n"
27934 #: ../fish/guestfish-actions.pod:2927
27940 #: ../fish/guestfish-actions.pod:2929
27943 " mkfs-b fstype blocksize device\n"
27949 #: ../fish/guestfish-actions.pod:2931
27951 "This call is similar to L</mkfs>, but it allows you to control the block "
27952 "size of the resulting filesystem. Supported block sizes depend on the "
27953 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
27958 #: ../fish/guestfish-actions.pod:2946
27963 #: ../fish/guestfish-actions.pod:2948
27966 " mkfs-opts fstype device [blocksize:..] [features:..]\n"
27972 #: ../fish/guestfish-actions.pod:2983
27973 msgid "mkmountpoint"
27978 #: ../fish/guestfish-actions.pod:2985
27981 " mkmountpoint exemptpath\n"
27987 #: ../fish/guestfish-actions.pod:2987
27989 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
27990 "to create extra mountpoints before mounting the first filesystem."
27995 #: ../fish/guestfish-actions.pod:3011
27997 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
27998 "unexpected errors if you try to mix these calls. It is safest to manually "
27999 "unmount filesystems and remove mountpoints after use."
28004 #: ../fish/guestfish-actions.pod:3015
28006 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
28007 "for this to work for manual mountpoints, you must ensure that the innermost "
28008 "mountpoints have the longest pathnames, as in the example code above."
28012 #: ../fish/guestfish-actions.pod:3022
28014 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
28015 "L</umount-all> to be called when the handle is closed which can also trigger "
28021 #: ../fish/guestfish-actions.pod:3026
28027 #: ../fish/guestfish-actions.pod:3028
28030 " mknod mode devmajor devminor path\n"
28036 #: ../fish/guestfish-actions.pod:3038
28038 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28039 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28040 "regular file). These constants are available in the standard Linux header "
28041 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
28042 "wrappers around this command which bitwise OR in the appropriate constant "
28048 #: ../fish/guestfish-actions.pod:3048
28054 #: ../fish/guestfish-actions.pod:3050
28057 " mknod-b mode devmajor devminor path\n"
28063 #: ../fish/guestfish-actions.pod:3052
28065 "This call creates a block device node called C<path> with mode C<mode> and "
28066 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28067 "wrapper around L</mknod>."
28072 #: ../fish/guestfish-actions.pod:3058
28078 #: ../fish/guestfish-actions.pod:3060
28081 " mknod-c mode devmajor devminor path\n"
28087 #: ../fish/guestfish-actions.pod:3062
28089 "This call creates a char device node called C<path> with mode C<mode> and "
28090 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28091 "wrapper around L</mknod>."
28096 #: ../fish/guestfish-actions.pod:3068
28102 #: ../fish/guestfish-actions.pod:3070
28111 #: ../fish/guestfish-actions.pod:3074
28117 #: ../fish/guestfish-actions.pod:3076
28120 " mkswap-L label device\n"
28126 #: ../fish/guestfish-actions.pod:3084
28132 #: ../fish/guestfish-actions.pod:3086
28135 " mkswap-U uuid device\n"
28141 #: ../fish/guestfish-actions.pod:3090
28142 msgid "mkswap-file"
28147 #: ../fish/guestfish-actions.pod:3092
28150 " mkswap-file path\n"
28156 #: ../fish/guestfish-actions.pod:3096
28158 "This command just writes a swap file signature to an existing file. To "
28159 "create the file itself, use something like L</fallocate>."
28164 #: ../fish/guestfish-actions.pod:3099
28170 #: ../fish/guestfish-actions.pod:3101
28173 " modprobe modulename\n"
28179 #: ../fish/guestfish-actions.pod:3108
28185 #: ../fish/guestfish-actions.pod:3110
28188 " mount device mountpoint\n"
28194 #: ../fish/guestfish-actions.pod:3126
28196 "B<Important note:> When you use this call, the filesystem options C<sync> "
28197 "and C<noatime> are set implicitly. This was originally done because we "
28198 "thought it would improve reliability, but it turns out that I<-o sync> has a "
28199 "very large negative performance impact and negligible effect on "
28200 "reliability. Therefore we recommend that you avoid using L</mount> in any "
28201 "code that needs performance, and instead use L</mount-options> (use an empty "
28202 "string for the first parameter if you don't want any options)."
28207 #: ../fish/guestfish-actions.pod:3136
28213 #: ../fish/guestfish-actions.pod:3138
28216 " mount-loop file mountpoint\n"
28222 #: ../fish/guestfish-actions.pod:3144
28223 msgid "mount-options"
28228 #: ../fish/guestfish-actions.pod:3146
28231 " mount-options options device mountpoint\n"
28237 #: ../fish/guestfish-actions.pod:3148
28239 "This is the same as the L</mount> command, but it allows you to set the "
28240 "mount options as for the L<mount(8)> I<-o> flag."
28245 #: ../fish/guestfish-actions.pod:3156
28251 #: ../fish/guestfish-actions.pod:3158
28254 " mount-ro device mountpoint\n"
28260 #: ../fish/guestfish-actions.pod:3160
28262 "This is the same as the L</mount> command, but it mounts the filesystem with "
28263 "the read-only (I<-o ro>) flag."
28268 #: ../fish/guestfish-actions.pod:3163
28274 #: ../fish/guestfish-actions.pod:3165
28277 " mount-vfs options vfstype device mountpoint\n"
28283 #: ../fish/guestfish-actions.pod:3167
28285 "This is the same as the L</mount> command, but it allows you to set both the "
28286 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
28291 #: ../fish/guestfish-actions.pod:3171
28292 msgid "mountpoints"
28297 #: ../fish/guestfish-actions.pod:3173
28306 #: ../fish/guestfish-actions.pod:3175
28308 "This call is similar to L</mounts>. That call returns a list of devices. "
28309 "This one returns a hash table (map) of device name to directory where the "
28310 "device is mounted."
28315 #: ../fish/guestfish-actions.pod:3179
28321 #: ../fish/guestfish-actions.pod:3181
28330 #: ../fish/guestfish-actions.pod:3188
28331 msgid "See also: L</mountpoints>"
28336 #: ../fish/guestfish-actions.pod:3190
28342 #: ../fish/guestfish-actions.pod:3192
28351 #: ../fish/guestfish-actions.pod:3197
28352 msgid "ntfs-3g-probe"
28357 #: ../fish/guestfish-actions.pod:3199
28360 " ntfs-3g-probe true|false device\n"
28366 #: ../fish/guestfish-actions.pod:3213
28372 #: ../fish/guestfish-actions.pod:3215
28375 " ntfsresize device\n"
28381 #: ../fish/guestfish-actions.pod:3221
28382 msgid "ntfsresize-size"
28387 #: ../fish/guestfish-actions.pod:3223
28390 " ntfsresize-size device size\n"
28396 #: ../fish/guestfish-actions.pod:3225
28398 "This command is the same as L</ntfsresize> except that it allows you to "
28399 "specify the new size (in bytes) explicitly."
28404 #: ../fish/guestfish-actions.pod:3228
28410 #: ../fish/guestfish-actions.pod:3230
28413 " part-add device prlogex startsect endsect\n"
28419 #: ../fish/guestfish-actions.pod:3232
28421 "This command adds a partition to C<device>. If there is no partition table "
28422 "on the device, call L</part-init> first."
28427 #: ../fish/guestfish-actions.pod:3244
28429 "Creating a partition which covers the whole disk is not so easy. Use L</"
28430 "part-disk> to do that."
28435 #: ../fish/guestfish-actions.pod:3247
28441 #: ../fish/guestfish-actions.pod:3249
28444 " part-del device partnum\n"
28450 #: ../fish/guestfish-actions.pod:3257
28456 #: ../fish/guestfish-actions.pod:3259
28459 " part-disk device parttype\n"
28465 #: ../fish/guestfish-actions.pod:3261
28467 "This command is simply a combination of L</part-init> followed by L</part-"
28468 "add> to create a single primary partition covering the whole disk."
28473 #: ../fish/guestfish-actions.pod:3265
28475 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
28476 "possible values are described in L</part-init>."
28481 #: ../fish/guestfish-actions.pod:3271
28482 msgid "part-get-bootable"
28487 #: ../fish/guestfish-actions.pod:3273
28490 " part-get-bootable device partnum\n"
28496 #: ../fish/guestfish-actions.pod:3278
28497 msgid "See also L</part-set-bootable>."
28502 #: ../fish/guestfish-actions.pod:3280
28503 msgid "part-get-mbr-id"
28508 #: ../fish/guestfish-actions.pod:3282
28511 " part-get-mbr-id device partnum\n"
28517 #: ../fish/guestfish-actions.pod:3287 ../fish/guestfish-actions.pod:3425
28519 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
28520 "undefined results for other partition table types (see L</part-get-"
28526 #: ../fish/guestfish-actions.pod:3291
28527 msgid "part-get-parttype"
28532 #: ../fish/guestfish-actions.pod:3293
28535 " part-get-parttype device\n"
28541 #: ../fish/guestfish-actions.pod:3298
28543 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
28544 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
28545 "possible, although unusual. See L</part-init> for a full list."
28550 #: ../fish/guestfish-actions.pod:3303
28556 #: ../fish/guestfish-actions.pod:3305
28559 " part-init device parttype\n"
28565 #: ../fish/guestfish-actions.pod:3311
28567 "Initially there are no partitions. Following this, you should call L</part-"
28568 "add> for each partition required."
28573 #: ../fish/guestfish-actions.pod:3374
28579 #: ../fish/guestfish-actions.pod:3376
28582 " part-list device\n"
28588 #: ../fish/guestfish-actions.pod:3391
28590 "Start of the partition I<in bytes>. To get sectors you have to divide by "
28591 "the device's sector size, see L</blockdev-getss>."
28596 #: ../fish/guestfish-actions.pod:3404
28597 msgid "part-set-bootable"
28602 #: ../fish/guestfish-actions.pod:3406
28605 " part-set-bootable device partnum true|false\n"
28611 #: ../fish/guestfish-actions.pod:3415
28612 msgid "part-set-mbr-id"
28617 #: ../fish/guestfish-actions.pod:3417
28620 " part-set-mbr-id device partnum idbyte\n"
28626 #: ../fish/guestfish-actions.pod:3429
28627 msgid "part-set-name"
28632 #: ../fish/guestfish-actions.pod:3431
28635 " part-set-name device partnum name\n"
28641 #: ../fish/guestfish-actions.pod:3439
28642 msgid "part-to-dev"
28647 #: ../fish/guestfish-actions.pod:3441
28650 " part-to-dev partition\n"
28656 #: ../fish/guestfish-actions.pod:3447
28658 "The named partition must exist, for example as a string returned from L</"
28659 "list-partitions>."
28664 #: ../fish/guestfish-actions.pod:3450
28665 msgid "ping-daemon"
28670 #: ../fish/guestfish-actions.pod:3452
28679 #: ../fish/guestfish-actions.pod:3459
28685 #: ../fish/guestfish-actions.pod:3461
28688 " pread path count offset\n"
28694 #: ../fish/guestfish-actions.pod:3469
28695 msgid "See also L</pwrite>, L</pread-device>."
28700 #: ../fish/guestfish-actions.pod:3474
28701 msgid "pread-device"
28706 #: ../fish/guestfish-actions.pod:3476
28709 " pread-device device count offset\n"
28715 #: ../fish/guestfish-actions.pod:3484
28716 msgid "See also L</pread>."
28721 #: ../fish/guestfish-actions.pod:3489
28727 #: ../fish/guestfish-actions.pod:3491
28730 " pvcreate device\n"
28736 #: ../fish/guestfish-actions.pod:3497
28742 #: ../fish/guestfish-actions.pod:3499
28745 " pvremove device\n"
28751 #: ../fish/guestfish-actions.pod:3508
28757 #: ../fish/guestfish-actions.pod:3510
28760 " pvresize device\n"
28766 #: ../fish/guestfish-actions.pod:3515
28767 msgid "pvresize-size"
28772 #: ../fish/guestfish-actions.pod:3517
28775 " pvresize-size device size\n"
28781 #: ../fish/guestfish-actions.pod:3519
28783 "This command is the same as L</pvresize> except that it allows you to "
28784 "specify the new size (in bytes) explicitly."
28789 #: ../fish/guestfish-actions.pod:3522
28795 #: ../fish/guestfish-actions.pod:3524
28804 #: ../fish/guestfish-actions.pod:3532
28805 msgid "See also L</pvs-full>."
28810 #: ../fish/guestfish-actions.pod:3534
28816 #: ../fish/guestfish-actions.pod:3536
28825 #: ../fish/guestfish-actions.pod:3541
28831 #: ../fish/guestfish-actions.pod:3543
28840 #: ../fish/guestfish-actions.pod:3547
28846 #: ../fish/guestfish-actions.pod:3549
28849 " pwrite path content offset\n"
28855 #: ../fish/guestfish-actions.pod:3560
28856 msgid "See also L</pread>, L</pwrite-device>."
28861 #: ../fish/guestfish-actions.pod:3565
28862 msgid "pwrite-device"
28867 #: ../fish/guestfish-actions.pod:3567
28870 " pwrite-device device content offset\n"
28876 #: ../fish/guestfish-actions.pod:3577
28877 msgid "See also L</pwrite>."
28882 #: ../fish/guestfish-actions.pod:3582
28888 #: ../fish/guestfish-actions.pod:3584
28891 " read-file path\n"
28897 #: ../fish/guestfish-actions.pod:3589
28899 "Unlike L</cat>, this function can correctly handle files that contain "
28900 "embedded ASCII NUL characters. However unlike L</download>, this function "
28901 "is limited in the total size of file that can be handled."
28906 #: ../fish/guestfish-actions.pod:3597
28912 #: ../fish/guestfish-actions.pod:3599
28915 " read-lines path\n"
28921 #: ../fish/guestfish-actions.pod:3606
28923 "Note that this function cannot correctly handle binary files (specifically, "
28924 "files containing C<\\0> character which is treated as end of line). For "
28925 "those you need to use the L</read-file> function which has a more complex "
28931 #: ../fish/guestfish-actions.pod:3611
28937 #: ../fish/guestfish-actions.pod:3613
28946 #: ../fish/guestfish-actions.pod:3665
28948 "This function is primarily intended for use by programs. To get a simple "
28949 "list of names, use L</ls>. To get a printable directory for human "
28950 "consumption, use L</ll>."
28955 #: ../fish/guestfish-actions.pod:3669
28961 #: ../fish/guestfish-actions.pod:3671
28970 #: ../fish/guestfish-actions.pod:3675
28971 msgid "readlinklist"
28976 #: ../fish/guestfish-actions.pod:3677
28979 " readlinklist path 'names ...'\n"
28985 #: ../fish/guestfish-actions.pod:3701
28991 #: ../fish/guestfish-actions.pod:3703
29000 #: ../fish/guestfish-actions.pod:3708
29001 msgid "removexattr"
29006 #: ../fish/guestfish-actions.pod:3710
29009 " removexattr xattr path\n"
29015 #: ../fish/guestfish-actions.pod:3715
29016 msgid "See also: L</lremovexattr>, L<attr(5)>."
29021 #: ../fish/guestfish-actions.pod:3717
29027 #: ../fish/guestfish-actions.pod:3719
29030 " resize2fs device\n"
29036 #: ../fish/guestfish-actions.pod:3724
29038 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
29039 "before calling this command. For unknown reasons C<resize2fs> sometimes "
29040 "gives an error about this and sometimes not. In any case, it is always safe "
29041 "to call L</e2fsck-f> before calling this function."
29045 #: ../fish/guestfish-actions.pod:3730
29046 msgid "resize2fs-M"
29050 #: ../fish/guestfish-actions.pod:3732
29053 " resize2fs-M device\n"
29058 #: ../fish/guestfish-actions.pod:3734
29060 "This command is the same as L</resize2fs>, but the filesystem is resized to "
29061 "its minimum size. This works like the C<-M> option to the C<resize2fs> "
29066 #: ../fish/guestfish-actions.pod:3738
29068 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
29069 "and read the C<Block size> and C<Block count> values. These two numbers, "
29070 "multiplied together, give the resulting size of the minimal filesystem in "
29076 #: ../fish/guestfish-actions.pod:3743
29077 msgid "resize2fs-size"
29082 #: ../fish/guestfish-actions.pod:3745
29085 " resize2fs-size device size\n"
29091 #: ../fish/guestfish-actions.pod:3747
29093 "This command is the same as L</resize2fs> except that it allows you to "
29094 "specify the new size (in bytes) explicitly."
29099 #: ../fish/guestfish-actions.pod:3750
29105 #: ../fish/guestfish-actions.pod:3752
29114 #: ../fish/guestfish-actions.pod:3756
29120 #: ../fish/guestfish-actions.pod:3758
29129 #: ../fish/guestfish-actions.pod:3764
29135 #: ../fish/guestfish-actions.pod:3766
29144 #: ../fish/guestfish-actions.pod:3770
29145 msgid "rmmountpoint"
29150 #: ../fish/guestfish-actions.pod:3772
29153 " rmmountpoint exemptpath\n"
29159 #: ../fish/guestfish-actions.pod:3774
29161 "This calls removes a mountpoint that was previously created with L</"
29162 "mkmountpoint>. See L</mkmountpoint> for full details."
29167 #: ../fish/guestfish-actions.pod:3778
29168 msgid "scrub-device"
29173 #: ../fish/guestfish-actions.pod:3780
29176 " scrub-device device\n"
29182 #: ../fish/guestfish-actions.pod:3791
29188 #: ../fish/guestfish-actions.pod:3793
29191 " scrub-file file\n"
29197 #: ../fish/guestfish-actions.pod:3803
29198 msgid "scrub-freespace"
29203 #: ../fish/guestfish-actions.pod:3805
29206 " scrub-freespace dir\n"
29212 #: ../fish/guestfish-actions.pod:3807
29214 "This command creates the directory C<dir> and then fills it with files until "
29215 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
29216 "deletes them. The intention is to scrub any free space on the partition "
29217 "containing C<dir>."
29222 #: ../fish/guestfish-actions.pod:3816
29228 #: ../fish/guestfish-actions.pod:3818
29234 #: ../fish/guestfish-actions.pod:3820
29237 " set-append append\n"
29242 #: ../fish/guestfish-actions.pod:3831
29243 msgid "set-attach-method"
29247 #: ../fish/guestfish-actions.pod:3833
29248 msgid "attach-method"
29252 #: ../fish/guestfish-actions.pod:3835
29255 " set-attach-method attachmethod\n"
29261 #: ../fish/guestfish-actions.pod:3857
29262 msgid "set-autosync"
29267 #: ../fish/guestfish-actions.pod:3859
29273 #: ../fish/guestfish-actions.pod:3861
29276 " set-autosync true|false\n"
29282 #: ../fish/guestfish-actions.pod:3871
29288 #: ../fish/guestfish-actions.pod:3873
29294 #: ../fish/guestfish-actions.pod:3875
29297 " set-direct true|false\n"
29303 #: ../fish/guestfish-actions.pod:3881
29305 "One consequence of this is that log messages aren't caught by the library "
29306 "and handled by L</set-log-message-callback>, but go straight to stdout."
29311 #: ../fish/guestfish-actions.pod:3890
29312 msgid "set-e2label"
29317 #: ../fish/guestfish-actions.pod:3892
29320 " set-e2label device label\n"
29326 #: ../fish/guestfish-actions.pod:3898
29328 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
29329 "label on a filesystem."
29334 #: ../fish/guestfish-actions.pod:3901
29340 #: ../fish/guestfish-actions.pod:3903
29343 " set-e2uuid device uuid\n"
29349 #: ../fish/guestfish-actions.pod:3910
29351 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
29352 "UUID of a filesystem."
29357 #: ../fish/guestfish-actions.pod:3913
29358 msgid "set-memsize"
29363 #: ../fish/guestfish-actions.pod:3915
29369 #: ../fish/guestfish-actions.pod:3917
29372 " set-memsize memsize\n"
29378 #: ../fish/guestfish-actions.pod:3919
29380 "This sets the memory size in megabytes allocated to the qemu subprocess. "
29381 "This only has any effect if called before L</launch>."
29386 #: ../fish/guestfish-actions.pod:3930
29387 msgid "set-network"
29392 #: ../fish/guestfish-actions.pod:3932
29398 #: ../fish/guestfish-actions.pod:3934
29401 " set-network true|false\n"
29407 #: ../fish/guestfish-actions.pod:3942
29409 "You must call this before calling L</launch>, otherwise it has no effect."
29414 #: ../fish/guestfish-actions.pod:3945
29420 #: ../fish/guestfish-actions.pod:3947
29426 #: ../fish/guestfish-actions.pod:3949
29429 " set-path searchpath\n"
29435 #: ../fish/guestfish-actions.pod:3958
29441 #: ../fish/guestfish-actions.pod:3960
29447 #: ../fish/guestfish-actions.pod:3962
29456 #: ../fish/guestfish-actions.pod:3982
29457 msgid "set-recovery-proc"
29462 #: ../fish/guestfish-actions.pod:3984
29463 msgid "recovery-proc"
29468 #: ../fish/guestfish-actions.pod:3986
29471 " set-recovery-proc true|false\n"
29477 #: ../fish/guestfish-actions.pod:3988
29479 "If this is called with the parameter C<false> then L</launch> does not "
29480 "create a recovery process. The purpose of the recovery process is to stop "
29481 "runaway qemu processes in the case where the main program aborts abruptly."
29486 #: ../fish/guestfish-actions.pod:3993
29488 "This only has any effect if called before L</launch>, and the default is "
29494 #: ../fish/guestfish-actions.pod:4002
29495 msgid "set-selinux"
29500 #: ../fish/guestfish-actions.pod:4004
29506 #: ../fish/guestfish-actions.pod:4006
29509 " set-selinux true|false\n"
29515 #: ../fish/guestfish-actions.pod:4017
29521 #: ../fish/guestfish-actions.pod:4019
29527 #: ../fish/guestfish-actions.pod:4021
29530 " set-trace true|false\n"
29535 #: ../fish/guestfish-actions.pod:4033
29537 "Trace messages are normally sent to C<stderr>, unless you register a "
29538 "callback to send them somewhere else (see L</set-event-callback>)."
29543 #: ../fish/guestfish-actions.pod:4037
29544 msgid "set-verbose"
29549 #: ../fish/guestfish-actions.pod:4039
29555 #: ../fish/guestfish-actions.pod:4041
29558 " set-verbose true|false\n"
29563 #: ../fish/guestfish-actions.pod:4048
29565 "Verbose messages are normally sent to C<stderr>, unless you register a "
29566 "callback to send them somewhere else (see L</set-event-callback>)."
29571 #: ../fish/guestfish-actions.pod:4052
29577 #: ../fish/guestfish-actions.pod:4054
29580 " setcon context\n"
29586 #: ../fish/guestfish-actions.pod:4061
29592 #: ../fish/guestfish-actions.pod:4063
29595 " setxattr xattr val vallen path\n"
29601 #: ../fish/guestfish-actions.pod:4069
29602 msgid "See also: L</lsetxattr>, L<attr(5)>."
29607 #: ../fish/guestfish-actions.pod:4071
29613 #: ../fish/guestfish-actions.pod:4073
29616 " sfdisk device cyls heads sectors 'lines ...'\n"
29622 #: ../fish/guestfish-actions.pod:4095
29623 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
29628 #: ../fish/guestfish-actions.pod:4101
29634 #: ../fish/guestfish-actions.pod:4103
29637 " sfdiskM device 'lines ...'\n"
29643 #: ../fish/guestfish-actions.pod:4105
29645 "This is a simplified interface to the L</sfdisk> command, where partition "
29646 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
29647 "you don't need to specify the cyls, heads and sectors parameters which were "
29648 "rarely if ever used anyway."
29653 #: ../fish/guestfish-actions.pod:4111
29654 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
29659 #: ../fish/guestfish-actions.pod:4117
29665 #: ../fish/guestfish-actions.pod:4119
29668 " sfdisk-N device partnum cyls heads sectors line\n"
29674 #: ../fish/guestfish-actions.pod:4124
29676 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
29677 "cyls/heads/sectors parameters."
29682 #: ../fish/guestfish-actions.pod:4127
29683 msgid "See also: L</part-add>"
29688 #: ../fish/guestfish-actions.pod:4132
29689 msgid "sfdisk-disk-geometry"
29694 #: ../fish/guestfish-actions.pod:4134
29697 " sfdisk-disk-geometry device\n"
29703 #: ../fish/guestfish-actions.pod:4136
29705 "This displays the disk geometry of C<device> read from the partition table. "
29706 "Especially in the case where the underlying block device has been resized, "
29707 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
29708 "kernel-geometry>)."
29713 #: ../fish/guestfish-actions.pod:4144
29714 msgid "sfdisk-kernel-geometry"
29719 #: ../fish/guestfish-actions.pod:4146
29722 " sfdisk-kernel-geometry device\n"
29728 #: ../fish/guestfish-actions.pod:4153
29734 #: ../fish/guestfish-actions.pod:4155
29737 " sfdisk-l device\n"
29743 #: ../fish/guestfish-actions.pod:4161
29744 msgid "See also: L</part-list>"
29749 #: ../fish/guestfish-actions.pod:4163
29755 #: ../fish/guestfish-actions.pod:4165
29764 #: ../fish/guestfish-actions.pod:4170
29765 msgid "This is like L</command>, but passes the command to:"
29770 #: ../fish/guestfish-actions.pod:4178
29771 msgid "All the provisos about L</command> apply to this call."
29776 #: ../fish/guestfish-actions.pod:4180
29782 #: ../fish/guestfish-actions.pod:4182
29785 " sh-lines command\n"
29791 #: ../fish/guestfish-actions.pod:4184
29792 msgid "This is the same as L</sh>, but splits the result into a list of lines."
29797 #: ../fish/guestfish-actions.pod:4187
29798 msgid "See also: L</command-lines>"
29803 #: ../fish/guestfish-actions.pod:4189
29809 #: ../fish/guestfish-actions.pod:4191
29818 #: ../fish/guestfish-actions.pod:4195
29824 #: ../fish/guestfish-actions.pod:4197
29833 #: ../fish/guestfish-actions.pod:4203
29839 #: ../fish/guestfish-actions.pod:4205
29848 #: ../fish/guestfish-actions.pod:4213
29854 #: ../fish/guestfish-actions.pod:4215
29863 #: ../fish/guestfish-actions.pod:4223
29869 #: ../fish/guestfish-actions.pod:4225
29872 " strings-e encoding path\n"
29878 #: ../fish/guestfish-actions.pod:4227
29880 "This is like the L</strings> command, but allows you to specify the encoding "
29881 "of strings that are looked for in the source file C<path>."
29886 #: ../fish/guestfish-actions.pod:4237
29888 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
29889 "ISO-8859-X (this is what L</strings> uses)."
29894 #: ../fish/guestfish-actions.pod:4269
29895 msgid "swapoff-device"
29900 #: ../fish/guestfish-actions.pod:4271
29903 " swapoff-device device\n"
29909 #: ../fish/guestfish-actions.pod:4273
29911 "This command disables the libguestfs appliance swap device or partition "
29912 "named C<device>. See L</swapon-device>."
29917 #: ../fish/guestfish-actions.pod:4277
29918 msgid "swapoff-file"
29923 #: ../fish/guestfish-actions.pod:4279
29926 " swapoff-file file\n"
29932 #: ../fish/guestfish-actions.pod:4283
29933 msgid "swapoff-label"
29938 #: ../fish/guestfish-actions.pod:4285
29941 " swapoff-label label\n"
29947 #: ../fish/guestfish-actions.pod:4290
29948 msgid "swapoff-uuid"
29953 #: ../fish/guestfish-actions.pod:4292
29956 " swapoff-uuid uuid\n"
29962 #: ../fish/guestfish-actions.pod:4297
29963 msgid "swapon-device"
29968 #: ../fish/guestfish-actions.pod:4299
29971 " swapon-device device\n"
29977 #: ../fish/guestfish-actions.pod:4301
29979 "This command enables the libguestfs appliance to use the swap device or "
29980 "partition named C<device>. The increased memory is made available for all "
29981 "commands, for example those run using L</command> or L</sh>."
29986 #: ../fish/guestfish-actions.pod:4313
29987 msgid "swapon-file"
29992 #: ../fish/guestfish-actions.pod:4315
29995 " swapon-file file\n"
30001 #: ../fish/guestfish-actions.pod:4317
30003 "This command enables swap to a file. See L</swapon-device> for other notes."
30008 #: ../fish/guestfish-actions.pod:4320
30009 msgid "swapon-label"
30014 #: ../fish/guestfish-actions.pod:4322
30017 " swapon-label label\n"
30023 #: ../fish/guestfish-actions.pod:4324
30025 "This command enables swap to a labeled swap partition. See L</swapon-"
30026 "device> for other notes."
30031 #: ../fish/guestfish-actions.pod:4327
30032 msgid "swapon-uuid"
30037 #: ../fish/guestfish-actions.pod:4329
30040 " swapon-uuid uuid\n"
30046 #: ../fish/guestfish-actions.pod:4331
30048 "This command enables swap to a swap partition with the given UUID. See L</"
30049 "swapon-device> for other notes."
30054 #: ../fish/guestfish-actions.pod:4334
30060 #: ../fish/guestfish-actions.pod:4336
30069 #: ../fish/guestfish-actions.pod:4344
30075 #: ../fish/guestfish-actions.pod:4346
30084 #: ../fish/guestfish-actions.pod:4354
30090 #: ../fish/guestfish-actions.pod:4356
30093 " tail-n nrlines path\n"
30099 #: ../fish/guestfish-actions.pod:4369
30105 #: ../fish/guestfish-actions.pod:4371
30108 " tar-in (tarfile|-) directory\n"
30114 #: ../fish/guestfish-actions.pod:4376
30115 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
30120 #: ../fish/guestfish-actions.pod:4381
30126 #: ../fish/guestfish-actions.pod:4383
30129 " tar-out directory (tarfile|-)\n"
30135 #: ../fish/guestfish-actions.pod:4388
30136 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
30141 #: ../fish/guestfish-actions.pod:4393
30147 #: ../fish/guestfish-actions.pod:4395
30150 " tgz-in (tarball|-) directory\n"
30156 #: ../fish/guestfish-actions.pod:4400
30157 msgid "To upload an uncompressed tarball, use L</tar-in>."
30162 #: ../fish/guestfish-actions.pod:4404
30168 #: ../fish/guestfish-actions.pod:4406
30171 " tgz-out directory (tarball|-)\n"
30177 #: ../fish/guestfish-actions.pod:4411
30178 msgid "To download an uncompressed tarball, use L</tar-out>."
30183 #: ../fish/guestfish-actions.pod:4415
30189 #: ../fish/guestfish-actions.pod:4417
30198 #: ../fish/guestfish-actions.pod:4426
30204 #: ../fish/guestfish-actions.pod:4428
30213 #: ../fish/guestfish-actions.pod:4433
30214 msgid "truncate-size"
30219 #: ../fish/guestfish-actions.pod:4435
30222 " truncate-size path size\n"
30228 #: ../fish/guestfish-actions.pod:4440
30230 "If the current file size is less than C<size> then the file is extended to "
30231 "the required size with zero bytes. This creates a sparse file (ie. disk "
30232 "blocks are not allocated for the file until you write to it). To create a "
30233 "non-sparse file of zeroes, use L</fallocate64> instead."
30238 #: ../fish/guestfish-actions.pod:4446
30244 #: ../fish/guestfish-actions.pod:4448
30247 " tune2fs-l device\n"
30253 #: ../fish/guestfish-actions.pod:4458
30259 #: ../fish/guestfish-actions.pod:4460
30262 " txz-in (tarball|-) directory\n"
30268 #: ../fish/guestfish-actions.pod:4467
30274 #: ../fish/guestfish-actions.pod:4469
30277 " txz-out directory (tarball|-)\n"
30283 #: ../fish/guestfish-actions.pod:4476
30289 #: ../fish/guestfish-actions.pod:4478
30298 #: ../fish/guestfish-actions.pod:4492
30299 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
30304 #: ../fish/guestfish-actions.pod:4497
30310 #: ../fish/guestfish-actions.pod:4499
30316 #: ../fish/guestfish-actions.pod:4501
30319 " umount pathordevice\n"
30325 #: ../fish/guestfish-actions.pod:4507
30331 #: ../fish/guestfish-actions.pod:4509
30332 msgid "unmount-all"
30337 #: ../fish/guestfish-actions.pod:4511
30346 #: ../fish/guestfish-actions.pod:4517
30352 #: ../fish/guestfish-actions.pod:4519
30355 " upload (filename|-) remotefilename\n"
30361 #: ../fish/guestfish-actions.pod:4526
30362 msgid "See also L</download>."
30367 #: ../fish/guestfish-actions.pod:4530
30368 msgid "upload-offset"
30373 #: ../fish/guestfish-actions.pod:4532
30376 " upload-offset (filename|-) remotefilename offset\n"
30382 #: ../fish/guestfish-actions.pod:4544
30384 "Note that there is no limit on the amount of data that can be uploaded with "
30385 "this call, unlike with L</pwrite>, and this call always writes the full "
30386 "amount unless an error occurs."
30391 #: ../fish/guestfish-actions.pod:4549
30392 msgid "See also L</upload>, L</pwrite>."
30397 #: ../fish/guestfish-actions.pod:4553
30403 #: ../fish/guestfish-actions.pod:4555
30406 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
30412 #: ../fish/guestfish-actions.pod:4574
30418 #: ../fish/guestfish-actions.pod:4576
30427 #: ../fish/guestfish-actions.pod:4603
30429 "I<Note:> Don't use this call to test for availability of features. In "
30430 "enterprise distributions we backport features from later versions into "
30431 "earlier versions, making this an unreliable way to test for features. Use "
30432 "L</available> instead."
30437 #: ../fish/guestfish-actions.pod:4609
30443 #: ../fish/guestfish-actions.pod:4611
30446 " vfs-label device\n"
30452 #: ../fish/guestfish-actions.pod:4618
30453 msgid "To find a filesystem from the label, use L</findfs-label>."
30458 #: ../fish/guestfish-actions.pod:4620
30464 #: ../fish/guestfish-actions.pod:4622
30467 " vfs-type device\n"
30473 #: ../fish/guestfish-actions.pod:4632
30479 #: ../fish/guestfish-actions.pod:4634
30482 " vfs-uuid device\n"
30488 #: ../fish/guestfish-actions.pod:4641
30489 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
30494 #: ../fish/guestfish-actions.pod:4643
30495 msgid "vg-activate"
30500 #: ../fish/guestfish-actions.pod:4645
30503 " vg-activate true|false 'volgroups ...'\n"
30509 #: ../fish/guestfish-actions.pod:4658
30510 msgid "vg-activate-all"
30515 #: ../fish/guestfish-actions.pod:4660
30518 " vg-activate-all true|false\n"
30524 #: ../fish/guestfish-actions.pod:4670
30530 #: ../fish/guestfish-actions.pod:4672
30533 " vgcreate volgroup 'physvols ...'\n"
30539 #: ../fish/guestfish-actions.pod:4677
30545 #: ../fish/guestfish-actions.pod:4679
30548 " vglvuuids vgname\n"
30554 #: ../fish/guestfish-actions.pod:4684
30556 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
30557 "logical volumes and volume groups."
30562 #: ../fish/guestfish-actions.pod:4687
30563 msgid "See also L</vgpvuuids>."
30568 #: ../fish/guestfish-actions.pod:4689
30574 #: ../fish/guestfish-actions.pod:4691
30577 " vgpvuuids vgname\n"
30583 #: ../fish/guestfish-actions.pod:4696
30585 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
30586 "physical volumes and volume groups."
30591 #: ../fish/guestfish-actions.pod:4699
30592 msgid "See also L</vglvuuids>."
30597 #: ../fish/guestfish-actions.pod:4701
30603 #: ../fish/guestfish-actions.pod:4703
30606 " vgremove vgname\n"
30612 #: ../fish/guestfish-actions.pod:4710
30618 #: ../fish/guestfish-actions.pod:4712
30621 " vgrename volgroup newvolgroup\n"
30627 #: ../fish/guestfish-actions.pod:4716
30633 #: ../fish/guestfish-actions.pod:4718
30642 #: ../fish/guestfish-actions.pod:4726
30643 msgid "See also L</vgs-full>."
30648 #: ../fish/guestfish-actions.pod:4728
30654 #: ../fish/guestfish-actions.pod:4730
30663 #: ../fish/guestfish-actions.pod:4735
30669 #: ../fish/guestfish-actions.pod:4737
30678 #: ../fish/guestfish-actions.pod:4742
30684 #: ../fish/guestfish-actions.pod:4744
30693 #: ../fish/guestfish-actions.pod:4748
30699 #: ../fish/guestfish-actions.pod:4750
30708 #: ../fish/guestfish-actions.pod:4755
30714 #: ../fish/guestfish-actions.pod:4757
30723 #: ../fish/guestfish-actions.pod:4762
30729 #: ../fish/guestfish-actions.pod:4764
30738 #: ../fish/guestfish-actions.pod:4769
30744 #: ../fish/guestfish-actions.pod:4771
30747 " write path content\n"
30753 #: ../fish/guestfish-actions.pod:4779
30759 #: ../fish/guestfish-actions.pod:4781
30762 " write-file path content size\n"
30768 #: ../fish/guestfish-actions.pod:4804
30774 #: ../fish/guestfish-actions.pod:4806
30777 " zegrep regex path\n"
30783 #: ../fish/guestfish-actions.pod:4814
30789 #: ../fish/guestfish-actions.pod:4816
30792 " zegrepi regex path\n"
30798 #: ../fish/guestfish-actions.pod:4824
30804 #: ../fish/guestfish-actions.pod:4826
30813 #: ../fish/guestfish-actions.pod:4834
30814 msgid "See also: L</zero-device>, L</scrub-device>."
30819 #: ../fish/guestfish-actions.pod:4836
30820 msgid "zero-device"
30825 #: ../fish/guestfish-actions.pod:4838
30828 " zero-device device\n"
30834 #: ../fish/guestfish-actions.pod:4840
30836 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
30837 "which just zeroes the first few blocks of a device."
30842 #: ../fish/guestfish-actions.pod:4847
30848 #: ../fish/guestfish-actions.pod:4849
30851 " zerofree device\n"
30857 #: ../fish/guestfish-actions.pod:4862
30863 #: ../fish/guestfish-actions.pod:4864
30866 " zfgrep pattern path\n"
30872 #: ../fish/guestfish-actions.pod:4872
30878 #: ../fish/guestfish-actions.pod:4874
30881 " zfgrepi pattern path\n"
30887 #: ../fish/guestfish-actions.pod:4882
30893 #: ../fish/guestfish-actions.pod:4884
30896 " zfile meth path\n"
30902 #: ../fish/guestfish-actions.pod:4891
30904 "Since 1.0.63, use L</file> instead which can now process compressed files."
30909 #: ../fish/guestfish-actions.pod:4901
30915 #: ../fish/guestfish-actions.pod:4903
30918 " zgrep regex path\n"
30924 #: ../fish/guestfish-actions.pod:4911
30930 #: ../fish/guestfish-actions.pod:4913
30933 " zgrepi regex path\n"
30939 #: ../fish/guestfish-commands.pod:1
30945 #: ../fish/guestfish-commands.pod:3
30951 #: ../fish/guestfish-commands.pod:5
30954 " alloc filename size\n"
30960 #: ../fish/guestfish-commands.pod:7
30962 "This creates an empty (zeroed) file of the given size, and then adds so it "
30963 "can be further examined."
30968 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
30969 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
30974 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
30975 msgid "Size can be specified using standard suffixes, eg. C<1M>."
30980 #: ../fish/guestfish-commands.pod:14
30982 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
30983 "image, see L</PREPARED DISK IMAGES>."
30988 #: ../fish/guestfish-commands.pod:17
30994 #: ../fish/guestfish-commands.pod:19
30997 " copy-in local [local ...] /remotedir\n"
31003 #: ../fish/guestfish-commands.pod:21
31005 "C<copy-in> copies local files or directories recursively into the disk "
31006 "image, placing them in the directory called C</remotedir> (which must "
31007 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
31008 "other commands as necessary."
31013 #: ../fish/guestfish-commands.pod:26
31015 "Multiple local files and directories can be specified, but the last "
31016 "parameter must always be a remote directory. Wildcards cannot be used."
31021 #: ../fish/guestfish-commands.pod:30
31027 #: ../fish/guestfish-commands.pod:32
31030 " copy-out remote [remote ...] localdir\n"
31036 #: ../fish/guestfish-commands.pod:34
31038 "C<copy-out> copies remote files or directories recursively out of the disk "
31039 "image, placing them on the host disk in a local directory called C<localdir> "
31040 "(which must exist). This guestfish meta-command turns into a sequence of L</"
31041 "download>, L</tar-out> and other commands as necessary."
31046 #: ../fish/guestfish-commands.pod:40
31048 "Multiple remote files and directories can be specified, but the last "
31049 "parameter must always be a local directory. To download to the current "
31050 "directory, use C<.> as in:"
31055 #: ../fish/guestfish-commands.pod:44
31058 " copy-out /home .\n"
31064 #: ../fish/guestfish-commands.pod:46
31066 "Wildcards cannot be used in the ordinary command, but you can use them with "
31067 "the help of L</glob> like this:"
31072 #: ../fish/guestfish-commands.pod:49
31075 " glob copy-out /home/* .\n"
31081 #: ../fish/guestfish-commands.pod:51
31087 #: ../fish/guestfish-commands.pod:53
31090 " echo [params ...]\n"
31096 #: ../fish/guestfish-commands.pod:55
31097 msgid "This echos the parameters to the terminal."
31102 #: ../fish/guestfish-commands.pod:57
31108 #: ../fish/guestfish-commands.pod:59
31114 #: ../fish/guestfish-commands.pod:61
31120 #: ../fish/guestfish-commands.pod:63
31129 #: ../fish/guestfish-commands.pod:65
31131 "This is used to edit a file. It downloads the file, edits it locally using "
31132 "your editor, then uploads the result."
31137 #: ../fish/guestfish-commands.pod:68
31139 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
31140 "or C<emacs> you will get those corresponding editors."
31145 #: ../fish/guestfish-commands.pod:72
31151 #: ../fish/guestfish-commands.pod:74
31154 " glob command args...\n"
31160 #: ../fish/guestfish-commands.pod:76
31162 "Expand wildcards in any paths in the args list, and run C<command> "
31163 "repeatedly on each matching path."
31168 #: ../fish/guestfish-commands.pod:79
31169 msgid "See L</WILDCARDS AND GLOBBING>."
31174 #: ../fish/guestfish-commands.pod:81
31180 #: ../fish/guestfish-commands.pod:83
31183 " hexedit <filename|device>\n"
31184 " hexedit <filename|device> <max>\n"
31185 " hexedit <filename|device> <start> <max>\n"
31191 #: ../fish/guestfish-commands.pod:87
31193 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
31199 #: ../fish/guestfish-commands.pod:90
31201 "This command works by downloading potentially the whole file or device, "
31202 "editing it locally, then uploading it. If the file or device is large, you "
31203 "have to specify which part you wish to edit by using C<max> and/or C<start> "
31204 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
31205 "usual modifiers allowed such as C<1M> (1 megabyte)."
31210 #: ../fish/guestfish-commands.pod:97
31211 msgid "For example to edit the first few sectors of a disk you might do:"
31216 #: ../fish/guestfish-commands.pod:100
31219 " hexedit /dev/sda 1M\n"
31225 #: ../fish/guestfish-commands.pod:102
31227 "which would allow you to edit anywhere within the first megabyte of the disk."
31232 #: ../fish/guestfish-commands.pod:105
31233 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
31238 #: ../fish/guestfish-commands.pod:107
31241 " hexedit /dev/sda1 0x400 0x400\n"
31247 #: ../fish/guestfish-commands.pod:109
31248 msgid "(assuming the superblock is in the standard location)."
31253 #: ../fish/guestfish-commands.pod:111
31255 "This command requires the external L<hexedit(1)> program. You can specify "
31256 "another program to use by setting the C<HEXEDITOR> environment variable."
31261 #: ../fish/guestfish-commands.pod:115
31262 msgid "See also L</hexdump>."
31267 #: ../fish/guestfish-commands.pod:117
31273 #: ../fish/guestfish-commands.pod:119
31282 #: ../fish/guestfish-commands.pod:121
31284 "Change the local directory, ie. the current directory of guestfish itself."
31289 #: ../fish/guestfish-commands.pod:124
31290 msgid "Note that C<!cd> won't do what you might expect."
31295 #: ../fish/guestfish-commands.pod:126
31301 #: ../fish/guestfish-commands.pod:128
31307 #: ../fish/guestfish-commands.pod:130
31316 #: ../fish/guestfish-commands.pod:132
31317 msgid "Opens the manual page for guestfish."
31322 #: ../fish/guestfish-commands.pod:134
31328 #: ../fish/guestfish-commands.pod:136
31334 #: ../fish/guestfish-commands.pod:138
31343 #: ../fish/guestfish-commands.pod:140
31352 #: ../fish/guestfish-commands.pod:142
31353 msgid "This is used to view a file."
31358 #: ../fish/guestfish-commands.pod:144
31360 "The default viewer is C<$PAGER>. However if you use the alternate command "
31361 "C<less> you will get the C<less> command specifically."
31366 #: ../fish/guestfish-commands.pod:147
31372 #: ../fish/guestfish-commands.pod:149
31381 #: ../fish/guestfish-commands.pod:151
31383 "Close and reopen the libguestfs handle. It is not necessary to use this "
31384 "normally, because the handle is closed properly when guestfish exits. "
31385 "However this is occasionally useful for testing."
31390 #: ../fish/guestfish-commands.pod:155
31396 #: ../fish/guestfish-commands.pod:157
31399 " sparse filename size\n"
31405 #: ../fish/guestfish-commands.pod:159
31407 "This creates an empty sparse file of the given size, and then adds so it can "
31408 "be further examined."
31413 #: ../fish/guestfish-commands.pod:162
31415 "In all respects it works the same as the L</alloc> command, except that the "
31416 "image file is allocated sparsely, which means that disk blocks are not "
31417 "assigned to the file until they are needed. Sparse disk files only use "
31418 "space when written to, but they are slower and there is a danger you could "
31419 "run out of real disk space during a write operation."
31424 #: ../fish/guestfish-commands.pod:172
31430 #: ../fish/guestfish-commands.pod:174
31439 #: ../fish/guestfish-commands.pod:176
31441 "This command returns a list of the optional groups known to the daemon, and "
31442 "indicates which ones are supported by this build of the libguestfs appliance."
31447 #: ../fish/guestfish-commands.pod:180
31448 msgid "See also L<guestfs(3)/AVAILABILITY>."
31453 #: ../fish/guestfish-commands.pod:182
31459 #: ../fish/guestfish-commands.pod:184
31462 " time command args...\n"
31468 #: ../fish/guestfish-commands.pod:186
31470 "Run the command as usual, but print the elapsed time afterwards. This can "
31471 "be useful for benchmarking operations."
31476 #: ../test-tool/libguestfs-test-tool.pod:5
31477 msgid "libguestfs-test-tool - End user tests for libguestfs"
31482 #: ../test-tool/libguestfs-test-tool.pod:9
31485 " libguestfs-test-tool [--options]\n"
31491 #: ../test-tool/libguestfs-test-tool.pod:13
31493 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
31494 "and developers, to allow them to check basic libguestfs functionality is "
31495 "working. This is needed because libguestfs occasionally breaks for reasons "
31496 "beyond our control: usually because of changes in the underlying qemu or "
31497 "kernel packages, or the host environment."
31502 #: ../test-tool/libguestfs-test-tool.pod:20
31503 msgid "If you suspect a problem in libguestfs, then just run:"
31508 #: ../test-tool/libguestfs-test-tool.pod:22
31511 " libguestfs-test-tool\n"
31517 #: ../test-tool/libguestfs-test-tool.pod:24
31518 msgid "It will print lots of diagnostic messages."
31523 #: ../test-tool/libguestfs-test-tool.pod:26
31524 msgid "If it runs to completion successfully, you will see this near the end:"
31529 #: ../test-tool/libguestfs-test-tool.pod:28
31532 " ===== TEST FINISHED OK =====\n"
31538 #: ../test-tool/libguestfs-test-tool.pod:30
31539 msgid "and the test tool will exit with code 0."
31544 #: ../test-tool/libguestfs-test-tool.pod:32
31546 "If it fails (and/or exits with non-zero error code), please paste the "
31547 "B<complete, unedited> output of the test tool into a bug report. More "
31548 "information about reporting bugs can be found on the L<http://libguestfs.org/"
31554 #: ../test-tool/libguestfs-test-tool.pod:41
31560 #: ../test-tool/libguestfs-test-tool.pod:43
31561 msgid "Display short usage information and exit."
31566 #: ../test-tool/libguestfs-test-tool.pod:45
31567 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
31572 #: ../test-tool/libguestfs-test-tool.pod:47
31574 "Pass an alternate name for the helper program. libguestfs-test-tool will "
31575 "normally look in the C<$libexec> directory that was configured when the tool "
31581 #: ../test-tool/libguestfs-test-tool.pod:51
31582 msgid "I<--qemu qemu_binary>"
31587 #: ../test-tool/libguestfs-test-tool.pod:53
31589 "If you have downloaded another qemu binary, point this option at the full "
31590 "path of the binary to try it."
31595 #: ../test-tool/libguestfs-test-tool.pod:56
31596 msgid "I<--qemudir qemu_source_dir>"
31601 #: ../test-tool/libguestfs-test-tool.pod:58
31603 "If you have compiled qemu from source, point this option at the source "
31604 "directory to try it."
31609 #: ../test-tool/libguestfs-test-tool.pod:61
31610 msgid "I<--timeout N>"
31615 #: ../test-tool/libguestfs-test-tool.pod:63
31617 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
31618 "does not usually need to be adjusted unless your machine is very slow."
31623 #: ../test-tool/libguestfs-test-tool.pod:69
31624 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
31629 #: ../test-tool/libguestfs-test-tool.pod:71
31631 "If you have compiled another version of qemu from source and would like to "
31632 "try that, then you can use the I<--qemudir> option to point to the qemu "
31633 "source directory."
31638 #: ../test-tool/libguestfs-test-tool.pod:75
31640 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
31641 "option to point to the binary."
31646 #: ../test-tool/libguestfs-test-tool.pod:78
31648 "When using an alternate qemu with libguestfs, usually you would need to "
31649 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
31650 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
31651 "use either of the I<--qemudir> or I<--qemu> options."
31656 #: ../test-tool/libguestfs-test-tool.pod:85
31658 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
31659 "I<1> if there was an error."
31664 #: ../test-tool/libguestfs-test-tool.pod:92
31665 msgid "/usr/libexec/libguestfs-test-tool-helper"
31670 #: ../test-tool/libguestfs-test-tool.pod:94
31672 "This helper program is run inside the appliance and provides additional "
31678 #: ../test-tool/libguestfs-test-tool.pod:97
31679 msgid "/usr/bin/mkisofs"
31684 #: ../test-tool/libguestfs-test-tool.pod:99
31686 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
31687 "which is used as part of the tests."
31692 #: ../test-tool/libguestfs-test-tool.pod:106
31694 "For the full list of environment variables which may affect libguestfs, "
31695 "please see the L<guestfs(3)> manual page."
31700 #: ../test-tool/libguestfs-test-tool.pod:111
31701 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
31706 #: ../test-tool/libguestfs-test-tool.pod:121
31707 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
31712 #: ../fuse/guestmount.pod:5
31714 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
31719 #: ../fuse/guestmount.pod:9
31722 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
31728 #: ../fuse/guestmount.pod:11
31731 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
31737 #: ../fuse/guestmount.pod:13
31740 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
31746 #: ../fuse/guestmount.pod:17
31748 "You must I<not> use C<guestmount> in read-write mode on live virtual "
31749 "machines. If you do this, you risk disk corruption in the VM."
31754 #: ../fuse/guestmount.pod:22
31756 "The guestmount program can be used to mount virtual machine filesystems and "
31757 "other disk images on the host. It uses libguestfs for access to the guest "
31758 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
31759 "a mountable device."
31764 #: ../fuse/guestmount.pod:27
31766 "Along with other options, you have to give at least one device (I<-a> "
31767 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
31768 "option) or use the I<-i> inspection option. How this works is better "
31769 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
31775 #: ../fuse/guestmount.pod:33
31777 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
31778 "by you, and the filesystem will not be visible to any other users unless you "
31779 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
31780 "the filesystem, use the C<fusermount -u> command."
31785 #: ../fuse/guestmount.pod:41
31787 "For a typical Windows guest which has its main filesystem on the first "
31793 #: ../fuse/guestmount.pod:44
31796 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
31802 #: ../fuse/guestmount.pod:46
31804 "For a typical Linux guest which has a /boot filesystem on the first "
31805 "partition, and the root filesystem on a logical volume:"
31810 #: ../fuse/guestmount.pod:49
31813 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
31819 #: ../fuse/guestmount.pod:51
31820 msgid "To get libguestfs to detect guest mountpoints for you:"
31825 #: ../fuse/guestmount.pod:53
31828 " guestmount -a guest.img -i --ro /mnt\n"
31834 #: ../fuse/guestmount.pod:55
31835 msgid "For a libvirt guest called \"Guest\" you could do:"
31840 #: ../fuse/guestmount.pod:57
31843 " guestmount -d Guest -i --ro /mnt\n"
31849 #: ../fuse/guestmount.pod:59
31851 "If you don't know what filesystems are contained in a guest or disk image, "
31852 "use L<virt-filesystems(1)> first:"
31857 #: ../fuse/guestmount.pod:62
31860 " virt-filesystems MyGuest\n"
31866 #: ../fuse/guestmount.pod:64
31868 "If you want to trace the libguestfs calls but without excessive debugging "
31869 "information, we recommend:"
31874 #: ../fuse/guestmount.pod:67
31877 " guestmount [...] --trace /mnt\n"
31883 #: ../fuse/guestmount.pod:69
31884 msgid "If you want to debug the program, we recommend:"
31889 #: ../fuse/guestmount.pod:71
31892 " guestmount [...] --trace --verbose /mnt\n"
31898 #: ../fuse/guestmount.pod:77
31899 msgid "B<-a image> | B<--add image>"
31904 #: ../fuse/guestmount.pod:79
31905 msgid "Add a block device or virtual machine image."
31910 #: ../fuse/guestmount.pod:84
31911 msgid "B<-c URI> | B<--connect URI>"
31916 #: ../fuse/guestmount.pod:90
31917 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
31922 #: ../fuse/guestmount.pod:96
31923 msgid "B<--dir-cache-timeout N>"
31928 #: ../fuse/guestmount.pod:98
31930 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
31931 "seconds. The readdir cache [actually, there are several semi-independent "
31932 "caches] is populated after a readdir(2) call with the stat and extended "
31933 "attributes of the files in the directory, in anticipation that they will be "
31934 "requested soon after."
31939 #: ../fuse/guestmount.pod:104
31941 "There is also a different attribute cache implemented by FUSE (see the FUSE "
31942 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
31943 "requests, only cache existing ones."
31948 #: ../fuse/guestmount.pod:115
31949 msgid "B<--format=raw|qcow2|..> | B<--format>"
31954 #: ../fuse/guestmount.pod:122
31956 "If you have untrusted raw-format guest disk images, you should use this "
31957 "option to specify the disk format. This avoids a possible security problem "
31958 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
31959 "guestfs_add_drive_opts>."
31964 #: ../fuse/guestmount.pod:127
31965 msgid "B<--fuse-help>"
31970 #: ../fuse/guestmount.pod:129
31971 msgid "Display help on special FUSE options (see I<-o> below)."
31976 #: ../fuse/guestmount.pod:133
31977 msgid "Display brief help and exit."
31982 #: ../fuse/guestmount.pod:135
31983 msgid "B<-i> | B<--inspector>"
31988 #: ../fuse/guestmount.pod:155
31990 "Mount the named partition or logical volume on the given mountpoint B<in the "
31991 "guest> (this has nothing to do with mountpoints in the host)."
31996 #: ../fuse/guestmount.pod:158
31998 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
31999 "something on C</>."
32004 #: ../fuse/guestmount.pod:171
32005 msgid "B<-n> | B<--no-sync>"
32010 #: ../fuse/guestmount.pod:173
32012 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
32013 "unmounted. If you specify this option, then we don't attempt to sync the "
32014 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
32019 #: ../fuse/guestmount.pod:178
32020 msgid "B<-o option> | B<--option option>"
32025 #: ../fuse/guestmount.pod:180
32026 msgid "Pass extra options to FUSE."
32031 #: ../fuse/guestmount.pod:182
32033 "To get a list of all the extra options supported by FUSE, use the command "
32034 "below. Note that only the FUSE I<-o> options can be passed, and only some "
32035 "of them are a good idea."
32040 #: ../fuse/guestmount.pod:186
32043 " guestmount --fuse-help\n"
32049 #: ../fuse/guestmount.pod:188
32050 msgid "Some potentially useful FUSE options:"
32055 #: ../fuse/guestmount.pod:192
32056 msgid "B<-o allow_other>"
32061 #: ../fuse/guestmount.pod:194
32062 msgid "Allow other users to see the filesystem."
32067 #: ../fuse/guestmount.pod:196
32068 msgid "B<-o attr_timeout=N>"
32073 #: ../fuse/guestmount.pod:198
32074 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
32079 #: ../fuse/guestmount.pod:200
32080 msgid "B<-o kernel_cache>"
32085 #: ../fuse/guestmount.pod:202
32087 "Allow the kernel to cache files (reduces the number of reads that have to go "
32088 "through the L<guestfs(3)> API). This is generally a good idea if you can "
32089 "afford the extra memory usage."
32094 #: ../fuse/guestmount.pod:206
32095 msgid "B<-o uid=N> B<-o gid=N>"
32100 #: ../fuse/guestmount.pod:208
32102 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
32103 "the chosen values."
32108 #: ../fuse/guestmount.pod:213
32109 msgid "B<-r> | B<--ro>"
32114 #: ../fuse/guestmount.pod:215
32116 "Add devices and mount everything read-only. Also disallow writes and make "
32117 "the disk appear read-only to FUSE."
32122 #: ../fuse/guestmount.pod:218
32124 "This is highly recommended if you are not going to edit the guest disk. If "
32125 "the guest is running and this option is I<not> supplied, then there is a "
32126 "strong risk of disk corruption in the guest. We try to prevent this from "
32127 "happening, but it is not always possible."
32132 #: ../fuse/guestmount.pod:223
32133 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
32138 #: ../fuse/guestmount.pod:227
32139 msgid "Enable SELinux support for the guest."
32144 #: ../fuse/guestmount.pod:229
32145 msgid "B<-v> | B<--verbose>"
32150 #: ../fuse/guestmount.pod:231
32151 msgid "Enable verbose messages from underlying libguestfs."
32156 #: ../fuse/guestmount.pod:233
32157 msgid "B<-V> | B<--version>"
32162 #: ../fuse/guestmount.pod:235
32163 msgid "Display the program version and exit."
32168 #: ../fuse/guestmount.pod:237
32169 msgid "B<-w> | B<--rw>"
32174 #: ../fuse/guestmount.pod:239
32176 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
32177 "FOR READ AND WRITE>."
32182 #: ../fuse/guestmount.pod:242
32183 msgid "B<-x> | B<--trace>"
32188 #: ../fuse/guestmount.pod:244
32189 msgid "Trace libguestfs calls and entry into each FUSE function."
32194 #: ../fuse/guestmount.pod:246
32195 msgid "This also stops the daemon from forking into the background."
32200 #: ../fuse/guestmount.pod:252
32202 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
32203 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
32209 #: ../tools/virt-edit.pl:34
32210 msgid "virt-edit - Edit a file in a virtual machine"
32215 #: ../tools/virt-edit.pl:38
32218 " virt-edit [--options] domname file\n"
32224 #: ../tools/virt-edit.pl:40
32227 " virt-edit [--options] disk.img [disk.img ...] file\n"
32233 #: ../tools/virt-edit.pl:42
32236 " virt-edit [domname|disk.img] file -e 'expr'\n"
32242 #: ../tools/virt-edit.pl:46
32244 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
32245 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
32246 "doing this, but doesn't catch all cases."
32251 #: ../tools/virt-edit.pl:52
32253 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
32254 "the named virtual machine (or disk image)."
32259 #: ../tools/virt-edit.pl:55
32261 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
32262 "you should look at the L<guestfish(1)> tool."
32267 #: ../tools/virt-edit.pl:60
32268 msgid "Edit the named files interactively:"
32273 #: ../tools/virt-edit.pl:62
32276 " virt-edit mydomain /boot/grub/grub.conf\n"
32282 #: ../tools/virt-edit.pl:64
32285 " virt-edit mydomain /etc/passwd\n"
32291 #: ../tools/virt-edit.pl:66
32293 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
32294 "below). To change the init default level to 5:"
32299 #: ../tools/virt-edit.pl:70
32302 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
32308 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:106
32309 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:113
32310 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
32311 msgid "Display brief help."
32316 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:114
32317 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
32318 #: ../tools/virt-tar.pl:121 ../tools/virt-make-fs.pl:171
32319 #: ../tools/virt-list-partitions.pl:72
32320 msgid "Display version number and exit."
32325 #: ../tools/virt-edit.pl:96
32326 msgid "B<--backup extension> | B<-b extension>"
32331 #: ../tools/virt-edit.pl:98
32333 "Create a backup of the original file I<in the guest disk image>. The backup "
32334 "has the original filename with C<extension> added."
32339 #: ../tools/virt-edit.pl:101
32341 "Usually the first character of C<extension> would be a dot C<.> so you would "
32347 #: ../tools/virt-edit.pl:104
32350 " virt-edit -b .orig [etc]\n"
32356 #: ../tools/virt-edit.pl:106
32357 msgid "By default, no backup file is made."
32362 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:128
32363 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:127
32364 #: ../tools/virt-list-partitions.pl:78
32365 msgid "B<--connect URI> | B<-c URI>"
32370 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:130
32371 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:129
32372 #: ../tools/virt-list-partitions.pl:80
32374 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
32375 "to the default libvirt hypervisor."
32380 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:133
32381 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:132
32382 #: ../tools/virt-list-partitions.pl:83
32384 "If you specify guest block devices directly, then libvirt is not used at all."
32389 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:140
32390 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
32391 #: ../tools/virt-tar.pl:139 ../tools/virt-list-partitions.pl:90
32392 msgid "B<--format> raw"
32397 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:142
32398 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:141
32399 #: ../tools/virt-list-partitions.pl:92
32401 "Specify the format of disk images given on the command line. If this is "
32402 "omitted then the format is autodetected from the content of the disk image."
32407 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:146
32408 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:145
32409 #: ../tools/virt-list-partitions.pl:96
32411 "If disk images are requested from libvirt, then this program asks libvirt "
32412 "for this information. In this case, the value of the format parameter is "
32418 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:150
32419 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
32420 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:149
32421 #: ../tools/virt-list-partitions.pl:100
32423 "If working with untrusted raw-format guest disk images, you should ensure "
32424 "the format is always specified."
32429 #: ../tools/virt-edit.pl:141
32430 msgid "B<--expr EXPR> | B<-e EXPR>"
32435 #: ../tools/virt-edit.pl:143
32437 "Instead of launching the external editor, non-interactively apply the Perl "
32438 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
32444 #: ../tools/virt-edit.pl:147
32446 "Be careful to properly quote the expression to prevent it from being altered "
32452 #: ../tools/virt-edit.pl:268
32453 msgid "NON-INTERACTIVE EDITING"
32458 #: ../tools/virt-edit.pl:270
32460 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
32461 "administrator can interactively edit the file."
32466 #: ../tools/virt-edit.pl:273
32468 "There are two ways also to use C<virt-edit> from scripts in order to make "
32469 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
32470 "like this, it's less error-prone to write scripts directly using the "
32471 "libguestfs API and Augeas for configuration file editing.)"
32476 #: ../tools/virt-edit.pl:279
32478 "The first method is to temporarily set C<$EDITOR> to any script or program "
32479 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
32480 "update C<tmpfile> in place however it likes."
32485 #: ../tools/virt-edit.pl:283
32487 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
32488 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
32489 "instances of C<foo> with C<bar> in a file:"
32494 #: ../tools/virt-edit.pl:287
32497 " virt-edit domname filename -e 's/foo/bar/'\n"
32503 #: ../tools/virt-edit.pl:289
32505 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
32506 "For example to delete root's password you could do:"
32511 #: ../tools/virt-edit.pl:292
32514 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
32520 #: ../tools/virt-edit.pl:294
32522 "What really happens is that the snippet is evaluated as a Perl expression "
32523 "for each line of the file. The line, including the final C<\\n>, is passed "
32524 "in C<$_> and the expression should update C<$_> or leave it unchanged."
32529 #: ../tools/virt-edit.pl:299
32531 "To delete a line, set C<$_> to the empty string. For example, to delete the "
32532 "C<apache> user account from the password file you can do:"
32537 #: ../tools/virt-edit.pl:302
32540 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
32546 #: ../tools/virt-edit.pl:304
32548 "To insert a line, prepend or append it to C<$_>. However appending lines to "
32549 "the end of the file is rather difficult this way since there is no concept "
32550 "of \"last line of the file\" - your expression just doesn't get called "
32551 "again. You might want to use the first method (setting C<$EDITOR>) if you "
32557 #: ../tools/virt-edit.pl:310
32559 "The variable C<$lineno> contains the current line number. As is "
32560 "traditional, the first line in the file is number C<1>."
32565 #: ../tools/virt-edit.pl:313
32567 "The return value from the expression is ignored, but the expression may call "
32568 "C<die> in order to abort the whole program, leaving the original file "
32574 #: ../tools/virt-edit.pl:317
32576 "Remember when matching the end of a line that C<$_> may contain the final C<"
32577 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
32578 "newline then neither of these. Thus to match or substitute some text at the "
32579 "end of a line, use this regular expression:"
32584 #: ../tools/virt-edit.pl:322
32587 " /some text(\\r?\\n)?$/\n"
32593 #: ../tools/virt-edit.pl:324
32595 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
32596 "$_> itself (since that would remove all newlines from the file):"
32601 #: ../tools/virt-edit.pl:328
32604 " my $m = $_; chomp $m; $m =~ /some text$/\n"
32610 #: ../tools/virt-edit.pl:334
32616 #: ../tools/virt-edit.pl:336
32618 "If set, this string is used as the editor. It may contain arguments, eg. C<"
32624 #: ../tools/virt-edit.pl:339
32625 msgid "If not set, C<vi> is used."
32630 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:559
32631 #: ../tools/virt-resize.pl:1482 ../tools/virt-list-filesystems.pl:182
32632 #: ../tools/virt-tar.pl:279 ../tools/virt-make-fs.pl:532
32633 #: ../tools/virt-list-partitions.pl:250
32634 msgid "SHELL QUOTING"
32639 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:567
32640 #: ../tools/virt-resize.pl:1484 ../tools/virt-list-filesystems.pl:184
32641 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534
32642 #: ../tools/virt-list-partitions.pl:252
32644 "Libvirt guest names can contain arbitrary characters, some of which have "
32645 "meaning to the shell such as C<#> and space. You may need to quote or "
32646 "escape these characters on the command line. See the shell manual page L<sh"
32647 "(1)> for details."
32651 #: ../tools/virt-edit.pl:352
32653 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-"
32654 "tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, "
32655 "L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
32660 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:598
32661 #: ../tools/virt-resize.pl:1510 ../tools/virt-list-filesystems.pl:202
32662 #: ../tools/virt-tar.pl:301 ../tools/virt-make-fs.pl:564
32663 #: ../tools/virt-list-partitions.pl:269
32669 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:600
32670 #: ../tools/virt-resize.pl:1512 ../tools/virt-list-filesystems.pl:204
32671 #: ../tools/virt-tar.pl:303 ../tools/virt-make-fs.pl:566
32672 #: ../tools/virt-list-partitions.pl:271
32673 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
32678 #: ../tools/virt-edit.pl:370 ../tools/virt-list-partitions.pl:275
32679 msgid "Copyright (C) 2009-2010 Red Hat Inc."
32684 #: ../tools/virt-win-reg.pl:37
32686 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
32691 #: ../tools/virt-win-reg.pl:41
32694 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
32700 #: ../tools/virt-win-reg.pl:43
32703 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
32709 #: ../tools/virt-win-reg.pl:45
32712 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
32718 #: ../tools/virt-win-reg.pl:47
32721 " virt-win-reg --merge domname [input.reg ...]\n"
32727 #: ../tools/virt-win-reg.pl:49
32730 " virt-win-reg [--options] disk.img ... # instead of domname\n"
32736 #: ../tools/virt-win-reg.pl:53
32738 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
32739 "virtual machines. If you do this, you I<will> get irreversible disk "
32740 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
32741 "but doesn't catch all cases."
32746 #: ../tools/virt-win-reg.pl:58
32748 "Modifying the Windows Registry is an inherently risky operation. The format "
32749 "is deliberately obscure and undocumented, and Registry changes can leave the "
32750 "system unbootable. Therefore when using the C<--merge> option, make sure "
32751 "you have a reliable backup first."
32756 #: ../tools/virt-win-reg.pl:65
32758 "This program can export and merge Windows Registry entries from a Windows "
32764 #: ../tools/virt-win-reg.pl:68
32766 "The first parameter is the libvirt guest name or the raw disk image of a "
32772 #: ../tools/virt-win-reg.pl:71
32774 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
32775 "exported (recursively). For example:"
32780 #: ../tools/virt-win-reg.pl:74
32783 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
32789 #: ../tools/virt-win-reg.pl:76
32791 "You can also display single values from within registry keys, for example:"
32796 #: ../tools/virt-win-reg.pl:79
32799 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
32800 " $ virt-win-reg Windows7 $cvkey ProductName\n"
32801 " Windows 7 Enterprise\n"
32807 #: ../tools/virt-win-reg.pl:83
32809 "With C<--merge>, you can merge a textual regedit file into the Windows "
32815 #: ../tools/virt-win-reg.pl:86
32818 " $ virt-win-reg --merge Windows7 changes.reg\n"
32824 #: ../tools/virt-win-reg.pl:88 ../tools/virt-tar.pl:45
32830 #: ../tools/virt-win-reg.pl:90
32832 "This program is only meant for simple access to the registry. If you want "
32833 "to do complicated things with the registry, we suggest you download the "
32834 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
32835 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
32836 "L<hivexregedit(1)>."
32841 #: ../tools/virt-win-reg.pl:120 ../tools/virt-make-fs.pl:177
32847 #: ../tools/virt-win-reg.pl:122 ../tools/virt-resize.pl:498
32848 msgid "Enable debugging messages."
32853 #: ../tools/virt-win-reg.pl:157
32859 #: ../tools/virt-win-reg.pl:159
32861 "In merge mode, this merges a textual regedit file into the Windows Registry "
32862 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
32863 "displays or exports Registry entries instead."
32868 #: ../tools/virt-win-reg.pl:163
32870 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
32871 "result in disk corruption. However exporting (without this flag) is always "
32877 #: ../tools/virt-win-reg.pl:171
32878 msgid "B<--encoding> UTF-16LE|ASCII"
32883 #: ../tools/virt-win-reg.pl:173
32885 "When merging (only), you may need to specify the encoding for strings to be "
32886 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
32887 "(3)/ENCODING STRINGS>."
32892 #: ../tools/virt-win-reg.pl:177
32894 "The default is to use UTF-16LE, which should work with recent versions of "
32900 #: ../tools/virt-win-reg.pl:402
32901 msgid "SUPPORTED SYSTEMS"
32906 #: ../tools/virt-win-reg.pl:404
32908 "The program currently supports Windows NT-derived guests starting with "
32909 "Windows XP through to at least Windows 7."
32914 #: ../tools/virt-win-reg.pl:407
32916 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
32917 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
32918 "and C<HKEY_USERS\\.DEFAULT>."
32923 #: ../tools/virt-win-reg.pl:411
32925 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
32931 #: ../tools/virt-win-reg.pl:414
32933 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
32939 #: ../tools/virt-win-reg.pl:417
32945 #: ../tools/virt-win-reg.pl:419
32947 "C<virt-win-reg> expects that regedit files have already been reencoded in "
32948 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
32949 "style line endings. Since Windows regedit files are often in UTF-16LE with "
32950 "Windows-style line endings, you may need to reencode the whole file before "
32951 "or after processing."
32956 #: ../tools/virt-win-reg.pl:425
32958 "To reencode a file from Windows format to Linux (before processing it with "
32959 "the C<--merge> option), you would do something like this:"
32964 #: ../tools/virt-win-reg.pl:428
32967 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
32973 #: ../tools/virt-win-reg.pl:430
32975 "To go in the opposite direction, after exporting and before sending the file "
32976 "to a Windows user, do something like this:"
32981 #: ../tools/virt-win-reg.pl:433
32984 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
32990 #: ../tools/virt-win-reg.pl:435
32991 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
32996 #: ../tools/virt-win-reg.pl:437
32998 "If you are unsure about the current encoding, use the L<file(1)> command. "
32999 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
33000 "style (CRLF) line endings, like this:"
33005 #: ../tools/virt-win-reg.pl:441
33008 " $ file software.reg\n"
33009 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
33010 " with CRLF line terminators\n"
33016 #: ../tools/virt-win-reg.pl:445
33017 msgid "This file would need conversion before you could C<--merge> it."
33022 #: ../tools/virt-win-reg.pl:447
33023 msgid "CurrentControlSet etc."
33028 #: ../tools/virt-win-reg.pl:449
33030 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
33031 "Registry at the level of the hive file, and therefore you cannot modify "
33037 #: ../tools/virt-win-reg.pl:453
33039 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
33040 "circumstances it might refer to another control set. The way to find out is "
33041 "to look at the C<HKLM\\SYSTEM\\Select> key:"
33046 #: ../tools/virt-win-reg.pl:457
33049 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
33050 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
33051 " \"Current\"=dword:00000001\n"
33052 " \"Default\"=dword:00000001\n"
33053 " \"Failed\"=dword:00000000\n"
33054 " \"LastKnownGood\"=dword:00000002\n"
33060 #: ../tools/virt-win-reg.pl:464
33061 msgid "\"Current\" is the one which Windows will choose when it boots."
33066 #: ../tools/virt-win-reg.pl:466
33068 "Similarly, other C<Current...> keys in the path may need to be replaced."
33073 #: ../tools/virt-win-reg.pl:469
33074 msgid "WINDOWS TIPS"
33079 #: ../tools/virt-win-reg.pl:471
33081 "Note that some of these tips modify the guest disk image. The guest I<must> "
33082 "be shut off, else you will get disk corruption."
33087 #: ../tools/virt-win-reg.pl:474
33088 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
33093 #: ../tools/virt-win-reg.pl:476
33095 "Prepare a DOS batch script, VBScript or executable. Upload this using "
33096 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
33097 "is uploaded into C<C:\\>:"
33102 #: ../tools/virt-win-reg.pl:480
33105 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
33111 #: ../tools/virt-win-reg.pl:482
33112 msgid "Prepare a regedit file containing the registry change:"
33117 #: ../tools/virt-win-reg.pl:484
33120 " cat > test.reg <<'EOF'\n"
33121 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
33122 " \"Test\"=\"c:\\\\test.bat\"\n"
33129 #: ../tools/virt-win-reg.pl:489
33131 "In this example we use the key C<RunOnce> which means that the script will "
33132 "run precisely once when the first user logs in. If you want it to run every "
33133 "time a user logs in, replace C<RunOnce> with C<Run>."
33138 #: ../tools/virt-win-reg.pl:493
33139 msgid "Now update the registry:"
33144 #: ../tools/virt-win-reg.pl:495
33147 " virt-win-reg --merge WindowsGuest test.reg\n"
33153 #: ../tools/virt-win-reg.pl:497
33154 msgid "INSTALLING A SERVICE"
33159 #: ../tools/virt-win-reg.pl:499
33161 "This section assumes you are familiar with Windows services, and you either "
33162 "have a program which handles the Windows Service Control Protocol directly "
33163 "or you want to run any program using a service wrapper like SrvAny or the "
33169 #: ../tools/virt-win-reg.pl:504
33171 "First upload the program and optionally the service wrapper. In this case "
33172 "the test program is called C<test.exe> and we are using the RHSrvAny wrapper:"
33177 #: ../tools/virt-win-reg.pl:508
33180 " guestfish -i -d WindowsGuest <<EOF\n"
33181 " upload rhsrvany.exe /rhsrvany.exe\n"
33182 " upload test.exe /test.exe\n"
33189 #: ../tools/virt-win-reg.pl:513
33191 "Prepare a regedit file containing the registry changes. In this example, "
33192 "the first registry change is needed for the service itself or the service "
33193 "wrapper (if used). The second registry change is only needed because I am "
33194 "using the RHSrvAny service wrapper."
33199 #: ../tools/virt-win-reg.pl:518
33202 " cat > service.reg <<'EOF'\n"
33203 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
33204 " \"Type\"=dword:00000010\n"
33205 " \"Start\"=dword:00000002\n"
33206 " \"ErrorControl\"=dword:00000001\n"
33207 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
33208 " \"DisplayName\"=\"RHSrvAny\"\n"
33209 " \"ObjectName\"=\"NetworkService\"\n"
33215 #: ../tools/virt-win-reg.pl:527
33218 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
33219 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
33220 " \"PWD\"=\"c:\\\\Temp\"\n"
33227 #: ../tools/virt-win-reg.pl:538
33229 "For use of C<ControlSet001> see the section above in this manual page. You "
33230 "may need to adjust this according to the control set that is in use by the "
33236 #: ../tools/virt-win-reg.pl:544
33238 "C<\"ObjectName\"> controls the privileges that the service will have. An "
33239 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
33240 "privileged account."
33245 #: ../tools/virt-win-reg.pl:550
33247 "For the meaning of the magic numbers, see this Microsoft KB article: "
33248 "L<http://support.microsoft.com/kb/103000>."
33253 #: ../tools/virt-win-reg.pl:555
33254 msgid "Update the registry:"
33259 #: ../tools/virt-win-reg.pl:557
33262 " virt-win-reg --merge WindowsGuest service.reg\n"
33268 #: ../tools/virt-win-reg.pl:561
33270 "Be careful when passing parameters containing C<\\> (backslash) in the "
33271 "shell. Usually you will have to use 'single quotes' or double backslashes "
33272 "(but not both) to protect them from the shell."
33277 #: ../tools/virt-win-reg.pl:565
33278 msgid "Paths and value names are case-insensitive."
33283 #: ../tools/virt-win-reg.pl:574
33285 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
33286 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
33287 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
33292 #: ../tools/virt-win-reg.pl:589 ../tools/virt-make-fs.pl:555
33294 "When reporting bugs, please enable debugging and capture the I<complete> "
33300 #: ../tools/virt-win-reg.pl:592
33303 " export LIBGUESTFS_DEBUG=1\n"
33304 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
33310 #: ../tools/virt-win-reg.pl:595
33312 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
33318 #: ../tools/virt-win-reg.pl:604 ../tools/virt-resize.pl:1516
33319 #: ../tools/virt-make-fs.pl:570
33320 msgid "Copyright (C) 2010 Red Hat Inc."
33325 #: ../tools/virt-resize.pl:42
33326 msgid "virt-resize - Resize a virtual machine disk"
33331 #: ../tools/virt-resize.pl:46
33334 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
33335 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
33336 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
33342 #: ../tools/virt-resize.pl:52
33344 "Virt-resize is a tool which can resize a virtual machine disk, making it "
33345 "larger or smaller overall, and resizing or deleting any partitions contained "
33351 #: ../tools/virt-resize.pl:56
33353 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
33354 "not> be used on live virtual machines - for consistent results, shut the "
33355 "virtual machine down before resizing it."
33360 #: ../tools/virt-resize.pl:60
33362 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
33363 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
33368 #: ../tools/virt-resize.pl:66
33370 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
33371 "fill the extra 5GB of space."
33375 #: ../tools/virt-resize.pl:69
33378 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
33379 " virt-filesystems --long -h --all -a olddisk\n"
33380 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
33381 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
33387 #: ../tools/virt-resize.pl:74
33389 "As above, but make the /boot partition 200MB bigger, while giving the "
33390 "remaining space to /dev/sda2:"
33395 #: ../tools/virt-resize.pl:77
33398 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
33404 #: ../tools/virt-resize.pl:79
33405 msgid "As above, but the output format will be uncompressed qcow2:"
33410 #: ../tools/virt-resize.pl:81
33413 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
33414 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
33420 #: ../tools/virt-resize.pl:84
33421 msgid "DETAILED USAGE"
33426 #: ../tools/virt-resize.pl:86
33427 msgid "EXPANDING A VIRTUAL MACHINE DISK"
33432 #: ../tools/virt-resize.pl:90
33433 msgid "1. Shut down the virtual machine"
33438 #: ../tools/virt-resize.pl:92
33439 msgid "2. Locate input disk image"
33444 #: ../tools/virt-resize.pl:94
33446 "Locate the input disk image (ie. the file or device on the host containing "
33447 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
33448 "dumpxml> like this to find the disk image name:"
33453 #: ../tools/virt-resize.pl:98
33456 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
33457 " Found 1 nodes:\n"
33459 " <source dev=\"/dev/vg/lv_guest\" />\n"
33465 #: ../tools/virt-resize.pl:103
33466 msgid "3. Look at current sizing"
33471 #: ../tools/virt-resize.pl:105
33472 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
33477 #: ../tools/virt-resize.pl:108
33480 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
33481 " Name Type Size Parent\n"
33482 " /dev/sda1 partition 101M /dev/sda\n"
33483 " /dev/sda2 partition 7.9G /dev/sda\n"
33484 " /dev/sda device 8.0G -\n"
33490 #: ../tools/virt-resize.pl:114
33492 "(This example is a virtual machine with an 8 GB disk which we would like to "
33493 "expand up to 10 GB)."
33498 #: ../tools/virt-resize.pl:117
33499 msgid "4. Create output disk"
33504 #: ../tools/virt-resize.pl:119
33506 "Virt-resize cannot do in-place disk modifications. You have to have space "
33507 "to store the resized output disk."
33512 #: ../tools/virt-resize.pl:122
33514 "To store the resized disk image in a file, create a file of a suitable size:"
33519 #: ../tools/virt-resize.pl:125
33522 " # rm -f outdisk\n"
33523 " # truncate -s 10G outdisk\n"
33529 #: ../tools/virt-resize.pl:128
33530 msgid "Or use L<lvcreate(1)> to create a logical volume:"
33535 #: ../tools/virt-resize.pl:130
33538 " # lvcreate -L 10G -n lv_name vg_name\n"
33544 #: ../tools/virt-resize.pl:132
33545 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
33550 #: ../tools/virt-resize.pl:134
33553 " # virsh pool-list\n"
33554 " # virsh vol-create-as poolname newvol 10G\n"
33560 #: ../tools/virt-resize.pl:137
33566 #: ../tools/virt-resize.pl:139
33568 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
33569 "file) and the output disk. The output disk is the one created in the "
33575 #: ../tools/virt-resize.pl:143
33578 " # virt-resize indisk outdisk\n"
33584 #: ../tools/virt-resize.pl:145
33586 "This command just copies disk image C<indisk> to disk image C<outdisk> "
33587 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
33588 "larger, then an extra, empty partition is created at the end of the disk "
33589 "covering the extra space. If C<outdisk> is smaller, then it will give an "
33595 #: ../tools/virt-resize.pl:151
33597 "More realistically you'd want to expand existing partitions in the disk "
33598 "image by passing extra options (for the full list see the L</OPTIONS> "
33604 #: ../tools/virt-resize.pl:155
33606 "L</--expand> is the most useful option. It expands the named partition "
33607 "within the disk to fill any extra space:"
33612 #: ../tools/virt-resize.pl:158
33615 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
33621 #: ../tools/virt-resize.pl:160
33623 "(In this case, an extra partition is I<not> created at the end of the disk, "
33624 "because there will be no unused space)."
33629 #: ../tools/virt-resize.pl:163
33631 "L</--resize> is the other commonly used option. The following would "
33632 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
33633 "rest of the available space:"
33638 #: ../tools/virt-resize.pl:167
33641 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
33642 " indisk outdisk\n"
33648 #: ../tools/virt-resize.pl:170
33650 "If the expanded partition in the image contains a filesystem or LVM PV, then "
33651 "if virt-resize knows how, it will resize the contents, the equivalent of "
33652 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
33653 ">. However virt-resize does not know how to resize some filesystems, so you "
33654 "would have to online resize them after booting the guest."
33659 #: ../tools/virt-resize.pl:177
33660 msgid "Other options are covered below."
33665 #: ../tools/virt-resize.pl:179
33671 #: ../tools/virt-resize.pl:181
33672 msgid "Thoroughly test the new disk image I<before> discarding the old one."
33677 #: ../tools/virt-resize.pl:183
33678 msgid "If you are using libvirt, edit the XML to point at the new disk:"
33683 #: ../tools/virt-resize.pl:185
33686 " # virsh edit guestname\n"
33692 #: ../tools/virt-resize.pl:187
33694 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
33695 "html#elementsDisks>"
33700 #: ../tools/virt-resize.pl:190
33701 msgid "Then start up the domain with the new, resized disk:"
33706 #: ../tools/virt-resize.pl:192
33709 " # virsh start guestname\n"
33715 #: ../tools/virt-resize.pl:194
33717 "and check that it still works. See also the L</NOTES> section below for "
33718 "additional information."
33723 #: ../tools/virt-resize.pl:197
33724 msgid "7. Resize LVs etc inside the guest"
33729 #: ../tools/virt-resize.pl:199
33730 msgid "(This can also be done offline using L<guestfish(1)>)"
33735 #: ../tools/virt-resize.pl:201
33737 "Once the guest has booted you should see the new space available, at least "
33738 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
33739 "may need to resize LVs inside PVs, and also resize filesystem types that "
33740 "virt-resize does not know how to expand."
33745 #: ../tools/virt-resize.pl:208
33746 msgid "SHRINKING A VIRTUAL MACHINE DISK"
33751 #: ../tools/virt-resize.pl:210
33753 "Shrinking is somewhat more complex than expanding, and only an overview is "
33759 #: ../tools/virt-resize.pl:213
33761 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
33762 "filesystems). The user has to shrink content before passing the disk image "
33763 "to virt-resize, and virt-resize will check that the content has been shrunk "
33769 #: ../tools/virt-resize.pl:218
33770 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
33775 #: ../tools/virt-resize.pl:220
33777 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
33778 "steps 3 and 4 above to allocate a new disk image."
33783 #: ../tools/virt-resize.pl:223
33785 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
33790 #: ../tools/virt-resize.pl:226
33791 msgid "IGNORING OR DELETING PARTITIONS"
33796 #: ../tools/virt-resize.pl:228
33798 "virt-resize also gives a convenient way to ignore or delete partitions when "
33799 "copying from the input disk to the output disk. Ignoring a partition speeds "
33800 "up the copy where you don't care about the existing contents of a "
33801 "partition. Deleting a partition removes it completely, but note that it "
33802 "also renumbers any partitions after the one which is deleted, which can "
33803 "leave some guests unbootable."
33808 #: ../tools/virt-resize.pl:235
33809 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
33814 #: ../tools/virt-resize.pl:237
33816 "If the input disk is in qcow2 format, then you may prefer that the output is "
33817 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
33818 "the fly. The output format is simply determined by the format of the empty "
33819 "output container that you provide. Thus to create qcow2 output, use:"
33824 #: ../tools/virt-resize.pl:243
33827 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
33833 #: ../tools/virt-resize.pl:245
33834 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
33839 #: ../tools/virt-resize.pl:247
33840 msgid "Similarly, to get non-sparse raw output use:"
33845 #: ../tools/virt-resize.pl:249
33848 " fallocate -l size outdisk\n"
33854 #: ../tools/virt-resize.pl:251
33856 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
33857 "dev/zero of=outdisk bs=1M count=..>)"
33862 #: ../tools/virt-resize.pl:264
33863 msgid "Display help."
33868 #: ../tools/virt-resize.pl:278
33869 msgid "B<--resize part=size>"
33874 #: ../tools/virt-resize.pl:280
33876 "Resize the named partition (expanding or shrinking it) so that it has the "
33882 #: ../tools/virt-resize.pl:283
33884 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
33885 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
33886 "Exabytes; or as a percentage of the current size; or as a relative number or "
33887 "percentage. For example:"
33892 #: ../tools/virt-resize.pl:288
33895 " --resize /dev/sda2=10G\n"
33901 #: ../tools/virt-resize.pl:290
33904 " --resize /dev/sda4=90%\n"
33910 #: ../tools/virt-resize.pl:292
33913 " --resize /dev/sda2=+1G\n"
33919 #: ../tools/virt-resize.pl:294
33922 " --resize /dev/sda2=-200M\n"
33928 #: ../tools/virt-resize.pl:296
33931 " --resize /dev/sda1=+128K\n"
33937 #: ../tools/virt-resize.pl:298
33940 " --resize /dev/sda1=+10%\n"
33946 #: ../tools/virt-resize.pl:300
33949 " --resize /dev/sda1=-10%\n"
33955 #: ../tools/virt-resize.pl:302
33957 "You can increase the size of any partition. Virt-resize will expand the "
33958 "direct content of the partition if it knows how (see C<--expand> below)."
33963 #: ../tools/virt-resize.pl:306
33965 "You can only I<decrease> the size of partitions that contain filesystems or "
33966 "PVs which have already been shrunk. Virt-resize will check this has been "
33967 "done before proceeding, or else will print an error (see also C<--resize-"
33973 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
33974 #: ../tools/virt-resize.pl:420
33975 msgid "You can give this option multiple times."
33980 #: ../tools/virt-resize.pl:317
33981 msgid "B<--resize-force part=size>"
33986 #: ../tools/virt-resize.pl:319
33988 "This is the same as C<--resize> except that it will let you decrease the "
33989 "size of any partition. Generally this means you will lose any data which "
33990 "was at the end of the partition you shrink, but you may not care about that "
33991 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
33992 "as a swap partition)."
33997 #: ../tools/virt-resize.pl:325
33998 msgid "See also the C<--ignore> option."
34003 #: ../tools/virt-resize.pl:331
34004 msgid "B<--expand part>"
34009 #: ../tools/virt-resize.pl:333
34011 "Expand the named partition so it uses up all extra space (space left over "
34012 "after any other resize changes that you request have been done)."
34017 #: ../tools/virt-resize.pl:336
34019 "If virt-resize knows how, it will expand the direct content of the "
34020 "partition. For example, if the partition is an LVM PV, it will expand the "
34021 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
34022 "content it doesn't know about alone."
34027 #: ../tools/virt-resize.pl:341
34028 msgid "Currently virt-resize can resize:"
34033 #: ../tools/virt-resize.pl:347
34035 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
34041 #: ../tools/virt-resize.pl:352
34043 "NTFS filesystems contained directly in a partition, if libguestfs was "
34044 "compiled with support for NTFS."
34049 #: ../tools/virt-resize.pl:355
34051 "The filesystem must have been shut down consistently last time it was used. "
34052 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
34053 "consistency check, so at the first boot after resizing Windows will check "
34059 #: ../tools/virt-resize.pl:362
34061 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
34062 "inside the PV, but see the C<--LV-expand> option. The user could also "
34063 "resize LVs as desired after boot."
34068 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
34069 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
34074 #: ../tools/virt-resize.pl:374
34075 msgid "B<--shrink part>"
34080 #: ../tools/virt-resize.pl:376
34082 "Shrink the named partition until the overall disk image fits in the "
34083 "destination. The named partition B<must> contain a filesystem or PV which "
34084 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
34085 "online tools). Virt-resize will check this and give an error if it has not "
34091 #: ../tools/virt-resize.pl:382
34093 "The amount by which the overall disk must be shrunk (after carrying out all "
34094 "other operations requested by the user) is called the \"deficit\". For "
34095 "example, a straight copy (assume no other operations) from a 5GB disk image "
34096 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
34097 "would give an error unless the user specified a partition to shrink and that "
34098 "partition had more than a gigabyte of free space."
34103 #: ../tools/virt-resize.pl:396
34104 msgid "B<--ignore part>"
34109 #: ../tools/virt-resize.pl:398
34111 "Ignore the named partition. Effectively this means the partition is "
34112 "allocated on the destination disk, but the content is not copied across from "
34113 "the source disk. The content of the partition will be blank (all zero "
34119 #: ../tools/virt-resize.pl:409
34120 msgid "B<--delete part>"
34125 #: ../tools/virt-resize.pl:411
34127 "Delete the named partition. It would be more accurate to describe this as "
34128 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
34129 "the original disk image is left intact."
34134 #: ../tools/virt-resize.pl:415
34136 "Note that when you delete a partition, then anything contained in the "
34137 "partition is also deleted. Furthermore, this causes any partitions that "
34138 "come after to be I<renumbered>, which can easily make your guest unbootable."
34143 #: ../tools/virt-resize.pl:426
34144 msgid "B<--LV-expand logvol>"
34149 #: ../tools/virt-resize.pl:428
34151 "This takes the logical volume and, as a final step, expands it to fill all "
34152 "the space available in its volume group. A typical usage, assuming a Linux "
34153 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
34154 "lv_root> would be:"
34159 #: ../tools/virt-resize.pl:433
34162 " virt-resize indisk outdisk \\\n"
34163 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
34169 #: ../tools/virt-resize.pl:436
34171 "This would first expand the partition (and PV), and then expand the root "
34172 "device to fill the extra space in the PV."
34177 #: ../tools/virt-resize.pl:439
34179 "The contents of the LV are also resized if virt-resize knows how to do "
34180 "that. You can stop virt-resize from trying to expand the content by using "
34181 "the option C<--no-expand-content>."
34186 #: ../tools/virt-resize.pl:443
34187 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
34192 #: ../tools/virt-resize.pl:446
34194 "You can give this option multiple times, I<but> it doesn't make sense to do "
34195 "this unless the logical volumes you specify are all in different volume "
34201 #: ../tools/virt-resize.pl:454
34202 msgid "B<--no-copy-boot-loader>"
34207 #: ../tools/virt-resize.pl:456
34209 "By default, virt-resize copies over some sectors at the start of the disk "
34210 "(up to the beginning of the first partition). Commonly these sectors "
34211 "contain the Master Boot Record (MBR) and the boot loader, and are required "
34212 "in order for the guest to boot correctly."
34217 #: ../tools/virt-resize.pl:461
34219 "If you specify this flag, then this initial copy is not done. You may need "
34220 "to reinstall the boot loader in this case."
34225 #: ../tools/virt-resize.pl:469
34226 msgid "B<--no-extra-partition>"
34231 #: ../tools/virt-resize.pl:471
34233 "By default, virt-resize creates an extra partition if there is any extra, "
34234 "unused space after all resizing has happened. Use this option to prevent "
34235 "the extra partition from being created. If you do this then the extra space "
34236 "will be inaccessible until you run fdisk, parted, or some other partitioning "
34237 "tool in the guest."
34242 #: ../tools/virt-resize.pl:477
34244 "Note that if the surplus space is smaller than 10 MB, no extra partition "
34250 #: ../tools/virt-resize.pl:484
34251 msgid "B<--no-expand-content>"
34256 #: ../tools/virt-resize.pl:486
34258 "By default, virt-resize will try to expand the direct contents of "
34259 "partitions, if it knows how (see C<--expand> option above)."
34264 #: ../tools/virt-resize.pl:489
34266 "If you give the C<--no-expand-content> option then virt-resize will not "
34272 #: ../tools/virt-resize.pl:496
34273 msgid "B<-d> | B<--debug>"
34278 #: ../tools/virt-resize.pl:504
34279 msgid "B<-n> | B<--dryrun>"
34284 #: ../tools/virt-resize.pl:506
34285 msgid "Print a summary of what would be done, but don't do anything."
34290 #: ../tools/virt-resize.pl:512
34291 msgid "B<-q> | B<--quiet>"
34296 #: ../tools/virt-resize.pl:514
34297 msgid "Don't print the summary."
34302 #: ../tools/virt-resize.pl:522
34304 "Specify the format of the input disk image. If this flag is not given then "
34305 "it is auto-detected from the image itself."
34310 #: ../tools/virt-resize.pl:528
34312 "Note that this option I<does not> affect the output format. See L</QCOW2 "
34313 "AND NON-SPARSE RAW FORMATS>."
34318 #: ../tools/virt-resize.pl:535
34319 msgid "B<--output-format> raw"
34324 #: ../tools/virt-resize.pl:537
34326 "Specify the format of the output disk image. If this flag is not given then "
34327 "it is auto-detected from the image itself."
34332 #: ../tools/virt-resize.pl:543
34334 "Note that you still need to create the output disk with the right format. "
34335 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
34340 #: ../tools/virt-resize.pl:1425
34346 #: ../tools/virt-resize.pl:1427
34347 msgid "\"Partition 1 does not end on cylinder boundary.\""
34352 #: ../tools/virt-resize.pl:1429
34354 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
34355 "means the partitions will not be aligned to the ancient CHS geometry. "
34356 "However CHS geometry is meaningless for disks manufactured since the early "
34357 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
34358 "cylinders is not required by any modern operating system."
34363 #: ../tools/virt-resize.pl:1436
34364 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
34369 #: ../tools/virt-resize.pl:1438
34371 "In Windows Vista and later versions, Microsoft switched to using a separate "
34372 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
34373 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
34374 "the boot partition. Doing so seems to break the guest completely. However "
34375 "expanding the second partition (ie. C: drive) should work."
34380 #: ../tools/virt-resize.pl:1445
34382 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
34383 "NTFS partitions have been expanded. This is just a safety check and (unless "
34384 "it find errors) is nothing to worry about."
34389 #: ../tools/virt-resize.pl:1449
34390 msgid "GUEST BOOT STUCK AT \"GRUB\""
34395 #: ../tools/virt-resize.pl:1451
34397 "If a Linux guest does not boot after resizing, and the boot is stuck after "
34398 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
34399 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
34400 "although we think is to do with partition alignment."
34405 #: ../tools/virt-resize.pl:1456
34408 " guestfish -i -a newdisk\n"
34409 " ><fs> cat /boot/grub/device.map\n"
34410 " # check the contents of this file are sensible or\n"
34411 " # edit the file if necessary\n"
34412 " ><fs> grub-install / /dev/vda\n"
34419 #: ../tools/virt-resize.pl:1463
34421 "For more flexible guest reconfiguration, including if you need to specify "
34422 "other parameters to grub-install, use L<virt-rescue(1)>."
34427 #: ../tools/virt-resize.pl:1466
34428 msgid "ALTERNATIVE TOOLS"
34433 #: ../tools/virt-resize.pl:1468
34435 "There are several proprietary tools for resizing partitions. We won't "
34436 "mention any here."
34441 #: ../tools/virt-resize.pl:1471
34443 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
34444 "operations on disk images. They can resize and move partitions, but I don't "
34445 "think they can do anything with the contents, and they certainly don't "
34451 #: ../tools/virt-resize.pl:1476
34453 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
34454 "but at a much lower level. You will probably end up hand-calculating sector "
34455 "offsets, which is something that virt-resize was designed to avoid. If you "
34456 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
34462 #: ../tools/virt-resize.pl:1491
34464 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
34465 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
34466 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
34467 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
34468 "libguestfs.org/>."
34473 #: ../tools/virt-list-filesystems.pl:32
34475 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
34480 #: ../tools/virt-list-filesystems.pl:36
34483 " virt-list-filesystems [--options] domname\n"
34489 #: ../tools/virt-list-filesystems.pl:38
34492 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
34498 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
34500 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
34506 #: ../tools/virt-list-filesystems.pl:45
34508 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
34509 "are contained in a virtual machine or disk image."
34514 #: ../tools/virt-list-filesystems.pl:49
34516 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
34517 "functionality. For more complex cases you should look at the L<guestfish(1)"
34523 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
34524 msgid "B<-l> | B<--long>"
34529 #: ../tools/virt-list-filesystems.pl:108
34531 "With this option, C<virt-list-filesystems> displays the type of each "
34532 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
34537 #: ../tools/virt-list-filesystems.pl:115
34538 msgid "B<-a> | B<--all>"
34543 #: ../tools/virt-list-filesystems.pl:117
34545 "Normally we only show mountable filesystems. If this option is given then "
34546 "swap devices are shown too."
34551 #: ../tools/virt-list-filesystems.pl:191
34553 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
34554 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
34555 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
34560 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:307
34561 msgid "Copyright (C) 2009 Red Hat Inc."
34566 #: ../tools/virt-tar.pl:33
34567 msgid "virt-tar - Extract or upload files to a virtual machine"
34572 #: ../tools/virt-tar.pl:37
34575 " virt-tar [--options] -x domname directory tarball\n"
34581 #: ../tools/virt-tar.pl:39
34584 " virt-tar [--options] -u domname tarball directory\n"
34590 #: ../tools/virt-tar.pl:41
34593 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
34599 #: ../tools/virt-tar.pl:43
34602 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
34607 #: ../tools/virt-tar.pl:47
34609 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-"
34610 "tar-in(1)>, L<virt-tar-out(1)> as replacements."
34615 #: ../tools/virt-tar.pl:52
34616 msgid "Download C</home> from the VM into a local tarball:"
34621 #: ../tools/virt-tar.pl:54
34624 " virt-tar -x domname /home home.tar\n"
34630 #: ../tools/virt-tar.pl:56
34633 " virt-tar -zx domname /home home.tar.gz\n"
34639 #: ../tools/virt-tar.pl:58
34640 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
34645 #: ../tools/virt-tar.pl:60
34648 " virt-tar -u domname uploadstuff.tar /tmp\n"
34654 #: ../tools/virt-tar.pl:62
34657 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
34663 #: ../tools/virt-tar.pl:66
34665 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
34666 "virtual machines. If you do this, you risk disk corruption in the VM. "
34667 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
34672 #: ../tools/virt-tar.pl:71
34674 "You can use C<-x> (extract) on live virtual machines, but you might get "
34675 "inconsistent results or errors if there is filesystem activity inside the "
34676 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
34677 "work, but the only way to guarantee consistent results is if the virtual "
34678 "machine is shut down."
34683 #: ../tools/virt-tar.pl:79
34685 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
34686 "parts of a guest filesystem. There are many possibilities: making backups, "
34687 "uploading data files, snooping on guest activity, fixing or customizing "
34693 #: ../tools/virt-tar.pl:84
34695 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
34696 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
34697 "should look at the L<guestfish(1)> tool."
34702 #: ../tools/virt-tar.pl:88
34704 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
34705 "its contents (recursively) from the virtual machine into a local tarball. "
34706 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
34707 "virtual machine. You cannot use these two options together."
34712 #: ../tools/virt-tar.pl:94
34714 "In addition, you may need to use the C<-z> (gZip) option to enable "
34715 "compression. When uploading, you have to specify C<-z> if the upload file "
34716 "is compressed because virt-tar won't detect this on its own."
34721 #: ../tools/virt-tar.pl:98
34723 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
34724 "example it cannot do PKZip files or bzip2 compression. If you want that "
34725 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
34726 "the L<libguestfs(3)> API)."
34731 #: ../tools/virt-tar.pl:156
34732 msgid "B<-x> | B<--extract> | B<--download>"
34737 #: ../tools/virt-tar.pl:158
34738 msgid "B<-u> | B<--upload>"
34743 #: ../tools/virt-tar.pl:160
34745 "Use C<-x> to extract (download) a directory from a virtual machine to a "
34751 #: ../tools/virt-tar.pl:163
34753 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
34754 "Please read the L</WARNING> section above before using this option."
34759 #: ../tools/virt-tar.pl:167
34760 msgid "You must specify exactly one of these options."
34765 #: ../tools/virt-tar.pl:173
34766 msgid "B<-z> | B<--gzip>"
34771 #: ../tools/virt-tar.pl:175
34772 msgid "Specify that the input or output tarball is gzip-compressed."
34776 #: ../tools/virt-tar.pl:288
34778 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<virt-copy-"
34779 "in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<Sys::"
34780 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
34786 #: ../tools/virt-make-fs.pl:37
34787 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
34792 #: ../tools/virt-make-fs.pl:41
34795 " virt-make-fs [--options] input.tar output.img\n"
34801 #: ../tools/virt-make-fs.pl:43
34804 " virt-make-fs [--options] input.tar.gz output.img\n"
34810 #: ../tools/virt-make-fs.pl:45
34813 " virt-make-fs [--options] directory output.img\n"
34819 #: ../tools/virt-make-fs.pl:49
34821 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
34822 "archive or some files in a directory. It is similar to tools like L<mkisofs"
34823 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
34824 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
34825 "you want to attach these filesystems to existing virtual machines (eg. to "
34826 "import large amounts of read-only data to a VM)."
34831 #: ../tools/virt-make-fs.pl:57
34832 msgid "Basic usage is:"
34837 #: ../tools/virt-make-fs.pl:59
34840 " virt-make-fs input output\n"
34846 #: ../tools/virt-make-fs.pl:61
34848 "where C<input> is either a directory containing files that you want to add, "
34849 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
34850 "C<output> is a disk image. The input type is detected automatically. The "
34851 "output disk image defaults to a raw ext2 image unless you specify extra "
34852 "flags (see L</OPTIONS> below)."
34857 #: ../tools/virt-make-fs.pl:67
34858 msgid "EXTRA SPACE"
34863 #: ../tools/virt-make-fs.pl:69
34865 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
34866 "the files that it contains, but might have extra space. Depending on how "
34867 "you are going to use the output, you might think this extra space is wasted "
34868 "and want to minimize it, or you might want to leave space so that more files "
34869 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
34870 "but you can use the C<--size> flag to leave space in the filesystem if you "
34876 #: ../tools/virt-make-fs.pl:77
34878 "An alternative way to leave extra space but not make the output image any "
34879 "bigger is to use an alternative disk image format (instead of the default "
34880 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
34881 "image format (check your hypervisor supports this before using it). This "
34882 "allows you to choose a large C<--size> but the extra space won't actually be "
34883 "allocated in the image until you try to store something in it."
34887 #: ../tools/virt-make-fs.pl:85
34889 "Don't forget that you can also use local commands including L<resize2fs(8)> "
34890 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
34891 "to build another image from scratch."
34896 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
34897 #: ../tools/virt-make-fs.pl:142
34903 #: ../tools/virt-make-fs.pl:91
34906 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
34912 #: ../tools/virt-make-fs.pl:93
34913 msgid "FILESYSTEM TYPE"
34918 #: ../tools/virt-make-fs.pl:95
34920 "The default filesystem type is C<ext2>. Just about any filesystem type that "
34921 "libguestfs supports can be used (but I<not> read-only formats like "
34922 "ISO9660). Here are some of the more common choices:"
34927 #: ../tools/virt-make-fs.pl:101
34933 #: ../tools/virt-make-fs.pl:103
34935 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
34936 "you are not going to use the filesystem in a way that requires the journal, "
34937 "then this is just wasted overhead."
34942 #: ../tools/virt-make-fs.pl:107
34943 msgid "I<ntfs> or I<vfat>"
34948 #: ../tools/virt-make-fs.pl:109
34949 msgid "Useful if exporting data to a Windows guest."
34954 #: ../tools/virt-make-fs.pl:111
34956 "I<Note for vfat>: The tar archive or local directory must only contain files "
34957 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
34958 "program running within libguestfs is unable to change the ownership of non-"
34959 "root files, since vfat itself does not support this."
34964 #: ../tools/virt-make-fs.pl:116
34970 #: ../tools/virt-make-fs.pl:118
34972 "Lower overhead than C<ext2>, but certain limitations on filename length and "
34973 "total filesystem size."
34978 #: ../tools/virt-make-fs.pl:125
34981 " virt-make-fs --type=minix input minixfs.img\n"
34987 #: ../tools/virt-make-fs.pl:127
34988 msgid "TO PARTITION OR NOT TO PARTITION"
34993 #: ../tools/virt-make-fs.pl:129
34994 msgid "Optionally virt-make-fs can add a partition table to the output disk."
34999 #: ../tools/virt-make-fs.pl:131
35001 "Adding a partition can make the disk image more compatible with certain "
35002 "virtualized operating systems which don't expect to see a filesystem "
35003 "directly located on a block device (Linux doesn't care and will happily "
35004 "handle both types)."
35009 #: ../tools/virt-make-fs.pl:136
35011 "On the other hand, if you have a partition table then the output image is no "
35012 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
35013 "directly on a partitioned disk image. (However libguestfs tools such as "
35014 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
35019 #: ../tools/virt-make-fs.pl:144
35020 msgid "Add an MBR partition:"
35025 #: ../tools/virt-make-fs.pl:146
35028 " virt-make-fs --partition -- input disk.img\n"
35034 #: ../tools/virt-make-fs.pl:148
35036 "If the output disk image could be terabyte-sized or larger, it's better to "
35037 "use an EFI/GPT-compatible partition table:"
35042 #: ../tools/virt-make-fs.pl:151
35045 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
35051 #: ../tools/virt-make-fs.pl:179
35052 msgid "Enable debugging information."
35057 #: ../tools/virt-make-fs.pl:185
35058 msgid "B<--size=E<lt>NE<gt>>"
35063 #: ../tools/virt-make-fs.pl:187
35064 msgid "B<--size=+E<lt>NE<gt>>"
35069 #: ../tools/virt-make-fs.pl:189
35070 msgid "B<-s E<lt>NE<gt>>"
35075 #: ../tools/virt-make-fs.pl:191
35076 msgid "B<-s +E<lt>NE<gt>>"
35081 #: ../tools/virt-make-fs.pl:193
35083 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
35088 #: ../tools/virt-make-fs.pl:196
35090 "If this option is I<not> given, then the output image will be just large "
35091 "enough to contain all the files, with not much wasted space."
35096 #: ../tools/virt-make-fs.pl:199
35098 "To choose a fixed size output disk, specify an absolute number followed by b/"
35099 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
35100 "Petabytes or Exabytes. This must be large enough to contain all the input "
35101 "files, else you will get an error."
35106 #: ../tools/virt-make-fs.pl:204
35108 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
35109 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
35110 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
35111 "the input files, and (approximately) an extra 200 MB free space."
35116 #: ../tools/virt-make-fs.pl:210
35118 "Note that virt-make-fs estimates free space, and therefore will not produce "
35119 "filesystems containing precisely the free space requested. (It is much more "
35120 "expensive and time-consuming to produce a filesystem which has precisely the "
35121 "desired free space)."
35126 #: ../tools/virt-make-fs.pl:219
35127 msgid "B<--format=E<lt>fmtE<gt>>"
35132 #: ../tools/virt-make-fs.pl:221
35133 msgid "B<-F E<lt>fmtE<gt>>"
35138 #: ../tools/virt-make-fs.pl:223
35139 msgid "Choose the output disk image format."
35144 #: ../tools/virt-make-fs.pl:225
35145 msgid "The default is C<raw> (raw disk image)."
35150 #: ../tools/virt-make-fs.pl:227
35152 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
35153 "that would really make sense here is C<qcow2>."
35158 #: ../tools/virt-make-fs.pl:234
35159 msgid "B<--type=E<lt>fsE<gt>>"
35164 #: ../tools/virt-make-fs.pl:236
35165 msgid "B<-t E<lt>fsE<gt>>"
35170 #: ../tools/virt-make-fs.pl:238
35171 msgid "Choose the output filesystem type."
35176 #: ../tools/virt-make-fs.pl:240
35177 msgid "The default is C<ext2>."
35182 #: ../tools/virt-make-fs.pl:242
35184 "Any filesystem which is supported read-write by libguestfs can be used here."
35189 #: ../tools/virt-make-fs.pl:249
35190 msgid "B<--partition>"
35195 #: ../tools/virt-make-fs.pl:251
35196 msgid "B<--partition=E<lt>parttypeE<gt>>"
35201 #: ../tools/virt-make-fs.pl:253
35203 "If specified, this flag adds an MBR partition table to the output disk image."
35208 #: ../tools/virt-make-fs.pl:256
35210 "You can change the partition table type, eg. C<--partition=gpt> for large "
35216 #: ../tools/virt-make-fs.pl:259
35218 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
35219 "might consider the next parameter to be the partition type. For example:"
35224 #: ../tools/virt-make-fs.pl:263
35227 " virt-make-fs --partition input.tar ...\n"
35233 #: ../tools/virt-make-fs.pl:265
35235 "would cause virt-make-fs to think you wanted to use a partition type of "
35236 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
35237 "dash) between options and the input file argument:"
35242 #: ../tools/virt-make-fs.pl:269
35245 " virt-make-fs --partition -- input.tar ...\n"
35250 #: ../tools/virt-make-fs.pl:541
35252 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
35253 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
35254 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
35259 #: ../tools/virt-make-fs.pl:558
35262 " export LIBGUESTFS_DEBUG=1\n"
35263 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
35269 #: ../tools/virt-make-fs.pl:561
35271 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
35277 #: ../tools/virt-list-partitions.pl:32
35279 "virt-list-partitions - List partitions in a virtual machine or disk image"
35284 #: ../tools/virt-list-partitions.pl:36
35287 " virt-list-partitions [--options] domname\n"
35293 #: ../tools/virt-list-partitions.pl:38
35296 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
35302 #: ../tools/virt-list-partitions.pl:45
35304 "C<virt-list-partitions> is a command line tool to list the partitions that "
35305 "are contained in a virtual machine or disk image. It is mainly useful as a "
35306 "first step to using L<virt-resize(1)>."
35311 #: ../tools/virt-list-partitions.pl:50
35313 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
35314 "functionality. For more complex cases you should look at the L<guestfish(1)"
35320 #: ../tools/virt-list-partitions.pl:107
35321 msgid "B<-h> | B<--human-readable>"
35326 #: ../tools/virt-list-partitions.pl:109
35327 msgid "Show sizes in human-readable form (eg. \"1G\")."
35332 #: ../tools/virt-list-partitions.pl:117
35334 "With this option, C<virt-list-partitions> displays the type and size of each "
35335 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
35340 #: ../tools/virt-list-partitions.pl:124
35341 msgid "B<-t> | B<--total>"
35346 #: ../tools/virt-list-partitions.pl:126
35348 "Display the total size of each block device (as a separate row or rows)."
35353 #: ../tools/virt-list-partitions.pl:259
35355 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
35356 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
35357 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."