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: 2010-12-05 10:35+0000\n"
11 "PO-Revision-Date: 2010-09-02 14:46+0100\n"
12 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13 "Language-Team: LANGUAGE <LL@li.org>\n"
16 "Content-Type: text/plain; charset=UTF-8\n"
17 "Content-Transfer-Encoding: 8bit\n"
20 #: ../src/guestfs.pod:1 ../fish/guestfish.pod:1
21 #: ../test-tool/libguestfs-test-tool.pod:1 ../fuse/guestmount.pod:1
22 #: ../tools/virt-edit.pl:30 ../tools/virt-win-reg.pl:33
23 #: ../tools/virt-resize.pl:38 ../tools/virt-list-filesystems.pl:28
24 #: ../tools/virt-tar.pl:29 ../tools/virt-make-fs.pl:33
25 #: ../tools/virt-list-partitions.pl:28
30 #: ../src/guestfs.pod:3 ../fish/guestfish.pod:3
31 #: ../test-tool/libguestfs-test-tool.pod:3 ../fuse/guestmount.pod:3
32 #: ../tools/virt-edit.pl:32 ../tools/virt-win-reg.pl:35
33 #: ../tools/virt-resize.pl:40 ../tools/virt-list-filesystems.pl:30
34 #: ../tools/virt-tar.pl:31 ../tools/virt-make-fs.pl:35
35 #: ../tools/virt-list-partitions.pl:30
40 #: ../src/guestfs.pod:5
41 msgid "guestfs - Library for accessing and modifying virtual machine images"
45 #: ../src/guestfs.pod:7 ../fish/guestfish.pod:7
46 #: ../test-tool/libguestfs-test-tool.pod:7 ../fuse/guestmount.pod:7
47 #: ../tools/virt-edit.pl:36 ../tools/virt-win-reg.pl:39
48 #: ../tools/virt-resize.pl:44 ../tools/virt-list-filesystems.pl:34
49 #: ../tools/virt-tar.pl:35 ../tools/virt-make-fs.pl:39
50 #: ../tools/virt-list-partitions.pl:34
55 #: ../src/guestfs.pod:9
58 " #include <guestfs.h>\n"
63 #: ../src/guestfs.pod:11
66 " guestfs_h *g = guestfs_create ();\n"
67 " guestfs_add_drive (g, \"guest.img\");\n"
68 " guestfs_launch (g);\n"
69 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
70 " guestfs_touch (g, \"/hello\");\n"
71 " guestfs_umount (g, \"/\");\n"
72 " guestfs_sync (g);\n"
73 " guestfs_close (g);\n"
78 #: ../src/guestfs.pod:20
81 " cc prog.c -o prog -lguestfs\n"
83 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
88 #: ../src/guestfs.pod:24 ../fish/guestfish.pod:30
89 #: ../test-tool/libguestfs-test-tool.pod:11 ../fuse/guestmount.pod:20
90 #: ../tools/virt-edit.pl:50 ../tools/virt-win-reg.pl:63
91 #: ../tools/virt-resize.pl:50 ../tools/virt-list-filesystems.pl:40
92 #: ../tools/virt-tar.pl:72 ../tools/virt-make-fs.pl:47
93 #: ../tools/virt-list-partitions.pl:40
98 #: ../src/guestfs.pod:26
100 "Libguestfs is a library for accessing and modifying guest disk images. "
101 "Amongst the things this is good for: making batch configuration changes to "
102 "guests, getting disk used/free statistics (see also: virt-df), migrating "
103 "between virtualization systems (see also: virt-p2v), performing partial "
104 "backups, performing partial guest clones, cloning guests and changing "
105 "registry/UUID/hostname info, and much else besides."
109 #: ../src/guestfs.pod:34
111 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
112 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
113 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
118 #: ../src/guestfs.pod:39
120 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
121 "what filesystem is in each LV, etc.). It can also run commands in the "
122 "context of the guest. Also you can access filesystems over FUSE."
126 #: ../src/guestfs.pod:44
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 "
135 #: ../src/guestfs.pod:49
137 "You don't need to be root to use libguestfs, although obviously you do need "
138 "enough permissions to access the disk images."
142 #: ../src/guestfs.pod:52
144 "Libguestfs is a large API because it can do many things. For a gentle "
145 "introduction, please read the L</API OVERVIEW> section next."
149 #: ../src/guestfs.pod:55
151 "There are also some example programs in the L<guestfs-examples(3)> manual "
156 #: ../src/guestfs.pod:58
161 #: ../src/guestfs.pod:60
163 "This section provides a gentler overview of the libguestfs API. We also try "
164 "to group API calls together, where that may not be obvious from reading "
165 "about the individual calls in the main section of this manual."
169 #: ../src/guestfs.pod:65
174 #: ../src/guestfs.pod:67
176 "Before you can use libguestfs calls, you have to create a handle. Then you "
177 "must add at least one disk image to the handle, followed by launching the "
178 "handle, then performing whatever operations you want, and finally closing "
179 "the handle. By convention we use the single letter C<g> for the name of the "
180 "handle variable, although of course you can use any name you want."
184 #: ../src/guestfs.pod:74
185 msgid "The general structure of all libguestfs-using programs looks like this:"
189 #: ../src/guestfs.pod:77
192 " guestfs_h *g = guestfs_create ();\n"
197 #: ../src/guestfs.pod:79
200 " /* Call guestfs_add_drive additional times if there are\n"
201 " * multiple disk images.\n"
203 " guestfs_add_drive (g, \"guest.img\");\n"
208 #: ../src/guestfs.pod:84
211 " /* Most manipulation calls won't work until you've launched\n"
212 " * the handle 'g'. You have to do this _after_ adding drives\n"
213 " * and _before_ other commands.\n"
215 " guestfs_launch (g);\n"
220 #: ../src/guestfs.pod:90
223 " /* Now you can examine what partitions, LVs etc are available.\n"
225 " char **partitions = guestfs_list_partitions (g);\n"
226 " char **logvols = guestfs_lvs (g);\n"
231 #: ../src/guestfs.pod:95
234 " /* To access a filesystem in the image, you must mount it.\n"
236 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
241 #: ../src/guestfs.pod:99
244 " /* Now you can perform filesystem actions on the guest\n"
247 " guestfs_touch (g, \"/hello\");\n"
252 #: ../src/guestfs.pod:104
255 " /* You only need to call guestfs_sync if you have made\n"
256 " * changes to the guest image. (But if you've made changes\n"
257 " * then you *must* sync). See also: guestfs_umount and\n"
258 " * guestfs_umount_all calls.\n"
260 " guestfs_sync (g);\n"
265 #: ../src/guestfs.pod:111
268 " /* Close the handle 'g'. */\n"
269 " guestfs_close (g);\n"
274 #: ../src/guestfs.pod:114
276 "The code above doesn't include any error checking. In real code you should "
277 "check return values carefully for errors. In general all functions that "
278 "return integers return C<-1> on error, and all functions that return "
279 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
280 "how to handle errors, and consult the documentation for each function call "
281 "below to see precisely how they return error indications."
285 #: ../src/guestfs.pod:122
290 #: ../src/guestfs.pod:124
292 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
293 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
294 "actual block device, or simply an empty file of zeroes that you have created "
295 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
300 #: ../src/guestfs.pod:130
302 "The call you should use in modern code for adding drives is L</"
303 "guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
304 "specifying that the format is raw, do:"
308 #: ../src/guestfs.pod:134
311 " guestfs_add_drive_opts (g, filename,\n"
312 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
318 #: ../src/guestfs.pod:138
319 msgid "You can add a disk read-only using:"
323 #: ../src/guestfs.pod:140
326 " guestfs_add_drive_opts (g, filename,\n"
327 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
328 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
334 #: ../src/guestfs.pod:145
336 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
337 "libguestfs won't modify the file."
341 #: ../src/guestfs.pod:148
343 "Be extremely cautious if the disk image is in use, eg. if it is being used "
344 "by a virtual machine. Adding it read-write will almost certainly cause disk "
345 "corruption, but adding it read-only is safe."
349 #: ../src/guestfs.pod:152
351 "You must add at least one disk image, and you may add multiple disk images. "
352 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
353 "first one you added), C</dev/sdb> (for the second one you added), etc."
357 #: ../src/guestfs.pod:157
359 "Once L</guestfs_launch> has been called you cannot add any more images. You "
360 "can call L</guestfs_list_devices> to get a list of the device names, in the "
361 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
365 #: ../src/guestfs.pod:162
370 #: ../src/guestfs.pod:164
372 "Before you can read or write files, create directories and so on in a disk "
373 "image that contains filesystems, you have to mount those filesystems using "
374 "L</guestfs_mount>. If you already know that a disk image contains (for "
375 "example) one partition with a filesystem on that partition, then you can "
380 #: ../src/guestfs.pod:170
383 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
388 #: ../src/guestfs.pod:172
390 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
391 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
392 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>)."
396 #: ../src/guestfs.pod:176
398 "If you are given a disk image and you don't know what it contains then you "
399 "have to find out. Libguestfs can do that too: use L</"
400 "guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions and "
401 "LVs, and either try mounting each to see what is mountable, or else examine "
402 "them with L</guestfs_vfs_type> or L</guestfs_file>. Libguestfs also has a "
403 "set of APIs for inspection of disk images (see L</INSPECTION> below). But "
404 "you might find it easier to look at higher level programs built on top of "
405 "libguestfs, in particular L<virt-inspector(1)>."
409 #: ../src/guestfs.pod:186
411 "To mount a disk image read-only, use L</guestfs_mount_ro>. There are "
412 "several other variations of the C<guestfs_mount_*> call."
416 #: ../src/guestfs.pod:189
417 msgid "FILESYSTEM ACCESS AND MODIFICATION"
421 #: ../src/guestfs.pod:191
423 "The majority of the libguestfs API consists of fairly low-level calls for "
424 "accessing and modifying the files, directories, symlinks etc on mounted "
425 "filesystems. There are over a hundred such calls which you can find listed "
426 "in detail below in this man page, and we don't even pretend to cover them "
427 "all in this overview."
431 #: ../src/guestfs.pod:197
433 "Specify filenames as full paths, starting with C<\"/\"> and including the "
438 #: ../src/guestfs.pod:200
440 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
441 "the file called C<\"etc/passwd\"> then you could do:"
445 #: ../src/guestfs.pod:203
448 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
453 #: ../src/guestfs.pod:205
455 "This would return C<data> as a newly allocated buffer containing the full "
456 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
457 "or C<NULL> if there was an error."
461 #: ../src/guestfs.pod:209
463 "As another example, to create a top-level directory on that filesystem "
464 "called C<\"var\"> you would do:"
468 #: ../src/guestfs.pod:212
471 " guestfs_mkdir (g, \"/var\");\n"
476 #: ../src/guestfs.pod:214
477 msgid "To create a symlink you could do:"
481 #: ../src/guestfs.pod:216
484 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
485 " \"/etc/rc3.d/S30portmap\");\n"
490 #: ../src/guestfs.pod:219
492 "Libguestfs will reject attempts to use relative paths and there is no "
493 "concept of a current working directory."
497 #: ../src/guestfs.pod:222
499 "Libguestfs can return errors in many situations: for example if the "
500 "filesystem isn't writable, or if a file or directory that you requested "
501 "doesn't exist. If you are using the C API (documented here) you have to "
502 "check for those error conditions after each call. (Other language bindings "
503 "turn these errors into exceptions)."
507 #: ../src/guestfs.pod:228
509 "File writes are affected by the per-handle umask, set by calling L</"
510 "guestfs_umask> and defaulting to 022. See L</UMASK>."
514 #: ../src/guestfs.pod:231
519 #: ../src/guestfs.pod:233
521 "Libguestfs contains API calls to read, create and modify partition tables on "
526 #: ../src/guestfs.pod:236
528 "In the common case where you want to create a single partition covering the "
529 "whole disk, you should use the L</guestfs_part_disk> call:"
533 #: ../src/guestfs.pod:240
536 " const char *parttype = \"mbr\";\n"
537 " if (disk_is_larger_than_2TB)\n"
538 " parttype = \"gpt\";\n"
539 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
544 #: ../src/guestfs.pod:245
546 "Obviously this effectively wipes anything that was on that disk image before."
550 #: ../src/guestfs.pod:248
555 #: ../src/guestfs.pod:250
557 "Libguestfs provides access to a large part of the LVM2 API, such as L</"
558 "guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense unless "
559 "you familiarize yourself with the concepts of physical volumes, volume "
560 "groups and logical volumes."
564 #: ../src/guestfs.pod:255
566 "This author strongly recommends reading the LVM HOWTO, online at L<http://"
567 "tldp.org/HOWTO/LVM-HOWTO/>."
571 #: ../src/guestfs.pod:258
576 #: ../src/guestfs.pod:260
578 "Use L</guestfs_cat> to download small, text only files. This call is "
579 "limited to files which are less than 2 MB and which cannot contain any ASCII "
580 "NUL (C<\\0>) characters. However it has a very simple to use API."
584 #: ../src/guestfs.pod:265
586 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
587 "bit data, since it returns a (pointer, size) pair. However it is still "
588 "limited to \"small\" files, less than 2 MB."
592 #: ../src/guestfs.pod:269
594 "L</guestfs_download> can be used to download any file, with no limits on "
595 "content or size (even files larger than 4 GB)."
599 #: ../src/guestfs.pod:272
601 "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
605 #: ../src/guestfs.pod:275
610 #: ../src/guestfs.pod:277
612 "It's often the case that you want to write a file or files to the disk image."
616 #: ../src/guestfs.pod:280
618 "To write a small file with fixed content, use L</guestfs_write>. To create "
619 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or L</"
620 "guestfs_fallocate64> (with all disk blocks allocated). There are a variety "
621 "of other functions for creating test files, for example L</guestfs_fill> and "
622 "L</guestfs_fill_pattern>."
626 #: ../src/guestfs.pod:286
628 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
629 "file content or size (even files larger than 4 GB)."
633 #: ../src/guestfs.pod:289
635 "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
639 #: ../src/guestfs.pod:291
641 "However the fastest way to upload I<large numbers of arbitrary files> is to "
642 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and L<mkisofs(8)"
643 ">), then attach this using L</guestfs_add_drive_ro>. If you add the drive "
644 "in a predictable way (eg. adding it last after all other drives) then you "
645 "can get the device name from L</guestfs_list_devices> and mount it directly "
646 "using L</guestfs_mount_ro>. Note that squashfs images are sometimes non-"
647 "portable between kernel versions, and they don't support labels or UUIDs. "
648 "If you want to pre-build an image or you need to mount it using a label or "
649 "UUID, use an ISO image instead."
653 #: ../src/guestfs.pod:302
658 #: ../src/guestfs.pod:304
660 "There are various different commands for copying between files and devices "
661 "and in and out of the guest filesystem. These are summarised in the table "
666 #: ../src/guestfs.pod:310
667 msgid "B<file> to B<file>"
671 #: ../src/guestfs.pod:312
673 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
674 "directories recursively."
678 #: ../src/guestfs.pod:315
679 msgid "B<file or device> to B<file or device>"
683 #: ../src/guestfs.pod:317
685 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
686 "devices in the guest."
690 #: ../src/guestfs.pod:320
691 msgid "Example: duplicate the contents of an LV:"
695 #: ../src/guestfs.pod:322
698 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
703 #: ../src/guestfs.pod:324
705 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
706 "(C</dev/VG/Original>). To copy less than the whole source device, use L</"
707 "guestfs_copy_size>."
711 #: ../src/guestfs.pod:328
712 msgid "B<file on the host> to B<file or device>"
716 #: ../src/guestfs.pod:330
717 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
721 #: ../src/guestfs.pod:332
722 msgid "B<file or device> to B<file on the host>"
726 #: ../src/guestfs.pod:334
727 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
731 #: ../src/guestfs.pod:338
732 msgid "LISTING FILES"
736 #: ../src/guestfs.pod:340
738 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
739 "L<guestfish(1)>-equivalent command C<ll>)."
743 #: ../src/guestfs.pod:343
745 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
746 "programs, as a flat list of strings."
750 #: ../src/guestfs.pod:346
752 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
753 "directory, plus additional information about each one. It is more "
754 "equivalent to using the L<readdir(3)> call on a local filesystem."
758 #: ../src/guestfs.pod:350
760 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list files."
764 #: ../src/guestfs.pod:353
765 msgid "RUNNING COMMANDS"
769 #: ../src/guestfs.pod:355
771 "Although libguestfs is primarily an API for manipulating files inside guest "
772 "images, we also provide some limited facilities for running commands inside "
777 #: ../src/guestfs.pod:359
778 msgid "There are many limitations to this:"
782 #: ../src/guestfs.pod:363 ../src/guestfs.pod:368 ../src/guestfs.pod:373
783 #: ../src/guestfs.pod:377 ../src/guestfs.pod:382 ../src/guestfs.pod:386
784 #: ../src/guestfs.pod:391 ../src/guestfs.pod:396 ../src/guestfs.pod:955
785 #: ../src/guestfs.pod:959 ../src/guestfs.pod:963 ../src/guestfs.pod:968
786 #: ../src/guestfs.pod:976 ../src/guestfs.pod:995 ../src/guestfs.pod:1003
787 #: ../src/guestfs.pod:1025 ../src/guestfs.pod:1029 ../src/guestfs.pod:1033
788 #: ../src/guestfs.pod:1037 ../src/guestfs.pod:1041 ../src/guestfs.pod:1045
789 #: ../src/guestfs.pod:1527 ../src/guestfs.pod:1532 ../src/guestfs.pod:1536
790 #: ../src/guestfs.pod:1646 ../src/guestfs.pod:1651 ../src/guestfs.pod:1655
791 #: ../src/guestfs.pod:2007 ../src/guestfs.pod:2013 ../src/guestfs.pod:2018
792 #: ../src/guestfs.pod:2024 ../src/guestfs.pod:2136 ../src/guestfs.pod:2140
793 #: ../src/guestfs.pod:2144 ../src/guestfs.pod:2148
794 #: ../src/guestfs-actions.pod:15 ../src/guestfs-actions.pod:22
795 #: ../src/guestfs-actions.pod:571 ../src/guestfs-actions.pod:579
796 #: ../src/guestfs-actions.pod:586 ../src/guestfs-actions.pod:593
797 #: ../src/guestfs-actions.pod:1589 ../src/guestfs-actions.pod:1593
798 #: ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:1601
799 #: ../src/guestfs-actions.pod:1609 ../src/guestfs-actions.pod:1613
800 #: ../src/guestfs-actions.pod:1617 ../src/guestfs-actions.pod:1627
801 #: ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1635
802 #: ../src/guestfs-actions.pod:1773 ../src/guestfs-actions.pod:1777
803 #: ../src/guestfs-actions.pod:1782 ../src/guestfs-actions.pod:1787
804 #: ../src/guestfs-actions.pod:1848 ../src/guestfs-actions.pod:1852
805 #: ../src/guestfs-actions.pod:1857 ../fish/guestfish.pod:377
806 #: ../fish/guestfish.pod:381 ../fish/guestfish.pod:385
807 #: ../fish/guestfish.pod:389 ../fish/guestfish-actions.pod:13
808 #: ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:375
809 #: ../fish/guestfish-actions.pod:383 ../fish/guestfish-actions.pod:390
810 #: ../fish/guestfish-actions.pod:397 ../fish/guestfish-actions.pod:1067
811 #: ../fish/guestfish-actions.pod:1071 ../fish/guestfish-actions.pod:1075
812 #: ../fish/guestfish-actions.pod:1079 ../fish/guestfish-actions.pod:1087
813 #: ../fish/guestfish-actions.pod:1091 ../fish/guestfish-actions.pod:1095
814 #: ../fish/guestfish-actions.pod:1105 ../fish/guestfish-actions.pod:1109
815 #: ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1203
816 #: ../fish/guestfish-actions.pod:1207 ../fish/guestfish-actions.pod:1212
817 #: ../fish/guestfish-actions.pod:1217 ../fish/guestfish-actions.pod:1259
818 #: ../fish/guestfish-actions.pod:1263 ../fish/guestfish-actions.pod:1268
819 #: ../tools/virt-resize.pl:345 ../tools/virt-resize.pl:350
820 #: ../tools/virt-resize.pl:360
825 #: ../src/guestfs.pod:365
827 "The kernel version that the command runs under will be different from what "
832 #: ../src/guestfs.pod:370
834 "If the command needs to communicate with daemons, then most likely they "
839 #: ../src/guestfs.pod:375
840 msgid "The command will be running in limited memory."
844 #: ../src/guestfs.pod:379
846 "The network may not be available unless you enable it (see L</"
847 "guestfs_set_network>)."
851 #: ../src/guestfs.pod:384
852 msgid "Only supports Linux guests (not Windows, BSD, etc)."
856 #: ../src/guestfs.pod:388
858 "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
862 #: ../src/guestfs.pod:393
864 "For SELinux guests, you may need to enable SELinux and load policy first. "
865 "See L</SELINUX> in this manpage."
869 #: ../src/guestfs.pod:398
871 "I<Security:> It is not safe to run commands from untrusted, possibly "
872 "malicious guests. These commands may attempt to exploit your program by "
873 "sending unexpected output. They could also try to exploit the Linux kernel "
874 "or qemu provided by the libguestfs appliance. They could use the network "
875 "provided by the libguestfs appliance to bypass ordinary network partitions "
876 "and firewalls. They could use the elevated privileges or different SELinux "
877 "context of your program to their advantage."
881 #: ../src/guestfs.pod:407
883 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
884 "(a script which runs when the guest next boots normally), and to have this "
885 "script run the commands you want in the normal context of the running guest, "
886 "network security and so on. For information about other security issues, "
891 #: ../src/guestfs.pod:415
893 "The two main API calls to run commands are L</guestfs_command> and L</"
894 "guestfs_sh> (there are also variations)."
898 #: ../src/guestfs.pod:418
900 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
901 "shell globs, redirections, etc will work."
905 #: ../src/guestfs.pod:421
906 msgid "CONFIGURATION FILES"
910 #: ../src/guestfs.pod:423
912 "To read and write configuration files in Linux guest filesystems, we "
913 "strongly recommend using Augeas. For example, Augeas understands how to "
914 "read and write, say, a Linux shadow password file or X.org configuration "
915 "file, and so avoids you having to write that code."
919 #: ../src/guestfs.pod:428
921 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
922 "document Augeas itself here because there is excellent documentation on the "
923 "L<http://augeas.net/> website."
927 #: ../src/guestfs.pod:432
929 "If you don't want to use Augeas (you fool!) then try calling L</"
930 "guestfs_read_lines> to get the file as a list of lines which you can iterate "
935 #: ../src/guestfs.pod:436
940 #: ../src/guestfs.pod:438
942 "We support SELinux guests. To ensure that labeling happens correctly in "
943 "SELinux guests, you need to enable SELinux and load the guest's policy:"
947 #: ../src/guestfs.pod:444 ../src/guestfs.pod:1148 ../src/guestfs.pod:1279
952 #: ../src/guestfs.pod:446
953 msgid "Before launching, do:"
957 #: ../src/guestfs.pod:448
960 " guestfs_set_selinux (g, 1);\n"
965 #: ../src/guestfs.pod:450 ../src/guestfs.pod:1152 ../src/guestfs.pod:1283
970 #: ../src/guestfs.pod:452
972 "After mounting the guest's filesystem(s), load the policy. This is best "
973 "done by running the L<load_policy(8)> command in the guest itself:"
977 #: ../src/guestfs.pod:456
980 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
985 #: ../src/guestfs.pod:458
987 "(Older versions of C<load_policy> require you to specify the name of the "
992 #: ../src/guestfs.pod:461 ../src/guestfs.pod:1289
997 #: ../src/guestfs.pod:463
999 "Optionally, set the security context for the API. The correct security "
1000 "context to use can only be known by inspecting the guest. As an example:"
1004 #: ../src/guestfs.pod:467
1007 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
1012 #: ../src/guestfs.pod:471
1013 msgid "This will work for running commands and editing existing files."
1017 #: ../src/guestfs.pod:473
1019 "When new files are created, you may need to label them explicitly, for "
1020 "example by running the external command C<restorecon pathname>."
1024 #: ../src/guestfs.pod:477
1029 #: ../src/guestfs.pod:479
1031 "Certain calls are affected by the current file mode creation mask (the "
1032 "\"umask\"). In particular ones which create files or directories, such as "
1033 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
1034 "either the default mode that the file is created with or modifies the mode "
1039 #: ../src/guestfs.pod:485
1041 "The default umask is C<022>, so files are created with modes such as C<0644> "
1042 "and directories with C<0755>."
1046 #: ../src/guestfs.pod:488
1048 "There are two ways to avoid being affected by umask. Either set umask to 0 "
1049 "(call C<guestfs_umask (g, 0)> early after launching). Or call L</"
1050 "guestfs_chmod> after creating each file or directory."
1054 #: ../src/guestfs.pod:492
1055 msgid "For more information about umask, see L<umask(2)>."
1059 #: ../src/guestfs.pod:494 ../fish/guestfish.pod:670
1060 msgid "ENCRYPTED DISKS"
1064 #: ../src/guestfs.pod:496
1066 "Libguestfs allows you to access Linux guests which have been encrypted using "
1067 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
1068 "standard. This includes nearly all whole disk encryption systems used by "
1069 "modern Linux guests."
1073 #: ../src/guestfs.pod:502
1075 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
1076 "returns the string C<crypto_LUKS>)."
1080 #: ../src/guestfs.pod:505
1082 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
1083 "will require the passphrase!"
1087 #: ../src/guestfs.pod:508
1089 "Opening a LUKS device creates a new device mapper device called C</dev/"
1090 "mapper/mapname> (where C<mapname> is the string you supply to L</"
1091 "guestfs_luks_open>). Reads and writes to this mapper device are decrypted "
1092 "from and encrypted to the underlying block device respectively."
1096 #: ../src/guestfs.pod:514
1098 "LVM volume groups on the device can be made visible by calling L</"
1099 "guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical volume"
1100 "(s) can now be mounted in the usual way."
1104 #: ../src/guestfs.pod:518
1106 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
1107 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
1108 "[\"/dev/VG\"])>. Then close the mapper device by calling L</"
1109 "guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
1110 "underlying encrypted block device)."
1114 #: ../src/guestfs.pod:525
1119 #: ../src/guestfs.pod:527
1121 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
1122 "contains operating systems. (These APIs used to be in a separate Perl-only "
1123 "library called L<Sys::Guestfs::Lib(3)> but since version 1.5.3 the most "
1124 "frequently used part of this library has been rewritten in C and moved into "
1129 #: ../src/guestfs.pod:533
1131 "Add all disks belonging to the unknown virtual machine and call L</"
1132 "guestfs_launch> in the usual way."
1136 #: ../src/guestfs.pod:536
1138 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
1139 "and certain heuristics, and returns a list of operating systems that were "
1140 "found. An empty list means none were found. A single element is the root "
1141 "filesystem of the operating system. For dual- or multi-boot guests, "
1142 "multiple roots can be returned, each one corresponding to a separate "
1143 "operating system. (Multi-boot virtual machines are extremely rare in the "
1144 "world of virtualization, but since this scenario can happen, we have built "
1145 "libguestfs to deal with it.)"
1149 #: ../src/guestfs.pod:545
1151 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
1152 "to get additional details about that operating system. For example, call L</"
1153 "guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
1154 "Windows and Linux-based operating systems respectively."
1158 #: ../src/guestfs.pod:551
1160 "Un*x-like and Linux-based operating systems usually consist of several "
1161 "filesystems which are mounted at boot time (for example, a separate boot "
1162 "partition mounted on C</boot>). The inspection rules are able to detect how "
1163 "filesystems correspond to mount points. Call "
1164 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
1165 "hash table like this example:"
1169 #: ../src/guestfs.pod:558
1172 " /boot => /dev/sda1\n"
1173 " / => /dev/vg_guest/lv_root\n"
1174 " /usr => /dev/vg_guest/lv_usr\n"
1179 #: ../src/guestfs.pod:562
1181 "The caller can then make calls to L</guestfs_mount_options> to mount the "
1182 "filesystems as suggested."
1186 #: ../src/guestfs.pod:565
1188 "Be careful to mount filesystems in the right order (eg. C</> before C</"
1189 "usr>). Sorting the keys of the hash by length, shortest first, should work."
1193 #: ../src/guestfs.pod:569
1195 "Inspection currently only works for some common operating systems. "
1196 "Contributors are welcome to send patches for other operating systems that we "
1197 "currently cannot detect."
1201 #: ../src/guestfs.pod:573
1203 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
1204 "for more details. The L</guestfs_inspect_os> function just ignores any "
1205 "encrypted devices."
1209 #: ../src/guestfs.pod:577
1211 "A note on the implementation: The call L</guestfs_inspect_os> performs "
1212 "inspection and caches the results in the guest handle. Subsequent calls to "
1213 "C<guestfs_inspect_get_*> return this cached information, but I<do not> re-"
1214 "read the disks. If you change the content of the guest disks, you can redo "
1215 "inspection by calling L</guestfs_inspect_os> again. (L</"
1216 "guestfs_inspect_list_applications> works a little differently from the other "
1217 "calls and does read the disks. See documentation for that function for "
1222 #: ../src/guestfs.pod:586
1223 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
1227 #: ../src/guestfs.pod:588
1229 "Libguestfs can mount NTFS partitions. It does this using the L<http://www."
1230 "ntfs-3g.org/> driver."
1234 #: ../src/guestfs.pod:591
1236 "DOS and Windows still use drive letters, and the filesystems are always "
1237 "treated as case insensitive by Windows itself, and therefore you might find "
1238 "a Windows configuration file referring to a path like C<c:\\windows"
1239 "\\system32>. When the filesystem is mounted in libguestfs, that directory "
1240 "might be referred to as C</WINDOWS/System32>."
1244 #: ../src/guestfs.pod:597
1246 "Drive letter mappings are outside the scope of libguestfs. You have to use "
1247 "libguestfs to read the appropriate Windows Registry and configuration files, "
1248 "to determine yourself how drives are mapped (see also L<hivex(3)> and L<virt-"
1253 #: ../src/guestfs.pod:602
1255 "Replacing backslash characters with forward slash characters is also outside "
1256 "the scope of libguestfs, but something that you can easily do."
1260 #: ../src/guestfs.pod:605
1262 "Where we can help is in resolving the case insensitivity of paths. For "
1263 "this, call L</guestfs_case_sensitive_path>."
1267 #: ../src/guestfs.pod:608
1269 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
1270 "files, through the library C<hivex> which is part of the libguestfs project "
1271 "although ships as a separate tarball. You have to locate and download the "
1272 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
1273 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and L<virt-win-"
1274 "reg(1)> for more help on this issue."
1278 #: ../src/guestfs.pod:616
1279 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
1283 #: ../src/guestfs.pod:618
1285 "Although we don't want to discourage you from using the C API, we will "
1286 "mention here that the same API is also available in other languages."
1290 #: ../src/guestfs.pod:621
1292 "The API is broadly identical in all supported languages. This means that "
1293 "the C call C<guestfs_mount(g,path)> is C<$g-E<gt>mount($path)> in Perl, C<g."
1294 "mount(path)> in Python, and C<Guestfs.mount g path> in OCaml. In other "
1295 "words, a straightforward, predictable isomorphism between each language."
1299 #: ../src/guestfs.pod:627
1301 "Error messages are automatically transformed into exceptions if the language "
1306 #: ../src/guestfs.pod:630
1308 "We don't try to \"object orientify\" parts of the API in OO languages, "
1309 "although contributors are welcome to write higher level APIs above what we "
1310 "provide in their favourite languages if they wish."
1314 #: ../src/guestfs.pod:636
1319 #: ../src/guestfs.pod:638
1321 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
1322 "identical to the C API. C++ classes and exceptions are not used."
1326 #: ../src/guestfs.pod:642
1331 #: ../src/guestfs.pod:644
1333 "The C# bindings are highly experimental. Please read the warnings at the "
1334 "top of C<csharp/Libguestfs.cs>."
1338 #: ../src/guestfs.pod:647
1343 #: ../src/guestfs.pod:649
1345 "This is the only language binding that is working but incomplete. Only "
1346 "calls which return simple integers have been bound in Haskell, and we are "
1347 "looking for help to complete this binding."
1351 #: ../src/guestfs.pod:653
1356 #: ../src/guestfs.pod:655
1358 "Full documentation is contained in the Javadoc which is distributed with "
1363 #: ../src/guestfs.pod:658
1368 #: ../src/guestfs.pod:660
1369 msgid "For documentation see L<guestfs-ocaml(3)>."
1373 #: ../src/guestfs.pod:662
1378 #: ../src/guestfs.pod:664
1379 msgid "For documentation see L<Sys::Guestfs(3)>."
1383 #: ../src/guestfs.pod:666
1388 #: ../src/guestfs.pod:668
1390 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
1391 "the php-libguestfs package for your distribution."
1395 #: ../src/guestfs.pod:671
1396 msgid "The PHP binding only works correctly on 64 bit machines."
1400 #: ../src/guestfs.pod:673
1405 #: ../src/guestfs.pod:675
1406 msgid "For documentation see L<guestfs-python(3)>."
1410 #: ../src/guestfs.pod:677
1415 #: ../src/guestfs.pod:679
1416 msgid "For documentation see L<guestfs-ruby(3)>."
1420 #: ../src/guestfs.pod:681
1421 msgid "B<shell scripts>"
1425 #: ../src/guestfs.pod:683
1426 msgid "For documentation see L<guestfish(1)>."
1430 #: ../src/guestfs.pod:687
1431 msgid "LIBGUESTFS GOTCHAS"
1435 #: ../src/guestfs.pod:689
1437 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
1438 "system [...] that works in the way it is documented but is counterintuitive "
1439 "and almost invites mistakes.\""
1443 #: ../src/guestfs.pod:693
1445 "Since we developed libguestfs and the associated tools, there are several "
1446 "things we would have designed differently, but are now stuck with for "
1447 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
1448 "release, you can expect these to change. Beware of them."
1452 #: ../src/guestfs.pod:701
1453 msgid "Autosync / forgetting to sync."
1457 #: ../src/guestfs.pod:703
1459 "When modifying a filesystem from C or another language, you B<must> unmount "
1460 "all filesystems and call L</guestfs_sync> explicitly before you close the "
1461 "libguestfs handle. You can also call:"
1465 #: ../src/guestfs.pod:707
1468 " guestfs_set_autosync (g, 1);\n"
1473 #: ../src/guestfs.pod:709
1475 "to have the unmount/sync done automatically for you when the handle 'g' is "
1476 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> q.v.)"
1480 #: ../src/guestfs.pod:713
1482 "If you forget to do this, then it is entirely possible that your changes "
1483 "won't be written out, or will be partially written, or (very rarely) that "
1484 "you'll get disk corruption."
1488 #: ../src/guestfs.pod:717
1490 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
1491 "guestfish scripts that forget to sync will work just fine, which can make "
1492 "this very puzzling if you are trying to debug a problem."
1496 #: ../src/guestfs.pod:721
1498 "Update: Autosync is enabled by default for all API users starting from "
1499 "libguestfs 1.5.24."
1503 #: ../src/guestfs.pod:724
1504 msgid "Mount option C<-o sync> should not be the default."
1508 #: ../src/guestfs.pod:726
1510 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
1511 "However C<-o sync> does not add any reliability benefit, but does have a "
1512 "very large performance impact."
1516 #: ../src/guestfs.pod:730
1518 "The work around is to use L</guestfs_mount_options> and set the mount "
1519 "options that you actually want to use."
1523 #: ../src/guestfs.pod:733
1524 msgid "Read-only should be the default."
1528 #: ../src/guestfs.pod:735
1530 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
1531 "specify I<--rw> if you want to make changes to the image."
1535 #: ../src/guestfs.pod:738
1536 msgid "This would reduce the potential to corrupt live VM images."
1540 #: ../src/guestfs.pod:740
1542 "Note that many filesystems change the disk when you just mount and unmount, "
1543 "even if you didn't perform any writes. You need to use L</"
1544 "guestfs_add_drive_ro> to guarantee that the disk is not changed."
1548 #: ../src/guestfs.pod:744
1549 msgid "guestfish command line is hard to use."
1553 #: ../src/guestfs.pod:746
1555 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
1556 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
1557 "exist, so it fails. In earlier versions of guestfish the error message was "
1558 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
1559 "we should have used C<guestfish -c command> to run commands."
1563 #: ../src/guestfs.pod:753
1564 msgid "guestfish megabyte modifiers don't work right on all commands"
1568 #: ../src/guestfs.pod:755
1570 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
1571 "other modifiers). What guestfish actually does is to multiply the number "
1572 "part by the modifier part and pass the result to the C API. However this "
1573 "doesn't work for a few APIs which aren't expecting bytes, but are already "
1574 "expecting some other unit (eg. megabytes)."
1578 #: ../src/guestfs.pod:762
1579 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
1583 #: ../src/guestfs.pod:764
1586 " lvcreate LV VG 100M\n"
1591 #: ../src/guestfs.pod:766
1593 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
1594 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
1595 "megabytes * megabytes) logical volume. The error message you get from this "
1596 "is also a little obscure."
1600 #: ../src/guestfs.pod:771
1602 "This could be fixed in the generator by specially marking parameters and "
1603 "return values which take bytes or other units."
1607 #: ../src/guestfs.pod:774
1608 msgid "Ambiguity between devices and paths"
1612 #: ../src/guestfs.pod:776
1614 "There is a subtle ambiguity in the API between a device name (eg. C</dev/"
1615 "sdb2>) and a similar pathname. A file might just happen to be called "
1616 "C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
1620 #: ../src/guestfs.pod:781
1622 "In the current API we usually resolve this ambiguity by having two separate "
1623 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
1624 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
1625 "detecting if the path supplied begins with C</dev/>."
1629 #: ../src/guestfs.pod:787
1631 "To avoid both the ambiguity and the need to duplicate some calls, we could "
1632 "make paths/devices into structured names. One way to do this would be to "
1633 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
1634 "aspect of grub. Another way would be to use a structured type, equivalent "
1635 "to this OCaml type:"
1639 #: ../src/guestfs.pod:793
1642 " type path = Path of string | Device of int | Partition of int * int\n"
1647 #: ../src/guestfs.pod:795
1648 msgid "which would allow you to pass arguments like:"
1652 #: ../src/guestfs.pod:797
1655 " Path \"/foo/bar\"\n"
1656 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
1657 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
1658 " Path \"/dev/sdb2\" (* not a device *)\n"
1663 #: ../src/guestfs.pod:802
1665 "As you can see there are still problems to resolve even with this "
1666 "representation. Also consider how it might work in guestfish."
1670 #: ../src/guestfs.pod:807
1671 msgid "PROTOCOL LIMITS"
1675 #: ../src/guestfs.pod:809
1677 "Internally libguestfs uses a message-based protocol to pass API calls and "
1678 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
1679 "plenty more detail about this). The maximum message size used by the "
1680 "protocol is slightly less than 4 MB. For some API calls you may need to be "
1681 "aware of this limit. The API calls which may be affected are individually "
1682 "documented, with a link back to this section of the documentation."
1686 #: ../src/guestfs.pod:817
1688 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
1689 "a simple string. Because this string is at some point internally encoded as "
1690 "a message, the maximum size that it can return is slightly under 4 MB. If "
1691 "the requested file is larger than this then you will get an error."
1695 #: ../src/guestfs.pod:823
1697 "In order to transfer large files into and out of the guest filesystem, you "
1698 "need to use particular calls that support this. The sections L</UPLOADING> "
1699 "and L</DOWNLOADING> document how to do this."
1703 #: ../src/guestfs.pod:827
1705 "You might also consider mounting the disk image using our FUSE filesystem "
1706 "support (L<guestmount(1)>)."
1710 #: ../src/guestfs.pod:830
1711 msgid "KEYS AND PASSPHRASES"
1715 #: ../src/guestfs.pod:832
1717 "Certain libguestfs calls take a parameter that contains sensitive key "
1718 "material, passed in as a C string."
1722 #: ../src/guestfs.pod:835
1724 "In the future we would hope to change the libguestfs implementation so that "
1725 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
1726 "swap. However this is I<not> done at the moment, because of the complexity "
1727 "of such an implementation."
1731 #: ../src/guestfs.pod:840
1733 "Therefore you should be aware that any key parameter you pass to libguestfs "
1734 "might end up being written out to the swap partition. If this is a concern, "
1735 "scrub the swap partition or don't use libguestfs on encrypted devices."
1739 #: ../src/guestfs.pod:845
1740 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
1744 #: ../src/guestfs.pod:847
1746 "All high-level libguestfs actions are synchronous. If you want to use "
1747 "libguestfs asynchronously then you must create a thread."
1751 #: ../src/guestfs.pod:850
1753 "Only use the handle from a single thread. Either use the handle exclusively "
1754 "from one thread, or provide your own mutex so that two threads cannot issue "
1755 "calls on the same handle at the same time."
1759 #: ../src/guestfs.pod:854
1761 "See the graphical program guestfs-browser for one possible architecture for "
1762 "multithreaded programs using libvirt and libguestfs."
1766 #: ../src/guestfs.pod:857
1771 #: ../src/guestfs.pod:859
1773 "Libguestfs needs a kernel and initrd.img, which it finds by looking along an "
1778 #: ../src/guestfs.pod:862
1780 "By default it looks for these in the directory C<$libdir/guestfs> (eg. C</"
1781 "usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
1785 #: ../src/guestfs.pod:865
1787 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
1788 "to change the directories that libguestfs will search in. The value is a "
1789 "colon-separated list of paths. The current directory is I<not> searched "
1790 "unless the path contains an empty element or C<.>. For example "
1791 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
1792 "then C</usr/lib/guestfs>."
1796 #: ../src/guestfs.pod:872
1797 msgid "QEMU WRAPPERS"
1801 #: ../src/guestfs.pod:874
1803 "If you want to compile your own qemu, run qemu from a non-standard location, "
1804 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
1809 #: ../src/guestfs.pod:878
1811 "There is one important rule to remember: you I<must C<exec qemu>> as the "
1812 "last command in the shell script (so that qemu replaces the shell and "
1813 "becomes the direct child of the libguestfs-using program). If you don't do "
1814 "this, then the qemu process won't be cleaned up correctly."
1818 #: ../src/guestfs.pod:883
1820 "Here is an example of a wrapper, where I have built my own copy of qemu from "
1825 #: ../src/guestfs.pod:886
1829 " qemudir=/home/rjones/d/qemu\n"
1830 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios \"$@\"\n"
1835 #: ../src/guestfs.pod:890
1837 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
1838 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
1843 #: ../src/guestfs.pod:894
1846 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
1851 #: ../src/guestfs.pod:896
1853 "Note that libguestfs also calls qemu with the -help and -version options in "
1854 "order to determine features."
1858 #: ../src/guestfs.pod:899
1859 msgid "ABI GUARANTEE"
1863 #: ../src/guestfs.pod:901
1865 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
1866 "actions as outlined in this section. Although we will deprecate some "
1867 "actions, for example if they get replaced by newer calls, we will keep the "
1868 "old actions forever. This allows you the developer to program in confidence "
1869 "against the libguestfs API."
1873 #: ../src/guestfs.pod:907
1874 msgid "BLOCK DEVICE NAMING"
1878 #: ../src/guestfs.pod:909
1880 "In the kernel there is now quite a profusion of schemata for naming block "
1881 "devices (in this context, by I<block device> I mean a physical or virtual "
1882 "hard drive). The original Linux IDE driver used names starting with C</dev/"
1883 "hd*>. SCSI devices have historically used a different naming scheme, C</dev/"
1884 "sd*>. When the Linux kernel I<libata> driver became a popular replacement "
1885 "for the old IDE driver (particularly for SATA devices) those devices also "
1886 "used the C</dev/sd*> scheme. Additionally we now have virtual machines with "
1887 "paravirtualized drivers. This has created several different naming systems, "
1888 "such as C</dev/vd*> for virtio disks and C</dev/xvd*> for Xen PV disks."
1892 #: ../src/guestfs.pod:921
1894 "As discussed above, libguestfs uses a qemu appliance running an embedded "
1895 "Linux kernel to access block devices. We can run a variety of appliances "
1896 "based on a variety of Linux kernels."
1900 #: ../src/guestfs.pod:925
1902 "This causes a problem for libguestfs because many API calls use device or "
1903 "partition names. Working scripts and the recipe (example) scripts that we "
1904 "make available over the internet could fail if the naming scheme changes."
1908 #: ../src/guestfs.pod:930
1910 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
1911 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
1912 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
1913 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
1917 #: ../src/guestfs.pod:936
1919 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
1920 "L</guestfs_list_partitions> and similar calls return the true names of the "
1921 "devices and partitions as known to the appliance."
1925 #: ../src/guestfs.pod:941
1926 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
1930 #: ../src/guestfs.pod:943
1932 "Usually this translation is transparent. However in some (very rare) cases "
1933 "you may need to know the exact algorithm. Such cases include where you use "
1934 "L</guestfs_config> to add a mixture of virtio and IDE devices to the qemu-"
1935 "based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> devices."
1939 #: ../src/guestfs.pod:949
1941 "The algorithm is applied only to I<parameters> which are known to be either "
1942 "device or partition names. Return values from functions such as L</"
1943 "guestfs_list_devices> are never changed."
1947 #: ../src/guestfs.pod:957
1948 msgid "Is the string a parameter which is a device or partition name?"
1952 #: ../src/guestfs.pod:961
1953 msgid "Does the string begin with C</dev/sd>?"
1957 #: ../src/guestfs.pod:965
1959 "Does the named device exist? If so, we use that device. However if I<not> "
1960 "then we continue with this algorithm."
1964 #: ../src/guestfs.pod:970
1965 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
1969 #: ../src/guestfs.pod:972
1970 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
1974 #: ../src/guestfs.pod:974
1975 msgid "If that named device exists, use it. If not, continue."
1979 #: ../src/guestfs.pod:978
1980 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
1984 #: ../src/guestfs.pod:980
1985 msgid "If that named device exists, use it. If not, return an error."
1989 #: ../src/guestfs.pod:984
1990 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
1994 #: ../src/guestfs.pod:986
1996 "Although the standard naming scheme and automatic translation is useful for "
1997 "simple programs and guestfish scripts, for larger programs it is best not to "
1998 "rely on this mechanism."
2002 #: ../src/guestfs.pod:990
2004 "Where possible for maximum future portability programs using libguestfs "
2005 "should use these future-proof techniques:"
2009 #: ../src/guestfs.pod:997
2011 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
2012 "device names, and then use those names directly."
2016 #: ../src/guestfs.pod:1000
2018 "Since those device names exist by definition, they will never be translated."
2022 #: ../src/guestfs.pod:1005
2024 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
2025 "filesystem labels."
2029 #: ../src/guestfs.pod:1010
2034 #: ../src/guestfs.pod:1012
2036 "This section discusses security implications of using libguestfs, "
2037 "particularly with untrusted or malicious guests or disk images."
2041 #: ../src/guestfs.pod:1015
2042 msgid "GENERAL SECURITY CONSIDERATIONS"
2046 #: ../src/guestfs.pod:1017
2048 "Be careful with any files or data that you download from a guest (by "
2049 "\"download\" we mean not just the L</guestfs_download> command but any "
2050 "command that reads files, filenames, directories or anything else from a "
2051 "disk image). An attacker could manipulate the data to fool your program "
2052 "into doing the wrong thing. Consider cases such as:"
2056 #: ../src/guestfs.pod:1027
2057 msgid "the data (file etc) not being present"
2061 #: ../src/guestfs.pod:1031
2062 msgid "being present but empty"
2066 #: ../src/guestfs.pod:1035
2067 msgid "being much larger than normal"
2071 #: ../src/guestfs.pod:1039
2072 msgid "containing arbitrary 8 bit data"
2076 #: ../src/guestfs.pod:1043
2077 msgid "being in an unexpected character encoding"
2081 #: ../src/guestfs.pod:1047
2082 msgid "containing homoglyphs."
2086 #: ../src/guestfs.pod:1051
2087 msgid "SECURITY OF MOUNTING FILESYSTEMS"
2091 #: ../src/guestfs.pod:1053
2093 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
2094 "(VFS) module can sometimes be escalated into exploits by deliberately "
2095 "creating a malicious, malformed filesystem. These exploits are very severe "
2096 "for two reasons. Firstly there are very many filesystem drivers in the "
2097 "kernel, and many of them are infrequently used and not much developer "
2098 "attention has been paid to the code. Linux userspace helps potential "
2099 "crackers by detecting the filesystem type and automatically choosing the "
2100 "right VFS driver, even if that filesystem type is obscure or unexpected for "
2101 "the administrator. Secondly, a kernel-level exploit is like a local root "
2102 "exploit (worse in some ways), giving immediate and total access to the "
2103 "system right down to the hardware level."
2107 #: ../src/guestfs.pod:1066
2109 "That explains why you should never mount a filesystem from an untrusted "
2110 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
2111 "inside a qemu virtual machine, usually running as a non-root user. The "
2112 "attacker would need to write a filesystem which first exploited the kernel, "
2113 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
2114 "the libguestfs protocol, and finally to be as serious as the host kernel "
2115 "exploit it would need to escalate its privileges to root. This multi-step "
2116 "escalation, performed by a static piece of data, is thought to be extremely "
2117 "hard to do, although we never say 'never' about security issues."
2121 #: ../src/guestfs.pod:1077
2123 "In any case callers can reduce the attack surface by forcing the filesystem "
2124 "type when mounting (use L</guestfs_mount_vfs>)."
2128 #: ../src/guestfs.pod:1080
2129 msgid "PROTOCOL SECURITY"
2133 #: ../src/guestfs.pod:1082
2135 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
2136 "defined upper message size. However a program that uses libguestfs must "
2137 "also take care - for example you can write a program that downloads a binary "
2138 "from a disk image and executes it locally, and no amount of protocol "
2139 "security will save you from the consequences."
2143 #: ../src/guestfs.pod:1088
2144 msgid "INSPECTION SECURITY"
2148 #: ../src/guestfs.pod:1090
2150 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
2151 "directly from the guest, and these could contain any 8 bit data. Callers "
2152 "should be careful to escape these before printing them to a structured file "
2153 "(for example, use HTML escaping if creating a web page)."
2157 #: ../src/guestfs.pod:1096
2159 "Guest configuration may be altered in unusual ways by the administrator of "
2160 "the virtual machine, and may not reflect reality (particularly for untrusted "
2161 "or actively malicious guests). For example we parse the hostname from "
2162 "configuration files like C</etc/sysconfig/network> that we find in the "
2163 "guest, but the guest administrator can easily manipulate these files to "
2164 "provide the wrong hostname."
2168 #: ../src/guestfs.pod:1104
2170 "The inspection API parses guest configuration using two external libraries: "
2171 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
2172 "designed to be robust in the face of malicious data, although denial of "
2173 "service attacks are still possible, for example with oversized configuration "
2178 #: ../src/guestfs.pod:1110
2179 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
2183 #: ../src/guestfs.pod:1112
2185 "Be very cautious about running commands from the guest. By running a "
2186 "command in the guest, you are giving CPU time to a binary that you do not "
2187 "control, under the same user account as the library, albeit wrapped in qemu "
2188 "virtualization. More information and alternatives can be found in the "
2189 "section L</RUNNING COMMANDS>."
2193 #: ../src/guestfs.pod:1118
2194 msgid "CVE-2010-3851"
2198 #: ../src/guestfs.pod:1120
2199 msgid "https://bugzilla.redhat.com/642934"
2203 #: ../src/guestfs.pod:1122
2205 "This security bug concerns the automatic disk format detection that qemu "
2206 "does on disk images."
2210 #: ../src/guestfs.pod:1125
2212 "A raw disk image is just the raw bytes, there is no header. Other disk "
2213 "images like qcow2 contain a special header. Qemu deals with this by looking "
2214 "for one of the known headers, and if none is found then assuming the disk "
2215 "image must be raw."
2219 #: ../src/guestfs.pod:1130
2221 "This allows a guest which has been given a raw disk image to write some "
2222 "other header. At next boot (or when the disk image is accessed by "
2223 "libguestfs) qemu would do autodetection and think the disk image format was, "
2224 "say, qcow2 based on the header written by the guest."
2228 #: ../src/guestfs.pod:1135
2230 "This in itself would not be a problem, but qcow2 offers many features, one "
2231 "of which is to allow a disk image to refer to another image (called the "
2232 "\"backing disk\"). It does this by placing the path to the backing disk "
2233 "into the qcow2 header. This path is not validated and could point to any "
2234 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
2235 "\"holes\" in the qcow2 disk image, which of course is completely under the "
2236 "control of the attacker."
2240 #: ../src/guestfs.pod:1143
2242 "In libguestfs this is rather hard to exploit except under two circumstances:"
2246 #: ../src/guestfs.pod:1150
2247 msgid "You have enabled the network or have opened the disk in write mode."
2251 #: ../src/guestfs.pod:1154
2253 "You are also running untrusted code from the guest (see L</RUNNING "
2258 #: ../src/guestfs.pod:1159
2260 "The way to avoid this is to specify the expected disk format when adding "
2261 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
2262 "should always do this if the disk is raw format, and it's a good idea for "
2267 #: ../src/guestfs.pod:1164
2269 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
2270 "format is fetched from libvirt and passed through."
2274 #: ../src/guestfs.pod:1167
2276 "For libguestfs tools, use the I<--format> command line parameter as "
2281 #: ../src/guestfs.pod:1170
2282 msgid "CONNECTION MANAGEMENT"
2286 #: ../src/guestfs.pod:1172
2291 #: ../src/guestfs.pod:1174
2293 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
2294 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
2295 "handle and release all resources used."
2299 #: ../src/guestfs.pod:1178
2301 "For information on using multiple handles and threads, see the section L</"
2302 "MULTIPLE HANDLES AND MULTIPLE THREADS> below."
2306 #: ../src/guestfs.pod:1181
2307 msgid "guestfs_create"
2311 #: ../src/guestfs.pod:1183
2314 " guestfs_h *guestfs_create (void);\n"
2319 #: ../src/guestfs.pod:1185
2320 msgid "Create a connection handle."
2324 #: ../src/guestfs.pod:1187
2326 "You have to call L</guestfs_add_drive_opts> (or one of the equivalent calls) "
2327 "on the handle at least once."
2331 #: ../src/guestfs.pod:1190
2333 "This function returns a non-NULL pointer to a handle on success or NULL on "
2338 #: ../src/guestfs.pod:1193
2339 msgid "After configuring the handle, you have to call L</guestfs_launch>."
2343 #: ../src/guestfs.pod:1195
2345 "You may also want to configure error handling for the handle. See L</ERROR "
2346 "HANDLING> section below."
2350 #: ../src/guestfs.pod:1198
2351 msgid "guestfs_close"
2355 #: ../src/guestfs.pod:1200
2358 " void guestfs_close (guestfs_h *g);\n"
2363 #: ../src/guestfs.pod:1202
2364 msgid "This closes the connection handle and frees up all resources used."
2368 #: ../src/guestfs.pod:1204
2369 msgid "ERROR HANDLING"
2373 #: ../src/guestfs.pod:1206
2375 "API functions can return errors. For example, almost all functions that "
2376 "return C<int> will return C<-1> to indicate an error."
2380 #: ../src/guestfs.pod:1209
2382 "Additional information is available for errors: an error message string and "
2383 "optionally an error number (errno) if the thing that failed was a system "
2388 #: ../src/guestfs.pod:1213
2390 "You can get at the additional information about the last error on the handle "
2391 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
2392 "up an error handler with L</guestfs_set_error_handler>."
2396 #: ../src/guestfs.pod:1218
2398 "When the handle is created, a default error handler is installed which "
2399 "prints the error message string to C<stderr>. For small short-running "
2400 "command line programs it is sufficient to do:"
2404 #: ../src/guestfs.pod:1222
2407 " if (guestfs_launch (g) == -1)\n"
2408 " exit (EXIT_FAILURE);\n"
2413 #: ../src/guestfs.pod:1225
2415 "since the default error handler will ensure that an error message has been "
2416 "printed to C<stderr> before the program exits."
2420 #: ../src/guestfs.pod:1228
2422 "For other programs the caller will almost certainly want to install an "
2423 "alternate error handler or do error handling in-line like this:"
2427 #: ../src/guestfs.pod:1231
2430 " g = guestfs_create ();\n"
2435 #: ../src/guestfs.pod:1233
2438 " /* This disables the default behaviour of printing errors\n"
2440 " guestfs_set_error_handler (g, NULL, NULL);\n"
2445 #: ../src/guestfs.pod:1237
2448 " if (guestfs_launch (g) == -1) {\n"
2449 " /* Examine the error message and print it etc. */\n"
2450 " char *msg = guestfs_last_error (g);\n"
2451 " int errnum = guestfs_last_errno (g);\n"
2452 " fprintf (stderr, \"%s\\n\", msg);\n"
2459 #: ../src/guestfs.pod:1245
2461 "Out of memory errors are handled differently. The default action is to call "
2462 "L<abort(3)>. If this is undesirable, then you can set a handler using L</"
2463 "guestfs_set_out_of_memory_handler>."
2467 #: ../src/guestfs.pod:1249
2469 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
2470 "because there is no handle if this happens there is no way to get additional "
2471 "error information. However L</guestfs_create> is supposed to be a "
2472 "lightweight operation which can only fail because of insufficient memory (it "
2473 "returns NULL in this case)."
2477 #: ../src/guestfs.pod:1255
2478 msgid "guestfs_last_error"
2482 #: ../src/guestfs.pod:1257
2485 " const char *guestfs_last_error (guestfs_h *g);\n"
2490 #: ../src/guestfs.pod:1259
2492 "This returns the last error message that happened on C<g>. If there has not "
2493 "been an error since the handle was created, then this returns C<NULL>."
2497 #: ../src/guestfs.pod:1263
2499 "The lifetime of the returned string is until the next error occurs, or L</"
2500 "guestfs_close> is called."
2504 #: ../src/guestfs.pod:1266
2505 msgid "guestfs_last_errno"
2509 #: ../src/guestfs.pod:1268
2512 " int guestfs_last_errno (guestfs_h *g);\n"
2517 #: ../src/guestfs.pod:1270
2518 msgid "This returns the last error number (errno) that happened on C<g>."
2522 #: ../src/guestfs.pod:1272
2523 msgid "If successful, an errno integer not equal to zero is returned."
2527 #: ../src/guestfs.pod:1274
2529 "If no error, this returns 0. This call can return 0 in three situations:"
2533 #: ../src/guestfs.pod:1281
2534 msgid "There has not been any error on the handle."
2538 #: ../src/guestfs.pod:1285
2540 "There has been an error but the errno was meaningless. This corresponds to "
2541 "the case where the error did not come from a failed system call, but for "
2542 "some other reason."
2546 #: ../src/guestfs.pod:1291
2548 "There was an error from a failed system call, but for some reason the errno "
2549 "was not captured and returned. This usually indicates a bug in libguestfs."
2553 #: ../src/guestfs.pod:1297
2555 "Libguestfs tries to convert the errno from inside the applicance into a "
2556 "corresponding errno for the caller (not entirely trivial: the appliance "
2557 "might be running a completely different operating system from the library "
2558 "and error numbers are not standardized across Un*xen). If this could not be "
2559 "done, then the error is translated to C<EINVAL>. In practice this should "
2560 "only happen in very rare circumstances."
2564 #: ../src/guestfs.pod:1305
2565 msgid "guestfs_set_error_handler"
2569 #: ../src/guestfs.pod:1307
2572 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
2574 " const char *msg);\n"
2575 " void guestfs_set_error_handler (guestfs_h *g,\n"
2576 " guestfs_error_handler_cb cb,\n"
2582 #: ../src/guestfs.pod:1314
2584 "The callback C<cb> will be called if there is an error. The parameters "
2585 "passed to the callback are an opaque data pointer and the error message "
2590 #: ../src/guestfs.pod:1318
2592 "C<errno> is not passed to the callback. To get that the callback must call "
2593 "L</guestfs_last_errno>."
2597 #: ../src/guestfs.pod:1321
2599 "Note that the message string C<msg> is freed as soon as the callback "
2600 "function returns, so if you want to stash it somewhere you must make your "
2605 #: ../src/guestfs.pod:1325
2606 msgid "The default handler prints messages on C<stderr>."
2610 #: ../src/guestfs.pod:1327
2611 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
2615 #: ../src/guestfs.pod:1329
2616 msgid "guestfs_get_error_handler"
2620 #: ../src/guestfs.pod:1331
2623 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
2624 " void **opaque_rtn);\n"
2629 #: ../src/guestfs.pod:1334
2630 msgid "Returns the current error handler callback."
2634 #: ../src/guestfs.pod:1336
2635 msgid "guestfs_set_out_of_memory_handler"
2639 #: ../src/guestfs.pod:1338
2642 " typedef void (*guestfs_abort_cb) (void);\n"
2643 " int guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
2644 " guestfs_abort_cb);\n"
2649 #: ../src/guestfs.pod:1342
2651 "The callback C<cb> will be called if there is an out of memory situation. "
2652 "I<Note this callback must not return>."
2656 #: ../src/guestfs.pod:1345
2657 msgid "The default is to call L<abort(3)>."
2661 #: ../src/guestfs.pod:1347
2663 "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
2667 #: ../src/guestfs.pod:1350
2668 msgid "guestfs_get_out_of_memory_handler"
2672 #: ../src/guestfs.pod:1352
2675 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
2680 #: ../src/guestfs.pod:1354
2681 msgid "This returns the current out of memory handler."
2685 #: ../src/guestfs.pod:1356
2690 #: ../src/guestfs.pod:1358 ../fish/guestfish.pod:908
2695 #: ../src/guestfs.pod:1360
2700 #: ../src/guestfs.pod:1362
2705 #: ../src/guestfs.pod:1364
2706 msgid "AVAILABILITY"
2710 #: ../src/guestfs.pod:1366
2711 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
2715 #: ../src/guestfs.pod:1368
2717 "Using L</guestfs_available> you can test availability of the following "
2718 "groups of functions. This test queries the appliance to see if the "
2719 "appliance you are currently using supports the functionality."
2723 #: ../src/guestfs.pod:1373
2724 msgid "@AVAILABILITY@"
2728 #: ../src/guestfs.pod:1375
2729 msgid "GUESTFISH supported COMMAND"
2733 #: ../src/guestfs.pod:1377
2735 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
2736 "prints out the available groups and whether they are supported by this build "
2737 "of libguestfs. Note however that you have to do C<run> first."
2741 #: ../src/guestfs.pod:1382
2742 msgid "SINGLE CALLS AT COMPILE TIME"
2746 #: ../src/guestfs.pod:1384
2748 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
2749 "function, such as:"
2753 #: ../src/guestfs.pod:1387
2756 " #define LIBGUESTFS_HAVE_DD 1\n"
2761 #: ../src/guestfs.pod:1389
2762 msgid "if L</guestfs_dd> is available."
2766 #: ../src/guestfs.pod:1391
2768 "Before version 1.5.8, if you needed to test whether a single libguestfs "
2769 "function is available at compile time, we recommended using build tools such "
2770 "as autoconf or cmake. For example in autotools you could use:"
2774 #: ../src/guestfs.pod:1396
2777 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
2778 " AC_CHECK_FUNCS([guestfs_dd])\n"
2783 #: ../src/guestfs.pod:1399
2785 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
2790 #: ../src/guestfs.pod:1402
2791 msgid "SINGLE CALLS AT RUN TIME"
2795 #: ../src/guestfs.pod:1404
2797 "Testing at compile time doesn't guarantee that a function really exists in "
2798 "the library. The reason is that you might be dynamically linked against a "
2799 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
2800 "This situation unfortunately results in a segmentation fault, which is a "
2801 "shortcoming of the C dynamic linking system itself."
2805 #: ../src/guestfs.pod:1411
2807 "You can use L<dlopen(3)> to test if a function is available at run time, as "
2808 "in this example program (note that you still need the compile time check as "
2813 #: ../src/guestfs.pod:1415
2816 " #include <stdio.h>\n"
2817 " #include <stdlib.h>\n"
2818 " #include <unistd.h>\n"
2819 " #include <dlfcn.h>\n"
2820 " #include <guestfs.h>\n"
2825 #: ../src/guestfs.pod:1421
2830 " #ifdef LIBGUESTFS_HAVE_DD\n"
2832 " int has_function;\n"
2837 #: ../src/guestfs.pod:1427
2840 " /* Test if the function guestfs_dd is really available. */\n"
2841 " dl = dlopen (NULL, RTLD_LAZY);\n"
2843 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
2844 " exit (EXIT_FAILURE);\n"
2846 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
2852 #: ../src/guestfs.pod:1436
2855 " if (!has_function)\n"
2856 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
2858 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
2859 " /* Now it's safe to call\n"
2860 " guestfs_dd (g, \"foo\", \"bar\");\n"
2864 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
2871 #: ../src/guestfs.pod:1449
2873 "You may think the above is an awful lot of hassle, and it is. There are "
2874 "other ways outside of the C linking system to ensure that this kind of "
2875 "incompatibility never arises, such as using package versioning:"
2879 #: ../src/guestfs.pod:1454
2882 " Requires: libguestfs >= 1.0.80\n"
2887 #: ../src/guestfs.pod:1456
2888 msgid "CALLS WITH OPTIONAL ARGUMENTS"
2892 #: ../src/guestfs.pod:1458
2894 "A recent feature of the API is the introduction of calls which take optional "
2895 "arguments. In C these are declared 3 ways. The main way is as a call which "
2896 "takes variable arguments (ie. C<...>), as in this example:"
2900 #: ../src/guestfs.pod:1463
2903 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
2908 #: ../src/guestfs.pod:1465
2910 "Call this with a list of optional arguments, terminated by C<-1>. So to "
2911 "call with no optional arguments specified:"
2915 #: ../src/guestfs.pod:1468
2918 " guestfs_add_drive_opts (g, filename, -1);\n"
2923 #: ../src/guestfs.pod:1470
2924 msgid "With a single optional argument:"
2928 #: ../src/guestfs.pod:1472
2931 " guestfs_add_drive_opts (g, filename,\n"
2932 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2938 #: ../src/guestfs.pod:1476
2943 #: ../src/guestfs.pod:1478
2946 " guestfs_add_drive_opts (g, filename,\n"
2947 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
2948 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
2954 #: ../src/guestfs.pod:1483
2956 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
2961 #: ../src/guestfs.pod:1486
2962 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
2966 #: ../src/guestfs.pod:1488
2968 "The second variant has the same name with the suffix C<_va>, which works the "
2969 "same way but takes a C<va_list>. See the C manual for details. For the "
2970 "example function, this is declared:"
2974 #: ../src/guestfs.pod:1492
2977 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
2983 #: ../src/guestfs.pod:1495
2984 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
2988 #: ../src/guestfs.pod:1497
2990 "The third variant is useful where you need to construct these calls. You "
2991 "pass in a structure where you fill in the optional fields. The structure "
2992 "has a bitmask as the first element which you must set to indicate which "
2993 "fields you have filled in. For our example function the structure and call "
2998 #: ../src/guestfs.pod:1503
3001 " struct guestfs_add_drive_opts_argv {\n"
3002 " uint64_t bitmask;\n"
3004 " const char *format;\n"
3007 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
3008 " const struct guestfs_add_drive_opts_argv *optargs);\n"
3013 #: ../src/guestfs.pod:1512
3014 msgid "You could call it like this:"
3018 #: ../src/guestfs.pod:1514
3021 " struct guestfs_add_drive_opts_argv optargs = {\n"
3022 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
3023 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
3025 " .format = \"qcow2\"\n"
3031 #: ../src/guestfs.pod:1521
3034 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
3039 #: ../src/guestfs.pod:1523 ../src/guestfs-actions.pod:11
3040 #: ../src/guestfs-actions.pod:1844 ../fish/guestfish-actions.pod:9
3041 #: ../fish/guestfish-actions.pod:1255
3046 #: ../src/guestfs.pod:1529
3047 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
3051 #: ../src/guestfs.pod:1534
3052 msgid "You do not need to fill in all fields of the structure."
3056 #: ../src/guestfs.pod:1538
3058 "There must be a one-to-one correspondence between fields of the structure "
3059 "that are filled in, and bits set in the bitmask."
3063 #: ../src/guestfs.pod:1543
3064 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
3068 #: ../src/guestfs.pod:1545
3070 "In other languages, optional arguments are expressed in the way that is "
3071 "natural for that language. We refer you to the language-specific "
3072 "documentation for more details on that."
3076 #: ../src/guestfs.pod:1549
3077 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
3081 #: ../src/guestfs.pod:1551
3082 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
3086 #: ../src/guestfs.pod:1553
3088 "The child process generates events in some situations. Current events "
3089 "include: receiving a log message, the child process exits."
3093 #: ../src/guestfs.pod:1556
3095 "Use the C<guestfs_set_*_callback> functions to set a callback for different "
3100 #: ../src/guestfs.pod:1559
3102 "Only I<one callback of each type> can be registered for each handle. "
3103 "Calling C<guestfs_set_*_callback> again overwrites the previous callback of "
3104 "that type. Cancel all callbacks of this type by calling this function with "
3105 "C<cb> set to C<NULL>."
3109 #: ../src/guestfs.pod:1564
3110 msgid "guestfs_set_log_message_callback"
3114 #: ../src/guestfs.pod:1566
3117 " typedef void (*guestfs_log_message_cb) (guestfs_h *g, void *opaque,\n"
3118 " char *buf, int len);\n"
3119 " void guestfs_set_log_message_callback (guestfs_h *g,\n"
3120 " guestfs_log_message_cb cb,\n"
3126 #: ../src/guestfs.pod:1572
3128 "The callback function C<cb> will be called whenever qemu or the guest writes "
3129 "anything to the console."
3133 #: ../src/guestfs.pod:1575
3134 msgid "Use this function to capture kernel messages and similar."
3138 #: ../src/guestfs.pod:1577
3140 "Normally there is no log message handler, and log messages are just "
3145 #: ../src/guestfs.pod:1580
3146 msgid "guestfs_set_subprocess_quit_callback"
3150 #: ../src/guestfs.pod:1582
3153 " typedef void (*guestfs_subprocess_quit_cb) (guestfs_h *g, void *opaque);\n"
3154 " void guestfs_set_subprocess_quit_callback (guestfs_h *g,\n"
3155 " guestfs_subprocess_quit_cb cb,\n"
3161 #: ../src/guestfs.pod:1587
3163 "The callback function C<cb> will be called when the child process quits, "
3164 "either asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
3165 "corresponds to a transition from any state to the CONFIG state)."
3169 #: ../src/guestfs.pod:1592
3170 msgid "guestfs_set_launch_done_callback"
3174 #: ../src/guestfs.pod:1594
3177 " typedef void (*guestfs_launch_done_cb) (guestfs_h *g, void *opaque);\n"
3178 " void guestfs_set_launch_done_callback (guestfs_h *g,\n"
3179 " guestfs_launch_done_cb cb,\n"
3185 #: ../src/guestfs.pod:1599
3187 "The callback function C<cb> will be called when the child process becomes "
3188 "ready first time after it has been launched. (This corresponds to a "
3189 "transition from LAUNCHING to the READY state)."
3193 #: ../src/guestfs.pod:1603
3194 msgid "guestfs_set_close_callback"
3198 #: ../src/guestfs.pod:1605
3201 " typedef void (*guestfs_close_cb) (guestfs_h *g, void *opaque);\n"
3202 " void guestfs_set_close_callback (guestfs_h *g,\n"
3203 " guestfs_close_cb cb,\n"
3209 #: ../src/guestfs.pod:1610
3211 "The callback function C<cb> will be called while the handle is being closed "
3212 "(synchronously from L</guestfs_close>)."
3216 #: ../src/guestfs.pod:1613
3218 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
3219 "handles that are open when the program exits. This means that this callback "
3220 "might be called indirectly from L<exit(3)>, which can cause unexpected "
3221 "problems in higher-level languages (eg. if your HLL interpreter has already "
3222 "been cleaned up by the time this is called, and if your callback then jumps "
3223 "into some HLL function)."
3227 #: ../src/guestfs.pod:1621
3228 msgid "guestfs_set_progress_callback"
3232 #: ../src/guestfs.pod:1623
3235 " typedef void (*guestfs_progress_cb) (guestfs_h *g, void *opaque,\n"
3236 " int proc_nr, int serial,\n"
3237 " uint64_t position, uint64_t total);\n"
3238 " void guestfs_set_progress_callback (guestfs_h *g,\n"
3239 " guestfs_progress_cb cb,\n"
3245 #: ../src/guestfs.pod:1630
3247 "Some long-running operations can generate progress messages. If this "
3248 "callback is registered, then it will be called each time a progress message "
3249 "is generated (usually two seconds after the operation started, and three "
3250 "times per second thereafter until it completes, although the frequency may "
3251 "change in future versions)."
3255 #: ../src/guestfs.pod:1636
3257 "The callback receives two numbers: C<position> and C<total>. The units of "
3258 "C<total> are not defined, although for some operations C<total> may relate "
3259 "in some way to the amount of data to be transferred (eg. in bytes or "
3260 "megabytes), and C<position> may be the portion which has been transferred."
3264 #: ../src/guestfs.pod:1642
3265 msgid "The only defined and stable parts of the API are:"
3269 #: ../src/guestfs.pod:1648
3271 "The callback can display to the user some type of progress bar or indicator "
3272 "which shows the ratio of C<position>:C<total>."
3276 #: ../src/guestfs.pod:1653
3277 msgid "0 E<lt>= C<position> E<lt>= C<total>"
3281 #: ../src/guestfs.pod:1657
3283 "If any progress notification is sent during a call, then a final progress "
3284 "notification is always sent when C<position> = C<total>."
3288 #: ../src/guestfs.pod:1660
3290 "This is to simplify caller code, so callers can easily set the progress "
3291 "indicator to \"100%\" at the end of the operation, without requiring special "
3292 "code to detect this case."
3296 #: ../src/guestfs.pod:1666
3298 "The callback also receives the procedure number and serial number of the "
3299 "call. These are only useful for debugging protocol issues, and the callback "
3300 "can normally ignore them. The callback may want to print these numbers in "
3301 "error messages or debugging messages."
3305 #: ../src/guestfs.pod:1671
3306 msgid "PRIVATE DATA AREA"
3310 #: ../src/guestfs.pod:1673
3312 "You can attach named pieces of private data to the libguestfs handle, and "
3313 "fetch them by name for the lifetime of the handle. This is called the "
3314 "private data area and is only available from the C API."
3318 #: ../src/guestfs.pod:1677
3319 msgid "To attach a named piece of data, use the following call:"
3323 #: ../src/guestfs.pod:1679
3326 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
3331 #: ../src/guestfs.pod:1681
3333 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
3334 "pointer (which can be C<NULL>). Any previous item with the same name is "
3339 #: ../src/guestfs.pod:1685
3341 "You can use any C<key> you want, but names beginning with an underscore "
3342 "character are reserved for internal libguestfs purposes (for implementing "
3343 "language bindings). It is recommended to prefix the name with some unique "
3344 "string to avoid collisions with other users."
3348 #: ../src/guestfs.pod:1690
3349 msgid "To retrieve the pointer, use:"
3353 #: ../src/guestfs.pod:1692
3356 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
3361 #: ../src/guestfs.pod:1694
3363 "This function returns C<NULL> if either no data is found associated with "
3364 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
3369 #: ../src/guestfs.pod:1698
3371 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
3372 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
3373 "all. In particular, libguestfs does I<not> try to free the data when the "
3374 "handle is closed. If the data must be freed, then the caller must either "
3375 "free it before calling L</guestfs_close> or must set up a close callback to "
3376 "do it (see L</guestfs_set_close_callback>, and note that only one callback "
3377 "can be registered for a handle)."
3381 #: ../src/guestfs.pod:1706
3383 "The private data area is implemented using a hash table, and should be "
3384 "reasonably efficient for moderate numbers of keys."
3388 #: ../src/guestfs.pod:1709 ../src/guestfs.pod:1714
3393 #: ../src/guestfs.pod:1711
3395 "<!-- old anchor for the next section --> <a name="
3396 "\"state_machine_and_low_level_event_api\"/>"
3400 #: ../src/guestfs.pod:1716
3401 msgid "ARCHITECTURE"
3405 #: ../src/guestfs.pod:1718
3407 "Internally, libguestfs is implemented by running an appliance (a special "
3408 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
3409 "process of the main program."
3413 #: ../src/guestfs.pod:1722
3416 " ___________________\n"
3418 " | main program |\n"
3420 " | | child process / appliance\n"
3421 " | | __________________________\n"
3423 " +-------------------+ RPC | +-----------------+ |\n"
3424 " | libguestfs <--------------------> guestfsd | |\n"
3425 " | | | +-----------------+ |\n"
3426 " \\___________________/ | | Linux kernel | |\n"
3427 " | +--^--------------+ |\n"
3428 " \\_________|________________/\n"
3434 " \\______________/\n"
3439 #: ../src/guestfs.pod:1742
3441 "The library, linked to the main program, creates the child process and hence "
3442 "the appliance in the L</guestfs_launch> function."
3446 #: ../src/guestfs.pod:1745
3448 "Inside the appliance is a Linux kernel and a complete stack of userspace "
3449 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
3450 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
3451 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
3452 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
3453 "attached to the qemu process which translates device access by the "
3454 "appliance's Linux kernel into accesses to the image."
3458 #: ../src/guestfs.pod:1754
3460 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
3461 "Although the disk image you are attached to might also be used by some "
3462 "virtual machine, libguestfs doesn't know or care about this. (But you will "
3463 "care if both libguestfs's qemu process and your virtual machine are trying "
3464 "to update the disk image at the same time, since these usually results in "
3465 "massive disk corruption)."
3469 #: ../src/guestfs.pod:1761
3470 msgid "STATE MACHINE"
3474 #: ../src/guestfs.pod:1763
3475 msgid "libguestfs uses a state machine to model the child process:"
3479 #: ../src/guestfs.pod:1765
3491 " / | \\ \\ guestfs_launch\n"
3492 " / | _\\__V______\n"
3494 " / | | LAUNCHING |\n"
3495 " / | \\___________/\n"
3497 " / | guestfs_launch\n"
3499 " ______ / __|____V\n"
3500 " / \\ ------> / \\\n"
3501 " | BUSY | | READY |\n"
3502 " \\______/ <------ \\________/\n"
3507 #: ../src/guestfs.pod:1787
3509 "The normal transitions are (1) CONFIG (when the handle is created, but there "
3510 "is no child process), (2) LAUNCHING (when the child process is booting up), "
3511 "(3) alternating between READY and BUSY as commands are issued to, and "
3512 "carried out by, the child process."
3516 #: ../src/guestfs.pod:1792
3518 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
3519 "asynchronously at any time (eg. due to some internal error), and that causes "
3520 "the state to transition back to CONFIG."
3524 #: ../src/guestfs.pod:1796
3526 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
3527 "issued when in the CONFIG state."
3531 #: ../src/guestfs.pod:1799
3533 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
3534 "L</guestfs_launch> blocks until the child process is READY to accept "
3535 "commands (or until some failure or timeout). L</guestfs_launch> internally "
3536 "moves the state from CONFIG to LAUNCHING while it is running."
3540 #: ../src/guestfs.pod:1805
3542 "API actions such as L</guestfs_mount> can only be issued when in the READY "
3543 "state. These API calls block waiting for the command to be carried out (ie. "
3544 "the state to transition to BUSY and then back to READY). There are no non-"
3545 "blocking versions, and no way to issue more than one command per handle at "
3550 #: ../src/guestfs.pod:1811
3552 "Finally, the child process sends asynchronous messages back to the main "
3553 "program, such as kernel log messages. You can register a callback to "
3554 "receive these messages."
3558 #: ../src/guestfs.pod:1815
3563 #: ../src/guestfs.pod:1817
3564 msgid "COMMUNICATION PROTOCOL"
3568 #: ../src/guestfs.pod:1819
3570 "Don't rely on using this protocol directly. This section documents how it "
3571 "currently works, but it may change at any time."
3575 #: ../src/guestfs.pod:1822
3577 "The protocol used to talk between the library and the daemon running inside "
3578 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
3579 "1014, RFC 1832, RFC 4506)."
3583 #: ../src/guestfs.pod:1826
3585 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
3586 "this file is automatically generated)."
3590 #: ../src/guestfs.pod:1829
3592 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
3593 "and C<FileOut> parameters, which are handled with very simple request/reply "
3594 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
3595 "parameters, which use the same request and reply messages, but they may also "
3596 "be followed by files sent using a chunked encoding."
3600 #: ../src/guestfs.pod:1836
3601 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
3605 #: ../src/guestfs.pod:1838
3606 msgid "For ordinary functions, the request message is:"
3610 #: ../src/guestfs.pod:1840
3613 " total length (header + arguments,\n"
3614 " but not including the length word itself)\n"
3615 " struct guestfs_message_header (encoded as XDR)\n"
3616 " struct guestfs_<foo>_args (encoded as XDR)\n"
3621 #: ../src/guestfs.pod:1845
3623 "The total length field allows the daemon to allocate a fixed size buffer "
3624 "into which it slurps the rest of the message. As a result, the total length "
3625 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
3626 "effective size of any request is limited to somewhere under this size."
3630 #: ../src/guestfs.pod:1851
3632 "Note also that many functions don't take any arguments, in which case the "
3633 "C<guestfs_I<foo>_args> is completely omitted."
3637 #: ../src/guestfs.pod:1854
3639 "The header contains the procedure number (C<guestfs_proc>) which is how the "
3640 "receiver knows what type of args structure to expect, or none at all."
3644 #: ../src/guestfs.pod:1858
3646 "For functions that take optional arguments, the optional arguments are "
3647 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
3648 "arguments. A bitmask in the header indicates which optional arguments are "
3649 "meaningful. The bitmask is also checked to see if it contains bits set "
3650 "which the daemon does not know about (eg. if more optional arguments were "
3651 "added in a later version of the library), and this causes the call to be "
3656 #: ../src/guestfs.pod:1866
3657 msgid "The reply message for ordinary functions is:"
3661 #: ../src/guestfs.pod:1868
3664 " total length (header + ret,\n"
3665 " but not including the length word itself)\n"
3666 " struct guestfs_message_header (encoded as XDR)\n"
3667 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3672 #: ../src/guestfs.pod:1873
3674 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
3675 "functions that return no formal return values."
3679 #: ../src/guestfs.pod:1876
3681 "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
3685 #: ../src/guestfs.pod:1879
3687 "In the case of an error, a flag is set in the header, and the reply message "
3688 "is slightly changed:"
3692 #: ../src/guestfs.pod:1882
3695 " total length (header + error,\n"
3696 " but not including the length word itself)\n"
3697 " struct guestfs_message_header (encoded as XDR)\n"
3698 " struct guestfs_message_error (encoded as XDR)\n"
3703 #: ../src/guestfs.pod:1887
3705 "The C<guestfs_message_error> structure contains the error message as a "
3710 #: ../src/guestfs.pod:1890
3711 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
3715 #: ../src/guestfs.pod:1892
3717 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
3718 "The normal request message is sent (see above). However this is followed by "
3719 "a sequence of file chunks."
3723 #: ../src/guestfs.pod:1896
3726 " total length (header + arguments,\n"
3727 " but not including the length word itself,\n"
3728 " and not including the chunks)\n"
3729 " struct guestfs_message_header (encoded as XDR)\n"
3730 " struct guestfs_<foo>_args (encoded as XDR)\n"
3731 " sequence of chunks for FileIn param #0\n"
3732 " sequence of chunks for FileIn param #1 etc.\n"
3737 #: ../src/guestfs.pod:1904
3738 msgid "The \"sequence of chunks\" is:"
3742 #: ../src/guestfs.pod:1906
3745 " length of chunk (not including length word itself)\n"
3746 " struct guestfs_chunk (encoded as XDR)\n"
3747 " length of chunk\n"
3748 " struct guestfs_chunk (encoded as XDR)\n"
3750 " length of chunk\n"
3751 " struct guestfs_chunk (with data.data_len == 0)\n"
3756 #: ../src/guestfs.pod:1914
3758 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
3759 "is set in the final chunk to indicate either successful completion or early "
3764 #: ../src/guestfs.pod:1918
3766 "At time of writing there are no functions that have more than one FileIn "
3767 "parameter. However this is (theoretically) supported, by sending the "
3768 "sequence of chunks for each FileIn parameter one after another (from left to "
3773 #: ../src/guestfs.pod:1923
3775 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
3776 "transfer. The library does this by sending a chunk with a special flag set "
3777 "to indicate cancellation. When the daemon sees this, it cancels the whole "
3778 "RPC, does I<not> send any reply, and goes back to reading the next request."
3782 #: ../src/guestfs.pod:1929
3784 "The daemon may also cancel. It does this by writing a special word "
3785 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
3786 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
3787 "cancel chunk). The special word is chosen so that even if cancellation "
3788 "happens right at the end of the transfer (after the library has finished "
3789 "writing and has started listening for the reply), the \"spurious\" cancel "
3790 "flag will not be confused with the reply message."
3794 #: ../src/guestfs.pod:1938
3796 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
3797 "limit), and also files where the size is not known in advance (eg. from "
3798 "pipes or sockets). However the chunks are rather small "
3799 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
3800 "to keep much in memory."
3804 #: ../src/guestfs.pod:1944
3805 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
3809 #: ../src/guestfs.pod:1946
3811 "The protocol for FileOut parameters is exactly the same as for FileIn "
3812 "parameters, but with the roles of daemon and library reversed."
3816 #: ../src/guestfs.pod:1949
3819 " total length (header + ret,\n"
3820 " but not including the length word itself,\n"
3821 " and not including the chunks)\n"
3822 " struct guestfs_message_header (encoded as XDR)\n"
3823 " struct guestfs_<foo>_ret (encoded as XDR)\n"
3824 " sequence of chunks for FileOut param #0\n"
3825 " sequence of chunks for FileOut param #1 etc.\n"
3830 #: ../src/guestfs.pod:1957
3831 msgid "INITIAL MESSAGE"
3835 #: ../src/guestfs.pod:1959
3837 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
3838 "which indicates that the guest and daemon is alive. This is what L</"
3839 "guestfs_launch> waits for."
3843 #: ../src/guestfs.pod:1963
3844 msgid "PROGRESS NOTIFICATION MESSAGES"
3848 #: ../src/guestfs.pod:1965
3850 "The daemon may send progress notification messages at any time. These are "
3851 "distinguished by the normal length word being replaced by "
3852 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
3856 #: ../src/guestfs.pod:1969
3858 "The library turns them into progress callbacks (see "
3859 "C<guestfs_set_progress_callback>) if there is a callback registered, or "
3860 "discards them if not."
3864 #: ../src/guestfs.pod:1973
3866 "The daemon self-limits the frequency of progress messages it sends (see "
3867 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
3872 #: ../src/guestfs.pod:1977
3873 msgid "LIBGUESTFS VERSION NUMBERS"
3877 #: ../src/guestfs.pod:1979
3879 "Since April 2010, libguestfs has started to make separate development and "
3880 "stable releases, along with corresponding branches in our git repository. "
3881 "These separate releases can be identified by version number:"
3885 #: ../src/guestfs.pod:1984
3888 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
3889 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
3895 " | `-------- sub-version\n"
3897 " `------ always '1' because we don't change the ABI\n"
3902 #: ../src/guestfs.pod:1995
3903 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
3907 #: ../src/guestfs.pod:1997
3909 "As time passes we cherry pick fixes from the development branch and backport "
3910 "those into the stable branch, the effect being that the stable branch should "
3911 "get more stable and less buggy over time. So the stable releases are ideal "
3912 "for people who don't need new features but would just like the software to "
3917 #: ../src/guestfs.pod:2003
3918 msgid "Our criteria for backporting changes are:"
3922 #: ../src/guestfs.pod:2009
3924 "Documentation changes which don't affect any code are backported unless the "
3925 "documentation refers to a future feature which is not in stable."
3929 #: ../src/guestfs.pod:2015
3931 "Bug fixes which are not controversial, fix obvious problems, and have been "
3932 "well tested are backported."
3936 #: ../src/guestfs.pod:2020
3938 "Simple rearrangements of code which shouldn't affect how it works get "
3939 "backported. This is so that the code in the two branches doesn't get too "
3940 "far out of step, allowing us to backport future fixes more easily."
3944 #: ../src/guestfs.pod:2026
3946 "We I<don't> backport new features, new APIs, new tools etc, except in one "
3947 "exceptional case: the new feature is required in order to implement an "
3948 "important bug fix."
3952 #: ../src/guestfs.pod:2032
3954 "A new stable branch starts when we think the new features in development are "
3955 "substantial and compelling enough over the current stable branch to warrant "
3956 "it. When that happens we create new stable and development versions 1.N.0 "
3957 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
3958 "stable at this point, but by backporting fixes from development, that branch "
3959 "will stabilize over time."
3963 #: ../src/guestfs.pod:2040 ../fish/guestfish.pod:915
3964 #: ../test-tool/libguestfs-test-tool.pod:104 ../tools/virt-edit.pl:330
3965 msgid "ENVIRONMENT VARIABLES"
3969 #: ../src/guestfs.pod:2044 ../fish/guestfish.pod:941
3970 msgid "LIBGUESTFS_APPEND"
3974 #: ../src/guestfs.pod:2046 ../fish/guestfish.pod:943
3975 msgid "Pass additional options to the guest kernel."
3979 #: ../src/guestfs.pod:2048 ../fish/guestfish.pod:945
3980 msgid "LIBGUESTFS_DEBUG"
3984 #: ../src/guestfs.pod:2050
3986 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
3987 "effect as calling C<guestfs_set_verbose (g, 1)>."
3991 #: ../src/guestfs.pod:2053 ../fish/guestfish.pod:950
3992 msgid "LIBGUESTFS_MEMSIZE"
3996 #: ../src/guestfs.pod:2055 ../fish/guestfish.pod:952
3998 "Set the memory allocated to the qemu process, in megabytes. For example:"
4002 #: ../src/guestfs.pod:2058 ../fish/guestfish.pod:955
4005 " LIBGUESTFS_MEMSIZE=700\n"
4010 #: ../src/guestfs.pod:2060 ../fish/guestfish.pod:957
4011 msgid "LIBGUESTFS_PATH"
4015 #: ../src/guestfs.pod:2062
4017 "Set the path that libguestfs uses to search for kernel and initrd.img. See "
4018 "the discussion of paths in section PATH above."
4022 #: ../src/guestfs.pod:2065 ../fish/guestfish.pod:962
4023 msgid "LIBGUESTFS_QEMU"
4027 #: ../src/guestfs.pod:2067 ../fish/guestfish.pod:964
4029 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
4030 "which was found at compile time by the configure script is used."
4034 #: ../src/guestfs.pod:2071
4035 msgid "See also L</QEMU WRAPPERS> above."
4039 #: ../src/guestfs.pod:2073 ../fish/guestfish.pod:968
4040 msgid "LIBGUESTFS_TRACE"
4044 #: ../src/guestfs.pod:2075
4046 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
4047 "effect as calling C<guestfs_set_trace (g, 1)>."
4051 #: ../src/guestfs.pod:2078 ../fish/guestfish.pod:977
4056 #: ../src/guestfs.pod:2080 ../fish/guestfish.pod:979
4057 msgid "Location of temporary directory, defaults to C</tmp>."
4061 #: ../src/guestfs.pod:2082 ../fish/guestfish.pod:981
4063 "If libguestfs was compiled to use the supermin appliance then the real "
4064 "appliance is cached in this directory, shared between all handles belonging "
4065 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
4066 "use in case C</tmp> is not large enough."
4070 #: ../src/guestfs.pod:2090 ../fish/guestfish.pod:1039
4071 #: ../test-tool/libguestfs-test-tool.pod:109 ../fuse/guestmount.pod:233
4072 #: ../tools/virt-edit.pl:350 ../tools/virt-win-reg.pl:484
4073 #: ../tools/virt-resize.pl:1483 ../tools/virt-list-filesystems.pl:189
4074 #: ../tools/virt-tar.pl:281 ../tools/virt-make-fs.pl:534
4075 #: ../tools/virt-list-partitions.pl:257
4080 #: ../src/guestfs.pod:2092
4082 "L<guestfs-examples(3)>, L<guestfs-ocaml(3)>, L<guestfs-python(3)>, L<guestfs-"
4083 "ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
4084 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
4085 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
4086 ">, L<virt-rescue(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, L<qemu(1)>, "
4087 "L<febootstrap(1)>, L<hivex(3)>, L<http://libguestfs.org/>."
4091 #: ../src/guestfs.pod:2115
4093 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, L<lvm"
4094 "(8)>, L<disktype(1)>."
4098 #: ../src/guestfs.pod:2122 ../tools/virt-win-reg.pl:499
4099 #: ../tools/virt-make-fs.pl:548
4104 #: ../src/guestfs.pod:2124
4105 msgid "To get a list of bugs against libguestfs use this link:"
4109 #: ../src/guestfs.pod:2126
4111 "L<https://bugzilla.redhat.com/buglist.cgi?"
4112 "component=libguestfs&product=Virtualization+Tools>"
4116 #: ../src/guestfs.pod:2128
4117 msgid "To report a new bug against libguestfs use this link:"
4121 #: ../src/guestfs.pod:2130
4123 "L<https://bugzilla.redhat.com/enter_bug.cgi?"
4124 "component=libguestfs&product=Virtualization+Tools>"
4128 #: ../src/guestfs.pod:2132
4129 msgid "When reporting a bug, please check:"
4133 #: ../src/guestfs.pod:2138
4134 msgid "That the bug hasn't been reported already."
4138 #: ../src/guestfs.pod:2142
4139 msgid "That you are testing a recent version."
4143 #: ../src/guestfs.pod:2146
4144 msgid "Describe the bug accurately, and give a way to reproduce it."
4148 #: ../src/guestfs.pod:2150
4150 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
4155 #: ../src/guestfs.pod:2155 ../fish/guestfish.pod:1058
4156 #: ../test-tool/libguestfs-test-tool.pod:115 ../fuse/guestmount.pod:244
4161 #: ../src/guestfs.pod:2157 ../fish/guestfish.pod:1060
4162 #: ../test-tool/libguestfs-test-tool.pod:117 ../fuse/guestmount.pod:246
4163 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4167 #: ../src/guestfs.pod:2159 ../fish/guestfish.pod:1062
4168 #: ../test-tool/libguestfs-test-tool.pod:119 ../fuse/guestmount.pod:248
4169 #: ../tools/virt-edit.pl:366 ../tools/virt-win-reg.pl:514
4170 #: ../tools/virt-resize.pl:1508 ../tools/virt-list-filesystems.pl:206
4171 #: ../tools/virt-tar.pl:296 ../tools/virt-make-fs.pl:563
4172 #: ../tools/virt-list-partitions.pl:273
4177 #: ../src/guestfs.pod:2161 ../fish/guestfish.pod:1064
4178 #: ../fuse/guestmount.pod:250
4179 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
4183 #: ../src/guestfs.pod:2164
4185 "This library is free software; you can redistribute it and/or modify it "
4186 "under the terms of the GNU Lesser General Public License as published by the "
4187 "Free Software Foundation; either version 2 of the License, or (at your "
4188 "option) any later version."
4192 #: ../src/guestfs.pod:2169
4194 "This library is distributed in the hope that it will be useful, but WITHOUT "
4195 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4196 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4201 #: ../src/guestfs.pod:2174
4203 "You should have received a copy of the GNU Lesser General Public License "
4204 "along with this library; if not, write to the Free Software Foundation, "
4205 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4209 #: ../src/guestfs-actions.pod:1
4210 msgid "guestfs_add_cdrom"
4214 #: ../src/guestfs-actions.pod:3
4218 " guestfs_add_cdrom (guestfs_h *g,\n"
4219 " const char *filename);\n"
4224 #: ../src/guestfs-actions.pod:7 ../fish/guestfish-actions.pod:5
4225 msgid "This function adds a virtual CD-ROM disk image to the guest."
4229 #: ../src/guestfs-actions.pod:9 ../fish/guestfish-actions.pod:7
4230 msgid "This is equivalent to the qemu parameter C<-cdrom filename>."
4234 #: ../src/guestfs-actions.pod:17
4236 "This call checks for the existence of C<filename>. This stops you from "
4237 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4238 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
4243 #: ../src/guestfs-actions.pod:24
4245 "If you just want to add an ISO file (often you use this as an efficient way "
4246 "to transfer large files into the guest), then you should probably use "
4247 "C<guestfs_add_drive_ro> instead."
4251 #: ../src/guestfs-actions.pod:30 ../src/guestfs-actions.pod:128
4252 #: ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:226
4253 #: ../src/guestfs-actions.pod:240 ../src/guestfs-actions.pod:261
4254 #: ../src/guestfs-actions.pod:281 ../src/guestfs-actions.pod:295
4255 #: ../src/guestfs-actions.pod:410 ../src/guestfs-actions.pod:430
4256 #: ../src/guestfs-actions.pod:444 ../src/guestfs-actions.pod:489
4257 #: ../src/guestfs-actions.pod:517 ../src/guestfs-actions.pod:535
4258 #: ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:635
4259 #: ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:664
4260 #: ../src/guestfs-actions.pod:763 ../src/guestfs-actions.pod:781
4261 #: ../src/guestfs-actions.pod:795 ../src/guestfs-actions.pod:809
4262 #: ../src/guestfs-actions.pod:970 ../src/guestfs-actions.pod:990
4263 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1092
4264 #: ../src/guestfs-actions.pod:1110 ../src/guestfs-actions.pod:1129
4265 #: ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1163
4266 #: ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1264
4267 #: ../src/guestfs-actions.pod:1289 ../src/guestfs-actions.pod:1326
4268 #: ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1466
4269 #: ../src/guestfs-actions.pod:1684 ../src/guestfs-actions.pod:1706
4270 #: ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:2215
4271 #: ../src/guestfs-actions.pod:2359 ../src/guestfs-actions.pod:2420
4272 #: ../src/guestfs-actions.pod:2455 ../src/guestfs-actions.pod:3194
4273 #: ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3229
4274 #: ../src/guestfs-actions.pod:3354 ../src/guestfs-actions.pod:3368
4275 #: ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:3395
4276 #: ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3446
4277 #: ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3538
4278 #: ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:3578
4279 #: ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3633
4280 #: ../src/guestfs-actions.pod:3652 ../src/guestfs-actions.pod:3671
4281 #: ../src/guestfs-actions.pod:3706 ../src/guestfs-actions.pod:3718
4282 #: ../src/guestfs-actions.pod:3754 ../src/guestfs-actions.pod:3770
4283 #: ../src/guestfs-actions.pod:3783 ../src/guestfs-actions.pod:3798
4284 #: ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:3908
4285 #: ../src/guestfs-actions.pod:3928 ../src/guestfs-actions.pod:3941
4286 #: ../src/guestfs-actions.pod:3992 ../src/guestfs-actions.pod:4010
4287 #: ../src/guestfs-actions.pod:4028 ../src/guestfs-actions.pod:4044
4288 #: ../src/guestfs-actions.pod:4058 ../src/guestfs-actions.pod:4072
4289 #: ../src/guestfs-actions.pod:4089 ../src/guestfs-actions.pod:4104
4290 #: ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:4168
4291 #: ../src/guestfs-actions.pod:4239 ../src/guestfs-actions.pod:4270
4292 #: ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:4308
4293 #: ../src/guestfs-actions.pod:4320 ../src/guestfs-actions.pod:4337
4294 #: ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4365
4295 #: ../src/guestfs-actions.pod:4380 ../src/guestfs-actions.pod:4415
4296 #: ../src/guestfs-actions.pod:4430 ../src/guestfs-actions.pod:4450
4297 #: ../src/guestfs-actions.pod:4464 ../src/guestfs-actions.pod:4481
4298 #: ../src/guestfs-actions.pod:4530 ../src/guestfs-actions.pod:4567
4299 #: ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4609
4300 #: ../src/guestfs-actions.pod:4626 ../src/guestfs-actions.pod:4644
4301 #: ../src/guestfs-actions.pod:4778 ../src/guestfs-actions.pod:4835
4302 #: ../src/guestfs-actions.pod:4857 ../src/guestfs-actions.pod:4875
4303 #: ../src/guestfs-actions.pod:4907 ../src/guestfs-actions.pod:4973
4304 #: ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5003
4305 #: ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5306
4306 #: ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5339
4307 #: ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5365
4308 #: ../src/guestfs-actions.pod:5377 ../src/guestfs-actions.pod:5391
4309 #: ../src/guestfs-actions.pod:5407 ../src/guestfs-actions.pod:5428
4310 #: ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5466
4311 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5507
4312 #: ../src/guestfs-actions.pod:5525 ../src/guestfs-actions.pod:5544
4313 #: ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:5584
4314 #: ../src/guestfs-actions.pod:5601 ../src/guestfs-actions.pod:5629
4315 #: ../src/guestfs-actions.pod:5653 ../src/guestfs-actions.pod:5672
4316 #: ../src/guestfs-actions.pod:5696 ../src/guestfs-actions.pod:5711
4317 #: ../src/guestfs-actions.pod:5726 ../src/guestfs-actions.pod:5745
4318 #: ../src/guestfs-actions.pod:5782 ../src/guestfs-actions.pod:5805
4319 #: ../src/guestfs-actions.pod:5831 ../src/guestfs-actions.pod:5939
4320 #: ../src/guestfs-actions.pod:6060 ../src/guestfs-actions.pod:6072
4321 #: ../src/guestfs-actions.pod:6085 ../src/guestfs-actions.pod:6098
4322 #: ../src/guestfs-actions.pod:6120 ../src/guestfs-actions.pod:6133
4323 #: ../src/guestfs-actions.pod:6146 ../src/guestfs-actions.pod:6159
4324 #: ../src/guestfs-actions.pod:6174 ../src/guestfs-actions.pod:6233
4325 #: ../src/guestfs-actions.pod:6250 ../src/guestfs-actions.pod:6266
4326 #: ../src/guestfs-actions.pod:6282 ../src/guestfs-actions.pod:6299
4327 #: ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6332
4328 #: ../src/guestfs-actions.pod:6368 ../src/guestfs-actions.pod:6382
4329 #: ../src/guestfs-actions.pod:6423 ../src/guestfs-actions.pod:6436
4330 #: ../src/guestfs-actions.pod:6454 ../src/guestfs-actions.pod:6488
4331 #: ../src/guestfs-actions.pod:6524 ../src/guestfs-actions.pod:6643
4332 #: ../src/guestfs-actions.pod:6661 ../src/guestfs-actions.pod:6675
4333 #: ../src/guestfs-actions.pod:6730 ../src/guestfs-actions.pod:6743
4334 #: ../src/guestfs-actions.pod:6788 ../src/guestfs-actions.pod:6821
4335 #: ../src/guestfs-actions.pod:6875 ../src/guestfs-actions.pod:6901
4336 #: ../src/guestfs-actions.pod:6967 ../src/guestfs-actions.pod:6986
4337 #: ../src/guestfs-actions.pod:7015
4338 msgid "This function returns 0 on success or -1 on error."
4342 #: ../src/guestfs-actions.pod:32 ../src/guestfs-actions.pod:242
4343 #: ../src/guestfs-actions.pod:263 ../fish/guestfish-actions.pod:28
4344 #: ../fish/guestfish-actions.pod:153 ../fish/guestfish-actions.pod:167
4346 "This function is deprecated. In new code, use the C<add_drive_opts> call "
4351 #: ../src/guestfs-actions.pod:35 ../src/guestfs-actions.pod:245
4352 #: ../src/guestfs-actions.pod:266 ../src/guestfs-actions.pod:1437
4353 #: ../src/guestfs-actions.pod:1923 ../src/guestfs-actions.pod:1944
4354 #: ../src/guestfs-actions.pod:4129 ../src/guestfs-actions.pod:6909
4355 #: ../src/guestfs-actions.pod:7078 ../fish/guestfish-actions.pod:31
4356 #: ../fish/guestfish-actions.pod:156 ../fish/guestfish-actions.pod:170
4357 #: ../fish/guestfish-actions.pod:951 ../fish/guestfish-actions.pod:1308
4358 #: ../fish/guestfish-actions.pod:1322 ../fish/guestfish-actions.pod:2778
4359 #: ../fish/guestfish-actions.pod:4580 ../fish/guestfish-actions.pod:4677
4361 "Deprecated functions will not be removed from the API, but the fact that "
4362 "they are deprecated indicates that there are problems with correct use of "
4367 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:130
4368 #: ../src/guestfs-actions.pod:1094 ../src/guestfs-actions.pod:1895
4369 #: ../src/guestfs-actions.pod:1993 ../src/guestfs-actions.pod:2096
4370 #: ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3211
4371 #: ../src/guestfs-actions.pod:4417 ../src/guestfs-actions.pod:5486
4372 #: ../src/guestfs-actions.pod:5603 ../src/guestfs-actions.pod:5713
4373 #: ../src/guestfs-actions.pod:6176 ../src/guestfs-actions.pod:6301
4374 #: ../src/guestfs-actions.pod:6823
4375 msgid "(Added in 0.3)"
4379 #: ../src/guestfs-actions.pod:41
4380 msgid "guestfs_add_domain"
4384 #: ../src/guestfs-actions.pod:43
4388 " guestfs_add_domain (guestfs_h *g,\n"
4389 " const char *dom,\n"
4395 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:139
4396 #: ../src/guestfs-actions.pod:4143
4398 "You may supply a list of optional arguments to this call. Use zero or more "
4399 "of the following pairs of parameters, and terminate the list with C<-1> on "
4400 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
4404 #: ../src/guestfs-actions.pod:53
4407 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
4408 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
4409 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
4414 #: ../src/guestfs-actions.pod:57
4416 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
4417 "It works by connecting to libvirt, requesting the domain and domain XML from "
4418 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
4423 #: ../src/guestfs-actions.pod:62 ../fish/guestfish-actions.pod:46
4425 "The number of disks added is returned. This operation is atomic: if an "
4426 "error is returned, then no disks are added."
4430 #: ../src/guestfs-actions.pod:65 ../fish/guestfish-actions.pod:49
4432 "This function does some minimal checks to make sure the libvirt domain is "
4433 "not running (unless C<readonly> is true). In a future version we will try "
4434 "to acquire the libvirt lock on each disk."
4438 #: ../src/guestfs-actions.pod:69 ../fish/guestfish-actions.pod:53
4440 "Disks must be accessible locally. This often means that adding disks from a "
4441 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
4442 "unless those disks are accessible via the same device path locally too."
4446 #: ../src/guestfs-actions.pod:74
4448 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
4449 "libvirt.org/uri.html>). If this is not set then we connect to the default "
4450 "libvirt URI (or one set through an environment variable, see the libvirt "
4451 "documentation for full details). If you are using the C API directly then "
4452 "it is more flexible to create the libvirt connection object yourself, get "
4453 "the domain object, and call C<guestfs_add_libvirt_dom>."
4457 #: ../src/guestfs-actions.pod:82
4459 "The other optional parameters are passed directly through to "
4460 "C<guestfs_add_drive_opts>."
4464 #: ../src/guestfs-actions.pod:85 ../src/guestfs-actions.pod:338
4465 #: ../src/guestfs-actions.pod:503 ../src/guestfs-actions.pod:681
4466 #: ../src/guestfs-actions.pod:712 ../src/guestfs-actions.pod:730
4467 #: ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:1309
4468 #: ../src/guestfs-actions.pod:1663 ../src/guestfs-actions.pod:1866
4469 #: ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:2005
4470 #: ../src/guestfs-actions.pod:2060 ../src/guestfs-actions.pod:2083
4471 #: ../src/guestfs-actions.pod:2346 ../src/guestfs-actions.pod:2634
4472 #: ../src/guestfs-actions.pod:2655 ../src/guestfs-actions.pod:4553
4473 #: ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:5087
4474 #: ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6409
4475 #: ../src/guestfs-actions.pod:6834 ../src/guestfs-actions.pod:6847
4476 #: ../src/guestfs-actions.pod:6860
4477 msgid "On error this function returns -1."
4481 #: ../src/guestfs-actions.pod:87
4482 msgid "(Added in 1.7.4)"
4486 #: ../src/guestfs-actions.pod:89
4487 msgid "guestfs_add_domain_va"
4491 #: ../src/guestfs-actions.pod:91
4495 " guestfs_add_domain_va (guestfs_h *g,\n"
4496 " const char *dom,\n"
4502 #: ../src/guestfs-actions.pod:96
4503 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
4507 #: ../src/guestfs-actions.pod:98 ../src/guestfs-actions.pod:109
4508 #: ../src/guestfs-actions.pod:202 ../src/guestfs-actions.pod:213
4509 #: ../src/guestfs-actions.pod:4180 ../src/guestfs-actions.pod:4192
4510 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
4514 #: ../src/guestfs-actions.pod:100
4515 msgid "guestfs_add_domain_argv"
4519 #: ../src/guestfs-actions.pod:102
4523 " guestfs_add_domain_argv (guestfs_h *g,\n"
4524 " const char *dom,\n"
4525 " const struct guestfs_add_domain_argv *optargs);\n"
4530 #: ../src/guestfs-actions.pod:107
4531 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
4535 #: ../src/guestfs-actions.pod:111
4536 msgid "guestfs_add_drive"
4540 #: ../src/guestfs-actions.pod:113
4544 " guestfs_add_drive (guestfs_h *g,\n"
4545 " const char *filename);\n"
4550 #: ../src/guestfs-actions.pod:117
4552 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
4553 "optional parameters, so the disk is added writable, with the format being "
4554 "detected automatically."
4558 #: ../src/guestfs-actions.pod:121
4560 "Automatic detection of the format opens you up to a potential security hole "
4561 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4562 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
4563 "you should think about replacing calls to this function with calls to "
4564 "C<guestfs_add_drive_opts>, and specifying the format."
4568 #: ../src/guestfs-actions.pod:132
4569 msgid "guestfs_add_drive_opts"
4573 #: ../src/guestfs-actions.pod:134
4577 " guestfs_add_drive_opts (guestfs_h *g,\n"
4578 " const char *filename,\n"
4584 #: ../src/guestfs-actions.pod:144
4587 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
4588 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
4589 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
4594 #: ../src/guestfs-actions.pod:148 ../fish/guestfish-actions.pod:92
4596 "This function adds a virtual machine disk image C<filename> to libguestfs. "
4597 "The first time you call this function, the disk appears as C</dev/sda>, the "
4598 "second time as C</dev/sdb>, and so on."
4602 #: ../src/guestfs-actions.pod:153 ../fish/guestfish-actions.pod:97
4604 "You don't necessarily need to be root when using libguestfs. However you "
4605 "obviously do need sufficient permissions to access the filename for whatever "
4606 "operations you want to perform (ie. read access if you just want to read the "
4607 "image or write access if you want to modify the image)."
4611 #: ../src/guestfs-actions.pod:159 ../fish/guestfish-actions.pod:103
4612 msgid "This call checks that C<filename> exists."
4616 #: ../src/guestfs-actions.pod:161 ../src/guestfs-actions.pod:4153
4617 #: ../fish/guestfish-actions.pod:105 ../fish/guestfish-actions.pod:2789
4618 msgid "The optional arguments are:"
4622 #: ../src/guestfs-actions.pod:165 ../fish/guestfish-actions.pod:109
4627 #: ../src/guestfs-actions.pod:167 ../fish/guestfish-actions.pod:111
4629 "If true then the image is treated as read-only. Writes are still allowed, "
4630 "but they are stored in a temporary snapshot overlay which is discarded at "
4631 "the end. The disk that you add is not modified."
4635 #: ../src/guestfs-actions.pod:171 ../fish/guestfish-actions.pod:115
4640 #: ../src/guestfs-actions.pod:173
4642 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
4643 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
4644 "Possible formats include C<raw> and C<qcow2>."
4648 #: ../src/guestfs-actions.pod:177 ../fish/guestfish-actions.pod:121
4650 "Automatic detection of the format opens you up to a potential security hole "
4651 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
4652 "RHBZ#642934. Specifying the format closes this security hole."
4656 #: ../src/guestfs-actions.pod:182 ../fish/guestfish-actions.pod:126
4661 #: ../src/guestfs-actions.pod:184
4663 "This rarely-used option lets you emulate the behaviour of the deprecated "
4664 "C<guestfs_add_drive_with_if> call (q.v.)"
4668 #: ../src/guestfs-actions.pod:191
4669 msgid "(Added in 1.5.23)"
4673 #: ../src/guestfs-actions.pod:193
4674 msgid "guestfs_add_drive_opts_va"
4678 #: ../src/guestfs-actions.pod:195
4682 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
4683 " const char *filename,\n"
4689 #: ../src/guestfs-actions.pod:200
4690 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
4694 #: ../src/guestfs-actions.pod:204
4695 msgid "guestfs_add_drive_opts_argv"
4699 #: ../src/guestfs-actions.pod:206
4703 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
4704 " const char *filename,\n"
4705 " const struct guestfs_add_drive_opts_argv *optargs);\n"
4710 #: ../src/guestfs-actions.pod:211
4711 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
4715 #: ../src/guestfs-actions.pod:215
4716 msgid "guestfs_add_drive_ro"
4720 #: ../src/guestfs-actions.pod:217
4724 " guestfs_add_drive_ro (guestfs_h *g,\n"
4725 " const char *filename);\n"
4730 #: ../src/guestfs-actions.pod:221
4732 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
4733 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
4734 "disk is added read-only, with the format being detected automatically."
4738 #: ../src/guestfs-actions.pod:228
4739 msgid "(Added in 1.0.38)"
4743 #: ../src/guestfs-actions.pod:230
4744 msgid "guestfs_add_drive_ro_with_if"
4748 #: ../src/guestfs-actions.pod:232
4752 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
4753 " const char *filename,\n"
4754 " const char *iface);\n"
4759 #: ../src/guestfs-actions.pod:237
4761 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
4762 "QEMU interface emulation to use at run time."
4766 #: ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
4767 #: ../src/guestfs-actions.pod:2305
4768 msgid "(Added in 1.0.84)"
4772 #: ../src/guestfs-actions.pod:251
4773 msgid "guestfs_add_drive_with_if"
4777 #: ../src/guestfs-actions.pod:253
4781 " guestfs_add_drive_with_if (guestfs_h *g,\n"
4782 " const char *filename,\n"
4783 " const char *iface);\n"
4788 #: ../src/guestfs-actions.pod:258
4790 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
4791 "QEMU interface emulation to use at run time."
4795 #: ../src/guestfs-actions.pod:272
4796 msgid "guestfs_aug_clear"
4800 #: ../src/guestfs-actions.pod:274
4804 " guestfs_aug_clear (guestfs_h *g,\n"
4805 " const char *augpath);\n"
4810 #: ../src/guestfs-actions.pod:278 ../fish/guestfish-actions.pod:178
4812 "Set the value associated with C<path> to C<NULL>. This is the same as the "
4813 "L<augtool(1)> C<clear> command."
4817 #: ../src/guestfs-actions.pod:283 ../src/guestfs-actions.pod:2085
4818 msgid "(Added in 1.3.4)"
4822 #: ../src/guestfs-actions.pod:285
4823 msgid "guestfs_aug_close"
4827 #: ../src/guestfs-actions.pod:287
4831 " guestfs_aug_close (guestfs_h *g);\n"
4836 #: ../src/guestfs-actions.pod:290
4838 "Close the current Augeas handle and free up any resources used by it. After "
4839 "calling this, you have to call C<guestfs_aug_init> again before you can use "
4840 "any other Augeas functions."
4844 #: ../src/guestfs-actions.pod:297 ../src/guestfs-actions.pod:322
4845 #: ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:354
4846 #: ../src/guestfs-actions.pod:412 ../src/guestfs-actions.pod:432
4847 #: ../src/guestfs-actions.pod:446 ../src/guestfs-actions.pod:477
4848 #: ../src/guestfs-actions.pod:491 ../src/guestfs-actions.pod:505
4849 #: ../src/guestfs-actions.pod:519 ../src/guestfs-actions.pod:537
4850 #: ../src/guestfs-actions.pod:5164
4851 msgid "(Added in 0.7)"
4855 #: ../src/guestfs-actions.pod:299
4856 msgid "guestfs_aug_defnode"
4860 #: ../src/guestfs-actions.pod:301
4863 " struct guestfs_int_bool *\n"
4864 " guestfs_aug_defnode (guestfs_h *g,\n"
4865 " const char *name,\n"
4866 " const char *expr,\n"
4867 " const char *val);\n"
4872 #: ../src/guestfs-actions.pod:307 ../fish/guestfish-actions.pod:194
4874 "Defines a variable C<name> whose value is the result of evaluating C<expr>."
4878 #: ../src/guestfs-actions.pod:310
4880 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
4881 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
4882 "containing that single node."
4886 #: ../src/guestfs-actions.pod:314 ../fish/guestfish-actions.pod:201
4888 "On success this returns a pair containing the number of nodes in the "
4889 "nodeset, and a boolean flag if a node was created."
4893 #: ../src/guestfs-actions.pod:318
4895 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
4896 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
4900 #: ../src/guestfs-actions.pod:324
4901 msgid "guestfs_aug_defvar"
4905 #: ../src/guestfs-actions.pod:326
4909 " guestfs_aug_defvar (guestfs_h *g,\n"
4910 " const char *name,\n"
4911 " const char *expr);\n"
4916 #: ../src/guestfs-actions.pod:331 ../fish/guestfish-actions.pod:209
4918 "Defines an Augeas variable C<name> whose value is the result of evaluating "
4919 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
4923 #: ../src/guestfs-actions.pod:335 ../fish/guestfish-actions.pod:213
4925 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
4926 "evaluates to something which is not a nodeset."
4930 #: ../src/guestfs-actions.pod:342
4931 msgid "guestfs_aug_get"
4935 #: ../src/guestfs-actions.pod:344
4939 " guestfs_aug_get (guestfs_h *g,\n"
4940 " const char *augpath);\n"
4945 #: ../src/guestfs-actions.pod:348 ../fish/guestfish-actions.pod:220
4947 "Look up the value associated with C<path>. If C<path> matches exactly one "
4948 "node, the C<value> is returned."
4952 #: ../src/guestfs-actions.pod:351 ../src/guestfs-actions.pod:851
4953 #: ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:929
4954 #: ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1048
4955 #: ../src/guestfs-actions.pod:1178 ../src/guestfs-actions.pod:1195
4956 #: ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1343
4957 #: ../src/guestfs-actions.pod:1534 ../src/guestfs-actions.pod:1646
4958 #: ../src/guestfs-actions.pod:1809 ../src/guestfs-actions.pod:1826
4959 #: ../src/guestfs-actions.pod:1917 ../src/guestfs-actions.pod:1938
4960 #: ../src/guestfs-actions.pod:2108 ../src/guestfs-actions.pod:2270
4961 #: ../src/guestfs-actions.pod:2477 ../src/guestfs-actions.pod:2558
4962 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2716
4963 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2771
4964 #: ../src/guestfs-actions.pod:2833 ../src/guestfs-actions.pod:2856
4965 #: ../src/guestfs-actions.pod:3340 ../src/guestfs-actions.pod:3690
4966 #: ../src/guestfs-actions.pod:3860 ../src/guestfs-actions.pod:3970
4967 #: ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4892
4968 #: ../src/guestfs-actions.pod:5062 ../src/guestfs-actions.pod:5240
4969 #: ../src/guestfs-actions.pod:5289 ../src/guestfs-actions.pod:5852
4970 #: ../src/guestfs-actions.pod:5868 ../src/guestfs-actions.pod:5885
4971 #: ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:6583
4972 #: ../src/guestfs-actions.pod:6602 ../src/guestfs-actions.pod:6620
4973 #: ../src/guestfs-actions.pod:6800 ../src/guestfs-actions.pod:7072
4975 "This function returns a string, or NULL on error. I<The caller must free "
4976 "the returned string after use>."
4980 #: ../src/guestfs-actions.pod:356
4981 msgid "guestfs_aug_init"
4985 #: ../src/guestfs-actions.pod:358
4989 " guestfs_aug_init (guestfs_h *g,\n"
4990 " const char *root,\n"
4996 #: ../src/guestfs-actions.pod:363 ../fish/guestfish-actions.pod:227
4998 "Create a new Augeas handle for editing configuration files. If there was "
4999 "any previous Augeas handle associated with this guestfs session, then it is "
5004 #: ../src/guestfs-actions.pod:367
5005 msgid "You must call this before using any other C<guestfs_aug_*> commands."
5009 #: ../src/guestfs-actions.pod:370 ../fish/guestfish-actions.pod:234
5011 "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5015 #: ../src/guestfs-actions.pod:373 ../fish/guestfish-actions.pod:237
5017 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5018 "logical I<or> of the following integers:"
5022 #: ../src/guestfs-actions.pod:379 ../fish/guestfish-actions.pod:243
5023 msgid "C<AUG_SAVE_BACKUP> = 1"
5027 #: ../src/guestfs-actions.pod:381 ../fish/guestfish-actions.pod:245
5028 msgid "Keep the original file with a C<.augsave> extension."
5032 #: ../src/guestfs-actions.pod:383 ../fish/guestfish-actions.pod:247
5033 msgid "C<AUG_SAVE_NEWFILE> = 2"
5037 #: ../src/guestfs-actions.pod:385 ../fish/guestfish-actions.pod:249
5039 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5040 "original. Overrides C<AUG_SAVE_BACKUP>."
5044 #: ../src/guestfs-actions.pod:388 ../fish/guestfish-actions.pod:252
5045 msgid "C<AUG_TYPE_CHECK> = 4"
5049 #: ../src/guestfs-actions.pod:390 ../fish/guestfish-actions.pod:254
5050 msgid "Typecheck lenses (can be expensive)."
5054 #: ../src/guestfs-actions.pod:392 ../fish/guestfish-actions.pod:256
5055 msgid "C<AUG_NO_STDINC> = 8"
5059 #: ../src/guestfs-actions.pod:394 ../fish/guestfish-actions.pod:258
5060 msgid "Do not use standard load path for modules."
5064 #: ../src/guestfs-actions.pod:396 ../fish/guestfish-actions.pod:260
5065 msgid "C<AUG_SAVE_NOOP> = 16"
5069 #: ../src/guestfs-actions.pod:398 ../fish/guestfish-actions.pod:262
5070 msgid "Make save a no-op, just record what would have been changed."
5074 #: ../src/guestfs-actions.pod:400 ../fish/guestfish-actions.pod:264
5075 msgid "C<AUG_NO_LOAD> = 32"
5079 #: ../src/guestfs-actions.pod:402
5080 msgid "Do not load the tree in C<guestfs_aug_init>."
5084 #: ../src/guestfs-actions.pod:406
5085 msgid "To close the handle, you can call C<guestfs_aug_close>."
5089 #: ../src/guestfs-actions.pod:408 ../fish/guestfish-actions.pod:272
5090 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5094 #: ../src/guestfs-actions.pod:414
5095 msgid "guestfs_aug_insert"
5099 #: ../src/guestfs-actions.pod:416
5103 " guestfs_aug_insert (guestfs_h *g,\n"
5104 " const char *augpath,\n"
5105 " const char *label,\n"
5111 #: ../src/guestfs-actions.pod:422 ../fish/guestfish-actions.pod:278
5113 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5114 "or after C<path> (depending on the boolean flag C<before>)."
5118 #: ../src/guestfs-actions.pod:426 ../fish/guestfish-actions.pod:282
5120 "C<path> must match exactly one existing node in the tree, and C<label> must "
5121 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5125 #: ../src/guestfs-actions.pod:434
5126 msgid "guestfs_aug_load"
5130 #: ../src/guestfs-actions.pod:436
5134 " guestfs_aug_load (guestfs_h *g);\n"
5139 #: ../src/guestfs-actions.pod:439 ../fish/guestfish-actions.pod:290
5140 msgid "Load files into the tree."
5144 #: ../src/guestfs-actions.pod:441 ../fish/guestfish-actions.pod:292
5145 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5149 #: ../src/guestfs-actions.pod:448
5150 msgid "guestfs_aug_ls"
5154 #: ../src/guestfs-actions.pod:450
5158 " guestfs_aug_ls (guestfs_h *g,\n"
5159 " const char *augpath);\n"
5164 #: ../src/guestfs-actions.pod:454
5166 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
5167 "sorting the resulting nodes into alphabetical order."
5171 #: ../src/guestfs-actions.pod:457 ../src/guestfs-actions.pod:473
5172 #: ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:1067
5173 #: ../src/guestfs-actions.pod:1358 ../src/guestfs-actions.pod:1377
5174 #: ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1499
5175 #: ../src/guestfs-actions.pod:1748 ../src/guestfs-actions.pod:2150
5176 #: ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2185
5177 #: ../src/guestfs-actions.pod:2228 ../src/guestfs-actions.pod:2252
5178 #: ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:2372
5179 #: ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:2790
5180 #: ../src/guestfs-actions.pod:3005 ../src/guestfs-actions.pod:3260
5181 #: ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3427
5182 #: ../src/guestfs-actions.pod:3832 ../src/guestfs-actions.pod:4514
5183 #: ../src/guestfs-actions.pod:5034 ../src/guestfs-actions.pod:5160
5184 #: ../src/guestfs-actions.pod:5274 ../src/guestfs-actions.pod:5925
5185 #: ../src/guestfs-actions.pod:5986 ../src/guestfs-actions.pod:6041
5186 #: ../src/guestfs-actions.pod:6187 ../src/guestfs-actions.pod:6211
5187 #: ../src/guestfs-actions.pod:6693 ../src/guestfs-actions.pod:6713
5188 #: ../src/guestfs-actions.pod:6760 ../src/guestfs-actions.pod:6925
5189 #: ../src/guestfs-actions.pod:6944 ../src/guestfs-actions.pod:7029
5190 #: ../src/guestfs-actions.pod:7048 ../src/guestfs-actions.pod:7094
5191 #: ../src/guestfs-actions.pod:7113
5193 "This function returns a NULL-terminated array of strings (like L<environ(3)"
5194 ">), or NULL if there was an error. I<The caller must free the strings and "
5195 "the array after use>."
5199 #: ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:992
5200 #: ../src/guestfs-actions.pod:1010 ../src/guestfs-actions.pod:1415
5201 #: ../src/guestfs-actions.pod:3083 ../src/guestfs-actions.pod:3114
5202 #: ../src/guestfs-actions.pod:3673 ../src/guestfs-actions.pod:3723
5203 #: ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3943
5204 #: ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4518
5205 #: ../src/guestfs-actions.pod:4975 ../src/guestfs-actions.pod:5353
5206 #: ../src/guestfs-actions.pod:5367 ../src/guestfs-actions.pod:5379
5207 #: ../src/guestfs-actions.pod:5787 ../src/guestfs-actions.pod:6425
5208 #: ../src/guestfs-actions.pod:6438 ../src/guestfs-actions.pod:6677
5209 #: ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:6913
5210 msgid "(Added in 0.8)"
5214 #: ../src/guestfs-actions.pod:463
5215 msgid "guestfs_aug_match"
5219 #: ../src/guestfs-actions.pod:465
5223 " guestfs_aug_match (guestfs_h *g,\n"
5224 " const char *augpath);\n"
5229 #: ../src/guestfs-actions.pod:469 ../fish/guestfish-actions.pod:306
5231 "Returns a list of paths which match the path expression C<path>. The "
5232 "returned paths are sufficiently qualified so that they match exactly one "
5233 "node in the current tree."
5237 #: ../src/guestfs-actions.pod:479
5238 msgid "guestfs_aug_mv"
5242 #: ../src/guestfs-actions.pod:481
5246 " guestfs_aug_mv (guestfs_h *g,\n"
5247 " const char *src,\n"
5248 " const char *dest);\n"
5253 #: ../src/guestfs-actions.pod:486 ../fish/guestfish-actions.pod:314
5255 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5256 "C<dest> is overwritten if it exists."
5260 #: ../src/guestfs-actions.pod:493
5261 msgid "guestfs_aug_rm"
5265 #: ../src/guestfs-actions.pod:495
5269 " guestfs_aug_rm (guestfs_h *g,\n"
5270 " const char *augpath);\n"
5275 #: ../src/guestfs-actions.pod:499 ../fish/guestfish-actions.pod:321
5276 msgid "Remove C<path> and all of its children."
5280 #: ../src/guestfs-actions.pod:501 ../fish/guestfish-actions.pod:323
5281 msgid "On success this returns the number of entries which were removed."
5285 #: ../src/guestfs-actions.pod:507
5286 msgid "guestfs_aug_save"
5290 #: ../src/guestfs-actions.pod:509
5294 " guestfs_aug_save (guestfs_h *g);\n"
5299 #: ../src/guestfs-actions.pod:512 ../fish/guestfish-actions.pod:329
5300 msgid "This writes all pending changes to disk."
5304 #: ../src/guestfs-actions.pod:514
5306 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
5311 #: ../src/guestfs-actions.pod:521
5312 msgid "guestfs_aug_set"
5316 #: ../src/guestfs-actions.pod:523
5320 " guestfs_aug_set (guestfs_h *g,\n"
5321 " const char *augpath,\n"
5322 " const char *val);\n"
5327 #: ../src/guestfs-actions.pod:528 ../fish/guestfish-actions.pod:338
5328 msgid "Set the value associated with C<path> to C<val>."
5332 #: ../src/guestfs-actions.pod:530
5334 "In the Augeas API, it is possible to clear a node by setting the value to "
5335 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5336 "this call. Instead you must use the C<guestfs_aug_clear> call."
5340 #: ../src/guestfs-actions.pod:539
5341 msgid "guestfs_available"
5345 #: ../src/guestfs-actions.pod:541
5349 " guestfs_available (guestfs_h *g,\n"
5350 " char *const *groups);\n"
5355 #: ../src/guestfs-actions.pod:545 ../fish/guestfish-actions.pod:349
5357 "This command is used to check the availability of some groups of "
5358 "functionality in the appliance, which not all builds of the libguestfs "
5359 "appliance will be able to provide."
5363 #: ../src/guestfs-actions.pod:549
5365 "The libguestfs groups, and the functions that those groups correspond to, "
5366 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5367 "runtime by calling C<guestfs_available_all_groups>."
5371 #: ../src/guestfs-actions.pod:554 ../fish/guestfish-actions.pod:358
5373 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", \"augeas"
5374 "\"]> would check for the availability of the Linux inotify functions and "
5375 "Augeas (configuration file editing) functions."
5379 #: ../src/guestfs-actions.pod:559 ../fish/guestfish-actions.pod:363
5380 msgid "The command returns no error if I<all> requested groups are available."
5384 #: ../src/guestfs-actions.pod:561 ../fish/guestfish-actions.pod:365
5386 "It fails with an error if one or more of the requested groups is unavailable "
5391 #: ../src/guestfs-actions.pod:564 ../fish/guestfish-actions.pod:368
5393 "If an unknown group name is included in the list of groups then an error is "
5398 #: ../src/guestfs-actions.pod:567 ../fish/guestfish-actions.pod:371
5403 #: ../src/guestfs-actions.pod:573
5404 msgid "You must call C<guestfs_launch> before calling this function."
5408 #: ../src/guestfs-actions.pod:575 ../fish/guestfish-actions.pod:379
5410 "The reason is because we don't know what groups are supported by the "
5411 "appliance/daemon until it is running and can be queried."
5415 #: ../src/guestfs-actions.pod:581 ../fish/guestfish-actions.pod:385
5417 "If a group of functions is available, this does not necessarily mean that "
5418 "they will work. You still have to check for errors when calling individual "
5419 "API functions even if they are available."
5423 #: ../src/guestfs-actions.pod:588 ../fish/guestfish-actions.pod:392
5425 "It is usually the job of distro packagers to build complete functionality "
5426 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5427 "with all requirements satisfied, will support everything."
5431 #: ../src/guestfs-actions.pod:595
5433 "This call was added in version C<1.0.80>. In previous versions of "
5434 "libguestfs all you could do would be to speculatively execute a command to "
5435 "find out if the daemon implemented it. See also C<guestfs_version>."
5439 #: ../src/guestfs-actions.pod:604 ../src/guestfs-actions.pod:1165
5440 msgid "(Added in 1.0.80)"
5444 #: ../src/guestfs-actions.pod:606
5445 msgid "guestfs_available_all_groups"
5449 #: ../src/guestfs-actions.pod:608
5453 " guestfs_available_all_groups (guestfs_h *g);\n"
5458 #: ../src/guestfs-actions.pod:611
5460 "This command returns a list of all optional groups that this daemon knows "
5461 "about. Note this returns both supported and unsupported groups. To find "
5462 "out which ones the daemon can actually support you have to call "
5463 "C<guestfs_available> on each member of the returned list."
5467 #: ../src/guestfs-actions.pod:617
5468 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
5472 #: ../src/guestfs-actions.pod:623
5473 msgid "(Added in 1.3.15)"
5477 #: ../src/guestfs-actions.pod:625
5478 msgid "guestfs_base64_in"
5482 #: ../src/guestfs-actions.pod:627
5486 " guestfs_base64_in (guestfs_h *g,\n"
5487 " const char *base64file,\n"
5488 " const char *filename);\n"
5493 #: ../src/guestfs-actions.pod:632 ../fish/guestfish-actions.pod:422
5495 "This command uploads base64-encoded data from C<base64file> to C<filename>."
5499 #: ../src/guestfs-actions.pod:637 ../src/guestfs-actions.pod:651
5500 msgid "(Added in 1.3.5)"
5504 #: ../src/guestfs-actions.pod:639
5505 msgid "guestfs_base64_out"
5509 #: ../src/guestfs-actions.pod:641
5513 " guestfs_base64_out (guestfs_h *g,\n"
5514 " const char *filename,\n"
5515 " const char *base64file);\n"
5520 #: ../src/guestfs-actions.pod:646 ../fish/guestfish-actions.pod:431
5522 "This command downloads the contents of C<filename>, writing it out to local "
5523 "file C<base64file> encoded as base64."
5527 #: ../src/guestfs-actions.pod:653
5528 msgid "guestfs_blockdev_flushbufs"
5532 #: ../src/guestfs-actions.pod:655
5536 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
5537 " const char *device);\n"
5542 #: ../src/guestfs-actions.pod:659 ../fish/guestfish-actions.pod:440
5544 "This tells the kernel to flush internal buffers associated with C<device>."
5548 #: ../src/guestfs-actions.pod:662 ../src/guestfs-actions.pod:679
5549 #: ../src/guestfs-actions.pod:694 ../src/guestfs-actions.pod:710
5550 #: ../src/guestfs-actions.pod:728 ../src/guestfs-actions.pod:747
5551 #: ../src/guestfs-actions.pod:761 ../src/guestfs-actions.pod:779
5552 #: ../src/guestfs-actions.pod:793 ../src/guestfs-actions.pod:807
5553 #: ../fish/guestfish-actions.pod:443 ../fish/guestfish-actions.pod:454
5554 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:473
5555 #: ../fish/guestfish-actions.pod:485 ../fish/guestfish-actions.pod:498
5556 #: ../fish/guestfish-actions.pod:506 ../fish/guestfish-actions.pod:517
5557 #: ../fish/guestfish-actions.pod:525 ../fish/guestfish-actions.pod:533
5558 msgid "This uses the L<blockdev(8)> command."
5562 #: ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:683
5563 #: ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:714
5564 #: ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:751
5565 #: ../src/guestfs-actions.pod:765 ../src/guestfs-actions.pod:783
5566 #: ../src/guestfs-actions.pod:797 ../src/guestfs-actions.pod:811
5567 msgid "(Added in 0.9.3)"
5571 #: ../src/guestfs-actions.pod:668
5572 msgid "guestfs_blockdev_getbsz"
5576 #: ../src/guestfs-actions.pod:670
5580 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
5581 " const char *device);\n"
5586 #: ../src/guestfs-actions.pod:674 ../fish/guestfish-actions.pod:449
5587 msgid "This returns the block size of a device."
5591 #: ../src/guestfs-actions.pod:676 ../src/guestfs-actions.pod:776
5592 #: ../fish/guestfish-actions.pod:451 ../fish/guestfish-actions.pod:514
5594 "(Note this is different from both I<size in blocks> and I<filesystem block "
5599 #: ../src/guestfs-actions.pod:685
5600 msgid "guestfs_blockdev_getro"
5604 #: ../src/guestfs-actions.pod:687
5608 " guestfs_blockdev_getro (guestfs_h *g,\n"
5609 " const char *device);\n"
5614 #: ../src/guestfs-actions.pod:691 ../fish/guestfish-actions.pod:460
5616 "Returns a boolean indicating if the block device is read-only (true if read-"
5617 "only, false if not)."
5621 #: ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:1398
5622 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1893
5623 #: ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:1976
5624 #: ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:2046
5625 #: ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2094
5626 #: ../src/guestfs-actions.pod:3022 ../src/guestfs-actions.pod:3036
5627 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3065
5628 #: ../src/guestfs-actions.pod:3081 ../src/guestfs-actions.pod:3096
5629 #: ../src/guestfs-actions.pod:3112 ../src/guestfs-actions.pod:3126
5630 #: ../src/guestfs-actions.pod:3139 ../src/guestfs-actions.pod:3153
5631 #: ../src/guestfs-actions.pod:3168 ../src/guestfs-actions.pod:3183
5632 #: ../src/guestfs-actions.pod:4663
5633 msgid "This function returns a C truth value on success or -1 on error."
5637 #: ../src/guestfs-actions.pod:700
5638 msgid "guestfs_blockdev_getsize64"
5642 #: ../src/guestfs-actions.pod:702
5646 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
5647 " const char *device);\n"
5652 #: ../src/guestfs-actions.pod:706 ../fish/guestfish-actions.pod:469
5653 msgid "This returns the size of the device in bytes."
5657 #: ../src/guestfs-actions.pod:708
5658 msgid "See also C<guestfs_blockdev_getsz>."
5662 #: ../src/guestfs-actions.pod:716
5663 msgid "guestfs_blockdev_getss"
5667 #: ../src/guestfs-actions.pod:718
5671 " guestfs_blockdev_getss (guestfs_h *g,\n"
5672 " const char *device);\n"
5677 #: ../src/guestfs-actions.pod:722 ../fish/guestfish-actions.pod:479
5679 "This returns the size of sectors on a block device. Usually 512, but can be "
5680 "larger for modern devices."
5684 #: ../src/guestfs-actions.pod:725
5686 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
5691 #: ../src/guestfs-actions.pod:734
5692 msgid "guestfs_blockdev_getsz"
5696 #: ../src/guestfs-actions.pod:736
5700 " guestfs_blockdev_getsz (guestfs_h *g,\n"
5701 " const char *device);\n"
5706 #: ../src/guestfs-actions.pod:740 ../fish/guestfish-actions.pod:491
5708 "This returns the size of the device in units of 512-byte sectors (even if "
5709 "the sectorsize isn't 512 bytes ... weird)."
5713 #: ../src/guestfs-actions.pod:743
5715 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
5716 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
5720 #: ../src/guestfs-actions.pod:753
5721 msgid "guestfs_blockdev_rereadpt"
5725 #: ../src/guestfs-actions.pod:755
5729 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
5730 " const char *device);\n"
5735 #: ../src/guestfs-actions.pod:759 ../fish/guestfish-actions.pod:504
5736 msgid "Reread the partition table on C<device>."
5740 #: ../src/guestfs-actions.pod:767
5741 msgid "guestfs_blockdev_setbsz"
5745 #: ../src/guestfs-actions.pod:769
5749 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
5750 " const char *device,\n"
5751 " int blocksize);\n"
5756 #: ../src/guestfs-actions.pod:774 ../fish/guestfish-actions.pod:512
5757 msgid "This sets the block size of a device."
5761 #: ../src/guestfs-actions.pod:785
5762 msgid "guestfs_blockdev_setro"
5766 #: ../src/guestfs-actions.pod:787
5770 " guestfs_blockdev_setro (guestfs_h *g,\n"
5771 " const char *device);\n"
5776 #: ../src/guestfs-actions.pod:791 ../fish/guestfish-actions.pod:523
5777 msgid "Sets the block device named C<device> to read-only."
5781 #: ../src/guestfs-actions.pod:799
5782 msgid "guestfs_blockdev_setrw"
5786 #: ../src/guestfs-actions.pod:801
5790 " guestfs_blockdev_setrw (guestfs_h *g,\n"
5791 " const char *device);\n"
5796 #: ../src/guestfs-actions.pod:805 ../fish/guestfish-actions.pod:531
5797 msgid "Sets the block device named C<device> to read-write."
5801 #: ../src/guestfs-actions.pod:813
5802 msgid "guestfs_case_sensitive_path"
5806 #: ../src/guestfs-actions.pod:815
5810 " guestfs_case_sensitive_path (guestfs_h *g,\n"
5811 " const char *path);\n"
5816 #: ../src/guestfs-actions.pod:819 ../fish/guestfish-actions.pod:539
5818 "This can be used to resolve case insensitive paths on a filesystem which is "
5819 "case sensitive. The use case is to resolve paths which you have read from "
5820 "Windows configuration files or the Windows Registry, to the true path."
5824 #: ../src/guestfs-actions.pod:824 ../fish/guestfish-actions.pod:544
5826 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
5827 "(and probably others), which is that although the underlying filesystem is "
5828 "case-insensitive, the driver exports the filesystem to Linux as case-"
5833 #: ../src/guestfs-actions.pod:829 ../fish/guestfish-actions.pod:549
5835 "One consequence of this is that special directories such as C<c:\\windows> "
5836 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
5837 "precise details of how they were created. In Windows itself this would not "
5842 #: ../src/guestfs-actions.pod:835 ../fish/guestfish-actions.pod:555
5844 "Bug or feature? You decide: L<http://www.tuxera.com/community/ntfs-3g-faq/"
5849 #: ../src/guestfs-actions.pod:838 ../fish/guestfish-actions.pod:558
5851 "This function resolves the true case of each element in the path and returns "
5852 "the case-sensitive path."
5856 #: ../src/guestfs-actions.pod:841
5858 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return C<"
5859 "\"/WINDOWS/system32\"> (the exact return value would depend on details of "
5860 "how the directories were originally created under Windows)."
5864 #: ../src/guestfs-actions.pod:846 ../fish/guestfish-actions.pod:566
5865 msgid "I<Note>: This function does not handle drive names, backslashes etc."
5869 #: ../src/guestfs-actions.pod:849
5870 msgid "See also C<guestfs_realpath>."
5874 #: ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:6605
5875 msgid "(Added in 1.0.75)"
5879 #: ../src/guestfs-actions.pod:856
5884 #: ../src/guestfs-actions.pod:858
5888 " guestfs_cat (guestfs_h *g,\n"
5889 " const char *path);\n"
5894 #: ../src/guestfs-actions.pod:862 ../src/guestfs-actions.pod:5150
5895 #: ../fish/guestfish-actions.pod:575 ../fish/guestfish-actions.pod:3424
5896 msgid "Return the contents of the file named C<path>."
5900 #: ../src/guestfs-actions.pod:864
5902 "Note that this function cannot correctly handle binary files (specifically, "
5903 "files containing C<\\0> character which is treated as end of string). For "
5904 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
5905 "functions which have a more complex interface."
5909 #: ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:1051
5910 #: ../src/guestfs-actions.pod:1071 ../src/guestfs-actions.pod:1362
5911 #: ../src/guestfs-actions.pod:1381 ../src/guestfs-actions.pod:1484
5912 #: ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:1752
5913 #: ../src/guestfs-actions.pod:2170 ../src/guestfs-actions.pod:2189
5914 #: ../src/guestfs-actions.pod:2232 ../src/guestfs-actions.pod:2256
5915 #: ../src/guestfs-actions.pod:2273 ../src/guestfs-actions.pod:2302
5916 #: ../src/guestfs-actions.pod:4932 ../src/guestfs-actions.pod:4958
5917 #: ../src/guestfs-actions.pod:5089 ../src/guestfs-actions.pod:5115
5918 #: ../src/guestfs-actions.pod:5139 ../src/guestfs-actions.pod:5990
5919 #: ../src/guestfs-actions.pod:6045 ../src/guestfs-actions.pod:6191
5920 #: ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:6877
5921 #: ../src/guestfs-actions.pod:6903 ../src/guestfs-actions.pod:6929
5922 #: ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:7033
5923 #: ../src/guestfs-actions.pod:7052 ../src/guestfs-actions.pod:7098
5924 #: ../src/guestfs-actions.pod:7117 ../fish/guestfish-actions.pod:582
5925 #: ../fish/guestfish-actions.pod:717 ../fish/guestfish-actions.pod:729
5926 #: ../fish/guestfish-actions.pod:905 ../fish/guestfish-actions.pod:915
5927 #: ../fish/guestfish-actions.pod:982 ../fish/guestfish-actions.pod:992
5928 #: ../fish/guestfish-actions.pod:1187 ../fish/guestfish-actions.pod:1462
5929 #: ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:1500
5930 #: ../fish/guestfish-actions.pod:1515 ../fish/guestfish-actions.pod:1525
5931 #: ../fish/guestfish-actions.pod:1544 ../fish/guestfish-actions.pod:3294
5932 #: ../fish/guestfish-actions.pod:3309 ../fish/guestfish-actions.pod:3385
5933 #: ../fish/guestfish-actions.pod:3402 ../fish/guestfish-actions.pod:3417
5934 #: ../fish/guestfish-actions.pod:4000 ../fish/guestfish-actions.pod:4046
5935 #: ../fish/guestfish-actions.pod:4131 ../fish/guestfish-actions.pod:4146
5936 #: ../fish/guestfish-actions.pod:4556 ../fish/guestfish-actions.pod:4574
5937 #: ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4601
5938 #: ../fish/guestfish-actions.pod:4649 ../fish/guestfish-actions.pod:4659
5939 #: ../fish/guestfish-actions.pod:4688 ../fish/guestfish-actions.pod:4698
5941 "Because of the message protocol, there is a transfer limit of somewhere "
5942 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
5946 #: ../src/guestfs-actions.pod:875 ../src/guestfs-actions.pod:3264
5947 #: ../src/guestfs-actions.pod:3326 ../src/guestfs-actions.pod:3343
5948 #: ../src/guestfs-actions.pod:3431 ../src/guestfs-actions.pod:3836
5949 #: ../src/guestfs-actions.pod:3850 ../src/guestfs-actions.pod:5038
5950 #: ../src/guestfs-actions.pod:5052 ../src/guestfs-actions.pod:6764
5951 #: ../src/guestfs-actions.pod:6778
5952 msgid "(Added in 0.4)"
5956 #: ../src/guestfs-actions.pod:877
5957 msgid "guestfs_checksum"
5961 #: ../src/guestfs-actions.pod:879
5965 " guestfs_checksum (guestfs_h *g,\n"
5966 " const char *csumtype,\n"
5967 " const char *path);\n"
5972 #: ../src/guestfs-actions.pod:884 ../fish/guestfish-actions.pod:589
5974 "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
5978 #: ../src/guestfs-actions.pod:887 ../fish/guestfish-actions.pod:592
5980 "The type of checksum to compute is given by the C<csumtype> parameter which "
5981 "must have one of the following values:"
5985 #: ../src/guestfs-actions.pod:892 ../fish/guestfish-actions.pod:597
5990 #: ../src/guestfs-actions.pod:894 ../fish/guestfish-actions.pod:599
5992 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
5997 #: ../src/guestfs-actions.pod:897 ../fish/guestfish-actions.pod:602
6002 #: ../src/guestfs-actions.pod:899 ../fish/guestfish-actions.pod:604
6003 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6007 #: ../src/guestfs-actions.pod:901 ../fish/guestfish-actions.pod:606
6012 #: ../src/guestfs-actions.pod:903 ../fish/guestfish-actions.pod:608
6013 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6017 #: ../src/guestfs-actions.pod:905 ../fish/guestfish-actions.pod:610
6022 #: ../src/guestfs-actions.pod:907 ../fish/guestfish-actions.pod:612
6023 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6027 #: ../src/guestfs-actions.pod:909 ../fish/guestfish-actions.pod:614
6032 #: ../src/guestfs-actions.pod:911 ../fish/guestfish-actions.pod:616
6033 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6037 #: ../src/guestfs-actions.pod:913 ../fish/guestfish-actions.pod:618
6042 #: ../src/guestfs-actions.pod:915 ../fish/guestfish-actions.pod:620
6043 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6047 #: ../src/guestfs-actions.pod:917 ../fish/guestfish-actions.pod:622
6052 #: ../src/guestfs-actions.pod:919 ../fish/guestfish-actions.pod:624
6053 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6057 #: ../src/guestfs-actions.pod:923 ../fish/guestfish-actions.pod:628
6058 msgid "The checksum is returned as a printable string."
6062 #: ../src/guestfs-actions.pod:925
6063 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
6067 #: ../src/guestfs-actions.pod:927
6068 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
6072 #: ../src/guestfs-actions.pod:932 ../src/guestfs-actions.pod:1240
6073 #: ../src/guestfs-actions.pod:2062 ../src/guestfs-actions.pod:3038
6074 #: ../src/guestfs-actions.pod:3067 ../src/guestfs-actions.pod:3128
6075 #: ../src/guestfs-actions.pod:3155 ../src/guestfs-actions.pod:6461
6076 msgid "(Added in 1.0.2)"
6080 #: ../src/guestfs-actions.pod:934
6081 msgid "guestfs_checksum_device"
6085 #: ../src/guestfs-actions.pod:936
6089 " guestfs_checksum_device (guestfs_h *g,\n"
6090 " const char *csumtype,\n"
6091 " const char *device);\n"
6096 #: ../src/guestfs-actions.pod:941
6098 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6099 "device named C<device>. For the types of checksums supported see the "
6100 "C<guestfs_checksum> command."
6104 #: ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:4569
6105 #: ../src/guestfs-actions.pod:4628 ../src/guestfs-actions.pod:4665
6106 #: ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:4859
6107 #: ../src/guestfs-actions.pod:6370 ../src/guestfs-actions.pod:6384
6108 #: ../src/guestfs-actions.pod:6790
6109 msgid "(Added in 1.3.2)"
6113 #: ../src/guestfs-actions.pod:950
6114 msgid "guestfs_checksums_out"
6118 #: ../src/guestfs-actions.pod:952
6122 " guestfs_checksums_out (guestfs_h *g,\n"
6123 " const char *csumtype,\n"
6124 " const char *directory,\n"
6125 " const char *sumsfile);\n"
6130 #: ../src/guestfs-actions.pod:958 ../fish/guestfish-actions.pod:646
6132 "This command computes the checksums of all regular files in C<directory> and "
6133 "then emits a list of those checksums to the local output file C<sumsfile>."
6137 #: ../src/guestfs-actions.pod:962 ../fish/guestfish-actions.pod:650
6139 "This can be used for verifying the integrity of a virtual machine. However "
6140 "to be properly secure you should pay attention to the output of the checksum "
6141 "command (it uses the ones from GNU coreutils). In particular when the "
6142 "filename is not printable, coreutils uses a special backslash syntax. For "
6143 "more information, see the GNU coreutils info file."
6147 #: ../src/guestfs-actions.pod:972
6148 msgid "(Added in 1.3.7)"
6152 #: ../src/guestfs-actions.pod:974
6153 msgid "guestfs_chmod"
6157 #: ../src/guestfs-actions.pod:976
6161 " guestfs_chmod (guestfs_h *g,\n"
6163 " const char *path);\n"
6168 #: ../src/guestfs-actions.pod:981 ../fish/guestfish-actions.pod:664
6170 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6175 #: ../src/guestfs-actions.pod:984 ../fish/guestfish-actions.pod:667
6177 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6178 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6183 #: ../src/guestfs-actions.pod:988 ../src/guestfs-actions.pod:4087
6184 #: ../src/guestfs-actions.pod:4268 ../src/guestfs-actions.pod:4287
6185 #: ../src/guestfs-actions.pod:4306 ../fish/guestfish-actions.pod:671
6186 #: ../fish/guestfish-actions.pod:2753 ../fish/guestfish-actions.pod:2869
6187 #: ../fish/guestfish-actions.pod:2879 ../fish/guestfish-actions.pod:2889
6188 msgid "The mode actually set is affected by the umask."
6192 #: ../src/guestfs-actions.pod:994
6193 msgid "guestfs_chown"
6197 #: ../src/guestfs-actions.pod:996
6201 " guestfs_chown (guestfs_h *g,\n"
6204 " const char *path);\n"
6209 #: ../src/guestfs-actions.pod:1002 ../fish/guestfish-actions.pod:677
6210 msgid "Change the file owner to C<owner> and group to C<group>."
6214 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:3225
6215 #: ../fish/guestfish-actions.pod:679 ../fish/guestfish-actions.pod:2231
6217 "Only numeric uid and gid are supported. If you want to use names, you will "
6218 "need to locate and parse the password file yourself (Augeas support makes "
6219 "this relatively easy)."
6223 #: ../src/guestfs-actions.pod:1012
6224 msgid "guestfs_command"
6228 #: ../src/guestfs-actions.pod:1014
6232 " guestfs_command (guestfs_h *g,\n"
6233 " char *const *arguments);\n"
6238 #: ../src/guestfs-actions.pod:1018 ../fish/guestfish-actions.pod:687
6240 "This call runs a command from the guest filesystem. The filesystem must be "
6241 "mounted, and must contain a compatible operating system (ie. something "
6242 "Linux, with the same or compatible processor architecture)."
6246 #: ../src/guestfs-actions.pod:1023
6248 "The single parameter is an argv-style list of arguments. The first element "
6249 "is the name of the program to run. Subsequent elements are parameters. The "
6250 "list must be non-empty (ie. must contain a program name). Note that the "
6251 "command runs directly, and is I<not> invoked via the shell (see "
6256 #: ../src/guestfs-actions.pod:1030 ../fish/guestfish-actions.pod:699
6257 msgid "The return value is anything printed to I<stdout> by the command."
6261 #: ../src/guestfs-actions.pod:1033 ../fish/guestfish-actions.pod:702
6263 "If the command returns a non-zero exit status, then this function returns an "
6264 "error message. The error message string is the content of I<stderr> from "
6269 #: ../src/guestfs-actions.pod:1037 ../fish/guestfish-actions.pod:706
6271 "The C<$PATH> environment variable will contain at least C</usr/bin> and C</"
6272 "bin>. If you require a program from another location, you should provide "
6273 "the full path in the first parameter."
6277 #: ../src/guestfs-actions.pod:1042 ../fish/guestfish-actions.pod:711
6279 "Shared libraries and data files required by the program must be available on "
6280 "filesystems which are mounted in the correct places. It is the caller's "
6281 "responsibility to ensure all filesystems that are needed are mounted at the "
6286 #: ../src/guestfs-actions.pod:1054 ../src/guestfs-actions.pod:1074
6287 #: ../src/guestfs-actions.pod:1537
6288 msgid "(Added in 0.9.1)"
6292 #: ../src/guestfs-actions.pod:1056
6293 msgid "guestfs_command_lines"
6297 #: ../src/guestfs-actions.pod:1058
6301 " guestfs_command_lines (guestfs_h *g,\n"
6302 " char *const *arguments);\n"
6307 #: ../src/guestfs-actions.pod:1062
6309 "This is the same as C<guestfs_command>, but splits the result into a list of "
6314 #: ../src/guestfs-actions.pod:1065
6315 msgid "See also: C<guestfs_sh_lines>"
6319 #: ../src/guestfs-actions.pod:1076
6320 msgid "guestfs_config"
6324 #: ../src/guestfs-actions.pod:1078
6328 " guestfs_config (guestfs_h *g,\n"
6329 " const char *qemuparam,\n"
6330 " const char *qemuvalue);\n"
6335 #: ../src/guestfs-actions.pod:1083 ../fish/guestfish-actions.pod:736
6337 "This can be used to add arbitrary qemu command line parameters of the form "
6338 "C<-param value>. Actually it's not quite arbitrary - we prevent you from "
6339 "setting some parameters which would interfere with parameters that we use."
6343 #: ../src/guestfs-actions.pod:1088 ../fish/guestfish-actions.pod:741
6344 msgid "The first character of C<param> string must be a C<-> (dash)."
6348 #: ../src/guestfs-actions.pod:1090 ../fish/guestfish-actions.pod:743
6349 msgid "C<value> can be NULL."
6353 #: ../src/guestfs-actions.pod:1096
6354 msgid "guestfs_copy_size"
6358 #: ../src/guestfs-actions.pod:1098
6362 " guestfs_copy_size (guestfs_h *g,\n"
6363 " const char *src,\n"
6364 " const char *dest,\n"
6370 #: ../src/guestfs-actions.pod:1104 ../fish/guestfish-actions.pod:749
6372 "This command copies exactly C<size> bytes from one source device or file "
6373 "C<src> to another destination device or file C<dest>."
6377 #: ../src/guestfs-actions.pod:1107 ../fish/guestfish-actions.pod:752
6379 "Note this will fail if the source is too short or if the destination is not "
6384 #: ../src/guestfs-actions.pod:1112 ../src/guestfs-actions.pod:1235
6385 #: ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1686
6386 #: ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:6456
6387 #: ../src/guestfs-actions.pod:6490 ../src/guestfs-actions.pod:6969
6388 #: ../src/guestfs-actions.pod:6988
6390 "This long-running command can generate progress notification messages so "
6391 "that the caller can display a progress bar or indicator. To receive these "
6392 "messages, the caller must register a progress callback. See L<guestfs(3)/"
6393 "guestfs_set_progress_callback>."
6397 #: ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:3863
6398 #: ../src/guestfs-actions.pod:5065 ../src/guestfs-actions.pod:6697
6399 #: ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:6803
6400 msgid "(Added in 1.0.87)"
6404 #: ../src/guestfs-actions.pod:1119
6409 #: ../src/guestfs-actions.pod:1121
6413 " guestfs_cp (guestfs_h *g,\n"
6414 " const char *src,\n"
6415 " const char *dest);\n"
6420 #: ../src/guestfs-actions.pod:1126 ../fish/guestfish-actions.pod:759
6422 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6423 "destination filename or destination directory."
6427 #: ../src/guestfs-actions.pod:1131 ../src/guestfs-actions.pod:1145
6428 #: ../src/guestfs-actions.pod:1217 ../src/guestfs-actions.pod:1291
6429 #: ../src/guestfs-actions.pod:1400 ../src/guestfs-actions.pod:4532
6430 #: ../src/guestfs-actions.pod:4909
6431 msgid "(Added in 1.0.18)"
6435 #: ../src/guestfs-actions.pod:1133
6436 msgid "guestfs_cp_a"
6440 #: ../src/guestfs-actions.pod:1135
6444 " guestfs_cp_a (guestfs_h *g,\n"
6445 " const char *src,\n"
6446 " const char *dest);\n"
6451 #: ../src/guestfs-actions.pod:1140 ../fish/guestfish-actions.pod:766
6453 "This copies a file or directory from C<src> to C<dest> recursively using the "
6458 #: ../src/guestfs-actions.pod:1147
6463 #: ../src/guestfs-actions.pod:1149
6467 " guestfs_dd (guestfs_h *g,\n"
6468 " const char *src,\n"
6469 " const char *dest);\n"
6474 #: ../src/guestfs-actions.pod:1154 ../fish/guestfish-actions.pod:773
6476 "This command copies from one source device or file C<src> to another "
6477 "destination device or file C<dest>. Normally you would use this to copy to "
6478 "or from a device or partition, for example to duplicate a filesystem."
6482 #: ../src/guestfs-actions.pod:1159
6484 "If the destination is a device, it must be as large or larger than the "
6485 "source file or device, otherwise the copy will fail. This command cannot do "
6486 "partial copies (see C<guestfs_copy_size>)."
6490 #: ../src/guestfs-actions.pod:1167
6495 #: ../src/guestfs-actions.pod:1169
6499 " guestfs_df (guestfs_h *g);\n"
6504 #: ../src/guestfs-actions.pod:1172 ../fish/guestfish-actions.pod:786
6505 msgid "This command runs the C<df> command to report disk space used."
6509 #: ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1191
6510 #: ../fish/guestfish-actions.pod:788 ../fish/guestfish-actions.pod:799
6512 "This command is mostly useful for interactive sessions. It is I<not> "
6513 "intended that you try to parse the output string. Use C<statvfs> from "
6518 #: ../src/guestfs-actions.pod:1181 ../src/guestfs-actions.pod:1198
6519 #: ../src/guestfs-actions.pod:1311 ../src/guestfs-actions.pod:2235
6520 #: ../src/guestfs-actions.pod:2259 ../src/guestfs-actions.pod:2327
6521 #: ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:4432
6522 #: ../src/guestfs-actions.pod:6194 ../src/guestfs-actions.pod:6218
6523 #: ../src/guestfs-actions.pod:6836 ../src/guestfs-actions.pod:6849
6524 #: ../src/guestfs-actions.pod:6862
6525 msgid "(Added in 1.0.54)"
6529 #: ../src/guestfs-actions.pod:1183
6530 msgid "guestfs_df_h"
6534 #: ../src/guestfs-actions.pod:1185
6538 " guestfs_df_h (guestfs_h *g);\n"
6543 #: ../src/guestfs-actions.pod:1188 ../fish/guestfish-actions.pod:796
6545 "This command runs the C<df -h> command to report disk space used in human-"
6550 #: ../src/guestfs-actions.pod:1200
6551 msgid "guestfs_dmesg"
6555 #: ../src/guestfs-actions.pod:1202
6559 " guestfs_dmesg (guestfs_h *g);\n"
6564 #: ../src/guestfs-actions.pod:1205 ../fish/guestfish-actions.pod:807
6566 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6567 "This is sometimes useful for extended debugging of problems."
6571 #: ../src/guestfs-actions.pod:1209
6573 "Another way to get the same information is to enable verbose messages with "
6574 "C<guestfs_set_verbose> or by setting the environment variable "
6575 "C<LIBGUESTFS_DEBUG=1> before running the program."
6579 #: ../src/guestfs-actions.pod:1219
6580 msgid "guestfs_download"
6584 #: ../src/guestfs-actions.pod:1221
6588 " guestfs_download (guestfs_h *g,\n"
6589 " const char *remotefilename,\n"
6590 " const char *filename);\n"
6595 #: ../src/guestfs-actions.pod:1226 ../src/guestfs-actions.pod:1251
6596 #: ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:833
6598 "Download file C<remotefilename> and save it as C<filename> on the local "
6603 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:6450
6604 #: ../fish/guestfish-actions.pod:823 ../fish/guestfish-actions.pod:4304
6605 msgid "C<filename> can also be a named pipe."
6609 #: ../src/guestfs-actions.pod:1231
6610 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
6614 #: ../src/guestfs-actions.pod:1242
6615 msgid "guestfs_download_offset"
6619 #: ../src/guestfs-actions.pod:1244
6623 " guestfs_download_offset (guestfs_h *g,\n"
6624 " const char *remotefilename,\n"
6625 " const char *filename,\n"
6626 " int64_t offset,\n"
6632 #: ../src/guestfs-actions.pod:1254 ../fish/guestfish-actions.pod:836
6634 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6635 "region must be within the file or device)."
6639 #: ../src/guestfs-actions.pod:1257
6641 "Note that there is no limit on the amount of data that can be downloaded "
6642 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
6643 "full amount unless an error occurs."
6647 #: ../src/guestfs-actions.pod:1262
6648 msgid "See also C<guestfs_download>, C<guestfs_pread>."
6652 #: ../src/guestfs-actions.pod:1271 ../src/guestfs-actions.pod:6495
6653 msgid "(Added in 1.5.17)"
6657 #: ../src/guestfs-actions.pod:1273
6658 msgid "guestfs_drop_caches"
6662 #: ../src/guestfs-actions.pod:1275
6666 " guestfs_drop_caches (guestfs_h *g,\n"
6667 " int whattodrop);\n"
6672 #: ../src/guestfs-actions.pod:1279 ../fish/guestfish-actions.pod:852
6674 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6675 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6676 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6680 #: ../src/guestfs-actions.pod:1284 ../fish/guestfish-actions.pod:857
6681 msgid "Setting C<whattodrop> to 3 should drop everything."
6685 #: ../src/guestfs-actions.pod:1286 ../fish/guestfish-actions.pod:859
6687 "This automatically calls L<sync(2)> before the operation, so that the "
6688 "maximum guest memory is freed."
6692 #: ../src/guestfs-actions.pod:1293
6697 #: ../src/guestfs-actions.pod:1295
6701 " guestfs_du (guestfs_h *g,\n"
6702 " const char *path);\n"
6707 #: ../src/guestfs-actions.pod:1299 ../fish/guestfish-actions.pod:866
6709 "This command runs the C<du -s> command to estimate file space usage for "
6714 #: ../src/guestfs-actions.pod:1302 ../fish/guestfish-actions.pod:869
6716 "C<path> can be a file or a directory. If C<path> is a directory then the "
6717 "estimate includes the contents of the directory and all subdirectories "
6722 #: ../src/guestfs-actions.pod:1306 ../fish/guestfish-actions.pod:873
6724 "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6728 #: ../src/guestfs-actions.pod:1313
6729 msgid "guestfs_e2fsck_f"
6733 #: ../src/guestfs-actions.pod:1315
6737 " guestfs_e2fsck_f (guestfs_h *g,\n"
6738 " const char *device);\n"
6743 #: ../src/guestfs-actions.pod:1319 ../fish/guestfish-actions.pod:880
6745 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6746 "on C<device>, noninteractively (C<-p>), even if the filesystem appears to be "
6751 #: ../src/guestfs-actions.pod:1323
6753 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
6754 "Normally you should use C<guestfs_fsck>."
6758 #: ../src/guestfs-actions.pod:1328
6759 msgid "(Added in 1.0.29)"
6763 #: ../src/guestfs-actions.pod:1330
6764 msgid "guestfs_echo_daemon"
6768 #: ../src/guestfs-actions.pod:1332
6772 " guestfs_echo_daemon (guestfs_h *g,\n"
6773 " char *const *words);\n"
6778 #: ../src/guestfs-actions.pod:1336 ../fish/guestfish-actions.pod:891
6780 "This command concatenates the list of C<words> passed with single spaces "
6781 "between them and returns the resulting string."
6785 #: ../src/guestfs-actions.pod:1339 ../fish/guestfish-actions.pod:894
6786 msgid "You can use this command to test the connection through to the daemon."
6790 #: ../src/guestfs-actions.pod:1341
6791 msgid "See also C<guestfs_ping_daemon>."
6795 #: ../src/guestfs-actions.pod:1346 ../src/guestfs-actions.pod:2073
6796 #: ../src/guestfs-actions.pod:5698
6797 msgid "(Added in 1.0.69)"
6801 #: ../src/guestfs-actions.pod:1348
6802 msgid "guestfs_egrep"
6806 #: ../src/guestfs-actions.pod:1350
6810 " guestfs_egrep (guestfs_h *g,\n"
6811 " const char *regex,\n"
6812 " const char *path);\n"
6817 #: ../src/guestfs-actions.pod:1355 ../fish/guestfish-actions.pod:902
6819 "This calls the external C<egrep> program and returns the matching lines."
6823 #: ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1384
6824 #: ../src/guestfs-actions.pod:1441 ../src/guestfs-actions.pod:1487
6825 #: ../src/guestfs-actions.pod:1506 ../src/guestfs-actions.pod:2173
6826 #: ../src/guestfs-actions.pod:2192 ../src/guestfs-actions.pod:2348
6827 #: ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:2376
6828 #: ../src/guestfs-actions.pod:2422 ../src/guestfs-actions.pod:2444
6829 #: ../src/guestfs-actions.pod:2457 ../src/guestfs-actions.pod:3356
6830 #: ../src/guestfs-actions.pod:3370 ../src/guestfs-actions.pod:3383
6831 #: ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:4367
6832 #: ../src/guestfs-actions.pod:5243 ../src/guestfs-actions.pod:5292
6833 #: ../src/guestfs-actions.pod:6062 ../src/guestfs-actions.pod:6074
6834 #: ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6100
6835 #: ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6135
6836 #: ../src/guestfs-actions.pod:6148 ../src/guestfs-actions.pod:6161
6837 #: ../src/guestfs-actions.pod:6932 ../src/guestfs-actions.pod:6951
6838 #: ../src/guestfs-actions.pod:7036 ../src/guestfs-actions.pod:7055
6839 #: ../src/guestfs-actions.pod:7101 ../src/guestfs-actions.pod:7120
6840 msgid "(Added in 1.0.66)"
6844 #: ../src/guestfs-actions.pod:1367
6845 msgid "guestfs_egrepi"
6849 #: ../src/guestfs-actions.pod:1369
6853 " guestfs_egrepi (guestfs_h *g,\n"
6854 " const char *regex,\n"
6855 " const char *path);\n"
6860 #: ../src/guestfs-actions.pod:1374 ../fish/guestfish-actions.pod:912
6862 "This calls the external C<egrep -i> program and returns the matching lines."
6866 #: ../src/guestfs-actions.pod:1386
6867 msgid "guestfs_equal"
6871 #: ../src/guestfs-actions.pod:1388
6875 " guestfs_equal (guestfs_h *g,\n"
6876 " const char *file1,\n"
6877 " const char *file2);\n"
6882 #: ../src/guestfs-actions.pod:1393 ../fish/guestfish-actions.pod:922
6884 "This compares the two files C<file1> and C<file2> and returns true if their "
6885 "content is exactly equal, or false otherwise."
6889 #: ../src/guestfs-actions.pod:1396 ../fish/guestfish-actions.pod:925
6890 msgid "The external L<cmp(1)> program is used for the comparison."
6894 #: ../src/guestfs-actions.pod:1402
6895 msgid "guestfs_exists"
6899 #: ../src/guestfs-actions.pod:1404
6903 " guestfs_exists (guestfs_h *g,\n"
6904 " const char *path);\n"
6909 #: ../src/guestfs-actions.pod:1408 ../fish/guestfish-actions.pod:931
6911 "This returns C<true> if and only if there is a file, directory (or anything) "
6912 "with the given C<path> name."
6916 #: ../src/guestfs-actions.pod:1411
6917 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
6921 #: ../src/guestfs-actions.pod:1417
6922 msgid "guestfs_fallocate"
6926 #: ../src/guestfs-actions.pod:1419
6930 " guestfs_fallocate (guestfs_h *g,\n"
6931 " const char *path,\n"
6937 #: ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1450
6938 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:959
6940 "This command preallocates a file (containing zero bytes) named C<path> of "
6941 "size C<len> bytes. If the file exists already, it is overwritten."
6945 #: ../src/guestfs-actions.pod:1428 ../fish/guestfish-actions.pod:944
6947 "Do not confuse this with the guestfish-specific C<alloc> command which "
6948 "allocates a file in the host and attaches it as a device."
6952 #: ../src/guestfs-actions.pod:1434 ../fish/guestfish-actions.pod:948
6954 "This function is deprecated. In new code, use the C<fallocate64> call "
6959 #: ../src/guestfs-actions.pod:1443
6960 msgid "guestfs_fallocate64"
6964 #: ../src/guestfs-actions.pod:1445
6968 " guestfs_fallocate64 (guestfs_h *g,\n"
6969 " const char *path,\n"
6975 #: ../src/guestfs-actions.pod:1454
6977 "Note that this call allocates disk blocks for the file. To create a sparse "
6978 "file use C<guestfs_truncate_size> instead."
6982 #: ../src/guestfs-actions.pod:1457
6984 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
6985 "oversight it only allowed 30 bit lengths to be specified, effectively "
6986 "limiting the maximum size of files created through that call to 1GB."
6990 #: ../src/guestfs-actions.pod:1462 ../fish/guestfish-actions.pod:971
6992 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
6993 "commands which create a file in the host and attach it as a device."
6997 #: ../src/guestfs-actions.pod:1468
6998 msgid "(Added in 1.3.17)"
7002 #: ../src/guestfs-actions.pod:1470
7003 msgid "guestfs_fgrep"
7007 #: ../src/guestfs-actions.pod:1472
7011 " guestfs_fgrep (guestfs_h *g,\n"
7012 " const char *pattern,\n"
7013 " const char *path);\n"
7018 #: ../src/guestfs-actions.pod:1477 ../fish/guestfish-actions.pod:979
7020 "This calls the external C<fgrep> program and returns the matching lines."
7024 #: ../src/guestfs-actions.pod:1489
7025 msgid "guestfs_fgrepi"
7029 #: ../src/guestfs-actions.pod:1491
7033 " guestfs_fgrepi (guestfs_h *g,\n"
7034 " const char *pattern,\n"
7035 " const char *path);\n"
7040 #: ../src/guestfs-actions.pod:1496 ../fish/guestfish-actions.pod:989
7042 "This calls the external C<fgrep -i> program and returns the matching lines."
7046 #: ../src/guestfs-actions.pod:1508
7047 msgid "guestfs_file"
7051 #: ../src/guestfs-actions.pod:1510
7055 " guestfs_file (guestfs_h *g,\n"
7056 " const char *path);\n"
7061 #: ../src/guestfs-actions.pod:1514 ../fish/guestfish-actions.pod:999
7063 "This call uses the standard L<file(1)> command to determine the type or "
7064 "contents of the file."
7068 #: ../src/guestfs-actions.pod:1517 ../fish/guestfish-actions.pod:1002
7070 "This call will also transparently look inside various types of compressed "
7075 #: ../src/guestfs-actions.pod:1520 ../fish/guestfish-actions.pod:1005
7077 "The exact command which runs is C<file -zb path>. Note in particular that "
7078 "the filename is not prepended to the output (the C<-b> option)."
7082 #: ../src/guestfs-actions.pod:1524
7084 "This command can also be used on C</dev/> devices (and partitions, LV "
7085 "names). You can for example use this to determine if a device contains a "
7086 "filesystem, although it's usually better to use C<guestfs_vfs_type>."
7090 #: ../src/guestfs-actions.pod:1529 ../fish/guestfish-actions.pod:1014
7092 "If the C<path> does not begin with C</dev/> then this command only works for "
7093 "the content of regular files. For other file types (directory, symbolic "
7094 "link etc) it will just return the string C<directory> etc."
7098 #: ../src/guestfs-actions.pod:1539
7099 msgid "guestfs_file_architecture"
7103 #: ../src/guestfs-actions.pod:1541
7107 " guestfs_file_architecture (guestfs_h *g,\n"
7108 " const char *filename);\n"
7113 #: ../src/guestfs-actions.pod:1545 ../fish/guestfish-actions.pod:1023
7115 "This detects the architecture of the binary C<filename>, and returns it if "
7120 #: ../src/guestfs-actions.pod:1548 ../fish/guestfish-actions.pod:1026
7121 msgid "Currently defined architectures are:"
7125 #: ../src/guestfs-actions.pod:1552 ../fish/guestfish-actions.pod:1030
7130 #: ../src/guestfs-actions.pod:1554 ../fish/guestfish-actions.pod:1032
7132 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7133 "irrespective of the precise processor requirements of the binary."
7137 #: ../src/guestfs-actions.pod:1557 ../fish/guestfish-actions.pod:1035
7142 #: ../src/guestfs-actions.pod:1559 ../fish/guestfish-actions.pod:1037
7143 msgid "64 bit x86-64."
7147 #: ../src/guestfs-actions.pod:1561 ../fish/guestfish-actions.pod:1039
7152 #: ../src/guestfs-actions.pod:1563 ../fish/guestfish-actions.pod:1041
7153 msgid "32 bit SPARC."
7157 #: ../src/guestfs-actions.pod:1565 ../fish/guestfish-actions.pod:1043
7162 #: ../src/guestfs-actions.pod:1567 ../fish/guestfish-actions.pod:1045
7163 msgid "64 bit SPARC V9 and above."
7167 #: ../src/guestfs-actions.pod:1569 ../fish/guestfish-actions.pod:1047
7172 #: ../src/guestfs-actions.pod:1571 ../fish/guestfish-actions.pod:1049
7173 msgid "Intel Itanium."
7177 #: ../src/guestfs-actions.pod:1573 ../fish/guestfish-actions.pod:1051
7182 #: ../src/guestfs-actions.pod:1575 ../fish/guestfish-actions.pod:1053
7183 msgid "32 bit Power PC."
7187 #: ../src/guestfs-actions.pod:1577 ../fish/guestfish-actions.pod:1055
7192 #: ../src/guestfs-actions.pod:1579 ../fish/guestfish-actions.pod:1057
7193 msgid "64 bit Power PC."
7197 #: ../src/guestfs-actions.pod:1583 ../fish/guestfish-actions.pod:1061
7198 msgid "Libguestfs may return other architecture strings in future."
7202 #: ../src/guestfs-actions.pod:1585 ../fish/guestfish-actions.pod:1063
7203 msgid "The function works on at least the following types of files:"
7207 #: ../src/guestfs-actions.pod:1591 ../fish/guestfish-actions.pod:1069
7208 msgid "many types of Un*x and Linux binary"
7212 #: ../src/guestfs-actions.pod:1595 ../fish/guestfish-actions.pod:1073
7213 msgid "many types of Un*x and Linux shared library"
7217 #: ../src/guestfs-actions.pod:1599 ../fish/guestfish-actions.pod:1077
7218 msgid "Windows Win32 and Win64 binaries"
7222 #: ../src/guestfs-actions.pod:1603 ../fish/guestfish-actions.pod:1081
7223 msgid "Windows Win32 and Win64 DLLs"
7227 #: ../src/guestfs-actions.pod:1605 ../fish/guestfish-actions.pod:1083
7228 msgid "Win32 binaries and DLLs return C<i386>."
7232 #: ../src/guestfs-actions.pod:1607 ../fish/guestfish-actions.pod:1085
7233 msgid "Win64 binaries and DLLs return C<x86_64>."
7237 #: ../src/guestfs-actions.pod:1611 ../fish/guestfish-actions.pod:1089
7238 msgid "Linux kernel modules"
7242 #: ../src/guestfs-actions.pod:1615 ../fish/guestfish-actions.pod:1093
7243 msgid "Linux new-style initrd images"
7247 #: ../src/guestfs-actions.pod:1619 ../fish/guestfish-actions.pod:1097
7248 msgid "some non-x86 Linux vmlinuz kernels"
7252 #: ../src/guestfs-actions.pod:1623 ../fish/guestfish-actions.pod:1101
7253 msgid "What it can't do currently:"
7257 #: ../src/guestfs-actions.pod:1629 ../fish/guestfish-actions.pod:1107
7258 msgid "static libraries (libfoo.a)"
7262 #: ../src/guestfs-actions.pod:1633 ../fish/guestfish-actions.pod:1111
7263 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7267 #: ../src/guestfs-actions.pod:1637 ../fish/guestfish-actions.pod:1115
7268 msgid "x86 Linux vmlinuz kernels"
7272 #: ../src/guestfs-actions.pod:1639 ../fish/guestfish-actions.pod:1117
7274 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7275 "compressed code, and are horribly hard to unpack. If you want to find the "
7276 "architecture of a kernel, use the architecture of the associated initrd or "
7277 "kernel module(s) instead."
7281 #: ../src/guestfs-actions.pod:1649 ../src/guestfs-actions.pod:1812
7282 #: ../src/guestfs-actions.pod:1829 ../src/guestfs-actions.pod:2480
7283 #: ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2587
7284 #: ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2657
7285 #: ../src/guestfs-actions.pod:2690 ../src/guestfs-actions.pod:2774
7286 #: ../src/guestfs-actions.pod:2836 ../src/guestfs-actions.pod:3009
7287 #: ../src/guestfs-actions.pod:3141
7288 msgid "(Added in 1.5.3)"
7292 #: ../src/guestfs-actions.pod:1651
7293 msgid "guestfs_filesize"
7297 #: ../src/guestfs-actions.pod:1653
7301 " guestfs_filesize (guestfs_h *g,\n"
7302 " const char *file);\n"
7307 #: ../src/guestfs-actions.pod:1657 ../fish/guestfish-actions.pod:1128
7308 msgid "This command returns the size of C<file> in bytes."
7312 #: ../src/guestfs-actions.pod:1659
7314 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
7315 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
7316 "devices, use C<guestfs_blockdev_getsize64>."
7320 #: ../src/guestfs-actions.pod:1665
7321 msgid "(Added in 1.0.82)"
7325 #: ../src/guestfs-actions.pod:1667
7326 msgid "guestfs_fill"
7330 #: ../src/guestfs-actions.pod:1669
7334 " guestfs_fill (guestfs_h *g,\n"
7337 " const char *path);\n"
7342 #: ../src/guestfs-actions.pod:1675 ../fish/guestfish-actions.pod:1138
7344 "This command creates a new file called C<path>. The initial content of the "
7345 "file is C<len> octets of C<c>, where C<c> must be a number in the range C<"
7350 #: ../src/guestfs-actions.pod:1679
7352 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7353 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
7354 "bytes use C<guestfs_fill_pattern>."
7358 #: ../src/guestfs-actions.pod:1691
7359 msgid "(Added in 1.0.79)"
7363 #: ../src/guestfs-actions.pod:1693
7364 msgid "guestfs_fill_pattern"
7368 #: ../src/guestfs-actions.pod:1695
7372 " guestfs_fill_pattern (guestfs_h *g,\n"
7373 " const char *pattern,\n"
7375 " const char *path);\n"
7380 #: ../src/guestfs-actions.pod:1701
7382 "This function is like C<guestfs_fill> except that it creates a new file of "
7383 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
7384 "pattern is truncated if necessary to ensure the length of the file is "
7385 "exactly C<len> bytes."
7389 #: ../src/guestfs-actions.pod:1713
7390 msgid "(Added in 1.3.12)"
7394 #: ../src/guestfs-actions.pod:1715
7395 msgid "guestfs_find"
7399 #: ../src/guestfs-actions.pod:1717
7403 " guestfs_find (guestfs_h *g,\n"
7404 " const char *directory);\n"
7409 #: ../src/guestfs-actions.pod:1721 ../fish/guestfish-actions.pod:1160
7411 "This command lists out all files and directories, recursively, starting at "
7412 "C<directory>. It is essentially equivalent to running the shell command "
7413 "C<find directory -print> but some post-processing happens on the output, "
7418 #: ../src/guestfs-actions.pod:1726 ../fish/guestfish-actions.pod:1165
7420 "This returns a list of strings I<without any prefix>. Thus if the directory "
7425 #: ../src/guestfs-actions.pod:1729 ../fish/guestfish-actions.pod:1168
7435 #: ../src/guestfs-actions.pod:1733
7437 "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
7441 #: ../src/guestfs-actions.pod:1736 ../fish/guestfish-actions.pod:1175
7452 #: ../src/guestfs-actions.pod:1741 ../fish/guestfish-actions.pod:1180
7453 msgid "If C<directory> is not a directory, then this command returns an error."
7457 #: ../src/guestfs-actions.pod:1744 ../fish/guestfish-actions.pod:1183
7458 msgid "The returned list is sorted."
7462 #: ../src/guestfs-actions.pod:1746
7463 msgid "See also C<guestfs_find0>."
7467 #: ../src/guestfs-actions.pod:1755 ../src/guestfs-actions.pod:3800
7468 #: ../src/guestfs-actions.pod:5327
7469 msgid "(Added in 1.0.27)"
7473 #: ../src/guestfs-actions.pod:1757
7474 msgid "guestfs_find0"
7478 #: ../src/guestfs-actions.pod:1759
7482 " guestfs_find0 (guestfs_h *g,\n"
7483 " const char *directory,\n"
7484 " const char *files);\n"
7489 #: ../src/guestfs-actions.pod:1764 ../fish/guestfish-actions.pod:1194
7491 "This command lists out all files and directories, recursively, starting at "
7492 "C<directory>, placing the resulting list in the external file called "
7497 #: ../src/guestfs-actions.pod:1768
7499 "This command works the same way as C<guestfs_find> with the following "
7504 #: ../src/guestfs-actions.pod:1775 ../fish/guestfish-actions.pod:1205
7505 msgid "The resulting list is written to an external file."
7509 #: ../src/guestfs-actions.pod:1779 ../fish/guestfish-actions.pod:1209
7511 "Items (filenames) in the result are separated by C<\\0> characters. See "
7512 "L<find(1)> option I<-print0>."
7516 #: ../src/guestfs-actions.pod:1784 ../fish/guestfish-actions.pod:1214
7517 msgid "This command is not limited in the number of names that it can return."
7521 #: ../src/guestfs-actions.pod:1789 ../fish/guestfish-actions.pod:1219
7522 msgid "The result list is not sorted."
7526 #: ../src/guestfs-actions.pod:1795
7527 msgid "(Added in 1.0.74)"
7531 #: ../src/guestfs-actions.pod:1797
7532 msgid "guestfs_findfs_label"
7536 #: ../src/guestfs-actions.pod:1799
7540 " guestfs_findfs_label (guestfs_h *g,\n"
7541 " const char *label);\n"
7546 #: ../src/guestfs-actions.pod:1803 ../fish/guestfish-actions.pod:1229
7548 "This command searches the filesystems and returns the one which has the "
7549 "given label. An error is returned if no such filesystem can be found."
7553 #: ../src/guestfs-actions.pod:1807
7554 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
7558 #: ../src/guestfs-actions.pod:1814
7559 msgid "guestfs_findfs_uuid"
7563 #: ../src/guestfs-actions.pod:1816
7567 " guestfs_findfs_uuid (guestfs_h *g,\n"
7568 " const char *uuid);\n"
7573 #: ../src/guestfs-actions.pod:1820 ../fish/guestfish-actions.pod:1239
7575 "This command searches the filesystems and returns the one which has the "
7576 "given UUID. An error is returned if no such filesystem can be found."
7580 #: ../src/guestfs-actions.pod:1824
7581 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
7585 #: ../src/guestfs-actions.pod:1831
7586 msgid "guestfs_fsck"
7590 #: ../src/guestfs-actions.pod:1833
7594 " guestfs_fsck (guestfs_h *g,\n"
7595 " const char *fstype,\n"
7596 " const char *device);\n"
7601 #: ../src/guestfs-actions.pod:1838 ../fish/guestfish-actions.pod:1249
7603 "This runs the filesystem checker (fsck) on C<device> which should have "
7604 "filesystem type C<fstype>."
7608 #: ../src/guestfs-actions.pod:1841 ../fish/guestfish-actions.pod:1252
7610 "The returned integer is the status. See L<fsck(8)> for the list of status "
7611 "codes from C<fsck>."
7615 #: ../src/guestfs-actions.pod:1850 ../fish/guestfish-actions.pod:1261
7616 msgid "Multiple status codes can be summed together."
7620 #: ../src/guestfs-actions.pod:1854 ../fish/guestfish-actions.pod:1265
7622 "A non-zero return code can mean \"success\", for example if errors have been "
7623 "corrected on the filesystem."
7627 #: ../src/guestfs-actions.pod:1859 ../fish/guestfish-actions.pod:1270
7628 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7632 #: ../src/guestfs-actions.pod:1864 ../fish/guestfish-actions.pod:1275
7634 "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7638 #: ../src/guestfs-actions.pod:1868 ../src/guestfs-actions.pod:6974
7639 msgid "(Added in 1.0.16)"
7643 #: ../src/guestfs-actions.pod:1870
7644 msgid "guestfs_get_append"
7648 #: ../src/guestfs-actions.pod:1872
7652 " guestfs_get_append (guestfs_h *g);\n"
7657 #: ../src/guestfs-actions.pod:1875 ../fish/guestfish-actions.pod:1281
7659 "Return the additional kernel options which are added to the guest kernel "
7664 #: ../src/guestfs-actions.pod:1878 ../fish/guestfish-actions.pod:1284
7665 msgid "If C<NULL> then no options are added."
7669 #: ../src/guestfs-actions.pod:1880
7671 "This function returns a string which may be NULL. There is no way to return "
7672 "an error from this function. The string is owned by the guest handle and "
7673 "must I<not> be freed."
7677 #: ../src/guestfs-actions.pod:1884 ../src/guestfs-actions.pod:5005
7678 #: ../src/guestfs-actions.pod:5468 ../src/guestfs-actions.pod:5836
7679 #: ../src/guestfs-actions.pod:5855 ../src/guestfs-actions.pod:5871
7680 #: ../src/guestfs-actions.pod:5888 ../src/guestfs-actions.pod:6645
7681 #: ../src/guestfs-actions.pod:6663 ../src/guestfs-actions.pod:7017
7682 msgid "(Added in 1.0.26)"
7686 #: ../src/guestfs-actions.pod:1886
7687 msgid "guestfs_get_autosync"
7691 #: ../src/guestfs-actions.pod:1888
7695 " guestfs_get_autosync (guestfs_h *g);\n"
7700 #: ../src/guestfs-actions.pod:1891 ../fish/guestfish-actions.pod:1290
7701 msgid "Get the autosync flag."
7705 #: ../src/guestfs-actions.pod:1897
7706 msgid "guestfs_get_direct"
7710 #: ../src/guestfs-actions.pod:1899
7714 " guestfs_get_direct (guestfs_h *g);\n"
7719 #: ../src/guestfs-actions.pod:1902 ../fish/guestfish-actions.pod:1296
7720 msgid "Return the direct appliance mode flag."
7724 #: ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:5509
7725 msgid "(Added in 1.0.72)"
7729 #: ../src/guestfs-actions.pod:1908
7730 msgid "guestfs_get_e2label"
7734 #: ../src/guestfs-actions.pod:1910
7738 " guestfs_get_e2label (guestfs_h *g,\n"
7739 " const char *device);\n"
7744 #: ../src/guestfs-actions.pod:1914 ../fish/guestfish-actions.pod:1302
7746 "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7750 #: ../src/guestfs-actions.pod:1920 ../fish/guestfish-actions.pod:1305
7752 "This function is deprecated. In new code, use the C<vfs_label> call instead."
7756 #: ../src/guestfs-actions.pod:1927 ../src/guestfs-actions.pod:1948
7757 #: ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5546
7758 msgid "(Added in 1.0.15)"
7762 #: ../src/guestfs-actions.pod:1929
7763 msgid "guestfs_get_e2uuid"
7767 #: ../src/guestfs-actions.pod:1931
7771 " guestfs_get_e2uuid (guestfs_h *g,\n"
7772 " const char *device);\n"
7777 #: ../src/guestfs-actions.pod:1935 ../fish/guestfish-actions.pod:1316
7779 "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7783 #: ../src/guestfs-actions.pod:1941 ../fish/guestfish-actions.pod:1319
7785 "This function is deprecated. In new code, use the C<vfs_uuid> call instead."
7789 #: ../src/guestfs-actions.pod:1950
7790 msgid "guestfs_get_memsize"
7794 #: ../src/guestfs-actions.pod:1952
7798 " guestfs_get_memsize (guestfs_h *g);\n"
7803 #: ../src/guestfs-actions.pod:1955 ../fish/guestfish-actions.pod:1330
7805 "This gets the memory size in megabytes allocated to the qemu subprocess."
7809 #: ../src/guestfs-actions.pod:1958
7811 "If C<guestfs_set_memsize> was not called on this handle, and if "
7812 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7813 "value for memsize."
7817 #: ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:2043
7818 #: ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5669
7819 #: ../fish/guestfish-actions.pod:1337 ../fish/guestfish-actions.pod:1388
7820 #: ../fish/guestfish-actions.pod:3711 ../fish/guestfish-actions.pod:3798
7822 "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7826 #: ../src/guestfs-actions.pod:1967 ../src/guestfs-actions.pod:4091
7827 #: ../src/guestfs-actions.pod:4272 ../src/guestfs-actions.pod:4291
7828 #: ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4322
7829 #: ../src/guestfs-actions.pod:4339 ../src/guestfs-actions.pod:4352
7830 #: ../src/guestfs-actions.pod:5230 ../src/guestfs-actions.pod:5567
7831 #: ../src/guestfs-actions.pod:5810 ../src/guestfs-actions.pod:6411
7832 msgid "(Added in 1.0.55)"
7836 #: ../src/guestfs-actions.pod:1969
7837 msgid "guestfs_get_network"
7841 #: ../src/guestfs-actions.pod:1971
7845 " guestfs_get_network (guestfs_h *g);\n"
7850 #: ../src/guestfs-actions.pod:1974 ../fish/guestfish-actions.pod:1344
7851 msgid "This returns the enable network flag."
7855 #: ../src/guestfs-actions.pod:1978 ../src/guestfs-actions.pod:5586
7856 msgid "(Added in 1.5.4)"
7860 #: ../src/guestfs-actions.pod:1980
7861 msgid "guestfs_get_path"
7865 #: ../src/guestfs-actions.pod:1982
7869 " guestfs_get_path (guestfs_h *g);\n"
7874 #: ../src/guestfs-actions.pod:1985 ../fish/guestfish-actions.pod:1350
7875 msgid "Return the current search path."
7879 #: ../src/guestfs-actions.pod:1987 ../fish/guestfish-actions.pod:1352
7881 "This is always non-NULL. If it wasn't set already, then this will return "
7886 #: ../src/guestfs-actions.pod:1990 ../src/guestfs-actions.pod:2019
7888 "This function returns a string, or NULL on error. The string is owned by "
7889 "the guest handle and must I<not> be freed."
7893 #: ../src/guestfs-actions.pod:1995
7894 msgid "guestfs_get_pid"
7898 #: ../src/guestfs-actions.pod:1997
7902 " guestfs_get_pid (guestfs_h *g);\n"
7907 #: ../src/guestfs-actions.pod:2000 ../fish/guestfish-actions.pod:1361
7909 "Return the process ID of the qemu subprocess. If there is no qemu "
7910 "subprocess, then this will return an error."
7914 #: ../src/guestfs-actions.pod:2003 ../fish/guestfish-actions.pod:1364
7915 msgid "This is an internal call used for debugging and testing."
7919 #: ../src/guestfs-actions.pod:2007
7920 msgid "(Added in 1.0.56)"
7924 #: ../src/guestfs-actions.pod:2009
7925 msgid "guestfs_get_qemu"
7929 #: ../src/guestfs-actions.pod:2011
7933 " guestfs_get_qemu (guestfs_h *g);\n"
7938 #: ../src/guestfs-actions.pod:2014 ../fish/guestfish-actions.pod:1370
7939 msgid "Return the current qemu binary."
7943 #: ../src/guestfs-actions.pod:2016 ../fish/guestfish-actions.pod:1372
7945 "This is always non-NULL. If it wasn't set already, then this will return "
7946 "the default qemu binary name."
7950 #: ../src/guestfs-actions.pod:2022 ../src/guestfs-actions.pod:5631
7951 msgid "(Added in 1.0.6)"
7955 #: ../src/guestfs-actions.pod:2024
7956 msgid "guestfs_get_recovery_proc"
7960 #: ../src/guestfs-actions.pod:2026
7964 " guestfs_get_recovery_proc (guestfs_h *g);\n"
7969 #: ../src/guestfs-actions.pod:2029 ../fish/guestfish-actions.pod:1379
7970 msgid "Return the recovery process enabled flag."
7974 #: ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:3231
7975 #: ../src/guestfs-actions.pod:3498 ../src/guestfs-actions.pod:3898
7976 #: ../src/guestfs-actions.pod:3930 ../src/guestfs-actions.pod:4935
7977 #: ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5655
7978 #: ../src/guestfs-actions.pod:6314 ../src/guestfs-actions.pod:6334
7979 #: ../src/guestfs-actions.pod:6526
7980 msgid "(Added in 1.0.77)"
7984 #: ../src/guestfs-actions.pod:2035
7985 msgid "guestfs_get_selinux"
7989 #: ../src/guestfs-actions.pod:2037
7993 " guestfs_get_selinux (guestfs_h *g);\n"
7998 #: ../src/guestfs-actions.pod:2040
8000 "This returns the current setting of the selinux flag which is passed to the "
8001 "appliance at boot time. See C<guestfs_set_selinux>."
8005 #: ../src/guestfs-actions.pod:2048 ../src/guestfs-actions.pod:2111
8006 #: ../src/guestfs-actions.pod:5674 ../src/guestfs-actions.pod:5728
8007 msgid "(Added in 1.0.67)"
8011 #: ../src/guestfs-actions.pod:2050
8012 msgid "guestfs_get_state"
8016 #: ../src/guestfs-actions.pod:2052
8020 " guestfs_get_state (guestfs_h *g);\n"
8025 #: ../src/guestfs-actions.pod:2055 ../fish/guestfish-actions.pod:1395
8027 "This returns the current state as an opaque integer. This is only useful "
8028 "for printing debug and internal error messages."
8032 #: ../src/guestfs-actions.pod:2058 ../src/guestfs-actions.pod:3034
8033 #: ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3124
8034 #: ../src/guestfs-actions.pod:3151 ../fish/guestfish-actions.pod:1398
8035 #: ../fish/guestfish-actions.pod:2113 ../fish/guestfish-actions.pod:2131
8036 #: ../fish/guestfish-actions.pod:2169 ../fish/guestfish-actions.pod:2185
8037 msgid "For more information on states, see L<guestfs(3)>."
8041 #: ../src/guestfs-actions.pod:2064
8042 msgid "guestfs_get_trace"
8046 #: ../src/guestfs-actions.pod:2066
8050 " guestfs_get_trace (guestfs_h *g);\n"
8055 #: ../src/guestfs-actions.pod:2069 ../fish/guestfish-actions.pod:1404
8056 msgid "Return the command trace flag."
8060 #: ../src/guestfs-actions.pod:2075
8061 msgid "guestfs_get_umask"
8065 #: ../src/guestfs-actions.pod:2077
8069 " guestfs_get_umask (guestfs_h *g);\n"
8074 #: ../src/guestfs-actions.pod:2080
8076 "Return the current umask. By default the umask is C<022> unless it has been "
8077 "set by calling C<guestfs_umask>."
8081 #: ../src/guestfs-actions.pod:2087
8082 msgid "guestfs_get_verbose"
8086 #: ../src/guestfs-actions.pod:2089
8090 " guestfs_get_verbose (guestfs_h *g);\n"
8095 #: ../src/guestfs-actions.pod:2092 ../fish/guestfish-actions.pod:1417
8096 msgid "This returns the verbose messages flag."
8100 #: ../src/guestfs-actions.pod:2098
8101 msgid "guestfs_getcon"
8105 #: ../src/guestfs-actions.pod:2100
8109 " guestfs_getcon (guestfs_h *g);\n"
8114 #: ../src/guestfs-actions.pod:2103 ../fish/guestfish-actions.pod:1423
8115 msgid "This gets the SELinux security context of the daemon."
8119 #: ../src/guestfs-actions.pod:2105
8121 "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
8125 #: ../src/guestfs-actions.pod:2113
8126 msgid "guestfs_getxattrs"
8130 #: ../src/guestfs-actions.pod:2115
8133 " struct guestfs_xattr_list *\n"
8134 " guestfs_getxattrs (guestfs_h *g,\n"
8135 " const char *path);\n"
8140 #: ../src/guestfs-actions.pod:2119 ../fish/guestfish-actions.pod:1432
8142 "This call lists the extended attributes of the file or directory C<path>."
8146 #: ../src/guestfs-actions.pod:2122 ../fish/guestfish-actions.pod:1435
8148 "At the system call level, this is a combination of the L<listxattr(2)> and "
8149 "L<getxattr(2)> calls."
8153 #: ../src/guestfs-actions.pod:2125
8154 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
8158 #: ../src/guestfs-actions.pod:2127 ../src/guestfs-actions.pod:3243
8159 #: ../src/guestfs-actions.pod:3894
8161 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
8162 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
8166 #: ../src/guestfs-actions.pod:2131 ../src/guestfs-actions.pod:3247
8167 #: ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3448
8168 #: ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5747
8169 #: ../src/guestfs-actions.pod:7082
8170 msgid "(Added in 1.0.59)"
8174 #: ../src/guestfs-actions.pod:2133
8175 msgid "guestfs_glob_expand"
8179 #: ../src/guestfs-actions.pod:2135
8183 " guestfs_glob_expand (guestfs_h *g,\n"
8184 " const char *pattern);\n"
8189 #: ../src/guestfs-actions.pod:2139 ../fish/guestfish-actions.pod:1444
8191 "This command searches for all the pathnames matching C<pattern> according to "
8192 "the wildcard expansion rules used by the shell."
8196 #: ../src/guestfs-actions.pod:2143 ../fish/guestfish-actions.pod:1448
8198 "If no paths match, then this returns an empty list (note: not an error)."
8202 #: ../src/guestfs-actions.pod:2146 ../fish/guestfish-actions.pod:1451
8204 "It is just a wrapper around the C L<glob(3)> function with flags C<GLOB_MARK|"
8205 "GLOB_BRACE>. See that manual page for more details."
8209 #: ../src/guestfs-actions.pod:2154 ../src/guestfs-actions.pod:5912
8210 #: ../src/guestfs-actions.pod:5929
8211 msgid "(Added in 1.0.50)"
8215 #: ../src/guestfs-actions.pod:2156
8216 msgid "guestfs_grep"
8220 #: ../src/guestfs-actions.pod:2158
8224 " guestfs_grep (guestfs_h *g,\n"
8225 " const char *regex,\n"
8226 " const char *path);\n"
8231 #: ../src/guestfs-actions.pod:2163 ../fish/guestfish-actions.pod:1459
8232 msgid "This calls the external C<grep> program and returns the matching lines."
8236 #: ../src/guestfs-actions.pod:2175
8237 msgid "guestfs_grepi"
8241 #: ../src/guestfs-actions.pod:2177
8245 " guestfs_grepi (guestfs_h *g,\n"
8246 " const char *regex,\n"
8247 " const char *path);\n"
8252 #: ../src/guestfs-actions.pod:2182 ../fish/guestfish-actions.pod:1469
8254 "This calls the external C<grep -i> program and returns the matching lines."
8258 #: ../src/guestfs-actions.pod:2194
8259 msgid "guestfs_grub_install"
8263 #: ../src/guestfs-actions.pod:2196
8267 " guestfs_grub_install (guestfs_h *g,\n"
8268 " const char *root,\n"
8269 " const char *device);\n"
8274 #: ../src/guestfs-actions.pod:2201 ../fish/guestfish-actions.pod:1479
8276 "This command installs GRUB (the Grand Unified Bootloader) on C<device>, with "
8277 "the root directory being C<root>."
8281 #: ../src/guestfs-actions.pod:2204 ../fish/guestfish-actions.pod:1482
8283 "Note: If grub-install reports the error \"No suitable drive was found in the "
8284 "generated device map.\" it may be that you need to create a C</boot/grub/"
8285 "device.map> file first that contains the mapping between grub device names "
8286 "and Linux device names. It is usually sufficient to create a file "
8291 #: ../src/guestfs-actions.pod:2211 ../fish/guestfish-actions.pod:1489
8299 #: ../src/guestfs-actions.pod:2213 ../fish/guestfish-actions.pod:1491
8300 msgid "replacing C</dev/vda> with the name of the installation device."
8304 #: ../src/guestfs-actions.pod:2217
8305 msgid "(Added in 1.0.17)"
8309 #: ../src/guestfs-actions.pod:2219
8310 msgid "guestfs_head"
8314 #: ../src/guestfs-actions.pod:2221
8318 " guestfs_head (guestfs_h *g,\n"
8319 " const char *path);\n"
8324 #: ../src/guestfs-actions.pod:2225 ../fish/guestfish-actions.pod:1497
8326 "This command returns up to the first 10 lines of a file as a list of strings."
8330 #: ../src/guestfs-actions.pod:2237
8331 msgid "guestfs_head_n"
8335 #: ../src/guestfs-actions.pod:2239
8339 " guestfs_head_n (guestfs_h *g,\n"
8341 " const char *path);\n"
8346 #: ../src/guestfs-actions.pod:2244 ../fish/guestfish-actions.pod:1507
8348 "If the parameter C<nrlines> is a positive number, this returns the first "
8349 "C<nrlines> lines of the file C<path>."
8353 #: ../src/guestfs-actions.pod:2247 ../fish/guestfish-actions.pod:1510
8355 "If the parameter C<nrlines> is a negative number, this returns lines from "
8356 "the file C<path>, excluding the last C<nrlines> lines."
8360 #: ../src/guestfs-actions.pod:2250 ../src/guestfs-actions.pod:6209
8361 #: ../fish/guestfish-actions.pod:1513 ../fish/guestfish-actions.pod:4144
8362 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8366 #: ../src/guestfs-actions.pod:2261
8367 msgid "guestfs_hexdump"
8371 #: ../src/guestfs-actions.pod:2263
8375 " guestfs_hexdump (guestfs_h *g,\n"
8376 " const char *path);\n"
8381 #: ../src/guestfs-actions.pod:2267 ../fish/guestfish-actions.pod:1522
8383 "This runs C<hexdump -C> on the given C<path>. The result is the human-"
8384 "readable, canonical hex dump of the file."
8388 #: ../src/guestfs-actions.pod:2276 ../src/guestfs-actions.pod:5993
8389 #: ../src/guestfs-actions.pod:6048
8390 msgid "(Added in 1.0.22)"
8394 #: ../src/guestfs-actions.pod:2278
8395 msgid "guestfs_initrd_cat"
8399 #: ../src/guestfs-actions.pod:2280
8403 " guestfs_initrd_cat (guestfs_h *g,\n"
8404 " const char *initrdpath,\n"
8405 " const char *filename,\n"
8406 " size_t *size_r);\n"
8411 #: ../src/guestfs-actions.pod:2286 ../fish/guestfish-actions.pod:1532
8413 "This command unpacks the file C<filename> from the initrd file called "
8414 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8419 #: ../src/guestfs-actions.pod:2290 ../fish/guestfish-actions.pod:1536
8421 "For example, in guestfish you could use the following command to examine the "
8422 "boot script (usually called C</init>) contained in a Linux initrd or "
8427 #: ../src/guestfs-actions.pod:2294 ../fish/guestfish-actions.pod:1540
8430 " initrd-cat /boot/initrd-<version>.img init\n"
8435 #: ../src/guestfs-actions.pod:2296
8436 msgid "See also C<guestfs_initrd_list>."
8440 #: ../src/guestfs-actions.pod:2298 ../src/guestfs-actions.pod:4928
8441 #: ../src/guestfs-actions.pod:4954 ../src/guestfs-actions.pod:5135
8443 "This function returns a buffer, or NULL on error. The size of the returned "
8444 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
8449 #: ../src/guestfs-actions.pod:2307
8450 msgid "guestfs_initrd_list"
8454 #: ../src/guestfs-actions.pod:2309
8458 " guestfs_initrd_list (guestfs_h *g,\n"
8459 " const char *path);\n"
8464 #: ../src/guestfs-actions.pod:2313 ../fish/guestfish-actions.pod:1551
8465 msgid "This command lists out files contained in an initrd."
8469 #: ../src/guestfs-actions.pod:2315 ../fish/guestfish-actions.pod:1553
8471 "The files are listed without any initial C</> character. The files are "
8472 "listed in the order they appear (not necessarily alphabetical). Directory "
8473 "names are listed as separate items."
8477 #: ../src/guestfs-actions.pod:2319 ../fish/guestfish-actions.pod:1557
8479 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8480 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8485 #: ../src/guestfs-actions.pod:2329
8486 msgid "guestfs_inotify_add_watch"
8490 #: ../src/guestfs-actions.pod:2331
8494 " guestfs_inotify_add_watch (guestfs_h *g,\n"
8495 " const char *path,\n"
8501 #: ../src/guestfs-actions.pod:2336 ../fish/guestfish-actions.pod:1565
8502 msgid "Watch C<path> for the events listed in C<mask>."
8506 #: ../src/guestfs-actions.pod:2338 ../fish/guestfish-actions.pod:1567
8508 "Note that if C<path> is a directory then events within that directory are "
8509 "watched, but this does I<not> happen recursively (in subdirectories)."
8513 #: ../src/guestfs-actions.pod:2342 ../fish/guestfish-actions.pod:1571
8515 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8516 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8520 #: ../src/guestfs-actions.pod:2350
8521 msgid "guestfs_inotify_close"
8525 #: ../src/guestfs-actions.pod:2352
8529 " guestfs_inotify_close (guestfs_h *g);\n"
8534 #: ../src/guestfs-actions.pod:2355 ../fish/guestfish-actions.pod:1579
8536 "This closes the inotify handle which was previously opened by inotify_init. "
8537 "It removes all watches, throws away any pending events, and deallocates all "
8542 #: ../src/guestfs-actions.pod:2363
8543 msgid "guestfs_inotify_files"
8547 #: ../src/guestfs-actions.pod:2365
8551 " guestfs_inotify_files (guestfs_h *g);\n"
8556 #: ../src/guestfs-actions.pod:2368
8558 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
8559 "returns a list of pathnames of objects that were touched. The returned "
8560 "pathnames are sorted and deduplicated."
8564 #: ../src/guestfs-actions.pod:2378
8565 msgid "guestfs_inotify_init"
8569 #: ../src/guestfs-actions.pod:2380
8573 " guestfs_inotify_init (guestfs_h *g,\n"
8574 " int maxevents);\n"
8579 #: ../src/guestfs-actions.pod:2384 ../fish/guestfish-actions.pod:1595
8581 "This command creates a new inotify handle. The inotify subsystem can be "
8582 "used to notify events which happen to objects in the guest filesystem."
8586 #: ../src/guestfs-actions.pod:2388
8588 "C<maxevents> is the maximum number of events which will be queued up between "
8589 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
8590 "passed as C<0>, then the kernel (or previously set) default is used. For "
8591 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
8592 "throws away events, but records the fact that it threw them away by setting "
8593 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
8594 "C<guestfs_inotify_read>)."
8598 #: ../src/guestfs-actions.pod:2398
8600 "Before any events are generated, you have to add some watches to the "
8601 "internal watch list. See: C<guestfs_inotify_add_watch>, "
8602 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
8606 #: ../src/guestfs-actions.pod:2404
8608 "Queued up events should be read periodically by calling "
8609 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
8610 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
8611 "often enough then you risk the internal queue overflowing."
8615 #: ../src/guestfs-actions.pod:2411
8617 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
8618 "This also removes any watches automatically."
8622 #: ../src/guestfs-actions.pod:2415 ../fish/guestfish-actions.pod:1626
8624 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8625 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8626 "that there is one global inotify handle per libguestfs instance."
8630 #: ../src/guestfs-actions.pod:2424
8631 msgid "guestfs_inotify_read"
8635 #: ../src/guestfs-actions.pod:2426
8638 " struct guestfs_inotify_event_list *\n"
8639 " guestfs_inotify_read (guestfs_h *g);\n"
8644 #: ../src/guestfs-actions.pod:2429 ../fish/guestfish-actions.pod:1635
8646 "Return the complete queue of events that have happened since the previous "
8651 #: ../src/guestfs-actions.pod:2432 ../fish/guestfish-actions.pod:1638
8652 msgid "If no events have happened, this returns an empty list."
8656 #: ../src/guestfs-actions.pod:2434 ../fish/guestfish-actions.pod:1640
8658 "I<Note>: In order to make sure that all events have been read, you must call "
8659 "this function repeatedly until it returns an empty list. The reason is that "
8660 "the call will read events up to the maximum appliance-to-host message size "
8661 "and leave remaining events in the queue."
8665 #: ../src/guestfs-actions.pod:2440
8667 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
8668 "there was an error. I<The caller must call "
8669 "C<guestfs_free_inotify_event_list> after use>."
8673 #: ../src/guestfs-actions.pod:2446
8674 msgid "guestfs_inotify_rm_watch"
8678 #: ../src/guestfs-actions.pod:2448
8682 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
8688 #: ../src/guestfs-actions.pod:2452
8690 "Remove a previously defined inotify watch. See C<guestfs_inotify_add_watch>."
8694 #: ../src/guestfs-actions.pod:2459
8695 msgid "guestfs_inspect_get_arch"
8699 #: ../src/guestfs-actions.pod:2461
8703 " guestfs_inspect_get_arch (guestfs_h *g,\n"
8704 " const char *root);\n"
8709 #: ../src/guestfs-actions.pod:2465 ../src/guestfs-actions.pod:2488
8710 #: ../src/guestfs-actions.pod:2569 ../src/guestfs-actions.pod:2595
8711 #: ../src/guestfs-actions.pod:2617 ../src/guestfs-actions.pod:2644
8712 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:2698
8713 #: ../src/guestfs-actions.pod:2727 ../src/guestfs-actions.pod:2758
8714 #: ../src/guestfs-actions.pod:2802 ../src/guestfs-actions.pod:2844
8715 #: ../src/guestfs-actions.pod:2867
8717 "This function should only be called with a root device string as returned by "
8718 "C<guestfs_inspect_os>."
8722 #: ../src/guestfs-actions.pod:2468
8724 "This returns the architecture of the inspected operating system. The "
8725 "possible return values are listed under C<guestfs_file_architecture>."
8729 #: ../src/guestfs-actions.pod:2472 ../fish/guestfish-actions.pod:1664
8731 "If the architecture could not be determined, then the string C<unknown> is "
8736 #: ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:2556
8737 #: ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2632
8738 #: ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2745
8739 #: ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2788
8740 #: ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:2854
8741 #: ../src/guestfs-actions.pod:2960 ../src/guestfs-actions.pod:3001
8742 #: ../fish/guestfish-actions.pod:1667 ../fish/guestfish-actions.pod:1741
8743 #: ../fish/guestfish-actions.pod:1774 ../fish/guestfish-actions.pod:1795
8744 #: ../fish/guestfish-actions.pod:1855 ../fish/guestfish-actions.pod:1879
8745 #: ../fish/guestfish-actions.pod:1896 ../fish/guestfish-actions.pod:1909
8746 #: ../fish/guestfish-actions.pod:1944 ../fish/guestfish-actions.pod:1960
8747 #: ../fish/guestfish-actions.pod:2059 ../fish/guestfish-actions.pod:2093
8748 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8752 #: ../src/guestfs-actions.pod:2482
8753 msgid "guestfs_inspect_get_distro"
8757 #: ../src/guestfs-actions.pod:2484
8761 " guestfs_inspect_get_distro (guestfs_h *g,\n"
8762 " const char *root);\n"
8767 #: ../src/guestfs-actions.pod:2491 ../fish/guestfish-actions.pod:1676
8769 "This returns the distro (distribution) of the inspected operating system."
8773 #: ../src/guestfs-actions.pod:2494 ../fish/guestfish-actions.pod:1679
8774 msgid "Currently defined distros are:"
8778 #: ../src/guestfs-actions.pod:2498 ../fish/guestfish-actions.pod:1683
8779 msgid "\"archlinux\""
8783 #: ../src/guestfs-actions.pod:2500 ../fish/guestfish-actions.pod:1685
8788 #: ../src/guestfs-actions.pod:2502 ../fish/guestfish-actions.pod:1687
8793 #: ../src/guestfs-actions.pod:2504 ../fish/guestfish-actions.pod:1689
8798 #: ../src/guestfs-actions.pod:2506 ../fish/guestfish-actions.pod:1691
8803 #: ../src/guestfs-actions.pod:2508 ../fish/guestfish-actions.pod:1693
8808 #: ../src/guestfs-actions.pod:2510 ../fish/guestfish-actions.pod:1695
8813 #: ../src/guestfs-actions.pod:2512 ../fish/guestfish-actions.pod:1697
8818 #: ../src/guestfs-actions.pod:2514 ../fish/guestfish-actions.pod:1699
8819 msgid "\"linuxmint\""
8823 #: ../src/guestfs-actions.pod:2516 ../fish/guestfish-actions.pod:1701
8828 #: ../src/guestfs-actions.pod:2518 ../fish/guestfish-actions.pod:1703
8829 msgid "\"mandriva\""
8833 #: ../src/guestfs-actions.pod:2520 ../fish/guestfish-actions.pod:1705
8838 #: ../src/guestfs-actions.pod:2522 ../fish/guestfish-actions.pod:1707
8843 #: ../src/guestfs-actions.pod:2524 ../fish/guestfish-actions.pod:1709
8848 #: ../src/guestfs-actions.pod:2526 ../fish/guestfish-actions.pod:1711
8853 #: ../src/guestfs-actions.pod:2528 ../fish/guestfish-actions.pod:1713
8858 #: ../src/guestfs-actions.pod:2530 ../fish/guestfish-actions.pod:1715
8859 msgid "\"redhat-based\""
8863 #: ../src/guestfs-actions.pod:2532 ../fish/guestfish-actions.pod:1717
8864 msgid "Some Red Hat-derived distro."
8868 #: ../src/guestfs-actions.pod:2534 ../fish/guestfish-actions.pod:1719
8873 #: ../src/guestfs-actions.pod:2536 ../fish/guestfish-actions.pod:1721
8874 msgid "Red Hat Enterprise Linux and some derivatives."
8878 #: ../src/guestfs-actions.pod:2538 ../fish/guestfish-actions.pod:1723
8883 #: ../src/guestfs-actions.pod:2540 ../fish/guestfish-actions.pod:1725
8888 #: ../src/guestfs-actions.pod:2542 ../src/guestfs-actions.pod:2822
8889 #: ../fish/guestfish-actions.pod:1727 ../fish/guestfish-actions.pod:1935
8894 #: ../src/guestfs-actions.pod:2544 ../fish/guestfish-actions.pod:1729
8895 msgid "The distro could not be determined."
8899 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:2814
8900 #: ../fish/guestfish-actions.pod:1731 ../fish/guestfish-actions.pod:1927
8905 #: ../src/guestfs-actions.pod:2548 ../fish/guestfish-actions.pod:1733
8907 "Windows does not have distributions. This string is returned if the OS type "
8912 #: ../src/guestfs-actions.pod:2553 ../src/guestfs-actions.pod:2828
8913 #: ../fish/guestfish-actions.pod:1738 ../fish/guestfish-actions.pod:1941
8915 "Future versions of libguestfs may return other strings here. The caller "
8916 "should be prepared to handle any string."
8920 #: ../src/guestfs-actions.pod:2563
8921 msgid "guestfs_inspect_get_filesystems"
8925 #: ../src/guestfs-actions.pod:2565
8929 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
8930 " const char *root);\n"
8935 #: ../src/guestfs-actions.pod:2572 ../fish/guestfish-actions.pod:1750
8937 "This returns a list of all the filesystems that we think are associated with "
8938 "this operating system. This includes the root filesystem, other ordinary "
8939 "filesystems, and non-mounted devices like swap partitions."
8943 #: ../src/guestfs-actions.pod:2577 ../fish/guestfish-actions.pod:1755
8945 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
8946 "to be shared between operating systems."
8950 #: ../src/guestfs-actions.pod:2580
8952 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8953 "C<guestfs_inspect_get_mountpoints>."
8957 #: ../src/guestfs-actions.pod:2589
8958 msgid "guestfs_inspect_get_hostname"
8962 #: ../src/guestfs-actions.pod:2591
8966 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
8967 " const char *root);\n"
8972 #: ../src/guestfs-actions.pod:2598 ../fish/guestfish-actions.pod:1768
8974 "This function returns the hostname of the operating system as found by "
8975 "inspection of the guest's configuration files."
8979 #: ../src/guestfs-actions.pod:2601 ../fish/guestfish-actions.pod:1771
8981 "If the hostname could not be determined, then the string C<unknown> is "
8986 #: ../src/guestfs-actions.pod:2609
8987 msgid "(Added in 1.7.9)"
8991 #: ../src/guestfs-actions.pod:2611
8992 msgid "guestfs_inspect_get_major_version"
8996 #: ../src/guestfs-actions.pod:2613
9000 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
9001 " const char *root);\n"
9006 #: ../src/guestfs-actions.pod:2620 ../fish/guestfish-actions.pod:1783
9008 "This returns the major version number of the inspected operating system."
9012 #: ../src/guestfs-actions.pod:2623 ../fish/guestfish-actions.pod:1786
9014 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9015 "popular public names used by the operating system. Notably the operating "
9016 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9017 "1). You can find out the real versions corresponding to releases of Windows "
9018 "by consulting Wikipedia or MSDN."
9022 #: ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:2650
9023 #: ../fish/guestfish-actions.pod:1793 ../fish/guestfish-actions.pod:1807
9024 msgid "If the version could not be determined, then C<0> is returned."
9028 #: ../src/guestfs-actions.pod:2638
9029 msgid "guestfs_inspect_get_minor_version"
9033 #: ../src/guestfs-actions.pod:2640
9037 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
9038 " const char *root);\n"
9043 #: ../src/guestfs-actions.pod:2647 ../fish/guestfish-actions.pod:1804
9045 "This returns the minor version number of the inspected operating system."
9049 #: ../src/guestfs-actions.pod:2652
9051 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9052 "C<guestfs_inspect_get_major_version>."
9056 #: ../src/guestfs-actions.pod:2659
9057 msgid "guestfs_inspect_get_mountpoints"
9061 #: ../src/guestfs-actions.pod:2661
9065 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
9066 " const char *root);\n"
9071 #: ../src/guestfs-actions.pod:2668 ../fish/guestfish-actions.pod:1819
9073 "This returns a hash of where we think the filesystems associated with this "
9074 "operating system should be mounted. Callers should note that this is at "
9075 "best an educated guess made by reading configuration files such as C</etc/"
9080 #: ../src/guestfs-actions.pod:2673 ../fish/guestfish-actions.pod:1824
9082 "Each element in the returned hashtable has a key which is the path of the "
9083 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9084 "mounted there (eg. C</dev/sda1>)."
9088 #: ../src/guestfs-actions.pod:2678 ../fish/guestfish-actions.pod:1829
9090 "Non-mounted devices such as swap devices are I<not> returned in this list."
9094 #: ../src/guestfs-actions.pod:2681
9096 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9097 "C<guestfs_inspect_get_filesystems>."
9101 #: ../src/guestfs-actions.pod:2684 ../src/guestfs-actions.pod:3300
9102 #: ../src/guestfs-actions.pod:4494 ../src/guestfs-actions.pod:6350
9104 "This function returns a NULL-terminated array of strings, or NULL if there "
9105 "was an error. The array of strings will always have length C<2n+1>, where "
9106 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
9107 "caller must free the strings and the array after use>."
9111 #: ../src/guestfs-actions.pod:2692
9112 msgid "guestfs_inspect_get_package_format"
9116 #: ../src/guestfs-actions.pod:2694
9120 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
9121 " const char *root);\n"
9126 #: ../src/guestfs-actions.pod:2701
9128 "This function and C<guestfs_inspect_get_package_management> return the "
9129 "package format and package management tool used by the inspected operating "
9130 "system. For example for Fedora these functions would return C<rpm> (package "
9131 "format) and C<yum> (package management)."
9135 #: ../src/guestfs-actions.pod:2707 ../fish/guestfish-actions.pod:1848
9137 "This returns the string C<unknown> if we could not determine the package "
9138 "format I<or> if the operating system does not have a real packaging system "
9143 #: ../src/guestfs-actions.pod:2711 ../fish/guestfish-actions.pod:1852
9145 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9146 "Future versions of libguestfs may return other strings."
9150 #: ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2750
9151 msgid "(Added in 1.7.5)"
9155 #: ../src/guestfs-actions.pod:2721
9156 msgid "guestfs_inspect_get_package_management"
9160 #: ../src/guestfs-actions.pod:2723
9164 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
9165 " const char *root);\n"
9170 #: ../src/guestfs-actions.pod:2730
9172 "C<guestfs_inspect_get_package_format> and this function return the package "
9173 "format and package management tool used by the inspected operating system. "
9174 "For example for Fedora these functions would return C<rpm> (package format) "
9175 "and C<yum> (package management)."
9179 #: ../src/guestfs-actions.pod:2736 ../fish/guestfish-actions.pod:1870
9181 "This returns the string C<unknown> if we could not determine the package "
9182 "management tool I<or> if the operating system does not have a real packaging "
9183 "system (eg. Windows)."
9187 #: ../src/guestfs-actions.pod:2740 ../fish/guestfish-actions.pod:1874
9189 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9190 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9191 "libguestfs may return other strings."
9195 #: ../src/guestfs-actions.pod:2752
9196 msgid "guestfs_inspect_get_product_name"
9200 #: ../src/guestfs-actions.pod:2754
9204 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
9205 " const char *root);\n"
9210 #: ../src/guestfs-actions.pod:2761 ../fish/guestfish-actions.pod:1888
9212 "This returns the product name of the inspected operating system. The "
9213 "product name is generally some freeform string which can be displayed to the "
9214 "user, but should not be parsed by programs."
9218 #: ../src/guestfs-actions.pod:2766 ../fish/guestfish-actions.pod:1893
9220 "If the product name could not be determined, then the string C<unknown> is "
9225 #: ../src/guestfs-actions.pod:2776
9226 msgid "guestfs_inspect_get_roots"
9230 #: ../src/guestfs-actions.pod:2778
9234 " guestfs_inspect_get_roots (guestfs_h *g);\n"
9239 #: ../src/guestfs-actions.pod:2781
9241 "This function is a convenient way to get the list of root devices, as "
9242 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
9243 "the whole inspection process."
9247 #: ../src/guestfs-actions.pod:2785
9249 "This returns an empty list if either no root devices were found or the "
9250 "caller has not called C<guestfs_inspect_os>."
9254 #: ../src/guestfs-actions.pod:2794
9255 msgid "(Added in 1.7.3)"
9259 #: ../src/guestfs-actions.pod:2796
9260 msgid "guestfs_inspect_get_type"
9264 #: ../src/guestfs-actions.pod:2798
9268 " guestfs_inspect_get_type (guestfs_h *g,\n"
9269 " const char *root);\n"
9274 #: ../src/guestfs-actions.pod:2805 ../fish/guestfish-actions.pod:1918
9276 "This returns the type of the inspected operating system. Currently defined "
9281 #: ../src/guestfs-actions.pod:2810 ../fish/guestfish-actions.pod:1923
9286 #: ../src/guestfs-actions.pod:2812 ../fish/guestfish-actions.pod:1925
9287 msgid "Any Linux-based operating system."
9291 #: ../src/guestfs-actions.pod:2816 ../fish/guestfish-actions.pod:1929
9292 msgid "Any Microsoft Windows operating system."
9296 #: ../src/guestfs-actions.pod:2818 ../fish/guestfish-actions.pod:1931
9301 #: ../src/guestfs-actions.pod:2820 ../fish/guestfish-actions.pod:1933
9306 #: ../src/guestfs-actions.pod:2824 ../fish/guestfish-actions.pod:1937
9307 msgid "The operating system type could not be determined."
9311 #: ../src/guestfs-actions.pod:2838
9312 msgid "guestfs_inspect_get_windows_systemroot"
9316 #: ../src/guestfs-actions.pod:2840
9320 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
9321 " const char *root);\n"
9326 #: ../src/guestfs-actions.pod:2847 ../fish/guestfish-actions.pod:1953
9328 "This returns the Windows systemroot of the inspected guest. The systemroot "
9329 "is a directory path such as C</WINDOWS>."
9333 #: ../src/guestfs-actions.pod:2850 ../fish/guestfish-actions.pod:1956
9335 "This call assumes that the guest is Windows and that the systemroot could be "
9336 "determined by inspection. If this is not the case then an error is returned."
9340 #: ../src/guestfs-actions.pod:2859
9341 msgid "(Added in 1.5.25)"
9345 #: ../src/guestfs-actions.pod:2861
9346 msgid "guestfs_inspect_list_applications"
9350 #: ../src/guestfs-actions.pod:2863
9353 " struct guestfs_application_list *\n"
9354 " guestfs_inspect_list_applications (guestfs_h *g,\n"
9355 " const char *root);\n"
9360 #: ../src/guestfs-actions.pod:2870 ../fish/guestfish-actions.pod:1969
9361 msgid "Return the list of applications installed in the operating system."
9365 #: ../src/guestfs-actions.pod:2872
9367 "I<Note:> This call works differently from other parts of the inspection "
9368 "API. You have to call C<guestfs_inspect_os>, then "
9369 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
9370 "this. Listing applications is a significantly more difficult operation "
9371 "which requires access to the full filesystem. Also note that unlike the "
9372 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
9373 "the libguestfs handle, this call actually reads parts of the mounted "
9374 "filesystems during the call."
9378 #: ../src/guestfs-actions.pod:2882 ../fish/guestfish-actions.pod:1981
9380 "This returns an empty list if the inspection code was not able to determine "
9381 "the list of applications."
9385 #: ../src/guestfs-actions.pod:2885 ../fish/guestfish-actions.pod:1984
9386 msgid "The application structure contains the following fields:"
9390 #: ../src/guestfs-actions.pod:2889 ../fish/guestfish-actions.pod:1988
9395 #: ../src/guestfs-actions.pod:2891 ../fish/guestfish-actions.pod:1990
9397 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9398 "guests, this is the package name."
9402 #: ../src/guestfs-actions.pod:2894 ../fish/guestfish-actions.pod:1993
9403 msgid "C<app_display_name>"
9407 #: ../src/guestfs-actions.pod:2896 ../fish/guestfish-actions.pod:1995
9409 "The display name of the application, sometimes localized to the install "
9410 "language of the guest operating system."
9414 #: ../src/guestfs-actions.pod:2899 ../fish/guestfish-actions.pod:1998
9416 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9417 "to display something can use C<app_name> instead."
9421 #: ../src/guestfs-actions.pod:2902 ../fish/guestfish-actions.pod:2001
9422 msgid "C<app_epoch>"
9426 #: ../src/guestfs-actions.pod:2904 ../fish/guestfish-actions.pod:2003
9428 "For package managers which use epochs, this contains the epoch of the "
9429 "package (an integer). If unavailable, this is returned as C<0>."
9433 #: ../src/guestfs-actions.pod:2907 ../fish/guestfish-actions.pod:2006
9434 msgid "C<app_version>"
9438 #: ../src/guestfs-actions.pod:2909 ../fish/guestfish-actions.pod:2008
9440 "The version string of the application or package. If unavailable this is "
9441 "returned as an empty string C<\"\">."
9445 #: ../src/guestfs-actions.pod:2912 ../fish/guestfish-actions.pod:2011
9446 msgid "C<app_release>"
9450 #: ../src/guestfs-actions.pod:2914 ../fish/guestfish-actions.pod:2013
9452 "The release string of the application or package, for package managers that "
9453 "use this. If unavailable this is returned as an empty string C<\"\">."
9457 #: ../src/guestfs-actions.pod:2918 ../fish/guestfish-actions.pod:2017
9458 msgid "C<app_install_path>"
9462 #: ../src/guestfs-actions.pod:2920 ../fish/guestfish-actions.pod:2019
9464 "The installation path of the application (on operating systems such as "
9465 "Windows which use installation paths). This path is in the format used by "
9466 "the guest operating system, it is not a libguestfs path."
9470 #: ../src/guestfs-actions.pod:2925 ../fish/guestfish-actions.pod:2024
9471 msgid "If unavailable this is returned as an empty string C<\"\">."
9475 #: ../src/guestfs-actions.pod:2927 ../fish/guestfish-actions.pod:2026
9476 msgid "C<app_trans_path>"
9480 #: ../src/guestfs-actions.pod:2929 ../fish/guestfish-actions.pod:2028
9482 "The install path translated into a libguestfs path. If unavailable this is "
9483 "returned as an empty string C<\"\">."
9487 #: ../src/guestfs-actions.pod:2932 ../fish/guestfish-actions.pod:2031
9488 msgid "C<app_publisher>"
9492 #: ../src/guestfs-actions.pod:2934 ../fish/guestfish-actions.pod:2033
9494 "The name of the publisher of the application, for package managers that use "
9495 "this. If unavailable this is returned as an empty string C<\"\">."
9499 #: ../src/guestfs-actions.pod:2938 ../fish/guestfish-actions.pod:2037
9504 #: ../src/guestfs-actions.pod:2940 ../fish/guestfish-actions.pod:2039
9506 "The URL (eg. upstream URL) of the application. If unavailable this is "
9507 "returned as an empty string C<\"\">."
9511 #: ../src/guestfs-actions.pod:2943 ../fish/guestfish-actions.pod:2042
9512 msgid "C<app_source_package>"
9516 #: ../src/guestfs-actions.pod:2945 ../fish/guestfish-actions.pod:2044
9518 "For packaging systems which support this, the name of the source package. "
9519 "If unavailable this is returned as an empty string C<\"\">."
9523 #: ../src/guestfs-actions.pod:2948 ../fish/guestfish-actions.pod:2047
9524 msgid "C<app_summary>"
9528 #: ../src/guestfs-actions.pod:2950 ../fish/guestfish-actions.pod:2049
9530 "A short (usually one line) description of the application or package. If "
9531 "unavailable this is returned as an empty string C<\"\">."
9535 #: ../src/guestfs-actions.pod:2953 ../fish/guestfish-actions.pod:2052
9536 msgid "C<app_description>"
9540 #: ../src/guestfs-actions.pod:2955 ../fish/guestfish-actions.pod:2054
9542 "A longer description of the application or package. If unavailable this is "
9543 "returned as an empty string C<\"\">."
9547 #: ../src/guestfs-actions.pod:2962
9549 "This function returns a C<struct guestfs_application_list *>, or NULL if "
9550 "there was an error. I<The caller must call C<guestfs_free_application_list> "
9555 #: ../src/guestfs-actions.pod:2966
9556 msgid "(Added in 1.7.8)"
9560 #: ../src/guestfs-actions.pod:2968
9561 msgid "guestfs_inspect_os"
9565 #: ../src/guestfs-actions.pod:2970
9569 " guestfs_inspect_os (guestfs_h *g);\n"
9574 #: ../src/guestfs-actions.pod:2973 ../fish/guestfish-actions.pod:2065
9576 "This function uses other libguestfs functions and certain heuristics to "
9577 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9578 "for operating systems."
9582 #: ../src/guestfs-actions.pod:2977 ../fish/guestfish-actions.pod:2069
9583 msgid "The list returned is empty if no operating systems were found."
9587 #: ../src/guestfs-actions.pod:2979 ../fish/guestfish-actions.pod:2071
9589 "If one operating system was found, then this returns a list with a single "
9590 "element, which is the name of the root filesystem of this operating system. "
9591 "It is also possible for this function to return a list containing more than "
9592 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9593 "element being the root filesystem of one of the operating systems."
9597 #: ../src/guestfs-actions.pod:2986
9599 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
9600 "functions in order to query further information about each operating system, "
9601 "such as the name and version."
9605 #: ../src/guestfs-actions.pod:2991
9607 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
9608 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
9609 "the contents. This should be called with no disks currently mounted. The "
9610 "function may also use Augeas, so any existing Augeas handle will be closed."
9614 #: ../src/guestfs-actions.pod:2997 ../fish/guestfish-actions.pod:2089
9616 "This function cannot decrypt encrypted disks. The caller must do that first "
9617 "(supplying the necessary keys) if the disk is encrypted."
9621 #: ../src/guestfs-actions.pod:3003 ../src/guestfs-actions.pod:3258
9622 #: ../src/guestfs-actions.pod:3320
9623 msgid "See also C<guestfs_list_filesystems>."
9627 #: ../src/guestfs-actions.pod:3011
9628 msgid "guestfs_is_blockdev"
9632 #: ../src/guestfs-actions.pod:3013
9636 " guestfs_is_blockdev (guestfs_h *g,\n"
9637 " const char *path);\n"
9642 #: ../src/guestfs-actions.pod:3017 ../fish/guestfish-actions.pod:2101
9644 "This returns C<true> if and only if there is a block device with the given "
9649 #: ../src/guestfs-actions.pod:3020 ../src/guestfs-actions.pod:3049
9650 #: ../src/guestfs-actions.pod:3079 ../src/guestfs-actions.pod:3094
9651 #: ../src/guestfs-actions.pod:3110 ../src/guestfs-actions.pod:3166
9652 #: ../src/guestfs-actions.pod:3181
9653 msgid "See also C<guestfs_stat>."
9657 #: ../src/guestfs-actions.pod:3024 ../src/guestfs-actions.pod:3053
9658 #: ../src/guestfs-actions.pod:3098 ../src/guestfs-actions.pod:3170
9659 #: ../src/guestfs-actions.pod:3185
9660 msgid "(Added in 1.5.10)"
9664 #: ../src/guestfs-actions.pod:3026
9665 msgid "guestfs_is_busy"
9669 #: ../src/guestfs-actions.pod:3028
9673 " guestfs_is_busy (guestfs_h *g);\n"
9678 #: ../src/guestfs-actions.pod:3031 ../fish/guestfish-actions.pod:2110
9680 "This returns true iff this handle is busy processing a command (in the "
9685 #: ../src/guestfs-actions.pod:3040
9686 msgid "guestfs_is_chardev"
9690 #: ../src/guestfs-actions.pod:3042
9694 " guestfs_is_chardev (guestfs_h *g,\n"
9695 " const char *path);\n"
9700 #: ../src/guestfs-actions.pod:3046 ../fish/guestfish-actions.pod:2119
9702 "This returns C<true> if and only if there is a character device with the "
9703 "given C<path> name."
9707 #: ../src/guestfs-actions.pod:3055
9708 msgid "guestfs_is_config"
9712 #: ../src/guestfs-actions.pod:3057
9716 " guestfs_is_config (guestfs_h *g);\n"
9721 #: ../src/guestfs-actions.pod:3060 ../fish/guestfish-actions.pod:2128
9723 "This returns true iff this handle is being configured (in the C<CONFIG> "
9728 #: ../src/guestfs-actions.pod:3069
9729 msgid "guestfs_is_dir"
9733 #: ../src/guestfs-actions.pod:3071
9737 " guestfs_is_dir (guestfs_h *g,\n"
9738 " const char *path);\n"
9743 #: ../src/guestfs-actions.pod:3075 ../fish/guestfish-actions.pod:2137
9745 "This returns C<true> if and only if there is a directory with the given "
9746 "C<path> name. Note that it returns false for other objects like files."
9750 #: ../src/guestfs-actions.pod:3085
9751 msgid "guestfs_is_fifo"
9755 #: ../src/guestfs-actions.pod:3087
9759 " guestfs_is_fifo (guestfs_h *g,\n"
9760 " const char *path);\n"
9765 #: ../src/guestfs-actions.pod:3091 ../fish/guestfish-actions.pod:2147
9767 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
9768 "given C<path> name."
9772 #: ../src/guestfs-actions.pod:3100
9773 msgid "guestfs_is_file"
9777 #: ../src/guestfs-actions.pod:3102
9781 " guestfs_is_file (guestfs_h *g,\n"
9782 " const char *path);\n"
9787 #: ../src/guestfs-actions.pod:3106 ../fish/guestfish-actions.pod:2156
9789 "This returns C<true> if and only if there is a regular file with the given "
9790 "C<path> name. Note that it returns false for other objects like directories."
9794 #: ../src/guestfs-actions.pod:3116
9795 msgid "guestfs_is_launching"
9799 #: ../src/guestfs-actions.pod:3118
9803 " guestfs_is_launching (guestfs_h *g);\n"
9808 #: ../src/guestfs-actions.pod:3121 ../fish/guestfish-actions.pod:2166
9810 "This returns true iff this handle is launching the subprocess (in the "
9811 "C<LAUNCHING> state)."
9815 #: ../src/guestfs-actions.pod:3130
9816 msgid "guestfs_is_lv"
9820 #: ../src/guestfs-actions.pod:3132
9824 " guestfs_is_lv (guestfs_h *g,\n"
9825 " const char *device);\n"
9830 #: ../src/guestfs-actions.pod:3136 ../fish/guestfish-actions.pod:2175
9832 "This command tests whether C<device> is a logical volume, and returns true "
9833 "iff this is the case."
9837 #: ../src/guestfs-actions.pod:3143
9838 msgid "guestfs_is_ready"
9842 #: ../src/guestfs-actions.pod:3145
9846 " guestfs_is_ready (guestfs_h *g);\n"
9851 #: ../src/guestfs-actions.pod:3148 ../fish/guestfish-actions.pod:2182
9853 "This returns true iff this handle is ready to accept commands (in the "
9858 #: ../src/guestfs-actions.pod:3157
9859 msgid "guestfs_is_socket"
9863 #: ../src/guestfs-actions.pod:3159
9867 " guestfs_is_socket (guestfs_h *g,\n"
9868 " const char *path);\n"
9873 #: ../src/guestfs-actions.pod:3163 ../fish/guestfish-actions.pod:2191
9875 "This returns C<true> if and only if there is a Unix domain socket with the "
9876 "given C<path> name."
9880 #: ../src/guestfs-actions.pod:3172
9881 msgid "guestfs_is_symlink"
9885 #: ../src/guestfs-actions.pod:3174
9889 " guestfs_is_symlink (guestfs_h *g,\n"
9890 " const char *path);\n"
9895 #: ../src/guestfs-actions.pod:3178 ../fish/guestfish-actions.pod:2200
9897 "This returns C<true> if and only if there is a symbolic link with the given "
9902 #: ../src/guestfs-actions.pod:3187
9903 msgid "guestfs_kill_subprocess"
9907 #: ../src/guestfs-actions.pod:3189
9911 " guestfs_kill_subprocess (guestfs_h *g);\n"
9916 #: ../src/guestfs-actions.pod:3192 ../fish/guestfish-actions.pod:2209
9917 msgid "This kills the qemu subprocess. You should never need to call this."
9921 #: ../src/guestfs-actions.pod:3198
9922 msgid "guestfs_launch"
9926 #: ../src/guestfs-actions.pod:3200
9930 " guestfs_launch (guestfs_h *g);\n"
9935 #: ../src/guestfs-actions.pod:3203 ../fish/guestfish-actions.pod:2217
9937 "Internally libguestfs is implemented by running a virtual machine using "
9942 #: ../src/guestfs-actions.pod:3206 ../fish/guestfish-actions.pod:2220
9944 "You should call this after configuring the handle (eg. adding drives) but "
9945 "before performing any actions."
9949 #: ../src/guestfs-actions.pod:3213
9950 msgid "guestfs_lchown"
9954 #: ../src/guestfs-actions.pod:3215
9958 " guestfs_lchown (guestfs_h *g,\n"
9961 " const char *path);\n"
9966 #: ../src/guestfs-actions.pod:3221
9968 "Change the file owner to C<owner> and group to C<group>. This is like "
9969 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
9970 "changed, not the target."
9974 #: ../src/guestfs-actions.pod:3233
9975 msgid "guestfs_lgetxattrs"
9979 #: ../src/guestfs-actions.pod:3235
9982 " struct guestfs_xattr_list *\n"
9983 " guestfs_lgetxattrs (guestfs_h *g,\n"
9984 " const char *path);\n"
9989 #: ../src/guestfs-actions.pod:3239
9991 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
9992 "then it returns the extended attributes of the link itself."
9996 #: ../src/guestfs-actions.pod:3249
9997 msgid "guestfs_list_devices"
10001 #: ../src/guestfs-actions.pod:3251
10005 " guestfs_list_devices (guestfs_h *g);\n"
10010 #: ../src/guestfs-actions.pod:3254 ../fish/guestfish-actions.pod:2247
10011 msgid "List all the block devices."
10015 #: ../src/guestfs-actions.pod:3256 ../fish/guestfish-actions.pod:2249
10016 msgid "The full block device names are returned, eg. C</dev/sda>."
10020 #: ../src/guestfs-actions.pod:3266
10021 msgid "guestfs_list_filesystems"
10025 #: ../src/guestfs-actions.pod:3268
10029 " guestfs_list_filesystems (guestfs_h *g);\n"
10034 #: ../src/guestfs-actions.pod:3271 ../fish/guestfish-actions.pod:2257
10036 "This inspection command looks for filesystems on partitions, block devices "
10037 "and logical volumes, returning a list of devices containing filesystems and "
10042 #: ../src/guestfs-actions.pod:3275 ../fish/guestfish-actions.pod:2261
10044 "The return value is a hash, where the keys are the devices containing "
10045 "filesystems, and the values are the filesystem types. For example:"
10049 #: ../src/guestfs-actions.pod:3279 ../fish/guestfish-actions.pod:2265
10052 " \"/dev/sda1\" => \"ntfs\"\n"
10053 " \"/dev/sda2\" => \"ext2\"\n"
10054 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10055 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10060 #: ../src/guestfs-actions.pod:3284 ../fish/guestfish-actions.pod:2270
10062 "The value can have the special value \"unknown\", meaning the content of the "
10063 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10067 #: ../src/guestfs-actions.pod:3288
10069 "This command runs other libguestfs commands, which might include "
10070 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
10071 "soon after launch and only when nothing is mounted."
10075 #: ../src/guestfs-actions.pod:3292
10077 "Not all of the filesystems returned will be mountable. In particular, swap "
10078 "partitions are returned in the list. Also this command does not check that "
10079 "each filesystem found is valid and mountable, and some filesystems might be "
10080 "mountable but require special options. Filesystems may not all belong to a "
10081 "single logical operating system (use C<guestfs_inspect_os> to look for OSes)."
10085 #: ../src/guestfs-actions.pod:3306 ../src/guestfs-actions.pod:4895
10086 msgid "(Added in 1.5.15)"
10090 #: ../src/guestfs-actions.pod:3308
10091 msgid "guestfs_list_partitions"
10095 #: ../src/guestfs-actions.pod:3310
10099 " guestfs_list_partitions (guestfs_h *g);\n"
10104 #: ../src/guestfs-actions.pod:3313 ../fish/guestfish-actions.pod:2290
10105 msgid "List all the partitions detected on all block devices."
10109 #: ../src/guestfs-actions.pod:3315 ../fish/guestfish-actions.pod:2292
10110 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10114 #: ../src/guestfs-actions.pod:3317
10116 "This does not return logical volumes. For that you will need to call "
10121 #: ../src/guestfs-actions.pod:3328
10126 #: ../src/guestfs-actions.pod:3330
10130 " guestfs_ll (guestfs_h *g,\n"
10131 " const char *directory);\n"
10136 #: ../src/guestfs-actions.pod:3334 ../fish/guestfish-actions.pod:2303
10138 "List the files in C<directory> (relative to the root directory, there is no "
10139 "cwd) in the format of 'ls -la'."
10143 #: ../src/guestfs-actions.pod:3337 ../fish/guestfish-actions.pod:2306
10145 "This command is mostly useful for interactive sessions. It is I<not> "
10146 "intended that you try to parse the output string."
10150 #: ../src/guestfs-actions.pod:3345
10155 #: ../src/guestfs-actions.pod:3347
10159 " guestfs_ln (guestfs_h *g,\n"
10160 " const char *target,\n"
10161 " const char *linkname);\n"
10166 #: ../src/guestfs-actions.pod:3352 ../fish/guestfish-actions.pod:2313
10167 msgid "This command creates a hard link using the C<ln> command."
10171 #: ../src/guestfs-actions.pod:3358
10172 msgid "guestfs_ln_f"
10176 #: ../src/guestfs-actions.pod:3360
10180 " guestfs_ln_f (guestfs_h *g,\n"
10181 " const char *target,\n"
10182 " const char *linkname);\n"
10187 #: ../src/guestfs-actions.pod:3365 ../fish/guestfish-actions.pod:2319
10189 "This command creates a hard link using the C<ln -f> command. The C<-f> "
10190 "option removes the link (C<linkname>) if it exists already."
10194 #: ../src/guestfs-actions.pod:3372
10195 msgid "guestfs_ln_s"
10199 #: ../src/guestfs-actions.pod:3374
10203 " guestfs_ln_s (guestfs_h *g,\n"
10204 " const char *target,\n"
10205 " const char *linkname);\n"
10210 #: ../src/guestfs-actions.pod:3379 ../fish/guestfish-actions.pod:2326
10211 msgid "This command creates a symbolic link using the C<ln -s> command."
10215 #: ../src/guestfs-actions.pod:3385
10216 msgid "guestfs_ln_sf"
10220 #: ../src/guestfs-actions.pod:3387
10224 " guestfs_ln_sf (guestfs_h *g,\n"
10225 " const char *target,\n"
10226 " const char *linkname);\n"
10231 #: ../src/guestfs-actions.pod:3392 ../fish/guestfish-actions.pod:2332
10233 "This command creates a symbolic link using the C<ln -sf> command, The C<-f> "
10234 "option removes the link (C<linkname>) if it exists already."
10238 #: ../src/guestfs-actions.pod:3399
10239 msgid "guestfs_lremovexattr"
10243 #: ../src/guestfs-actions.pod:3401
10247 " guestfs_lremovexattr (guestfs_h *g,\n"
10248 " const char *xattr,\n"
10249 " const char *path);\n"
10254 #: ../src/guestfs-actions.pod:3406
10256 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
10257 "link, then it removes an extended attribute of the link itself."
10261 #: ../src/guestfs-actions.pod:3414
10266 #: ../src/guestfs-actions.pod:3416
10270 " guestfs_ls (guestfs_h *g,\n"
10271 " const char *directory);\n"
10276 #: ../src/guestfs-actions.pod:3420 ../fish/guestfish-actions.pod:2347
10278 "List the files in C<directory> (relative to the root directory, there is no "
10279 "cwd). The '.' and '..' entries are not returned, but hidden files are shown."
10283 #: ../src/guestfs-actions.pod:3424
10285 "This command is mostly useful for interactive sessions. Programs should "
10286 "probably use C<guestfs_readdir> instead."
10290 #: ../src/guestfs-actions.pod:3433
10291 msgid "guestfs_lsetxattr"
10295 #: ../src/guestfs-actions.pod:3435
10299 " guestfs_lsetxattr (guestfs_h *g,\n"
10300 " const char *xattr,\n"
10301 " const char *val,\n"
10303 " const char *path);\n"
10308 #: ../src/guestfs-actions.pod:3442
10310 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
10311 "then it sets an extended attribute of the link itself."
10315 #: ../src/guestfs-actions.pod:3450
10316 msgid "guestfs_lstat"
10320 #: ../src/guestfs-actions.pod:3452
10323 " struct guestfs_stat *\n"
10324 " guestfs_lstat (guestfs_h *g,\n"
10325 " const char *path);\n"
10330 #: ../src/guestfs-actions.pod:3456 ../src/guestfs-actions.pod:5949
10331 #: ../fish/guestfish-actions.pod:2366 ../fish/guestfish-actions.pod:3979
10332 msgid "Returns file information for the given C<path>."
10336 #: ../src/guestfs-actions.pod:3458
10338 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
10339 "link, then the link is stat-ed, not the file it refers to."
10343 #: ../src/guestfs-actions.pod:3462 ../fish/guestfish-actions.pod:2372
10344 msgid "This is the same as the C<lstat(2)> system call."
10348 #: ../src/guestfs-actions.pod:3464 ../src/guestfs-actions.pod:5953
10350 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
10351 "error. I<The caller must call C<guestfs_free_stat> after use>."
10355 #: ../src/guestfs-actions.pod:3468 ../src/guestfs-actions.pod:5957
10356 #: ../src/guestfs-actions.pod:5975 ../src/guestfs-actions.pod:6356
10357 msgid "(Added in 0.9.2)"
10361 #: ../src/guestfs-actions.pod:3470
10362 msgid "guestfs_lstatlist"
10366 #: ../src/guestfs-actions.pod:3472
10369 " struct guestfs_stat_list *\n"
10370 " guestfs_lstatlist (guestfs_h *g,\n"
10371 " const char *path,\n"
10372 " char *const *names);\n"
10377 #: ../src/guestfs-actions.pod:3477
10379 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
10380 "files, where all files are in the directory C<path>. C<names> is the list "
10381 "of files from this directory."
10385 #: ../src/guestfs-actions.pod:3481 ../fish/guestfish-actions.pod:2382
10387 "On return you get a list of stat structs, with a one-to-one correspondence "
10388 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10389 "then the C<ino> field of that structure is set to C<-1>."
10393 #: ../src/guestfs-actions.pod:3486
10395 "This call is intended for programs that want to efficiently list a directory "
10396 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
10397 "for a similarly efficient call for getting extended attributes. Very long "
10398 "directory listings might cause the protocol message size to be exceeded, "
10399 "causing this call to fail. The caller must split up such requests into "
10400 "smaller groups of names."
10404 #: ../src/guestfs-actions.pod:3494
10406 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
10407 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
10411 #: ../src/guestfs-actions.pod:3500
10412 msgid "guestfs_luks_add_key"
10416 #: ../src/guestfs-actions.pod:3502
10420 " guestfs_luks_add_key (guestfs_h *g,\n"
10421 " const char *device,\n"
10422 " const char *key,\n"
10423 " const char *newkey,\n"
10429 #: ../src/guestfs-actions.pod:3509 ../fish/guestfish-actions.pod:2399
10431 "This command adds a new key on LUKS device C<device>. C<key> is any "
10432 "existing key, and is used to access the device. C<newkey> is the new key to "
10433 "add. C<keyslot> is the key slot that will be replaced."
10437 #: ../src/guestfs-actions.pod:3514
10439 "Note that if C<keyslot> already contains a key, then this command will "
10440 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
10444 #: ../src/guestfs-actions.pod:3520 ../src/guestfs-actions.pod:3560
10445 #: ../src/guestfs-actions.pod:3583 ../src/guestfs-actions.pod:3603
10446 #: ../src/guestfs-actions.pod:3635 ../src/guestfs-actions.pod:3654
10448 "This function takes a key or passphrase parameter which could contain "
10449 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
10454 #: ../src/guestfs-actions.pod:3524 ../src/guestfs-actions.pod:3564
10455 #: ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3607
10456 msgid "(Added in 1.5.2)"
10460 #: ../src/guestfs-actions.pod:3526
10461 msgid "guestfs_luks_close"
10465 #: ../src/guestfs-actions.pod:3528
10469 " guestfs_luks_close (guestfs_h *g,\n"
10470 " const char *device);\n"
10475 #: ../src/guestfs-actions.pod:3532
10477 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
10478 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
10479 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10480 "underlying block device."
10484 #: ../src/guestfs-actions.pod:3540 ../src/guestfs-actions.pod:3639
10485 #: ../src/guestfs-actions.pod:3658 ../src/guestfs-actions.pod:3708
10486 #: ../src/guestfs-actions.pod:3756
10487 msgid "(Added in 1.5.1)"
10491 #: ../src/guestfs-actions.pod:3542
10492 msgid "guestfs_luks_format"
10496 #: ../src/guestfs-actions.pod:3544
10500 " guestfs_luks_format (guestfs_h *g,\n"
10501 " const char *device,\n"
10502 " const char *key,\n"
10508 #: ../src/guestfs-actions.pod:3550 ../fish/guestfish-actions.pod:2425
10510 "This command erases existing data on C<device> and formats the device as a "
10511 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10512 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10516 #: ../src/guestfs-actions.pod:3557 ../src/guestfs-actions.pod:3580
10517 #: ../src/guestfs-actions.pod:3720 ../src/guestfs-actions.pod:4646
10518 #: ../src/guestfs-actions.pod:5409 ../src/guestfs-actions.pod:5784
10519 #: ../src/guestfs-actions.pod:5807 ../src/guestfs-actions.pod:5833
10520 #: ../src/guestfs-actions.pod:6993 ../fish/guestfish-actions.pod:2433
10521 #: ../fish/guestfish-actions.pod:2446 ../fish/guestfish-actions.pod:2530
10522 #: ../fish/guestfish-actions.pod:3091 ../fish/guestfish-actions.pod:3598
10523 #: ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3894
10524 #: ../fish/guestfish-actions.pod:3909 ../fish/guestfish-actions.pod:4624
10526 "B<This command is dangerous. Without careful use you can easily destroy all "
10531 #: ../src/guestfs-actions.pod:3566
10532 msgid "guestfs_luks_format_cipher"
10536 #: ../src/guestfs-actions.pod:3568
10540 " guestfs_luks_format_cipher (guestfs_h *g,\n"
10541 " const char *device,\n"
10542 " const char *key,\n"
10544 " const char *cipher);\n"
10549 #: ../src/guestfs-actions.pod:3575
10551 "This command is the same as C<guestfs_luks_format> but it also allows you to "
10552 "set the C<cipher> used."
10556 #: ../src/guestfs-actions.pod:3589
10557 msgid "guestfs_luks_kill_slot"
10561 #: ../src/guestfs-actions.pod:3591
10565 " guestfs_luks_kill_slot (guestfs_h *g,\n"
10566 " const char *device,\n"
10567 " const char *key,\n"
10573 #: ../src/guestfs-actions.pod:3597 ../fish/guestfish-actions.pod:2453
10575 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10576 "device C<device>. C<key> must be one of the I<other> keys."
10580 #: ../src/guestfs-actions.pod:3609
10581 msgid "guestfs_luks_open"
10585 #: ../src/guestfs-actions.pod:3611
10589 " guestfs_luks_open (guestfs_h *g,\n"
10590 " const char *device,\n"
10591 " const char *key,\n"
10592 " const char *mapname);\n"
10597 #: ../src/guestfs-actions.pod:3617 ../fish/guestfish-actions.pod:2464
10599 "This command opens a block device which has been encrypted according to the "
10600 "Linux Unified Key Setup (LUKS) standard."
10604 #: ../src/guestfs-actions.pod:3620 ../fish/guestfish-actions.pod:2467
10605 msgid "C<device> is the encrypted block device or partition."
10609 #: ../src/guestfs-actions.pod:3622 ../fish/guestfish-actions.pod:2469
10611 "The caller must supply one of the keys associated with the LUKS block "
10612 "device, in the C<key> parameter."
10616 #: ../src/guestfs-actions.pod:3625 ../fish/guestfish-actions.pod:2472
10618 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10619 "writes to this block device are decrypted from and encrypted to the "
10620 "underlying C<device> respectively."
10624 #: ../src/guestfs-actions.pod:3629
10626 "If this block device contains LVM volume groups, then calling "
10627 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
10632 #: ../src/guestfs-actions.pod:3641
10633 msgid "guestfs_luks_open_ro"
10637 #: ../src/guestfs-actions.pod:3643
10641 " guestfs_luks_open_ro (guestfs_h *g,\n"
10642 " const char *device,\n"
10643 " const char *key,\n"
10644 " const char *mapname);\n"
10649 #: ../src/guestfs-actions.pod:3649
10651 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
10656 #: ../src/guestfs-actions.pod:3660
10657 msgid "guestfs_lvcreate"
10661 #: ../src/guestfs-actions.pod:3662
10665 " guestfs_lvcreate (guestfs_h *g,\n"
10666 " const char *logvol,\n"
10667 " const char *volgroup,\n"
10673 #: ../src/guestfs-actions.pod:3668 ../fish/guestfish-actions.pod:2497
10675 "This creates an LVM logical volume called C<logvol> on the volume group "
10676 "C<volgroup>, with C<size> megabytes."
10680 #: ../src/guestfs-actions.pod:3675
10681 msgid "guestfs_lvm_canonical_lv_name"
10685 #: ../src/guestfs-actions.pod:3677
10689 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
10690 " const char *lvname);\n"
10695 #: ../src/guestfs-actions.pod:3681 ../fish/guestfish-actions.pod:2504
10697 "This converts alternative naming schemes for LVs that you might find to the "
10698 "canonical name. For example, C</dev/mapper/VG-LV> is converted to C</dev/VG/"
10703 #: ../src/guestfs-actions.pod:3685 ../fish/guestfish-actions.pod:2508
10705 "This command returns an error if the C<lvname> parameter does not refer to a "
10710 #: ../src/guestfs-actions.pod:3688
10711 msgid "See also C<guestfs_is_lv>."
10715 #: ../src/guestfs-actions.pod:3693
10716 msgid "(Added in 1.5.24)"
10720 #: ../src/guestfs-actions.pod:3695
10721 msgid "guestfs_lvm_clear_filter"
10725 #: ../src/guestfs-actions.pod:3697
10729 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
10734 #: ../src/guestfs-actions.pod:3700
10736 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
10737 "see every block device."
10741 #: ../src/guestfs-actions.pod:3703 ../src/guestfs-actions.pod:3745
10742 #: ../fish/guestfish-actions.pod:2520 ../fish/guestfish-actions.pod:2551
10744 "This command also clears the LVM cache and performs a volume group scan."
10748 #: ../src/guestfs-actions.pod:3710
10749 msgid "guestfs_lvm_remove_all"
10753 #: ../src/guestfs-actions.pod:3712
10757 " guestfs_lvm_remove_all (guestfs_h *g);\n"
10762 #: ../src/guestfs-actions.pod:3715 ../fish/guestfish-actions.pod:2527
10764 "This command removes all LVM logical volumes, volume groups and physical "
10769 #: ../src/guestfs-actions.pod:3725
10770 msgid "guestfs_lvm_set_filter"
10774 #: ../src/guestfs-actions.pod:3727
10778 " guestfs_lvm_set_filter (guestfs_h *g,\n"
10779 " char *const *devices);\n"
10784 #: ../src/guestfs-actions.pod:3731 ../fish/guestfish-actions.pod:2537
10786 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
10787 "block devices in the list C<devices>, and will ignore all other attached "
10792 #: ../src/guestfs-actions.pod:3735 ../fish/guestfish-actions.pod:2541
10794 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
10795 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
10796 "there are two types of duplication possible: either cloned PVs/VGs which "
10797 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
10798 "same name. In normal operation you cannot create this situation, but you "
10799 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
10800 "inside the LVM metadata."
10804 #: ../src/guestfs-actions.pod:3748 ../fish/guestfish-actions.pod:2554
10805 msgid "You can filter whole block devices or individual partitions."
10809 #: ../src/guestfs-actions.pod:3750 ../fish/guestfish-actions.pod:2556
10811 "You cannot use this if any VG is currently in use (eg. contains a mounted "
10812 "filesystem), even if you are not filtering out that VG."
10816 #: ../src/guestfs-actions.pod:3758
10817 msgid "guestfs_lvremove"
10821 #: ../src/guestfs-actions.pod:3760
10825 " guestfs_lvremove (guestfs_h *g,\n"
10826 " const char *device);\n"
10831 #: ../src/guestfs-actions.pod:3764 ../fish/guestfish-actions.pod:2564
10833 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
10834 "LV, such as C</dev/VG/LV>."
10838 #: ../src/guestfs-actions.pod:3767 ../fish/guestfish-actions.pod:2567
10840 "You can also remove all LVs in a volume group by specifying the VG name, C</"
10845 #: ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:4992
10846 #: ../src/guestfs-actions.pod:6732
10847 msgid "(Added in 1.0.13)"
10851 #: ../src/guestfs-actions.pod:3774
10852 msgid "guestfs_lvrename"
10856 #: ../src/guestfs-actions.pod:3776
10860 " guestfs_lvrename (guestfs_h *g,\n"
10861 " const char *logvol,\n"
10862 " const char *newlogvol);\n"
10867 #: ../src/guestfs-actions.pod:3781 ../fish/guestfish-actions.pod:2574
10868 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
10872 #: ../src/guestfs-actions.pod:3785 ../src/guestfs-actions.pod:6745
10873 msgid "(Added in 1.0.83)"
10877 #: ../src/guestfs-actions.pod:3787
10878 msgid "guestfs_lvresize"
10882 #: ../src/guestfs-actions.pod:3789
10886 " guestfs_lvresize (guestfs_h *g,\n"
10887 " const char *device,\n"
10893 #: ../src/guestfs-actions.pod:3794 ../fish/guestfish-actions.pod:2580
10895 "This resizes (expands or shrinks) an existing LVM logical volume to "
10896 "C<mbytes>. When reducing, data in the reduced part is lost."
10900 #: ../src/guestfs-actions.pod:3802
10901 msgid "guestfs_lvresize_free"
10905 #: ../src/guestfs-actions.pod:3804
10909 " guestfs_lvresize_free (guestfs_h *g,\n"
10910 " const char *lv,\n"
10916 #: ../src/guestfs-actions.pod:3809 ../fish/guestfish-actions.pod:2588
10918 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
10919 "remaining free space in the volume group. Commonly you would call this with "
10920 "pc = 100 which expands the logical volume as much as possible, using all "
10921 "remaining free space in the volume group."
10925 #: ../src/guestfs-actions.pod:3817
10926 msgid "(Added in 1.3.3)"
10930 #: ../src/guestfs-actions.pod:3819
10931 msgid "guestfs_lvs"
10935 #: ../src/guestfs-actions.pod:3821
10939 " guestfs_lvs (guestfs_h *g);\n"
10944 #: ../src/guestfs-actions.pod:3824 ../fish/guestfish-actions.pod:2598
10946 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10951 #: ../src/guestfs-actions.pod:3827 ../fish/guestfish-actions.pod:2601
10953 "This returns a list of the logical volume device names (eg. C</dev/"
10954 "VolGroup00/LogVol00>)."
10958 #: ../src/guestfs-actions.pod:3830
10959 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
10963 #: ../src/guestfs-actions.pod:3838
10964 msgid "guestfs_lvs_full"
10968 #: ../src/guestfs-actions.pod:3840
10971 " struct guestfs_lvm_lv_list *\n"
10972 " guestfs_lvs_full (guestfs_h *g);\n"
10977 #: ../src/guestfs-actions.pod:3843 ../fish/guestfish-actions.pod:2610
10979 "List all the logical volumes detected. This is the equivalent of the L<lvs"
10980 "(8)> command. The \"full\" version includes all fields."
10984 #: ../src/guestfs-actions.pod:3846
10986 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
10987 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after use>."
10991 #: ../src/guestfs-actions.pod:3852
10992 msgid "guestfs_lvuuid"
10996 #: ../src/guestfs-actions.pod:3854
11000 " guestfs_lvuuid (guestfs_h *g,\n"
11001 " const char *device);\n"
11006 #: ../src/guestfs-actions.pod:3858 ../fish/guestfish-actions.pod:2617
11007 msgid "This command returns the UUID of the LVM LV C<device>."
11011 #: ../src/guestfs-actions.pod:3865
11012 msgid "guestfs_lxattrlist"
11016 #: ../src/guestfs-actions.pod:3867
11019 " struct guestfs_xattr_list *\n"
11020 " guestfs_lxattrlist (guestfs_h *g,\n"
11021 " const char *path,\n"
11022 " char *const *names);\n"
11027 #: ../src/guestfs-actions.pod:3872 ../fish/guestfish-actions.pod:2623
11029 "This call allows you to get the extended attributes of multiple files, where "
11030 "all files are in the directory C<path>. C<names> is the list of files from "
11035 #: ../src/guestfs-actions.pod:3876 ../fish/guestfish-actions.pod:2627
11037 "On return you get a flat list of xattr structs which must be interpreted "
11038 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11039 "C<attrval> in this struct is zero-length to indicate there was an error "
11040 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11041 "number (the number of following attributes for this file, which could be C<"
11042 "\"0\">). Then after the first xattr struct are the zero or more attributes "
11043 "for the first named file. This repeats for the second and subsequent files."
11047 #: ../src/guestfs-actions.pod:3886
11049 "This call is intended for programs that want to efficiently list a directory "
11050 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
11051 "a similarly efficient call for getting standard stats. Very long directory "
11052 "listings might cause the protocol message size to be exceeded, causing this "
11053 "call to fail. The caller must split up such requests into smaller groups of "
11058 #: ../src/guestfs-actions.pod:3900
11059 msgid "guestfs_mkdir"
11063 #: ../src/guestfs-actions.pod:3902
11067 " guestfs_mkdir (guestfs_h *g,\n"
11068 " const char *path);\n"
11073 #: ../src/guestfs-actions.pod:3906 ../fish/guestfish-actions.pod:2649
11074 msgid "Create a directory named C<path>."
11078 #: ../src/guestfs-actions.pod:3912
11079 msgid "guestfs_mkdir_mode"
11083 #: ../src/guestfs-actions.pod:3914
11087 " guestfs_mkdir_mode (guestfs_h *g,\n"
11088 " const char *path,\n"
11094 #: ../src/guestfs-actions.pod:3919 ../fish/guestfish-actions.pod:2655
11096 "This command creates a directory, setting the initial permissions of the "
11097 "directory to C<mode>."
11101 #: ../src/guestfs-actions.pod:3922 ../fish/guestfish-actions.pod:2658
11103 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11104 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11109 #: ../src/guestfs-actions.pod:3926
11110 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
11114 #: ../src/guestfs-actions.pod:3932
11115 msgid "guestfs_mkdir_p"
11119 #: ../src/guestfs-actions.pod:3934
11123 " guestfs_mkdir_p (guestfs_h *g,\n"
11124 " const char *path);\n"
11129 #: ../src/guestfs-actions.pod:3938 ../fish/guestfish-actions.pod:2668
11131 "Create a directory named C<path>, creating any parent directories as "
11132 "necessary. This is like the C<mkdir -p> shell command."
11136 #: ../src/guestfs-actions.pod:3945
11137 msgid "guestfs_mkdtemp"
11141 #: ../src/guestfs-actions.pod:3947
11145 " guestfs_mkdtemp (guestfs_h *g,\n"
11146 " const char *template);\n"
11151 #: ../src/guestfs-actions.pod:3951 ../fish/guestfish-actions.pod:2675
11153 "This command creates a temporary directory. The C<template> parameter "
11154 "should be a full pathname for the temporary directory name with the final "
11155 "six characters being \"XXXXXX\"."
11159 #: ../src/guestfs-actions.pod:3956 ../fish/guestfish-actions.pod:2680
11161 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11162 "being suitable for Windows filesystems."
11166 #: ../src/guestfs-actions.pod:3959 ../fish/guestfish-actions.pod:2683
11167 msgid "The name of the temporary directory that was created is returned."
11171 #: ../src/guestfs-actions.pod:3962 ../fish/guestfish-actions.pod:2686
11172 msgid "The temporary directory is created with mode 0700 and is owned by root."
11176 #: ../src/guestfs-actions.pod:3965 ../fish/guestfish-actions.pod:2689
11178 "The caller is responsible for deleting the temporary directory and its "
11179 "contents after use."
11183 #: ../src/guestfs-actions.pod:3968 ../fish/guestfish-actions.pod:2692
11184 msgid "See also: L<mkdtemp(3)>"
11188 #: ../src/guestfs-actions.pod:3975
11189 msgid "guestfs_mke2fs_J"
11193 #: ../src/guestfs-actions.pod:3977
11197 " guestfs_mke2fs_J (guestfs_h *g,\n"
11198 " const char *fstype,\n"
11199 " int blocksize,\n"
11200 " const char *device,\n"
11201 " const char *journal);\n"
11206 #: ../src/guestfs-actions.pod:3984 ../fish/guestfish-actions.pod:2698
11208 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11209 "C<journal>. It is equivalent to the command:"
11213 #: ../src/guestfs-actions.pod:3988 ../fish/guestfish-actions.pod:2702
11216 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11221 #: ../src/guestfs-actions.pod:3990
11222 msgid "See also C<guestfs_mke2journal>."
11226 #: ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4012
11227 #: ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4046
11228 #: ../src/guestfs-actions.pod:4060 ../src/guestfs-actions.pod:4074
11229 #: ../src/guestfs-actions.pod:4133 ../src/guestfs-actions.pod:4382
11230 msgid "(Added in 1.0.68)"
11234 #: ../src/guestfs-actions.pod:3996
11235 msgid "guestfs_mke2fs_JL"
11239 #: ../src/guestfs-actions.pod:3998
11243 " guestfs_mke2fs_JL (guestfs_h *g,\n"
11244 " const char *fstype,\n"
11245 " int blocksize,\n"
11246 " const char *device,\n"
11247 " const char *label);\n"
11252 #: ../src/guestfs-actions.pod:4005 ../fish/guestfish-actions.pod:2710
11254 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11255 "the journal labeled C<label>."
11259 #: ../src/guestfs-actions.pod:4008
11260 msgid "See also C<guestfs_mke2journal_L>."
11264 #: ../src/guestfs-actions.pod:4014
11265 msgid "guestfs_mke2fs_JU"
11269 #: ../src/guestfs-actions.pod:4016
11273 " guestfs_mke2fs_JU (guestfs_h *g,\n"
11274 " const char *fstype,\n"
11275 " int blocksize,\n"
11276 " const char *device,\n"
11277 " const char *uuid);\n"
11282 #: ../src/guestfs-actions.pod:4023 ../fish/guestfish-actions.pod:2719
11284 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11285 "the journal with UUID C<uuid>."
11289 #: ../src/guestfs-actions.pod:4026
11290 msgid "See also C<guestfs_mke2journal_U>."
11294 #: ../src/guestfs-actions.pod:4032
11295 msgid "guestfs_mke2journal"
11299 #: ../src/guestfs-actions.pod:4034
11303 " guestfs_mke2journal (guestfs_h *g,\n"
11304 " int blocksize,\n"
11305 " const char *device);\n"
11310 #: ../src/guestfs-actions.pod:4039 ../fish/guestfish-actions.pod:2728
11312 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11317 #: ../src/guestfs-actions.pod:4042 ../fish/guestfish-actions.pod:2731
11320 " mke2fs -O journal_dev -b blocksize device\n"
11325 #: ../src/guestfs-actions.pod:4048
11326 msgid "guestfs_mke2journal_L"
11330 #: ../src/guestfs-actions.pod:4050
11334 " guestfs_mke2journal_L (guestfs_h *g,\n"
11335 " int blocksize,\n"
11336 " const char *label,\n"
11337 " const char *device);\n"
11342 #: ../src/guestfs-actions.pod:4056 ../fish/guestfish-actions.pod:2737
11343 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11347 #: ../src/guestfs-actions.pod:4062
11348 msgid "guestfs_mke2journal_U"
11352 #: ../src/guestfs-actions.pod:4064
11356 " guestfs_mke2journal_U (guestfs_h *g,\n"
11357 " int blocksize,\n"
11358 " const char *uuid,\n"
11359 " const char *device);\n"
11364 #: ../src/guestfs-actions.pod:4070 ../fish/guestfish-actions.pod:2743
11365 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11369 #: ../src/guestfs-actions.pod:4076
11370 msgid "guestfs_mkfifo"
11374 #: ../src/guestfs-actions.pod:4078
11378 " guestfs_mkfifo (guestfs_h *g,\n"
11380 " const char *path);\n"
11385 #: ../src/guestfs-actions.pod:4083
11387 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11388 "is just a convenient wrapper around C<guestfs_mknod>."
11392 #: ../src/guestfs-actions.pod:4093
11393 msgid "guestfs_mkfs"
11397 #: ../src/guestfs-actions.pod:4095
11401 " guestfs_mkfs (guestfs_h *g,\n"
11402 " const char *fstype,\n"
11403 " const char *device);\n"
11408 #: ../src/guestfs-actions.pod:4100 ../fish/guestfish-actions.pod:2759
11410 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11411 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11415 #: ../src/guestfs-actions.pod:4108
11416 msgid "guestfs_mkfs_b"
11420 #: ../src/guestfs-actions.pod:4110
11424 " guestfs_mkfs_b (guestfs_h *g,\n"
11425 " const char *fstype,\n"
11426 " int blocksize,\n"
11427 " const char *device);\n"
11432 #: ../src/guestfs-actions.pod:4116
11434 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
11435 "block size of the resulting filesystem. Supported block sizes depend on the "
11436 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11440 #: ../src/guestfs-actions.pod:4121 ../src/guestfs-actions.pod:4163
11441 #: ../fish/guestfish-actions.pod:2772 ../fish/guestfish-actions.pod:2799
11443 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11448 #: ../src/guestfs-actions.pod:4126 ../fish/guestfish-actions.pod:2775
11450 "This function is deprecated. In new code, use the C<mkfs_opts> call instead."
11454 #: ../src/guestfs-actions.pod:4135
11455 msgid "guestfs_mkfs_opts"
11459 #: ../src/guestfs-actions.pod:4137
11463 " guestfs_mkfs_opts (guestfs_h *g,\n"
11464 " const char *fstype,\n"
11465 " const char *device,\n"
11471 #: ../src/guestfs-actions.pod:4148
11474 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
11479 #: ../src/guestfs-actions.pod:4150 ../fish/guestfish-actions.pod:2786
11481 "This function creates a filesystem on C<device>. The filesystem type is "
11482 "C<fstype>, for example C<ext3>."
11486 #: ../src/guestfs-actions.pod:4157 ../fish/guestfish-actions.pod:2793
11487 msgid "C<blocksize>"
11491 #: ../src/guestfs-actions.pod:4159 ../fish/guestfish-actions.pod:2795
11493 "The filesystem block size. Supported block sizes depend on the filesystem "
11494 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11499 #: ../src/guestfs-actions.pod:4170
11500 msgid "guestfs_mkfs_opts_va"
11504 #: ../src/guestfs-actions.pod:4172
11508 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
11509 " const char *fstype,\n"
11510 " const char *device,\n"
11511 " va_list args);\n"
11516 #: ../src/guestfs-actions.pod:4178
11517 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
11521 #: ../src/guestfs-actions.pod:4182
11522 msgid "guestfs_mkfs_opts_argv"
11526 #: ../src/guestfs-actions.pod:4184
11530 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
11531 " const char *fstype,\n"
11532 " const char *device,\n"
11533 " const struct guestfs_mkfs_opts_argv *optargs);\n"
11538 #: ../src/guestfs-actions.pod:4190
11539 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
11543 #: ../src/guestfs-actions.pod:4194
11544 msgid "guestfs_mkmountpoint"
11548 #: ../src/guestfs-actions.pod:4196
11552 " guestfs_mkmountpoint (guestfs_h *g,\n"
11553 " const char *exemptpath);\n"
11558 #: ../src/guestfs-actions.pod:4200
11560 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
11561 "that can be used to create extra mountpoints before mounting the first "
11566 #: ../src/guestfs-actions.pod:4204 ../fish/guestfish-actions.pod:2814
11568 "These calls are I<only> necessary in some very limited circumstances, mainly "
11569 "the case where you want to mount a mix of unrelated and/or read-only "
11570 "filesystems together."
11574 #: ../src/guestfs-actions.pod:4208 ../fish/guestfish-actions.pod:2818
11576 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11577 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11578 "inside that. You can unpack this as follows in guestfish:"
11582 #: ../src/guestfs-actions.pod:4213 ../fish/guestfish-actions.pod:2823
11585 " add-ro Fedora-11-i686-Live.iso\n"
11587 " mkmountpoint /cd\n"
11588 " mkmountpoint /sqsh\n"
11589 " mkmountpoint /ext3fs\n"
11590 " mount /dev/sda /cd\n"
11591 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11592 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11597 #: ../src/guestfs-actions.pod:4222 ../fish/guestfish-actions.pod:2832
11598 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11602 #: ../src/guestfs-actions.pod:4224
11604 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
11605 "may get unexpected errors if you try to mix these calls. It is safest to "
11606 "manually unmount filesystems and remove mountpoints after use."
11610 #: ../src/guestfs-actions.pod:4228
11612 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
11613 "first, so for this to work for manual mountpoints, you must ensure that the "
11614 "innermost mountpoints have the longest pathnames, as in the example code "
11619 #: ../src/guestfs-actions.pod:4233 ../fish/guestfish-actions.pod:2843
11621 "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11625 #: ../src/guestfs-actions.pod:4235
11627 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
11628 "means that C<guestfs_umount_all> is called when the handle is closed which "
11629 "can also trigger these issues."
11633 #: ../src/guestfs-actions.pod:4241 ../src/guestfs-actions.pod:4500
11634 #: ../src/guestfs-actions.pod:5393
11635 msgid "(Added in 1.0.62)"
11639 #: ../src/guestfs-actions.pod:4243
11640 msgid "guestfs_mknod"
11644 #: ../src/guestfs-actions.pod:4245
11648 " guestfs_mknod (guestfs_h *g,\n"
11652 " const char *path);\n"
11657 #: ../src/guestfs-actions.pod:4252 ../fish/guestfish-actions.pod:2853
11659 "This call creates block or character special devices, or named pipes (FIFOs)."
11663 #: ../src/guestfs-actions.pod:4255 ../fish/guestfish-actions.pod:2856
11665 "The C<mode> parameter should be the mode, using the standard constants. "
11666 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11667 "used when creating block and character special devices."
11671 #: ../src/guestfs-actions.pod:4260
11673 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11674 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11675 "regular file). These constants are available in the standard Linux header "
11676 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
11677 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
11678 "the appropriate constant for you."
11682 #: ../src/guestfs-actions.pod:4274
11683 msgid "guestfs_mknod_b"
11687 #: ../src/guestfs-actions.pod:4276
11691 " guestfs_mknod_b (guestfs_h *g,\n"
11695 " const char *path);\n"
11700 #: ../src/guestfs-actions.pod:4283
11702 "This call creates a block device node called C<path> with mode C<mode> and "
11703 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11704 "wrapper around C<guestfs_mknod>."
11708 #: ../src/guestfs-actions.pod:4293
11709 msgid "guestfs_mknod_c"
11713 #: ../src/guestfs-actions.pod:4295
11717 " guestfs_mknod_c (guestfs_h *g,\n"
11721 " const char *path);\n"
11726 #: ../src/guestfs-actions.pod:4302
11728 "This call creates a char device node called C<path> with mode C<mode> and "
11729 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11730 "wrapper around C<guestfs_mknod>."
11734 #: ../src/guestfs-actions.pod:4312
11735 msgid "guestfs_mkswap"
11739 #: ../src/guestfs-actions.pod:4314
11743 " guestfs_mkswap (guestfs_h *g,\n"
11744 " const char *device);\n"
11749 #: ../src/guestfs-actions.pod:4318 ../fish/guestfish-actions.pod:2895
11750 msgid "Create a swap partition on C<device>."
11754 #: ../src/guestfs-actions.pod:4324
11755 msgid "guestfs_mkswap_L"
11759 #: ../src/guestfs-actions.pod:4326
11763 " guestfs_mkswap_L (guestfs_h *g,\n"
11764 " const char *label,\n"
11765 " const char *device);\n"
11770 #: ../src/guestfs-actions.pod:4331 ../fish/guestfish-actions.pod:2901
11771 msgid "Create a swap partition on C<device> with label C<label>."
11775 #: ../src/guestfs-actions.pod:4333 ../fish/guestfish-actions.pod:2903
11777 "Note that you cannot attach a swap label to a block device (eg. C</dev/"
11778 "sda>), just to a partition. This appears to be a limitation of the kernel "
11783 #: ../src/guestfs-actions.pod:4341
11784 msgid "guestfs_mkswap_U"
11788 #: ../src/guestfs-actions.pod:4343
11792 " guestfs_mkswap_U (guestfs_h *g,\n"
11793 " const char *uuid,\n"
11794 " const char *device);\n"
11799 #: ../src/guestfs-actions.pod:4348 ../fish/guestfish-actions.pod:2911
11800 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11804 #: ../src/guestfs-actions.pod:4354
11805 msgid "guestfs_mkswap_file"
11809 #: ../src/guestfs-actions.pod:4356
11813 " guestfs_mkswap_file (guestfs_h *g,\n"
11814 " const char *path);\n"
11819 #: ../src/guestfs-actions.pod:4360 ../fish/guestfish-actions.pod:2917
11820 msgid "Create a swap file."
11824 #: ../src/guestfs-actions.pod:4362
11826 "This command just writes a swap file signature to an existing file. To "
11827 "create the file itself, use something like C<guestfs_fallocate>."
11831 #: ../src/guestfs-actions.pod:4369
11832 msgid "guestfs_modprobe"
11836 #: ../src/guestfs-actions.pod:4371
11840 " guestfs_modprobe (guestfs_h *g,\n"
11841 " const char *modulename);\n"
11846 #: ../src/guestfs-actions.pod:4375 ../fish/guestfish-actions.pod:2926
11847 msgid "This loads a kernel module in the appliance."
11851 #: ../src/guestfs-actions.pod:4377 ../fish/guestfish-actions.pod:2928
11853 "The kernel module must have been whitelisted when libguestfs was built (see "
11854 "C<appliance/kmod.whitelist.in> in the source)."
11858 #: ../src/guestfs-actions.pod:4384
11859 msgid "guestfs_mount"
11863 #: ../src/guestfs-actions.pod:4386
11867 " guestfs_mount (guestfs_h *g,\n"
11868 " const char *device,\n"
11869 " const char *mountpoint);\n"
11874 #: ../src/guestfs-actions.pod:4391 ../fish/guestfish-actions.pod:2935
11876 "Mount a guest disk at a position in the filesystem. Block devices are named "
11877 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
11878 "those block devices contain partitions, they will have the usual names (eg. "
11879 "C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
11883 #: ../src/guestfs-actions.pod:4397 ../fish/guestfish-actions.pod:2941
11885 "The rules are the same as for L<mount(2)>: A filesystem must first be "
11886 "mounted on C</> before others can be mounted. Other filesystems can only be "
11887 "mounted on directories which already exist."
11891 #: ../src/guestfs-actions.pod:4402 ../fish/guestfish-actions.pod:2946
11893 "The mounted filesystem is writable, if we have sufficient permissions on the "
11894 "underlying device."
11898 #: ../src/guestfs-actions.pod:4405
11900 "B<Important note:> When you use this call, the filesystem options C<sync> "
11901 "and C<noatime> are set implicitly. This was originally done because we "
11902 "thought it would improve reliability, but it turns out that I<-o sync> has a "
11903 "very large negative performance impact and negligible effect on "
11904 "reliability. Therefore we recommend that you avoid using C<guestfs_mount> "
11905 "in any code that needs performance, and instead use C<guestfs_mount_options> "
11906 "(use an empty string for the first parameter if you don't want any options)."
11910 #: ../src/guestfs-actions.pod:4419
11911 msgid "guestfs_mount_loop"
11915 #: ../src/guestfs-actions.pod:4421
11919 " guestfs_mount_loop (guestfs_h *g,\n"
11920 " const char *file,\n"
11921 " const char *mountpoint);\n"
11926 #: ../src/guestfs-actions.pod:4426 ../fish/guestfish-actions.pod:2963
11928 "This command lets you mount C<file> (a filesystem image in a file) on a "
11929 "mount point. It is entirely equivalent to the command C<mount -o loop file "
11934 #: ../src/guestfs-actions.pod:4434
11935 msgid "guestfs_mount_options"
11939 #: ../src/guestfs-actions.pod:4436
11943 " guestfs_mount_options (guestfs_h *g,\n"
11944 " const char *options,\n"
11945 " const char *device,\n"
11946 " const char *mountpoint);\n"
11951 #: ../src/guestfs-actions.pod:4442
11953 "This is the same as the C<guestfs_mount> command, but it allows you to set "
11954 "the mount options as for the L<mount(8)> I<-o> flag."
11958 #: ../src/guestfs-actions.pod:4446 ../fish/guestfish-actions.pod:2975
11960 "If the C<options> parameter is an empty string, then no options are passed "
11961 "(all options default to whatever the filesystem uses)."
11965 #: ../src/guestfs-actions.pod:4452 ../src/guestfs-actions.pod:4466
11966 #: ../src/guestfs-actions.pod:4483
11967 msgid "(Added in 1.0.10)"
11971 #: ../src/guestfs-actions.pod:4454
11972 msgid "guestfs_mount_ro"
11976 #: ../src/guestfs-actions.pod:4456
11980 " guestfs_mount_ro (guestfs_h *g,\n"
11981 " const char *device,\n"
11982 " const char *mountpoint);\n"
11987 #: ../src/guestfs-actions.pod:4461
11989 "This is the same as the C<guestfs_mount> command, but it mounts the "
11990 "filesystem with the read-only (I<-o ro>) flag."
11994 #: ../src/guestfs-actions.pod:4468
11995 msgid "guestfs_mount_vfs"
11999 #: ../src/guestfs-actions.pod:4470
12003 " guestfs_mount_vfs (guestfs_h *g,\n"
12004 " const char *options,\n"
12005 " const char *vfstype,\n"
12006 " const char *device,\n"
12007 " const char *mountpoint);\n"
12012 #: ../src/guestfs-actions.pod:4477
12014 "This is the same as the C<guestfs_mount> command, but it allows you to set "
12015 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and I<-"
12020 #: ../src/guestfs-actions.pod:4485
12021 msgid "guestfs_mountpoints"
12025 #: ../src/guestfs-actions.pod:4487
12029 " guestfs_mountpoints (guestfs_h *g);\n"
12034 #: ../src/guestfs-actions.pod:4490
12036 "This call is similar to C<guestfs_mounts>. That call returns a list of "
12037 "devices. This one returns a hash table (map) of device name to directory "
12038 "where the device is mounted."
12042 #: ../src/guestfs-actions.pod:4502
12043 msgid "guestfs_mounts"
12047 #: ../src/guestfs-actions.pod:4504
12051 " guestfs_mounts (guestfs_h *g);\n"
12056 #: ../src/guestfs-actions.pod:4507 ../fish/guestfish-actions.pod:3006
12058 "This returns the list of currently mounted filesystems. It returns the list "
12059 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12063 #: ../src/guestfs-actions.pod:4510 ../fish/guestfish-actions.pod:3009
12064 msgid "Some internal mounts are not shown."
12068 #: ../src/guestfs-actions.pod:4512
12069 msgid "See also: C<guestfs_mountpoints>"
12073 #: ../src/guestfs-actions.pod:4520
12078 #: ../src/guestfs-actions.pod:4522
12082 " guestfs_mv (guestfs_h *g,\n"
12083 " const char *src,\n"
12084 " const char *dest);\n"
12089 #: ../src/guestfs-actions.pod:4527 ../fish/guestfish-actions.pod:3017
12091 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12092 "destination filename or destination directory."
12096 #: ../src/guestfs-actions.pod:4534
12097 msgid "guestfs_ntfs_3g_probe"
12101 #: ../src/guestfs-actions.pod:4536
12105 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
12107 " const char *device);\n"
12112 #: ../src/guestfs-actions.pod:4541 ../fish/guestfish-actions.pod:3024
12114 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12115 "C<device> for mountability. (Not all NTFS volumes can be mounted read-"
12116 "write, and some cannot be mounted at all)."
12120 #: ../src/guestfs-actions.pod:4545 ../fish/guestfish-actions.pod:3028
12122 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12123 "can be mounted read-write. Set it to false if you want to test if the "
12124 "volume can be mounted read-only."
12128 #: ../src/guestfs-actions.pod:4549 ../fish/guestfish-actions.pod:3032
12130 "The return value is an integer which C<0> if the operation would succeed, or "
12131 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12135 #: ../src/guestfs-actions.pod:4555
12136 msgid "(Added in 1.0.43)"
12140 #: ../src/guestfs-actions.pod:4557
12141 msgid "guestfs_ntfsresize"
12145 #: ../src/guestfs-actions.pod:4559
12149 " guestfs_ntfsresize (guestfs_h *g,\n"
12150 " const char *device);\n"
12155 #: ../src/guestfs-actions.pod:4563 ../fish/guestfish-actions.pod:3040
12157 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12158 "size of the underlying device. See also L<ntfsresize(8)>."
12162 #: ../src/guestfs-actions.pod:4571
12163 msgid "guestfs_ntfsresize_size"
12167 #: ../src/guestfs-actions.pod:4573
12171 " guestfs_ntfsresize_size (guestfs_h *g,\n"
12172 " const char *device,\n"
12173 " int64_t size);\n"
12178 #: ../src/guestfs-actions.pod:4578
12180 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
12181 "to specify the new size (in bytes) explicitly."
12185 #: ../src/guestfs-actions.pod:4583 ../src/guestfs-actions.pod:5019
12186 #: ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5341
12187 msgid "(Added in 1.3.14)"
12191 #: ../src/guestfs-actions.pod:4585
12192 msgid "guestfs_part_add"
12196 #: ../src/guestfs-actions.pod:4587
12200 " guestfs_part_add (guestfs_h *g,\n"
12201 " const char *device,\n"
12202 " const char *prlogex,\n"
12203 " int64_t startsect,\n"
12204 " int64_t endsect);\n"
12209 #: ../src/guestfs-actions.pod:4594
12211 "This command adds a partition to C<device>. If there is no partition table "
12212 "on the device, call C<guestfs_part_init> first."
12216 #: ../src/guestfs-actions.pod:4597 ../fish/guestfish-actions.pod:3058
12218 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12219 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12220 "C<logical>) and C<e> (or C<extended>) partition types."
12224 #: ../src/guestfs-actions.pod:4602 ../fish/guestfish-actions.pod:3063
12226 "C<startsect> and C<endsect> are the start and end of the partition in "
12227 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12228 "from the end of the disk (C<-1> is the last sector)."
12232 #: ../src/guestfs-actions.pod:4606
12234 "Creating a partition which covers the whole disk is not so easy. Use "
12235 "C<guestfs_part_disk> to do that."
12239 #: ../src/guestfs-actions.pod:4611 ../src/guestfs-actions.pod:4649
12240 #: ../src/guestfs-actions.pod:4702 ../src/guestfs-actions.pod:4780
12241 #: ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:4837
12242 #: ../src/guestfs-actions.pod:4877
12243 msgid "(Added in 1.0.78)"
12247 #: ../src/guestfs-actions.pod:4613
12248 msgid "guestfs_part_del"
12252 #: ../src/guestfs-actions.pod:4615
12256 " guestfs_part_del (guestfs_h *g,\n"
12257 " const char *device,\n"
12263 #: ../src/guestfs-actions.pod:4620 ../fish/guestfish-actions.pod:3074
12264 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12268 #: ../src/guestfs-actions.pod:4622 ../fish/guestfish-actions.pod:3076
12270 "Note that in the case of MBR partitioning, deleting an extended partition "
12271 "also deletes any logical partitions it contains."
12275 #: ../src/guestfs-actions.pod:4630
12276 msgid "guestfs_part_disk"
12280 #: ../src/guestfs-actions.pod:4632
12284 " guestfs_part_disk (guestfs_h *g,\n"
12285 " const char *device,\n"
12286 " const char *parttype);\n"
12291 #: ../src/guestfs-actions.pod:4637
12293 "This command is simply a combination of C<guestfs_part_init> followed by "
12294 "C<guestfs_part_add> to create a single primary partition covering the whole "
12299 #: ../src/guestfs-actions.pod:4641
12301 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12302 "possible values are described in C<guestfs_part_init>."
12306 #: ../src/guestfs-actions.pod:4651
12307 msgid "guestfs_part_get_bootable"
12311 #: ../src/guestfs-actions.pod:4653
12315 " guestfs_part_get_bootable (guestfs_h *g,\n"
12316 " const char *device,\n"
12322 #: ../src/guestfs-actions.pod:4658 ../fish/guestfish-actions.pod:3098
12324 "This command returns true if the partition C<partnum> on C<device> has the "
12325 "bootable flag set."
12329 #: ../src/guestfs-actions.pod:4661
12330 msgid "See also C<guestfs_part_set_bootable>."
12334 #: ../src/guestfs-actions.pod:4667
12335 msgid "guestfs_part_get_mbr_id"
12339 #: ../src/guestfs-actions.pod:4669
12343 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
12344 " const char *device,\n"
12350 #: ../src/guestfs-actions.pod:4674 ../fish/guestfish-actions.pod:3107
12352 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12353 "partition C<partnum>."
12357 #: ../src/guestfs-actions.pod:4677 ../src/guestfs-actions.pod:4853
12359 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12360 "undefined results for other partition table types (see "
12361 "C<guestfs_part_get_parttype>)."
12365 #: ../src/guestfs-actions.pod:4685
12366 msgid "guestfs_part_get_parttype"
12370 #: ../src/guestfs-actions.pod:4687
12374 " guestfs_part_get_parttype (guestfs_h *g,\n"
12375 " const char *device);\n"
12380 #: ../src/guestfs-actions.pod:4691 ../fish/guestfish-actions.pod:3118
12382 "This command examines the partition table on C<device> and returns the "
12383 "partition table type (format) being used."
12387 #: ../src/guestfs-actions.pod:4694
12389 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12390 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12391 "possible, although unusual. See C<guestfs_part_init> for a full list."
12395 #: ../src/guestfs-actions.pod:4704
12396 msgid "guestfs_part_init"
12400 #: ../src/guestfs-actions.pod:4706
12404 " guestfs_part_init (guestfs_h *g,\n"
12405 " const char *device,\n"
12406 " const char *parttype);\n"
12411 #: ../src/guestfs-actions.pod:4711 ../fish/guestfish-actions.pod:3130
12413 "This creates an empty partition table on C<device> of one of the partition "
12414 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12415 "(for large disks)."
12419 #: ../src/guestfs-actions.pod:4715
12421 "Initially there are no partitions. Following this, you should call "
12422 "C<guestfs_part_add> for each partition required."
12426 #: ../src/guestfs-actions.pod:4718 ../fish/guestfish-actions.pod:3137
12427 msgid "Possible values for C<parttype> are:"
12431 #: ../src/guestfs-actions.pod:4722 ../fish/guestfish-actions.pod:3141
12432 msgid "B<efi> | B<gpt>"
12436 #: ../src/guestfs-actions.pod:4724 ../fish/guestfish-actions.pod:3143
12437 msgid "Intel EFI / GPT partition table."
12441 #: ../src/guestfs-actions.pod:4726 ../fish/guestfish-actions.pod:3145
12443 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12444 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12445 "the C<mbr> format."
12449 #: ../src/guestfs-actions.pod:4730 ../fish/guestfish-actions.pod:3149
12450 msgid "B<mbr> | B<msdos>"
12454 #: ../src/guestfs-actions.pod:4732 ../fish/guestfish-actions.pod:3151
12456 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12457 "Windows. This partition type will B<only> work for device sizes up to 2 "
12458 "TB. For large disks we recommend using C<gpt>."
12462 #: ../src/guestfs-actions.pod:4739 ../fish/guestfish-actions.pod:3158
12464 "Other partition table types that may work but are not supported include:"
12468 #: ../src/guestfs-actions.pod:4744 ../fish/guestfish-actions.pod:3163
12473 #: ../src/guestfs-actions.pod:4746 ../fish/guestfish-actions.pod:3165
12474 msgid "AIX disk labels."
12478 #: ../src/guestfs-actions.pod:4748 ../fish/guestfish-actions.pod:3167
12479 msgid "B<amiga> | B<rdb>"
12483 #: ../src/guestfs-actions.pod:4750 ../fish/guestfish-actions.pod:3169
12484 msgid "Amiga \"Rigid Disk Block\" format."
12488 #: ../src/guestfs-actions.pod:4752 ../fish/guestfish-actions.pod:3171
12493 #: ../src/guestfs-actions.pod:4754 ../fish/guestfish-actions.pod:3173
12494 msgid "BSD disk labels."
12498 #: ../src/guestfs-actions.pod:4756 ../fish/guestfish-actions.pod:3175
12503 #: ../src/guestfs-actions.pod:4758 ../fish/guestfish-actions.pod:3177
12504 msgid "DASD, used on IBM mainframes."
12508 #: ../src/guestfs-actions.pod:4760 ../fish/guestfish-actions.pod:3179
12513 #: ../src/guestfs-actions.pod:4762 ../fish/guestfish-actions.pod:3181
12514 msgid "MIPS/SGI volumes."
12518 #: ../src/guestfs-actions.pod:4764 ../fish/guestfish-actions.pod:3183
12523 #: ../src/guestfs-actions.pod:4766 ../fish/guestfish-actions.pod:3185
12524 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12528 #: ../src/guestfs-actions.pod:4768 ../fish/guestfish-actions.pod:3187
12533 #: ../src/guestfs-actions.pod:4770 ../fish/guestfish-actions.pod:3189
12534 msgid "NEC PC-98 format, common in Japan apparently."
12538 #: ../src/guestfs-actions.pod:4772 ../fish/guestfish-actions.pod:3191
12543 #: ../src/guestfs-actions.pod:4774 ../fish/guestfish-actions.pod:3193
12544 msgid "Sun disk labels."
12548 #: ../src/guestfs-actions.pod:4782
12549 msgid "guestfs_part_list"
12553 #: ../src/guestfs-actions.pod:4784
12556 " struct guestfs_partition_list *\n"
12557 " guestfs_part_list (guestfs_h *g,\n"
12558 " const char *device);\n"
12563 #: ../src/guestfs-actions.pod:4788 ../fish/guestfish-actions.pod:3201
12565 "This command parses the partition table on C<device> and returns the list of "
12566 "partitions found."
12570 #: ../src/guestfs-actions.pod:4791 ../fish/guestfish-actions.pod:3204
12571 msgid "The fields in the returned structure are:"
12575 #: ../src/guestfs-actions.pod:4795 ../fish/guestfish-actions.pod:3208
12576 msgid "B<part_num>"
12580 #: ../src/guestfs-actions.pod:4797 ../fish/guestfish-actions.pod:3210
12581 msgid "Partition number, counting from 1."
12585 #: ../src/guestfs-actions.pod:4799 ../fish/guestfish-actions.pod:3212
12586 msgid "B<part_start>"
12590 #: ../src/guestfs-actions.pod:4801
12592 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12593 "the device's sector size, see C<guestfs_blockdev_getss>."
12597 #: ../src/guestfs-actions.pod:4804 ../fish/guestfish-actions.pod:3217
12598 msgid "B<part_end>"
12602 #: ../src/guestfs-actions.pod:4806 ../fish/guestfish-actions.pod:3219
12603 msgid "End of the partition in bytes."
12607 #: ../src/guestfs-actions.pod:4808 ../fish/guestfish-actions.pod:3221
12608 msgid "B<part_size>"
12612 #: ../src/guestfs-actions.pod:4810 ../fish/guestfish-actions.pod:3223
12613 msgid "Size of the partition in bytes."
12617 #: ../src/guestfs-actions.pod:4814
12619 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
12620 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
12625 #: ../src/guestfs-actions.pod:4820
12626 msgid "guestfs_part_set_bootable"
12630 #: ../src/guestfs-actions.pod:4822
12634 " guestfs_part_set_bootable (guestfs_h *g,\n"
12635 " const char *device,\n"
12637 " int bootable);\n"
12642 #: ../src/guestfs-actions.pod:4828 ../fish/guestfish-actions.pod:3231
12644 "This sets the bootable flag on partition numbered C<partnum> on device "
12645 "C<device>. Note that partitions are numbered from 1."
12649 #: ../src/guestfs-actions.pod:4831 ../fish/guestfish-actions.pod:3234
12651 "The bootable flag is used by some operating systems (notably Windows) to "
12652 "determine which partition to boot from. It is by no means universally "
12657 #: ../src/guestfs-actions.pod:4839
12658 msgid "guestfs_part_set_mbr_id"
12662 #: ../src/guestfs-actions.pod:4841
12666 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
12667 " const char *device,\n"
12674 #: ../src/guestfs-actions.pod:4847 ../fish/guestfish-actions.pod:3242
12676 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12677 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12678 "documentation are in fact hexadecimal numbers, but usually documented "
12679 "without any leading \"0x\" which might be confusing."
12683 #: ../src/guestfs-actions.pod:4861
12684 msgid "guestfs_part_set_name"
12688 #: ../src/guestfs-actions.pod:4863
12692 " guestfs_part_set_name (guestfs_h *g,\n"
12693 " const char *device,\n"
12695 " const char *name);\n"
12700 #: ../src/guestfs-actions.pod:4869 ../fish/guestfish-actions.pod:3256
12702 "This sets the partition name on partition numbered C<partnum> on device "
12703 "C<device>. Note that partitions are numbered from 1."
12707 #: ../src/guestfs-actions.pod:4872 ../fish/guestfish-actions.pod:3259
12709 "The partition name can only be set on certain types of partition table. "
12710 "This works on C<gpt> but not on C<mbr> partitions."
12714 #: ../src/guestfs-actions.pod:4879
12715 msgid "guestfs_part_to_dev"
12719 #: ../src/guestfs-actions.pod:4881
12723 " guestfs_part_to_dev (guestfs_h *g,\n"
12724 " const char *partition);\n"
12729 #: ../src/guestfs-actions.pod:4885 ../fish/guestfish-actions.pod:3266
12731 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12732 "partition number, returning the device name (eg. \"/dev/sdb\")."
12736 #: ../src/guestfs-actions.pod:4889
12738 "The named partition must exist, for example as a string returned from "
12739 "C<guestfs_list_partitions>."
12743 #: ../src/guestfs-actions.pod:4897
12744 msgid "guestfs_ping_daemon"
12748 #: ../src/guestfs-actions.pod:4899
12752 " guestfs_ping_daemon (guestfs_h *g);\n"
12757 #: ../src/guestfs-actions.pod:4902 ../fish/guestfish-actions.pod:3277
12759 "This is a test probe into the guestfs daemon running inside the qemu "
12760 "subprocess. Calling this function checks that the daemon responds to the "
12761 "ping message, without affecting the daemon or attached block device(s) in "
12766 #: ../src/guestfs-actions.pod:4911
12767 msgid "guestfs_pread"
12771 #: ../src/guestfs-actions.pod:4913
12775 " guestfs_pread (guestfs_h *g,\n"
12776 " const char *path,\n"
12778 " int64_t offset,\n"
12779 " size_t *size_r);\n"
12784 #: ../src/guestfs-actions.pod:4920 ../fish/guestfish-actions.pod:3286
12786 "This command lets you read part of a file. It reads C<count> bytes of the "
12787 "file, starting at C<offset>, from file C<path>."
12791 #: ../src/guestfs-actions.pod:4923 ../src/guestfs-actions.pod:4949
12792 #: ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3304
12794 "This may read fewer bytes than requested. For further details see the "
12795 "L<pread(2)> system call."
12799 #: ../src/guestfs-actions.pod:4926
12800 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
12804 #: ../src/guestfs-actions.pod:4937
12805 msgid "guestfs_pread_device"
12809 #: ../src/guestfs-actions.pod:4939
12813 " guestfs_pread_device (guestfs_h *g,\n"
12814 " const char *device,\n"
12816 " int64_t offset,\n"
12817 " size_t *size_r);\n"
12822 #: ../src/guestfs-actions.pod:4946 ../fish/guestfish-actions.pod:3301
12824 "This command lets you read part of a file. It reads C<count> bytes of "
12825 "C<device>, starting at C<offset>."
12829 #: ../src/guestfs-actions.pod:4952
12830 msgid "See also C<guestfs_pread>."
12834 #: ../src/guestfs-actions.pod:4961
12835 msgid "(Added in 1.5.21)"
12839 #: ../src/guestfs-actions.pod:4963
12840 msgid "guestfs_pvcreate"
12844 #: ../src/guestfs-actions.pod:4965
12848 " guestfs_pvcreate (guestfs_h *g,\n"
12849 " const char *device);\n"
12854 #: ../src/guestfs-actions.pod:4969 ../fish/guestfish-actions.pod:3316
12856 "This creates an LVM physical volume on the named C<device>, where C<device> "
12857 "should usually be a partition name such as C</dev/sda1>."
12861 #: ../src/guestfs-actions.pod:4977
12862 msgid "guestfs_pvremove"
12866 #: ../src/guestfs-actions.pod:4979
12870 " guestfs_pvremove (guestfs_h *g,\n"
12871 " const char *device);\n"
12876 #: ../src/guestfs-actions.pod:4983 ../fish/guestfish-actions.pod:3324
12878 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12883 #: ../src/guestfs-actions.pod:4986 ../fish/guestfish-actions.pod:3327
12885 "The implementation uses the C<pvremove> command which refuses to wipe "
12886 "physical volumes that contain any volume groups, so you have to remove those "
12891 #: ../src/guestfs-actions.pod:4994
12892 msgid "guestfs_pvresize"
12896 #: ../src/guestfs-actions.pod:4996
12900 " guestfs_pvresize (guestfs_h *g,\n"
12901 " const char *device);\n"
12906 #: ../src/guestfs-actions.pod:5000 ../fish/guestfish-actions.pod:3335
12908 "This resizes (expands or shrinks) an existing LVM physical volume to match "
12909 "the new size of the underlying device."
12913 #: ../src/guestfs-actions.pod:5007
12914 msgid "guestfs_pvresize_size"
12918 #: ../src/guestfs-actions.pod:5009
12922 " guestfs_pvresize_size (guestfs_h *g,\n"
12923 " const char *device,\n"
12924 " int64_t size);\n"
12929 #: ../src/guestfs-actions.pod:5014
12931 "This command is the same as C<guestfs_pvresize> except that it allows you to "
12932 "specify the new size (in bytes) explicitly."
12936 #: ../src/guestfs-actions.pod:5021
12937 msgid "guestfs_pvs"
12941 #: ../src/guestfs-actions.pod:5023
12945 " guestfs_pvs (guestfs_h *g);\n"
12950 #: ../src/guestfs-actions.pod:5026 ../fish/guestfish-actions.pod:3349
12952 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12957 #: ../src/guestfs-actions.pod:5029 ../fish/guestfish-actions.pod:3352
12959 "This returns a list of just the device names that contain PVs (eg. C</dev/"
12964 #: ../src/guestfs-actions.pod:5032
12965 msgid "See also C<guestfs_pvs_full>."
12969 #: ../src/guestfs-actions.pod:5040
12970 msgid "guestfs_pvs_full"
12974 #: ../src/guestfs-actions.pod:5042
12977 " struct guestfs_lvm_pv_list *\n"
12978 " guestfs_pvs_full (guestfs_h *g);\n"
12983 #: ../src/guestfs-actions.pod:5045 ../fish/guestfish-actions.pod:3361
12985 "List all the physical volumes detected. This is the equivalent of the L<pvs"
12986 "(8)> command. The \"full\" version includes all fields."
12990 #: ../src/guestfs-actions.pod:5048
12992 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
12993 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after use>."
12997 #: ../src/guestfs-actions.pod:5054
12998 msgid "guestfs_pvuuid"
13002 #: ../src/guestfs-actions.pod:5056
13006 " guestfs_pvuuid (guestfs_h *g,\n"
13007 " const char *device);\n"
13012 #: ../src/guestfs-actions.pod:5060 ../fish/guestfish-actions.pod:3368
13013 msgid "This command returns the UUID of the LVM PV C<device>."
13017 #: ../src/guestfs-actions.pod:5067
13018 msgid "guestfs_pwrite"
13022 #: ../src/guestfs-actions.pod:5069
13026 " guestfs_pwrite (guestfs_h *g,\n"
13027 " const char *path,\n"
13028 " const char *content,\n"
13029 " size_t content_size,\n"
13030 " int64_t offset);\n"
13035 #: ../src/guestfs-actions.pod:5076 ../fish/guestfish-actions.pod:3374
13037 "This command writes to part of a file. It writes the data buffer C<content> "
13038 "to the file C<path> starting at offset C<offset>."
13042 #: ../src/guestfs-actions.pod:5079 ../fish/guestfish-actions.pod:3377
13044 "This command implements the L<pwrite(2)> system call, and like that system "
13045 "call it may not write the full data requested. The return value is the "
13046 "number of bytes that were actually written to the file. This could even be "
13047 "0, although short writes are unlikely for regular files in ordinary "
13052 #: ../src/guestfs-actions.pod:5085
13053 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
13057 #: ../src/guestfs-actions.pod:5094
13058 msgid "guestfs_pwrite_device"
13062 #: ../src/guestfs-actions.pod:5096
13066 " guestfs_pwrite_device (guestfs_h *g,\n"
13067 " const char *device,\n"
13068 " const char *content,\n"
13069 " size_t content_size,\n"
13070 " int64_t offset);\n"
13075 #: ../src/guestfs-actions.pod:5103 ../fish/guestfish-actions.pod:3392
13077 "This command writes to part of a device. It writes the data buffer "
13078 "C<content> to C<device> starting at offset C<offset>."
13082 #: ../src/guestfs-actions.pod:5106 ../fish/guestfish-actions.pod:3395
13084 "This command implements the L<pwrite(2)> system call, and like that system "
13085 "call it may not write the full data requested (although short writes to disk "
13086 "devices and partitions are probably impossible with standard Linux kernels)."
13090 #: ../src/guestfs-actions.pod:5111
13091 msgid "See also C<guestfs_pwrite>."
13095 #: ../src/guestfs-actions.pod:5118
13096 msgid "(Added in 1.5.20)"
13100 #: ../src/guestfs-actions.pod:5120
13101 msgid "guestfs_read_file"
13105 #: ../src/guestfs-actions.pod:5122
13109 " guestfs_read_file (guestfs_h *g,\n"
13110 " const char *path,\n"
13111 " size_t *size_r);\n"
13116 #: ../src/guestfs-actions.pod:5127 ../fish/guestfish-actions.pod:3409
13117 msgid "This calls returns the contents of the file C<path> as a buffer."
13121 #: ../src/guestfs-actions.pod:5130
13123 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
13124 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
13125 "function is limited in the total size of file that can be handled."
13129 #: ../src/guestfs-actions.pod:5142
13130 msgid "(Added in 1.0.63)"
13134 #: ../src/guestfs-actions.pod:5144
13135 msgid "guestfs_read_lines"
13139 #: ../src/guestfs-actions.pod:5146
13143 " guestfs_read_lines (guestfs_h *g,\n"
13144 " const char *path);\n"
13149 #: ../src/guestfs-actions.pod:5152 ../fish/guestfish-actions.pod:3426
13151 "The file contents are returned as a list of lines. Trailing C<LF> and "
13152 "C<CRLF> character sequences are I<not> returned."
13156 #: ../src/guestfs-actions.pod:5155
13158 "Note that this function cannot correctly handle binary files (specifically, "
13159 "files containing C<\\0> character which is treated as end of line). For "
13160 "those you need to use the C<guestfs_read_file> function which has a more "
13161 "complex interface."
13165 #: ../src/guestfs-actions.pod:5166
13166 msgid "guestfs_readdir"
13170 #: ../src/guestfs-actions.pod:5168
13173 " struct guestfs_dirent_list *\n"
13174 " guestfs_readdir (guestfs_h *g,\n"
13175 " const char *dir);\n"
13180 #: ../src/guestfs-actions.pod:5172 ../fish/guestfish-actions.pod:3438
13181 msgid "This returns the list of directory entries in directory C<dir>."
13185 #: ../src/guestfs-actions.pod:5174 ../fish/guestfish-actions.pod:3440
13187 "All entries in the directory are returned, including C<.> and C<..>. The "
13188 "entries are I<not> sorted, but returned in the same order as the underlying "
13193 #: ../src/guestfs-actions.pod:5178 ../fish/guestfish-actions.pod:3444
13195 "Also this call returns basic file type information about each file. The "
13196 "C<ftyp> field will contain one of the following characters:"
13200 #: ../src/guestfs-actions.pod:5183 ../fish/guestfish-actions.pod:3449
13205 #: ../src/guestfs-actions.pod:5185 ../fish/guestfish-actions.pod:3451
13206 msgid "Block special"
13210 #: ../src/guestfs-actions.pod:5187 ../fish/guestfish-actions.pod:3453
13215 #: ../src/guestfs-actions.pod:5189 ../fish/guestfish-actions.pod:3455
13216 msgid "Char special"
13220 #: ../src/guestfs-actions.pod:5191 ../fish/guestfish-actions.pod:3457
13225 #: ../src/guestfs-actions.pod:5193 ../fish/guestfish-actions.pod:3459
13230 #: ../src/guestfs-actions.pod:5195 ../fish/guestfish-actions.pod:3461
13235 #: ../src/guestfs-actions.pod:5197 ../fish/guestfish-actions.pod:3463
13236 msgid "FIFO (named pipe)"
13240 #: ../src/guestfs-actions.pod:5199 ../fish/guestfish-actions.pod:3465
13245 #: ../src/guestfs-actions.pod:5201 ../fish/guestfish-actions.pod:3467
13246 msgid "Symbolic link"
13250 #: ../src/guestfs-actions.pod:5203 ../fish/guestfish-actions.pod:3469
13255 #: ../src/guestfs-actions.pod:5205 ../fish/guestfish-actions.pod:3471
13256 msgid "Regular file"
13260 #: ../src/guestfs-actions.pod:5207 ../fish/guestfish-actions.pod:3473
13265 #: ../src/guestfs-actions.pod:5209 ../fish/guestfish-actions.pod:3475
13270 #: ../src/guestfs-actions.pod:5211 ../fish/guestfish-actions.pod:3477
13275 #: ../src/guestfs-actions.pod:5213 ../fish/guestfish-actions.pod:3479
13276 msgid "Unknown file type"
13280 #: ../src/guestfs-actions.pod:5215 ../fish/guestfish-actions.pod:3481
13285 #: ../src/guestfs-actions.pod:5217 ../fish/guestfish-actions.pod:3483
13287 "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13291 #: ../src/guestfs-actions.pod:5222
13293 "This function is primarily intended for use by programs. To get a simple "
13294 "list of names, use C<guestfs_ls>. To get a printable directory for human "
13295 "consumption, use C<guestfs_ll>."
13299 #: ../src/guestfs-actions.pod:5226
13301 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
13302 "was an error. I<The caller must call C<guestfs_free_dirent_list> after use>."
13306 #: ../src/guestfs-actions.pod:5232
13307 msgid "guestfs_readlink"
13311 #: ../src/guestfs-actions.pod:5234
13315 " guestfs_readlink (guestfs_h *g,\n"
13316 " const char *path);\n"
13321 #: ../src/guestfs-actions.pod:5238 ../fish/guestfish-actions.pod:3496
13322 msgid "This command reads the target of a symbolic link."
13326 #: ../src/guestfs-actions.pod:5245
13327 msgid "guestfs_readlinklist"
13331 #: ../src/guestfs-actions.pod:5247
13335 " guestfs_readlinklist (guestfs_h *g,\n"
13336 " const char *path,\n"
13337 " char *const *names);\n"
13342 #: ../src/guestfs-actions.pod:5252 ../fish/guestfish-actions.pod:3502
13344 "This call allows you to do a C<readlink> operation on multiple files, where "
13345 "all files are in the directory C<path>. C<names> is the list of files from "
13350 #: ../src/guestfs-actions.pod:5256 ../fish/guestfish-actions.pod:3506
13352 "On return you get a list of strings, with a one-to-one correspondence to the "
13353 "C<names> list. Each string is the value of the symbolic link."
13357 #: ../src/guestfs-actions.pod:5260 ../fish/guestfish-actions.pod:3510
13359 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13360 "result string is the empty string C<\"\">. However the whole operation is "
13361 "completed even if there were C<readlink(2)> errors, and so you can call this "
13362 "function with names where you don't know if they are symbolic links already "
13363 "(albeit slightly less efficient)."
13367 #: ../src/guestfs-actions.pod:5267 ../fish/guestfish-actions.pod:3517
13369 "This call is intended for programs that want to efficiently list a directory "
13370 "contents without making many round-trips. Very long directory listings "
13371 "might cause the protocol message size to be exceeded, causing this call to "
13372 "fail. The caller must split up such requests into smaller groups of names."
13376 #: ../src/guestfs-actions.pod:5280
13377 msgid "guestfs_realpath"
13381 #: ../src/guestfs-actions.pod:5282
13385 " guestfs_realpath (guestfs_h *g,\n"
13386 " const char *path);\n"
13391 #: ../src/guestfs-actions.pod:5286 ../fish/guestfish-actions.pod:3528
13393 "Return the canonicalized absolute pathname of C<path>. The returned path "
13394 "has no C<.>, C<..> or symbolic link path elements."
13398 #: ../src/guestfs-actions.pod:5294
13399 msgid "guestfs_removexattr"
13403 #: ../src/guestfs-actions.pod:5296
13407 " guestfs_removexattr (guestfs_h *g,\n"
13408 " const char *xattr,\n"
13409 " const char *path);\n"
13414 #: ../src/guestfs-actions.pod:5301 ../fish/guestfish-actions.pod:3535
13416 "This call removes the extended attribute named C<xattr> of the file C<path>."
13420 #: ../src/guestfs-actions.pod:5304
13421 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
13425 #: ../src/guestfs-actions.pod:5310
13426 msgid "guestfs_resize2fs"
13430 #: ../src/guestfs-actions.pod:5312
13434 " guestfs_resize2fs (guestfs_h *g,\n"
13435 " const char *device);\n"
13440 #: ../src/guestfs-actions.pod:5316 ../fish/guestfish-actions.pod:3544
13442 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13443 "underlying device."
13447 #: ../src/guestfs-actions.pod:5319
13449 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
13450 "C<device> before calling this command. For unknown reasons C<resize2fs> "
13451 "sometimes gives an error about this and sometimes not. In any case, it is "
13452 "always safe to call C<guestfs_e2fsck_f> before calling this function."
13456 #: ../src/guestfs-actions.pod:5329
13457 msgid "guestfs_resize2fs_size"
13461 #: ../src/guestfs-actions.pod:5331
13465 " guestfs_resize2fs_size (guestfs_h *g,\n"
13466 " const char *device,\n"
13467 " int64_t size);\n"
13472 #: ../src/guestfs-actions.pod:5336
13474 "This command is the same as C<guestfs_resize2fs> except that it allows you "
13475 "to specify the new size (in bytes) explicitly."
13479 #: ../src/guestfs-actions.pod:5343
13484 #: ../src/guestfs-actions.pod:5345
13488 " guestfs_rm (guestfs_h *g,\n"
13489 " const char *path);\n"
13494 #: ../src/guestfs-actions.pod:5349 ../fish/guestfish-actions.pod:3564
13495 msgid "Remove the single file C<path>."
13499 #: ../src/guestfs-actions.pod:5355
13500 msgid "guestfs_rm_rf"
13504 #: ../src/guestfs-actions.pod:5357
13508 " guestfs_rm_rf (guestfs_h *g,\n"
13509 " const char *path);\n"
13514 #: ../src/guestfs-actions.pod:5361 ../fish/guestfish-actions.pod:3570
13516 "Remove the file or directory C<path>, recursively removing the contents if "
13517 "its a directory. This is like the C<rm -rf> shell command."
13521 #: ../src/guestfs-actions.pod:5369
13522 msgid "guestfs_rmdir"
13526 #: ../src/guestfs-actions.pod:5371
13530 " guestfs_rmdir (guestfs_h *g,\n"
13531 " const char *path);\n"
13536 #: ../src/guestfs-actions.pod:5375 ../fish/guestfish-actions.pod:3578
13537 msgid "Remove the single directory C<path>."
13541 #: ../src/guestfs-actions.pod:5381
13542 msgid "guestfs_rmmountpoint"
13546 #: ../src/guestfs-actions.pod:5383
13550 " guestfs_rmmountpoint (guestfs_h *g,\n"
13551 " const char *exemptpath);\n"
13556 #: ../src/guestfs-actions.pod:5387
13558 "This calls removes a mountpoint that was previously created with "
13559 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
13563 #: ../src/guestfs-actions.pod:5395
13564 msgid "guestfs_scrub_device"
13568 #: ../src/guestfs-actions.pod:5397
13572 " guestfs_scrub_device (guestfs_h *g,\n"
13573 " const char *device);\n"
13578 #: ../src/guestfs-actions.pod:5401 ../fish/guestfish-actions.pod:3592
13580 "This command writes patterns over C<device> to make data retrieval more "
13585 #: ../src/guestfs-actions.pod:5404 ../src/guestfs-actions.pod:5425
13586 #: ../src/guestfs-actions.pod:5444 ../fish/guestfish-actions.pod:3595
13587 #: ../fish/guestfish-actions.pod:3610 ../fish/guestfish-actions.pod:3623
13589 "It is an interface to the L<scrub(1)> program. See that manual page for "
13594 #: ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:5430
13595 #: ../src/guestfs-actions.pod:5449
13596 msgid "(Added in 1.0.52)"
13600 #: ../src/guestfs-actions.pod:5414
13601 msgid "guestfs_scrub_file"
13605 #: ../src/guestfs-actions.pod:5416
13609 " guestfs_scrub_file (guestfs_h *g,\n"
13610 " const char *file);\n"
13615 #: ../src/guestfs-actions.pod:5420 ../fish/guestfish-actions.pod:3605
13617 "This command writes patterns over a file to make data retrieval more "
13622 #: ../src/guestfs-actions.pod:5423 ../fish/guestfish-actions.pod:3608
13623 msgid "The file is I<removed> after scrubbing."
13627 #: ../src/guestfs-actions.pod:5432
13628 msgid "guestfs_scrub_freespace"
13632 #: ../src/guestfs-actions.pod:5434
13636 " guestfs_scrub_freespace (guestfs_h *g,\n"
13637 " const char *dir);\n"
13642 #: ../src/guestfs-actions.pod:5438
13644 "This command creates the directory C<dir> and then fills it with files until "
13645 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
13646 "and deletes them. The intention is to scrub any free space on the partition "
13647 "containing C<dir>."
13651 #: ../src/guestfs-actions.pod:5451
13652 msgid "guestfs_set_append"
13656 #: ../src/guestfs-actions.pod:5453
13660 " guestfs_set_append (guestfs_h *g,\n"
13661 " const char *append);\n"
13666 #: ../src/guestfs-actions.pod:5457 ../fish/guestfish-actions.pod:3632
13668 "This function is used to add additional options to the guest kernel command "
13673 #: ../src/guestfs-actions.pod:5460 ../fish/guestfish-actions.pod:3635
13675 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13676 "environment variable."
13680 #: ../src/guestfs-actions.pod:5463 ../fish/guestfish-actions.pod:3638
13682 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13683 "(libguestfs always adds a few of its own)."
13687 #: ../src/guestfs-actions.pod:5470
13688 msgid "guestfs_set_autosync"
13692 #: ../src/guestfs-actions.pod:5472
13696 " guestfs_set_autosync (guestfs_h *g,\n"
13697 " int autosync);\n"
13702 #: ../src/guestfs-actions.pod:5476
13704 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13705 "effort attempt to run C<guestfs_umount_all> followed by C<guestfs_sync> when "
13706 "the handle is closed (also if the program exits without closing handles)."
13710 #: ../src/guestfs-actions.pod:5481 ../fish/guestfish-actions.pod:3652
13712 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13713 "disabled by default)."
13717 #: ../src/guestfs-actions.pod:5488
13718 msgid "guestfs_set_direct"
13722 #: ../src/guestfs-actions.pod:5490
13726 " guestfs_set_direct (guestfs_h *g,\n"
13732 #: ../src/guestfs-actions.pod:5494 ../fish/guestfish-actions.pod:3661
13734 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13735 "passed directly through to the appliance once it is launched."
13739 #: ../src/guestfs-actions.pod:5498
13741 "One consequence of this is that log messages aren't caught by the library "
13742 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
13747 #: ../src/guestfs-actions.pod:5502 ../fish/guestfish-actions.pod:3669
13748 msgid "You probably don't want to use this unless you know what you are doing."
13752 #: ../src/guestfs-actions.pod:5505 ../fish/guestfish-actions.pod:3672
13753 msgid "The default is disabled."
13757 #: ../src/guestfs-actions.pod:5511
13758 msgid "guestfs_set_e2label"
13762 #: ../src/guestfs-actions.pod:5513
13766 " guestfs_set_e2label (guestfs_h *g,\n"
13767 " const char *device,\n"
13768 " const char *label);\n"
13773 #: ../src/guestfs-actions.pod:5518 ../fish/guestfish-actions.pod:3678
13775 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13776 "C<label>. Filesystem labels are limited to 16 characters."
13780 #: ../src/guestfs-actions.pod:5522
13782 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
13783 "the existing label on a filesystem."
13787 #: ../src/guestfs-actions.pod:5529
13788 msgid "guestfs_set_e2uuid"
13792 #: ../src/guestfs-actions.pod:5531
13796 " guestfs_set_e2uuid (guestfs_h *g,\n"
13797 " const char *device,\n"
13798 " const char *uuid);\n"
13803 #: ../src/guestfs-actions.pod:5536 ../fish/guestfish-actions.pod:3689
13805 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13806 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13807 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13811 #: ../src/guestfs-actions.pod:5541
13813 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
13814 "the existing UUID of a filesystem."
13818 #: ../src/guestfs-actions.pod:5548
13819 msgid "guestfs_set_memsize"
13823 #: ../src/guestfs-actions.pod:5550
13827 " guestfs_set_memsize (guestfs_h *g,\n"
13833 #: ../src/guestfs-actions.pod:5554
13835 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13836 "This only has any effect if called before C<guestfs_launch>."
13840 #: ../src/guestfs-actions.pod:5558 ../fish/guestfish-actions.pod:3707
13842 "You can also change this by setting the environment variable "
13843 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13847 #: ../src/guestfs-actions.pod:5569
13848 msgid "guestfs_set_network"
13852 #: ../src/guestfs-actions.pod:5571
13856 " guestfs_set_network (guestfs_h *g,\n"
13862 #: ../src/guestfs-actions.pod:5575 ../fish/guestfish-actions.pod:3720
13864 "If C<network> is true, then the network is enabled in the libguestfs "
13865 "appliance. The default is false."
13869 #: ../src/guestfs-actions.pod:5578 ../fish/guestfish-actions.pod:3723
13871 "This affects whether commands are able to access the network (see L<guestfs"
13872 "(3)/RUNNING COMMANDS>)."
13876 #: ../src/guestfs-actions.pod:5581
13878 "You must call this before calling C<guestfs_launch>, otherwise it has no "
13883 #: ../src/guestfs-actions.pod:5588
13884 msgid "guestfs_set_path"
13888 #: ../src/guestfs-actions.pod:5590
13892 " guestfs_set_path (guestfs_h *g,\n"
13893 " const char *searchpath);\n"
13898 #: ../src/guestfs-actions.pod:5594 ../fish/guestfish-actions.pod:3735
13899 msgid "Set the path that libguestfs searches for kernel and initrd.img."
13903 #: ../src/guestfs-actions.pod:5596 ../fish/guestfish-actions.pod:3737
13905 "The default is C<$libdir/guestfs> unless overridden by setting "
13906 "C<LIBGUESTFS_PATH> environment variable."
13910 #: ../src/guestfs-actions.pod:5599 ../fish/guestfish-actions.pod:3740
13911 msgid "Setting C<path> to C<NULL> restores the default path."
13915 #: ../src/guestfs-actions.pod:5605
13916 msgid "guestfs_set_qemu"
13920 #: ../src/guestfs-actions.pod:5607
13924 " guestfs_set_qemu (guestfs_h *g,\n"
13925 " const char *qemu);\n"
13930 #: ../src/guestfs-actions.pod:5611 ../fish/guestfish-actions.pod:3748
13931 msgid "Set the qemu binary that we will use."
13935 #: ../src/guestfs-actions.pod:5613 ../fish/guestfish-actions.pod:3750
13937 "The default is chosen when the library was compiled by the configure script."
13941 #: ../src/guestfs-actions.pod:5616 ../fish/guestfish-actions.pod:3753
13943 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
13948 #: ../src/guestfs-actions.pod:5619 ../fish/guestfish-actions.pod:3756
13949 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
13953 #: ../src/guestfs-actions.pod:5621 ../fish/guestfish-actions.pod:3758
13955 "Note that you should call this function as early as possible after creating "
13956 "the handle. This is because some pre-launch operations depend on testing "
13957 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
13958 "don't retest features, and so you might see inconsistent results. Using the "
13959 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
13960 "the qemu binary at the same time as the handle is created."
13964 #: ../src/guestfs-actions.pod:5633
13965 msgid "guestfs_set_recovery_proc"
13969 #: ../src/guestfs-actions.pod:5635
13973 " guestfs_set_recovery_proc (guestfs_h *g,\n"
13974 " int recoveryproc);\n"
13979 #: ../src/guestfs-actions.pod:5639
13981 "If this is called with the parameter C<false> then C<guestfs_launch> does "
13982 "not create a recovery process. The purpose of the recovery process is to "
13983 "stop runaway qemu processes in the case where the main program aborts "
13988 #: ../src/guestfs-actions.pod:5644
13990 "This only has any effect if called before C<guestfs_launch>, and the default "
13995 #: ../src/guestfs-actions.pod:5647 ../fish/guestfish-actions.pod:3780
13997 "About the only time when you would want to disable this is if the main "
13998 "process will fork itself into the background (\"daemonize\" itself). In "
13999 "this case the recovery process thinks that the main program has disappeared "
14000 "and so kills qemu, which is not very helpful."
14004 #: ../src/guestfs-actions.pod:5657
14005 msgid "guestfs_set_selinux"
14009 #: ../src/guestfs-actions.pod:5659
14013 " guestfs_set_selinux (guestfs_h *g,\n"
14019 #: ../src/guestfs-actions.pod:5663 ../fish/guestfish-actions.pod:3792
14021 "This sets the selinux flag that is passed to the appliance at boot time. "
14022 "The default is C<selinux=0> (disabled)."
14026 #: ../src/guestfs-actions.pod:5666 ../fish/guestfish-actions.pod:3795
14028 "Note that if SELinux is enabled, it is always in Permissive mode "
14029 "(C<enforcing=0>)."
14033 #: ../src/guestfs-actions.pod:5676
14034 msgid "guestfs_set_trace"
14038 #: ../src/guestfs-actions.pod:5678
14042 " guestfs_set_trace (guestfs_h *g,\n"
14048 #: ../src/guestfs-actions.pod:5682 ../fish/guestfish-actions.pod:3807
14050 "If the command trace flag is set to 1, then commands are printed on stderr "
14051 "before they are executed in a format which is very similar to the one used "
14052 "by guestfish. In other words, you can run a program with this enabled, and "
14053 "you will get out a script which you can feed to guestfish to perform the "
14054 "same set of actions."
14058 #: ../src/guestfs-actions.pod:5689 ../fish/guestfish-actions.pod:3814
14060 "If you want to trace C API calls into libguestfs (and other libraries) then "
14061 "possibly a better way is to use the external ltrace(1) command."
14065 #: ../src/guestfs-actions.pod:5693 ../fish/guestfish-actions.pod:3818
14067 "Command traces are disabled unless the environment variable "
14068 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14072 #: ../src/guestfs-actions.pod:5700
14073 msgid "guestfs_set_verbose"
14077 #: ../src/guestfs-actions.pod:5702
14081 " guestfs_set_verbose (guestfs_h *g,\n"
14087 #: ../src/guestfs-actions.pod:5706 ../fish/guestfish-actions.pod:3827
14088 msgid "If C<verbose> is true, this turns on verbose messages (to C<stderr>)."
14092 #: ../src/guestfs-actions.pod:5708 ../fish/guestfish-actions.pod:3829
14094 "Verbose messages are disabled unless the environment variable "
14095 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14099 #: ../src/guestfs-actions.pod:5715
14100 msgid "guestfs_setcon"
14104 #: ../src/guestfs-actions.pod:5717
14108 " guestfs_setcon (guestfs_h *g,\n"
14109 " const char *context);\n"
14114 #: ../src/guestfs-actions.pod:5721 ../fish/guestfish-actions.pod:3836
14116 "This sets the SELinux security context of the daemon to the string "
14121 #: ../src/guestfs-actions.pod:5724 ../fish/guestfish-actions.pod:3839
14122 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14126 #: ../src/guestfs-actions.pod:5730
14127 msgid "guestfs_setxattr"
14131 #: ../src/guestfs-actions.pod:5732
14135 " guestfs_setxattr (guestfs_h *g,\n"
14136 " const char *xattr,\n"
14137 " const char *val,\n"
14139 " const char *path);\n"
14144 #: ../src/guestfs-actions.pod:5739 ../fish/guestfish-actions.pod:3845
14146 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14147 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14151 #: ../src/guestfs-actions.pod:5743
14152 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
14156 #: ../src/guestfs-actions.pod:5749
14157 msgid "guestfs_sfdisk"
14161 #: ../src/guestfs-actions.pod:5751
14165 " guestfs_sfdisk (guestfs_h *g,\n"
14166 " const char *device,\n"
14170 " char *const *lines);\n"
14175 #: ../src/guestfs-actions.pod:5759 ../fish/guestfish-actions.pod:3855
14177 "This is a direct interface to the L<sfdisk(8)> program for creating "
14178 "partitions on block devices."
14182 #: ../src/guestfs-actions.pod:5762 ../fish/guestfish-actions.pod:3858
14183 msgid "C<device> should be a block device, for example C</dev/sda>."
14187 #: ../src/guestfs-actions.pod:5764 ../fish/guestfish-actions.pod:3860
14189 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14190 "sectors on the device, which are passed directly to sfdisk as the I<-C>, I<-"
14191 "H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14192 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14193 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14194 "the kernel) cannot work out the right geometry and you will need to tell it."
14198 #: ../src/guestfs-actions.pod:5772 ../fish/guestfish-actions.pod:3868
14200 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14201 "refer to the L<sfdisk(8)> manpage."
14205 #: ../src/guestfs-actions.pod:5775 ../fish/guestfish-actions.pod:3871
14207 "To create a single partition occupying the whole disk, you would pass "
14208 "C<lines> as a single element list, when the single element being the string "
14213 #: ../src/guestfs-actions.pod:5779
14215 "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
14219 #: ../src/guestfs-actions.pod:5789
14220 msgid "guestfs_sfdiskM"
14224 #: ../src/guestfs-actions.pod:5791
14228 " guestfs_sfdiskM (guestfs_h *g,\n"
14229 " const char *device,\n"
14230 " char *const *lines);\n"
14235 #: ../src/guestfs-actions.pod:5796
14237 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
14238 "partition sizes are specified in megabytes only (rounded to the nearest "
14239 "cylinder) and you don't need to specify the cyls, heads and sectors "
14240 "parameters which were rarely if ever used anyway."
14244 #: ../src/guestfs-actions.pod:5802
14246 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
14247 "C<guestfs_part_disk>"
14251 #: ../src/guestfs-actions.pod:5812
14252 msgid "guestfs_sfdisk_N"
14256 #: ../src/guestfs-actions.pod:5814
14260 " guestfs_sfdisk_N (guestfs_h *g,\n"
14261 " const char *device,\n"
14266 " const char *line);\n"
14271 #: ../src/guestfs-actions.pod:5823 ../fish/guestfish-actions.pod:3901
14273 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14274 "(note: C<n> counts from 1)."
14278 #: ../src/guestfs-actions.pod:5826
14280 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
14281 "for the cyls/heads/sectors parameters."
14285 #: ../src/guestfs-actions.pod:5829
14286 msgid "See also: C<guestfs_part_add>"
14290 #: ../src/guestfs-actions.pod:5838
14291 msgid "guestfs_sfdisk_disk_geometry"
14295 #: ../src/guestfs-actions.pod:5840
14299 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
14300 " const char *device);\n"
14305 #: ../src/guestfs-actions.pod:5844
14307 "This displays the disk geometry of C<device> read from the partition table. "
14308 "Especially in the case where the underlying block device has been resized, "
14309 "this can be different from the kernel's idea of the geometry (see "
14310 "C<guestfs_sfdisk_kernel_geometry>)."
14314 #: ../src/guestfs-actions.pod:5849 ../src/guestfs-actions.pod:5865
14315 #: ../fish/guestfish-actions.pod:3921 ../fish/guestfish-actions.pod:3930
14316 msgid "The result is in human-readable format, and not designed to be parsed."
14320 #: ../src/guestfs-actions.pod:5857
14321 msgid "guestfs_sfdisk_kernel_geometry"
14325 #: ../src/guestfs-actions.pod:5859
14329 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
14330 " const char *device);\n"
14335 #: ../src/guestfs-actions.pod:5863 ../fish/guestfish-actions.pod:3928
14336 msgid "This displays the kernel's idea of the geometry of C<device>."
14340 #: ../src/guestfs-actions.pod:5873
14341 msgid "guestfs_sfdisk_l"
14345 #: ../src/guestfs-actions.pod:5875
14349 " guestfs_sfdisk_l (guestfs_h *g,\n"
14350 " const char *device);\n"
14355 #: ../src/guestfs-actions.pod:5879 ../fish/guestfish-actions.pod:3937
14357 "This displays the partition table on C<device>, in the human-readable output "
14358 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14362 #: ../src/guestfs-actions.pod:5883
14363 msgid "See also: C<guestfs_part_list>"
14367 #: ../src/guestfs-actions.pod:5890
14372 #: ../src/guestfs-actions.pod:5892
14376 " guestfs_sh (guestfs_h *g,\n"
14377 " const char *command);\n"
14382 #: ../src/guestfs-actions.pod:5896 ../fish/guestfish-actions.pod:3947
14384 "This call runs a command from the guest filesystem via the guest's C</bin/"
14389 #: ../src/guestfs-actions.pod:5899
14390 msgid "This is like C<guestfs_command>, but passes the command to:"
14394 #: ../src/guestfs-actions.pod:5901 ../fish/guestfish-actions.pod:3952
14397 " /bin/sh -c \"command\"\n"
14402 #: ../src/guestfs-actions.pod:5903 ../fish/guestfish-actions.pod:3954
14404 "Depending on the guest's shell, this usually results in wildcards being "
14405 "expanded, shell expressions being interpolated and so on."
14409 #: ../src/guestfs-actions.pod:5907
14410 msgid "All the provisos about C<guestfs_command> apply to this call."
14414 #: ../src/guestfs-actions.pod:5914
14415 msgid "guestfs_sh_lines"
14419 #: ../src/guestfs-actions.pod:5916
14423 " guestfs_sh_lines (guestfs_h *g,\n"
14424 " const char *command);\n"
14429 #: ../src/guestfs-actions.pod:5920
14431 "This is the same as C<guestfs_sh>, but splits the result into a list of "
14436 #: ../src/guestfs-actions.pod:5923
14437 msgid "See also: C<guestfs_command_lines>"
14441 #: ../src/guestfs-actions.pod:5931
14442 msgid "guestfs_sleep"
14446 #: ../src/guestfs-actions.pod:5933
14450 " guestfs_sleep (guestfs_h *g,\n"
14456 #: ../src/guestfs-actions.pod:5937 ../fish/guestfish-actions.pod:3973
14457 msgid "Sleep for C<secs> seconds."
14461 #: ../src/guestfs-actions.pod:5941
14462 msgid "(Added in 1.0.41)"
14466 #: ../src/guestfs-actions.pod:5943 ../src/guestfs-structs.pod:109
14467 msgid "guestfs_stat"
14471 #: ../src/guestfs-actions.pod:5945
14474 " struct guestfs_stat *\n"
14475 " guestfs_stat (guestfs_h *g,\n"
14476 " const char *path);\n"
14481 #: ../src/guestfs-actions.pod:5951 ../fish/guestfish-actions.pod:3981
14482 msgid "This is the same as the C<stat(2)> system call."
14486 #: ../src/guestfs-actions.pod:5959 ../src/guestfs-structs.pod:135
14487 msgid "guestfs_statvfs"
14491 #: ../src/guestfs-actions.pod:5961
14494 " struct guestfs_statvfs *\n"
14495 " guestfs_statvfs (guestfs_h *g,\n"
14496 " const char *path);\n"
14501 #: ../src/guestfs-actions.pod:5965 ../fish/guestfish-actions.pod:3987
14503 "Returns file system statistics for any mounted file system. C<path> should "
14504 "be a file or directory in the mounted file system (typically it is the mount "
14505 "point itself, but it doesn't need to be)."
14509 #: ../src/guestfs-actions.pod:5969 ../fish/guestfish-actions.pod:3991
14510 msgid "This is the same as the C<statvfs(2)> system call."
14514 #: ../src/guestfs-actions.pod:5971
14516 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
14517 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
14521 #: ../src/guestfs-actions.pod:5977
14522 msgid "guestfs_strings"
14526 #: ../src/guestfs-actions.pod:5979
14530 " guestfs_strings (guestfs_h *g,\n"
14531 " const char *path);\n"
14536 #: ../src/guestfs-actions.pod:5983 ../fish/guestfish-actions.pod:3997
14538 "This runs the L<strings(1)> command on a file and returns the list of "
14539 "printable strings found."
14543 #: ../src/guestfs-actions.pod:5995
14544 msgid "guestfs_strings_e"
14548 #: ../src/guestfs-actions.pod:5997
14552 " guestfs_strings_e (guestfs_h *g,\n"
14553 " const char *encoding,\n"
14554 " const char *path);\n"
14559 #: ../src/guestfs-actions.pod:6002
14561 "This is like the C<guestfs_strings> command, but allows you to specify the "
14562 "encoding of strings that are looked for in the source file C<path>."
14566 #: ../src/guestfs-actions.pod:6006 ../fish/guestfish-actions.pod:4011
14567 msgid "Allowed encodings are:"
14571 #: ../src/guestfs-actions.pod:6010 ../fish/guestfish-actions.pod:4015
14576 #: ../src/guestfs-actions.pod:6012
14578 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14579 "ISO-8859-X (this is what C<guestfs_strings> uses)."
14583 #: ../src/guestfs-actions.pod:6015 ../fish/guestfish-actions.pod:4020
14588 #: ../src/guestfs-actions.pod:6017 ../fish/guestfish-actions.pod:4022
14589 msgid "Single 8-bit-byte characters."
14593 #: ../src/guestfs-actions.pod:6019 ../fish/guestfish-actions.pod:4024
14598 #: ../src/guestfs-actions.pod:6021 ../fish/guestfish-actions.pod:4026
14599 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14603 #: ../src/guestfs-actions.pod:6024 ../fish/guestfish-actions.pod:4029
14604 msgid "l (lower case letter L)"
14608 #: ../src/guestfs-actions.pod:6026 ../fish/guestfish-actions.pod:4031
14610 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14611 "examining binaries in Windows guests."
14615 #: ../src/guestfs-actions.pod:6029 ../fish/guestfish-actions.pod:4034
14620 #: ../src/guestfs-actions.pod:6031 ../fish/guestfish-actions.pod:4036
14621 msgid "32-bit big endian such as UCS-4BE."
14625 #: ../src/guestfs-actions.pod:6033 ../fish/guestfish-actions.pod:4038
14630 #: ../src/guestfs-actions.pod:6035 ../fish/guestfish-actions.pod:4040
14631 msgid "32-bit little endian such as UCS-4LE."
14635 #: ../src/guestfs-actions.pod:6039 ../fish/guestfish-actions.pod:4044
14636 msgid "The returned strings are transcoded to UTF-8."
14640 #: ../src/guestfs-actions.pod:6050
14641 msgid "guestfs_swapoff_device"
14645 #: ../src/guestfs-actions.pod:6052
14649 " guestfs_swapoff_device (guestfs_h *g,\n"
14650 " const char *device);\n"
14655 #: ../src/guestfs-actions.pod:6056
14657 "This command disables the libguestfs appliance swap device or partition "
14658 "named C<device>. See C<guestfs_swapon_device>."
14662 #: ../src/guestfs-actions.pod:6064
14663 msgid "guestfs_swapoff_file"
14667 #: ../src/guestfs-actions.pod:6066
14671 " guestfs_swapoff_file (guestfs_h *g,\n"
14672 " const char *file);\n"
14677 #: ../src/guestfs-actions.pod:6070 ../fish/guestfish-actions.pod:4061
14678 msgid "This command disables the libguestfs appliance swap on file."
14682 #: ../src/guestfs-actions.pod:6076
14683 msgid "guestfs_swapoff_label"
14687 #: ../src/guestfs-actions.pod:6078
14691 " guestfs_swapoff_label (guestfs_h *g,\n"
14692 " const char *label);\n"
14697 #: ../src/guestfs-actions.pod:6082 ../fish/guestfish-actions.pod:4067
14699 "This command disables the libguestfs appliance swap on labeled swap "
14704 #: ../src/guestfs-actions.pod:6089
14705 msgid "guestfs_swapoff_uuid"
14709 #: ../src/guestfs-actions.pod:6091
14713 " guestfs_swapoff_uuid (guestfs_h *g,\n"
14714 " const char *uuid);\n"
14719 #: ../src/guestfs-actions.pod:6095 ../fish/guestfish-actions.pod:4074
14721 "This command disables the libguestfs appliance swap partition with the given "
14726 #: ../src/guestfs-actions.pod:6102
14727 msgid "guestfs_swapon_device"
14731 #: ../src/guestfs-actions.pod:6104
14735 " guestfs_swapon_device (guestfs_h *g,\n"
14736 " const char *device);\n"
14741 #: ../src/guestfs-actions.pod:6108
14743 "This command enables the libguestfs appliance to use the swap device or "
14744 "partition named C<device>. The increased memory is made available for all "
14745 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
14749 #: ../src/guestfs-actions.pod:6113 ../fish/guestfish-actions.pod:4086
14751 "Note that you should not swap to existing guest swap partitions unless you "
14752 "know what you are doing. They may contain hibernation information, or other "
14753 "information that the guest doesn't want you to trash. You also risk leaking "
14754 "information about the host to the guest this way. Instead, attach a new "
14755 "host device to the guest and swap on that."
14759 #: ../src/guestfs-actions.pod:6124
14760 msgid "guestfs_swapon_file"
14764 #: ../src/guestfs-actions.pod:6126
14768 " guestfs_swapon_file (guestfs_h *g,\n"
14769 " const char *file);\n"
14774 #: ../src/guestfs-actions.pod:6130
14776 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
14781 #: ../src/guestfs-actions.pod:6137
14782 msgid "guestfs_swapon_label"
14786 #: ../src/guestfs-actions.pod:6139
14790 " guestfs_swapon_label (guestfs_h *g,\n"
14791 " const char *label);\n"
14796 #: ../src/guestfs-actions.pod:6143
14798 "This command enables swap to a labeled swap partition. See "
14799 "C<guestfs_swapon_device> for other notes."
14803 #: ../src/guestfs-actions.pod:6150
14804 msgid "guestfs_swapon_uuid"
14808 #: ../src/guestfs-actions.pod:6152
14812 " guestfs_swapon_uuid (guestfs_h *g,\n"
14813 " const char *uuid);\n"
14818 #: ../src/guestfs-actions.pod:6156
14820 "This command enables swap to a swap partition with the given UUID. See "
14821 "C<guestfs_swapon_device> for other notes."
14825 #: ../src/guestfs-actions.pod:6163
14826 msgid "guestfs_sync"
14830 #: ../src/guestfs-actions.pod:6165
14834 " guestfs_sync (guestfs_h *g);\n"
14839 #: ../src/guestfs-actions.pod:6168 ../fish/guestfish-actions.pod:4118
14841 "This syncs the disk, so that any writes are flushed through to the "
14842 "underlying disk image."
14846 #: ../src/guestfs-actions.pod:6171 ../fish/guestfish-actions.pod:4121
14848 "You should always call this if you have modified a disk image, before "
14849 "closing the handle."
14853 #: ../src/guestfs-actions.pod:6178
14854 msgid "guestfs_tail"
14858 #: ../src/guestfs-actions.pod:6180
14862 " guestfs_tail (guestfs_h *g,\n"
14863 " const char *path);\n"
14868 #: ../src/guestfs-actions.pod:6184 ../fish/guestfish-actions.pod:4128
14870 "This command returns up to the last 10 lines of a file as a list of strings."
14874 #: ../src/guestfs-actions.pod:6196
14875 msgid "guestfs_tail_n"
14879 #: ../src/guestfs-actions.pod:6198
14883 " guestfs_tail_n (guestfs_h *g,\n"
14885 " const char *path);\n"
14890 #: ../src/guestfs-actions.pod:6203 ../fish/guestfish-actions.pod:4138
14892 "If the parameter C<nrlines> is a positive number, this returns the last "
14893 "C<nrlines> lines of the file C<path>."
14897 #: ../src/guestfs-actions.pod:6206 ../fish/guestfish-actions.pod:4141
14899 "If the parameter C<nrlines> is a negative number, this returns lines from "
14900 "the file C<path>, starting with the C<-nrlines>th line."
14904 #: ../src/guestfs-actions.pod:6220
14905 msgid "guestfs_tar_in"
14909 #: ../src/guestfs-actions.pod:6222
14913 " guestfs_tar_in (guestfs_h *g,\n"
14914 " const char *tarfile,\n"
14915 " const char *directory);\n"
14920 #: ../src/guestfs-actions.pod:6227 ../fish/guestfish-actions.pod:4153
14922 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
14923 "tar file) into C<directory>."
14927 #: ../src/guestfs-actions.pod:6230
14929 "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
14933 #: ../src/guestfs-actions.pod:6235 ../src/guestfs-actions.pod:6252
14934 #: ../src/guestfs-actions.pod:6268 ../src/guestfs-actions.pod:6284
14935 msgid "(Added in 1.0.3)"
14939 #: ../src/guestfs-actions.pod:6237
14940 msgid "guestfs_tar_out"
14944 #: ../src/guestfs-actions.pod:6239
14948 " guestfs_tar_out (guestfs_h *g,\n"
14949 " const char *directory,\n"
14950 " const char *tarfile);\n"
14955 #: ../src/guestfs-actions.pod:6244 ../fish/guestfish-actions.pod:4165
14957 "This command packs the contents of C<directory> and downloads it to local "
14962 #: ../src/guestfs-actions.pod:6247
14964 "To download a compressed tarball, use C<guestfs_tgz_out> or "
14965 "C<guestfs_txz_out>."
14969 #: ../src/guestfs-actions.pod:6254
14970 msgid "guestfs_tgz_in"
14974 #: ../src/guestfs-actions.pod:6256
14978 " guestfs_tgz_in (guestfs_h *g,\n"
14979 " const char *tarball,\n"
14980 " const char *directory);\n"
14985 #: ../src/guestfs-actions.pod:6261 ../fish/guestfish-actions.pod:4177
14987 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
14988 "tar file) into C<directory>."
14992 #: ../src/guestfs-actions.pod:6264
14993 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
14997 #: ../src/guestfs-actions.pod:6270
14998 msgid "guestfs_tgz_out"
15002 #: ../src/guestfs-actions.pod:6272
15006 " guestfs_tgz_out (guestfs_h *g,\n"
15007 " const char *directory,\n"
15008 " const char *tarball);\n"
15013 #: ../src/guestfs-actions.pod:6277 ../fish/guestfish-actions.pod:4188
15015 "This command packs the contents of C<directory> and downloads it to local "
15020 #: ../src/guestfs-actions.pod:6280
15021 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
15025 #: ../src/guestfs-actions.pod:6286
15026 msgid "guestfs_touch"
15030 #: ../src/guestfs-actions.pod:6288
15034 " guestfs_touch (guestfs_h *g,\n"
15035 " const char *path);\n"
15040 #: ../src/guestfs-actions.pod:6292 ../fish/guestfish-actions.pod:4199
15042 "Touch acts like the L<touch(1)> command. It can be used to update the "
15043 "timestamps on a file, or, if the file does not exist, to create a new zero-"
15048 #: ../src/guestfs-actions.pod:6296 ../fish/guestfish-actions.pod:4203
15050 "This command only works on regular files, and will fail on other file types "
15051 "such as directories, symbolic links, block special etc."
15055 #: ../src/guestfs-actions.pod:6303
15056 msgid "guestfs_truncate"
15060 #: ../src/guestfs-actions.pod:6305
15064 " guestfs_truncate (guestfs_h *g,\n"
15065 " const char *path);\n"
15070 #: ../src/guestfs-actions.pod:6309 ../fish/guestfish-actions.pod:4210
15072 "This command truncates C<path> to a zero-length file. The file must exist "
15077 #: ../src/guestfs-actions.pod:6316
15078 msgid "guestfs_truncate_size"
15082 #: ../src/guestfs-actions.pod:6318
15086 " guestfs_truncate_size (guestfs_h *g,\n"
15087 " const char *path,\n"
15088 " int64_t size);\n"
15093 #: ../src/guestfs-actions.pod:6323 ../fish/guestfish-actions.pod:4217
15095 "This command truncates C<path> to size C<size> bytes. The file must exist "
15100 #: ../src/guestfs-actions.pod:6326
15102 "If the current file size is less than C<size> then the file is extended to "
15103 "the required size with zero bytes. This creates a sparse file (ie. disk "
15104 "blocks are not allocated for the file until you write to it). To create a "
15105 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
15109 #: ../src/guestfs-actions.pod:6336
15110 msgid "guestfs_tune2fs_l"
15114 #: ../src/guestfs-actions.pod:6338
15118 " guestfs_tune2fs_l (guestfs_h *g,\n"
15119 " const char *device);\n"
15124 #: ../src/guestfs-actions.pod:6342 ../fish/guestfish-actions.pod:4230
15126 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15131 #: ../src/guestfs-actions.pod:6345 ../fish/guestfish-actions.pod:4233
15133 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15134 "for more details. The list of fields returned isn't clearly defined, and "
15135 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15136 "and the filesystem itself."
15140 #: ../src/guestfs-actions.pod:6358
15141 msgid "guestfs_txz_in"
15145 #: ../src/guestfs-actions.pod:6360
15149 " guestfs_txz_in (guestfs_h *g,\n"
15150 " const char *tarball,\n"
15151 " const char *directory);\n"
15156 #: ../src/guestfs-actions.pod:6365 ../fish/guestfish-actions.pod:4242
15158 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15159 "tar file) into C<directory>."
15163 #: ../src/guestfs-actions.pod:6372
15164 msgid "guestfs_txz_out"
15168 #: ../src/guestfs-actions.pod:6374
15172 " guestfs_txz_out (guestfs_h *g,\n"
15173 " const char *directory,\n"
15174 " const char *tarball);\n"
15179 #: ../src/guestfs-actions.pod:6379 ../fish/guestfish-actions.pod:4251
15181 "This command packs the contents of C<directory> and downloads it to local "
15182 "file C<tarball> (as an xz compressed tar archive)."
15186 #: ../src/guestfs-actions.pod:6386
15187 msgid "guestfs_umask"
15191 #: ../src/guestfs-actions.pod:6388
15195 " guestfs_umask (guestfs_h *g,\n"
15201 #: ../src/guestfs-actions.pod:6392 ../fish/guestfish-actions.pod:4260
15203 "This function sets the mask used for creating new files and device nodes to "
15208 #: ../src/guestfs-actions.pod:6395 ../fish/guestfish-actions.pod:4263
15210 "Typical umask values would be C<022> which creates new files with "
15211 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15212 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15216 #: ../src/guestfs-actions.pod:6400 ../fish/guestfish-actions.pod:4268
15218 "The default umask is C<022>. This is important because it means that "
15219 "directories and device nodes will be created with C<0644> or C<0755> mode "
15220 "even if you specify C<0777>."
15224 #: ../src/guestfs-actions.pod:6404
15226 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
15227 "C<guestfs_mkdir>."
15231 #: ../src/guestfs-actions.pod:6407 ../fish/guestfish-actions.pod:4275
15232 msgid "This call returns the previous umask."
15236 #: ../src/guestfs-actions.pod:6413
15237 msgid "guestfs_umount"
15241 #: ../src/guestfs-actions.pod:6415
15245 " guestfs_umount (guestfs_h *g,\n"
15246 " const char *pathordevice);\n"
15251 #: ../src/guestfs-actions.pod:6419 ../fish/guestfish-actions.pod:4283
15253 "This unmounts the given filesystem. The filesystem may be specified either "
15254 "by its mountpoint (path) or the device which contains the filesystem."
15258 #: ../src/guestfs-actions.pod:6427
15259 msgid "guestfs_umount_all"
15263 #: ../src/guestfs-actions.pod:6429
15267 " guestfs_umount_all (guestfs_h *g);\n"
15272 #: ../src/guestfs-actions.pod:6432 ../fish/guestfish-actions.pod:4293
15273 msgid "This unmounts all mounted filesystems."
15277 #: ../src/guestfs-actions.pod:6434 ../fish/guestfish-actions.pod:4295
15278 msgid "Some internal mounts are not unmounted by this call."
15282 #: ../src/guestfs-actions.pod:6440
15283 msgid "guestfs_upload"
15287 #: ../src/guestfs-actions.pod:6442
15291 " guestfs_upload (guestfs_h *g,\n"
15292 " const char *filename,\n"
15293 " const char *remotefilename);\n"
15298 #: ../src/guestfs-actions.pod:6447 ../src/guestfs-actions.pod:6471
15299 #: ../fish/guestfish-actions.pod:4301 ../fish/guestfish-actions.pod:4314
15300 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15304 #: ../src/guestfs-actions.pod:6452
15305 msgid "See also C<guestfs_download>."
15309 #: ../src/guestfs-actions.pod:6463
15310 msgid "guestfs_upload_offset"
15314 #: ../src/guestfs-actions.pod:6465
15318 " guestfs_upload_offset (guestfs_h *g,\n"
15319 " const char *filename,\n"
15320 " const char *remotefilename,\n"
15321 " int64_t offset);\n"
15326 #: ../src/guestfs-actions.pod:6474 ../fish/guestfish-actions.pod:4317
15328 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15329 "The intention is to overwrite parts of existing files or devices, although "
15330 "if a non-existant file is specified then it is created with a \"hole\" "
15331 "before C<offset>. The size of the data written is implicit in the size of "
15332 "the source C<filename>."
15336 #: ../src/guestfs-actions.pod:6481
15338 "Note that there is no limit on the amount of data that can be uploaded with "
15339 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
15340 "full amount unless an error occurs."
15344 #: ../src/guestfs-actions.pod:6486
15345 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
15349 #: ../src/guestfs-actions.pod:6497
15350 msgid "guestfs_utimens"
15354 #: ../src/guestfs-actions.pod:6499
15358 " guestfs_utimens (guestfs_h *g,\n"
15359 " const char *path,\n"
15360 " int64_t atsecs,\n"
15361 " int64_t atnsecs,\n"
15362 " int64_t mtsecs,\n"
15363 " int64_t mtnsecs);\n"
15368 #: ../src/guestfs-actions.pod:6507 ../fish/guestfish-actions.pod:4337
15369 msgid "This command sets the timestamps of a file with nanosecond precision."
15373 #: ../src/guestfs-actions.pod:6510 ../fish/guestfish-actions.pod:4340
15375 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15380 #: ../src/guestfs-actions.pod:6513 ../fish/guestfish-actions.pod:4343
15382 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15383 "nanoseconds from the epoch."
15387 #: ../src/guestfs-actions.pod:6516 ../fish/guestfish-actions.pod:4346
15389 "If the C<*nsecs> field contains the special value C<-1> then the "
15390 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15391 "ignored in this case)."
15395 #: ../src/guestfs-actions.pod:6520 ../fish/guestfish-actions.pod:4350
15397 "If the C<*nsecs> field contains the special value C<-2> then the "
15398 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15403 #: ../src/guestfs-actions.pod:6528 ../src/guestfs-structs.pod:175
15404 msgid "guestfs_version"
15408 #: ../src/guestfs-actions.pod:6530
15411 " struct guestfs_version *\n"
15412 " guestfs_version (guestfs_h *g);\n"
15417 #: ../src/guestfs-actions.pod:6533 ../fish/guestfish-actions.pod:4358
15419 "Return the libguestfs version number that the program is linked against."
15423 #: ../src/guestfs-actions.pod:6536 ../fish/guestfish-actions.pod:4361
15425 "Note that because of dynamic linking this is not necessarily the version of "
15426 "libguestfs that you compiled against. You can compile the program, and then "
15427 "at runtime dynamically link against a completely different C<libguestfs.so> "
15432 #: ../src/guestfs-actions.pod:6541 ../fish/guestfish-actions.pod:4366
15434 "This call was added in version C<1.0.58>. In previous versions of "
15435 "libguestfs there was no way to get the version number. From C code you can "
15436 "use dynamic linker functions to find out if this symbol exists (if it "
15437 "doesn't, then it's an earlier version)."
15441 #: ../src/guestfs-actions.pod:6547 ../fish/guestfish-actions.pod:4372
15443 "The call returns a structure with four elements. The first three (C<major>, "
15444 "C<minor> and C<release>) are numbers and correspond to the usual version "
15445 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15446 "but may be used for distro-specific information."
15450 #: ../src/guestfs-actions.pod:6553 ../fish/guestfish-actions.pod:4378
15452 "To construct the original version string: C<$major.$minor.$release$extra>"
15456 #: ../src/guestfs-actions.pod:6556 ../fish/guestfish-actions.pod:4381
15457 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15461 #: ../src/guestfs-actions.pod:6558
15463 "I<Note:> Don't use this call to test for availability of features. In "
15464 "enterprise distributions we backport features from later versions into "
15465 "earlier versions, making this an unreliable way to test for features. Use "
15466 "C<guestfs_available> instead."
15470 #: ../src/guestfs-actions.pod:6564
15472 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
15473 "error. I<The caller must call C<guestfs_free_version> after use>."
15477 #: ../src/guestfs-actions.pod:6568
15478 msgid "(Added in 1.0.58)"
15482 #: ../src/guestfs-actions.pod:6570
15483 msgid "guestfs_vfs_label"
15487 #: ../src/guestfs-actions.pod:6572
15491 " guestfs_vfs_label (guestfs_h *g,\n"
15492 " const char *device);\n"
15497 #: ../src/guestfs-actions.pod:6576 ../fish/guestfish-actions.pod:4393
15498 msgid "This returns the filesystem label of the filesystem on C<device>."
15502 #: ../src/guestfs-actions.pod:6579 ../fish/guestfish-actions.pod:4396
15503 msgid "If the filesystem is unlabeled, this returns the empty string."
15507 #: ../src/guestfs-actions.pod:6581
15508 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
15512 #: ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6623
15513 msgid "(Added in 1.3.18)"
15517 #: ../src/guestfs-actions.pod:6588
15518 msgid "guestfs_vfs_type"
15522 #: ../src/guestfs-actions.pod:6590
15526 " guestfs_vfs_type (guestfs_h *g,\n"
15527 " const char *device);\n"
15532 #: ../src/guestfs-actions.pod:6594 ../fish/guestfish-actions.pod:4404
15534 "This command gets the filesystem type corresponding to the filesystem on "
15539 #: ../src/guestfs-actions.pod:6597 ../fish/guestfish-actions.pod:4407
15541 "For most filesystems, the result is the name of the Linux VFS module which "
15542 "would be used to mount this filesystem if you mounted it without specifying "
15543 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15547 #: ../src/guestfs-actions.pod:6607
15548 msgid "guestfs_vfs_uuid"
15552 #: ../src/guestfs-actions.pod:6609
15556 " guestfs_vfs_uuid (guestfs_h *g,\n"
15557 " const char *device);\n"
15562 #: ../src/guestfs-actions.pod:6613 ../fish/guestfish-actions.pod:4416
15563 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15567 #: ../src/guestfs-actions.pod:6616 ../fish/guestfish-actions.pod:4419
15568 msgid "If the filesystem does not have a UUID, this returns the empty string."
15572 #: ../src/guestfs-actions.pod:6618
15573 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
15577 #: ../src/guestfs-actions.pod:6625
15578 msgid "guestfs_vg_activate"
15582 #: ../src/guestfs-actions.pod:6627
15586 " guestfs_vg_activate (guestfs_h *g,\n"
15588 " char *const *volgroups);\n"
15593 #: ../src/guestfs-actions.pod:6632 ../fish/guestfish-actions.pod:4427
15595 "This command activates or (if C<activate> is false) deactivates all logical "
15596 "volumes in the listed volume groups C<volgroups>. If activated, then they "
15597 "are made known to the kernel, ie. they appear as C</dev/mapper> devices. If "
15598 "deactivated, then those devices disappear."
15602 #: ../src/guestfs-actions.pod:6638 ../fish/guestfish-actions.pod:4433
15603 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15607 #: ../src/guestfs-actions.pod:6640 ../fish/guestfish-actions.pod:4435
15609 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15610 "activated or deactivated."
15614 #: ../src/guestfs-actions.pod:6647
15615 msgid "guestfs_vg_activate_all"
15619 #: ../src/guestfs-actions.pod:6649
15623 " guestfs_vg_activate_all (guestfs_h *g,\n"
15624 " int activate);\n"
15629 #: ../src/guestfs-actions.pod:6653 ../fish/guestfish-actions.pod:4442
15631 "This command activates or (if C<activate> is false) deactivates all logical "
15632 "volumes in all volume groups. If activated, then they are made known to the "
15633 "kernel, ie. they appear as C</dev/mapper> devices. If deactivated, then "
15634 "those devices disappear."
15638 #: ../src/guestfs-actions.pod:6659 ../fish/guestfish-actions.pod:4448
15639 msgid "This command is the same as running C<vgchange -a y|n>"
15643 #: ../src/guestfs-actions.pod:6665
15644 msgid "guestfs_vgcreate"
15648 #: ../src/guestfs-actions.pod:6667
15652 " guestfs_vgcreate (guestfs_h *g,\n"
15653 " const char *volgroup,\n"
15654 " char *const *physvols);\n"
15659 #: ../src/guestfs-actions.pod:6672 ../fish/guestfish-actions.pod:4454
15661 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15662 "of physical volumes C<physvols>."
15666 #: ../src/guestfs-actions.pod:6679
15667 msgid "guestfs_vglvuuids"
15671 #: ../src/guestfs-actions.pod:6681
15675 " guestfs_vglvuuids (guestfs_h *g,\n"
15676 " const char *vgname);\n"
15681 #: ../src/guestfs-actions.pod:6685 ../fish/guestfish-actions.pod:4461
15683 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15684 "volumes created in this volume group."
15688 #: ../src/guestfs-actions.pod:6688
15690 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
15691 "associate logical volumes and volume groups."
15695 #: ../src/guestfs-actions.pod:6691
15696 msgid "See also C<guestfs_vgpvuuids>."
15700 #: ../src/guestfs-actions.pod:6699
15701 msgid "guestfs_vgpvuuids"
15705 #: ../src/guestfs-actions.pod:6701
15709 " guestfs_vgpvuuids (guestfs_h *g,\n"
15710 " const char *vgname);\n"
15715 #: ../src/guestfs-actions.pod:6705 ../fish/guestfish-actions.pod:4473
15717 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15718 "volumes that this volume group resides on."
15722 #: ../src/guestfs-actions.pod:6708
15724 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
15725 "associate physical volumes and volume groups."
15729 #: ../src/guestfs-actions.pod:6711
15730 msgid "See also C<guestfs_vglvuuids>."
15734 #: ../src/guestfs-actions.pod:6719
15735 msgid "guestfs_vgremove"
15739 #: ../src/guestfs-actions.pod:6721
15743 " guestfs_vgremove (guestfs_h *g,\n"
15744 " const char *vgname);\n"
15749 #: ../src/guestfs-actions.pod:6725 ../fish/guestfish-actions.pod:4485
15750 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15754 #: ../src/guestfs-actions.pod:6727 ../fish/guestfish-actions.pod:4487
15756 "This also forcibly removes all logical volumes in the volume group (if any)."
15760 #: ../src/guestfs-actions.pod:6734
15761 msgid "guestfs_vgrename"
15765 #: ../src/guestfs-actions.pod:6736
15769 " guestfs_vgrename (guestfs_h *g,\n"
15770 " const char *volgroup,\n"
15771 " const char *newvolgroup);\n"
15776 #: ../src/guestfs-actions.pod:6741 ../fish/guestfish-actions.pod:4494
15777 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15781 #: ../src/guestfs-actions.pod:6747
15782 msgid "guestfs_vgs"
15786 #: ../src/guestfs-actions.pod:6749
15790 " guestfs_vgs (guestfs_h *g);\n"
15795 #: ../src/guestfs-actions.pod:6752 ../fish/guestfish-actions.pod:4500
15797 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15802 #: ../src/guestfs-actions.pod:6755 ../fish/guestfish-actions.pod:4503
15804 "This returns a list of just the volume group names that were detected (eg. "
15809 #: ../src/guestfs-actions.pod:6758
15810 msgid "See also C<guestfs_vgs_full>."
15814 #: ../src/guestfs-actions.pod:6766
15815 msgid "guestfs_vgs_full"
15819 #: ../src/guestfs-actions.pod:6768
15822 " struct guestfs_lvm_vg_list *\n"
15823 " guestfs_vgs_full (guestfs_h *g);\n"
15828 #: ../src/guestfs-actions.pod:6771 ../fish/guestfish-actions.pod:4512
15830 "List all the volumes groups detected. This is the equivalent of the L<vgs(8)"
15831 "> command. The \"full\" version includes all fields."
15835 #: ../src/guestfs-actions.pod:6774
15837 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
15838 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after use>."
15842 #: ../src/guestfs-actions.pod:6780
15843 msgid "guestfs_vgscan"
15847 #: ../src/guestfs-actions.pod:6782
15851 " guestfs_vgscan (guestfs_h *g);\n"
15856 #: ../src/guestfs-actions.pod:6785 ../fish/guestfish-actions.pod:4519
15858 "This rescans all block devices and rebuilds the list of LVM physical "
15859 "volumes, volume groups and logical volumes."
15863 #: ../src/guestfs-actions.pod:6792
15864 msgid "guestfs_vguuid"
15868 #: ../src/guestfs-actions.pod:6794
15872 " guestfs_vguuid (guestfs_h *g,\n"
15873 " const char *vgname);\n"
15878 #: ../src/guestfs-actions.pod:6798 ../fish/guestfish-actions.pod:4526
15879 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15883 #: ../src/guestfs-actions.pod:6805
15884 msgid "guestfs_wait_ready"
15888 #: ../src/guestfs-actions.pod:6807
15892 " guestfs_wait_ready (guestfs_h *g);\n"
15897 #: ../src/guestfs-actions.pod:6810
15898 msgid "This function is a no op."
15902 #: ../src/guestfs-actions.pod:6812
15904 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
15905 "calling C<guestfs_launch> to wait for the launch to complete. However this "
15906 "is no longer necessary because C<guestfs_launch> now does the waiting."
15910 #: ../src/guestfs-actions.pod:6817
15912 "If you see any calls to this function in code then you can just remove them, "
15913 "unless you want to retain compatibility with older versions of the API."
15917 #: ../src/guestfs-actions.pod:6825
15918 msgid "guestfs_wc_c"
15922 #: ../src/guestfs-actions.pod:6827
15926 " guestfs_wc_c (guestfs_h *g,\n"
15927 " const char *path);\n"
15932 #: ../src/guestfs-actions.pod:6831 ../fish/guestfish-actions.pod:4532
15934 "This command counts the characters in a file, using the C<wc -c> external "
15939 #: ../src/guestfs-actions.pod:6838
15940 msgid "guestfs_wc_l"
15944 #: ../src/guestfs-actions.pod:6840
15948 " guestfs_wc_l (guestfs_h *g,\n"
15949 " const char *path);\n"
15954 #: ../src/guestfs-actions.pod:6844 ../fish/guestfish-actions.pod:4539
15956 "This command counts the lines in a file, using the C<wc -l> external command."
15960 #: ../src/guestfs-actions.pod:6851
15961 msgid "guestfs_wc_w"
15965 #: ../src/guestfs-actions.pod:6853
15969 " guestfs_wc_w (guestfs_h *g,\n"
15970 " const char *path);\n"
15975 #: ../src/guestfs-actions.pod:6857 ../fish/guestfish-actions.pod:4546
15977 "This command counts the words in a file, using the C<wc -w> external command."
15981 #: ../src/guestfs-actions.pod:6864
15982 msgid "guestfs_write"
15986 #: ../src/guestfs-actions.pod:6866
15990 " guestfs_write (guestfs_h *g,\n"
15991 " const char *path,\n"
15992 " const char *content,\n"
15993 " size_t content_size);\n"
15998 #: ../src/guestfs-actions.pod:6872 ../fish/guestfish-actions.pod:4553
16000 "This call creates a file called C<path>. The content of the file is the "
16001 "string C<content> (which can contain any 8 bit data)."
16005 #: ../src/guestfs-actions.pod:6882
16006 msgid "guestfs_write_file"
16010 #: ../src/guestfs-actions.pod:6884
16014 " guestfs_write_file (guestfs_h *g,\n"
16015 " const char *path,\n"
16016 " const char *content,\n"
16022 #: ../src/guestfs-actions.pod:6890 ../fish/guestfish-actions.pod:4563
16024 "This call creates a file called C<path>. The contents of the file is the "
16025 "string C<content> (which can contain any 8 bit data), with length C<size>."
16029 #: ../src/guestfs-actions.pod:6894 ../fish/guestfish-actions.pod:4567
16031 "As a special case, if C<size> is C<0> then the length is calculated using "
16032 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16036 #: ../src/guestfs-actions.pod:6898 ../fish/guestfish-actions.pod:4571
16038 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16039 "I<not> work, even if the length is specified."
16043 #: ../src/guestfs-actions.pod:6906 ../fish/guestfish-actions.pod:4577
16045 "This function is deprecated. In new code, use the C<write> call instead."
16049 #: ../src/guestfs-actions.pod:6915
16050 msgid "guestfs_zegrep"
16054 #: ../src/guestfs-actions.pod:6917
16058 " guestfs_zegrep (guestfs_h *g,\n"
16059 " const char *regex,\n"
16060 " const char *path);\n"
16065 #: ../src/guestfs-actions.pod:6922 ../fish/guestfish-actions.pod:4588
16067 "This calls the external C<zegrep> program and returns the matching lines."
16071 #: ../src/guestfs-actions.pod:6934
16072 msgid "guestfs_zegrepi"
16076 #: ../src/guestfs-actions.pod:6936
16080 " guestfs_zegrepi (guestfs_h *g,\n"
16081 " const char *regex,\n"
16082 " const char *path);\n"
16087 #: ../src/guestfs-actions.pod:6941 ../fish/guestfish-actions.pod:4598
16089 "This calls the external C<zegrep -i> program and returns the matching lines."
16093 #: ../src/guestfs-actions.pod:6953
16094 msgid "guestfs_zero"
16098 #: ../src/guestfs-actions.pod:6955
16102 " guestfs_zero (guestfs_h *g,\n"
16103 " const char *device);\n"
16108 #: ../src/guestfs-actions.pod:6959 ../fish/guestfish-actions.pod:4608
16109 msgid "This command writes zeroes over the first few blocks of C<device>."
16113 #: ../src/guestfs-actions.pod:6961 ../fish/guestfish-actions.pod:4610
16115 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16116 "securely wipe the device). It should be sufficient to remove any partition "
16117 "tables, filesystem superblocks and so on."
16121 #: ../src/guestfs-actions.pod:6965
16122 msgid "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>."
16126 #: ../src/guestfs-actions.pod:6976
16127 msgid "guestfs_zero_device"
16131 #: ../src/guestfs-actions.pod:6978
16135 " guestfs_zero_device (guestfs_h *g,\n"
16136 " const char *device);\n"
16141 #: ../src/guestfs-actions.pod:6982
16143 "This command writes zeroes over the entire C<device>. Compare with "
16144 "C<guestfs_zero> which just zeroes the first few blocks of a device."
16148 #: ../src/guestfs-actions.pod:6996
16149 msgid "(Added in 1.3.1)"
16153 #: ../src/guestfs-actions.pod:6998
16154 msgid "guestfs_zerofree"
16158 #: ../src/guestfs-actions.pod:7000
16162 " guestfs_zerofree (guestfs_h *g,\n"
16163 " const char *device);\n"
16168 #: ../src/guestfs-actions.pod:7004 ../fish/guestfish-actions.pod:4631
16170 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16171 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16172 "possible to compress the filesystem more effectively."
16176 #: ../src/guestfs-actions.pod:7009 ../fish/guestfish-actions.pod:4636
16177 msgid "You should B<not> run this program if the filesystem is mounted."
16181 #: ../src/guestfs-actions.pod:7012 ../fish/guestfish-actions.pod:4639
16183 "It is possible that using this program can damage the filesystem or data on "
16188 #: ../src/guestfs-actions.pod:7019
16189 msgid "guestfs_zfgrep"
16193 #: ../src/guestfs-actions.pod:7021
16197 " guestfs_zfgrep (guestfs_h *g,\n"
16198 " const char *pattern,\n"
16199 " const char *path);\n"
16204 #: ../src/guestfs-actions.pod:7026 ../fish/guestfish-actions.pod:4646
16206 "This calls the external C<zfgrep> program and returns the matching lines."
16210 #: ../src/guestfs-actions.pod:7038
16211 msgid "guestfs_zfgrepi"
16215 #: ../src/guestfs-actions.pod:7040
16219 " guestfs_zfgrepi (guestfs_h *g,\n"
16220 " const char *pattern,\n"
16221 " const char *path);\n"
16226 #: ../src/guestfs-actions.pod:7045 ../fish/guestfish-actions.pod:4656
16228 "This calls the external C<zfgrep -i> program and returns the matching lines."
16232 #: ../src/guestfs-actions.pod:7057
16233 msgid "guestfs_zfile"
16237 #: ../src/guestfs-actions.pod:7059
16241 " guestfs_zfile (guestfs_h *g,\n"
16242 " const char *meth,\n"
16243 " const char *path);\n"
16248 #: ../src/guestfs-actions.pod:7064 ../fish/guestfish-actions.pod:4666
16250 "This command runs C<file> after first decompressing C<path> using C<method>."
16254 #: ../src/guestfs-actions.pod:7067 ../fish/guestfish-actions.pod:4669
16255 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16259 #: ../src/guestfs-actions.pod:7069
16261 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
16266 #: ../src/guestfs-actions.pod:7075 ../fish/guestfish-actions.pod:4674
16268 "This function is deprecated. In new code, use the C<file> call instead."
16272 #: ../src/guestfs-actions.pod:7084
16273 msgid "guestfs_zgrep"
16277 #: ../src/guestfs-actions.pod:7086
16281 " guestfs_zgrep (guestfs_h *g,\n"
16282 " const char *regex,\n"
16283 " const char *path);\n"
16288 #: ../src/guestfs-actions.pod:7091 ../fish/guestfish-actions.pod:4685
16290 "This calls the external C<zgrep> program and returns the matching lines."
16294 #: ../src/guestfs-actions.pod:7103
16295 msgid "guestfs_zgrepi"
16299 #: ../src/guestfs-actions.pod:7105
16303 " guestfs_zgrepi (guestfs_h *g,\n"
16304 " const char *regex,\n"
16305 " const char *path);\n"
16310 #: ../src/guestfs-actions.pod:7110 ../fish/guestfish-actions.pod:4695
16312 "This calls the external C<zgrep -i> program and returns the matching lines."
16316 #: ../src/guestfs-availability.pod:3
16321 #: ../src/guestfs-availability.pod:5
16323 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> L</"
16324 "guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> L</"
16325 "guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> L</"
16326 "guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> L</guestfs_aug_rm> "
16327 "L</guestfs_aug_save> L</guestfs_aug_set>"
16331 #: ../src/guestfs-availability.pod:21
16336 #: ../src/guestfs-availability.pod:23
16338 "The following functions: L</guestfs_inotify_add_watch> L</"
16339 "guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> L</"
16340 "guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
16344 #: ../src/guestfs-availability.pod:31
16345 msgid "B<linuxfsuuid>"
16349 #: ../src/guestfs-availability.pod:33
16351 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> L</"
16352 "guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
16356 #: ../src/guestfs-availability.pod:40
16357 msgid "B<linuxmodules>"
16361 #: ../src/guestfs-availability.pod:42
16362 msgid "The following functions: L</guestfs_modprobe>"
16366 #: ../src/guestfs-availability.pod:45
16367 msgid "B<linuxxattrs>"
16371 #: ../src/guestfs-availability.pod:47
16373 "The following functions: L</guestfs_getxattrs> L</guestfs_lgetxattrs> L</"
16374 "guestfs_lremovexattr> L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</"
16375 "guestfs_removexattr> L</guestfs_setxattr>"
16379 #: ../src/guestfs-availability.pod:56
16384 #: ../src/guestfs-availability.pod:58
16386 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> L</"
16387 "guestfs_luks_format> L</guestfs_luks_format_cipher> L</"
16388 "guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
16392 #: ../src/guestfs-availability.pod:67
16397 #: ../src/guestfs-availability.pod:69
16399 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> L</"
16400 "guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> L</"
16401 "guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> L</"
16402 "guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> L</"
16403 "guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> L</"
16404 "guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> L</"
16405 "guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> L</guestfs_vgs_full>"
16409 #: ../src/guestfs-availability.pod:92
16414 #: ../src/guestfs-availability.pod:94
16416 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> L</"
16417 "guestfs_mknod_b> L</guestfs_mknod_c>"
16421 #: ../src/guestfs-availability.pod:100
16426 #: ../src/guestfs-availability.pod:102
16427 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
16431 #: ../src/guestfs-availability.pod:105
16432 msgid "B<ntfsprogs>"
16436 #: ../src/guestfs-availability.pod:107
16438 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_size>"
16442 #: ../src/guestfs-availability.pod:111
16443 msgid "B<realpath>"
16447 #: ../src/guestfs-availability.pod:113
16448 msgid "The following functions: L</guestfs_realpath>"
16452 #: ../src/guestfs-availability.pod:116
16457 #: ../src/guestfs-availability.pod:118
16459 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> L</"
16460 "guestfs_scrub_freespace>"
16464 #: ../src/guestfs-availability.pod:123
16469 #: ../src/guestfs-availability.pod:125
16470 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
16474 #: ../src/guestfs-availability.pod:129
16479 #: ../src/guestfs-availability.pod:131
16480 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
16484 #: ../src/guestfs-availability.pod:135
16485 msgid "B<zerofree>"
16489 #: ../src/guestfs-availability.pod:137
16490 msgid "The following functions: L</guestfs_zerofree>"
16494 #: ../src/guestfs-structs.pod:1
16495 msgid "guestfs_int_bool"
16499 #: ../src/guestfs-structs.pod:3
16502 " struct guestfs_int_bool {\n"
16510 #: ../src/guestfs-structs.pod:8
16513 " struct guestfs_int_bool_list {\n"
16514 " uint32_t len; /* Number of elements in list. */\n"
16515 " struct guestfs_int_bool *val; /* Elements. */\n"
16521 #: ../src/guestfs-structs.pod:13
16524 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
16525 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
16530 #: ../src/guestfs-structs.pod:16
16531 msgid "guestfs_lvm_pv"
16535 #: ../src/guestfs-structs.pod:18
16538 " struct guestfs_lvm_pv {\n"
16539 " char *pv_name;\n"
16540 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16541 " char pv_uuid[32];\n"
16543 " uint64_t pv_size;\n"
16544 " uint64_t dev_size;\n"
16545 " uint64_t pv_free;\n"
16546 " uint64_t pv_used;\n"
16547 " char *pv_attr;\n"
16548 " int64_t pv_pe_count;\n"
16549 " int64_t pv_pe_alloc_count;\n"
16550 " char *pv_tags;\n"
16551 " uint64_t pe_start;\n"
16552 " int64_t pv_mda_count;\n"
16553 " uint64_t pv_mda_free;\n"
16559 #: ../src/guestfs-structs.pod:36
16562 " struct guestfs_lvm_pv_list {\n"
16563 " uint32_t len; /* Number of elements in list. */\n"
16564 " struct guestfs_lvm_pv *val; /* Elements. */\n"
16570 #: ../src/guestfs-structs.pod:41
16573 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
16574 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
16579 #: ../src/guestfs-structs.pod:44
16580 msgid "guestfs_lvm_vg"
16584 #: ../src/guestfs-structs.pod:46
16587 " struct guestfs_lvm_vg {\n"
16588 " char *vg_name;\n"
16589 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16590 " char vg_uuid[32];\n"
16592 " char *vg_attr;\n"
16593 " uint64_t vg_size;\n"
16594 " uint64_t vg_free;\n"
16595 " char *vg_sysid;\n"
16596 " uint64_t vg_extent_size;\n"
16597 " int64_t vg_extent_count;\n"
16598 " int64_t vg_free_count;\n"
16599 " int64_t max_lv;\n"
16600 " int64_t max_pv;\n"
16601 " int64_t pv_count;\n"
16602 " int64_t lv_count;\n"
16603 " int64_t snap_count;\n"
16604 " int64_t vg_seqno;\n"
16605 " char *vg_tags;\n"
16606 " int64_t vg_mda_count;\n"
16607 " uint64_t vg_mda_free;\n"
16613 #: ../src/guestfs-structs.pod:69
16616 " struct guestfs_lvm_vg_list {\n"
16617 " uint32_t len; /* Number of elements in list. */\n"
16618 " struct guestfs_lvm_vg *val; /* Elements. */\n"
16624 #: ../src/guestfs-structs.pod:74
16627 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
16628 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
16633 #: ../src/guestfs-structs.pod:77
16634 msgid "guestfs_lvm_lv"
16638 #: ../src/guestfs-structs.pod:79
16641 " struct guestfs_lvm_lv {\n"
16642 " char *lv_name;\n"
16643 " /* The next field is NOT nul-terminated, be careful when printing it: */\n"
16644 " char lv_uuid[32];\n"
16645 " char *lv_attr;\n"
16646 " int64_t lv_major;\n"
16647 " int64_t lv_minor;\n"
16648 " int64_t lv_kernel_major;\n"
16649 " int64_t lv_kernel_minor;\n"
16650 " uint64_t lv_size;\n"
16651 " int64_t seg_count;\n"
16653 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16654 " float snap_percent;\n"
16655 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
16656 " float copy_percent;\n"
16657 " char *move_pv;\n"
16658 " char *lv_tags;\n"
16659 " char *mirror_log;\n"
16660 " char *modules;\n"
16666 #: ../src/guestfs-structs.pod:101
16669 " struct guestfs_lvm_lv_list {\n"
16670 " uint32_t len; /* Number of elements in list. */\n"
16671 " struct guestfs_lvm_lv *val; /* Elements. */\n"
16677 #: ../src/guestfs-structs.pod:106
16680 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
16681 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
16686 #: ../src/guestfs-structs.pod:111
16689 " struct guestfs_stat {\n"
16693 " int64_t nlink;\n"
16698 " int64_t blksize;\n"
16699 " int64_t blocks;\n"
16700 " int64_t atime;\n"
16701 " int64_t mtime;\n"
16702 " int64_t ctime;\n"
16708 #: ../src/guestfs-structs.pod:127
16711 " struct guestfs_stat_list {\n"
16712 " uint32_t len; /* Number of elements in list. */\n"
16713 " struct guestfs_stat *val; /* Elements. */\n"
16719 #: ../src/guestfs-structs.pod:132
16722 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
16723 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
16728 #: ../src/guestfs-structs.pod:137
16731 " struct guestfs_statvfs {\n"
16732 " int64_t bsize;\n"
16733 " int64_t frsize;\n"
16734 " int64_t blocks;\n"
16735 " int64_t bfree;\n"
16736 " int64_t bavail;\n"
16737 " int64_t files;\n"
16738 " int64_t ffree;\n"
16739 " int64_t favail;\n"
16742 " int64_t namemax;\n"
16748 #: ../src/guestfs-structs.pod:151
16751 " struct guestfs_statvfs_list {\n"
16752 " uint32_t len; /* Number of elements in list. */\n"
16753 " struct guestfs_statvfs *val; /* Elements. */\n"
16759 #: ../src/guestfs-structs.pod:156
16762 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
16763 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
16768 #: ../src/guestfs-structs.pod:159
16769 msgid "guestfs_dirent"
16773 #: ../src/guestfs-structs.pod:161
16776 " struct guestfs_dirent {\n"
16785 #: ../src/guestfs-structs.pod:167
16788 " struct guestfs_dirent_list {\n"
16789 " uint32_t len; /* Number of elements in list. */\n"
16790 " struct guestfs_dirent *val; /* Elements. */\n"
16796 #: ../src/guestfs-structs.pod:172
16799 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
16800 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
16805 #: ../src/guestfs-structs.pod:177
16808 " struct guestfs_version {\n"
16809 " int64_t major;\n"
16810 " int64_t minor;\n"
16811 " int64_t release;\n"
16818 #: ../src/guestfs-structs.pod:184
16821 " struct guestfs_version_list {\n"
16822 " uint32_t len; /* Number of elements in list. */\n"
16823 " struct guestfs_version *val; /* Elements. */\n"
16829 #: ../src/guestfs-structs.pod:189
16832 " void guestfs_free_version (struct guestfs_free_version *);\n"
16833 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
16838 #: ../src/guestfs-structs.pod:192
16839 msgid "guestfs_xattr"
16843 #: ../src/guestfs-structs.pod:194
16846 " struct guestfs_xattr {\n"
16847 " char *attrname;\n"
16848 " /* The next two fields describe a byte array. */\n"
16849 " uint32_t attrval_len;\n"
16850 " char *attrval;\n"
16856 #: ../src/guestfs-structs.pod:201
16859 " struct guestfs_xattr_list {\n"
16860 " uint32_t len; /* Number of elements in list. */\n"
16861 " struct guestfs_xattr *val; /* Elements. */\n"
16867 #: ../src/guestfs-structs.pod:206
16870 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
16871 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
16876 #: ../src/guestfs-structs.pod:209
16877 msgid "guestfs_inotify_event"
16881 #: ../src/guestfs-structs.pod:211
16884 " struct guestfs_inotify_event {\n"
16885 " int64_t in_wd;\n"
16886 " uint32_t in_mask;\n"
16887 " uint32_t in_cookie;\n"
16888 " char *in_name;\n"
16894 #: ../src/guestfs-structs.pod:218
16897 " struct guestfs_inotify_event_list {\n"
16898 " uint32_t len; /* Number of elements in list. */\n"
16899 " struct guestfs_inotify_event *val; /* Elements. */\n"
16905 #: ../src/guestfs-structs.pod:223
16908 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
16909 " void guestfs_free_inotify_event_list (struct guestfs_free_inotify_event_list *);\n"
16914 #: ../src/guestfs-structs.pod:226
16915 msgid "guestfs_partition"
16919 #: ../src/guestfs-structs.pod:228
16922 " struct guestfs_partition {\n"
16923 " int32_t part_num;\n"
16924 " uint64_t part_start;\n"
16925 " uint64_t part_end;\n"
16926 " uint64_t part_size;\n"
16932 #: ../src/guestfs-structs.pod:235
16935 " struct guestfs_partition_list {\n"
16936 " uint32_t len; /* Number of elements in list. */\n"
16937 " struct guestfs_partition *val; /* Elements. */\n"
16943 #: ../src/guestfs-structs.pod:240
16946 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
16947 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
16952 #: ../src/guestfs-structs.pod:243
16953 msgid "guestfs_application"
16957 #: ../src/guestfs-structs.pod:245
16960 " struct guestfs_application {\n"
16961 " char *app_name;\n"
16962 " char *app_display_name;\n"
16963 " int32_t app_epoch;\n"
16964 " char *app_version;\n"
16965 " char *app_release;\n"
16966 " char *app_install_path;\n"
16967 " char *app_trans_path;\n"
16968 " char *app_publisher;\n"
16969 " char *app_url;\n"
16970 " char *app_source_package;\n"
16971 " char *app_summary;\n"
16972 " char *app_description;\n"
16978 #: ../src/guestfs-structs.pod:260
16981 " struct guestfs_application_list {\n"
16982 " uint32_t len; /* Number of elements in list. */\n"
16983 " struct guestfs_application *val; /* Elements. */\n"
16989 #: ../src/guestfs-structs.pod:265
16992 " void guestfs_free_application (struct guestfs_free_application *);\n"
16993 " void guestfs_free_application_list (struct guestfs_free_application_list *);\n"
16998 #: ../fish/guestfish.pod:5
16999 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17003 #: ../fish/guestfish.pod:9
17006 " guestfish [--options] [commands]\n"
17011 #: ../fish/guestfish.pod:11
17019 #: ../fish/guestfish.pod:13
17022 " guestfish [--ro|--rw] -a disk.img\n"
17027 #: ../fish/guestfish.pod:15
17030 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17035 #: ../fish/guestfish.pod:17
17038 " guestfish -d libvirt-domain\n"
17043 #: ../fish/guestfish.pod:19
17046 " guestfish [--ro|--rw] -a disk.img -i\n"
17051 #: ../fish/guestfish.pod:21
17054 " guestfish -d libvirt-domain -i\n"
17059 #: ../fish/guestfish.pod:23 ../fuse/guestmount.pod:15 ../tools/virt-edit.pl:44
17060 #: ../tools/virt-win-reg.pl:51 ../tools/virt-tar.pl:59
17065 #: ../fish/guestfish.pod:25
17067 "Using guestfish in read/write mode on live virtual machines can be "
17068 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17069 "option to use guestfish safely if the disk image or virtual machine might be "
17074 #: ../fish/guestfish.pod:32
17076 "Guestfish is a shell and command-line tool for examining and modifying "
17077 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17078 "functionality of the guestfs API, see L<guestfs(3)>."
17082 #: ../fish/guestfish.pod:36
17084 "Guestfish gives you structured access to the libguestfs API, from shell "
17085 "scripts or the command line or interactively. If you want to rescue a "
17086 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17091 #: ../fish/guestfish.pod:41 ../fish/guestfish.pod:847
17092 #: ../fuse/guestmount.pod:39 ../tools/virt-edit.pl:58
17093 #: ../tools/virt-resize.pl:64 ../tools/virt-tar.pl:45
17098 #: ../fish/guestfish.pod:43
17099 msgid "As an interactive shell"
17103 #: ../fish/guestfish.pod:45
17111 #: ../fish/guestfish.pod:47
17114 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17115 " editing virtual machine filesystems.\n"
17120 #: ../fish/guestfish.pod:50
17123 " Type: 'help' for a list of commands\n"
17124 " 'man' to read the manual\n"
17125 " 'quit' to quit the shell\n"
17130 #: ../fish/guestfish.pod:54
17133 " ><fs> add-ro disk.img\n"
17135 " ><fs> list-filesystems\n"
17136 " /dev/sda1: ext4\n"
17137 " /dev/vg_guest/lv_root: ext4\n"
17138 " /dev/vg_guest/lv_swap: swap\n"
17139 " ><fs> mount /dev/vg_guest/lv_root /\n"
17140 " ><fs> cat /etc/fstab\n"
17142 " # Created by anaconda\n"
17149 #: ../fish/guestfish.pod:67
17150 msgid "From shell scripts"
17154 #: ../fish/guestfish.pod:69
17155 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17159 #: ../fish/guestfish.pod:71
17162 " guestfish <<_EOF_\n"
17165 " mount /dev/vg_guest/lv_root /\n"
17166 " write /etc/motd \"Welcome, new users\"\n"
17172 #: ../fish/guestfish.pod:78
17173 msgid "List the LVM logical volumes in a disk image:"
17177 #: ../fish/guestfish.pod:80
17180 " guestfish -a disk.img --ro <<_EOF_\n"
17188 #: ../fish/guestfish.pod:85
17189 msgid "List all the filesystems in a disk image:"
17193 #: ../fish/guestfish.pod:87
17196 " guestfish -a disk.img --ro <<_EOF_\n"
17198 " list-filesystems\n"
17204 #: ../fish/guestfish.pod:92
17205 msgid "On one command line"
17209 #: ../fish/guestfish.pod:94
17210 msgid "Update C</etc/resolv.conf> in a guest:"
17214 #: ../fish/guestfish.pod:96
17218 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17219 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17224 #: ../fish/guestfish.pod:100
17225 msgid "Edit C</boot/grub/grub.conf> interactively:"
17229 #: ../fish/guestfish.pod:102
17232 " guestfish --rw --add disk.img \\\n"
17233 " --mount /dev/vg_guest/lv_root \\\n"
17234 " --mount /dev/sda1:/boot \\\n"
17235 " edit /boot/grub/grub.conf\n"
17240 #: ../fish/guestfish.pod:107
17241 msgid "Mount disks automatically"
17245 #: ../fish/guestfish.pod:109
17247 "Use the I<-i> option to automatically mount the disks from a virtual machine:"
17251 #: ../fish/guestfish.pod:112
17254 " guestfish --ro -a disk.img -i cat /etc/group\n"
17259 #: ../fish/guestfish.pod:114
17262 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17267 #: ../fish/guestfish.pod:116
17268 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17272 #: ../fish/guestfish.pod:118
17275 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17280 #: ../fish/guestfish.pod:120
17281 msgid "As a script interpreter"
17285 #: ../fish/guestfish.pod:122
17286 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17290 #: ../fish/guestfish.pod:124
17293 " #!/usr/bin/guestfish -f\n"
17294 " sparse test1.img 100M\n"
17296 " part-disk /dev/sda mbr\n"
17297 " mkfs ext2 /dev/sda1\n"
17302 #: ../fish/guestfish.pod:130
17303 msgid "Start with a prepared disk"
17307 #: ../fish/guestfish.pod:132
17309 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17310 "single ext2-formatted partition:"
17314 #: ../fish/guestfish.pod:135
17317 " guestfish -N fs\n"
17322 #: ../fish/guestfish.pod:137
17323 msgid "To list what is available do:"
17327 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:838
17330 " guestfish -N help | less\n"
17335 #: ../fish/guestfish.pod:141
17336 msgid "Remote control"
17340 #: ../fish/guestfish.pod:143
17343 " eval \"`guestfish --listen`\"\n"
17344 " guestfish --remote add-ro disk.img\n"
17345 " guestfish --remote run\n"
17346 " guestfish --remote lvs\n"
17351 #: ../fish/guestfish.pod:148 ../test-tool/libguestfs-test-tool.pod:37
17352 #: ../fuse/guestmount.pod:73 ../tools/virt-edit.pl:72
17353 #: ../tools/virt-win-reg.pl:171 ../tools/virt-resize.pl:254
17354 #: ../tools/virt-list-filesystems.pl:53 ../tools/virt-tar.pl:98
17355 #: ../tools/virt-make-fs.pl:153 ../tools/virt-list-partitions.pl:54
17360 #: ../fish/guestfish.pod:152 ../fuse/guestmount.pod:131
17361 #: ../tools/virt-edit.pl:80 ../tools/virt-win-reg.pl:179
17362 #: ../tools/virt-resize.pl:262 ../tools/virt-list-filesystems.pl:61
17363 #: ../tools/virt-tar.pl:106 ../tools/virt-make-fs.pl:161
17364 #: ../tools/virt-list-partitions.pl:62
17369 #: ../fish/guestfish.pod:154
17370 msgid "Displays general help on options."
17374 #: ../fish/guestfish.pod:156
17375 msgid "B<-h> | B<--cmd-help>"
17379 #: ../fish/guestfish.pod:158
17380 msgid "Lists all available guestfish commands."
17384 #: ../fish/guestfish.pod:160
17385 msgid "B<-h cmd> | B<--cmd-help cmd>"
17389 #: ../fish/guestfish.pod:162
17390 msgid "Displays detailed help on a single command C<cmd>."
17394 #: ../fish/guestfish.pod:164 ../fuse/guestmount.pod:77
17395 msgid "B<-a image> | B<--add image>"
17399 #: ../fish/guestfish.pod:166
17400 msgid "Add a block device or virtual machine image to the shell."
17404 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:81
17406 "The format of the disk image is auto-detected. To override this and force a "
17407 "particular format use the I<--format=..> option."
17411 #: ../fish/guestfish.pod:171 ../fuse/guestmount.pod:84
17412 msgid "B<-c URI> | B<--connect URI>"
17416 #: ../fish/guestfish.pod:173 ../fuse/guestmount.pod:86
17418 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17419 "URI to use. The default is to use the default libvirt connection."
17423 #: ../fish/guestfish.pod:177
17428 #: ../fish/guestfish.pod:179
17430 "If using the I<--listen> option and a csh-like shell, use this option. See "
17431 "section L</REMOTE CONTROL AND CSH> below."
17435 #: ../fish/guestfish.pod:182 ../fuse/guestmount.pod:90
17436 msgid "B<-d libvirt-domain> | B<--domain libvirt-domain>"
17440 #: ../fish/guestfish.pod:184 ../fuse/guestmount.pod:92
17442 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17443 "used, then any libvirt domain can be used. However in write mode, only "
17444 "libvirt domains which are shut down can be named here."
17448 #: ../fish/guestfish.pod:188
17449 msgid "B<-D> | B<--no-dest-paths>"
17453 #: ../fish/guestfish.pod:190
17455 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17456 "to hit the tab key to complete paths on the guest filesystem, but this "
17457 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17458 "allow this feature to be disabled."
17462 #: ../fish/guestfish.pod:195 ../fuse/guestmount.pod:108
17463 msgid "B<--echo-keys>"
17467 #: ../fish/guestfish.pod:197 ../fuse/guestmount.pod:110
17469 "When prompting for keys and passphrases, guestfish normally turns echoing "
17470 "off so you cannot see what you are typing. If you are not worried about "
17471 "Tempest attacks and there is no one else in the room you can specify this "
17472 "flag to see what you are typing."
17476 #: ../fish/guestfish.pod:202
17477 msgid "B<-f file> | B<--file file>"
17481 #: ../fish/guestfish.pod:204
17482 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17486 #: ../fish/guestfish.pod:207
17489 " #!/usr/bin/guestfish -f\n"
17494 #: ../fish/guestfish.pod:209 ../fuse/guestmount.pod:115
17495 msgid "B<--format=raw|qcow2|..> | B<--format>"
17499 #: ../fish/guestfish.pod:211 ../fuse/guestmount.pod:117
17501 "The default for the I<-a> option is to auto-detect the format of the disk "
17502 "image. Using this forces the disk format for I<-a> options which follow on "
17503 "the command line. Using I<--format> with no argument switches back to auto-"
17504 "detection for subsequent I<-a> options."
17508 #: ../fish/guestfish.pod:216 ../fish/guestfish.pod:544
17509 msgid "For example:"
17513 #: ../fish/guestfish.pod:218
17516 " guestfish --format=raw -a disk.img\n"
17521 #: ../fish/guestfish.pod:220
17522 msgid "forces raw format (no auto-detection) for C<disk.img>."
17526 #: ../fish/guestfish.pod:222
17529 " guestfish --format=raw -a disk.img --format -a another.img\n"
17534 #: ../fish/guestfish.pod:224
17536 "forces raw format (no auto-detection) for C<disk.img> and reverts to auto-"
17537 "detection for C<another.img>."
17541 #: ../fish/guestfish.pod:227
17543 "If you have untrusted raw-format guest disk images, you should use this "
17544 "option to specify the disk format. This avoids a possible security problem "
17545 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17549 #: ../fish/guestfish.pod:232 ../fuse/guestmount.pod:135
17550 msgid "B<-i> | B<--inspector>"
17554 #: ../fish/guestfish.pod:234 ../fuse/guestmount.pod:137
17556 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17557 "system and mount filesystems as they would be mounted on the real virtual "
17562 #: ../fish/guestfish.pod:238
17563 msgid "Typical usage is either:"
17567 #: ../fish/guestfish.pod:240
17570 " guestfish -d myguest -i\n"
17575 #: ../fish/guestfish.pod:242
17576 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17580 #: ../fish/guestfish.pod:244
17583 " guestfish --ro -d myguest -i\n"
17588 #: ../fish/guestfish.pod:246
17589 msgid "(for active domains, readonly), or specify the block device directly:"
17593 #: ../fish/guestfish.pod:248
17596 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17601 #: ../fish/guestfish.pod:250
17603 "Note that the command line syntax changed slightly over older versions of "
17604 "guestfish. You can still use the old syntax:"
17608 #: ../fish/guestfish.pod:253
17611 " guestfish [--ro] -i disk.img\n"
17616 #: ../fish/guestfish.pod:255
17619 " guestfish [--ro] -i libvirt-domain\n"
17624 #: ../fish/guestfish.pod:257 ../fuse/guestmount.pod:141
17625 msgid "B<--keys-from-stdin>"
17629 #: ../fish/guestfish.pod:259 ../fuse/guestmount.pod:143
17631 "Read key or passphrase parameters from stdin. The default is to try to read "
17632 "passphrases from the user by opening C</dev/tty>."
17636 #: ../fish/guestfish.pod:262
17637 msgid "B<--listen>"
17641 #: ../fish/guestfish.pod:264
17643 "Fork into the background and listen for remote commands. See section L</"
17644 "REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17648 #: ../fish/guestfish.pod:267
17649 msgid "B<-m dev[:mountpoint]> | B<--mount dev[:mountpoint]>"
17653 #: ../fish/guestfish.pod:269
17654 msgid "Mount the named partition or logical volume on the given mountpoint."
17658 #: ../fish/guestfish.pod:271
17659 msgid "If the mountpoint is omitted, it defaults to C</>."
17663 #: ../fish/guestfish.pod:273
17664 msgid "You have to mount something on C</> before most commands will work."
17668 #: ../fish/guestfish.pod:275
17670 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17675 #: ../fish/guestfish.pod:278
17677 "If you don't know what filesystems a disk image contains, you can either run "
17678 "guestfish without this option, then list the partitions, filesystems and LVs "
17679 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17680 "commands), or you can use the L<virt-filesystems(1)> program."
17684 #: ../fish/guestfish.pod:284 ../fuse/guestmount.pod:154
17685 msgid "B<-n> | B<--no-sync>"
17689 #: ../fish/guestfish.pod:286
17691 "Disable autosync. This is enabled by default. See the discussion of "
17692 "autosync in the L<guestfs(3)> manpage."
17696 #: ../fish/guestfish.pod:289
17697 msgid "B<-N type> | B<--new type> | B<-N help>"
17701 #: ../fish/guestfish.pod:291
17703 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17704 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17705 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17710 #: ../fish/guestfish.pod:296
17711 msgid "B<--progress-bars>"
17715 #: ../fish/guestfish.pod:298
17716 msgid "Enable progress bars, even when guestfish is used non-interactively."
17720 #: ../fish/guestfish.pod:300
17722 "Progress bars are enabled by default when guestfish is used as an "
17723 "interactive shell."
17727 #: ../fish/guestfish.pod:303
17728 msgid "B<--no-progress-bars>"
17732 #: ../fish/guestfish.pod:305
17733 msgid "Disable progress bars."
17737 #: ../fish/guestfish.pod:307
17738 msgid "B<--remote[=pid]>"
17742 #: ../fish/guestfish.pod:309
17744 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17745 "CONTROL GUESTFISH OVER A SOCKET> below."
17749 #: ../fish/guestfish.pod:312 ../fuse/guestmount.pod:196
17750 msgid "B<-r> | B<--ro>"
17754 #: ../fish/guestfish.pod:314
17756 "This changes the I<-a> and I<-m> options so that disks are added and mounts "
17757 "are done read-only (see L<guestfs(3)/guestfs_mount_ro>)."
17761 #: ../fish/guestfish.pod:317
17763 "The option must always be used if the disk image or virtual machine might be "
17764 "running, and is generally recommended in cases where you don't need write "
17765 "access to the disk."
17769 #: ../fish/guestfish.pod:321
17771 "Note that prepared disk images created with I<-N> are not affected by the "
17776 #: ../fish/guestfish.pod:324
17777 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17781 #: ../fish/guestfish.pod:326 ../fuse/guestmount.pod:208
17782 msgid "B<--selinux>"
17786 #: ../fish/guestfish.pod:328
17787 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17791 #: ../fish/guestfish.pod:330 ../fuse/guestmount.pod:212
17792 msgid "B<-v> | B<--verbose>"
17796 #: ../fish/guestfish.pod:332
17798 "Enable very verbose messages. This is particularly useful if you find a bug."
17802 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:216
17803 msgid "B<-V> | B<--version>"
17807 #: ../fish/guestfish.pod:337
17808 msgid "Display the guestfish / libguestfs version number and exit."
17812 #: ../fish/guestfish.pod:339 ../fuse/guestmount.pod:220
17813 msgid "B<-w> | B<--rw>"
17817 #: ../fish/guestfish.pod:341
17819 "This option does nothing at the moment. See L</OPENING DISKS FOR READ AND "
17824 #: ../fish/guestfish.pod:344
17829 #: ../fish/guestfish.pod:346
17830 msgid "Echo each command before executing it."
17834 #: ../fish/guestfish.pod:350
17835 msgid "COMMANDS ON COMMAND LINE"
17839 #: ../fish/guestfish.pod:352
17841 "Any additional (non-option) arguments are treated as commands to execute."
17845 #: ../fish/guestfish.pod:355
17847 "Commands to execute should be separated by a colon (C<:>), where the colon "
17848 "is a separate parameter. Thus:"
17852 #: ../fish/guestfish.pod:358
17855 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17860 #: ../fish/guestfish.pod:360
17862 "If there are no additional arguments, then we enter a shell, either an "
17863 "interactive shell with a prompt (if the input is a terminal) or a non-"
17864 "interactive shell."
17868 #: ../fish/guestfish.pod:364
17870 "In either command line mode or non-interactive shell, the first command that "
17871 "gives an error causes the whole shell to exit. In interactive mode (with a "
17872 "prompt) if a command fails, you can continue to enter commands."
17876 #: ../fish/guestfish.pod:369
17877 msgid "USING launch (OR run)"
17881 #: ../fish/guestfish.pod:371
17883 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17884 "then launch it, then mount any disks you need, and finally issue actions/"
17885 "commands. So the general order of the day is:"
17889 #: ../fish/guestfish.pod:379
17890 msgid "add or -a/--add"
17894 #: ../fish/guestfish.pod:383
17895 msgid "launch (aka run)"
17899 #: ../fish/guestfish.pod:387
17900 msgid "mount or -m/--mount"
17904 #: ../fish/guestfish.pod:391
17905 msgid "any other commands"
17909 #: ../fish/guestfish.pod:395
17911 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17912 "guest before mounting or performing any other commands."
17916 #: ../fish/guestfish.pod:398
17918 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17919 "I<--new> options were given then C<run> is done automatically, simply "
17920 "because guestfish can't perform the action you asked for without doing this."
17924 #: ../fish/guestfish.pod:403
17925 msgid "OPENING DISKS FOR READ AND WRITE"
17929 #: ../fish/guestfish.pod:405
17931 "The guestfish (and L<guestmount(1)>) options I<--ro> and I<--rw> affect "
17932 "whether the other command line options I<-a>, I<-c>, I<-d>, I<-i> and I<-m> "
17933 "open disk images read-only or for writing."
17937 #: ../fish/guestfish.pod:409
17939 "In libguestfs E<lt> 1.6.2, guestfish and guestmount defaulted to opening "
17940 "disk images supplied on the command line for write. To open a disk image "
17941 "read-only you have to do I<-a image --ro>."
17945 #: ../fish/guestfish.pod:413
17947 "This matters: If you accidentally open a live VM disk image writable then "
17948 "you will cause irreversible disk corruption."
17952 #: ../fish/guestfish.pod:416
17954 "By libguestfs 1.8 we intend to change the default the other way. Disk "
17955 "images will be opened read-only. You will have to either specify "
17956 "I<guestfish --rw> or change a configuration file in order to get write "
17957 "access for disk images specified by those other command line options."
17961 #: ../fish/guestfish.pod:421
17963 "This version of guestfish has a I<--rw> option which does nothing (it is "
17964 "already the default). However it is highly recommended that you use this "
17965 "option to indicate that guestfish needs write access, and to prepare your "
17966 "scripts for the day when this option will be required for write access."
17970 #: ../fish/guestfish.pod:427
17972 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17973 "other libguestfs program apart from guestfish and guestmount."
17977 #: ../fish/guestfish.pod:430
17982 #: ../fish/guestfish.pod:432
17984 "You can quote ordinary parameters using either single or double quotes. For "
17989 #: ../fish/guestfish.pod:435
17992 " add \"file with a space.img\"\n"
17997 #: ../fish/guestfish.pod:437
18000 " rm '/file name'\n"
18005 #: ../fish/guestfish.pod:439
18013 #: ../fish/guestfish.pod:441
18015 "A few commands require a list of strings to be passed. For these, use a "
18016 "whitespace-separated list, enclosed in quotes. Strings containing "
18017 "whitespace to be passed through must be enclosed in single quotes. A "
18018 "literal single quote must be escaped with a backslash."
18022 #: ../fish/guestfish.pod:446
18025 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18026 " command \"/bin/echo 'foo bar'\"\n"
18027 " command \"/bin/echo \\'foo\\'\"\n"
18032 #: ../fish/guestfish.pod:450
18033 msgid "OPTIONAL ARGUMENTS"
18037 #: ../fish/guestfish.pod:452
18039 "Some commands take optional arguments. These arguments appear in this "
18040 "documentation as C<[argname:..]>. You can use them as in these examples:"
18044 #: ../fish/guestfish.pod:456
18047 " add-drive-opts filename\n"
18052 #: ../fish/guestfish.pod:458
18055 " add-drive-opts filename readonly:true\n"
18060 #: ../fish/guestfish.pod:460
18063 " add-drive-opts filename format:qcow2 readonly:false\n"
18068 #: ../fish/guestfish.pod:462
18070 "Each optional argument can appear at most once. All optional arguments must "
18071 "appear after the required ones."
18075 #: ../fish/guestfish.pod:465
18080 #: ../fish/guestfish.pod:467
18082 "This section applies to all commands which can take integers as parameters."
18086 #: ../fish/guestfish.pod:470
18087 msgid "SIZE SUFFIX"
18091 #: ../fish/guestfish.pod:472
18093 "When the command takes a parameter measured in bytes, you can use one of the "
18094 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18098 #: ../fish/guestfish.pod:478
18099 msgid "B<k> or B<K> or B<KiB>"
18103 #: ../fish/guestfish.pod:480
18104 msgid "The size in kilobytes (multiplied by 1024)."
18108 #: ../fish/guestfish.pod:482
18113 #: ../fish/guestfish.pod:484
18114 msgid "The size in SI 1000 byte units."
18118 #: ../fish/guestfish.pod:486
18119 msgid "B<M> or B<MiB>"
18123 #: ../fish/guestfish.pod:488
18124 msgid "The size in megabytes (multiplied by 1048576)."
18128 #: ../fish/guestfish.pod:490
18133 #: ../fish/guestfish.pod:492
18134 msgid "The size in SI 1000000 byte units."
18138 #: ../fish/guestfish.pod:494
18139 msgid "B<G> or B<GiB>"
18143 #: ../fish/guestfish.pod:496
18144 msgid "The size in gigabytes (multiplied by 2**30)."
18148 #: ../fish/guestfish.pod:498
18153 #: ../fish/guestfish.pod:500
18154 msgid "The size in SI 10**9 byte units."
18158 #: ../fish/guestfish.pod:502
18159 msgid "B<T> or B<TiB>"
18163 #: ../fish/guestfish.pod:504
18164 msgid "The size in terabytes (multiplied by 2**40)."
18168 #: ../fish/guestfish.pod:506
18173 #: ../fish/guestfish.pod:508
18174 msgid "The size in SI 10**12 byte units."
18178 #: ../fish/guestfish.pod:510
18179 msgid "B<P> or B<PiB>"
18183 #: ../fish/guestfish.pod:512
18184 msgid "The size in petabytes (multiplied by 2**50)."
18188 #: ../fish/guestfish.pod:514
18193 #: ../fish/guestfish.pod:516
18194 msgid "The size in SI 10**15 byte units."
18198 #: ../fish/guestfish.pod:518
18199 msgid "B<E> or B<EiB>"
18203 #: ../fish/guestfish.pod:520
18204 msgid "The size in exabytes (multiplied by 2**60)."
18208 #: ../fish/guestfish.pod:522
18213 #: ../fish/guestfish.pod:524
18214 msgid "The size in SI 10**18 byte units."
18218 #: ../fish/guestfish.pod:526
18219 msgid "B<Z> or B<ZiB>"
18223 #: ../fish/guestfish.pod:528
18224 msgid "The size in zettabytes (multiplied by 2**70)."
18228 #: ../fish/guestfish.pod:530
18233 #: ../fish/guestfish.pod:532
18234 msgid "The size in SI 10**21 byte units."
18238 #: ../fish/guestfish.pod:534
18239 msgid "B<Y> or B<YiB>"
18243 #: ../fish/guestfish.pod:536
18244 msgid "The size in yottabytes (multiplied by 2**80)."
18248 #: ../fish/guestfish.pod:538
18253 #: ../fish/guestfish.pod:540
18254 msgid "The size in SI 10**24 byte units."
18258 #: ../fish/guestfish.pod:546
18261 " truncate-size /file 1G\n"
18266 #: ../fish/guestfish.pod:548
18267 msgid "would truncate the file to 1 gigabyte."
18271 #: ../fish/guestfish.pod:550
18273 "Be careful because a few commands take sizes in kilobytes or megabytes (eg. "
18274 "the parameter to L</memsize> is specified in megabytes already). Adding a "
18275 "suffix will probably not do what you expect."
18279 #: ../fish/guestfish.pod:554
18280 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18284 #: ../fish/guestfish.pod:556
18286 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18287 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18291 #: ../fish/guestfish.pod:559
18294 " 1234 decimal number 1234\n"
18295 " 02322 octal number, equivalent to decimal 1234\n"
18296 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18301 #: ../fish/guestfish.pod:563
18303 "When using the C<chmod> command, you almost always want to specify an octal "
18304 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18305 "L<chmod(1)> program):"
18309 #: ../fish/guestfish.pod:567
18312 " chmod 0777 /public # OK\n"
18313 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18318 #: ../fish/guestfish.pod:570
18320 "Commands that return numbers usually print them in decimal, but some "
18321 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18322 "octal, preceeded by C<0>)."
18326 #: ../fish/guestfish.pod:574
18327 msgid "WILDCARDS AND GLOBBING"
18331 #: ../fish/guestfish.pod:576
18333 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18334 "(globbing) by default. So for example the following will not do what you "
18339 #: ../fish/guestfish.pod:580
18347 #: ../fish/guestfish.pod:582
18349 "Assuming you don't have a directory called literally C</home/*> then the "
18350 "above command will return an error."
18354 #: ../fish/guestfish.pod:585
18355 msgid "To perform wildcard expansion, use the C<glob> command."
18359 #: ../fish/guestfish.pod:587
18362 " glob rm-rf /home/*\n"
18367 #: ../fish/guestfish.pod:589
18369 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18370 "many times), equivalent to:"
18374 #: ../fish/guestfish.pod:592
18377 " rm-rf /home/jim\n"
18378 " rm-rf /home/joe\n"
18379 " rm-rf /home/mary\n"
18384 #: ../fish/guestfish.pod:596
18385 msgid "C<glob> only works on simple guest paths and not on device names."
18389 #: ../fish/guestfish.pod:598
18391 "If you have several parameters, each containing a wildcard, then glob will "
18392 "perform a Cartesian product."
18396 #: ../fish/guestfish.pod:601
18401 #: ../fish/guestfish.pod:603
18403 "Any line which starts with a I<#> character is treated as a comment and "
18404 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18405 "a command. For example:"
18409 #: ../fish/guestfish.pod:607
18412 " # this is a comment\n"
18413 " # this is a comment\n"
18414 " foo # NOT a comment\n"
18419 #: ../fish/guestfish.pod:611
18420 msgid "Blank lines are also ignored."
18424 #: ../fish/guestfish.pod:613
18425 msgid "RUNNING COMMANDS LOCALLY"
18429 #: ../fish/guestfish.pod:615
18431 "Any line which starts with a I<!> character is treated as a command sent to "
18432 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18436 #: ../fish/guestfish.pod:619
18440 " tgz-out /remote local/remote-data.tar.gz\n"
18445 #: ../fish/guestfish.pod:622
18447 "will create a directory C<local> on the host, and then export the contents "
18448 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18449 "(See C<tgz-out>)."
18453 #: ../fish/guestfish.pod:626
18455 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18456 "effect, due to the way that subprocesses work in Unix."
18460 #: ../fish/guestfish.pod:629
18465 #: ../fish/guestfish.pod:631
18467 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18468 "command (a guestfish command) to the second command (any host command). For "
18473 #: ../fish/guestfish.pod:635
18476 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18481 #: ../fish/guestfish.pod:637
18483 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18484 "program). The above command would list all accounts in the guest filesystem "
18485 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18489 #: ../fish/guestfish.pod:642
18492 " hexdump /bin/ls | head\n"
18493 " list-devices | tail -1\n"
18494 " tgz-out / - | tar ztf -\n"
18499 #: ../fish/guestfish.pod:646
18501 "The space before the pipe symbol is required, any space after the pipe "
18502 "symbol is optional. Everything after the pipe symbol is just passed "
18503 "straight to the host shell, so it can contain redirections, globs and "
18504 "anything else that makes sense on the host side."
18508 #: ../fish/guestfish.pod:651
18510 "To use a literal argument which begins with a pipe symbol, you have to quote "
18515 #: ../fish/guestfish.pod:654
18523 #: ../fish/guestfish.pod:656
18524 msgid "HOME DIRECTORIES"
18528 #: ../fish/guestfish.pod:658
18530 "If a parameter starts with the character C<~> then the tilde may be expanded "
18531 "as a home directory path (either C<~> for the current user's home directory, "
18532 "or C<~user> for another user)."
18536 #: ../fish/guestfish.pod:662
18538 "Note that home directory expansion happens for users known I<on the host>, "
18539 "not in the guest filesystem."
18543 #: ../fish/guestfish.pod:665
18545 "To use a literal argument which begins with a tilde, you have to quote it, "
18550 #: ../fish/guestfish.pod:668
18558 #: ../fish/guestfish.pod:672
18560 "Libguestfs has some support for Linux guests encrypted according to the "
18561 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18562 "disk encryption systems used by modern Linux guests. Currently only LVM-on-"
18563 "LUKS is supported."
18567 #: ../fish/guestfish.pod:677
18568 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18572 #: ../fish/guestfish.pod:679
18575 " ><fs> vfs-type /dev/sda2\n"
18581 #: ../fish/guestfish.pod:682
18583 "Then open those devices using L</luks-open>. This creates a device-mapper "
18584 "device called C</dev/mapper/luksdev>."
18588 #: ../fish/guestfish.pod:685
18591 " ><fs> luks-open /dev/sda2 luksdev\n"
18592 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18597 #: ../fish/guestfish.pod:688
18599 "Finally you have to tell LVM to scan for volume groups on the newly created "
18604 #: ../fish/guestfish.pod:691
18608 " vg-activate-all true\n"
18613 #: ../fish/guestfish.pod:694
18614 msgid "The logical volume(s) can now be mounted in the usual way."
18618 #: ../fish/guestfish.pod:696
18620 "Before closing a LUKS device you must unmount any logical volumes on it and "
18621 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18622 "one. Then you can close the mapper device:"
18626 #: ../fish/guestfish.pod:700
18629 " vg-activate false /dev/VG\n"
18630 " luks-close /dev/mapper/luksdev\n"
18635 #: ../fish/guestfish.pod:703
18636 msgid "WINDOWS PATHS"
18640 #: ../fish/guestfish.pod:705
18642 "If a path is prefixed with C<win:> then you can use Windows-style paths "
18643 "(with some limitations). The following commands are equivalent:"
18647 #: ../fish/guestfish.pod:708
18650 " file /WINDOWS/system32/config/system.LOG\n"
18655 #: ../fish/guestfish.pod:710
18658 " file win:/windows/system32/config/system.log\n"
18663 #: ../fish/guestfish.pod:712
18666 " file win:\\windows\\system32\\config\\system.log\n"
18671 #: ../fish/guestfish.pod:714
18674 " file WIN:C:\\Windows\\SYSTEM32\\conFIG\\SYSTEM.LOG\n"
18679 #: ../fish/guestfish.pod:716
18681 "This syntax implicitly calls C<case-sensitive-path> (q.v.) so it also "
18682 "handles case insensitivity like Windows would. This only works in argument "
18683 "positions that expect a path."
18687 #: ../fish/guestfish.pod:720
18688 msgid "UPLOADING AND DOWNLOADING FILES"
18692 #: ../fish/guestfish.pod:722
18694 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18695 "others which upload from or download to a local file, you can use the "
18696 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18700 #: ../fish/guestfish.pod:726
18708 #: ../fish/guestfish.pod:728
18710 "reads stdin and creates from that a file C</foo> in the disk image, and:"
18714 #: ../fish/guestfish.pod:731
18717 " tar-out /etc - | tar tf -\n"
18722 #: ../fish/guestfish.pod:733
18724 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18725 "command (see L</PIPES>)."
18729 #: ../fish/guestfish.pod:736
18731 "When using C<-> to read from stdin, the input is read up to the end of "
18732 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18733 "some arbitrary end marker:"
18737 #: ../fish/guestfish.pod:740
18740 " upload -<<END /foo\n"
18749 #: ../fish/guestfish.pod:746
18751 "Any string of characters can be used instead of C<END>. The end marker must "
18752 "appear on a line of its own, without any preceeding or following characters "
18753 "(not even spaces)."
18757 #: ../fish/guestfish.pod:750
18759 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18760 "upload local files (so-called \"FileIn\" parameters in the generator)."
18764 #: ../fish/guestfish.pod:753
18765 msgid "EXIT ON ERROR BEHAVIOUR"
18769 #: ../fish/guestfish.pod:755
18771 "By default, guestfish will ignore any errors when in interactive mode (ie. "
18772 "taking commands from a human over a tty), and will exit on the first error "
18773 "in non-interactive mode (scripts, commands given on the command line)."
18777 #: ../fish/guestfish.pod:760
18779 "If you prefix a command with a I<-> character, then that command will not "
18780 "cause guestfish to exit, even if that (one) command returns an error."
18784 #: ../fish/guestfish.pod:764
18785 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18789 #: ../fish/guestfish.pod:766
18791 "Guestfish can be remote-controlled over a socket. This is useful "
18792 "particularly in shell scripts where you want to make several different "
18793 "changes to a filesystem, but you don't want the overhead of starting up a "
18794 "guestfish process each time."
18798 #: ../fish/guestfish.pod:771
18799 msgid "Start a guestfish server process using:"
18803 #: ../fish/guestfish.pod:773
18806 " eval \"`guestfish --listen`\"\n"
18811 #: ../fish/guestfish.pod:775
18812 msgid "and then send it commands by doing:"
18816 #: ../fish/guestfish.pod:777
18819 " guestfish --remote cmd [...]\n"
18824 #: ../fish/guestfish.pod:779
18825 msgid "To cause the server to exit, send it the exit command:"
18829 #: ../fish/guestfish.pod:781
18832 " guestfish --remote exit\n"
18837 #: ../fish/guestfish.pod:783
18839 "Note that the server will normally exit if there is an error in a command. "
18840 "You can change this in the usual way. See section L</EXIT ON ERROR "
18845 #: ../fish/guestfish.pod:787
18846 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18850 #: ../fish/guestfish.pod:789
18852 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18853 "is how the I<--remote> option knows where to send the commands. You can "
18854 "have several guestfish listener processes running using:"
18858 #: ../fish/guestfish.pod:793
18861 " eval \"`guestfish --listen`\"\n"
18862 " pid1=$GUESTFISH_PID\n"
18863 " eval \"`guestfish --listen`\"\n"
18864 " pid2=$GUESTFISH_PID\n"
18866 " guestfish --remote=$pid1 cmd\n"
18867 " guestfish --remote=$pid2 cmd\n"
18872 #: ../fish/guestfish.pod:801
18873 msgid "REMOTE CONTROL AND CSH"
18877 #: ../fish/guestfish.pod:803
18879 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18884 #: ../fish/guestfish.pod:806
18887 " eval \"`guestfish --listen --csh`\"\n"
18892 #: ../fish/guestfish.pod:808
18893 msgid "REMOTE CONTROL DETAILS"
18897 #: ../fish/guestfish.pod:810
18899 "Remote control happens over a Unix domain socket called C</tmp/.guestfish-"
18900 "$UID/socket-$PID>, where C<$UID> is the effective user ID of the process, "
18901 "and C<$PID> is the process ID of the server."
18905 #: ../fish/guestfish.pod:814
18906 msgid "Guestfish client and server versions must match exactly."
18910 #: ../fish/guestfish.pod:816
18911 msgid "PREPARED DISK IMAGES"
18915 #: ../fish/guestfish.pod:818
18917 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
18918 "preformatted disk images that guestfish can make for you to save typing. "
18919 "This is particularly useful for testing purposes. This option is used "
18920 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
18921 "can be mixed with I<-a>)."
18925 #: ../fish/guestfish.pod:824
18927 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
18928 "the second and so on. Existing files in the current directory are "
18933 #: ../fish/guestfish.pod:828
18935 "The type briefly describes how the disk should be sized, partitioned, how "
18936 "filesystem(s) should be created, and how content should be added. "
18937 "Optionally the type can be followed by extra parameters, separated by C<:> "
18938 "(colon) characters. For example, I<-N fs> creates a default 100MB, sparsely-"
18939 "allocated disk, containing a single partition, with the partition formatted "
18940 "as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem on a 1GB "
18945 #: ../fish/guestfish.pod:836
18946 msgid "To list the available types and any extra parameters they take, run:"
18950 #: ../fish/guestfish.pod:840
18952 "Note that the prepared filesystem is not mounted. You would usually have to "
18953 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
18957 #: ../fish/guestfish.pod:844
18959 "If any I<-N> or I<--new> options are given, the guest is automatically "
18964 #: ../fish/guestfish.pod:849
18965 msgid "Create a 100MB disk with an ext4-formatted partition:"
18969 #: ../fish/guestfish.pod:851
18972 " guestfish -N fs:ext4\n"
18977 #: ../fish/guestfish.pod:853
18978 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
18982 #: ../fish/guestfish.pod:855
18985 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
18990 #: ../fish/guestfish.pod:857
18991 msgid "Create a blank 200MB disk:"
18995 #: ../fish/guestfish.pod:859
18998 " guestfish -N disk:200M\n"
19003 #: ../fish/guestfish.pod:861
19004 msgid "PROGRESS BARS"
19008 #: ../fish/guestfish.pod:863
19010 "Some (not all) long-running commands send progress notification messages as "
19011 "they are running. Guestfish turns these messages into progress bars."
19015 #: ../fish/guestfish.pod:867
19017 "When a command that supports progress bars takes longer than two seconds to "
19018 "run, and if progress bars are enabled, then you will see one appearing below "
19023 #: ../fish/guestfish.pod:871
19026 " ><fs> copy-size /large-file /another-file 2048M\n"
19027 " / 10% [#####-----------------------------------------] 00:30\n"
19032 #: ../fish/guestfish.pod:874
19034 "The spinner on the left hand side moves round once for every progress "
19035 "notification received from the backend. This is a (reasonably) golden "
19036 "assurance that the command is \"doing something\" even if the progress bar "
19037 "is not moving, because the command is able to send the progress "
19038 "notifications. When the bar reaches 100% and the command finishes, the "
19039 "spinner disappears."
19043 #: ../fish/guestfish.pod:881
19045 "Progress bars are enabled by default when guestfish is used interactively. "
19046 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19047 "and you can disable them completely using I<--no-progress-bars>."
19051 #: ../fish/guestfish.pod:886
19052 msgid "GUESTFISH COMMANDS"
19056 #: ../fish/guestfish.pod:888
19058 "The commands in this section are guestfish convenience commands, in other "
19059 "words, they are not part of the L<guestfs(3)> API."
19063 #: ../fish/guestfish.pod:891
19068 #: ../fish/guestfish.pod:893
19077 #: ../fish/guestfish.pod:896
19078 msgid "Without any parameter, this provides general help."
19082 #: ../fish/guestfish.pod:898
19083 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19087 #: ../fish/guestfish.pod:900
19088 msgid "quit | exit"
19092 #: ../fish/guestfish.pod:902
19093 msgid "This exits guestfish. You can also use C<^D> key."
19097 #: ../fish/guestfish.pod:904
19098 msgid "@FISH_COMMANDS@"
19102 #: ../fish/guestfish.pod:906
19107 #: ../fish/guestfish.pod:910 ../test-tool/libguestfs-test-tool.pod:83
19112 #: ../fish/guestfish.pod:912
19114 "guestfish returns 0 if the commands completed without error, or 1 if there "
19119 #: ../fish/guestfish.pod:919
19124 #: ../fish/guestfish.pod:921
19126 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19131 #: ../fish/guestfish.pod:924
19132 msgid "GUESTFISH_PID"
19136 #: ../fish/guestfish.pod:926
19138 "Used with the I<--remote> option to specify the remote guestfish process to "
19139 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19143 #: ../fish/guestfish.pod:930
19148 #: ../fish/guestfish.pod:932
19150 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19151 "not specified, the external L<hexedit(1)> program is used."
19155 #: ../fish/guestfish.pod:936
19160 #: ../fish/guestfish.pod:938
19162 "If compiled with GNU readline support, various files in the home directory "
19163 "can be used. See L</FILES>."
19167 #: ../fish/guestfish.pod:947
19169 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19170 "effect as using the B<-v> option."
19174 #: ../fish/guestfish.pod:959
19176 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19177 "the discussion of paths in L<guestfs(3)>."
19181 #: ../fish/guestfish.pod:970
19182 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19186 #: ../fish/guestfish.pod:972
19191 #: ../fish/guestfish.pod:974
19193 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19198 #: ../fish/guestfish.pod:989 ../test-tool/libguestfs-test-tool.pod:88
19203 #: ../fish/guestfish.pod:993
19204 msgid "$HOME/.guestfish"
19208 #: ../fish/guestfish.pod:995
19210 "If compiled with GNU readline support, then the command history is saved in "
19215 #: ../fish/guestfish.pod:998
19216 msgid "$HOME/.inputrc"
19220 #: ../fish/guestfish.pod:1000
19221 msgid "/etc/inputrc"
19225 #: ../fish/guestfish.pod:1002
19227 "If compiled with GNU readline support, then these files can be used to "
19228 "configure readline. For further information, please see L<readline(3)/"
19229 "INITIALIZATION FILE>."
19233 #: ../fish/guestfish.pod:1006
19234 msgid "To write rules which only apply to guestfish, use:"
19238 #: ../fish/guestfish.pod:1008
19248 #: ../fish/guestfish.pod:1012
19250 "Variables that you can set in inputrc that change the behaviour of guestfish "
19251 "in useful ways include:"
19255 #: ../fish/guestfish.pod:1017
19256 msgid "completion-ignore-case (default: on)"
19260 #: ../fish/guestfish.pod:1019
19262 "By default, guestfish will ignore case when tab-completing paths on the "
19267 #: ../fish/guestfish.pod:1022
19270 " set completion-ignore-case off\n"
19275 #: ../fish/guestfish.pod:1024
19276 msgid "to make guestfish case sensitive."
19280 #: ../fish/guestfish.pod:1028
19285 #: ../fish/guestfish.pod:1030
19286 msgid "test2.img (etc)"
19290 #: ../fish/guestfish.pod:1032
19292 "When using the C<-N> or C<--new> option, the prepared disk or filesystem "
19293 "will be created in the file C<test1.img> in the current directory. The "
19294 "second use of C<-N> will use C<test2.img> and so on. Any existing file with "
19295 "the same name will be overwritten."
19299 #: ../fish/guestfish.pod:1041
19301 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-cat(1)>, L<virt-df(1)>, "
19302 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, L<virt-list-"
19303 "filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)"
19304 ">, L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<virt-win-reg(1)>, "
19309 #: ../fish/guestfish.pod:1067 ../test-tool/libguestfs-test-tool.pod:124
19310 #: ../fuse/guestmount.pod:253 ../tools/virt-edit.pl:370
19311 #: ../tools/virt-win-reg.pl:518 ../tools/virt-resize.pl:1512
19312 #: ../tools/virt-list-filesystems.pl:210 ../tools/virt-tar.pl:300
19313 #: ../tools/virt-make-fs.pl:567 ../tools/virt-list-partitions.pl:277
19315 "This program is free software; you can redistribute it and/or modify it "
19316 "under the terms of the GNU General Public License as published by the Free "
19317 "Software Foundation; either version 2 of the License, or (at your option) "
19318 "any later version."
19322 #: ../fish/guestfish.pod:1072 ../test-tool/libguestfs-test-tool.pod:129
19323 #: ../fuse/guestmount.pod:258 ../tools/virt-edit.pl:375
19324 #: ../tools/virt-win-reg.pl:523 ../tools/virt-resize.pl:1517
19325 #: ../tools/virt-list-filesystems.pl:215 ../tools/virt-tar.pl:305
19326 #: ../tools/virt-make-fs.pl:572 ../tools/virt-list-partitions.pl:282
19328 "This program is distributed in the hope that it will be useful, but WITHOUT "
19329 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
19330 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
19335 #: ../fish/guestfish.pod:1077 ../test-tool/libguestfs-test-tool.pod:134
19336 #: ../fuse/guestmount.pod:263 ../tools/virt-edit.pl:380
19337 #: ../tools/virt-win-reg.pl:528 ../tools/virt-resize.pl:1522
19338 #: ../tools/virt-list-filesystems.pl:220 ../tools/virt-tar.pl:310
19339 #: ../tools/virt-make-fs.pl:577 ../tools/virt-list-partitions.pl:287
19341 "You should have received a copy of the GNU General Public License along with "
19342 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
19343 "Ave, Cambridge, MA 02139, USA."
19347 #: ../fish/guestfish-actions.pod:1
19352 #: ../fish/guestfish-actions.pod:3
19355 " add-cdrom filename\n"
19360 #: ../fish/guestfish-actions.pod:15
19362 "This call checks for the existence of C<filename>. This stops you from "
19363 "specifying other types of drive which are supported by qemu such as C<nbd:> "
19364 "and C<http:> URLs. To specify those, use the general L</config> call "
19369 #: ../fish/guestfish-actions.pod:22
19371 "If you just want to add an ISO file (often you use this as an efficient way "
19372 "to transfer large files into the guest), then you should probably use L</add-"
19373 "drive-ro> instead."
19377 #: ../fish/guestfish-actions.pod:35
19382 #: ../fish/guestfish-actions.pod:37
19387 #: ../fish/guestfish-actions.pod:39
19390 " add-domain dom [libvirturi:..] [readonly:..] [iface:..]\n"
19395 #: ../fish/guestfish-actions.pod:41
19397 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
19398 "It works by connecting to libvirt, requesting the domain and domain XML from "
19399 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
19403 #: ../fish/guestfish-actions.pod:58
19405 "The optional C<libvirturi> parameter sets the libvirt URI (see L<http://"
19406 "libvirt.org/uri.html>). If this is not set then we connect to the default "
19407 "libvirt URI (or one set through an environment variable, see the libvirt "
19408 "documentation for full details). If you are using the C API directly then "
19409 "it is more flexible to create the libvirt connection object yourself, get "
19410 "the domain object, and call L</add-libvirt-dom>."
19414 #: ../fish/guestfish-actions.pod:66
19416 "The other optional parameters are passed directly through to L</add-drive-"
19421 #: ../fish/guestfish-actions.pod:69 ../fish/guestfish-actions.pod:133
19422 #: ../fish/guestfish-actions.pod:2804
19424 "This command has one or more optional arguments. See L</OPTIONAL ARGUMENTS>."
19428 #: ../fish/guestfish-actions.pod:71
19433 #: ../fish/guestfish-actions.pod:73
19436 " add-drive filename\n"
19441 #: ../fish/guestfish-actions.pod:75
19443 "This function is the equivalent of calling L</add-drive-opts> with no "
19444 "optional parameters, so the disk is added writable, with the format being "
19445 "detected automatically."
19449 #: ../fish/guestfish-actions.pod:79
19451 "Automatic detection of the format opens you up to a potential security hole "
19452 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
19453 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
19454 "you should think about replacing calls to this function with calls to L</add-"
19455 "drive-opts>, and specifying the format."
19459 #: ../fish/guestfish-actions.pod:86
19460 msgid "add-drive-opts"
19464 #: ../fish/guestfish-actions.pod:88
19469 #: ../fish/guestfish-actions.pod:90
19472 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
19477 #: ../fish/guestfish-actions.pod:117
19479 "This forces the image format. If you omit this (or use L</add-drive> or L</"
19480 "add-drive-ro>) then the format is automatically detected. Possible formats "
19481 "include C<raw> and C<qcow2>."
19485 #: ../fish/guestfish-actions.pod:128
19487 "This rarely-used option lets you emulate the behaviour of the deprecated L</"
19488 "add-drive-with-if> call (q.v.)"
19492 #: ../fish/guestfish-actions.pod:135
19493 msgid "add-drive-ro"
19497 #: ../fish/guestfish-actions.pod:137
19502 #: ../fish/guestfish-actions.pod:139
19505 " add-drive-ro filename\n"
19510 #: ../fish/guestfish-actions.pod:141
19512 "This function is the equivalent of calling L</add-drive-opts> with the "
19513 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
19514 "is added read-only, with the format being detected automatically."
19518 #: ../fish/guestfish-actions.pod:146
19519 msgid "add-drive-ro-with-if"
19523 #: ../fish/guestfish-actions.pod:148
19526 " add-drive-ro-with-if filename iface\n"
19531 #: ../fish/guestfish-actions.pod:150
19533 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
19534 "interface emulation to use at run time."
19538 #: ../fish/guestfish-actions.pod:160
19539 msgid "add-drive-with-if"
19543 #: ../fish/guestfish-actions.pod:162
19546 " add-drive-with-if filename iface\n"
19551 #: ../fish/guestfish-actions.pod:164
19553 "This is the same as L</add-drive> but it allows you to specify the QEMU "
19554 "interface emulation to use at run time."
19558 #: ../fish/guestfish-actions.pod:174
19563 #: ../fish/guestfish-actions.pod:176
19566 " aug-clear augpath\n"
19571 #: ../fish/guestfish-actions.pod:181
19576 #: ../fish/guestfish-actions.pod:183
19584 #: ../fish/guestfish-actions.pod:185
19586 "Close the current Augeas handle and free up any resources used by it. After "
19587 "calling this, you have to call L</aug-init> again before you can use any "
19588 "other Augeas functions."
19592 #: ../fish/guestfish-actions.pod:190
19593 msgid "aug-defnode"
19597 #: ../fish/guestfish-actions.pod:192
19600 " aug-defnode name expr val\n"
19605 #: ../fish/guestfish-actions.pod:197
19607 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
19608 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
19609 "containing that single node."
19613 #: ../fish/guestfish-actions.pod:205
19618 #: ../fish/guestfish-actions.pod:207
19621 " aug-defvar name expr\n"
19626 #: ../fish/guestfish-actions.pod:216
19631 #: ../fish/guestfish-actions.pod:218
19634 " aug-get augpath\n"
19639 #: ../fish/guestfish-actions.pod:223
19644 #: ../fish/guestfish-actions.pod:225
19647 " aug-init root flags\n"
19652 #: ../fish/guestfish-actions.pod:231
19653 msgid "You must call this before using any other L</aug-*> commands."
19657 #: ../fish/guestfish-actions.pod:266
19658 msgid "Do not load the tree in L</aug-init>."
19662 #: ../fish/guestfish-actions.pod:270
19663 msgid "To close the handle, you can call L</aug-close>."
19667 #: ../fish/guestfish-actions.pod:274
19672 #: ../fish/guestfish-actions.pod:276
19675 " aug-insert augpath label true|false\n"
19680 #: ../fish/guestfish-actions.pod:286
19685 #: ../fish/guestfish-actions.pod:288
19693 #: ../fish/guestfish-actions.pod:295
19698 #: ../fish/guestfish-actions.pod:297
19701 " aug-ls augpath\n"
19706 #: ../fish/guestfish-actions.pod:299
19708 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
19709 "resulting nodes into alphabetical order."
19713 #: ../fish/guestfish-actions.pod:302
19718 #: ../fish/guestfish-actions.pod:304
19721 " aug-match augpath\n"
19726 #: ../fish/guestfish-actions.pod:310
19731 #: ../fish/guestfish-actions.pod:312
19734 " aug-mv src dest\n"
19739 #: ../fish/guestfish-actions.pod:317
19744 #: ../fish/guestfish-actions.pod:319
19747 " aug-rm augpath\n"
19752 #: ../fish/guestfish-actions.pod:325
19757 #: ../fish/guestfish-actions.pod:327
19765 #: ../fish/guestfish-actions.pod:331
19767 "The flags which were passed to L</aug-init> affect exactly how files are "
19772 #: ../fish/guestfish-actions.pod:334
19777 #: ../fish/guestfish-actions.pod:336
19780 " aug-set augpath val\n"
19785 #: ../fish/guestfish-actions.pod:340
19787 "In the Augeas API, it is possible to clear a node by setting the value to "
19788 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
19789 "this call. Instead you must use the L</aug-clear> call."
19793 #: ../fish/guestfish-actions.pod:345
19798 #: ../fish/guestfish-actions.pod:347
19801 " available 'groups ...'\n"
19806 #: ../fish/guestfish-actions.pod:353
19808 "The libguestfs groups, and the functions that those groups correspond to, "
19809 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
19810 "runtime by calling L</available-all-groups>."
19814 #: ../fish/guestfish-actions.pod:377
19815 msgid "You must call L</launch> before calling this function."
19819 #: ../fish/guestfish-actions.pod:399
19821 "This call was added in version C<1.0.80>. In previous versions of "
19822 "libguestfs all you could do would be to speculatively execute a command to "
19823 "find out if the daemon implemented it. See also L</version>."
19827 #: ../fish/guestfish-actions.pod:406
19828 msgid "available-all-groups"
19832 #: ../fish/guestfish-actions.pod:408
19835 " available-all-groups\n"
19840 #: ../fish/guestfish-actions.pod:410
19842 "This command returns a list of all optional groups that this daemon knows "
19843 "about. Note this returns both supported and unsupported groups. To find "
19844 "out which ones the daemon can actually support you have to call L</"
19845 "available> on each member of the returned list."
19849 #: ../fish/guestfish-actions.pod:416
19850 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
19854 #: ../fish/guestfish-actions.pod:418
19859 #: ../fish/guestfish-actions.pod:420
19862 " base64-in (base64file|-) filename\n"
19867 #: ../fish/guestfish-actions.pod:425 ../fish/guestfish-actions.pod:434
19868 #: ../fish/guestfish-actions.pod:658 ../fish/guestfish-actions.pod:827
19869 #: ../fish/guestfish-actions.pod:846 ../fish/guestfish-actions.pod:1223
19870 #: ../fish/guestfish-actions.pod:4159 ../fish/guestfish-actions.pod:4171
19871 #: ../fish/guestfish-actions.pod:4182 ../fish/guestfish-actions.pod:4193
19872 #: ../fish/guestfish-actions.pod:4245 ../fish/guestfish-actions.pod:4254
19873 #: ../fish/guestfish-actions.pod:4308 ../fish/guestfish-actions.pod:4331
19874 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
19878 #: ../fish/guestfish-actions.pod:427
19883 #: ../fish/guestfish-actions.pod:429
19886 " base64-out filename (base64file|-)\n"
19891 #: ../fish/guestfish-actions.pod:436
19892 msgid "blockdev-flushbufs"
19896 #: ../fish/guestfish-actions.pod:438
19899 " blockdev-flushbufs device\n"
19904 #: ../fish/guestfish-actions.pod:445
19905 msgid "blockdev-getbsz"
19909 #: ../fish/guestfish-actions.pod:447
19912 " blockdev-getbsz device\n"
19917 #: ../fish/guestfish-actions.pod:456
19918 msgid "blockdev-getro"
19922 #: ../fish/guestfish-actions.pod:458
19925 " blockdev-getro device\n"
19930 #: ../fish/guestfish-actions.pod:465
19931 msgid "blockdev-getsize64"
19935 #: ../fish/guestfish-actions.pod:467
19938 " blockdev-getsize64 device\n"
19943 #: ../fish/guestfish-actions.pod:471
19944 msgid "See also L</blockdev-getsz>."
19948 #: ../fish/guestfish-actions.pod:475
19949 msgid "blockdev-getss"
19953 #: ../fish/guestfish-actions.pod:477
19956 " blockdev-getss device\n"
19961 #: ../fish/guestfish-actions.pod:482
19963 "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
19967 #: ../fish/guestfish-actions.pod:487
19968 msgid "blockdev-getsz"
19972 #: ../fish/guestfish-actions.pod:489
19975 " blockdev-getsz device\n"
19980 #: ../fish/guestfish-actions.pod:494
19982 "See also L</blockdev-getss> for the real sector size of the device, and L</"
19983 "blockdev-getsize64> for the more useful I<size in bytes>."
19987 #: ../fish/guestfish-actions.pod:500
19988 msgid "blockdev-rereadpt"
19992 #: ../fish/guestfish-actions.pod:502
19995 " blockdev-rereadpt device\n"
20000 #: ../fish/guestfish-actions.pod:508
20001 msgid "blockdev-setbsz"
20005 #: ../fish/guestfish-actions.pod:510
20008 " blockdev-setbsz device blocksize\n"
20013 #: ../fish/guestfish-actions.pod:519
20014 msgid "blockdev-setro"
20018 #: ../fish/guestfish-actions.pod:521
20021 " blockdev-setro device\n"
20026 #: ../fish/guestfish-actions.pod:527
20027 msgid "blockdev-setrw"
20031 #: ../fish/guestfish-actions.pod:529
20034 " blockdev-setrw device\n"
20039 #: ../fish/guestfish-actions.pod:535
20040 msgid "case-sensitive-path"
20044 #: ../fish/guestfish-actions.pod:537
20047 " case-sensitive-path path\n"
20052 #: ../fish/guestfish-actions.pod:561
20054 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return C<\"/"
20055 "WINDOWS/system32\"> (the exact return value would depend on details of how "
20056 "the directories were originally created under Windows)."
20060 #: ../fish/guestfish-actions.pod:569
20061 msgid "See also L</realpath>."
20065 #: ../fish/guestfish-actions.pod:571
20070 #: ../fish/guestfish-actions.pod:573
20078 #: ../fish/guestfish-actions.pod:577
20080 "Note that this function cannot correctly handle binary files (specifically, "
20081 "files containing C<\\0> character which is treated as end of string). For "
20082 "those you need to use the L</read-file> or L</download> functions which have "
20083 "a more complex interface."
20087 #: ../fish/guestfish-actions.pod:585
20092 #: ../fish/guestfish-actions.pod:587
20095 " checksum csumtype path\n"
20100 #: ../fish/guestfish-actions.pod:630
20101 msgid "To get the checksum for a device, use L</checksum-device>."
20105 #: ../fish/guestfish-actions.pod:632
20106 msgid "To get the checksums for many files, use L</checksums-out>."
20110 #: ../fish/guestfish-actions.pod:634
20111 msgid "checksum-device"
20115 #: ../fish/guestfish-actions.pod:636
20118 " checksum-device csumtype device\n"
20123 #: ../fish/guestfish-actions.pod:638
20125 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
20126 "device named C<device>. For the types of checksums supported see the L</"
20127 "checksum> command."
20131 #: ../fish/guestfish-actions.pod:642
20132 msgid "checksums-out"
20136 #: ../fish/guestfish-actions.pod:644
20139 " checksums-out csumtype directory (sumsfile|-)\n"
20144 #: ../fish/guestfish-actions.pod:660
20149 #: ../fish/guestfish-actions.pod:662
20152 " chmod mode path\n"
20157 #: ../fish/guestfish-actions.pod:673
20162 #: ../fish/guestfish-actions.pod:675
20165 " chown owner group path\n"
20170 #: ../fish/guestfish-actions.pod:683
20175 #: ../fish/guestfish-actions.pod:685
20178 " command 'arguments ...'\n"
20183 #: ../fish/guestfish-actions.pod:692
20185 "The single parameter is an argv-style list of arguments. The first element "
20186 "is the name of the program to run. Subsequent elements are parameters. The "
20187 "list must be non-empty (ie. must contain a program name). Note that the "
20188 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
20192 #: ../fish/guestfish-actions.pod:720
20193 msgid "command-lines"
20197 #: ../fish/guestfish-actions.pod:722
20200 " command-lines 'arguments ...'\n"
20205 #: ../fish/guestfish-actions.pod:724
20207 "This is the same as L</command>, but splits the result into a list of lines."
20211 #: ../fish/guestfish-actions.pod:727
20212 msgid "See also: L</sh-lines>"
20216 #: ../fish/guestfish-actions.pod:732
20221 #: ../fish/guestfish-actions.pod:734
20224 " config qemuparam qemuvalue\n"
20229 #: ../fish/guestfish-actions.pod:745
20234 #: ../fish/guestfish-actions.pod:747
20237 " copy-size src dest size\n"
20242 #: ../fish/guestfish-actions.pod:755
20247 #: ../fish/guestfish-actions.pod:757
20255 #: ../fish/guestfish-actions.pod:762
20260 #: ../fish/guestfish-actions.pod:764
20268 #: ../fish/guestfish-actions.pod:769
20273 #: ../fish/guestfish-actions.pod:771
20281 #: ../fish/guestfish-actions.pod:778
20283 "If the destination is a device, it must be as large or larger than the "
20284 "source file or device, otherwise the copy will fail. This command cannot do "
20285 "partial copies (see L</copy-size>)."
20289 #: ../fish/guestfish-actions.pod:782
20294 #: ../fish/guestfish-actions.pod:784
20302 #: ../fish/guestfish-actions.pod:792
20307 #: ../fish/guestfish-actions.pod:794
20315 #: ../fish/guestfish-actions.pod:803
20320 #: ../fish/guestfish-actions.pod:805
20328 #: ../fish/guestfish-actions.pod:811
20330 "Another way to get the same information is to enable verbose messages with "
20331 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
20332 "before running the program."
20336 #: ../fish/guestfish-actions.pod:816
20341 #: ../fish/guestfish-actions.pod:818
20344 " download remotefilename (filename|-)\n"
20349 #: ../fish/guestfish-actions.pod:825
20350 msgid "See also L</upload>, L</cat>."
20354 #: ../fish/guestfish-actions.pod:829
20355 msgid "download-offset"
20359 #: ../fish/guestfish-actions.pod:831
20362 " download-offset remotefilename (filename|-) offset size\n"
20367 #: ../fish/guestfish-actions.pod:839
20369 "Note that there is no limit on the amount of data that can be downloaded "
20370 "with this call, unlike with L</pread>, and this call always reads the full "
20371 "amount unless an error occurs."
20375 #: ../fish/guestfish-actions.pod:844
20376 msgid "See also L</download>, L</pread>."
20380 #: ../fish/guestfish-actions.pod:848
20381 msgid "drop-caches"
20385 #: ../fish/guestfish-actions.pod:850
20388 " drop-caches whattodrop\n"
20393 #: ../fish/guestfish-actions.pod:862
20398 #: ../fish/guestfish-actions.pod:864
20406 #: ../fish/guestfish-actions.pod:876
20411 #: ../fish/guestfish-actions.pod:878
20414 " e2fsck-f device\n"
20419 #: ../fish/guestfish-actions.pod:884
20421 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
20422 "should use L</fsck>."
20426 #: ../fish/guestfish-actions.pod:887
20427 msgid "echo-daemon"
20431 #: ../fish/guestfish-actions.pod:889
20434 " echo-daemon 'words ...'\n"
20439 #: ../fish/guestfish-actions.pod:896
20440 msgid "See also L</ping-daemon>."
20444 #: ../fish/guestfish-actions.pod:898
20449 #: ../fish/guestfish-actions.pod:900
20452 " egrep regex path\n"
20457 #: ../fish/guestfish-actions.pod:908
20462 #: ../fish/guestfish-actions.pod:910
20465 " egrepi regex path\n"
20470 #: ../fish/guestfish-actions.pod:918
20475 #: ../fish/guestfish-actions.pod:920
20478 " equal file1 file2\n"
20483 #: ../fish/guestfish-actions.pod:927
20488 #: ../fish/guestfish-actions.pod:929
20496 #: ../fish/guestfish-actions.pod:934
20497 msgid "See also L</is-file>, L</is-dir>, L</stat>."
20501 #: ../fish/guestfish-actions.pod:936
20506 #: ../fish/guestfish-actions.pod:938
20509 " fallocate path len\n"
20514 #: ../fish/guestfish-actions.pod:955
20515 msgid "fallocate64"
20519 #: ../fish/guestfish-actions.pod:957
20522 " fallocate64 path len\n"
20527 #: ../fish/guestfish-actions.pod:963
20529 "Note that this call allocates disk blocks for the file. To create a sparse "
20530 "file use L</truncate-size> instead."
20534 #: ../fish/guestfish-actions.pod:966
20536 "The deprecated call L</fallocate> does the same, but owing to an oversight "
20537 "it only allowed 30 bit lengths to be specified, effectively limiting the "
20538 "maximum size of files created through that call to 1GB."
20542 #: ../fish/guestfish-actions.pod:975
20547 #: ../fish/guestfish-actions.pod:977
20550 " fgrep pattern path\n"
20555 #: ../fish/guestfish-actions.pod:985
20560 #: ../fish/guestfish-actions.pod:987
20563 " fgrepi pattern path\n"
20568 #: ../fish/guestfish-actions.pod:995
20573 #: ../fish/guestfish-actions.pod:997
20581 #: ../fish/guestfish-actions.pod:1009
20583 "This command can also be used on C</dev/> devices (and partitions, LV "
20584 "names). You can for example use this to determine if a device contains a "
20585 "filesystem, although it's usually better to use L</vfs-type>."
20589 #: ../fish/guestfish-actions.pod:1019
20590 msgid "file-architecture"
20594 #: ../fish/guestfish-actions.pod:1021
20597 " file-architecture filename\n"
20602 #: ../fish/guestfish-actions.pod:1124
20607 #: ../fish/guestfish-actions.pod:1126
20615 #: ../fish/guestfish-actions.pod:1130
20617 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, L</is-"
20618 "file> etc. To get the size of block devices, use L</blockdev-getsize64>."
20622 #: ../fish/guestfish-actions.pod:1134
20627 #: ../fish/guestfish-actions.pod:1136
20630 " fill c len path\n"
20635 #: ../fish/guestfish-actions.pod:1142
20637 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
20638 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
20639 "L</fill-pattern>."
20643 #: ../fish/guestfish-actions.pod:1147
20644 msgid "fill-pattern"
20648 #: ../fish/guestfish-actions.pod:1149
20651 " fill-pattern pattern len path\n"
20656 #: ../fish/guestfish-actions.pod:1151
20658 "This function is like L</fill> except that it creates a new file of length "
20659 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
20660 "is truncated if necessary to ensure the length of the file is exactly C<len> "
20665 #: ../fish/guestfish-actions.pod:1156
20670 #: ../fish/guestfish-actions.pod:1158
20673 " find directory\n"
20678 #: ../fish/guestfish-actions.pod:1172
20679 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
20683 #: ../fish/guestfish-actions.pod:1185
20684 msgid "See also L</find0>."
20688 #: ../fish/guestfish-actions.pod:1190
20693 #: ../fish/guestfish-actions.pod:1192
20696 " find0 directory (files|-)\n"
20701 #: ../fish/guestfish-actions.pod:1198
20703 "This command works the same way as L</find> with the following exceptions:"
20707 #: ../fish/guestfish-actions.pod:1225
20708 msgid "findfs-label"
20712 #: ../fish/guestfish-actions.pod:1227
20715 " findfs-label label\n"
20720 #: ../fish/guestfish-actions.pod:1233
20721 msgid "To find the label of a filesystem, use L</vfs-label>."
20725 #: ../fish/guestfish-actions.pod:1235
20726 msgid "findfs-uuid"
20730 #: ../fish/guestfish-actions.pod:1237
20733 " findfs-uuid uuid\n"
20738 #: ../fish/guestfish-actions.pod:1243
20739 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
20743 #: ../fish/guestfish-actions.pod:1245
20748 #: ../fish/guestfish-actions.pod:1247
20751 " fsck fstype device\n"
20756 #: ../fish/guestfish-actions.pod:1277
20761 #: ../fish/guestfish-actions.pod:1279
20769 #: ../fish/guestfish-actions.pod:1286
20770 msgid "get-autosync"
20774 #: ../fish/guestfish-actions.pod:1288
20782 #: ../fish/guestfish-actions.pod:1292
20787 #: ../fish/guestfish-actions.pod:1294
20795 #: ../fish/guestfish-actions.pod:1298
20796 msgid "get-e2label"
20800 #: ../fish/guestfish-actions.pod:1300
20803 " get-e2label device\n"
20808 #: ../fish/guestfish-actions.pod:1312
20813 #: ../fish/guestfish-actions.pod:1314
20816 " get-e2uuid device\n"
20821 #: ../fish/guestfish-actions.pod:1326
20822 msgid "get-memsize"
20826 #: ../fish/guestfish-actions.pod:1328
20834 #: ../fish/guestfish-actions.pod:1333
20836 "If L</set-memsize> was not called on this handle, and if "
20837 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
20838 "value for memsize."
20842 #: ../fish/guestfish-actions.pod:1340
20843 msgid "get-network"
20847 #: ../fish/guestfish-actions.pod:1342
20855 #: ../fish/guestfish-actions.pod:1346
20860 #: ../fish/guestfish-actions.pod:1348
20868 #: ../fish/guestfish-actions.pod:1355
20873 #: ../fish/guestfish-actions.pod:1357
20878 #: ../fish/guestfish-actions.pod:1359
20886 #: ../fish/guestfish-actions.pod:1366
20891 #: ../fish/guestfish-actions.pod:1368
20899 #: ../fish/guestfish-actions.pod:1375
20900 msgid "get-recovery-proc"
20904 #: ../fish/guestfish-actions.pod:1377
20907 " get-recovery-proc\n"
20912 #: ../fish/guestfish-actions.pod:1381
20913 msgid "get-selinux"
20917 #: ../fish/guestfish-actions.pod:1383
20925 #: ../fish/guestfish-actions.pod:1385
20927 "This returns the current setting of the selinux flag which is passed to the "
20928 "appliance at boot time. See L</set-selinux>."
20932 #: ../fish/guestfish-actions.pod:1391
20937 #: ../fish/guestfish-actions.pod:1393
20945 #: ../fish/guestfish-actions.pod:1400
20950 #: ../fish/guestfish-actions.pod:1402
20958 #: ../fish/guestfish-actions.pod:1406
20963 #: ../fish/guestfish-actions.pod:1408
20971 #: ../fish/guestfish-actions.pod:1410
20973 "Return the current umask. By default the umask is C<022> unless it has been "
20974 "set by calling L</umask>."
20978 #: ../fish/guestfish-actions.pod:1413
20979 msgid "get-verbose"
20983 #: ../fish/guestfish-actions.pod:1415
20991 #: ../fish/guestfish-actions.pod:1419
20996 #: ../fish/guestfish-actions.pod:1421
21004 #: ../fish/guestfish-actions.pod:1425
21005 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
21009 #: ../fish/guestfish-actions.pod:1428
21014 #: ../fish/guestfish-actions.pod:1430
21017 " getxattrs path\n"
21022 #: ../fish/guestfish-actions.pod:1438
21023 msgid "See also: L</lgetxattrs>, L<attr(5)>."
21027 #: ../fish/guestfish-actions.pod:1440
21028 msgid "glob-expand"
21032 #: ../fish/guestfish-actions.pod:1442
21035 " glob-expand pattern\n"
21040 #: ../fish/guestfish-actions.pod:1455
21045 #: ../fish/guestfish-actions.pod:1457
21048 " grep regex path\n"
21053 #: ../fish/guestfish-actions.pod:1465
21058 #: ../fish/guestfish-actions.pod:1467
21061 " grepi regex path\n"
21066 #: ../fish/guestfish-actions.pod:1475
21067 msgid "grub-install"
21071 #: ../fish/guestfish-actions.pod:1477
21074 " grub-install root device\n"
21079 #: ../fish/guestfish-actions.pod:1493
21084 #: ../fish/guestfish-actions.pod:1495
21092 #: ../fish/guestfish-actions.pod:1503
21097 #: ../fish/guestfish-actions.pod:1505
21100 " head-n nrlines path\n"
21105 #: ../fish/guestfish-actions.pod:1518
21110 #: ../fish/guestfish-actions.pod:1520
21118 #: ../fish/guestfish-actions.pod:1528
21123 #: ../fish/guestfish-actions.pod:1530
21126 " initrd-cat initrdpath filename\n"
21131 #: ../fish/guestfish-actions.pod:1542
21132 msgid "See also L</initrd-list>."
21136 #: ../fish/guestfish-actions.pod:1547
21137 msgid "initrd-list"
21141 #: ../fish/guestfish-actions.pod:1549
21144 " initrd-list path\n"
21149 #: ../fish/guestfish-actions.pod:1561
21150 msgid "inotify-add-watch"
21154 #: ../fish/guestfish-actions.pod:1563
21157 " inotify-add-watch path mask\n"
21162 #: ../fish/guestfish-actions.pod:1575
21163 msgid "inotify-close"
21167 #: ../fish/guestfish-actions.pod:1577
21175 #: ../fish/guestfish-actions.pod:1583
21176 msgid "inotify-files"
21180 #: ../fish/guestfish-actions.pod:1585
21188 #: ../fish/guestfish-actions.pod:1587
21190 "This function is a helpful wrapper around L</inotify-read> which just "
21191 "returns a list of pathnames of objects that were touched. The returned "
21192 "pathnames are sorted and deduplicated."
21196 #: ../fish/guestfish-actions.pod:1591
21197 msgid "inotify-init"
21201 #: ../fish/guestfish-actions.pod:1593
21204 " inotify-init maxevents\n"
21209 #: ../fish/guestfish-actions.pod:1599
21211 "C<maxevents> is the maximum number of events which will be queued up between "
21212 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
21213 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
21214 "default was 16384 events. Beyond this limit, the kernel throws away events, "
21215 "but records the fact that it threw them away by setting a flag "
21216 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
21220 #: ../fish/guestfish-actions.pod:1609
21222 "Before any events are generated, you have to add some watches to the "
21223 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
21224 "L</inotify-watch-all>."
21228 #: ../fish/guestfish-actions.pod:1615
21230 "Queued up events should be read periodically by calling L</inotify-read> (or "
21231 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
21232 "If you don't read the events out often enough then you risk the internal "
21233 "queue overflowing."
21237 #: ../fish/guestfish-actions.pod:1622
21239 "The handle should be closed after use by calling L</inotify-close>. This "
21240 "also removes any watches automatically."
21244 #: ../fish/guestfish-actions.pod:1631
21245 msgid "inotify-read"
21249 #: ../fish/guestfish-actions.pod:1633
21257 #: ../fish/guestfish-actions.pod:1646
21258 msgid "inotify-rm-watch"
21262 #: ../fish/guestfish-actions.pod:1648
21265 " inotify-rm-watch wd\n"
21270 #: ../fish/guestfish-actions.pod:1650
21271 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
21275 #: ../fish/guestfish-actions.pod:1653
21276 msgid "inspect-get-arch"
21280 #: ../fish/guestfish-actions.pod:1655
21283 " inspect-get-arch root\n"
21288 #: ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1673
21289 #: ../fish/guestfish-actions.pod:1747 ../fish/guestfish-actions.pod:1765
21290 #: ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1801
21291 #: ../fish/guestfish-actions.pod:1816 ../fish/guestfish-actions.pod:1839
21292 #: ../fish/guestfish-actions.pod:1861 ../fish/guestfish-actions.pod:1885
21293 #: ../fish/guestfish-actions.pod:1915 ../fish/guestfish-actions.pod:1950
21294 #: ../fish/guestfish-actions.pod:1966
21296 "This function should only be called with a root device string as returned by "
21301 #: ../fish/guestfish-actions.pod:1660
21303 "This returns the architecture of the inspected operating system. The "
21304 "possible return values are listed under L</file-architecture>."
21308 #: ../fish/guestfish-actions.pod:1669
21309 msgid "inspect-get-distro"
21313 #: ../fish/guestfish-actions.pod:1671
21316 " inspect-get-distro root\n"
21321 #: ../fish/guestfish-actions.pod:1743
21322 msgid "inspect-get-filesystems"
21326 #: ../fish/guestfish-actions.pod:1745
21329 " inspect-get-filesystems root\n"
21334 #: ../fish/guestfish-actions.pod:1758
21336 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21337 "get-mountpoints>."
21341 #: ../fish/guestfish-actions.pod:1761
21342 msgid "inspect-get-hostname"
21346 #: ../fish/guestfish-actions.pod:1763
21349 " inspect-get-hostname root\n"
21354 #: ../fish/guestfish-actions.pod:1776
21355 msgid "inspect-get-major-version"
21359 #: ../fish/guestfish-actions.pod:1778
21362 " inspect-get-major-version root\n"
21367 #: ../fish/guestfish-actions.pod:1797
21368 msgid "inspect-get-minor-version"
21372 #: ../fish/guestfish-actions.pod:1799
21375 " inspect-get-minor-version root\n"
21380 #: ../fish/guestfish-actions.pod:1809
21382 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21383 "get-major-version>."
21387 #: ../fish/guestfish-actions.pod:1812
21388 msgid "inspect-get-mountpoints"
21392 #: ../fish/guestfish-actions.pod:1814
21395 " inspect-get-mountpoints root\n"
21400 #: ../fish/guestfish-actions.pod:1832
21402 "Please read L<guestfs(3)/INSPECTION> for more details. See also L</inspect-"
21403 "get-filesystems>."
21407 #: ../fish/guestfish-actions.pod:1835
21408 msgid "inspect-get-package-format"
21412 #: ../fish/guestfish-actions.pod:1837
21415 " inspect-get-package-format root\n"
21420 #: ../fish/guestfish-actions.pod:1842
21422 "This function and L</inspect-get-package-management> return the package "
21423 "format and package management tool used by the inspected operating system. "
21424 "For example for Fedora these functions would return C<rpm> (package format) "
21425 "and C<yum> (package management)."
21429 #: ../fish/guestfish-actions.pod:1857
21430 msgid "inspect-get-package-management"
21434 #: ../fish/guestfish-actions.pod:1859
21437 " inspect-get-package-management root\n"
21442 #: ../fish/guestfish-actions.pod:1864
21444 "L</inspect-get-package-format> and this function return the package format "
21445 "and package management tool used by the inspected operating system. For "
21446 "example for Fedora these functions would return C<rpm> (package format) and "
21447 "C<yum> (package management)."
21451 #: ../fish/guestfish-actions.pod:1881
21452 msgid "inspect-get-product-name"
21456 #: ../fish/guestfish-actions.pod:1883
21459 " inspect-get-product-name root\n"
21464 #: ../fish/guestfish-actions.pod:1898
21465 msgid "inspect-get-roots"
21469 #: ../fish/guestfish-actions.pod:1900
21472 " inspect-get-roots\n"
21477 #: ../fish/guestfish-actions.pod:1902
21479 "This function is a convenient way to get the list of root devices, as "
21480 "returned from a previous call to L</inspect-os>, but without redoing the "
21481 "whole inspection process."
21485 #: ../fish/guestfish-actions.pod:1906
21487 "This returns an empty list if either no root devices were found or the "
21488 "caller has not called L</inspect-os>."
21492 #: ../fish/guestfish-actions.pod:1911
21493 msgid "inspect-get-type"
21497 #: ../fish/guestfish-actions.pod:1913
21500 " inspect-get-type root\n"
21505 #: ../fish/guestfish-actions.pod:1946
21506 msgid "inspect-get-windows-systemroot"
21510 #: ../fish/guestfish-actions.pod:1948
21513 " inspect-get-windows-systemroot root\n"
21518 #: ../fish/guestfish-actions.pod:1962
21519 msgid "inspect-list-applications"
21523 #: ../fish/guestfish-actions.pod:1964
21526 " inspect-list-applications root\n"
21531 #: ../fish/guestfish-actions.pod:1971
21533 "I<Note:> This call works differently from other parts of the inspection "
21534 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
21535 "then mount up the disks, before calling this. Listing applications is a "
21536 "significantly more difficult operation which requires access to the full "
21537 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
21538 "are just returning data cached in the libguestfs handle, this call actually "
21539 "reads parts of the mounted filesystems during the call."
21543 #: ../fish/guestfish-actions.pod:2061
21548 #: ../fish/guestfish-actions.pod:2063
21556 #: ../fish/guestfish-actions.pod:2078
21558 "You can pass the root string(s) returned to other L</inspect-get-*> "
21559 "functions in order to query further information about each operating system, "
21560 "such as the name and version."
21564 #: ../fish/guestfish-actions.pod:2083
21566 "This function uses other libguestfs features such as L</mount-ro> and L</"
21567 "umount-all> in order to mount and unmount filesystems and look at the "
21568 "contents. This should be called with no disks currently mounted. The "
21569 "function may also use Augeas, so any existing Augeas handle will be closed."
21573 #: ../fish/guestfish-actions.pod:2095 ../fish/guestfish-actions.pod:2251
21574 #: ../fish/guestfish-actions.pod:2297
21575 msgid "See also L</list-filesystems>."
21579 #: ../fish/guestfish-actions.pod:2097
21580 msgid "is-blockdev"
21584 #: ../fish/guestfish-actions.pod:2099
21587 " is-blockdev path\n"
21592 #: ../fish/guestfish-actions.pod:2104 ../fish/guestfish-actions.pod:2122
21593 #: ../fish/guestfish-actions.pod:2141 ../fish/guestfish-actions.pod:2150
21594 #: ../fish/guestfish-actions.pod:2160 ../fish/guestfish-actions.pod:2194
21595 #: ../fish/guestfish-actions.pod:2203
21596 msgid "See also L</stat>."
21600 #: ../fish/guestfish-actions.pod:2106
21605 #: ../fish/guestfish-actions.pod:2108
21613 #: ../fish/guestfish-actions.pod:2115
21618 #: ../fish/guestfish-actions.pod:2117
21621 " is-chardev path\n"
21626 #: ../fish/guestfish-actions.pod:2124
21631 #: ../fish/guestfish-actions.pod:2126
21639 #: ../fish/guestfish-actions.pod:2133
21644 #: ../fish/guestfish-actions.pod:2135
21652 #: ../fish/guestfish-actions.pod:2143
21657 #: ../fish/guestfish-actions.pod:2145
21665 #: ../fish/guestfish-actions.pod:2152
21670 #: ../fish/guestfish-actions.pod:2154
21678 #: ../fish/guestfish-actions.pod:2162
21679 msgid "is-launching"
21683 #: ../fish/guestfish-actions.pod:2164
21691 #: ../fish/guestfish-actions.pod:2171
21696 #: ../fish/guestfish-actions.pod:2173
21704 #: ../fish/guestfish-actions.pod:2178
21709 #: ../fish/guestfish-actions.pod:2180
21717 #: ../fish/guestfish-actions.pod:2187
21722 #: ../fish/guestfish-actions.pod:2189
21725 " is-socket path\n"
21730 #: ../fish/guestfish-actions.pod:2196
21735 #: ../fish/guestfish-actions.pod:2198
21738 " is-symlink path\n"
21743 #: ../fish/guestfish-actions.pod:2205
21744 msgid "kill-subprocess"
21748 #: ../fish/guestfish-actions.pod:2207
21751 " kill-subprocess\n"
21756 #: ../fish/guestfish-actions.pod:2211
21761 #: ../fish/guestfish-actions.pod:2213
21766 #: ../fish/guestfish-actions.pod:2215
21774 #: ../fish/guestfish-actions.pod:2223
21779 #: ../fish/guestfish-actions.pod:2225
21782 " lchown owner group path\n"
21787 #: ../fish/guestfish-actions.pod:2227
21789 "Change the file owner to C<owner> and group to C<group>. This is like L</"
21790 "chown> but if C<path> is a symlink then the link itself is changed, not the "
21795 #: ../fish/guestfish-actions.pod:2235
21800 #: ../fish/guestfish-actions.pod:2237
21803 " lgetxattrs path\n"
21808 #: ../fish/guestfish-actions.pod:2239
21810 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
21811 "it returns the extended attributes of the link itself."
21815 #: ../fish/guestfish-actions.pod:2243
21816 msgid "list-devices"
21820 #: ../fish/guestfish-actions.pod:2245
21828 #: ../fish/guestfish-actions.pod:2253
21829 msgid "list-filesystems"
21833 #: ../fish/guestfish-actions.pod:2255
21836 " list-filesystems\n"
21841 #: ../fish/guestfish-actions.pod:2274
21843 "This command runs other libguestfs commands, which might include L</mount> "
21844 "and L</umount>, and therefore you should use this soon after launch and only "
21845 "when nothing is mounted."
21849 #: ../fish/guestfish-actions.pod:2278
21851 "Not all of the filesystems returned will be mountable. In particular, swap "
21852 "partitions are returned in the list. Also this command does not check that "
21853 "each filesystem found is valid and mountable, and some filesystems might be "
21854 "mountable but require special options. Filesystems may not all belong to a "
21855 "single logical operating system (use L</inspect-os> to look for OSes)."
21859 #: ../fish/guestfish-actions.pod:2286
21860 msgid "list-partitions"
21864 #: ../fish/guestfish-actions.pod:2288
21867 " list-partitions\n"
21872 #: ../fish/guestfish-actions.pod:2294
21874 "This does not return logical volumes. For that you will need to call L</"
21879 #: ../fish/guestfish-actions.pod:2299
21884 #: ../fish/guestfish-actions.pod:2301
21892 #: ../fish/guestfish-actions.pod:2309
21897 #: ../fish/guestfish-actions.pod:2311
21900 " ln target linkname\n"
21905 #: ../fish/guestfish-actions.pod:2315
21910 #: ../fish/guestfish-actions.pod:2317
21913 " ln-f target linkname\n"
21918 #: ../fish/guestfish-actions.pod:2322
21923 #: ../fish/guestfish-actions.pod:2324
21926 " ln-s target linkname\n"
21931 #: ../fish/guestfish-actions.pod:2328
21936 #: ../fish/guestfish-actions.pod:2330
21939 " ln-sf target linkname\n"
21944 #: ../fish/guestfish-actions.pod:2335
21945 msgid "lremovexattr"
21949 #: ../fish/guestfish-actions.pod:2337
21952 " lremovexattr xattr path\n"
21957 #: ../fish/guestfish-actions.pod:2339
21959 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
21960 "it removes an extended attribute of the link itself."
21964 #: ../fish/guestfish-actions.pod:2343
21969 #: ../fish/guestfish-actions.pod:2345
21977 #: ../fish/guestfish-actions.pod:2351
21979 "This command is mostly useful for interactive sessions. Programs should "
21980 "probably use L</readdir> instead."
21984 #: ../fish/guestfish-actions.pod:2354
21989 #: ../fish/guestfish-actions.pod:2356
21992 " lsetxattr xattr val vallen path\n"
21997 #: ../fish/guestfish-actions.pod:2358
21999 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
22000 "sets an extended attribute of the link itself."
22004 #: ../fish/guestfish-actions.pod:2362
22009 #: ../fish/guestfish-actions.pod:2364
22017 #: ../fish/guestfish-actions.pod:2368
22019 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
22020 "the link is stat-ed, not the file it refers to."
22024 #: ../fish/guestfish-actions.pod:2374
22029 #: ../fish/guestfish-actions.pod:2376
22032 " lstatlist path 'names ...'\n"
22037 #: ../fish/guestfish-actions.pod:2378
22039 "This call allows you to perform the L</lstat> operation on multiple files, "
22040 "where all files are in the directory C<path>. C<names> is the list of files "
22041 "from this directory."
22045 #: ../fish/guestfish-actions.pod:2387
22047 "This call is intended for programs that want to efficiently list a directory "
22048 "contents without making many round-trips. See also L</lxattrlist> for a "
22049 "similarly efficient call for getting extended attributes. Very long "
22050 "directory listings might cause the protocol message size to be exceeded, "
22051 "causing this call to fail. The caller must split up such requests into "
22052 "smaller groups of names."
22056 #: ../fish/guestfish-actions.pod:2395
22057 msgid "luks-add-key"
22061 #: ../fish/guestfish-actions.pod:2397
22064 " luks-add-key device keyslot\n"
22069 #: ../fish/guestfish-actions.pod:2404
22071 "Note that if C<keyslot> already contains a key, then this command will "
22072 "fail. You have to use L</luks-kill-slot> first to remove that key."
22076 #: ../fish/guestfish-actions.pod:2408 ../fish/guestfish-actions.pod:2430
22077 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2457
22078 #: ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2490
22080 "This command has one or more key or passphrase parameters. Guestfish will "
22081 "prompt for these separately."
22085 #: ../fish/guestfish-actions.pod:2411
22090 #: ../fish/guestfish-actions.pod:2413
22093 " luks-close device\n"
22098 #: ../fish/guestfish-actions.pod:2415
22100 "This closes a LUKS device that was created earlier by L</luks-open> or L</"
22101 "luks-open-ro>. The C<device> parameter must be the name of the LUKS mapping "
22102 "device (ie. C</dev/mapper/mapname>) and I<not> the name of the underlying "
22107 #: ../fish/guestfish-actions.pod:2421
22108 msgid "luks-format"
22112 #: ../fish/guestfish-actions.pod:2423
22115 " luks-format device keyslot\n"
22120 #: ../fish/guestfish-actions.pod:2436
22121 msgid "luks-format-cipher"
22125 #: ../fish/guestfish-actions.pod:2438
22128 " luks-format-cipher device keyslot cipher\n"
22133 #: ../fish/guestfish-actions.pod:2440
22135 "This command is the same as L</luks-format> but it also allows you to set "
22136 "the C<cipher> used."
22140 #: ../fish/guestfish-actions.pod:2449
22141 msgid "luks-kill-slot"
22145 #: ../fish/guestfish-actions.pod:2451
22148 " luks-kill-slot device keyslot\n"
22153 #: ../fish/guestfish-actions.pod:2460
22158 #: ../fish/guestfish-actions.pod:2462
22161 " luks-open device mapname\n"
22166 #: ../fish/guestfish-actions.pod:2476
22168 "If this block device contains LVM volume groups, then calling L</vgscan> "
22169 "followed by L</vg-activate-all> will make them visible."
22173 #: ../fish/guestfish-actions.pod:2483
22174 msgid "luks-open-ro"
22178 #: ../fish/guestfish-actions.pod:2485
22181 " luks-open-ro device mapname\n"
22186 #: ../fish/guestfish-actions.pod:2487
22188 "This is the same as L</luks-open> except that a read-only mapping is created."
22192 #: ../fish/guestfish-actions.pod:2493
22197 #: ../fish/guestfish-actions.pod:2495
22200 " lvcreate logvol volgroup mbytes\n"
22205 #: ../fish/guestfish-actions.pod:2500
22206 msgid "lvm-canonical-lv-name"
22210 #: ../fish/guestfish-actions.pod:2502
22213 " lvm-canonical-lv-name lvname\n"
22218 #: ../fish/guestfish-actions.pod:2511
22219 msgid "See also L</is-lv>."
22223 #: ../fish/guestfish-actions.pod:2513
22224 msgid "lvm-clear-filter"
22228 #: ../fish/guestfish-actions.pod:2515
22231 " lvm-clear-filter\n"
22236 #: ../fish/guestfish-actions.pod:2517
22238 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
22243 #: ../fish/guestfish-actions.pod:2523
22244 msgid "lvm-remove-all"
22248 #: ../fish/guestfish-actions.pod:2525
22251 " lvm-remove-all\n"
22256 #: ../fish/guestfish-actions.pod:2533
22257 msgid "lvm-set-filter"
22261 #: ../fish/guestfish-actions.pod:2535
22264 " lvm-set-filter 'devices ...'\n"
22269 #: ../fish/guestfish-actions.pod:2560
22274 #: ../fish/guestfish-actions.pod:2562
22277 " lvremove device\n"
22282 #: ../fish/guestfish-actions.pod:2570
22287 #: ../fish/guestfish-actions.pod:2572
22290 " lvrename logvol newlogvol\n"
22295 #: ../fish/guestfish-actions.pod:2576
22300 #: ../fish/guestfish-actions.pod:2578
22303 " lvresize device mbytes\n"
22308 #: ../fish/guestfish-actions.pod:2584
22309 msgid "lvresize-free"
22313 #: ../fish/guestfish-actions.pod:2586
22316 " lvresize-free lv percent\n"
22321 #: ../fish/guestfish-actions.pod:2594
22326 #: ../fish/guestfish-actions.pod:2596
22334 #: ../fish/guestfish-actions.pod:2604
22335 msgid "See also L</lvs-full>, L</list-filesystems>."
22339 #: ../fish/guestfish-actions.pod:2606
22344 #: ../fish/guestfish-actions.pod:2608
22352 #: ../fish/guestfish-actions.pod:2613
22357 #: ../fish/guestfish-actions.pod:2615
22365 #: ../fish/guestfish-actions.pod:2619
22370 #: ../fish/guestfish-actions.pod:2621
22373 " lxattrlist path 'names ...'\n"
22378 #: ../fish/guestfish-actions.pod:2637
22380 "This call is intended for programs that want to efficiently list a directory "
22381 "contents without making many round-trips. See also L</lstatlist> for a "
22382 "similarly efficient call for getting standard stats. Very long directory "
22383 "listings might cause the protocol message size to be exceeded, causing this "
22384 "call to fail. The caller must split up such requests into smaller groups of "
22389 #: ../fish/guestfish-actions.pod:2645
22394 #: ../fish/guestfish-actions.pod:2647
22402 #: ../fish/guestfish-actions.pod:2651
22407 #: ../fish/guestfish-actions.pod:2653
22410 " mkdir-mode path mode\n"
22415 #: ../fish/guestfish-actions.pod:2662
22416 msgid "See also L</mkdir>, L</umask>"
22420 #: ../fish/guestfish-actions.pod:2664
22425 #: ../fish/guestfish-actions.pod:2666
22433 #: ../fish/guestfish-actions.pod:2671
22438 #: ../fish/guestfish-actions.pod:2673
22441 " mkdtemp template\n"
22446 #: ../fish/guestfish-actions.pod:2694
22451 #: ../fish/guestfish-actions.pod:2696
22454 " mke2fs-J fstype blocksize device journal\n"
22459 #: ../fish/guestfish-actions.pod:2704
22460 msgid "See also L</mke2journal>."
22464 #: ../fish/guestfish-actions.pod:2706
22469 #: ../fish/guestfish-actions.pod:2708
22472 " mke2fs-JL fstype blocksize device label\n"
22477 #: ../fish/guestfish-actions.pod:2713
22478 msgid "See also L</mke2journal-L>."
22482 #: ../fish/guestfish-actions.pod:2715
22487 #: ../fish/guestfish-actions.pod:2717
22490 " mke2fs-JU fstype blocksize device uuid\n"
22495 #: ../fish/guestfish-actions.pod:2722
22496 msgid "See also L</mke2journal-U>."
22500 #: ../fish/guestfish-actions.pod:2724
22501 msgid "mke2journal"
22505 #: ../fish/guestfish-actions.pod:2726
22508 " mke2journal blocksize device\n"
22513 #: ../fish/guestfish-actions.pod:2733
22514 msgid "mke2journal-L"
22518 #: ../fish/guestfish-actions.pod:2735
22521 " mke2journal-L blocksize label device\n"
22526 #: ../fish/guestfish-actions.pod:2739
22527 msgid "mke2journal-U"
22531 #: ../fish/guestfish-actions.pod:2741
22534 " mke2journal-U blocksize uuid device\n"
22539 #: ../fish/guestfish-actions.pod:2745
22544 #: ../fish/guestfish-actions.pod:2747
22547 " mkfifo mode path\n"
22552 #: ../fish/guestfish-actions.pod:2749
22554 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
22555 "is just a convenient wrapper around L</mknod>."
22559 #: ../fish/guestfish-actions.pod:2755
22564 #: ../fish/guestfish-actions.pod:2757
22567 " mkfs fstype device\n"
22572 #: ../fish/guestfish-actions.pod:2763
22577 #: ../fish/guestfish-actions.pod:2765
22580 " mkfs-b fstype blocksize device\n"
22585 #: ../fish/guestfish-actions.pod:2767
22587 "This call is similar to L</mkfs>, but it allows you to control the block "
22588 "size of the resulting filesystem. Supported block sizes depend on the "
22589 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
22593 #: ../fish/guestfish-actions.pod:2782
22598 #: ../fish/guestfish-actions.pod:2784
22601 " mkfs-opts fstype device [blocksize:..]\n"
22606 #: ../fish/guestfish-actions.pod:2806
22607 msgid "mkmountpoint"
22611 #: ../fish/guestfish-actions.pod:2808
22614 " mkmountpoint exemptpath\n"
22619 #: ../fish/guestfish-actions.pod:2810
22621 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
22622 "to create extra mountpoints before mounting the first filesystem."
22626 #: ../fish/guestfish-actions.pod:2834
22628 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
22629 "unexpected errors if you try to mix these calls. It is safest to manually "
22630 "unmount filesystems and remove mountpoints after use."
22634 #: ../fish/guestfish-actions.pod:2838
22636 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
22637 "for this to work for manual mountpoints, you must ensure that the innermost "
22638 "mountpoints have the longest pathnames, as in the example code above."
22642 #: ../fish/guestfish-actions.pod:2845
22644 "Autosync [see L</set-autosync>, this is set by default on handles] means "
22645 "that L</umount-all> is called when the handle is closed which can also "
22646 "trigger these issues."
22650 #: ../fish/guestfish-actions.pod:2849
22655 #: ../fish/guestfish-actions.pod:2851
22658 " mknod mode devmajor devminor path\n"
22663 #: ../fish/guestfish-actions.pod:2861
22665 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
22666 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
22667 "regular file). These constants are available in the standard Linux header "
22668 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
22669 "wrappers around this command which bitwise OR in the appropriate constant "
22674 #: ../fish/guestfish-actions.pod:2871
22679 #: ../fish/guestfish-actions.pod:2873
22682 " mknod-b mode devmajor devminor path\n"
22687 #: ../fish/guestfish-actions.pod:2875
22689 "This call creates a block device node called C<path> with mode C<mode> and "
22690 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22691 "wrapper around L</mknod>."
22695 #: ../fish/guestfish-actions.pod:2881
22700 #: ../fish/guestfish-actions.pod:2883
22703 " mknod-c mode devmajor devminor path\n"
22708 #: ../fish/guestfish-actions.pod:2885
22710 "This call creates a char device node called C<path> with mode C<mode> and "
22711 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
22712 "wrapper around L</mknod>."
22716 #: ../fish/guestfish-actions.pod:2891
22721 #: ../fish/guestfish-actions.pod:2893
22729 #: ../fish/guestfish-actions.pod:2897
22734 #: ../fish/guestfish-actions.pod:2899
22737 " mkswap-L label device\n"
22742 #: ../fish/guestfish-actions.pod:2907
22747 #: ../fish/guestfish-actions.pod:2909
22750 " mkswap-U uuid device\n"
22755 #: ../fish/guestfish-actions.pod:2913
22756 msgid "mkswap-file"
22760 #: ../fish/guestfish-actions.pod:2915
22763 " mkswap-file path\n"
22768 #: ../fish/guestfish-actions.pod:2919
22770 "This command just writes a swap file signature to an existing file. To "
22771 "create the file itself, use something like L</fallocate>."
22775 #: ../fish/guestfish-actions.pod:2922
22780 #: ../fish/guestfish-actions.pod:2924
22783 " modprobe modulename\n"
22788 #: ../fish/guestfish-actions.pod:2931
22793 #: ../fish/guestfish-actions.pod:2933
22796 " mount device mountpoint\n"
22801 #: ../fish/guestfish-actions.pod:2949
22803 "B<Important note:> When you use this call, the filesystem options C<sync> "
22804 "and C<noatime> are set implicitly. This was originally done because we "
22805 "thought it would improve reliability, but it turns out that I<-o sync> has a "
22806 "very large negative performance impact and negligible effect on "
22807 "reliability. Therefore we recommend that you avoid using L</mount> in any "
22808 "code that needs performance, and instead use L</mount-options> (use an empty "
22809 "string for the first parameter if you don't want any options)."
22813 #: ../fish/guestfish-actions.pod:2959
22818 #: ../fish/guestfish-actions.pod:2961
22821 " mount-loop file mountpoint\n"
22826 #: ../fish/guestfish-actions.pod:2967
22827 msgid "mount-options"
22831 #: ../fish/guestfish-actions.pod:2969
22834 " mount-options options device mountpoint\n"
22839 #: ../fish/guestfish-actions.pod:2971
22841 "This is the same as the L</mount> command, but it allows you to set the "
22842 "mount options as for the L<mount(8)> I<-o> flag."
22846 #: ../fish/guestfish-actions.pod:2979
22851 #: ../fish/guestfish-actions.pod:2981
22854 " mount-ro device mountpoint\n"
22859 #: ../fish/guestfish-actions.pod:2983
22861 "This is the same as the L</mount> command, but it mounts the filesystem with "
22862 "the read-only (I<-o ro>) flag."
22866 #: ../fish/guestfish-actions.pod:2986
22871 #: ../fish/guestfish-actions.pod:2988
22874 " mount-vfs options vfstype device mountpoint\n"
22879 #: ../fish/guestfish-actions.pod:2990
22881 "This is the same as the L</mount> command, but it allows you to set both the "
22882 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
22886 #: ../fish/guestfish-actions.pod:2994
22887 msgid "mountpoints"
22891 #: ../fish/guestfish-actions.pod:2996
22899 #: ../fish/guestfish-actions.pod:2998
22901 "This call is similar to L</mounts>. That call returns a list of devices. "
22902 "This one returns a hash table (map) of device name to directory where the "
22903 "device is mounted."
22907 #: ../fish/guestfish-actions.pod:3002
22912 #: ../fish/guestfish-actions.pod:3004
22920 #: ../fish/guestfish-actions.pod:3011
22921 msgid "See also: L</mountpoints>"
22925 #: ../fish/guestfish-actions.pod:3013
22930 #: ../fish/guestfish-actions.pod:3015
22938 #: ../fish/guestfish-actions.pod:3020
22939 msgid "ntfs-3g-probe"
22943 #: ../fish/guestfish-actions.pod:3022
22946 " ntfs-3g-probe true|false device\n"
22951 #: ../fish/guestfish-actions.pod:3036
22956 #: ../fish/guestfish-actions.pod:3038
22959 " ntfsresize device\n"
22964 #: ../fish/guestfish-actions.pod:3044
22965 msgid "ntfsresize-size"
22969 #: ../fish/guestfish-actions.pod:3046
22972 " ntfsresize-size device size\n"
22977 #: ../fish/guestfish-actions.pod:3048
22979 "This command is the same as L</ntfsresize> except that it allows you to "
22980 "specify the new size (in bytes) explicitly."
22984 #: ../fish/guestfish-actions.pod:3051
22989 #: ../fish/guestfish-actions.pod:3053
22992 " part-add device prlogex startsect endsect\n"
22997 #: ../fish/guestfish-actions.pod:3055
22999 "This command adds a partition to C<device>. If there is no partition table "
23000 "on the device, call L</part-init> first."
23004 #: ../fish/guestfish-actions.pod:3067
23006 "Creating a partition which covers the whole disk is not so easy. Use L</"
23007 "part-disk> to do that."
23011 #: ../fish/guestfish-actions.pod:3070
23016 #: ../fish/guestfish-actions.pod:3072
23019 " part-del device partnum\n"
23024 #: ../fish/guestfish-actions.pod:3080
23029 #: ../fish/guestfish-actions.pod:3082
23032 " part-disk device parttype\n"
23037 #: ../fish/guestfish-actions.pod:3084
23039 "This command is simply a combination of L</part-init> followed by L</part-"
23040 "add> to create a single primary partition covering the whole disk."
23044 #: ../fish/guestfish-actions.pod:3088
23046 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
23047 "possible values are described in L</part-init>."
23051 #: ../fish/guestfish-actions.pod:3094
23052 msgid "part-get-bootable"
23056 #: ../fish/guestfish-actions.pod:3096
23059 " part-get-bootable device partnum\n"
23064 #: ../fish/guestfish-actions.pod:3101
23065 msgid "See also L</part-set-bootable>."
23069 #: ../fish/guestfish-actions.pod:3103
23070 msgid "part-get-mbr-id"
23074 #: ../fish/guestfish-actions.pod:3105
23077 " part-get-mbr-id device partnum\n"
23082 #: ../fish/guestfish-actions.pod:3110 ../fish/guestfish-actions.pod:3248
23084 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
23085 "undefined results for other partition table types (see L</part-get-"
23090 #: ../fish/guestfish-actions.pod:3114
23091 msgid "part-get-parttype"
23095 #: ../fish/guestfish-actions.pod:3116
23098 " part-get-parttype device\n"
23103 #: ../fish/guestfish-actions.pod:3121
23105 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
23106 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
23107 "possible, although unusual. See L</part-init> for a full list."
23111 #: ../fish/guestfish-actions.pod:3126
23116 #: ../fish/guestfish-actions.pod:3128
23119 " part-init device parttype\n"
23124 #: ../fish/guestfish-actions.pod:3134
23126 "Initially there are no partitions. Following this, you should call L</part-"
23127 "add> for each partition required."
23131 #: ../fish/guestfish-actions.pod:3197
23136 #: ../fish/guestfish-actions.pod:3199
23139 " part-list device\n"
23144 #: ../fish/guestfish-actions.pod:3214
23146 "Start of the partition I<in bytes>. To get sectors you have to divide by "
23147 "the device's sector size, see L</blockdev-getss>."
23151 #: ../fish/guestfish-actions.pod:3227
23152 msgid "part-set-bootable"
23156 #: ../fish/guestfish-actions.pod:3229
23159 " part-set-bootable device partnum true|false\n"
23164 #: ../fish/guestfish-actions.pod:3238
23165 msgid "part-set-mbr-id"
23169 #: ../fish/guestfish-actions.pod:3240
23172 " part-set-mbr-id device partnum idbyte\n"
23177 #: ../fish/guestfish-actions.pod:3252
23178 msgid "part-set-name"
23182 #: ../fish/guestfish-actions.pod:3254
23185 " part-set-name device partnum name\n"
23190 #: ../fish/guestfish-actions.pod:3262
23191 msgid "part-to-dev"
23195 #: ../fish/guestfish-actions.pod:3264
23198 " part-to-dev partition\n"
23203 #: ../fish/guestfish-actions.pod:3270
23205 "The named partition must exist, for example as a string returned from L</"
23206 "list-partitions>."
23210 #: ../fish/guestfish-actions.pod:3273
23211 msgid "ping-daemon"
23215 #: ../fish/guestfish-actions.pod:3275
23223 #: ../fish/guestfish-actions.pod:3282
23228 #: ../fish/guestfish-actions.pod:3284
23231 " pread path count offset\n"
23236 #: ../fish/guestfish-actions.pod:3292
23237 msgid "See also L</pwrite>, L</pread-device>."
23241 #: ../fish/guestfish-actions.pod:3297
23242 msgid "pread-device"
23246 #: ../fish/guestfish-actions.pod:3299
23249 " pread-device device count offset\n"
23254 #: ../fish/guestfish-actions.pod:3307
23255 msgid "See also L</pread>."
23259 #: ../fish/guestfish-actions.pod:3312
23264 #: ../fish/guestfish-actions.pod:3314
23267 " pvcreate device\n"
23272 #: ../fish/guestfish-actions.pod:3320
23277 #: ../fish/guestfish-actions.pod:3322
23280 " pvremove device\n"
23285 #: ../fish/guestfish-actions.pod:3331
23290 #: ../fish/guestfish-actions.pod:3333
23293 " pvresize device\n"
23298 #: ../fish/guestfish-actions.pod:3338
23299 msgid "pvresize-size"
23303 #: ../fish/guestfish-actions.pod:3340
23306 " pvresize-size device size\n"
23311 #: ../fish/guestfish-actions.pod:3342
23313 "This command is the same as L</pvresize> except that it allows you to "
23314 "specify the new size (in bytes) explicitly."
23318 #: ../fish/guestfish-actions.pod:3345
23323 #: ../fish/guestfish-actions.pod:3347
23331 #: ../fish/guestfish-actions.pod:3355
23332 msgid "See also L</pvs-full>."
23336 #: ../fish/guestfish-actions.pod:3357
23341 #: ../fish/guestfish-actions.pod:3359
23349 #: ../fish/guestfish-actions.pod:3364
23354 #: ../fish/guestfish-actions.pod:3366
23362 #: ../fish/guestfish-actions.pod:3370
23367 #: ../fish/guestfish-actions.pod:3372
23370 " pwrite path content offset\n"
23375 #: ../fish/guestfish-actions.pod:3383
23376 msgid "See also L</pread>, L</pwrite-device>."
23380 #: ../fish/guestfish-actions.pod:3388
23381 msgid "pwrite-device"
23385 #: ../fish/guestfish-actions.pod:3390
23388 " pwrite-device device content offset\n"
23393 #: ../fish/guestfish-actions.pod:3400
23394 msgid "See also L</pwrite>."
23398 #: ../fish/guestfish-actions.pod:3405
23403 #: ../fish/guestfish-actions.pod:3407
23406 " read-file path\n"
23411 #: ../fish/guestfish-actions.pod:3412
23413 "Unlike L</cat>, this function can correctly handle files that contain "
23414 "embedded ASCII NUL characters. However unlike L</download>, this function "
23415 "is limited in the total size of file that can be handled."
23419 #: ../fish/guestfish-actions.pod:3420
23424 #: ../fish/guestfish-actions.pod:3422
23427 " read-lines path\n"
23432 #: ../fish/guestfish-actions.pod:3429
23434 "Note that this function cannot correctly handle binary files (specifically, "
23435 "files containing C<\\0> character which is treated as end of line). For "
23436 "those you need to use the L</read-file> function which has a more complex "
23441 #: ../fish/guestfish-actions.pod:3434
23446 #: ../fish/guestfish-actions.pod:3436
23454 #: ../fish/guestfish-actions.pod:3488
23456 "This function is primarily intended for use by programs. To get a simple "
23457 "list of names, use L</ls>. To get a printable directory for human "
23458 "consumption, use L</ll>."
23462 #: ../fish/guestfish-actions.pod:3492
23467 #: ../fish/guestfish-actions.pod:3494
23475 #: ../fish/guestfish-actions.pod:3498
23476 msgid "readlinklist"
23480 #: ../fish/guestfish-actions.pod:3500
23483 " readlinklist path 'names ...'\n"
23488 #: ../fish/guestfish-actions.pod:3524
23493 #: ../fish/guestfish-actions.pod:3526
23501 #: ../fish/guestfish-actions.pod:3531
23502 msgid "removexattr"
23506 #: ../fish/guestfish-actions.pod:3533
23509 " removexattr xattr path\n"
23514 #: ../fish/guestfish-actions.pod:3538
23515 msgid "See also: L</lremovexattr>, L<attr(5)>."
23519 #: ../fish/guestfish-actions.pod:3540
23524 #: ../fish/guestfish-actions.pod:3542
23527 " resize2fs device\n"
23532 #: ../fish/guestfish-actions.pod:3547
23534 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
23535 "before calling this command. For unknown reasons C<resize2fs> sometimes "
23536 "gives an error about this and sometimes not. In any case, it is always safe "
23537 "to call L</e2fsck-f> before calling this function."
23541 #: ../fish/guestfish-actions.pod:3553
23542 msgid "resize2fs-size"
23546 #: ../fish/guestfish-actions.pod:3555
23549 " resize2fs-size device size\n"
23554 #: ../fish/guestfish-actions.pod:3557
23556 "This command is the same as L</resize2fs> except that it allows you to "
23557 "specify the new size (in bytes) explicitly."
23561 #: ../fish/guestfish-actions.pod:3560
23566 #: ../fish/guestfish-actions.pod:3562
23574 #: ../fish/guestfish-actions.pod:3566
23579 #: ../fish/guestfish-actions.pod:3568
23587 #: ../fish/guestfish-actions.pod:3574
23592 #: ../fish/guestfish-actions.pod:3576
23600 #: ../fish/guestfish-actions.pod:3580
23601 msgid "rmmountpoint"
23605 #: ../fish/guestfish-actions.pod:3582
23608 " rmmountpoint exemptpath\n"
23613 #: ../fish/guestfish-actions.pod:3584
23615 "This calls removes a mountpoint that was previously created with L</"
23616 "mkmountpoint>. See L</mkmountpoint> for full details."
23620 #: ../fish/guestfish-actions.pod:3588
23621 msgid "scrub-device"
23625 #: ../fish/guestfish-actions.pod:3590
23628 " scrub-device device\n"
23633 #: ../fish/guestfish-actions.pod:3601
23638 #: ../fish/guestfish-actions.pod:3603
23641 " scrub-file file\n"
23646 #: ../fish/guestfish-actions.pod:3613
23647 msgid "scrub-freespace"
23651 #: ../fish/guestfish-actions.pod:3615
23654 " scrub-freespace dir\n"
23659 #: ../fish/guestfish-actions.pod:3617
23661 "This command creates the directory C<dir> and then fills it with files until "
23662 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
23663 "deletes them. The intention is to scrub any free space on the partition "
23664 "containing C<dir>."
23668 #: ../fish/guestfish-actions.pod:3626
23673 #: ../fish/guestfish-actions.pod:3628
23678 #: ../fish/guestfish-actions.pod:3630
23681 " set-append append\n"
23686 #: ../fish/guestfish-actions.pod:3641
23687 msgid "set-autosync"
23691 #: ../fish/guestfish-actions.pod:3643
23696 #: ../fish/guestfish-actions.pod:3645
23699 " set-autosync true|false\n"
23704 #: ../fish/guestfish-actions.pod:3647
23706 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
23707 "effort attempt to run L</umount-all> followed by L</sync> when the handle is "
23708 "closed (also if the program exits without closing handles)."
23712 #: ../fish/guestfish-actions.pod:3655
23717 #: ../fish/guestfish-actions.pod:3657
23722 #: ../fish/guestfish-actions.pod:3659
23725 " set-direct true|false\n"
23730 #: ../fish/guestfish-actions.pod:3665
23732 "One consequence of this is that log messages aren't caught by the library "
23733 "and handled by L</set-log-message-callback>, but go straight to stdout."
23737 #: ../fish/guestfish-actions.pod:3674
23738 msgid "set-e2label"
23742 #: ../fish/guestfish-actions.pod:3676
23745 " set-e2label device label\n"
23750 #: ../fish/guestfish-actions.pod:3682
23752 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
23753 "label on a filesystem."
23757 #: ../fish/guestfish-actions.pod:3685
23762 #: ../fish/guestfish-actions.pod:3687
23765 " set-e2uuid device uuid\n"
23770 #: ../fish/guestfish-actions.pod:3694
23772 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
23773 "UUID of a filesystem."
23777 #: ../fish/guestfish-actions.pod:3697
23778 msgid "set-memsize"
23782 #: ../fish/guestfish-actions.pod:3699
23787 #: ../fish/guestfish-actions.pod:3701
23790 " set-memsize memsize\n"
23795 #: ../fish/guestfish-actions.pod:3703
23797 "This sets the memory size in megabytes allocated to the qemu subprocess. "
23798 "This only has any effect if called before L</launch>."
23802 #: ../fish/guestfish-actions.pod:3714
23803 msgid "set-network"
23807 #: ../fish/guestfish-actions.pod:3716
23812 #: ../fish/guestfish-actions.pod:3718
23815 " set-network true|false\n"
23820 #: ../fish/guestfish-actions.pod:3726
23822 "You must call this before calling L</launch>, otherwise it has no effect."
23826 #: ../fish/guestfish-actions.pod:3729
23831 #: ../fish/guestfish-actions.pod:3731
23836 #: ../fish/guestfish-actions.pod:3733
23839 " set-path searchpath\n"
23844 #: ../fish/guestfish-actions.pod:3742
23849 #: ../fish/guestfish-actions.pod:3744
23854 #: ../fish/guestfish-actions.pod:3746
23862 #: ../fish/guestfish-actions.pod:3766
23863 msgid "set-recovery-proc"
23867 #: ../fish/guestfish-actions.pod:3768
23868 msgid "recovery-proc"
23872 #: ../fish/guestfish-actions.pod:3770
23875 " set-recovery-proc true|false\n"
23880 #: ../fish/guestfish-actions.pod:3772
23882 "If this is called with the parameter C<false> then L</launch> does not "
23883 "create a recovery process. The purpose of the recovery process is to stop "
23884 "runaway qemu processes in the case where the main program aborts abruptly."
23888 #: ../fish/guestfish-actions.pod:3777
23890 "This only has any effect if called before L</launch>, and the default is "
23895 #: ../fish/guestfish-actions.pod:3786
23896 msgid "set-selinux"
23900 #: ../fish/guestfish-actions.pod:3788
23905 #: ../fish/guestfish-actions.pod:3790
23908 " set-selinux true|false\n"
23913 #: ../fish/guestfish-actions.pod:3801
23918 #: ../fish/guestfish-actions.pod:3803
23923 #: ../fish/guestfish-actions.pod:3805
23926 " set-trace true|false\n"
23931 #: ../fish/guestfish-actions.pod:3821
23932 msgid "set-verbose"
23936 #: ../fish/guestfish-actions.pod:3823
23941 #: ../fish/guestfish-actions.pod:3825
23944 " set-verbose true|false\n"
23949 #: ../fish/guestfish-actions.pod:3832
23954 #: ../fish/guestfish-actions.pod:3834
23957 " setcon context\n"
23962 #: ../fish/guestfish-actions.pod:3841
23967 #: ../fish/guestfish-actions.pod:3843
23970 " setxattr xattr val vallen path\n"
23975 #: ../fish/guestfish-actions.pod:3849
23976 msgid "See also: L</lsetxattr>, L<attr(5)>."
23980 #: ../fish/guestfish-actions.pod:3851
23985 #: ../fish/guestfish-actions.pod:3853
23988 " sfdisk device cyls heads sectors 'lines ...'\n"
23993 #: ../fish/guestfish-actions.pod:3875
23994 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
23998 #: ../fish/guestfish-actions.pod:3881
24003 #: ../fish/guestfish-actions.pod:3883
24006 " sfdiskM device 'lines ...'\n"
24011 #: ../fish/guestfish-actions.pod:3885
24013 "This is a simplified interface to the L</sfdisk> command, where partition "
24014 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
24015 "you don't need to specify the cyls, heads and sectors parameters which were "
24016 "rarely if ever used anyway."
24020 #: ../fish/guestfish-actions.pod:3891
24021 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
24025 #: ../fish/guestfish-actions.pod:3897
24030 #: ../fish/guestfish-actions.pod:3899
24033 " sfdisk-N device partnum cyls heads sectors line\n"
24038 #: ../fish/guestfish-actions.pod:3904
24040 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
24041 "cyls/heads/sectors parameters."
24045 #: ../fish/guestfish-actions.pod:3907
24046 msgid "See also: L</part-add>"
24050 #: ../fish/guestfish-actions.pod:3912
24051 msgid "sfdisk-disk-geometry"
24055 #: ../fish/guestfish-actions.pod:3914
24058 " sfdisk-disk-geometry device\n"
24063 #: ../fish/guestfish-actions.pod:3916
24065 "This displays the disk geometry of C<device> read from the partition table. "
24066 "Especially in the case where the underlying block device has been resized, "
24067 "this can be different from the kernel's idea of the geometry (see L</sfdisk-"
24068 "kernel-geometry>)."
24072 #: ../fish/guestfish-actions.pod:3924
24073 msgid "sfdisk-kernel-geometry"
24077 #: ../fish/guestfish-actions.pod:3926
24080 " sfdisk-kernel-geometry device\n"
24085 #: ../fish/guestfish-actions.pod:3933
24090 #: ../fish/guestfish-actions.pod:3935
24093 " sfdisk-l device\n"
24098 #: ../fish/guestfish-actions.pod:3941
24099 msgid "See also: L</part-list>"
24103 #: ../fish/guestfish-actions.pod:3943
24108 #: ../fish/guestfish-actions.pod:3945
24116 #: ../fish/guestfish-actions.pod:3950
24117 msgid "This is like L</command>, but passes the command to:"
24121 #: ../fish/guestfish-actions.pod:3958
24122 msgid "All the provisos about L</command> apply to this call."
24126 #: ../fish/guestfish-actions.pod:3960
24131 #: ../fish/guestfish-actions.pod:3962
24134 " sh-lines command\n"
24139 #: ../fish/guestfish-actions.pod:3964
24140 msgid "This is the same as L</sh>, but splits the result into a list of lines."
24144 #: ../fish/guestfish-actions.pod:3967
24145 msgid "See also: L</command-lines>"
24149 #: ../fish/guestfish-actions.pod:3969
24154 #: ../fish/guestfish-actions.pod:3971
24162 #: ../fish/guestfish-actions.pod:3975
24167 #: ../fish/guestfish-actions.pod:3977
24175 #: ../fish/guestfish-actions.pod:3983
24180 #: ../fish/guestfish-actions.pod:3985
24188 #: ../fish/guestfish-actions.pod:3993
24193 #: ../fish/guestfish-actions.pod:3995
24201 #: ../fish/guestfish-actions.pod:4003
24206 #: ../fish/guestfish-actions.pod:4005
24209 " strings-e encoding path\n"
24214 #: ../fish/guestfish-actions.pod:4007
24216 "This is like the L</strings> command, but allows you to specify the encoding "
24217 "of strings that are looked for in the source file C<path>."
24221 #: ../fish/guestfish-actions.pod:4017
24223 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
24224 "ISO-8859-X (this is what L</strings> uses)."
24228 #: ../fish/guestfish-actions.pod:4049
24229 msgid "swapoff-device"
24233 #: ../fish/guestfish-actions.pod:4051
24236 " swapoff-device device\n"
24241 #: ../fish/guestfish-actions.pod:4053
24243 "This command disables the libguestfs appliance swap device or partition "
24244 "named C<device>. See L</swapon-device>."
24248 #: ../fish/guestfish-actions.pod:4057
24249 msgid "swapoff-file"
24253 #: ../fish/guestfish-actions.pod:4059
24256 " swapoff-file file\n"
24261 #: ../fish/guestfish-actions.pod:4063
24262 msgid "swapoff-label"
24266 #: ../fish/guestfish-actions.pod:4065
24269 " swapoff-label label\n"
24274 #: ../fish/guestfish-actions.pod:4070
24275 msgid "swapoff-uuid"
24279 #: ../fish/guestfish-actions.pod:4072
24282 " swapoff-uuid uuid\n"
24287 #: ../fish/guestfish-actions.pod:4077
24288 msgid "swapon-device"
24292 #: ../fish/guestfish-actions.pod:4079
24295 " swapon-device device\n"
24300 #: ../fish/guestfish-actions.pod:4081
24302 "This command enables the libguestfs appliance to use the swap device or "
24303 "partition named C<device>. The increased memory is made available for all "
24304 "commands, for example those run using L</command> or L</sh>."
24308 #: ../fish/guestfish-actions.pod:4093
24309 msgid "swapon-file"
24313 #: ../fish/guestfish-actions.pod:4095
24316 " swapon-file file\n"
24321 #: ../fish/guestfish-actions.pod:4097
24323 "This command enables swap to a file. See L</swapon-device> for other notes."
24327 #: ../fish/guestfish-actions.pod:4100
24328 msgid "swapon-label"
24332 #: ../fish/guestfish-actions.pod:4102
24335 " swapon-label label\n"
24340 #: ../fish/guestfish-actions.pod:4104
24342 "This command enables swap to a labeled swap partition. See L</swapon-"
24343 "device> for other notes."
24347 #: ../fish/guestfish-actions.pod:4107
24348 msgid "swapon-uuid"
24352 #: ../fish/guestfish-actions.pod:4109
24355 " swapon-uuid uuid\n"
24360 #: ../fish/guestfish-actions.pod:4111
24362 "This command enables swap to a swap partition with the given UUID. See L</"
24363 "swapon-device> for other notes."
24367 #: ../fish/guestfish-actions.pod:4114
24372 #: ../fish/guestfish-actions.pod:4116
24380 #: ../fish/guestfish-actions.pod:4124
24385 #: ../fish/guestfish-actions.pod:4126
24393 #: ../fish/guestfish-actions.pod:4134
24398 #: ../fish/guestfish-actions.pod:4136
24401 " tail-n nrlines path\n"
24406 #: ../fish/guestfish-actions.pod:4149
24411 #: ../fish/guestfish-actions.pod:4151
24414 " tar-in (tarfile|-) directory\n"
24419 #: ../fish/guestfish-actions.pod:4156
24420 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
24424 #: ../fish/guestfish-actions.pod:4161
24429 #: ../fish/guestfish-actions.pod:4163
24432 " tar-out directory (tarfile|-)\n"
24437 #: ../fish/guestfish-actions.pod:4168
24438 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
24442 #: ../fish/guestfish-actions.pod:4173
24447 #: ../fish/guestfish-actions.pod:4175
24450 " tgz-in (tarball|-) directory\n"
24455 #: ../fish/guestfish-actions.pod:4180
24456 msgid "To upload an uncompressed tarball, use L</tar-in>."
24460 #: ../fish/guestfish-actions.pod:4184
24465 #: ../fish/guestfish-actions.pod:4186
24468 " tgz-out directory (tarball|-)\n"
24473 #: ../fish/guestfish-actions.pod:4191
24474 msgid "To download an uncompressed tarball, use L</tar-out>."
24478 #: ../fish/guestfish-actions.pod:4195
24483 #: ../fish/guestfish-actions.pod:4197
24491 #: ../fish/guestfish-actions.pod:4206
24496 #: ../fish/guestfish-actions.pod:4208
24504 #: ../fish/guestfish-actions.pod:4213
24505 msgid "truncate-size"
24509 #: ../fish/guestfish-actions.pod:4215
24512 " truncate-size path size\n"
24517 #: ../fish/guestfish-actions.pod:4220
24519 "If the current file size is less than C<size> then the file is extended to "
24520 "the required size with zero bytes. This creates a sparse file (ie. disk "
24521 "blocks are not allocated for the file until you write to it). To create a "
24522 "non-sparse file of zeroes, use L</fallocate64> instead."
24526 #: ../fish/guestfish-actions.pod:4226
24531 #: ../fish/guestfish-actions.pod:4228
24534 " tune2fs-l device\n"
24539 #: ../fish/guestfish-actions.pod:4238
24544 #: ../fish/guestfish-actions.pod:4240
24547 " txz-in (tarball|-) directory\n"
24552 #: ../fish/guestfish-actions.pod:4247
24557 #: ../fish/guestfish-actions.pod:4249
24560 " txz-out directory (tarball|-)\n"
24565 #: ../fish/guestfish-actions.pod:4256
24570 #: ../fish/guestfish-actions.pod:4258
24578 #: ../fish/guestfish-actions.pod:4272
24579 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
24583 #: ../fish/guestfish-actions.pod:4277
24588 #: ../fish/guestfish-actions.pod:4279
24593 #: ../fish/guestfish-actions.pod:4281
24596 " umount pathordevice\n"
24601 #: ../fish/guestfish-actions.pod:4287
24606 #: ../fish/guestfish-actions.pod:4289
24607 msgid "unmount-all"
24611 #: ../fish/guestfish-actions.pod:4291
24619 #: ../fish/guestfish-actions.pod:4297
24624 #: ../fish/guestfish-actions.pod:4299
24627 " upload (filename|-) remotefilename\n"
24632 #: ../fish/guestfish-actions.pod:4306
24633 msgid "See also L</download>."
24637 #: ../fish/guestfish-actions.pod:4310
24638 msgid "upload-offset"
24642 #: ../fish/guestfish-actions.pod:4312
24645 " upload-offset (filename|-) remotefilename offset\n"
24650 #: ../fish/guestfish-actions.pod:4324
24652 "Note that there is no limit on the amount of data that can be uploaded with "
24653 "this call, unlike with L</pwrite>, and this call always writes the full "
24654 "amount unless an error occurs."
24658 #: ../fish/guestfish-actions.pod:4329
24659 msgid "See also L</upload>, L</pwrite>."
24663 #: ../fish/guestfish-actions.pod:4333
24668 #: ../fish/guestfish-actions.pod:4335
24671 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
24676 #: ../fish/guestfish-actions.pod:4354
24681 #: ../fish/guestfish-actions.pod:4356
24689 #: ../fish/guestfish-actions.pod:4383
24691 "I<Note:> Don't use this call to test for availability of features. In "
24692 "enterprise distributions we backport features from later versions into "
24693 "earlier versions, making this an unreliable way to test for features. Use "
24694 "L</available> instead."
24698 #: ../fish/guestfish-actions.pod:4389
24703 #: ../fish/guestfish-actions.pod:4391
24706 " vfs-label device\n"
24711 #: ../fish/guestfish-actions.pod:4398
24712 msgid "To find a filesystem from the label, use L</findfs-label>."
24716 #: ../fish/guestfish-actions.pod:4400
24721 #: ../fish/guestfish-actions.pod:4402
24724 " vfs-type device\n"
24729 #: ../fish/guestfish-actions.pod:4412
24734 #: ../fish/guestfish-actions.pod:4414
24737 " vfs-uuid device\n"
24742 #: ../fish/guestfish-actions.pod:4421
24743 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
24747 #: ../fish/guestfish-actions.pod:4423
24748 msgid "vg-activate"
24752 #: ../fish/guestfish-actions.pod:4425
24755 " vg-activate true|false 'volgroups ...'\n"
24760 #: ../fish/guestfish-actions.pod:4438
24761 msgid "vg-activate-all"
24765 #: ../fish/guestfish-actions.pod:4440
24768 " vg-activate-all true|false\n"
24773 #: ../fish/guestfish-actions.pod:4450
24778 #: ../fish/guestfish-actions.pod:4452
24781 " vgcreate volgroup 'physvols ...'\n"
24786 #: ../fish/guestfish-actions.pod:4457
24791 #: ../fish/guestfish-actions.pod:4459
24794 " vglvuuids vgname\n"
24799 #: ../fish/guestfish-actions.pod:4464
24801 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
24802 "logical volumes and volume groups."
24806 #: ../fish/guestfish-actions.pod:4467
24807 msgid "See also L</vgpvuuids>."
24811 #: ../fish/guestfish-actions.pod:4469
24816 #: ../fish/guestfish-actions.pod:4471
24819 " vgpvuuids vgname\n"
24824 #: ../fish/guestfish-actions.pod:4476
24826 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
24827 "physical volumes and volume groups."
24831 #: ../fish/guestfish-actions.pod:4479
24832 msgid "See also L</vglvuuids>."
24836 #: ../fish/guestfish-actions.pod:4481
24841 #: ../fish/guestfish-actions.pod:4483
24844 " vgremove vgname\n"
24849 #: ../fish/guestfish-actions.pod:4490
24854 #: ../fish/guestfish-actions.pod:4492
24857 " vgrename volgroup newvolgroup\n"
24862 #: ../fish/guestfish-actions.pod:4496
24867 #: ../fish/guestfish-actions.pod:4498
24875 #: ../fish/guestfish-actions.pod:4506
24876 msgid "See also L</vgs-full>."
24880 #: ../fish/guestfish-actions.pod:4508
24885 #: ../fish/guestfish-actions.pod:4510
24893 #: ../fish/guestfish-actions.pod:4515
24898 #: ../fish/guestfish-actions.pod:4517
24906 #: ../fish/guestfish-actions.pod:4522
24911 #: ../fish/guestfish-actions.pod:4524
24919 #: ../fish/guestfish-actions.pod:4528
24924 #: ../fish/guestfish-actions.pod:4530
24932 #: ../fish/guestfish-actions.pod:4535
24937 #: ../fish/guestfish-actions.pod:4537
24945 #: ../fish/guestfish-actions.pod:4542
24950 #: ../fish/guestfish-actions.pod:4544
24958 #: ../fish/guestfish-actions.pod:4549
24963 #: ../fish/guestfish-actions.pod:4551
24966 " write path content\n"
24971 #: ../fish/guestfish-actions.pod:4559
24976 #: ../fish/guestfish-actions.pod:4561
24979 " write-file path content size\n"
24984 #: ../fish/guestfish-actions.pod:4584
24989 #: ../fish/guestfish-actions.pod:4586
24992 " zegrep regex path\n"
24997 #: ../fish/guestfish-actions.pod:4594
25002 #: ../fish/guestfish-actions.pod:4596
25005 " zegrepi regex path\n"
25010 #: ../fish/guestfish-actions.pod:4604
25015 #: ../fish/guestfish-actions.pod:4606
25023 #: ../fish/guestfish-actions.pod:4614
25024 msgid "See also: L</zero-device>, L</scrub-device>."
25028 #: ../fish/guestfish-actions.pod:4616
25029 msgid "zero-device"
25033 #: ../fish/guestfish-actions.pod:4618
25036 " zero-device device\n"
25041 #: ../fish/guestfish-actions.pod:4620
25043 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
25044 "which just zeroes the first few blocks of a device."
25048 #: ../fish/guestfish-actions.pod:4627
25053 #: ../fish/guestfish-actions.pod:4629
25056 " zerofree device\n"
25061 #: ../fish/guestfish-actions.pod:4642
25066 #: ../fish/guestfish-actions.pod:4644
25069 " zfgrep pattern path\n"
25074 #: ../fish/guestfish-actions.pod:4652
25079 #: ../fish/guestfish-actions.pod:4654
25082 " zfgrepi pattern path\n"
25087 #: ../fish/guestfish-actions.pod:4662
25092 #: ../fish/guestfish-actions.pod:4664
25095 " zfile meth path\n"
25100 #: ../fish/guestfish-actions.pod:4671
25102 "Since 1.0.63, use L</file> instead which can now process compressed files."
25106 #: ../fish/guestfish-actions.pod:4681
25111 #: ../fish/guestfish-actions.pod:4683
25114 " zgrep regex path\n"
25119 #: ../fish/guestfish-actions.pod:4691
25124 #: ../fish/guestfish-actions.pod:4693
25127 " zgrepi regex path\n"
25132 #: ../fish/guestfish-commands.pod:1
25137 #: ../fish/guestfish-commands.pod:3
25142 #: ../fish/guestfish-commands.pod:5
25145 " alloc filename size\n"
25150 #: ../fish/guestfish-commands.pod:7
25152 "This creates an empty (zeroed) file of the given size, and then adds so it "
25153 "can be further examined."
25157 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:168
25158 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
25162 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:170
25163 msgid "Size can be specified using standard suffixes, eg. C<1M>."
25167 #: ../fish/guestfish-commands.pod:14
25169 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
25170 "image, see L</PREPARED DISK IMAGES>."
25174 #: ../fish/guestfish-commands.pod:17
25179 #: ../fish/guestfish-commands.pod:19
25182 " copy-in local [local ...] /remotedir\n"
25187 #: ../fish/guestfish-commands.pod:21
25189 "C<copy-in> copies local files or directories recursively into the disk "
25190 "image, placing them in the directory called C</remotedir> (which must "
25191 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
25192 "other commands as necessary."
25196 #: ../fish/guestfish-commands.pod:26
25198 "Multiple local files and directories can be specified, but the last "
25199 "parameter must always be a remote directory. Wildcards cannot be used."
25203 #: ../fish/guestfish-commands.pod:30
25208 #: ../fish/guestfish-commands.pod:32
25211 " copy-out remote [remote ...] localdir\n"
25216 #: ../fish/guestfish-commands.pod:34
25218 "C<copy-out> copies remote files or directories recursively out of the disk "
25219 "image, placing them on the host disk in a local directory called C<localdir> "
25220 "(which must exist). This guestfish meta-command turns into a sequence of L</"
25221 "download>, L</tar-out> and other commands as necessary."
25225 #: ../fish/guestfish-commands.pod:40
25227 "Multiple remote files and directories can be specified, but the last "
25228 "parameter must always be a local directory. To download to the current "
25229 "directory, use C<.> as in:"
25233 #: ../fish/guestfish-commands.pod:44
25236 " copy-out /home .\n"
25241 #: ../fish/guestfish-commands.pod:46
25243 "Wildcards cannot be used in the ordinary command, but you can use them with "
25244 "the help of L</glob> like this:"
25248 #: ../fish/guestfish-commands.pod:49
25251 " glob copy-out /home/* .\n"
25256 #: ../fish/guestfish-commands.pod:51
25261 #: ../fish/guestfish-commands.pod:53
25264 " echo [params ...]\n"
25269 #: ../fish/guestfish-commands.pod:55
25270 msgid "This echos the parameters to the terminal."
25274 #: ../fish/guestfish-commands.pod:57
25279 #: ../fish/guestfish-commands.pod:59
25284 #: ../fish/guestfish-commands.pod:61
25289 #: ../fish/guestfish-commands.pod:63
25297 #: ../fish/guestfish-commands.pod:65
25299 "This is used to edit a file. It downloads the file, edits it locally using "
25300 "your editor, then uploads the result."
25304 #: ../fish/guestfish-commands.pod:68
25306 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
25307 "or C<emacs> you will get those corresponding editors."
25311 #: ../fish/guestfish-commands.pod:72
25316 #: ../fish/guestfish-commands.pod:74
25319 " glob command args...\n"
25324 #: ../fish/guestfish-commands.pod:76
25326 "Expand wildcards in any paths in the args list, and run C<command> "
25327 "repeatedly on each matching path."
25331 #: ../fish/guestfish-commands.pod:79
25332 msgid "See L</WILDCARDS AND GLOBBING>."
25336 #: ../fish/guestfish-commands.pod:81
25341 #: ../fish/guestfish-commands.pod:83
25344 " hexedit <filename|device>\n"
25345 " hexedit <filename|device> <max>\n"
25346 " hexedit <filename|device> <start> <max>\n"
25351 #: ../fish/guestfish-commands.pod:87
25353 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
25358 #: ../fish/guestfish-commands.pod:90
25360 "This command works by downloading potentially the whole file or device, "
25361 "editing it locally, then uploading it. If the file or device is large, you "
25362 "have to specify which part you wish to edit by using C<max> and/or C<start> "
25363 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
25364 "usual modifiers allowed such as C<1M> (1 megabyte)."
25368 #: ../fish/guestfish-commands.pod:97
25369 msgid "For example to edit the first few sectors of a disk you might do:"
25373 #: ../fish/guestfish-commands.pod:100
25376 " hexedit /dev/sda 1M\n"
25381 #: ../fish/guestfish-commands.pod:102
25383 "which would allow you to edit anywhere within the first megabyte of the disk."
25387 #: ../fish/guestfish-commands.pod:105
25388 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
25392 #: ../fish/guestfish-commands.pod:107
25395 " hexedit /dev/sda1 0x400 0x400\n"
25400 #: ../fish/guestfish-commands.pod:109
25401 msgid "(assuming the superblock is in the standard location)."
25405 #: ../fish/guestfish-commands.pod:111
25407 "This command requires the external L<hexedit(1)> program. You can specify "
25408 "another program to use by setting the C<HEXEDITOR> environment variable."
25412 #: ../fish/guestfish-commands.pod:115
25413 msgid "See also L</hexdump>."
25417 #: ../fish/guestfish-commands.pod:117
25422 #: ../fish/guestfish-commands.pod:119
25430 #: ../fish/guestfish-commands.pod:121
25432 "Change the local directory, ie. the current directory of guestfish itself."
25436 #: ../fish/guestfish-commands.pod:124
25437 msgid "Note that C<!cd> won't do what you might expect."
25441 #: ../fish/guestfish-commands.pod:126
25446 #: ../fish/guestfish-commands.pod:128
25451 #: ../fish/guestfish-commands.pod:130
25459 #: ../fish/guestfish-commands.pod:132
25460 msgid "Opens the manual page for guestfish."
25464 #: ../fish/guestfish-commands.pod:134
25469 #: ../fish/guestfish-commands.pod:136
25474 #: ../fish/guestfish-commands.pod:138
25482 #: ../fish/guestfish-commands.pod:140
25490 #: ../fish/guestfish-commands.pod:142
25491 msgid "This is used to view a file."
25495 #: ../fish/guestfish-commands.pod:144
25497 "The default viewer is C<$PAGER>. However if you use the alternate command "
25498 "C<less> you will get the C<less> command specifically."
25502 #: ../fish/guestfish-commands.pod:147
25507 #: ../fish/guestfish-commands.pod:149
25515 #: ../fish/guestfish-commands.pod:151
25517 "Close and reopen the libguestfs handle. It is not necessary to use this "
25518 "normally, because the handle is closed properly when guestfish exits. "
25519 "However this is occasionally useful for testing."
25523 #: ../fish/guestfish-commands.pod:155
25528 #: ../fish/guestfish-commands.pod:157
25531 " sparse filename size\n"
25536 #: ../fish/guestfish-commands.pod:159
25538 "This creates an empty sparse file of the given size, and then adds so it can "
25539 "be further examined."
25543 #: ../fish/guestfish-commands.pod:162
25545 "In all respects it works the same as the L</alloc> command, except that the "
25546 "image file is allocated sparsely, which means that disk blocks are not "
25547 "assigned to the file until they are needed. Sparse disk files only use "
25548 "space when written to, but they are slower and there is a danger you could "
25549 "run out of real disk space during a write operation."
25553 #: ../fish/guestfish-commands.pod:172
25558 #: ../fish/guestfish-commands.pod:174
25566 #: ../fish/guestfish-commands.pod:176
25568 "This command returns a list of the optional groups known to the daemon, and "
25569 "indicates which ones are supported by this build of the libguestfs appliance."
25573 #: ../fish/guestfish-commands.pod:180
25574 msgid "See also L<guestfs(3)/AVAILABILITY>."
25578 #: ../fish/guestfish-commands.pod:182
25583 #: ../fish/guestfish-commands.pod:184
25586 " time command args...\n"
25591 #: ../fish/guestfish-commands.pod:186
25593 "Run the command as usual, but print the elapsed time afterwards. This can "
25594 "be useful for benchmarking operations."
25598 #: ../test-tool/libguestfs-test-tool.pod:5
25599 msgid "libguestfs-test-tool - End user tests for libguestfs"
25603 #: ../test-tool/libguestfs-test-tool.pod:9
25606 " libguestfs-test-tool [--options]\n"
25611 #: ../test-tool/libguestfs-test-tool.pod:13
25613 "libguestfs-test-tool is a test program shipped with libguestfs to end users "
25614 "and developers, to allow them to check basic libguestfs functionality is "
25615 "working. This is needed because libguestfs occasionally breaks for reasons "
25616 "beyond our control: usually because of changes in the underlying qemu or "
25617 "kernel packages, or the host environment."
25621 #: ../test-tool/libguestfs-test-tool.pod:20
25622 msgid "If you suspect a problem in libguestfs, then just run:"
25626 #: ../test-tool/libguestfs-test-tool.pod:22
25629 " libguestfs-test-tool\n"
25634 #: ../test-tool/libguestfs-test-tool.pod:24
25635 msgid "It will print lots of diagnostic messages."
25639 #: ../test-tool/libguestfs-test-tool.pod:26
25640 msgid "If it runs to completion successfully, you will see this near the end:"
25644 #: ../test-tool/libguestfs-test-tool.pod:28
25647 " ===== TEST FINISHED OK =====\n"
25652 #: ../test-tool/libguestfs-test-tool.pod:30
25653 msgid "and the test tool will exit with code 0."
25657 #: ../test-tool/libguestfs-test-tool.pod:32
25659 "If it fails (and/or exits with non-zero error code), please paste the "
25660 "B<complete, unedited> output of the test tool into a bug report. More "
25661 "information about reporting bugs can be found on the L<http://libguestfs.org/"
25666 #: ../test-tool/libguestfs-test-tool.pod:41
25671 #: ../test-tool/libguestfs-test-tool.pod:43
25672 msgid "Display short usage information and exit."
25676 #: ../test-tool/libguestfs-test-tool.pod:45
25677 msgid "I<--helper /path/to/libguestfs-test-tool-helper>"
25681 #: ../test-tool/libguestfs-test-tool.pod:47
25683 "Pass an alternate name for the helper program. libguestfs-test-tool will "
25684 "normally look in the C<$libexec> directory that was configured when the tool "
25689 #: ../test-tool/libguestfs-test-tool.pod:51
25690 msgid "I<--qemu qemu_binary>"
25694 #: ../test-tool/libguestfs-test-tool.pod:53
25696 "If you have downloaded another qemu binary, point this option at the full "
25697 "path of the binary to try it."
25701 #: ../test-tool/libguestfs-test-tool.pod:56
25702 msgid "I<--qemudir qemu_source_dir>"
25706 #: ../test-tool/libguestfs-test-tool.pod:58
25708 "If you have compiled qemu from source, point this option at the source "
25709 "directory to try it."
25713 #: ../test-tool/libguestfs-test-tool.pod:61
25714 msgid "I<--timeout N>"
25718 #: ../test-tool/libguestfs-test-tool.pod:63
25720 "Set the launch timeout to C<N> seconds. The default is 120 seconds which "
25721 "does not usually need to be adjusted unless your machine is very slow."
25725 #: ../test-tool/libguestfs-test-tool.pod:69
25726 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
25730 #: ../test-tool/libguestfs-test-tool.pod:71
25732 "If you have compiled another version of qemu from source and would like to "
25733 "try that, then you can use the I<--qemudir> option to point to the qemu "
25734 "source directory."
25738 #: ../test-tool/libguestfs-test-tool.pod:75
25740 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
25741 "option to point to the binary."
25745 #: ../test-tool/libguestfs-test-tool.pod:78
25747 "When using an alternate qemu with libguestfs, usually you would need to "
25748 "write a qemu wrapper script (see section I<QEMU WRAPPERS> in L<guestfs(3)"
25749 ">). libguestfs-test-tool writes a temporary qemu wrapper script when you "
25750 "use either of the I<--qemudir> or I<--qemu> options."
25754 #: ../test-tool/libguestfs-test-tool.pod:85
25756 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
25757 "I<1> if there was an error."
25761 #: ../test-tool/libguestfs-test-tool.pod:92
25762 msgid "/usr/libexec/libguestfs-test-tool-helper"
25766 #: ../test-tool/libguestfs-test-tool.pod:94
25768 "This helper program is run inside the appliance and provides additional "
25773 #: ../test-tool/libguestfs-test-tool.pod:97
25774 msgid "/usr/bin/mkisofs"
25778 #: ../test-tool/libguestfs-test-tool.pod:99
25780 "The C<mkisofs> command is required in order to construct a CD-ROM ISO file "
25781 "which is used as part of the tests."
25785 #: ../test-tool/libguestfs-test-tool.pod:106
25787 "For the full list of environment variables which may affect libguestfs, "
25788 "please see the L<guestfs(3)> manual page."
25792 #: ../test-tool/libguestfs-test-tool.pod:111
25793 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
25797 #: ../test-tool/libguestfs-test-tool.pod:121
25798 msgid "Copyright (C) 2009 Red Hat Inc. L<http://libguestfs.org/>"
25802 #: ../fuse/guestmount.pod:5
25804 "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
25808 #: ../fuse/guestmount.pod:9
25811 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
25816 #: ../fuse/guestmount.pod:11
25819 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
25824 #: ../fuse/guestmount.pod:13
25827 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
25832 #: ../fuse/guestmount.pod:17
25834 "You must I<not> use C<guestmount> in read-write mode on live virtual "
25835 "machines. If you do this, you risk disk corruption in the VM."
25839 #: ../fuse/guestmount.pod:22
25841 "The guestmount program can be used to mount virtual machine filesystems and "
25842 "other disk images on the host. It uses libguestfs for access to the guest "
25843 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
25844 "a mountable device."
25848 #: ../fuse/guestmount.pod:27
25850 "Along with other options, you have to give at least one device (I<-a> "
25851 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
25852 "option) or use the I<-i> inspection option. How this works is better "
25853 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
25858 #: ../fuse/guestmount.pod:33
25860 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
25861 "by you, and the filesystem will not be visible to any other users unless you "
25862 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
25863 "the filesystem, use the C<fusermount -u> command."
25867 #: ../fuse/guestmount.pod:41
25869 "For a typical Windows guest which has its main filesystem on the first "
25874 #: ../fuse/guestmount.pod:44
25877 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
25882 #: ../fuse/guestmount.pod:46
25884 "For a typical Linux guest which has a /boot filesystem on the first "
25885 "partition, and the root filesystem on a logical volume:"
25889 #: ../fuse/guestmount.pod:49
25892 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
25897 #: ../fuse/guestmount.pod:51
25898 msgid "To get libguestfs to detect guest mountpoints for you:"
25902 #: ../fuse/guestmount.pod:53
25905 " guestmount -a guest.img -i --ro /mnt\n"
25910 #: ../fuse/guestmount.pod:55
25911 msgid "For a libvirt guest called \"Guest\" you could do:"
25915 #: ../fuse/guestmount.pod:57
25918 " guestmount -d Guest -i --ro /mnt\n"
25923 #: ../fuse/guestmount.pod:59
25925 "If you don't know what filesystems are contained in a guest or disk image, "
25926 "use L<virt-filesystems(1)> first:"
25930 #: ../fuse/guestmount.pod:62
25933 " virt-filesystems MyGuest\n"
25938 #: ../fuse/guestmount.pod:64
25940 "If you want to trace the libguestfs calls but without excessive debugging "
25941 "information, we recommend:"
25945 #: ../fuse/guestmount.pod:67
25948 " guestmount [...] --trace /mnt\n"
25953 #: ../fuse/guestmount.pod:69
25954 msgid "If you want to debug the program, we recommend:"
25958 #: ../fuse/guestmount.pod:71
25961 " guestmount [...] --trace --verbose /mnt\n"
25966 #: ../fuse/guestmount.pod:79
25967 msgid "Add a block device or virtual machine image."
25971 #: ../fuse/guestmount.pod:96
25972 msgid "B<--dir-cache-timeout N>"
25976 #: ../fuse/guestmount.pod:98
25978 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
25979 "seconds. The readdir cache [actually, there are several semi-independent "
25980 "caches] is populated after a readdir(2) call with the stat and extended "
25981 "attributes of the files in the directory, in anticipation that they will be "
25982 "requested soon after."
25986 #: ../fuse/guestmount.pod:104
25988 "There is also a different attribute cache implemented by FUSE (see the FUSE "
25989 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
25990 "requests, only cache existing ones."
25994 #: ../fuse/guestmount.pod:122
25996 "If you have untrusted raw-format guest disk images, you should use this "
25997 "option to specify the disk format. This avoids a possible security problem "
25998 "with malicious guests (CVE-2010-3851). See also L<guestfs(3)/"
25999 "guestfs_add_drive_opts>."
26003 #: ../fuse/guestmount.pod:127
26004 msgid "B<--fuse-help>"
26008 #: ../fuse/guestmount.pod:129
26009 msgid "Display help on special FUSE options (see I<-o> below)."
26013 #: ../fuse/guestmount.pod:133
26014 msgid "Display brief help and exit."
26018 #: ../fuse/guestmount.pod:146
26019 msgid "B<-m dev[:mnt]> | B<--mount dev[:mnt]>"
26023 #: ../fuse/guestmount.pod:148
26025 "Mount the named partition or logical volume on the given mountpoint B<in the "
26026 "guest> (this has nothing to do with mountpoints in the host)."
26030 #: ../fuse/guestmount.pod:151
26032 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
26033 "something on C</>."
26037 #: ../fuse/guestmount.pod:156
26039 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
26040 "unmounted. If you specify this option, then we don't attempt to sync the "
26041 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
26045 #: ../fuse/guestmount.pod:161
26046 msgid "B<-o option> | B<--option option>"
26050 #: ../fuse/guestmount.pod:163
26051 msgid "Pass extra options to FUSE."
26055 #: ../fuse/guestmount.pod:165
26057 "To get a list of all the extra options supported by FUSE, use the command "
26058 "below. Note that only the FUSE I<-o> options can be passed, and only some "
26059 "of them are a good idea."
26063 #: ../fuse/guestmount.pod:169
26066 " guestmount --fuse-help\n"
26071 #: ../fuse/guestmount.pod:171
26072 msgid "Some potentially useful FUSE options:"
26076 #: ../fuse/guestmount.pod:175
26077 msgid "B<-o allow_other>"
26081 #: ../fuse/guestmount.pod:177
26082 msgid "Allow other users to see the filesystem."
26086 #: ../fuse/guestmount.pod:179
26087 msgid "B<-o attr_timeout=N>"
26091 #: ../fuse/guestmount.pod:181
26092 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
26096 #: ../fuse/guestmount.pod:183
26097 msgid "B<-o kernel_cache>"
26101 #: ../fuse/guestmount.pod:185
26103 "Allow the kernel to cache files (reduces the number of reads that have to go "
26104 "through the L<guestfs(3)> API). This is generally a good idea if you can "
26105 "afford the extra memory usage."
26109 #: ../fuse/guestmount.pod:189
26110 msgid "B<-o uid=N> B<-o gid=N>"
26114 #: ../fuse/guestmount.pod:191
26116 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
26117 "the chosen values."
26121 #: ../fuse/guestmount.pod:198
26123 "Add devices and mount everything read-only. Also disallow writes and make "
26124 "the disk appear read-only to FUSE."
26128 #: ../fuse/guestmount.pod:201
26130 "This is highly recommended if you are not going to edit the guest disk. If "
26131 "the guest is running and this option is I<not> supplied, then there is a "
26132 "strong risk of disk corruption in the guest. We try to prevent this from "
26133 "happening, but it is not always possible."
26137 #: ../fuse/guestmount.pod:206
26138 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
26142 #: ../fuse/guestmount.pod:210
26143 msgid "Enable SELinux support for the guest."
26147 #: ../fuse/guestmount.pod:214
26148 msgid "Enable verbose messages from underlying libguestfs."
26152 #: ../fuse/guestmount.pod:218
26153 msgid "Display the program version and exit."
26157 #: ../fuse/guestmount.pod:222
26159 "This option does nothing at the moment. See L<guestfish(1)/OPENING DISKS "
26160 "FOR READ AND WRITE>."
26164 #: ../fuse/guestmount.pod:225
26165 msgid "B<-x> | B<--trace>"
26169 #: ../fuse/guestmount.pod:227
26170 msgid "Trace libguestfs calls."
26174 #: ../fuse/guestmount.pod:229
26175 msgid "This also stops the daemon from forking into the background."
26179 #: ../fuse/guestmount.pod:235
26181 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
26182 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, L<http://fuse.sf."
26187 #: ../tools/virt-edit.pl:34
26188 msgid "virt-edit - Edit a file in a virtual machine"
26192 #: ../tools/virt-edit.pl:38
26195 " virt-edit [--options] domname file\n"
26200 #: ../tools/virt-edit.pl:40
26203 " virt-edit [--options] disk.img [disk.img ...] file\n"
26208 #: ../tools/virt-edit.pl:42
26211 " virt-edit [domname|disk.img] file -e 'expr'\n"
26216 #: ../tools/virt-edit.pl:46
26218 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
26219 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
26220 "doing this, but doesn't catch all cases."
26224 #: ../tools/virt-edit.pl:52
26226 "C<virt-edit> is a command line tool to edit C<file> where C<file> exists in "
26227 "the named virtual machine (or disk image)."
26231 #: ../tools/virt-edit.pl:55
26233 "If you want to just view a file, use L<virt-cat(1)>. For more complex cases "
26234 "you should look at the L<guestfish(1)> tool."
26238 #: ../tools/virt-edit.pl:60
26239 msgid "Edit the named files interactively:"
26243 #: ../tools/virt-edit.pl:62
26246 " virt-edit mydomain /boot/grub/grub.conf\n"
26251 #: ../tools/virt-edit.pl:64
26254 " virt-edit mydomain /etc/passwd\n"
26259 #: ../tools/virt-edit.pl:66
26261 "You can also edit files non-interactively (see L</NON-INTERACTIVE EDITING> "
26262 "below). To change the init default level to 5:"
26266 #: ../tools/virt-edit.pl:70
26269 " virt-edit mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
26274 #: ../tools/virt-edit.pl:82 ../tools/virt-win-reg.pl:181
26275 #: ../tools/virt-list-filesystems.pl:63 ../tools/virt-tar.pl:108
26276 #: ../tools/virt-make-fs.pl:163 ../tools/virt-list-partitions.pl:64
26277 msgid "Display brief help."
26281 #: ../tools/virt-edit.pl:88 ../tools/virt-win-reg.pl:187
26282 #: ../tools/virt-resize.pl:270 ../tools/virt-list-filesystems.pl:69
26283 #: ../tools/virt-tar.pl:114 ../tools/virt-make-fs.pl:169
26284 #: ../tools/virt-list-partitions.pl:70
26285 msgid "B<--version>"
26289 #: ../tools/virt-edit.pl:90 ../tools/virt-win-reg.pl:189
26290 #: ../tools/virt-resize.pl:272 ../tools/virt-list-filesystems.pl:71
26291 #: ../tools/virt-tar.pl:116 ../tools/virt-make-fs.pl:171
26292 #: ../tools/virt-list-partitions.pl:72
26293 msgid "Display version number and exit."
26297 #: ../tools/virt-edit.pl:96
26298 msgid "B<--backup extension> | B<-b extension>"
26302 #: ../tools/virt-edit.pl:98
26304 "Create a backup of the original file I<in the guest disk image>. The backup "
26305 "has the original filename with C<extension> added."
26309 #: ../tools/virt-edit.pl:101
26311 "Usually the first character of C<extension> would be a dot C<.> so you would "
26316 #: ../tools/virt-edit.pl:104
26319 " virt-edit -b .orig [etc]\n"
26324 #: ../tools/virt-edit.pl:106
26325 msgid "By default, no backup file is made."
26329 #: ../tools/virt-edit.pl:112 ../tools/virt-win-reg.pl:203
26330 #: ../tools/virt-list-filesystems.pl:77 ../tools/virt-tar.pl:122
26331 #: ../tools/virt-list-partitions.pl:78
26332 msgid "B<--connect URI> | B<-c URI>"
26336 #: ../tools/virt-edit.pl:114 ../tools/virt-win-reg.pl:205
26337 #: ../tools/virt-list-filesystems.pl:79 ../tools/virt-tar.pl:124
26338 #: ../tools/virt-list-partitions.pl:80
26340 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
26341 "to the default libvirt hypervisor."
26345 #: ../tools/virt-edit.pl:117 ../tools/virt-win-reg.pl:208
26346 #: ../tools/virt-list-filesystems.pl:82 ../tools/virt-tar.pl:127
26347 #: ../tools/virt-list-partitions.pl:83
26349 "If you specify guest block devices directly, then libvirt is not used at all."
26353 #: ../tools/virt-edit.pl:124 ../tools/virt-win-reg.pl:215
26354 #: ../tools/virt-resize.pl:520 ../tools/virt-list-filesystems.pl:89
26355 #: ../tools/virt-tar.pl:134 ../tools/virt-list-partitions.pl:90
26356 msgid "B<--format> raw"
26360 #: ../tools/virt-edit.pl:126 ../tools/virt-win-reg.pl:217
26361 #: ../tools/virt-list-filesystems.pl:91 ../tools/virt-tar.pl:136
26362 #: ../tools/virt-list-partitions.pl:92
26364 "Specify the format of disk images given on the command line. If this is "
26365 "omitted then the format is autodetected from the content of the disk image."
26369 #: ../tools/virt-edit.pl:130 ../tools/virt-win-reg.pl:221
26370 #: ../tools/virt-list-filesystems.pl:95 ../tools/virt-tar.pl:140
26371 #: ../tools/virt-list-partitions.pl:96
26373 "If disk images are requested from libvirt, then this program asks libvirt "
26374 "for this information. In this case, the value of the format parameter is "
26379 #: ../tools/virt-edit.pl:134 ../tools/virt-win-reg.pl:225
26380 #: ../tools/virt-resize.pl:525 ../tools/virt-resize.pl:540
26381 #: ../tools/virt-list-filesystems.pl:99 ../tools/virt-tar.pl:144
26382 #: ../tools/virt-list-partitions.pl:100
26384 "If working with untrusted raw-format guest disk images, you should ensure "
26385 "the format is always specified."
26389 #: ../tools/virt-edit.pl:141
26390 msgid "B<--expr EXPR> | B<-e EXPR>"
26394 #: ../tools/virt-edit.pl:143
26396 "Instead of launching the external editor, non-interactively apply the Perl "
26397 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
26402 #: ../tools/virt-edit.pl:147
26404 "Be careful to properly quote the expression to prevent it from being altered "
26409 #: ../tools/virt-edit.pl:268
26410 msgid "NON-INTERACTIVE EDITING"
26414 #: ../tools/virt-edit.pl:270
26416 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
26417 "administrator can interactively edit the file."
26421 #: ../tools/virt-edit.pl:273
26423 "There are two ways also to use C<virt-edit> from scripts in order to make "
26424 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
26425 "like this, it's less error-prone to write scripts directly using the "
26426 "libguestfs API and Augeas for configuration file editing.)"
26430 #: ../tools/virt-edit.pl:279
26432 "The first method is to temporarily set C<$EDITOR> to any script or program "
26433 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
26434 "update C<tmpfile> in place however it likes."
26438 #: ../tools/virt-edit.pl:283
26440 "The second method is to use the C<-e> parameter of C<virt-edit> to run a "
26441 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
26442 "instances of C<foo> with C<bar> in a file:"
26446 #: ../tools/virt-edit.pl:287
26449 " virt-edit domname filename -e 's/foo/bar/'\n"
26454 #: ../tools/virt-edit.pl:289
26456 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
26457 "For example to delete root's password you could do:"
26461 #: ../tools/virt-edit.pl:292
26464 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
26469 #: ../tools/virt-edit.pl:294
26471 "What really happens is that the snippet is evaluated as a Perl expression "
26472 "for each line of the file. The line, including the final C<\\n>, is passed "
26473 "in C<$_> and the expression should update C<$_> or leave it unchanged."
26477 #: ../tools/virt-edit.pl:299
26479 "To delete a line, set C<$_> to the empty string. For example, to delete the "
26480 "C<apache> user account from the password file you can do:"
26484 #: ../tools/virt-edit.pl:302
26487 " virt-edit mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
26492 #: ../tools/virt-edit.pl:304
26494 "To insert a line, prepend or append it to C<$_>. However appending lines to "
26495 "the end of the file is rather difficult this way since there is no concept "
26496 "of \"last line of the file\" - your expression just doesn't get called "
26497 "again. You might want to use the first method (setting C<$EDITOR>) if you "
26502 #: ../tools/virt-edit.pl:310
26504 "The variable C<$lineno> contains the current line number. As is "
26505 "traditional, the first line in the file is number C<1>."
26509 #: ../tools/virt-edit.pl:313
26511 "The return value from the expression is ignored, but the expression may call "
26512 "C<die> in order to abort the whole program, leaving the original file "
26517 #: ../tools/virt-edit.pl:317
26519 "Remember when matching the end of a line that C<$_> may contain the final C<"
26520 "\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
26521 "newline then neither of these. Thus to match or substitute some text at the "
26522 "end of a line, use this regular expression:"
26526 #: ../tools/virt-edit.pl:322
26529 " /some text(\\r?\\n)?$/\n"
26534 #: ../tools/virt-edit.pl:324
26536 "Alternately, use the perl C<chomp> function, being careful not to chomp C<"
26537 "$_> itself (since that would remove all newlines from the file):"
26541 #: ../tools/virt-edit.pl:328
26544 " my $m = $_; chomp $m; $m =~ /some text$/\n"
26549 #: ../tools/virt-edit.pl:334
26554 #: ../tools/virt-edit.pl:336
26556 "If set, this string is used as the editor. It may contain arguments, eg. C<"
26561 #: ../tools/virt-edit.pl:339
26562 msgid "If not set, C<vi> is used."
26566 #: ../tools/virt-edit.pl:343 ../tools/virt-win-reg.pl:141
26567 #: ../tools/virt-win-reg.pl:477 ../tools/virt-resize.pl:1476
26568 #: ../tools/virt-list-filesystems.pl:182 ../tools/virt-tar.pl:274
26569 #: ../tools/virt-make-fs.pl:527 ../tools/virt-list-partitions.pl:250
26570 msgid "SHELL QUOTING"
26574 #: ../tools/virt-edit.pl:345 ../tools/virt-win-reg.pl:479
26575 #: ../tools/virt-resize.pl:1478 ../tools/virt-list-filesystems.pl:184
26576 #: ../tools/virt-tar.pl:276 ../tools/virt-make-fs.pl:529
26577 #: ../tools/virt-list-partitions.pl:252
26579 "Libvirt guest names can contain arbitrary characters, some of which have "
26580 "meaning to the shell such as C<#> and space. You may need to quote or "
26581 "escape these characters on the command line. See the shell manual page L<sh"
26582 "(1)> for details."
26586 #: ../tools/virt-edit.pl:352
26588 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::"
26589 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, "
26594 #: ../tools/virt-edit.pl:362 ../tools/virt-win-reg.pl:510
26595 #: ../tools/virt-resize.pl:1504 ../tools/virt-list-filesystems.pl:202
26596 #: ../tools/virt-tar.pl:292 ../tools/virt-make-fs.pl:559
26597 #: ../tools/virt-list-partitions.pl:269
26602 #: ../tools/virt-edit.pl:364 ../tools/virt-win-reg.pl:512
26603 #: ../tools/virt-resize.pl:1506 ../tools/virt-list-filesystems.pl:204
26604 #: ../tools/virt-tar.pl:294 ../tools/virt-make-fs.pl:561
26605 #: ../tools/virt-list-partitions.pl:271
26606 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
26610 #: ../tools/virt-edit.pl:368 ../tools/virt-list-partitions.pl:275
26611 msgid "Copyright (C) 2009-2010 Red Hat Inc."
26615 #: ../tools/virt-win-reg.pl:37
26617 "virt-win-reg - Export and merge Windows Registry entries from a Windows guest"
26621 #: ../tools/virt-win-reg.pl:41
26624 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
26629 #: ../tools/virt-win-reg.pl:43
26632 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
26637 #: ../tools/virt-win-reg.pl:45
26640 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
26645 #: ../tools/virt-win-reg.pl:47
26648 " virt-win-reg --merge domname [input.reg ...]\n"
26653 #: ../tools/virt-win-reg.pl:49
26656 " virt-win-reg [--options] disk.img ... # instead of domname\n"
26661 #: ../tools/virt-win-reg.pl:53
26663 "You must I<not> use C<virt-win-reg> with the C<--merge> option on live "
26664 "virtual machines. If you do this, you I<will> get irreversible disk "
26665 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
26666 "but doesn't catch all cases."
26670 #: ../tools/virt-win-reg.pl:58
26672 "Modifying the Windows Registry is an inherently risky operation. The format "
26673 "is deliberately obscure and undocumented, and Registry changes can leave the "
26674 "system unbootable. Therefore when using the C<--merge> option, make sure "
26675 "you have a reliable backup first."
26679 #: ../tools/virt-win-reg.pl:65
26681 "This program can export and merge Windows Registry entries from a Windows "
26686 #: ../tools/virt-win-reg.pl:68
26688 "The first parameter is the libvirt guest name or the raw disk image of a "
26693 #: ../tools/virt-win-reg.pl:71
26695 "If C<--merge> is I<not> specified, then the chosen registry key is displayed/"
26696 "exported (recursively). For example:"
26700 #: ../tools/virt-win-reg.pl:74
26703 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
26708 #: ../tools/virt-win-reg.pl:76
26710 "You can also display single values from within registry keys, for example:"
26714 #: ../tools/virt-win-reg.pl:79
26717 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
26718 " $ virt-win-reg Windows7 $cvkey ProductName\n"
26719 " Windows 7 Enterprise\n"
26724 #: ../tools/virt-win-reg.pl:83
26726 "With C<--merge>, you can merge a textual regedit file into the Windows "
26731 #: ../tools/virt-win-reg.pl:86
26734 " $ virt-win-reg --merge Windows7 changes.reg\n"
26739 #: ../tools/virt-win-reg.pl:88
26740 msgid "SUPPORTED SYSTEMS"
26744 #: ../tools/virt-win-reg.pl:90
26746 "The program currently supports Windows NT-derived guests starting with "
26747 "Windows XP through to at least Windows 7."
26751 #: ../tools/virt-win-reg.pl:93
26753 "Registry support is done for C<HKEY_LOCAL_MACHINE\\SAM>, C<HKEY_LOCAL_MACHINE"
26754 "\\SECURITY>, C<HKEY_LOCAL_MACHINE\\SOFTWARE>, C<HKEY_LOCAL_MACHINE\\SYSTEM> "
26755 "and C<HKEY_USERS\\.DEFAULT>."
26759 #: ../tools/virt-win-reg.pl:97
26761 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
26766 #: ../tools/virt-win-reg.pl:100
26768 "C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are B<not> supported at this "
26773 #: ../tools/virt-win-reg.pl:103
26778 #: ../tools/virt-win-reg.pl:105
26780 "This program is only meant for simple access to the registry. If you want "
26781 "to do complicated things with the registry, we suggest you download the "
26782 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
26783 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
26784 "L<hivexregedit(1)>."
26788 #: ../tools/virt-win-reg.pl:111
26793 #: ../tools/virt-win-reg.pl:113
26795 "C<virt-win-reg> expects that regedit files have already been reencoded in "
26796 "the local encoding. Usually on Linux hosts, this means UTF-8 with Unix-"
26797 "style line endings. Since Windows regedit files are often in UTF-16LE with "
26798 "Windows-style line endings, you may need to reencode the whole file before "
26799 "or after processing."
26803 #: ../tools/virt-win-reg.pl:119
26805 "To reencode a file from Windows format to Linux (before processing it with "
26806 "the C<--merge> option), you would do something like this:"
26810 #: ../tools/virt-win-reg.pl:122
26813 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
26818 #: ../tools/virt-win-reg.pl:124
26820 "To go in the opposite direction, after exporting and before sending the file "
26821 "to a Windows user, do something like this:"
26825 #: ../tools/virt-win-reg.pl:127
26828 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
26833 #: ../tools/virt-win-reg.pl:129
26834 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
26838 #: ../tools/virt-win-reg.pl:131
26840 "If you are unsure about the current encoding, use the L<file(1)> command. "
26841 "Recent versions of Windows regedit.exe produce a UTF-16LE file with Windows-"
26842 "style (CRLF) line endings, like this:"
26846 #: ../tools/virt-win-reg.pl:135
26849 " $ file software.reg\n"
26850 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
26851 " with CRLF line terminators\n"
26856 #: ../tools/virt-win-reg.pl:139
26857 msgid "This file would need conversion before you could C<--merge> it."
26861 #: ../tools/virt-win-reg.pl:143
26863 "Be careful when passing parameters containing C<\\> (backslash) in the "
26864 "shell. Usually you will have to use 'single quotes' or double backslashes "
26865 "(but not both) to protect them from the shell."
26869 #: ../tools/virt-win-reg.pl:147
26870 msgid "Paths and value names are case-insensitive."
26874 #: ../tools/virt-win-reg.pl:149
26875 msgid "CurrentControlSet etc."
26879 #: ../tools/virt-win-reg.pl:151
26881 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
26882 "Registry at the level of the hive file, and therefore you cannot modify "
26887 #: ../tools/virt-win-reg.pl:155
26889 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
26890 "circumstances it might refer to another control set. The way to find out is "
26891 "to look at the C<HKLM\\SYSTEM\\Select> key:"
26895 #: ../tools/virt-win-reg.pl:159
26898 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
26899 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
26900 " \"Current\"=dword:00000001\n"
26901 " \"Default\"=dword:00000001\n"
26902 " \"Failed\"=dword:00000000\n"
26903 " \"LastKnownGood\"=dword:00000002\n"
26908 #: ../tools/virt-win-reg.pl:166
26909 msgid "\"Current\" is the one which Windows will choose when it boots."
26913 #: ../tools/virt-win-reg.pl:168
26915 "Similarly, other C<Current...> keys in the path may need to be replaced."
26919 #: ../tools/virt-win-reg.pl:195 ../tools/virt-make-fs.pl:177
26924 #: ../tools/virt-win-reg.pl:197 ../tools/virt-resize.pl:498
26925 msgid "Enable debugging messages."
26929 #: ../tools/virt-win-reg.pl:232
26934 #: ../tools/virt-win-reg.pl:234
26936 "In merge mode, this merges a textual regedit file into the Windows Registry "
26937 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
26938 "displays or exports Registry entries instead."
26942 #: ../tools/virt-win-reg.pl:238
26944 "Note that C<--merge> is I<unsafe> to use on live virtual machines, and will "
26945 "result in disk corruption. However exporting (without this flag) is always "
26950 #: ../tools/virt-win-reg.pl:246
26951 msgid "B<--encoding> UTF-16LE|ASCII"
26955 #: ../tools/virt-win-reg.pl:248
26957 "When merging (only), you may need to specify the encoding for strings to be "
26958 "used in the hive file. This is explained in detail in L<Win::Hivex::Regedit"
26959 "(3)/ENCODING STRINGS>."
26963 #: ../tools/virt-win-reg.pl:252
26965 "The default is to use UTF-16LE, which should work with recent versions of "
26970 #: ../tools/virt-win-reg.pl:486
26972 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, L<guestfish(1)"
26973 ">, L<virt-cat(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Win::Hivex"
26974 "(3)>, L<Win::Hivex::Regedit(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
26978 #: ../tools/virt-win-reg.pl:501 ../tools/virt-make-fs.pl:550
26980 "When reporting bugs, please enable debugging and capture the I<complete> "
26985 #: ../tools/virt-win-reg.pl:504
26988 " export LIBGUESTFS_DEBUG=1\n"
26989 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
26994 #: ../tools/virt-win-reg.pl:507
26996 "Attach /tmp/virt-win-reg.log to a new bug report at L<https://bugzilla."
27001 #: ../tools/virt-win-reg.pl:516 ../tools/virt-resize.pl:1510
27002 #: ../tools/virt-make-fs.pl:565
27003 msgid "Copyright (C) 2010 Red Hat Inc."
27007 #: ../tools/virt-resize.pl:42
27008 msgid "virt-resize - Resize a virtual machine disk"
27012 #: ../tools/virt-resize.pl:46
27015 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
27016 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
27017 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
27022 #: ../tools/virt-resize.pl:52
27024 "Virt-resize is a tool which can resize a virtual machine disk, making it "
27025 "larger or smaller overall, and resizing or deleting any partitions contained "
27030 #: ../tools/virt-resize.pl:56
27032 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
27033 "not> be used on live virtual machines - for consistent results, shut the "
27034 "virtual machine down before resizing it."
27038 #: ../tools/virt-resize.pl:60
27040 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
27041 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
27045 #: ../tools/virt-resize.pl:66
27047 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
27048 "fill the extra 5GB of space."
27052 #: ../tools/virt-resize.pl:69
27055 " truncate -r olddisk newdisk; truncate -s +5G newdisk\n"
27056 " virt-filesystems --long --h --all -a olddisk\n"
27057 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
27058 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
27063 #: ../tools/virt-resize.pl:74
27065 "As above, but make the /boot partition 200MB bigger, while giving the "
27066 "remaining space to /dev/sda2:"
27070 #: ../tools/virt-resize.pl:77
27073 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 olddisk newdisk\n"
27078 #: ../tools/virt-resize.pl:79
27079 msgid "As above, but the output format will be uncompressed qcow2:"
27083 #: ../tools/virt-resize.pl:81
27086 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
27087 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
27092 #: ../tools/virt-resize.pl:84
27093 msgid "DETAILED USAGE"
27097 #: ../tools/virt-resize.pl:86
27098 msgid "EXPANDING A VIRTUAL MACHINE DISK"
27102 #: ../tools/virt-resize.pl:90
27103 msgid "1. Shut down the virtual machine"
27107 #: ../tools/virt-resize.pl:92
27108 msgid "2. Locate input disk image"
27112 #: ../tools/virt-resize.pl:94
27114 "Locate the input disk image (ie. the file or device on the host containing "
27115 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
27116 "dumpxml> like this to find the disk image name:"
27120 #: ../tools/virt-resize.pl:98
27123 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
27124 " Found 1 nodes:\n"
27126 " <source dev=\"/dev/vg/lv_guest\" />\n"
27131 #: ../tools/virt-resize.pl:103
27132 msgid "3. Look at current sizing"
27136 #: ../tools/virt-resize.pl:105
27137 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
27141 #: ../tools/virt-resize.pl:108
27144 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
27145 " Name Type Size Parent\n"
27146 " /dev/sda1 partition 101M /dev/sda\n"
27147 " /dev/sda2 partition 7.9G /dev/sda\n"
27148 " /dev/sda device 8.0G -\n"
27153 #: ../tools/virt-resize.pl:114
27155 "(This example is a virtual machine with an 8 GB disk which we would like to "
27156 "expand up to 10 GB)."
27160 #: ../tools/virt-resize.pl:117
27161 msgid "4. Create output disk"
27165 #: ../tools/virt-resize.pl:119
27167 "Virt-resize cannot do in-place disk modifications. You have to have space "
27168 "to store the resized output disk."
27172 #: ../tools/virt-resize.pl:122
27174 "To store the resized disk image in a file, create a file of a suitable size:"
27178 #: ../tools/virt-resize.pl:125
27181 " # rm -f outdisk\n"
27182 " # truncate -s 10G outdisk\n"
27187 #: ../tools/virt-resize.pl:128
27188 msgid "Or use L<lvcreate(1)> to create a logical volume:"
27192 #: ../tools/virt-resize.pl:130
27195 " # lvcreate -L 10G -n lv_name vg_name\n"
27200 #: ../tools/virt-resize.pl:132
27201 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
27205 #: ../tools/virt-resize.pl:134
27208 " # virsh pool-list\n"
27209 " # virsh vol-create-as poolname newvol 10G\n"
27214 #: ../tools/virt-resize.pl:137
27219 #: ../tools/virt-resize.pl:139
27221 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
27222 "file) and the output disk. The output disk is the one created in the "
27227 #: ../tools/virt-resize.pl:143
27230 " # virt-resize indisk outdisk\n"
27235 #: ../tools/virt-resize.pl:145
27237 "This command just copies disk image C<indisk> to disk image C<outdisk> "
27238 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
27239 "larger, then an extra, empty partition is created at the end of the disk "
27240 "covering the extra space. If C<outdisk> is smaller, then it will give an "
27245 #: ../tools/virt-resize.pl:151
27247 "More realistically you'd want to expand existing partitions in the disk "
27248 "image by passing extra options (for the full list see the L</OPTIONS> "
27253 #: ../tools/virt-resize.pl:155
27255 "L</--expand> is the most useful option. It expands the named partition "
27256 "within the disk to fill any extra space:"
27260 #: ../tools/virt-resize.pl:158
27263 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
27268 #: ../tools/virt-resize.pl:160
27270 "(In this case, an extra partition is I<not> created at the end of the disk, "
27271 "because there will be no unused space)."
27275 #: ../tools/virt-resize.pl:163
27277 "L</--resize> is the other commonly used option. The following would "
27278 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
27279 "rest of the available space:"
27283 #: ../tools/virt-resize.pl:167
27286 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
27287 " indisk outdisk\n"
27292 #: ../tools/virt-resize.pl:170
27294 "If the expanded partition in the image contains a filesystem or LVM PV, then "
27295 "if virt-resize knows how, it will resize the contents, the equivalent of "
27296 "calling a command such as L<pvresize(8)>, L<resize2fs(8)> or L<ntfsresize(8)"
27297 ">. However virt-resize does not know how to resize some filesystems, so you "
27298 "would have to online resize them after booting the guest."
27302 #: ../tools/virt-resize.pl:177
27303 msgid "Other options are covered below."
27307 #: ../tools/virt-resize.pl:179
27312 #: ../tools/virt-resize.pl:181
27313 msgid "Thoroughly test the new disk image I<before> discarding the old one."
27317 #: ../tools/virt-resize.pl:183
27318 msgid "If you are using libvirt, edit the XML to point at the new disk:"
27322 #: ../tools/virt-resize.pl:185
27325 " # virsh edit guestname\n"
27330 #: ../tools/virt-resize.pl:187
27332 "Change E<lt>source ...E<gt>, see L<http://libvirt.org/formatdomain."
27333 "html#elementsDisks>"
27337 #: ../tools/virt-resize.pl:190
27338 msgid "Then start up the domain with the new, resized disk:"
27342 #: ../tools/virt-resize.pl:192
27345 " # virsh start guestname\n"
27350 #: ../tools/virt-resize.pl:194
27352 "and check that it still works. See also the L</NOTES> section below for "
27353 "additional information."
27357 #: ../tools/virt-resize.pl:197
27358 msgid "7. Resize LVs etc inside the guest"
27362 #: ../tools/virt-resize.pl:199
27363 msgid "(This can also be done offline using L<guestfish(1)>)"
27367 #: ../tools/virt-resize.pl:201
27369 "Once the guest has booted you should see the new space available, at least "
27370 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
27371 "may need to resize LVs inside PVs, and also resize filesystem types that "
27372 "virt-resize does not know how to expand."
27376 #: ../tools/virt-resize.pl:208
27377 msgid "SHRINKING A VIRTUAL MACHINE DISK"
27381 #: ../tools/virt-resize.pl:210
27383 "Shrinking is somewhat more complex than expanding, and only an overview is "
27388 #: ../tools/virt-resize.pl:213
27390 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
27391 "filesystems). The user has to shrink content before passing the disk image "
27392 "to virt-resize, and virt-resize will check that the content has been shrunk "
27397 #: ../tools/virt-resize.pl:218
27398 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
27402 #: ../tools/virt-resize.pl:220
27404 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
27405 "steps 3 and 4 above to allocate a new disk image."
27409 #: ../tools/virt-resize.pl:223
27411 "Then run virt-resize with any of the C<--shrink> and/or C<--resize> options."
27415 #: ../tools/virt-resize.pl:226
27416 msgid "IGNORING OR DELETING PARTITIONS"
27420 #: ../tools/virt-resize.pl:228
27422 "virt-resize also gives a convenient way to ignore or delete partitions when "
27423 "copying from the input disk to the output disk. Ignoring a partition speeds "
27424 "up the copy where you don't care about the existing contents of a "
27425 "partition. Deleting a partition removes it completely, but note that it "
27426 "also renumbers any partitions after the one which is deleted, which can "
27427 "leave some guests unbootable."
27431 #: ../tools/virt-resize.pl:235
27432 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
27436 #: ../tools/virt-resize.pl:237
27438 "If the input disk is in qcow2 format, then you may prefer that the output is "
27439 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
27440 "the fly. The output format is simply determined by the format of the empty "
27441 "output container that you provide. Thus to create qcow2 output, use:"
27445 #: ../tools/virt-resize.pl:243
27448 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
27453 #: ../tools/virt-resize.pl:245
27454 msgid "instead of the truncate command (use C<-c> for a compressed disk)."
27458 #: ../tools/virt-resize.pl:247
27459 msgid "Similarly, to get non-sparse raw output use:"
27463 #: ../tools/virt-resize.pl:249
27466 " fallocate -l size outdisk\n"
27471 #: ../tools/virt-resize.pl:251
27473 "(on older systems that don't have the L<fallocate(1)> command use C<dd if=/"
27474 "dev/zero of=outdisk bs=1M count=..>)"
27478 #: ../tools/virt-resize.pl:264
27479 msgid "Display help."
27483 #: ../tools/virt-resize.pl:278
27484 msgid "B<--resize part=size>"
27488 #: ../tools/virt-resize.pl:280
27490 "Resize the named partition (expanding or shrinking it) so that it has the "
27495 #: ../tools/virt-resize.pl:283
27497 "C<size> can be expressed as an absolute number followed by b/K/M/G/T/P/E to "
27498 "mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, Petabytes or "
27499 "Exabytes; or as a percentage of the current size; or as a relative number or "
27500 "percentage. For example:"
27504 #: ../tools/virt-resize.pl:288
27507 " --resize /dev/sda2=10G\n"
27512 #: ../tools/virt-resize.pl:290
27515 " --resize /dev/sda4=90%\n"
27520 #: ../tools/virt-resize.pl:292
27523 " --resize /dev/sda2=+1G\n"
27528 #: ../tools/virt-resize.pl:294
27531 " --resize /dev/sda2=-200M\n"
27536 #: ../tools/virt-resize.pl:296
27539 " --resize /dev/sda1=+128K\n"
27544 #: ../tools/virt-resize.pl:298
27547 " --resize /dev/sda1=+10%\n"
27552 #: ../tools/virt-resize.pl:300
27555 " --resize /dev/sda1=-10%\n"
27560 #: ../tools/virt-resize.pl:302
27562 "You can increase the size of any partition. Virt-resize will expand the "
27563 "direct content of the partition if it knows how (see C<--expand> below)."
27567 #: ../tools/virt-resize.pl:306
27569 "You can only I<decrease> the size of partitions that contain filesystems or "
27570 "PVs which have already been shrunk. Virt-resize will check this has been "
27571 "done before proceeding, or else will print an error (see also C<--resize-"
27576 #: ../tools/virt-resize.pl:311 ../tools/virt-resize.pl:403
27577 #: ../tools/virt-resize.pl:420
27578 msgid "You can give this option multiple times."
27582 #: ../tools/virt-resize.pl:317
27583 msgid "B<--resize-force part=size>"
27587 #: ../tools/virt-resize.pl:319
27589 "This is the same as C<--resize> except that it will let you decrease the "
27590 "size of any partition. Generally this means you will lose any data which "
27591 "was at the end of the partition you shrink, but you may not care about that "
27592 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
27593 "as a swap partition)."
27597 #: ../tools/virt-resize.pl:325
27598 msgid "See also the C<--ignore> option."
27602 #: ../tools/virt-resize.pl:331
27603 msgid "B<--expand part>"
27607 #: ../tools/virt-resize.pl:333
27609 "Expand the named partition so it uses up all extra space (space left over "
27610 "after any other resize changes that you request have been done)."
27614 #: ../tools/virt-resize.pl:336
27616 "If virt-resize knows how, it will expand the direct content of the "
27617 "partition. For example, if the partition is an LVM PV, it will expand the "
27618 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
27619 "content it doesn't know about alone."
27623 #: ../tools/virt-resize.pl:341
27624 msgid "Currently virt-resize can resize:"
27628 #: ../tools/virt-resize.pl:347
27630 "ext2, ext3 and ext4 filesystems when they are contained directly inside a "
27635 #: ../tools/virt-resize.pl:352
27637 "NTFS filesystems contained directly in a partition, if libguestfs was "
27638 "compiled with support for NTFS."
27642 #: ../tools/virt-resize.pl:355
27644 "The filesystem must have been shut down consistently last time it was used. "
27645 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
27646 "consistency check, so at the first boot after resizing Windows will check "
27651 #: ../tools/virt-resize.pl:362
27653 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
27654 "inside the PV, but see the C<--LV-expand> option. The user could also "
27655 "resize LVs as desired after boot."
27659 #: ../tools/virt-resize.pl:368 ../tools/virt-resize.pl:390
27660 msgid "Note that you cannot use C<--expand> and C<--shrink> together."
27664 #: ../tools/virt-resize.pl:374
27665 msgid "B<--shrink part>"
27669 #: ../tools/virt-resize.pl:376
27671 "Shrink the named partition until the overall disk image fits in the "
27672 "destination. The named partition B<must> contain a filesystem or PV which "
27673 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
27674 "online tools). Virt-resize will check this and give an error if it has not "
27679 #: ../tools/virt-resize.pl:382
27681 "The amount by which the overall disk must be shrunk (after carrying out all "
27682 "other operations requested by the user) is called the \"deficit\". For "
27683 "example, a straight copy (assume no other operations) from a 5GB disk image "
27684 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
27685 "would give an error unless the user specified a partition to shrink and that "
27686 "partition had more than a gigabyte of free space."
27690 #: ../tools/virt-resize.pl:396
27691 msgid "B<--ignore part>"
27695 #: ../tools/virt-resize.pl:398
27697 "Ignore the named partition. Effectively this means the partition is "
27698 "allocated on the destination disk, but the content is not copied across from "
27699 "the source disk. The content of the partition will be blank (all zero "
27704 #: ../tools/virt-resize.pl:409
27705 msgid "B<--delete part>"
27709 #: ../tools/virt-resize.pl:411
27711 "Delete the named partition. It would be more accurate to describe this as "
27712 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
27713 "the original disk image is left intact."
27717 #: ../tools/virt-resize.pl:415
27719 "Note that when you delete a partition, then anything contained in the "
27720 "partition is also deleted. Furthermore, this causes any partitions that "
27721 "come after to be I<renumbered>, which can easily make your guest unbootable."
27725 #: ../tools/virt-resize.pl:426
27726 msgid "B<--LV-expand logvol>"
27730 #: ../tools/virt-resize.pl:428
27732 "This takes the logical volume and, as a final step, expands it to fill all "
27733 "the space available in its volume group. A typical usage, assuming a Linux "
27734 "guest with a single PV C</dev/sda2> and a root device called C</dev/vg_guest/"
27735 "lv_root> would be:"
27739 #: ../tools/virt-resize.pl:433
27742 " virt-resize indisk outdisk \\\n"
27743 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
27748 #: ../tools/virt-resize.pl:436
27750 "This would first expand the partition (and PV), and then expand the root "
27751 "device to fill the extra space in the PV."
27755 #: ../tools/virt-resize.pl:439
27757 "The contents of the LV are also resized if virt-resize knows how to do "
27758 "that. You can stop virt-resize from trying to expand the content by using "
27759 "the option C<--no-expand-content>."
27763 #: ../tools/virt-resize.pl:443
27764 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
27768 #: ../tools/virt-resize.pl:446
27770 "You can give this option multiple times, I<but> it doesn't make sense to do "
27771 "this unless the logical volumes you specify are all in different volume "
27776 #: ../tools/virt-resize.pl:454
27777 msgid "B<--no-copy-boot-loader>"
27781 #: ../tools/virt-resize.pl:456
27783 "By default, virt-resize copies over some sectors at the start of the disk "
27784 "(up to the beginning of the first partition). Commonly these sectors "
27785 "contain the Master Boot Record (MBR) and the boot loader, and are required "
27786 "in order for the guest to boot correctly."
27790 #: ../tools/virt-resize.pl:461
27792 "If you specify this flag, then this initial copy is not done. You may need "
27793 "to reinstall the boot loader in this case."
27797 #: ../tools/virt-resize.pl:469
27798 msgid "B<--no-extra-partition>"
27802 #: ../tools/virt-resize.pl:471
27804 "By default, virt-resize creates an extra partition if there is any extra, "
27805 "unused space after all resizing has happened. Use this option to prevent "
27806 "the extra partition from being created. If you do this then the extra space "
27807 "will be inaccessible until you run fdisk, parted, or some other partitioning "
27808 "tool in the guest."
27812 #: ../tools/virt-resize.pl:477
27814 "Note that if the surplus space is smaller than 10 MB, no extra partition "
27819 #: ../tools/virt-resize.pl:484
27820 msgid "B<--no-expand-content>"
27824 #: ../tools/virt-resize.pl:486
27826 "By default, virt-resize will try to expand the direct contents of "
27827 "partitions, if it knows how (see C<--expand> option above)."
27831 #: ../tools/virt-resize.pl:489
27833 "If you give the C<--no-expand-content> option then virt-resize will not "
27838 #: ../tools/virt-resize.pl:496
27839 msgid "B<-d> | B<--debug>"
27843 #: ../tools/virt-resize.pl:504
27844 msgid "B<-n> | B<--dryrun>"
27848 #: ../tools/virt-resize.pl:506
27849 msgid "Print a summary of what would be done, but don't do anything."
27853 #: ../tools/virt-resize.pl:512
27854 msgid "B<-q> | B<--quiet>"
27858 #: ../tools/virt-resize.pl:514
27859 msgid "Don't print the summary."
27863 #: ../tools/virt-resize.pl:522
27865 "Specify the format of the input disk image. If this flag is not given then "
27866 "it is auto-detected from the image itself."
27870 #: ../tools/virt-resize.pl:528
27872 "Note that this option I<does not> affect the output format. See L</QCOW2 "
27873 "AND NON-SPARSE RAW FORMATS>."
27877 #: ../tools/virt-resize.pl:535
27878 msgid "B<--output-format> raw"
27882 #: ../tools/virt-resize.pl:537
27884 "Specify the format of the output disk image. If this flag is not given then "
27885 "it is auto-detected from the image itself."
27889 #: ../tools/virt-resize.pl:543
27891 "Note that you still need to create the output disk with the right format. "
27892 "See L</QCOW2 AND NON-SPARSE RAW FORMATS>."
27896 #: ../tools/virt-resize.pl:1419
27901 #: ../tools/virt-resize.pl:1421
27902 msgid "\"Partition 1 does not end on cylinder boundary.\""
27906 #: ../tools/virt-resize.pl:1423
27908 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
27909 "means the partitions will not be aligned to the ancient CHS geometry. "
27910 "However CHS geometry is meaningless for disks manufactured since the early "
27911 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
27912 "cylinders is not required by any modern operating system."
27916 #: ../tools/virt-resize.pl:1430
27917 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
27921 #: ../tools/virt-resize.pl:1432
27923 "In Windows Vista and later versions, Microsoft switched to using a separate "
27924 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
27925 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
27926 "the boot partition. Doing so seems to break the guest completely. However "
27927 "expanding the second partition (ie. C: drive) should work."
27931 #: ../tools/virt-resize.pl:1439
27933 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
27934 "NTFS partitions have been expanded. This is just a safety check and (unless "
27935 "it find errors) is nothing to worry about."
27939 #: ../tools/virt-resize.pl:1443
27940 msgid "GUEST BOOT STUCK AT \"GRUB\""
27944 #: ../tools/virt-resize.pl:1445
27946 "If a Linux guest does not boot after resizing, and the boot is stuck after "
27947 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
27948 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
27949 "although we think is to do with partition alignment."
27953 #: ../tools/virt-resize.pl:1450
27956 " guestfish -i -a newdisk\n"
27957 " ><fs> cat /boot/grub/device.map\n"
27958 " # check the contents of this file are sensible or\n"
27959 " # edit the file if necessary\n"
27960 " ><fs> grub-install / /dev/vda\n"
27966 #: ../tools/virt-resize.pl:1457
27968 "For more flexible guest reconfiguration, including if you need to specify "
27969 "other parameters to grub-install, use L<virt-rescue(1)>."
27973 #: ../tools/virt-resize.pl:1460
27974 msgid "ALTERNATIVE TOOLS"
27978 #: ../tools/virt-resize.pl:1462
27980 "There are several proprietary tools for resizing partitions. We won't "
27981 "mention any here."
27985 #: ../tools/virt-resize.pl:1465
27987 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
27988 "operations on disk images. They can resize and move partitions, but I don't "
27989 "think they can do anything with the contents, and they certainly don't "
27994 #: ../tools/virt-resize.pl:1470
27996 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
27997 "but at a much lower level. You will probably end up hand-calculating sector "
27998 "offsets, which is something that virt-resize was designed to avoid. If you "
27999 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
28004 #: ../tools/virt-resize.pl:1485
28006 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<lvm"
28007 "(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)>, "
28008 "L<virsh(1)>, L<parted(8)>, L<truncate(1)>, L<fallocate(1)>, L<grub(8)>, "
28009 "L<grub-install(8)>, L<virt-rescue(1)>, L<Sys::Guestfs(3)>, L<http://"
28010 "libguestfs.org/>."
28014 #: ../tools/virt-list-filesystems.pl:32
28016 "virt-list-filesystems - List filesystems in a virtual machine or disk image"
28020 #: ../tools/virt-list-filesystems.pl:36
28023 " virt-list-filesystems [--options] domname\n"
28028 #: ../tools/virt-list-filesystems.pl:38
28031 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
28036 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
28038 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
28043 #: ../tools/virt-list-filesystems.pl:45
28045 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
28046 "are contained in a virtual machine or disk image."
28050 #: ../tools/virt-list-filesystems.pl:49
28052 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
28053 "functionality. For more complex cases you should look at the L<guestfish(1)"
28058 #: ../tools/virt-list-filesystems.pl:106 ../tools/virt-list-partitions.pl:115
28059 msgid "B<-l> | B<--long>"
28063 #: ../tools/virt-list-filesystems.pl:108
28065 "With this option, C<virt-list-filesystems> displays the type of each "
28066 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
28070 #: ../tools/virt-list-filesystems.pl:115
28071 msgid "B<-a> | B<--all>"
28075 #: ../tools/virt-list-filesystems.pl:117
28077 "Normally we only show mountable filesystems. If this option is given then "
28078 "swap devices are shown too."
28082 #: ../tools/virt-list-filesystems.pl:191
28084 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, L<virt-"
28085 "filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, L<Sys::"
28086 "Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
28090 #: ../tools/virt-list-filesystems.pl:208 ../tools/virt-tar.pl:298
28091 msgid "Copyright (C) 2009 Red Hat Inc."
28095 #: ../tools/virt-tar.pl:33
28096 msgid "virt-tar - Extract or upload files to a virtual machine"
28100 #: ../tools/virt-tar.pl:37
28103 " virt-tar [--options] -x domname directory tarball\n"
28108 #: ../tools/virt-tar.pl:39
28111 " virt-tar [--options] -u domname tarball directory\n"
28116 #: ../tools/virt-tar.pl:41
28119 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
28124 #: ../tools/virt-tar.pl:43
28127 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
28132 #: ../tools/virt-tar.pl:47
28133 msgid "Download C</home> from the VM into a local tarball:"
28137 #: ../tools/virt-tar.pl:49
28140 " virt-tar -x domname /home home.tar\n"
28145 #: ../tools/virt-tar.pl:51
28148 " virt-tar -zx domname /home home.tar.gz\n"
28153 #: ../tools/virt-tar.pl:53
28154 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
28158 #: ../tools/virt-tar.pl:55
28161 " virt-tar -u domname uploadstuff.tar /tmp\n"
28166 #: ../tools/virt-tar.pl:57
28169 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
28174 #: ../tools/virt-tar.pl:61
28176 "You must I<not> use C<virt-tar> with the C<-u> option (upload) on live "
28177 "virtual machines. If you do this, you risk disk corruption in the VM. "
28178 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
28182 #: ../tools/virt-tar.pl:66
28184 "You can use C<-x> (extract) on live virtual machines, but you might get "
28185 "inconsistent results or errors if there is filesystem activity inside the "
28186 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
28187 "work, but the only way to guarantee consistent results is if the virtual "
28188 "machine is shut down."
28192 #: ../tools/virt-tar.pl:74
28194 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
28195 "parts of a guest filesystem. There are many possibilities: making backups, "
28196 "uploading data files, snooping on guest activity, fixing or customizing "
28201 #: ../tools/virt-tar.pl:79
28203 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
28204 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
28205 "should look at the L<guestfish(1)> tool."
28209 #: ../tools/virt-tar.pl:83
28211 "There are two modes of operation: C<-x> (eXtract) downloads a directory and "
28212 "its contents (recursively) from the virtual machine into a local tarball. "
28213 "C<-u> uploads from a local tarball, unpacking it into a directory inside the "
28214 "virtual machine. You cannot use these two options together."
28218 #: ../tools/virt-tar.pl:89
28220 "In addition, you may need to use the C<-z> (gZip) option to enable "
28221 "compression. When uploading, you have to specify C<-z> if the upload file "
28222 "is compressed because virt-tar won't detect this on its own."
28226 #: ../tools/virt-tar.pl:93
28228 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
28229 "example it cannot do PKZip files or bzip2 compression. If you want that "
28230 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
28231 "the L<libguestfs(3)> API)."
28235 #: ../tools/virt-tar.pl:151
28236 msgid "B<-x> | B<--extract> | B<--download>"
28240 #: ../tools/virt-tar.pl:153
28241 msgid "B<-u> | B<--upload>"
28245 #: ../tools/virt-tar.pl:155
28247 "Use C<-x> to extract (download) a directory from a virtual machine to a "
28252 #: ../tools/virt-tar.pl:158
28254 "Use C<-u> to upload and unpack from a local tarball into a virtual machine. "
28255 "Please read the L</WARNING> section above before using this option."
28259 #: ../tools/virt-tar.pl:162
28260 msgid "You must specify exactly one of these options."
28264 #: ../tools/virt-tar.pl:168
28265 msgid "B<-z> | B<--gzip>"
28269 #: ../tools/virt-tar.pl:170
28270 msgid "Specify that the input or output tarball is gzip-compressed."
28274 #: ../tools/virt-tar.pl:283
28276 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, L<Sys::"
28277 "Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs."
28282 #: ../tools/virt-make-fs.pl:37
28283 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
28287 #: ../tools/virt-make-fs.pl:41
28290 " virt-make-fs [--options] input.tar output.img\n"
28295 #: ../tools/virt-make-fs.pl:43
28298 " virt-make-fs [--options] input.tar.gz output.img\n"
28303 #: ../tools/virt-make-fs.pl:45
28306 " virt-make-fs [--options] directory output.img\n"
28311 #: ../tools/virt-make-fs.pl:49
28313 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
28314 "archive or some files in a directory. It is similar to tools like L<mkisofs"
28315 "(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, it can "
28316 "create common filesystem types like ext2/3 or NTFS, which can be useful if "
28317 "you want to attach these filesystems to existing virtual machines (eg. to "
28318 "import large amounts of read-only data to a VM)."
28322 #: ../tools/virt-make-fs.pl:57
28323 msgid "Basic usage is:"
28327 #: ../tools/virt-make-fs.pl:59
28330 " virt-make-fs input output\n"
28335 #: ../tools/virt-make-fs.pl:61
28337 "where C<input> is either a directory containing files that you want to add, "
28338 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
28339 "C<output> is a disk image. The input type is detected automatically. The "
28340 "output disk image defaults to a raw ext2 image unless you specify extra "
28341 "flags (see L</OPTIONS> below)."
28345 #: ../tools/virt-make-fs.pl:67
28346 msgid "EXTRA SPACE"
28350 #: ../tools/virt-make-fs.pl:69
28352 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
28353 "the files that it contains, but might have extra space. Depending on how "
28354 "you are going to use the output, you might think this extra space is wasted "
28355 "and want to minimize it, or you might want to leave space so that more files "
28356 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
28357 "but you can use the C<--size> flag to leave space in the filesystem if you "
28362 #: ../tools/virt-make-fs.pl:77
28364 "An alternative way to leave extra space but not make the output image any "
28365 "bigger is to use an alternative disk image format (instead of the default "
28366 "\"raw\" format). Using C<--format=qcow2> will use the native QEmu/KVM qcow2 "
28367 "image format (check your hypervisor supports this before using it). This "
28368 "allows you to choose a large C<--size> but the extra space won't actually be "
28369 "allocated in the image until you try to store something in it."
28373 #: ../tools/virt-make-fs.pl:85
28375 "Don't forget that you can also use local commands including L<resize2fs(8)> "
28376 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-"
28377 "resize to build another image from scratch."
28381 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123
28382 #: ../tools/virt-make-fs.pl:142
28387 #: ../tools/virt-make-fs.pl:91
28390 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
28395 #: ../tools/virt-make-fs.pl:93
28396 msgid "FILESYSTEM TYPE"
28400 #: ../tools/virt-make-fs.pl:95
28402 "The default filesystem type is C<ext2>. Just about any filesystem type that "
28403 "libguestfs supports can be used (but I<not> read-only formats like "
28404 "ISO9660). Here are some of the more common choices:"
28408 #: ../tools/virt-make-fs.pl:101
28413 #: ../tools/virt-make-fs.pl:103
28415 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
28416 "you are not going to use the filesystem in a way that requires the journal, "
28417 "then this is just wasted overhead."
28421 #: ../tools/virt-make-fs.pl:107
28422 msgid "I<ntfs> or I<vfat>"
28426 #: ../tools/virt-make-fs.pl:109
28427 msgid "Useful if exporting data to a Windows guest."
28431 #: ../tools/virt-make-fs.pl:111
28433 "I<Note for vfat>: The tar archive or local directory must only contain files "
28434 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
28435 "program running within libguestfs is unable to change the ownership of non-"
28436 "root files, since vfat itself does not support this."
28440 #: ../tools/virt-make-fs.pl:116
28445 #: ../tools/virt-make-fs.pl:118
28447 "Lower overhead than C<ext2>, but certain limitations on filename length and "
28448 "total filesystem size."
28452 #: ../tools/virt-make-fs.pl:125
28455 " virt-make-fs --type=minix input minixfs.img\n"
28460 #: ../tools/virt-make-fs.pl:127
28461 msgid "TO PARTITION OR NOT TO PARTITION"
28465 #: ../tools/virt-make-fs.pl:129
28466 msgid "Optionally virt-make-fs can add a partition table to the output disk."
28470 #: ../tools/virt-make-fs.pl:131
28472 "Adding a partition can make the disk image more compatible with certain "
28473 "virtualized operating systems which don't expect to see a filesystem "
28474 "directly located on a block device (Linux doesn't care and will happily "
28475 "handle both types)."
28479 #: ../tools/virt-make-fs.pl:136
28481 "On the other hand, if you have a partition table then the output image is no "
28482 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
28483 "directly on a partitioned disk image. (However libguestfs tools such as "
28484 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
28488 #: ../tools/virt-make-fs.pl:144
28489 msgid "Add an MBR partition:"
28493 #: ../tools/virt-make-fs.pl:146
28496 " virt-make-fs --partition -- input disk.img\n"
28501 #: ../tools/virt-make-fs.pl:148
28503 "If the output disk image could be terabyte-sized or larger, it's better to "
28504 "use an EFI/GPT-compatible partition table:"
28508 #: ../tools/virt-make-fs.pl:151
28511 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
28516 #: ../tools/virt-make-fs.pl:179
28517 msgid "Enable debugging information."
28521 #: ../tools/virt-make-fs.pl:185
28522 msgid "B<--size=E<lt>NE<gt>>"
28526 #: ../tools/virt-make-fs.pl:187
28527 msgid "B<--size=+E<lt>NE<gt>>"
28531 #: ../tools/virt-make-fs.pl:189
28532 msgid "B<-s E<lt>NE<gt>>"
28536 #: ../tools/virt-make-fs.pl:191
28537 msgid "B<-s +E<lt>NE<gt>>"
28541 #: ../tools/virt-make-fs.pl:193
28543 "Use the C<--size> (or C<-s>) option to choose the size of the output image."
28547 #: ../tools/virt-make-fs.pl:196
28549 "If this option is I<not> given, then the output image will be just large "
28550 "enough to contain all the files, with not much wasted space."
28554 #: ../tools/virt-make-fs.pl:199
28556 "To choose a fixed size output disk, specify an absolute number followed by b/"
28557 "K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28558 "Petabytes or Exabytes. This must be large enough to contain all the input "
28559 "files, else you will get an error."
28563 #: ../tools/virt-make-fs.pl:204
28565 "To leave extra space, specify C<+> (plus sign) and a number followed by b/K/"
28566 "M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
28567 "Petabytes or Exabytes. For example: C<--size=+200M> means enough space for "
28568 "the input files, and (approximately) an extra 200 MB free space."
28572 #: ../tools/virt-make-fs.pl:210
28574 "Note that virt-make-fs estimates free space, and therefore will not produce "
28575 "filesystems containing precisely the free space requested. (It is much more "
28576 "expensive and time-consuming to produce a filesystem which has precisely the "
28577 "desired free space)."
28581 #: ../tools/virt-make-fs.pl:219
28582 msgid "B<--format=E<lt>fmtE<gt>>"
28586 #: ../tools/virt-make-fs.pl:221
28587 msgid "B<-F E<lt>fmtE<gt>>"
28591 #: ../tools/virt-make-fs.pl:223
28592 msgid "Choose the output disk image format."
28596 #: ../tools/virt-make-fs.pl:225
28597 msgid "The default is C<raw> (raw disk image)."
28601 #: ../tools/virt-make-fs.pl:227
28603 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
28604 "that would really make sense here is C<qcow2>."
28608 #: ../tools/virt-make-fs.pl:234
28609 msgid "B<--type=E<lt>fsE<gt>>"
28613 #: ../tools/virt-make-fs.pl:236
28614 msgid "B<-t E<lt>fsE<gt>>"
28618 #: ../tools/virt-make-fs.pl:238
28619 msgid "Choose the output filesystem type."
28623 #: ../tools/virt-make-fs.pl:240
28624 msgid "The default is C<ext2>."
28628 #: ../tools/virt-make-fs.pl:242
28630 "Any filesystem which is supported read-write by libguestfs can be used here."
28634 #: ../tools/virt-make-fs.pl:249
28635 msgid "B<--partition>"
28639 #: ../tools/virt-make-fs.pl:251
28640 msgid "B<--partition=E<lt>parttypeE<gt>>"
28644 #: ../tools/virt-make-fs.pl:253
28646 "If specified, this flag adds an MBR partition table to the output disk image."
28650 #: ../tools/virt-make-fs.pl:256
28652 "You can change the partition table type, eg. C<--partition=gpt> for large "
28657 #: ../tools/virt-make-fs.pl:259
28659 "Note that if you just use a lonesome C<--partition>, the Perl option parser "
28660 "might consider the next parameter to be the partition type. For example:"
28664 #: ../tools/virt-make-fs.pl:263
28667 " virt-make-fs --partition input.tar ...\n"
28672 #: ../tools/virt-make-fs.pl:265
28674 "would cause virt-make-fs to think you wanted to use a partition type of "
28675 "C<input.tar> which is completely wrong. To avoid this, use C<--> (a double "
28676 "dash) between options and the input file argument:"
28680 #: ../tools/virt-make-fs.pl:269
28683 " virt-make-fs --partition -- input.tar ...\n"
28688 #: ../tools/virt-make-fs.pl:536
28690 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar(1)>, L<mkisofs(1)>, "
28691 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, L<guestfs"
28692 "(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
28696 #: ../tools/virt-make-fs.pl:553
28699 " export LIBGUESTFS_DEBUG=1\n"
28700 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
28705 #: ../tools/virt-make-fs.pl:556
28707 "Attach /tmp/virt-make-fs.log to a new bug report at L<https://bugzilla."
28712 #: ../tools/virt-list-partitions.pl:32
28714 "virt-list-partitions - List partitions in a virtual machine or disk image"
28718 #: ../tools/virt-list-partitions.pl:36
28721 " virt-list-partitions [--options] domname\n"
28726 #: ../tools/virt-list-partitions.pl:38
28729 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
28734 #: ../tools/virt-list-partitions.pl:45
28736 "C<virt-list-partitions> is a command line tool to list the partitions that "
28737 "are contained in a virtual machine or disk image. It is mainly useful as a "
28738 "first step to using L<virt-resize(1)>."
28742 #: ../tools/virt-list-partitions.pl:50
28744 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
28745 "functionality. For more complex cases you should look at the L<guestfish(1)"
28750 #: ../tools/virt-list-partitions.pl:107
28751 msgid "B<-h> | B<--human-readable>"
28755 #: ../tools/virt-list-partitions.pl:109
28756 msgid "Show sizes in human-readable form (eg. \"1G\")."
28760 #: ../tools/virt-list-partitions.pl:117
28762 "With this option, C<virt-list-partitions> displays the type and size of each "
28763 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
28767 #: ../tools/virt-list-partitions.pl:124
28768 msgid "B<-t> | B<--total>"
28772 #: ../tools/virt-list-partitions.pl:126
28774 "Display the total size of each block device (as a separate row or rows)."
28778 #: ../tools/virt-list-partitions.pl:259
28780 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-list-"
28781 "filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib"
28782 "(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."