1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.13.20\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-10-11 20:58+0200\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3 ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3 ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14 ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3 ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30 ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31 ../tools/virt-win-reg.pl:35
26 #: ../align/virt-alignment-scan.pod:5
27 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
31 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7 ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7 ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7 ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34 ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35 ../tools/virt-win-reg.pl:39
36 #: ../align/virt-alignment-scan.pod:9
39 " virt-alignment-scan [--options] -d domname\n"
44 #: ../align/virt-alignment-scan.pod:11
47 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
52 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19 ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27 ../erlang/examples/guestfs-erlang.pod:16 ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18 ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19 ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21 ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15 ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18 ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29 ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15 ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11 ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40 ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77 ../tools/virt-win-reg.pl:63
57 #: ../align/virt-alignment-scan.pod:15
59 "When older operating systems install themselves, the partitioning tools "
60 "place partitions at a sector misaligned with the underlying storage "
61 "(commonly the first partition starts on sector C<63>). Misaligned "
62 "partitions can result in an operating system issuing more I/O than should be "
67 #: ../align/virt-alignment-scan.pod:21
69 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
70 "machines and disk images and warns you if there are alignment problems."
74 #: ../align/virt-alignment-scan.pod:25
76 "Currently there is no virt tool for fixing alignment problems. You can only "
77 "reinstall the guest operating system. The following NetApp document "
78 "summarises the problem and possible solutions: "
79 "L<http://media.netapp.com/documents/tr-3747.pdf>"
83 #: ../align/virt-alignment-scan.pod:30
88 #: ../align/virt-alignment-scan.pod:32
89 msgid "To run this tool on a disk image directly, use the I<-a> option:"
93 #: ../align/virt-alignment-scan.pod:34
96 " $ virt-alignment-scan -a winxp.img\n"
97 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
102 #: ../align/virt-alignment-scan.pod:37
105 " $ virt-alignment-scan -a fedora16.img\n"
106 " /dev/sda1 1048576 1024K ok\n"
107 " /dev/sda2 2097152 2048K ok\n"
108 " /dev/sda3 526385152 2048K ok\n"
113 #: ../align/virt-alignment-scan.pod:42
115 "To run the tool on a guest known to libvirt, use the I<-d> option and "
116 "possibly the I<-c> option:"
120 #: ../align/virt-alignment-scan.pod:45
123 " # virt-alignment-scan -d RHEL5\n"
124 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
125 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
130 #: ../align/virt-alignment-scan.pod:49
133 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
134 " /dev/sda1 1048576 1024K ok\n"
135 " /dev/sda2 105906176 1024K ok\n"
136 " /dev/sdb1 65536 64K ok\n"
141 #: ../align/virt-alignment-scan.pod:54
143 "The output consists of 4 or more whitespace-separated columns. Only the "
144 "first 4 columns are signficant if you want to parse this from a program. "
149 #: ../align/virt-alignment-scan.pod:60
154 #: ../align/virt-alignment-scan.pod:62
156 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
157 "on the first block device)"
161 #: ../align/virt-alignment-scan.pod:65
166 #: ../align/virt-alignment-scan.pod:67
167 msgid "the start of the partition in bytes"
171 #: ../align/virt-alignment-scan.pod:69
176 #: ../align/virt-alignment-scan.pod:71
177 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
181 #: ../align/virt-alignment-scan.pod:73
186 #: ../align/virt-alignment-scan.pod:75
188 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
189 "can cause performance problems"
193 #: ../align/virt-alignment-scan.pod:78
198 #: ../align/virt-alignment-scan.pod:80
199 msgid "optional free-text explanation."
203 #: ../align/virt-alignment-scan.pod:84
205 "The exit code from the program changes depending on whether poorly aligned "
206 "partitions were found. See L</EXIT STATUS> below."
210 #: ../align/virt-alignment-scan.pod:87
211 msgid "If you just want the exit code with no output, use the I<-q> option."
215 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261 ../clone/virt-sysprep.pod:36 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62 ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45 ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42 ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:83 ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84 ../resize/virt-resize.pod:241 ../sparsify/virt-sparsify.pod:99 ../test-tool/libguestfs-test-tool.pod:36 ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54 ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103 ../tools/virt-win-reg.pl:96
220 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../clone/virt-sysprep.pod:40 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:151 ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88 ../resize/virt-resize.pod:245 ../sparsify/virt-sparsify.pod:103 ../test-tool/libguestfs-test-tool.pod:40 ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62 ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111 ../tools/virt-win-reg.pl:104
225 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68 ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90 ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64 ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113 ../tools/virt-win-reg.pl:106
226 msgid "Display brief help."
230 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269 ../clone/virt-sysprep.pod:44 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70 ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
235 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271 ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72 ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
236 msgid "B<--add> file"
240 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:48
241 msgid "Add I<file> which should be a disk image from a virtual machine."
245 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277 ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174 ../fuse/guestmount.pod:93 ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
247 "The format of the disk image is auto-detected. To override this and force a "
248 "particular format use the I<--format=..> option."
252 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291 ../clone/virt-sysprep.pod:53 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
257 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293 ../clone/virt-sysprep.pod:55 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
258 msgid "B<--connect> URI"
262 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295 ../clone/virt-sysprep.pod:57 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99 ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111 ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82 ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
264 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
265 "to the default libvirt hypervisor."
269 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298 ../clone/virt-sysprep.pod:60 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
271 "If you specify guest block devices directly (I<-a>), then libvirt is not "
276 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307 ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105 ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
281 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309 ../clone/virt-sysprep.pod:65 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107 ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
282 msgid "B<--domain> guest"
286 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311 ../clone/virt-sysprep.pod:67 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109 ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
288 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
293 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328 ../clone/virt-sysprep.pod:89 ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:133 ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
294 msgid "B<--format=raw|qcow2|..>"
298 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330 ../clone/virt-sysprep.pod:91 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235 ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
303 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332 ../clone/virt-sysprep.pod:93 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237 ../fuse/guestmount.pod:137 ../rescue/virt-rescue.pod:128
305 "The default for the I<-a> option is to auto-detect the format of the disk "
306 "image. Using this forces the disk format for I<-a> options which follow on "
307 "the command line. Using I<--format> with no argument switches back to "
308 "auto-detection for subsequent I<-a> options."
312 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337 ../clone/virt-sysprep.pod:98 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242 ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:336 ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2862
317 #: ../align/virt-alignment-scan.pod:134
320 " virt-alignment-scan --format=raw -a disk.img\n"
325 #: ../align/virt-alignment-scan.pod:136 ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341 ../clone/virt-sysprep.pod:102 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
326 msgid "forces raw format (no auto-detection) for C<disk.img>."
330 #: ../align/virt-alignment-scan.pod:138
333 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
338 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345 ../clone/virt-sysprep.pod:106 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
340 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
341 "auto-detection for C<another.img>."
345 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348 ../clone/virt-sysprep.pod:109 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:144
347 "If you have untrusted raw-format guest disk images, you should use this "
348 "option to specify the disk format. This avoids a possible security problem "
349 "with malicious guests (CVE-2010-3851)."
353 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:414 ../sparsify/virt-sparsify.pod:153
358 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:416 ../sparsify/virt-sparsify.pod:155
363 #: ../align/virt-alignment-scan.pod:151
365 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
370 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425 ../clone/virt-sysprep.pod:122 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390 ../fuse/guestmount.pod:257 ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:182 ../sparsify/virt-sparsify.pod:159
375 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427 ../clone/virt-sysprep.pod:124 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392 ../fuse/guestmount.pod:259 ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:184 ../sparsify/virt-sparsify.pod:161
380 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429 ../clone/virt-sysprep.pod:126 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:186 ../sparsify/virt-sparsify.pod:163
381 msgid "Enable verbose messages for debugging."
385 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431 ../clone/virt-sysprep.pod:128 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397 ../fuse/guestmount.pod:263 ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:484 ../sparsify/virt-sparsify.pod:165
390 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433 ../clone/virt-sysprep.pod:130 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399 ../fuse/guestmount.pod:265 ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:486 ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69 ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169 ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
395 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435 ../clone/virt-sysprep.pod:132 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:192 ../resize/virt-resize.pod:488 ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71 ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171 ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
396 msgid "Display version number and exit."
400 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437 ../clone/virt-sysprep.pod:134 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412 ../fuse/guestmount.pod:278 ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171 ../tools/virt-tar.pl:158
405 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439 ../clone/virt-sysprep.pod:136 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:205 ../sparsify/virt-sparsify.pod:173
406 msgid "Enable tracing of libguestfs API calls."
410 #: ../align/virt-alignment-scan.pod:172
411 msgid "RECOMMENDED ALIGNMENT"
415 #: ../align/virt-alignment-scan.pod:174
417 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
418 "first sector of the first partition at sector 63, with a 512 byte sector "
419 "size. This happens because of a historical accident. Drives have to report "
420 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
421 "completely meaningless on modern drives, but it happens that the geometry "
422 "reported always has 63 sectors per track. The operating system therefore "
423 "places the first partition at the start of the second \"track\", at sector "
428 #: ../align/virt-alignment-scan.pod:183
430 "When the guest OS is virtualized, the host operating system and hypervisor "
431 "may prefer accesses aligned to one of:"
435 #: ../align/virt-alignment-scan.pod:188
440 #: ../align/virt-alignment-scan.pod:190
442 "if the host OS uses local storage directly on hard drive partitions, and the "
443 "hard drive has 512 byte physical sectors."
447 #: ../align/virt-alignment-scan.pod:193
452 #: ../align/virt-alignment-scan.pod:195
454 "for local storage on new hard drives with 4Kbyte physical sectors; for "
455 "file-backed storage on filesystems with 4Kbyte block size; or for some types "
456 "of network-attached storage."
460 #: ../align/virt-alignment-scan.pod:199
465 #: ../align/virt-alignment-scan.pod:201
467 "for high-end network-attached storage. This is the optimal block size for "
468 "some NetApp hardware."
472 #: ../align/virt-alignment-scan.pod:204
477 #: ../align/virt-alignment-scan.pod:206
478 msgid "see L</1 MB PARTITION ALIGNMENT> below."
482 #: ../align/virt-alignment-scan.pod:210
484 "Partitions which are not aligned correctly to the underlying storage cause "
485 "extra I/O. For example:"
489 #: ../align/virt-alignment-scan.pod:213
493 " +--------------------------+------\n"
495 " | filesystem block |\n"
496 " ---+------------------+------+-------------------+-----+---\n"
497 " | host block | host block |\n"
499 " ---+-------------------------+-------------------------+---\n"
504 #: ../align/virt-alignment-scan.pod:222
506 "In this example, each time a 4K guest block is read, two blocks on the host "
507 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
508 "written, two host blocks must first be read, the old and new data combined, "
509 "and the two blocks written back (4x I/O)."
513 #: ../align/virt-alignment-scan.pod:227
514 msgid "LINUX HOST BLOCK AND I/O SIZE"
518 #: ../align/virt-alignment-scan.pod:229
520 "New versions of the Linux kernel expose the physical and logical block size, "
521 "and minimum and recommended I/O size."
525 #: ../align/virt-alignment-scan.pod:232
526 msgid "For a typical hard drive with 512 byte sectors:"
530 #: ../align/virt-alignment-scan.pod:234
533 " $ cat /sys/block/sda/queue/physical_block_size\n"
535 " $ cat /sys/block/sda/queue/logical_block_size\n"
537 " $ cat /sys/block/sda/queue/minimum_io_size\n"
539 " $ cat /sys/block/sda/queue/optimal_io_size\n"
545 #: ../align/virt-alignment-scan.pod:243
546 msgid "For a NetApp LUN:"
550 #: ../align/virt-alignment-scan.pod:245
553 " $ cat /sys/block/sdc/queue/logical_block_size\n"
555 " $ cat /sys/block/sdc/queue/physical_block_size\n"
557 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
559 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
565 #: ../align/virt-alignment-scan.pod:254
567 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
568 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
572 #: ../align/virt-alignment-scan.pod:258
574 "For detailed information about what these numbers mean, see "
575 "L<http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage-iolimits.html>"
579 #: ../align/virt-alignment-scan.pod:261
581 "[Thanks to Mike Snitzer for providing NetApp data and additional "
586 #: ../align/virt-alignment-scan.pod:264
587 msgid "1 MB PARTITION ALIGNMENT"
591 #: ../align/virt-alignment-scan.pod:266
593 "Microsoft picked 1 MB as the default alignment for all partitions starting "
594 "with Windows 2008 Server, and Linux has followed this."
598 #: ../align/virt-alignment-scan.pod:269
600 "Assuming 512 byte sectors in the guest, you will now see the first partition "
601 "starting at sector 2048, and subsequent partitions (if any) will start at a "
602 "multiple of 2048 sectors."
606 #: ../align/virt-alignment-scan.pod:273
608 "1 MB alignment is compatible with all current alignment requirements (4K, "
609 "64K) and provides room for future growth in physical block sizes."
613 #: ../align/virt-alignment-scan.pod:276
614 msgid "SETTING ALIGNMENT"
618 #: ../align/virt-alignment-scan.pod:278
620 "Currently there is no virt tool for fixing alignment problems in guests. "
621 "This is a difficult problem to fix because simply moving partitions around "
622 "breaks the bootloader, necessitating either manual reinstallation of the "
623 "bootloader using a rescue disk, or complex and error-prone hacks."
627 #: ../align/virt-alignment-scan.pod:284
629 "L<virt-resize(1)> does not change the alignment of the first partition, but "
630 "it does align the second and subsequent partitions to a multiple of 64 or "
631 "128 sectors (depending on the version of virt-resize, 128 in virt-resize "
632 "E<ge> 1.13.19). For operating systems that have a separate boot partition, "
633 "virt-resize could be used to align the main OS partition, so that the "
634 "majority of OS accesses except at boot will be aligned."
638 #: ../align/virt-alignment-scan.pod:292
640 "The easiest way to correct partition alignment problems is to reinstall your "
641 "guest operating systems. If you install operating systems from templates, "
642 "ensure these have correct partition alignment too."
646 #: ../align/virt-alignment-scan.pod:297
648 "For older versions of Windows, the following NetApp document contains useful "
649 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
653 #: ../align/virt-alignment-scan.pod:300
655 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
656 "an explicit C<%pre> section that creates aligned partitions using "
657 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
658 "document above contains an example."
662 #: ../align/virt-alignment-scan.pod:305 ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483 ../clone/virt-sysprep.pod:359 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:601 ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532 ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
663 msgid "SHELL QUOTING"
667 #: ../align/virt-alignment-scan.pod:307 ../cat/virt-cat.pod:193 ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485 ../clone/virt-sysprep.pod:361 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:603 ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534 ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
669 "Libvirt guest names can contain arbitrary characters, some of which have "
670 "meaning to the shell such as C<#> and space. You may need to quote or "
671 "escape these characters on the command line. See the shell manual page "
672 "L<sh(1)> for details."
676 #: ../align/virt-alignment-scan.pod:312 ../cat/virt-cat.pod:198 ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490 ../clone/virt-sysprep.pod:366 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1113 ../fuse/guestmount.pod:303 ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:608 ../sparsify/virt-sparsify.pod:227 ../test-tool/libguestfs-test-tool.pod:90
681 #: ../align/virt-alignment-scan.pod:314
682 msgid "This program returns:"
686 #: ../align/virt-alignment-scan.pod:318 ../align/virt-alignment-scan.pod:324 ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:337 ../clone/virt-sysprep.pod:213 ../clone/virt-sysprep.pod:217 ../clone/virt-sysprep.pod:221 ../clone/virt-sysprep.pod:225 ../clone/virt-sysprep.pod:240 ../clone/virt-sysprep.pod:244 ../clone/virt-sysprep.pod:248 ../clone/virt-sysprep.pod:252 ../clone/virt-sysprep.pod:256 ../clone/virt-sysprep.pod:292 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266 ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276 ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291 ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102 ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132 ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227 ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235 ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:390 ../fish/guestfish-actions.pod:398 ../fish/guestfish-actions.pod:405 ../fish/guestfish-actions.pod:412 ../fish/guestfish-actions.pod:1139 ../fish/guestfish-actions.pod:1143 ../fish/guestfish-actions.pod:1147 ../fish/guestfish-actions.pod:1151 ../fish/guestfish-actions.pod:1159 ../fish/guestfish-actions.pod:1163 ../fish/guestfish-actions.pod:1167 ../fish/guestfish-actions.pod:1177 ../fish/guestfish-actions.pod:1181 ../fish/guestfish-actions.pod:1185 ../fish/guestfish-actions.pod:1275 ../fish/guestfish-actions.pod:1279 ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289 ../fish/guestfish-actions.pod:1331 ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1596 ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:1610 ../fish/guestfish-actions.pod:2005 ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2026 ../fish/guestfish-actions.pod:2033 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393 ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282 ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295 ../resize/virt-resize.pod:301 ../sparsify/virt-sparsify.pod:32 ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43 ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54 ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:588 ../src/guestfs-actions.pod:596 ../src/guestfs-actions.pod:603 ../src/guestfs-actions.pod:610 ../src/guestfs-actions.pod:1778 ../src/guestfs-actions.pod:1782 ../src/guestfs-actions.pod:1786 ../src/guestfs-actions.pod:1790 ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:1802 ../src/guestfs-actions.pod:1806 ../src/guestfs-actions.pod:1816 ../src/guestfs-actions.pod:1820 ../src/guestfs-actions.pod:1824 ../src/guestfs-actions.pod:1962 ../src/guestfs-actions.pod:1966 ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:1976 ../src/guestfs-actions.pod:2037 ../src/guestfs-actions.pod:2041 ../src/guestfs-actions.pod:2046 ../src/guestfs-actions.pod:2461 ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2475 ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3018 ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:3040 ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098 ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115 ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164 ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176 ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674 ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785 ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804 ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104 ../src/guestfs.pod:2112 ../src/guestfs.pod:2630 ../src/guestfs.pod:2636 ../src/guestfs.pod:2641 ../src/guestfs.pod:2647 ../src/guestfs.pod:3047 ../src/guestfs.pod:3052 ../src/guestfs.pod:3056 ../src/guestfs.pod:3060 ../src/guestfs.pod:3064 ../src/guestfs.pod:3078 ../src/guestfs.pod:3083 ../src/guestfs.pod:3314 ../src/guestfs.pod:3318 ../src/guestfs.pod:3322 ../src/guestfs.pod:3326 ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716 ../tools/virt-win-reg.pl:722
691 #: ../align/virt-alignment-scan.pod:320
696 #: ../align/virt-alignment-scan.pod:322
697 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
701 #: ../align/virt-alignment-scan.pod:326
706 #: ../align/virt-alignment-scan.pod:328
707 msgid "an error scanning the disk image or guest"
711 #: ../align/virt-alignment-scan.pod:332
716 #: ../align/virt-alignment-scan.pod:334
718 "successful exit, some partitions have alignment E<lt> 64K which can result "
719 "in poor performance on high end network storage"
723 #: ../align/virt-alignment-scan.pod:339
728 #: ../align/virt-alignment-scan.pod:341
730 "successful exit, some partitions have alignment E<lt> 4K which can result in "
731 "poor performance on most hypervisors"
735 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:203 ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495 ../clone/virt-sysprep.pod:370 ../df/virt-df.pod:227 ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97 ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384 ../fish/guestfish.pod:1267 ../fish/virt-copy-in.pod:50 ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47 ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:308 ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45 ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39 ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288 ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36 ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3255 ../test-tool/libguestfs-test-tool.pod:100 ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265 ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296 ../tools/virt-win-reg.pl:746
740 #: ../align/virt-alignment-scan.pod:348
742 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
743 "L<virt-resize(1)>, L<http://libguestfs.org/>."
747 #: ../align/virt-alignment-scan.pod:355 ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507 ../clone/virt-sysprep.pod:384 ../df/virt-df.pod:235 ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:635 ../sparsify/virt-sparsify.pod:264 ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:772
752 #: ../align/virt-alignment-scan.pod:357 ../cat/virt-cat.pod:214 ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509 ../clone/virt-sysprep.pod:386 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:637 ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566 ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
753 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
757 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511 ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:239 ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114 ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401 ../fish/guestfish.pod:1299 ../fish/virt-copy-in.pod:64 ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62 ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:323 ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62 ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56 ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300 ../resize/virt-resize.pod:639 ../ruby/examples/guestfs-ruby.pod:52 ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3337 ../test-tool/libguestfs-test-tool.pod:110 ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281 ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315 ../tools/virt-win-reg.pl:776
762 #: ../align/virt-alignment-scan.pod:361 ../clone/virt-sysprep.pod:390 ../sparsify/virt-sparsify.pod:270
763 msgid "Copyright (C) 2011 Red Hat Inc."
767 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:220 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515 ../clone/virt-sysprep.pod:392 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1304 ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:643 ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285 ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319 ../tools/virt-win-reg.pl:780
769 "This program is free software; you can redistribute it and/or modify it "
770 "under the terms of the GNU General Public License as published by the Free "
771 "Software Foundation; either version 2 of the License, or (at your option) "
776 #: ../align/virt-alignment-scan.pod:368 ../cat/virt-cat.pod:225 ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520 ../clone/virt-sysprep.pod:397 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1309 ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:333 ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:648 ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290 ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324 ../tools/virt-win-reg.pl:785
778 "This program is distributed in the hope that it will be useful, but WITHOUT "
779 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
780 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
785 #: ../align/virt-alignment-scan.pod:373 ../cat/virt-cat.pod:230 ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525 ../clone/virt-sysprep.pod:402 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1314 ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:338 ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:653 ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125 ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295 ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329 ../tools/virt-win-reg.pl:790
787 "You should have received a copy of the GNU General Public License along with "
788 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
789 "Ave, Cambridge, MA 02139, USA."
793 #: ../cat/virt-cat.pod:5
794 msgid "virt-cat - Display files in a virtual machine"
798 #: ../cat/virt-cat.pod:9
801 " virt-cat [--options] -d domname file [file ...]\n"
806 #: ../cat/virt-cat.pod:11
809 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
814 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
819 #: ../cat/virt-cat.pod:15
822 " virt-cat domname file\n"
827 #: ../cat/virt-cat.pod:17
830 " virt-cat disk.img file\n"
835 #: ../cat/virt-cat.pod:21
837 "C<virt-cat> is a command line tool to display the contents of C<file> where "
838 "C<file> exists in the named virtual machine (or disk image)."
842 #: ../cat/virt-cat.pod:24
844 "Multiple filenames can be given, in which case they are concatenated "
845 "together. Each filename must be a full path, starting at the root directory "
846 "(starting with '/')."
850 #: ../cat/virt-cat.pod:28
852 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
853 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
854 "tool (see L</USING GUESTFISH> below)."
858 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43 ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41 ../fish/guestfish.pod:1050 ../fish/virt-copy-in.pod:29 ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30 ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39 ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75 ../tools/virt-tar.pl:50
863 #: ../cat/virt-cat.pod:34
864 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
868 #: ../cat/virt-cat.pod:37
871 " virt-cat -d mydomain /etc/fstab\n"
876 #: ../cat/virt-cat.pod:39
877 msgid "List syslog messages from a VM disk image file:"
881 #: ../cat/virt-cat.pod:41
884 " virt-cat -a disk.img /var/log/messages | tail\n"
889 #: ../cat/virt-cat.pod:43
890 msgid "Find out what DHCP IP address a VM acquired:"
894 #: ../cat/virt-cat.pod:45
897 " virt-cat -d mydomain /var/log/messages | \\\n"
898 " grep 'dhclient: bound to' | tail\n"
903 #: ../cat/virt-cat.pod:48
904 msgid "Find out what packages were recently installed:"
908 #: ../cat/virt-cat.pod:50
911 " virt-cat -d mydomain /var/log/yum.log | tail\n"
916 #: ../cat/virt-cat.pod:52
917 msgid "Find out who is logged on inside a virtual machine:"
921 #: ../cat/virt-cat.pod:54
924 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
930 #: ../cat/virt-cat.pod:57
931 msgid "or who was logged on:"
935 #: ../cat/virt-cat.pod:59
938 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
939 " last -f /tmp/wtmp\n"
944 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103 ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74 ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
946 "Add I<file> which should be a disk image from a virtual machine. If the "
947 "virtual machine has multiple block devices, you must supply all of them with "
948 "separate I<-a> options."
952 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148 ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217 ../fuse/guestmount.pod:126 ../inspector/virt-inspector.pod:92
953 msgid "B<--echo-keys>"
957 #: ../cat/virt-cat.pod:100
959 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
960 "so you cannot see what you are typing. If you are not worried about Tempest "
961 "attacks and there is no one else in the room you can specify this flag to "
962 "see what you are typing."
966 #: ../cat/virt-cat.pod:116
969 " virt-cat --format=raw -a disk.img file\n"
974 #: ../cat/virt-cat.pod:120
977 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
982 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200 ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289 ../fuse/guestmount.pod:163 ../inspector/virt-inspector.pod:114
983 msgid "B<--keys-from-stdin>"
987 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202 ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291 ../fuse/guestmount.pod:165 ../inspector/virt-inspector.pod:116
989 "Read key or passphrase parameters from stdin. The default is to try to read "
990 "passphrases from the user by opening C</dev/tty>."
994 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179 ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
995 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
999 #: ../cat/virt-cat.pod:154
1000 msgid "Previous versions of virt-cat allowed you to write either:"
1004 #: ../cat/virt-cat.pod:156
1007 " virt-cat disk.img [disk.img ...] file\n"
1012 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185 ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1017 #: ../cat/virt-cat.pod:160
1020 " virt-cat guestname file\n"
1025 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189 ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1027 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1028 "the confusing case where a disk image might have the same name as a guest."
1032 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193 ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1033 msgid "For compatibility the old style is still supported."
1037 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1038 msgid "USING GUESTFISH"
1042 #: ../cat/virt-cat.pod:170
1044 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1045 "C<virt-cat> doesn't work."
1049 #: ../cat/virt-cat.pod:173
1050 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1054 #: ../cat/virt-cat.pod:175
1057 " guestfish --ro -i -d domname download file -\n"
1062 #: ../cat/virt-cat.pod:177
1064 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1065 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1069 #: ../cat/virt-cat.pod:181
1071 "The command above uses libguestfs's guest inspection feature and so does not "
1072 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1073 "disk images that don't contain guests. To display a file from a disk image "
1078 #: ../cat/virt-cat.pod:186
1081 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1086 #: ../cat/virt-cat.pod:188
1088 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1089 "the disk image, and C<file> is the full path to the file."
1093 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374 ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351 ../fuse/guestmount.pod:305 ../inspector/virt-inspector.pod:377 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:229
1094 msgid "This program returns 0 if successful, or non-zero if there was an error."
1098 #: ../cat/virt-cat.pod:205
1100 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
1101 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
1105 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405 ../resize/virt-resize.pod:641
1106 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1110 #: ../cat/virt-filesystems.pod:5
1112 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1113 "virtual machine or disk image"
1117 #: ../cat/virt-filesystems.pod:9
1120 " virt-filesystems [--options] -d domname\n"
1125 #: ../cat/virt-filesystems.pod:11
1128 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1133 #: ../cat/virt-filesystems.pod:15
1135 "This tool allows you to discover filesystems, partitions, logical volumes, "
1136 "and their sizes in a disk image or virtual machine. It is a replacement for "
1137 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1141 #: ../cat/virt-filesystems.pod:20
1143 "One use for this tool is from shell scripts to iterate over all filesystems "
1144 "from a disk image:"
1148 #: ../cat/virt-filesystems.pod:23
1151 " for fs in $(virt-filesystems -a disk.img); do\n"
1158 #: ../cat/virt-filesystems.pod:27
1160 "Another use is to list partitions before using another tool to modify those "
1161 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1162 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1166 #: ../cat/virt-filesystems.pod:32
1168 "Various command line options control what this program displays. You need "
1169 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1170 "guest respectively. If you just specify that then the program shows "
1171 "filesystems found, one per line, like this:"
1175 #: ../cat/virt-filesystems.pod:37
1178 " $ virt-filesystems -a disk.img\n"
1180 " /dev/vg_guest/lv_root\n"
1185 #: ../cat/virt-filesystems.pod:41
1186 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
1190 #: ../cat/virt-filesystems.pod:44
1193 " $ virt-filesystems -a disk.img -l\n"
1194 " Name Type VFS Label Size\n"
1195 " /dev/sda1 filesystem ext4 boot 524288000\n"
1196 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1201 #: ../cat/virt-filesystems.pod:49
1203 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1208 #: ../cat/virt-filesystems.pod:52
1211 " $ virt-filesystems -a disk.img --extra\n"
1213 " /dev/vg_guest/lv_root\n"
1214 " /dev/vg_guest/lv_swap\n"
1215 " /dev/vg_guest/lv_data\n"
1220 #: ../cat/virt-filesystems.pod:58
1221 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
1225 #: ../cat/virt-filesystems.pod:60
1228 " $ virt-filesystems -a disk.img --partitions\n"
1235 #: ../cat/virt-filesystems.pod:64
1237 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
1238 "I<--physical-volumes>, I<--block-devices> to list those items."
1242 #: ../cat/virt-filesystems.pod:67
1244 "You can use these options in combination as well (if you want a combination "
1245 "including filesystems, you have to add I<--filesystems>). Notice that some "
1246 "items fall into several categories (eg. C</dev/sda1> might be both a "
1247 "partition and a filesystem). These items are listed several times. To get "
1248 "a list which includes absolutely everything that virt-filesystems knows "
1249 "about, use the I<--all> option."
1253 #: ../cat/virt-filesystems.pod:74
1255 "UUIDs (because they are quite long) are not shown by default. Add the "
1256 "I<--uuid> option to display device and filesystem UUIDs in the long output."
1260 #: ../cat/virt-filesystems.pod:78
1262 "I<--all --long --uuid> is a useful combination to display all possible "
1263 "information about everything."
1267 #: ../cat/virt-filesystems.pod:81
1270 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1271 " Name Type VFS Label Size Parent UUID\n"
1272 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1273 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1274 " /dev/sda1 partition - - 100M /dev/sda -\n"
1275 " /dev/sda2 partition - - 20G /dev/sda -\n"
1276 " /dev/sda device - - 20G - -\n"
1281 #: ../cat/virt-filesystems.pod:89
1282 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1286 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1291 #: ../cat/virt-filesystems.pod:112
1293 "Display everything. This is currently the same as specifying these options: "
1294 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
1295 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
1296 "be added to this list in future)."
1300 #: ../cat/virt-filesystems.pod:117
1301 msgid "See also I<--long>."
1305 #: ../cat/virt-filesystems.pod:119
1306 msgid "B<--blkdevs>"
1310 #: ../cat/virt-filesystems.pod:121
1311 msgid "B<--block-devices>"
1315 #: ../cat/virt-filesystems.pod:123
1316 msgid "Display block devices."
1320 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1325 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1327 "Write out the results in CSV format (comma-separated values). This format "
1328 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1329 "ABOUT CSV FORMAT> below."
1333 #: ../cat/virt-filesystems.pod:150
1335 "When prompting for keys and passphrases, virt-filesystems normally turns "
1336 "echoing off so you cannot see what you are typing. If you are not worried "
1337 "about Tempest attacks and there is no one else in the room you can specify "
1338 "this flag to see what you are typing."
1342 #: ../cat/virt-filesystems.pod:155
1347 #: ../cat/virt-filesystems.pod:157
1349 "This causes filesystems that are not ordinary, mountable filesystems to be "
1350 "displayed. This category includes swapspace, and filesystems that are empty "
1351 "or contain unknown data."
1355 #: ../cat/virt-filesystems.pod:161
1356 msgid "This option implies I<--filesystems>."
1360 #: ../cat/virt-filesystems.pod:163
1361 msgid "B<--filesystems>"
1365 #: ../cat/virt-filesystems.pod:165
1367 "Display mountable filesystems. If no display option was selected then this "
1368 "option is implied."
1372 #: ../cat/virt-filesystems.pod:168
1373 msgid "With I<--extra>, non-mountable filesystems are shown too."
1377 #: ../cat/virt-filesystems.pod:181
1380 " virt-filesystems --format=raw -a disk.img\n"
1385 #: ../cat/virt-filesystems.pod:185
1388 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1393 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352 ../df/virt-df.pod:125 ../fish/guestfish.pod:156 ../tools/virt-list-partitions.pl:109
1398 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1399 msgid "B<--human-readable>"
1403 #: ../cat/virt-filesystems.pod:198
1404 msgid "In I<--long> mode, display sizes in human-readable format."
1408 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1413 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1418 #: ../cat/virt-filesystems.pod:209
1419 msgid "Display extra columns of data (\"long format\")."
1423 #: ../cat/virt-filesystems.pod:211
1424 msgid "A title row is added unless you also specify I<--no-title>."
1428 #: ../cat/virt-filesystems.pod:213
1430 "The extra columns displayed depend on what output you select, and the "
1431 "ordering of columns may change in future versions. Use the title row, "
1432 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
1437 #: ../cat/virt-filesystems.pod:218
1439 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1440 "default is to show raw numbers of I<bytes>."
1444 #: ../cat/virt-filesystems.pod:221
1445 msgid "Use I<--uuid> to display UUIDs too."
1449 #: ../cat/virt-filesystems.pod:223
1454 #: ../cat/virt-filesystems.pod:225
1455 msgid "B<--logvols>"
1459 #: ../cat/virt-filesystems.pod:227
1460 msgid "B<--logical-volumes>"
1464 #: ../cat/virt-filesystems.pod:229
1466 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1467 "of whether the LVs contain filesystems."
1471 #: ../cat/virt-filesystems.pod:232
1472 msgid "B<--no-title>"
1476 #: ../cat/virt-filesystems.pod:234
1477 msgid "In I<--long> mode, don't add a title row."
1481 #: ../cat/virt-filesystems.pod:236
1483 "Note that the order of the columns is not fixed, and may change in future "
1484 "versions of virt-filesystems, so using this option may give you unexpected "
1489 #: ../cat/virt-filesystems.pod:240
1494 #: ../cat/virt-filesystems.pod:242
1495 msgid "B<--partitions>"
1499 #: ../cat/virt-filesystems.pod:244
1501 "Display partitions. In this mode, these are displayed irrespective of "
1502 "whether the partitions contain filesystems."
1506 #: ../cat/virt-filesystems.pod:247
1511 #: ../cat/virt-filesystems.pod:249
1512 msgid "B<--physvols>"
1516 #: ../cat/virt-filesystems.pod:251
1517 msgid "B<--physical-volumes>"
1521 #: ../cat/virt-filesystems.pod:253
1522 msgid "Display LVM physical volumes."
1526 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1531 #: ../cat/virt-filesystems.pod:257
1536 #: ../cat/virt-filesystems.pod:259
1537 msgid "In I<--long> mode, display UUIDs as well."
1541 #: ../cat/virt-filesystems.pod:273
1546 #: ../cat/virt-filesystems.pod:275
1547 msgid "B<--volgroups>"
1551 #: ../cat/virt-filesystems.pod:277
1552 msgid "B<--volume-groups>"
1556 #: ../cat/virt-filesystems.pod:279
1557 msgid "Display LVM volume groups."
1561 #: ../cat/virt-filesystems.pod:287
1566 #: ../cat/virt-filesystems.pod:289
1568 "Note that columns in the output are subject to reordering and change in "
1569 "future versions of this tool."
1573 #: ../cat/virt-filesystems.pod:294
1578 #: ../cat/virt-filesystems.pod:296
1579 msgid "The filesystem, partition, block device or LVM name."
1583 #: ../cat/virt-filesystems.pod:298
1585 "For device and partition names these are displayed as canonical libguestfs "
1586 "names, so that for example C</dev/sda2> is the second partition on the first "
1591 #: ../cat/virt-filesystems.pod:302
1593 "If the I<--long> option is B<not> specified, then only the name column is "
1594 "shown in the output."
1598 #: ../cat/virt-filesystems.pod:305
1603 #: ../cat/virt-filesystems.pod:307
1604 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1608 #: ../cat/virt-filesystems.pod:309
1613 #: ../cat/virt-filesystems.pod:311
1615 "If there is a filesystem, then this column displays the filesystem type if "
1616 "one could be detected, eg. C<ext4>."
1620 #: ../cat/virt-filesystems.pod:314
1625 #: ../cat/virt-filesystems.pod:316
1627 "If the object has a label (used for identifying and mounting filesystems) "
1628 "then this column contains the label."
1632 #: ../cat/virt-filesystems.pod:319
1637 #: ../cat/virt-filesystems.pod:321
1639 "The size of the object in bytes. If the I<--human> option is used then the "
1640 "size is displayed in a human-readable form."
1644 #: ../cat/virt-filesystems.pod:324
1649 #: ../cat/virt-filesystems.pod:326
1651 "The parent column records the parent relationship between objects. For "
1652 "example, if the object is a partition, then this column contains the name of "
1653 "the containing device. If the object is a logical volume, then this column "
1654 "is the name of the volume group."
1658 #: ../cat/virt-filesystems.pod:331
1663 #: ../cat/virt-filesystems.pod:333
1665 "If the object has a UUID (used for identifying and mounting filesystems and "
1666 "block devices) then this column contains the UUID as a string."
1670 #: ../cat/virt-filesystems.pod:337
1671 msgid "The UUID is only displayed if the I<--uuid> option is given."
1675 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1676 msgid "NOTE ABOUT CSV FORMAT"
1680 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1682 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1683 "should be easy to parse, but it is definitely not easy to parse."
1687 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1689 "Myth: Just split fields at commas. Reality: This does I<not> work "
1690 "reliably. This example has two columns:"
1694 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1697 " \"foo,bar\",baz\n"
1702 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1704 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1705 "reliably. This example has one row:"
1709 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1718 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1720 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1721 "packaged in major Linux distributions)."
1725 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1727 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1728 "or Python's built-in csv library)."
1732 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1733 msgid "Most spreadsheets and databases can import CSV directly."
1737 #: ../cat/virt-filesystems.pod:379
1739 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1740 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1741 "L<http://libguestfs.org/>."
1745 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570 ../tools/virt-win-reg.pl:778
1746 msgid "Copyright (C) 2010 Red Hat Inc."
1750 #: ../cat/virt-ls.pod:5
1751 msgid "virt-ls - List files in a virtual machine"
1755 #: ../cat/virt-ls.pod:9
1758 " virt-ls [--options] -d domname directory [directory ...]\n"
1763 #: ../cat/virt-ls.pod:11
1766 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1772 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1777 #: ../cat/virt-ls.pod:15
1780 " virt-ls [--options] domname directory\n"
1785 #: ../cat/virt-ls.pod:17
1788 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1793 #: ../cat/virt-ls.pod:21
1795 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1796 "more from a virtual machine or disk image."
1800 #: ../cat/virt-ls.pod:24
1802 "Multiple directory names can be given, in which case the output from each is "
1807 #: ../cat/virt-ls.pod:27
1809 "To list directories from a libvirt guest use the I<-d> option to specify the "
1810 "name of the guest. For a disk image, use the I<-a> option."
1814 #: ../cat/virt-ls.pod:31
1816 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1817 "may need to use L<guestfish(1)>, or write a program directly to the "
1818 "L<guestfs(3)> API."
1822 #: ../cat/virt-ls.pod:37
1823 msgid "Get a list of all files and directories in a virtual machine:"
1827 #: ../cat/virt-ls.pod:39
1830 " virt-ls -R -d guest /\n"
1835 #: ../cat/virt-ls.pod:41
1836 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1840 #: ../cat/virt-ls.pod:43
1843 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1848 #: ../cat/virt-ls.pod:45
1849 msgid "List all public-writable directories in a Linux virtual machine:"
1853 #: ../cat/virt-ls.pod:47
1856 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1861 #: ../cat/virt-ls.pod:49
1862 msgid "List all Unix domain sockets in a Linux virtual machine:"
1866 #: ../cat/virt-ls.pod:51
1869 " virt-ls -lR -d guest / | grep '^s'\n"
1874 #: ../cat/virt-ls.pod:53
1875 msgid "List all regular files with filenames ending in '.png':"
1879 #: ../cat/virt-ls.pod:55
1882 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1887 #: ../cat/virt-ls.pod:57
1888 msgid "To display files larger than 10MB in home directories:"
1892 #: ../cat/virt-ls.pod:59
1895 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1900 #: ../cat/virt-ls.pod:61
1901 msgid "Find everything modified in the last 7 days:"
1905 #: ../cat/virt-ls.pod:63
1908 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1913 #: ../cat/virt-ls.pod:65
1914 msgid "Find regular files modified in the last 24 hours:"
1918 #: ../cat/virt-ls.pod:67
1921 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1926 #: ../cat/virt-ls.pod:69
1927 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1931 #: ../cat/virt-ls.pod:71
1933 "Find the differences between files in a guest and an earlier snapshot of the "
1938 #: ../cat/virt-ls.pod:74
1941 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1942 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1943 " diff -u old new | less\n"
1948 #: ../cat/virt-ls.pod:78
1950 "The commands above won't find files where the content has changed but the "
1951 "metadata (eg. file size and modification date) is the same. To do that, you "
1952 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
1953 "I<--checksum> can be quite slow since it has to read and compute a checksum "
1954 "of every regular file in the virtual machine."
1958 #: ../cat/virt-ls.pod:84
1959 msgid "OUTPUT MODES"
1963 #: ../cat/virt-ls.pod:86
1965 "C<virt-ls> has four output modes, controlled by different combinations of "
1966 "the I<-l> and I<-R> options."
1970 #: ../cat/virt-ls.pod:89
1971 msgid "SIMPLE LISTING"
1975 #: ../cat/virt-ls.pod:91
1976 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1980 #: ../cat/virt-ls.pod:93
1983 " $ virt-ls -d guest /\n"
1991 #: ../cat/virt-ls.pod:98
1992 msgid "LONG LISTING"
1996 #: ../cat/virt-ls.pod:100
1998 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1999 "(more specifically, like the C<guestfs_ll> function)."
2003 #: ../cat/virt-ls.pod:103
2006 " $ virt-ls -l -d guest /\n"
2008 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2009 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2015 #: ../cat/virt-ls.pod:109
2017 "Note that while this is useful for displaying a directory, do not try "
2018 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2023 #: ../cat/virt-ls.pod:113
2024 msgid "RECURSIVE LISTING"
2028 #: ../cat/virt-ls.pod:115
2030 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2031 "and directories recursively:"
2035 #: ../cat/virt-ls.pod:118
2038 " $ virt-ls -R -d guest /tmp\n"
2046 #: ../cat/virt-ls.pod:123
2048 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2049 "converts C<\\0> characters to C<\\n>."
2053 #: ../cat/virt-ls.pod:126
2054 msgid "RECURSIVE LONG LISTING"
2058 #: ../cat/virt-ls.pod:128
2060 "Using I<-lR> options together changes the output to display directories "
2061 "recursively, with file stats, and optionally other features such as "
2062 "checksums and extended attributes."
2066 #: ../cat/virt-ls.pod:132
2068 "Most of the interesting features of C<virt-ls> are only available when using "
2073 #: ../cat/virt-ls.pod:135
2075 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2076 "you cannot use the output in another program (because filenames can contain "
2077 "spaces and other unsafe characters). If the guest was untrusted and someone "
2078 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2079 "on you by creating filenames with embedded newline characters. To B<safely> "
2080 "parse the output in another program, use the I<--csv> (Comma-Separated "
2085 #: ../cat/virt-ls.pod:143
2087 "Note that this output format is completely unrelated to the C<ls -lR> "
2092 #: ../cat/virt-ls.pod:146
2095 " $ virt-ls -lR -d guest /bin\n"
2096 " d 0555 4096 /bin\n"
2097 " - 0755 123 /bin/alsaunmute\n"
2098 " - 0755 28328 /bin/arch\n"
2099 " l 0777 4 /bin/awk -> gawk\n"
2100 " - 0755 27216 /bin/basename\n"
2101 " - 0755 943360 /bin/bash\n"
2107 #: ../cat/virt-ls.pod:155
2108 msgid "These basic fields are always shown:"
2112 #: ../cat/virt-ls.pod:159
2117 #: ../cat/virt-ls.pod:161
2119 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2120 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2121 "link), C<s> (socket) or C<u> (unknown)."
2125 #: ../cat/virt-ls.pod:171
2130 #: ../cat/virt-ls.pod:173
2131 msgid "The Unix permissions, displayed as a 4 digit octal number."
2135 #: ../cat/virt-ls.pod:175
2140 #: ../cat/virt-ls.pod:177
2142 "The size of the file. This is shown in bytes unless I<-h> or "
2143 "I<--human-readable> option is given, in which case this is shown as a "
2144 "human-readable number."
2148 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4245
2153 #: ../cat/virt-ls.pod:183
2154 msgid "The full path of the file or directory."
2158 #: ../cat/virt-ls.pod:185
2163 #: ../cat/virt-ls.pod:187
2164 msgid "For symbolic links only, the link target."
2168 #: ../cat/virt-ls.pod:191
2170 "In I<-lR> mode, additional command line options enable the display of more "
2175 #: ../cat/virt-ls.pod:194
2177 "With the I<--uids> flag, these additional fields are displayed before the "
2182 #: ../cat/virt-ls.pod:199
2187 #: ../cat/virt-ls.pod:201
2192 #: ../cat/virt-ls.pod:203
2194 "The UID and GID of the owner of the file (displayed numerically). Note "
2195 "these only make sense in the context of a Unix-like guest."
2199 #: ../cat/virt-ls.pod:208
2200 msgid "With the I<--times> flag, these additional fields are displayed:"
2204 #: ../cat/virt-ls.pod:212
2209 #: ../cat/virt-ls.pod:214
2210 msgid "The time of last access."
2214 #: ../cat/virt-ls.pod:216
2219 #: ../cat/virt-ls.pod:218
2220 msgid "The time of last modification."
2224 #: ../cat/virt-ls.pod:220
2229 #: ../cat/virt-ls.pod:222
2230 msgid "The time of last status change."
2234 #: ../cat/virt-ls.pod:226
2236 "The time fields are displayed as string dates and times, unless one of the "
2237 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2241 #: ../cat/virt-ls.pod:229
2242 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2246 #: ../cat/virt-ls.pod:233
2251 #: ../cat/virt-ls.pod:235
2253 "The device containing the file (displayed as major:minor). This may not "
2254 "match devices as known to the guest."
2258 #: ../cat/virt-ls.pod:238
2263 #: ../cat/virt-ls.pod:240
2264 msgid "The inode number."
2268 #: ../cat/virt-ls.pod:242
2273 #: ../cat/virt-ls.pod:244
2274 msgid "The number of hard links."
2278 #: ../cat/virt-ls.pod:246
2283 #: ../cat/virt-ls.pod:248
2284 msgid "For block and char special files, the device (displayed as major:minor)."
2288 #: ../cat/virt-ls.pod:251
2293 #: ../cat/virt-ls.pod:253
2294 msgid "The number of 512 byte blocks allocated to the file."
2298 #: ../cat/virt-ls.pod:257
2300 "With the I<--checksum> flag, the checksum of the file contents is shown "
2301 "(only for regular files). Computing file checksums can take a considerable "
2306 #: ../cat/virt-ls.pod:280
2307 msgid "B<--checksum>"
2311 #: ../cat/virt-ls.pod:282
2312 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2316 #: ../cat/virt-ls.pod:284
2318 "Display checksum over file contents for regular files. With no argument, "
2319 "this defaults to using I<md5>. Using an argument, you can select the "
2320 "checksum type to use."
2324 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358 ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408 ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2326 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2331 #: ../cat/virt-ls.pod:316
2333 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2334 "so you cannot see what you are typing. If you are not worried about Tempest "
2335 "attacks and there is no one else in the room you can specify this flag to "
2336 "see what you are typing."
2340 #: ../cat/virt-ls.pod:321
2341 msgid "B<--extra-stats>"
2345 #: ../cat/virt-ls.pod:323
2346 msgid "Display extra stats."
2350 #: ../cat/virt-ls.pod:339
2353 " virt-ls --format=raw -a disk.img /dir\n"
2358 #: ../cat/virt-ls.pod:343
2361 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2366 #: ../cat/virt-ls.pod:356
2367 msgid "Display file sizes in human-readable format."
2371 #: ../cat/virt-ls.pod:370
2376 #: ../cat/virt-ls.pod:372
2377 msgid "B<--recursive>"
2381 #: ../cat/virt-ls.pod:374
2383 "Select the mode. With neither of these options, C<virt-ls> produces a "
2384 "simple, flat list of the files in the named directory. See L</SIMPLE "
2389 #: ../cat/virt-ls.pod:378
2391 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2396 #: ../cat/virt-ls.pod:381
2398 "C<virt-ls -R> produces a recursive list of files starting at the named "
2399 "directory. See L</RECURSIVE LISTING>."
2403 #: ../cat/virt-ls.pod:384
2405 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2406 "parsed. See L</RECURSIVE LONG LISTING>."
2410 #: ../cat/virt-ls.pod:387
2415 #: ../cat/virt-ls.pod:389
2416 msgid "Display time fields."
2420 #: ../cat/virt-ls.pod:394
2421 msgid "B<--time-days>"
2425 #: ../cat/virt-ls.pod:396
2426 msgid "Display time fields as days before now (negative if in the future)."
2430 #: ../cat/virt-ls.pod:398
2432 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2433 "of the file is between 0 and 86399 seconds."
2437 #: ../cat/virt-ls.pod:404
2438 msgid "B<--time-relative>"
2442 #: ../cat/virt-ls.pod:406
2443 msgid "Display time fields as seconds before now (negative if in the future)."
2447 #: ../cat/virt-ls.pod:411
2452 #: ../cat/virt-ls.pod:413
2453 msgid "Display time fields as seconds since the Unix epoch."
2457 #: ../cat/virt-ls.pod:418
2462 #: ../cat/virt-ls.pod:420
2463 msgid "Display UID and GID fields."
2467 #: ../cat/virt-ls.pod:445
2468 msgid "Previous versions of virt-ls allowed you to write either:"
2472 #: ../cat/virt-ls.pod:447
2475 " virt-ls disk.img [disk.img ...] /dir\n"
2480 #: ../cat/virt-ls.pod:451
2483 " virt-ls guestname /dir\n"
2488 #: ../cat/virt-ls.pod:497
2490 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2491 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2492 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2496 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:302
2497 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2501 #: ../clone/virt-sysprep.pod:5
2502 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2506 #: ../clone/virt-sysprep.pod:9
2509 " virt-sysprep [--options] -d domname\n"
2514 #: ../clone/virt-sysprep.pod:11
2517 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2522 #: ../clone/virt-sysprep.pod:15
2524 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2525 "can be made from it. Steps in this process include removing SSH host keys, "
2526 "removing persistent network MAC configuration, and removing user accounts. "
2527 "Each step can be enabled or disabled as required."
2531 #: ../clone/virt-sysprep.pod:21
2533 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2534 "customization by the system administrator."
2538 #: ../clone/virt-sysprep.pod:24
2540 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2541 "be shut down. If you want to preserve the existing contents of the guest, "
2542 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2547 #: ../clone/virt-sysprep.pod:29
2549 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2550 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2551 "machines in preparation for cloning them. Having said that, virt-sysprep "
2552 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2553 "Windows sysprepping in a future version, and we already have code to do it."
2557 #: ../clone/virt-sysprep.pod:70
2558 msgid "B<--enable=...>"
2562 #: ../clone/virt-sysprep.pod:72
2564 "Choose which sysprep operations to perform. Give a comma-separated list of "
2565 "operations, for example:"
2569 #: ../clone/virt-sysprep.pod:75
2572 " --enable=ssh-hostkeys,udev-persistent-net\n"
2577 #: ../clone/virt-sysprep.pod:77
2578 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2582 #: ../clone/virt-sysprep.pod:79
2584 "If the I<--enable> option is not given, then we default to trying all "
2585 "possible sysprep operations. But some sysprep operations are skipped for "
2590 #: ../clone/virt-sysprep.pod:83
2592 "Use I<--list-operations> to list operations supported by a particular "
2593 "version of virt-sysprep."
2597 #: ../clone/virt-sysprep.pod:86
2598 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2602 #: ../clone/virt-sysprep.pod:100
2605 " virt-sysprep --format=raw -a disk.img\n"
2610 #: ../clone/virt-sysprep.pod:104
2613 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2618 #: ../clone/virt-sysprep.pod:113
2619 msgid "B<--hostname> newhostname"
2623 #: ../clone/virt-sysprep.pod:115
2625 "Change the hostname. See the L</hostname> operation below. If not given, "
2626 "defaults to C<localhost.localdomain>."
2630 #: ../clone/virt-sysprep.pod:118
2631 msgid "B<--list-operations>"
2635 #: ../clone/virt-sysprep.pod:120
2636 msgid "List the operations supported by the virt-sysprep program."
2640 #: ../clone/virt-sysprep.pod:140
2645 #: ../clone/virt-sysprep.pod:142
2647 "If the I<--enable> option is I<not> given, then all sysprep operations in "
2648 "the list below are enabled, although some are skipped depending on the type "
2653 #: ../clone/virt-sysprep.pod:146
2655 "Operations can be individually enabled using the I<--enable> option. Use a "
2656 "comma-separated list, for example:"
2660 #: ../clone/virt-sysprep.pod:149
2663 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2668 #: ../clone/virt-sysprep.pod:151
2670 "To list the operations supported by the current version of virt-sysprep, use "
2671 "I<--list-operations>."
2675 #: ../clone/virt-sysprep.pod:154
2680 #: ../clone/virt-sysprep.pod:156
2682 "This changes the hostname of the guest to the value given in the "
2683 "I<--hostname> parameter."
2687 #: ../clone/virt-sysprep.pod:159
2689 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2690 "C<localhost.localdomain>."
2694 #: ../clone/virt-sysprep.pod:162
2699 #: ../clone/virt-sysprep.pod:164
2701 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2702 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2706 #: ../clone/virt-sysprep.pod:167
2707 msgid "ssh-hostkeys"
2711 #: ../clone/virt-sysprep.pod:169
2712 msgid "This erases the SSH host keys in the guest."
2716 #: ../clone/virt-sysprep.pod:171
2718 "The SSH host keys are regenerated (differently) next time the guest is "
2723 #: ../clone/virt-sysprep.pod:174
2725 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2726 "stark warning about the host key changing:"
2730 #: ../clone/virt-sysprep.pod:177
2733 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2734 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2735 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2736 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2741 #: ../clone/virt-sysprep.pod:182
2742 msgid "udev-persistent-net"
2746 #: ../clone/virt-sysprep.pod:184
2748 "This erases udev persistent net rules which map the guest's existing MAC "
2749 "address to a fixed ethernet device (eg. eth0)."
2753 #: ../clone/virt-sysprep.pod:187
2755 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2756 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2757 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2758 "Erasing the udev persistent net rules avoids this."
2762 #: ../clone/virt-sysprep.pod:192
2763 msgid "COPYING AND CLONING"
2767 #: ../clone/virt-sysprep.pod:194
2769 "Virt-sysprep can be used as part of a process of cloning guests, or to "
2770 "prepare a template from which guests can be cloned. There are many "
2771 "different ways to achieve this using the virt tools, and this section is "
2772 "just an introduction."
2776 #: ../clone/virt-sysprep.pod:199
2777 msgid "A virtual machine (when switched off) consists of two parts:"
2781 #: ../clone/virt-sysprep.pod:203
2782 msgid "I<configuration>"
2786 #: ../clone/virt-sysprep.pod:205
2788 "The configuration or description of the guest. eg. The libvirt XML (see "
2789 "C<virsh dumpxml>), the running configuration of the guest, or another "
2790 "external format like OVF."
2794 #: ../clone/virt-sysprep.pod:209
2795 msgid "Some configuration items that might need to be changed:"
2799 #: ../clone/virt-sysprep.pod:215
2804 #: ../clone/virt-sysprep.pod:219 ../clone/virt-sysprep.pod:246
2809 #: ../clone/virt-sysprep.pod:223
2810 msgid "path to block device(s)"
2814 #: ../clone/virt-sysprep.pod:227
2815 msgid "network card MAC address"
2819 #: ../clone/virt-sysprep.pod:231
2820 msgid "I<block device(s)>"
2824 #: ../clone/virt-sysprep.pod:233
2826 "One or more hard disk images, themselves containing files, directories, "
2827 "applications, kernels, configuration, etc."
2831 #: ../clone/virt-sysprep.pod:236
2832 msgid "Some things inside the block devices that might need to be changed:"
2836 #: ../clone/virt-sysprep.pod:242
2837 msgid "hostname and other net configuration"
2841 #: ../clone/virt-sysprep.pod:250
2842 msgid "SSH host keys"
2846 #: ../clone/virt-sysprep.pod:254
2847 msgid "Windows unique security ID (SID)"
2851 #: ../clone/virt-sysprep.pod:258
2852 msgid "Puppet registration"
2856 #: ../clone/virt-sysprep.pod:264
2857 msgid "COPYING THE BLOCK DEVICE"
2861 #: ../clone/virt-sysprep.pod:266
2863 "Starting with an original guest, you probably wish to copy the guest block "
2864 "device and its configuration to make a template. Then once you are happy "
2865 "with the template, you will want to make many clones from it."
2869 #: ../clone/virt-sysprep.pod:271
2875 " original guest --------> template ---------->\n"
2876 " \\------> cloned\n"
2877 " \\-----> guests\n"
2883 #: ../clone/virt-sysprep.pod:279
2885 "You can, of course, just copy the block device on the host using L<cp(1)> or "
2890 #: ../clone/virt-sysprep.pod:282
2894 " original guest --------> template ---------->\n"
2895 " \\------> cloned\n"
2896 " \\-----> guests\n"
2902 #: ../clone/virt-sysprep.pod:288
2903 msgid "There are some smarter (and faster) ways too:"
2907 #: ../clone/virt-sysprep.pod:294
2911 " template ---------->\n"
2912 " \\------> cloned\n"
2913 " \\-----> guests\n"
2919 #: ../clone/virt-sysprep.pod:300
2921 "Use the block device as a backing file and create a snapshot on top for each "
2922 "guest. The advantage is that you don't need to copy the block device (very "
2923 "fast) and only changes are stored (less storage required)."
2927 #: ../clone/virt-sysprep.pod:305
2929 "Note that writing to the backing file once you have created guests on top of "
2930 "it is not possible: you will corrupt the guests."
2934 #: ../clone/virt-sysprep.pod:308
2936 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
2937 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
2938 "filesystems (such as btrfs) and most Network Attached Storage devices can "
2939 "also create cheap snapshots from files or LUNs."
2943 #: ../clone/virt-sysprep.pod:316
2944 msgid "Get your NAS to snapshot and/or duplicate the LUN."
2948 #: ../clone/virt-sysprep.pod:320
2949 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
2953 #: ../clone/virt-sysprep.pod:324
2958 #: ../clone/virt-sysprep.pod:326
2960 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
2961 "and/or modify the external libvirt configuration of a guest. It will reset "
2962 "the name, UUID and MAC address of the guest in the libvirt XML."
2966 #: ../clone/virt-sysprep.pod:331
2968 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
2969 "image. This was the original motivation to write virt-sysprep."
2973 #: ../clone/virt-sysprep.pod:334
2978 #: ../clone/virt-sysprep.pod:336
2982 " original guest --------> template\n"
2987 #: ../clone/virt-sysprep.pod:339
2989 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
2990 "it easier to compress and/or faster to copy."
2994 #: ../clone/virt-sysprep.pod:342
2996 "Notice that since virt-sparsify also copies the image, you can use it to "
2997 "make the initial copy (instead of C<dd>)."
3001 #: ../clone/virt-sysprep.pod:345
3006 #: ../clone/virt-sysprep.pod:347
3010 " template ---------->\n"
3011 " \\------> cloned\n"
3012 " \\-----> guests\n"
3018 #: ../clone/virt-sysprep.pod:353
3020 "If you want to give people cloned guests, but let them pick the size of the "
3021 "guest themselves (eg. depending on how much they are prepared to pay for "
3022 "disk space), then instead of copying the template, you can run "
3023 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3024 "ideal for cloning guests from a template."
3028 #: ../clone/virt-sysprep.pod:368
3029 msgid "This program returns 0 on success, or 1 if there was an error."
3033 #: ../clone/virt-sysprep.pod:372
3035 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3036 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<qemu-img(1)>, "
3037 "L<lvcreate(8)>, L<http://libguestfs.org/>, L<http://libvirt.org/>."
3041 #: ../df/virt-df.pod:5
3042 msgid "virt-df - Display free space on virtual filesystems"
3046 #: ../df/virt-df.pod:9
3049 " virt-df [--options]\n"
3054 #: ../df/virt-df.pod:11
3057 " virt-df [--options] -d domname\n"
3062 #: ../df/virt-df.pod:13
3065 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3070 #: ../df/virt-df.pod:17
3073 " virt-df [--options] domname\n"
3078 #: ../df/virt-df.pod:19
3081 " virt-df [--options] disk.img [disk.img ...]\n"
3086 #: ../df/virt-df.pod:23
3088 "C<virt-df> is a command line tool to display free space on virtual machine "
3089 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3090 "allocated to a virtual machine, but can look inside disk images to see how "
3091 "much space is really being used."
3095 #: ../df/virt-df.pod:28
3097 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3098 "to get a list of all active and inactive guests, and performs a C<df>-type "
3099 "operation on each one in turn, printing out the results."
3103 #: ../df/virt-df.pod:32
3105 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3106 "C<df>-type operation on either the single named libvirt domain, or on the "
3107 "disk image(s) listed on the command line (which must all belong to a single "
3108 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3109 "single guest>. If you want to run on multiple guests, then you have to "
3110 "invoke C<virt-df> multiple times."
3114 #: ../df/virt-df.pod:39
3116 "Use the I<--csv> option to get a format which can be easily parsed by other "
3117 "programs. Other options are similar to the standard L<df(1)> command."
3121 #: ../df/virt-df.pod:45
3123 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3124 "output human-readable:"
3128 #: ../df/virt-df.pod:48
3131 " # virt-df -d F14x64 -h\n"
3132 " Filesystem Size Used Available Use%\n"
3133 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3134 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3139 #: ../df/virt-df.pod:53
3140 msgid "Show disk usage for a disk image file called C<test.img>:"
3144 #: ../df/virt-df.pod:55
3147 " $ virt-df -a test1.img\n"
3148 " Filesystem 1K-blocks Used Available Use%\n"
3149 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3154 #: ../df/virt-df.pod:112
3157 " virt-df --format=raw -a disk.img\n"
3162 #: ../df/virt-df.pod:116
3165 " virt-df --format=raw -a disk.img --format -a another.img\n"
3170 #: ../df/virt-df.pod:129
3171 msgid "Print sizes in human-readable format."
3175 #: ../df/virt-df.pod:131
3176 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3180 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:155
3185 #: ../df/virt-df.pod:135
3190 #: ../df/virt-df.pod:137
3191 msgid "Print inodes instead of blocks."
3195 #: ../df/virt-df.pod:139
3196 msgid "B<--one-per-guest>"
3200 #: ../df/virt-df.pod:141
3202 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3203 "disks from several guests to a single libguestfs appliance."
3207 #: ../df/virt-df.pod:144
3208 msgid "You might use this option in the following circumstances:"
3212 #: ../df/virt-df.pod:150
3214 "If you think an untrusted guest might actively try to exploit the libguestfs "
3215 "appliance kernel, then this prevents one guest from interfering with the "
3216 "stats printed for another guest."
3220 #: ../df/virt-df.pod:156
3222 "If the kernel has a bug which stops it from accessing a filesystem in one "
3223 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3224 "and report stats for further guests."
3228 #: ../df/virt-df.pod:165
3230 "Print UUIDs instead of names. This is useful for following a guest even "
3231 "when the guest is migrated or renamed, or when two guests happen to have the "
3236 #: ../df/virt-df.pod:169
3238 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3239 "images, we still print the disk image name even when this option is "
3244 #: ../df/virt-df.pod:229
3246 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3247 "L<http://libguestfs.org/>."
3251 #: ../edit/virt-edit.pod:5
3252 msgid "virt-edit - Edit a file in a virtual machine"
3256 #: ../edit/virt-edit.pod:9
3259 " virt-edit [--options] -d domname file [file ...]\n"
3264 #: ../edit/virt-edit.pod:11
3267 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3272 #: ../edit/virt-edit.pod:13
3275 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3280 #: ../edit/virt-edit.pod:17
3283 " virt-edit domname file\n"
3288 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3291 " virt-edit disk.img [disk.img ...] file\n"
3296 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23 ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15 ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19 ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3301 #: ../edit/virt-edit.pod:23
3303 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3304 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3305 "doing this, but doesn't catch all cases."
3309 #: ../edit/virt-edit.pod:29
3311 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3312 "exists in the named virtual machine (or disk image)."
3316 #: ../edit/virt-edit.pod:32
3318 "Multiple filenames can be given, in which case they are each edited in "
3319 "turn. Each filename must be a full path, starting at the root directory "
3320 "(starting with '/')."
3324 #: ../edit/virt-edit.pod:36
3325 msgid "If you want to just view a file, use L<virt-cat(1)>."
3329 #: ../edit/virt-edit.pod:38
3331 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3332 "L</USING GUESTFISH> below)."
3336 #: ../edit/virt-edit.pod:41
3338 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3339 "that and much more."
3343 #: ../edit/virt-edit.pod:46
3344 msgid "Edit the named files interactively:"
3348 #: ../edit/virt-edit.pod:48
3351 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3356 #: ../edit/virt-edit.pod:50
3359 " virt-edit -d mydomain /etc/passwd\n"
3364 #: ../edit/virt-edit.pod:52
3365 msgid "For Windows guests, some Windows paths are understood:"
3369 #: ../edit/virt-edit.pod:54
3372 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3377 #: ../edit/virt-edit.pod:56
3379 "If Perl is installed, you can also edit files non-interactively (see "
3380 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3384 #: ../edit/virt-edit.pod:60
3387 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3392 #: ../edit/virt-edit.pod:81
3393 msgid "B<-b> extension"
3397 #: ../edit/virt-edit.pod:83
3398 msgid "B<--backup> extension"
3402 #: ../edit/virt-edit.pod:85
3404 "Create a backup of the original file I<in the guest disk image>. The backup "
3405 "has the original filename with C<extension> added."
3409 #: ../edit/virt-edit.pod:88
3411 "Usually the first character of C<extension> would be a dot C<.> so you would "
3416 #: ../edit/virt-edit.pod:91
3419 " virt-edit -b .orig [etc]\n"
3424 #: ../edit/virt-edit.pod:93
3425 msgid "By default, no backup file is made."
3429 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181 ../fuse/guestmount.pod:96 ../inspector/virt-inspector.pod:74 ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78 ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
3434 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183 ../fuse/guestmount.pod:98 ../inspector/virt-inspector.pod:76 ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80 ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
3435 msgid "B<--connect URI>"
3439 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84 ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134 ../tools/virt-win-reg.pl:135
3441 "If you specify guest block devices directly, then libvirt is not used at "
3446 #: ../edit/virt-edit.pod:114
3448 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3449 "off so you cannot see what you are typing. If you are not worried about "
3450 "Tempest attacks and there is no one else in the room you can specify this "
3451 "flag to see what you are typing."
3455 #: ../edit/virt-edit.pod:119
3460 #: ../edit/virt-edit.pod:121
3461 msgid "B<--expr> EXPR"
3465 #: ../edit/virt-edit.pod:123
3467 "Instead of launching the external editor, non-interactively apply the Perl "
3468 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3473 #: ../edit/virt-edit.pod:127
3475 "Be careful to properly quote the expression to prevent it from being altered "
3480 #: ../edit/virt-edit.pod:130
3481 msgid "Note that this option is only available when Perl 5 is installed."
3485 #: ../edit/virt-edit.pod:132
3486 msgid "B<--format> raw|qcow2|..."
3490 #: ../edit/virt-edit.pod:143
3493 " virt-edit --format=raw -a disk.img file\n"
3498 #: ../edit/virt-edit.pod:147
3501 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3506 #: ../edit/virt-edit.pod:181
3507 msgid "Previous versions of virt-edit allowed you to write either:"
3511 #: ../edit/virt-edit.pod:187
3514 " virt-edit guestname file\n"
3519 #: ../edit/virt-edit.pod:195
3520 msgid "NON-INTERACTIVE EDITING"
3524 #: ../edit/virt-edit.pod:197
3526 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3527 "administrator can interactively edit the file."
3531 #: ../edit/virt-edit.pod:200
3533 "There are two ways also to use C<virt-edit> from scripts in order to make "
3534 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3535 "like this, it's less error-prone to write scripts directly using the "
3536 "libguestfs API and Augeas for configuration file editing.)"
3540 #: ../edit/virt-edit.pod:206
3542 "The first method is to temporarily set C<$EDITOR> to any script or program "
3543 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3544 "update C<tmpfile> in place however it likes."
3548 #: ../edit/virt-edit.pod:210
3550 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3551 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3552 "instances of C<foo> with C<bar> in a file:"
3556 #: ../edit/virt-edit.pod:214
3559 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3564 #: ../edit/virt-edit.pod:216
3566 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3567 "For example to delete root's password you could do:"
3571 #: ../edit/virt-edit.pod:219
3574 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3579 #: ../edit/virt-edit.pod:221
3581 "What really happens is that the snippet is evaluated as a Perl expression "
3582 "for each line of the file. The line, including the final C<\\n>, is passed "
3583 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3587 #: ../edit/virt-edit.pod:226
3589 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3590 "C<apache> user account from the password file you can do:"
3594 #: ../edit/virt-edit.pod:229
3597 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3602 #: ../edit/virt-edit.pod:231
3604 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3605 "the end of the file is rather difficult this way since there is no concept "
3606 "of \"last line of the file\" - your expression just doesn't get called "
3607 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3612 #: ../edit/virt-edit.pod:237
3614 "The variable C<$lineno> contains the current line number. As is "
3615 "traditional, the first line in the file is number C<1>."
3619 #: ../edit/virt-edit.pod:240
3621 "The return value from the expression is ignored, but the expression may call "
3622 "C<die> in order to abort the whole program, leaving the original file "
3627 #: ../edit/virt-edit.pod:244
3629 "Remember when matching the end of a line that C<$_> may contain the final "
3630 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3631 "newline then neither of these. Thus to match or substitute some text at the "
3632 "end of a line, use this regular expression:"
3636 #: ../edit/virt-edit.pod:249
3639 " /some text(\\r?\\n)?$/\n"
3644 #: ../edit/virt-edit.pod:251
3646 "Alternately, use the perl C<chomp> function, being careful not to chomp "
3647 "C<$_> itself (since that would remove all newlines from the file):"
3651 #: ../edit/virt-edit.pod:255
3654 " my $m = $_; chomp $m; $m =~ /some text$/\n"
3659 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
3660 msgid "WINDOWS PATHS"
3664 #: ../edit/virt-edit.pod:259
3666 "C<virt-edit> has a limited ability to understand Windows drive letters and "
3667 "paths (eg. C<E:\\foo\\bar.txt>)."
3671 #: ../edit/virt-edit.pod:262
3672 msgid "If and only if the guest is running Windows then:"
3676 #: ../edit/virt-edit.pod:268
3678 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
3679 "to the correct filesystem."
3683 #: ../edit/virt-edit.pod:273
3685 "Any backslash (C<\\>) characters in the path are replaced with forward "
3686 "slashes so that libguestfs can process it."
3690 #: ../edit/virt-edit.pod:278
3692 "The path is resolved case insensitively to locate the file that should be "
3697 #: ../edit/virt-edit.pod:283
3698 msgid "There are some known shortcomings:"
3702 #: ../edit/virt-edit.pod:289
3703 msgid "Some NTFS symbolic links may not be followed correctly."
3707 #: ../edit/virt-edit.pod:293
3708 msgid "NTFS junction points that cross filesystems are not followed."
3712 #: ../edit/virt-edit.pod:299
3714 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
3715 "C<virt-edit> doesn't work."
3719 #: ../edit/virt-edit.pod:302
3720 msgid "Using C<virt-edit> is approximately equivalent to doing:"
3724 #: ../edit/virt-edit.pod:304
3727 " guestfish --rw -i -d domname edit /file\n"
3732 #: ../edit/virt-edit.pod:306
3734 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
3739 #: ../edit/virt-edit.pod:309
3741 "The command above uses libguestfs's guest inspection feature and so does not "
3742 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
3743 "disk images that don't contain guests. To edit a file on a disk image "
3748 #: ../edit/virt-edit.pod:314
3751 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
3756 #: ../edit/virt-edit.pod:316
3758 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
3759 "the disk image to edit, and C</file> is the full path to the file."
3763 #: ../edit/virt-edit.pod:320
3765 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
3766 "C<write> or C<upload> instead:"
3770 #: ../edit/virt-edit.pod:323
3773 " guestfish --rw -i -d domname touch /newfile\n"
3778 #: ../edit/virt-edit.pod:325
3781 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
3786 #: ../edit/virt-edit.pod:327
3789 " guestfish --rw -i -d domname upload localfile /newfile\n"
3794 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1118 ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232 ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
3795 msgid "ENVIRONMENT VARIABLES"
3799 #: ../edit/virt-edit.pod:333
3804 #: ../edit/virt-edit.pod:335
3806 "If set, this string is used as the editor. It may contain arguments, "
3807 "eg. C<\"emacs -nw\">"
3811 #: ../edit/virt-edit.pod:338
3812 msgid "If not set, C<vi> is used."
3816 #: ../edit/virt-edit.pod:356
3818 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
3819 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
3820 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
3824 #: ../erlang/examples/guestfs-erlang.pod:5
3825 msgid "guestfs-erlang - How to use libguestfs from Erlang"
3829 #: ../erlang/examples/guestfs-erlang.pod:9
3832 " {ok, G} = guestfs:create(),\n"
3833 " ok = guestfs:add_drive_opts(G, Disk,\n"
3834 " [{format, \"raw\"}, {readonly, true}]),\n"
3835 " ok = guestfs:launch(G),\n"
3836 " [Device] = guestfs:list_devices(G),\n"
3837 " ok = guestfs:close(G).\n"
3842 #: ../erlang/examples/guestfs-erlang.pod:18
3844 "This manual page documents how to call libguestfs from the Erlang "
3845 "programming language. This page just documents the differences from the C "
3846 "API and gives some examples. If you are not familiar with using libguestfs, "
3847 "you also need to read L<guestfs(3)>."
3851 #: ../erlang/examples/guestfs-erlang.pod:23
3852 msgid "OPENING AND CLOSING THE HANDLE"
3856 #: ../erlang/examples/guestfs-erlang.pod:25
3858 "The Erlang bindings are implemented using an external program called "
3859 "C<erl-guestfs>. This program must be on the current PATH, or else you "
3860 "should specify the full path to the program:"
3864 #: ../erlang/examples/guestfs-erlang.pod:29
3867 " {ok, G} = guestfs:create().\n"
3872 #: ../erlang/examples/guestfs-erlang.pod:31
3875 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
3880 #: ../erlang/examples/guestfs-erlang.pod:33
3881 msgid "C<G> is the libguestfs handle which you should pass to other functions."
3885 #: ../erlang/examples/guestfs-erlang.pod:36
3886 msgid "To close the handle:"
3890 #: ../erlang/examples/guestfs-erlang.pod:38
3893 " ok = guestfs:close(G).\n"
3898 #: ../erlang/examples/guestfs-erlang.pod:40
3899 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
3903 #: ../erlang/examples/guestfs-erlang.pod:42
3905 "For functions that take optional arguments, the first arguments are the "
3906 "non-optional ones. The last argument is a list of tuples supplying the "
3907 "remaining optional arguments."
3911 #: ../erlang/examples/guestfs-erlang.pod:46
3914 " ok = guestfs:add_drive_opts(G, Disk,\n"
3915 " [{format, \"raw\"}, {readonly, true}]).\n"
3920 #: ../erlang/examples/guestfs-erlang.pod:49
3921 msgid "If the last argument would be an empty list, you can also omit it:"
3925 #: ../erlang/examples/guestfs-erlang.pod:51
3928 " ok = guestfs:add_drive_opts(G, Disk).\n"
3933 #: ../erlang/examples/guestfs-erlang.pod:53
3934 msgid "RETURN VALUES AND ERRORS"
3938 #: ../erlang/examples/guestfs-erlang.pod:55
3940 "On success, most functions return a C<Result> term (which could be a list, "
3941 "string, tuple etc.). If there is nothing for the function to return, then "
3942 "the atom C<ok> is returned."
3946 #: ../erlang/examples/guestfs-erlang.pod:59
3947 msgid "On error, you would see one of the following tuples:"
3951 #: ../erlang/examples/guestfs-erlang.pod:63
3952 msgid "C<{error, Msg, Errno}>"
3956 #: ../erlang/examples/guestfs-erlang.pod:65
3957 msgid "This indicates an ordinary error from the function."
3961 #: ../erlang/examples/guestfs-erlang.pod:67
3963 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
3968 #: ../erlang/examples/guestfs-erlang.pod:70
3969 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
3973 #: ../erlang/examples/guestfs-erlang.pod:72
3974 msgid "C<{unknown, Function}>"
3978 #: ../erlang/examples/guestfs-erlang.pod:74
3980 "This indicates that the function you called is not known. Generally this "
3981 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
3982 "which you should not do."
3986 #: ../erlang/examples/guestfs-erlang.pod:78
3987 msgid "C<Function> is the name of the unknown function."
3991 #: ../erlang/examples/guestfs-erlang.pod:80
3992 msgid "C<{unknownarg, Arg}>"
3996 #: ../erlang/examples/guestfs-erlang.pod:82
3998 "This indicates that you called a function with optional arguments, with an "
3999 "unknown argument name."
4003 #: ../erlang/examples/guestfs-erlang.pod:85
4004 msgid "C<Arg> is the name of the unknown argument."
4008 #: ../erlang/examples/guestfs-erlang.pod:89 ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37 ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31 ../python/examples/guestfs-python.pod:34 ../ruby/examples/guestfs-ruby.pod:28
4009 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4013 #: ../erlang/examples/guestfs-erlang.pod:91 ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39 ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33 ../python/examples/guestfs-python.pod:36 ../ruby/examples/guestfs-ruby.pod:30
4018 #: ../erlang/examples/guestfs-erlang.pod:93 ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41 ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35 ../python/examples/guestfs-python.pod:38 ../ruby/examples/guestfs-ruby.pod:32
4019 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4023 #: ../erlang/examples/guestfs-erlang.pod:95 ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43 ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37 ../python/examples/guestfs-python.pod:40 ../ruby/examples/guestfs-ruby.pod:34
4028 #: ../erlang/examples/guestfs-erlang.pod:99
4030 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4031 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4032 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4033 "L<http://libguestfs.org/>."
4037 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../fish/guestfish.pod:1295 ../fish/virt-copy-in.pod:60 ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58 ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:319 ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58 ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52 ../python/examples/guestfs-python.pod:54 ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3333 ../test-tool/libguestfs-test-tool.pod:106
4042 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../fish/guestfish.pod:1297 ../fish/virt-copy-in.pod:62 ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60 ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:321 ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93 ../perl/examples/guestfs-perl.pod:54 ../python/examples/guestfs-python.pod:56 ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3335 ../test-tool/libguestfs-test-tool.pod:108
4043 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4047 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4048 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4052 #: ../erlang/examples/guestfs-erlang.pod:118 ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405 ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99 ../perl/examples/guestfs-perl.pod:60 ../python/examples/guestfs-python.pod:62 ../ruby/examples/guestfs-ruby.pod:56
4054 "The examples in this manual page may be freely copied, modified and "
4055 "distributed without any restrictions."
4059 #: ../erlang/examples/guestfs-erlang.pod:121 ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408 ../java/examples/guestfs-java.pod:69 ../ocaml/examples/guestfs-ocaml.pod:102 ../perl/examples/guestfs-perl.pod:63 ../python/examples/guestfs-python.pod:65 ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3342
4061 "This library is free software; you can redistribute it and/or modify it "
4062 "under the terms of the GNU Lesser General Public License as published by the "
4063 "Free Software Foundation; either version 2 of the License, or (at your "
4064 "option) any later version."
4068 #: ../erlang/examples/guestfs-erlang.pod:126 ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413 ../java/examples/guestfs-java.pod:74 ../ocaml/examples/guestfs-ocaml.pod:107 ../perl/examples/guestfs-perl.pod:68 ../python/examples/guestfs-python.pod:70 ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3347
4070 "This library is distributed in the hope that it will be useful, but WITHOUT "
4071 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4072 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4077 #: ../erlang/examples/guestfs-erlang.pod:131 ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418 ../java/examples/guestfs-java.pod:79 ../ocaml/examples/guestfs-ocaml.pod:112 ../perl/examples/guestfs-perl.pod:73 ../python/examples/guestfs-python.pod:75 ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3352
4079 "You should have received a copy of the GNU Lesser General Public License "
4080 "along with this library; if not, write to the Free Software Foundation, "
4081 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4085 #: ../examples/guestfs-examples.pod:5
4086 msgid "guestfs-examples - Examples of using libguestfs from C"
4090 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4093 " #include <guestfs.h>\n"
4098 #: ../examples/guestfs-examples.pod:11
4101 " guestfs_h *g = guestfs_create ();\n"
4102 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4103 " guestfs_launch (g);\n"
4108 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4111 " cc prog.c -o prog -lguestfs\n"
4113 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4118 #: ../examples/guestfs-examples.pod:21
4120 "This manual page contains examples of calling libguestfs from the C "
4121 "programming language. If you are not familiar with using libguestfs, you "
4122 "also need to read L<guestfs(3)>."
4126 #: ../examples/guestfs-examples.pod:35
4128 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4129 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4130 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4134 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4135 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4139 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4144 #: ../examples/guestfs-recipes.pod:5
4146 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4147 "here. The only way which works for both sorts of output is to just write "
4148 "the URL directly. Do NOT use L<...> for URLs."
4152 #: ../examples/guestfs-recipes.pod:9
4154 "We break with tradition here and don't use ALL CAPS for the section "
4155 "headings, as this makes them much easier to read."
4159 #: ../examples/guestfs-recipes.pod:16
4160 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4164 #: ../examples/guestfs-recipes.pod:20
4166 "This page contains recipes for and links to things you can do using "
4167 "libguestfs, L<guestfish(1)> and the virt tools."
4171 #: ../examples/guestfs-recipes.pod:23
4172 msgid "Audit a virtual machine for setuid files"
4176 #: ../examples/guestfs-recipes.pod:25
4178 "The link below contains a small program which can be used to audit a Linux "
4179 "virtual machine to see what setuid and setgid files it contains."
4183 #: ../examples/guestfs-recipes.pod:28
4184 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4188 #: ../examples/guestfs-recipes.pod:30
4189 msgid "Change the background image in a Windows XP VM"
4193 #: ../examples/guestfs-recipes.pod:32
4195 "The links below explain how to use L<guestfish(1)> to change the background "
4196 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4197 "be substantially different for each version of Windows."
4201 #: ../examples/guestfs-recipes.pod:37
4203 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4204 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4208 #: ../examples/guestfs-recipes.pod:40
4209 msgid "Cloning a virtual machine (Linux)"
4213 #: ../examples/guestfs-recipes.pod:42
4215 "The guestfish technique described in the link below works well for most "
4216 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4221 #: ../examples/guestfs-recipes.pod:46
4222 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4226 #: ../examples/guestfs-recipes.pod:48
4228 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4233 #: ../examples/guestfs-recipes.pod:51
4234 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4238 #: ../examples/guestfs-recipes.pod:53
4239 msgid "Cloning a virtual machine (Windows)"
4243 #: ../examples/guestfs-recipes.pod:55
4245 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4246 "straightforward. Currently there is code in the Aeolus Oz project which "
4247 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4248 "we may add sysprepping ability."
4252 #: ../examples/guestfs-recipes.pod:60
4254 "https://github.com/clalancette/oz "
4255 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4259 #: ../examples/guestfs-recipes.pod:63
4260 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4264 #: ../examples/guestfs-recipes.pod:65
4265 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4269 #: ../examples/guestfs-recipes.pod:67
4272 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4277 #: ../examples/guestfs-recipes.pod:69
4278 msgid "To export just a subdirectory, eg. C</files>, do:"
4282 #: ../examples/guestfs-recipes.pod:71
4285 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4290 #: ../examples/guestfs-recipes.pod:73
4291 msgid "Create empty disk images"
4295 #: ../examples/guestfs-recipes.pod:75
4297 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4298 "The useful guide below explains the options available."
4302 #: ../examples/guestfs-recipes.pod:78
4303 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4307 #: ../examples/guestfs-recipes.pod:80
4308 msgid "Dump raw filesystem content from inside a disk image or VM"
4312 #: ../examples/guestfs-recipes.pod:82
4314 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4315 "filesystem content from any filesystem in a disk image or a VM (even one "
4316 "which is encrypted or buried inside an LV):"
4320 #: ../examples/guestfs-recipes.pod:86
4323 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4328 #: ../examples/guestfs-recipes.pod:88
4331 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4336 #: ../examples/guestfs-recipes.pod:90
4337 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4341 #: ../examples/guestfs-recipes.pod:92
4342 msgid "Edit grub configuration in a VM"
4346 #: ../examples/guestfs-recipes.pod:94
4347 msgid "You can use this to:"
4351 #: ../examples/guestfs-recipes.pod:100
4352 msgid "Fix a virtual machine that does not boot."
4356 #: ../examples/guestfs-recipes.pod:104
4357 msgid "Change which kernel is used to boot the VM."
4361 #: ../examples/guestfs-recipes.pod:108
4362 msgid "Change kernel command line options."
4366 #: ../examples/guestfs-recipes.pod:112
4367 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4371 #: ../examples/guestfs-recipes.pod:114
4374 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4379 #: ../examples/guestfs-recipes.pod:116
4381 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4386 #: ../examples/guestfs-recipes.pod:119
4389 " virt-rescue -d BrokenGuest\n"
4394 #: ../examples/guestfs-recipes.pod:121
4395 msgid "Export any directory from a VM"
4399 #: ../examples/guestfs-recipes.pod:123
4400 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4404 #: ../examples/guestfs-recipes.pod:126
4407 " virt-copy-out -d Guest /home .\n"
4412 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1592 ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:2457 ../src/guestfs-actions.pod:3008 ../src/guestfs.pod:1670 ../tools/virt-win-reg.pl:706
4417 #: ../examples/guestfs-recipes.pod:134
4419 "The final dot of the command is not a printing error. It means we want to "
4420 "copy out to the current directory."
4424 #: ../examples/guestfs-recipes.pod:139
4425 msgid "This creates a directory called C<home> under the current directory."
4429 #: ../examples/guestfs-recipes.pod:143
4431 "If the guest is a Windows guest then you can use drive letters and "
4432 "backslashes, but you must prefix the path with C<win:> and quote it to "
4433 "protect it from the shell, like this:"
4437 #: ../examples/guestfs-recipes.pod:147
4440 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4445 #: ../examples/guestfs-recipes.pod:149
4446 msgid "To get the output as a compressed tarball, do:"
4450 #: ../examples/guestfs-recipes.pod:151
4453 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4458 #: ../examples/guestfs-recipes.pod:153
4460 "Although it sounds tempting, this is usually not a reliable way to get a "
4461 "backup from a running guest. See the entry in the FAQ: "
4462 "http://libguestfs.org/FAQ.html#backup"
4466 #: ../examples/guestfs-recipes.pod:157
4467 msgid "Find out which user is using the most space"
4471 #: ../examples/guestfs-recipes.pod:159
4473 "This simple script examines a Linux guest to find out which user is using "
4474 "the most space in their home directory:"
4478 #: ../examples/guestfs-recipes.pod:162
4486 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4494 #: ../examples/guestfs-recipes.pod:166
4503 #: ../examples/guestfs-recipes.pod:169
4506 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4511 #: ../examples/guestfs-recipes.pod:171
4514 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4515 " echo -n \"$dir/$d\"\n"
4517 " guestfish --remote du \"$dir/$d\";\n"
4518 " done | sort -nr -k 2\n"
4523 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4526 " guestfish --remote exit\n"
4531 #: ../examples/guestfs-recipes.pod:179
4532 msgid "Get DHCP address from a VM"
4536 #: ../examples/guestfs-recipes.pod:181
4538 "The link below explains the many different possible techniques for getting "
4539 "the last assigned DHCP address of a virtual machine."
4543 #: ../examples/guestfs-recipes.pod:184
4544 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4548 #: ../examples/guestfs-recipes.pod:186
4550 "In the libguestfs source examples directory you will find the latest version "
4551 "of the C<virt-dhcp-address.c> program."
4555 #: ../examples/guestfs-recipes.pod:189
4556 msgid "Get the operating system product name string"
4560 #: ../examples/guestfs-recipes.pod:191
4561 msgid "Save the following script into a file called C<product-name.sh>:"
4565 #: ../examples/guestfs-recipes.pod:193
4570 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4571 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4572 " guestfish --remote inspect-get-product-name \"$root\"\n"
4573 " guestfish --remote exit\n"
4578 #: ../examples/guestfs-recipes.pod:200
4579 msgid "Make the script executable and run it on a named guest:"
4583 #: ../examples/guestfs-recipes.pod:202
4586 " # product-name.sh RHEL60x64\n"
4587 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4592 #: ../examples/guestfs-recipes.pod:205
4594 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4595 "C<xpath> command line tool or from your favourite programming language:"
4599 #: ../examples/guestfs-recipes.pod:209
4602 " # virt-inspector RHEL60x64 > xml\n"
4603 " # xpath '//product_name' < xml\n"
4606 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4607 "(Santiago)</product_name>\n"
4612 #: ../examples/guestfs-recipes.pod:215
4613 msgid "Get the default boot kernel for a Linux VM"
4617 #: ../examples/guestfs-recipes.pod:217
4619 "The link below contains a program to print the default boot kernel for a "
4624 #: ../examples/guestfs-recipes.pod:220
4625 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4629 #: ../examples/guestfs-recipes.pod:222
4631 "It uses Augeas, and the technique is generally applicable for many different "
4636 #: ../examples/guestfs-recipes.pod:229
4637 msgid "listing the user accounts in the guest"
4641 #: ../examples/guestfs-recipes.pod:233
4642 msgid "what repositories is it configured to use"
4646 #: ../examples/guestfs-recipes.pod:237
4647 msgid "what NTP servers does it connect to"
4651 #: ../examples/guestfs-recipes.pod:241
4652 msgid "what were the boot messages last time it booted"
4656 #: ../examples/guestfs-recipes.pod:245
4657 msgid "listing who was logged in recently"
4661 #: ../examples/guestfs-recipes.pod:249
4662 msgid "http://augeas.net/"
4666 #: ../examples/guestfs-recipes.pod:251
4667 msgid "Install RPMs in a guest"
4671 #: ../examples/guestfs-recipes.pod:253
4673 "The link below contains a method to install RPMs in a guest. In fact the "
4674 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4675 "installs them next time the guest is booted. You could use this technique "
4676 "to install vital security updates in an offline guest."
4680 #: ../examples/guestfs-recipes.pod:259
4681 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4685 #: ../examples/guestfs-recipes.pod:261
4686 msgid "List applications installed in a VM"
4690 #: ../examples/guestfs-recipes.pod:263
4691 msgid "Save the following to a file C<list-apps.sh>:"
4695 #: ../examples/guestfs-recipes.pod:265
4700 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4701 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4702 " guestfish --remote inspect-list-applications \"$root\"\n"
4703 " guestfish --remote exit\n"
4708 #: ../examples/guestfs-recipes.pod:272
4710 "Make the file executable and then you can run it on any named virtual "
4715 #: ../examples/guestfs-recipes.pod:275
4718 " # list-apps.sh WinGuest\n"
4720 " app_name: Mozilla Firefox (3.6.12)\n"
4721 " app_display_name: Mozilla Firefox (3.6.12)\n"
4723 " app_version: 3.6.12 (en-GB)\n"
4725 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
4726 " app_trans_path:\n"
4727 " app_publisher: Mozilla\n"
4728 " app_url: http://www.mozilla.com/en-GB/\n"
4729 " app_source_package:\n"
4731 " app_description: Mozilla Firefox\n"
4734 " app_name: VLC media player\n"
4735 " app_display_name: VLC media player 1.1.5\n"
4737 " app_version: 1.1.5\n"
4739 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
4740 " app_trans_path:\n"
4741 " app_publisher: VideoLAN\n"
4742 " app_url: http://www.videolan.org/\n"
4743 " app_source_package:\n"
4745 " app_description:\n"
4751 #: ../examples/guestfs-recipes.pod:305
4753 "If you want to run the script on disk images (instead of libvirt virtual "
4754 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
4755 "L<virt-inspector(1)>."
4759 #: ../examples/guestfs-recipes.pod:309
4760 msgid "List files and directories in a VM"
4764 #: ../examples/guestfs-recipes.pod:311
4765 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
4769 #: ../examples/guestfs-recipes.pod:313
4772 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
4777 #: ../examples/guestfs-recipes.pod:315
4778 msgid "List services in a Windows VM"
4782 #: ../examples/guestfs-recipes.pod:317
4784 "The link below contains a script that can be used to list out the services "
4785 "from a Windows VM, and whether those services run at boot time or are loaded "
4790 #: ../examples/guestfs-recipes.pod:321
4791 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
4795 #: ../examples/guestfs-recipes.pod:323
4796 msgid "Make a disk image sparse"
4800 #: ../examples/guestfs-recipes.pod:325
4802 "The link below contains some guides for making a disk image sparse (or "
4803 "reintroducing sparseness)."
4807 #: ../examples/guestfs-recipes.pod:328
4808 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
4812 #: ../examples/guestfs-recipes.pod:330
4813 msgid "Monitor disk usage over time"
4817 #: ../examples/guestfs-recipes.pod:332
4819 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
4820 "The link below contains a guide."
4824 #: ../examples/guestfs-recipes.pod:335
4825 msgid "http://virt-tools.org/learning/advanced-virt-df/"
4829 #: ../examples/guestfs-recipes.pod:337
4830 msgid "Reading the Windows Event Log from Windows Vista (or later)"
4834 #: ../examples/guestfs-recipes.pod:339
4836 "L<guestfish(1)> plus the tools described in the link below can be used to "
4837 "read out the Windows Event Log from any virtual machine running Windows "
4838 "Vista or a later version."
4842 #: ../examples/guestfs-recipes.pod:343
4843 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
4847 #: ../examples/guestfs-recipes.pod:345
4848 msgid "Remove root password (Linux)"
4852 #: ../examples/guestfs-recipes.pod:347
4854 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
4855 "files. One use is to remove the root password from a Linux guest:"
4859 #: ../examples/guestfs-recipes.pod:350
4862 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
4867 #: ../examples/guestfs-recipes.pod:352
4868 msgid "Remove Administrator password (Windows)"
4872 #: ../examples/guestfs-recipes.pod:354
4874 "The link below contains one technique for removing the Administrator "
4875 "password from a Windows VM, or to be more precise, it gives you a command "
4876 "prompt the next time you log in which you can use to bypass any security:"
4880 #: ../examples/guestfs-recipes.pod:359
4881 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
4885 #: ../examples/guestfs-recipes.pod:361
4886 msgid "Unpack a live CD"
4890 #: ../examples/guestfs-recipes.pod:363
4892 "Linux live CDs often contain multiple layers of disk images wrapped like a "
4893 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
4894 "layers, as outlined in the guide below."
4898 #: ../examples/guestfs-recipes.pod:367
4899 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
4903 #: ../examples/guestfs-recipes.pod:369
4904 msgid "Uploading and downloading files"
4908 #: ../examples/guestfs-recipes.pod:371
4910 "The link below contains general tips on uploading (copying in) and "
4911 "downloading (copying out) files from VMs."
4915 #: ../examples/guestfs-recipes.pod:374
4916 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
4920 #: ../examples/guestfs-recipes.pod:376
4921 msgid "Use libguestfs tools on VMware ESX guests"
4925 #: ../examples/guestfs-recipes.pod:378
4927 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
4928 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
4932 #: ../examples/guestfs-recipes.pod:382
4933 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
4937 #: ../examples/guestfs-recipes.pod:386
4939 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
4940 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
4941 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
4942 "L<http://libguestfs.org/>."
4946 #: ../examples/guestfs-recipes.pod:403
4947 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
4951 #: ../fish/guestfish-actions.pod:1
4956 #: ../fish/guestfish-actions.pod:3
4959 " add-cdrom filename\n"
4964 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
4965 msgid "This function adds a virtual CD-ROM disk image to the guest."
4969 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
4970 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
4974 #: ../fish/guestfish-actions.pod:15
4976 "This call checks for the existence of C<filename>. This stops you from "
4977 "specifying other types of drive which are supported by qemu such as C<nbd:> "
4978 "and C<http:> URLs. To specify those, use the general L</config> call "
4983 #: ../fish/guestfish-actions.pod:22
4985 "If you just want to add an ISO file (often you use this as an efficient way "
4986 "to transfer large files into the guest), then you should probably use "
4987 "L</add-drive-ro> instead."
4991 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163 ../fish/guestfish-actions.pod:177
4993 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
4998 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:166 ../fish/guestfish-actions.pod:180 ../fish/guestfish-actions.pod:1026 ../fish/guestfish-actions.pod:1386 ../fish/guestfish-actions.pod:1400 ../fish/guestfish-actions.pod:3157 ../fish/guestfish-actions.pod:3468 ../fish/guestfish-actions.pod:3516 ../fish/guestfish-actions.pod:4429 ../fish/guestfish-actions.pod:4452 ../fish/guestfish-actions.pod:4474 ../fish/guestfish-actions.pod:4512 ../fish/guestfish-actions.pod:5161 ../fish/guestfish-actions.pod:5267 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:252 ../src/guestfs-actions.pod:273 ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:2118 ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:4771 ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5393 ../src/guestfs-actions.pod:6675 ../src/guestfs-actions.pod:6719 ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6816 ../src/guestfs-actions.pod:7748 ../src/guestfs-actions.pod:7857 ../src/guestfs-actions.pod:8040
5000 "Deprecated functions will not be removed from the API, but the fact that "
5001 "they are deprecated indicates that there are problems with correct use of "
5006 #: ../fish/guestfish-actions.pod:35
5011 #: ../fish/guestfish-actions.pod:37
5016 #: ../fish/guestfish-actions.pod:39
5019 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
5025 #: ../fish/guestfish-actions.pod:41
5027 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5028 "It works by connecting to libvirt, requesting the domain and domain XML from "
5029 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5033 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5035 "The number of disks added is returned. This operation is atomic: if an "
5036 "error is returned, then no disks are added."
5040 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5042 "This function does some minimal checks to make sure the libvirt domain is "
5043 "not running (unless C<readonly> is true). In a future version we will try "
5044 "to acquire the libvirt lock on each disk."
5048 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5050 "Disks must be accessible locally. This often means that adding disks from a "
5051 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5052 "unless those disks are accessible via the same device path locally too."
5056 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5058 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5059 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5060 "default libvirt URI (or one set through an environment variable, see the "
5061 "libvirt documentation for full details)."
5065 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5067 "The optional C<live> flag controls whether this call will try to connect to "
5068 "a running virtual machine C<guestfsd> process if it sees a suitable "
5069 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5070 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5071 "DAEMONS> for more information."
5075 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5077 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5078 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5079 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5084 #: ../fish/guestfish-actions.pod:76
5086 "The other optional parameters are passed directly through to "
5087 "L</add-drive-opts>."
5091 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:143 ../fish/guestfish-actions.pod:573 ../fish/guestfish-actions.pod:784 ../fish/guestfish-actions.pod:805 ../fish/guestfish-actions.pod:2040 ../fish/guestfish-actions.pod:3206 ../fish/guestfish-actions.pod:3369 ../fish/guestfish-actions.pod:3504
5093 "This command has one or more optional arguments. See L</OPTIONAL "
5098 #: ../fish/guestfish-actions.pod:81
5103 #: ../fish/guestfish-actions.pod:83
5106 " add-drive filename\n"
5111 #: ../fish/guestfish-actions.pod:85
5113 "This function is the equivalent of calling L</add-drive-opts> with no "
5114 "optional parameters, so the disk is added writable, with the format being "
5115 "detected automatically."
5119 #: ../fish/guestfish-actions.pod:89
5121 "Automatic detection of the format opens you up to a potential security hole "
5122 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5123 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5124 "you should think about replacing calls to this function with calls to "
5125 "L</add-drive-opts>, and specifying the format."
5129 #: ../fish/guestfish-actions.pod:96
5130 msgid "add-drive-opts"
5134 #: ../fish/guestfish-actions.pod:98
5139 #: ../fish/guestfish-actions.pod:100
5142 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
5147 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
5149 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5150 "The first time you call this function, the disk appears as C</dev/sda>, the "
5151 "second time as C</dev/sdb>, and so on."
5155 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
5157 "You don't necessarily need to be root when using libguestfs. However you "
5158 "obviously do need sufficient permissions to access the filename for whatever "
5159 "operations you want to perform (ie. read access if you just want to read the "
5160 "image or write access if you want to modify the image)."
5164 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
5165 msgid "This call checks that C<filename> exists."
5169 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3168 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4808
5170 msgid "The optional arguments are:"
5174 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
5179 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
5181 "If true then the image is treated as read-only. Writes are still allowed, "
5182 "but they are stored in a temporary snapshot overlay which is discarded at "
5183 "the end. The disk that you add is not modified."
5187 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
5192 #: ../fish/guestfish-actions.pod:127
5194 "This forces the image format. If you omit this (or use L</add-drive> or "
5195 "L</add-drive-ro>) then the format is automatically detected. Possible "
5196 "formats include C<raw> and C<qcow2>."
5200 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
5202 "Automatic detection of the format opens you up to a potential security hole "
5203 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5204 "RHBZ#642934. Specifying the format closes this security hole."
5208 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
5213 #: ../fish/guestfish-actions.pod:138
5215 "This rarely-used option lets you emulate the behaviour of the deprecated "
5216 "L</add-drive-with-if> call (q.v.)"
5220 #: ../fish/guestfish-actions.pod:145
5221 msgid "add-drive-ro"
5225 #: ../fish/guestfish-actions.pod:147
5230 #: ../fish/guestfish-actions.pod:149
5233 " add-drive-ro filename\n"
5238 #: ../fish/guestfish-actions.pod:151
5240 "This function is the equivalent of calling L</add-drive-opts> with the "
5241 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5242 "is added read-only, with the format being detected automatically."
5246 #: ../fish/guestfish-actions.pod:156
5247 msgid "add-drive-ro-with-if"
5251 #: ../fish/guestfish-actions.pod:158
5254 " add-drive-ro-with-if filename iface\n"
5259 #: ../fish/guestfish-actions.pod:160
5261 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5262 "interface emulation to use at run time."
5266 #: ../fish/guestfish-actions.pod:170
5267 msgid "add-drive-with-if"
5271 #: ../fish/guestfish-actions.pod:172
5274 " add-drive-with-if filename iface\n"
5279 #: ../fish/guestfish-actions.pod:174
5281 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5282 "interface emulation to use at run time."
5286 #: ../fish/guestfish-actions.pod:184
5291 #: ../fish/guestfish-actions.pod:186
5294 " aug-clear augpath\n"
5299 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
5301 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5302 "L<augtool(1)> C<clear> command."
5306 #: ../fish/guestfish-actions.pod:191
5311 #: ../fish/guestfish-actions.pod:193
5319 #: ../fish/guestfish-actions.pod:195
5321 "Close the current Augeas handle and free up any resources used by it. After "
5322 "calling this, you have to call L</aug-init> again before you can use any "
5323 "other Augeas functions."
5327 #: ../fish/guestfish-actions.pod:200
5332 #: ../fish/guestfish-actions.pod:202
5335 " aug-defnode name expr val\n"
5340 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
5341 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5345 #: ../fish/guestfish-actions.pod:207
5347 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5348 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5349 "containing that single node."
5353 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
5355 "On success this returns a pair containing the number of nodes in the "
5356 "nodeset, and a boolean flag if a node was created."
5360 #: ../fish/guestfish-actions.pod:215
5365 #: ../fish/guestfish-actions.pod:217
5368 " aug-defvar name expr\n"
5373 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
5375 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5376 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5380 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
5382 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5383 "evaluates to something which is not a nodeset."
5387 #: ../fish/guestfish-actions.pod:226
5392 #: ../fish/guestfish-actions.pod:228
5395 " aug-get augpath\n"
5400 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
5402 "Look up the value associated with C<path>. If C<path> matches exactly one "
5403 "node, the C<value> is returned."
5407 #: ../fish/guestfish-actions.pod:233
5412 #: ../fish/guestfish-actions.pod:235
5415 " aug-init root flags\n"
5420 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
5422 "Create a new Augeas handle for editing configuration files. If there was "
5423 "any previous Augeas handle associated with this guestfs session, then it is "
5428 #: ../fish/guestfish-actions.pod:241
5429 msgid "You must call this before using any other L</aug-*> commands."
5433 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
5434 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5438 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
5440 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5441 "logical I<or> of the following integers:"
5445 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
5446 msgid "C<AUG_SAVE_BACKUP> = 1"
5450 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
5451 msgid "Keep the original file with a C<.augsave> extension."
5455 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
5456 msgid "C<AUG_SAVE_NEWFILE> = 2"
5460 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
5462 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5463 "original. Overrides C<AUG_SAVE_BACKUP>."
5467 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
5468 msgid "C<AUG_TYPE_CHECK> = 4"
5472 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
5473 msgid "Typecheck lenses."
5477 #: ../fish/guestfish-actions.pod:266
5479 "This option is only useful when debugging Augeas lenses. Use of this option "
5480 "may require additional memory for the libguestfs appliance. You may need to "
5481 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5485 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
5486 msgid "C<AUG_NO_STDINC> = 8"
5490 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
5491 msgid "Do not use standard load path for modules."
5495 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
5496 msgid "C<AUG_SAVE_NOOP> = 16"
5500 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
5501 msgid "Make save a no-op, just record what would have been changed."
5505 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
5506 msgid "C<AUG_NO_LOAD> = 32"
5510 #: ../fish/guestfish-actions.pod:281
5511 msgid "Do not load the tree in L</aug-init>."
5515 #: ../fish/guestfish-actions.pod:285
5516 msgid "To close the handle, you can call L</aug-close>."
5520 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
5521 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5525 #: ../fish/guestfish-actions.pod:289
5530 #: ../fish/guestfish-actions.pod:291
5533 " aug-insert augpath label true|false\n"
5538 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
5540 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5541 "or after C<path> (depending on the boolean flag C<before>)."
5545 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
5547 "C<path> must match exactly one existing node in the tree, and C<label> must "
5548 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5552 #: ../fish/guestfish-actions.pod:301
5557 #: ../fish/guestfish-actions.pod:303
5565 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
5566 msgid "Load files into the tree."
5570 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
5571 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5575 #: ../fish/guestfish-actions.pod:310
5580 #: ../fish/guestfish-actions.pod:312
5588 #: ../fish/guestfish-actions.pod:314
5590 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5591 "resulting nodes into alphabetical order."
5595 #: ../fish/guestfish-actions.pod:317
5600 #: ../fish/guestfish-actions.pod:319
5603 " aug-match augpath\n"
5608 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
5610 "Returns a list of paths which match the path expression C<path>. The "
5611 "returned paths are sufficiently qualified so that they match exactly one "
5612 "node in the current tree."
5616 #: ../fish/guestfish-actions.pod:325
5621 #: ../fish/guestfish-actions.pod:327
5624 " aug-mv src dest\n"
5629 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
5631 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5632 "C<dest> is overwritten if it exists."
5636 #: ../fish/guestfish-actions.pod:332
5641 #: ../fish/guestfish-actions.pod:334
5649 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
5650 msgid "Remove C<path> and all of its children."
5654 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
5655 msgid "On success this returns the number of entries which were removed."
5659 #: ../fish/guestfish-actions.pod:340
5664 #: ../fish/guestfish-actions.pod:342
5672 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
5673 msgid "This writes all pending changes to disk."
5677 #: ../fish/guestfish-actions.pod:346
5679 "The flags which were passed to L</aug-init> affect exactly how files are "
5684 #: ../fish/guestfish-actions.pod:349
5689 #: ../fish/guestfish-actions.pod:351
5692 " aug-set augpath val\n"
5697 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
5698 msgid "Set the value associated with C<path> to C<val>."
5702 #: ../fish/guestfish-actions.pod:355
5704 "In the Augeas API, it is possible to clear a node by setting the value to "
5705 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5706 "this call. Instead you must use the L</aug-clear> call."
5710 #: ../fish/guestfish-actions.pod:360
5715 #: ../fish/guestfish-actions.pod:362
5718 " available 'groups ...'\n"
5723 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
5725 "This command is used to check the availability of some groups of "
5726 "functionality in the appliance, which not all builds of the libguestfs "
5727 "appliance will be able to provide."
5731 #: ../fish/guestfish-actions.pod:368
5733 "The libguestfs groups, and the functions that those groups correspond to, "
5734 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5735 "runtime by calling L</available-all-groups>."
5739 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
5741 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
5742 "\"augeas\"]> would check for the availability of the Linux inotify functions "
5743 "and Augeas (configuration file editing) functions."
5747 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
5748 msgid "The command returns no error if I<all> requested groups are available."
5752 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
5754 "It fails with an error if one or more of the requested groups is unavailable "
5759 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
5761 "If an unknown group name is included in the list of groups then an error is "
5766 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
5771 #: ../fish/guestfish-actions.pod:392
5772 msgid "You must call L</launch> before calling this function."
5776 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
5778 "The reason is because we don't know what groups are supported by the "
5779 "appliance/daemon until it is running and can be queried."
5783 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
5785 "If a group of functions is available, this does not necessarily mean that "
5786 "they will work. You still have to check for errors when calling individual "
5787 "API functions even if they are available."
5791 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
5793 "It is usually the job of distro packagers to build complete functionality "
5794 "into the libguestfs appliance. Upstream libguestfs, if built from source "
5795 "with all requirements satisfied, will support everything."
5799 #: ../fish/guestfish-actions.pod:414
5801 "This call was added in version C<1.0.80>. In previous versions of "
5802 "libguestfs all you could do would be to speculatively execute a command to "
5803 "find out if the daemon implemented it. See also L</version>."
5807 #: ../fish/guestfish-actions.pod:421
5808 msgid "available-all-groups"
5812 #: ../fish/guestfish-actions.pod:423
5815 " available-all-groups\n"
5820 #: ../fish/guestfish-actions.pod:425
5822 "This command returns a list of all optional groups that this daemon knows "
5823 "about. Note this returns both supported and unsupported groups. To find "
5824 "out which ones the daemon can actually support you have to call "
5825 "L</available> on each member of the returned list."
5829 #: ../fish/guestfish-actions.pod:431
5830 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
5834 #: ../fish/guestfish-actions.pod:433
5839 #: ../fish/guestfish-actions.pod:435
5842 " base64-in (base64file|-) filename\n"
5847 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
5848 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
5852 #: ../fish/guestfish-actions.pod:440 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:698 ../fish/guestfish-actions.pod:782 ../fish/guestfish-actions.pod:803 ../fish/guestfish-actions.pod:902 ../fish/guestfish-actions.pod:921 ../fish/guestfish-actions.pod:1295 ../fish/guestfish-actions.pod:4732 ../fish/guestfish-actions.pod:4744 ../fish/guestfish-actions.pod:4755 ../fish/guestfish-actions.pod:4766 ../fish/guestfish-actions.pod:4818 ../fish/guestfish-actions.pod:4827 ../fish/guestfish-actions.pod:4881 ../fish/guestfish-actions.pod:4904
5853 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
5857 #: ../fish/guestfish-actions.pod:442
5862 #: ../fish/guestfish-actions.pod:444
5865 " base64-out filename (base64file|-)\n"
5870 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
5872 "This command downloads the contents of C<filename>, writing it out to local "
5873 "file C<base64file> encoded as base64."
5877 #: ../fish/guestfish-actions.pod:451
5878 msgid "blockdev-flushbufs"
5882 #: ../fish/guestfish-actions.pod:453
5885 " blockdev-flushbufs device\n"
5890 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
5891 msgid "This tells the kernel to flush internal buffers associated with C<device>."
5895 #: ../fish/guestfish-actions.pod:458 ../fish/guestfish-actions.pod:469 ../fish/guestfish-actions.pod:478 ../fish/guestfish-actions.pod:488 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:513 ../fish/guestfish-actions.pod:521 ../fish/guestfish-actions.pod:532 ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:548 ../src/guestfs-actions.pod:679 ../src/guestfs-actions.pod:696 ../src/guestfs-actions.pod:711 ../src/guestfs-actions.pod:727 ../src/guestfs-actions.pod:745 ../src/guestfs-actions.pod:764 ../src/guestfs-actions.pod:778 ../src/guestfs-actions.pod:796 ../src/guestfs-actions.pod:810 ../src/guestfs-actions.pod:824
5896 msgid "This uses the L<blockdev(8)> command."
5900 #: ../fish/guestfish-actions.pod:460
5901 msgid "blockdev-getbsz"
5905 #: ../fish/guestfish-actions.pod:462
5908 " blockdev-getbsz device\n"
5913 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
5914 msgid "This returns the block size of a device."
5918 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
5920 "(Note this is different from both I<size in blocks> and I<filesystem block "
5925 #: ../fish/guestfish-actions.pod:471
5926 msgid "blockdev-getro"
5930 #: ../fish/guestfish-actions.pod:473
5933 " blockdev-getro device\n"
5938 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
5940 "Returns a boolean indicating if the block device is read-only (true if "
5941 "read-only, false if not)."
5945 #: ../fish/guestfish-actions.pod:480
5946 msgid "blockdev-getsize64"
5950 #: ../fish/guestfish-actions.pod:482
5953 " blockdev-getsize64 device\n"
5958 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
5959 msgid "This returns the size of the device in bytes."
5963 #: ../fish/guestfish-actions.pod:486
5964 msgid "See also L</blockdev-getsz>."
5968 #: ../fish/guestfish-actions.pod:490
5969 msgid "blockdev-getss"
5973 #: ../fish/guestfish-actions.pod:492
5976 " blockdev-getss device\n"
5981 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
5983 "This returns the size of sectors on a block device. Usually 512, but can be "
5984 "larger for modern devices."
5988 #: ../fish/guestfish-actions.pod:497
5989 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
5993 #: ../fish/guestfish-actions.pod:502
5994 msgid "blockdev-getsz"
5998 #: ../fish/guestfish-actions.pod:504
6001 " blockdev-getsz device\n"
6006 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
6008 "This returns the size of the device in units of 512-byte sectors (even if "
6009 "the sectorsize isn't 512 bytes ... weird)."
6013 #: ../fish/guestfish-actions.pod:509
6015 "See also L</blockdev-getss> for the real sector size of the device, and "
6016 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6020 #: ../fish/guestfish-actions.pod:515
6021 msgid "blockdev-rereadpt"
6025 #: ../fish/guestfish-actions.pod:517
6028 " blockdev-rereadpt device\n"
6033 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
6034 msgid "Reread the partition table on C<device>."
6038 #: ../fish/guestfish-actions.pod:523
6039 msgid "blockdev-setbsz"
6043 #: ../fish/guestfish-actions.pod:525
6046 " blockdev-setbsz device blocksize\n"
6051 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
6052 msgid "This sets the block size of a device."
6056 #: ../fish/guestfish-actions.pod:534
6057 msgid "blockdev-setro"
6061 #: ../fish/guestfish-actions.pod:536
6064 " blockdev-setro device\n"
6069 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
6070 msgid "Sets the block device named C<device> to read-only."
6074 #: ../fish/guestfish-actions.pod:542
6075 msgid "blockdev-setrw"
6079 #: ../fish/guestfish-actions.pod:544
6082 " blockdev-setrw device\n"
6087 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
6088 msgid "Sets the block device named C<device> to read-write."
6092 #: ../fish/guestfish-actions.pod:550
6093 msgid "btrfs-filesystem-resize"
6097 #: ../fish/guestfish-actions.pod:552
6100 " btrfs-filesystem-resize mountpoint [size:..]\n"
6105 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
6106 msgid "This command resizes a btrfs filesystem."
6110 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
6112 "Note that unlike other resize calls, the filesystem has to be mounted and "
6113 "the parameter is the mountpoint not the device (this is a requirement of "
6118 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3479 ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5332
6119 msgid "The optional parameters are:"
6123 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3483 ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5336
6128 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
6130 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6131 "resized to the maximum size."
6135 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
6136 msgid "See also L<btrfs(8)>."
6140 #: ../fish/guestfish-actions.pod:575
6141 msgid "case-sensitive-path"
6145 #: ../fish/guestfish-actions.pod:577
6148 " case-sensitive-path path\n"
6153 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
6155 "This can be used to resolve case insensitive paths on a filesystem which is "
6156 "case sensitive. The use case is to resolve paths which you have read from "
6157 "Windows configuration files or the Windows Registry, to the true path."
6161 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
6163 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6164 "(and probably others), which is that although the underlying filesystem is "
6165 "case-insensitive, the driver exports the filesystem to Linux as "
6170 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
6172 "One consequence of this is that special directories such as C<c:\\windows> "
6173 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6174 "precise details of how they were created. In Windows itself this would not "
6179 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
6181 "Bug or feature? You decide: "
6182 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6186 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
6188 "This function resolves the true case of each element in the path and returns "
6189 "the case-sensitive path."
6193 #: ../fish/guestfish-actions.pod:601
6195 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6196 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6197 "how the directories were originally created under Windows)."
6201 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
6202 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6206 #: ../fish/guestfish-actions.pod:609
6207 msgid "See also L</realpath>."
6211 #: ../fish/guestfish-actions.pod:611
6216 #: ../fish/guestfish-actions.pod:613
6224 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5975
6225 msgid "Return the contents of the file named C<path>."
6229 #: ../fish/guestfish-actions.pod:617
6231 "Note that this function cannot correctly handle binary files (specifically, "
6232 "files containing C<\\0> character which is treated as end of string). For "
6233 "those you need to use the L</read-file> or L</download> functions which have "
6234 "a more complex interface."
6238 #: ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:757 ../fish/guestfish-actions.pod:769 ../fish/guestfish-actions.pod:980 ../fish/guestfish-actions.pod:990 ../fish/guestfish-actions.pod:1057 ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1259 ../fish/guestfish-actions.pod:1572 ../fish/guestfish-actions.pod:1582 ../fish/guestfish-actions.pod:1632 ../fish/guestfish-actions.pod:1647 ../fish/guestfish-actions.pod:1657 ../fish/guestfish-actions.pod:1676 ../fish/guestfish-actions.pod:3769 ../fish/guestfish-actions.pod:3784 ../fish/guestfish-actions.pod:3860 ../fish/guestfish-actions.pod:3877 ../fish/guestfish-actions.pod:3892 ../fish/guestfish-actions.pod:4573 ../fish/guestfish-actions.pod:4619 ../fish/guestfish-actions.pod:4704 ../fish/guestfish-actions.pod:4719 ../fish/guestfish-actions.pod:5125 ../fish/guestfish-actions.pod:5137 ../fish/guestfish-actions.pod:5155 ../fish/guestfish-actions.pod:5172 ../fish/guestfish-actions.pod:5182 ../fish/guestfish-actions.pod:5239 ../fish/guestfish-actions.pod:5249 ../fish/guestfish-actions.pod:5278 ../fish/guestfish-actions.pod:5288 ../src/guestfs-actions.pod:948 ../src/guestfs-actions.pod:1127 ../src/guestfs-actions.pod:1147 ../src/guestfs-actions.pod:1554 ../src/guestfs-actions.pod:1573 ../src/guestfs-actions.pod:1676 ../src/guestfs-actions.pod:1695 ../src/guestfs-actions.pod:1941 ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2442 ../src/guestfs-actions.pod:2507 ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:2577 ../src/guestfs-actions.pod:5757 ../src/guestfs-actions.pod:5783 ../src/guestfs-actions.pod:5914 ../src/guestfs-actions.pod:5940 ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:6931 ../src/guestfs-actions.pod:6986 ../src/guestfs-actions.pod:7132 ../src/guestfs-actions.pod:7156 ../src/guestfs-actions.pod:7821 ../src/guestfs-actions.pod:7841 ../src/guestfs-actions.pod:7874 ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7912 ../src/guestfs-actions.pod:8006 ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8071 ../src/guestfs-actions.pod:8090
6240 "Because of the message protocol, there is a transfer limit of somewhere "
6241 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6245 #: ../fish/guestfish-actions.pod:625
6250 #: ../fish/guestfish-actions.pod:627
6253 " checksum csumtype path\n"
6258 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
6259 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6263 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
6265 "The type of checksum to compute is given by the C<csumtype> parameter which "
6266 "must have one of the following values:"
6270 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
6275 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
6277 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6282 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
6287 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
6288 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6292 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
6297 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
6298 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6302 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
6307 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
6308 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6312 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
6317 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
6318 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6322 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
6327 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
6328 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6332 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
6337 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
6338 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6342 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
6343 msgid "The checksum is returned as a printable string."
6347 #: ../fish/guestfish-actions.pod:670
6348 msgid "To get the checksum for a device, use L</checksum-device>."
6352 #: ../fish/guestfish-actions.pod:672
6353 msgid "To get the checksums for many files, use L</checksums-out>."
6357 #: ../fish/guestfish-actions.pod:674
6358 msgid "checksum-device"
6362 #: ../fish/guestfish-actions.pod:676
6365 " checksum-device csumtype device\n"
6370 #: ../fish/guestfish-actions.pod:678
6372 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6373 "device named C<device>. For the types of checksums supported see the "
6374 "L</checksum> command."
6378 #: ../fish/guestfish-actions.pod:682
6379 msgid "checksums-out"
6383 #: ../fish/guestfish-actions.pod:684
6386 " checksums-out csumtype directory (sumsfile|-)\n"
6391 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
6393 "This command computes the checksums of all regular files in C<directory> and "
6394 "then emits a list of those checksums to the local output file C<sumsfile>."
6398 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
6400 "This can be used for verifying the integrity of a virtual machine. However "
6401 "to be properly secure you should pay attention to the output of the checksum "
6402 "command (it uses the ones from GNU coreutils). In particular when the "
6403 "filename is not printable, coreutils uses a special backslash syntax. For "
6404 "more information, see the GNU coreutils info file."
6408 #: ../fish/guestfish-actions.pod:700
6413 #: ../fish/guestfish-actions.pod:702
6416 " chmod mode path\n"
6421 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
6423 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6428 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
6430 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6431 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6436 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3132 ../fish/guestfish-actions.pod:3271 ../fish/guestfish-actions.pod:3281 ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:1064 ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4948 ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4986
6437 msgid "The mode actually set is affected by the umask."
6441 #: ../fish/guestfish-actions.pod:713
6446 #: ../fish/guestfish-actions.pod:715
6449 " chown owner group path\n"
6454 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
6455 msgid "Change the file owner to C<owner> and group to C<group>."
6459 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3810
6461 "Only numeric uid and gid are supported. If you want to use names, you will "
6462 "need to locate and parse the password file yourself (Augeas support makes "
6463 "this relatively easy)."
6467 #: ../fish/guestfish-actions.pod:723
6472 #: ../fish/guestfish-actions.pod:725
6475 " command 'arguments ...'\n"
6480 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
6482 "This call runs a command from the guest filesystem. The filesystem must be "
6483 "mounted, and must contain a compatible operating system (ie. something "
6484 "Linux, with the same or compatible processor architecture)."
6488 #: ../fish/guestfish-actions.pod:732
6490 "The single parameter is an argv-style list of arguments. The first element "
6491 "is the name of the program to run. Subsequent elements are parameters. The "
6492 "list must be non-empty (ie. must contain a program name). Note that the "
6493 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6497 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
6498 msgid "The return value is anything printed to I<stdout> by the command."
6502 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
6504 "If the command returns a non-zero exit status, then this function returns an "
6505 "error message. The error message string is the content of I<stderr> from "
6510 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
6512 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6513 "C</bin>. If you require a program from another location, you should provide "
6514 "the full path in the first parameter."
6518 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
6520 "Shared libraries and data files required by the program must be available on "
6521 "filesystems which are mounted in the correct places. It is the caller's "
6522 "responsibility to ensure all filesystems that are needed are mounted at the "
6527 #: ../fish/guestfish-actions.pod:760
6528 msgid "command-lines"
6532 #: ../fish/guestfish-actions.pod:762
6535 " command-lines 'arguments ...'\n"
6540 #: ../fish/guestfish-actions.pod:764
6541 msgid "This is the same as L</command>, but splits the result into a list of lines."
6545 #: ../fish/guestfish-actions.pod:767
6546 msgid "See also: L</sh-lines>"
6550 #: ../fish/guestfish-actions.pod:772
6551 msgid "compress-device-out"
6555 #: ../fish/guestfish-actions.pod:774
6558 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6563 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1168
6565 "This command compresses C<device> and writes it out to the local file "
6570 #: ../fish/guestfish-actions.pod:779
6572 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6577 #: ../fish/guestfish-actions.pod:786
6578 msgid "compress-out"
6582 #: ../fish/guestfish-actions.pod:788
6585 " compress-out ctype file (zfile|-) [level:..]\n"
6590 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1220
6592 "This command compresses C<file> and writes it out to the local file "
6597 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1223
6599 "The compression program used is controlled by the C<ctype> parameter. "
6600 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6601 "Some compression types may not be supported by particular builds of "
6602 "libguestfs, in which case you will get an error containing the substring "
6603 "\"not supported\"."
6607 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1229
6609 "The optional C<level> parameter controls compression level. The meaning and "
6610 "default for this parameter depends on the compression program being used."
6614 #: ../fish/guestfish-actions.pod:807
6619 #: ../fish/guestfish-actions.pod:809
6622 " config qemuparam qemuvalue\n"
6627 #: ../fish/guestfish-actions.pod:811 ../src/guestfs-actions.pod:1270
6629 "This can be used to add arbitrary qemu command line parameters of the form "
6630 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6631 "setting some parameters which would interfere with parameters that we use."
6635 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1275
6636 msgid "The first character of C<param> string must be a C<-> (dash)."
6640 #: ../fish/guestfish-actions.pod:818 ../src/guestfs-actions.pod:1277
6641 msgid "C<value> can be NULL."
6645 #: ../fish/guestfish-actions.pod:820
6650 #: ../fish/guestfish-actions.pod:822
6653 " copy-size src dest size\n"
6658 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1291
6660 "This command copies exactly C<size> bytes from one source device or file "
6661 "C<src> to another destination device or file C<dest>."
6665 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1294
6667 "Note this will fail if the source is too short or if the destination is not "
6672 #: ../fish/guestfish-actions.pod:830
6677 #: ../fish/guestfish-actions.pod:832
6685 #: ../fish/guestfish-actions.pod:834 ../src/guestfs-actions.pod:1313
6687 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6688 "destination filename or destination directory."
6692 #: ../fish/guestfish-actions.pod:837
6697 #: ../fish/guestfish-actions.pod:839
6705 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1327
6707 "This copies a file or directory from C<src> to C<dest> recursively using the "
6712 #: ../fish/guestfish-actions.pod:844
6717 #: ../fish/guestfish-actions.pod:846
6725 #: ../fish/guestfish-actions.pod:848 ../src/guestfs-actions.pod:1341
6727 "This command copies from one source device or file C<src> to another "
6728 "destination device or file C<dest>. Normally you would use this to copy to "
6729 "or from a device or partition, for example to duplicate a filesystem."
6733 #: ../fish/guestfish-actions.pod:853
6735 "If the destination is a device, it must be as large or larger than the "
6736 "source file or device, otherwise the copy will fail. This command cannot do "
6737 "partial copies (see L</copy-size>)."
6741 #: ../fish/guestfish-actions.pod:857
6746 #: ../fish/guestfish-actions.pod:859
6754 #: ../fish/guestfish-actions.pod:861 ../src/guestfs-actions.pod:1359
6755 msgid "This command runs the C<df> command to report disk space used."
6759 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:874
6761 "This command is mostly useful for interactive sessions. It is I<not> "
6762 "intended that you try to parse the output string. Use L</statvfs> from "
6767 #: ../fish/guestfish-actions.pod:867
6772 #: ../fish/guestfish-actions.pod:869
6780 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1375
6782 "This command runs the C<df -h> command to report disk space used in "
6783 "human-readable format."
6787 #: ../fish/guestfish-actions.pod:878
6792 #: ../fish/guestfish-actions.pod:880
6800 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1392
6802 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
6803 "This is sometimes useful for extended debugging of problems."
6807 #: ../fish/guestfish-actions.pod:886
6809 "Another way to get the same information is to enable verbose messages with "
6810 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
6811 "before running the program."
6815 #: ../fish/guestfish-actions.pod:891
6820 #: ../fish/guestfish-actions.pod:893
6823 " download remotefilename (filename|-)\n"
6828 #: ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:908 ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1438
6830 "Download file C<remotefilename> and save it as C<filename> on the local "
6835 #: ../fish/guestfish-actions.pod:898 ../fish/guestfish-actions.pod:4877 ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:7391
6836 msgid "C<filename> can also be a named pipe."
6840 #: ../fish/guestfish-actions.pod:900
6841 msgid "See also L</upload>, L</cat>."
6845 #: ../fish/guestfish-actions.pod:904
6846 msgid "download-offset"
6850 #: ../fish/guestfish-actions.pod:906
6853 " download-offset remotefilename (filename|-) offset size\n"
6858 #: ../fish/guestfish-actions.pod:911 ../src/guestfs-actions.pod:1441
6860 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
6861 "region must be within the file or device)."
6865 #: ../fish/guestfish-actions.pod:914
6867 "Note that there is no limit on the amount of data that can be downloaded "
6868 "with this call, unlike with L</pread>, and this call always reads the full "
6869 "amount unless an error occurs."
6873 #: ../fish/guestfish-actions.pod:919
6874 msgid "See also L</download>, L</pread>."
6878 #: ../fish/guestfish-actions.pod:923
6883 #: ../fish/guestfish-actions.pod:925
6886 " drop-caches whattodrop\n"
6891 #: ../fish/guestfish-actions.pod:927 ../src/guestfs-actions.pod:1466
6893 "This instructs the guest kernel to drop its page cache, and/or dentries and "
6894 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
6895 "to drop, see L<http://linux-mm.org/Drop_Caches>"
6899 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1471
6900 msgid "Setting C<whattodrop> to 3 should drop everything."
6904 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1473
6906 "This automatically calls L<sync(2)> before the operation, so that the "
6907 "maximum guest memory is freed."
6911 #: ../fish/guestfish-actions.pod:937
6916 #: ../fish/guestfish-actions.pod:939
6924 #: ../fish/guestfish-actions.pod:941 ../src/guestfs-actions.pod:1486
6926 "This command runs the C<du -s> command to estimate file space usage for "
6931 #: ../fish/guestfish-actions.pod:944 ../src/guestfs-actions.pod:1489
6933 "C<path> can be a file or a directory. If C<path> is a directory then the "
6934 "estimate includes the contents of the directory and all subdirectories "
6939 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1493
6940 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
6944 #: ../fish/guestfish-actions.pod:951
6949 #: ../fish/guestfish-actions.pod:953
6952 " e2fsck-f device\n"
6957 #: ../fish/guestfish-actions.pod:955 ../src/guestfs-actions.pod:1511
6959 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
6960 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
6965 #: ../fish/guestfish-actions.pod:959
6967 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
6968 "should use L</fsck>."
6972 #: ../fish/guestfish-actions.pod:962
6977 #: ../fish/guestfish-actions.pod:964
6980 " echo-daemon 'words ...'\n"
6985 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1528
6987 "This command concatenates the list of C<words> passed with single spaces "
6988 "between them and returns the resulting string."
6992 #: ../fish/guestfish-actions.pod:969 ../src/guestfs-actions.pod:1531
6993 msgid "You can use this command to test the connection through to the daemon."
6997 #: ../fish/guestfish-actions.pod:971
6998 msgid "See also L</ping-daemon>."
7002 #: ../fish/guestfish-actions.pod:973
7007 #: ../fish/guestfish-actions.pod:975
7010 " egrep regex path\n"
7015 #: ../fish/guestfish-actions.pod:977 ../src/guestfs-actions.pod:1547
7016 msgid "This calls the external C<egrep> program and returns the matching lines."
7020 #: ../fish/guestfish-actions.pod:983
7025 #: ../fish/guestfish-actions.pod:985
7028 " egrepi regex path\n"
7033 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1566
7034 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7038 #: ../fish/guestfish-actions.pod:993
7043 #: ../fish/guestfish-actions.pod:995
7046 " equal file1 file2\n"
7051 #: ../fish/guestfish-actions.pod:997 ../src/guestfs-actions.pod:1585
7053 "This compares the two files C<file1> and C<file2> and returns true if their "
7054 "content is exactly equal, or false otherwise."
7058 #: ../fish/guestfish-actions.pod:1000 ../src/guestfs-actions.pod:1588
7059 msgid "The external L<cmp(1)> program is used for the comparison."
7063 #: ../fish/guestfish-actions.pod:1002
7068 #: ../fish/guestfish-actions.pod:1004
7076 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1600
7078 "This returns C<true> if and only if there is a file, directory (or anything) "
7079 "with the given C<path> name."
7083 #: ../fish/guestfish-actions.pod:1009
7084 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7088 #: ../fish/guestfish-actions.pod:1011
7093 #: ../fish/guestfish-actions.pod:1013
7096 " fallocate path len\n"
7101 #: ../fish/guestfish-actions.pod:1015 ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1642
7103 "This command preallocates a file (containing zero bytes) named C<path> of "
7104 "size C<len> bytes. If the file exists already, it is overwritten."
7108 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1627
7110 "Do not confuse this with the guestfish-specific C<alloc> command which "
7111 "allocates a file in the host and attaches it as a device."
7115 #: ../fish/guestfish-actions.pod:1023
7117 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7122 #: ../fish/guestfish-actions.pod:1030
7127 #: ../fish/guestfish-actions.pod:1032
7130 " fallocate64 path len\n"
7135 #: ../fish/guestfish-actions.pod:1038
7137 "Note that this call allocates disk blocks for the file. To create a sparse "
7138 "file use L</truncate-size> instead."
7142 #: ../fish/guestfish-actions.pod:1041
7144 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7145 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7146 "maximum size of files created through that call to 1GB."
7150 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1654
7152 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7153 "commands which create a file in the host and attach it as a device."
7157 #: ../fish/guestfish-actions.pod:1050
7162 #: ../fish/guestfish-actions.pod:1052
7165 " fgrep pattern path\n"
7170 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1669
7171 msgid "This calls the external C<fgrep> program and returns the matching lines."
7175 #: ../fish/guestfish-actions.pod:1060
7180 #: ../fish/guestfish-actions.pod:1062
7183 " fgrepi pattern path\n"
7188 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1688
7189 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7193 #: ../fish/guestfish-actions.pod:1070
7198 #: ../fish/guestfish-actions.pod:1072
7206 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1706
7208 "This call uses the standard L<file(1)> command to determine the type or "
7209 "contents of the file."
7213 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1709
7215 "This call will also transparently look inside various types of compressed "
7220 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1712
7222 "The exact command which runs is C<file -zb path>. Note in particular that "
7223 "the filename is not prepended to the output (the I<-b> option)."
7227 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1716
7229 "The output depends on the output of the underlying L<file(1)> command and it "
7230 "can change in future in ways beyond our control. In other words, the output "
7231 "is not guaranteed by the ABI."
7235 #: ../fish/guestfish-actions.pod:1088
7237 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7238 "(etc), L</is-zero>."
7242 #: ../fish/guestfish-actions.pod:1091
7243 msgid "file-architecture"
7247 #: ../fish/guestfish-actions.pod:1093
7250 " file-architecture filename\n"
7255 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1734
7257 "This detects the architecture of the binary C<filename>, and returns it if "
7262 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1737
7263 msgid "Currently defined architectures are:"
7267 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1741
7272 #: ../fish/guestfish-actions.pod:1104 ../src/guestfs-actions.pod:1743
7274 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7275 "irrespective of the precise processor requirements of the binary."
7279 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1746
7284 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1748
7285 msgid "64 bit x86-64."
7289 #: ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1750
7294 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1752
7295 msgid "32 bit SPARC."
7299 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1754
7304 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1756
7305 msgid "64 bit SPARC V9 and above."
7309 #: ../fish/guestfish-actions.pod:1119 ../src/guestfs-actions.pod:1758
7314 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1760
7315 msgid "Intel Itanium."
7319 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1762
7324 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1764
7325 msgid "32 bit Power PC."
7329 #: ../fish/guestfish-actions.pod:1127 ../src/guestfs-actions.pod:1766
7334 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1768
7335 msgid "64 bit Power PC."
7339 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1772
7340 msgid "Libguestfs may return other architecture strings in future."
7344 #: ../fish/guestfish-actions.pod:1135 ../src/guestfs-actions.pod:1774
7345 msgid "The function works on at least the following types of files:"
7349 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1780
7350 msgid "many types of Un*x and Linux binary"
7354 #: ../fish/guestfish-actions.pod:1145 ../src/guestfs-actions.pod:1784
7355 msgid "many types of Un*x and Linux shared library"
7359 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1788
7360 msgid "Windows Win32 and Win64 binaries"
7364 #: ../fish/guestfish-actions.pod:1153 ../src/guestfs-actions.pod:1792
7365 msgid "Windows Win32 and Win64 DLLs"
7369 #: ../fish/guestfish-actions.pod:1155 ../src/guestfs-actions.pod:1794
7370 msgid "Win32 binaries and DLLs return C<i386>."
7374 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1796
7375 msgid "Win64 binaries and DLLs return C<x86_64>."
7379 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1800
7380 msgid "Linux kernel modules"
7384 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1804
7385 msgid "Linux new-style initrd images"
7389 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1808
7390 msgid "some non-x86 Linux vmlinuz kernels"
7394 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1812
7395 msgid "What it can't do currently:"
7399 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1818
7400 msgid "static libraries (libfoo.a)"
7404 #: ../fish/guestfish-actions.pod:1183 ../src/guestfs-actions.pod:1822
7405 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7409 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1826
7410 msgid "x86 Linux vmlinuz kernels"
7414 #: ../fish/guestfish-actions.pod:1189 ../src/guestfs-actions.pod:1828
7416 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7417 "compressed code, and are horribly hard to unpack. If you want to find the "
7418 "architecture of a kernel, use the architecture of the associated initrd or "
7419 "kernel module(s) instead."
7423 #: ../fish/guestfish-actions.pod:1196
7428 #: ../fish/guestfish-actions.pod:1198
7436 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1846
7437 msgid "This command returns the size of C<file> in bytes."
7441 #: ../fish/guestfish-actions.pod:1202
7443 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7444 "L</is-file> etc. To get the size of block devices, use "
7445 "L</blockdev-getsize64>."
7449 #: ../fish/guestfish-actions.pod:1206
7454 #: ../fish/guestfish-actions.pod:1208
7457 " fill c len path\n"
7462 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:1864
7464 "This command creates a new file called C<path>. The initial content of the "
7465 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7470 #: ../fish/guestfish-actions.pod:1214
7472 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7473 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7478 #: ../fish/guestfish-actions.pod:1219
7479 msgid "fill-pattern"
7483 #: ../fish/guestfish-actions.pod:1221
7486 " fill-pattern pattern len path\n"
7491 #: ../fish/guestfish-actions.pod:1223
7493 "This function is like L</fill> except that it creates a new file of length "
7494 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7495 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7500 #: ../fish/guestfish-actions.pod:1228
7505 #: ../fish/guestfish-actions.pod:1230
7513 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:1910
7515 "This command lists out all files and directories, recursively, starting at "
7516 "C<directory>. It is essentially equivalent to running the shell command "
7517 "C<find directory -print> but some post-processing happens on the output, "
7522 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1915
7524 "This returns a list of strings I<without any prefix>. Thus if the directory "
7529 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:1918
7539 #: ../fish/guestfish-actions.pod:1244
7540 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
7544 #: ../fish/guestfish-actions.pod:1247 ../src/guestfs-actions.pod:1925
7555 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1930
7556 msgid "If C<directory> is not a directory, then this command returns an error."
7560 #: ../fish/guestfish-actions.pod:1255 ../src/guestfs-actions.pod:1933
7561 msgid "The returned list is sorted."
7565 #: ../fish/guestfish-actions.pod:1257
7566 msgid "See also L</find0>."
7570 #: ../fish/guestfish-actions.pod:1262
7575 #: ../fish/guestfish-actions.pod:1264
7578 " find0 directory (files|-)\n"
7583 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1953
7585 "This command lists out all files and directories, recursively, starting at "
7586 "C<directory>, placing the resulting list in the external file called "
7591 #: ../fish/guestfish-actions.pod:1270
7592 msgid "This command works the same way as L</find> with the following exceptions:"
7596 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:1964
7597 msgid "The resulting list is written to an external file."
7601 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1968
7603 "Items (filenames) in the result are separated by C<\\0> characters. See "
7604 "L<find(1)> option I<-print0>."
7608 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1973
7609 msgid "This command is not limited in the number of names that it can return."
7613 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1978
7614 msgid "The result list is not sorted."
7618 #: ../fish/guestfish-actions.pod:1297
7619 msgid "findfs-label"
7623 #: ../fish/guestfish-actions.pod:1299
7626 " findfs-label label\n"
7631 #: ../fish/guestfish-actions.pod:1301 ../src/guestfs-actions.pod:1992
7633 "This command searches the filesystems and returns the one which has the "
7634 "given label. An error is returned if no such filesystem can be found."
7638 #: ../fish/guestfish-actions.pod:1305
7639 msgid "To find the label of a filesystem, use L</vfs-label>."
7643 #: ../fish/guestfish-actions.pod:1307
7648 #: ../fish/guestfish-actions.pod:1309
7651 " findfs-uuid uuid\n"
7656 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2009
7658 "This command searches the filesystems and returns the one which has the "
7659 "given UUID. An error is returned if no such filesystem can be found."
7663 #: ../fish/guestfish-actions.pod:1315
7664 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
7668 #: ../fish/guestfish-actions.pod:1317
7673 #: ../fish/guestfish-actions.pod:1319
7676 " fsck fstype device\n"
7681 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:2027
7683 "This runs the filesystem checker (fsck) on C<device> which should have "
7684 "filesystem type C<fstype>."
7688 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2030
7690 "The returned integer is the status. See L<fsck(8)> for the list of status "
7691 "codes from C<fsck>."
7695 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2039
7696 msgid "Multiple status codes can be summed together."
7700 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2043
7702 "A non-zero return code can mean \"success\", for example if errors have been "
7703 "corrected on the filesystem."
7707 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2048
7708 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7712 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2053
7713 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7717 #: ../fish/guestfish-actions.pod:1349
7722 #: ../fish/guestfish-actions.pod:1351
7730 #: ../fish/guestfish-actions.pod:1353 ../src/guestfs-actions.pod:2064
7732 "Return the additional kernel options which are added to the guest kernel "
7737 #: ../fish/guestfish-actions.pod:1356 ../src/guestfs-actions.pod:2067
7738 msgid "If C<NULL> then no options are added."
7742 #: ../fish/guestfish-actions.pod:1358
7743 msgid "get-attach-method"
7747 #: ../fish/guestfish-actions.pod:1360
7750 " get-attach-method\n"
7755 #: ../fish/guestfish-actions.pod:1362
7756 msgid "Return the current attach method. See L</set-attach-method>."
7760 #: ../fish/guestfish-actions.pod:1364
7761 msgid "get-autosync"
7765 #: ../fish/guestfish-actions.pod:1366
7773 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2092
7774 msgid "Get the autosync flag."
7778 #: ../fish/guestfish-actions.pod:1370
7783 #: ../fish/guestfish-actions.pod:1372
7791 #: ../fish/guestfish-actions.pod:1374 ../src/guestfs-actions.pod:2103
7792 msgid "Return the direct appliance mode flag."
7796 #: ../fish/guestfish-actions.pod:1376
7801 #: ../fish/guestfish-actions.pod:1378
7804 " get-e2label device\n"
7809 #: ../fish/guestfish-actions.pod:1380 ../src/guestfs-actions.pod:2122
7810 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
7814 #: ../fish/guestfish-actions.pod:1383
7816 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
7821 #: ../fish/guestfish-actions.pod:1390
7826 #: ../fish/guestfish-actions.pod:1392
7829 " get-e2uuid device\n"
7834 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2143
7835 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
7839 #: ../fish/guestfish-actions.pod:1397
7841 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
7846 #: ../fish/guestfish-actions.pod:1404
7851 #: ../fish/guestfish-actions.pod:1406
7859 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2156
7860 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
7864 #: ../fish/guestfish-actions.pod:1411
7866 "If L</set-memsize> was not called on this handle, and if "
7867 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
7868 "value for memsize."
7872 #: ../fish/guestfish-actions.pod:1415 ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:4225 ../fish/guestfish-actions.pod:4327 ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2255 ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:6562
7873 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
7877 #: ../fish/guestfish-actions.pod:1418
7882 #: ../fish/guestfish-actions.pod:1420
7890 #: ../fish/guestfish-actions.pod:1422 ../src/guestfs-actions.pod:2175
7891 msgid "This returns the enable network flag."
7895 #: ../fish/guestfish-actions.pod:1424
7900 #: ../fish/guestfish-actions.pod:1426
7908 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2186
7909 msgid "Return the current search path."
7913 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2188
7915 "This is always non-NULL. If it wasn't set already, then this will return "
7920 #: ../fish/guestfish-actions.pod:1433
7925 #: ../fish/guestfish-actions.pod:1435
7933 #: ../fish/guestfish-actions.pod:1437 ../src/guestfs-actions.pod:2201
7934 msgid "This returns the process group flag."
7938 #: ../fish/guestfish-actions.pod:1439
7943 #: ../fish/guestfish-actions.pod:1441
7948 #: ../fish/guestfish-actions.pod:1443
7956 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2212
7958 "Return the process ID of the qemu subprocess. If there is no qemu "
7959 "subprocess, then this will return an error."
7963 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2215
7964 msgid "This is an internal call used for debugging and testing."
7968 #: ../fish/guestfish-actions.pod:1450
7973 #: ../fish/guestfish-actions.pod:1452
7981 #: ../fish/guestfish-actions.pod:1454 ../src/guestfs-actions.pod:2226
7982 msgid "Return the current qemu binary."
7986 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2228
7988 "This is always non-NULL. If it wasn't set already, then this will return "
7989 "the default qemu binary name."
7993 #: ../fish/guestfish-actions.pod:1459
7994 msgid "get-recovery-proc"
7998 #: ../fish/guestfish-actions.pod:1461
8001 " get-recovery-proc\n"
8006 #: ../fish/guestfish-actions.pod:1463 ../src/guestfs-actions.pod:2241
8007 msgid "Return the recovery process enabled flag."
8011 #: ../fish/guestfish-actions.pod:1465
8016 #: ../fish/guestfish-actions.pod:1467
8024 #: ../fish/guestfish-actions.pod:1469
8026 "This returns the current setting of the selinux flag which is passed to the "
8027 "appliance at boot time. See L</set-selinux>."
8031 #: ../fish/guestfish-actions.pod:1475
8036 #: ../fish/guestfish-actions.pod:1477
8044 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2267
8045 msgid "This returns the number of virtual CPUs assigned to the appliance."
8049 #: ../fish/guestfish-actions.pod:1481
8054 #: ../fish/guestfish-actions.pod:1483
8062 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2278
8064 "This returns the current state as an opaque integer. This is only useful "
8065 "for printing debug and internal error messages."
8069 #: ../fish/guestfish-actions.pod:1488 ../fish/guestfish-actions.pod:2434 ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2490 ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:2281 ../src/guestfs-actions.pod:3587 ../src/guestfs-actions.pod:3616 ../src/guestfs-actions.pod:3677 ../src/guestfs-actions.pod:3704
8070 msgid "For more information on states, see L<guestfs(3)>."
8074 #: ../fish/guestfish-actions.pod:1490
8079 #: ../fish/guestfish-actions.pod:1492
8087 #: ../fish/guestfish-actions.pod:1494 ../src/guestfs-actions.pod:2292
8088 msgid "Return the command trace flag."
8092 #: ../fish/guestfish-actions.pod:1496
8097 #: ../fish/guestfish-actions.pod:1498
8105 #: ../fish/guestfish-actions.pod:1500
8107 "Return the current umask. By default the umask is C<022> unless it has been "
8108 "set by calling L</umask>."
8112 #: ../fish/guestfish-actions.pod:1503
8117 #: ../fish/guestfish-actions.pod:1505
8125 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2315
8126 msgid "This returns the verbose messages flag."
8130 #: ../fish/guestfish-actions.pod:1509
8135 #: ../fish/guestfish-actions.pod:1511
8143 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2326
8144 msgid "This gets the SELinux security context of the daemon."
8148 #: ../fish/guestfish-actions.pod:1515
8149 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8153 #: ../fish/guestfish-actions.pod:1518
8158 #: ../fish/guestfish-actions.pod:1520
8161 " getxattr path name\n"
8166 #: ../fish/guestfish-actions.pod:1522
8168 "Get a single extended attribute from file C<path> named C<name>. This call "
8169 "follows symlinks. If you want to lookup an extended attribute for the "
8170 "symlink itself, use L</lgetxattr>."
8174 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:2579
8176 "Normally it is better to get all extended attributes from a file in one go "
8177 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8178 "buggy and do not provide a way to list out attributes. For these "
8179 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8180 "attributes you want in advance and call this function."
8184 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:2586 ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:3837
8186 "Extended attribute values are blobs of binary data. If there is no extended "
8187 "attribute named C<name>, this returns an error."
8191 #: ../fish/guestfish-actions.pod:1536
8192 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8196 #: ../fish/guestfish-actions.pod:1538
8201 #: ../fish/guestfish-actions.pod:1540
8209 #: ../fish/guestfish-actions.pod:1542 ../src/guestfs-actions.pod:2372
8210 msgid "This call lists the extended attributes of the file or directory C<path>."
8214 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2375
8216 "At the system call level, this is a combination of the L<listxattr(2)> and "
8217 "L<getxattr(2)> calls."
8221 #: ../fish/guestfish-actions.pod:1548
8222 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8226 #: ../fish/guestfish-actions.pod:1550
8231 #: ../fish/guestfish-actions.pod:1552
8234 " glob-expand pattern\n"
8239 #: ../fish/guestfish-actions.pod:1554 ../src/guestfs-actions.pod:2392
8241 "This command searches for all the pathnames matching C<pattern> according to "
8242 "the wildcard expansion rules used by the shell."
8246 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2396
8247 msgid "If no paths match, then this returns an empty list (note: not an error)."
8251 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2399
8253 "It is just a wrapper around the C L<glob(3)> function with flags "
8254 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8258 #: ../fish/guestfish-actions.pod:1565
8263 #: ../fish/guestfish-actions.pod:1567
8266 " grep regex path\n"
8271 #: ../fish/guestfish-actions.pod:1569 ../src/guestfs-actions.pod:2416
8272 msgid "This calls the external C<grep> program and returns the matching lines."
8276 #: ../fish/guestfish-actions.pod:1575
8281 #: ../fish/guestfish-actions.pod:1577
8284 " grepi regex path\n"
8289 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2435
8290 msgid "This calls the external C<grep -i> program and returns the matching lines."
8294 #: ../fish/guestfish-actions.pod:1585
8295 msgid "grub-install"
8299 #: ../fish/guestfish-actions.pod:1587
8302 " grub-install root device\n"
8307 #: ../fish/guestfish-actions.pod:1589 ../src/guestfs-actions.pod:2454
8309 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8310 "with the root directory being C<root>."
8314 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2463
8316 "There is currently no way in the API to install grub2, which is used by most "
8317 "modern Linux guests. It is possible to run the grub2 command from the "
8318 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8322 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2470
8324 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8325 "compatible with itself, so this only works in rather narrow circumstances. "
8326 "Careful testing with each guest version is advisable."
8330 #: ../fish/guestfish-actions.pod:1612 ../src/guestfs-actions.pod:2477
8332 "If grub-install reports the error \"No suitable drive was found in the "
8333 "generated device map.\" it may be that you need to create a "
8334 "C</boot/grub/device.map> file first that contains the mapping between grub "
8335 "device names and Linux device names. It is usually sufficient to create a "
8340 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2484
8348 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2486
8349 msgid "replacing C</dev/vda> with the name of the installation device."
8353 #: ../fish/guestfish-actions.pod:1625
8358 #: ../fish/guestfish-actions.pod:1627
8366 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2500
8368 "This command returns up to the first 10 lines of a file as a list of "
8373 #: ../fish/guestfish-actions.pod:1635
8378 #: ../fish/guestfish-actions.pod:1637
8381 " head-n nrlines path\n"
8386 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2519
8388 "If the parameter C<nrlines> is a positive number, this returns the first "
8389 "C<nrlines> lines of the file C<path>."
8393 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2522
8395 "If the parameter C<nrlines> is a negative number, this returns lines from "
8396 "the file C<path>, excluding the last C<nrlines> lines."
8400 #: ../fish/guestfish-actions.pod:1645 ../fish/guestfish-actions.pod:4717 ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:7150
8401 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8405 #: ../fish/guestfish-actions.pod:1650
8410 #: ../fish/guestfish-actions.pod:1652
8418 #: ../fish/guestfish-actions.pod:1654 ../src/guestfs-actions.pod:2542
8420 "This runs C<hexdump -C> on the given C<path>. The result is the "
8421 "human-readable, canonical hex dump of the file."
8425 #: ../fish/guestfish-actions.pod:1660
8430 #: ../fish/guestfish-actions.pod:1662
8433 " initrd-cat initrdpath filename\n"
8438 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2561
8440 "This command unpacks the file C<filename> from the initrd file called "
8441 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8446 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2565
8448 "For example, in guestfish you could use the following command to examine the "
8449 "boot script (usually called C</init>) contained in a Linux initrd or "
8454 #: ../fish/guestfish-actions.pod:1672 ../src/guestfs-actions.pod:2569
8457 " initrd-cat /boot/initrd-<version>.img init\n"
8462 #: ../fish/guestfish-actions.pod:1674
8463 msgid "See also L</initrd-list>."
8467 #: ../fish/guestfish-actions.pod:1679
8472 #: ../fish/guestfish-actions.pod:1681
8475 " initrd-list path\n"
8480 #: ../fish/guestfish-actions.pod:1683 ../src/guestfs-actions.pod:2588
8481 msgid "This command lists out files contained in an initrd."
8485 #: ../fish/guestfish-actions.pod:1685 ../src/guestfs-actions.pod:2590
8487 "The files are listed without any initial C</> character. The files are "
8488 "listed in the order they appear (not necessarily alphabetical). Directory "
8489 "names are listed as separate items."
8493 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2594
8495 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8496 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8501 #: ../fish/guestfish-actions.pod:1693
8502 msgid "inotify-add-watch"
8506 #: ../fish/guestfish-actions.pod:1695
8509 " inotify-add-watch path mask\n"
8514 #: ../fish/guestfish-actions.pod:1697 ../src/guestfs-actions.pod:2611
8515 msgid "Watch C<path> for the events listed in C<mask>."
8519 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2613
8521 "Note that if C<path> is a directory then events within that directory are "
8522 "watched, but this does I<not> happen recursively (in subdirectories)."
8526 #: ../fish/guestfish-actions.pod:1703 ../src/guestfs-actions.pod:2617
8528 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8529 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8533 #: ../fish/guestfish-actions.pod:1707
8534 msgid "inotify-close"
8538 #: ../fish/guestfish-actions.pod:1709
8546 #: ../fish/guestfish-actions.pod:1711 ../src/guestfs-actions.pod:2630
8548 "This closes the inotify handle which was previously opened by inotify_init. "
8549 "It removes all watches, throws away any pending events, and deallocates all "
8554 #: ../fish/guestfish-actions.pod:1715
8555 msgid "inotify-files"
8559 #: ../fish/guestfish-actions.pod:1717
8567 #: ../fish/guestfish-actions.pod:1719
8569 "This function is a helpful wrapper around L</inotify-read> which just "
8570 "returns a list of pathnames of objects that were touched. The returned "
8571 "pathnames are sorted and deduplicated."
8575 #: ../fish/guestfish-actions.pod:1723
8576 msgid "inotify-init"
8580 #: ../fish/guestfish-actions.pod:1725
8583 " inotify-init maxevents\n"
8588 #: ../fish/guestfish-actions.pod:1727 ../src/guestfs-actions.pod:2659
8590 "This command creates a new inotify handle. The inotify subsystem can be "
8591 "used to notify events which happen to objects in the guest filesystem."
8595 #: ../fish/guestfish-actions.pod:1731
8597 "C<maxevents> is the maximum number of events which will be queued up between "
8598 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8599 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
8600 "default was 16384 events. Beyond this limit, the kernel throws away events, "
8601 "but records the fact that it threw them away by setting a flag "
8602 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
8606 #: ../fish/guestfish-actions.pod:1741
8608 "Before any events are generated, you have to add some watches to the "
8609 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
8610 "L</inotify-watch-all>."
8614 #: ../fish/guestfish-actions.pod:1747
8616 "Queued up events should be read periodically by calling L</inotify-read> (or "
8617 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
8618 "If you don't read the events out often enough then you risk the internal "
8619 "queue overflowing."
8623 #: ../fish/guestfish-actions.pod:1754
8625 "The handle should be closed after use by calling L</inotify-close>. This "
8626 "also removes any watches automatically."
8630 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2690
8632 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8633 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8634 "that there is one global inotify handle per libguestfs instance."
8638 #: ../fish/guestfish-actions.pod:1763
8639 msgid "inotify-read"
8643 #: ../fish/guestfish-actions.pod:1765
8651 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2704
8653 "Return the complete queue of events that have happened since the previous "
8658 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2707
8659 msgid "If no events have happened, this returns an empty list."
8663 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2709
8665 "I<Note>: In order to make sure that all events have been read, you must call "
8666 "this function repeatedly until it returns an empty list. The reason is that "
8667 "the call will read events up to the maximum appliance-to-host message size "
8668 "and leave remaining events in the queue."
8672 #: ../fish/guestfish-actions.pod:1778
8673 msgid "inotify-rm-watch"
8677 #: ../fish/guestfish-actions.pod:1780
8680 " inotify-rm-watch wd\n"
8685 #: ../fish/guestfish-actions.pod:1782
8686 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
8690 #: ../fish/guestfish-actions.pod:1785
8691 msgid "inspect-get-arch"
8695 #: ../fish/guestfish-actions.pod:1787
8698 " inspect-get-arch root\n"
8703 #: ../fish/guestfish-actions.pod:1789
8705 "This returns the architecture of the inspected operating system. The "
8706 "possible return values are listed under L</file-architecture>."
8710 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2744
8712 "If the architecture could not be determined, then the string C<unknown> is "
8717 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1883 ../fish/guestfish-actions.pod:1962 ../fish/guestfish-actions.pod:1974 ../fish/guestfish-actions.pod:2058 ../fish/guestfish-actions.pod:2119 ../fish/guestfish-actions.pod:2140 ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2194 ../fish/guestfish-actions.pod:2226 ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2252 ../fish/guestfish-actions.pod:2262 ../fish/guestfish-actions.pod:2272 ../fish/guestfish-actions.pod:2284 ../fish/guestfish-actions.pod:2380 ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2945 ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3178 ../src/guestfs-actions.pod:3206 ../src/guestfs-actions.pod:3227 ../src/guestfs-actions.pod:3280 ../src/guestfs-actions.pod:3320 ../src/guestfs-actions.pod:3340 ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3377 ../src/guestfs-actions.pod:3393 ../src/guestfs-actions.pod:3411 ../src/guestfs-actions.pod:3513 ../src/guestfs-actions.pod:3554
8718 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8722 #: ../fish/guestfish-actions.pod:1798
8723 msgid "inspect-get-distro"
8727 #: ../fish/guestfish-actions.pod:1800
8730 " inspect-get-distro root\n"
8735 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2760
8736 msgid "This returns the distro (distribution) of the inspected operating system."
8740 #: ../fish/guestfish-actions.pod:1805 ../src/guestfs-actions.pod:2763
8741 msgid "Currently defined distros are:"
8745 #: ../fish/guestfish-actions.pod:1809 ../src/guestfs-actions.pod:2767
8746 msgid "\"archlinux\""
8750 #: ../fish/guestfish-actions.pod:1811 ../src/guestfs-actions.pod:2769
8755 #: ../fish/guestfish-actions.pod:1813 ../src/guestfs-actions.pod:2771
8760 #: ../fish/guestfish-actions.pod:1815 ../src/guestfs-actions.pod:2773
8765 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2775
8770 #: ../fish/guestfish-actions.pod:1819 ../src/guestfs-actions.pod:2777
8775 #: ../fish/guestfish-actions.pod:1821 ../src/guestfs-actions.pod:2779
8780 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2781
8785 #: ../fish/guestfish-actions.pod:1825 ../src/guestfs-actions.pod:2783
8790 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2785
8795 #: ../fish/guestfish-actions.pod:1829 ../src/guestfs-actions.pod:2787
8796 msgid "\"linuxmint\""
8800 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2789
8805 #: ../fish/guestfish-actions.pod:1833 ../src/guestfs-actions.pod:2791
8806 msgid "\"mandriva\""
8810 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2793
8815 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2795
8820 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2797
8825 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2799
8830 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2801
8835 #: ../fish/guestfish-actions.pod:1845 ../src/guestfs-actions.pod:2803
8836 msgid "\"redhat-based\""
8840 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2805
8841 msgid "Some Red Hat-derived distro."
8845 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2807
8850 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2809
8851 msgid "Red Hat Enterprise Linux."
8855 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2811
8856 msgid "\"scientificlinux\""
8860 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2813
8861 msgid "Scientific Linux."
8865 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2815
8866 msgid "\"slackware\""
8870 #: ../fish/guestfish-actions.pod:1859 ../src/guestfs-actions.pod:2817
8875 #: ../fish/guestfish-actions.pod:1861 ../src/guestfs-actions.pod:2819
8876 msgid "\"ttylinux\""
8880 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2821
8885 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2823
8890 #: ../fish/guestfish-actions.pod:1867 ../src/guestfs-actions.pod:2825
8895 #: ../fish/guestfish-actions.pod:1869 ../fish/guestfish-actions.pod:1953 ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:2827 ../src/guestfs-actions.pod:2936 ../src/guestfs-actions.pod:3311
8900 #: ../fish/guestfish-actions.pod:1871 ../src/guestfs-actions.pod:2829
8901 msgid "The distro could not be determined."
8905 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:2209 ../src/guestfs-actions.pod:2831 ../src/guestfs-actions.pod:3303
8910 #: ../fish/guestfish-actions.pod:1875 ../src/guestfs-actions.pod:2833
8912 "Windows does not have distributions. This string is returned if the OS type "
8917 #: ../fish/guestfish-actions.pod:1880 ../fish/guestfish-actions.pod:1959 ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2838 ../src/guestfs-actions.pod:2942 ../src/guestfs-actions.pod:3317
8919 "Future versions of libguestfs may return other strings here. The caller "
8920 "should be prepared to handle any string."
8924 #: ../fish/guestfish-actions.pod:1885
8925 msgid "inspect-get-drive-mappings"
8929 #: ../fish/guestfish-actions.pod:1887
8932 " inspect-get-drive-mappings root\n"
8937 #: ../fish/guestfish-actions.pod:1889 ../src/guestfs-actions.pod:2854
8939 "This call is useful for Windows which uses a primitive system of assigning "
8940 "drive letters (like \"C:\") to partitions. This inspection API examines the "
8941 "Windows Registry to find out how disks/partitions are mapped to drive "
8942 "letters, and returns a hash table as in the example below:"
8946 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:2860
8956 #: ../fish/guestfish-actions.pod:1899 ../src/guestfs-actions.pod:2864
8958 "Note that keys are drive letters. For Windows, the key is case insensitive "
8959 "and just contains the drive letter, without the customary colon separator "
8964 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2868
8966 "In future we may support other operating systems that also used drive "
8967 "letters, but the keys for those might not be case insensitive and might be "
8968 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
8973 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2873
8975 "For Windows guests, currently only hard drive mappings are returned. "
8976 "Removable disks (eg. DVD-ROMs) are ignored."
8980 #: ../fish/guestfish-actions.pod:1911 ../src/guestfs-actions.pod:2876
8982 "For guests that do not use drive mappings, or if the drive mappings could "
8983 "not be determined, this returns an empty hash table."
8987 #: ../fish/guestfish-actions.pod:1914
8989 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
8990 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
8994 #: ../fish/guestfish-actions.pod:1918
8995 msgid "inspect-get-filesystems"
8999 #: ../fish/guestfish-actions.pod:1920
9002 " inspect-get-filesystems root\n"
9007 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:2897
9009 "This returns a list of all the filesystems that we think are associated with "
9010 "this operating system. This includes the root filesystem, other ordinary "
9011 "filesystems, and non-mounted devices like swap partitions."
9015 #: ../fish/guestfish-actions.pod:1927 ../src/guestfs-actions.pod:2902
9017 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9018 "to be shared between operating systems."
9022 #: ../fish/guestfish-actions.pod:1930
9024 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9025 "L</inspect-get-mountpoints>."
9029 #: ../fish/guestfish-actions.pod:1933
9030 msgid "inspect-get-format"
9034 #: ../fish/guestfish-actions.pod:1935
9037 " inspect-get-format root\n"
9042 #: ../fish/guestfish-actions.pod:1937 ../src/guestfs-actions.pod:2920
9044 "This returns the format of the inspected operating system. You can use it "
9045 "to detect install images, live CDs and similar."
9049 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2923
9050 msgid "Currently defined formats are:"
9054 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:2927
9055 msgid "\"installed\""
9059 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:2929
9060 msgid "This is an installed operating system."
9064 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2931
9065 msgid "\"installer\""
9069 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2933
9071 "The disk image being inspected is not an installed operating system, but a "
9072 "I<bootable> install disk, live CD, or similar."
9076 #: ../fish/guestfish-actions.pod:1955 ../src/guestfs-actions.pod:2938
9077 msgid "The format of this disk image is not known."
9081 #: ../fish/guestfish-actions.pod:1964
9082 msgid "inspect-get-hostname"
9086 #: ../fish/guestfish-actions.pod:1966
9089 " inspect-get-hostname root\n"
9094 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2958
9096 "This function returns the hostname of the operating system as found by "
9097 "inspection of the guest's configuration files."
9101 #: ../fish/guestfish-actions.pod:1971 ../src/guestfs-actions.pod:2961
9103 "If the hostname could not be determined, then the string C<unknown> is "
9108 #: ../fish/guestfish-actions.pod:1976
9109 msgid "inspect-get-icon"
9113 #: ../fish/guestfish-actions.pod:1978
9116 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9121 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:2987
9123 "This function returns an icon corresponding to the inspected operating "
9124 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9125 "to PNG if necessary)."
9129 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2991
9131 "If it was not possible to get an icon this function returns a zero-length "
9132 "(non-NULL) buffer. I<Callers must check for this case>."
9136 #: ../fish/guestfish-actions.pod:1987 ../src/guestfs-actions.pod:2994
9138 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9139 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9140 "this file will be returned. You can disable favicons by passing the "
9141 "optional C<favicon> boolean as false (default is true)."
9145 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3000
9147 "If finding the favicon fails, then we look in other places in the guest for "
9152 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3003
9154 "If the optional C<highquality> boolean is true then only high quality icons "
9155 "are returned, which means only icons of high resolution with an alpha "
9156 "channel. The default (false) is to return any icon we can, even if it is of "
9157 "substandard quality."
9161 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3014
9163 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9164 "before you call this, since it needs to read information from the guest "
9165 "filesystem during the call."
9169 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:3020
9171 "B<Security:> The icon data comes from the untrusted guest, and should be "
9172 "treated with caution. PNG files have been known to contain exploits. "
9173 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9174 "trying to process or display the icon."
9178 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3028
9180 "The PNG image returned can be any size. It might not be square. Libguestfs "
9181 "tries to return the largest, highest quality icon available. The "
9182 "application must scale the icon to the required size."
9186 #: ../fish/guestfish-actions.pod:2028 ../src/guestfs-actions.pod:3035
9188 "Extracting icons from Windows guests requires the external C<wrestool> "
9189 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9190 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9191 "installed separately."
9195 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3042
9197 "Operating system icons are usually trademarks. Seek legal advice before "
9198 "using trademarks in applications."
9202 #: ../fish/guestfish-actions.pod:2042
9203 msgid "inspect-get-major-version"
9207 #: ../fish/guestfish-actions.pod:2044
9210 " inspect-get-major-version root\n"
9215 #: ../fish/guestfish-actions.pod:2046 ../src/guestfs-actions.pod:3083
9216 msgid "This returns the major version number of the inspected operating system."
9220 #: ../fish/guestfish-actions.pod:2049 ../src/guestfs-actions.pod:3086
9222 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9223 "popular public names used by the operating system. Notably the operating "
9224 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9225 "1). You can find out the real versions corresponding to releases of Windows "
9226 "by consulting Wikipedia or MSDN."
9230 #: ../fish/guestfish-actions.pod:2056 ../fish/guestfish-actions.pod:2067 ../src/guestfs-actions.pod:3093 ../src/guestfs-actions.pod:3110
9231 msgid "If the version could not be determined, then C<0> is returned."
9235 #: ../fish/guestfish-actions.pod:2060
9236 msgid "inspect-get-minor-version"
9240 #: ../fish/guestfish-actions.pod:2062
9243 " inspect-get-minor-version root\n"
9248 #: ../fish/guestfish-actions.pod:2064 ../src/guestfs-actions.pod:3107
9249 msgid "This returns the minor version number of the inspected operating system."
9253 #: ../fish/guestfish-actions.pod:2069
9255 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9256 "L</inspect-get-major-version>."
9260 #: ../fish/guestfish-actions.pod:2072
9261 msgid "inspect-get-mountpoints"
9265 #: ../fish/guestfish-actions.pod:2074
9268 " inspect-get-mountpoints root\n"
9273 #: ../fish/guestfish-actions.pod:2076 ../src/guestfs-actions.pod:3125
9275 "This returns a hash of where we think the filesystems associated with this "
9276 "operating system should be mounted. Callers should note that this is at "
9277 "best an educated guess made by reading configuration files such as "
9278 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9279 "are non-existent or not mountable and callers should be prepared to handle "
9280 "or ignore failures if they try to mount them."
9284 #: ../fish/guestfish-actions.pod:2085 ../src/guestfs-actions.pod:3134
9286 "Each element in the returned hashtable has a key which is the path of the "
9287 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9288 "mounted there (eg. C</dev/sda1>)."
9292 #: ../fish/guestfish-actions.pod:2090 ../src/guestfs-actions.pod:3139
9293 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9297 #: ../fish/guestfish-actions.pod:2093
9299 "For operating systems like Windows which still use drive letters, this call "
9300 "will only return an entry for the first drive \"mounted on\" C</>. For "
9301 "information about the mapping of drive letters to partitions, see "
9302 "L</inspect-get-drive-mappings>."
9306 #: ../fish/guestfish-actions.pod:2099
9308 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9309 "L</inspect-get-filesystems>."
9313 #: ../fish/guestfish-actions.pod:2102
9314 msgid "inspect-get-package-format"
9318 #: ../fish/guestfish-actions.pod:2104
9321 " inspect-get-package-format root\n"
9326 #: ../fish/guestfish-actions.pod:2106
9328 "This function and L</inspect-get-package-management> return the package "
9329 "format and package management tool used by the inspected operating system. "
9330 "For example for Fedora these functions would return C<rpm> (package format) "
9331 "and C<yum> (package management)."
9335 #: ../fish/guestfish-actions.pod:2112 ../src/guestfs-actions.pod:3171
9337 "This returns the string C<unknown> if we could not determine the package "
9338 "format I<or> if the operating system does not have a real packaging system "
9343 #: ../fish/guestfish-actions.pod:2116 ../src/guestfs-actions.pod:3175
9345 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>. "
9346 "Future versions of libguestfs may return other strings."
9350 #: ../fish/guestfish-actions.pod:2121
9351 msgid "inspect-get-package-management"
9355 #: ../fish/guestfish-actions.pod:2123
9358 " inspect-get-package-management root\n"
9363 #: ../fish/guestfish-actions.pod:2125
9365 "L</inspect-get-package-format> and this function return the package format "
9366 "and package management tool used by the inspected operating system. For "
9367 "example for Fedora these functions would return C<rpm> (package format) and "
9368 "C<yum> (package management)."
9372 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3197
9374 "This returns the string C<unknown> if we could not determine the package "
9375 "management tool I<or> if the operating system does not have a real packaging "
9376 "system (eg. Windows)."
9380 #: ../fish/guestfish-actions.pod:2135 ../src/guestfs-actions.pod:3201
9382 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9383 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>. Future versions of "
9384 "libguestfs may return other strings."
9388 #: ../fish/guestfish-actions.pod:2142
9389 msgid "inspect-get-product-name"
9393 #: ../fish/guestfish-actions.pod:2144
9396 " inspect-get-product-name root\n"
9401 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3219
9403 "This returns the product name of the inspected operating system. The "
9404 "product name is generally some freeform string which can be displayed to the "
9405 "user, but should not be parsed by programs."
9409 #: ../fish/guestfish-actions.pod:2151 ../src/guestfs-actions.pod:3224
9411 "If the product name could not be determined, then the string C<unknown> is "
9416 #: ../fish/guestfish-actions.pod:2156
9417 msgid "inspect-get-product-variant"
9421 #: ../fish/guestfish-actions.pod:2158
9424 " inspect-get-product-variant root\n"
9429 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3240
9430 msgid "This returns the product variant of the inspected operating system."
9434 #: ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:3243
9436 "For Windows guests, this returns the contents of the Registry key "
9437 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9438 "which is usually a string such as C<Client> or C<Server> (other values are "
9439 "possible). This can be used to distinguish consumer and enterprise versions "
9440 "of Windows that have the same version number (for example, Windows 7 and "
9441 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9442 "the latter is C<Server>)."
9446 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:3252
9448 "For enterprise Linux guests, in future we intend this to return the product "
9449 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9450 "implemented at present."
9454 #: ../fish/guestfish-actions.pod:2176 ../src/guestfs-actions.pod:3256
9456 "If the product variant could not be determined, then the string C<unknown> "
9461 #: ../fish/guestfish-actions.pod:2179
9463 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9464 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9468 #: ../fish/guestfish-actions.pod:2183
9469 msgid "inspect-get-roots"
9473 #: ../fish/guestfish-actions.pod:2185
9476 " inspect-get-roots\n"
9481 #: ../fish/guestfish-actions.pod:2187
9483 "This function is a convenient way to get the list of root devices, as "
9484 "returned from a previous call to L</inspect-os>, but without redoing the "
9485 "whole inspection process."
9489 #: ../fish/guestfish-actions.pod:2191
9491 "This returns an empty list if either no root devices were found or the "
9492 "caller has not called L</inspect-os>."
9496 #: ../fish/guestfish-actions.pod:2196
9497 msgid "inspect-get-type"
9501 #: ../fish/guestfish-actions.pod:2198
9504 " inspect-get-type root\n"
9509 #: ../fish/guestfish-actions.pod:2200 ../src/guestfs-actions.pod:3294
9511 "This returns the type of the inspected operating system. Currently defined "
9516 #: ../fish/guestfish-actions.pod:2205 ../src/guestfs-actions.pod:3299
9521 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3301
9522 msgid "Any Linux-based operating system."
9526 #: ../fish/guestfish-actions.pod:2211 ../src/guestfs-actions.pod:3305
9527 msgid "Any Microsoft Windows operating system."
9531 #: ../fish/guestfish-actions.pod:2213 ../src/guestfs-actions.pod:3307
9536 #: ../fish/guestfish-actions.pod:2215 ../src/guestfs-actions.pod:3309
9541 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3313
9542 msgid "The operating system type could not be determined."
9546 #: ../fish/guestfish-actions.pod:2228
9547 msgid "inspect-get-windows-current-control-set"
9551 #: ../fish/guestfish-actions.pod:2230
9554 " inspect-get-windows-current-control-set root\n"
9559 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3333
9561 "This returns the Windows CurrentControlSet of the inspected guest. The "
9562 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9566 #: ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:3336
9568 "This call assumes that the guest is Windows and that the Registry could be "
9569 "examined by inspection. If this is not the case then an error is returned."
9573 #: ../fish/guestfish-actions.pod:2241
9574 msgid "inspect-get-windows-systemroot"
9578 #: ../fish/guestfish-actions.pod:2243
9581 " inspect-get-windows-systemroot root\n"
9586 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3353
9588 "This returns the Windows systemroot of the inspected guest. The systemroot "
9589 "is a directory path such as C</WINDOWS>."
9593 #: ../fish/guestfish-actions.pod:2248 ../src/guestfs-actions.pod:3356
9595 "This call assumes that the guest is Windows and that the systemroot could be "
9596 "determined by inspection. If this is not the case then an error is "
9601 #: ../fish/guestfish-actions.pod:2254
9602 msgid "inspect-is-live"
9606 #: ../fish/guestfish-actions.pod:2256
9609 " inspect-is-live root\n"
9614 #: ../fish/guestfish-actions.pod:2258
9616 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9617 "then this returns true if a live image was detected on the disk."
9621 #: ../fish/guestfish-actions.pod:2264
9622 msgid "inspect-is-multipart"
9626 #: ../fish/guestfish-actions.pod:2266
9629 " inspect-is-multipart root\n"
9634 #: ../fish/guestfish-actions.pod:2268
9636 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9637 "then this returns true if the disk is part of a set."
9641 #: ../fish/guestfish-actions.pod:2274
9642 msgid "inspect-is-netinst"
9646 #: ../fish/guestfish-actions.pod:2276
9649 " inspect-is-netinst root\n"
9654 #: ../fish/guestfish-actions.pod:2278
9656 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9657 "then this returns true if the disk is a network installer, ie. not a "
9658 "self-contained install CD but one which is likely to require network access "
9659 "to complete the install."
9663 #: ../fish/guestfish-actions.pod:2286
9664 msgid "inspect-list-applications"
9668 #: ../fish/guestfish-actions.pod:2288
9671 " inspect-list-applications root\n"
9676 #: ../fish/guestfish-actions.pod:2290 ../src/guestfs-actions.pod:3423
9677 msgid "Return the list of applications installed in the operating system."
9681 #: ../fish/guestfish-actions.pod:2292
9683 "I<Note:> This call works differently from other parts of the inspection "
9684 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
9685 "then mount up the disks, before calling this. Listing applications is a "
9686 "significantly more difficult operation which requires access to the full "
9687 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
9688 "are just returning data cached in the libguestfs handle, this call actually "
9689 "reads parts of the mounted filesystems during the call."
9693 #: ../fish/guestfish-actions.pod:2302 ../src/guestfs-actions.pod:3435
9695 "This returns an empty list if the inspection code was not able to determine "
9696 "the list of applications."
9700 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3438
9701 msgid "The application structure contains the following fields:"
9705 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3442
9710 #: ../fish/guestfish-actions.pod:2311 ../src/guestfs-actions.pod:3444
9712 "The name of the application. For Red Hat-derived and Debian-derived Linux "
9713 "guests, this is the package name."
9717 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3447
9718 msgid "C<app_display_name>"
9722 #: ../fish/guestfish-actions.pod:2316 ../src/guestfs-actions.pod:3449
9724 "The display name of the application, sometimes localized to the install "
9725 "language of the guest operating system."
9729 #: ../fish/guestfish-actions.pod:2319 ../src/guestfs-actions.pod:3452
9731 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
9732 "to display something can use C<app_name> instead."
9736 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3455
9737 msgid "C<app_epoch>"
9741 #: ../fish/guestfish-actions.pod:2324 ../src/guestfs-actions.pod:3457
9743 "For package managers which use epochs, this contains the epoch of the "
9744 "package (an integer). If unavailable, this is returned as C<0>."
9748 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3460
9749 msgid "C<app_version>"
9753 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3462
9755 "The version string of the application or package. If unavailable this is "
9756 "returned as an empty string C<\"\">."
9760 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3465
9761 msgid "C<app_release>"
9765 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3467
9767 "The release string of the application or package, for package managers that "
9768 "use this. If unavailable this is returned as an empty string C<\"\">."
9772 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3471
9773 msgid "C<app_install_path>"
9777 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3473
9779 "The installation path of the application (on operating systems such as "
9780 "Windows which use installation paths). This path is in the format used by "
9781 "the guest operating system, it is not a libguestfs path."
9785 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3478
9786 msgid "If unavailable this is returned as an empty string C<\"\">."
9790 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3480
9791 msgid "C<app_trans_path>"
9795 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3482
9797 "The install path translated into a libguestfs path. If unavailable this is "
9798 "returned as an empty string C<\"\">."
9802 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3485
9803 msgid "C<app_publisher>"
9807 #: ../fish/guestfish-actions.pod:2354 ../src/guestfs-actions.pod:3487
9809 "The name of the publisher of the application, for package managers that use "
9810 "this. If unavailable this is returned as an empty string C<\"\">."
9814 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3491
9819 #: ../fish/guestfish-actions.pod:2360 ../src/guestfs-actions.pod:3493
9821 "The URL (eg. upstream URL) of the application. If unavailable this is "
9822 "returned as an empty string C<\"\">."
9826 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3496
9827 msgid "C<app_source_package>"
9831 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3498
9833 "For packaging systems which support this, the name of the source package. "
9834 "If unavailable this is returned as an empty string C<\"\">."
9838 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3501
9839 msgid "C<app_summary>"
9843 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3503
9845 "A short (usually one line) description of the application or package. If "
9846 "unavailable this is returned as an empty string C<\"\">."
9850 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3506
9851 msgid "C<app_description>"
9855 #: ../fish/guestfish-actions.pod:2375 ../src/guestfs-actions.pod:3508
9857 "A longer description of the application or package. If unavailable this is "
9858 "returned as an empty string C<\"\">."
9862 #: ../fish/guestfish-actions.pod:2382
9867 #: ../fish/guestfish-actions.pod:2384
9875 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3526
9877 "This function uses other libguestfs functions and certain heuristics to "
9878 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
9879 "for operating systems."
9883 #: ../fish/guestfish-actions.pod:2390 ../src/guestfs-actions.pod:3530
9884 msgid "The list returned is empty if no operating systems were found."
9888 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3532
9890 "If one operating system was found, then this returns a list with a single "
9891 "element, which is the name of the root filesystem of this operating system. "
9892 "It is also possible for this function to return a list containing more than "
9893 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
9894 "element being the root filesystem of one of the operating systems."
9898 #: ../fish/guestfish-actions.pod:2399
9900 "You can pass the root string(s) returned to other L</inspect-get-*> "
9901 "functions in order to query further information about each operating system, "
9902 "such as the name and version."
9906 #: ../fish/guestfish-actions.pod:2404
9908 "This function uses other libguestfs features such as L</mount-ro> and "
9909 "L</umount-all> in order to mount and unmount filesystems and look at the "
9910 "contents. This should be called with no disks currently mounted. The "
9911 "function may also use Augeas, so any existing Augeas handle will be closed."
9915 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3550
9917 "This function cannot decrypt encrypted disks. The caller must do that first "
9918 "(supplying the necessary keys) if the disk is encrypted."
9922 #: ../fish/guestfish-actions.pod:2416 ../fish/guestfish-actions.pod:2614 ../fish/guestfish-actions.pod:2673
9923 msgid "See also L</list-filesystems>."
9927 #: ../fish/guestfish-actions.pod:2418
9932 #: ../fish/guestfish-actions.pod:2420
9935 " is-blockdev path\n"
9940 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3570
9942 "This returns C<true> if and only if there is a block device with the given "
9947 #: ../fish/guestfish-actions.pod:2425 ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2462 ../fish/guestfish-actions.pod:2471 ../fish/guestfish-actions.pod:2481 ../fish/guestfish-actions.pod:2515 ../fish/guestfish-actions.pod:2524
9948 msgid "See also L</stat>."
9952 #: ../fish/guestfish-actions.pod:2427
9957 #: ../fish/guestfish-actions.pod:2429
9965 #: ../fish/guestfish-actions.pod:2431 ../src/guestfs-actions.pod:3584
9967 "This returns true iff this handle is busy processing a command (in the "
9972 #: ../fish/guestfish-actions.pod:2436
9977 #: ../fish/guestfish-actions.pod:2438
9980 " is-chardev path\n"
9985 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3599
9987 "This returns C<true> if and only if there is a character device with the "
9988 "given C<path> name."
9992 #: ../fish/guestfish-actions.pod:2445
9997 #: ../fish/guestfish-actions.pod:2447
10005 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3613
10007 "This returns true iff this handle is being configured (in the C<CONFIG> "
10012 #: ../fish/guestfish-actions.pod:2454
10017 #: ../fish/guestfish-actions.pod:2456
10025 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3628
10027 "This returns C<true> if and only if there is a directory with the given "
10028 "C<path> name. Note that it returns false for other objects like files."
10032 #: ../fish/guestfish-actions.pod:2464
10037 #: ../fish/guestfish-actions.pod:2466
10045 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3644
10047 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10048 "given C<path> name."
10052 #: ../fish/guestfish-actions.pod:2473
10057 #: ../fish/guestfish-actions.pod:2475
10065 #: ../fish/guestfish-actions.pod:2477 ../src/guestfs-actions.pod:3659
10067 "This returns C<true> if and only if there is a regular file with the given "
10068 "C<path> name. Note that it returns false for other objects like "
10073 #: ../fish/guestfish-actions.pod:2483
10074 msgid "is-launching"
10078 #: ../fish/guestfish-actions.pod:2485
10086 #: ../fish/guestfish-actions.pod:2487 ../src/guestfs-actions.pod:3674
10088 "This returns true iff this handle is launching the subprocess (in the "
10089 "C<LAUNCHING> state)."
10093 #: ../fish/guestfish-actions.pod:2492
10098 #: ../fish/guestfish-actions.pod:2494
10106 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3689
10108 "This command tests whether C<device> is a logical volume, and returns true "
10109 "iff this is the case."
10113 #: ../fish/guestfish-actions.pod:2499
10118 #: ../fish/guestfish-actions.pod:2501
10126 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3701
10128 "This returns true iff this handle is ready to accept commands (in the "
10133 #: ../fish/guestfish-actions.pod:2508
10138 #: ../fish/guestfish-actions.pod:2510
10141 " is-socket path\n"
10146 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3716
10148 "This returns C<true> if and only if there is a Unix domain socket with the "
10149 "given C<path> name."
10153 #: ../fish/guestfish-actions.pod:2517
10158 #: ../fish/guestfish-actions.pod:2519
10161 " is-symlink path\n"
10166 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3731
10168 "This returns C<true> if and only if there is a symbolic link with the given "
10173 #: ../fish/guestfish-actions.pod:2526
10178 #: ../fish/guestfish-actions.pod:2528
10186 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3746
10188 "This returns true iff the file exists and the file is empty or it contains "
10193 #: ../fish/guestfish-actions.pod:2533
10194 msgid "is-zero-device"
10198 #: ../fish/guestfish-actions.pod:2535
10201 " is-zero-device device\n"
10206 #: ../fish/guestfish-actions.pod:2537 ../src/guestfs-actions.pod:3759
10207 msgid "This returns true iff the device exists and contains all zero bytes."
10211 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3761
10212 msgid "Note that for large devices this can take a long time to run."
10216 #: ../fish/guestfish-actions.pod:2541
10217 msgid "kill-subprocess"
10221 #: ../fish/guestfish-actions.pod:2543
10224 " kill-subprocess\n"
10229 #: ../fish/guestfish-actions.pod:2545 ../src/guestfs-actions.pod:3772
10230 msgid "This kills the qemu subprocess. You should never need to call this."
10234 #: ../fish/guestfish-actions.pod:2547
10239 #: ../fish/guestfish-actions.pod:2549
10244 #: ../fish/guestfish-actions.pod:2551
10252 #: ../fish/guestfish-actions.pod:2553 ../src/guestfs-actions.pod:3783
10254 "Internally libguestfs is implemented by running a virtual machine using "
10259 #: ../fish/guestfish-actions.pod:2556 ../src/guestfs-actions.pod:3786
10261 "You should call this after configuring the handle (eg. adding drives) but "
10262 "before performing any actions."
10266 #: ../fish/guestfish-actions.pod:2559
10271 #: ../fish/guestfish-actions.pod:2561
10274 " lchown owner group path\n"
10279 #: ../fish/guestfish-actions.pod:2563
10281 "Change the file owner to C<owner> and group to C<group>. This is like "
10282 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10287 #: ../fish/guestfish-actions.pod:2571
10292 #: ../fish/guestfish-actions.pod:2573
10295 " lgetxattr path name\n"
10300 #: ../fish/guestfish-actions.pod:2575 ../src/guestfs-actions.pod:3826
10302 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10303 "is a symlink, then this call returns an extended attribute from the symlink."
10307 #: ../fish/guestfish-actions.pod:2589
10308 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10312 #: ../fish/guestfish-actions.pod:2591
10317 #: ../fish/guestfish-actions.pod:2593
10320 " lgetxattrs path\n"
10325 #: ../fish/guestfish-actions.pod:2595
10327 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10328 "it returns the extended attributes of the link itself."
10332 #: ../fish/guestfish-actions.pod:2599
10337 #: ../fish/guestfish-actions.pod:2601
10345 #: ../fish/guestfish-actions.pod:2603 ../src/guestfs-actions.pod:3869
10347 "List all 9p filesystems attached to the guest. A list of mount tags is "
10352 #: ../fish/guestfish-actions.pod:2606
10353 msgid "list-devices"
10357 #: ../fish/guestfish-actions.pod:2608
10365 #: ../fish/guestfish-actions.pod:2610 ../src/guestfs-actions.pod:3883
10366 msgid "List all the block devices."
10370 #: ../fish/guestfish-actions.pod:2612 ../src/guestfs-actions.pod:3885
10371 msgid "The full block device names are returned, eg. C</dev/sda>."
10375 #: ../fish/guestfish-actions.pod:2616
10376 msgid "list-dm-devices"
10380 #: ../fish/guestfish-actions.pod:2618
10383 " list-dm-devices\n"
10388 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:3900
10389 msgid "List all device mapper devices."
10393 #: ../fish/guestfish-actions.pod:2622
10395 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10396 "previous call to L</luks-open>."
10400 #: ../fish/guestfish-actions.pod:2625
10402 "Device mapper devices which correspond to logical volumes are I<not> "
10403 "returned in this list. Call L</lvs> if you want to list logical volumes."
10407 #: ../fish/guestfish-actions.pod:2629
10408 msgid "list-filesystems"
10412 #: ../fish/guestfish-actions.pod:2631
10415 " list-filesystems\n"
10420 #: ../fish/guestfish-actions.pod:2633 ../src/guestfs-actions.pod:3920
10422 "This inspection command looks for filesystems on partitions, block devices "
10423 "and logical volumes, returning a list of devices containing filesystems and "
10428 #: ../fish/guestfish-actions.pod:2637 ../src/guestfs-actions.pod:3924
10430 "The return value is a hash, where the keys are the devices containing "
10431 "filesystems, and the values are the filesystem types. For example:"
10435 #: ../fish/guestfish-actions.pod:2641 ../src/guestfs-actions.pod:3928
10438 " \"/dev/sda1\" => \"ntfs\"\n"
10439 " \"/dev/sda2\" => \"ext2\"\n"
10440 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10441 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10446 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:3933
10448 "The value can have the special value \"unknown\", meaning the content of the "
10449 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10453 #: ../fish/guestfish-actions.pod:2650
10455 "This command runs other libguestfs commands, which might include L</mount> "
10456 "and L</umount>, and therefore you should use this soon after launch and only "
10457 "when nothing is mounted."
10461 #: ../fish/guestfish-actions.pod:2654
10463 "Not all of the filesystems returned will be mountable. In particular, swap "
10464 "partitions are returned in the list. Also this command does not check that "
10465 "each filesystem found is valid and mountable, and some filesystems might be "
10466 "mountable but require special options. Filesystems may not all belong to a "
10467 "single logical operating system (use L</inspect-os> to look for OSes)."
10471 #: ../fish/guestfish-actions.pod:2662
10472 msgid "list-partitions"
10476 #: ../fish/guestfish-actions.pod:2664
10479 " list-partitions\n"
10484 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:3962
10485 msgid "List all the partitions detected on all block devices."
10489 #: ../fish/guestfish-actions.pod:2668 ../src/guestfs-actions.pod:3964
10490 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10494 #: ../fish/guestfish-actions.pod:2670
10496 "This does not return logical volumes. For that you will need to call "
10501 #: ../fish/guestfish-actions.pod:2675
10506 #: ../fish/guestfish-actions.pod:2677
10514 #: ../fish/guestfish-actions.pod:2679 ../src/guestfs-actions.pod:3983
10516 "List the files in C<directory> (relative to the root directory, there is no "
10517 "cwd) in the format of 'ls -la'."
10521 #: ../fish/guestfish-actions.pod:2682 ../src/guestfs-actions.pod:3986
10523 "This command is mostly useful for interactive sessions. It is I<not> "
10524 "intended that you try to parse the output string."
10528 #: ../fish/guestfish-actions.pod:2685
10533 #: ../fish/guestfish-actions.pod:2687
10536 " ln target linkname\n"
10541 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4001
10542 msgid "This command creates a hard link using the C<ln> command."
10546 #: ../fish/guestfish-actions.pod:2691
10551 #: ../fish/guestfish-actions.pod:2693
10554 " ln-f target linkname\n"
10559 #: ../fish/guestfish-actions.pod:2695 ../src/guestfs-actions.pod:4014
10561 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10562 "option removes the link (C<linkname>) if it exists already."
10566 #: ../fish/guestfish-actions.pod:2698
10571 #: ../fish/guestfish-actions.pod:2700
10574 " ln-s target linkname\n"
10579 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4028
10580 msgid "This command creates a symbolic link using the C<ln -s> command."
10584 #: ../fish/guestfish-actions.pod:2704
10589 #: ../fish/guestfish-actions.pod:2706
10592 " ln-sf target linkname\n"
10597 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4041
10599 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
10600 "option removes the link (C<linkname>) if it exists already."
10604 #: ../fish/guestfish-actions.pod:2711
10605 msgid "lremovexattr"
10609 #: ../fish/guestfish-actions.pod:2713
10612 " lremovexattr xattr path\n"
10617 #: ../fish/guestfish-actions.pod:2715
10619 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
10620 "it removes an extended attribute of the link itself."
10624 #: ../fish/guestfish-actions.pod:2719
10629 #: ../fish/guestfish-actions.pod:2721
10637 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4069
10639 "List the files in C<directory> (relative to the root directory, there is no "
10640 "cwd). The '.' and '..' entries are not returned, but hidden files are "
10645 #: ../fish/guestfish-actions.pod:2727
10647 "This command is mostly useful for interactive sessions. Programs should "
10648 "probably use L</readdir> instead."
10652 #: ../fish/guestfish-actions.pod:2730
10657 #: ../fish/guestfish-actions.pod:2732
10660 " lsetxattr xattr val vallen path\n"
10665 #: ../fish/guestfish-actions.pod:2734
10667 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
10668 "sets an extended attribute of the link itself."
10672 #: ../fish/guestfish-actions.pod:2738
10677 #: ../fish/guestfish-actions.pod:2740
10685 #: ../fish/guestfish-actions.pod:2742 ../fish/guestfish-actions.pod:4552 ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:6890
10686 msgid "Returns file information for the given C<path>."
10690 #: ../fish/guestfish-actions.pod:2744
10692 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
10693 "the link is stat-ed, not the file it refers to."
10697 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4111
10698 msgid "This is the same as the C<lstat(2)> system call."
10702 #: ../fish/guestfish-actions.pod:2750
10707 #: ../fish/guestfish-actions.pod:2752
10710 " lstatlist path 'names ...'\n"
10715 #: ../fish/guestfish-actions.pod:2754
10717 "This call allows you to perform the L</lstat> operation on multiple files, "
10718 "where all files are in the directory C<path>. C<names> is the list of files "
10719 "from this directory."
10723 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4130
10725 "On return you get a list of stat structs, with a one-to-one correspondence "
10726 "to the C<names> list. If any name did not exist or could not be lstat'd, "
10727 "then the C<ino> field of that structure is set to C<-1>."
10731 #: ../fish/guestfish-actions.pod:2763
10733 "This call is intended for programs that want to efficiently list a directory "
10734 "contents without making many round-trips. See also L</lxattrlist> for a "
10735 "similarly efficient call for getting extended attributes. Very long "
10736 "directory listings might cause the protocol message size to be exceeded, "
10737 "causing this call to fail. The caller must split up such requests into "
10738 "smaller groups of names."
10742 #: ../fish/guestfish-actions.pod:2771
10743 msgid "luks-add-key"
10747 #: ../fish/guestfish-actions.pod:2773
10750 " luks-add-key device keyslot\n"
10755 #: ../fish/guestfish-actions.pod:2775 ../src/guestfs-actions.pod:4158
10757 "This command adds a new key on LUKS device C<device>. C<key> is any "
10758 "existing key, and is used to access the device. C<newkey> is the new key to "
10759 "add. C<keyslot> is the key slot that will be replaced."
10763 #: ../fish/guestfish-actions.pod:2780
10765 "Note that if C<keyslot> already contains a key, then this command will "
10766 "fail. You have to use L</luks-kill-slot> first to remove that key."
10770 #: ../fish/guestfish-actions.pod:2784 ../fish/guestfish-actions.pod:2806 ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2833 ../fish/guestfish-actions.pod:2859 ../fish/guestfish-actions.pod:2869
10772 "This command has one or more key or passphrase parameters. Guestfish will "
10773 "prompt for these separately."
10777 #: ../fish/guestfish-actions.pod:2787
10782 #: ../fish/guestfish-actions.pod:2789
10785 " luks-close device\n"
10790 #: ../fish/guestfish-actions.pod:2791
10792 "This closes a LUKS device that was created earlier by L</luks-open> or "
10793 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
10794 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
10795 "underlying block device."
10799 #: ../fish/guestfish-actions.pod:2797
10800 msgid "luks-format"
10804 #: ../fish/guestfish-actions.pod:2799
10807 " luks-format device keyslot\n"
10812 #: ../fish/guestfish-actions.pod:2801 ../src/guestfs-actions.pod:4199
10814 "This command erases existing data on C<device> and formats the device as a "
10815 "LUKS encrypted device. C<key> is the initial key, which is added to key "
10816 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
10820 #: ../fish/guestfish-actions.pod:2809 ../fish/guestfish-actions.pod:2822 ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:3560 ../fish/guestfish-actions.pod:4086 ../fish/guestfish-actions.pod:4423 ../fish/guestfish-actions.pod:4446 ../fish/guestfish-actions.pod:4468 ../fish/guestfish-actions.pod:5214 ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4372 ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:6253 ../src/guestfs-actions.pod:6704 ../src/guestfs-actions.pod:6734 ../src/guestfs-actions.pod:6767 ../src/guestfs-actions.pod:7966
10822 "B<This command is dangerous. Without careful use you can easily destroy all "
10827 #: ../fish/guestfish-actions.pod:2812
10828 msgid "luks-format-cipher"
10832 #: ../fish/guestfish-actions.pod:2814
10835 " luks-format-cipher device keyslot cipher\n"
10840 #: ../fish/guestfish-actions.pod:2816
10842 "This command is the same as L</luks-format> but it also allows you to set "
10843 "the C<cipher> used."
10847 #: ../fish/guestfish-actions.pod:2825
10848 msgid "luks-kill-slot"
10852 #: ../fish/guestfish-actions.pod:2827
10855 " luks-kill-slot device keyslot\n"
10860 #: ../fish/guestfish-actions.pod:2829 ../src/guestfs-actions.pod:4246
10862 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
10863 "device C<device>. C<key> must be one of the I<other> keys."
10867 #: ../fish/guestfish-actions.pod:2836
10872 #: ../fish/guestfish-actions.pod:2838
10875 " luks-open device mapname\n"
10880 #: ../fish/guestfish-actions.pod:2840 ../src/guestfs-actions.pod:4266
10882 "This command opens a block device which has been encrypted according to the "
10883 "Linux Unified Key Setup (LUKS) standard."
10887 #: ../fish/guestfish-actions.pod:2843 ../src/guestfs-actions.pod:4269
10888 msgid "C<device> is the encrypted block device or partition."
10892 #: ../fish/guestfish-actions.pod:2845 ../src/guestfs-actions.pod:4271
10894 "The caller must supply one of the keys associated with the LUKS block "
10895 "device, in the C<key> parameter."
10899 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4274
10901 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
10902 "writes to this block device are decrypted from and encrypted to the "
10903 "underlying C<device> respectively."
10907 #: ../fish/guestfish-actions.pod:2852
10909 "If this block device contains LVM volume groups, then calling L</vgscan> "
10910 "followed by L</vg-activate-all> will make them visible."
10914 #: ../fish/guestfish-actions.pod:2856
10915 msgid "Use L</list-dm-devices> to list all device mapper devices."
10919 #: ../fish/guestfish-actions.pod:2862
10920 msgid "luks-open-ro"
10924 #: ../fish/guestfish-actions.pod:2864
10927 " luks-open-ro device mapname\n"
10932 #: ../fish/guestfish-actions.pod:2866
10934 "This is the same as L</luks-open> except that a read-only mapping is "
10939 #: ../fish/guestfish-actions.pod:2872
10944 #: ../fish/guestfish-actions.pod:2874
10947 " lvcreate logvol volgroup mbytes\n"
10952 #: ../fish/guestfish-actions.pod:2876 ../src/guestfs-actions.pod:4320
10954 "This creates an LVM logical volume called C<logvol> on the volume group "
10955 "C<volgroup>, with C<size> megabytes."
10959 #: ../fish/guestfish-actions.pod:2879
10960 msgid "lvm-canonical-lv-name"
10964 #: ../fish/guestfish-actions.pod:2881
10967 " lvm-canonical-lv-name lvname\n"
10972 #: ../fish/guestfish-actions.pod:2883 ../src/guestfs-actions.pod:4333
10974 "This converts alternative naming schemes for LVs that you might find to the "
10975 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
10980 #: ../fish/guestfish-actions.pod:2887 ../src/guestfs-actions.pod:4337
10982 "This command returns an error if the C<lvname> parameter does not refer to a "
10987 #: ../fish/guestfish-actions.pod:2890
10988 msgid "See also L</is-lv>."
10992 #: ../fish/guestfish-actions.pod:2892
10993 msgid "lvm-clear-filter"
10997 #: ../fish/guestfish-actions.pod:2894
11000 " lvm-clear-filter\n"
11005 #: ../fish/guestfish-actions.pod:2896
11007 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11012 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2930 ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4397
11013 msgid "This command also clears the LVM cache and performs a volume group scan."
11017 #: ../fish/guestfish-actions.pod:2902
11018 msgid "lvm-remove-all"
11022 #: ../fish/guestfish-actions.pod:2904
11025 " lvm-remove-all\n"
11030 #: ../fish/guestfish-actions.pod:2906 ../src/guestfs-actions.pod:4367
11032 "This command removes all LVM logical volumes, volume groups and physical "
11037 #: ../fish/guestfish-actions.pod:2912
11038 msgid "lvm-set-filter"
11042 #: ../fish/guestfish-actions.pod:2914
11045 " lvm-set-filter 'devices ...'\n"
11050 #: ../fish/guestfish-actions.pod:2916 ../src/guestfs-actions.pod:4383
11052 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11053 "block devices in the list C<devices>, and will ignore all other attached "
11058 #: ../fish/guestfish-actions.pod:2920 ../src/guestfs-actions.pod:4387
11060 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11061 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11062 "there are two types of duplication possible: either cloned PVs/VGs which "
11063 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11064 "same name. In normal operation you cannot create this situation, but you "
11065 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11066 "inside the LVM metadata."
11070 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4400
11071 msgid "You can filter whole block devices or individual partitions."
11075 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4402
11077 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11078 "filesystem), even if you are not filtering out that VG."
11082 #: ../fish/guestfish-actions.pod:2939
11087 #: ../fish/guestfish-actions.pod:2941
11090 " lvremove device\n"
11095 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4416
11097 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11098 "LV, such as C</dev/VG/LV>."
11102 #: ../fish/guestfish-actions.pod:2946 ../src/guestfs-actions.pod:4419
11104 "You can also remove all LVs in a volume group by specifying the VG name, "
11109 #: ../fish/guestfish-actions.pod:2949
11114 #: ../fish/guestfish-actions.pod:2951
11117 " lvrename logvol newlogvol\n"
11122 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4433
11123 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11127 #: ../fish/guestfish-actions.pod:2955
11132 #: ../fish/guestfish-actions.pod:2957
11135 " lvresize device mbytes\n"
11140 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4446
11142 "This resizes (expands or shrinks) an existing LVM logical volume to "
11143 "C<mbytes>. When reducing, data in the reduced part is lost."
11147 #: ../fish/guestfish-actions.pod:2963
11148 msgid "lvresize-free"
11152 #: ../fish/guestfish-actions.pod:2965
11155 " lvresize-free lv percent\n"
11160 #: ../fish/guestfish-actions.pod:2967 ../src/guestfs-actions.pod:4461
11162 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11163 "remaining free space in the volume group. Commonly you would call this with "
11164 "pc = 100 which expands the logical volume as much as possible, using all "
11165 "remaining free space in the volume group."
11169 #: ../fish/guestfish-actions.pod:2973
11174 #: ../fish/guestfish-actions.pod:2975
11182 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4476
11184 "List all the logical volumes detected. This is the equivalent of the "
11185 "L<lvs(8)> command."
11189 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4479
11191 "This returns a list of the logical volume device names "
11192 "(eg. C</dev/VolGroup00/LogVol00>)."
11196 #: ../fish/guestfish-actions.pod:2983
11197 msgid "See also L</lvs-full>, L</list-filesystems>."
11201 #: ../fish/guestfish-actions.pod:2985
11206 #: ../fish/guestfish-actions.pod:2987
11214 #: ../fish/guestfish-actions.pod:2989 ../src/guestfs-actions.pod:4495
11216 "List all the logical volumes detected. This is the equivalent of the "
11217 "L<lvs(8)> command. The \"full\" version includes all fields."
11221 #: ../fish/guestfish-actions.pod:2992
11226 #: ../fish/guestfish-actions.pod:2994
11234 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4510
11235 msgid "This command returns the UUID of the LVM LV C<device>."
11239 #: ../fish/guestfish-actions.pod:2998
11244 #: ../fish/guestfish-actions.pod:3000
11247 " lxattrlist path 'names ...'\n"
11252 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4524
11254 "This call allows you to get the extended attributes of multiple files, where "
11255 "all files are in the directory C<path>. C<names> is the list of files from "
11260 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4528
11262 "On return you get a flat list of xattr structs which must be interpreted "
11263 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11264 "C<attrval> in this struct is zero-length to indicate there was an error "
11265 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11266 "number (the number of following attributes for this file, which could be "
11267 "C<\"0\">). Then after the first xattr struct are the zero or more "
11268 "attributes for the first named file. This repeats for the second and "
11269 "subsequent files."
11273 #: ../fish/guestfish-actions.pod:3016
11275 "This call is intended for programs that want to efficiently list a directory "
11276 "contents without making many round-trips. See also L</lstatlist> for a "
11277 "similarly efficient call for getting standard stats. Very long directory "
11278 "listings might cause the protocol message size to be exceeded, causing this "
11279 "call to fail. The caller must split up such requests into smaller groups of "
11284 #: ../fish/guestfish-actions.pod:3024
11289 #: ../fish/guestfish-actions.pod:3026
11297 #: ../fish/guestfish-actions.pod:3028 ../src/guestfs-actions.pod:4558
11298 msgid "Create a directory named C<path>."
11302 #: ../fish/guestfish-actions.pod:3030
11307 #: ../fish/guestfish-actions.pod:3032
11310 " mkdir-mode path mode\n"
11315 #: ../fish/guestfish-actions.pod:3034 ../src/guestfs-actions.pod:4571
11317 "This command creates a directory, setting the initial permissions of the "
11318 "directory to C<mode>."
11322 #: ../fish/guestfish-actions.pod:3037 ../src/guestfs-actions.pod:4574
11324 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11325 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11330 #: ../fish/guestfish-actions.pod:3041
11331 msgid "See also L</mkdir>, L</umask>"
11335 #: ../fish/guestfish-actions.pod:3043
11340 #: ../fish/guestfish-actions.pod:3045
11348 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4590
11350 "Create a directory named C<path>, creating any parent directories as "
11351 "necessary. This is like the C<mkdir -p> shell command."
11355 #: ../fish/guestfish-actions.pod:3050
11360 #: ../fish/guestfish-actions.pod:3052
11363 " mkdtemp template\n"
11368 #: ../fish/guestfish-actions.pod:3054 ../src/guestfs-actions.pod:4603
11370 "This command creates a temporary directory. The C<template> parameter "
11371 "should be a full pathname for the temporary directory name with the final "
11372 "six characters being \"XXXXXX\"."
11376 #: ../fish/guestfish-actions.pod:3059 ../src/guestfs-actions.pod:4608
11378 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11379 "being suitable for Windows filesystems."
11383 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4611
11384 msgid "The name of the temporary directory that was created is returned."
11388 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4614
11389 msgid "The temporary directory is created with mode 0700 and is owned by root."
11393 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4617
11395 "The caller is responsible for deleting the temporary directory and its "
11396 "contents after use."
11400 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4620
11401 msgid "See also: L<mkdtemp(3)>"
11405 #: ../fish/guestfish-actions.pod:3073
11410 #: ../fish/guestfish-actions.pod:3075
11413 " mke2fs-J fstype blocksize device journal\n"
11418 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4636
11420 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11421 "C<journal>. It is equivalent to the command:"
11425 #: ../fish/guestfish-actions.pod:3081 ../src/guestfs-actions.pod:4640
11428 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11433 #: ../fish/guestfish-actions.pod:3083
11434 msgid "See also L</mke2journal>."
11438 #: ../fish/guestfish-actions.pod:3085
11443 #: ../fish/guestfish-actions.pod:3087
11446 " mke2fs-JL fstype blocksize device label\n"
11451 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4657
11453 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11454 "the journal labeled C<label>."
11458 #: ../fish/guestfish-actions.pod:3092
11459 msgid "See also L</mke2journal-L>."
11463 #: ../fish/guestfish-actions.pod:3094
11468 #: ../fish/guestfish-actions.pod:3096
11471 " mke2fs-JU fstype blocksize device uuid\n"
11476 #: ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4675
11478 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11479 "the journal with UUID C<uuid>."
11483 #: ../fish/guestfish-actions.pod:3101
11484 msgid "See also L</mke2journal-U>."
11488 #: ../fish/guestfish-actions.pod:3103
11489 msgid "mke2journal"
11493 #: ../fish/guestfish-actions.pod:3105
11496 " mke2journal blocksize device\n"
11501 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4691
11503 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11508 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4694
11511 " mke2fs -O journal_dev -b blocksize device\n"
11516 #: ../fish/guestfish-actions.pod:3112
11517 msgid "mke2journal-L"
11521 #: ../fish/guestfish-actions.pod:3114
11524 " mke2journal-L blocksize label device\n"
11529 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4708
11530 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11534 #: ../fish/guestfish-actions.pod:3118
11535 msgid "mke2journal-U"
11539 #: ../fish/guestfish-actions.pod:3120
11542 " mke2journal-U blocksize uuid device\n"
11547 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4722
11548 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11552 #: ../fish/guestfish-actions.pod:3124
11557 #: ../fish/guestfish-actions.pod:3126
11560 " mkfifo mode path\n"
11565 #: ../fish/guestfish-actions.pod:3128
11567 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11568 "is just a convenient wrapper around L</mknod>."
11572 #: ../fish/guestfish-actions.pod:3134
11577 #: ../fish/guestfish-actions.pod:3136
11580 " mkfs fstype device\n"
11585 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4752
11587 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11588 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11592 #: ../fish/guestfish-actions.pod:3142
11597 #: ../fish/guestfish-actions.pod:3144
11600 " mkfs-b fstype blocksize device\n"
11605 #: ../fish/guestfish-actions.pod:3146
11607 "This call is similar to L</mkfs>, but it allows you to control the block "
11608 "size of the resulting filesystem. Supported block sizes depend on the "
11609 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11613 #: ../fish/guestfish-actions.pod:3151 ../fish/guestfish-actions.pod:3178 ../src/guestfs-actions.pod:4780 ../src/guestfs-actions.pod:4818
11615 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11620 #: ../fish/guestfish-actions.pod:3154
11622 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
11627 #: ../fish/guestfish-actions.pod:3161
11632 #: ../fish/guestfish-actions.pod:3163
11635 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
11636 "[sectorsize:..]\n"
11641 #: ../fish/guestfish-actions.pod:3165 ../src/guestfs-actions.pod:4805
11643 "This function creates a filesystem on C<device>. The filesystem type is "
11644 "C<fstype>, for example C<ext3>."
11648 #: ../fish/guestfish-actions.pod:3172 ../src/guestfs-actions.pod:4812
11649 msgid "C<blocksize>"
11653 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4814
11655 "The filesystem block size. Supported block sizes depend on the filesystem "
11656 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11661 #: ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:4821
11662 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
11666 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4823
11667 msgid "C<features>"
11671 #: ../fish/guestfish-actions.pod:3185 ../src/guestfs-actions.pod:4825
11672 msgid "This passes the I<-O> parameter to the external mkfs program."
11676 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4827
11678 "For certain filesystem types, this allows extra filesystem features to be "
11679 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
11683 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4831
11685 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
11690 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4834
11695 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4836
11697 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
11698 "sets the inode size (only for ext2/3/4 filesystems at present)."
11702 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4839
11703 msgid "C<sectorsize>"
11707 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4841
11709 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
11710 "sets sector size for ufs filesystem."
11714 #: ../fish/guestfish-actions.pod:3208
11715 msgid "mkmountpoint"
11719 #: ../fish/guestfish-actions.pod:3210
11722 " mkmountpoint exemptpath\n"
11727 #: ../fish/guestfish-actions.pod:3212
11729 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
11730 "to create extra mountpoints before mounting the first filesystem."
11734 #: ../fish/guestfish-actions.pod:3216 ../src/guestfs-actions.pod:4884
11736 "These calls are I<only> necessary in some very limited circumstances, mainly "
11737 "the case where you want to mount a mix of unrelated and/or read-only "
11738 "filesystems together."
11742 #: ../fish/guestfish-actions.pod:3220 ../src/guestfs-actions.pod:4888
11744 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
11745 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
11746 "inside that. You can unpack this as follows in guestfish:"
11750 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4893
11753 " add-ro Fedora-11-i686-Live.iso\n"
11755 " mkmountpoint /cd\n"
11756 " mkmountpoint /sqsh\n"
11757 " mkmountpoint /ext3fs\n"
11758 " mount /dev/sda /cd\n"
11759 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
11760 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
11765 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4902
11766 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
11770 #: ../fish/guestfish-actions.pod:3236
11772 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
11773 "unexpected errors if you try to mix these calls. It is safest to manually "
11774 "unmount filesystems and remove mountpoints after use."
11778 #: ../fish/guestfish-actions.pod:3240
11780 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
11781 "for this to work for manual mountpoints, you must ensure that the innermost "
11782 "mountpoints have the longest pathnames, as in the example code above."
11786 #: ../fish/guestfish-actions.pod:3245 ../src/guestfs-actions.pod:4913
11787 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
11791 #: ../fish/guestfish-actions.pod:3247
11793 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
11794 "L</umount-all> to be called when the handle is closed which can also trigger "
11799 #: ../fish/guestfish-actions.pod:3251
11804 #: ../fish/guestfish-actions.pod:3253
11807 " mknod mode devmajor devminor path\n"
11812 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:4932
11814 "This call creates block or character special devices, or named pipes "
11819 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4935
11821 "The C<mode> parameter should be the mode, using the standard constants. "
11822 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
11823 "used when creating block and character special devices."
11827 #: ../fish/guestfish-actions.pod:3263
11829 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
11830 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
11831 "regular file). These constants are available in the standard Linux header "
11832 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
11833 "wrappers around this command which bitwise OR in the appropriate constant "
11838 #: ../fish/guestfish-actions.pod:3273
11843 #: ../fish/guestfish-actions.pod:3275
11846 " mknod-b mode devmajor devminor path\n"
11851 #: ../fish/guestfish-actions.pod:3277
11853 "This call creates a block device node called C<path> with mode C<mode> and "
11854 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11855 "wrapper around L</mknod>."
11859 #: ../fish/guestfish-actions.pod:3283
11864 #: ../fish/guestfish-actions.pod:3285
11867 " mknod-c mode devmajor devminor path\n"
11872 #: ../fish/guestfish-actions.pod:3287
11874 "This call creates a char device node called C<path> with mode C<mode> and "
11875 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
11876 "wrapper around L</mknod>."
11880 #: ../fish/guestfish-actions.pod:3293
11885 #: ../fish/guestfish-actions.pod:3295
11893 #: ../fish/guestfish-actions.pod:3297 ../src/guestfs-actions.pod:4998
11894 msgid "Create a swap partition on C<device>."
11898 #: ../fish/guestfish-actions.pod:3299
11903 #: ../fish/guestfish-actions.pod:3301
11906 " mkswap-L label device\n"
11911 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5011
11912 msgid "Create a swap partition on C<device> with label C<label>."
11916 #: ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5013
11918 "Note that you cannot attach a swap label to a block device "
11919 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
11920 "the kernel or swap tools."
11924 #: ../fish/guestfish-actions.pod:3309
11929 #: ../fish/guestfish-actions.pod:3311
11932 " mkswap-U uuid device\n"
11937 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5028
11938 msgid "Create a swap partition on C<device> with UUID C<uuid>."
11942 #: ../fish/guestfish-actions.pod:3315
11943 msgid "mkswap-file"
11947 #: ../fish/guestfish-actions.pod:3317
11950 " mkswap-file path\n"
11955 #: ../fish/guestfish-actions.pod:3319 ../src/guestfs-actions.pod:5040
11956 msgid "Create a swap file."
11960 #: ../fish/guestfish-actions.pod:3321
11962 "This command just writes a swap file signature to an existing file. To "
11963 "create the file itself, use something like L</fallocate>."
11967 #: ../fish/guestfish-actions.pod:3324
11972 #: ../fish/guestfish-actions.pod:3326
11975 " modprobe modulename\n"
11980 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5055
11981 msgid "This loads a kernel module in the appliance."
11985 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5057
11987 "The kernel module must have been whitelisted when libguestfs was built (see "
11988 "C<appliance/kmod.whitelist.in> in the source)."
11992 #: ../fish/guestfish-actions.pod:3333
11997 #: ../fish/guestfish-actions.pod:3335
12000 " mount device mountpoint\n"
12005 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5071
12007 "Mount a guest disk at a position in the filesystem. Block devices are named "
12008 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12009 "those block devices contain partitions, they will have the usual names "
12010 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12014 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5077
12016 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12017 "mounted on C</> before others can be mounted. Other filesystems can only be "
12018 "mounted on directories which already exist."
12022 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5082
12024 "The mounted filesystem is writable, if we have sufficient permissions on the "
12025 "underlying device."
12029 #: ../fish/guestfish-actions.pod:3351
12031 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12032 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12033 "problems for users. If your program might need to work with older versions "
12034 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12035 "first parameter if you don't want any options)."
12039 #: ../fish/guestfish-actions.pod:3358
12044 #: ../fish/guestfish-actions.pod:3360
12047 " mount-9p mounttag mountpoint [options:..]\n"
12052 #: ../fish/guestfish-actions.pod:3362 ../src/guestfs-actions.pod:5111
12054 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12059 #: ../fish/guestfish-actions.pod:3365 ../src/guestfs-actions.pod:5114
12061 "If required, C<trans=virtio> will be automatically added to the options. "
12062 "Any other options required can be passed in the optional C<options> "
12067 #: ../fish/guestfish-actions.pod:3371
12072 #: ../fish/guestfish-actions.pod:3373
12075 " mount-loop file mountpoint\n"
12080 #: ../fish/guestfish-actions.pod:3375 ../src/guestfs-actions.pod:5153
12082 "This command lets you mount C<file> (a filesystem image in a file) on a "
12083 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12088 #: ../fish/guestfish-actions.pod:3379
12089 msgid "mount-options"
12093 #: ../fish/guestfish-actions.pod:3381
12096 " mount-options options device mountpoint\n"
12101 #: ../fish/guestfish-actions.pod:3383
12103 "This is the same as the L</mount> command, but it allows you to set the "
12104 "mount options as for the L<mount(8)> I<-o> flag."
12108 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5173
12110 "If the C<options> parameter is an empty string, then no options are passed "
12111 "(all options default to whatever the filesystem uses)."
12115 #: ../fish/guestfish-actions.pod:3391
12120 #: ../fish/guestfish-actions.pod:3393
12123 " mount-ro device mountpoint\n"
12128 #: ../fish/guestfish-actions.pod:3395
12130 "This is the same as the L</mount> command, but it mounts the filesystem with "
12131 "the read-only (I<-o ro>) flag."
12135 #: ../fish/guestfish-actions.pod:3398
12140 #: ../fish/guestfish-actions.pod:3400
12143 " mount-vfs options vfstype device mountpoint\n"
12148 #: ../fish/guestfish-actions.pod:3402
12150 "This is the same as the L</mount> command, but it allows you to set both the "
12151 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12155 #: ../fish/guestfish-actions.pod:3406
12156 msgid "mountpoints"
12160 #: ../fish/guestfish-actions.pod:3408
12168 #: ../fish/guestfish-actions.pod:3410
12170 "This call is similar to L</mounts>. That call returns a list of devices. "
12171 "This one returns a hash table (map) of device name to directory where the "
12172 "device is mounted."
12176 #: ../fish/guestfish-actions.pod:3414
12181 #: ../fish/guestfish-actions.pod:3416
12189 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5234
12191 "This returns the list of currently mounted filesystems. It returns the list "
12192 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12196 #: ../fish/guestfish-actions.pod:3421 ../src/guestfs-actions.pod:5237
12197 msgid "Some internal mounts are not shown."
12201 #: ../fish/guestfish-actions.pod:3423
12202 msgid "See also: L</mountpoints>"
12206 #: ../fish/guestfish-actions.pod:3425
12211 #: ../fish/guestfish-actions.pod:3427
12219 #: ../fish/guestfish-actions.pod:3429 ../src/guestfs-actions.pod:5254
12221 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12222 "destination filename or destination directory."
12226 #: ../fish/guestfish-actions.pod:3432
12227 msgid "ntfs-3g-probe"
12231 #: ../fish/guestfish-actions.pod:3434
12234 " ntfs-3g-probe true|false device\n"
12239 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5268
12241 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12242 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12243 "read-write, and some cannot be mounted at all)."
12247 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5272
12249 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12250 "can be mounted read-write. Set it to false if you want to test if the "
12251 "volume can be mounted read-only."
12255 #: ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:5276
12257 "The return value is an integer which C<0> if the operation would succeed, or "
12258 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12262 #: ../fish/guestfish-actions.pod:3448
12267 #: ../fish/guestfish-actions.pod:3450
12270 " ntfsresize device\n"
12275 #: ../fish/guestfish-actions.pod:3452 ../fish/guestfish-actions.pod:3476 ../src/guestfs-actions.pod:5297 ../src/guestfs-actions.pod:5329
12277 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12278 "size of the underlying device."
12282 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5300
12284 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12285 "consistency check (for safety). You have to boot into Windows to perform "
12286 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12287 "resize filesystems which have been marked in this way. So in effect it is "
12288 "not possible to call ntfsresize multiple times on a single filesystem "
12289 "without booting into Windows between each resize."
12293 #: ../fish/guestfish-actions.pod:3463 ../fish/guestfish-actions.pod:3502 ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5355
12294 msgid "See also L<ntfsresize(8)>."
12298 #: ../fish/guestfish-actions.pod:3465 ../fish/guestfish-actions.pod:3513
12300 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12305 #: ../fish/guestfish-actions.pod:3472
12306 msgid "ntfsresize-opts"
12310 #: ../fish/guestfish-actions.pod:3474
12313 " ntfsresize-opts device [size:..] [force:..]\n"
12318 #: ../fish/guestfish-actions.pod:3485 ../src/guestfs-actions.pod:5338
12320 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12321 "resized to fit the container (eg. partition)."
12325 #: ../fish/guestfish-actions.pod:3488 ../src/guestfs-actions.pod:5341
12330 #: ../fish/guestfish-actions.pod:3490 ../src/guestfs-actions.pod:5343
12332 "If this option is true, then force the resize of the filesystem even if the "
12333 "filesystem is marked as requiring a consistency check."
12337 #: ../fish/guestfish-actions.pod:3493
12339 "After the resize operation, the filesystem is always marked as requiring a "
12340 "consistency check (for safety). You have to boot into Windows to perform "
12341 "this check and clear this condition. If you I<don't> set the C<force> "
12342 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12343 "a single filesystem without booting into Windows between each resize."
12347 #: ../fish/guestfish-actions.pod:3506
12348 msgid "ntfsresize-size"
12352 #: ../fish/guestfish-actions.pod:3508
12355 " ntfsresize-size device size\n"
12360 #: ../fish/guestfish-actions.pod:3510
12362 "This command is the same as L</ntfsresize> except that it allows you to "
12363 "specify the new size (in bytes) explicitly."
12367 #: ../fish/guestfish-actions.pod:3520
12372 #: ../fish/guestfish-actions.pod:3522
12375 " part-add device prlogex startsect endsect\n"
12380 #: ../fish/guestfish-actions.pod:3524
12382 "This command adds a partition to C<device>. If there is no partition table "
12383 "on the device, call L</part-init> first."
12387 #: ../fish/guestfish-actions.pod:3527 ../src/guestfs-actions.pod:5416
12389 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12390 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12391 "C<logical>) and C<e> (or C<extended>) partition types."
12395 #: ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:5421
12397 "C<startsect> and C<endsect> are the start and end of the partition in "
12398 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12399 "from the end of the disk (C<-1> is the last sector)."
12403 #: ../fish/guestfish-actions.pod:3536
12405 "Creating a partition which covers the whole disk is not so easy. Use "
12406 "L</part-disk> to do that."
12410 #: ../fish/guestfish-actions.pod:3539
12415 #: ../fish/guestfish-actions.pod:3541
12418 " part-del device partnum\n"
12423 #: ../fish/guestfish-actions.pod:3543 ../src/guestfs-actions.pod:5439
12424 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12428 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5441
12430 "Note that in the case of MBR partitioning, deleting an extended partition "
12431 "also deletes any logical partitions it contains."
12435 #: ../fish/guestfish-actions.pod:3549
12440 #: ../fish/guestfish-actions.pod:3551
12443 " part-disk device parttype\n"
12448 #: ../fish/guestfish-actions.pod:3553
12450 "This command is simply a combination of L</part-init> followed by "
12451 "L</part-add> to create a single primary partition covering the whole disk."
12455 #: ../fish/guestfish-actions.pod:3557
12457 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12458 "possible values are described in L</part-init>."
12462 #: ../fish/guestfish-actions.pod:3563
12463 msgid "part-get-bootable"
12467 #: ../fish/guestfish-actions.pod:3565
12470 " part-get-bootable device partnum\n"
12475 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5477
12477 "This command returns true if the partition C<partnum> on C<device> has the "
12478 "bootable flag set."
12482 #: ../fish/guestfish-actions.pod:3570
12483 msgid "See also L</part-set-bootable>."
12487 #: ../fish/guestfish-actions.pod:3572
12488 msgid "part-get-mbr-id"
12492 #: ../fish/guestfish-actions.pod:3574
12495 " part-get-mbr-id device partnum\n"
12500 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5493
12502 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12503 "partition C<partnum>."
12507 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3723
12509 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12510 "undefined results for other partition table types (see "
12511 "L</part-get-parttype>)."
12515 #: ../fish/guestfish-actions.pod:3583
12516 msgid "part-get-parttype"
12520 #: ../fish/guestfish-actions.pod:3585
12523 " part-get-parttype device\n"
12528 #: ../fish/guestfish-actions.pod:3587 ../src/guestfs-actions.pod:5510
12530 "This command examines the partition table on C<device> and returns the "
12531 "partition table type (format) being used."
12535 #: ../fish/guestfish-actions.pod:3590
12537 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12538 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12539 "possible, although unusual. See L</part-init> for a full list."
12543 #: ../fish/guestfish-actions.pod:3595
12548 #: ../fish/guestfish-actions.pod:3597
12551 " part-init device parttype\n"
12556 #: ../fish/guestfish-actions.pod:3599 ../src/guestfs-actions.pod:5530
12558 "This creates an empty partition table on C<device> of one of the partition "
12559 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12560 "(for large disks)."
12564 #: ../fish/guestfish-actions.pod:3603
12566 "Initially there are no partitions. Following this, you should call "
12567 "L</part-add> for each partition required."
12571 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5537
12572 msgid "Possible values for C<parttype> are:"
12576 #: ../fish/guestfish-actions.pod:3610 ../src/guestfs-actions.pod:5541
12581 #: ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5543
12586 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5545
12587 msgid "Intel EFI / GPT partition table."
12591 #: ../fish/guestfish-actions.pod:3616 ../src/guestfs-actions.pod:5547
12593 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12594 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12595 "the C<mbr> format."
12599 #: ../fish/guestfish-actions.pod:3620 ../src/guestfs-actions.pod:5551
12604 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5553
12609 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5555
12611 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12612 "Windows. This partition type will B<only> work for device sizes up to 2 "
12613 "TB. For large disks we recommend using C<gpt>."
12617 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5562
12618 msgid "Other partition table types that may work but are not supported include:"
12622 #: ../fish/guestfish-actions.pod:3636 ../src/guestfs-actions.pod:5567
12627 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5569
12628 msgid "AIX disk labels."
12632 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5571
12637 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5573
12642 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5575
12643 msgid "Amiga \"Rigid Disk Block\" format."
12647 #: ../fish/guestfish-actions.pod:3646 ../src/guestfs-actions.pod:5577
12652 #: ../fish/guestfish-actions.pod:3648 ../src/guestfs-actions.pod:5579
12653 msgid "BSD disk labels."
12657 #: ../fish/guestfish-actions.pod:3650 ../src/guestfs-actions.pod:5581
12662 #: ../fish/guestfish-actions.pod:3652 ../src/guestfs-actions.pod:5583
12663 msgid "DASD, used on IBM mainframes."
12667 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5585
12672 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5587
12673 msgid "MIPS/SGI volumes."
12677 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5589
12682 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5591
12683 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12687 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5593
12692 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5595
12693 msgid "NEC PC-98 format, common in Japan apparently."
12697 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5597
12702 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5599
12703 msgid "Sun disk labels."
12707 #: ../fish/guestfish-actions.pod:3672
12712 #: ../fish/guestfish-actions.pod:3674
12715 " part-list device\n"
12720 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5613
12722 "This command parses the partition table on C<device> and returns the list of "
12723 "partitions found."
12727 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5616
12728 msgid "The fields in the returned structure are:"
12732 #: ../fish/guestfish-actions.pod:3683 ../src/guestfs-actions.pod:5620
12733 msgid "B<part_num>"
12737 #: ../fish/guestfish-actions.pod:3685 ../src/guestfs-actions.pod:5622
12738 msgid "Partition number, counting from 1."
12742 #: ../fish/guestfish-actions.pod:3687 ../src/guestfs-actions.pod:5624
12743 msgid "B<part_start>"
12747 #: ../fish/guestfish-actions.pod:3689
12749 "Start of the partition I<in bytes>. To get sectors you have to divide by "
12750 "the device's sector size, see L</blockdev-getss>."
12754 #: ../fish/guestfish-actions.pod:3692 ../src/guestfs-actions.pod:5629
12755 msgid "B<part_end>"
12759 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5631
12760 msgid "End of the partition in bytes."
12764 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5633
12765 msgid "B<part_size>"
12769 #: ../fish/guestfish-actions.pod:3698 ../src/guestfs-actions.pod:5635
12770 msgid "Size of the partition in bytes."
12774 #: ../fish/guestfish-actions.pod:3702
12775 msgid "part-set-bootable"
12779 #: ../fish/guestfish-actions.pod:3704
12782 " part-set-bootable device partnum true|false\n"
12787 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5653
12789 "This sets the bootable flag on partition numbered C<partnum> on device "
12790 "C<device>. Note that partitions are numbered from 1."
12794 #: ../fish/guestfish-actions.pod:3709 ../src/guestfs-actions.pod:5656
12796 "The bootable flag is used by some operating systems (notably Windows) to "
12797 "determine which partition to boot from. It is by no means universally "
12802 #: ../fish/guestfish-actions.pod:3713
12803 msgid "part-set-mbr-id"
12807 #: ../fish/guestfish-actions.pod:3715
12810 " part-set-mbr-id device partnum idbyte\n"
12815 #: ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5672
12817 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
12818 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
12819 "documentation are in fact hexadecimal numbers, but usually documented "
12820 "without any leading \"0x\" which might be confusing."
12824 #: ../fish/guestfish-actions.pod:3727
12825 msgid "part-set-name"
12829 #: ../fish/guestfish-actions.pod:3729
12832 " part-set-name device partnum name\n"
12837 #: ../fish/guestfish-actions.pod:3731 ../src/guestfs-actions.pod:5694
12839 "This sets the partition name on partition numbered C<partnum> on device "
12840 "C<device>. Note that partitions are numbered from 1."
12844 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5697
12846 "The partition name can only be set on certain types of partition table. "
12847 "This works on C<gpt> but not on C<mbr> partitions."
12851 #: ../fish/guestfish-actions.pod:3737
12852 msgid "part-to-dev"
12856 #: ../fish/guestfish-actions.pod:3739
12859 " part-to-dev partition\n"
12864 #: ../fish/guestfish-actions.pod:3741 ../src/guestfs-actions.pod:5710
12866 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
12867 "partition number, returning the device name (eg. \"/dev/sdb\")."
12871 #: ../fish/guestfish-actions.pod:3745
12873 "The named partition must exist, for example as a string returned from "
12874 "L</list-partitions>."
12878 #: ../fish/guestfish-actions.pod:3748
12879 msgid "ping-daemon"
12883 #: ../fish/guestfish-actions.pod:3750
12891 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5727
12893 "This is a test probe into the guestfs daemon running inside the qemu "
12894 "subprocess. Calling this function checks that the daemon responds to the "
12895 "ping message, without affecting the daemon or attached block device(s) in "
12900 #: ../fish/guestfish-actions.pod:3757
12905 #: ../fish/guestfish-actions.pod:3759
12908 " pread path count offset\n"
12913 #: ../fish/guestfish-actions.pod:3761 ../src/guestfs-actions.pod:5745
12915 "This command lets you read part of a file. It reads C<count> bytes of the "
12916 "file, starting at C<offset>, from file C<path>."
12920 #: ../fish/guestfish-actions.pod:3764 ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5748 ../src/guestfs-actions.pod:5774
12922 "This may read fewer bytes than requested. For further details see the "
12923 "L<pread(2)> system call."
12927 #: ../fish/guestfish-actions.pod:3767
12928 msgid "See also L</pwrite>, L</pread-device>."
12932 #: ../fish/guestfish-actions.pod:3772
12933 msgid "pread-device"
12937 #: ../fish/guestfish-actions.pod:3774
12940 " pread-device device count offset\n"
12945 #: ../fish/guestfish-actions.pod:3776 ../src/guestfs-actions.pod:5771
12947 "This command lets you read part of a file. It reads C<count> bytes of "
12948 "C<device>, starting at C<offset>."
12952 #: ../fish/guestfish-actions.pod:3782
12953 msgid "See also L</pread>."
12957 #: ../fish/guestfish-actions.pod:3787
12962 #: ../fish/guestfish-actions.pod:3789
12965 " pvcreate device\n"
12970 #: ../fish/guestfish-actions.pod:3791 ../src/guestfs-actions.pod:5794
12972 "This creates an LVM physical volume on the named C<device>, where C<device> "
12973 "should usually be a partition name such as C</dev/sda1>."
12977 #: ../fish/guestfish-actions.pod:3795
12982 #: ../fish/guestfish-actions.pod:3797
12985 " pvremove device\n"
12990 #: ../fish/guestfish-actions.pod:3799 ../src/guestfs-actions.pod:5808
12992 "This wipes a physical volume C<device> so that LVM will no longer recognise "
12997 #: ../fish/guestfish-actions.pod:3802 ../src/guestfs-actions.pod:5811
12999 "The implementation uses the C<pvremove> command which refuses to wipe "
13000 "physical volumes that contain any volume groups, so you have to remove those "
13005 #: ../fish/guestfish-actions.pod:3806
13010 #: ../fish/guestfish-actions.pod:3808
13013 " pvresize device\n"
13018 #: ../fish/guestfish-actions.pod:3810 ../src/guestfs-actions.pod:5825
13020 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13021 "the new size of the underlying device."
13025 #: ../fish/guestfish-actions.pod:3813
13026 msgid "pvresize-size"
13030 #: ../fish/guestfish-actions.pod:3815
13033 " pvresize-size device size\n"
13038 #: ../fish/guestfish-actions.pod:3817
13040 "This command is the same as L</pvresize> except that it allows you to "
13041 "specify the new size (in bytes) explicitly."
13045 #: ../fish/guestfish-actions.pod:3820
13050 #: ../fish/guestfish-actions.pod:3822
13058 #: ../fish/guestfish-actions.pod:3824 ../src/guestfs-actions.pod:5851
13060 "List all the physical volumes detected. This is the equivalent of the "
13061 "L<pvs(8)> command."
13065 #: ../fish/guestfish-actions.pod:3827 ../src/guestfs-actions.pod:5854
13067 "This returns a list of just the device names that contain PVs "
13068 "(eg. C</dev/sda2>)."
13072 #: ../fish/guestfish-actions.pod:3830
13073 msgid "See also L</pvs-full>."
13077 #: ../fish/guestfish-actions.pod:3832
13082 #: ../fish/guestfish-actions.pod:3834
13090 #: ../fish/guestfish-actions.pod:3836 ../src/guestfs-actions.pod:5870
13092 "List all the physical volumes detected. This is the equivalent of the "
13093 "L<pvs(8)> command. The \"full\" version includes all fields."
13097 #: ../fish/guestfish-actions.pod:3839
13102 #: ../fish/guestfish-actions.pod:3841
13110 #: ../fish/guestfish-actions.pod:3843 ../src/guestfs-actions.pod:5885
13111 msgid "This command returns the UUID of the LVM PV C<device>."
13115 #: ../fish/guestfish-actions.pod:3845
13120 #: ../fish/guestfish-actions.pod:3847
13123 " pwrite path content offset\n"
13128 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5901
13130 "This command writes to part of a file. It writes the data buffer C<content> "
13131 "to the file C<path> starting at offset C<offset>."
13135 #: ../fish/guestfish-actions.pod:3852 ../src/guestfs-actions.pod:5904
13137 "This command implements the L<pwrite(2)> system call, and like that system "
13138 "call it may not write the full data requested. The return value is the "
13139 "number of bytes that were actually written to the file. This could even be "
13140 "0, although short writes are unlikely for regular files in ordinary "
13145 #: ../fish/guestfish-actions.pod:3858
13146 msgid "See also L</pread>, L</pwrite-device>."
13150 #: ../fish/guestfish-actions.pod:3863
13151 msgid "pwrite-device"
13155 #: ../fish/guestfish-actions.pod:3865
13158 " pwrite-device device content offset\n"
13163 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5928
13165 "This command writes to part of a device. It writes the data buffer "
13166 "C<content> to C<device> starting at offset C<offset>."
13170 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5931
13172 "This command implements the L<pwrite(2)> system call, and like that system "
13173 "call it may not write the full data requested (although short writes to disk "
13174 "devices and partitions are probably impossible with standard Linux kernels)."
13178 #: ../fish/guestfish-actions.pod:3875
13179 msgid "See also L</pwrite>."
13183 #: ../fish/guestfish-actions.pod:3880
13188 #: ../fish/guestfish-actions.pod:3882
13191 " read-file path\n"
13196 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:5952
13197 msgid "This calls returns the contents of the file C<path> as a buffer."
13201 #: ../fish/guestfish-actions.pod:3887
13203 "Unlike L</cat>, this function can correctly handle files that contain "
13204 "embedded ASCII NUL characters. However unlike L</download>, this function "
13205 "is limited in the total size of file that can be handled."
13209 #: ../fish/guestfish-actions.pod:3895
13214 #: ../fish/guestfish-actions.pod:3897
13217 " read-lines path\n"
13222 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:5977
13224 "The file contents are returned as a list of lines. Trailing C<LF> and "
13225 "C<CRLF> character sequences are I<not> returned."
13229 #: ../fish/guestfish-actions.pod:3904
13231 "Note that this function cannot correctly handle binary files (specifically, "
13232 "files containing C<\\0> character which is treated as end of line). For "
13233 "those you need to use the L</read-file> function which has a more complex "
13238 #: ../fish/guestfish-actions.pod:3909
13243 #: ../fish/guestfish-actions.pod:3911
13251 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:5997
13252 msgid "This returns the list of directory entries in directory C<dir>."
13256 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:5999
13258 "All entries in the directory are returned, including C<.> and C<..>. The "
13259 "entries are I<not> sorted, but returned in the same order as the underlying "
13264 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:6003
13266 "Also this call returns basic file type information about each file. The "
13267 "C<ftyp> field will contain one of the following characters:"
13271 #: ../fish/guestfish-actions.pod:3924 ../src/guestfs-actions.pod:6008
13276 #: ../fish/guestfish-actions.pod:3926 ../src/guestfs-actions.pod:6010
13277 msgid "Block special"
13281 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6012
13286 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:6014
13287 msgid "Char special"
13291 #: ../fish/guestfish-actions.pod:3932 ../src/guestfs-actions.pod:6016
13296 #: ../fish/guestfish-actions.pod:3934 ../src/guestfs-actions.pod:6018
13301 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:6020
13306 #: ../fish/guestfish-actions.pod:3938 ../src/guestfs-actions.pod:6022
13307 msgid "FIFO (named pipe)"
13311 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6024
13316 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6026
13317 msgid "Symbolic link"
13321 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6028
13326 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6030
13327 msgid "Regular file"
13331 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6032
13336 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6034
13341 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6036
13346 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6038
13347 msgid "Unknown file type"
13351 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6040
13356 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6042
13357 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13361 #: ../fish/guestfish-actions.pod:3963
13363 "This function is primarily intended for use by programs. To get a simple "
13364 "list of names, use L</ls>. To get a printable directory for human "
13365 "consumption, use L</ll>."
13369 #: ../fish/guestfish-actions.pod:3967
13374 #: ../fish/guestfish-actions.pod:3969
13382 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6063
13383 msgid "This command reads the target of a symbolic link."
13387 #: ../fish/guestfish-actions.pod:3973
13388 msgid "readlinklist"
13392 #: ../fish/guestfish-actions.pod:3975
13395 " readlinklist path 'names ...'\n"
13400 #: ../fish/guestfish-actions.pod:3977 ../src/guestfs-actions.pod:6077
13402 "This call allows you to do a C<readlink> operation on multiple files, where "
13403 "all files are in the directory C<path>. C<names> is the list of files from "
13408 #: ../fish/guestfish-actions.pod:3981 ../src/guestfs-actions.pod:6081
13410 "On return you get a list of strings, with a one-to-one correspondence to the "
13411 "C<names> list. Each string is the value of the symbolic link."
13415 #: ../fish/guestfish-actions.pod:3985 ../src/guestfs-actions.pod:6085
13417 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13418 "result string is the empty string C<\"\">. However the whole operation is "
13419 "completed even if there were C<readlink(2)> errors, and so you can call this "
13420 "function with names where you don't know if they are symbolic links already "
13421 "(albeit slightly less efficient)."
13425 #: ../fish/guestfish-actions.pod:3992 ../src/guestfs-actions.pod:6092
13427 "This call is intended for programs that want to efficiently list a directory "
13428 "contents without making many round-trips. Very long directory listings "
13429 "might cause the protocol message size to be exceeded, causing this call to "
13430 "fail. The caller must split up such requests into smaller groups of names."
13434 #: ../fish/guestfish-actions.pod:3999
13439 #: ../fish/guestfish-actions.pod:4001
13447 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6111
13449 "Return the canonicalized absolute pathname of C<path>. The returned path "
13450 "has no C<.>, C<..> or symbolic link path elements."
13454 #: ../fish/guestfish-actions.pod:4006
13455 msgid "removexattr"
13459 #: ../fish/guestfish-actions.pod:4008
13462 " removexattr xattr path\n"
13467 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6126
13468 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
13472 #: ../fish/guestfish-actions.pod:4013
13473 msgid "See also: L</lremovexattr>, L<attr(5)>."
13477 #: ../fish/guestfish-actions.pod:4015
13482 #: ../fish/guestfish-actions.pod:4017
13485 " resize2fs device\n"
13490 #: ../fish/guestfish-actions.pod:4019 ../src/guestfs-actions.pod:6141
13492 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13493 "underlying device."
13497 #: ../fish/guestfish-actions.pod:4022
13499 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13500 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13501 "gives an error about this and sometimes not. In any case, it is always safe "
13502 "to call L</e2fsck-f> before calling this function."
13506 #: ../fish/guestfish-actions.pod:4028
13507 msgid "resize2fs-M"
13511 #: ../fish/guestfish-actions.pod:4030
13514 " resize2fs-M device\n"
13519 #: ../fish/guestfish-actions.pod:4032
13521 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13522 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13527 #: ../fish/guestfish-actions.pod:4036
13529 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13530 "and read the C<Block size> and C<Block count> values. These two numbers, "
13531 "multiplied together, give the resulting size of the minimal filesystem in "
13536 #: ../fish/guestfish-actions.pod:4041
13537 msgid "resize2fs-size"
13541 #: ../fish/guestfish-actions.pod:4043
13544 " resize2fs-size device size\n"
13549 #: ../fish/guestfish-actions.pod:4045
13551 "This command is the same as L</resize2fs> except that it allows you to "
13552 "specify the new size (in bytes) explicitly."
13556 #: ../fish/guestfish-actions.pod:4048
13561 #: ../fish/guestfish-actions.pod:4050
13569 #: ../fish/guestfish-actions.pod:4052 ../src/guestfs-actions.pod:6193
13570 msgid "Remove the single file C<path>."
13574 #: ../fish/guestfish-actions.pod:4054
13579 #: ../fish/guestfish-actions.pod:4056
13587 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6205
13589 "Remove the file or directory C<path>, recursively removing the contents if "
13590 "its a directory. This is like the C<rm -rf> shell command."
13594 #: ../fish/guestfish-actions.pod:4062
13599 #: ../fish/guestfish-actions.pod:4064
13607 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6219
13608 msgid "Remove the single directory C<path>."
13612 #: ../fish/guestfish-actions.pod:4068
13613 msgid "rmmountpoint"
13617 #: ../fish/guestfish-actions.pod:4070
13620 " rmmountpoint exemptpath\n"
13625 #: ../fish/guestfish-actions.pod:4072
13627 "This calls removes a mountpoint that was previously created with "
13628 "L</mkmountpoint>. See L</mkmountpoint> for full details."
13632 #: ../fish/guestfish-actions.pod:4076
13633 msgid "scrub-device"
13637 #: ../fish/guestfish-actions.pod:4078
13640 " scrub-device device\n"
13645 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6245
13647 "This command writes patterns over C<device> to make data retrieval more "
13652 #: ../fish/guestfish-actions.pod:4083 ../fish/guestfish-actions.pod:4098 ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6248 ../src/guestfs-actions.pod:6269 ../src/guestfs-actions.pod:6288
13654 "It is an interface to the L<scrub(1)> program. See that manual page for "
13659 #: ../fish/guestfish-actions.pod:4089
13664 #: ../fish/guestfish-actions.pod:4091
13667 " scrub-file file\n"
13672 #: ../fish/guestfish-actions.pod:4093 ../src/guestfs-actions.pod:6264
13674 "This command writes patterns over a file to make data retrieval more "
13679 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6267
13680 msgid "The file is I<removed> after scrubbing."
13684 #: ../fish/guestfish-actions.pod:4101
13685 msgid "scrub-freespace"
13689 #: ../fish/guestfish-actions.pod:4103
13692 " scrub-freespace dir\n"
13697 #: ../fish/guestfish-actions.pod:4105
13699 "This command creates the directory C<dir> and then fills it with files until "
13700 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
13701 "deletes them. The intention is to scrub any free space on the partition "
13702 "containing C<dir>."
13706 #: ../fish/guestfish-actions.pod:4114
13711 #: ../fish/guestfish-actions.pod:4116
13716 #: ../fish/guestfish-actions.pod:4118
13719 " set-append append\n"
13724 #: ../fish/guestfish-actions.pod:4120 ../src/guestfs-actions.pod:6301
13726 "This function is used to add additional options to the guest kernel command "
13731 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6304
13733 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
13734 "environment variable."
13738 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6307
13740 "Setting C<append> to C<NULL> means I<no> additional options are passed "
13741 "(libguestfs always adds a few of its own)."
13745 #: ../fish/guestfish-actions.pod:4129
13746 msgid "set-attach-method"
13750 #: ../fish/guestfish-actions.pod:4131
13751 msgid "attach-method"
13755 #: ../fish/guestfish-actions.pod:4133
13758 " set-attach-method attachmethod\n"
13763 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6320
13765 "Set the method that libguestfs uses to connect to the back end guestfsd "
13766 "daemon. Possible methods are:"
13770 #: ../fish/guestfish-actions.pod:4140 ../src/guestfs-actions.pod:6325 ../src/guestfs.pod:2901
13771 msgid "C<appliance>"
13775 #: ../fish/guestfish-actions.pod:4142 ../src/guestfs-actions.pod:6327
13777 "Launch an appliance and connect to it. This is the ordinary method and the "
13782 #: ../fish/guestfish-actions.pod:4145 ../src/guestfs-actions.pod:6330
13783 msgid "C<unix:I<path>>"
13787 #: ../fish/guestfish-actions.pod:4147 ../src/guestfs-actions.pod:6332
13788 msgid "Connect to the Unix domain socket I<path>."
13792 #: ../fish/guestfish-actions.pod:4149 ../src/guestfs-actions.pod:6334
13794 "This method lets you connect to an existing daemon or (using virtio-serial) "
13795 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
13796 "RUNNING DAEMONS>."
13800 #: ../fish/guestfish-actions.pod:4155
13801 msgid "set-autosync"
13805 #: ../fish/guestfish-actions.pod:4157
13810 #: ../fish/guestfish-actions.pod:4159
13813 " set-autosync true|false\n"
13818 #: ../fish/guestfish-actions.pod:4161 ../src/guestfs-actions.pod:6350
13820 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
13821 "effort attempt to make filesystems consistent and synchronized when the "
13822 "handle is closed (also if the program exits without closing handles)."
13826 #: ../fish/guestfish-actions.pod:4166 ../src/guestfs-actions.pod:6355
13828 "This is enabled by default (since libguestfs 1.5.24, previously it was "
13829 "disabled by default)."
13833 #: ../fish/guestfish-actions.pod:4169
13838 #: ../fish/guestfish-actions.pod:4171
13843 #: ../fish/guestfish-actions.pod:4173
13846 " set-direct true|false\n"
13851 #: ../fish/guestfish-actions.pod:4175 ../src/guestfs-actions.pod:6368
13853 "If the direct appliance mode flag is enabled, then stdin and stdout are "
13854 "passed directly through to the appliance once it is launched."
13858 #: ../fish/guestfish-actions.pod:4179
13860 "One consequence of this is that log messages aren't caught by the library "
13861 "and handled by L</set-log-message-callback>, but go straight to stdout."
13865 #: ../fish/guestfish-actions.pod:4183 ../src/guestfs-actions.pod:6376
13866 msgid "You probably don't want to use this unless you know what you are doing."
13870 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6379
13871 msgid "The default is disabled."
13875 #: ../fish/guestfish-actions.pod:4188
13876 msgid "set-e2label"
13880 #: ../fish/guestfish-actions.pod:4190
13883 " set-e2label device label\n"
13888 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6392
13890 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
13891 "C<label>. Filesystem labels are limited to 16 characters."
13895 #: ../fish/guestfish-actions.pod:4196
13897 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
13898 "label on a filesystem."
13902 #: ../fish/guestfish-actions.pod:4199
13907 #: ../fish/guestfish-actions.pod:4201
13910 " set-e2uuid device uuid\n"
13915 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6410
13917 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
13918 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
13919 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
13923 #: ../fish/guestfish-actions.pod:4208
13925 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
13926 "UUID of a filesystem."
13930 #: ../fish/guestfish-actions.pod:4211
13931 msgid "set-memsize"
13935 #: ../fish/guestfish-actions.pod:4213
13940 #: ../fish/guestfish-actions.pod:4215
13943 " set-memsize memsize\n"
13948 #: ../fish/guestfish-actions.pod:4217
13950 "This sets the memory size in megabytes allocated to the qemu subprocess. "
13951 "This only has any effect if called before L</launch>."
13955 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6432
13957 "You can also change this by setting the environment variable "
13958 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
13962 #: ../fish/guestfish-actions.pod:4228
13963 msgid "set-network"
13967 #: ../fish/guestfish-actions.pod:4230
13972 #: ../fish/guestfish-actions.pod:4232
13975 " set-network true|false\n"
13980 #: ../fish/guestfish-actions.pod:4234 ../src/guestfs-actions.pod:6449
13982 "If C<network> is true, then the network is enabled in the libguestfs "
13983 "appliance. The default is false."
13987 #: ../fish/guestfish-actions.pod:4237 ../src/guestfs-actions.pod:6452
13989 "This affects whether commands are able to access the network (see "
13990 "L<guestfs(3)/RUNNING COMMANDS>)."
13994 #: ../fish/guestfish-actions.pod:4240
13995 msgid "You must call this before calling L</launch>, otherwise it has no effect."
13999 #: ../fish/guestfish-actions.pod:4243
14004 #: ../fish/guestfish-actions.pod:4247
14007 " set-path searchpath\n"
14012 #: ../fish/guestfish-actions.pod:4249 ../src/guestfs-actions.pod:6468
14013 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14017 #: ../fish/guestfish-actions.pod:4251 ../src/guestfs-actions.pod:6470
14019 "The default is C<$libdir/guestfs> unless overridden by setting "
14020 "C<LIBGUESTFS_PATH> environment variable."
14024 #: ../fish/guestfish-actions.pod:4254 ../src/guestfs-actions.pod:6473
14025 msgid "Setting C<path> to C<NULL> restores the default path."
14029 #: ../fish/guestfish-actions.pod:4256
14034 #: ../fish/guestfish-actions.pod:4258
14039 #: ../fish/guestfish-actions.pod:4260
14042 " set-pgroup true|false\n"
14047 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6485
14049 "If C<pgroup> is true, child processes are placed into their own process "
14054 #: ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:6488
14056 "The practical upshot of this is that signals like C<SIGINT> (from users "
14057 "pressing C<^C>) won't be received by the child process."
14061 #: ../fish/guestfish-actions.pod:4268 ../src/guestfs-actions.pod:6491
14063 "The default for this flag is false, because usually you want C<^C> to kill "
14068 #: ../fish/guestfish-actions.pod:4271
14073 #: ../fish/guestfish-actions.pod:4273
14078 #: ../fish/guestfish-actions.pod:4275
14086 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6504
14087 msgid "Set the qemu binary that we will use."
14091 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6506
14092 msgid "The default is chosen when the library was compiled by the configure script."
14096 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6509
14098 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14103 #: ../fish/guestfish-actions.pod:4285 ../src/guestfs-actions.pod:6512
14104 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14108 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6514
14110 "Note that you should call this function as early as possible after creating "
14111 "the handle. This is because some pre-launch operations depend on testing "
14112 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14113 "don't retest features, and so you might see inconsistent results. Using the "
14114 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14115 "the qemu binary at the same time as the handle is created."
14119 #: ../fish/guestfish-actions.pod:4295
14120 msgid "set-recovery-proc"
14124 #: ../fish/guestfish-actions.pod:4297
14125 msgid "recovery-proc"
14129 #: ../fish/guestfish-actions.pod:4299
14132 " set-recovery-proc true|false\n"
14137 #: ../fish/guestfish-actions.pod:4301
14139 "If this is called with the parameter C<false> then L</launch> does not "
14140 "create a recovery process. The purpose of the recovery process is to stop "
14141 "runaway qemu processes in the case where the main program aborts abruptly."
14145 #: ../fish/guestfish-actions.pod:4306
14147 "This only has any effect if called before L</launch>, and the default is "
14152 #: ../fish/guestfish-actions.pod:4309 ../src/guestfs-actions.pod:6540
14154 "About the only time when you would want to disable this is if the main "
14155 "process will fork itself into the background (\"daemonize\" itself). In "
14156 "this case the recovery process thinks that the main program has disappeared "
14157 "and so kills qemu, which is not very helpful."
14161 #: ../fish/guestfish-actions.pod:4315
14162 msgid "set-selinux"
14166 #: ../fish/guestfish-actions.pod:4317
14171 #: ../fish/guestfish-actions.pod:4319
14174 " set-selinux true|false\n"
14179 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6556
14181 "This sets the selinux flag that is passed to the appliance at boot time. "
14182 "The default is C<selinux=0> (disabled)."
14186 #: ../fish/guestfish-actions.pod:4324 ../src/guestfs-actions.pod:6559
14188 "Note that if SELinux is enabled, it is always in Permissive mode "
14189 "(C<enforcing=0>)."
14193 #: ../fish/guestfish-actions.pod:4330
14198 #: ../fish/guestfish-actions.pod:4332
14203 #: ../fish/guestfish-actions.pod:4334
14211 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6575
14213 "Change the number of virtual CPUs assigned to the appliance. The default is "
14214 "C<1>. Increasing this may improve performance, though often it has no "
14219 #: ../fish/guestfish-actions.pod:4340
14220 msgid "This function must be called before L</launch>."
14224 #: ../fish/guestfish-actions.pod:4342
14229 #: ../fish/guestfish-actions.pod:4344
14234 #: ../fish/guestfish-actions.pod:4346
14237 " set-trace true|false\n"
14242 #: ../fish/guestfish-actions.pod:4348 ../src/guestfs-actions.pod:6591
14244 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14245 "return values are traced."
14249 #: ../fish/guestfish-actions.pod:4351 ../src/guestfs-actions.pod:6594
14251 "If you want to trace C API calls into libguestfs (and other libraries) then "
14252 "possibly a better way is to use the external ltrace(1) command."
14256 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6598
14258 "Command traces are disabled unless the environment variable "
14259 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14263 #: ../fish/guestfish-actions.pod:4358
14265 "Trace messages are normally sent to C<stderr>, unless you register a "
14266 "callback to send them somewhere else (see L</set-event-callback>)."
14270 #: ../fish/guestfish-actions.pod:4362
14271 msgid "set-verbose"
14275 #: ../fish/guestfish-actions.pod:4364
14280 #: ../fish/guestfish-actions.pod:4366
14283 " set-verbose true|false\n"
14288 #: ../fish/guestfish-actions.pod:4368 ../src/guestfs-actions.pod:6615
14289 msgid "If C<verbose> is true, this turns on verbose messages."
14293 #: ../fish/guestfish-actions.pod:4370 ../src/guestfs-actions.pod:6617
14295 "Verbose messages are disabled unless the environment variable "
14296 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14300 #: ../fish/guestfish-actions.pod:4373
14302 "Verbose messages are normally sent to C<stderr>, unless you register a "
14303 "callback to send them somewhere else (see L</set-event-callback>)."
14307 #: ../fish/guestfish-actions.pod:4377
14312 #: ../fish/guestfish-actions.pod:4379
14315 " setcon context\n"
14320 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6634
14322 "This sets the SELinux security context of the daemon to the string "
14327 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6637
14328 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14332 #: ../fish/guestfish-actions.pod:4386
14337 #: ../fish/guestfish-actions.pod:4388
14340 " setxattr xattr val vallen path\n"
14345 #: ../fish/guestfish-actions.pod:4390 ../src/guestfs-actions.pod:6652
14347 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14348 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14352 #: ../fish/guestfish-actions.pod:4394
14353 msgid "See also: L</lsetxattr>, L<attr(5)>."
14357 #: ../fish/guestfish-actions.pod:4396
14362 #: ../fish/guestfish-actions.pod:4398
14365 " sfdisk device cyls heads sectors 'lines ...'\n"
14370 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6679
14372 "This is a direct interface to the L<sfdisk(8)> program for creating "
14373 "partitions on block devices."
14377 #: ../fish/guestfish-actions.pod:4403 ../src/guestfs-actions.pod:6682
14378 msgid "C<device> should be a block device, for example C</dev/sda>."
14382 #: ../fish/guestfish-actions.pod:4405 ../src/guestfs-actions.pod:6684
14384 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14385 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14386 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14387 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14388 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14389 "the kernel) cannot work out the right geometry and you will need to tell it."
14393 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6692
14395 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14396 "refer to the L<sfdisk(8)> manpage."
14400 #: ../fish/guestfish-actions.pod:4416 ../src/guestfs-actions.pod:6695
14402 "To create a single partition occupying the whole disk, you would pass "
14403 "C<lines> as a single element list, when the single element being the string "
14408 #: ../fish/guestfish-actions.pod:4420
14409 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14413 #: ../fish/guestfish-actions.pod:4426 ../fish/guestfish-actions.pod:4449 ../fish/guestfish-actions.pod:4471
14415 "I<This function is deprecated.> In new code, use the L</part_add> call "
14420 #: ../fish/guestfish-actions.pod:4433
14425 #: ../fish/guestfish-actions.pod:4435
14428 " sfdiskM device 'lines ...'\n"
14433 #: ../fish/guestfish-actions.pod:4437
14435 "This is a simplified interface to the L</sfdisk> command, where partition "
14436 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14437 "you don't need to specify the cyls, heads and sectors parameters which were "
14438 "rarely if ever used anyway."
14442 #: ../fish/guestfish-actions.pod:4443
14443 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14447 #: ../fish/guestfish-actions.pod:4456
14452 #: ../fish/guestfish-actions.pod:4458
14455 " sfdisk-N device partnum cyls heads sectors line\n"
14460 #: ../fish/guestfish-actions.pod:4460 ../src/guestfs-actions.pod:6757
14462 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14463 "(note: C<n> counts from 1)."
14467 #: ../fish/guestfish-actions.pod:4463
14469 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
14470 "cyls/heads/sectors parameters."
14474 #: ../fish/guestfish-actions.pod:4466
14475 msgid "See also: L</part-add>"
14479 #: ../fish/guestfish-actions.pod:4478
14480 msgid "sfdisk-disk-geometry"
14484 #: ../fish/guestfish-actions.pod:4480
14487 " sfdisk-disk-geometry device\n"
14492 #: ../fish/guestfish-actions.pod:4482
14494 "This displays the disk geometry of C<device> read from the partition table. "
14495 "Especially in the case where the underlying block device has been resized, "
14496 "this can be different from the kernel's idea of the geometry (see "
14497 "L</sfdisk-kernel-geometry>)."
14501 #: ../fish/guestfish-actions.pod:4487 ../fish/guestfish-actions.pod:4496 ../src/guestfs-actions.pod:6783 ../src/guestfs-actions.pod:6799
14502 msgid "The result is in human-readable format, and not designed to be parsed."
14506 #: ../fish/guestfish-actions.pod:4490
14507 msgid "sfdisk-kernel-geometry"
14511 #: ../fish/guestfish-actions.pod:4492
14514 " sfdisk-kernel-geometry device\n"
14519 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6797
14520 msgid "This displays the kernel's idea of the geometry of C<device>."
14524 #: ../fish/guestfish-actions.pod:4499
14529 #: ../fish/guestfish-actions.pod:4501
14532 " sfdisk-l device\n"
14537 #: ../fish/guestfish-actions.pod:4503 ../src/guestfs-actions.pod:6820
14539 "This displays the partition table on C<device>, in the human-readable output "
14540 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14544 #: ../fish/guestfish-actions.pod:4507
14545 msgid "See also: L</part-list>"
14549 #: ../fish/guestfish-actions.pod:4509
14551 "I<This function is deprecated.> In new code, use the L</part_list> call "
14556 #: ../fish/guestfish-actions.pod:4516
14561 #: ../fish/guestfish-actions.pod:4518
14569 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6837
14571 "This call runs a command from the guest filesystem via the guest's "
14576 #: ../fish/guestfish-actions.pod:4523
14577 msgid "This is like L</command>, but passes the command to:"
14581 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6842
14584 " /bin/sh -c \"command\"\n"
14589 #: ../fish/guestfish-actions.pod:4527 ../src/guestfs-actions.pod:6844
14591 "Depending on the guest's shell, this usually results in wildcards being "
14592 "expanded, shell expressions being interpolated and so on."
14596 #: ../fish/guestfish-actions.pod:4531
14597 msgid "All the provisos about L</command> apply to this call."
14601 #: ../fish/guestfish-actions.pod:4533
14606 #: ../fish/guestfish-actions.pod:4535
14609 " sh-lines command\n"
14614 #: ../fish/guestfish-actions.pod:4537
14615 msgid "This is the same as L</sh>, but splits the result into a list of lines."
14619 #: ../fish/guestfish-actions.pod:4540
14620 msgid "See also: L</command-lines>"
14624 #: ../fish/guestfish-actions.pod:4542
14629 #: ../fish/guestfish-actions.pod:4544
14637 #: ../fish/guestfish-actions.pod:4546 ../src/guestfs-actions.pod:6878
14638 msgid "Sleep for C<secs> seconds."
14642 #: ../fish/guestfish-actions.pod:4548
14647 #: ../fish/guestfish-actions.pod:4550
14655 #: ../fish/guestfish-actions.pod:4554 ../src/guestfs-actions.pod:6892
14656 msgid "This is the same as the C<stat(2)> system call."
14660 #: ../fish/guestfish-actions.pod:4556
14665 #: ../fish/guestfish-actions.pod:4558
14673 #: ../fish/guestfish-actions.pod:4560 ../src/guestfs-actions.pod:6906
14675 "Returns file system statistics for any mounted file system. C<path> should "
14676 "be a file or directory in the mounted file system (typically it is the mount "
14677 "point itself, but it doesn't need to be)."
14681 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6910
14682 msgid "This is the same as the C<statvfs(2)> system call."
14686 #: ../fish/guestfish-actions.pod:4566
14691 #: ../fish/guestfish-actions.pod:4568
14699 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:6924
14701 "This runs the L<strings(1)> command on a file and returns the list of "
14702 "printable strings found."
14706 #: ../fish/guestfish-actions.pod:4576
14711 #: ../fish/guestfish-actions.pod:4578
14714 " strings-e encoding path\n"
14719 #: ../fish/guestfish-actions.pod:4580
14721 "This is like the L</strings> command, but allows you to specify the encoding "
14722 "of strings that are looked for in the source file C<path>."
14726 #: ../fish/guestfish-actions.pod:4584 ../src/guestfs-actions.pod:6947
14727 msgid "Allowed encodings are:"
14731 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6951
14736 #: ../fish/guestfish-actions.pod:4590
14738 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
14739 "ISO-8859-X (this is what L</strings> uses)."
14743 #: ../fish/guestfish-actions.pod:4593 ../src/guestfs-actions.pod:6956
14748 #: ../fish/guestfish-actions.pod:4595 ../src/guestfs-actions.pod:6958
14749 msgid "Single 8-bit-byte characters."
14753 #: ../fish/guestfish-actions.pod:4597 ../src/guestfs-actions.pod:6960
14758 #: ../fish/guestfish-actions.pod:4599 ../src/guestfs-actions.pod:6962
14759 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
14763 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6965
14764 msgid "l (lower case letter L)"
14768 #: ../fish/guestfish-actions.pod:4604 ../src/guestfs-actions.pod:6967
14770 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
14771 "examining binaries in Windows guests."
14775 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:6970
14780 #: ../fish/guestfish-actions.pod:4609 ../src/guestfs-actions.pod:6972
14781 msgid "32-bit big endian such as UCS-4BE."
14785 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6974
14790 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6976
14791 msgid "32-bit little endian such as UCS-4LE."
14795 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6980
14796 msgid "The returned strings are transcoded to UTF-8."
14800 #: ../fish/guestfish-actions.pod:4622
14801 msgid "swapoff-device"
14805 #: ../fish/guestfish-actions.pod:4624
14808 " swapoff-device device\n"
14813 #: ../fish/guestfish-actions.pod:4626
14815 "This command disables the libguestfs appliance swap device or partition "
14816 "named C<device>. See L</swapon-device>."
14820 #: ../fish/guestfish-actions.pod:4630
14821 msgid "swapoff-file"
14825 #: ../fish/guestfish-actions.pod:4632
14828 " swapoff-file file\n"
14833 #: ../fish/guestfish-actions.pod:4634 ../src/guestfs-actions.pod:7011
14834 msgid "This command disables the libguestfs appliance swap on file."
14838 #: ../fish/guestfish-actions.pod:4636
14839 msgid "swapoff-label"
14843 #: ../fish/guestfish-actions.pod:4638
14846 " swapoff-label label\n"
14851 #: ../fish/guestfish-actions.pod:4640 ../src/guestfs-actions.pod:7023
14853 "This command disables the libguestfs appliance swap on labeled swap "
14858 #: ../fish/guestfish-actions.pod:4643
14859 msgid "swapoff-uuid"
14863 #: ../fish/guestfish-actions.pod:4645
14866 " swapoff-uuid uuid\n"
14871 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:7036
14873 "This command disables the libguestfs appliance swap partition with the given "
14878 #: ../fish/guestfish-actions.pod:4650
14879 msgid "swapon-device"
14883 #: ../fish/guestfish-actions.pod:4652
14886 " swapon-device device\n"
14891 #: ../fish/guestfish-actions.pod:4654
14893 "This command enables the libguestfs appliance to use the swap device or "
14894 "partition named C<device>. The increased memory is made available for all "
14895 "commands, for example those run using L</command> or L</sh>."
14899 #: ../fish/guestfish-actions.pod:4659 ../src/guestfs-actions.pod:7054
14901 "Note that you should not swap to existing guest swap partitions unless you "
14902 "know what you are doing. They may contain hibernation information, or other "
14903 "information that the guest doesn't want you to trash. You also risk leaking "
14904 "information about the host to the guest this way. Instead, attach a new "
14905 "host device to the guest and swap on that."
14909 #: ../fish/guestfish-actions.pod:4666
14910 msgid "swapon-file"
14914 #: ../fish/guestfish-actions.pod:4668
14917 " swapon-file file\n"
14922 #: ../fish/guestfish-actions.pod:4670
14923 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
14927 #: ../fish/guestfish-actions.pod:4673
14928 msgid "swapon-label"
14932 #: ../fish/guestfish-actions.pod:4675
14935 " swapon-label label\n"
14940 #: ../fish/guestfish-actions.pod:4677
14942 "This command enables swap to a labeled swap partition. See "
14943 "L</swapon-device> for other notes."
14947 #: ../fish/guestfish-actions.pod:4680
14948 msgid "swapon-uuid"
14952 #: ../fish/guestfish-actions.pod:4682
14955 " swapon-uuid uuid\n"
14960 #: ../fish/guestfish-actions.pod:4684
14962 "This command enables swap to a swap partition with the given UUID. See "
14963 "L</swapon-device> for other notes."
14967 #: ../fish/guestfish-actions.pod:4687
14972 #: ../fish/guestfish-actions.pod:4689
14980 #: ../fish/guestfish-actions.pod:4691 ../src/guestfs-actions.pod:7109
14982 "This syncs the disk, so that any writes are flushed through to the "
14983 "underlying disk image."
14987 #: ../fish/guestfish-actions.pod:4694 ../src/guestfs-actions.pod:7112
14989 "You should always call this if you have modified a disk image, before "
14990 "closing the handle."
14994 #: ../fish/guestfish-actions.pod:4697
14999 #: ../fish/guestfish-actions.pod:4699
15007 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7125
15008 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15012 #: ../fish/guestfish-actions.pod:4707
15017 #: ../fish/guestfish-actions.pod:4709
15020 " tail-n nrlines path\n"
15025 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7144
15027 "If the parameter C<nrlines> is a positive number, this returns the last "
15028 "C<nrlines> lines of the file C<path>."
15032 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7147
15034 "If the parameter C<nrlines> is a negative number, this returns lines from "
15035 "the file C<path>, starting with the C<-nrlines>th line."
15039 #: ../fish/guestfish-actions.pod:4722
15044 #: ../fish/guestfish-actions.pod:4724
15047 " tar-in (tarfile|-) directory\n"
15052 #: ../fish/guestfish-actions.pod:4726 ../src/guestfs-actions.pod:7168
15054 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15055 "tar file) into C<directory>."
15059 #: ../fish/guestfish-actions.pod:4729
15060 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15064 #: ../fish/guestfish-actions.pod:4734
15069 #: ../fish/guestfish-actions.pod:4736
15072 " tar-out directory (tarfile|-)\n"
15077 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7185
15079 "This command packs the contents of C<directory> and downloads it to local "
15084 #: ../fish/guestfish-actions.pod:4741
15085 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15089 #: ../fish/guestfish-actions.pod:4746
15094 #: ../fish/guestfish-actions.pod:4748
15097 " tgz-in (tarball|-) directory\n"
15102 #: ../fish/guestfish-actions.pod:4750 ../src/guestfs-actions.pod:7202
15104 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15105 "tar file) into C<directory>."
15109 #: ../fish/guestfish-actions.pod:4753
15110 msgid "To upload an uncompressed tarball, use L</tar-in>."
15114 #: ../fish/guestfish-actions.pod:4757
15119 #: ../fish/guestfish-actions.pod:4759
15122 " tgz-out directory (tarball|-)\n"
15127 #: ../fish/guestfish-actions.pod:4761 ../src/guestfs-actions.pod:7218
15129 "This command packs the contents of C<directory> and downloads it to local "
15134 #: ../fish/guestfish-actions.pod:4764
15135 msgid "To download an uncompressed tarball, use L</tar-out>."
15139 #: ../fish/guestfish-actions.pod:4768
15144 #: ../fish/guestfish-actions.pod:4770
15152 #: ../fish/guestfish-actions.pod:4772 ../src/guestfs-actions.pod:7233
15154 "Touch acts like the L<touch(1)> command. It can be used to update the "
15155 "timestamps on a file, or, if the file does not exist, to create a new "
15156 "zero-length file."
15160 #: ../fish/guestfish-actions.pod:4776 ../src/guestfs-actions.pod:7237
15162 "This command only works on regular files, and will fail on other file types "
15163 "such as directories, symbolic links, block special etc."
15167 #: ../fish/guestfish-actions.pod:4779
15172 #: ../fish/guestfish-actions.pod:4781
15180 #: ../fish/guestfish-actions.pod:4783 ../src/guestfs-actions.pod:7250
15182 "This command truncates C<path> to a zero-length file. The file must exist "
15187 #: ../fish/guestfish-actions.pod:4786
15188 msgid "truncate-size"
15192 #: ../fish/guestfish-actions.pod:4788
15195 " truncate-size path size\n"
15200 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7264
15202 "This command truncates C<path> to size C<size> bytes. The file must exist "
15207 #: ../fish/guestfish-actions.pod:4793
15209 "If the current file size is less than C<size> then the file is extended to "
15210 "the required size with zero bytes. This creates a sparse file (ie. disk "
15211 "blocks are not allocated for the file until you write to it). To create a "
15212 "non-sparse file of zeroes, use L</fallocate64> instead."
15216 #: ../fish/guestfish-actions.pod:4799
15221 #: ../fish/guestfish-actions.pod:4801
15224 " tune2fs-l device\n"
15229 #: ../fish/guestfish-actions.pod:4803 ../src/guestfs-actions.pod:7283
15231 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15236 #: ../fish/guestfish-actions.pod:4806 ../src/guestfs-actions.pod:7286
15238 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15239 "for more details. The list of fields returned isn't clearly defined, and "
15240 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15241 "and the filesystem itself."
15245 #: ../fish/guestfish-actions.pod:4811
15250 #: ../fish/guestfish-actions.pod:4813
15253 " txz-in (tarball|-) directory\n"
15258 #: ../fish/guestfish-actions.pod:4815 ../src/guestfs-actions.pod:7306
15260 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15261 "tar file) into C<directory>."
15265 #: ../fish/guestfish-actions.pod:4820
15270 #: ../fish/guestfish-actions.pod:4822
15273 " txz-out directory (tarball|-)\n"
15278 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7320
15280 "This command packs the contents of C<directory> and downloads it to local "
15281 "file C<tarball> (as an xz compressed tar archive)."
15285 #: ../fish/guestfish-actions.pod:4829
15290 #: ../fish/guestfish-actions.pod:4831
15298 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7333
15300 "This function sets the mask used for creating new files and device nodes to "
15305 #: ../fish/guestfish-actions.pod:4836 ../src/guestfs-actions.pod:7336
15307 "Typical umask values would be C<022> which creates new files with "
15308 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15309 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15313 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7341
15315 "The default umask is C<022>. This is important because it means that "
15316 "directories and device nodes will be created with C<0644> or C<0755> mode "
15317 "even if you specify C<0777>."
15321 #: ../fish/guestfish-actions.pod:4845
15322 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15326 #: ../fish/guestfish-actions.pod:4848 ../src/guestfs-actions.pod:7348
15327 msgid "This call returns the previous umask."
15331 #: ../fish/guestfish-actions.pod:4850
15336 #: ../fish/guestfish-actions.pod:4852
15341 #: ../fish/guestfish-actions.pod:4854
15344 " umount pathordevice\n"
15349 #: ../fish/guestfish-actions.pod:4856 ../src/guestfs-actions.pod:7360
15351 "This unmounts the given filesystem. The filesystem may be specified either "
15352 "by its mountpoint (path) or the device which contains the filesystem."
15356 #: ../fish/guestfish-actions.pod:4860
15361 #: ../fish/guestfish-actions.pod:4862
15362 msgid "unmount-all"
15366 #: ../fish/guestfish-actions.pod:4864
15374 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7373
15375 msgid "This unmounts all mounted filesystems."
15379 #: ../fish/guestfish-actions.pod:4868 ../src/guestfs-actions.pod:7375
15380 msgid "Some internal mounts are not unmounted by this call."
15384 #: ../fish/guestfish-actions.pod:4870
15389 #: ../fish/guestfish-actions.pod:4872
15392 " upload (filename|-) remotefilename\n"
15397 #: ../fish/guestfish-actions.pod:4874 ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7388 ../src/guestfs-actions.pod:7412
15398 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15402 #: ../fish/guestfish-actions.pod:4879
15403 msgid "See also L</download>."
15407 #: ../fish/guestfish-actions.pod:4883
15408 msgid "upload-offset"
15412 #: ../fish/guestfish-actions.pod:4885
15415 " upload-offset (filename|-) remotefilename offset\n"
15420 #: ../fish/guestfish-actions.pod:4890 ../src/guestfs-actions.pod:7415
15422 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15423 "The intention is to overwrite parts of existing files or devices, although "
15424 "if a non-existant file is specified then it is created with a \"hole\" "
15425 "before C<offset>. The size of the data written is implicit in the size of "
15426 "the source C<filename>."
15430 #: ../fish/guestfish-actions.pod:4897
15432 "Note that there is no limit on the amount of data that can be uploaded with "
15433 "this call, unlike with L</pwrite>, and this call always writes the full "
15434 "amount unless an error occurs."
15438 #: ../fish/guestfish-actions.pod:4902
15439 msgid "See also L</upload>, L</pwrite>."
15443 #: ../fish/guestfish-actions.pod:4906
15448 #: ../fish/guestfish-actions.pod:4908
15451 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15456 #: ../fish/guestfish-actions.pod:4910 ../src/guestfs-actions.pod:7448
15457 msgid "This command sets the timestamps of a file with nanosecond precision."
15461 #: ../fish/guestfish-actions.pod:4913 ../src/guestfs-actions.pod:7451
15463 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15468 #: ../fish/guestfish-actions.pod:4916 ../src/guestfs-actions.pod:7454
15470 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15471 "nanoseconds from the epoch."
15475 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7457
15477 "If the C<*nsecs> field contains the special value C<-1> then the "
15478 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15479 "ignored in this case)."
15483 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7461
15485 "If the C<*nsecs> field contains the special value C<-2> then the "
15486 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15491 #: ../fish/guestfish-actions.pod:4927
15496 #: ../fish/guestfish-actions.pod:4929
15504 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7474
15505 msgid "Return the libguestfs version number that the program is linked against."
15509 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7477
15511 "Note that because of dynamic linking this is not necessarily the version of "
15512 "libguestfs that you compiled against. You can compile the program, and then "
15513 "at runtime dynamically link against a completely different C<libguestfs.so> "
15518 #: ../fish/guestfish-actions.pod:4939 ../src/guestfs-actions.pod:7482
15520 "This call was added in version C<1.0.58>. In previous versions of "
15521 "libguestfs there was no way to get the version number. From C code you can "
15522 "use dynamic linker functions to find out if this symbol exists (if it "
15523 "doesn't, then it's an earlier version)."
15527 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7488
15529 "The call returns a structure with four elements. The first three (C<major>, "
15530 "C<minor> and C<release>) are numbers and correspond to the usual version "
15531 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15532 "but may be used for distro-specific information."
15536 #: ../fish/guestfish-actions.pod:4951 ../src/guestfs-actions.pod:7494
15537 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
15541 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7497
15542 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15546 #: ../fish/guestfish-actions.pod:4956
15548 "I<Note:> Don't use this call to test for availability of features. In "
15549 "enterprise distributions we backport features from later versions into "
15550 "earlier versions, making this an unreliable way to test for features. Use "
15551 "L</available> instead."
15555 #: ../fish/guestfish-actions.pod:4962
15560 #: ../fish/guestfish-actions.pod:4964
15563 " vfs-label device\n"
15568 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7517
15569 msgid "This returns the filesystem label of the filesystem on C<device>."
15573 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7520
15574 msgid "If the filesystem is unlabeled, this returns the empty string."
15578 #: ../fish/guestfish-actions.pod:4971
15579 msgid "To find a filesystem from the label, use L</findfs-label>."
15583 #: ../fish/guestfish-actions.pod:4973
15588 #: ../fish/guestfish-actions.pod:4975
15591 " vfs-type device\n"
15596 #: ../fish/guestfish-actions.pod:4977 ../src/guestfs-actions.pod:7535
15598 "This command gets the filesystem type corresponding to the filesystem on "
15603 #: ../fish/guestfish-actions.pod:4980 ../src/guestfs-actions.pod:7538
15605 "For most filesystems, the result is the name of the Linux VFS module which "
15606 "would be used to mount this filesystem if you mounted it without specifying "
15607 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15611 #: ../fish/guestfish-actions.pod:4985
15616 #: ../fish/guestfish-actions.pod:4987
15619 " vfs-uuid device\n"
15624 #: ../fish/guestfish-actions.pod:4989 ../src/guestfs-actions.pod:7554
15625 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15629 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7557
15630 msgid "If the filesystem does not have a UUID, this returns the empty string."
15634 #: ../fish/guestfish-actions.pod:4994
15635 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
15639 #: ../fish/guestfish-actions.pod:4996
15640 msgid "vg-activate"
15644 #: ../fish/guestfish-actions.pod:4998
15647 " vg-activate true|false 'volgroups ...'\n"
15652 #: ../fish/guestfish-actions.pod:5000 ../src/guestfs-actions.pod:7573
15654 "This command activates or (if C<activate> is false) deactivates all logical "
15655 "volumes in the listed volume groups C<volgroups>."
15659 #: ../fish/guestfish-actions.pod:5003 ../src/guestfs-actions.pod:7576
15660 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15664 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7578
15666 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15667 "activated or deactivated."
15671 #: ../fish/guestfish-actions.pod:5008
15672 msgid "vg-activate-all"
15676 #: ../fish/guestfish-actions.pod:5010
15679 " vg-activate-all true|false\n"
15684 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7591
15686 "This command activates or (if C<activate> is false) deactivates all logical "
15687 "volumes in all volume groups."
15691 #: ../fish/guestfish-actions.pod:5015 ../src/guestfs-actions.pod:7594
15692 msgid "This command is the same as running C<vgchange -a y|n>"
15696 #: ../fish/guestfish-actions.pod:5017
15701 #: ../fish/guestfish-actions.pod:5019
15704 " vgcreate volgroup 'physvols ...'\n"
15709 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7607
15711 "This creates an LVM volume group called C<volgroup> from the non-empty list "
15712 "of physical volumes C<physvols>."
15716 #: ../fish/guestfish-actions.pod:5024
15721 #: ../fish/guestfish-actions.pod:5026
15724 " vglvuuids vgname\n"
15729 #: ../fish/guestfish-actions.pod:5028 ../src/guestfs-actions.pod:7620
15731 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
15732 "volumes created in this volume group."
15736 #: ../fish/guestfish-actions.pod:5031
15738 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
15739 "logical volumes and volume groups."
15743 #: ../fish/guestfish-actions.pod:5034
15744 msgid "See also L</vgpvuuids>."
15748 #: ../fish/guestfish-actions.pod:5036
15753 #: ../fish/guestfish-actions.pod:5038
15756 " vgpvuuids vgname\n"
15761 #: ../fish/guestfish-actions.pod:5040 ../src/guestfs-actions.pod:7640
15763 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
15764 "volumes that this volume group resides on."
15768 #: ../fish/guestfish-actions.pod:5043
15770 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
15771 "physical volumes and volume groups."
15775 #: ../fish/guestfish-actions.pod:5046
15776 msgid "See also L</vglvuuids>."
15780 #: ../fish/guestfish-actions.pod:5048
15785 #: ../fish/guestfish-actions.pod:5050
15788 " vgremove vgname\n"
15793 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7660
15794 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
15798 #: ../fish/guestfish-actions.pod:5054 ../src/guestfs-actions.pod:7662
15799 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
15803 #: ../fish/guestfish-actions.pod:5057
15808 #: ../fish/guestfish-actions.pod:5059
15811 " vgrename volgroup newvolgroup\n"
15816 #: ../fish/guestfish-actions.pod:5061 ../src/guestfs-actions.pod:7676
15817 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
15821 #: ../fish/guestfish-actions.pod:5063
15826 #: ../fish/guestfish-actions.pod:5065
15834 #: ../fish/guestfish-actions.pod:5067 ../src/guestfs-actions.pod:7687
15836 "List all the volumes groups detected. This is the equivalent of the "
15837 "L<vgs(8)> command."
15841 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7690
15843 "This returns a list of just the volume group names that were detected "
15844 "(eg. C<VolGroup00>)."
15848 #: ../fish/guestfish-actions.pod:5073
15849 msgid "See also L</vgs-full>."
15853 #: ../fish/guestfish-actions.pod:5075
15858 #: ../fish/guestfish-actions.pod:5077
15866 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7706
15868 "List all the volumes groups detected. This is the equivalent of the "
15869 "L<vgs(8)> command. The \"full\" version includes all fields."
15873 #: ../fish/guestfish-actions.pod:5082
15878 #: ../fish/guestfish-actions.pod:5084
15886 #: ../fish/guestfish-actions.pod:5086 ../src/guestfs-actions.pod:7720
15888 "This rescans all block devices and rebuilds the list of LVM physical "
15889 "volumes, volume groups and logical volumes."
15893 #: ../fish/guestfish-actions.pod:5089
15898 #: ../fish/guestfish-actions.pod:5091
15906 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7733
15907 msgid "This command returns the UUID of the LVM VG named C<vgname>."
15911 #: ../fish/guestfish-actions.pod:5095
15916 #: ../fish/guestfish-actions.pod:5097
15924 #: ../fish/guestfish-actions.pod:5099 ../src/guestfs-actions.pod:7773
15926 "This command counts the characters in a file, using the C<wc -c> external "
15931 #: ../fish/guestfish-actions.pod:5102
15936 #: ../fish/guestfish-actions.pod:5104
15944 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7786
15946 "This command counts the lines in a file, using the C<wc -l> external "
15951 #: ../fish/guestfish-actions.pod:5109
15956 #: ../fish/guestfish-actions.pod:5111
15964 #: ../fish/guestfish-actions.pod:5113 ../src/guestfs-actions.pod:7799
15966 "This command counts the words in a file, using the C<wc -w> external "
15971 #: ../fish/guestfish-actions.pod:5116
15976 #: ../fish/guestfish-actions.pod:5118
15979 " write path content\n"
15984 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7814
15986 "This call creates a file called C<path>. The content of the file is the "
15987 "string C<content> (which can contain any 8 bit data)."
15991 #: ../fish/guestfish-actions.pod:5123
15992 msgid "See also L</write-append>."
15996 #: ../fish/guestfish-actions.pod:5128
15997 msgid "write-append"
16001 #: ../fish/guestfish-actions.pod:5130
16004 " write-append path content\n"
16009 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7834
16011 "This call appends C<content> to the end of file C<path>. If C<path> does "
16012 "not exist, then a new file is created."
16016 #: ../fish/guestfish-actions.pod:5135
16017 msgid "See also L</write>."
16021 #: ../fish/guestfish-actions.pod:5140
16026 #: ../fish/guestfish-actions.pod:5142
16029 " write-file path content size\n"
16034 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7861
16036 "This call creates a file called C<path>. The contents of the file is the "
16037 "string C<content> (which can contain any 8 bit data), with length C<size>."
16041 #: ../fish/guestfish-actions.pod:5148 ../src/guestfs-actions.pod:7865
16043 "As a special case, if C<size> is C<0> then the length is calculated using "
16044 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16048 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7869
16050 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16051 "I<not> work, even if the length is specified."
16055 #: ../fish/guestfish-actions.pod:5158
16056 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16060 #: ../fish/guestfish-actions.pod:5165
16065 #: ../fish/guestfish-actions.pod:5167
16068 " zegrep regex path\n"
16073 #: ../fish/guestfish-actions.pod:5169 ../src/guestfs-actions.pod:7886
16074 msgid "This calls the external C<zegrep> program and returns the matching lines."
16078 #: ../fish/guestfish-actions.pod:5175
16083 #: ../fish/guestfish-actions.pod:5177
16086 " zegrepi regex path\n"
16091 #: ../fish/guestfish-actions.pod:5179 ../src/guestfs-actions.pod:7905
16092 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16096 #: ../fish/guestfish-actions.pod:5185
16101 #: ../fish/guestfish-actions.pod:5187
16109 #: ../fish/guestfish-actions.pod:5189 ../src/guestfs-actions.pod:7923
16110 msgid "This command writes zeroes over the first few blocks of C<device>."
16114 #: ../fish/guestfish-actions.pod:5191 ../src/guestfs-actions.pod:7925
16116 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16117 "securely wipe the device). It should be sufficient to remove any partition "
16118 "tables, filesystem superblocks and so on."
16122 #: ../fish/guestfish-actions.pod:5195 ../fish/guestfish-actions.pod:5210 ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:7955
16124 "If blocks are already zero, then this command avoids writing zeroes. This "
16125 "prevents the underlying device from becoming non-sparse or growing "
16130 #: ../fish/guestfish-actions.pod:5199
16131 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16135 #: ../fish/guestfish-actions.pod:5202
16136 msgid "zero-device"
16140 #: ../fish/guestfish-actions.pod:5204
16143 " zero-device device\n"
16148 #: ../fish/guestfish-actions.pod:5206
16150 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16151 "which just zeroes the first few blocks of a device."
16155 #: ../fish/guestfish-actions.pod:5217
16160 #: ../fish/guestfish-actions.pod:5219
16163 " zerofree device\n"
16168 #: ../fish/guestfish-actions.pod:5221 ../src/guestfs-actions.pod:7977
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 #: ../fish/guestfish-actions.pod:5226 ../src/guestfs-actions.pod:7982
16177 msgid "You should B<not> run this program if the filesystem is mounted."
16181 #: ../fish/guestfish-actions.pod:5229 ../src/guestfs-actions.pod:7985
16183 "It is possible that using this program can damage the filesystem or data on "
16188 #: ../fish/guestfish-actions.pod:5232
16193 #: ../fish/guestfish-actions.pod:5234
16196 " zfgrep pattern path\n"
16201 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:7999
16202 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16206 #: ../fish/guestfish-actions.pod:5242
16211 #: ../fish/guestfish-actions.pod:5244
16214 " zfgrepi pattern path\n"
16219 #: ../fish/guestfish-actions.pod:5246 ../src/guestfs-actions.pod:8018
16220 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16224 #: ../fish/guestfish-actions.pod:5252
16229 #: ../fish/guestfish-actions.pod:5254
16232 " zfile meth path\n"
16237 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8044
16238 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16242 #: ../fish/guestfish-actions.pod:5259 ../src/guestfs-actions.pod:8047
16243 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16247 #: ../fish/guestfish-actions.pod:5261
16248 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16252 #: ../fish/guestfish-actions.pod:5264
16253 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16257 #: ../fish/guestfish-actions.pod:5271
16262 #: ../fish/guestfish-actions.pod:5273
16265 " zgrep regex path\n"
16270 #: ../fish/guestfish-actions.pod:5275 ../src/guestfs-actions.pod:8064
16271 msgid "This calls the external C<zgrep> program and returns the matching lines."
16275 #: ../fish/guestfish-actions.pod:5281
16280 #: ../fish/guestfish-actions.pod:5283
16283 " zgrepi regex path\n"
16288 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:8083
16289 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16293 #: ../fish/guestfish-commands.pod:1
16298 #: ../fish/guestfish-commands.pod:3
16303 #: ../fish/guestfish-commands.pod:5
16306 " alloc filename size\n"
16311 #: ../fish/guestfish-commands.pod:7
16313 "This creates an empty (zeroed) file of the given size, and then adds so it "
16314 "can be further examined."
16318 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16319 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16323 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16324 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16328 #: ../fish/guestfish-commands.pod:14
16330 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16331 "image, see L</PREPARED DISK IMAGES>."
16335 #: ../fish/guestfish-commands.pod:17
16340 #: ../fish/guestfish-commands.pod:19
16343 " copy-in local [local ...] /remotedir\n"
16348 #: ../fish/guestfish-commands.pod:21
16350 "C<copy-in> copies local files or directories recursively into the disk "
16351 "image, placing them in the directory called C</remotedir> (which must "
16352 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16353 "other commands as necessary."
16357 #: ../fish/guestfish-commands.pod:26
16359 "Multiple local files and directories can be specified, but the last "
16360 "parameter must always be a remote directory. Wildcards cannot be used."
16364 #: ../fish/guestfish-commands.pod:30
16369 #: ../fish/guestfish-commands.pod:32
16372 " copy-out remote [remote ...] localdir\n"
16377 #: ../fish/guestfish-commands.pod:34
16379 "C<copy-out> copies remote files or directories recursively out of the disk "
16380 "image, placing them on the host disk in a local directory called C<localdir> "
16381 "(which must exist). This guestfish meta-command turns into a sequence of "
16382 "L</download>, L</tar-out> and other commands as necessary."
16386 #: ../fish/guestfish-commands.pod:40
16388 "Multiple remote files and directories can be specified, but the last "
16389 "parameter must always be a local directory. To download to the current "
16390 "directory, use C<.> as in:"
16394 #: ../fish/guestfish-commands.pod:44
16397 " copy-out /home .\n"
16402 #: ../fish/guestfish-commands.pod:46
16404 "Wildcards cannot be used in the ordinary command, but you can use them with "
16405 "the help of L</glob> like this:"
16409 #: ../fish/guestfish-commands.pod:49
16412 " glob copy-out /home/* .\n"
16417 #: ../fish/guestfish-commands.pod:51
16422 #: ../fish/guestfish-commands.pod:53
16425 " display filename\n"
16430 #: ../fish/guestfish-commands.pod:55
16432 "Use C<display> (a graphical display program) to display an image file. It "
16433 "downloads the file, and runs C<display> on it."
16437 #: ../fish/guestfish-commands.pod:58
16439 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16440 "environment variable. For example to use the GNOME display program:"
16444 #: ../fish/guestfish-commands.pod:61
16447 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16452 #: ../fish/guestfish-commands.pod:63
16453 msgid "See also L<display(1)>."
16457 #: ../fish/guestfish-commands.pod:65
16462 #: ../fish/guestfish-commands.pod:67
16465 " echo [params ...]\n"
16470 #: ../fish/guestfish-commands.pod:69
16471 msgid "This echos the parameters to the terminal."
16475 #: ../fish/guestfish-commands.pod:71
16480 #: ../fish/guestfish-commands.pod:73
16485 #: ../fish/guestfish-commands.pod:75
16490 #: ../fish/guestfish-commands.pod:77
16498 #: ../fish/guestfish-commands.pod:79
16500 "This is used to edit a file. It downloads the file, edits it locally using "
16501 "your editor, then uploads the result."
16505 #: ../fish/guestfish-commands.pod:82
16507 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16508 "or C<emacs> you will get those corresponding editors."
16512 #: ../fish/guestfish-commands.pod:86
16517 #: ../fish/guestfish-commands.pod:88
16520 " glob command args...\n"
16525 #: ../fish/guestfish-commands.pod:90
16527 "Expand wildcards in any paths in the args list, and run C<command> "
16528 "repeatedly on each matching path."
16532 #: ../fish/guestfish-commands.pod:93
16533 msgid "See L</WILDCARDS AND GLOBBING>."
16537 #: ../fish/guestfish-commands.pod:95
16542 #: ../fish/guestfish-commands.pod:97
16545 " hexedit <filename|device>\n"
16546 " hexedit <filename|device> <max>\n"
16547 " hexedit <filename|device> <start> <max>\n"
16552 #: ../fish/guestfish-commands.pod:101
16554 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
16559 #: ../fish/guestfish-commands.pod:104
16561 "This command works by downloading potentially the whole file or device, "
16562 "editing it locally, then uploading it. If the file or device is large, you "
16563 "have to specify which part you wish to edit by using C<max> and/or C<start> "
16564 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
16565 "usual modifiers allowed such as C<1M> (1 megabyte)."
16569 #: ../fish/guestfish-commands.pod:111
16570 msgid "For example to edit the first few sectors of a disk you might do:"
16574 #: ../fish/guestfish-commands.pod:114
16577 " hexedit /dev/sda 1M\n"
16582 #: ../fish/guestfish-commands.pod:116
16584 "which would allow you to edit anywhere within the first megabyte of the "
16589 #: ../fish/guestfish-commands.pod:119
16590 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
16594 #: ../fish/guestfish-commands.pod:121
16597 " hexedit /dev/sda1 0x400 0x400\n"
16602 #: ../fish/guestfish-commands.pod:123
16603 msgid "(assuming the superblock is in the standard location)."
16607 #: ../fish/guestfish-commands.pod:125
16609 "This command requires the external L<hexedit(1)> program. You can specify "
16610 "another program to use by setting the C<HEXEDITOR> environment variable."
16614 #: ../fish/guestfish-commands.pod:129
16615 msgid "See also L</hexdump>."
16619 #: ../fish/guestfish-commands.pod:131
16624 #: ../fish/guestfish-commands.pod:133
16632 #: ../fish/guestfish-commands.pod:135
16633 msgid "Change the local directory, ie. the current directory of guestfish itself."
16637 #: ../fish/guestfish-commands.pod:138
16638 msgid "Note that C<!cd> won't do what you might expect."
16642 #: ../fish/guestfish-commands.pod:140
16647 #: ../fish/guestfish-commands.pod:142
16652 #: ../fish/guestfish-commands.pod:144
16660 #: ../fish/guestfish-commands.pod:146
16661 msgid "Opens the manual page for guestfish."
16665 #: ../fish/guestfish-commands.pod:148
16670 #: ../fish/guestfish-commands.pod:150
16675 #: ../fish/guestfish-commands.pod:152
16683 #: ../fish/guestfish-commands.pod:154
16691 #: ../fish/guestfish-commands.pod:156
16692 msgid "This is used to view a file."
16696 #: ../fish/guestfish-commands.pod:158
16698 "The default viewer is C<$PAGER>. However if you use the alternate command "
16699 "C<less> you will get the C<less> command specifically."
16703 #: ../fish/guestfish-commands.pod:161
16708 #: ../fish/guestfish-commands.pod:163
16716 #: ../fish/guestfish-commands.pod:165
16718 "Close and reopen the libguestfs handle. It is not necessary to use this "
16719 "normally, because the handle is closed properly when guestfish exits. "
16720 "However this is occasionally useful for testing."
16724 #: ../fish/guestfish-commands.pod:169
16729 #: ../fish/guestfish-commands.pod:171
16732 " setenv VAR value\n"
16737 #: ../fish/guestfish-commands.pod:173
16738 msgid "Set the environment variable C<VAR> to the string C<value>."
16742 #: ../fish/guestfish-commands.pod:175
16743 msgid "To print the value of an environment variable use a shell command such as:"
16747 #: ../fish/guestfish-commands.pod:178
16755 #: ../fish/guestfish-commands.pod:180
16760 #: ../fish/guestfish-commands.pod:182
16763 " sparse filename size\n"
16768 #: ../fish/guestfish-commands.pod:184
16770 "This creates an empty sparse file of the given size, and then adds so it can "
16771 "be further examined."
16775 #: ../fish/guestfish-commands.pod:187
16777 "In all respects it works the same as the L</alloc> command, except that the "
16778 "image file is allocated sparsely, which means that disk blocks are not "
16779 "assigned to the file until they are needed. Sparse disk files only use "
16780 "space when written to, but they are slower and there is a danger you could "
16781 "run out of real disk space during a write operation."
16785 #: ../fish/guestfish-commands.pod:197
16790 #: ../fish/guestfish-commands.pod:199
16798 #: ../fish/guestfish-commands.pod:201
16800 "This command returns a list of the optional groups known to the daemon, and "
16801 "indicates which ones are supported by this build of the libguestfs "
16806 #: ../fish/guestfish-commands.pod:205
16807 msgid "See also L<guestfs(3)/AVAILABILITY>."
16811 #: ../fish/guestfish-commands.pod:207
16816 #: ../fish/guestfish-commands.pod:209
16819 " time command args...\n"
16824 #: ../fish/guestfish-commands.pod:211
16826 "Run the command as usual, but print the elapsed time afterwards. This can "
16827 "be useful for benchmarking operations."
16831 #: ../fish/guestfish-commands.pod:214
16836 #: ../fish/guestfish-commands.pod:216
16844 #: ../fish/guestfish-commands.pod:218
16845 msgid "Remove C<VAR> from the environment."
16849 #: ../fish/guestfish.pod:5
16850 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
16854 #: ../fish/guestfish.pod:9
16857 " guestfish [--options] [commands]\n"
16862 #: ../fish/guestfish.pod:11
16870 #: ../fish/guestfish.pod:13
16873 " guestfish [--ro|--rw] -a disk.img\n"
16878 #: ../fish/guestfish.pod:15
16881 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
16886 #: ../fish/guestfish.pod:17
16889 " guestfish -d libvirt-domain\n"
16894 #: ../fish/guestfish.pod:19
16897 " guestfish [--ro|--rw] -a disk.img -i\n"
16902 #: ../fish/guestfish.pod:21
16905 " guestfish -d libvirt-domain -i\n"
16910 #: ../fish/guestfish.pod:25
16912 "Using guestfish in read/write mode on live virtual machines can be "
16913 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
16914 "option to use guestfish safely if the disk image or virtual machine might be "
16919 #: ../fish/guestfish.pod:32
16921 "Guestfish is a shell and command-line tool for examining and modifying "
16922 "virtual machine filesystems. It uses libguestfs and exposes all of the "
16923 "functionality of the guestfs API, see L<guestfs(3)>."
16927 #: ../fish/guestfish.pod:36
16929 "Guestfish gives you structured access to the libguestfs API, from shell "
16930 "scripts or the command line or interactively. If you want to rescue a "
16931 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
16936 #: ../fish/guestfish.pod:43
16937 msgid "As an interactive shell"
16941 #: ../fish/guestfish.pod:45
16949 #: ../fish/guestfish.pod:47
16952 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
16953 " editing virtual machine filesystems.\n"
16958 #: ../fish/guestfish.pod:50
16961 " Type: 'help' for a list of commands\n"
16962 " 'man' to read the manual\n"
16963 " 'quit' to quit the shell\n"
16968 #: ../fish/guestfish.pod:54
16971 " ><fs> add-ro disk.img\n"
16973 " ><fs> list-filesystems\n"
16974 " /dev/sda1: ext4\n"
16975 " /dev/vg_guest/lv_root: ext4\n"
16976 " /dev/vg_guest/lv_swap: swap\n"
16977 " ><fs> mount /dev/vg_guest/lv_root /\n"
16978 " ><fs> cat /etc/fstab\n"
16980 " # Created by anaconda\n"
16987 #: ../fish/guestfish.pod:67
16988 msgid "From shell scripts"
16992 #: ../fish/guestfish.pod:69
16993 msgid "Create a new C</etc/motd> file in a guest or disk image:"
16997 #: ../fish/guestfish.pod:71
17000 " guestfish <<_EOF_\n"
17003 " mount /dev/vg_guest/lv_root /\n"
17004 " write /etc/motd \"Welcome, new users\"\n"
17010 #: ../fish/guestfish.pod:78
17011 msgid "List the LVM logical volumes in a disk image:"
17015 #: ../fish/guestfish.pod:80
17018 " guestfish -a disk.img --ro <<_EOF_\n"
17026 #: ../fish/guestfish.pod:85
17027 msgid "List all the filesystems in a disk image:"
17031 #: ../fish/guestfish.pod:87
17034 " guestfish -a disk.img --ro <<_EOF_\n"
17036 " list-filesystems\n"
17042 #: ../fish/guestfish.pod:92
17043 msgid "On one command line"
17047 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17048 msgid "Update C</etc/resolv.conf> in a guest:"
17052 #: ../fish/guestfish.pod:96
17056 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17057 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17062 #: ../fish/guestfish.pod:100
17063 msgid "Edit C</boot/grub/grub.conf> interactively:"
17067 #: ../fish/guestfish.pod:102
17070 " guestfish --rw --add disk.img \\\n"
17071 " --mount /dev/vg_guest/lv_root \\\n"
17072 " --mount /dev/sda1:/boot \\\n"
17073 " edit /boot/grub/grub.conf\n"
17078 #: ../fish/guestfish.pod:107
17079 msgid "Mount disks automatically"
17083 #: ../fish/guestfish.pod:109
17085 "Use the I<-i> option to automatically mount the disks from a virtual "
17090 #: ../fish/guestfish.pod:112
17093 " guestfish --ro -a disk.img -i cat /etc/group\n"
17098 #: ../fish/guestfish.pod:114
17101 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17106 #: ../fish/guestfish.pod:116
17107 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17111 #: ../fish/guestfish.pod:118
17114 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17119 #: ../fish/guestfish.pod:120
17120 msgid "As a script interpreter"
17124 #: ../fish/guestfish.pod:122
17125 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17129 #: ../fish/guestfish.pod:124
17132 " #!/usr/bin/guestfish -f\n"
17133 " sparse test1.img 100M\n"
17135 " part-disk /dev/sda mbr\n"
17136 " mkfs ext2 /dev/sda1\n"
17141 #: ../fish/guestfish.pod:130
17142 msgid "Start with a prepared disk"
17146 #: ../fish/guestfish.pod:132
17148 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17149 "single ext2-formatted partition:"
17153 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
17156 " guestfish -N fs\n"
17161 #: ../fish/guestfish.pod:137
17162 msgid "To list what is available do:"
17166 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1041
17169 " guestfish -N help | less\n"
17174 #: ../fish/guestfish.pod:141
17175 msgid "Remote control"
17179 #: ../fish/guestfish.pod:143
17182 " eval \"`guestfish --listen`\"\n"
17183 " guestfish --remote add-ro disk.img\n"
17184 " guestfish --remote run\n"
17185 " guestfish --remote lvs\n"
17190 #: ../fish/guestfish.pod:154
17191 msgid "Displays general help on options."
17195 #: ../fish/guestfish.pod:158
17196 msgid "B<--cmd-help>"
17200 #: ../fish/guestfish.pod:160
17201 msgid "Lists all available guestfish commands."
17205 #: ../fish/guestfish.pod:162
17210 #: ../fish/guestfish.pod:164
17211 msgid "B<--cmd-help cmd>"
17215 #: ../fish/guestfish.pod:166
17216 msgid "Displays detailed help on a single command C<cmd>."
17220 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:87
17221 msgid "B<-a image>"
17225 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:89
17226 msgid "B<--add image>"
17230 #: ../fish/guestfish.pod:172
17231 msgid "Add a block device or virtual machine image to the shell."
17235 #: ../fish/guestfish.pod:177
17237 "Using this flag is mostly equivalent to using the C<add> command, with "
17238 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17239 "the I<--format=...> flag was given."
17243 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:100
17245 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17246 "URI to use. The default is to use the default libvirt connection."
17250 #: ../fish/guestfish.pod:189
17255 #: ../fish/guestfish.pod:191
17257 "If using the I<--listen> option and a csh-like shell, use this option. See "
17258 "section L</REMOTE CONTROL AND CSH> below."
17262 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:104
17263 msgid "B<-d libvirt-domain>"
17267 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:106
17268 msgid "B<--domain libvirt-domain>"
17272 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:108
17274 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17275 "used, then any libvirt domain can be used. However in write mode, only "
17276 "libvirt domains which are shut down can be named here."
17280 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:112
17281 msgid "Domain UUIDs can be used instead of names."
17285 #: ../fish/guestfish.pod:204
17287 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17288 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17289 "if the I<--format:...> flag was given."
17293 #: ../fish/guestfish.pod:208
17298 #: ../fish/guestfish.pod:210
17299 msgid "B<--no-dest-paths>"
17303 #: ../fish/guestfish.pod:212
17305 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17306 "to hit the tab key to complete paths on the guest filesystem, but this "
17307 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17308 "allow this feature to be disabled."
17312 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:128
17314 "When prompting for keys and passphrases, guestfish normally turns echoing "
17315 "off so you cannot see what you are typing. If you are not worried about "
17316 "Tempest attacks and there is no one else in the room you can specify this "
17317 "flag to see what you are typing."
17321 #: ../fish/guestfish.pod:224
17326 #: ../fish/guestfish.pod:226
17327 msgid "B<--file file>"
17331 #: ../fish/guestfish.pod:228
17332 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17336 #: ../fish/guestfish.pod:231
17339 " #!/usr/bin/guestfish -f\n"
17344 #: ../fish/guestfish.pod:244
17347 " guestfish --format=raw -a disk.img\n"
17352 #: ../fish/guestfish.pod:248
17355 " guestfish --format=raw -a disk.img --format -a another.img\n"
17360 #: ../fish/guestfish.pod:253
17362 "If you have untrusted raw-format guest disk images, you should use this "
17363 "option to specify the disk format. This avoids a possible security problem "
17364 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17368 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:157
17369 msgid "B<--inspector>"
17373 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:159
17375 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17376 "system and mount filesystems as they would be mounted on the real virtual "
17381 #: ../fish/guestfish.pod:266
17382 msgid "Typical usage is either:"
17386 #: ../fish/guestfish.pod:268
17389 " guestfish -d myguest -i\n"
17394 #: ../fish/guestfish.pod:270
17395 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17399 #: ../fish/guestfish.pod:272
17402 " guestfish --ro -d myguest -i\n"
17407 #: ../fish/guestfish.pod:274
17408 msgid "(for active domains, readonly), or specify the block device directly:"
17412 #: ../fish/guestfish.pod:276
17415 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17420 #: ../fish/guestfish.pod:278
17422 "Note that the command line syntax changed slightly over older versions of "
17423 "guestfish. You can still use the old syntax:"
17427 #: ../fish/guestfish.pod:281
17430 " guestfish [--ro] -i disk.img\n"
17435 #: ../fish/guestfish.pod:283
17438 " guestfish [--ro] -i libvirt-domain\n"
17443 #: ../fish/guestfish.pod:285
17445 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17446 "then using other commands to mount the filesystems that were found."
17450 #: ../fish/guestfish.pod:294
17451 msgid "B<--listen>"
17455 #: ../fish/guestfish.pod:296
17457 "Fork into the background and listen for remote commands. See section "
17458 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17462 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:168
17467 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:170
17469 "Connect to a live virtual machine. (Experimental, see "
17470 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
17474 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:173
17475 msgid "B<-m dev[:mountpoint[:options]]>"
17479 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:175
17480 msgid "B<--mount dev[:mountpoint[:options]]>"
17484 #: ../fish/guestfish.pod:308
17485 msgid "Mount the named partition or logical volume on the given mountpoint."
17489 #: ../fish/guestfish.pod:310
17490 msgid "If the mountpoint is omitted, it defaults to C</>."
17494 #: ../fish/guestfish.pod:312
17495 msgid "You have to mount something on C</> before most commands will work."
17499 #: ../fish/guestfish.pod:314
17501 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17506 #: ../fish/guestfish.pod:317
17508 "If you don't know what filesystems a disk image contains, you can either run "
17509 "guestfish without this option, then list the partitions, filesystems and LVs "
17510 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17511 "commands), or you can use the L<virt-filesystems(1)> program."
17515 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:183
17517 "The third (and rarely used) part of the mount parameter is the list of mount "
17518 "options used to mount the underlying filesystem. If this is not given, then "
17519 "the mount options are either the empty string or C<ro> (the latter if the "
17520 "I<--ro> flag is used). By specifying the mount options, you override this "
17521 "default choice. Probably the only time you would use this is to enable ACLs "
17522 "and/or extended attributes if the filesystem can support them:"
17526 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:191
17529 " -m /dev/sda1:/:acl,user_xattr\n"
17534 #: ../fish/guestfish.pod:333
17535 msgid "Using this flag is equivalent to using the C<mount-options> command."
17539 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:193 ../resize/virt-resize.pod:358
17544 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:195
17545 msgid "B<--no-sync>"
17549 #: ../fish/guestfish.pod:339
17551 "Disable autosync. This is enabled by default. See the discussion of "
17552 "autosync in the L<guestfs(3)> manpage."
17556 #: ../fish/guestfish.pod:342
17561 #: ../fish/guestfish.pod:344
17562 msgid "B<--new type>"
17566 #: ../fish/guestfish.pod:346
17571 #: ../fish/guestfish.pod:348
17573 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17574 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17575 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17580 #: ../fish/guestfish.pod:353
17581 msgid "B<--progress-bars>"
17585 #: ../fish/guestfish.pod:355
17586 msgid "Enable progress bars, even when guestfish is used non-interactively."
17590 #: ../fish/guestfish.pod:357
17592 "Progress bars are enabled by default when guestfish is used as an "
17593 "interactive shell."
17597 #: ../fish/guestfish.pod:360
17598 msgid "B<--no-progress-bars>"
17602 #: ../fish/guestfish.pod:362
17603 msgid "Disable progress bars."
17607 #: ../fish/guestfish.pod:364
17608 msgid "B<--remote[=pid]>"
17612 #: ../fish/guestfish.pod:366
17614 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17615 "CONTROL GUESTFISH OVER A SOCKET> below."
17619 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:239 ../rescue/virt-rescue.pod:161
17624 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:241 ../rescue/virt-rescue.pod:163
17629 #: ../fish/guestfish.pod:373
17631 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17632 "mounts are done read-only."
17636 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
17638 "The option must always be used if the disk image or virtual machine might be "
17639 "running, and is generally recommended in cases where you don't need write "
17640 "access to the disk."
17644 #: ../fish/guestfish.pod:380
17646 "Note that prepared disk images created with I<-N> are not affected by this "
17647 "option. Also commands like C<add> are not affected - you have to specify "
17648 "the C<readonly:true> option explicitly if you need it."
17652 #: ../fish/guestfish.pod:384
17653 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17657 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:253 ../rescue/virt-rescue.pod:173
17658 msgid "B<--selinux>"
17662 #: ../fish/guestfish.pod:388
17663 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17667 #: ../fish/guestfish.pod:394
17669 "Enable very verbose messages. This is particularly useful if you find a "
17674 #: ../fish/guestfish.pod:401
17675 msgid "Display the guestfish / libguestfs version number and exit."
17679 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:269 ../rescue/virt-rescue.pod:194
17684 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:271 ../rescue/virt-rescue.pod:196
17689 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:273
17691 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17692 "mounts are done read-write."
17696 #: ../fish/guestfish.pod:410
17697 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
17701 #: ../fish/guestfish.pod:414
17702 msgid "Echo each command before executing it."
17706 #: ../fish/guestfish.pod:418
17707 msgid "COMMANDS ON COMMAND LINE"
17711 #: ../fish/guestfish.pod:420
17712 msgid "Any additional (non-option) arguments are treated as commands to execute."
17716 #: ../fish/guestfish.pod:423
17718 "Commands to execute should be separated by a colon (C<:>), where the colon "
17719 "is a separate parameter. Thus:"
17723 #: ../fish/guestfish.pod:426
17726 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
17731 #: ../fish/guestfish.pod:428
17733 "If there are no additional arguments, then we enter a shell, either an "
17734 "interactive shell with a prompt (if the input is a terminal) or a "
17735 "non-interactive shell."
17739 #: ../fish/guestfish.pod:432
17741 "In either command line mode or non-interactive shell, the first command that "
17742 "gives an error causes the whole shell to exit. In interactive mode (with a "
17743 "prompt) if a command fails, you can continue to enter commands."
17747 #: ../fish/guestfish.pod:437
17748 msgid "USING launch (OR run)"
17752 #: ../fish/guestfish.pod:439
17754 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
17755 "then launch it, then mount any disks you need, and finally issue "
17756 "actions/commands. So the general order of the day is:"
17760 #: ../fish/guestfish.pod:447
17761 msgid "add or -a/--add"
17765 #: ../fish/guestfish.pod:451
17766 msgid "launch (aka run)"
17770 #: ../fish/guestfish.pod:455
17771 msgid "mount or -m/--mount"
17775 #: ../fish/guestfish.pod:459
17776 msgid "any other commands"
17780 #: ../fish/guestfish.pod:463
17782 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
17783 "guest before mounting or performing any other commands."
17787 #: ../fish/guestfish.pod:466
17789 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
17790 "I<--new> options were given then C<run> is done automatically, simply "
17791 "because guestfish can't perform the action you asked for without doing this."
17795 #: ../fish/guestfish.pod:471
17796 msgid "OPENING DISKS FOR READ AND WRITE"
17800 #: ../fish/guestfish.pod:473
17802 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
17803 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
17804 "I<-i> and I<-m> open disk images read-only or for writing."
17808 #: ../fish/guestfish.pod:478
17810 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
17811 "opening disk images supplied on the command line for write. To open a disk "
17812 "image read-only you have to do I<-a image --ro>."
17816 #: ../fish/guestfish.pod:482
17818 "This matters: If you accidentally open a live VM disk image writable then "
17819 "you will cause irreversible disk corruption."
17823 #: ../fish/guestfish.pod:485
17825 "In a future libguestfs we intend to change the default the other way. Disk "
17826 "images will be opened read-only. You will have to either specify "
17827 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
17828 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
17829 "access for disk images specified by those other command line options."
17833 #: ../fish/guestfish.pod:492
17835 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
17836 "which does nothing (it is already the default). However it is highly "
17837 "recommended that you use this option to indicate that you need write access, "
17838 "and prepare your scripts for the day when this option will be required for "
17843 #: ../fish/guestfish.pod:498
17845 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
17846 "other libguestfs program apart from guestfish and guestmount."
17850 #: ../fish/guestfish.pod:501
17855 #: ../fish/guestfish.pod:503
17857 "You can quote ordinary parameters using either single or double quotes. For "
17862 #: ../fish/guestfish.pod:506
17865 " add \"file with a space.img\"\n"
17870 #: ../fish/guestfish.pod:508
17873 " rm '/file name'\n"
17878 #: ../fish/guestfish.pod:510
17886 #: ../fish/guestfish.pod:512
17888 "A few commands require a list of strings to be passed. For these, use a "
17889 "whitespace-separated list, enclosed in quotes. Strings containing "
17890 "whitespace to be passed through must be enclosed in single quotes. A "
17891 "literal single quote must be escaped with a backslash."
17895 #: ../fish/guestfish.pod:517
17898 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
17899 " command \"/bin/echo 'foo bar'\"\n"
17900 " command \"/bin/echo \\'foo\\'\"\n"
17905 #: ../fish/guestfish.pod:521
17906 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
17910 #: ../fish/guestfish.pod:523
17912 "In double-quoted arguments (only) use backslash to insert special "
17917 #: ../fish/guestfish.pod:528
17922 #: ../fish/guestfish.pod:530
17923 msgid "Alert (bell) character."
17927 #: ../fish/guestfish.pod:532
17932 #: ../fish/guestfish.pod:534
17933 msgid "Backspace character."
17937 #: ../fish/guestfish.pod:536
17942 #: ../fish/guestfish.pod:538
17943 msgid "Form feed character."
17947 #: ../fish/guestfish.pod:540
17952 #: ../fish/guestfish.pod:542
17953 msgid "Newline character."
17957 #: ../fish/guestfish.pod:544
17962 #: ../fish/guestfish.pod:546
17963 msgid "Carriage return character."
17967 #: ../fish/guestfish.pod:548
17972 #: ../fish/guestfish.pod:550
17973 msgid "Horizontal tab character."
17977 #: ../fish/guestfish.pod:552
17982 #: ../fish/guestfish.pod:554
17983 msgid "Vertical tab character."
17987 #: ../fish/guestfish.pod:556
17992 #: ../fish/guestfish.pod:558
17993 msgid "A literal double quote character."
17997 #: ../fish/guestfish.pod:560
18002 #: ../fish/guestfish.pod:562
18004 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18009 #: ../fish/guestfish.pod:565
18014 #: ../fish/guestfish.pod:567
18015 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18019 #: ../fish/guestfish.pod:570
18021 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18026 #: ../fish/guestfish.pod:573
18031 #: ../fish/guestfish.pod:575
18032 msgid "A literal backslash character."
18036 #: ../fish/guestfish.pod:579
18037 msgid "OPTIONAL ARGUMENTS"
18041 #: ../fish/guestfish.pod:581
18043 "Some commands take optional arguments. These arguments appear in this "
18044 "documentation as C<[argname:..]>. You can use them as in these examples:"
18048 #: ../fish/guestfish.pod:585
18051 " add-drive-opts filename\n"
18056 #: ../fish/guestfish.pod:587
18059 " add-drive-opts filename readonly:true\n"
18064 #: ../fish/guestfish.pod:589
18067 " add-drive-opts filename format:qcow2 readonly:false\n"
18072 #: ../fish/guestfish.pod:591
18074 "Each optional argument can appear at most once. All optional arguments must "
18075 "appear after the required ones."
18079 #: ../fish/guestfish.pod:594
18084 #: ../fish/guestfish.pod:596
18085 msgid "This section applies to all commands which can take integers as parameters."
18089 #: ../fish/guestfish.pod:599
18090 msgid "SIZE SUFFIX"
18094 #: ../fish/guestfish.pod:601
18096 "When the command takes a parameter measured in bytes, you can use one of the "
18097 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18101 #: ../fish/guestfish.pod:607
18102 msgid "B<k> or B<K> or B<KiB>"
18106 #: ../fish/guestfish.pod:609
18107 msgid "The size in kilobytes (multiplied by 1024)."
18111 #: ../fish/guestfish.pod:611
18116 #: ../fish/guestfish.pod:613
18117 msgid "The size in SI 1000 byte units."
18121 #: ../fish/guestfish.pod:615
18122 msgid "B<M> or B<MiB>"
18126 #: ../fish/guestfish.pod:617
18127 msgid "The size in megabytes (multiplied by 1048576)."
18131 #: ../fish/guestfish.pod:619
18136 #: ../fish/guestfish.pod:621
18137 msgid "The size in SI 1000000 byte units."
18141 #: ../fish/guestfish.pod:623
18142 msgid "B<G> or B<GiB>"
18146 #: ../fish/guestfish.pod:625
18147 msgid "The size in gigabytes (multiplied by 2**30)."
18151 #: ../fish/guestfish.pod:627
18156 #: ../fish/guestfish.pod:629
18157 msgid "The size in SI 10**9 byte units."
18161 #: ../fish/guestfish.pod:631
18162 msgid "B<T> or B<TiB>"
18166 #: ../fish/guestfish.pod:633
18167 msgid "The size in terabytes (multiplied by 2**40)."
18171 #: ../fish/guestfish.pod:635
18176 #: ../fish/guestfish.pod:637
18177 msgid "The size in SI 10**12 byte units."
18181 #: ../fish/guestfish.pod:639
18182 msgid "B<P> or B<PiB>"
18186 #: ../fish/guestfish.pod:641
18187 msgid "The size in petabytes (multiplied by 2**50)."
18191 #: ../fish/guestfish.pod:643
18196 #: ../fish/guestfish.pod:645
18197 msgid "The size in SI 10**15 byte units."
18201 #: ../fish/guestfish.pod:647
18202 msgid "B<E> or B<EiB>"
18206 #: ../fish/guestfish.pod:649
18207 msgid "The size in exabytes (multiplied by 2**60)."
18211 #: ../fish/guestfish.pod:651
18216 #: ../fish/guestfish.pod:653
18217 msgid "The size in SI 10**18 byte units."
18221 #: ../fish/guestfish.pod:655
18222 msgid "B<Z> or B<ZiB>"
18226 #: ../fish/guestfish.pod:657
18227 msgid "The size in zettabytes (multiplied by 2**70)."
18231 #: ../fish/guestfish.pod:659
18236 #: ../fish/guestfish.pod:661
18237 msgid "The size in SI 10**21 byte units."
18241 #: ../fish/guestfish.pod:663
18242 msgid "B<Y> or B<YiB>"
18246 #: ../fish/guestfish.pod:665
18247 msgid "The size in yottabytes (multiplied by 2**80)."
18251 #: ../fish/guestfish.pod:667
18256 #: ../fish/guestfish.pod:669
18257 msgid "The size in SI 10**24 byte units."
18261 #: ../fish/guestfish.pod:675
18264 " truncate-size /file 1G\n"
18269 #: ../fish/guestfish.pod:677
18270 msgid "would truncate the file to 1 gigabyte."
18274 #: ../fish/guestfish.pod:679
18276 "Be careful because a few commands take sizes in kilobytes or megabytes "
18277 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18278 "Adding a suffix will probably not do what you expect."
18282 #: ../fish/guestfish.pod:683
18283 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18287 #: ../fish/guestfish.pod:685
18289 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18290 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18294 #: ../fish/guestfish.pod:688
18297 " 1234 decimal number 1234\n"
18298 " 02322 octal number, equivalent to decimal 1234\n"
18299 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18304 #: ../fish/guestfish.pod:692
18306 "When using the C<chmod> command, you almost always want to specify an octal "
18307 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18308 "L<chmod(1)> program):"
18312 #: ../fish/guestfish.pod:696
18315 " chmod 0777 /public # OK\n"
18316 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18321 #: ../fish/guestfish.pod:699
18323 "Commands that return numbers usually print them in decimal, but some "
18324 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18325 "octal, preceeded by C<0>)."
18329 #: ../fish/guestfish.pod:703
18330 msgid "WILDCARDS AND GLOBBING"
18334 #: ../fish/guestfish.pod:705
18336 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18337 "(globbing) by default. So for example the following will not do what you "
18342 #: ../fish/guestfish.pod:709
18350 #: ../fish/guestfish.pod:711
18352 "Assuming you don't have a directory called literally C</home/*> then the "
18353 "above command will return an error."
18357 #: ../fish/guestfish.pod:714
18358 msgid "To perform wildcard expansion, use the C<glob> command."
18362 #: ../fish/guestfish.pod:716
18365 " glob rm-rf /home/*\n"
18370 #: ../fish/guestfish.pod:718
18372 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18373 "many times), equivalent to:"
18377 #: ../fish/guestfish.pod:721
18380 " rm-rf /home/jim\n"
18381 " rm-rf /home/joe\n"
18382 " rm-rf /home/mary\n"
18387 #: ../fish/guestfish.pod:725
18388 msgid "C<glob> only works on simple guest paths and not on device names."
18392 #: ../fish/guestfish.pod:727
18394 "If you have several parameters, each containing a wildcard, then glob will "
18395 "perform a Cartesian product."
18399 #: ../fish/guestfish.pod:730
18404 #: ../fish/guestfish.pod:732
18406 "Any line which starts with a I<#> character is treated as a comment and "
18407 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18408 "a command. For example:"
18412 #: ../fish/guestfish.pod:736
18415 " # this is a comment\n"
18416 " # this is a comment\n"
18417 " foo # NOT a comment\n"
18422 #: ../fish/guestfish.pod:740
18423 msgid "Blank lines are also ignored."
18427 #: ../fish/guestfish.pod:742
18428 msgid "RUNNING COMMANDS LOCALLY"
18432 #: ../fish/guestfish.pod:744
18434 "Any line which starts with a I<!> character is treated as a command sent to "
18435 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18439 #: ../fish/guestfish.pod:748
18443 " tgz-out /remote local/remote-data.tar.gz\n"
18448 #: ../fish/guestfish.pod:751
18450 "will create a directory C<local> on the host, and then export the contents "
18451 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18452 "(See C<tgz-out>)."
18456 #: ../fish/guestfish.pod:755
18458 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18459 "effect, due to the way that subprocesses work in Unix."
18463 #: ../fish/guestfish.pod:758
18464 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18468 #: ../fish/guestfish.pod:760
18470 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18471 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18472 "and executed as guestfish commands."
18476 #: ../fish/guestfish.pod:764
18478 "Thus you can use shell script to construct arbitrary guestfish commands "
18479 "which are then parsed by guestfish."
18483 #: ../fish/guestfish.pod:767
18485 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18486 "through C</foo.100>) using guestfish commands alone. However this is simple "
18487 "if we use a shell script to create the guestfish commands for us:"
18491 #: ../fish/guestfish.pod:772
18494 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18499 #: ../fish/guestfish.pod:774
18500 msgid "or with names like C</foo.001>:"
18504 #: ../fish/guestfish.pod:776
18507 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18512 #: ../fish/guestfish.pod:778
18514 "When using guestfish interactively it can be helpful to just run the shell "
18515 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18516 "ordinary I<!> local command), see what guestfish commands it would run, and "
18517 "when you are happy with those prepend the C<E<lt>> character to run the "
18518 "guestfish commands for real."
18522 #: ../fish/guestfish.pod:784
18527 #: ../fish/guestfish.pod:786
18529 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18530 "command (a guestfish command) to the second command (any host command). For "
18535 #: ../fish/guestfish.pod:790
18538 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18543 #: ../fish/guestfish.pod:792
18545 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18546 "program). The above command would list all accounts in the guest filesystem "
18547 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18551 #: ../fish/guestfish.pod:797
18554 " hexdump /bin/ls | head\n"
18555 " list-devices | tail -1\n"
18556 " tgz-out / - | tar ztf -\n"
18561 #: ../fish/guestfish.pod:801
18563 "The space before the pipe symbol is required, any space after the pipe "
18564 "symbol is optional. Everything after the pipe symbol is just passed "
18565 "straight to the host shell, so it can contain redirections, globs and "
18566 "anything else that makes sense on the host side."
18570 #: ../fish/guestfish.pod:806
18572 "To use a literal argument which begins with a pipe symbol, you have to quote "
18577 #: ../fish/guestfish.pod:809
18585 #: ../fish/guestfish.pod:811
18586 msgid "HOME DIRECTORIES"
18590 #: ../fish/guestfish.pod:813
18592 "If a parameter starts with the character C<~> then the tilde may be expanded "
18593 "as a home directory path (either C<~> for the current user's home directory, "
18594 "or C<~user> for another user)."
18598 #: ../fish/guestfish.pod:817
18600 "Note that home directory expansion happens for users known I<on the host>, "
18601 "not in the guest filesystem."
18605 #: ../fish/guestfish.pod:820
18607 "To use a literal argument which begins with a tilde, you have to quote it, "
18612 #: ../fish/guestfish.pod:823
18620 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
18621 msgid "ENCRYPTED DISKS"
18625 #: ../fish/guestfish.pod:827
18627 "Libguestfs has some support for Linux guests encrypted according to the "
18628 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18629 "disk encryption systems used by modern Linux guests. Currently only "
18630 "LVM-on-LUKS is supported."
18634 #: ../fish/guestfish.pod:832
18635 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18639 #: ../fish/guestfish.pod:834
18642 " ><fs> vfs-type /dev/sda2\n"
18648 #: ../fish/guestfish.pod:837
18650 "Then open those devices using L</luks-open>. This creates a device-mapper "
18651 "device called C</dev/mapper/luksdev>."
18655 #: ../fish/guestfish.pod:840
18658 " ><fs> luks-open /dev/sda2 luksdev\n"
18659 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18664 #: ../fish/guestfish.pod:843
18666 "Finally you have to tell LVM to scan for volume groups on the newly created "
18671 #: ../fish/guestfish.pod:846
18675 " vg-activate-all true\n"
18680 #: ../fish/guestfish.pod:849
18681 msgid "The logical volume(s) can now be mounted in the usual way."
18685 #: ../fish/guestfish.pod:851
18687 "Before closing a LUKS device you must unmount any logical volumes on it and "
18688 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18689 "one. Then you can close the mapper device:"
18693 #: ../fish/guestfish.pod:855
18696 " vg-activate false /dev/VG\n"
18697 " luks-close /dev/mapper/luksdev\n"
18702 #: ../fish/guestfish.pod:860
18704 "If a path is prefixed with C<win:> then you can use Windows-style drive "
18705 "letters and paths (with some limitations). The following commands are "
18710 #: ../fish/guestfish.pod:864
18713 " file /WINDOWS/system32/config/system.LOG\n"
18718 #: ../fish/guestfish.pod:866
18721 " file win:\\windows\\system32\\config\\system.log\n"
18726 #: ../fish/guestfish.pod:868
18729 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
18734 #: ../fish/guestfish.pod:870
18736 "The parameter is rewritten \"behind the scenes\" by looking up the position "
18737 "where the drive is mounted, prepending that to the path, changing all "
18738 "backslash characters to forward slash, then resolving the result using "
18739 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
18740 "then the parameter might be rewritten like this:"
18744 #: ../fish/guestfish.pod:876
18747 " win:e:\\foo\\bar => /e/FOO/bar\n"
18752 #: ../fish/guestfish.pod:878
18753 msgid "This only works in argument positions that expect a path."
18757 #: ../fish/guestfish.pod:880
18758 msgid "UPLOADING AND DOWNLOADING FILES"
18762 #: ../fish/guestfish.pod:882
18764 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
18765 "others which upload from or download to a local file, you can use the "
18766 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
18770 #: ../fish/guestfish.pod:886
18778 #: ../fish/guestfish.pod:888
18779 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
18783 #: ../fish/guestfish.pod:891
18786 " tar-out /etc - | tar tf -\n"
18791 #: ../fish/guestfish.pod:893
18793 "writes the tarball to stdout and then pipes that into the external \"tar\" "
18794 "command (see L</PIPES>)."
18798 #: ../fish/guestfish.pod:896
18800 "When using C<-> to read from stdin, the input is read up to the end of "
18801 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
18802 "some arbitrary end marker:"
18806 #: ../fish/guestfish.pod:900
18809 " upload -<<END /foo\n"
18818 #: ../fish/guestfish.pod:906
18820 "Any string of characters can be used instead of C<END>. The end marker must "
18821 "appear on a line of its own, without any preceeding or following characters "
18822 "(not even spaces)."
18826 #: ../fish/guestfish.pod:910
18828 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
18829 "upload local files (so-called \"FileIn\" parameters in the generator)."
18833 #: ../fish/guestfish.pod:913
18834 msgid "EXIT ON ERROR BEHAVIOUR"
18838 #: ../fish/guestfish.pod:915
18840 "By default, guestfish will ignore any errors when in interactive mode "
18841 "(ie. taking commands from a human over a tty), and will exit on the first "
18842 "error in non-interactive mode (scripts, commands given on the command line)."
18846 #: ../fish/guestfish.pod:920
18848 "If you prefix a command with a I<-> character, then that command will not "
18849 "cause guestfish to exit, even if that (one) command returns an error."
18853 #: ../fish/guestfish.pod:924
18854 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
18858 #: ../fish/guestfish.pod:926
18860 "Guestfish can be remote-controlled over a socket. This is useful "
18861 "particularly in shell scripts where you want to make several different "
18862 "changes to a filesystem, but you don't want the overhead of starting up a "
18863 "guestfish process each time."
18867 #: ../fish/guestfish.pod:931
18868 msgid "Start a guestfish server process using:"
18872 #: ../fish/guestfish.pod:933
18875 " eval \"`guestfish --listen`\"\n"
18880 #: ../fish/guestfish.pod:935
18881 msgid "and then send it commands by doing:"
18885 #: ../fish/guestfish.pod:937
18888 " guestfish --remote cmd [...]\n"
18893 #: ../fish/guestfish.pod:939
18894 msgid "To cause the server to exit, send it the exit command:"
18898 #: ../fish/guestfish.pod:943
18900 "Note that the server will normally exit if there is an error in a command. "
18901 "You can change this in the usual way. See section L</EXIT ON ERROR "
18906 #: ../fish/guestfish.pod:947
18907 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
18911 #: ../fish/guestfish.pod:949
18913 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
18914 "is how the I<--remote> option knows where to send the commands. You can "
18915 "have several guestfish listener processes running using:"
18919 #: ../fish/guestfish.pod:953
18922 " eval \"`guestfish --listen`\"\n"
18923 " pid1=$GUESTFISH_PID\n"
18924 " eval \"`guestfish --listen`\"\n"
18925 " pid2=$GUESTFISH_PID\n"
18927 " guestfish --remote=$pid1 cmd\n"
18928 " guestfish --remote=$pid2 cmd\n"
18933 #: ../fish/guestfish.pod:961
18934 msgid "REMOTE CONTROL AND CSH"
18938 #: ../fish/guestfish.pod:963
18940 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
18945 #: ../fish/guestfish.pod:966
18948 " eval \"`guestfish --listen --csh`\"\n"
18953 #: ../fish/guestfish.pod:968
18954 msgid "REMOTE CONTROL DETAILS"
18958 #: ../fish/guestfish.pod:970
18960 "Remote control happens over a Unix domain socket called "
18961 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
18962 "of the process, and C<$PID> is the process ID of the server."
18966 #: ../fish/guestfish.pod:974
18967 msgid "Guestfish client and server versions must match exactly."
18971 #: ../fish/guestfish.pod:976
18972 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
18976 #: ../fish/guestfish.pod:978
18978 "From Bash, you can use the following code which creates a guestfish "
18979 "instance, correctly quotes the command line, handles failure to start, and "
18980 "cleans up guestfish when the script exits:"
18984 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
18992 #: ../fish/guestfish.pod:986
18995 " guestfish[0]=\"guestfish\"\n"
18996 " guestfish[1]=\"--listen\"\n"
18997 " guestfish[2]=\"--ro\"\n"
18998 " guestfish[3]=\"-a\"\n"
18999 " guestfish[4]=\"disk.img\"\n"
19004 #: ../fish/guestfish.pod:992
19007 " GUESTFISH_PID=\n"
19008 " eval $(\"${guestfish[@]}\")\n"
19009 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19010 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19017 #: ../fish/guestfish.pod:999
19020 " kill_guestfish ()\n"
19022 " kill $GUESTFISH_PID >/dev/null 2>&1 ||:\n"
19024 " trap kill_guestfish EXIT\n"
19029 #: ../fish/guestfish.pod:1005
19032 " guestfish --remote run\n"
19038 #: ../fish/guestfish.pod:1008
19039 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19043 #: ../fish/guestfish.pod:1010
19045 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19046 "context hangs, ie. don't do (note the backquotes):"
19050 #: ../fish/guestfish.pod:1013
19053 " a=`guestfish --remote run`\n"
19058 #: ../fish/guestfish.pod:1015
19060 "Since the C<run> command produces no output on stdout, this is not useful "
19061 "anyway. For further information see "
19062 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19066 #: ../fish/guestfish.pod:1019
19067 msgid "PREPARED DISK IMAGES"
19071 #: ../fish/guestfish.pod:1021
19073 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19074 "preformatted disk images that guestfish can make for you to save typing. "
19075 "This is particularly useful for testing purposes. This option is used "
19076 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19077 "can be mixed with I<-a>)."
19081 #: ../fish/guestfish.pod:1027
19083 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19084 "the second and so on. Existing files in the current directory are "
19089 #: ../fish/guestfish.pod:1031
19091 "The type briefly describes how the disk should be sized, partitioned, how "
19092 "filesystem(s) should be created, and how content should be added. "
19093 "Optionally the type can be followed by extra parameters, separated by C<:> "
19094 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19095 "sparsely-allocated disk, containing a single partition, with the partition "
19096 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19097 "on a 1GB disk instead."
19101 #: ../fish/guestfish.pod:1039
19102 msgid "To list the available types and any extra parameters they take, run:"
19106 #: ../fish/guestfish.pod:1043
19108 "Note that the prepared filesystem is not mounted. You would usually have to "
19109 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19113 #: ../fish/guestfish.pod:1047
19115 "If any I<-N> or I<--new> options are given, the guest is automatically "
19120 #: ../fish/guestfish.pod:1052
19121 msgid "Create a 100MB disk with an ext4-formatted partition:"
19125 #: ../fish/guestfish.pod:1054
19128 " guestfish -N fs:ext4\n"
19133 #: ../fish/guestfish.pod:1056
19134 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19138 #: ../fish/guestfish.pod:1058
19141 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19146 #: ../fish/guestfish.pod:1060
19147 msgid "Create a blank 200MB disk:"
19151 #: ../fish/guestfish.pod:1062
19154 " guestfish -N disk:200M\n"
19159 #: ../fish/guestfish.pod:1064
19160 msgid "PROGRESS BARS"
19164 #: ../fish/guestfish.pod:1066
19166 "Some (not all) long-running commands send progress notification messages as "
19167 "they are running. Guestfish turns these messages into progress bars."
19171 #: ../fish/guestfish.pod:1070
19173 "When a command that supports progress bars takes longer than two seconds to "
19174 "run, and if progress bars are enabled, then you will see one appearing below "
19179 #: ../fish/guestfish.pod:1074
19182 " ><fs> copy-size /large-file /another-file 2048M\n"
19183 " / 10% [#####-----------------------------------------] 00:30\n"
19188 #: ../fish/guestfish.pod:1077
19190 "The spinner on the left hand side moves round once for every progress "
19191 "notification received from the backend. This is a (reasonably) golden "
19192 "assurance that the command is \"doing something\" even if the progress bar "
19193 "is not moving, because the command is able to send the progress "
19194 "notifications. When the bar reaches 100% and the command finishes, the "
19195 "spinner disappears."
19199 #: ../fish/guestfish.pod:1084
19201 "Progress bars are enabled by default when guestfish is used interactively. "
19202 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19203 "and you can disable them completely using I<--no-progress-bars>."
19207 #: ../fish/guestfish.pod:1089
19208 msgid "GUESTFISH COMMANDS"
19212 #: ../fish/guestfish.pod:1091
19214 "The commands in this section are guestfish convenience commands, in other "
19215 "words, they are not part of the L<guestfs(3)> API."
19219 #: ../fish/guestfish.pod:1094
19224 #: ../fish/guestfish.pod:1096
19233 #: ../fish/guestfish.pod:1099
19234 msgid "Without any parameter, this provides general help."
19238 #: ../fish/guestfish.pod:1101
19239 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19243 #: ../fish/guestfish.pod:1103
19244 msgid "quit | exit"
19248 #: ../fish/guestfish.pod:1105
19249 msgid "This exits guestfish. You can also use C<^D> key."
19253 #: ../fish/guestfish.pod:1107
19254 msgid "@FISH_COMMANDS@"
19258 #: ../fish/guestfish.pod:1109
19263 #: ../fish/guestfish.pod:1111 ../src/guestfs.pod:1505
19268 #: ../fish/guestfish.pod:1115
19270 "guestfish returns 0 if the commands completed without error, or 1 if there "
19275 #: ../fish/guestfish.pod:1122
19280 #: ../fish/guestfish.pod:1124
19282 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19287 #: ../fish/guestfish.pod:1127 ../src/guestfs.pod:3198
19288 msgid "FEBOOTSTRAP_KERNEL"
19292 #: ../fish/guestfish.pod:1129 ../src/guestfs.pod:3200
19293 msgid "FEBOOTSTRAP_MODULES"
19297 #: ../fish/guestfish.pod:1131 ../src/guestfs.pod:3202
19299 "These two environment variables allow the kernel that libguestfs uses in the "
19300 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19301 "most recent host kernel is chosen. For more information about kernel "
19302 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19303 "available in febootstrap E<ge> 3.8."
19307 #: ../fish/guestfish.pod:1137
19308 msgid "GUESTFISH_DISPLAY_IMAGE"
19312 #: ../fish/guestfish.pod:1139
19314 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19315 "If not set, it uses L<display(1)>."
19319 #: ../fish/guestfish.pod:1142
19320 msgid "GUESTFISH_PID"
19324 #: ../fish/guestfish.pod:1144
19326 "Used with the I<--remote> option to specify the remote guestfish process to "
19327 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19331 #: ../fish/guestfish.pod:1148
19336 #: ../fish/guestfish.pod:1150
19338 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19339 "not specified, the external L<hexedit(1)> program is used."
19343 #: ../fish/guestfish.pod:1154
19348 #: ../fish/guestfish.pod:1156
19350 "If compiled with GNU readline support, various files in the home directory "
19351 "can be used. See L</FILES>."
19355 #: ../fish/guestfish.pod:1159 ../src/guestfs.pod:3208
19356 msgid "LIBGUESTFS_APPEND"
19360 #: ../fish/guestfish.pod:1161 ../src/guestfs.pod:3210
19361 msgid "Pass additional options to the guest kernel."
19365 #: ../fish/guestfish.pod:1163 ../src/guestfs.pod:3212
19366 msgid "LIBGUESTFS_DEBUG"
19370 #: ../fish/guestfish.pod:1165
19372 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19373 "effect as using the B<-v> option."
19377 #: ../fish/guestfish.pod:1168 ../src/guestfs.pod:3217
19378 msgid "LIBGUESTFS_MEMSIZE"
19382 #: ../fish/guestfish.pod:1170 ../src/guestfs.pod:3219
19383 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19387 #: ../fish/guestfish.pod:1173 ../src/guestfs.pod:3222
19390 " LIBGUESTFS_MEMSIZE=700\n"
19395 #: ../fish/guestfish.pod:1175 ../src/guestfs.pod:3224
19396 msgid "LIBGUESTFS_PATH"
19400 #: ../fish/guestfish.pod:1177
19402 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19403 "the discussion of paths in L<guestfs(3)>."
19407 #: ../fish/guestfish.pod:1180 ../src/guestfs.pod:3229
19408 msgid "LIBGUESTFS_QEMU"
19412 #: ../fish/guestfish.pod:1182 ../src/guestfs.pod:3231
19414 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19415 "which was found at compile time by the configure script is used."
19419 #: ../fish/guestfish.pod:1186 ../src/guestfs.pod:3237
19420 msgid "LIBGUESTFS_TRACE"
19424 #: ../fish/guestfish.pod:1188
19425 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19429 #: ../fish/guestfish.pod:1190
19434 #: ../fish/guestfish.pod:1192
19436 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19441 #: ../fish/guestfish.pod:1195 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3242
19446 #: ../fish/guestfish.pod:1197 ../src/guestfs.pod:3244
19448 "Location of temporary directory, defaults to C</tmp> except for the cached "
19449 "supermin appliance which defaults to C</var/tmp>."
19453 #: ../fish/guestfish.pod:1200 ../src/guestfs.pod:3247
19455 "If libguestfs was compiled to use the supermin appliance then the real "
19456 "appliance is cached in this directory, shared between all handles belonging "
19457 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19458 "use in case C</var/tmp> is not large enough."
19462 #: ../fish/guestfish.pod:1208 ../fuse/guestmount.pod:288 ../rescue/virt-rescue.pod:273
19467 #: ../fish/guestfish.pod:1212 ../fuse/guestmount.pod:292 ../rescue/virt-rescue.pod:277
19468 msgid "$HOME/.libguestfs-tools.rc"
19472 #: ../fish/guestfish.pod:1214 ../fuse/guestmount.pod:294 ../rescue/virt-rescue.pod:279
19473 msgid "/etc/libguestfs-tools.conf"
19477 #: ../fish/guestfish.pod:1216 ../fuse/guestmount.pod:296 ../rescue/virt-rescue.pod:281
19479 "This configuration file controls the default read-only or read-write mode "
19480 "(I<--ro> or I<--rw>)."
19484 #: ../fish/guestfish.pod:1219
19485 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
19489 #: ../fish/guestfish.pod:1221
19490 msgid "$HOME/.guestfish"
19494 #: ../fish/guestfish.pod:1223
19496 "If compiled with GNU readline support, then the command history is saved in "
19501 #: ../fish/guestfish.pod:1226
19502 msgid "$HOME/.inputrc"
19506 #: ../fish/guestfish.pod:1228
19507 msgid "/etc/inputrc"
19511 #: ../fish/guestfish.pod:1230
19513 "If compiled with GNU readline support, then these files can be used to "
19514 "configure readline. For further information, please see "
19515 "L<readline(3)/INITIALIZATION FILE>."
19519 #: ../fish/guestfish.pod:1234
19520 msgid "To write rules which only apply to guestfish, use:"
19524 #: ../fish/guestfish.pod:1236
19534 #: ../fish/guestfish.pod:1240
19536 "Variables that you can set in inputrc that change the behaviour of guestfish "
19537 "in useful ways include:"
19541 #: ../fish/guestfish.pod:1245
19542 msgid "completion-ignore-case (default: on)"
19546 #: ../fish/guestfish.pod:1247
19548 "By default, guestfish will ignore case when tab-completing paths on the "
19553 #: ../fish/guestfish.pod:1250
19556 " set completion-ignore-case off\n"
19561 #: ../fish/guestfish.pod:1252
19562 msgid "to make guestfish case sensitive."
19566 #: ../fish/guestfish.pod:1256
19571 #: ../fish/guestfish.pod:1258
19572 msgid "test2.img (etc)"
19576 #: ../fish/guestfish.pod:1260
19578 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
19579 "will be created in the file C<test1.img> in the current directory. The "
19580 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
19581 "the same name will be overwritten."
19585 #: ../fish/guestfish.pod:1269
19587 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
19588 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
19589 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
19590 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
19591 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
19592 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
19593 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
19594 "L<febootstrap-supermin-helper(8)>."
19598 #: ../fish/guestfish.pod:1301 ../src/guestfs.pod:3339 ../test-tool/libguestfs-test-tool.pod:112
19599 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
19603 #: ../fish/virt-copy-in.pod:5
19604 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
19608 #: ../fish/virt-copy-in.pod:9
19611 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
19616 #: ../fish/virt-copy-in.pod:11
19619 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
19624 #: ../fish/virt-copy-in.pod:15
19626 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
19627 "causing disk corruption. The virtual machine must be shut down before you "
19628 "use this command."
19632 #: ../fish/virt-copy-in.pod:21
19634 "C<virt-copy-in> copies files and directories from the local disk into a "
19635 "virtual machine disk image or named libvirt domain."
19639 #: ../fish/virt-copy-in.pod:24
19641 "You can give one of more filenames and directories on the command line. "
19642 "Directories are copied in recursively. The final parameter must be the "
19643 "destination directory in the disk image which must be an absolute path "
19644 "starting with a C</> character."
19648 #: ../fish/virt-copy-in.pod:33
19651 " virt-copy-in -d MyGuest resolv.conf /etc\n"
19656 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
19657 msgid "Upload a home directory to a guest:"
19661 #: ../fish/virt-copy-in.pod:37
19664 " virt-copy-in -d MyGuest skel /home\n"
19669 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
19670 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
19674 #: ../fish/virt-copy-in.pod:41
19676 "This command is just a simple shell script wrapper around the "
19677 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
19678 "trivial copy, you are probably better off using guestfish directly."
19682 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
19684 "Since the shell script just passes options straight to guestfish, read "
19685 "L<guestfish(1)> to see the full list of options."
19689 #: ../fish/virt-copy-in.pod:52
19691 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
19692 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19696 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
19697 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
19701 #: ../fish/virt-copy-out.pod:5
19703 "virt-copy-out - Copy files and directories out of a virtual machine disk "
19708 #: ../fish/virt-copy-out.pod:9
19711 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
19716 #: ../fish/virt-copy-out.pod:11
19719 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
19724 #: ../fish/virt-copy-out.pod:15
19726 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
19727 "image or named libvirt domain."
19731 #: ../fish/virt-copy-out.pod:18
19733 "You can give one of more filenames and directories on the command line. "
19734 "Directories are copied out recursively."
19738 #: ../fish/virt-copy-out.pod:23
19739 msgid "Download the home directories from a virtual machine:"
19743 #: ../fish/virt-copy-out.pod:25
19747 " virt-copy-out -d MyGuest /home homes\n"
19752 #: ../fish/virt-copy-out.pod:30
19754 "This command is just a simple shell script wrapper around the "
19755 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
19756 "trivial copy, you are probably better off using guestfish directly."
19760 #: ../fish/virt-copy-out.pod:41
19762 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
19763 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19767 #: ../fish/virt-tar-in.pod:5
19768 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
19772 #: ../fish/virt-tar-in.pod:9
19775 " virt-tar-in -a disk.img data.tar /destination\n"
19780 #: ../fish/virt-tar-in.pod:11
19783 " virt-tar-in -d domain data.tar /destination\n"
19788 #: ../fish/virt-tar-in.pod:13
19791 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
19796 #: ../fish/virt-tar-in.pod:17
19798 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
19799 "causing disk corruption. The virtual machine must be shut down before you "
19800 "use this command."
19804 #: ../fish/virt-tar-in.pod:23
19806 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
19807 "image or named libvirt domain."
19811 #: ../fish/virt-tar-in.pod:26
19813 "The first parameter is the tar file. Use C<-> to read the tar file from "
19814 "standard input. The second parameter is the absolute target directory to "
19819 #: ../fish/virt-tar-in.pod:34
19822 " virt-tar-in -d MyGuest homes.tar /home\n"
19827 #: ../fish/virt-tar-in.pod:38
19829 "This command is just a simple shell script wrapper around the "
19830 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
19831 "copy, you are probably better off using guestfish directly."
19835 #: ../fish/virt-tar-in.pod:49
19837 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19838 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
19839 "L<http://libguestfs.org/>."
19843 #: ../fish/virt-tar-out.pod:5
19844 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
19848 #: ../fish/virt-tar-out.pod:9
19851 " virt-tar-out -a disk.img /dir files.tar\n"
19856 #: ../fish/virt-tar-out.pod:11
19859 " virt-tar-out -d domain /dir files.tar\n"
19864 #: ../fish/virt-tar-out.pod:13
19867 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
19872 #: ../fish/virt-tar-out.pod:17
19873 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
19877 #: ../fish/virt-tar-out.pod:20
19879 "The first parameter is the absolute path of the virtual machine directory. "
19880 "The second parameter is the tar file to write. Use C<-> to write to "
19885 #: ../fish/virt-tar-out.pod:26
19886 msgid "Download the home directories from a guest:"
19890 #: ../fish/virt-tar-out.pod:28
19893 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
19898 #: ../fish/virt-tar-out.pod:32
19900 "This command is just a simple shell script wrapper around the "
19901 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
19902 "trivial copy, you are probably better off using guestfish directly."
19906 #: ../fish/virt-tar-out.pod:43
19908 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
19909 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
19913 #: ../fuse/guestmount.pod:5
19914 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
19918 #: ../fuse/guestmount.pod:9
19921 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
19926 #: ../fuse/guestmount.pod:11
19929 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
19934 #: ../fuse/guestmount.pod:13
19937 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
19942 #: ../fuse/guestmount.pod:17
19944 "You must I<not> use C<guestmount> in read-write mode on live virtual "
19945 "machines. If you do this, you risk disk corruption in the VM."
19949 #: ../fuse/guestmount.pod:22
19951 "The guestmount program can be used to mount virtual machine filesystems and "
19952 "other disk images on the host. It uses libguestfs for access to the guest "
19953 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
19954 "a mountable device."
19958 #: ../fuse/guestmount.pod:27
19960 "Along with other options, you have to give at least one device (I<-a> "
19961 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
19962 "option) or use the I<-i> inspection option. How this works is better "
19963 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
19968 #: ../fuse/guestmount.pod:33
19970 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
19971 "by you, and the filesystem will not be visible to any other users unless you "
19972 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
19973 "the filesystem, use the C<fusermount -u> command."
19977 #: ../fuse/guestmount.pod:41
19979 "For a typical Windows guest which has its main filesystem on the first "
19984 #: ../fuse/guestmount.pod:44
19987 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
19992 #: ../fuse/guestmount.pod:46
19994 "For a typical Linux guest which has a /boot filesystem on the first "
19995 "partition, and the root filesystem on a logical volume:"
19999 #: ../fuse/guestmount.pod:49
20002 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20007 #: ../fuse/guestmount.pod:51
20008 msgid "To get libguestfs to detect guest mountpoints for you:"
20012 #: ../fuse/guestmount.pod:53
20015 " guestmount -a guest.img -i --ro /mnt\n"
20020 #: ../fuse/guestmount.pod:55
20021 msgid "For a libvirt guest called \"Guest\" you could do:"
20025 #: ../fuse/guestmount.pod:57
20028 " guestmount -d Guest -i --ro /mnt\n"
20033 #: ../fuse/guestmount.pod:59
20035 "If you don't know what filesystems are contained in a guest or disk image, "
20036 "use L<virt-filesystems(1)> first:"
20040 #: ../fuse/guestmount.pod:62
20043 " virt-filesystems MyGuest\n"
20048 #: ../fuse/guestmount.pod:64
20050 "If you want to trace the libguestfs calls but without excessive debugging "
20051 "information, we recommend:"
20055 #: ../fuse/guestmount.pod:67
20058 " guestmount [...] --trace /mnt\n"
20063 #: ../fuse/guestmount.pod:69
20064 msgid "If you want to debug the program, we recommend:"
20068 #: ../fuse/guestmount.pod:71
20071 " guestmount [...] --trace --verbose /mnt\n"
20076 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:544
20081 #: ../fuse/guestmount.pod:75
20082 msgid "Other users cannot see the filesystem by default"
20086 #: ../fuse/guestmount.pod:77
20088 "If you mount a filesystem as one user (eg. root), then other users will not "
20089 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20090 "option when mounting:"
20094 #: ../fuse/guestmount.pod:81
20097 " sudo guestmount [...] -o allow_other /mnt\n"
20102 #: ../fuse/guestmount.pod:91
20103 msgid "Add a block device or virtual machine image."
20107 #: ../fuse/guestmount.pod:114
20108 msgid "B<--dir-cache-timeout N>"
20112 #: ../fuse/guestmount.pod:116
20114 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20115 "seconds. The readdir cache [actually, there are several semi-independent "
20116 "caches] is populated after a readdir(2) call with the stat and extended "
20117 "attributes of the files in the directory, in anticipation that they will be "
20118 "requested soon after."
20122 #: ../fuse/guestmount.pod:122
20124 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20125 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20126 "requests, only cache existing ones."
20130 #: ../fuse/guestmount.pod:142
20132 "If you have untrusted raw-format guest disk images, you should use this "
20133 "option to specify the disk format. This avoids a possible security problem "
20134 "with malicious guests (CVE-2010-3851). See also "
20135 "L<guestfs(3)/guestfs_add_drive_opts>."
20139 #: ../fuse/guestmount.pod:147
20140 msgid "B<--fuse-help>"
20144 #: ../fuse/guestmount.pod:149
20145 msgid "Display help on special FUSE options (see I<-o> below)."
20149 #: ../fuse/guestmount.pod:153
20150 msgid "Display brief help and exit."
20154 #: ../fuse/guestmount.pod:177
20156 "Mount the named partition or logical volume on the given mountpoint B<in the "
20157 "guest> (this has nothing to do with mountpoints in the host)."
20161 #: ../fuse/guestmount.pod:180
20163 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20164 "something on C</>."
20168 #: ../fuse/guestmount.pod:197
20170 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20171 "unmounted. If you specify this option, then we don't attempt to sync the "
20172 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20176 #: ../fuse/guestmount.pod:202
20177 msgid "B<-o option>"
20181 #: ../fuse/guestmount.pod:204
20182 msgid "B<--option option>"
20186 #: ../fuse/guestmount.pod:206
20187 msgid "Pass extra options to FUSE."
20191 #: ../fuse/guestmount.pod:208
20193 "To get a list of all the extra options supported by FUSE, use the command "
20194 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20195 "of them are a good idea."
20199 #: ../fuse/guestmount.pod:212
20202 " guestmount --fuse-help\n"
20207 #: ../fuse/guestmount.pod:214
20208 msgid "Some potentially useful FUSE options:"
20212 #: ../fuse/guestmount.pod:218
20213 msgid "B<-o allow_other>"
20217 #: ../fuse/guestmount.pod:220
20218 msgid "Allow other users to see the filesystem."
20222 #: ../fuse/guestmount.pod:222
20223 msgid "B<-o attr_timeout=N>"
20227 #: ../fuse/guestmount.pod:224
20228 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20232 #: ../fuse/guestmount.pod:226
20233 msgid "B<-o kernel_cache>"
20237 #: ../fuse/guestmount.pod:228
20239 "Allow the kernel to cache files (reduces the number of reads that have to go "
20240 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20241 "afford the extra memory usage."
20245 #: ../fuse/guestmount.pod:232
20246 msgid "B<-o uid=N> B<-o gid=N>"
20250 #: ../fuse/guestmount.pod:234
20252 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20253 "the chosen values."
20257 #: ../fuse/guestmount.pod:243
20259 "Add devices and mount everything read-only. Also disallow writes and make "
20260 "the disk appear read-only to FUSE."
20264 #: ../fuse/guestmount.pod:246
20266 "This is highly recommended if you are not going to edit the guest disk. If "
20267 "the guest is running and this option is I<not> supplied, then there is a "
20268 "strong risk of disk corruption in the guest. We try to prevent this from "
20269 "happening, but it is not always possible."
20273 #: ../fuse/guestmount.pod:251 ../rescue/virt-rescue.pod:171
20274 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20278 #: ../fuse/guestmount.pod:255
20279 msgid "Enable SELinux support for the guest."
20283 #: ../fuse/guestmount.pod:261
20284 msgid "Enable verbose messages from underlying libguestfs."
20288 #: ../fuse/guestmount.pod:267
20289 msgid "Display the program version and exit."
20293 #: ../fuse/guestmount.pod:276 ../fuse/guestmount.pod:299 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20294 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20298 #: ../fuse/guestmount.pod:280
20303 #: ../fuse/guestmount.pod:282
20304 msgid "Trace libguestfs calls and entry into each FUSE function."
20308 #: ../fuse/guestmount.pod:284
20309 msgid "This also stops the daemon from forking into the background."
20313 #: ../fuse/guestmount.pod:310
20315 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20316 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20317 "L<http://fuse.sf.net/>."
20321 #: ../fuse/guestmount.pod:325
20322 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20326 #: ../inspector/virt-inspector.pod:5
20328 "virt-inspector - Display operating system version and other information "
20329 "about a virtual machine"
20333 #: ../inspector/virt-inspector.pod:9
20336 " virt-inspector [--options] -d domname\n"
20341 #: ../inspector/virt-inspector.pod:11
20344 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20349 #: ../inspector/virt-inspector.pod:15
20352 " virt-inspector domname\n"
20357 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20360 " virt-inspector disk.img [disk.img ...]\n"
20365 #: ../inspector/virt-inspector.pod:21
20367 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20368 "determine the version of the operating system and other information about "
20369 "the virtual machine."
20373 #: ../inspector/virt-inspector.pod:25
20374 msgid "Virt-inspector produces XML output for feeding into other programs."
20378 #: ../inspector/virt-inspector.pod:27
20380 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20381 "the libvirt domain (see: C<virsh list --all>)."
20385 #: ../inspector/virt-inspector.pod:30
20387 "You can also run virt-inspector directly on disk images from a single "
20388 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20389 "has several block devices, in which case you should list several I<-a> "
20390 "options one after another, with the first corresponding to the guest's "
20391 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20395 #: ../inspector/virt-inspector.pod:37
20397 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20398 "keys and similar."
20402 #: ../inspector/virt-inspector.pod:40
20404 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20405 "inspect several virtual machines, you have to run virt-inspector several "
20406 "times (for example, from a shell script for-loop)."
20410 #: ../inspector/virt-inspector.pod:45
20412 "Because virt-inspector needs direct access to guest images, it won't "
20413 "normally work over remote libvirt connections."
20417 #: ../inspector/virt-inspector.pod:48
20419 "All of the information available from virt-inspector is also available "
20420 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20421 "The same information can also be fetched using guestfish or via libguestfs "
20422 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20423 "WITH OTHER PROGRAMMING LANGUAGES>)."
20427 #: ../inspector/virt-inspector.pod:81
20429 "Libvirt is only used if you specify a C<domname> on the command line. If "
20430 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20435 #: ../inspector/virt-inspector.pod:94
20437 "When prompting for keys and passphrases, virt-inspector normally turns "
20438 "echoing off so you cannot see what you are typing. If you are not worried "
20439 "about Tempest attacks and there is no one else in the room you can specify "
20440 "this flag to see what you are typing."
20444 #: ../inspector/virt-inspector.pod:103 ../tools/virt-list-filesystems.pl:93 ../tools/virt-list-partitions.pl:94 ../tools/virt-tar.pl:143 ../tools/virt-win-reg.pl:144
20446 "Specify the format of disk images given on the command line. If this is "
20447 "omitted then the format is autodetected from the content of the disk image."
20451 #: ../inspector/virt-inspector.pod:107 ../tools/virt-list-filesystems.pl:97 ../tools/virt-list-partitions.pl:98 ../tools/virt-tar.pl:147 ../tools/virt-win-reg.pl:148
20453 "If disk images are requested from libvirt, then this program asks libvirt "
20454 "for this information. In this case, the value of the format parameter is "
20459 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314 ../resize/virt-resize.pod:406 ../sparsify/virt-sparsify.pod:132 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
20461 "If working with untrusted raw-format guest disk images, you should ensure "
20462 "the format is always specified."
20466 #: ../inspector/virt-inspector.pod:139
20467 msgid "Previous versions of virt-inspector allowed you to write either:"
20471 #: ../inspector/virt-inspector.pod:145
20474 " virt-inspector guestname\n"
20479 #: ../inspector/virt-inspector.pod:153
20484 #: ../inspector/virt-inspector.pod:155
20486 "The virt-inspector XML is described precisely in a RELAX NG schema file "
20487 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
20488 "just an overview."
20492 #: ../inspector/virt-inspector.pod:159
20494 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
20495 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
20496 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
20497 "which is vanishingly rare in real world VMs."
20501 #: ../inspector/virt-inspector.pod:164
20502 msgid "E<lt>operatingsystemE<gt>"
20506 #: ../inspector/virt-inspector.pod:166
20508 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20509 "describe the operating system, its architecture, the descriptive \"product "
20510 "name\" string, the type of OS and so on, as in this example:"
20514 #: ../inspector/virt-inspector.pod:170
20517 " <operatingsystems>\n"
20518 " <operatingsystem>\n"
20519 " <root>/dev/sda2</root>\n"
20520 " <name>windows</name>\n"
20521 " <arch>i386</arch>\n"
20522 " <distro>windows</distro>\n"
20523 " <product_name>Windows 7 Enterprise</product_name>\n"
20524 " <product_variant>Client</product_variant>\n"
20525 " <major_version>6</major_version>\n"
20526 " <minor_version>1</minor_version>\n"
20527 " <windows_systemroot>/Windows</windows_systemroot>\n"
20528 " <format>installed</format>\n"
20533 #: ../inspector/virt-inspector.pod:183
20535 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
20536 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
20537 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
20538 "architecture. The other fields are fairly self-explanatory, but because "
20539 "these fields are taken directly from the libguestfs inspection API you can "
20540 "find precise information from L<guestfs(3)/INSPECTION>."
20544 #: ../inspector/virt-inspector.pod:191
20546 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
20547 "of view of libguestfs (block devices may have completely different names "
20548 "inside the VM itself)."
20552 #: ../inspector/virt-inspector.pod:195
20553 msgid "E<lt>mountpointsE<gt>"
20557 #: ../inspector/virt-inspector.pod:197
20559 "Un*x-like guests typically have multiple filesystems which are mounted at "
20560 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
20561 "element which looks like this:"
20565 #: ../inspector/virt-inspector.pod:201
20568 " <operatingsystems>\n"
20569 " <operatingsystem>\n"
20572 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
20573 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
20574 " </mountpoints>\n"
20579 #: ../inspector/virt-inspector.pod:209
20581 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
20582 "and may have completely different names inside the guest. Only mountable "
20583 "filesystems appear in this list, not things like swap devices."
20587 #: ../inspector/virt-inspector.pod:214
20588 msgid "E<lt>filesystemsE<gt>"
20592 #: ../inspector/virt-inspector.pod:216
20594 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
20595 "filesystems belonging to the guest, including swap and empty partitions. "
20596 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
20597 "this OS or shared with this OS and other OSes)."
20601 #: ../inspector/virt-inspector.pod:222
20602 msgid "You might see something like this:"
20606 #: ../inspector/virt-inspector.pod:224
20609 " <operatingsystems>\n"
20610 " <operatingsystem>\n"
20613 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20614 " <type>ext4</type>\n"
20615 " <label>Fedora-13-x86_64</label>\n"
20616 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
20622 #: ../inspector/virt-inspector.pod:234
20624 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
20625 "the label, and the UUID."
20629 #: ../inspector/virt-inspector.pod:237
20630 msgid "E<lt>applicationsE<gt>"
20634 #: ../inspector/virt-inspector.pod:239
20636 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
20637 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
20642 #: ../inspector/virt-inspector.pod:243
20644 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
20645 "Typical values would be C<rpm> and C<deb>."
20649 #: ../inspector/virt-inspector.pod:246
20651 "E<lt>package_managementE<gt>, if present, describes the package manager. "
20652 "Typical values include C<yum>, C<up2date> and C<apt>"
20656 #: ../inspector/virt-inspector.pod:249
20657 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
20661 #: ../inspector/virt-inspector.pod:252
20664 " <operatingsystems>\n"
20665 " <operatingsystem>\n"
20667 " <applications>\n"
20669 " <name>coreutils</name>\n"
20670 " <version>8.5</version>\n"
20671 " <release>1</release>\n"
20672 " </application>\n"
20677 #: ../inspector/virt-inspector.pod:262
20679 "The version and release fields may not be available for some types guests. "
20680 "Other fields are possible, see "
20681 "L<guestfs(3)/guestfs_inspect_list_applications>."
20685 #: ../inspector/virt-inspector.pod:266
20686 msgid "E<lt>drive_mappingsE<gt>"
20690 #: ../inspector/virt-inspector.pod:268
20692 "For operating systems like Windows which use drive letters, virt-inspector "
20693 "is able to find out how drive letters map to filesystems."
20697 #: ../inspector/virt-inspector.pod:272
20700 " <operatingsystems>\n"
20701 " <operatingsystem>\n"
20703 " <drive_mappings>\n"
20704 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
20705 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
20706 " </drive_mappings>\n"
20711 #: ../inspector/virt-inspector.pod:280
20713 "In the example above, drive C maps to the filesystem on the second partition "
20714 "on the first disk, and drive E maps to the filesystem on the first partition "
20715 "on the second disk."
20719 #: ../inspector/virt-inspector.pod:284
20721 "Note that this only covers permanent local filesystem mappings, not things "
20722 "like network shares. Furthermore NTFS volume mount points may not be listed "
20727 #: ../inspector/virt-inspector.pod:288
20728 msgid "E<lt>iconE<gt>"
20732 #: ../inspector/virt-inspector.pod:290
20734 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
20735 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
20736 "very large and high quality."
20740 #: ../inspector/virt-inspector.pod:294
20743 " <operatingsystems>\n"
20744 " <operatingsystem>\n"
20747 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
20748 " [... many lines of base64 data ...]\n"
20754 #: ../inspector/virt-inspector.pod:302
20756 "To display the icon, you have to extract it and convert the base64 data back "
20757 "to a binary file. Use an XPath query or simply an editor to extract the "
20758 "data, then use the coreutils L<base64(1)> program to do the conversion back "
20763 #: ../inspector/virt-inspector.pod:307
20766 " base64 -i -d < icon.data > icon.png\n"
20771 #: ../inspector/virt-inspector.pod:309
20772 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
20776 #: ../inspector/virt-inspector.pod:311
20778 "Virt-inspector can detect some operating system installers on install disks, "
20779 "live CDs, bootable USB keys and more."
20783 #: ../inspector/virt-inspector.pod:314
20785 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
20786 "fields may be present to indicate a live CD, network installer, or one part "
20787 "of a multipart CD. For example:"
20791 #: ../inspector/virt-inspector.pod:318
20794 " <operatingsystems>\n"
20795 " <operatingsystem>\n"
20796 " <root>/dev/sda</root>\n"
20797 " <name>linux</name>\n"
20798 " <arch>i386</arch>\n"
20799 " <distro>ubuntu</distro>\n"
20800 " <product_name>Ubuntu 10.10 "Maverick "
20801 "Meerkat"</product_name>\n"
20802 " <major_version>10</major_version>\n"
20803 " <minor_version>10</minor_version>\n"
20804 " <format>installer</format>\n"
20810 #: ../inspector/virt-inspector.pod:330
20811 msgid "USING XPATH"
20815 #: ../inspector/virt-inspector.pod:332
20817 "You can use the XPath query language to select parts of the XML. We "
20818 "recommend using C<xmlstarlet> to perform XPath queries from the command "
20823 #: ../inspector/virt-inspector.pod:338
20826 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
20828 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20829 " <type>ext4</type>\n"
20835 #: ../inspector/virt-inspector.pod:344
20838 " $ virt-inspector -d Guest | \\\n"
20839 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
20845 #: ../inspector/virt-inspector.pod:348
20848 " $ virt-inspector -d Guest | \\\n"
20849 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
20850 " [displays the guest icon, if there is one]\n"
20855 #: ../inspector/virt-inspector.pod:359
20856 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
20860 #: ../inspector/virt-inspector.pod:361
20862 "Early versions of libguestfs shipped with a different virt-inspector program "
20863 "written in Perl (the current version is written in C). The XML output of "
20864 "the Perl virt-inspector was different and it could also output in other "
20865 "formats like text."
20869 #: ../inspector/virt-inspector.pod:366
20870 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
20874 #: ../inspector/virt-inspector.pod:369
20876 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
20877 "versions of virt-inspector with different names:"
20881 #: ../inspector/virt-inspector.pod:372
20884 " virt-inspector Old Perl version.\n"
20885 " virt-inspector2 New C version.\n"
20890 #: ../inspector/virt-inspector.pod:382
20892 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
20893 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
20897 #: ../inspector/virt-inspector.pod:399
20898 msgid "Matthew Booth L<mbooth@redhat.com>"
20902 #: ../java/examples/guestfs-java.pod:5
20903 msgid "guestfs-java - How to use libguestfs from Java"
20907 #: ../java/examples/guestfs-java.pod:9
20910 " import com.redhat.et.libguestfs.*;\n"
20915 #: ../java/examples/guestfs-java.pod:11
20918 " GuestFS g = new GuestFS ();\n"
20919 " g.add_drive_opts (\"disk.img\", null);\n"
20925 #: ../java/examples/guestfs-java.pod:17
20927 "This manual page documents how to call libguestfs from the Java programming "
20928 "language. This page just documents the differences from the C API and gives "
20929 "some examples. If you are not familiar with using libguestfs, you also need "
20930 "to read L<guestfs(3)>."
20934 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
20935 msgid "CLOSING THE HANDLE"
20939 #: ../java/examples/guestfs-java.pod:24
20941 "The handle is closed when it is reaped by the garbage collector. Because "
20942 "libguestfs handles include a lot of state, it is also possible to close (and "
20943 "hence free) them explicitly by calling the C<close> method."
20947 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
20952 #: ../java/examples/guestfs-java.pod:31
20954 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
20955 "exception. This has a single parameter which is the error message (a "
20960 #: ../java/examples/guestfs-java.pod:35
20961 msgid "Calling any method on a closed handle raises the same exception."
20965 #: ../java/examples/guestfs-java.pod:47
20967 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
20968 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
20969 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
20970 "L<http://caml.inria.fr/>."
20974 #: ../ocaml/examples/guestfs-ocaml.pod:5
20975 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
20979 #: ../ocaml/examples/guestfs-ocaml.pod:9
20980 msgid "Module style:"
20984 #: ../ocaml/examples/guestfs-ocaml.pod:11
20987 " let g = Guestfs.create () in\n"
20988 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
20989 " Guestfs.launch g;\n"
20994 #: ../ocaml/examples/guestfs-ocaml.pod:15
20995 msgid "Object-oriented style:"
20999 #: ../ocaml/examples/guestfs-ocaml.pod:17
21002 " let g = new Guestfs.guestfs () in\n"
21003 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21009 #: ../ocaml/examples/guestfs-ocaml.pod:21
21012 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21014 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21019 #: ../ocaml/examples/guestfs-ocaml.pod:27
21021 "This manual page documents how to call libguestfs from the OCaml programming "
21022 "language. This page just documents the differences from the C API and gives "
21023 "some examples. If you are not familiar with using libguestfs, you also need "
21024 "to read L<guestfs(3)>."
21028 #: ../ocaml/examples/guestfs-ocaml.pod:32
21029 msgid "PROGRAMMING STYLES"
21033 #: ../ocaml/examples/guestfs-ocaml.pod:34
21035 "There are two different programming styles supported by the OCaml bindings. "
21036 "You can use a module style, with each C function mapped to an OCaml "
21041 #: ../ocaml/examples/guestfs-ocaml.pod:38
21044 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21049 #: ../ocaml/examples/guestfs-ocaml.pod:40
21054 #: ../ocaml/examples/guestfs-ocaml.pod:42
21057 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21062 #: ../ocaml/examples/guestfs-ocaml.pod:44
21064 "Alternately you can use an object-oriented style, calling methods on the "
21065 "class C<Guestfs.guestfs>:"
21069 #: ../ocaml/examples/guestfs-ocaml.pod:47
21072 " method set_verbose : bool -> unit\n"
21077 #: ../ocaml/examples/guestfs-ocaml.pod:49
21079 "The object-oriented style is usually briefer, and the minor performance "
21080 "penalty isn't noticable in the general overhead of performing libguestfs "
21085 #: ../ocaml/examples/guestfs-ocaml.pod:55
21087 "The handle is closed when it is reaped by the garbage collector. Because "
21088 "libguestfs handles include a lot of state, it is also possible to close (and "
21089 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21094 #: ../ocaml/examples/guestfs-ocaml.pod:62
21096 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21097 "exception. This has a single parameter which is the error message (a "
21102 #: ../ocaml/examples/guestfs-ocaml.pod:66
21104 "Calling any function/method on a closed handle raises "
21105 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21110 #: ../ocaml/examples/guestfs-ocaml.pod:80
21112 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21113 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21114 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21115 "L<http://caml.inria.fr/>."
21119 #: ../perl/examples/guestfs-perl.pod:5
21120 msgid "guestfs-perl - How to use libguestfs from Perl"
21124 #: ../perl/examples/guestfs-perl.pod:9
21127 " use Sys::Guestfs;\n"
21132 #: ../perl/examples/guestfs-perl.pod:11
21135 " my $h = Sys::Guestfs->new ();\n"
21136 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21137 " $h->launch ();\n"
21138 " $h->mount_options ('', '/dev/sda1', '/');\n"
21139 " $h->touch ('/hello');\n"
21145 #: ../perl/examples/guestfs-perl.pod:20
21147 "This manual page documents how to call libguestfs from the Perl programming "
21148 "language. This page just documents the differences from the C API and gives "
21149 "some examples. If you are not familiar with using libguestfs, you also need "
21150 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21154 #: ../perl/examples/guestfs-perl.pod:26
21159 #: ../perl/examples/guestfs-perl.pod:28
21161 "Errors from libguestfs functions turn into calls to C<croak> (see "
21166 #: ../perl/examples/guestfs-perl.pod:41
21168 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21169 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21170 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21171 "L<http://libguestfs.org/>."
21175 #: ../python/examples/guestfs-python.pod:5
21176 msgid "guestfs-python - How to use libguestfs from Python"
21180 #: ../python/examples/guestfs-python.pod:9
21183 " import guestfs\n"
21184 " g = guestfs.GuestFS ()\n"
21185 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21191 #: ../python/examples/guestfs-python.pod:16
21193 "This manual page documents how to call libguestfs from the Python "
21194 "programming language. This page just documents the differences from the C "
21195 "API and gives some examples. If you are not familiar with using libguestfs, "
21196 "you also need to read L<guestfs(3)>."
21200 #: ../python/examples/guestfs-python.pod:23
21202 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21203 "single string argument which is the error message."
21207 #: ../python/examples/guestfs-python.pod:26
21208 msgid "MORE DOCUMENTATION"
21212 #: ../python/examples/guestfs-python.pod:28
21217 #: ../python/examples/guestfs-python.pod:30
21221 " >>> import guestfs\n"
21222 " >>> help (guestfs)\n"
21227 #: ../python/examples/guestfs-python.pod:44
21229 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21230 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21231 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21235 #: ../rescue/virt-rescue.pod:5
21236 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21240 #: ../rescue/virt-rescue.pod:9
21243 " virt-rescue [--options] -d domname\n"
21248 #: ../rescue/virt-rescue.pod:11
21251 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21256 #: ../rescue/virt-rescue.pod:15
21259 " virt-rescue [--options] domname\n"
21264 #: ../rescue/virt-rescue.pod:17
21267 " virt-rescue [--options] disk.img [disk.img ...]\n"
21272 #: ../rescue/virt-rescue.pod:21
21274 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21275 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21276 "you from doing this, but doesn't catch all cases."
21280 #: ../rescue/virt-rescue.pod:25
21282 "However if you use the I<--ro> (read only) option, then you can attach a "
21283 "shell to a live virtual machine. The results might be strange or "
21284 "inconsistent at times but you won't get disk corruption."
21288 #: ../rescue/virt-rescue.pod:31
21290 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21291 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21292 "recovery tools which you can use to examine or rescue a virtual machine or "
21297 #: ../rescue/virt-rescue.pod:36
21299 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21300 "on disk image(s):"
21304 #: ../rescue/virt-rescue.pod:39
21307 " virt-rescue -d GuestName\n"
21312 #: ../rescue/virt-rescue.pod:41
21315 " virt-rescue --ro -a /path/to/disk.img\n"
21320 #: ../rescue/virt-rescue.pod:43
21323 " virt-rescue -a /dev/sdc\n"
21328 #: ../rescue/virt-rescue.pod:45
21329 msgid "For live VMs you I<must> use the --ro option."
21333 #: ../rescue/virt-rescue.pod:47
21335 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21336 "in an interactive bash shell where you can use many ordinary Linux "
21337 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21338 "appliance. You must mount the virtual machine's filesystems by hand. There "
21339 "is an empty directory called C</sysroot> where you can mount filesystems."
21343 #: ../rescue/virt-rescue.pod:54
21345 "In the example below, we list logical volumes, then choose one to mount "
21346 "under C</sysroot>:"
21350 #: ../rescue/virt-rescue.pod:57
21354 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21355 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21356 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21357 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21358 " ><rescue> ls /sysroot\n"
21363 #: ../rescue/virt-rescue.pod:64
21365 "If you don't know what filesystems are available on the virtual machine then "
21366 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21370 #: ../rescue/virt-rescue.pod:70
21372 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21373 "virtual machine. For example you can use it on a blank file if you want to "
21374 "partition that file (although we would recommend using L<guestfish(1)> "
21375 "instead as it is more suitable for this purpose). You can even use "
21376 "virt-rescue on things like SD cards."
21380 #: ../rescue/virt-rescue.pod:76
21382 "Virt-rescue does not require root. You only need to run it as root if you "
21383 "need root to open the disk image."
21387 #: ../rescue/virt-rescue.pod:79
21389 "This tool is just designed for quick interactive hacking on a virtual "
21390 "machine. For more structured access to a virtual machine disk image, you "
21391 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21392 "make scripted changes to guests, use L<guestfish(1)>."
21396 #: ../rescue/virt-rescue.pod:103
21397 msgid "B<--append kernelopts>"
21401 #: ../rescue/virt-rescue.pod:105
21402 msgid "Pass additional options to the rescue kernel."
21406 #: ../rescue/virt-rescue.pod:135
21409 " virt-rescue --format=raw -a disk.img\n"
21414 #: ../rescue/virt-rescue.pod:139
21417 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21422 #: ../rescue/virt-rescue.pod:148
21427 #: ../rescue/virt-rescue.pod:150
21428 msgid "B<--memsize MB>"
21432 #: ../rescue/virt-rescue.pod:152
21434 "Change the amount of memory allocated to the rescue system. The default is "
21435 "set by libguestfs and is small but adequate for running system tools. The "
21436 "occasional program might need more memory. The parameter is specified in "
21441 #: ../rescue/virt-rescue.pod:157
21442 msgid "B<--network>"
21446 #: ../rescue/virt-rescue.pod:159
21447 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
21451 #: ../rescue/virt-rescue.pod:165
21452 msgid "Open the image read-only."
21456 #: ../rescue/virt-rescue.pod:175
21458 "Enable SELinux in the rescue appliance. You should read "
21459 "L<guestfs(3)/SELINUX> before using this option."
21463 #: ../rescue/virt-rescue.pod:178
21468 #: ../rescue/virt-rescue.pod:180
21469 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
21473 #: ../rescue/virt-rescue.pod:198
21475 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
21476 "are done read-write."
21480 #: ../rescue/virt-rescue.pod:211
21481 msgid "Previous versions of virt-rescue allowed you to write either:"
21485 #: ../rescue/virt-rescue.pod:213
21488 " virt-rescue disk.img [disk.img ...]\n"
21493 #: ../rescue/virt-rescue.pod:217
21496 " virt-rescue guestname\n"
21501 #: ../rescue/virt-rescue.pod:225
21506 #: ../rescue/virt-rescue.pod:227
21508 "Adding the I<--network> option enables QEMU user networking in the rescue "
21509 "appliance. There are some differences between user networking and ordinary "
21514 #: ../rescue/virt-rescue.pod:233
21515 msgid "ping does not work"
21519 #: ../rescue/virt-rescue.pod:235
21521 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
21522 "send the ping packets, and because virt-rescue must be able to run as "
21523 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
21524 "command. The ping command will appear to resolve addresses but will not be "
21525 "able to send or receive any packets. This does not mean that the network is "
21530 #: ../rescue/virt-rescue.pod:242
21531 msgid "cannot receive connections"
21535 #: ../rescue/virt-rescue.pod:244
21536 msgid "QEMU user networking cannot receive incoming connections."
21540 #: ../rescue/virt-rescue.pod:246
21541 msgid "making TCP connections"
21545 #: ../rescue/virt-rescue.pod:248
21547 "The virt-rescue appliance needs to be small and so does not include many "
21548 "network tools. In particular there is no L<telnet(1)> command. You can "
21549 "make TCP connections from the shell using the magical "
21550 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
21554 #: ../rescue/virt-rescue.pod:253
21557 " exec 3<>/dev/tcp/redhat.com/80\n"
21558 " echo \"GET /\" >&3\n"
21564 #: ../rescue/virt-rescue.pod:257
21565 msgid "See L<bash(1)> for more details."
21569 #: ../rescue/virt-rescue.pod:263
21571 "Several environment variables affect virt-rescue. See "
21572 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
21576 #: ../rescue/virt-rescue.pod:290
21578 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21579 "L<http://libguestfs.org/>."
21583 #: ../resize/virt-resize.pod:5
21584 msgid "virt-resize - Resize a virtual machine disk"
21588 #: ../resize/virt-resize.pod:9
21591 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
21592 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
21593 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
21598 #: ../resize/virt-resize.pod:15
21600 "Virt-resize is a tool which can resize a virtual machine disk, making it "
21601 "larger or smaller overall, and resizing or deleting any partitions contained "
21606 #: ../resize/virt-resize.pod:19
21608 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
21609 "not> be used on live virtual machines - for consistent results, shut the "
21610 "virtual machine down before resizing it."
21614 #: ../resize/virt-resize.pod:23
21616 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
21617 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
21621 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520 ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469 ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2675
21626 #: ../resize/virt-resize.pod:33
21628 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
21629 "fill the extra 5GB of space."
21633 #: ../resize/virt-resize.pod:36
21636 " virt-filesystems --long -h --all -a olddisk\n"
21641 #: ../resize/virt-resize.pod:38
21644 " truncate -r olddisk newdisk\n"
21645 " truncate -s +5G newdisk\n"
21650 #: ../resize/virt-resize.pod:41
21653 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
21654 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
21659 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527 ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475 ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2700
21664 #: ../resize/virt-resize.pod:46
21666 "As above, but make the /boot partition 200MB bigger, while giving the "
21667 "remaining space to /dev/sda2:"
21671 #: ../resize/virt-resize.pod:49
21674 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21675 " olddisk newdisk\n"
21680 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486 ../src/guestfs.pod:1436
21685 #: ../resize/virt-resize.pod:54
21687 "As in the first example, but expand a logical volume as the final step. "
21688 "This is what you would typically use for Linux guests that use LVM:"
21692 #: ../resize/virt-resize.pod:58
21695 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
21696 " olddisk newdisk\n"
21701 #: ../resize/virt-resize.pod:61
21706 #: ../resize/virt-resize.pod:63
21708 "As in the first example, but the output format will be qcow2 instead of a "
21713 #: ../resize/virt-resize.pod:66
21716 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
21717 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
21722 #: ../resize/virt-resize.pod:71
21723 msgid "DETAILED USAGE"
21727 #: ../resize/virt-resize.pod:73
21728 msgid "EXPANDING A VIRTUAL MACHINE DISK"
21732 #: ../resize/virt-resize.pod:77
21733 msgid "1. Shut down the virtual machine"
21737 #: ../resize/virt-resize.pod:79
21738 msgid "2. Locate input disk image"
21742 #: ../resize/virt-resize.pod:81
21744 "Locate the input disk image (ie. the file or device on the host containing "
21745 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
21746 "dumpxml> like this to find the disk image name:"
21750 #: ../resize/virt-resize.pod:85
21753 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
21754 " Found 1 nodes:\n"
21756 " <source dev=\"/dev/vg/lv_guest\" />\n"
21761 #: ../resize/virt-resize.pod:90
21762 msgid "3. Look at current sizing"
21766 #: ../resize/virt-resize.pod:92
21767 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
21771 #: ../resize/virt-resize.pod:95
21774 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
21775 " Name Type Size Parent\n"
21776 " /dev/sda1 partition 101M /dev/sda\n"
21777 " /dev/sda2 partition 7.9G /dev/sda\n"
21778 " /dev/sda device 8.0G -\n"
21783 #: ../resize/virt-resize.pod:101
21785 "(This example is a virtual machine with an 8 GB disk which we would like to "
21786 "expand up to 10 GB)."
21790 #: ../resize/virt-resize.pod:104
21791 msgid "4. Create output disk"
21795 #: ../resize/virt-resize.pod:106
21797 "Virt-resize cannot do in-place disk modifications. You have to have space "
21798 "to store the resized output disk."
21802 #: ../resize/virt-resize.pod:109
21803 msgid "To store the resized disk image in a file, create a file of a suitable size:"
21807 #: ../resize/virt-resize.pod:112
21810 " # rm -f outdisk\n"
21811 " # truncate -s 10G outdisk\n"
21816 #: ../resize/virt-resize.pod:115
21817 msgid "Or use L<lvcreate(1)> to create a logical volume:"
21821 #: ../resize/virt-resize.pod:117
21824 " # lvcreate -L 10G -n lv_name vg_name\n"
21829 #: ../resize/virt-resize.pod:119
21830 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
21834 #: ../resize/virt-resize.pod:121
21837 " # virsh pool-list\n"
21838 " # virsh vol-create-as poolname newvol 10G\n"
21843 #: ../resize/virt-resize.pod:124
21848 #: ../resize/virt-resize.pod:126
21850 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
21851 "file) and the output disk. The output disk is the one created in the "
21856 #: ../resize/virt-resize.pod:130
21859 " # virt-resize indisk outdisk\n"
21864 #: ../resize/virt-resize.pod:132
21866 "This command just copies disk image C<indisk> to disk image C<outdisk> "
21867 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
21868 "larger, then an extra, empty partition is created at the end of the disk "
21869 "covering the extra space. If C<outdisk> is smaller, then it will give an "
21874 #: ../resize/virt-resize.pod:138
21876 "More realistically you'd want to expand existing partitions in the disk "
21877 "image by passing extra options (for the full list see the L</OPTIONS> "
21882 #: ../resize/virt-resize.pod:142
21884 "L</--expand> is the most useful option. It expands the named partition "
21885 "within the disk to fill any extra space:"
21889 #: ../resize/virt-resize.pod:145
21892 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
21897 #: ../resize/virt-resize.pod:147
21899 "(In this case, an extra partition is I<not> created at the end of the disk, "
21900 "because there will be no unused space)."
21904 #: ../resize/virt-resize.pod:150
21906 "L</--resize> is the other commonly used option. The following would "
21907 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
21908 "rest of the available space:"
21912 #: ../resize/virt-resize.pod:154
21915 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21916 " indisk outdisk\n"
21921 #: ../resize/virt-resize.pod:157
21923 "If the expanded partition in the image contains a filesystem or LVM PV, then "
21924 "if virt-resize knows how, it will resize the contents, the equivalent of "
21925 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
21926 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
21927 "filesystems, so you would have to online resize them after booting the "
21932 #: ../resize/virt-resize.pod:164
21933 msgid "Other options are covered below."
21937 #: ../resize/virt-resize.pod:166
21942 #: ../resize/virt-resize.pod:168
21943 msgid "Thoroughly test the new disk image I<before> discarding the old one."
21947 #: ../resize/virt-resize.pod:170
21948 msgid "If you are using libvirt, edit the XML to point at the new disk:"
21952 #: ../resize/virt-resize.pod:172
21955 " # virsh edit guestname\n"
21960 #: ../resize/virt-resize.pod:174
21962 "Change E<lt>source ...E<gt>, see "
21963 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
21967 #: ../resize/virt-resize.pod:177
21968 msgid "Then start up the domain with the new, resized disk:"
21972 #: ../resize/virt-resize.pod:179
21975 " # virsh start guestname\n"
21980 #: ../resize/virt-resize.pod:181
21982 "and check that it still works. See also the L</NOTES> section below for "
21983 "additional information."
21987 #: ../resize/virt-resize.pod:184
21988 msgid "7. Resize LVs etc inside the guest"
21992 #: ../resize/virt-resize.pod:186
21993 msgid "(This can also be done offline using L<guestfish(1)>)"
21997 #: ../resize/virt-resize.pod:188
21999 "Once the guest has booted you should see the new space available, at least "
22000 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22001 "may need to resize LVs inside PVs, and also resize filesystem types that "
22002 "virt-resize does not know how to expand."
22006 #: ../resize/virt-resize.pod:195
22007 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22011 #: ../resize/virt-resize.pod:197
22013 "Shrinking is somewhat more complex than expanding, and only an overview is "
22018 #: ../resize/virt-resize.pod:200
22020 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22021 "filesystems). The user has to shrink content before passing the disk image "
22022 "to virt-resize, and virt-resize will check that the content has been shrunk "
22027 #: ../resize/virt-resize.pod:205
22028 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22032 #: ../resize/virt-resize.pod:207
22034 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22035 "steps 3 and 4 above to allocate a new disk image."
22039 #: ../resize/virt-resize.pod:210
22040 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22044 #: ../resize/virt-resize.pod:213
22045 msgid "IGNORING OR DELETING PARTITIONS"
22049 #: ../resize/virt-resize.pod:215
22051 "virt-resize also gives a convenient way to ignore or delete partitions when "
22052 "copying from the input disk to the output disk. Ignoring a partition speeds "
22053 "up the copy where you don't care about the existing contents of a "
22054 "partition. Deleting a partition removes it completely, but note that it "
22055 "also renumbers any partitions after the one which is deleted, which can "
22056 "leave some guests unbootable."
22060 #: ../resize/virt-resize.pod:222
22061 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22065 #: ../resize/virt-resize.pod:224
22067 "If the input disk is in qcow2 format, then you may prefer that the output is "
22068 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22069 "the fly. The output format is simply determined by the format of the empty "
22070 "output container that you provide. Thus to create qcow2 output, use:"
22074 #: ../resize/virt-resize.pod:230
22077 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22082 #: ../resize/virt-resize.pod:232
22083 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22087 #: ../resize/virt-resize.pod:234
22088 msgid "Similarly, to get non-sparse raw output use:"
22092 #: ../resize/virt-resize.pod:236
22095 " fallocate -l size outdisk\n"
22100 #: ../resize/virt-resize.pod:238
22102 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22103 "if=/dev/zero of=outdisk bs=1M count=..>)"
22107 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
22108 msgid "Display help."
22112 #: ../resize/virt-resize.pod:249
22117 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22122 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
22123 msgid "Enable debugging messages."
22127 #: ../resize/virt-resize.pod:255
22128 msgid "B<--delete part>"
22132 #: ../resize/virt-resize.pod:257
22134 "Delete the named partition. It would be more accurate to describe this as "
22135 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22136 "the original disk image is left intact."
22140 #: ../resize/virt-resize.pod:261
22142 "Note that when you delete a partition, then anything contained in the "
22143 "partition is also deleted. Furthermore, this causes any partitions that "
22144 "come after to be I<renumbered>, which can easily make your guest unbootable."
22148 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
22149 msgid "You can give this option multiple times."
22153 #: ../resize/virt-resize.pod:268
22154 msgid "B<--expand part>"
22158 #: ../resize/virt-resize.pod:270
22160 "Expand the named partition so it uses up all extra space (space left over "
22161 "after any other resize changes that you request have been done)."
22165 #: ../resize/virt-resize.pod:273
22167 "If virt-resize knows how, it will expand the direct content of the "
22168 "partition. For example, if the partition is an LVM PV, it will expand the "
22169 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22170 "content it doesn't know about alone."
22174 #: ../resize/virt-resize.pod:278
22175 msgid "Currently virt-resize can resize:"
22179 #: ../resize/virt-resize.pod:284
22180 msgid "ext2, ext3 and ext4 filesystems."
22184 #: ../resize/virt-resize.pod:288
22185 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22189 #: ../resize/virt-resize.pod:290
22191 "The filesystem must have been shut down consistently last time it was used. "
22192 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22193 "consistency check, so at the first boot after resizing Windows will check "
22198 #: ../resize/virt-resize.pod:297
22200 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22201 "inside the PV, but see the I<--LV-expand> option. The user could also "
22202 "resize LVs as desired after boot."
22206 #: ../resize/virt-resize.pod:303
22207 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22211 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
22212 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22216 #: ../resize/virt-resize.pod:309 ../sparsify/virt-sparsify.pod:125 ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
22217 msgid "B<--format> raw"
22221 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
22223 "Specify the format of the input disk image. If this flag is not given then "
22224 "it is auto-detected from the image itself."
22228 #: ../resize/virt-resize.pod:317
22230 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22231 "AND NON-SPARSE RAW FORMATS>."
22235 #: ../resize/virt-resize.pod:320
22236 msgid "B<--ignore part>"
22240 #: ../resize/virt-resize.pod:322
22242 "Ignore the named partition. Effectively this means the partition is "
22243 "allocated on the destination disk, but the content is not copied across from "
22244 "the source disk. The content of the partition will be blank (all zero "
22249 #: ../resize/virt-resize.pod:329
22250 msgid "B<--LV-expand logvol>"
22254 #: ../resize/virt-resize.pod:331
22256 "This takes the logical volume and, as a final step, expands it to fill all "
22257 "the space available in its volume group. A typical usage, assuming a Linux "
22258 "guest with a single PV C</dev/sda2> and a root device called "
22259 "C</dev/vg_guest/lv_root> would be:"
22263 #: ../resize/virt-resize.pod:336
22266 " virt-resize indisk outdisk \\\n"
22267 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22272 #: ../resize/virt-resize.pod:339
22274 "This would first expand the partition (and PV), and then expand the root "
22275 "device to fill the extra space in the PV."
22279 #: ../resize/virt-resize.pod:342
22281 "The contents of the LV are also resized if virt-resize knows how to do "
22282 "that. You can stop virt-resize from trying to expand the content by using "
22283 "the option I<--no-expand-content>."
22287 #: ../resize/virt-resize.pod:346
22288 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
22292 #: ../resize/virt-resize.pod:348
22294 "You can give this option multiple times, I<but> it doesn't make sense to do "
22295 "this unless the logical volumes you specify are all in different volume "
22300 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
22301 msgid "B<--machine-readable>"
22305 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
22307 "This option is used to make the output more machine friendly when being "
22308 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
22312 #: ../resize/virt-resize.pod:360
22313 msgid "B<--dryrun>"
22317 #: ../resize/virt-resize.pod:362
22318 msgid "Print a summary of what would be done, but don't do anything."
22322 #: ../resize/virt-resize.pod:364
22323 msgid "B<--no-copy-boot-loader>"
22327 #: ../resize/virt-resize.pod:366
22329 "By default, virt-resize copies over some sectors at the start of the disk "
22330 "(up to the beginning of the first partition). Commonly these sectors "
22331 "contain the Master Boot Record (MBR) and the boot loader, and are required "
22332 "in order for the guest to boot correctly."
22336 #: ../resize/virt-resize.pod:371
22338 "If you specify this flag, then this initial copy is not done. You may need "
22339 "to reinstall the boot loader in this case."
22343 #: ../resize/virt-resize.pod:374
22344 msgid "B<--no-extra-partition>"
22348 #: ../resize/virt-resize.pod:376
22350 "By default, virt-resize creates an extra partition if there is any extra, "
22351 "unused space after all resizing has happened. Use this option to prevent "
22352 "the extra partition from being created. If you do this then the extra space "
22353 "will be inaccessible until you run fdisk, parted, or some other partitioning "
22354 "tool in the guest."
22358 #: ../resize/virt-resize.pod:382
22360 "Note that if the surplus space is smaller than 10 MB, no extra partition "
22365 #: ../resize/virt-resize.pod:385
22366 msgid "B<--no-expand-content>"
22370 #: ../resize/virt-resize.pod:387
22372 "By default, virt-resize will try to expand the direct contents of "
22373 "partitions, if it knows how (see I<--expand> option above)."
22377 #: ../resize/virt-resize.pod:390
22379 "If you give the I<--no-expand-content> option then virt-resize will not "
22384 #: ../resize/virt-resize.pod:393
22385 msgid "B<--ntfsresize-force>"
22389 #: ../resize/virt-resize.pod:395
22391 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
22392 "the NTFS disk is marked as needing a consistency check. You have to use "
22393 "this option if you want to resize a Windows guest multiple times without "
22394 "booting into Windows between each resize."
22398 #: ../resize/virt-resize.pod:401
22399 msgid "B<--output-format> raw"
22403 #: ../resize/virt-resize.pod:403
22405 "Specify the format of the output disk image. If this flag is not given then "
22406 "it is auto-detected from the image itself."
22410 #: ../resize/virt-resize.pod:409
22412 "Note that this option I<does not create> the output format. This option "
22413 "just tells libguestfs what it is so it doesn't try to guess it. You still "
22414 "need to create the output disk with the right format. See L</QCOW2 AND "
22415 "NON-SPARSE RAW FORMATS>."
22419 #: ../resize/virt-resize.pod:418
22420 msgid "Don't print the summary."
22424 #: ../resize/virt-resize.pod:420
22425 msgid "B<--resize part=size>"
22429 #: ../resize/virt-resize.pod:422
22431 "Resize the named partition (expanding or shrinking it) so that it has the "
22436 #: ../resize/virt-resize.pod:425
22438 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
22439 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
22440 "size; or as a relative number or percentage. For example:"
22444 #: ../resize/virt-resize.pod:431
22447 " --resize /dev/sda2=10G\n"
22452 #: ../resize/virt-resize.pod:433
22455 " --resize /dev/sda4=90%\n"
22460 #: ../resize/virt-resize.pod:435
22463 " --resize /dev/sda2=+1G\n"
22468 #: ../resize/virt-resize.pod:437
22471 " --resize /dev/sda2=-200M\n"
22476 #: ../resize/virt-resize.pod:439
22479 " --resize /dev/sda1=+128K\n"
22484 #: ../resize/virt-resize.pod:441
22487 " --resize /dev/sda1=+10%\n"
22492 #: ../resize/virt-resize.pod:443
22495 " --resize /dev/sda1=-10%\n"
22500 #: ../resize/virt-resize.pod:445
22502 "You can increase the size of any partition. Virt-resize will expand the "
22503 "direct content of the partition if it knows how (see I<--expand> below)."
22507 #: ../resize/virt-resize.pod:449
22509 "You can only I<decrease> the size of partitions that contain filesystems or "
22510 "PVs which have already been shrunk. Virt-resize will check this has been "
22511 "done before proceeding, or else will print an error (see also "
22512 "I<--resize-force>)."
22516 #: ../resize/virt-resize.pod:456
22517 msgid "B<--resize-force part=size>"
22521 #: ../resize/virt-resize.pod:458
22523 "This is the same as I<--resize> except that it will let you decrease the "
22524 "size of any partition. Generally this means you will lose any data which "
22525 "was at the end of the partition you shrink, but you may not care about that "
22526 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
22527 "as a swap partition)."
22531 #: ../resize/virt-resize.pod:464
22532 msgid "See also the I<--ignore> option."
22536 #: ../resize/virt-resize.pod:466
22537 msgid "B<--shrink part>"
22541 #: ../resize/virt-resize.pod:468
22543 "Shrink the named partition until the overall disk image fits in the "
22544 "destination. The named partition B<must> contain a filesystem or PV which "
22545 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
22546 "online tools). Virt-resize will check this and give an error if it has not "
22551 #: ../resize/virt-resize.pod:474
22553 "The amount by which the overall disk must be shrunk (after carrying out all "
22554 "other operations requested by the user) is called the \"deficit\". For "
22555 "example, a straight copy (assume no other operations) from a 5GB disk image "
22556 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
22557 "would give an error unless the user specified a partition to shrink and that "
22558 "partition had more than a gigabyte of free space."
22562 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
22563 msgid "MACHINE READABLE OUTPUT"
22567 #: ../resize/virt-resize.pod:494
22569 "The I<--machine-readable> option can be used to make the output more machine "
22570 "friendly, which is useful when calling virt-resize from other programs, GUIs "
22575 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
22576 msgid "There are two ways to use this option."
22580 #: ../resize/virt-resize.pod:500
22582 "Firstly use the option on its own to query the capabilities of the "
22583 "virt-resize binary. Typical output looks like this:"
22587 #: ../resize/virt-resize.pod:503
22590 " $ virt-resize --machine-readable\n"
22592 " ntfsresize-force\n"
22600 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
22602 "A list of features is printed, one per line, and the program exits with "
22607 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
22609 "Secondly use the option in conjunction with other options to make the "
22610 "regular program output more machine friendly."
22614 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
22615 msgid "At the moment this means:"
22619 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
22621 "Progress bar messages can be parsed from stdout by looking for this regular "
22626 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
22629 " ^[0-9]+/[0-9]+$\n"
22634 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
22636 "The calling program should treat messages sent to stdout (except for "
22637 "progress bar messages) as status messages. They can be logged and/or "
22638 "displayed to the user."
22642 #: ../resize/virt-resize.pod:535
22644 "The calling program should treat messages sent to stderr as error messages. "
22645 "In addition, virt-resize exits with a non-zero status code if there was a "
22650 #: ../resize/virt-resize.pod:541
22652 "Versions of the program prior to 1.13.9 did not support the "
22653 "I<--machine-readable> option and will return an error."
22657 #: ../resize/virt-resize.pod:546
22658 msgid "\"Partition 1 does not end on cylinder boundary.\""
22662 #: ../resize/virt-resize.pod:548
22664 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
22665 "means the partitions will not be aligned to the ancient CHS geometry. "
22666 "However CHS geometry is meaningless for disks manufactured since the early "
22667 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
22668 "cylinders is not required by any modern operating system."
22672 #: ../resize/virt-resize.pod:555
22673 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
22677 #: ../resize/virt-resize.pod:557
22679 "In Windows Vista and later versions, Microsoft switched to using a separate "
22680 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
22681 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
22682 "the boot partition. Doing so seems to break the guest completely. However "
22683 "expanding the second partition (ie. C: drive) should work."
22687 #: ../resize/virt-resize.pod:564
22689 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
22690 "NTFS partitions have been expanded. This is just a safety check and (unless "
22691 "it find errors) is nothing to worry about."
22695 #: ../resize/virt-resize.pod:568
22696 msgid "GUEST BOOT STUCK AT \"GRUB\""
22700 #: ../resize/virt-resize.pod:570
22702 "If a Linux guest does not boot after resizing, and the boot is stuck after "
22703 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
22704 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
22705 "although we think is to do with partition alignment."
22709 #: ../resize/virt-resize.pod:575
22712 " guestfish -i -a newdisk\n"
22713 " ><fs> cat /boot/grub/device.map\n"
22714 " # check the contents of this file are sensible or\n"
22715 " # edit the file if necessary\n"
22716 " ><fs> grub-install / /dev/vda\n"
22722 #: ../resize/virt-resize.pod:582
22724 "For more flexible guest reconfiguration, including if you need to specify "
22725 "other parameters to grub-install, use L<virt-rescue(1)>."
22729 #: ../resize/virt-resize.pod:585
22730 msgid "ALTERNATIVE TOOLS"
22734 #: ../resize/virt-resize.pod:587
22736 "There are several proprietary tools for resizing partitions. We won't "
22737 "mention any here."
22741 #: ../resize/virt-resize.pod:590
22743 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
22744 "operations on disk images. They can resize and move partitions, but I don't "
22745 "think they can do anything with the contents, and they certainly don't "
22750 #: ../resize/virt-resize.pod:595
22752 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
22753 "but at a much lower level. You will probably end up hand-calculating sector "
22754 "offsets, which is something that virt-resize was designed to avoid. If you "
22755 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
22760 #: ../resize/virt-resize.pod:615
22762 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
22763 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
22764 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
22765 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
22766 "L<virt-sparsify(1)>, L<http://libguestfs.org/>."
22770 #: ../ruby/examples/guestfs-ruby.pod:5
22771 msgid "guestfs-ruby - How to use libguestfs from Ruby"
22775 #: ../ruby/examples/guestfs-ruby.pod:9
22778 " require 'guestfs'\n"
22779 " g = Guestfs::Guestfs.new()\n"
22780 " g.add_drive_opts(\"disk.img\",\n"
22781 " :readonly => 1, :format => \"raw\")\n"
22787 #: ../ruby/examples/guestfs-ruby.pod:17
22789 "This manual page documents how to call libguestfs from the Ruby programming "
22790 "language. This page just documents the differences from the C API and gives "
22791 "some examples. If you are not familiar with using libguestfs, you also need "
22792 "to read L<guestfs(3)>."
22796 #: ../ruby/examples/guestfs-ruby.pod:24
22798 "Errors from libguestfs functions are mapped into the C<Error> exception. "
22799 "This has a single parameter which is the error message (a string)."
22803 #: ../ruby/examples/guestfs-ruby.pod:38
22805 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
22806 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
22807 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
22811 #: ../sparsify/virt-sparsify.pod:5
22812 msgid "virt-sparsify - Make a virtual machine disk sparse"
22816 #: ../sparsify/virt-sparsify.pod:9
22819 " virt-sparsify [--options] indisk outdisk\n"
22824 #: ../sparsify/virt-sparsify.pod:13
22826 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
22827 "image) sparse a.k.a. thin-provisioned. This means that free space within "
22828 "the disk image can be converted back to free space on the host."
22832 #: ../sparsify/virt-sparsify.pod:18
22834 "Virt-sparsify can locate and sparsify free space in most filesystems "
22835 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
22839 #: ../sparsify/virt-sparsify.pod:21
22841 "Virt-sparsify can also convert between some disk formats, for example "
22842 "converting a raw disk image to a thin-provisioned qcow2 image."
22846 #: ../sparsify/virt-sparsify.pod:24
22848 "Virt-sparsify can operate on any disk image, not just ones from virtual "
22849 "machines. If a virtual machine has more than one attached disk, you must "
22850 "sparsify each one separately."
22854 #: ../sparsify/virt-sparsify.pod:28
22855 msgid "IMPORTANT LIMITATIONS"
22859 #: ../sparsify/virt-sparsify.pod:34
22861 "Virt-sparsify does not do in-place modifications. It copies from a source "
22862 "image to a destination image, leaving the source unchanged. I<Check that "
22863 "the sparsification was successful before deleting the source image>."
22867 #: ../sparsify/virt-sparsify.pod:41
22868 msgid "The virtual machine I<must be shut down> before using this tool."
22872 #: ../sparsify/virt-sparsify.pod:45
22874 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
22875 "(1 temporary copy + 1 destination image). This is in the worst case and "
22876 "usually much less space is required."
22880 #: ../sparsify/virt-sparsify.pod:51
22881 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
22885 #: ../sparsify/virt-sparsify.pod:56
22886 msgid "Virt-sparsify cannot handle encrypted disks."
22890 #: ../sparsify/virt-sparsify.pod:60
22892 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
22893 "this space is often used for critical items like bootloaders so it's not "
22898 #: ../sparsify/virt-sparsify.pod:66
22900 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
22901 "to do this unless we can be sure there is no hibernation data, so at the "
22902 "moment swap partitions are ignored."
22906 #: ../sparsify/virt-sparsify.pod:72
22908 "You may also want to read the manual pages for the associated tools "
22909 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
22913 #: ../sparsify/virt-sparsify.pod:77
22914 msgid "Typical usage is:"
22918 #: ../sparsify/virt-sparsify.pod:79
22921 " virt-sparsify indisk outdisk\n"
22926 #: ../sparsify/virt-sparsify.pod:81
22928 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
22929 "is created, or overwritten if it already exists. The format of the input "
22930 "disk is detected (eg. qcow2) and the same format is used for the output "
22935 #: ../sparsify/virt-sparsify.pod:86
22936 msgid "To convert between formats, use the I<--convert> option:"
22940 #: ../sparsify/virt-sparsify.pod:88
22943 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
22948 #: ../sparsify/virt-sparsify.pod:90
22950 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
22951 "can find within the source disk image. You can get it to ignore (don't zero "
22952 "free space on) certain filesystems by doing:"
22956 #: ../sparsify/virt-sparsify.pod:94
22959 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
22964 #: ../sparsify/virt-sparsify.pod:96
22965 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
22969 #: ../sparsify/virt-sparsify.pod:107
22970 msgid "B<--convert> raw"
22974 #: ../sparsify/virt-sparsify.pod:109
22975 msgid "B<--convert> qcow2"
22979 #: ../sparsify/virt-sparsify.pod:111
22980 msgid "B<--convert> [other formats]"
22984 #: ../sparsify/virt-sparsify.pod:113
22986 "Use C<output-format> as the format for the destination image. If this is "
22987 "not specified, then the input format is used."
22991 #: ../sparsify/virt-sparsify.pod:116
22992 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
22996 #: ../sparsify/virt-sparsify.pod:118
22998 "You can also use any format supported by the L<qemu-img(1)> program, "
22999 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23003 #: ../sparsify/virt-sparsify.pod:122
23005 "Specifying the I<--convert> option is usually a good idea, because then "
23006 "virt-sparsify doesn't need to try to guess the input format."
23010 #: ../sparsify/virt-sparsify.pod:127
23011 msgid "B<--format> qcow2"
23015 #: ../sparsify/virt-sparsify.pod:135
23016 msgid "B<--ignore> filesystem"
23020 #: ../sparsify/virt-sparsify.pod:137
23021 msgid "B<--ignore> volgroup"
23025 #: ../sparsify/virt-sparsify.pod:139
23027 "Ignore the named filesystem. Free space on the filesystem will not be "
23028 "zeroed, but existing blocks of zeroes will still be sparsified."
23032 #: ../sparsify/virt-sparsify.pod:142
23034 "In the second form, this ignores the named volume group. Use the volume "
23035 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23039 #: ../sparsify/virt-sparsify.pod:157
23040 msgid "This disables progress bars and other unnecessary output."
23044 #: ../sparsify/virt-sparsify.pod:179
23046 "The I<--machine-readable> option can be used to make the output more machine "
23047 "friendly, which is useful when calling virt-sparsify from other programs, "
23052 #: ../sparsify/virt-sparsify.pod:185
23054 "Firstly use the option on its own to query the capabilities of the "
23055 "virt-sparsify binary. Typical output looks like this:"
23059 #: ../sparsify/virt-sparsify.pod:188
23062 " $ virt-sparsify --machine-readable\n"
23070 #: ../sparsify/virt-sparsify.pod:218
23072 "The calling program should treat messages sent to stderr as error messages. "
23073 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23078 #: ../sparsify/virt-sparsify.pod:224
23080 "All versions of virt-sparsify have supported the I<--machine-readable> "
23085 #: ../sparsify/virt-sparsify.pod:238
23087 "Location of the temporary directory used for the potentially large temporary "
23092 #: ../sparsify/virt-sparsify.pod:241
23094 "You should ensure there is enough free space in the worst case for a full "
23095 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23096 "to another directory that has enough space."
23100 #: ../sparsify/virt-sparsify.pod:245
23101 msgid "This defaults to C</tmp>."
23105 #: ../sparsify/virt-sparsify.pod:249
23106 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23110 #: ../sparsify/virt-sparsify.pod:253
23112 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23113 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23114 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23118 #: ../src/guestfs-actions.pod:1
23119 msgid "guestfs_add_cdrom"
23123 #: ../src/guestfs-actions.pod:3
23127 " guestfs_add_cdrom (guestfs_h *g,\n"
23128 " const char *filename);\n"
23133 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
23135 "I<This function is deprecated.> In new code, use the "
23136 "L</guestfs_add_drive_opts> call instead."
23140 #: ../src/guestfs-actions.pod:24
23142 "This call checks for the existence of C<filename>. This stops you from "
23143 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23144 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23149 #: ../src/guestfs-actions.pod:31
23151 "If you just want to add an ISO file (often you use this as an efficient way "
23152 "to transfer large files into the guest), then you should probably use "
23153 "C<guestfs_add_drive_ro> instead."
23157 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:201 ../src/guestfs-actions.pod:238 ../src/guestfs-actions.pod:259 ../src/guestfs-actions.pod:280 ../src/guestfs-actions.pod:293 ../src/guestfs-actions.pod:307 ../src/guestfs-actions.pod:427 ../src/guestfs-actions.pod:447 ../src/guestfs-actions.pod:461 ../src/guestfs-actions.pod:506 ../src/guestfs-actions.pod:534 ../src/guestfs-actions.pod:552 ../src/guestfs-actions.pod:619 ../src/guestfs-actions.pod:652 ../src/guestfs-actions.pod:666 ../src/guestfs-actions.pod:681 ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:812 ../src/guestfs-actions.pod:826 ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:1046 ../src/guestfs-actions.pod:1066 ../src/guestfs-actions.pod:1084 ../src/guestfs-actions.pod:1174 ../src/guestfs-actions.pod:1233 ../src/guestfs-actions.pod:1279 ../src/guestfs-actions.pod:1297 ../src/guestfs-actions.pod:1316 ../src/guestfs-actions.pod:1330 ../src/guestfs-actions.pod:1350 ../src/guestfs-actions.pod:1420 ../src/guestfs-actions.pod:1451 ../src/guestfs-actions.pod:1476 ../src/guestfs-actions.pod:1518 ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1658 ../src/guestfs-actions.pod:1873 ../src/guestfs-actions.pod:1895 ../src/guestfs-actions.pod:1982 ../src/guestfs-actions.pod:2490 ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:2730 ../src/guestfs-actions.pod:3774 ../src/guestfs-actions.pod:3789 ../src/guestfs-actions.pod:3814 ../src/guestfs-actions.pod:4003 ../src/guestfs-actions.pod:4017 ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4044 ../src/guestfs-actions.pod:4059 ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4167 ../src/guestfs-actions.pod:4187 ../src/guestfs-actions.pod:4204 ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:4250 ../src/guestfs-actions.pod:4285 ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:4370 ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4422 ../src/guestfs-actions.pod:4435 ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:4467 ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:4580 ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:4662 ../src/guestfs-actions.pod:4680 ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:4710 ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4741 ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4783 ../src/guestfs-actions.pod:4846 ../src/guestfs-actions.pod:4919 ../src/guestfs-actions.pod:4950 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5000 ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5030 ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5060 ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:5118 ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5177 ../src/guestfs-actions.pod:5191 ../src/guestfs-actions.pod:5208 ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5310 ../src/guestfs-actions.pod:5357 ../src/guestfs-actions.pod:5400 ../src/guestfs-actions.pod:5428 ../src/guestfs-actions.pod:5445 ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5603 ../src/guestfs-actions.pod:5660 ../src/guestfs-actions.pod:5682 ../src/guestfs-actions.pod:5700 ../src/guestfs-actions.pod:5732 ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5815 ../src/guestfs-actions.pod:5828 ../src/guestfs-actions.pod:5842 ../src/guestfs-actions.pod:6131 ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6183 ../src/guestfs-actions.pod:6195 ../src/guestfs-actions.pod:6209 ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6235 ../src/guestfs-actions.pod:6251 ../src/guestfs-actions.pod:6272 ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6340 ../src/guestfs-actions.pod:6358 ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6399 ../src/guestfs-actions.pod:6418 ../src/guestfs-actions.pod:6439 ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6475 ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6522 ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6581 ../src/guestfs-actions.pod:6605 ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6639 ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6702 ../src/guestfs-actions.pod:6732 ../src/guestfs-actions.pod:6765 ../src/guestfs-actions.pod:6880 ../src/guestfs-actions.pod:7001 ../src/guestfs-actions.pod:7013 ../src/guestfs-actions.pod:7026 ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7061 ../src/guestfs-actions.pod:7074 ../src/guestfs-actions.pod:7087 ../src/guestfs-actions.pod:7100 ../src/guestfs-actions.pod:7115 ../src/guestfs-actions.pod:7174 ../src/guestfs-actions.pod:7191 ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7223 ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7253 ../src/guestfs-actions.pod:7273 ../src/guestfs-actions.pod:7309 ../src/guestfs-actions.pod:7323 ../src/guestfs-actions.pod:7364 ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7395 ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7465 ../src/guestfs-actions.pod:7581 ../src/guestfs-actions.pod:7596 ../src/guestfs-actions.pod:7610 ../src/guestfs-actions.pod:7665 ../src/guestfs-actions.pod:7678 ../src/guestfs-actions.pod:7723 ../src/guestfs-actions.pod:7763 ../src/guestfs-actions.pod:7819 ../src/guestfs-actions.pod:7839 ../src/guestfs-actions.pod:7872 ../src/guestfs-actions.pod:7936 ../src/guestfs-actions.pod:7959 ../src/guestfs-actions.pod:7988
23158 msgid "This function returns 0 on success or -1 on error."
23162 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:2096 ../src/guestfs-actions.pod:2194 ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:3796 ../src/guestfs-actions.pod:5094 ../src/guestfs-actions.pod:6360 ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6626 ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7242 ../src/guestfs-actions.pod:7765
23163 msgid "(Added in 0.3)"
23167 #: ../src/guestfs-actions.pod:41
23168 msgid "guestfs_add_domain"
23172 #: ../src/guestfs-actions.pod:43
23176 " guestfs_add_domain (guestfs_h *g,\n"
23177 " const char *dom,\n"
23183 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:1161 ../src/guestfs-actions.pod:1213 ../src/guestfs-actions.pod:2979 ../src/guestfs-actions.pod:4795 ../src/guestfs-actions.pod:5104 ../src/guestfs-actions.pod:5321
23185 "You may supply a list of optional arguments to this call. Use zero or more "
23186 "of the following pairs of parameters, and terminate the list with C<-1> on "
23187 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23191 #: ../src/guestfs-actions.pod:53
23194 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23195 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23196 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23197 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23198 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23203 #: ../src/guestfs-actions.pod:59
23205 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23206 "It works by connecting to libvirt, requesting the domain and domain XML from "
23207 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23212 #: ../src/guestfs-actions.pod:94
23214 "The other optional parameters are passed directly through to "
23215 "C<guestfs_add_drive_opts>."
23219 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:350 ../src/guestfs-actions.pod:520 ../src/guestfs-actions.pod:698 ../src/guestfs-actions.pod:729 ../src/guestfs-actions.pod:747 ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1496 ../src/guestfs-actions.pod:1852 ../src/guestfs-actions.pod:2055 ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2217 ../src/guestfs-actions.pod:2269 ../src/guestfs-actions.pod:2283 ../src/guestfs-actions.pod:2306 ../src/guestfs-actions.pod:2621 ../src/guestfs-actions.pod:3097 ../src/guestfs-actions.pod:3115 ../src/guestfs-actions.pod:5280 ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:5938 ../src/guestfs-actions.pod:7350 ../src/guestfs-actions.pod:7776 ../src/guestfs-actions.pod:7789 ../src/guestfs-actions.pod:7802
23220 msgid "On error this function returns -1."
23224 #: ../src/guestfs-actions.pod:99
23225 msgid "(Added in 1.7.4)"
23229 #: ../src/guestfs-actions.pod:101
23230 msgid "guestfs_add_domain_va"
23234 #: ../src/guestfs-actions.pod:103
23238 " guestfs_add_domain_va (guestfs_h *g,\n"
23239 " const char *dom,\n"
23240 " va_list args);\n"
23245 #: ../src/guestfs-actions.pod:108
23246 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23250 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:214 ../src/guestfs-actions.pod:225 ../src/guestfs-actions.pod:876 ../src/guestfs-actions.pod:887 ../src/guestfs-actions.pod:1189 ../src/guestfs-actions.pod:1202 ../src/guestfs-actions.pod:1248 ../src/guestfs-actions.pod:1261 ../src/guestfs-actions.pod:3063 ../src/guestfs-actions.pod:3075 ../src/guestfs-actions.pod:4860 ../src/guestfs-actions.pod:4872 ../src/guestfs-actions.pod:5132 ../src/guestfs-actions.pod:5144 ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5381
23251 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23255 #: ../src/guestfs-actions.pod:112
23256 msgid "guestfs_add_domain_argv"
23260 #: ../src/guestfs-actions.pod:114
23264 " guestfs_add_domain_argv (guestfs_h *g,\n"
23265 " const char *dom,\n"
23266 " const struct guestfs_add_domain_argv *optargs);\n"
23271 #: ../src/guestfs-actions.pod:119
23272 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23276 #: ../src/guestfs-actions.pod:123
23277 msgid "guestfs_add_drive"
23281 #: ../src/guestfs-actions.pod:125
23285 " guestfs_add_drive (guestfs_h *g,\n"
23286 " const char *filename);\n"
23291 #: ../src/guestfs-actions.pod:129
23293 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
23294 "optional parameters, so the disk is added writable, with the format being "
23295 "detected automatically."
23299 #: ../src/guestfs-actions.pod:133
23301 "Automatic detection of the format opens you up to a potential security hole "
23302 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23303 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23304 "you should think about replacing calls to this function with calls to "
23305 "C<guestfs_add_drive_opts>, and specifying the format."
23309 #: ../src/guestfs-actions.pod:144
23310 msgid "guestfs_add_drive_opts"
23314 #: ../src/guestfs-actions.pod:146
23318 " guestfs_add_drive_opts (guestfs_h *g,\n"
23319 " const char *filename,\n"
23325 #: ../src/guestfs-actions.pod:156
23328 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
23329 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
23330 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
23335 #: ../src/guestfs-actions.pod:185
23337 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
23338 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
23339 "Possible formats include C<raw> and C<qcow2>."
23343 #: ../src/guestfs-actions.pod:196
23345 "This rarely-used option lets you emulate the behaviour of the deprecated "
23346 "C<guestfs_add_drive_with_if> call (q.v.)"
23350 #: ../src/guestfs-actions.pod:203
23351 msgid "(Added in 1.5.23)"
23355 #: ../src/guestfs-actions.pod:205
23356 msgid "guestfs_add_drive_opts_va"
23360 #: ../src/guestfs-actions.pod:207
23364 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
23365 " const char *filename,\n"
23366 " va_list args);\n"
23371 #: ../src/guestfs-actions.pod:212
23372 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
23376 #: ../src/guestfs-actions.pod:216
23377 msgid "guestfs_add_drive_opts_argv"
23381 #: ../src/guestfs-actions.pod:218
23385 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
23386 " const char *filename,\n"
23387 " const struct guestfs_add_drive_opts_argv "
23393 #: ../src/guestfs-actions.pod:223
23394 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
23398 #: ../src/guestfs-actions.pod:227
23399 msgid "guestfs_add_drive_ro"
23403 #: ../src/guestfs-actions.pod:229
23407 " guestfs_add_drive_ro (guestfs_h *g,\n"
23408 " const char *filename);\n"
23413 #: ../src/guestfs-actions.pod:233
23415 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
23416 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
23417 "disk is added read-only, with the format being detected automatically."
23421 #: ../src/guestfs-actions.pod:240
23422 msgid "(Added in 1.0.38)"
23426 #: ../src/guestfs-actions.pod:242
23427 msgid "guestfs_add_drive_ro_with_if"
23431 #: ../src/guestfs-actions.pod:244
23435 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
23436 " const char *filename,\n"
23437 " const char *iface);\n"
23442 #: ../src/guestfs-actions.pod:256
23444 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
23445 "QEMU interface emulation to use at run time."
23449 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2580
23450 msgid "(Added in 1.0.84)"
23454 #: ../src/guestfs-actions.pod:263
23455 msgid "guestfs_add_drive_with_if"
23459 #: ../src/guestfs-actions.pod:265
23463 " guestfs_add_drive_with_if (guestfs_h *g,\n"
23464 " const char *filename,\n"
23465 " const char *iface);\n"
23470 #: ../src/guestfs-actions.pod:277
23472 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
23473 "QEMU interface emulation to use at run time."
23477 #: ../src/guestfs-actions.pod:284
23478 msgid "guestfs_aug_clear"
23482 #: ../src/guestfs-actions.pod:286
23486 " guestfs_aug_clear (guestfs_h *g,\n"
23487 " const char *augpath);\n"
23492 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2308
23493 msgid "(Added in 1.3.4)"
23497 #: ../src/guestfs-actions.pod:297
23498 msgid "guestfs_aug_close"
23502 #: ../src/guestfs-actions.pod:299
23506 " guestfs_aug_close (guestfs_h *g);\n"
23511 #: ../src/guestfs-actions.pod:302
23513 "Close the current Augeas handle and free up any resources used by it. After "
23514 "calling this, you have to call C<guestfs_aug_init> again before you can use "
23515 "any other Augeas functions."
23519 #: ../src/guestfs-actions.pod:309 ../src/guestfs-actions.pod:334 ../src/guestfs-actions.pod:352 ../src/guestfs-actions.pod:366 ../src/guestfs-actions.pod:429 ../src/guestfs-actions.pod:449 ../src/guestfs-actions.pod:463 ../src/guestfs-actions.pod:494 ../src/guestfs-actions.pod:508 ../src/guestfs-actions.pod:522 ../src/guestfs-actions.pod:536 ../src/guestfs-actions.pod:554 ../src/guestfs-actions.pod:5989
23520 msgid "(Added in 0.7)"
23524 #: ../src/guestfs-actions.pod:311
23525 msgid "guestfs_aug_defnode"
23529 #: ../src/guestfs-actions.pod:313
23532 " struct guestfs_int_bool *\n"
23533 " guestfs_aug_defnode (guestfs_h *g,\n"
23534 " const char *name,\n"
23535 " const char *expr,\n"
23536 " const char *val);\n"
23541 #: ../src/guestfs-actions.pod:322
23543 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23544 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
23545 "containing that single node."
23549 #: ../src/guestfs-actions.pod:330
23551 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
23552 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
23556 #: ../src/guestfs-actions.pod:336
23557 msgid "guestfs_aug_defvar"
23561 #: ../src/guestfs-actions.pod:338
23565 " guestfs_aug_defvar (guestfs_h *g,\n"
23566 " const char *name,\n"
23567 " const char *expr);\n"
23572 #: ../src/guestfs-actions.pod:354
23573 msgid "guestfs_aug_get"
23577 #: ../src/guestfs-actions.pod:356
23581 " guestfs_aug_get (guestfs_h *g,\n"
23582 " const char *augpath);\n"
23587 #: ../src/guestfs-actions.pod:363 ../src/guestfs-actions.pod:927 ../src/guestfs-actions.pod:945 ../src/guestfs-actions.pod:1005 ../src/guestfs-actions.pod:1021 ../src/guestfs-actions.pod:1124 ../src/guestfs-actions.pod:1365 ../src/guestfs-actions.pod:1382 ../src/guestfs-actions.pod:1401 ../src/guestfs-actions.pod:1535 ../src/guestfs-actions.pod:1723 ../src/guestfs-actions.pod:1835 ../src/guestfs-actions.pod:1998 ../src/guestfs-actions.pod:2015 ../src/guestfs-actions.pod:2082 ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:2146 ../src/guestfs-actions.pod:2331 ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:2749 ../src/guestfs-actions.pod:2843 ../src/guestfs-actions.pod:2947 ../src/guestfs-actions.pod:2966 ../src/guestfs-actions.pod:3180 ../src/guestfs-actions.pod:3208 ../src/guestfs-actions.pod:3229 ../src/guestfs-actions.pod:3263 ../src/guestfs-actions.pod:3322 ../src/guestfs-actions.pod:3342 ../src/guestfs-actions.pod:3362 ../src/guestfs-actions.pod:3989 ../src/guestfs-actions.pod:4342 ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4622 ../src/guestfs-actions.pod:5518 ../src/guestfs-actions.pod:5717 ../src/guestfs-actions.pod:5887 ../src/guestfs-actions.pod:6065 ../src/guestfs-actions.pod:6114 ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6826 ../src/guestfs-actions.pod:6850 ../src/guestfs-actions.pod:7524 ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7561 ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:8052
23589 "This function returns a string, or NULL on error. I<The caller must free "
23590 "the returned string after use>."
23594 #: ../src/guestfs-actions.pod:368
23595 msgid "guestfs_aug_init"
23599 #: ../src/guestfs-actions.pod:370
23603 " guestfs_aug_init (guestfs_h *g,\n"
23604 " const char *root,\n"
23610 #: ../src/guestfs-actions.pod:379
23611 msgid "You must call this before using any other C<guestfs_aug_*> commands."
23615 #: ../src/guestfs-actions.pod:404
23617 "This option is only useful when debugging Augeas lenses. Use of this option "
23618 "may require additional memory for the libguestfs appliance. You may need to "
23619 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
23620 "C<guestfs_set_memsize>."
23624 #: ../src/guestfs-actions.pod:419
23625 msgid "Do not load the tree in C<guestfs_aug_init>."
23629 #: ../src/guestfs-actions.pod:423
23630 msgid "To close the handle, you can call C<guestfs_aug_close>."
23634 #: ../src/guestfs-actions.pod:431
23635 msgid "guestfs_aug_insert"
23639 #: ../src/guestfs-actions.pod:433
23643 " guestfs_aug_insert (guestfs_h *g,\n"
23644 " const char *augpath,\n"
23645 " const char *label,\n"
23651 #: ../src/guestfs-actions.pod:451
23652 msgid "guestfs_aug_load"
23656 #: ../src/guestfs-actions.pod:453
23660 " guestfs_aug_load (guestfs_h *g);\n"
23665 #: ../src/guestfs-actions.pod:465
23666 msgid "guestfs_aug_ls"
23670 #: ../src/guestfs-actions.pod:467
23674 " guestfs_aug_ls (guestfs_h *g,\n"
23675 " const char *augpath);\n"
23680 #: ../src/guestfs-actions.pod:471
23682 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
23683 "sorting the resulting nodes into alphabetical order."
23687 #: ../src/guestfs-actions.pod:474 ../src/guestfs-actions.pod:490 ../src/guestfs-actions.pod:636 ../src/guestfs-actions.pod:1143 ../src/guestfs-actions.pod:1550 ../src/guestfs-actions.pod:1569 ../src/guestfs-actions.pod:1672 ../src/guestfs-actions.pod:1691 ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:2403 ../src/guestfs-actions.pod:2419 ../src/guestfs-actions.pod:2438 ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2527 ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2647 ../src/guestfs-actions.pod:2908 ../src/guestfs-actions.pod:3282 ../src/guestfs-actions.pod:3558 ../src/guestfs-actions.pod:3872 ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3909 ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4484 ../src/guestfs-actions.pod:5241 ../src/guestfs-actions.pod:5859 ../src/guestfs-actions.pod:5985 ../src/guestfs-actions.pod:6099 ../src/guestfs-actions.pod:6866 ../src/guestfs-actions.pod:6927 ../src/guestfs-actions.pod:6982 ../src/guestfs-actions.pod:7128 ../src/guestfs-actions.pod:7152 ../src/guestfs-actions.pod:7628 ../src/guestfs-actions.pod:7648 ../src/guestfs-actions.pod:7695 ../src/guestfs-actions.pod:7889 ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:8002 ../src/guestfs-actions.pod:8021 ../src/guestfs-actions.pod:8067 ../src/guestfs-actions.pod:8086
23689 "This function returns a NULL-terminated array of strings (like "
23690 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
23691 "strings and the array after use>."
23695 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3667 ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4375 ../src/guestfs-actions.pod:4562 ../src/guestfs-actions.pod:4595 ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:5245 ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:6197 ../src/guestfs-actions.pod:6211 ../src/guestfs-actions.pod:6223 ../src/guestfs-actions.pod:6707 ../src/guestfs-actions.pod:7366 ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:7612 ../src/guestfs-actions.pod:7877
23696 msgid "(Added in 0.8)"
23700 #: ../src/guestfs-actions.pod:480
23701 msgid "guestfs_aug_match"
23705 #: ../src/guestfs-actions.pod:482
23709 " guestfs_aug_match (guestfs_h *g,\n"
23710 " const char *augpath);\n"
23715 #: ../src/guestfs-actions.pod:496
23716 msgid "guestfs_aug_mv"
23720 #: ../src/guestfs-actions.pod:498
23724 " guestfs_aug_mv (guestfs_h *g,\n"
23725 " const char *src,\n"
23726 " const char *dest);\n"
23731 #: ../src/guestfs-actions.pod:510
23732 msgid "guestfs_aug_rm"
23736 #: ../src/guestfs-actions.pod:512
23740 " guestfs_aug_rm (guestfs_h *g,\n"
23741 " const char *augpath);\n"
23746 #: ../src/guestfs-actions.pod:524
23747 msgid "guestfs_aug_save"
23751 #: ../src/guestfs-actions.pod:526
23755 " guestfs_aug_save (guestfs_h *g);\n"
23760 #: ../src/guestfs-actions.pod:531
23762 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
23767 #: ../src/guestfs-actions.pod:538
23768 msgid "guestfs_aug_set"
23772 #: ../src/guestfs-actions.pod:540
23776 " guestfs_aug_set (guestfs_h *g,\n"
23777 " const char *augpath,\n"
23778 " const char *val);\n"
23783 #: ../src/guestfs-actions.pod:547
23785 "In the Augeas API, it is possible to clear a node by setting the value to "
23786 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
23787 "this call. Instead you must use the C<guestfs_aug_clear> call."
23791 #: ../src/guestfs-actions.pod:556
23792 msgid "guestfs_available"
23796 #: ../src/guestfs-actions.pod:558
23800 " guestfs_available (guestfs_h *g,\n"
23801 " char *const *groups);\n"
23806 #: ../src/guestfs-actions.pod:566
23808 "The libguestfs groups, and the functions that those groups correspond to, "
23809 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
23810 "runtime by calling C<guestfs_available_all_groups>."
23814 #: ../src/guestfs-actions.pod:590
23815 msgid "You must call C<guestfs_launch> before calling this function."
23819 #: ../src/guestfs-actions.pod:612
23821 "This call was added in version C<1.0.80>. In previous versions of "
23822 "libguestfs all you could do would be to speculatively execute a command to "
23823 "find out if the daemon implemented it. See also C<guestfs_version>."
23827 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1352
23828 msgid "(Added in 1.0.80)"
23832 #: ../src/guestfs-actions.pod:623
23833 msgid "guestfs_available_all_groups"
23837 #: ../src/guestfs-actions.pod:625
23841 " guestfs_available_all_groups (guestfs_h *g);\n"
23846 #: ../src/guestfs-actions.pod:628
23848 "This command returns a list of all optional groups that this daemon knows "
23849 "about. Note this returns both supported and unsupported groups. To find "
23850 "out which ones the daemon can actually support you have to call "
23851 "C<guestfs_available> on each member of the returned list."
23855 #: ../src/guestfs-actions.pod:634
23856 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
23860 #: ../src/guestfs-actions.pod:640
23861 msgid "(Added in 1.3.15)"
23865 #: ../src/guestfs-actions.pod:642
23866 msgid "guestfs_base64_in"
23870 #: ../src/guestfs-actions.pod:644
23874 " guestfs_base64_in (guestfs_h *g,\n"
23875 " const char *base64file,\n"
23876 " const char *filename);\n"
23881 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
23882 msgid "(Added in 1.3.5)"
23886 #: ../src/guestfs-actions.pod:656
23887 msgid "guestfs_base64_out"
23891 #: ../src/guestfs-actions.pod:658
23895 " guestfs_base64_out (guestfs_h *g,\n"
23896 " const char *filename,\n"
23897 " const char *base64file);\n"
23902 #: ../src/guestfs-actions.pod:670
23903 msgid "guestfs_blockdev_flushbufs"
23907 #: ../src/guestfs-actions.pod:672
23911 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
23912 " const char *device);\n"
23917 #: ../src/guestfs-actions.pod:683 ../src/guestfs-actions.pod:700 ../src/guestfs-actions.pod:715 ../src/guestfs-actions.pod:731 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:768 ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800 ../src/guestfs-actions.pod:814 ../src/guestfs-actions.pod:828
23918 msgid "(Added in 0.9.3)"
23922 #: ../src/guestfs-actions.pod:685
23923 msgid "guestfs_blockdev_getbsz"
23927 #: ../src/guestfs-actions.pod:687
23931 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
23932 " const char *device);\n"
23937 #: ../src/guestfs-actions.pod:702
23938 msgid "guestfs_blockdev_getro"
23942 #: ../src/guestfs-actions.pod:704
23946 " guestfs_blockdev_getro (guestfs_h *g,\n"
23947 " const char *device);\n"
23952 #: ../src/guestfs-actions.pod:713 ../src/guestfs-actions.pod:1590 ../src/guestfs-actions.pod:1605 ../src/guestfs-actions.pod:2094 ../src/guestfs-actions.pod:2105 ../src/guestfs-actions.pod:2177 ../src/guestfs-actions.pod:2203 ../src/guestfs-actions.pod:2243 ../src/guestfs-actions.pod:2258 ../src/guestfs-actions.pod:2294 ../src/guestfs-actions.pod:2317 ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:3413 ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3589 ../src/guestfs-actions.pod:3604 ../src/guestfs-actions.pod:3618 ../src/guestfs-actions.pod:3634 ../src/guestfs-actions.pod:3649 ../src/guestfs-actions.pod:3665 ../src/guestfs-actions.pod:3679 ../src/guestfs-actions.pod:3692 ../src/guestfs-actions.pod:3706 ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3749 ../src/guestfs-actions.pod:3763 ../src/guestfs-actions.pod:5482
23953 msgid "This function returns a C truth value on success or -1 on error."
23957 #: ../src/guestfs-actions.pod:717
23958 msgid "guestfs_blockdev_getsize64"
23962 #: ../src/guestfs-actions.pod:719
23966 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
23967 " const char *device);\n"
23972 #: ../src/guestfs-actions.pod:725
23973 msgid "See also C<guestfs_blockdev_getsz>."
23977 #: ../src/guestfs-actions.pod:733
23978 msgid "guestfs_blockdev_getss"
23982 #: ../src/guestfs-actions.pod:735
23986 " guestfs_blockdev_getss (guestfs_h *g,\n"
23987 " const char *device);\n"
23992 #: ../src/guestfs-actions.pod:742
23994 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
23999 #: ../src/guestfs-actions.pod:751
24000 msgid "guestfs_blockdev_getsz"
24004 #: ../src/guestfs-actions.pod:753
24008 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24009 " const char *device);\n"
24014 #: ../src/guestfs-actions.pod:760
24016 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24017 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24021 #: ../src/guestfs-actions.pod:770
24022 msgid "guestfs_blockdev_rereadpt"
24026 #: ../src/guestfs-actions.pod:772
24030 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24031 " const char *device);\n"
24036 #: ../src/guestfs-actions.pod:784
24037 msgid "guestfs_blockdev_setbsz"
24041 #: ../src/guestfs-actions.pod:786
24045 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24046 " const char *device,\n"
24047 " int blocksize);\n"
24052 #: ../src/guestfs-actions.pod:802
24053 msgid "guestfs_blockdev_setro"
24057 #: ../src/guestfs-actions.pod:804
24061 " guestfs_blockdev_setro (guestfs_h *g,\n"
24062 " const char *device);\n"
24067 #: ../src/guestfs-actions.pod:816
24068 msgid "guestfs_blockdev_setrw"
24072 #: ../src/guestfs-actions.pod:818
24076 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24077 " const char *device);\n"
24082 #: ../src/guestfs-actions.pod:830
24083 msgid "guestfs_btrfs_filesystem_resize"
24087 #: ../src/guestfs-actions.pod:832
24091 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24092 " const char *mountpoint,\n"
24098 #: ../src/guestfs-actions.pod:842
24101 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24106 #: ../src/guestfs-actions.pod:865
24107 msgid "(Added in 1.11.17)"
24111 #: ../src/guestfs-actions.pod:867
24112 msgid "guestfs_btrfs_filesystem_resize_va"
24116 #: ../src/guestfs-actions.pod:869
24120 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24121 " const char *mountpoint,\n"
24122 " va_list args);\n"
24127 #: ../src/guestfs-actions.pod:874
24128 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24132 #: ../src/guestfs-actions.pod:878
24133 msgid "guestfs_btrfs_filesystem_resize_argv"
24137 #: ../src/guestfs-actions.pod:880
24141 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24142 " const char *mountpoint,\n"
24144 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24149 #: ../src/guestfs-actions.pod:885
24150 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24154 #: ../src/guestfs-actions.pod:889
24155 msgid "guestfs_case_sensitive_path"
24159 #: ../src/guestfs-actions.pod:891
24163 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24164 " const char *path);\n"
24169 #: ../src/guestfs-actions.pod:917
24171 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24172 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24173 "how the directories were originally created under Windows)."
24177 #: ../src/guestfs-actions.pod:925
24178 msgid "See also C<guestfs_realpath>."
24182 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7546
24183 msgid "(Added in 1.0.75)"
24187 #: ../src/guestfs-actions.pod:932
24188 msgid "guestfs_cat"
24192 #: ../src/guestfs-actions.pod:934
24196 " guestfs_cat (guestfs_h *g,\n"
24197 " const char *path);\n"
24202 #: ../src/guestfs-actions.pod:940
24204 "Note that this function cannot correctly handle binary files (specifically, "
24205 "files containing C<\\0> character which is treated as end of string). For "
24206 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24207 "functions which have a more complex interface."
24211 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3975 ../src/guestfs-actions.pod:3992 ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4488 ../src/guestfs-actions.pod:4502 ../src/guestfs-actions.pod:5863 ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:7699 ../src/guestfs-actions.pod:7713
24212 msgid "(Added in 0.4)"
24216 #: ../src/guestfs-actions.pod:953
24217 msgid "guestfs_checksum"
24221 #: ../src/guestfs-actions.pod:955
24225 " guestfs_checksum (guestfs_h *g,\n"
24226 " const char *csumtype,\n"
24227 " const char *path);\n"
24232 #: ../src/guestfs-actions.pod:1001
24233 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24237 #: ../src/guestfs-actions.pod:1003
24238 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24242 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:3591 ../src/guestfs-actions.pod:3620 ../src/guestfs-actions.pod:3681 ../src/guestfs-actions.pod:3708 ../src/guestfs-actions.pod:7402
24243 msgid "(Added in 1.0.2)"
24247 #: ../src/guestfs-actions.pod:1010
24248 msgid "guestfs_checksum_device"
24252 #: ../src/guestfs-actions.pod:1012
24256 " guestfs_checksum_device (guestfs_h *g,\n"
24257 " const char *csumtype,\n"
24258 " const char *device);\n"
24263 #: ../src/guestfs-actions.pod:1017
24265 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24266 "device named C<device>. For the types of checksums supported see the "
24267 "C<guestfs_checksum> command."
24271 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5502 ../src/guestfs-actions.pod:5684 ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7325 ../src/guestfs-actions.pod:7725
24272 msgid "(Added in 1.3.2)"
24276 #: ../src/guestfs-actions.pod:1026
24277 msgid "guestfs_checksums_out"
24281 #: ../src/guestfs-actions.pod:1028
24285 " guestfs_checksums_out (guestfs_h *g,\n"
24286 " const char *csumtype,\n"
24287 " const char *directory,\n"
24288 " const char *sumsfile);\n"
24293 #: ../src/guestfs-actions.pod:1048
24294 msgid "(Added in 1.3.7)"
24298 #: ../src/guestfs-actions.pod:1050
24299 msgid "guestfs_chmod"
24303 #: ../src/guestfs-actions.pod:1052
24307 " guestfs_chmod (guestfs_h *g,\n"
24309 " const char *path);\n"
24314 #: ../src/guestfs-actions.pod:1070
24315 msgid "guestfs_chown"
24319 #: ../src/guestfs-actions.pod:1072
24323 " guestfs_chown (guestfs_h *g,\n"
24326 " const char *path);\n"
24331 #: ../src/guestfs-actions.pod:1088
24332 msgid "guestfs_command"
24336 #: ../src/guestfs-actions.pod:1090
24340 " guestfs_command (guestfs_h *g,\n"
24341 " char *const *arguments);\n"
24346 #: ../src/guestfs-actions.pod:1099
24348 "The single parameter is an argv-style list of arguments. The first element "
24349 "is the name of the program to run. Subsequent elements are parameters. The "
24350 "list must be non-empty (ie. must contain a program name). Note that the "
24351 "command runs directly, and is I<not> invoked via the shell (see "
24356 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150 ../src/guestfs-actions.pod:1726
24357 msgid "(Added in 0.9.1)"
24361 #: ../src/guestfs-actions.pod:1132
24362 msgid "guestfs_command_lines"
24366 #: ../src/guestfs-actions.pod:1134
24370 " guestfs_command_lines (guestfs_h *g,\n"
24371 " char *const *arguments);\n"
24376 #: ../src/guestfs-actions.pod:1138
24378 "This is the same as C<guestfs_command>, but splits the result into a list of "
24383 #: ../src/guestfs-actions.pod:1141
24384 msgid "See also: C<guestfs_sh_lines>"
24388 #: ../src/guestfs-actions.pod:1152
24389 msgid "guestfs_compress_device_out"
24393 #: ../src/guestfs-actions.pod:1154
24397 " guestfs_compress_device_out (guestfs_h *g,\n"
24398 " const char *ctype,\n"
24399 " const char *device,\n"
24400 " const char *zdevice,\n"
24406 #: ../src/guestfs-actions.pod:1166
24409 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
24414 #: ../src/guestfs-actions.pod:1171
24416 "The C<ctype> and optional C<level> parameters have the same meaning as in "
24417 "C<guestfs_compress_out>."
24421 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:6583
24422 msgid "(Added in 1.13.15)"
24426 #: ../src/guestfs-actions.pod:1178
24427 msgid "guestfs_compress_device_out_va"
24431 #: ../src/guestfs-actions.pod:1180
24435 " guestfs_compress_device_out_va (guestfs_h *g,\n"
24436 " const char *ctype,\n"
24437 " const char *device,\n"
24438 " const char *zdevice,\n"
24439 " va_list args);\n"
24444 #: ../src/guestfs-actions.pod:1187
24445 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
24449 #: ../src/guestfs-actions.pod:1191
24450 msgid "guestfs_compress_device_out_argv"
24454 #: ../src/guestfs-actions.pod:1193
24458 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
24459 " const char *ctype,\n"
24460 " const char *device,\n"
24461 " const char *zdevice,\n"
24463 "guestfs_compress_device_out_argv *optargs);\n"
24468 #: ../src/guestfs-actions.pod:1200
24469 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
24473 #: ../src/guestfs-actions.pod:1204
24474 msgid "guestfs_compress_out"
24478 #: ../src/guestfs-actions.pod:1206
24482 " guestfs_compress_out (guestfs_h *g,\n"
24483 " const char *ctype,\n"
24484 " const char *file,\n"
24485 " const char *zfile,\n"
24491 #: ../src/guestfs-actions.pod:1218
24494 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
24499 #: ../src/guestfs-actions.pod:1237
24500 msgid "guestfs_compress_out_va"
24504 #: ../src/guestfs-actions.pod:1239
24508 " guestfs_compress_out_va (guestfs_h *g,\n"
24509 " const char *ctype,\n"
24510 " const char *file,\n"
24511 " const char *zfile,\n"
24512 " va_list args);\n"
24517 #: ../src/guestfs-actions.pod:1246
24518 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
24522 #: ../src/guestfs-actions.pod:1250
24523 msgid "guestfs_compress_out_argv"
24527 #: ../src/guestfs-actions.pod:1252
24531 " guestfs_compress_out_argv (guestfs_h *g,\n"
24532 " const char *ctype,\n"
24533 " const char *file,\n"
24534 " const char *zfile,\n"
24535 " const struct guestfs_compress_out_argv "
24541 #: ../src/guestfs-actions.pod:1259
24542 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
24546 #: ../src/guestfs-actions.pod:1263
24547 msgid "guestfs_config"
24551 #: ../src/guestfs-actions.pod:1265
24555 " guestfs_config (guestfs_h *g,\n"
24556 " const char *qemuparam,\n"
24557 " const char *qemuvalue);\n"
24562 #: ../src/guestfs-actions.pod:1283
24563 msgid "guestfs_copy_size"
24567 #: ../src/guestfs-actions.pod:1285
24571 " guestfs_copy_size (guestfs_h *g,\n"
24572 " const char *src,\n"
24573 " const char *dest,\n"
24574 " int64_t size);\n"
24579 #: ../src/guestfs-actions.pod:1299 ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1453 ../src/guestfs-actions.pod:1498 ../src/guestfs-actions.pod:1875 ../src/guestfs-actions.pod:1897 ../src/guestfs-actions.pod:3791 ../src/guestfs-actions.pod:7397 ../src/guestfs-actions.pod:7431 ../src/guestfs-actions.pod:7938 ../src/guestfs-actions.pod:7961
24581 "This long-running command can generate progress notification messages so "
24582 "that the caller can display a progress bar or indicator. To receive these "
24583 "messages, the caller must register a progress event callback. See "
24584 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
24588 #: ../src/guestfs-actions.pod:1304 ../src/guestfs-actions.pod:4515 ../src/guestfs-actions.pod:5890 ../src/guestfs-actions.pod:7632 ../src/guestfs-actions.pod:7652 ../src/guestfs-actions.pod:7738
24589 msgid "(Added in 1.0.87)"
24593 #: ../src/guestfs-actions.pod:1306
24598 #: ../src/guestfs-actions.pod:1308
24602 " guestfs_cp (guestfs_h *g,\n"
24603 " const char *src,\n"
24604 " const char *dest);\n"
24609 #: ../src/guestfs-actions.pod:1318 ../src/guestfs-actions.pod:1332 ../src/guestfs-actions.pod:1404 ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1592 ../src/guestfs-actions.pod:5259 ../src/guestfs-actions.pod:5734
24610 msgid "(Added in 1.0.18)"
24614 #: ../src/guestfs-actions.pod:1320
24615 msgid "guestfs_cp_a"
24619 #: ../src/guestfs-actions.pod:1322
24623 " guestfs_cp_a (guestfs_h *g,\n"
24624 " const char *src,\n"
24625 " const char *dest);\n"
24630 #: ../src/guestfs-actions.pod:1334
24635 #: ../src/guestfs-actions.pod:1336
24639 " guestfs_dd (guestfs_h *g,\n"
24640 " const char *src,\n"
24641 " const char *dest);\n"
24646 #: ../src/guestfs-actions.pod:1346
24648 "If the destination is a device, it must be as large or larger than the "
24649 "source file or device, otherwise the copy will fail. This command cannot do "
24650 "partial copies (see C<guestfs_copy_size>)."
24654 #: ../src/guestfs-actions.pod:1354
24659 #: ../src/guestfs-actions.pod:1356
24663 " guestfs_df (guestfs_h *g);\n"
24668 #: ../src/guestfs-actions.pod:1361 ../src/guestfs-actions.pod:1378
24670 "This command is mostly useful for interactive sessions. It is I<not> "
24671 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
24676 #: ../src/guestfs-actions.pod:1368 ../src/guestfs-actions.pod:1385 ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:2510 ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2602 ../src/guestfs-actions.pod:4625 ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:7135 ../src/guestfs-actions.pod:7159 ../src/guestfs-actions.pod:7778 ../src/guestfs-actions.pod:7791 ../src/guestfs-actions.pod:7804
24677 msgid "(Added in 1.0.54)"
24681 #: ../src/guestfs-actions.pod:1370
24682 msgid "guestfs_df_h"
24686 #: ../src/guestfs-actions.pod:1372
24690 " guestfs_df_h (guestfs_h *g);\n"
24695 #: ../src/guestfs-actions.pod:1387
24696 msgid "guestfs_dmesg"
24700 #: ../src/guestfs-actions.pod:1389
24704 " guestfs_dmesg (guestfs_h *g);\n"
24709 #: ../src/guestfs-actions.pod:1396
24711 "Another way to get the same information is to enable verbose messages with "
24712 "C<guestfs_set_verbose> or by setting the environment variable "
24713 "C<LIBGUESTFS_DEBUG=1> before running the program."
24717 #: ../src/guestfs-actions.pod:1406
24718 msgid "guestfs_download"
24722 #: ../src/guestfs-actions.pod:1408
24726 " guestfs_download (guestfs_h *g,\n"
24727 " const char *remotefilename,\n"
24728 " const char *filename);\n"
24733 #: ../src/guestfs-actions.pod:1418
24734 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
24738 #: ../src/guestfs-actions.pod:1429
24739 msgid "guestfs_download_offset"
24743 #: ../src/guestfs-actions.pod:1431
24747 " guestfs_download_offset (guestfs_h *g,\n"
24748 " const char *remotefilename,\n"
24749 " const char *filename,\n"
24750 " int64_t offset,\n"
24751 " int64_t size);\n"
24756 #: ../src/guestfs-actions.pod:1444
24758 "Note that there is no limit on the amount of data that can be downloaded "
24759 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
24760 "full amount unless an error occurs."
24764 #: ../src/guestfs-actions.pod:1449
24765 msgid "See also C<guestfs_download>, C<guestfs_pread>."
24769 #: ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:7436
24770 msgid "(Added in 1.5.17)"
24774 #: ../src/guestfs-actions.pod:1460
24775 msgid "guestfs_drop_caches"
24779 #: ../src/guestfs-actions.pod:1462
24783 " guestfs_drop_caches (guestfs_h *g,\n"
24784 " int whattodrop);\n"
24789 #: ../src/guestfs-actions.pod:1480
24794 #: ../src/guestfs-actions.pod:1482
24798 " guestfs_du (guestfs_h *g,\n"
24799 " const char *path);\n"
24804 #: ../src/guestfs-actions.pod:1505
24805 msgid "guestfs_e2fsck_f"
24809 #: ../src/guestfs-actions.pod:1507
24813 " guestfs_e2fsck_f (guestfs_h *g,\n"
24814 " const char *device);\n"
24819 #: ../src/guestfs-actions.pod:1515
24821 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
24822 "Normally you should use C<guestfs_fsck>."
24826 #: ../src/guestfs-actions.pod:1520
24827 msgid "(Added in 1.0.29)"
24831 #: ../src/guestfs-actions.pod:1522
24832 msgid "guestfs_echo_daemon"
24836 #: ../src/guestfs-actions.pod:1524
24840 " guestfs_echo_daemon (guestfs_h *g,\n"
24841 " char *const *words);\n"
24846 #: ../src/guestfs-actions.pod:1533
24847 msgid "See also C<guestfs_ping_daemon>."
24851 #: ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:6607
24852 msgid "(Added in 1.0.69)"
24856 #: ../src/guestfs-actions.pod:1540
24857 msgid "guestfs_egrep"
24861 #: ../src/guestfs-actions.pod:1542
24865 " guestfs_egrep (guestfs_h *g,\n"
24866 " const char *regex,\n"
24867 " const char *path);\n"
24872 #: ../src/guestfs-actions.pod:1557 ../src/guestfs-actions.pod:1576 ../src/guestfs-actions.pod:1633 ../src/guestfs-actions.pod:1679 ../src/guestfs-actions.pod:1698 ../src/guestfs-actions.pod:2426 ../src/guestfs-actions.pod:2445 ../src/guestfs-actions.pod:2623 ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:2651 ../src/guestfs-actions.pod:2697 ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2732 ../src/guestfs-actions.pod:4005 ../src/guestfs-actions.pod:4019 ../src/guestfs-actions.pod:4032 ../src/guestfs-actions.pod:4046 ../src/guestfs-actions.pod:5047 ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6117 ../src/guestfs-actions.pod:7003 ../src/guestfs-actions.pod:7015 ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7041 ../src/guestfs-actions.pod:7063 ../src/guestfs-actions.pod:7076 ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7102 ../src/guestfs-actions.pod:7896 ../src/guestfs-actions.pod:7915 ../src/guestfs-actions.pod:8009 ../src/guestfs-actions.pod:8028 ../src/guestfs-actions.pod:8074 ../src/guestfs-actions.pod:8093
24873 msgid "(Added in 1.0.66)"
24877 #: ../src/guestfs-actions.pod:1559
24878 msgid "guestfs_egrepi"
24882 #: ../src/guestfs-actions.pod:1561
24886 " guestfs_egrepi (guestfs_h *g,\n"
24887 " const char *regex,\n"
24888 " const char *path);\n"
24893 #: ../src/guestfs-actions.pod:1578
24894 msgid "guestfs_equal"
24898 #: ../src/guestfs-actions.pod:1580
24902 " guestfs_equal (guestfs_h *g,\n"
24903 " const char *file1,\n"
24904 " const char *file2);\n"
24909 #: ../src/guestfs-actions.pod:1594
24910 msgid "guestfs_exists"
24914 #: ../src/guestfs-actions.pod:1596
24918 " guestfs_exists (guestfs_h *g,\n"
24919 " const char *path);\n"
24924 #: ../src/guestfs-actions.pod:1603
24925 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
24929 #: ../src/guestfs-actions.pod:1609
24930 msgid "guestfs_fallocate"
24934 #: ../src/guestfs-actions.pod:1611
24938 " guestfs_fallocate (guestfs_h *g,\n"
24939 " const char *path,\n"
24945 #: ../src/guestfs-actions.pod:1616
24947 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
24952 #: ../src/guestfs-actions.pod:1635
24953 msgid "guestfs_fallocate64"
24957 #: ../src/guestfs-actions.pod:1637
24961 " guestfs_fallocate64 (guestfs_h *g,\n"
24962 " const char *path,\n"
24968 #: ../src/guestfs-actions.pod:1646
24970 "Note that this call allocates disk blocks for the file. To create a sparse "
24971 "file use C<guestfs_truncate_size> instead."
24975 #: ../src/guestfs-actions.pod:1649
24977 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
24978 "oversight it only allowed 30 bit lengths to be specified, effectively "
24979 "limiting the maximum size of files created through that call to 1GB."
24983 #: ../src/guestfs-actions.pod:1660
24984 msgid "(Added in 1.3.17)"
24988 #: ../src/guestfs-actions.pod:1662
24989 msgid "guestfs_fgrep"
24993 #: ../src/guestfs-actions.pod:1664
24997 " guestfs_fgrep (guestfs_h *g,\n"
24998 " const char *pattern,\n"
24999 " const char *path);\n"
25004 #: ../src/guestfs-actions.pod:1681
25005 msgid "guestfs_fgrepi"
25009 #: ../src/guestfs-actions.pod:1683
25013 " guestfs_fgrepi (guestfs_h *g,\n"
25014 " const char *pattern,\n"
25015 " const char *path);\n"
25020 #: ../src/guestfs-actions.pod:1700
25021 msgid "guestfs_file"
25025 #: ../src/guestfs-actions.pod:1702
25029 " guestfs_file (guestfs_h *g,\n"
25030 " const char *path);\n"
25035 #: ../src/guestfs-actions.pod:1720
25037 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25038 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
25042 #: ../src/guestfs-actions.pod:1728
25043 msgid "guestfs_file_architecture"
25047 #: ../src/guestfs-actions.pod:1730
25051 " guestfs_file_architecture (guestfs_h *g,\n"
25052 " const char *filename);\n"
25057 #: ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:2001 ../src/guestfs-actions.pod:2018 ../src/guestfs-actions.pod:2752 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2912 ../src/guestfs-actions.pod:3099 ../src/guestfs-actions.pod:3117 ../src/guestfs-actions.pod:3157 ../src/guestfs-actions.pod:3232 ../src/guestfs-actions.pod:3325 ../src/guestfs-actions.pod:3562 ../src/guestfs-actions.pod:3694
25058 msgid "(Added in 1.5.3)"
25062 #: ../src/guestfs-actions.pod:1840
25063 msgid "guestfs_filesize"
25067 #: ../src/guestfs-actions.pod:1842
25071 " guestfs_filesize (guestfs_h *g,\n"
25072 " const char *file);\n"
25077 #: ../src/guestfs-actions.pod:1848
25079 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
25080 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
25081 "devices, use C<guestfs_blockdev_getsize64>."
25085 #: ../src/guestfs-actions.pod:1854
25086 msgid "(Added in 1.0.82)"
25090 #: ../src/guestfs-actions.pod:1856
25091 msgid "guestfs_fill"
25095 #: ../src/guestfs-actions.pod:1858
25099 " guestfs_fill (guestfs_h *g,\n"
25102 " const char *path);\n"
25107 #: ../src/guestfs-actions.pod:1868
25109 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25110 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
25111 "bytes use C<guestfs_fill_pattern>."
25115 #: ../src/guestfs-actions.pod:1880
25116 msgid "(Added in 1.0.79)"
25120 #: ../src/guestfs-actions.pod:1882
25121 msgid "guestfs_fill_pattern"
25125 #: ../src/guestfs-actions.pod:1884
25129 " guestfs_fill_pattern (guestfs_h *g,\n"
25130 " const char *pattern,\n"
25132 " const char *path);\n"
25137 #: ../src/guestfs-actions.pod:1890
25139 "This function is like C<guestfs_fill> except that it creates a new file of "
25140 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
25141 "pattern is truncated if necessary to ensure the length of the file is "
25142 "exactly C<len> bytes."
25146 #: ../src/guestfs-actions.pod:1902
25147 msgid "(Added in 1.3.12)"
25151 #: ../src/guestfs-actions.pod:1904
25152 msgid "guestfs_find"
25156 #: ../src/guestfs-actions.pod:1906
25160 " guestfs_find (guestfs_h *g,\n"
25161 " const char *directory);\n"
25166 #: ../src/guestfs-actions.pod:1922
25167 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
25171 #: ../src/guestfs-actions.pod:1935
25172 msgid "See also C<guestfs_find0>."
25176 #: ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:4452 ../src/guestfs-actions.pod:6152
25177 msgid "(Added in 1.0.27)"
25181 #: ../src/guestfs-actions.pod:1946
25182 msgid "guestfs_find0"
25186 #: ../src/guestfs-actions.pod:1948
25190 " guestfs_find0 (guestfs_h *g,\n"
25191 " const char *directory,\n"
25192 " const char *files);\n"
25197 #: ../src/guestfs-actions.pod:1957
25199 "This command works the same way as C<guestfs_find> with the following "
25204 #: ../src/guestfs-actions.pod:1984
25205 msgid "(Added in 1.0.74)"
25209 #: ../src/guestfs-actions.pod:1986
25210 msgid "guestfs_findfs_label"
25214 #: ../src/guestfs-actions.pod:1988
25218 " guestfs_findfs_label (guestfs_h *g,\n"
25219 " const char *label);\n"
25224 #: ../src/guestfs-actions.pod:1996
25225 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
25229 #: ../src/guestfs-actions.pod:2003
25230 msgid "guestfs_findfs_uuid"
25234 #: ../src/guestfs-actions.pod:2005
25238 " guestfs_findfs_uuid (guestfs_h *g,\n"
25239 " const char *uuid);\n"
25244 #: ../src/guestfs-actions.pod:2013
25245 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
25249 #: ../src/guestfs-actions.pod:2020
25250 msgid "guestfs_fsck"
25254 #: ../src/guestfs-actions.pod:2022
25258 " guestfs_fsck (guestfs_h *g,\n"
25259 " const char *fstype,\n"
25260 " const char *device);\n"
25265 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:7943
25266 msgid "(Added in 1.0.16)"
25270 #: ../src/guestfs-actions.pod:2059
25271 msgid "guestfs_get_append"
25275 #: ../src/guestfs-actions.pod:2061
25279 " guestfs_get_append (guestfs_h *g);\n"
25284 #: ../src/guestfs-actions.pod:2069
25286 "This function returns a string which may be NULL. There is no way to return "
25287 "an error from this function. The string is owned by the guest handle and "
25288 "must I<not> be freed."
25292 #: ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:5830 ../src/guestfs-actions.pod:6312 ../src/guestfs-actions.pod:6770 ../src/guestfs-actions.pod:6789 ../src/guestfs-actions.pod:6805 ../src/guestfs-actions.pod:6829 ../src/guestfs-actions.pod:7583 ../src/guestfs-actions.pod:7598 ../src/guestfs-actions.pod:7990
25293 msgid "(Added in 1.0.26)"
25297 #: ../src/guestfs-actions.pod:2075
25298 msgid "guestfs_get_attach_method"
25302 #: ../src/guestfs-actions.pod:2077
25306 " guestfs_get_attach_method (guestfs_h *g);\n"
25311 #: ../src/guestfs-actions.pod:2080
25312 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
25316 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:6342
25317 msgid "(Added in 1.9.8)"
25321 #: ../src/guestfs-actions.pod:2087
25322 msgid "guestfs_get_autosync"
25326 #: ../src/guestfs-actions.pod:2089
25330 " guestfs_get_autosync (guestfs_h *g);\n"
25335 #: ../src/guestfs-actions.pod:2098
25336 msgid "guestfs_get_direct"
25340 #: ../src/guestfs-actions.pod:2100
25344 " guestfs_get_direct (guestfs_h *g);\n"
25349 #: ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:6383
25350 msgid "(Added in 1.0.72)"
25354 #: ../src/guestfs-actions.pod:2109
25355 msgid "guestfs_get_e2label"
25359 #: ../src/guestfs-actions.pod:2111
25363 " guestfs_get_e2label (guestfs_h *g,\n"
25364 " const char *device);\n"
25369 #: ../src/guestfs-actions.pod:2115
25371 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
25376 #: ../src/guestfs-actions.pod:2128 ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:6401 ../src/guestfs-actions.pod:6420
25377 msgid "(Added in 1.0.15)"
25381 #: ../src/guestfs-actions.pod:2130
25382 msgid "guestfs_get_e2uuid"
25386 #: ../src/guestfs-actions.pod:2132
25390 " guestfs_get_e2uuid (guestfs_h *g,\n"
25391 " const char *device);\n"
25396 #: ../src/guestfs-actions.pod:2136
25398 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
25403 #: ../src/guestfs-actions.pod:2151
25404 msgid "guestfs_get_memsize"
25408 #: ../src/guestfs-actions.pod:2153
25412 " guestfs_get_memsize (guestfs_h *g);\n"
25417 #: ../src/guestfs-actions.pod:2159
25419 "If C<guestfs_set_memsize> was not called on this handle, and if "
25420 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25421 "value for memsize."
25425 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4952 ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5002 ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5032 ../src/guestfs-actions.pod:6055 ../src/guestfs-actions.pod:6441 ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:7352
25426 msgid "(Added in 1.0.55)"
25430 #: ../src/guestfs-actions.pod:2170
25431 msgid "guestfs_get_network"
25435 #: ../src/guestfs-actions.pod:2172
25439 " guestfs_get_network (guestfs_h *g);\n"
25444 #: ../src/guestfs-actions.pod:2179 ../src/guestfs-actions.pod:6460
25445 msgid "(Added in 1.5.4)"
25449 #: ../src/guestfs-actions.pod:2181
25450 msgid "guestfs_get_path"
25454 #: ../src/guestfs-actions.pod:2183
25458 " guestfs_get_path (guestfs_h *g);\n"
25463 #: ../src/guestfs-actions.pod:2191 ../src/guestfs-actions.pod:2231
25465 "This function returns a string, or NULL on error. The string is owned by "
25466 "the guest handle and must I<not> be freed."
25470 #: ../src/guestfs-actions.pod:2196
25471 msgid "guestfs_get_pgroup"
25475 #: ../src/guestfs-actions.pod:2198
25479 " guestfs_get_pgroup (guestfs_h *g);\n"
25484 #: ../src/guestfs-actions.pod:2205 ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:7844
25485 msgid "(Added in 1.11.18)"
25489 #: ../src/guestfs-actions.pod:2207
25490 msgid "guestfs_get_pid"
25494 #: ../src/guestfs-actions.pod:2209
25498 " guestfs_get_pid (guestfs_h *g);\n"
25503 #: ../src/guestfs-actions.pod:2219
25504 msgid "(Added in 1.0.56)"
25508 #: ../src/guestfs-actions.pod:2221
25509 msgid "guestfs_get_qemu"
25513 #: ../src/guestfs-actions.pod:2223
25517 " guestfs_get_qemu (guestfs_h *g);\n"
25522 #: ../src/guestfs-actions.pod:2234 ../src/guestfs-actions.pod:6524
25523 msgid "(Added in 1.0.6)"
25527 #: ../src/guestfs-actions.pod:2236
25528 msgid "guestfs_get_recovery_proc"
25532 #: ../src/guestfs-actions.pod:2238
25536 " guestfs_get_recovery_proc (guestfs_h *g);\n"
25541 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:3816 ../src/guestfs-actions.pod:4147 ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:4582 ../src/guestfs-actions.pod:5760 ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6548 ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7275 ../src/guestfs-actions.pod:7467
25542 msgid "(Added in 1.0.77)"
25546 #: ../src/guestfs-actions.pod:2247
25547 msgid "guestfs_get_selinux"
25551 #: ../src/guestfs-actions.pod:2249
25555 " guestfs_get_selinux (guestfs_h *g);\n"
25560 #: ../src/guestfs-actions.pod:2252
25562 "This returns the current setting of the selinux flag which is passed to the "
25563 "appliance at boot time. See C<guestfs_set_selinux>."
25567 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:6641
25568 msgid "(Added in 1.0.67)"
25572 #: ../src/guestfs-actions.pod:2262
25573 msgid "guestfs_get_smp"
25577 #: ../src/guestfs-actions.pod:2264
25581 " guestfs_get_smp (guestfs_h *g);\n"
25586 #: ../src/guestfs-actions.pod:2273
25587 msgid "guestfs_get_state"
25591 #: ../src/guestfs-actions.pod:2275
25595 " guestfs_get_state (guestfs_h *g);\n"
25600 #: ../src/guestfs-actions.pod:2287
25601 msgid "guestfs_get_trace"
25605 #: ../src/guestfs-actions.pod:2289
25609 " guestfs_get_trace (guestfs_h *g);\n"
25614 #: ../src/guestfs-actions.pod:2298
25615 msgid "guestfs_get_umask"
25619 #: ../src/guestfs-actions.pod:2300
25623 " guestfs_get_umask (guestfs_h *g);\n"
25628 #: ../src/guestfs-actions.pod:2303
25630 "Return the current umask. By default the umask is C<022> unless it has been "
25631 "set by calling C<guestfs_umask>."
25635 #: ../src/guestfs-actions.pod:2310
25636 msgid "guestfs_get_verbose"
25640 #: ../src/guestfs-actions.pod:2312
25644 " guestfs_get_verbose (guestfs_h *g);\n"
25649 #: ../src/guestfs-actions.pod:2321
25650 msgid "guestfs_getcon"
25654 #: ../src/guestfs-actions.pod:2323
25658 " guestfs_getcon (guestfs_h *g);\n"
25663 #: ../src/guestfs-actions.pod:2328
25664 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
25668 #: ../src/guestfs-actions.pod:2336
25669 msgid "guestfs_getxattr"
25673 #: ../src/guestfs-actions.pod:2338
25677 " guestfs_getxattr (guestfs_h *g,\n"
25678 " const char *path,\n"
25679 " const char *name,\n"
25680 " size_t *size_r);\n"
25685 #: ../src/guestfs-actions.pod:2344
25687 "Get a single extended attribute from file C<path> named C<name>. This call "
25688 "follows symlinks. If you want to lookup an extended attribute for the "
25689 "symlink itself, use C<guestfs_lgetxattr>."
25693 #: ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:3830
25695 "Normally it is better to get all extended attributes from a file in one go "
25696 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
25697 "implementations are buggy and do not provide a way to list out attributes. "
25698 "For these filesystems (notably ntfs-3g) you have to know the names of the "
25699 "extended attributes you want in advance and call this function."
25703 #: ../src/guestfs-actions.pod:2358
25704 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
25708 #: ../src/guestfs-actions.pod:2360 ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3842 ../src/guestfs-actions.pod:5753 ../src/guestfs-actions.pod:5779 ../src/guestfs-actions.pod:5960
25710 "This function returns a buffer, or NULL on error. The size of the returned "
25711 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
25716 #: ../src/guestfs-actions.pod:2364 ../src/guestfs-actions.pod:3846
25717 msgid "(Added in 1.7.24)"
25721 #: ../src/guestfs-actions.pod:2366
25722 msgid "guestfs_getxattrs"
25726 #: ../src/guestfs-actions.pod:2368
25729 " struct guestfs_xattr_list *\n"
25730 " guestfs_getxattrs (guestfs_h *g,\n"
25731 " const char *path);\n"
25736 #: ../src/guestfs-actions.pod:2378
25737 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
25741 #: ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:3858 ../src/guestfs-actions.pod:4546
25743 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
25744 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
25748 #: ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:3862 ../src/guestfs-actions.pod:4061 ../src/guestfs-actions.pod:4097 ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6660 ../src/guestfs-actions.pod:8055
25749 msgid "(Added in 1.0.59)"
25753 #: ../src/guestfs-actions.pod:2386
25754 msgid "guestfs_glob_expand"
25758 #: ../src/guestfs-actions.pod:2388
25762 " guestfs_glob_expand (guestfs_h *g,\n"
25763 " const char *pattern);\n"
25768 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6853 ../src/guestfs-actions.pod:6870
25769 msgid "(Added in 1.0.50)"
25773 #: ../src/guestfs-actions.pod:2409
25774 msgid "guestfs_grep"
25778 #: ../src/guestfs-actions.pod:2411
25782 " guestfs_grep (guestfs_h *g,\n"
25783 " const char *regex,\n"
25784 " const char *path);\n"
25789 #: ../src/guestfs-actions.pod:2428
25790 msgid "guestfs_grepi"
25794 #: ../src/guestfs-actions.pod:2430
25798 " guestfs_grepi (guestfs_h *g,\n"
25799 " const char *regex,\n"
25800 " const char *path);\n"
25805 #: ../src/guestfs-actions.pod:2447
25806 msgid "guestfs_grub_install"
25810 #: ../src/guestfs-actions.pod:2449
25814 " guestfs_grub_install (guestfs_h *g,\n"
25815 " const char *root,\n"
25816 " const char *device);\n"
25821 #: ../src/guestfs-actions.pod:2492
25822 msgid "(Added in 1.0.17)"
25826 #: ../src/guestfs-actions.pod:2494
25827 msgid "guestfs_head"
25831 #: ../src/guestfs-actions.pod:2496
25835 " guestfs_head (guestfs_h *g,\n"
25836 " const char *path);\n"
25841 #: ../src/guestfs-actions.pod:2512
25842 msgid "guestfs_head_n"
25846 #: ../src/guestfs-actions.pod:2514
25850 " guestfs_head_n (guestfs_h *g,\n"
25852 " const char *path);\n"
25857 #: ../src/guestfs-actions.pod:2536
25858 msgid "guestfs_hexdump"
25862 #: ../src/guestfs-actions.pod:2538
25866 " guestfs_hexdump (guestfs_h *g,\n"
25867 " const char *path);\n"
25872 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:6934 ../src/guestfs-actions.pod:6989
25873 msgid "(Added in 1.0.22)"
25877 #: ../src/guestfs-actions.pod:2553
25878 msgid "guestfs_initrd_cat"
25882 #: ../src/guestfs-actions.pod:2555
25886 " guestfs_initrd_cat (guestfs_h *g,\n"
25887 " const char *initrdpath,\n"
25888 " const char *filename,\n"
25889 " size_t *size_r);\n"
25894 #: ../src/guestfs-actions.pod:2571
25895 msgid "See also C<guestfs_initrd_list>."
25899 #: ../src/guestfs-actions.pod:2582
25900 msgid "guestfs_initrd_list"
25904 #: ../src/guestfs-actions.pod:2584
25908 " guestfs_initrd_list (guestfs_h *g,\n"
25909 " const char *path);\n"
25914 #: ../src/guestfs-actions.pod:2604
25915 msgid "guestfs_inotify_add_watch"
25919 #: ../src/guestfs-actions.pod:2606
25923 " guestfs_inotify_add_watch (guestfs_h *g,\n"
25924 " const char *path,\n"
25930 #: ../src/guestfs-actions.pod:2625
25931 msgid "guestfs_inotify_close"
25935 #: ../src/guestfs-actions.pod:2627
25939 " guestfs_inotify_close (guestfs_h *g);\n"
25944 #: ../src/guestfs-actions.pod:2638
25945 msgid "guestfs_inotify_files"
25949 #: ../src/guestfs-actions.pod:2640
25953 " guestfs_inotify_files (guestfs_h *g);\n"
25958 #: ../src/guestfs-actions.pod:2643
25960 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
25961 "returns a list of pathnames of objects that were touched. The returned "
25962 "pathnames are sorted and deduplicated."
25966 #: ../src/guestfs-actions.pod:2653
25967 msgid "guestfs_inotify_init"
25971 #: ../src/guestfs-actions.pod:2655
25975 " guestfs_inotify_init (guestfs_h *g,\n"
25976 " int maxevents);\n"
25981 #: ../src/guestfs-actions.pod:2663
25983 "C<maxevents> is the maximum number of events which will be queued up between "
25984 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
25985 "passed as C<0>, then the kernel (or previously set) default is used. For "
25986 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
25987 "throws away events, but records the fact that it threw them away by setting "
25988 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
25989 "C<guestfs_inotify_read>)."
25993 #: ../src/guestfs-actions.pod:2673
25995 "Before any events are generated, you have to add some watches to the "
25996 "internal watch list. See: C<guestfs_inotify_add_watch>, "
25997 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26001 #: ../src/guestfs-actions.pod:2679
26003 "Queued up events should be read periodically by calling "
26004 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26005 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
26006 "often enough then you risk the internal queue overflowing."
26010 #: ../src/guestfs-actions.pod:2686
26012 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
26013 "This also removes any watches automatically."
26017 #: ../src/guestfs-actions.pod:2699
26018 msgid "guestfs_inotify_read"
26022 #: ../src/guestfs-actions.pod:2701
26025 " struct guestfs_inotify_event_list *\n"
26026 " guestfs_inotify_read (guestfs_h *g);\n"
26031 #: ../src/guestfs-actions.pod:2715
26033 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
26034 "there was an error. I<The caller must call "
26035 "C<guestfs_free_inotify_event_list> after use>."
26039 #: ../src/guestfs-actions.pod:2721
26040 msgid "guestfs_inotify_rm_watch"
26044 #: ../src/guestfs-actions.pod:2723
26048 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
26054 #: ../src/guestfs-actions.pod:2727
26056 "Remove a previously defined inotify watch. See "
26057 "C<guestfs_inotify_add_watch>."
26061 #: ../src/guestfs-actions.pod:2734
26062 msgid "guestfs_inspect_get_arch"
26066 #: ../src/guestfs-actions.pod:2736
26070 " guestfs_inspect_get_arch (guestfs_h *g,\n"
26071 " const char *root);\n"
26076 #: ../src/guestfs-actions.pod:2740
26078 "This returns the architecture of the inspected operating system. The "
26079 "possible return values are listed under C<guestfs_file_architecture>."
26083 #: ../src/guestfs-actions.pod:2754
26084 msgid "guestfs_inspect_get_distro"
26088 #: ../src/guestfs-actions.pod:2756
26092 " guestfs_inspect_get_distro (guestfs_h *g,\n"
26093 " const char *root);\n"
26098 #: ../src/guestfs-actions.pod:2848
26099 msgid "guestfs_inspect_get_drive_mappings"
26103 #: ../src/guestfs-actions.pod:2850
26107 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
26108 " const char *root);\n"
26113 #: ../src/guestfs-actions.pod:2879
26115 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26116 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
26120 #: ../src/guestfs-actions.pod:2883 ../src/guestfs-actions.pod:3151 ../src/guestfs-actions.pod:3949 ../src/guestfs-actions.pod:5221 ../src/guestfs-actions.pod:7291
26122 "This function returns a NULL-terminated array of strings, or NULL if there "
26123 "was an error. The array of strings will always have length C<2n+1>, where "
26124 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
26125 "caller must free the strings and the array after use>."
26129 #: ../src/guestfs-actions.pod:2889 ../src/guestfs-actions.pod:3345
26130 msgid "(Added in 1.9.17)"
26134 #: ../src/guestfs-actions.pod:2891
26135 msgid "guestfs_inspect_get_filesystems"
26139 #: ../src/guestfs-actions.pod:2893
26143 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
26144 " const char *root);\n"
26149 #: ../src/guestfs-actions.pod:2905
26151 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26152 "C<guestfs_inspect_get_mountpoints>."
26156 #: ../src/guestfs-actions.pod:2914
26157 msgid "guestfs_inspect_get_format"
26161 #: ../src/guestfs-actions.pod:2916
26165 " guestfs_inspect_get_format (guestfs_h *g,\n"
26166 " const char *root);\n"
26171 #: ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:3397 ../src/guestfs-actions.pod:3415 ../src/guestfs-actions.pod:6171
26172 msgid "(Added in 1.9.4)"
26176 #: ../src/guestfs-actions.pod:2952
26177 msgid "guestfs_inspect_get_hostname"
26181 #: ../src/guestfs-actions.pod:2954
26185 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
26186 " const char *root);\n"
26191 #: ../src/guestfs-actions.pod:2969
26192 msgid "(Added in 1.7.9)"
26196 #: ../src/guestfs-actions.pod:2971
26197 msgid "guestfs_inspect_get_icon"
26201 #: ../src/guestfs-actions.pod:2973
26205 " guestfs_inspect_get_icon (guestfs_h *g,\n"
26206 " const char *root,\n"
26207 " size_t *size_r,\n"
26213 #: ../src/guestfs-actions.pod:2984
26216 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
26217 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
26222 #: ../src/guestfs-actions.pod:3051 ../src/guestfs-actions.pod:3876 ../src/guestfs-actions.pod:5120
26223 msgid "(Added in 1.11.12)"
26227 #: ../src/guestfs-actions.pod:3053
26228 msgid "guestfs_inspect_get_icon_va"
26232 #: ../src/guestfs-actions.pod:3055
26236 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
26237 " const char *root,\n"
26238 " size_t *size_r,\n"
26239 " va_list args);\n"
26244 #: ../src/guestfs-actions.pod:3061
26245 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
26249 #: ../src/guestfs-actions.pod:3065
26250 msgid "guestfs_inspect_get_icon_argv"
26254 #: ../src/guestfs-actions.pod:3067
26258 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
26259 " const char *root,\n"
26260 " size_t *size_r,\n"
26261 " const struct guestfs_inspect_get_icon_argv "
26267 #: ../src/guestfs-actions.pod:3073
26268 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
26272 #: ../src/guestfs-actions.pod:3077
26273 msgid "guestfs_inspect_get_major_version"
26277 #: ../src/guestfs-actions.pod:3079
26281 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
26282 " const char *root);\n"
26287 #: ../src/guestfs-actions.pod:3101
26288 msgid "guestfs_inspect_get_minor_version"
26292 #: ../src/guestfs-actions.pod:3103
26296 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
26297 " const char *root);\n"
26302 #: ../src/guestfs-actions.pod:3112
26304 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26305 "C<guestfs_inspect_get_major_version>."
26309 #: ../src/guestfs-actions.pod:3119
26310 msgid "guestfs_inspect_get_mountpoints"
26314 #: ../src/guestfs-actions.pod:3121
26318 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
26319 " const char *root);\n"
26324 #: ../src/guestfs-actions.pod:3142
26326 "For operating systems like Windows which still use drive letters, this call "
26327 "will only return an entry for the first drive \"mounted on\" C</>. For "
26328 "information about the mapping of drive letters to partitions, see "
26329 "C<guestfs_inspect_get_drive_mappings>."
26333 #: ../src/guestfs-actions.pod:3148
26335 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26336 "C<guestfs_inspect_get_filesystems>."
26340 #: ../src/guestfs-actions.pod:3159
26341 msgid "guestfs_inspect_get_package_format"
26345 #: ../src/guestfs-actions.pod:3161
26349 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
26350 " const char *root);\n"
26355 #: ../src/guestfs-actions.pod:3165
26357 "This function and C<guestfs_inspect_get_package_management> return the "
26358 "package format and package management tool used by the inspected operating "
26359 "system. For example for Fedora these functions would return C<rpm> (package "
26360 "format) and C<yum> (package management)."
26364 #: ../src/guestfs-actions.pod:3183 ../src/guestfs-actions.pod:3211
26365 msgid "(Added in 1.7.5)"
26369 #: ../src/guestfs-actions.pod:3185
26370 msgid "guestfs_inspect_get_package_management"
26374 #: ../src/guestfs-actions.pod:3187
26378 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
26379 " const char *root);\n"
26384 #: ../src/guestfs-actions.pod:3191
26386 "C<guestfs_inspect_get_package_format> and this function return the package "
26387 "format and package management tool used by the inspected operating system. "
26388 "For example for Fedora these functions would return C<rpm> (package format) "
26389 "and C<yum> (package management)."
26393 #: ../src/guestfs-actions.pod:3213
26394 msgid "guestfs_inspect_get_product_name"
26398 #: ../src/guestfs-actions.pod:3215
26402 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
26403 " const char *root);\n"
26408 #: ../src/guestfs-actions.pod:3234
26409 msgid "guestfs_inspect_get_product_variant"
26413 #: ../src/guestfs-actions.pod:3236
26417 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
26418 " const char *root);\n"
26423 #: ../src/guestfs-actions.pod:3259
26425 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26426 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
26430 #: ../src/guestfs-actions.pod:3266
26431 msgid "(Added in 1.9.13)"
26435 #: ../src/guestfs-actions.pod:3268
26436 msgid "guestfs_inspect_get_roots"
26440 #: ../src/guestfs-actions.pod:3270
26444 " guestfs_inspect_get_roots (guestfs_h *g);\n"
26449 #: ../src/guestfs-actions.pod:3273
26451 "This function is a convenient way to get the list of root devices, as "
26452 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
26453 "the whole inspection process."
26457 #: ../src/guestfs-actions.pod:3277
26459 "This returns an empty list if either no root devices were found or the "
26460 "caller has not called C<guestfs_inspect_os>."
26464 #: ../src/guestfs-actions.pod:3286
26465 msgid "(Added in 1.7.3)"
26469 #: ../src/guestfs-actions.pod:3288
26470 msgid "guestfs_inspect_get_type"
26474 #: ../src/guestfs-actions.pod:3290
26478 " guestfs_inspect_get_type (guestfs_h *g,\n"
26479 " const char *root);\n"
26484 #: ../src/guestfs-actions.pod:3327
26485 msgid "guestfs_inspect_get_windows_current_control_set"
26489 #: ../src/guestfs-actions.pod:3329
26493 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
26494 " const char *root);\n"
26499 #: ../src/guestfs-actions.pod:3347
26500 msgid "guestfs_inspect_get_windows_systemroot"
26504 #: ../src/guestfs-actions.pod:3349
26508 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
26509 " const char *root);\n"
26514 #: ../src/guestfs-actions.pod:3365
26515 msgid "(Added in 1.5.25)"
26519 #: ../src/guestfs-actions.pod:3367
26520 msgid "guestfs_inspect_is_live"
26524 #: ../src/guestfs-actions.pod:3369
26528 " guestfs_inspect_is_live (guestfs_h *g,\n"
26529 " const char *root);\n"
26534 #: ../src/guestfs-actions.pod:3373
26536 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26537 "disk), then this returns true if a live image was detected on the disk."
26541 #: ../src/guestfs-actions.pod:3383
26542 msgid "guestfs_inspect_is_multipart"
26546 #: ../src/guestfs-actions.pod:3385
26550 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
26551 " const char *root);\n"
26556 #: ../src/guestfs-actions.pod:3389
26558 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26559 "disk), then this returns true if the disk is part of a set."
26563 #: ../src/guestfs-actions.pod:3399
26564 msgid "guestfs_inspect_is_netinst"
26568 #: ../src/guestfs-actions.pod:3401
26572 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
26573 " const char *root);\n"
26578 #: ../src/guestfs-actions.pod:3405
26580 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26581 "disk), then this returns true if the disk is a network installer, ie. not a "
26582 "self-contained install CD but one which is likely to require network access "
26583 "to complete the install."
26587 #: ../src/guestfs-actions.pod:3417
26588 msgid "guestfs_inspect_list_applications"
26592 #: ../src/guestfs-actions.pod:3419
26595 " struct guestfs_application_list *\n"
26596 " guestfs_inspect_list_applications (guestfs_h *g,\n"
26597 " const char *root);\n"
26602 #: ../src/guestfs-actions.pod:3425
26604 "I<Note:> This call works differently from other parts of the inspection "
26605 "API. You have to call C<guestfs_inspect_os>, then "
26606 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
26607 "this. Listing applications is a significantly more difficult operation "
26608 "which requires access to the full filesystem. Also note that unlike the "
26609 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
26610 "the libguestfs handle, this call actually reads parts of the mounted "
26611 "filesystems during the call."
26615 #: ../src/guestfs-actions.pod:3515
26617 "This function returns a C<struct guestfs_application_list *>, or NULL if "
26618 "there was an error. I<The caller must call C<guestfs_free_application_list> "
26623 #: ../src/guestfs-actions.pod:3519
26624 msgid "(Added in 1.7.8)"
26628 #: ../src/guestfs-actions.pod:3521
26629 msgid "guestfs_inspect_os"
26633 #: ../src/guestfs-actions.pod:3523
26637 " guestfs_inspect_os (guestfs_h *g);\n"
26642 #: ../src/guestfs-actions.pod:3539
26644 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
26645 "functions in order to query further information about each operating system, "
26646 "such as the name and version."
26650 #: ../src/guestfs-actions.pod:3544
26652 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
26653 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
26654 "the contents. This should be called with no disks currently mounted. The "
26655 "function may also use Augeas, so any existing Augeas handle will be closed."
26659 #: ../src/guestfs-actions.pod:3556 ../src/guestfs-actions.pod:3887 ../src/guestfs-actions.pod:3969
26660 msgid "See also C<guestfs_list_filesystems>."
26664 #: ../src/guestfs-actions.pod:3564
26665 msgid "guestfs_is_blockdev"
26669 #: ../src/guestfs-actions.pod:3566
26673 " guestfs_is_blockdev (guestfs_h *g,\n"
26674 " const char *path);\n"
26679 #: ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3602 ../src/guestfs-actions.pod:3632 ../src/guestfs-actions.pod:3647 ../src/guestfs-actions.pod:3663 ../src/guestfs-actions.pod:3719 ../src/guestfs-actions.pod:3734
26680 msgid "See also C<guestfs_stat>."
26684 #: ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3723 ../src/guestfs-actions.pod:3738
26685 msgid "(Added in 1.5.10)"
26689 #: ../src/guestfs-actions.pod:3579
26690 msgid "guestfs_is_busy"
26694 #: ../src/guestfs-actions.pod:3581
26698 " guestfs_is_busy (guestfs_h *g);\n"
26703 #: ../src/guestfs-actions.pod:3593
26704 msgid "guestfs_is_chardev"
26708 #: ../src/guestfs-actions.pod:3595
26712 " guestfs_is_chardev (guestfs_h *g,\n"
26713 " const char *path);\n"
26718 #: ../src/guestfs-actions.pod:3608
26719 msgid "guestfs_is_config"
26723 #: ../src/guestfs-actions.pod:3610
26727 " guestfs_is_config (guestfs_h *g);\n"
26732 #: ../src/guestfs-actions.pod:3622
26733 msgid "guestfs_is_dir"
26737 #: ../src/guestfs-actions.pod:3624
26741 " guestfs_is_dir (guestfs_h *g,\n"
26742 " const char *path);\n"
26747 #: ../src/guestfs-actions.pod:3638
26748 msgid "guestfs_is_fifo"
26752 #: ../src/guestfs-actions.pod:3640
26756 " guestfs_is_fifo (guestfs_h *g,\n"
26757 " const char *path);\n"
26762 #: ../src/guestfs-actions.pod:3653
26763 msgid "guestfs_is_file"
26767 #: ../src/guestfs-actions.pod:3655
26771 " guestfs_is_file (guestfs_h *g,\n"
26772 " const char *path);\n"
26777 #: ../src/guestfs-actions.pod:3669
26778 msgid "guestfs_is_launching"
26782 #: ../src/guestfs-actions.pod:3671
26786 " guestfs_is_launching (guestfs_h *g);\n"
26791 #: ../src/guestfs-actions.pod:3683
26792 msgid "guestfs_is_lv"
26796 #: ../src/guestfs-actions.pod:3685
26800 " guestfs_is_lv (guestfs_h *g,\n"
26801 " const char *device);\n"
26806 #: ../src/guestfs-actions.pod:3696
26807 msgid "guestfs_is_ready"
26811 #: ../src/guestfs-actions.pod:3698
26815 " guestfs_is_ready (guestfs_h *g);\n"
26820 #: ../src/guestfs-actions.pod:3710
26821 msgid "guestfs_is_socket"
26825 #: ../src/guestfs-actions.pod:3712
26829 " guestfs_is_socket (guestfs_h *g,\n"
26830 " const char *path);\n"
26835 #: ../src/guestfs-actions.pod:3725
26836 msgid "guestfs_is_symlink"
26840 #: ../src/guestfs-actions.pod:3727
26844 " guestfs_is_symlink (guestfs_h *g,\n"
26845 " const char *path);\n"
26850 #: ../src/guestfs-actions.pod:3740
26851 msgid "guestfs_is_zero"
26855 #: ../src/guestfs-actions.pod:3742
26859 " guestfs_is_zero (guestfs_h *g,\n"
26860 " const char *path);\n"
26865 #: ../src/guestfs-actions.pod:3751 ../src/guestfs-actions.pod:3765
26866 msgid "(Added in 1.11.8)"
26870 #: ../src/guestfs-actions.pod:3753
26871 msgid "guestfs_is_zero_device"
26875 #: ../src/guestfs-actions.pod:3755
26879 " guestfs_is_zero_device (guestfs_h *g,\n"
26880 " const char *device);\n"
26885 #: ../src/guestfs-actions.pod:3767
26886 msgid "guestfs_kill_subprocess"
26890 #: ../src/guestfs-actions.pod:3769
26894 " guestfs_kill_subprocess (guestfs_h *g);\n"
26899 #: ../src/guestfs-actions.pod:3778
26900 msgid "guestfs_launch"
26904 #: ../src/guestfs-actions.pod:3780
26908 " guestfs_launch (guestfs_h *g);\n"
26913 #: ../src/guestfs-actions.pod:3798
26914 msgid "guestfs_lchown"
26918 #: ../src/guestfs-actions.pod:3800
26922 " guestfs_lchown (guestfs_h *g,\n"
26925 " const char *path);\n"
26930 #: ../src/guestfs-actions.pod:3806
26932 "Change the file owner to C<owner> and group to C<group>. This is like "
26933 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
26934 "changed, not the target."
26938 #: ../src/guestfs-actions.pod:3818
26939 msgid "guestfs_lgetxattr"
26943 #: ../src/guestfs-actions.pod:3820
26947 " guestfs_lgetxattr (guestfs_h *g,\n"
26948 " const char *path,\n"
26949 " const char *name,\n"
26950 " size_t *size_r);\n"
26955 #: ../src/guestfs-actions.pod:3840
26956 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
26960 #: ../src/guestfs-actions.pod:3848
26961 msgid "guestfs_lgetxattrs"
26965 #: ../src/guestfs-actions.pod:3850
26968 " struct guestfs_xattr_list *\n"
26969 " guestfs_lgetxattrs (guestfs_h *g,\n"
26970 " const char *path);\n"
26975 #: ../src/guestfs-actions.pod:3854
26977 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
26978 "then it returns the extended attributes of the link itself."
26982 #: ../src/guestfs-actions.pod:3864
26983 msgid "guestfs_list_9p"
26987 #: ../src/guestfs-actions.pod:3866
26991 " guestfs_list_9p (guestfs_h *g);\n"
26996 #: ../src/guestfs-actions.pod:3878
26997 msgid "guestfs_list_devices"
27001 #: ../src/guestfs-actions.pod:3880
27005 " guestfs_list_devices (guestfs_h *g);\n"
27010 #: ../src/guestfs-actions.pod:3895
27011 msgid "guestfs_list_dm_devices"
27015 #: ../src/guestfs-actions.pod:3897
27019 " guestfs_list_dm_devices (guestfs_h *g);\n"
27024 #: ../src/guestfs-actions.pod:3902
27026 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
27027 "previous call to C<guestfs_luks_open>."
27031 #: ../src/guestfs-actions.pod:3905
27033 "Device mapper devices which correspond to logical volumes are I<not> "
27034 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
27039 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:5359
27040 msgid "(Added in 1.11.15)"
27044 #: ../src/guestfs-actions.pod:3915
27045 msgid "guestfs_list_filesystems"
27049 #: ../src/guestfs-actions.pod:3917
27053 " guestfs_list_filesystems (guestfs_h *g);\n"
27058 #: ../src/guestfs-actions.pod:3937
27060 "This command runs other libguestfs commands, which might include "
27061 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
27062 "soon after launch and only when nothing is mounted."
27066 #: ../src/guestfs-actions.pod:3941
27068 "Not all of the filesystems returned will be mountable. In particular, swap "
27069 "partitions are returned in the list. Also this command does not check that "
27070 "each filesystem found is valid and mountable, and some filesystems might be "
27071 "mountable but require special options. Filesystems may not all belong to a "
27072 "single logical operating system (use C<guestfs_inspect_os> to look for "
27077 #: ../src/guestfs-actions.pod:3955 ../src/guestfs-actions.pod:5720
27078 msgid "(Added in 1.5.15)"
27082 #: ../src/guestfs-actions.pod:3957
27083 msgid "guestfs_list_partitions"
27087 #: ../src/guestfs-actions.pod:3959
27091 " guestfs_list_partitions (guestfs_h *g);\n"
27096 #: ../src/guestfs-actions.pod:3966
27098 "This does not return logical volumes. For that you will need to call "
27103 #: ../src/guestfs-actions.pod:3977
27108 #: ../src/guestfs-actions.pod:3979
27112 " guestfs_ll (guestfs_h *g,\n"
27113 " const char *directory);\n"
27118 #: ../src/guestfs-actions.pod:3994
27123 #: ../src/guestfs-actions.pod:3996
27127 " guestfs_ln (guestfs_h *g,\n"
27128 " const char *target,\n"
27129 " const char *linkname);\n"
27134 #: ../src/guestfs-actions.pod:4007
27135 msgid "guestfs_ln_f"
27139 #: ../src/guestfs-actions.pod:4009
27143 " guestfs_ln_f (guestfs_h *g,\n"
27144 " const char *target,\n"
27145 " const char *linkname);\n"
27150 #: ../src/guestfs-actions.pod:4021
27151 msgid "guestfs_ln_s"
27155 #: ../src/guestfs-actions.pod:4023
27159 " guestfs_ln_s (guestfs_h *g,\n"
27160 " const char *target,\n"
27161 " const char *linkname);\n"
27166 #: ../src/guestfs-actions.pod:4034
27167 msgid "guestfs_ln_sf"
27171 #: ../src/guestfs-actions.pod:4036
27175 " guestfs_ln_sf (guestfs_h *g,\n"
27176 " const char *target,\n"
27177 " const char *linkname);\n"
27182 #: ../src/guestfs-actions.pod:4048
27183 msgid "guestfs_lremovexattr"
27187 #: ../src/guestfs-actions.pod:4050
27191 " guestfs_lremovexattr (guestfs_h *g,\n"
27192 " const char *xattr,\n"
27193 " const char *path);\n"
27198 #: ../src/guestfs-actions.pod:4055
27200 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
27201 "link, then it removes an extended attribute of the link itself."
27205 #: ../src/guestfs-actions.pod:4063
27210 #: ../src/guestfs-actions.pod:4065
27214 " guestfs_ls (guestfs_h *g,\n"
27215 " const char *directory);\n"
27220 #: ../src/guestfs-actions.pod:4073
27222 "This command is mostly useful for interactive sessions. Programs should "
27223 "probably use C<guestfs_readdir> instead."
27227 #: ../src/guestfs-actions.pod:4082
27228 msgid "guestfs_lsetxattr"
27232 #: ../src/guestfs-actions.pod:4084
27236 " guestfs_lsetxattr (guestfs_h *g,\n"
27237 " const char *xattr,\n"
27238 " const char *val,\n"
27240 " const char *path);\n"
27245 #: ../src/guestfs-actions.pod:4091
27247 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
27248 "then it sets an extended attribute of the link itself."
27252 #: ../src/guestfs-actions.pod:4099
27253 msgid "guestfs_lstat"
27257 #: ../src/guestfs-actions.pod:4101
27260 " struct guestfs_stat *\n"
27261 " guestfs_lstat (guestfs_h *g,\n"
27262 " const char *path);\n"
27267 #: ../src/guestfs-actions.pod:4107
27269 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
27270 "link, then the link is stat-ed, not the file it refers to."
27274 #: ../src/guestfs-actions.pod:4113 ../src/guestfs-actions.pod:6894
27276 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
27277 "error. I<The caller must call C<guestfs_free_stat> after use>."
27281 #: ../src/guestfs-actions.pod:4117 ../src/guestfs-actions.pod:6898 ../src/guestfs-actions.pod:6916 ../src/guestfs-actions.pod:7297
27282 msgid "(Added in 0.9.2)"
27286 #: ../src/guestfs-actions.pod:4119
27287 msgid "guestfs_lstatlist"
27291 #: ../src/guestfs-actions.pod:4121
27294 " struct guestfs_stat_list *\n"
27295 " guestfs_lstatlist (guestfs_h *g,\n"
27296 " const char *path,\n"
27297 " char *const *names);\n"
27302 #: ../src/guestfs-actions.pod:4126
27304 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
27305 "files, where all files are in the directory C<path>. C<names> is the list "
27306 "of files from this directory."
27310 #: ../src/guestfs-actions.pod:4135
27312 "This call is intended for programs that want to efficiently list a directory "
27313 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
27314 "for a similarly efficient call for getting extended attributes. Very long "
27315 "directory listings might cause the protocol message size to be exceeded, "
27316 "causing this call to fail. The caller must split up such requests into "
27317 "smaller groups of names."
27321 #: ../src/guestfs-actions.pod:4143
27323 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
27324 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
27328 #: ../src/guestfs-actions.pod:4149
27329 msgid "guestfs_luks_add_key"
27333 #: ../src/guestfs-actions.pod:4151
27337 " guestfs_luks_add_key (guestfs_h *g,\n"
27338 " const char *device,\n"
27339 " const char *key,\n"
27340 " const char *newkey,\n"
27346 #: ../src/guestfs-actions.pod:4163
27348 "Note that if C<keyslot> already contains a key, then this command will "
27349 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
27353 #: ../src/guestfs-actions.pod:4169 ../src/guestfs-actions.pod:4209 ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4252 ../src/guestfs-actions.pod:4287 ../src/guestfs-actions.pod:4306
27355 "This function takes a key or passphrase parameter which could contain "
27356 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
27361 #: ../src/guestfs-actions.pod:4173 ../src/guestfs-actions.pod:4213 ../src/guestfs-actions.pod:4236 ../src/guestfs-actions.pod:4256
27362 msgid "(Added in 1.5.2)"
27366 #: ../src/guestfs-actions.pod:4175
27367 msgid "guestfs_luks_close"
27371 #: ../src/guestfs-actions.pod:4177
27375 " guestfs_luks_close (guestfs_h *g,\n"
27376 " const char *device);\n"
27381 #: ../src/guestfs-actions.pod:4181
27383 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
27384 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
27385 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
27386 "underlying block device."
27390 #: ../src/guestfs-actions.pod:4189 ../src/guestfs-actions.pod:4291 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4360 ../src/guestfs-actions.pod:4408
27391 msgid "(Added in 1.5.1)"
27395 #: ../src/guestfs-actions.pod:4191
27396 msgid "guestfs_luks_format"
27400 #: ../src/guestfs-actions.pod:4193
27404 " guestfs_luks_format (guestfs_h *g,\n"
27405 " const char *device,\n"
27406 " const char *key,\n"
27412 #: ../src/guestfs-actions.pod:4215
27413 msgid "guestfs_luks_format_cipher"
27417 #: ../src/guestfs-actions.pod:4217
27421 " guestfs_luks_format_cipher (guestfs_h *g,\n"
27422 " const char *device,\n"
27423 " const char *key,\n"
27425 " const char *cipher);\n"
27430 #: ../src/guestfs-actions.pod:4224
27432 "This command is the same as C<guestfs_luks_format> but it also allows you to "
27433 "set the C<cipher> used."
27437 #: ../src/guestfs-actions.pod:4238
27438 msgid "guestfs_luks_kill_slot"
27442 #: ../src/guestfs-actions.pod:4240
27446 " guestfs_luks_kill_slot (guestfs_h *g,\n"
27447 " const char *device,\n"
27448 " const char *key,\n"
27454 #: ../src/guestfs-actions.pod:4258
27455 msgid "guestfs_luks_open"
27459 #: ../src/guestfs-actions.pod:4260
27463 " guestfs_luks_open (guestfs_h *g,\n"
27464 " const char *device,\n"
27465 " const char *key,\n"
27466 " const char *mapname);\n"
27471 #: ../src/guestfs-actions.pod:4278
27473 "If this block device contains LVM volume groups, then calling "
27474 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
27479 #: ../src/guestfs-actions.pod:4282
27480 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
27484 #: ../src/guestfs-actions.pod:4293
27485 msgid "guestfs_luks_open_ro"
27489 #: ../src/guestfs-actions.pod:4295
27493 " guestfs_luks_open_ro (guestfs_h *g,\n"
27494 " const char *device,\n"
27495 " const char *key,\n"
27496 " const char *mapname);\n"
27501 #: ../src/guestfs-actions.pod:4301
27503 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
27508 #: ../src/guestfs-actions.pod:4312
27509 msgid "guestfs_lvcreate"
27513 #: ../src/guestfs-actions.pod:4314
27517 " guestfs_lvcreate (guestfs_h *g,\n"
27518 " const char *logvol,\n"
27519 " const char *volgroup,\n"
27525 #: ../src/guestfs-actions.pod:4327
27526 msgid "guestfs_lvm_canonical_lv_name"
27530 #: ../src/guestfs-actions.pod:4329
27534 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
27535 " const char *lvname);\n"
27540 #: ../src/guestfs-actions.pod:4340
27541 msgid "See also C<guestfs_is_lv>."
27545 #: ../src/guestfs-actions.pod:4345
27546 msgid "(Added in 1.5.24)"
27550 #: ../src/guestfs-actions.pod:4347
27551 msgid "guestfs_lvm_clear_filter"
27555 #: ../src/guestfs-actions.pod:4349
27559 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
27564 #: ../src/guestfs-actions.pod:4352
27566 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
27567 "see every block device."
27571 #: ../src/guestfs-actions.pod:4362
27572 msgid "guestfs_lvm_remove_all"
27576 #: ../src/guestfs-actions.pod:4364
27580 " guestfs_lvm_remove_all (guestfs_h *g);\n"
27585 #: ../src/guestfs-actions.pod:4377
27586 msgid "guestfs_lvm_set_filter"
27590 #: ../src/guestfs-actions.pod:4379
27594 " guestfs_lvm_set_filter (guestfs_h *g,\n"
27595 " char *const *devices);\n"
27600 #: ../src/guestfs-actions.pod:4410
27601 msgid "guestfs_lvremove"
27605 #: ../src/guestfs-actions.pod:4412
27609 " guestfs_lvremove (guestfs_h *g,\n"
27610 " const char *device);\n"
27615 #: ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:5817 ../src/guestfs-actions.pod:7667
27616 msgid "(Added in 1.0.13)"
27620 #: ../src/guestfs-actions.pod:4426
27621 msgid "guestfs_lvrename"
27625 #: ../src/guestfs-actions.pod:4428
27629 " guestfs_lvrename (guestfs_h *g,\n"
27630 " const char *logvol,\n"
27631 " const char *newlogvol);\n"
27636 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:7680
27637 msgid "(Added in 1.0.83)"
27641 #: ../src/guestfs-actions.pod:4439
27642 msgid "guestfs_lvresize"
27646 #: ../src/guestfs-actions.pod:4441
27650 " guestfs_lvresize (guestfs_h *g,\n"
27651 " const char *device,\n"
27657 #: ../src/guestfs-actions.pod:4454
27658 msgid "guestfs_lvresize_free"
27662 #: ../src/guestfs-actions.pod:4456
27666 " guestfs_lvresize_free (guestfs_h *g,\n"
27667 " const char *lv,\n"
27673 #: ../src/guestfs-actions.pod:4469
27674 msgid "(Added in 1.3.3)"
27678 #: ../src/guestfs-actions.pod:4471
27679 msgid "guestfs_lvs"
27683 #: ../src/guestfs-actions.pod:4473
27687 " guestfs_lvs (guestfs_h *g);\n"
27692 #: ../src/guestfs-actions.pod:4482
27693 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
27697 #: ../src/guestfs-actions.pod:4490
27698 msgid "guestfs_lvs_full"
27702 #: ../src/guestfs-actions.pod:4492
27705 " struct guestfs_lvm_lv_list *\n"
27706 " guestfs_lvs_full (guestfs_h *g);\n"
27711 #: ../src/guestfs-actions.pod:4498
27713 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
27714 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
27719 #: ../src/guestfs-actions.pod:4504
27720 msgid "guestfs_lvuuid"
27724 #: ../src/guestfs-actions.pod:4506
27728 " guestfs_lvuuid (guestfs_h *g,\n"
27729 " const char *device);\n"
27734 #: ../src/guestfs-actions.pod:4517
27735 msgid "guestfs_lxattrlist"
27739 #: ../src/guestfs-actions.pod:4519
27742 " struct guestfs_xattr_list *\n"
27743 " guestfs_lxattrlist (guestfs_h *g,\n"
27744 " const char *path,\n"
27745 " char *const *names);\n"
27750 #: ../src/guestfs-actions.pod:4538
27752 "This call is intended for programs that want to efficiently list a directory "
27753 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
27754 "a similarly efficient call for getting standard stats. Very long directory "
27755 "listings might cause the protocol message size to be exceeded, causing this "
27756 "call to fail. The caller must split up such requests into smaller groups of "
27761 #: ../src/guestfs-actions.pod:4552
27762 msgid "guestfs_mkdir"
27766 #: ../src/guestfs-actions.pod:4554
27770 " guestfs_mkdir (guestfs_h *g,\n"
27771 " const char *path);\n"
27776 #: ../src/guestfs-actions.pod:4564
27777 msgid "guestfs_mkdir_mode"
27781 #: ../src/guestfs-actions.pod:4566
27785 " guestfs_mkdir_mode (guestfs_h *g,\n"
27786 " const char *path,\n"
27792 #: ../src/guestfs-actions.pod:4578
27793 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
27797 #: ../src/guestfs-actions.pod:4584
27798 msgid "guestfs_mkdir_p"
27802 #: ../src/guestfs-actions.pod:4586
27806 " guestfs_mkdir_p (guestfs_h *g,\n"
27807 " const char *path);\n"
27812 #: ../src/guestfs-actions.pod:4597
27813 msgid "guestfs_mkdtemp"
27817 #: ../src/guestfs-actions.pod:4599
27821 " guestfs_mkdtemp (guestfs_h *g,\n"
27822 " const char *template);\n"
27827 #: ../src/guestfs-actions.pod:4627
27828 msgid "guestfs_mke2fs_J"
27832 #: ../src/guestfs-actions.pod:4629
27836 " guestfs_mke2fs_J (guestfs_h *g,\n"
27837 " const char *fstype,\n"
27838 " int blocksize,\n"
27839 " const char *device,\n"
27840 " const char *journal);\n"
27845 #: ../src/guestfs-actions.pod:4642
27846 msgid "See also C<guestfs_mke2journal>."
27850 #: ../src/guestfs-actions.pod:4646 ../src/guestfs-actions.pod:4664 ../src/guestfs-actions.pod:4682 ../src/guestfs-actions.pod:4698 ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4726 ../src/guestfs-actions.pod:4785 ../src/guestfs-actions.pod:5062
27851 msgid "(Added in 1.0.68)"
27855 #: ../src/guestfs-actions.pod:4648
27856 msgid "guestfs_mke2fs_JL"
27860 #: ../src/guestfs-actions.pod:4650
27864 " guestfs_mke2fs_JL (guestfs_h *g,\n"
27865 " const char *fstype,\n"
27866 " int blocksize,\n"
27867 " const char *device,\n"
27868 " const char *label);\n"
27873 #: ../src/guestfs-actions.pod:4660
27874 msgid "See also C<guestfs_mke2journal_L>."
27878 #: ../src/guestfs-actions.pod:4666
27879 msgid "guestfs_mke2fs_JU"
27883 #: ../src/guestfs-actions.pod:4668
27887 " guestfs_mke2fs_JU (guestfs_h *g,\n"
27888 " const char *fstype,\n"
27889 " int blocksize,\n"
27890 " const char *device,\n"
27891 " const char *uuid);\n"
27896 #: ../src/guestfs-actions.pod:4678
27897 msgid "See also C<guestfs_mke2journal_U>."
27901 #: ../src/guestfs-actions.pod:4684
27902 msgid "guestfs_mke2journal"
27906 #: ../src/guestfs-actions.pod:4686
27910 " guestfs_mke2journal (guestfs_h *g,\n"
27911 " int blocksize,\n"
27912 " const char *device);\n"
27917 #: ../src/guestfs-actions.pod:4700
27918 msgid "guestfs_mke2journal_L"
27922 #: ../src/guestfs-actions.pod:4702
27926 " guestfs_mke2journal_L (guestfs_h *g,\n"
27927 " int blocksize,\n"
27928 " const char *label,\n"
27929 " const char *device);\n"
27934 #: ../src/guestfs-actions.pod:4714
27935 msgid "guestfs_mke2journal_U"
27939 #: ../src/guestfs-actions.pod:4716
27943 " guestfs_mke2journal_U (guestfs_h *g,\n"
27944 " int blocksize,\n"
27945 " const char *uuid,\n"
27946 " const char *device);\n"
27951 #: ../src/guestfs-actions.pod:4728
27952 msgid "guestfs_mkfifo"
27956 #: ../src/guestfs-actions.pod:4730
27960 " guestfs_mkfifo (guestfs_h *g,\n"
27962 " const char *path);\n"
27967 #: ../src/guestfs-actions.pod:4735
27969 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
27970 "is just a convenient wrapper around C<guestfs_mknod>."
27974 #: ../src/guestfs-actions.pod:4745
27975 msgid "guestfs_mkfs"
27979 #: ../src/guestfs-actions.pod:4747
27983 " guestfs_mkfs (guestfs_h *g,\n"
27984 " const char *fstype,\n"
27985 " const char *device);\n"
27990 #: ../src/guestfs-actions.pod:4760
27991 msgid "guestfs_mkfs_b"
27995 #: ../src/guestfs-actions.pod:4762
27999 " guestfs_mkfs_b (guestfs_h *g,\n"
28000 " const char *fstype,\n"
28001 " int blocksize,\n"
28002 " const char *device);\n"
28007 #: ../src/guestfs-actions.pod:4768
28009 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
28014 #: ../src/guestfs-actions.pod:4775
28016 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
28017 "block size of the resulting filesystem. Supported block sizes depend on the "
28018 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28022 #: ../src/guestfs-actions.pod:4787
28023 msgid "guestfs_mkfs_opts"
28027 #: ../src/guestfs-actions.pod:4789
28031 " guestfs_mkfs_opts (guestfs_h *g,\n"
28032 " const char *fstype,\n"
28033 " const char *device,\n"
28039 #: ../src/guestfs-actions.pod:4800
28042 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
28043 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
28044 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
28045 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
28050 #: ../src/guestfs-actions.pod:4848
28051 msgid "(Added in 1.7.19)"
28055 #: ../src/guestfs-actions.pod:4850
28056 msgid "guestfs_mkfs_opts_va"
28060 #: ../src/guestfs-actions.pod:4852
28064 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
28065 " const char *fstype,\n"
28066 " const char *device,\n"
28067 " va_list args);\n"
28072 #: ../src/guestfs-actions.pod:4858
28073 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
28077 #: ../src/guestfs-actions.pod:4862
28078 msgid "guestfs_mkfs_opts_argv"
28082 #: ../src/guestfs-actions.pod:4864
28086 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
28087 " const char *fstype,\n"
28088 " const char *device,\n"
28089 " const struct guestfs_mkfs_opts_argv *optargs);\n"
28094 #: ../src/guestfs-actions.pod:4870
28095 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
28099 #: ../src/guestfs-actions.pod:4874
28100 msgid "guestfs_mkmountpoint"
28104 #: ../src/guestfs-actions.pod:4876
28108 " guestfs_mkmountpoint (guestfs_h *g,\n"
28109 " const char *exemptpath);\n"
28114 #: ../src/guestfs-actions.pod:4880
28116 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
28117 "that can be used to create extra mountpoints before mounting the first "
28122 #: ../src/guestfs-actions.pod:4904
28124 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
28125 "may get unexpected errors if you try to mix these calls. It is safest to "
28126 "manually unmount filesystems and remove mountpoints after use."
28130 #: ../src/guestfs-actions.pod:4908
28132 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
28133 "first, so for this to work for manual mountpoints, you must ensure that the "
28134 "innermost mountpoints have the longest pathnames, as in the example code "
28139 #: ../src/guestfs-actions.pod:4915
28141 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
28142 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
28143 "can also trigger these issues."
28147 #: ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:5227 ../src/guestfs-actions.pod:6237
28148 msgid "(Added in 1.0.62)"
28152 #: ../src/guestfs-actions.pod:4923
28153 msgid "guestfs_mknod"
28157 #: ../src/guestfs-actions.pod:4925
28161 " guestfs_mknod (guestfs_h *g,\n"
28165 " const char *path);\n"
28170 #: ../src/guestfs-actions.pod:4940
28172 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28173 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28174 "regular file). These constants are available in the standard Linux header "
28175 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
28176 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
28177 "the appropriate constant for you."
28181 #: ../src/guestfs-actions.pod:4954
28182 msgid "guestfs_mknod_b"
28186 #: ../src/guestfs-actions.pod:4956
28190 " guestfs_mknod_b (guestfs_h *g,\n"
28194 " const char *path);\n"
28199 #: ../src/guestfs-actions.pod:4963
28201 "This call creates a block device node called C<path> with mode C<mode> and "
28202 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28203 "wrapper around C<guestfs_mknod>."
28207 #: ../src/guestfs-actions.pod:4973
28208 msgid "guestfs_mknod_c"
28212 #: ../src/guestfs-actions.pod:4975
28216 " guestfs_mknod_c (guestfs_h *g,\n"
28220 " const char *path);\n"
28225 #: ../src/guestfs-actions.pod:4982
28227 "This call creates a char device node called C<path> with mode C<mode> and "
28228 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28229 "wrapper around C<guestfs_mknod>."
28233 #: ../src/guestfs-actions.pod:4992
28234 msgid "guestfs_mkswap"
28238 #: ../src/guestfs-actions.pod:4994
28242 " guestfs_mkswap (guestfs_h *g,\n"
28243 " const char *device);\n"
28248 #: ../src/guestfs-actions.pod:5004
28249 msgid "guestfs_mkswap_L"
28253 #: ../src/guestfs-actions.pod:5006
28257 " guestfs_mkswap_L (guestfs_h *g,\n"
28258 " const char *label,\n"
28259 " const char *device);\n"
28264 #: ../src/guestfs-actions.pod:5021
28265 msgid "guestfs_mkswap_U"
28269 #: ../src/guestfs-actions.pod:5023
28273 " guestfs_mkswap_U (guestfs_h *g,\n"
28274 " const char *uuid,\n"
28275 " const char *device);\n"
28280 #: ../src/guestfs-actions.pod:5034
28281 msgid "guestfs_mkswap_file"
28285 #: ../src/guestfs-actions.pod:5036
28289 " guestfs_mkswap_file (guestfs_h *g,\n"
28290 " const char *path);\n"
28295 #: ../src/guestfs-actions.pod:5042
28297 "This command just writes a swap file signature to an existing file. To "
28298 "create the file itself, use something like C<guestfs_fallocate>."
28302 #: ../src/guestfs-actions.pod:5049
28303 msgid "guestfs_modprobe"
28307 #: ../src/guestfs-actions.pod:5051
28311 " guestfs_modprobe (guestfs_h *g,\n"
28312 " const char *modulename);\n"
28317 #: ../src/guestfs-actions.pod:5064
28318 msgid "guestfs_mount"
28322 #: ../src/guestfs-actions.pod:5066
28326 " guestfs_mount (guestfs_h *g,\n"
28327 " const char *device,\n"
28328 " const char *mountpoint);\n"
28333 #: ../src/guestfs-actions.pod:5085
28335 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
28336 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
28337 "problems for users. If your program might need to work with older versions "
28338 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
28339 "for the first parameter if you don't want any options)."
28343 #: ../src/guestfs-actions.pod:5096
28344 msgid "guestfs_mount_9p"
28348 #: ../src/guestfs-actions.pod:5098
28352 " guestfs_mount_9p (guestfs_h *g,\n"
28353 " const char *mounttag,\n"
28354 " const char *mountpoint,\n"
28360 #: ../src/guestfs-actions.pod:5109
28363 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
28368 #: ../src/guestfs-actions.pod:5122
28369 msgid "guestfs_mount_9p_va"
28373 #: ../src/guestfs-actions.pod:5124
28377 " guestfs_mount_9p_va (guestfs_h *g,\n"
28378 " const char *mounttag,\n"
28379 " const char *mountpoint,\n"
28380 " va_list args);\n"
28385 #: ../src/guestfs-actions.pod:5130
28386 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
28390 #: ../src/guestfs-actions.pod:5134
28391 msgid "guestfs_mount_9p_argv"
28395 #: ../src/guestfs-actions.pod:5136
28399 " guestfs_mount_9p_argv (guestfs_h *g,\n"
28400 " const char *mounttag,\n"
28401 " const char *mountpoint,\n"
28402 " const struct guestfs_mount_9p_argv *optargs);\n"
28407 #: ../src/guestfs-actions.pod:5142
28408 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
28412 #: ../src/guestfs-actions.pod:5146
28413 msgid "guestfs_mount_loop"
28417 #: ../src/guestfs-actions.pod:5148
28421 " guestfs_mount_loop (guestfs_h *g,\n"
28422 " const char *file,\n"
28423 " const char *mountpoint);\n"
28428 #: ../src/guestfs-actions.pod:5161
28429 msgid "guestfs_mount_options"
28433 #: ../src/guestfs-actions.pod:5163
28437 " guestfs_mount_options (guestfs_h *g,\n"
28438 " const char *options,\n"
28439 " const char *device,\n"
28440 " const char *mountpoint);\n"
28445 #: ../src/guestfs-actions.pod:5169
28447 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28448 "the mount options as for the L<mount(8)> I<-o> flag."
28452 #: ../src/guestfs-actions.pod:5179 ../src/guestfs-actions.pod:5193 ../src/guestfs-actions.pod:5210
28453 msgid "(Added in 1.0.10)"
28457 #: ../src/guestfs-actions.pod:5181
28458 msgid "guestfs_mount_ro"
28462 #: ../src/guestfs-actions.pod:5183
28466 " guestfs_mount_ro (guestfs_h *g,\n"
28467 " const char *device,\n"
28468 " const char *mountpoint);\n"
28473 #: ../src/guestfs-actions.pod:5188
28475 "This is the same as the C<guestfs_mount> command, but it mounts the "
28476 "filesystem with the read-only (I<-o ro>) flag."
28480 #: ../src/guestfs-actions.pod:5195
28481 msgid "guestfs_mount_vfs"
28485 #: ../src/guestfs-actions.pod:5197
28489 " guestfs_mount_vfs (guestfs_h *g,\n"
28490 " const char *options,\n"
28491 " const char *vfstype,\n"
28492 " const char *device,\n"
28493 " const char *mountpoint);\n"
28498 #: ../src/guestfs-actions.pod:5204
28500 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28501 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
28506 #: ../src/guestfs-actions.pod:5212
28507 msgid "guestfs_mountpoints"
28511 #: ../src/guestfs-actions.pod:5214
28515 " guestfs_mountpoints (guestfs_h *g);\n"
28520 #: ../src/guestfs-actions.pod:5217
28522 "This call is similar to C<guestfs_mounts>. That call returns a list of "
28523 "devices. This one returns a hash table (map) of device name to directory "
28524 "where the device is mounted."
28528 #: ../src/guestfs-actions.pod:5229
28529 msgid "guestfs_mounts"
28533 #: ../src/guestfs-actions.pod:5231
28537 " guestfs_mounts (guestfs_h *g);\n"
28542 #: ../src/guestfs-actions.pod:5239
28543 msgid "See also: C<guestfs_mountpoints>"
28547 #: ../src/guestfs-actions.pod:5247
28552 #: ../src/guestfs-actions.pod:5249
28556 " guestfs_mv (guestfs_h *g,\n"
28557 " const char *src,\n"
28558 " const char *dest);\n"
28563 #: ../src/guestfs-actions.pod:5261
28564 msgid "guestfs_ntfs_3g_probe"
28568 #: ../src/guestfs-actions.pod:5263
28572 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
28574 " const char *device);\n"
28579 #: ../src/guestfs-actions.pod:5282
28580 msgid "(Added in 1.0.43)"
28584 #: ../src/guestfs-actions.pod:5284
28585 msgid "guestfs_ntfsresize"
28589 #: ../src/guestfs-actions.pod:5286
28593 " guestfs_ntfsresize (guestfs_h *g,\n"
28594 " const char *device);\n"
28599 #: ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5390
28601 "I<This function is deprecated.> In new code, use the "
28602 "L</guestfs_ntfsresize_opts> call instead."
28606 #: ../src/guestfs-actions.pod:5314
28607 msgid "guestfs_ntfsresize_opts"
28611 #: ../src/guestfs-actions.pod:5316
28615 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
28616 " const char *device,\n"
28622 #: ../src/guestfs-actions.pod:5326
28625 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
28626 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
28631 #: ../src/guestfs-actions.pod:5346
28633 "After the resize operation, the filesystem is always marked as requiring a "
28634 "consistency check (for safety). You have to boot into Windows to perform "
28635 "this check and clear this condition. If you I<don't> set the C<force> "
28636 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
28637 "times on a single filesystem without booting into Windows between each "
28642 #: ../src/guestfs-actions.pod:5361
28643 msgid "guestfs_ntfsresize_opts_va"
28647 #: ../src/guestfs-actions.pod:5363
28651 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
28652 " const char *device,\n"
28653 " va_list args);\n"
28658 #: ../src/guestfs-actions.pod:5368
28659 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
28663 #: ../src/guestfs-actions.pod:5372
28664 msgid "guestfs_ntfsresize_opts_argv"
28668 #: ../src/guestfs-actions.pod:5374
28672 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
28673 " const char *device,\n"
28674 " const struct guestfs_ntfsresize_opts_argv "
28680 #: ../src/guestfs-actions.pod:5379
28681 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
28685 #: ../src/guestfs-actions.pod:5383
28686 msgid "guestfs_ntfsresize_size"
28690 #: ../src/guestfs-actions.pod:5385
28694 " guestfs_ntfsresize_size (guestfs_h *g,\n"
28695 " const char *device,\n"
28696 " int64_t size);\n"
28701 #: ../src/guestfs-actions.pod:5397
28703 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
28704 "to specify the new size (in bytes) explicitly."
28708 #: ../src/guestfs-actions.pod:5402 ../src/guestfs-actions.pod:5844 ../src/guestfs-actions.pod:5917 ../src/guestfs-actions.pod:6185 ../src/guestfs-actions.pod:7824
28709 msgid "(Added in 1.3.14)"
28713 #: ../src/guestfs-actions.pod:5404
28714 msgid "guestfs_part_add"
28718 #: ../src/guestfs-actions.pod:5406
28722 " guestfs_part_add (guestfs_h *g,\n"
28723 " const char *device,\n"
28724 " const char *prlogex,\n"
28725 " int64_t startsect,\n"
28726 " int64_t endsect);\n"
28731 #: ../src/guestfs-actions.pod:5413
28733 "This command adds a partition to C<device>. If there is no partition table "
28734 "on the device, call C<guestfs_part_init> first."
28738 #: ../src/guestfs-actions.pod:5425
28740 "Creating a partition which covers the whole disk is not so easy. Use "
28741 "C<guestfs_part_disk> to do that."
28745 #: ../src/guestfs-actions.pod:5430 ../src/guestfs-actions.pod:5468 ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5605 ../src/guestfs-actions.pod:5643 ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5702
28746 msgid "(Added in 1.0.78)"
28750 #: ../src/guestfs-actions.pod:5432
28751 msgid "guestfs_part_del"
28755 #: ../src/guestfs-actions.pod:5434
28759 " guestfs_part_del (guestfs_h *g,\n"
28760 " const char *device,\n"
28766 #: ../src/guestfs-actions.pod:5449
28767 msgid "guestfs_part_disk"
28771 #: ../src/guestfs-actions.pod:5451
28775 " guestfs_part_disk (guestfs_h *g,\n"
28776 " const char *device,\n"
28777 " const char *parttype);\n"
28782 #: ../src/guestfs-actions.pod:5456
28784 "This command is simply a combination of C<guestfs_part_init> followed by "
28785 "C<guestfs_part_add> to create a single primary partition covering the whole "
28790 #: ../src/guestfs-actions.pod:5460
28792 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
28793 "possible values are described in C<guestfs_part_init>."
28797 #: ../src/guestfs-actions.pod:5470
28798 msgid "guestfs_part_get_bootable"
28802 #: ../src/guestfs-actions.pod:5472
28806 " guestfs_part_get_bootable (guestfs_h *g,\n"
28807 " const char *device,\n"
28813 #: ../src/guestfs-actions.pod:5480
28814 msgid "See also C<guestfs_part_set_bootable>."
28818 #: ../src/guestfs-actions.pod:5486
28819 msgid "guestfs_part_get_mbr_id"
28823 #: ../src/guestfs-actions.pod:5488
28827 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
28828 " const char *device,\n"
28834 #: ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5678
28836 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
28837 "undefined results for other partition table types (see "
28838 "C<guestfs_part_get_parttype>)."
28842 #: ../src/guestfs-actions.pod:5504
28843 msgid "guestfs_part_get_parttype"
28847 #: ../src/guestfs-actions.pod:5506
28851 " guestfs_part_get_parttype (guestfs_h *g,\n"
28852 " const char *device);\n"
28857 #: ../src/guestfs-actions.pod:5513
28859 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
28860 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
28861 "possible, although unusual. See C<guestfs_part_init> for a full list."
28865 #: ../src/guestfs-actions.pod:5523
28866 msgid "guestfs_part_init"
28870 #: ../src/guestfs-actions.pod:5525
28874 " guestfs_part_init (guestfs_h *g,\n"
28875 " const char *device,\n"
28876 " const char *parttype);\n"
28881 #: ../src/guestfs-actions.pod:5534
28883 "Initially there are no partitions. Following this, you should call "
28884 "C<guestfs_part_add> for each partition required."
28888 #: ../src/guestfs-actions.pod:5607
28889 msgid "guestfs_part_list"
28893 #: ../src/guestfs-actions.pod:5609
28896 " struct guestfs_partition_list *\n"
28897 " guestfs_part_list (guestfs_h *g,\n"
28898 " const char *device);\n"
28903 #: ../src/guestfs-actions.pod:5626
28905 "Start of the partition I<in bytes>. To get sectors you have to divide by "
28906 "the device's sector size, see C<guestfs_blockdev_getss>."
28910 #: ../src/guestfs-actions.pod:5639
28912 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
28913 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
28918 #: ../src/guestfs-actions.pod:5645
28919 msgid "guestfs_part_set_bootable"
28923 #: ../src/guestfs-actions.pod:5647
28927 " guestfs_part_set_bootable (guestfs_h *g,\n"
28928 " const char *device,\n"
28930 " int bootable);\n"
28935 #: ../src/guestfs-actions.pod:5664
28936 msgid "guestfs_part_set_mbr_id"
28940 #: ../src/guestfs-actions.pod:5666
28944 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
28945 " const char *device,\n"
28952 #: ../src/guestfs-actions.pod:5686
28953 msgid "guestfs_part_set_name"
28957 #: ../src/guestfs-actions.pod:5688
28961 " guestfs_part_set_name (guestfs_h *g,\n"
28962 " const char *device,\n"
28964 " const char *name);\n"
28969 #: ../src/guestfs-actions.pod:5704
28970 msgid "guestfs_part_to_dev"
28974 #: ../src/guestfs-actions.pod:5706
28978 " guestfs_part_to_dev (guestfs_h *g,\n"
28979 " const char *partition);\n"
28984 #: ../src/guestfs-actions.pod:5714
28986 "The named partition must exist, for example as a string returned from "
28987 "C<guestfs_list_partitions>."
28991 #: ../src/guestfs-actions.pod:5722
28992 msgid "guestfs_ping_daemon"
28996 #: ../src/guestfs-actions.pod:5724
29000 " guestfs_ping_daemon (guestfs_h *g);\n"
29005 #: ../src/guestfs-actions.pod:5736
29006 msgid "guestfs_pread"
29010 #: ../src/guestfs-actions.pod:5738
29014 " guestfs_pread (guestfs_h *g,\n"
29015 " const char *path,\n"
29017 " int64_t offset,\n"
29018 " size_t *size_r);\n"
29023 #: ../src/guestfs-actions.pod:5751
29024 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
29028 #: ../src/guestfs-actions.pod:5762
29029 msgid "guestfs_pread_device"
29033 #: ../src/guestfs-actions.pod:5764
29037 " guestfs_pread_device (guestfs_h *g,\n"
29038 " const char *device,\n"
29040 " int64_t offset,\n"
29041 " size_t *size_r);\n"
29046 #: ../src/guestfs-actions.pod:5777
29047 msgid "See also C<guestfs_pread>."
29051 #: ../src/guestfs-actions.pod:5786
29052 msgid "(Added in 1.5.21)"
29056 #: ../src/guestfs-actions.pod:5788
29057 msgid "guestfs_pvcreate"
29061 #: ../src/guestfs-actions.pod:5790
29065 " guestfs_pvcreate (guestfs_h *g,\n"
29066 " const char *device);\n"
29071 #: ../src/guestfs-actions.pod:5802
29072 msgid "guestfs_pvremove"
29076 #: ../src/guestfs-actions.pod:5804
29080 " guestfs_pvremove (guestfs_h *g,\n"
29081 " const char *device);\n"
29086 #: ../src/guestfs-actions.pod:5819
29087 msgid "guestfs_pvresize"
29091 #: ../src/guestfs-actions.pod:5821
29095 " guestfs_pvresize (guestfs_h *g,\n"
29096 " const char *device);\n"
29101 #: ../src/guestfs-actions.pod:5832
29102 msgid "guestfs_pvresize_size"
29106 #: ../src/guestfs-actions.pod:5834
29110 " guestfs_pvresize_size (guestfs_h *g,\n"
29111 " const char *device,\n"
29112 " int64_t size);\n"
29117 #: ../src/guestfs-actions.pod:5839
29119 "This command is the same as C<guestfs_pvresize> except that it allows you to "
29120 "specify the new size (in bytes) explicitly."
29124 #: ../src/guestfs-actions.pod:5846
29125 msgid "guestfs_pvs"
29129 #: ../src/guestfs-actions.pod:5848
29133 " guestfs_pvs (guestfs_h *g);\n"
29138 #: ../src/guestfs-actions.pod:5857
29139 msgid "See also C<guestfs_pvs_full>."
29143 #: ../src/guestfs-actions.pod:5865
29144 msgid "guestfs_pvs_full"
29148 #: ../src/guestfs-actions.pod:5867
29151 " struct guestfs_lvm_pv_list *\n"
29152 " guestfs_pvs_full (guestfs_h *g);\n"
29157 #: ../src/guestfs-actions.pod:5873
29159 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
29160 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
29165 #: ../src/guestfs-actions.pod:5879
29166 msgid "guestfs_pvuuid"
29170 #: ../src/guestfs-actions.pod:5881
29174 " guestfs_pvuuid (guestfs_h *g,\n"
29175 " const char *device);\n"
29180 #: ../src/guestfs-actions.pod:5892
29181 msgid "guestfs_pwrite"
29185 #: ../src/guestfs-actions.pod:5894
29189 " guestfs_pwrite (guestfs_h *g,\n"
29190 " const char *path,\n"
29191 " const char *content,\n"
29192 " size_t content_size,\n"
29193 " int64_t offset);\n"
29198 #: ../src/guestfs-actions.pod:5910
29199 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
29203 #: ../src/guestfs-actions.pod:5919
29204 msgid "guestfs_pwrite_device"
29208 #: ../src/guestfs-actions.pod:5921
29212 " guestfs_pwrite_device (guestfs_h *g,\n"
29213 " const char *device,\n"
29214 " const char *content,\n"
29215 " size_t content_size,\n"
29216 " int64_t offset);\n"
29221 #: ../src/guestfs-actions.pod:5936
29222 msgid "See also C<guestfs_pwrite>."
29226 #: ../src/guestfs-actions.pod:5943
29227 msgid "(Added in 1.5.20)"
29231 #: ../src/guestfs-actions.pod:5945
29232 msgid "guestfs_read_file"
29236 #: ../src/guestfs-actions.pod:5947
29240 " guestfs_read_file (guestfs_h *g,\n"
29241 " const char *path,\n"
29242 " size_t *size_r);\n"
29247 #: ../src/guestfs-actions.pod:5955
29249 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
29250 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
29251 "function is limited in the total size of file that can be handled."
29255 #: ../src/guestfs-actions.pod:5967
29256 msgid "(Added in 1.0.63)"
29260 #: ../src/guestfs-actions.pod:5969
29261 msgid "guestfs_read_lines"
29265 #: ../src/guestfs-actions.pod:5971
29269 " guestfs_read_lines (guestfs_h *g,\n"
29270 " const char *path);\n"
29275 #: ../src/guestfs-actions.pod:5980
29277 "Note that this function cannot correctly handle binary files (specifically, "
29278 "files containing C<\\0> character which is treated as end of line). For "
29279 "those you need to use the C<guestfs_read_file> function which has a more "
29280 "complex interface."
29284 #: ../src/guestfs-actions.pod:5991
29285 msgid "guestfs_readdir"
29289 #: ../src/guestfs-actions.pod:5993
29292 " struct guestfs_dirent_list *\n"
29293 " guestfs_readdir (guestfs_h *g,\n"
29294 " const char *dir);\n"
29299 #: ../src/guestfs-actions.pod:6047
29301 "This function is primarily intended for use by programs. To get a simple "
29302 "list of names, use C<guestfs_ls>. To get a printable directory for human "
29303 "consumption, use C<guestfs_ll>."
29307 #: ../src/guestfs-actions.pod:6051
29309 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
29310 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
29315 #: ../src/guestfs-actions.pod:6057
29316 msgid "guestfs_readlink"
29320 #: ../src/guestfs-actions.pod:6059
29324 " guestfs_readlink (guestfs_h *g,\n"
29325 " const char *path);\n"
29330 #: ../src/guestfs-actions.pod:6070
29331 msgid "guestfs_readlinklist"
29335 #: ../src/guestfs-actions.pod:6072
29339 " guestfs_readlinklist (guestfs_h *g,\n"
29340 " const char *path,\n"
29341 " char *const *names);\n"
29346 #: ../src/guestfs-actions.pod:6105
29347 msgid "guestfs_realpath"
29351 #: ../src/guestfs-actions.pod:6107
29355 " guestfs_realpath (guestfs_h *g,\n"
29356 " const char *path);\n"
29361 #: ../src/guestfs-actions.pod:6119
29362 msgid "guestfs_removexattr"
29366 #: ../src/guestfs-actions.pod:6121
29370 " guestfs_removexattr (guestfs_h *g,\n"
29371 " const char *xattr,\n"
29372 " const char *path);\n"
29377 #: ../src/guestfs-actions.pod:6129
29378 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
29382 #: ../src/guestfs-actions.pod:6135
29383 msgid "guestfs_resize2fs"
29387 #: ../src/guestfs-actions.pod:6137
29391 " guestfs_resize2fs (guestfs_h *g,\n"
29392 " const char *device);\n"
29397 #: ../src/guestfs-actions.pod:6144
29399 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
29400 "C<device> before calling this command. For unknown reasons C<resize2fs> "
29401 "sometimes gives an error about this and sometimes not. In any case, it is "
29402 "always safe to call C<guestfs_e2fsck_f> before calling this function."
29406 #: ../src/guestfs-actions.pod:6154
29407 msgid "guestfs_resize2fs_M"
29411 #: ../src/guestfs-actions.pod:6156
29415 " guestfs_resize2fs_M (guestfs_h *g,\n"
29416 " const char *device);\n"
29421 #: ../src/guestfs-actions.pod:6160
29423 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
29424 "resized to its minimum size. This works like the I<-M> option to the "
29425 "C<resize2fs> command."
29429 #: ../src/guestfs-actions.pod:6164
29431 "To get the resulting size of the filesystem you should call "
29432 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
29433 "These two numbers, multiplied together, give the resulting size of the "
29434 "minimal filesystem in bytes."
29438 #: ../src/guestfs-actions.pod:6173
29439 msgid "guestfs_resize2fs_size"
29443 #: ../src/guestfs-actions.pod:6175
29447 " guestfs_resize2fs_size (guestfs_h *g,\n"
29448 " const char *device,\n"
29449 " int64_t size);\n"
29454 #: ../src/guestfs-actions.pod:6180
29456 "This command is the same as C<guestfs_resize2fs> except that it allows you "
29457 "to specify the new size (in bytes) explicitly."
29461 #: ../src/guestfs-actions.pod:6187
29466 #: ../src/guestfs-actions.pod:6189
29470 " guestfs_rm (guestfs_h *g,\n"
29471 " const char *path);\n"
29476 #: ../src/guestfs-actions.pod:6199
29477 msgid "guestfs_rm_rf"
29481 #: ../src/guestfs-actions.pod:6201
29485 " guestfs_rm_rf (guestfs_h *g,\n"
29486 " const char *path);\n"
29491 #: ../src/guestfs-actions.pod:6213
29492 msgid "guestfs_rmdir"
29496 #: ../src/guestfs-actions.pod:6215
29500 " guestfs_rmdir (guestfs_h *g,\n"
29501 " const char *path);\n"
29506 #: ../src/guestfs-actions.pod:6225
29507 msgid "guestfs_rmmountpoint"
29511 #: ../src/guestfs-actions.pod:6227
29515 " guestfs_rmmountpoint (guestfs_h *g,\n"
29516 " const char *exemptpath);\n"
29521 #: ../src/guestfs-actions.pod:6231
29523 "This calls removes a mountpoint that was previously created with "
29524 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
29528 #: ../src/guestfs-actions.pod:6239
29529 msgid "guestfs_scrub_device"
29533 #: ../src/guestfs-actions.pod:6241
29537 " guestfs_scrub_device (guestfs_h *g,\n"
29538 " const char *device);\n"
29543 #: ../src/guestfs-actions.pod:6256 ../src/guestfs-actions.pod:6274 ../src/guestfs-actions.pod:6293
29544 msgid "(Added in 1.0.52)"
29548 #: ../src/guestfs-actions.pod:6258
29549 msgid "guestfs_scrub_file"
29553 #: ../src/guestfs-actions.pod:6260
29557 " guestfs_scrub_file (guestfs_h *g,\n"
29558 " const char *file);\n"
29563 #: ../src/guestfs-actions.pod:6276
29564 msgid "guestfs_scrub_freespace"
29568 #: ../src/guestfs-actions.pod:6278
29572 " guestfs_scrub_freespace (guestfs_h *g,\n"
29573 " const char *dir);\n"
29578 #: ../src/guestfs-actions.pod:6282
29580 "This command creates the directory C<dir> and then fills it with files until "
29581 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
29582 "and deletes them. The intention is to scrub any free space on the partition "
29583 "containing C<dir>."
29587 #: ../src/guestfs-actions.pod:6295
29588 msgid "guestfs_set_append"
29592 #: ../src/guestfs-actions.pod:6297
29596 " guestfs_set_append (guestfs_h *g,\n"
29597 " const char *append);\n"
29602 #: ../src/guestfs-actions.pod:6314
29603 msgid "guestfs_set_attach_method"
29607 #: ../src/guestfs-actions.pod:6316
29611 " guestfs_set_attach_method (guestfs_h *g,\n"
29612 " const char *attachmethod);\n"
29617 #: ../src/guestfs-actions.pod:6344
29618 msgid "guestfs_set_autosync"
29622 #: ../src/guestfs-actions.pod:6346
29626 " guestfs_set_autosync (guestfs_h *g,\n"
29627 " int autosync);\n"
29632 #: ../src/guestfs-actions.pod:6362
29633 msgid "guestfs_set_direct"
29637 #: ../src/guestfs-actions.pod:6364
29641 " guestfs_set_direct (guestfs_h *g,\n"
29647 #: ../src/guestfs-actions.pod:6372
29649 "One consequence of this is that log messages aren't caught by the library "
29650 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
29655 #: ../src/guestfs-actions.pod:6385
29656 msgid "guestfs_set_e2label"
29660 #: ../src/guestfs-actions.pod:6387
29664 " guestfs_set_e2label (guestfs_h *g,\n"
29665 " const char *device,\n"
29666 " const char *label);\n"
29671 #: ../src/guestfs-actions.pod:6396
29673 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
29674 "the existing label on a filesystem."
29678 #: ../src/guestfs-actions.pod:6403
29679 msgid "guestfs_set_e2uuid"
29683 #: ../src/guestfs-actions.pod:6405
29687 " guestfs_set_e2uuid (guestfs_h *g,\n"
29688 " const char *device,\n"
29689 " const char *uuid);\n"
29694 #: ../src/guestfs-actions.pod:6415
29696 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
29697 "the existing UUID of a filesystem."
29701 #: ../src/guestfs-actions.pod:6422
29702 msgid "guestfs_set_memsize"
29706 #: ../src/guestfs-actions.pod:6424
29710 " guestfs_set_memsize (guestfs_h *g,\n"
29716 #: ../src/guestfs-actions.pod:6428
29718 "This sets the memory size in megabytes allocated to the qemu subprocess. "
29719 "This only has any effect if called before C<guestfs_launch>."
29723 #: ../src/guestfs-actions.pod:6443
29724 msgid "guestfs_set_network"
29728 #: ../src/guestfs-actions.pod:6445
29732 " guestfs_set_network (guestfs_h *g,\n"
29738 #: ../src/guestfs-actions.pod:6455
29740 "You must call this before calling C<guestfs_launch>, otherwise it has no "
29745 #: ../src/guestfs-actions.pod:6462
29746 msgid "guestfs_set_path"
29750 #: ../src/guestfs-actions.pod:6464
29754 " guestfs_set_path (guestfs_h *g,\n"
29755 " const char *searchpath);\n"
29760 #: ../src/guestfs-actions.pod:6479
29761 msgid "guestfs_set_pgroup"
29765 #: ../src/guestfs-actions.pod:6481
29769 " guestfs_set_pgroup (guestfs_h *g,\n"
29775 #: ../src/guestfs-actions.pod:6498
29776 msgid "guestfs_set_qemu"
29780 #: ../src/guestfs-actions.pod:6500
29784 " guestfs_set_qemu (guestfs_h *g,\n"
29785 " const char *qemu);\n"
29790 #: ../src/guestfs-actions.pod:6526
29791 msgid "guestfs_set_recovery_proc"
29795 #: ../src/guestfs-actions.pod:6528
29799 " guestfs_set_recovery_proc (guestfs_h *g,\n"
29800 " int recoveryproc);\n"
29805 #: ../src/guestfs-actions.pod:6532
29807 "If this is called with the parameter C<false> then C<guestfs_launch> does "
29808 "not create a recovery process. The purpose of the recovery process is to "
29809 "stop runaway qemu processes in the case where the main program aborts "
29814 #: ../src/guestfs-actions.pod:6537
29816 "This only has any effect if called before C<guestfs_launch>, and the default "
29821 #: ../src/guestfs-actions.pod:6550
29822 msgid "guestfs_set_selinux"
29826 #: ../src/guestfs-actions.pod:6552
29830 " guestfs_set_selinux (guestfs_h *g,\n"
29836 #: ../src/guestfs-actions.pod:6569
29837 msgid "guestfs_set_smp"
29841 #: ../src/guestfs-actions.pod:6571
29845 " guestfs_set_smp (guestfs_h *g,\n"
29851 #: ../src/guestfs-actions.pod:6579
29852 msgid "This function must be called before C<guestfs_launch>."
29856 #: ../src/guestfs-actions.pod:6585
29857 msgid "guestfs_set_trace"
29861 #: ../src/guestfs-actions.pod:6587
29865 " guestfs_set_trace (guestfs_h *g,\n"
29871 #: ../src/guestfs-actions.pod:6601
29873 "Trace messages are normally sent to C<stderr>, unless you register a "
29874 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
29878 #: ../src/guestfs-actions.pod:6609
29879 msgid "guestfs_set_verbose"
29883 #: ../src/guestfs-actions.pod:6611
29887 " guestfs_set_verbose (guestfs_h *g,\n"
29893 #: ../src/guestfs-actions.pod:6620
29895 "Verbose messages are normally sent to C<stderr>, unless you register a "
29896 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
29900 #: ../src/guestfs-actions.pod:6628
29901 msgid "guestfs_setcon"
29905 #: ../src/guestfs-actions.pod:6630
29909 " guestfs_setcon (guestfs_h *g,\n"
29910 " const char *context);\n"
29915 #: ../src/guestfs-actions.pod:6643
29916 msgid "guestfs_setxattr"
29920 #: ../src/guestfs-actions.pod:6645
29924 " guestfs_setxattr (guestfs_h *g,\n"
29925 " const char *xattr,\n"
29926 " const char *val,\n"
29928 " const char *path);\n"
29933 #: ../src/guestfs-actions.pod:6656
29934 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
29938 #: ../src/guestfs-actions.pod:6662
29939 msgid "guestfs_sfdisk"
29943 #: ../src/guestfs-actions.pod:6664
29947 " guestfs_sfdisk (guestfs_h *g,\n"
29948 " const char *device,\n"
29952 " char *const *lines);\n"
29957 #: ../src/guestfs-actions.pod:6672 ../src/guestfs-actions.pod:6716 ../src/guestfs-actions.pod:6750
29959 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
29964 #: ../src/guestfs-actions.pod:6699
29965 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
29969 #: ../src/guestfs-actions.pod:6709
29970 msgid "guestfs_sfdiskM"
29974 #: ../src/guestfs-actions.pod:6711
29978 " guestfs_sfdiskM (guestfs_h *g,\n"
29979 " const char *device,\n"
29980 " char *const *lines);\n"
29985 #: ../src/guestfs-actions.pod:6723
29987 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
29988 "partition sizes are specified in megabytes only (rounded to the nearest "
29989 "cylinder) and you don't need to specify the cyls, heads and sectors "
29990 "parameters which were rarely if ever used anyway."
29994 #: ../src/guestfs-actions.pod:6729
29996 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
29997 "C<guestfs_part_disk>"
30001 #: ../src/guestfs-actions.pod:6739
30002 msgid "guestfs_sfdisk_N"
30006 #: ../src/guestfs-actions.pod:6741
30010 " guestfs_sfdisk_N (guestfs_h *g,\n"
30011 " const char *device,\n"
30016 " const char *line);\n"
30021 #: ../src/guestfs-actions.pod:6760
30023 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
30024 "for the cyls/heads/sectors parameters."
30028 #: ../src/guestfs-actions.pod:6763
30029 msgid "See also: C<guestfs_part_add>"
30033 #: ../src/guestfs-actions.pod:6772
30034 msgid "guestfs_sfdisk_disk_geometry"
30038 #: ../src/guestfs-actions.pod:6774
30042 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
30043 " const char *device);\n"
30048 #: ../src/guestfs-actions.pod:6778
30050 "This displays the disk geometry of C<device> read from the partition table. "
30051 "Especially in the case where the underlying block device has been resized, "
30052 "this can be different from the kernel's idea of the geometry (see "
30053 "C<guestfs_sfdisk_kernel_geometry>)."
30057 #: ../src/guestfs-actions.pod:6791
30058 msgid "guestfs_sfdisk_kernel_geometry"
30062 #: ../src/guestfs-actions.pod:6793
30066 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
30067 " const char *device);\n"
30072 #: ../src/guestfs-actions.pod:6807
30073 msgid "guestfs_sfdisk_l"
30077 #: ../src/guestfs-actions.pod:6809
30081 " guestfs_sfdisk_l (guestfs_h *g,\n"
30082 " const char *device);\n"
30087 #: ../src/guestfs-actions.pod:6813
30089 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
30094 #: ../src/guestfs-actions.pod:6824
30095 msgid "See also: C<guestfs_part_list>"
30099 #: ../src/guestfs-actions.pod:6831
30104 #: ../src/guestfs-actions.pod:6833
30108 " guestfs_sh (guestfs_h *g,\n"
30109 " const char *command);\n"
30114 #: ../src/guestfs-actions.pod:6840
30115 msgid "This is like C<guestfs_command>, but passes the command to:"
30119 #: ../src/guestfs-actions.pod:6848
30120 msgid "All the provisos about C<guestfs_command> apply to this call."
30124 #: ../src/guestfs-actions.pod:6855
30125 msgid "guestfs_sh_lines"
30129 #: ../src/guestfs-actions.pod:6857
30133 " guestfs_sh_lines (guestfs_h *g,\n"
30134 " const char *command);\n"
30139 #: ../src/guestfs-actions.pod:6861
30141 "This is the same as C<guestfs_sh>, but splits the result into a list of "
30146 #: ../src/guestfs-actions.pod:6864
30147 msgid "See also: C<guestfs_command_lines>"
30151 #: ../src/guestfs-actions.pod:6872
30152 msgid "guestfs_sleep"
30156 #: ../src/guestfs-actions.pod:6874
30160 " guestfs_sleep (guestfs_h *g,\n"
30166 #: ../src/guestfs-actions.pod:6882
30167 msgid "(Added in 1.0.41)"
30171 #: ../src/guestfs-actions.pod:6884 ../src/guestfs-structs.pod:109
30172 msgid "guestfs_stat"
30176 #: ../src/guestfs-actions.pod:6886
30179 " struct guestfs_stat *\n"
30180 " guestfs_stat (guestfs_h *g,\n"
30181 " const char *path);\n"
30186 #: ../src/guestfs-actions.pod:6900 ../src/guestfs-structs.pod:135
30187 msgid "guestfs_statvfs"
30191 #: ../src/guestfs-actions.pod:6902
30194 " struct guestfs_statvfs *\n"
30195 " guestfs_statvfs (guestfs_h *g,\n"
30196 " const char *path);\n"
30201 #: ../src/guestfs-actions.pod:6912
30203 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
30204 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
30208 #: ../src/guestfs-actions.pod:6918
30209 msgid "guestfs_strings"
30213 #: ../src/guestfs-actions.pod:6920
30217 " guestfs_strings (guestfs_h *g,\n"
30218 " const char *path);\n"
30223 #: ../src/guestfs-actions.pod:6936
30224 msgid "guestfs_strings_e"
30228 #: ../src/guestfs-actions.pod:6938
30232 " guestfs_strings_e (guestfs_h *g,\n"
30233 " const char *encoding,\n"
30234 " const char *path);\n"
30239 #: ../src/guestfs-actions.pod:6943
30241 "This is like the C<guestfs_strings> command, but allows you to specify the "
30242 "encoding of strings that are looked for in the source file C<path>."
30246 #: ../src/guestfs-actions.pod:6953
30248 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30249 "ISO-8859-X (this is what C<guestfs_strings> uses)."
30253 #: ../src/guestfs-actions.pod:6991
30254 msgid "guestfs_swapoff_device"
30258 #: ../src/guestfs-actions.pod:6993
30262 " guestfs_swapoff_device (guestfs_h *g,\n"
30263 " const char *device);\n"
30268 #: ../src/guestfs-actions.pod:6997
30270 "This command disables the libguestfs appliance swap device or partition "
30271 "named C<device>. See C<guestfs_swapon_device>."
30275 #: ../src/guestfs-actions.pod:7005
30276 msgid "guestfs_swapoff_file"
30280 #: ../src/guestfs-actions.pod:7007
30284 " guestfs_swapoff_file (guestfs_h *g,\n"
30285 " const char *file);\n"
30290 #: ../src/guestfs-actions.pod:7017
30291 msgid "guestfs_swapoff_label"
30295 #: ../src/guestfs-actions.pod:7019
30299 " guestfs_swapoff_label (guestfs_h *g,\n"
30300 " const char *label);\n"
30305 #: ../src/guestfs-actions.pod:7030
30306 msgid "guestfs_swapoff_uuid"
30310 #: ../src/guestfs-actions.pod:7032
30314 " guestfs_swapoff_uuid (guestfs_h *g,\n"
30315 " const char *uuid);\n"
30320 #: ../src/guestfs-actions.pod:7043
30321 msgid "guestfs_swapon_device"
30325 #: ../src/guestfs-actions.pod:7045
30329 " guestfs_swapon_device (guestfs_h *g,\n"
30330 " const char *device);\n"
30335 #: ../src/guestfs-actions.pod:7049
30337 "This command enables the libguestfs appliance to use the swap device or "
30338 "partition named C<device>. The increased memory is made available for all "
30339 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
30343 #: ../src/guestfs-actions.pod:7065
30344 msgid "guestfs_swapon_file"
30348 #: ../src/guestfs-actions.pod:7067
30352 " guestfs_swapon_file (guestfs_h *g,\n"
30353 " const char *file);\n"
30358 #: ../src/guestfs-actions.pod:7071
30360 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
30365 #: ../src/guestfs-actions.pod:7078
30366 msgid "guestfs_swapon_label"
30370 #: ../src/guestfs-actions.pod:7080
30374 " guestfs_swapon_label (guestfs_h *g,\n"
30375 " const char *label);\n"
30380 #: ../src/guestfs-actions.pod:7084
30382 "This command enables swap to a labeled swap partition. See "
30383 "C<guestfs_swapon_device> for other notes."
30387 #: ../src/guestfs-actions.pod:7091
30388 msgid "guestfs_swapon_uuid"
30392 #: ../src/guestfs-actions.pod:7093
30396 " guestfs_swapon_uuid (guestfs_h *g,\n"
30397 " const char *uuid);\n"
30402 #: ../src/guestfs-actions.pod:7097
30404 "This command enables swap to a swap partition with the given UUID. See "
30405 "C<guestfs_swapon_device> for other notes."
30409 #: ../src/guestfs-actions.pod:7104
30410 msgid "guestfs_sync"
30414 #: ../src/guestfs-actions.pod:7106
30418 " guestfs_sync (guestfs_h *g);\n"
30423 #: ../src/guestfs-actions.pod:7119
30424 msgid "guestfs_tail"
30428 #: ../src/guestfs-actions.pod:7121
30432 " guestfs_tail (guestfs_h *g,\n"
30433 " const char *path);\n"
30438 #: ../src/guestfs-actions.pod:7137
30439 msgid "guestfs_tail_n"
30443 #: ../src/guestfs-actions.pod:7139
30447 " guestfs_tail_n (guestfs_h *g,\n"
30449 " const char *path);\n"
30454 #: ../src/guestfs-actions.pod:7161
30455 msgid "guestfs_tar_in"
30459 #: ../src/guestfs-actions.pod:7163
30463 " guestfs_tar_in (guestfs_h *g,\n"
30464 " const char *tarfile,\n"
30465 " const char *directory);\n"
30470 #: ../src/guestfs-actions.pod:7171
30471 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
30475 #: ../src/guestfs-actions.pod:7176 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7209 ../src/guestfs-actions.pod:7225
30476 msgid "(Added in 1.0.3)"
30480 #: ../src/guestfs-actions.pod:7178
30481 msgid "guestfs_tar_out"
30485 #: ../src/guestfs-actions.pod:7180
30489 " guestfs_tar_out (guestfs_h *g,\n"
30490 " const char *directory,\n"
30491 " const char *tarfile);\n"
30496 #: ../src/guestfs-actions.pod:7188
30498 "To download a compressed tarball, use C<guestfs_tgz_out> or "
30499 "C<guestfs_txz_out>."
30503 #: ../src/guestfs-actions.pod:7195
30504 msgid "guestfs_tgz_in"
30508 #: ../src/guestfs-actions.pod:7197
30512 " guestfs_tgz_in (guestfs_h *g,\n"
30513 " const char *tarball,\n"
30514 " const char *directory);\n"
30519 #: ../src/guestfs-actions.pod:7205
30520 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
30524 #: ../src/guestfs-actions.pod:7211
30525 msgid "guestfs_tgz_out"
30529 #: ../src/guestfs-actions.pod:7213
30533 " guestfs_tgz_out (guestfs_h *g,\n"
30534 " const char *directory,\n"
30535 " const char *tarball);\n"
30540 #: ../src/guestfs-actions.pod:7221
30541 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
30545 #: ../src/guestfs-actions.pod:7227
30546 msgid "guestfs_touch"
30550 #: ../src/guestfs-actions.pod:7229
30554 " guestfs_touch (guestfs_h *g,\n"
30555 " const char *path);\n"
30560 #: ../src/guestfs-actions.pod:7244
30561 msgid "guestfs_truncate"
30565 #: ../src/guestfs-actions.pod:7246
30569 " guestfs_truncate (guestfs_h *g,\n"
30570 " const char *path);\n"
30575 #: ../src/guestfs-actions.pod:7257
30576 msgid "guestfs_truncate_size"
30580 #: ../src/guestfs-actions.pod:7259
30584 " guestfs_truncate_size (guestfs_h *g,\n"
30585 " const char *path,\n"
30586 " int64_t size);\n"
30591 #: ../src/guestfs-actions.pod:7267
30593 "If the current file size is less than C<size> then the file is extended to "
30594 "the required size with zero bytes. This creates a sparse file (ie. disk "
30595 "blocks are not allocated for the file until you write to it). To create a "
30596 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
30600 #: ../src/guestfs-actions.pod:7277
30601 msgid "guestfs_tune2fs_l"
30605 #: ../src/guestfs-actions.pod:7279
30609 " guestfs_tune2fs_l (guestfs_h *g,\n"
30610 " const char *device);\n"
30615 #: ../src/guestfs-actions.pod:7299
30616 msgid "guestfs_txz_in"
30620 #: ../src/guestfs-actions.pod:7301
30624 " guestfs_txz_in (guestfs_h *g,\n"
30625 " const char *tarball,\n"
30626 " const char *directory);\n"
30631 #: ../src/guestfs-actions.pod:7313
30632 msgid "guestfs_txz_out"
30636 #: ../src/guestfs-actions.pod:7315
30640 " guestfs_txz_out (guestfs_h *g,\n"
30641 " const char *directory,\n"
30642 " const char *tarball);\n"
30647 #: ../src/guestfs-actions.pod:7327
30648 msgid "guestfs_umask"
30652 #: ../src/guestfs-actions.pod:7329
30656 " guestfs_umask (guestfs_h *g,\n"
30662 #: ../src/guestfs-actions.pod:7345
30664 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
30665 "C<guestfs_mkdir>."
30669 #: ../src/guestfs-actions.pod:7354
30670 msgid "guestfs_umount"
30674 #: ../src/guestfs-actions.pod:7356
30678 " guestfs_umount (guestfs_h *g,\n"
30679 " const char *pathordevice);\n"
30684 #: ../src/guestfs-actions.pod:7368
30685 msgid "guestfs_umount_all"
30689 #: ../src/guestfs-actions.pod:7370
30693 " guestfs_umount_all (guestfs_h *g);\n"
30698 #: ../src/guestfs-actions.pod:7381
30699 msgid "guestfs_upload"
30703 #: ../src/guestfs-actions.pod:7383
30707 " guestfs_upload (guestfs_h *g,\n"
30708 " const char *filename,\n"
30709 " const char *remotefilename);\n"
30714 #: ../src/guestfs-actions.pod:7393
30715 msgid "See also C<guestfs_download>."
30719 #: ../src/guestfs-actions.pod:7404
30720 msgid "guestfs_upload_offset"
30724 #: ../src/guestfs-actions.pod:7406
30728 " guestfs_upload_offset (guestfs_h *g,\n"
30729 " const char *filename,\n"
30730 " const char *remotefilename,\n"
30731 " int64_t offset);\n"
30736 #: ../src/guestfs-actions.pod:7422
30738 "Note that there is no limit on the amount of data that can be uploaded with "
30739 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
30740 "full amount unless an error occurs."
30744 #: ../src/guestfs-actions.pod:7427
30745 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
30749 #: ../src/guestfs-actions.pod:7438
30750 msgid "guestfs_utimens"
30754 #: ../src/guestfs-actions.pod:7440
30758 " guestfs_utimens (guestfs_h *g,\n"
30759 " const char *path,\n"
30760 " int64_t atsecs,\n"
30761 " int64_t atnsecs,\n"
30762 " int64_t mtsecs,\n"
30763 " int64_t mtnsecs);\n"
30768 #: ../src/guestfs-actions.pod:7469 ../src/guestfs-structs.pod:175
30769 msgid "guestfs_version"
30773 #: ../src/guestfs-actions.pod:7471
30776 " struct guestfs_version *\n"
30777 " guestfs_version (guestfs_h *g);\n"
30782 #: ../src/guestfs-actions.pod:7499
30784 "I<Note:> Don't use this call to test for availability of features. In "
30785 "enterprise distributions we backport features from later versions into "
30786 "earlier versions, making this an unreliable way to test for features. Use "
30787 "C<guestfs_available> instead."
30791 #: ../src/guestfs-actions.pod:7505
30793 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
30794 "error. I<The caller must call C<guestfs_free_version> after use>."
30798 #: ../src/guestfs-actions.pod:7509
30799 msgid "(Added in 1.0.58)"
30803 #: ../src/guestfs-actions.pod:7511
30804 msgid "guestfs_vfs_label"
30808 #: ../src/guestfs-actions.pod:7513
30812 " guestfs_vfs_label (guestfs_h *g,\n"
30813 " const char *device);\n"
30818 #: ../src/guestfs-actions.pod:7522
30819 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
30823 #: ../src/guestfs-actions.pod:7527 ../src/guestfs-actions.pod:7564
30824 msgid "(Added in 1.3.18)"
30828 #: ../src/guestfs-actions.pod:7529
30829 msgid "guestfs_vfs_type"
30833 #: ../src/guestfs-actions.pod:7531
30837 " guestfs_vfs_type (guestfs_h *g,\n"
30838 " const char *device);\n"
30843 #: ../src/guestfs-actions.pod:7548
30844 msgid "guestfs_vfs_uuid"
30848 #: ../src/guestfs-actions.pod:7550
30852 " guestfs_vfs_uuid (guestfs_h *g,\n"
30853 " const char *device);\n"
30858 #: ../src/guestfs-actions.pod:7559
30859 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
30863 #: ../src/guestfs-actions.pod:7566
30864 msgid "guestfs_vg_activate"
30868 #: ../src/guestfs-actions.pod:7568
30872 " guestfs_vg_activate (guestfs_h *g,\n"
30874 " char *const *volgroups);\n"
30879 #: ../src/guestfs-actions.pod:7585
30880 msgid "guestfs_vg_activate_all"
30884 #: ../src/guestfs-actions.pod:7587
30888 " guestfs_vg_activate_all (guestfs_h *g,\n"
30889 " int activate);\n"
30894 #: ../src/guestfs-actions.pod:7600
30895 msgid "guestfs_vgcreate"
30899 #: ../src/guestfs-actions.pod:7602
30903 " guestfs_vgcreate (guestfs_h *g,\n"
30904 " const char *volgroup,\n"
30905 " char *const *physvols);\n"
30910 #: ../src/guestfs-actions.pod:7614
30911 msgid "guestfs_vglvuuids"
30915 #: ../src/guestfs-actions.pod:7616
30919 " guestfs_vglvuuids (guestfs_h *g,\n"
30920 " const char *vgname);\n"
30925 #: ../src/guestfs-actions.pod:7623
30927 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
30928 "associate logical volumes and volume groups."
30932 #: ../src/guestfs-actions.pod:7626
30933 msgid "See also C<guestfs_vgpvuuids>."
30937 #: ../src/guestfs-actions.pod:7634
30938 msgid "guestfs_vgpvuuids"
30942 #: ../src/guestfs-actions.pod:7636
30946 " guestfs_vgpvuuids (guestfs_h *g,\n"
30947 " const char *vgname);\n"
30952 #: ../src/guestfs-actions.pod:7643
30954 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
30955 "associate physical volumes and volume groups."
30959 #: ../src/guestfs-actions.pod:7646
30960 msgid "See also C<guestfs_vglvuuids>."
30964 #: ../src/guestfs-actions.pod:7654
30965 msgid "guestfs_vgremove"
30969 #: ../src/guestfs-actions.pod:7656
30973 " guestfs_vgremove (guestfs_h *g,\n"
30974 " const char *vgname);\n"
30979 #: ../src/guestfs-actions.pod:7669
30980 msgid "guestfs_vgrename"
30984 #: ../src/guestfs-actions.pod:7671
30988 " guestfs_vgrename (guestfs_h *g,\n"
30989 " const char *volgroup,\n"
30990 " const char *newvolgroup);\n"
30995 #: ../src/guestfs-actions.pod:7682
30996 msgid "guestfs_vgs"
31000 #: ../src/guestfs-actions.pod:7684
31004 " guestfs_vgs (guestfs_h *g);\n"
31009 #: ../src/guestfs-actions.pod:7693
31010 msgid "See also C<guestfs_vgs_full>."
31014 #: ../src/guestfs-actions.pod:7701
31015 msgid "guestfs_vgs_full"
31019 #: ../src/guestfs-actions.pod:7703
31022 " struct guestfs_lvm_vg_list *\n"
31023 " guestfs_vgs_full (guestfs_h *g);\n"
31028 #: ../src/guestfs-actions.pod:7709
31030 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
31031 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
31036 #: ../src/guestfs-actions.pod:7715
31037 msgid "guestfs_vgscan"
31041 #: ../src/guestfs-actions.pod:7717
31045 " guestfs_vgscan (guestfs_h *g);\n"
31050 #: ../src/guestfs-actions.pod:7727
31051 msgid "guestfs_vguuid"
31055 #: ../src/guestfs-actions.pod:7729
31059 " guestfs_vguuid (guestfs_h *g,\n"
31060 " const char *vgname);\n"
31065 #: ../src/guestfs-actions.pod:7740
31066 msgid "guestfs_wait_ready"
31070 #: ../src/guestfs-actions.pod:7742
31074 " guestfs_wait_ready (guestfs_h *g);\n"
31079 #: ../src/guestfs-actions.pod:7745
31081 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
31086 #: ../src/guestfs-actions.pod:7752
31087 msgid "This function is a no op."
31091 #: ../src/guestfs-actions.pod:7754
31093 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
31094 "calling C<guestfs_launch> to wait for the launch to complete. However this "
31095 "is no longer necessary because C<guestfs_launch> now does the waiting."
31099 #: ../src/guestfs-actions.pod:7759
31101 "If you see any calls to this function in code then you can just remove them, "
31102 "unless you want to retain compatibility with older versions of the API."
31106 #: ../src/guestfs-actions.pod:7767
31107 msgid "guestfs_wc_c"
31111 #: ../src/guestfs-actions.pod:7769
31115 " guestfs_wc_c (guestfs_h *g,\n"
31116 " const char *path);\n"
31121 #: ../src/guestfs-actions.pod:7780
31122 msgid "guestfs_wc_l"
31126 #: ../src/guestfs-actions.pod:7782
31130 " guestfs_wc_l (guestfs_h *g,\n"
31131 " const char *path);\n"
31136 #: ../src/guestfs-actions.pod:7793
31137 msgid "guestfs_wc_w"
31141 #: ../src/guestfs-actions.pod:7795
31145 " guestfs_wc_w (guestfs_h *g,\n"
31146 " const char *path);\n"
31151 #: ../src/guestfs-actions.pod:7806
31152 msgid "guestfs_write"
31156 #: ../src/guestfs-actions.pod:7808
31160 " guestfs_write (guestfs_h *g,\n"
31161 " const char *path,\n"
31162 " const char *content,\n"
31163 " size_t content_size);\n"
31168 #: ../src/guestfs-actions.pod:7817
31169 msgid "See also C<guestfs_write_append>."
31173 #: ../src/guestfs-actions.pod:7826
31174 msgid "guestfs_write_append"
31178 #: ../src/guestfs-actions.pod:7828
31182 " guestfs_write_append (guestfs_h *g,\n"
31183 " const char *path,\n"
31184 " const char *content,\n"
31185 " size_t content_size);\n"
31190 #: ../src/guestfs-actions.pod:7837
31191 msgid "See also C<guestfs_write>."
31195 #: ../src/guestfs-actions.pod:7846
31196 msgid "guestfs_write_file"
31200 #: ../src/guestfs-actions.pod:7848
31204 " guestfs_write_file (guestfs_h *g,\n"
31205 " const char *path,\n"
31206 " const char *content,\n"
31212 #: ../src/guestfs-actions.pod:7854
31214 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
31219 #: ../src/guestfs-actions.pod:7879
31220 msgid "guestfs_zegrep"
31224 #: ../src/guestfs-actions.pod:7881
31228 " guestfs_zegrep (guestfs_h *g,\n"
31229 " const char *regex,\n"
31230 " const char *path);\n"
31235 #: ../src/guestfs-actions.pod:7898
31236 msgid "guestfs_zegrepi"
31240 #: ../src/guestfs-actions.pod:7900
31244 " guestfs_zegrepi (guestfs_h *g,\n"
31245 " const char *regex,\n"
31246 " const char *path);\n"
31251 #: ../src/guestfs-actions.pod:7917
31252 msgid "guestfs_zero"
31256 #: ../src/guestfs-actions.pod:7919
31260 " guestfs_zero (guestfs_h *g,\n"
31261 " const char *device);\n"
31266 #: ../src/guestfs-actions.pod:7933
31268 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
31269 "C<guestfs_is_zero_device>"
31273 #: ../src/guestfs-actions.pod:7945
31274 msgid "guestfs_zero_device"
31278 #: ../src/guestfs-actions.pod:7947
31282 " guestfs_zero_device (guestfs_h *g,\n"
31283 " const char *device);\n"
31288 #: ../src/guestfs-actions.pod:7951
31290 "This command writes zeroes over the entire C<device>. Compare with "
31291 "C<guestfs_zero> which just zeroes the first few blocks of a device."
31295 #: ../src/guestfs-actions.pod:7969
31296 msgid "(Added in 1.3.1)"
31300 #: ../src/guestfs-actions.pod:7971
31301 msgid "guestfs_zerofree"
31305 #: ../src/guestfs-actions.pod:7973
31309 " guestfs_zerofree (guestfs_h *g,\n"
31310 " const char *device);\n"
31315 #: ../src/guestfs-actions.pod:7992
31316 msgid "guestfs_zfgrep"
31320 #: ../src/guestfs-actions.pod:7994
31324 " guestfs_zfgrep (guestfs_h *g,\n"
31325 " const char *pattern,\n"
31326 " const char *path);\n"
31331 #: ../src/guestfs-actions.pod:8011
31332 msgid "guestfs_zfgrepi"
31336 #: ../src/guestfs-actions.pod:8013
31340 " guestfs_zfgrepi (guestfs_h *g,\n"
31341 " const char *pattern,\n"
31342 " const char *path);\n"
31347 #: ../src/guestfs-actions.pod:8030
31348 msgid "guestfs_zfile"
31352 #: ../src/guestfs-actions.pod:8032
31356 " guestfs_zfile (guestfs_h *g,\n"
31357 " const char *meth,\n"
31358 " const char *path);\n"
31363 #: ../src/guestfs-actions.pod:8037
31365 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
31370 #: ../src/guestfs-actions.pod:8049
31372 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
31377 #: ../src/guestfs-actions.pod:8057
31378 msgid "guestfs_zgrep"
31382 #: ../src/guestfs-actions.pod:8059
31386 " guestfs_zgrep (guestfs_h *g,\n"
31387 " const char *regex,\n"
31388 " const char *path);\n"
31393 #: ../src/guestfs-actions.pod:8076
31394 msgid "guestfs_zgrepi"
31398 #: ../src/guestfs-actions.pod:8078
31402 " guestfs_zgrepi (guestfs_h *g,\n"
31403 " const char *regex,\n"
31404 " const char *path);\n"
31409 #: ../src/guestfs-availability.pod:3
31414 #: ../src/guestfs-availability.pod:5
31416 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
31417 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
31418 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
31419 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
31420 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
31424 #: ../src/guestfs-availability.pod:21
31429 #: ../src/guestfs-availability.pod:23
31430 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
31434 #: ../src/guestfs-availability.pod:26
31439 #: ../src/guestfs-availability.pod:28
31440 msgid "The following functions: L</guestfs_grub_install>"
31444 #: ../src/guestfs-availability.pod:31
31449 #: ../src/guestfs-availability.pod:33
31451 "The following functions: L</guestfs_inotify_add_watch> "
31452 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
31453 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
31457 #: ../src/guestfs-availability.pod:41
31458 msgid "B<linuxfsuuid>"
31462 #: ../src/guestfs-availability.pod:43
31464 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
31465 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
31469 #: ../src/guestfs-availability.pod:50
31470 msgid "B<linuxmodules>"
31474 #: ../src/guestfs-availability.pod:52
31475 msgid "The following functions: L</guestfs_modprobe>"
31479 #: ../src/guestfs-availability.pod:55
31480 msgid "B<linuxxattrs>"
31484 #: ../src/guestfs-availability.pod:57
31486 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
31487 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
31488 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
31489 "L</guestfs_setxattr>"
31493 #: ../src/guestfs-availability.pod:68
31498 #: ../src/guestfs-availability.pod:70
31500 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
31501 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
31502 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
31506 #: ../src/guestfs-availability.pod:79
31511 #: ../src/guestfs-availability.pod:81
31513 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
31514 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
31515 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
31516 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
31517 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
31518 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
31519 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
31520 "L</guestfs_vgs_full>"
31524 #: ../src/guestfs-availability.pod:104
31529 #: ../src/guestfs-availability.pod:106
31531 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
31532 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
31536 #: ../src/guestfs-availability.pod:112
31541 #: ../src/guestfs-availability.pod:114
31542 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
31546 #: ../src/guestfs-availability.pod:117
31547 msgid "B<ntfsprogs>"
31551 #: ../src/guestfs-availability.pod:119
31553 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
31554 "L</guestfs_ntfsresize_size>"
31558 #: ../src/guestfs-availability.pod:124
31559 msgid "B<realpath>"
31563 #: ../src/guestfs-availability.pod:126
31564 msgid "The following functions: L</guestfs_realpath>"
31568 #: ../src/guestfs-availability.pod:129
31573 #: ../src/guestfs-availability.pod:131
31575 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
31576 "L</guestfs_scrub_freespace>"
31580 #: ../src/guestfs-availability.pod:136
31585 #: ../src/guestfs-availability.pod:138
31586 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
31590 #: ../src/guestfs-availability.pod:142
31595 #: ../src/guestfs-availability.pod:144
31596 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
31600 #: ../src/guestfs-availability.pod:148
31601 msgid "B<zerofree>"
31605 #: ../src/guestfs-availability.pod:150
31606 msgid "The following functions: L</guestfs_zerofree>"
31610 #: ../src/guestfs-structs.pod:1
31611 msgid "guestfs_int_bool"
31615 #: ../src/guestfs-structs.pod:3
31618 " struct guestfs_int_bool {\n"
31626 #: ../src/guestfs-structs.pod:8
31629 " struct guestfs_int_bool_list {\n"
31630 " uint32_t len; /* Number of elements in list. */\n"
31631 " struct guestfs_int_bool *val; /* Elements. */\n"
31637 #: ../src/guestfs-structs.pod:13
31640 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
31641 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
31646 #: ../src/guestfs-structs.pod:16
31647 msgid "guestfs_lvm_pv"
31651 #: ../src/guestfs-structs.pod:18
31654 " struct guestfs_lvm_pv {\n"
31655 " char *pv_name;\n"
31656 " /* The next field is NOT nul-terminated, be careful when printing it: "
31658 " char pv_uuid[32];\n"
31660 " uint64_t pv_size;\n"
31661 " uint64_t dev_size;\n"
31662 " uint64_t pv_free;\n"
31663 " uint64_t pv_used;\n"
31664 " char *pv_attr;\n"
31665 " int64_t pv_pe_count;\n"
31666 " int64_t pv_pe_alloc_count;\n"
31667 " char *pv_tags;\n"
31668 " uint64_t pe_start;\n"
31669 " int64_t pv_mda_count;\n"
31670 " uint64_t pv_mda_free;\n"
31676 #: ../src/guestfs-structs.pod:36
31679 " struct guestfs_lvm_pv_list {\n"
31680 " uint32_t len; /* Number of elements in list. */\n"
31681 " struct guestfs_lvm_pv *val; /* Elements. */\n"
31687 #: ../src/guestfs-structs.pod:41
31690 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
31691 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
31696 #: ../src/guestfs-structs.pod:44
31697 msgid "guestfs_lvm_vg"
31701 #: ../src/guestfs-structs.pod:46
31704 " struct guestfs_lvm_vg {\n"
31705 " char *vg_name;\n"
31706 " /* The next field is NOT nul-terminated, be careful when printing it: "
31708 " char vg_uuid[32];\n"
31710 " char *vg_attr;\n"
31711 " uint64_t vg_size;\n"
31712 " uint64_t vg_free;\n"
31713 " char *vg_sysid;\n"
31714 " uint64_t vg_extent_size;\n"
31715 " int64_t vg_extent_count;\n"
31716 " int64_t vg_free_count;\n"
31717 " int64_t max_lv;\n"
31718 " int64_t max_pv;\n"
31719 " int64_t pv_count;\n"
31720 " int64_t lv_count;\n"
31721 " int64_t snap_count;\n"
31722 " int64_t vg_seqno;\n"
31723 " char *vg_tags;\n"
31724 " int64_t vg_mda_count;\n"
31725 " uint64_t vg_mda_free;\n"
31731 #: ../src/guestfs-structs.pod:69
31734 " struct guestfs_lvm_vg_list {\n"
31735 " uint32_t len; /* Number of elements in list. */\n"
31736 " struct guestfs_lvm_vg *val; /* Elements. */\n"
31742 #: ../src/guestfs-structs.pod:74
31745 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
31746 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
31751 #: ../src/guestfs-structs.pod:77
31752 msgid "guestfs_lvm_lv"
31756 #: ../src/guestfs-structs.pod:79
31759 " struct guestfs_lvm_lv {\n"
31760 " char *lv_name;\n"
31761 " /* The next field is NOT nul-terminated, be careful when printing it: "
31763 " char lv_uuid[32];\n"
31764 " char *lv_attr;\n"
31765 " int64_t lv_major;\n"
31766 " int64_t lv_minor;\n"
31767 " int64_t lv_kernel_major;\n"
31768 " int64_t lv_kernel_minor;\n"
31769 " uint64_t lv_size;\n"
31770 " int64_t seg_count;\n"
31772 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
31773 " float snap_percent;\n"
31774 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
31775 " float copy_percent;\n"
31776 " char *move_pv;\n"
31777 " char *lv_tags;\n"
31778 " char *mirror_log;\n"
31779 " char *modules;\n"
31785 #: ../src/guestfs-structs.pod:101
31788 " struct guestfs_lvm_lv_list {\n"
31789 " uint32_t len; /* Number of elements in list. */\n"
31790 " struct guestfs_lvm_lv *val; /* Elements. */\n"
31796 #: ../src/guestfs-structs.pod:106
31799 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
31800 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
31805 #: ../src/guestfs-structs.pod:111
31808 " struct guestfs_stat {\n"
31812 " int64_t nlink;\n"
31817 " int64_t blksize;\n"
31818 " int64_t blocks;\n"
31819 " int64_t atime;\n"
31820 " int64_t mtime;\n"
31821 " int64_t ctime;\n"
31827 #: ../src/guestfs-structs.pod:127
31830 " struct guestfs_stat_list {\n"
31831 " uint32_t len; /* Number of elements in list. */\n"
31832 " struct guestfs_stat *val; /* Elements. */\n"
31838 #: ../src/guestfs-structs.pod:132
31841 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
31842 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
31847 #: ../src/guestfs-structs.pod:137
31850 " struct guestfs_statvfs {\n"
31851 " int64_t bsize;\n"
31852 " int64_t frsize;\n"
31853 " int64_t blocks;\n"
31854 " int64_t bfree;\n"
31855 " int64_t bavail;\n"
31856 " int64_t files;\n"
31857 " int64_t ffree;\n"
31858 " int64_t favail;\n"
31861 " int64_t namemax;\n"
31867 #: ../src/guestfs-structs.pod:151
31870 " struct guestfs_statvfs_list {\n"
31871 " uint32_t len; /* Number of elements in list. */\n"
31872 " struct guestfs_statvfs *val; /* Elements. */\n"
31878 #: ../src/guestfs-structs.pod:156
31881 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
31882 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
31887 #: ../src/guestfs-structs.pod:159
31888 msgid "guestfs_dirent"
31892 #: ../src/guestfs-structs.pod:161
31895 " struct guestfs_dirent {\n"
31904 #: ../src/guestfs-structs.pod:167
31907 " struct guestfs_dirent_list {\n"
31908 " uint32_t len; /* Number of elements in list. */\n"
31909 " struct guestfs_dirent *val; /* Elements. */\n"
31915 #: ../src/guestfs-structs.pod:172
31918 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
31919 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
31924 #: ../src/guestfs-structs.pod:177
31927 " struct guestfs_version {\n"
31928 " int64_t major;\n"
31929 " int64_t minor;\n"
31930 " int64_t release;\n"
31937 #: ../src/guestfs-structs.pod:184
31940 " struct guestfs_version_list {\n"
31941 " uint32_t len; /* Number of elements in list. */\n"
31942 " struct guestfs_version *val; /* Elements. */\n"
31948 #: ../src/guestfs-structs.pod:189
31951 " void guestfs_free_version (struct guestfs_free_version *);\n"
31952 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
31957 #: ../src/guestfs-structs.pod:192
31958 msgid "guestfs_xattr"
31962 #: ../src/guestfs-structs.pod:194
31965 " struct guestfs_xattr {\n"
31966 " char *attrname;\n"
31967 " /* The next two fields describe a byte array. */\n"
31968 " uint32_t attrval_len;\n"
31969 " char *attrval;\n"
31975 #: ../src/guestfs-structs.pod:201
31978 " struct guestfs_xattr_list {\n"
31979 " uint32_t len; /* Number of elements in list. */\n"
31980 " struct guestfs_xattr *val; /* Elements. */\n"
31986 #: ../src/guestfs-structs.pod:206
31989 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
31990 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
31995 #: ../src/guestfs-structs.pod:209
31996 msgid "guestfs_inotify_event"
32000 #: ../src/guestfs-structs.pod:211
32003 " struct guestfs_inotify_event {\n"
32004 " int64_t in_wd;\n"
32005 " uint32_t in_mask;\n"
32006 " uint32_t in_cookie;\n"
32007 " char *in_name;\n"
32013 #: ../src/guestfs-structs.pod:218
32016 " struct guestfs_inotify_event_list {\n"
32017 " uint32_t len; /* Number of elements in list. */\n"
32018 " struct guestfs_inotify_event *val; /* Elements. */\n"
32024 #: ../src/guestfs-structs.pod:223
32027 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
32028 " void guestfs_free_inotify_event_list (struct "
32029 "guestfs_free_inotify_event_list *);\n"
32034 #: ../src/guestfs-structs.pod:226
32035 msgid "guestfs_partition"
32039 #: ../src/guestfs-structs.pod:228
32042 " struct guestfs_partition {\n"
32043 " int32_t part_num;\n"
32044 " uint64_t part_start;\n"
32045 " uint64_t part_end;\n"
32046 " uint64_t part_size;\n"
32052 #: ../src/guestfs-structs.pod:235
32055 " struct guestfs_partition_list {\n"
32056 " uint32_t len; /* Number of elements in list. */\n"
32057 " struct guestfs_partition *val; /* Elements. */\n"
32063 #: ../src/guestfs-structs.pod:240
32066 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
32067 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
32072 #: ../src/guestfs-structs.pod:243
32073 msgid "guestfs_application"
32077 #: ../src/guestfs-structs.pod:245
32080 " struct guestfs_application {\n"
32081 " char *app_name;\n"
32082 " char *app_display_name;\n"
32083 " int32_t app_epoch;\n"
32084 " char *app_version;\n"
32085 " char *app_release;\n"
32086 " char *app_install_path;\n"
32087 " char *app_trans_path;\n"
32088 " char *app_publisher;\n"
32089 " char *app_url;\n"
32090 " char *app_source_package;\n"
32091 " char *app_summary;\n"
32092 " char *app_description;\n"
32098 #: ../src/guestfs-structs.pod:260
32101 " struct guestfs_application_list {\n"
32102 " uint32_t len; /* Number of elements in list. */\n"
32103 " struct guestfs_application *val; /* Elements. */\n"
32109 #: ../src/guestfs-structs.pod:265
32112 " void guestfs_free_application (struct guestfs_free_application *);\n"
32113 " void guestfs_free_application_list (struct guestfs_free_application_list "
32119 #: ../src/guestfs.pod:5
32120 msgid "guestfs - Library for accessing and modifying virtual machine images"
32124 #: ../src/guestfs.pod:11
32127 " guestfs_h *g = guestfs_create ();\n"
32128 " guestfs_add_drive (g, \"guest.img\");\n"
32129 " guestfs_launch (g);\n"
32130 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32131 " guestfs_touch (g, \"/hello\");\n"
32132 " guestfs_umount (g, \"/\");\n"
32133 " guestfs_close (g);\n"
32138 #: ../src/guestfs.pod:25
32140 "Libguestfs is a library for accessing and modifying guest disk images. "
32141 "Amongst the things this is good for: making batch configuration changes to "
32142 "guests, getting disk used/free statistics (see also: virt-df), migrating "
32143 "between virtualization systems (see also: virt-p2v), performing partial "
32144 "backups, performing partial guest clones, cloning guests and changing "
32145 "registry/UUID/hostname info, and much else besides."
32149 #: ../src/guestfs.pod:33
32151 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
32152 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
32153 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
32158 #: ../src/guestfs.pod:38
32160 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
32161 "what filesystem is in each LV, etc.). It can also run commands in the "
32162 "context of the guest. Also you can access filesystems over FUSE."
32166 #: ../src/guestfs.pod:43
32168 "Libguestfs is a library that can be linked with C and C++ management "
32169 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
32170 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
32175 #: ../src/guestfs.pod:48
32177 "You don't need to be root to use libguestfs, although obviously you do need "
32178 "enough permissions to access the disk images."
32182 #: ../src/guestfs.pod:51
32184 "Libguestfs is a large API because it can do many things. For a gentle "
32185 "introduction, please read the L</API OVERVIEW> section next."
32189 #: ../src/guestfs.pod:54
32191 "There are also some example programs in the L<guestfs-examples(3)> manual "
32196 #: ../src/guestfs.pod:57
32197 msgid "API OVERVIEW"
32201 #: ../src/guestfs.pod:59
32203 "This section provides a gentler overview of the libguestfs API. We also try "
32204 "to group API calls together, where that may not be obvious from reading "
32205 "about the individual calls in the main section of this manual."
32209 #: ../src/guestfs.pod:64
32214 #: ../src/guestfs.pod:66
32216 "Before you can use libguestfs calls, you have to create a handle. Then you "
32217 "must add at least one disk image to the handle, followed by launching the "
32218 "handle, then performing whatever operations you want, and finally closing "
32219 "the handle. By convention we use the single letter C<g> for the name of the "
32220 "handle variable, although of course you can use any name you want."
32224 #: ../src/guestfs.pod:73
32225 msgid "The general structure of all libguestfs-using programs looks like this:"
32229 #: ../src/guestfs.pod:76
32232 " guestfs_h *g = guestfs_create ();\n"
32237 #: ../src/guestfs.pod:78
32240 " /* Call guestfs_add_drive additional times if there are\n"
32241 " * multiple disk images.\n"
32243 " guestfs_add_drive (g, \"guest.img\");\n"
32248 #: ../src/guestfs.pod:83
32251 " /* Most manipulation calls won't work until you've launched\n"
32252 " * the handle 'g'. You have to do this _after_ adding drives\n"
32253 " * and _before_ other commands.\n"
32255 " guestfs_launch (g);\n"
32260 #: ../src/guestfs.pod:89
32263 " /* Now you can examine what partitions, LVs etc are available.\n"
32265 " char **partitions = guestfs_list_partitions (g);\n"
32266 " char **logvols = guestfs_lvs (g);\n"
32271 #: ../src/guestfs.pod:94
32274 " /* To access a filesystem in the image, you must mount it.\n"
32276 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32281 #: ../src/guestfs.pod:98
32284 " /* Now you can perform filesystem actions on the guest\n"
32287 " guestfs_touch (g, \"/hello\");\n"
32292 #: ../src/guestfs.pod:103
32295 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
32296 " * it is done automatically when you close the handle. See\n"
32297 " * discussion of autosync in this page.\n"
32299 " guestfs_sync (g);\n"
32304 #: ../src/guestfs.pod:109
32307 " /* Close the handle 'g'. */\n"
32308 " guestfs_close (g);\n"
32313 #: ../src/guestfs.pod:112
32315 "The code above doesn't include any error checking. In real code you should "
32316 "check return values carefully for errors. In general all functions that "
32317 "return integers return C<-1> on error, and all functions that return "
32318 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
32319 "how to handle errors, and consult the documentation for each function call "
32320 "below to see precisely how they return error indications. See "
32321 "L<guestfs-examples(3)> for fully worked examples."
32325 #: ../src/guestfs.pod:121
32326 msgid "DISK IMAGES"
32330 #: ../src/guestfs.pod:123
32332 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
32333 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
32334 "actual block device, or simply an empty file of zeroes that you have created "
32335 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
32340 #: ../src/guestfs.pod:129
32342 "The call you should use in modern code for adding drives is "
32343 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
32344 "specifying that the format is raw, do:"
32348 #: ../src/guestfs.pod:133
32351 " guestfs_add_drive_opts (g, filename,\n"
32352 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32358 #: ../src/guestfs.pod:137
32359 msgid "You can add a disk read-only using:"
32363 #: ../src/guestfs.pod:139
32366 " guestfs_add_drive_opts (g, filename,\n"
32367 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32368 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32374 #: ../src/guestfs.pod:144
32376 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
32377 "libguestfs won't modify the file."
32381 #: ../src/guestfs.pod:147
32383 "Be extremely cautious if the disk image is in use, eg. if it is being used "
32384 "by a virtual machine. Adding it read-write will almost certainly cause disk "
32385 "corruption, but adding it read-only is safe."
32389 #: ../src/guestfs.pod:151
32391 "You must add at least one disk image, and you may add multiple disk images. "
32392 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
32393 "first one you added), C</dev/sdb> (for the second one you added), etc."
32397 #: ../src/guestfs.pod:156
32399 "Once L</guestfs_launch> has been called you cannot add any more images. You "
32400 "can call L</guestfs_list_devices> to get a list of the device names, in the "
32401 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
32405 #: ../src/guestfs.pod:161
32410 #: ../src/guestfs.pod:163
32412 "Before you can read or write files, create directories and so on in a disk "
32413 "image that contains filesystems, you have to mount those filesystems using "
32414 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
32415 "a disk image contains (for example) one partition with a filesystem on that "
32416 "partition, then you can mount it directly:"
32420 #: ../src/guestfs.pod:170
32423 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
32428 #: ../src/guestfs.pod:172
32430 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
32431 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
32432 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
32433 "that these are libguestfs virtual devices, and are nothing to do with host "
32438 #: ../src/guestfs.pod:178
32440 "If you are given a disk image and you don't know what it contains then you "
32441 "have to find out. Libguestfs can do that too: use "
32442 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
32443 "and LVs, and either try mounting each to see what is mountable, or else "
32444 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
32445 "filesystems, use L</guestfs_list_filesystems>."
32449 #: ../src/guestfs.pod:186
32451 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
32452 "L</INSPECTION> below). But you might find it easier to look at higher level "
32453 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
32457 #: ../src/guestfs.pod:191
32459 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
32460 "several other variations of the C<guestfs_mount_*> call."
32464 #: ../src/guestfs.pod:194
32465 msgid "FILESYSTEM ACCESS AND MODIFICATION"
32469 #: ../src/guestfs.pod:196
32471 "The majority of the libguestfs API consists of fairly low-level calls for "
32472 "accessing and modifying the files, directories, symlinks etc on mounted "
32473 "filesystems. There are over a hundred such calls which you can find listed "
32474 "in detail below in this man page, and we don't even pretend to cover them "
32475 "all in this overview."
32479 #: ../src/guestfs.pod:202
32481 "Specify filenames as full paths, starting with C<\"/\"> and including the "
32486 #: ../src/guestfs.pod:205
32488 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
32489 "the file called C<\"etc/passwd\"> then you could do:"
32493 #: ../src/guestfs.pod:208
32496 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
32501 #: ../src/guestfs.pod:210
32503 "This would return C<data> as a newly allocated buffer containing the full "
32504 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
32505 "or C<NULL> if there was an error."
32509 #: ../src/guestfs.pod:214
32511 "As another example, to create a top-level directory on that filesystem "
32512 "called C<\"var\"> you would do:"
32516 #: ../src/guestfs.pod:217
32519 " guestfs_mkdir (g, \"/var\");\n"
32524 #: ../src/guestfs.pod:219
32525 msgid "To create a symlink you could do:"
32529 #: ../src/guestfs.pod:221
32532 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
32533 " \"/etc/rc3.d/S30portmap\");\n"
32538 #: ../src/guestfs.pod:224
32540 "Libguestfs will reject attempts to use relative paths and there is no "
32541 "concept of a current working directory."
32545 #: ../src/guestfs.pod:227
32547 "Libguestfs can return errors in many situations: for example if the "
32548 "filesystem isn't writable, or if a file or directory that you requested "
32549 "doesn't exist. If you are using the C API (documented here) you have to "
32550 "check for those error conditions after each call. (Other language bindings "
32551 "turn these errors into exceptions)."
32555 #: ../src/guestfs.pod:233
32557 "File writes are affected by the per-handle umask, set by calling "
32558 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
32562 #: ../src/guestfs.pod:236
32563 msgid "PARTITIONING"
32567 #: ../src/guestfs.pod:238
32569 "Libguestfs contains API calls to read, create and modify partition tables on "
32574 #: ../src/guestfs.pod:241
32576 "In the common case where you want to create a single partition covering the "
32577 "whole disk, you should use the L</guestfs_part_disk> call:"
32581 #: ../src/guestfs.pod:245
32584 " const char *parttype = \"mbr\";\n"
32585 " if (disk_is_larger_than_2TB)\n"
32586 " parttype = \"gpt\";\n"
32587 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
32592 #: ../src/guestfs.pod:250
32594 "Obviously this effectively wipes anything that was on that disk image "
32599 #: ../src/guestfs.pod:253
32604 #: ../src/guestfs.pod:255
32606 "Libguestfs provides access to a large part of the LVM2 API, such as "
32607 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
32608 "unless you familiarize yourself with the concepts of physical volumes, "
32609 "volume groups and logical volumes."
32613 #: ../src/guestfs.pod:260
32615 "This author strongly recommends reading the LVM HOWTO, online at "
32616 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
32620 #: ../src/guestfs.pod:263
32621 msgid "DOWNLOADING"
32625 #: ../src/guestfs.pod:265
32627 "Use L</guestfs_cat> to download small, text only files. This call is "
32628 "limited to files which are less than 2 MB and which cannot contain any ASCII "
32629 "NUL (C<\\0>) characters. However the API is very simple to use."
32633 #: ../src/guestfs.pod:269
32635 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
32636 "bit data, since it returns a (pointer, size) pair. However it is still "
32637 "limited to \"small\" files, less than 2 MB."
32641 #: ../src/guestfs.pod:273
32643 "L</guestfs_download> can be used to download any file, with no limits on "
32644 "content or size (even files larger than 4 GB)."
32648 #: ../src/guestfs.pod:276
32649 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
32653 #: ../src/guestfs.pod:279
32658 #: ../src/guestfs.pod:281
32660 "It's often the case that you want to write a file or files to the disk "
32665 #: ../src/guestfs.pod:284
32667 "To write a small file with fixed content, use L</guestfs_write>. To create "
32668 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
32669 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
32670 "variety of other functions for creating test files, for example "
32671 "L</guestfs_fill> and L</guestfs_fill_pattern>."
32675 #: ../src/guestfs.pod:290
32677 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
32678 "file content or size (even files larger than 4 GB)."
32682 #: ../src/guestfs.pod:293
32683 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
32687 #: ../src/guestfs.pod:295
32689 "However the fastest way to upload I<large numbers of arbitrary files> is to "
32690 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
32691 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
32692 "the drive in a predictable way (eg. adding it last after all other drives) "
32693 "then you can get the device name from L</guestfs_list_devices> and mount it "
32694 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
32695 "sometimes non-portable between kernel versions, and they don't support "
32696 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
32697 "using a label or UUID, use an ISO image instead."
32701 #: ../src/guestfs.pod:306
32706 #: ../src/guestfs.pod:308
32708 "There are various different commands for copying between files and devices "
32709 "and in and out of the guest filesystem. These are summarised in the table "
32714 #: ../src/guestfs.pod:314
32715 msgid "B<file> to B<file>"
32719 #: ../src/guestfs.pod:316
32721 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
32722 "directories recursively."
32726 #: ../src/guestfs.pod:319
32727 msgid "B<file or device> to B<file or device>"
32731 #: ../src/guestfs.pod:321
32733 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
32734 "devices in the guest."
32738 #: ../src/guestfs.pod:324
32739 msgid "Example: duplicate the contents of an LV:"
32743 #: ../src/guestfs.pod:326
32746 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
32751 #: ../src/guestfs.pod:328
32753 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
32754 "(C</dev/VG/Original>). To copy less than the whole source device, use "
32755 "L</guestfs_copy_size>."
32759 #: ../src/guestfs.pod:332
32760 msgid "B<file on the host> to B<file or device>"
32764 #: ../src/guestfs.pod:334
32765 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
32769 #: ../src/guestfs.pod:336
32770 msgid "B<file or device> to B<file on the host>"
32774 #: ../src/guestfs.pod:338
32775 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
32779 #: ../src/guestfs.pod:342
32780 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
32784 #: ../src/guestfs.pod:344
32786 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
32787 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
32788 "appears you can only upload and download to files. However many Un*x-like "
32789 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
32790 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
32791 "stderr, and arbitrary file descriptor N."
32795 #: ../src/guestfs.pod:352
32796 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
32800 #: ../src/guestfs.pod:355
32803 " guestfs_download (g, filename, \"/dev/stdout\");\n"
32808 #: ../src/guestfs.pod:357
32809 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
32813 #: ../src/guestfs.pod:359
32816 " char devfd[64];\n"
32817 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
32818 " guestfs_tar_out (g, \"/\", devfd);\n"
32823 #: ../src/guestfs.pod:363
32824 msgid "LISTING FILES"
32828 #: ../src/guestfs.pod:365
32830 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
32831 "L<guestfish(1)>-equivalent command C<ll>)."
32835 #: ../src/guestfs.pod:368
32837 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
32838 "programs, as a flat list of strings."
32842 #: ../src/guestfs.pod:371
32844 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
32845 "directory, plus additional information about each one. It is more "
32846 "equivalent to using the L<readdir(3)> call on a local filesystem."
32850 #: ../src/guestfs.pod:375
32852 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
32857 #: ../src/guestfs.pod:378
32858 msgid "RUNNING COMMANDS"
32862 #: ../src/guestfs.pod:380
32864 "Although libguestfs is primarily an API for manipulating files inside guest "
32865 "images, we also provide some limited facilities for running commands inside "
32870 #: ../src/guestfs.pod:384
32871 msgid "There are many limitations to this:"
32875 #: ../src/guestfs.pod:390
32877 "The kernel version that the command runs under will be different from what "
32882 #: ../src/guestfs.pod:395
32884 "If the command needs to communicate with daemons, then most likely they "
32885 "won't be running."
32889 #: ../src/guestfs.pod:400
32890 msgid "The command will be running in limited memory."
32894 #: ../src/guestfs.pod:404
32896 "The network may not be available unless you enable it (see "
32897 "L</guestfs_set_network>)."
32901 #: ../src/guestfs.pod:409
32902 msgid "Only supports Linux guests (not Windows, BSD, etc)."
32906 #: ../src/guestfs.pod:413
32907 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
32911 #: ../src/guestfs.pod:418
32913 "For SELinux guests, you may need to enable SELinux and load policy first. "
32914 "See L</SELINUX> in this manpage."
32918 #: ../src/guestfs.pod:423
32920 "I<Security:> It is not safe to run commands from untrusted, possibly "
32921 "malicious guests. These commands may attempt to exploit your program by "
32922 "sending unexpected output. They could also try to exploit the Linux kernel "
32923 "or qemu provided by the libguestfs appliance. They could use the network "
32924 "provided by the libguestfs appliance to bypass ordinary network partitions "
32925 "and firewalls. They could use the elevated privileges or different SELinux "
32926 "context of your program to their advantage."
32930 #: ../src/guestfs.pod:432
32932 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
32933 "(a script which runs when the guest next boots normally), and to have this "
32934 "script run the commands you want in the normal context of the running guest, "
32935 "network security and so on. For information about other security issues, "
32936 "see L</SECURITY>."
32940 #: ../src/guestfs.pod:440
32942 "The two main API calls to run commands are L</guestfs_command> and "
32943 "L</guestfs_sh> (there are also variations)."
32947 #: ../src/guestfs.pod:443
32949 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
32950 "shell globs, redirections, etc will work."
32954 #: ../src/guestfs.pod:446
32955 msgid "CONFIGURATION FILES"
32959 #: ../src/guestfs.pod:448
32961 "To read and write configuration files in Linux guest filesystems, we "
32962 "strongly recommend using Augeas. For example, Augeas understands how to "
32963 "read and write, say, a Linux shadow password file or X.org configuration "
32964 "file, and so avoids you having to write that code."
32968 #: ../src/guestfs.pod:453
32970 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
32971 "document Augeas itself here because there is excellent documentation on the "
32972 "L<http://augeas.net/> website."
32976 #: ../src/guestfs.pod:457
32978 "If you don't want to use Augeas (you fool!) then try calling "
32979 "L</guestfs_read_lines> to get the file as a list of lines which you can "
32984 #: ../src/guestfs.pod:461
32989 #: ../src/guestfs.pod:463
32991 "We support SELinux guests. To ensure that labeling happens correctly in "
32992 "SELinux guests, you need to enable SELinux and load the guest's policy:"
32996 #: ../src/guestfs.pod:471
32997 msgid "Before launching, do:"
33001 #: ../src/guestfs.pod:473
33004 " guestfs_set_selinux (g, 1);\n"
33009 #: ../src/guestfs.pod:477
33011 "After mounting the guest's filesystem(s), load the policy. This is best "
33012 "done by running the L<load_policy(8)> command in the guest itself:"
33016 #: ../src/guestfs.pod:481
33019 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
33024 #: ../src/guestfs.pod:483
33026 "(Older versions of C<load_policy> require you to specify the name of the "
33031 #: ../src/guestfs.pod:488
33033 "Optionally, set the security context for the API. The correct security "
33034 "context to use can only be known by inspecting the guest. As an example:"
33038 #: ../src/guestfs.pod:492
33041 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
33046 #: ../src/guestfs.pod:496
33047 msgid "This will work for running commands and editing existing files."
33051 #: ../src/guestfs.pod:498
33053 "When new files are created, you may need to label them explicitly, for "
33054 "example by running the external command C<restorecon pathname>."
33058 #: ../src/guestfs.pod:502
33063 #: ../src/guestfs.pod:504
33065 "Certain calls are affected by the current file mode creation mask (the "
33066 "\"umask\"). In particular ones which create files or directories, such as "
33067 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
33068 "either the default mode that the file is created with or modifies the mode "
33073 #: ../src/guestfs.pod:510
33075 "The default umask is C<022>, so files are created with modes such as C<0644> "
33076 "and directories with C<0755>."
33080 #: ../src/guestfs.pod:513
33082 "There are two ways to avoid being affected by umask. Either set umask to 0 "
33083 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
33084 "L</guestfs_chmod> after creating each file or directory."
33088 #: ../src/guestfs.pod:517
33089 msgid "For more information about umask, see L<umask(2)>."
33093 #: ../src/guestfs.pod:521
33095 "Libguestfs allows you to access Linux guests which have been encrypted using "
33096 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
33097 "standard. This includes nearly all whole disk encryption systems used by "
33098 "modern Linux guests."
33102 #: ../src/guestfs.pod:527
33104 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
33105 "returns the string C<crypto_LUKS>)."
33109 #: ../src/guestfs.pod:530
33111 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
33112 "will require the passphrase!"
33116 #: ../src/guestfs.pod:533
33118 "Opening a LUKS device creates a new device mapper device called "
33119 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
33120 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
33121 "decrypted from and encrypted to the underlying block device respectively."
33125 #: ../src/guestfs.pod:539
33127 "LVM volume groups on the device can be made visible by calling "
33128 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
33129 "volume(s) can now be mounted in the usual way."
33133 #: ../src/guestfs.pod:543
33135 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
33136 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
33137 "[\"/dev/VG\"])>. Then close the mapper device by calling "
33138 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
33139 "underlying encrypted block device)."
33143 #: ../src/guestfs.pod:550
33148 #: ../src/guestfs.pod:552
33150 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
33151 "contains operating systems, an install CD or a live CD. (These APIs used to "
33152 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
33153 "version 1.5.3 the most frequently used part of this library has been "
33154 "rewritten in C and moved into the core code)."
33158 #: ../src/guestfs.pod:559
33160 "Add all disks belonging to the unknown virtual machine and call "
33161 "L</guestfs_launch> in the usual way."
33165 #: ../src/guestfs.pod:562
33167 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
33168 "and certain heuristics, and returns a list of operating systems that were "
33169 "found. An empty list means none were found. A single element is the root "
33170 "filesystem of the operating system. For dual- or multi-boot guests, "
33171 "multiple roots can be returned, each one corresponding to a separate "
33172 "operating system. (Multi-boot virtual machines are extremely rare in the "
33173 "world of virtualization, but since this scenario can happen, we have built "
33174 "libguestfs to deal with it.)"
33178 #: ../src/guestfs.pod:571
33180 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
33181 "to get additional details about that operating system. For example, call "
33182 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
33183 "Windows and Linux-based operating systems respectively."
33187 #: ../src/guestfs.pod:577
33189 "Un*x-like and Linux-based operating systems usually consist of several "
33190 "filesystems which are mounted at boot time (for example, a separate boot "
33191 "partition mounted on C</boot>). The inspection rules are able to detect how "
33192 "filesystems correspond to mount points. Call "
33193 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
33194 "hash table like this example:"
33198 #: ../src/guestfs.pod:584
33201 " /boot => /dev/sda1\n"
33202 " / => /dev/vg_guest/lv_root\n"
33203 " /usr => /dev/vg_guest/lv_usr\n"
33208 #: ../src/guestfs.pod:588
33210 "The caller can then make calls to L</guestfs_mount_options> to mount the "
33211 "filesystems as suggested."
33215 #: ../src/guestfs.pod:591
33217 "Be careful to mount filesystems in the right order (eg. C</> before "
33218 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
33223 #: ../src/guestfs.pod:595
33225 "Inspection currently only works for some common operating systems. "
33226 "Contributors are welcome to send patches for other operating systems that we "
33227 "currently cannot detect."
33231 #: ../src/guestfs.pod:599
33233 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
33234 "for more details. The L</guestfs_inspect_os> function just ignores any "
33235 "encrypted devices."
33239 #: ../src/guestfs.pod:603
33241 "A note on the implementation: The call L</guestfs_inspect_os> performs "
33242 "inspection and caches the results in the guest handle. Subsequent calls to "
33243 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
33244 "re-read the disks. If you change the content of the guest disks, you can "
33245 "redo inspection by calling L</guestfs_inspect_os> again. "
33246 "(L</guestfs_inspect_list_applications> works a little differently from the "
33247 "other calls and does read the disks. See documentation for that function "
33252 #: ../src/guestfs.pod:612
33253 msgid "INSPECTING INSTALL DISKS"
33257 #: ../src/guestfs.pod:614
33259 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
33264 #: ../src/guestfs.pod:617
33266 "Call L</guestfs_inspect_get_format> to return the format of the operating "
33267 "system, which currently can be C<installed> (a regular operating system) or "
33268 "C<installer> (some sort of install disk)."
33272 #: ../src/guestfs.pod:621
33274 "Further information is available about the operating system that can be "
33275 "installed using the regular inspection APIs like "
33276 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
33281 #: ../src/guestfs.pod:626
33283 "Some additional information specific to installer disks is also available "
33284 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
33285 "L</guestfs_inspect_is_multipart> calls."
33289 #: ../src/guestfs.pod:631
33290 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
33294 #: ../src/guestfs.pod:633
33296 "Libguestfs can mount NTFS partitions. It does this using the "
33297 "L<http://www.ntfs-3g.org/> driver."
33301 #: ../src/guestfs.pod:636
33302 msgid "DRIVE LETTERS AND PATHS"
33306 #: ../src/guestfs.pod:638
33308 "DOS and Windows still use drive letters, and the filesystems are always "
33309 "treated as case insensitive by Windows itself, and therefore you might find "
33310 "a Windows configuration file referring to a path like "
33311 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
33312 "that directory might be referred to as C</WINDOWS/System32>."
33316 #: ../src/guestfs.pod:644
33318 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
33319 "L</guestfs_inspect_get_drive_mappings>)"
33323 #: ../src/guestfs.pod:647
33325 "Dealing with separator characters (backslash vs forward slash) is outside "
33326 "the scope of libguestfs, but usually a simple character replacement will "
33331 #: ../src/guestfs.pod:651
33333 "To resolve the case insensitivity of paths, call "
33334 "L</guestfs_case_sensitive_path>."
33338 #: ../src/guestfs.pod:654
33339 msgid "ACCESSING THE WINDOWS REGISTRY"
33343 #: ../src/guestfs.pod:656
33345 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
33346 "files, through the library C<hivex> which is part of the libguestfs project "
33347 "although ships as a separate tarball. You have to locate and download the "
33348 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
33349 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
33350 "L<virt-win-reg(1)> for more help on this issue."
33354 #: ../src/guestfs.pod:664
33355 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
33359 #: ../src/guestfs.pod:666
33361 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
33362 "provide something which looks like a Linux symlink. The way it tries to do "
33363 "the rewriting is described here:"
33367 #: ../src/guestfs.pod:670
33368 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
33372 #: ../src/guestfs.pod:672
33374 "The essential problem is that ntfs-3g simply does not have enough "
33375 "information to do a correct job. NTFS links can contain drive letters and "
33376 "references to external device GUIDs that ntfs-3g has no way of resolving. "
33377 "It is almost certainly the case that libguestfs callers should ignore what "
33378 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
33382 #: ../src/guestfs.pod:679
33384 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
33385 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
33386 "attribute, and read the raw reparse data from that (you can find the format "
33387 "documented in various places around the web)."
33391 #: ../src/guestfs.pod:684
33392 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
33396 #: ../src/guestfs.pod:686
33398 "There are other useful extended attributes that can be read from ntfs-3g "
33399 "filesystems (using L</guestfs_getxattr>). See:"
33403 #: ../src/guestfs.pod:689
33404 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
33408 #: ../src/guestfs.pod:691
33409 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
33413 #: ../src/guestfs.pod:693
33415 "Although we don't want to discourage you from using the C API, we will "
33416 "mention here that the same API is also available in other languages."
33420 #: ../src/guestfs.pod:696
33422 "The API is broadly identical in all supported languages. This means that "
33423 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
33424 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
33425 "OCaml. In other words, a straightforward, predictable isomorphism between "
33430 #: ../src/guestfs.pod:702
33432 "Error messages are automatically transformed into exceptions if the language "
33437 #: ../src/guestfs.pod:705
33439 "We don't try to \"object orientify\" parts of the API in OO languages, "
33440 "although contributors are welcome to write higher level APIs above what we "
33441 "provide in their favourite languages if they wish."
33445 #: ../src/guestfs.pod:711
33450 #: ../src/guestfs.pod:713
33452 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
33453 "identical to the C API. C++ classes and exceptions are not used."
33457 #: ../src/guestfs.pod:717
33462 #: ../src/guestfs.pod:719
33464 "The C# bindings are highly experimental. Please read the warnings at the "
33465 "top of C<csharp/Libguestfs.cs>."
33469 #: ../src/guestfs.pod:722
33474 #: ../src/guestfs.pod:724
33475 msgid "See L<guestfs-erlang(3)>."
33479 #: ../src/guestfs.pod:726
33484 #: ../src/guestfs.pod:728
33486 "This is the only language binding that is working but incomplete. Only "
33487 "calls which return simple integers have been bound in Haskell, and we are "
33488 "looking for help to complete this binding."
33492 #: ../src/guestfs.pod:732
33497 #: ../src/guestfs.pod:734
33499 "Full documentation is contained in the Javadoc which is distributed with "
33500 "libguestfs. For examples, see L<guestfs-java(3)>."
33504 #: ../src/guestfs.pod:737
33509 #: ../src/guestfs.pod:739
33510 msgid "See L<guestfs-ocaml(3)>."
33514 #: ../src/guestfs.pod:741
33519 #: ../src/guestfs.pod:743
33520 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
33524 #: ../src/guestfs.pod:745
33529 #: ../src/guestfs.pod:747
33531 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
33532 "the php-libguestfs package for your distribution."
33536 #: ../src/guestfs.pod:750
33537 msgid "The PHP binding only works correctly on 64 bit machines."
33541 #: ../src/guestfs.pod:752
33546 #: ../src/guestfs.pod:754
33547 msgid "See L<guestfs-python(3)>."
33551 #: ../src/guestfs.pod:756
33556 #: ../src/guestfs.pod:758
33557 msgid "See L<guestfs-ruby(3)>."
33561 #: ../src/guestfs.pod:760
33562 msgid "B<shell scripts>"
33566 #: ../src/guestfs.pod:762
33567 msgid "See L<guestfish(1)>."
33571 #: ../src/guestfs.pod:766
33572 msgid "LIBGUESTFS GOTCHAS"
33576 #: ../src/guestfs.pod:768
33578 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
33579 "system [...] that works in the way it is documented but is counterintuitive "
33580 "and almost invites mistakes.\""
33584 #: ../src/guestfs.pod:772
33586 "Since we developed libguestfs and the associated tools, there are several "
33587 "things we would have designed differently, but are now stuck with for "
33588 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
33589 "release, you can expect these to change. Beware of them."
33593 #: ../src/guestfs.pod:780
33594 msgid "Autosync / forgetting to sync."
33598 #: ../src/guestfs.pod:782
33600 "I<Update:> Autosync is enabled by default for all API users starting from "
33601 "libguestfs 1.5.24. This section only applies to older versions."
33605 #: ../src/guestfs.pod:785
33607 "When modifying a filesystem from C or another language, you B<must> unmount "
33608 "all filesystems and call L</guestfs_sync> explicitly before you close the "
33609 "libguestfs handle. You can also call:"
33613 #: ../src/guestfs.pod:789
33616 " guestfs_set_autosync (g, 1);\n"
33621 #: ../src/guestfs.pod:791
33623 "to have the unmount/sync done automatically for you when the handle 'g' is "
33624 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
33629 #: ../src/guestfs.pod:795
33631 "If you forget to do this, then it is entirely possible that your changes "
33632 "won't be written out, or will be partially written, or (very rarely) that "
33633 "you'll get disk corruption."
33637 #: ../src/guestfs.pod:799
33639 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
33640 "guestfish scripts that forget to sync will work just fine, which can make "
33641 "this very puzzling if you are trying to debug a problem."
33645 #: ../src/guestfs.pod:803
33646 msgid "Mount option C<-o sync> should not be the default."
33650 #: ../src/guestfs.pod:805
33652 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
33653 "libguestfs 1.13.16. This section only applies to older versions."
33657 #: ../src/guestfs.pod:808
33659 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
33660 "However C<-o sync> does not add any reliability benefit, but does have a "
33661 "very large performance impact."
33665 #: ../src/guestfs.pod:812
33667 "The work around is to use L</guestfs_mount_options> and set the mount "
33668 "options that you actually want to use."
33672 #: ../src/guestfs.pod:815
33673 msgid "Read-only should be the default."
33677 #: ../src/guestfs.pod:817
33679 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
33680 "specify I<--rw> if you want to make changes to the image."
33684 #: ../src/guestfs.pod:820
33685 msgid "This would reduce the potential to corrupt live VM images."
33689 #: ../src/guestfs.pod:822
33691 "Note that many filesystems change the disk when you just mount and unmount, "
33692 "even if you didn't perform any writes. You need to use "
33693 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
33697 #: ../src/guestfs.pod:826
33698 msgid "guestfish command line is hard to use."
33702 #: ../src/guestfs.pod:828
33704 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
33705 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
33706 "exist, so it fails. In earlier versions of guestfish the error message was "
33707 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
33708 "we should have used C<guestfish -c command> to run commands."
33712 #: ../src/guestfs.pod:835
33713 msgid "guestfish megabyte modifiers don't work right on all commands"
33717 #: ../src/guestfs.pod:837
33719 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
33720 "other modifiers). What guestfish actually does is to multiply the number "
33721 "part by the modifier part and pass the result to the C API. However this "
33722 "doesn't work for a few APIs which aren't expecting bytes, but are already "
33723 "expecting some other unit (eg. megabytes)."
33727 #: ../src/guestfs.pod:844
33728 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
33732 #: ../src/guestfs.pod:846
33735 " lvcreate LV VG 100M\n"
33740 #: ../src/guestfs.pod:848
33742 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
33743 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
33744 "megabytes * megabytes) logical volume. The error message you get from this "
33745 "is also a little obscure."
33749 #: ../src/guestfs.pod:853
33751 "This could be fixed in the generator by specially marking parameters and "
33752 "return values which take bytes or other units."
33756 #: ../src/guestfs.pod:856
33757 msgid "Ambiguity between devices and paths"
33761 #: ../src/guestfs.pod:858
33763 "There is a subtle ambiguity in the API between a device name "
33764 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
33765 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
33769 #: ../src/guestfs.pod:863
33771 "In the current API we usually resolve this ambiguity by having two separate "
33772 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
33773 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
33774 "detecting if the path supplied begins with C</dev/>."
33778 #: ../src/guestfs.pod:869
33780 "To avoid both the ambiguity and the need to duplicate some calls, we could "
33781 "make paths/devices into structured names. One way to do this would be to "
33782 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
33783 "aspect of grub. Another way would be to use a structured type, equivalent "
33784 "to this OCaml type:"
33788 #: ../src/guestfs.pod:875
33791 " type path = Path of string | Device of int | Partition of int * int\n"
33796 #: ../src/guestfs.pod:877
33797 msgid "which would allow you to pass arguments like:"
33801 #: ../src/guestfs.pod:879
33804 " Path \"/foo/bar\"\n"
33805 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
33806 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
33807 " Path \"/dev/sdb2\" (* not a device *)\n"
33812 #: ../src/guestfs.pod:884
33814 "As you can see there are still problems to resolve even with this "
33815 "representation. Also consider how it might work in guestfish."
33819 #: ../src/guestfs.pod:889
33820 msgid "KEYS AND PASSPHRASES"
33824 #: ../src/guestfs.pod:891
33826 "Certain libguestfs calls take a parameter that contains sensitive key "
33827 "material, passed in as a C string."
33831 #: ../src/guestfs.pod:894
33833 "In the future we would hope to change the libguestfs implementation so that "
33834 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
33835 "swap. However this is I<not> done at the moment, because of the complexity "
33836 "of such an implementation."
33840 #: ../src/guestfs.pod:899
33842 "Therefore you should be aware that any key parameter you pass to libguestfs "
33843 "might end up being written out to the swap partition. If this is a concern, "
33844 "scrub the swap partition or don't use libguestfs on encrypted devices."
33848 #: ../src/guestfs.pod:904
33849 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
33853 #: ../src/guestfs.pod:906
33855 "All high-level libguestfs actions are synchronous. If you want to use "
33856 "libguestfs asynchronously then you must create a thread."
33860 #: ../src/guestfs.pod:909
33862 "Only use the handle from a single thread. Either use the handle exclusively "
33863 "from one thread, or provide your own mutex so that two threads cannot issue "
33864 "calls on the same handle at the same time."
33868 #: ../src/guestfs.pod:913
33870 "See the graphical program guestfs-browser for one possible architecture for "
33871 "multithreaded programs using libvirt and libguestfs."
33875 #: ../src/guestfs.pod:916
33880 #: ../src/guestfs.pod:918
33882 "Libguestfs needs a supermin appliance, which it finds by looking along an "
33887 #: ../src/guestfs.pod:921
33889 "By default it looks for these in the directory C<$libdir/guestfs> "
33890 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
33894 #: ../src/guestfs.pod:924
33896 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
33897 "to change the directories that libguestfs will search in. The value is a "
33898 "colon-separated list of paths. The current directory is I<not> searched "
33899 "unless the path contains an empty element or C<.>. For example "
33900 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
33901 "then C</usr/lib/guestfs>."
33905 #: ../src/guestfs.pod:931
33906 msgid "QEMU WRAPPERS"
33910 #: ../src/guestfs.pod:933
33912 "If you want to compile your own qemu, run qemu from a non-standard location, "
33913 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
33918 #: ../src/guestfs.pod:937
33920 "There is one important rule to remember: you I<must C<exec qemu>> as the "
33921 "last command in the shell script (so that qemu replaces the shell and "
33922 "becomes the direct child of the libguestfs-using program). If you don't do "
33923 "this, then the qemu process won't be cleaned up correctly."
33927 #: ../src/guestfs.pod:942
33929 "Here is an example of a wrapper, where I have built my own copy of qemu from "
33934 #: ../src/guestfs.pod:945
33938 " qemudir=/home/rjones/d/qemu\n"
33939 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
33945 #: ../src/guestfs.pod:949
33947 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
33948 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
33953 #: ../src/guestfs.pod:953
33956 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
33961 #: ../src/guestfs.pod:955
33963 "Note that libguestfs also calls qemu with the -help and -version options in "
33964 "order to determine features."
33968 #: ../src/guestfs.pod:958
33970 "Wrappers can also be used to edit the options passed to qemu. In the "
33971 "following example, the C<-machine ...> option (C<-machine> and the following "
33972 "argument) are removed from the command line and replaced with C<-machine "
33973 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
33974 "right one to remove, putting the remaining options into the C<args> array."
33978 #: ../src/guestfs.pod:967
33982 " while [ $# -gt 0 ]; do\n"
33983 " case \"$1\" in\n"
33987 " args[i]=\"$1\"\n"
33996 #: ../src/guestfs.pod:979
33999 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
34004 #: ../src/guestfs.pod:981
34005 msgid "ATTACHING TO RUNNING DAEMONS"
34009 #: ../src/guestfs.pod:983
34011 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
34012 "babies. Use with caution."
34016 #: ../src/guestfs.pod:986
34018 "I<Note (2):> This section explains how to attach to a running daemon from a "
34019 "low level perspective. For most users, simply using virt tools such as "
34020 "L<guestfish(1)> with the I<--live> option will \"just work\"."
34024 #: ../src/guestfs.pod:990
34025 msgid "Using guestfs_set_attach_method"
34029 #: ../src/guestfs.pod:992
34031 "By calling L</guestfs_set_attach_method> you can change how the library "
34032 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
34033 "L</ARCHITECTURE> for some background)."
34037 #: ../src/guestfs.pod:996
34039 "The normal attach method is C<appliance>, where a small appliance is created "
34040 "containing the daemon, and then the library connects to this."
34044 #: ../src/guestfs.pod:999
34046 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
34047 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
34048 "daemon over the Unix domain socket."
34052 #: ../src/guestfs.pod:1003
34054 "The normal use for this is to connect to a running virtual machine that "
34055 "contains a C<guestfsd> daemon, and send commands so you can read and write "
34056 "files inside the live virtual machine."
34060 #: ../src/guestfs.pod:1007
34061 msgid "Using guestfs_add_domain with live flag"
34065 #: ../src/guestfs.pod:1009
34067 "L</guestfs_add_domain> provides some help for getting the correct attach "
34068 "method. If you pass the C<live> option to this function, then (if the "
34069 "virtual machine is running) it will examine the libvirt XML looking for a "
34070 "virtio-serial channel to connect to:"
34074 #: ../src/guestfs.pod:1015
34081 " <channel type='unix'>\n"
34082 " <source mode='bind' path='/path/to/socket'/>\n"
34083 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
34092 #: ../src/guestfs.pod:1027
34094 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
34095 "method to C<unix:/path/to/socket>."
34099 #: ../src/guestfs.pod:1030
34101 "Some of the libguestfs tools (including guestfish) support a I<--live> "
34102 "option which is passed through to L</guestfs_add_domain> thus allowing you "
34103 "to attach to and modify live virtual machines."
34107 #: ../src/guestfs.pod:1034
34109 "The virtual machine needs to have been set up beforehand so that it has the "
34110 "virtio-serial channel and so that guestfsd is running inside it."
34114 #: ../src/guestfs.pod:1038
34115 msgid "ABI GUARANTEE"
34119 #: ../src/guestfs.pod:1040
34121 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
34122 "actions as outlined in this section. Although we will deprecate some "
34123 "actions, for example if they get replaced by newer calls, we will keep the "
34124 "old actions forever. This allows you the developer to program in confidence "
34125 "against the libguestfs API."
34129 #: ../src/guestfs.pod:1046
34130 msgid "BLOCK DEVICE NAMING"
34134 #: ../src/guestfs.pod:1048
34136 "In the kernel there is now quite a profusion of schemata for naming block "
34137 "devices (in this context, by I<block device> I mean a physical or virtual "
34138 "hard drive). The original Linux IDE driver used names starting with "
34139 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
34140 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
34141 "replacement for the old IDE driver (particularly for SATA devices) those "
34142 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
34143 "machines with paravirtualized drivers. This has created several different "
34144 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
34149 #: ../src/guestfs.pod:1060
34151 "As discussed above, libguestfs uses a qemu appliance running an embedded "
34152 "Linux kernel to access block devices. We can run a variety of appliances "
34153 "based on a variety of Linux kernels."
34157 #: ../src/guestfs.pod:1064
34159 "This causes a problem for libguestfs because many API calls use device or "
34160 "partition names. Working scripts and the recipe (example) scripts that we "
34161 "make available over the internet could fail if the naming scheme changes."
34165 #: ../src/guestfs.pod:1069
34167 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
34168 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
34169 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
34170 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
34174 #: ../src/guestfs.pod:1075
34176 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
34177 "L</guestfs_list_partitions> and similar calls return the true names of the "
34178 "devices and partitions as known to the appliance."
34182 #: ../src/guestfs.pod:1080
34183 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
34187 #: ../src/guestfs.pod:1082
34189 "Usually this translation is transparent. However in some (very rare) cases "
34190 "you may need to know the exact algorithm. Such cases include where you use "
34191 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
34192 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
34197 #: ../src/guestfs.pod:1088
34199 "The algorithm is applied only to I<parameters> which are known to be either "
34200 "device or partition names. Return values from functions such as "
34201 "L</guestfs_list_devices> are never changed."
34205 #: ../src/guestfs.pod:1096
34206 msgid "Is the string a parameter which is a device or partition name?"
34210 #: ../src/guestfs.pod:1100
34211 msgid "Does the string begin with C</dev/sd>?"
34215 #: ../src/guestfs.pod:1104
34217 "Does the named device exist? If so, we use that device. However if I<not> "
34218 "then we continue with this algorithm."
34222 #: ../src/guestfs.pod:1109
34223 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
34227 #: ../src/guestfs.pod:1111
34228 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
34232 #: ../src/guestfs.pod:1113
34233 msgid "If that named device exists, use it. If not, continue."
34237 #: ../src/guestfs.pod:1117
34238 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
34242 #: ../src/guestfs.pod:1119
34243 msgid "If that named device exists, use it. If not, return an error."
34247 #: ../src/guestfs.pod:1123
34248 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
34252 #: ../src/guestfs.pod:1125
34254 "Although the standard naming scheme and automatic translation is useful for "
34255 "simple programs and guestfish scripts, for larger programs it is best not to "
34256 "rely on this mechanism."
34260 #: ../src/guestfs.pod:1129
34262 "Where possible for maximum future portability programs using libguestfs "
34263 "should use these future-proof techniques:"
34267 #: ../src/guestfs.pod:1136
34269 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
34270 "device names, and then use those names directly."
34274 #: ../src/guestfs.pod:1139
34275 msgid "Since those device names exist by definition, they will never be translated."
34279 #: ../src/guestfs.pod:1144
34281 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
34282 "filesystem labels."
34286 #: ../src/guestfs.pod:1149
34291 #: ../src/guestfs.pod:1151
34293 "This section discusses security implications of using libguestfs, "
34294 "particularly with untrusted or malicious guests or disk images."
34298 #: ../src/guestfs.pod:1154
34299 msgid "GENERAL SECURITY CONSIDERATIONS"
34303 #: ../src/guestfs.pod:1156
34305 "Be careful with any files or data that you download from a guest (by "
34306 "\"download\" we mean not just the L</guestfs_download> command but any "
34307 "command that reads files, filenames, directories or anything else from a "
34308 "disk image). An attacker could manipulate the data to fool your program "
34309 "into doing the wrong thing. Consider cases such as:"
34313 #: ../src/guestfs.pod:1166
34314 msgid "the data (file etc) not being present"
34318 #: ../src/guestfs.pod:1170
34319 msgid "being present but empty"
34323 #: ../src/guestfs.pod:1174
34324 msgid "being much larger than normal"
34328 #: ../src/guestfs.pod:1178
34329 msgid "containing arbitrary 8 bit data"
34333 #: ../src/guestfs.pod:1182
34334 msgid "being in an unexpected character encoding"
34338 #: ../src/guestfs.pod:1186
34339 msgid "containing homoglyphs."
34343 #: ../src/guestfs.pod:1190
34344 msgid "SECURITY OF MOUNTING FILESYSTEMS"
34348 #: ../src/guestfs.pod:1192
34350 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
34351 "(VFS) module can sometimes be escalated into exploits by deliberately "
34352 "creating a malicious, malformed filesystem. These exploits are very severe "
34353 "for two reasons. Firstly there are very many filesystem drivers in the "
34354 "kernel, and many of them are infrequently used and not much developer "
34355 "attention has been paid to the code. Linux userspace helps potential "
34356 "crackers by detecting the filesystem type and automatically choosing the "
34357 "right VFS driver, even if that filesystem type is obscure or unexpected for "
34358 "the administrator. Secondly, a kernel-level exploit is like a local root "
34359 "exploit (worse in some ways), giving immediate and total access to the "
34360 "system right down to the hardware level."
34364 #: ../src/guestfs.pod:1205
34366 "That explains why you should never mount a filesystem from an untrusted "
34367 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
34368 "inside a qemu virtual machine, usually running as a non-root user. The "
34369 "attacker would need to write a filesystem which first exploited the kernel, "
34370 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
34371 "the libguestfs protocol, and finally to be as serious as the host kernel "
34372 "exploit it would need to escalate its privileges to root. This multi-step "
34373 "escalation, performed by a static piece of data, is thought to be extremely "
34374 "hard to do, although we never say 'never' about security issues."
34378 #: ../src/guestfs.pod:1216
34380 "In any case callers can reduce the attack surface by forcing the filesystem "
34381 "type when mounting (use L</guestfs_mount_vfs>)."
34385 #: ../src/guestfs.pod:1219
34386 msgid "PROTOCOL SECURITY"
34390 #: ../src/guestfs.pod:1221
34392 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
34393 "defined upper message size. However a program that uses libguestfs must "
34394 "also take care - for example you can write a program that downloads a binary "
34395 "from a disk image and executes it locally, and no amount of protocol "
34396 "security will save you from the consequences."
34400 #: ../src/guestfs.pod:1227
34401 msgid "INSPECTION SECURITY"
34405 #: ../src/guestfs.pod:1229
34407 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
34408 "directly from the guest, and these could contain any 8 bit data. Callers "
34409 "should be careful to escape these before printing them to a structured file "
34410 "(for example, use HTML escaping if creating a web page)."
34414 #: ../src/guestfs.pod:1235
34416 "Guest configuration may be altered in unusual ways by the administrator of "
34417 "the virtual machine, and may not reflect reality (particularly for untrusted "
34418 "or actively malicious guests). For example we parse the hostname from "
34419 "configuration files like C</etc/sysconfig/network> that we find in the "
34420 "guest, but the guest administrator can easily manipulate these files to "
34421 "provide the wrong hostname."
34425 #: ../src/guestfs.pod:1243
34427 "The inspection API parses guest configuration using two external libraries: "
34428 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
34429 "designed to be robust in the face of malicious data, although denial of "
34430 "service attacks are still possible, for example with oversized configuration "
34435 #: ../src/guestfs.pod:1249
34436 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
34440 #: ../src/guestfs.pod:1251
34442 "Be very cautious about running commands from the guest. By running a "
34443 "command in the guest, you are giving CPU time to a binary that you do not "
34444 "control, under the same user account as the library, albeit wrapped in qemu "
34445 "virtualization. More information and alternatives can be found in the "
34446 "section L</RUNNING COMMANDS>."
34450 #: ../src/guestfs.pod:1257
34451 msgid "CVE-2010-3851"
34455 #: ../src/guestfs.pod:1259
34456 msgid "https://bugzilla.redhat.com/642934"
34460 #: ../src/guestfs.pod:1261
34462 "This security bug concerns the automatic disk format detection that qemu "
34463 "does on disk images."
34467 #: ../src/guestfs.pod:1264
34469 "A raw disk image is just the raw bytes, there is no header. Other disk "
34470 "images like qcow2 contain a special header. Qemu deals with this by looking "
34471 "for one of the known headers, and if none is found then assuming the disk "
34472 "image must be raw."
34476 #: ../src/guestfs.pod:1269
34478 "This allows a guest which has been given a raw disk image to write some "
34479 "other header. At next boot (or when the disk image is accessed by "
34480 "libguestfs) qemu would do autodetection and think the disk image format was, "
34481 "say, qcow2 based on the header written by the guest."
34485 #: ../src/guestfs.pod:1274
34487 "This in itself would not be a problem, but qcow2 offers many features, one "
34488 "of which is to allow a disk image to refer to another image (called the "
34489 "\"backing disk\"). It does this by placing the path to the backing disk "
34490 "into the qcow2 header. This path is not validated and could point to any "
34491 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
34492 "\"holes\" in the qcow2 disk image, which of course is completely under the "
34493 "control of the attacker."
34497 #: ../src/guestfs.pod:1282
34498 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
34502 #: ../src/guestfs.pod:1289
34503 msgid "You have enabled the network or have opened the disk in write mode."
34507 #: ../src/guestfs.pod:1293
34509 "You are also running untrusted code from the guest (see L</RUNNING "
34514 #: ../src/guestfs.pod:1298
34516 "The way to avoid this is to specify the expected disk format when adding "
34517 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
34518 "should always do this if the disk is raw format, and it's a good idea for "
34523 #: ../src/guestfs.pod:1303
34525 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
34526 "format is fetched from libvirt and passed through."
34530 #: ../src/guestfs.pod:1306
34532 "For libguestfs tools, use the I<--format> command line parameter as "
34537 #: ../src/guestfs.pod:1309
34538 msgid "CONNECTION MANAGEMENT"
34542 #: ../src/guestfs.pod:1311
34543 msgid "guestfs_h *"
34547 #: ../src/guestfs.pod:1313
34549 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
34550 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
34551 "handle and release all resources used."
34555 #: ../src/guestfs.pod:1317
34557 "For information on using multiple handles and threads, see the section "
34558 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
34562 #: ../src/guestfs.pod:1320
34563 msgid "guestfs_create"
34567 #: ../src/guestfs.pod:1322
34570 " guestfs_h *guestfs_create (void);\n"
34575 #: ../src/guestfs.pod:1324
34576 msgid "Create a connection handle."
34580 #: ../src/guestfs.pod:1326
34582 "On success this returns a non-NULL pointer to a handle. On error it returns "
34587 #: ../src/guestfs.pod:1329
34589 "You have to \"configure\" the handle after creating it. This includes "
34590 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
34591 "handle at least once."
34595 #: ../src/guestfs.pod:1333
34596 msgid "After configuring the handle, you have to call L</guestfs_launch>."
34600 #: ../src/guestfs.pod:1335
34602 "You may also want to configure error handling for the handle. See the "
34603 "L</ERROR HANDLING> section below."
34607 #: ../src/guestfs.pod:1338
34608 msgid "guestfs_close"
34612 #: ../src/guestfs.pod:1340
34615 " void guestfs_close (guestfs_h *g);\n"
34620 #: ../src/guestfs.pod:1342
34621 msgid "This closes the connection handle and frees up all resources used."
34625 #: ../src/guestfs.pod:1344
34627 "If autosync was set on the handle and the handle was launched, then this "
34628 "implicitly calls various functions to unmount filesystems and sync the "
34629 "disk. See L</guestfs_set_autosync> for more details."
34633 #: ../src/guestfs.pod:1348
34634 msgid "If a close callback was set on the handle, then it is called."
34638 #: ../src/guestfs.pod:1350
34639 msgid "ERROR HANDLING"
34643 #: ../src/guestfs.pod:1352
34645 "API functions can return errors. For example, almost all functions that "
34646 "return C<int> will return C<-1> to indicate an error."
34650 #: ../src/guestfs.pod:1355
34652 "Additional information is available for errors: an error message string and "
34653 "optionally an error number (errno) if the thing that failed was a system "
34658 #: ../src/guestfs.pod:1359
34660 "You can get at the additional information about the last error on the handle "
34661 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
34662 "up an error handler with L</guestfs_set_error_handler>."
34666 #: ../src/guestfs.pod:1364
34668 "When the handle is created, a default error handler is installed which "
34669 "prints the error message string to C<stderr>. For small short-running "
34670 "command line programs it is sufficient to do:"
34674 #: ../src/guestfs.pod:1368
34677 " if (guestfs_launch (g) == -1)\n"
34678 " exit (EXIT_FAILURE);\n"
34683 #: ../src/guestfs.pod:1371
34685 "since the default error handler will ensure that an error message has been "
34686 "printed to C<stderr> before the program exits."
34690 #: ../src/guestfs.pod:1374
34692 "For other programs the caller will almost certainly want to install an "
34693 "alternate error handler or do error handling in-line like this:"
34697 #: ../src/guestfs.pod:1377
34700 " /* This disables the default behaviour of printing errors\n"
34702 " guestfs_set_error_handler (g, NULL, NULL);\n"
34707 #: ../src/guestfs.pod:1381
34710 " if (guestfs_launch (g) == -1) {\n"
34711 " /* Examine the error message and print it etc. */\n"
34712 " char *msg = guestfs_last_error (g);\n"
34713 " int errnum = guestfs_last_errno (g);\n"
34714 " fprintf (stderr, \"%s\", msg);\n"
34715 " if (errnum != 0)\n"
34716 " fprintf (stderr, \": %s\", strerror (errnum));\n"
34717 " fprintf (stderr, \"\\n\");\n"
34724 #: ../src/guestfs.pod:1392
34726 "Out of memory errors are handled differently. The default action is to call "
34727 "L<abort(3)>. If this is undesirable, then you can set a handler using "
34728 "L</guestfs_set_out_of_memory_handler>."
34732 #: ../src/guestfs.pod:1396
34734 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
34735 "because there is no handle if this happens there is no way to get additional "
34736 "error information. However L</guestfs_create> is supposed to be a "
34737 "lightweight operation which can only fail because of insufficient memory (it "
34738 "returns NULL in this case)."
34742 #: ../src/guestfs.pod:1402
34743 msgid "guestfs_last_error"
34747 #: ../src/guestfs.pod:1404
34750 " const char *guestfs_last_error (guestfs_h *g);\n"
34755 #: ../src/guestfs.pod:1406
34757 "This returns the last error message that happened on C<g>. If there has not "
34758 "been an error since the handle was created, then this returns C<NULL>."
34762 #: ../src/guestfs.pod:1410
34764 "The lifetime of the returned string is until the next error occurs, or "
34765 "L</guestfs_close> is called."
34769 #: ../src/guestfs.pod:1413
34770 msgid "guestfs_last_errno"
34774 #: ../src/guestfs.pod:1415
34777 " int guestfs_last_errno (guestfs_h *g);\n"
34782 #: ../src/guestfs.pod:1417
34783 msgid "This returns the last error number (errno) that happened on C<g>."
34787 #: ../src/guestfs.pod:1419
34788 msgid "If successful, an errno integer not equal to zero is returned."
34792 #: ../src/guestfs.pod:1421
34793 msgid "If no error, this returns 0. This call can return 0 in three situations:"
34797 #: ../src/guestfs.pod:1428
34798 msgid "There has not been any error on the handle."
34802 #: ../src/guestfs.pod:1432
34804 "There has been an error but the errno was meaningless. This corresponds to "
34805 "the case where the error did not come from a failed system call, but for "
34806 "some other reason."
34810 #: ../src/guestfs.pod:1438
34812 "There was an error from a failed system call, but for some reason the errno "
34813 "was not captured and returned. This usually indicates a bug in libguestfs."
34817 #: ../src/guestfs.pod:1444
34819 "Libguestfs tries to convert the errno from inside the applicance into a "
34820 "corresponding errno for the caller (not entirely trivial: the appliance "
34821 "might be running a completely different operating system from the library "
34822 "and error numbers are not standardized across Un*xen). If this could not be "
34823 "done, then the error is translated to C<EINVAL>. In practice this should "
34824 "only happen in very rare circumstances."
34828 #: ../src/guestfs.pod:1452
34829 msgid "guestfs_set_error_handler"
34833 #: ../src/guestfs.pod:1454
34836 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
34838 " const char *msg);\n"
34839 " void guestfs_set_error_handler (guestfs_h *g,\n"
34840 " guestfs_error_handler_cb cb,\n"
34841 " void *opaque);\n"
34846 #: ../src/guestfs.pod:1461
34848 "The callback C<cb> will be called if there is an error. The parameters "
34849 "passed to the callback are an opaque data pointer and the error message "
34854 #: ../src/guestfs.pod:1465
34856 "C<errno> is not passed to the callback. To get that the callback must call "
34857 "L</guestfs_last_errno>."
34861 #: ../src/guestfs.pod:1468
34863 "Note that the message string C<msg> is freed as soon as the callback "
34864 "function returns, so if you want to stash it somewhere you must make your "
34869 #: ../src/guestfs.pod:1472
34870 msgid "The default handler prints messages on C<stderr>."
34874 #: ../src/guestfs.pod:1474
34875 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
34879 #: ../src/guestfs.pod:1476
34880 msgid "guestfs_get_error_handler"
34884 #: ../src/guestfs.pod:1478
34887 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
34888 " void **opaque_rtn);\n"
34893 #: ../src/guestfs.pod:1481
34894 msgid "Returns the current error handler callback."
34898 #: ../src/guestfs.pod:1483
34899 msgid "guestfs_set_out_of_memory_handler"
34903 #: ../src/guestfs.pod:1485
34906 " typedef void (*guestfs_abort_cb) (void);\n"
34907 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
34908 " guestfs_abort_cb);\n"
34913 #: ../src/guestfs.pod:1489
34915 "The callback C<cb> will be called if there is an out of memory situation. "
34916 "I<Note this callback must not return>."
34920 #: ../src/guestfs.pod:1492
34921 msgid "The default is to call L<abort(3)>."
34925 #: ../src/guestfs.pod:1494
34926 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
34930 #: ../src/guestfs.pod:1497
34931 msgid "guestfs_get_out_of_memory_handler"
34935 #: ../src/guestfs.pod:1499
34938 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
34943 #: ../src/guestfs.pod:1501
34944 msgid "This returns the current out of memory handler."
34948 #: ../src/guestfs.pod:1503
34953 #: ../src/guestfs.pod:1507
34958 #: ../src/guestfs.pod:1509
34963 #: ../src/guestfs.pod:1511
34964 msgid "AVAILABILITY"
34968 #: ../src/guestfs.pod:1513
34969 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
34973 #: ../src/guestfs.pod:1515
34975 "Using L</guestfs_available> you can test availability of the following "
34976 "groups of functions. This test queries the appliance to see if the "
34977 "appliance you are currently using supports the functionality."
34981 #: ../src/guestfs.pod:1520
34982 msgid "@AVAILABILITY@"
34986 #: ../src/guestfs.pod:1522
34987 msgid "GUESTFISH supported COMMAND"
34991 #: ../src/guestfs.pod:1524
34993 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
34994 "prints out the available groups and whether they are supported by this build "
34995 "of libguestfs. Note however that you have to do C<run> first."
34999 #: ../src/guestfs.pod:1529
35000 msgid "SINGLE CALLS AT COMPILE TIME"
35004 #: ../src/guestfs.pod:1531
35006 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
35007 "function, such as:"
35011 #: ../src/guestfs.pod:1534
35014 " #define LIBGUESTFS_HAVE_DD 1\n"
35019 #: ../src/guestfs.pod:1536
35020 msgid "if L</guestfs_dd> is available."
35024 #: ../src/guestfs.pod:1538
35026 "Before version 1.5.8, if you needed to test whether a single libguestfs "
35027 "function is available at compile time, we recommended using build tools such "
35028 "as autoconf or cmake. For example in autotools you could use:"
35032 #: ../src/guestfs.pod:1543
35035 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
35036 " AC_CHECK_FUNCS([guestfs_dd])\n"
35041 #: ../src/guestfs.pod:1546
35043 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
35048 #: ../src/guestfs.pod:1549
35049 msgid "SINGLE CALLS AT RUN TIME"
35053 #: ../src/guestfs.pod:1551
35055 "Testing at compile time doesn't guarantee that a function really exists in "
35056 "the library. The reason is that you might be dynamically linked against a "
35057 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
35058 "This situation unfortunately results in a segmentation fault, which is a "
35059 "shortcoming of the C dynamic linking system itself."
35063 #: ../src/guestfs.pod:1558
35065 "You can use L<dlopen(3)> to test if a function is available at run time, as "
35066 "in this example program (note that you still need the compile time check as "
35071 #: ../src/guestfs.pod:1562
35074 " #include <stdio.h>\n"
35075 " #include <stdlib.h>\n"
35076 " #include <unistd.h>\n"
35077 " #include <dlfcn.h>\n"
35078 " #include <guestfs.h>\n"
35083 #: ../src/guestfs.pod:1568
35088 " #ifdef LIBGUESTFS_HAVE_DD\n"
35090 " int has_function;\n"
35095 #: ../src/guestfs.pod:1574
35098 " /* Test if the function guestfs_dd is really available. */\n"
35099 " dl = dlopen (NULL, RTLD_LAZY);\n"
35101 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
35102 " exit (EXIT_FAILURE);\n"
35104 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
35110 #: ../src/guestfs.pod:1583
35113 " if (!has_function)\n"
35114 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
35116 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
35117 " /* Now it's safe to call\n"
35118 " guestfs_dd (g, \"foo\", \"bar\");\n"
35122 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
35129 #: ../src/guestfs.pod:1596
35131 "You may think the above is an awful lot of hassle, and it is. There are "
35132 "other ways outside of the C linking system to ensure that this kind of "
35133 "incompatibility never arises, such as using package versioning:"
35137 #: ../src/guestfs.pod:1601
35140 " Requires: libguestfs >= 1.0.80\n"
35145 #: ../src/guestfs.pod:1603
35146 msgid "CALLS WITH OPTIONAL ARGUMENTS"
35150 #: ../src/guestfs.pod:1605
35152 "A recent feature of the API is the introduction of calls which take optional "
35153 "arguments. In C these are declared 3 ways. The main way is as a call which "
35154 "takes variable arguments (ie. C<...>), as in this example:"
35158 #: ../src/guestfs.pod:1610
35161 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
35166 #: ../src/guestfs.pod:1612
35168 "Call this with a list of optional arguments, terminated by C<-1>. So to "
35169 "call with no optional arguments specified:"
35173 #: ../src/guestfs.pod:1615
35176 " guestfs_add_drive_opts (g, filename, -1);\n"
35181 #: ../src/guestfs.pod:1617
35182 msgid "With a single optional argument:"
35186 #: ../src/guestfs.pod:1619
35189 " guestfs_add_drive_opts (g, filename,\n"
35190 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35196 #: ../src/guestfs.pod:1623
35201 #: ../src/guestfs.pod:1625
35204 " guestfs_add_drive_opts (g, filename,\n"
35205 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35206 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35212 #: ../src/guestfs.pod:1630
35214 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
35219 #: ../src/guestfs.pod:1633
35220 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
35224 #: ../src/guestfs.pod:1635
35226 "The second variant has the same name with the suffix C<_va>, which works the "
35227 "same way but takes a C<va_list>. See the C manual for details. For the "
35228 "example function, this is declared:"
35232 #: ../src/guestfs.pod:1639
35235 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
35236 " va_list args);\n"
35241 #: ../src/guestfs.pod:1642
35242 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
35246 #: ../src/guestfs.pod:1644
35248 "The third variant is useful where you need to construct these calls. You "
35249 "pass in a structure where you fill in the optional fields. The structure "
35250 "has a bitmask as the first element which you must set to indicate which "
35251 "fields you have filled in. For our example function the structure and call "
35256 #: ../src/guestfs.pod:1650
35259 " struct guestfs_add_drive_opts_argv {\n"
35260 " uint64_t bitmask;\n"
35262 " const char *format;\n"
35265 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
35266 " const struct guestfs_add_drive_opts_argv *optargs);\n"
35271 #: ../src/guestfs.pod:1659
35272 msgid "You could call it like this:"
35276 #: ../src/guestfs.pod:1661
35279 " struct guestfs_add_drive_opts_argv optargs = {\n"
35280 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
35281 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
35282 " .readonly = 1,\n"
35283 " .format = \"qcow2\"\n"
35289 #: ../src/guestfs.pod:1668
35292 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
35297 #: ../src/guestfs.pod:1676
35298 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
35302 #: ../src/guestfs.pod:1681
35303 msgid "You do not need to fill in all fields of the structure."
35307 #: ../src/guestfs.pod:1685
35309 "There must be a one-to-one correspondence between fields of the structure "
35310 "that are filled in, and bits set in the bitmask."
35314 #: ../src/guestfs.pod:1690
35315 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
35319 #: ../src/guestfs.pod:1692
35321 "In other languages, optional arguments are expressed in the way that is "
35322 "natural for that language. We refer you to the language-specific "
35323 "documentation for more details on that."
35327 #: ../src/guestfs.pod:1696
35328 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
35332 #: ../src/guestfs.pod:1698
35333 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
35337 #: ../src/guestfs.pod:1700
35339 "B<Note:> This section documents the generic event mechanism introduced in "
35340 "libguestfs 1.10, which you should use in new code if possible. The old "
35341 "functions C<guestfs_set_log_message_callback>, "
35342 "C<guestfs_set_subprocess_quit_callback>, "
35343 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
35344 "C<guestfs_set_progress_callback> are no longer documented in this manual "
35345 "page. Because of the ABI guarantee, the old functions continue to work."
35349 #: ../src/guestfs.pod:1709
35351 "Handles generate events when certain things happen, such as log messages "
35352 "being generated, progress messages during long-running operations, or the "
35353 "handle being closed. The API calls described below let you register a "
35354 "callback to be called when events happen. You can register multiple "
35355 "callbacks (for the same, different or overlapping sets of events), and "
35356 "individually remove callbacks. If callbacks are not removed, then they "
35357 "remain in force until the handle is closed."
35361 #: ../src/guestfs.pod:1717
35363 "In the current implementation, events are only generated synchronously: that "
35364 "means that events (and hence callbacks) can only happen while you are in the "
35365 "middle of making another libguestfs call. The callback is called in the "
35370 #: ../src/guestfs.pod:1722
35372 "Events may contain a payload, usually nothing (void), an array of 64 bit "
35373 "unsigned integers, or a message buffer. Payloads are discussed later on."
35377 #: ../src/guestfs.pod:1726
35378 msgid "CLASSES OF EVENTS"
35382 #: ../src/guestfs.pod:1730
35383 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
35387 #: ../src/guestfs.pod:1733
35389 "The callback function will be called while the handle is being closed "
35390 "(synchronously from L</guestfs_close>)."
35394 #: ../src/guestfs.pod:1736
35396 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
35397 "handles that are open when the program exits. This means that this callback "
35398 "might be called indirectly from L<exit(3)>, which can cause unexpected "
35399 "problems in higher-level languages (eg. if your HLL interpreter has already "
35400 "been cleaned up by the time this is called, and if your callback then jumps "
35401 "into some HLL function)."
35405 #: ../src/guestfs.pod:1743
35407 "If no callback is registered: the handle is closed without any callback "
35412 #: ../src/guestfs.pod:1746
35413 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
35417 #: ../src/guestfs.pod:1749
35419 "The callback function will be called when the child process quits, either "
35420 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
35421 "corresponds to a transition from any state to the CONFIG state)."
35425 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
35426 msgid "If no callback is registered: the event is ignored."
35430 #: ../src/guestfs.pod:1755
35431 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
35435 #: ../src/guestfs.pod:1758
35437 "The callback function will be called when the child process becomes ready "
35438 "first time after it has been launched. (This corresponds to a transition "
35439 "from LAUNCHING to the READY state)."
35443 #: ../src/guestfs.pod:1764
35444 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
35448 #: ../src/guestfs.pod:1767
35450 "Some long-running operations can generate progress messages. If this "
35451 "callback is registered, then it will be called each time a progress message "
35452 "is generated (usually two seconds after the operation started, and three "
35453 "times per second thereafter until it completes, although the frequency may "
35454 "change in future versions)."
35458 #: ../src/guestfs.pod:1773
35460 "The callback receives in the payload four unsigned 64 bit numbers which are "
35461 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
35465 #: ../src/guestfs.pod:1776
35467 "The units of C<total> are not defined, although for some operations C<total> "
35468 "may relate in some way to the amount of data to be transferred (eg. in bytes "
35469 "or megabytes), and C<position> may be the portion which has been "
35474 #: ../src/guestfs.pod:1781
35475 msgid "The only defined and stable parts of the API are:"
35479 #: ../src/guestfs.pod:1787
35481 "The callback can display to the user some type of progress bar or indicator "
35482 "which shows the ratio of C<position>:C<total>."
35486 #: ../src/guestfs.pod:1792
35487 msgid "0 E<lt>= C<position> E<lt>= C<total>"
35491 #: ../src/guestfs.pod:1796
35493 "If any progress notification is sent during a call, then a final progress "
35494 "notification is always sent when C<position> = C<total> (I<unless> the call "
35495 "fails with an error)."
35499 #: ../src/guestfs.pod:1800
35501 "This is to simplify caller code, so callers can easily set the progress "
35502 "indicator to \"100%\" at the end of the operation, without requiring special "
35503 "code to detect this case."
35507 #: ../src/guestfs.pod:1806
35509 "For some calls we are unable to estimate the progress of the call, but we "
35510 "can still generate progress messages to indicate activity. This is known as "
35511 "\"pulse mode\", and is directly supported by certain progress bar "
35512 "implementations (eg. GtkProgressBar)."
35516 #: ../src/guestfs.pod:1811
35518 "For these calls, zero or more progress messages are generated with "
35519 "C<position = 0> and C<total = 1>, followed by a final message with "
35520 "C<position = total = 1>."
35524 #: ../src/guestfs.pod:1815
35526 "As noted above, if the call fails with an error then the final message may "
35527 "not be generated."
35531 #: ../src/guestfs.pod:1820
35533 "The callback also receives the procedure number (C<proc_nr>) and serial "
35534 "number (C<serial>) of the call. These are only useful for debugging "
35535 "protocol issues, and the callback can normally ignore them. The callback "
35536 "may want to print these numbers in error messages or debugging messages."
35540 #: ../src/guestfs.pod:1826
35541 msgid "If no callback is registered: progress messages are discarded."
35545 #: ../src/guestfs.pod:1828
35546 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
35550 #: ../src/guestfs.pod:1831
35552 "The callback function is called whenever a log message is generated by qemu, "
35553 "the appliance kernel, guestfsd (daemon), or utility programs."
35557 #: ../src/guestfs.pod:1834
35559 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
35560 "(L</guestfs_launch>) then additional debug messages are generated."
35564 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
35566 "If no callback is registered: the messages are discarded unless the verbose "
35567 "flag is set in which case they are sent to stderr. You can override the "
35568 "printing of verbose messages to stderr by setting up a callback."
35572 #: ../src/guestfs.pod:1842
35573 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
35577 #: ../src/guestfs.pod:1845
35579 "The callback function is called whenever a log message is generated by the "
35580 "library part of libguestfs."
35584 #: ../src/guestfs.pod:1848
35586 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
35587 "messages are generated."
35591 #: ../src/guestfs.pod:1856
35592 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
35596 #: ../src/guestfs.pod:1859
35598 "The callback function is called whenever a trace message is generated. This "
35599 "only applies if the trace flag (L</guestfs_set_trace>) is set."
35603 #: ../src/guestfs.pod:1862
35605 "If no callback is registered: the messages are sent to stderr. You can "
35606 "override the printing of trace messages to stderr by setting up a callback."
35610 #: ../src/guestfs.pod:1866
35611 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
35615 #: ../src/guestfs.pod:1869
35616 msgid "The callback function is called whenever a libguestfs function is entered."
35620 #: ../src/guestfs.pod:1872
35622 "The payload is a string which contains the name of the function that we are "
35623 "entering (not including C<guestfs_> prefix)."
35627 #: ../src/guestfs.pod:1875
35629 "Note that libguestfs functions can call themselves, so you may see many "
35630 "events from a single call. A few libguestfs functions do not generate this "
35635 #: ../src/guestfs.pod:1883
35636 msgid "guestfs_set_event_callback"
35640 #: ../src/guestfs.pod:1885
35643 " int guestfs_set_event_callback (guestfs_h *g,\n"
35644 " guestfs_event_callback cb,\n"
35645 " uint64_t event_bitmask,\n"
35647 " void *opaque);\n"
35652 #: ../src/guestfs.pod:1891
35654 "This function registers a callback (C<cb>) for all event classes in the "
35655 "C<event_bitmask>."
35659 #: ../src/guestfs.pod:1894
35661 "For example, to register for all log message events, you could call this "
35662 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
35663 "To register a single callback for all possible classes of events, use "
35664 "C<GUESTFS_EVENT_ALL>."
35668 #: ../src/guestfs.pod:1900
35669 msgid "C<flags> should always be passed as 0."
35673 #: ../src/guestfs.pod:1902
35675 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
35676 "it for any purpose."
35680 #: ../src/guestfs.pod:1905
35682 "The return value is the event handle (an integer) which you can use to "
35683 "delete the callback (see below)."
35687 #: ../src/guestfs.pod:1908
35689 "If there is an error, this function returns C<-1>, and sets the error in the "
35690 "handle in the usual way (see L</guestfs_last_error> etc.)"
35694 #: ../src/guestfs.pod:1911
35696 "Callbacks remain in effect until they are deleted, or until the handle is "
35701 #: ../src/guestfs.pod:1914
35703 "In the case where multiple callbacks are registered for a particular event "
35704 "class, all of the callbacks are called. The order in which multiple "
35705 "callbacks are called is not defined."
35709 #: ../src/guestfs.pod:1918
35710 msgid "guestfs_delete_event_callback"
35714 #: ../src/guestfs.pod:1920
35717 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
35722 #: ../src/guestfs.pod:1922
35724 "Delete a callback that was previously registered. C<event_handle> should be "
35725 "the integer that was returned by a previous call to "
35726 "C<guestfs_set_event_callback> on the same handle."
35730 #: ../src/guestfs.pod:1926
35731 msgid "guestfs_event_callback"
35735 #: ../src/guestfs.pod:1928
35738 " typedef void (*guestfs_event_callback) (\n"
35741 " uint64_t event,\n"
35742 " int event_handle,\n"
35744 " const char *buf, size_t buf_len,\n"
35745 " const uint64_t *array, size_t array_len);\n"
35750 #: ../src/guestfs.pod:1937
35751 msgid "This is the type of the event callback function that you have to provide."
35755 #: ../src/guestfs.pod:1940
35757 "The basic parameters are: the handle (C<g>), the opaque user pointer "
35758 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
35759 "handle, and C<flags> which in the current API you should ignore."
35763 #: ../src/guestfs.pod:1944
35765 "The remaining parameters contain the event payload (if any). Each event may "
35766 "contain a payload, which usually relates to the event class, but for future "
35767 "proofing your code should be written to handle any payload for any event "
35772 #: ../src/guestfs.pod:1949
35774 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
35775 "there is no message buffer). Note that this message buffer can contain "
35776 "arbitrary 8 bit data, including NUL bytes."
35780 #: ../src/guestfs.pod:1953
35782 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
35783 "moment this is only used for progress messages."
35787 #: ../src/guestfs.pod:1956
35788 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
35792 #: ../src/guestfs.pod:1958
35794 "One motivation for the generic event API was to allow GUI programs to "
35795 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
35796 "unconditionally to C<stderr>."
35800 #: ../src/guestfs.pod:1962
35802 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
35803 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
35804 "messages are not events; you must capture error messages separately)."
35808 #: ../src/guestfs.pod:1967
35810 "Programs have to set up a callback to capture the classes of events of "
35815 #: ../src/guestfs.pod:1970
35819 " guestfs_set_event_callback\n"
35820 " (g, message_callback,\n"
35821 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
35822 " GUESTFS_EVENT_TRACE,\n"
35823 " 0, NULL) == -1)\n"
35824 " if (eh == -1) {\n"
35825 " // handle error in the usual way\n"
35831 #: ../src/guestfs.pod:1980
35833 "The callback can then direct messages to the appropriate place. In this "
35834 "example, messages are directed to syslog:"
35838 #: ../src/guestfs.pod:1983
35842 " message_callback (\n"
35845 " uint64_t event,\n"
35846 " int event_handle,\n"
35848 " const char *buf, size_t buf_len,\n"
35849 " const uint64_t *array, size_t array_len)\n"
35851 " const int priority = LOG_USER|LOG_INFO;\n"
35852 " if (buf_len > 0)\n"
35853 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
35859 #: ../src/guestfs.pod:1998
35860 msgid "CANCELLING LONG TRANSFERS"
35864 #: ../src/guestfs.pod:2000
35866 "Some operations can be cancelled by the caller while they are in progress. "
35867 "Currently only operations that involve uploading or downloading data can be "
35868 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
35869 "parameters in the generator)."
35873 #: ../src/guestfs.pod:2005
35874 msgid "guestfs_user_cancel"
35878 #: ../src/guestfs.pod:2007
35881 " void guestfs_user_cancel (guestfs_h *g);\n"
35886 #: ../src/guestfs.pod:2009
35887 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
35891 #: ../src/guestfs.pod:2012
35893 "Unlike most other libguestfs calls, this function is signal safe and thread "
35894 "safe. You can call it from a signal handler or from another thread, without "
35895 "needing to do any locking."
35899 #: ../src/guestfs.pod:2016
35901 "The transfer that was in progress (if there is one) will stop shortly "
35902 "afterwards, and will return an error. The errno (see "
35903 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
35904 "out if the operation was cancelled or failed because of another error."
35908 #: ../src/guestfs.pod:2022
35910 "No cleanup is performed: for example, if a file was being uploaded then "
35911 "after cancellation there may be a partially uploaded file. It is the "
35912 "caller's responsibility to clean up if necessary."
35916 #: ../src/guestfs.pod:2026
35917 msgid "There are two common places that you might call C<guestfs_user_cancel>."
35921 #: ../src/guestfs.pod:2028
35923 "In an interactive text-based program, you might call it from a C<SIGINT> "
35924 "signal handler so that pressing C<^C> cancels the current operation. (You "
35925 "also need to call L</guestfs_set_pgroup> so that child processes don't "
35926 "receive the C<^C> signal)."
35930 #: ../src/guestfs.pod:2033
35932 "In a graphical program, when the main thread is displaying a progress bar "
35933 "with a cancel button, wire up the cancel button to call this function."
35937 #: ../src/guestfs.pod:2037
35938 msgid "PRIVATE DATA AREA"
35942 #: ../src/guestfs.pod:2039
35944 "You can attach named pieces of private data to the libguestfs handle, fetch "
35945 "them by name, and walk over them, for the lifetime of the handle. This is "
35946 "called the private data area and is only available from the C API."
35950 #: ../src/guestfs.pod:2044
35951 msgid "To attach a named piece of data, use the following call:"
35955 #: ../src/guestfs.pod:2046
35958 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
35963 #: ../src/guestfs.pod:2048
35965 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
35966 "pointer (which can be C<NULL>). Any previous item with the same key is "
35971 #: ../src/guestfs.pod:2052
35973 "You can use any C<key> you want, but your key should I<not> start with an "
35974 "underscore character. Keys beginning with an underscore character are "
35975 "reserved for internal libguestfs purposes (eg. for implementing language "
35976 "bindings). It is recommended that you prefix the key with some unique "
35977 "string to avoid collisions with other users."
35981 #: ../src/guestfs.pod:2058
35982 msgid "To retrieve the pointer, use:"
35986 #: ../src/guestfs.pod:2060
35989 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
35994 #: ../src/guestfs.pod:2062
35996 "This function returns C<NULL> if either no data is found associated with "
35997 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
36002 #: ../src/guestfs.pod:2066
36004 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
36005 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
36006 "all. In particular, libguestfs does I<not> try to free the data when the "
36007 "handle is closed. If the data must be freed, then the caller must either "
36008 "free it before calling L</guestfs_close> or must set up a close callback to "
36009 "do it (see L</GUESTFS_EVENT_CLOSE>)."
36013 #: ../src/guestfs.pod:2073
36014 msgid "To walk over all entries, use these two functions:"
36018 #: ../src/guestfs.pod:2075
36021 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
36026 #: ../src/guestfs.pod:2077
36029 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
36034 #: ../src/guestfs.pod:2079
36036 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
36037 "not have any particular meaning -- keys are not returned in any defined "
36038 "order). A pointer to the key is returned in C<*key_rtn> and the "
36039 "corresponding data pointer is returned from the function. C<NULL> is "
36040 "returned if there are no keys stored in the handle."
36044 #: ../src/guestfs.pod:2085
36046 "C<guestfs_next_private> returns the next key, pointer pair. The return "
36047 "value of this function is also C<NULL> is there are no further entries to "
36052 #: ../src/guestfs.pod:2089
36053 msgid "Notes about walking over entries:"
36057 #: ../src/guestfs.pod:2095
36058 msgid "You must not call C<guestfs_set_private> while walking over the entries."
36062 #: ../src/guestfs.pod:2100
36064 "The handle maintains an internal iterator which is reset when you call "
36065 "C<guestfs_first_private>. This internal iterator is invalidated when you "
36066 "call C<guestfs_set_private>."
36070 #: ../src/guestfs.pod:2106
36071 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
36075 #: ../src/guestfs.pod:2108
36078 " guestfs_set_private (g, key, NULL);\n"
36083 #: ../src/guestfs.pod:2110
36084 msgid "then that C<key> is not returned when walking."
36088 #: ../src/guestfs.pod:2114
36090 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
36091 "C<guestfs_next_private> or C<guestfs_set_private>."
36095 #: ../src/guestfs.pod:2120
36097 "The following example code shows how to print all keys and data pointers "
36098 "that are associated with the handle C<g>:"
36102 #: ../src/guestfs.pod:2123
36105 " const char *key;\n"
36106 " void *data = guestfs_first_private (g, &key);\n"
36107 " while (data != NULL)\n"
36109 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36110 " data = guestfs_next_private (g, &key);\n"
36116 #: ../src/guestfs.pod:2131
36118 "More commonly you are only interested in keys that begin with an "
36119 "application-specific prefix C<foo_>. Modify the loop like so:"
36123 #: ../src/guestfs.pod:2134
36126 " const char *key;\n"
36127 " void *data = guestfs_first_private (g, &key);\n"
36128 " while (data != NULL)\n"
36130 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36131 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36132 " data = guestfs_next_private (g, &key);\n"
36138 #: ../src/guestfs.pod:2143
36140 "If you need to modify keys while walking, then you have to jump back to the "
36141 "beginning of the loop. For example, to delete all keys prefixed with "
36146 #: ../src/guestfs.pod:2147
36149 " const char *key;\n"
36152 " data = guestfs_first_private (g, &key);\n"
36153 " while (data != NULL)\n"
36155 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36157 " guestfs_set_private (g, key, NULL);\n"
36158 " /* note that 'key' pointer is now invalid, and so is\n"
36159 " the internal iterator */\n"
36162 " data = guestfs_next_private (g, &key);\n"
36168 #: ../src/guestfs.pod:2163
36170 "Note that the above loop is guaranteed to terminate because the keys are "
36171 "being deleted, but other manipulations of keys within the loop might not "
36172 "terminate unless you also maintain an indication of which keys have been "
36177 #: ../src/guestfs.pod:2168
36182 #: ../src/guestfs.pod:2170
36184 "The libguestfs C library can be probed using systemtap or DTrace. This is "
36185 "true of any library, not just libguestfs. However libguestfs also contains "
36186 "static markers to help in probing internal operations."
36190 #: ../src/guestfs.pod:2174
36191 msgid "You can list all the static markers by doing:"
36195 #: ../src/guestfs.pod:2176
36198 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
36199 " .provider(\"guestfs\").mark(\"*\")'\n"
36204 #: ../src/guestfs.pod:2179
36206 "B<Note:> These static markers are I<not> part of the stable API and may "
36207 "change in future versions."
36211 #: ../src/guestfs.pod:2182
36212 msgid "SYSTEMTAP SCRIPT EXAMPLE"
36216 #: ../src/guestfs.pod:2184
36218 "This script contains examples of displaying both the static markers and some "
36219 "ordinary C entry points:"
36223 #: ../src/guestfs.pod:2187
36231 #: ../src/guestfs.pod:2189
36234 " function display_time () {\n"
36235 " now = gettimeofday_us ();\n"
36238 " delta = now - last;\n"
36244 #: ../src/guestfs.pod:2196
36247 " printf (\"%d (+%d):\", now, delta);\n"
36253 #: ../src/guestfs.pod:2199
36258 " printf (\"ready\\n\");\n"
36264 #: ../src/guestfs.pod:2204
36267 " /* Display all calls to static markers. */\n"
36268 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36269 " .provider(\"guestfs\").mark(\"*\") ? {\n"
36270 " display_time();\n"
36271 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
36277 #: ../src/guestfs.pod:2211
36280 " /* Display all calls to guestfs_mkfs* functions. */\n"
36281 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36282 " .function(\"guestfs_mkfs*\") ? {\n"
36283 " display_time();\n"
36284 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
36290 #: ../src/guestfs.pod:2218
36292 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
36293 "program. Note that you either have to be root, or you have to add yourself "
36294 "to several special stap groups. Consult the systemtap documentation for "
36295 "more information."
36299 #: ../src/guestfs.pod:2223
36302 " # stap /tmp/test.stap\n"
36308 #: ../src/guestfs.pod:2226
36309 msgid "In another terminal, run a guestfish command such as this:"
36313 #: ../src/guestfs.pod:2230
36314 msgid "In the first terminal, stap trace output similar to this is shown:"
36318 #: ../src/guestfs.pod:2232
36321 " 1318248056692655 (+0):\tlaunch_start\n"
36322 " 1318248056692850 (+195): launch_build_appliance_start\n"
36323 " 1318248056818285 (+125435): launch_build_appliance_end\n"
36324 " 1318248056838059 (+19774): launch_run_qemu\n"
36325 " 1318248061071167 (+4233108): launch_end\n"
36326 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
36327 "device=0x1024e60\n"
36332 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
36337 #: ../src/guestfs.pod:2241
36339 "<!-- old anchor for the next section --> <a "
36340 "name=\"state_machine_and_low_level_event_api\"/>"
36344 #: ../src/guestfs.pod:2246
36345 msgid "ARCHITECTURE"
36349 #: ../src/guestfs.pod:2248
36351 "Internally, libguestfs is implemented by running an appliance (a special "
36352 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
36353 "process of the main program."
36357 #: ../src/guestfs.pod:2252
36360 " ___________________\n"
36362 " | main program |\n"
36364 " | | child process / appliance\n"
36365 " | | __________________________\n"
36367 " +-------------------+ RPC | +-----------------+ |\n"
36368 " | libguestfs <--------------------> guestfsd | |\n"
36369 " | | | +-----------------+ |\n"
36370 " \\___________________/ | | Linux kernel | |\n"
36371 " | +--^--------------+ |\n"
36372 " \\_________|________________/\n"
36374 " _______v______\n"
36377 " | disk image |\n"
36378 " \\______________/\n"
36383 #: ../src/guestfs.pod:2272
36385 "The library, linked to the main program, creates the child process and hence "
36386 "the appliance in the L</guestfs_launch> function."
36390 #: ../src/guestfs.pod:2275
36392 "Inside the appliance is a Linux kernel and a complete stack of userspace "
36393 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
36394 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
36395 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
36396 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
36397 "attached to the qemu process which translates device access by the "
36398 "appliance's Linux kernel into accesses to the image."
36402 #: ../src/guestfs.pod:2284
36404 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
36405 "Although the disk image you are attached to might also be used by some "
36406 "virtual machine, libguestfs doesn't know or care about this. (But you will "
36407 "care if both libguestfs's qemu process and your virtual machine are trying "
36408 "to update the disk image at the same time, since these usually results in "
36409 "massive disk corruption)."
36413 #: ../src/guestfs.pod:2291
36414 msgid "STATE MACHINE"
36418 #: ../src/guestfs.pod:2293
36419 msgid "libguestfs uses a state machine to model the child process:"
36423 #: ../src/guestfs.pod:2295
36427 " guestfs_create\n"
36435 " / | \\ \\ guestfs_launch\n"
36436 " / | _\\__V______\n"
36438 " / | | LAUNCHING |\n"
36439 " / | \\___________/\n"
36441 " / | guestfs_launch\n"
36443 " ______ / __|____V\n"
36444 " / \\ ------> / \\\n"
36445 " | BUSY | | READY |\n"
36446 " \\______/ <------ \\________/\n"
36451 #: ../src/guestfs.pod:2317
36453 "The normal transitions are (1) CONFIG (when the handle is created, but there "
36454 "is no child process), (2) LAUNCHING (when the child process is booting up), "
36455 "(3) alternating between READY and BUSY as commands are issued to, and "
36456 "carried out by, the child process."
36460 #: ../src/guestfs.pod:2322
36462 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
36463 "asynchronously at any time (eg. due to some internal error), and that causes "
36464 "the state to transition back to CONFIG."
36468 #: ../src/guestfs.pod:2326
36470 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
36471 "issued when in the CONFIG state."
36475 #: ../src/guestfs.pod:2329
36477 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
36478 "L</guestfs_launch> blocks until the child process is READY to accept "
36479 "commands (or until some failure or timeout). L</guestfs_launch> internally "
36480 "moves the state from CONFIG to LAUNCHING while it is running."
36484 #: ../src/guestfs.pod:2335
36486 "API actions such as L</guestfs_mount> can only be issued when in the READY "
36487 "state. These API calls block waiting for the command to be carried out "
36488 "(ie. the state to transition to BUSY and then back to READY). There are no "
36489 "non-blocking versions, and no way to issue more than one command per handle "
36490 "at the same time."
36494 #: ../src/guestfs.pod:2341
36496 "Finally, the child process sends asynchronous messages back to the main "
36497 "program, such as kernel log messages. You can register a callback to "
36498 "receive these messages."
36502 #: ../src/guestfs.pod:2345
36507 #: ../src/guestfs.pod:2347
36508 msgid "APPLIANCE BOOT PROCESS"
36512 #: ../src/guestfs.pod:2349
36514 "This process has evolved and continues to evolve. The description here "
36515 "corresponds only to the current version of libguestfs and is provided for "
36516 "information only."
36520 #: ../src/guestfs.pod:2353
36522 "In order to follow the stages involved below, enable libguestfs debugging "
36523 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
36527 #: ../src/guestfs.pod:2358
36528 msgid "Create the appliance"
36532 #: ../src/guestfs.pod:2360
36534 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
36535 "initrd and the appliance."
36539 #: ../src/guestfs.pod:2363
36541 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
36542 "directory if C<TMPDIR> is set)."
36546 #: ../src/guestfs.pod:2366
36548 "For a complete description of how the appliance is created and cached, read "
36549 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
36553 #: ../src/guestfs.pod:2370
36554 msgid "Start qemu and boot the kernel"
36558 #: ../src/guestfs.pod:2372
36559 msgid "qemu is invoked to boot the kernel."
36563 #: ../src/guestfs.pod:2374
36564 msgid "Run the initrd"
36568 #: ../src/guestfs.pod:2376
36570 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
36571 "appliance. The purpose of the initrd is to load enough kernel modules in "
36572 "order that the appliance itself can be mounted and started."
36576 #: ../src/guestfs.pod:2380
36578 "The initrd is a cpio archive called "
36579 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
36583 #: ../src/guestfs.pod:2383
36585 "When the initrd has started you will see messages showing that kernel "
36586 "modules are being loaded, similar to this:"
36590 #: ../src/guestfs.pod:2386
36593 " febootstrap: ext2 mini initrd starting up\n"
36594 " febootstrap: mounting /sys\n"
36595 " febootstrap: internal insmod libcrc32c.ko\n"
36596 " febootstrap: internal insmod crc32c-intel.ko\n"
36601 #: ../src/guestfs.pod:2391
36602 msgid "Find and mount the appliance device"
36606 #: ../src/guestfs.pod:2393
36608 "The appliance is a sparse file containing an ext2 filesystem which contains "
36609 "a familiar (although reduced in size) Linux operating system. It would "
36610 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
36614 #: ../src/guestfs.pod:2397
36616 "The regular disks being inspected by libguestfs are the first devices "
36617 "exposed by qemu (eg. as C</dev/vda>)."
36621 #: ../src/guestfs.pod:2400
36623 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
36624 "there was only one regular disk)."
36628 #: ../src/guestfs.pod:2403
36630 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
36631 "and switch root into the appliance, and run C</init> from the appliance."
36635 #: ../src/guestfs.pod:2407
36636 msgid "If this works successfully you will see messages such as:"
36640 #: ../src/guestfs.pod:2409
36643 " febootstrap: picked /sys/block/vdb/dev as root device\n"
36644 " febootstrap: creating /dev/root as block special 252:16\n"
36645 " febootstrap: mounting new root on /root\n"
36646 " febootstrap: chroot\n"
36647 " Starting /init script ...\n"
36652 #: ../src/guestfs.pod:2415
36654 "Note that C<Starting /init script ...> indicates that the appliance's init "
36655 "script is now running."
36659 #: ../src/guestfs.pod:2418
36660 msgid "Initialize the appliance"
36664 #: ../src/guestfs.pod:2420
36666 "The appliance itself now initializes itself. This involves starting certain "
36667 "processes like C<udev>, possibly printing some debug information, and "
36668 "finally running the daemon (C<guestfsd>)."
36672 #: ../src/guestfs.pod:2424
36677 #: ../src/guestfs.pod:2426
36679 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
36684 #: ../src/guestfs.pod:2429
36687 " verbose daemon enabled\n"
36692 #: ../src/guestfs.pod:2431
36694 "The daemon expects to see a named virtio-serial port exposed by qemu and "
36695 "connected on the other end to the library."
36699 #: ../src/guestfs.pod:2434
36701 "The daemon connects to this port (and hence to the library) and sends a four "
36702 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
36703 "protocol (see below)."
36707 #: ../src/guestfs.pod:2440
36708 msgid "COMMUNICATION PROTOCOL"
36712 #: ../src/guestfs.pod:2442
36714 "Don't rely on using this protocol directly. This section documents how it "
36715 "currently works, but it may change at any time."
36719 #: ../src/guestfs.pod:2445
36721 "The protocol used to talk between the library and the daemon running inside "
36722 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
36723 "1014, RFC 1832, RFC 4506)."
36727 #: ../src/guestfs.pod:2449
36729 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
36730 "this file is automatically generated)."
36734 #: ../src/guestfs.pod:2452
36736 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
36737 "and C<FileOut> parameters, which are handled with very simple request/reply "
36738 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
36739 "parameters, which use the same request and reply messages, but they may also "
36740 "be followed by files sent using a chunked encoding."
36744 #: ../src/guestfs.pod:2459
36745 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
36749 #: ../src/guestfs.pod:2461
36750 msgid "For ordinary functions, the request message is:"
36754 #: ../src/guestfs.pod:2463
36757 " total length (header + arguments,\n"
36758 " but not including the length word itself)\n"
36759 " struct guestfs_message_header (encoded as XDR)\n"
36760 " struct guestfs_<foo>_args (encoded as XDR)\n"
36765 #: ../src/guestfs.pod:2468
36767 "The total length field allows the daemon to allocate a fixed size buffer "
36768 "into which it slurps the rest of the message. As a result, the total length "
36769 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
36770 "effective size of any request is limited to somewhere under this size."
36774 #: ../src/guestfs.pod:2474
36776 "Note also that many functions don't take any arguments, in which case the "
36777 "C<guestfs_I<foo>_args> is completely omitted."
36781 #: ../src/guestfs.pod:2477
36783 "The header contains the procedure number (C<guestfs_proc>) which is how the "
36784 "receiver knows what type of args structure to expect, or none at all."
36788 #: ../src/guestfs.pod:2481
36790 "For functions that take optional arguments, the optional arguments are "
36791 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
36792 "arguments. A bitmask in the header indicates which optional arguments are "
36793 "meaningful. The bitmask is also checked to see if it contains bits set "
36794 "which the daemon does not know about (eg. if more optional arguments were "
36795 "added in a later version of the library), and this causes the call to be "
36800 #: ../src/guestfs.pod:2489
36801 msgid "The reply message for ordinary functions is:"
36805 #: ../src/guestfs.pod:2491
36808 " total length (header + ret,\n"
36809 " but not including the length word itself)\n"
36810 " struct guestfs_message_header (encoded as XDR)\n"
36811 " struct guestfs_<foo>_ret (encoded as XDR)\n"
36816 #: ../src/guestfs.pod:2496
36818 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
36819 "functions that return no formal return values."
36823 #: ../src/guestfs.pod:2499
36824 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
36828 #: ../src/guestfs.pod:2502
36830 "In the case of an error, a flag is set in the header, and the reply message "
36831 "is slightly changed:"
36835 #: ../src/guestfs.pod:2505
36838 " total length (header + error,\n"
36839 " but not including the length word itself)\n"
36840 " struct guestfs_message_header (encoded as XDR)\n"
36841 " struct guestfs_message_error (encoded as XDR)\n"
36846 #: ../src/guestfs.pod:2510
36848 "The C<guestfs_message_error> structure contains the error message as a "
36853 #: ../src/guestfs.pod:2513
36854 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
36858 #: ../src/guestfs.pod:2515
36860 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
36861 "The normal request message is sent (see above). However this is followed by "
36862 "a sequence of file chunks."
36866 #: ../src/guestfs.pod:2519
36869 " total length (header + arguments,\n"
36870 " but not including the length word itself,\n"
36871 " and not including the chunks)\n"
36872 " struct guestfs_message_header (encoded as XDR)\n"
36873 " struct guestfs_<foo>_args (encoded as XDR)\n"
36874 " sequence of chunks for FileIn param #0\n"
36875 " sequence of chunks for FileIn param #1 etc.\n"
36880 #: ../src/guestfs.pod:2527
36881 msgid "The \"sequence of chunks\" is:"
36885 #: ../src/guestfs.pod:2529
36888 " length of chunk (not including length word itself)\n"
36889 " struct guestfs_chunk (encoded as XDR)\n"
36890 " length of chunk\n"
36891 " struct guestfs_chunk (encoded as XDR)\n"
36893 " length of chunk\n"
36894 " struct guestfs_chunk (with data.data_len == 0)\n"
36899 #: ../src/guestfs.pod:2537
36901 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
36902 "is set in the final chunk to indicate either successful completion or early "
36907 #: ../src/guestfs.pod:2541
36909 "At time of writing there are no functions that have more than one FileIn "
36910 "parameter. However this is (theoretically) supported, by sending the "
36911 "sequence of chunks for each FileIn parameter one after another (from left to "
36916 #: ../src/guestfs.pod:2546
36918 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
36919 "transfer. The library does this by sending a chunk with a special flag set "
36920 "to indicate cancellation. When the daemon sees this, it cancels the whole "
36921 "RPC, does I<not> send any reply, and goes back to reading the next request."
36925 #: ../src/guestfs.pod:2552
36927 "The daemon may also cancel. It does this by writing a special word "
36928 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
36929 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
36930 "cancel chunk). The special word is chosen so that even if cancellation "
36931 "happens right at the end of the transfer (after the library has finished "
36932 "writing and has started listening for the reply), the \"spurious\" cancel "
36933 "flag will not be confused with the reply message."
36937 #: ../src/guestfs.pod:2561
36939 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
36940 "limit), and also files where the size is not known in advance (eg. from "
36941 "pipes or sockets). However the chunks are rather small "
36942 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
36943 "to keep much in memory."
36947 #: ../src/guestfs.pod:2567
36948 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
36952 #: ../src/guestfs.pod:2569
36954 "The protocol for FileOut parameters is exactly the same as for FileIn "
36955 "parameters, but with the roles of daemon and library reversed."
36959 #: ../src/guestfs.pod:2572
36962 " total length (header + ret,\n"
36963 " but not including the length word itself,\n"
36964 " and not including the chunks)\n"
36965 " struct guestfs_message_header (encoded as XDR)\n"
36966 " struct guestfs_<foo>_ret (encoded as XDR)\n"
36967 " sequence of chunks for FileOut param #0\n"
36968 " sequence of chunks for FileOut param #1 etc.\n"
36973 #: ../src/guestfs.pod:2580
36974 msgid "INITIAL MESSAGE"
36978 #: ../src/guestfs.pod:2582
36980 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
36981 "which indicates that the guest and daemon is alive. This is what "
36982 "L</guestfs_launch> waits for."
36986 #: ../src/guestfs.pod:2586
36987 msgid "PROGRESS NOTIFICATION MESSAGES"
36991 #: ../src/guestfs.pod:2588
36993 "The daemon may send progress notification messages at any time. These are "
36994 "distinguished by the normal length word being replaced by "
36995 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
36999 #: ../src/guestfs.pod:2592
37001 "The library turns them into progress callbacks (see "
37002 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
37007 #: ../src/guestfs.pod:2596
37009 "The daemon self-limits the frequency of progress messages it sends (see "
37010 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
37015 #: ../src/guestfs.pod:2600
37016 msgid "LIBGUESTFS VERSION NUMBERS"
37020 #: ../src/guestfs.pod:2602
37022 "Since April 2010, libguestfs has started to make separate development and "
37023 "stable releases, along with corresponding branches in our git repository. "
37024 "These separate releases can be identified by version number:"
37028 #: ../src/guestfs.pod:2607
37031 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
37032 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
37038 " | `-------- sub-version\n"
37040 " `------ always '1' because we don't change the ABI\n"
37045 #: ../src/guestfs.pod:2618
37046 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
37050 #: ../src/guestfs.pod:2620
37052 "As time passes we cherry pick fixes from the development branch and backport "
37053 "those into the stable branch, the effect being that the stable branch should "
37054 "get more stable and less buggy over time. So the stable releases are ideal "
37055 "for people who don't need new features but would just like the software to "
37060 #: ../src/guestfs.pod:2626
37061 msgid "Our criteria for backporting changes are:"
37065 #: ../src/guestfs.pod:2632
37067 "Documentation changes which don't affect any code are backported unless the "
37068 "documentation refers to a future feature which is not in stable."
37072 #: ../src/guestfs.pod:2638
37074 "Bug fixes which are not controversial, fix obvious problems, and have been "
37075 "well tested are backported."
37079 #: ../src/guestfs.pod:2643
37081 "Simple rearrangements of code which shouldn't affect how it works get "
37082 "backported. This is so that the code in the two branches doesn't get too "
37083 "far out of step, allowing us to backport future fixes more easily."
37087 #: ../src/guestfs.pod:2649
37089 "We I<don't> backport new features, new APIs, new tools etc, except in one "
37090 "exceptional case: the new feature is required in order to implement an "
37091 "important bug fix."
37095 #: ../src/guestfs.pod:2655
37097 "A new stable branch starts when we think the new features in development are "
37098 "substantial and compelling enough over the current stable branch to warrant "
37099 "it. When that happens we create new stable and development versions 1.N.0 "
37100 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
37101 "stable at this point, but by backporting fixes from development, that branch "
37102 "will stabilize over time."
37106 #: ../src/guestfs.pod:2663
37107 msgid "EXTENDING LIBGUESTFS"
37111 #: ../src/guestfs.pod:2665
37112 msgid "ADDING A NEW API ACTION"
37116 #: ../src/guestfs.pod:2667
37118 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
37119 "documentation) are generated, and this makes it easy to extend the "
37124 #: ../src/guestfs.pod:2671
37125 msgid "To add a new API action there are two changes:"
37129 #: ../src/guestfs.pod:2677
37131 "You need to add a description of the call (name, parameters, return type, "
37132 "tests, documentation) to C<generator/generator_actions.ml>."
37136 #: ../src/guestfs.pod:2680
37138 "There are two sorts of API action, depending on whether the call goes "
37139 "through to the daemon in the appliance, or is serviced entirely by the "
37140 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
37141 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
37142 "an example of the latter, since a trace flag is maintained in the handle and "
37143 "all tracing is done on the library side."
37147 #: ../src/guestfs.pod:2688
37149 "Most new actions are of the first type, and get added to the "
37150 "C<daemon_functions> list. Each function has a unique procedure number used "
37151 "in the RPC protocol which is assigned to that action when we publish "
37152 "libguestfs and cannot be reused. Take the latest procedure number and "
37157 #: ../src/guestfs.pod:2694
37159 "For library-only actions of the second type, add to the "
37160 "C<non_daemon_functions> list. Since these functions are serviced by the "
37161 "library and do not travel over the RPC mechanism to the daemon, these "
37162 "functions do not need a procedure number, and so the procedure number is set "
37167 #: ../src/guestfs.pod:2702
37168 msgid "Implement the action (in C):"
37172 #: ../src/guestfs.pod:2704
37174 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
37175 "C<daemon/> directory."
37179 #: ../src/guestfs.pod:2707
37181 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
37182 "(note: double underscore) in the C<src/> directory."
37186 #: ../src/guestfs.pod:2710
37187 msgid "In either case, use another function as an example of what to do."
37191 #: ../src/guestfs.pod:2714
37192 msgid "After making these changes, use C<make> to compile."
37196 #: ../src/guestfs.pod:2716
37198 "Note that you don't need to implement the RPC, language bindings, manual "
37199 "pages or anything else. It's all automatically generated from the OCaml "
37204 #: ../src/guestfs.pod:2720
37205 msgid "ADDING TESTS FOR AN API ACTION"
37209 #: ../src/guestfs.pod:2722
37211 "You can supply zero or as many tests as you want per API call. The tests "
37212 "can either be added as part of the API description "
37213 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
37214 "drop a script into C<regressions/>. Note that adding a script to "
37215 "C<regressions/> is slower, so if possible use the first method."
37219 #: ../src/guestfs.pod:2728
37221 "The following describes the test environment used when you add an API test "
37222 "in C<generator_actions.ml>."
37226 #: ../src/guestfs.pod:2731
37227 msgid "The test environment has 4 block devices:"
37231 #: ../src/guestfs.pod:2735
37232 msgid "C</dev/sda> 500MB"
37236 #: ../src/guestfs.pod:2737
37237 msgid "General block device for testing."
37241 #: ../src/guestfs.pod:2739
37242 msgid "C</dev/sdb> 50MB"
37246 #: ../src/guestfs.pod:2741
37248 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
37253 #: ../src/guestfs.pod:2744
37254 msgid "C</dev/sdc> 10MB"
37258 #: ../src/guestfs.pod:2746
37259 msgid "Used in a few tests where two block devices are needed."
37263 #: ../src/guestfs.pod:2748
37264 msgid "C</dev/sdd>"
37268 #: ../src/guestfs.pod:2750
37269 msgid "ISO with fixed content (see C<images/test.iso>)."
37273 #: ../src/guestfs.pod:2754
37275 "To be able to run the tests in a reasonable amount of time, the libguestfs "
37276 "appliance and block devices are reused between tests. So don't try testing "
37277 "L</guestfs_kill_subprocess> :-x"
37281 #: ../src/guestfs.pod:2758
37283 "Each test starts with an initial scenario, selected using one of the "
37284 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
37285 "initialize the disks mentioned above in a particular way as documented in "
37286 "C<generator_types.ml>. You should not assume anything about the previous "
37287 "contents of other disks that are not initialized."
37291 #: ../src/guestfs.pod:2764
37293 "You can add a prerequisite clause to any individual test. This is a "
37294 "run-time check, which, if it fails, causes the test to be skipped. Useful "
37295 "if testing a command which might not work on all variations of libguestfs "
37296 "builds. A test that has prerequisite of C<Always> means to run "
37301 #: ../src/guestfs.pod:2770
37303 "In addition, packagers can skip individual tests by setting environment "
37304 "variables before running C<make check>."
37308 #: ../src/guestfs.pod:2773
37311 " SKIP_TEST_<CMD>_<NUM>=1\n"
37316 #: ../src/guestfs.pod:2775
37317 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
37321 #: ../src/guestfs.pod:2777
37326 #: ../src/guestfs.pod:2779
37329 " SKIP_TEST_<CMD>=1\n"
37334 #: ../src/guestfs.pod:2781
37335 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
37339 #: ../src/guestfs.pod:2783
37340 msgid "Packagers can run only certain tests by setting for example:"
37344 #: ../src/guestfs.pod:2785
37347 " TEST_ONLY=\"vfs_type zerofree\"\n"
37352 #: ../src/guestfs.pod:2787
37354 "See C<capitests/tests.c> for more details of how these environment variables "
37359 #: ../src/guestfs.pod:2790
37360 msgid "DEBUGGING NEW API ACTIONS"
37364 #: ../src/guestfs.pod:2792
37365 msgid "Test new actions work before submitting them."
37369 #: ../src/guestfs.pod:2794
37370 msgid "You can use guestfish to try out new commands."
37374 #: ../src/guestfs.pod:2796
37376 "Debugging the daemon is a problem because it runs inside a minimal "
37377 "environment. However you can fprintf messages in the daemon to stderr, and "
37378 "they will show up if you use C<guestfish -v>."
37382 #: ../src/guestfs.pod:2800
37383 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
37387 #: ../src/guestfs.pod:2802
37389 "Our C source code generally adheres to some basic code-formatting "
37390 "conventions. The existing code base is not totally consistent on this "
37391 "front, but we do prefer that contributed code be formatted similarly. In "
37392 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
37393 "indentation level, and other than that, follow the K&R style."
37397 #: ../src/guestfs.pod:2808
37399 "If you use Emacs, add the following to one of one of your start-up files "
37400 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
37404 #: ../src/guestfs.pod:2811
37407 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
37408 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
37409 " (add-hook 'find-file-hook\n"
37410 " '(lambda () (if (and buffer-file-name\n"
37411 " (string-match \"/libguestfs\\\\>\"\n"
37412 " (buffer-file-name))\n"
37413 " (not (string-equal mode-name \"Change Log\"))\n"
37414 " (not (string-equal mode-name \"Makefile\")))\n"
37415 " (setq indent-tabs-mode nil))))\n"
37420 #: ../src/guestfs.pod:2821
37423 " ;;; When editing C sources in libguestfs, use this style.\n"
37424 " (defun libguestfs-c-mode ()\n"
37425 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
37427 " (c-set-style \"K&R\")\n"
37428 " (setq c-indent-level 2)\n"
37429 " (setq c-basic-offset 2))\n"
37430 " (add-hook 'c-mode-hook\n"
37431 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
37432 " (buffer-file-name))\n"
37433 " (libguestfs-c-mode))))\n"
37438 #: ../src/guestfs.pod:2833
37439 msgid "Enable warnings when compiling (and fix any problems this finds):"
37443 #: ../src/guestfs.pod:2836
37446 " ./configure --enable-gcc-warnings\n"
37451 #: ../src/guestfs.pod:2838
37452 msgid "Useful targets are:"
37456 #: ../src/guestfs.pod:2840
37459 " make syntax-check # checks the syntax of the C code\n"
37460 " make check # runs the test suite\n"
37465 #: ../src/guestfs.pod:2843
37466 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
37470 #: ../src/guestfs.pod:2845
37472 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
37473 "which are used to do shell quoting."
37477 #: ../src/guestfs.pod:2850
37482 #: ../src/guestfs.pod:2852
37484 "Simple shell quoted string. Any spaces or other shell characters are "
37489 #: ../src/guestfs.pod:2855
37494 #: ../src/guestfs.pod:2857
37496 "Same as C<%Q> except the string is treated as a path which is prefixed by "
37501 #: ../src/guestfs.pod:2864
37504 " asprintf (&cmd, \"cat %R\", path);\n"
37509 #: ../src/guestfs.pod:2866
37510 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
37514 #: ../src/guestfs.pod:2868
37516 "I<Note:> Do I<not> use these when you are passing parameters to the "
37517 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
37518 "because they are not passed via the shell (instead, straight to exec). You "
37519 "probably want to use the C<sysroot_path()> function however."
37523 #: ../src/guestfs.pod:2874
37524 msgid "SUBMITTING YOUR NEW API ACTIONS"
37528 #: ../src/guestfs.pod:2876
37530 "Submit patches to the mailing list: "
37531 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
37532 "L<rjones@redhat.com>."
37536 #: ../src/guestfs.pod:2880
37537 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
37541 #: ../src/guestfs.pod:2882
37542 msgid "We support i18n (gettext anyhow) in the library."
37546 #: ../src/guestfs.pod:2884
37548 "However many messages come from the daemon, and we don't translate those at "
37549 "the moment. One reason is that the appliance generally has all locale files "
37550 "removed from it, because they take up a lot of space. So we'd have to readd "
37551 "some of those, as well as copying our PO files into the appliance."
37555 #: ../src/guestfs.pod:2890
37557 "Debugging messages are never translated, since they are intended for the "
37562 #: ../src/guestfs.pod:2893
37563 msgid "SOURCE CODE SUBDIRECTORIES"
37567 #: ../src/guestfs.pod:2897
37572 #: ../src/guestfs.pod:2899
37573 msgid "L<virt-alignment-scan(1)> command and documentation."
37577 #: ../src/guestfs.pod:2903
37578 msgid "The libguestfs appliance, build scripts and so on."
37582 #: ../src/guestfs.pod:2905
37583 msgid "C<capitests>"
37587 #: ../src/guestfs.pod:2907
37588 msgid "Automated tests of the C API."
37592 #: ../src/guestfs.pod:2909
37597 #: ../src/guestfs.pod:2911
37599 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
37604 #: ../src/guestfs.pod:2914
37609 #: ../src/guestfs.pod:2916
37611 "Safety and liveness tests of components that libguestfs depends upon (not of "
37612 "libguestfs itself). Mainly this is for qemu and the kernel."
37616 #: ../src/guestfs.pod:2919
37621 #: ../src/guestfs.pod:2921
37623 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
37624 "command and documentation."
37628 #: ../src/guestfs.pod:2924
37633 #: ../src/guestfs.pod:2926
37634 msgid "Outside contributions, experimental parts."
37638 #: ../src/guestfs.pod:2928
37643 #: ../src/guestfs.pod:2930
37645 "The daemon that runs inside the libguestfs appliance and carries out "
37650 #: ../src/guestfs.pod:2933
37655 #: ../src/guestfs.pod:2935
37656 msgid "L<virt-df(1)> command and documentation."
37660 #: ../src/guestfs.pod:2937
37665 #: ../src/guestfs.pod:2939
37666 msgid "L<virt-edit(1)> command and documentation."
37670 #: ../src/guestfs.pod:2941
37671 msgid "C<examples>"
37675 #: ../src/guestfs.pod:2943
37676 msgid "C API example code."
37680 #: ../src/guestfs.pod:2945
37685 #: ../src/guestfs.pod:2947
37687 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
37688 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
37689 "L<virt-tar-out(1)>."
37693 #: ../src/guestfs.pod:2951
37698 #: ../src/guestfs.pod:2953
37699 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
37703 #: ../src/guestfs.pod:2955
37704 msgid "C<generator>"
37708 #: ../src/guestfs.pod:2957
37710 "The crucially important generator, used to automatically generate large "
37711 "amounts of boilerplate C code for things like RPC and bindings."
37715 #: ../src/guestfs.pod:2960
37720 #: ../src/guestfs.pod:2962
37721 msgid "Files used by the test suite."
37725 #: ../src/guestfs.pod:2964
37726 msgid "Some \"phony\" guest images which we test against."
37730 #: ../src/guestfs.pod:2966
37731 msgid "C<inspector>"
37735 #: ../src/guestfs.pod:2968
37736 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
37740 #: ../src/guestfs.pod:2970
37745 #: ../src/guestfs.pod:2972
37746 msgid "Logo used on the website. The fish is called Arthur by the way."
37750 #: ../src/guestfs.pod:2974
37755 #: ../src/guestfs.pod:2976
37756 msgid "M4 macros used by autoconf."
37760 #: ../src/guestfs.pod:2978
37765 #: ../src/guestfs.pod:2980
37766 msgid "Translations of simple gettext strings."
37770 #: ../src/guestfs.pod:2982
37775 #: ../src/guestfs.pod:2984
37777 "The build infrastructure and PO files for translations of manpages and POD "
37778 "files. Eventually this will be combined with the C<po> directory, but that "
37779 "is rather complicated."
37783 #: ../src/guestfs.pod:2988
37784 msgid "C<regressions>"
37788 #: ../src/guestfs.pod:2990
37789 msgid "Regression tests."
37793 #: ../src/guestfs.pod:2992
37798 #: ../src/guestfs.pod:2994
37799 msgid "L<virt-rescue(1)> command and documentation."
37803 #: ../src/guestfs.pod:2996
37808 #: ../src/guestfs.pod:2998
37809 msgid "L<virt-resize(1)> command and documentation."
37813 #: ../src/guestfs.pod:3000
37814 msgid "C<sparsify>"
37818 #: ../src/guestfs.pod:3002
37819 msgid "L<virt-sparsify(1)> command and documentation."
37823 #: ../src/guestfs.pod:3004
37828 #: ../src/guestfs.pod:3006
37829 msgid "Source code to the C library."
37833 #: ../src/guestfs.pod:3008
37838 #: ../src/guestfs.pod:3010
37839 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
37843 #: ../src/guestfs.pod:3012
37844 msgid "C<test-tool>"
37848 #: ../src/guestfs.pod:3014
37850 "Test tool for end users to test if their qemu/kernel combination will work "
37855 #: ../src/guestfs.pod:3017
37860 #: ../src/guestfs.pod:3019
37865 #: ../src/guestfs.pod:3021
37870 #: ../src/guestfs.pod:3023
37875 #: ../src/guestfs.pod:3025
37880 #: ../src/guestfs.pod:3027
37885 #: ../src/guestfs.pod:3029
37890 #: ../src/guestfs.pod:3031
37895 #: ../src/guestfs.pod:3033
37900 #: ../src/guestfs.pod:3035
37901 msgid "Language bindings."
37905 #: ../src/guestfs.pod:3039
37906 msgid "MAKING A STABLE RELEASE"
37910 #: ../src/guestfs.pod:3041
37912 "When we make a stable release, there are several steps documented here. See "
37913 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
37918 #: ../src/guestfs.pod:3049
37919 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
37923 #: ../src/guestfs.pod:3054
37924 msgid "Finalize RELEASE-NOTES."
37928 #: ../src/guestfs.pod:3058
37929 msgid "Update ROADMAP."
37933 #: ../src/guestfs.pod:3062
37934 msgid "Run C<src/api-support/update-from-tarballs.sh>."
37938 #: ../src/guestfs.pod:3066
37939 msgid "Push and pull from Transifex."
37943 #: ../src/guestfs.pod:3068
37948 #: ../src/guestfs.pod:3070
37956 #: ../src/guestfs.pod:3072
37957 msgid "to push the latest POT files to Transifex. Then run:"
37961 #: ../src/guestfs.pod:3074
37969 #: ../src/guestfs.pod:3076
37970 msgid "which is a wrapper to pull the latest translated C<*.po> files."
37974 #: ../src/guestfs.pod:3080
37976 "Create new stable and development directories under "
37977 "L<http://libguestfs.org/download>."
37981 #: ../src/guestfs.pod:3085
37982 msgid "Create the branch in git:"
37986 #: ../src/guestfs.pod:3087
37989 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
37990 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
37991 " git branch stable-1.XX\n"
37992 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
37997 #: ../src/guestfs.pod:3094
38002 #: ../src/guestfs.pod:3096
38003 msgid "PROTOCOL LIMITS"
38007 #: ../src/guestfs.pod:3098
38009 "Internally libguestfs uses a message-based protocol to pass API calls and "
38010 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
38011 "plenty more detail about this). The maximum message size used by the "
38012 "protocol is slightly less than 4 MB. For some API calls you may need to be "
38013 "aware of this limit. The API calls which may be affected are individually "
38014 "documented, with a link back to this section of the documentation."
38018 #: ../src/guestfs.pod:3106
38020 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
38021 "a simple string. Because this string is at some point internally encoded as "
38022 "a message, the maximum size that it can return is slightly under 4 MB. If "
38023 "the requested file is larger than this then you will get an error."
38027 #: ../src/guestfs.pod:3112
38029 "In order to transfer large files into and out of the guest filesystem, you "
38030 "need to use particular calls that support this. The sections L</UPLOADING> "
38031 "and L</DOWNLOADING> document how to do this."
38035 #: ../src/guestfs.pod:3116
38037 "You might also consider mounting the disk image using our FUSE filesystem "
38038 "support (L<guestmount(1)>)."
38042 #: ../src/guestfs.pod:3119
38043 msgid "MAXIMUM NUMBER OF DISKS"
38047 #: ../src/guestfs.pod:3121
38048 msgid "When using virtio disks (the default) the current limit is B<25> disks."
38052 #: ../src/guestfs.pod:3124
38054 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
38055 "slots. However febootstrap only understands disks with names C</dev/vda> "
38056 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
38061 #: ../src/guestfs.pod:3129
38063 "We are working to substantially raise this limit in future versions but it "
38064 "requires complex changes to qemu."
38068 #: ../src/guestfs.pod:3132
38070 "In future versions of libguestfs it should also be possible to \"hot plug\" "
38071 "disks (add and remove disks after calling L</guestfs_launch>). This also "
38072 "requires changes to qemu."
38076 #: ../src/guestfs.pod:3136
38077 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
38081 #: ../src/guestfs.pod:3138
38082 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
38086 #: ../src/guestfs.pod:3140
38088 "This is because it reserves 4 bits for the minor device number (thus "
38089 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
38093 #: ../src/guestfs.pod:3143
38095 "If you attach a disk with more than 15 partitions, the extra partitions are "
38096 "ignored by libguestfs."
38100 #: ../src/guestfs.pod:3146
38101 msgid "MAXIMUM SIZE OF A DISK"
38105 #: ../src/guestfs.pod:3148
38106 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
38110 #: ../src/guestfs.pod:3150
38112 "We have tested block devices up to 1 exabyte (2**60 or "
38113 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
38118 #: ../src/guestfs.pod:3154
38120 "Although libguestfs probably does not impose any limit, the underlying host "
38121 "storage will. If you store disk images on a host ext4 filesystem, then the "
38122 "maximum size will be limited by the maximum ext4 file size (currently 16 "
38123 "TB). If you store disk images as host logical volumes then you are limited "
38124 "by the maximum size of an LV."
38128 #: ../src/guestfs.pod:3160
38130 "For the hugest disk image files, we recommend using XFS on the host for "
38135 #: ../src/guestfs.pod:3163
38136 msgid "MAXIMUM SIZE OF A PARTITION"
38140 #: ../src/guestfs.pod:3165
38142 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
38143 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
38144 "address a partition located beyond 2 TB on the disk."
38148 #: ../src/guestfs.pod:3169
38150 "It is recommended that you use GPT partitions on disks which are larger than "
38151 "this size. GPT uses 64 bit sector numbers and so can address partitions "
38152 "which are theoretically larger than the largest disk we could support."
38156 #: ../src/guestfs.pod:3174
38157 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
38161 #: ../src/guestfs.pod:3176
38163 "This depends on the filesystem type. libguestfs itself does not impose any "
38164 "known limit. Consult Wikipedia or the filesystem documentation to find out "
38165 "what these limits are."
38169 #: ../src/guestfs.pod:3180
38170 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
38174 #: ../src/guestfs.pod:3182
38176 "The API functions L</guestfs_upload>, L</guestfs_download>, "
38177 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
38178 "uploads and downloads."
38182 #: ../src/guestfs.pod:3186
38183 msgid "INSPECTION LIMITS"
38187 #: ../src/guestfs.pod:3188
38189 "The inspection code has several arbitrary limits on things like the size of "
38190 "Windows Registry hive it will read, and the length of product name. These "
38191 "are intended to stop a malicious guest from consuming arbitrary amounts of "
38192 "memory and disk space on the host, and should not be reached in practice. "
38193 "See the source code for more information."
38197 #: ../src/guestfs.pod:3214
38199 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
38200 "effect as calling C<guestfs_set_verbose (g, 1)>."
38204 #: ../src/guestfs.pod:3226
38206 "Set the path that libguestfs uses to search for a supermin appliance. See "
38207 "the discussion of paths in section L</PATH> above."
38211 #: ../src/guestfs.pod:3235
38212 msgid "See also L</QEMU WRAPPERS> above."
38216 #: ../src/guestfs.pod:3239
38218 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
38219 "effect as calling C<guestfs_set_trace (g, 1)>."
38223 #: ../src/guestfs.pod:3257
38225 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
38226 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
38227 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
38228 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
38229 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
38230 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
38231 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
38232 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
38233 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
38234 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
38235 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
38236 "L<http://libguestfs.org/>."
38240 #: ../src/guestfs.pod:3293
38242 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
38243 "L<lvm(8)>, L<disktype(1)>."
38247 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
38252 #: ../src/guestfs.pod:3302
38253 msgid "To get a list of bugs against libguestfs use this link:"
38257 #: ../src/guestfs.pod:3304
38258 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
38262 #: ../src/guestfs.pod:3306
38263 msgid "To report a new bug against libguestfs use this link:"
38267 #: ../src/guestfs.pod:3308
38268 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
38272 #: ../src/guestfs.pod:3310
38273 msgid "When reporting a bug, please check:"
38277 #: ../src/guestfs.pod:3316
38278 msgid "That the bug hasn't been reported already."
38282 #: ../src/guestfs.pod:3320
38283 msgid "That you are testing a recent version."
38287 #: ../src/guestfs.pod:3324
38288 msgid "Describe the bug accurately, and give a way to reproduce it."
38292 #: ../src/guestfs.pod:3328
38294 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
38299 #: ../test-tool/libguestfs-test-tool.pod:5
38300 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
38304 #: ../test-tool/libguestfs-test-tool.pod:9
38307 " libguestfs-test-tool [--options]\n"
38312 #: ../test-tool/libguestfs-test-tool.pod:13
38314 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
38315 "to check basic libguestfs functionality is working. This is needed because "
38316 "libguestfs occasionally breaks for reasons beyond our control: usually "
38317 "because of changes in the underlying qemu or kernel packages, or the host "
38322 #: ../test-tool/libguestfs-test-tool.pod:19
38323 msgid "If you suspect a problem in libguestfs, then just run:"
38327 #: ../test-tool/libguestfs-test-tool.pod:21
38330 " libguestfs-test-tool\n"
38335 #: ../test-tool/libguestfs-test-tool.pod:23
38336 msgid "It will print lots of diagnostic messages."
38340 #: ../test-tool/libguestfs-test-tool.pod:25
38341 msgid "If it runs to completion successfully, you will see this near the end:"
38345 #: ../test-tool/libguestfs-test-tool.pod:27
38348 " ===== TEST FINISHED OK =====\n"
38353 #: ../test-tool/libguestfs-test-tool.pod:29
38354 msgid "and the test tool will exit with code 0."
38358 #: ../test-tool/libguestfs-test-tool.pod:31
38360 "If it fails (and/or exits with non-zero error code), please paste the "
38361 "I<complete, unedited> output of the test tool into a bug report. More "
38362 "information about reporting bugs can be found on the "
38363 "L<http://libguestfs.org/> website."
38367 #: ../test-tool/libguestfs-test-tool.pod:42
38368 msgid "Display short usage information and exit."
38372 #: ../test-tool/libguestfs-test-tool.pod:44
38373 msgid "B<--qemu qemu_binary>"
38377 #: ../test-tool/libguestfs-test-tool.pod:46
38379 "If you have downloaded another qemu binary, point this option at the full "
38380 "path of the binary to try it."
38384 #: ../test-tool/libguestfs-test-tool.pod:49
38385 msgid "B<--qemudir qemu_source_dir>"
38389 #: ../test-tool/libguestfs-test-tool.pod:51
38391 "If you have compiled qemu from source, point this option at the source "
38392 "directory to try it."
38396 #: ../test-tool/libguestfs-test-tool.pod:54
38401 #: ../test-tool/libguestfs-test-tool.pod:56
38402 msgid "B<--timeout N>"
38406 #: ../test-tool/libguestfs-test-tool.pod:58
38408 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
38409 "minutes) which does not usually need to be adjusted."
38413 #: ../test-tool/libguestfs-test-tool.pod:63
38414 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
38418 #: ../test-tool/libguestfs-test-tool.pod:65
38420 "If you have compiled another version of qemu from source and would like to "
38421 "try that, then you can use the I<--qemudir> option to point to the qemu "
38422 "source directory."
38426 #: ../test-tool/libguestfs-test-tool.pod:69
38428 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
38429 "option to point to the binary."
38433 #: ../test-tool/libguestfs-test-tool.pod:72
38435 "Note when using these options, you can ignore the business of qemu wrapper "
38436 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
38437 "wrapper script for you if one is needed."
38441 #: ../test-tool/libguestfs-test-tool.pod:76
38442 msgid "TRYING OUT A DIFFERENT KERNEL"
38446 #: ../test-tool/libguestfs-test-tool.pod:78
38448 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
38449 "libguestfs tries. You do this by setting the environment variables "
38450 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
38454 #: ../test-tool/libguestfs-test-tool.pod:82
38456 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
38461 #: ../test-tool/libguestfs-test-tool.pod:85
38462 msgid "SELF-DIAGNOSIS"
38466 #: ../test-tool/libguestfs-test-tool.pod:87
38468 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
38469 "produced by libguestfs-test-tool and/or possible errors."
38473 #: ../test-tool/libguestfs-test-tool.pod:92
38475 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
38476 "I<1> if there was an error."
38480 #: ../test-tool/libguestfs-test-tool.pod:97
38482 "For the full list of environment variables which may affect libguestfs, "
38483 "please see the L<guestfs(3)> manual page."
38487 #: ../test-tool/libguestfs-test-tool.pod:102
38488 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
38492 #: ../tools/virt-list-filesystems.pl:32
38493 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
38497 #: ../tools/virt-list-filesystems.pl:36
38500 " virt-list-filesystems [--options] domname\n"
38505 #: ../tools/virt-list-filesystems.pl:38
38508 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
38513 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
38515 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
38520 #: ../tools/virt-list-filesystems.pl:45
38522 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
38523 "are contained in a virtual machine or disk image."
38527 #: ../tools/virt-list-filesystems.pl:49
38529 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
38530 "functionality. For more complex cases you should look at the "
38531 "L<guestfish(1)> tool."
38535 #: ../tools/virt-list-filesystems.pl:112
38537 "With this option, C<virt-list-filesystems> displays the type of each "
38538 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
38542 #: ../tools/virt-list-filesystems.pl:119
38547 #: ../tools/virt-list-filesystems.pl:123
38549 "Normally we only show mountable filesystems. If this option is given then "
38550 "swap devices are shown too."
38554 #: ../tools/virt-list-filesystems.pl:197
38556 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
38557 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
38558 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38562 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
38563 msgid "Copyright (C) 2009 Red Hat Inc."
38567 #: ../tools/virt-list-partitions.pl:32
38568 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
38572 #: ../tools/virt-list-partitions.pl:36
38575 " virt-list-partitions [--options] domname\n"
38580 #: ../tools/virt-list-partitions.pl:38
38583 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
38588 #: ../tools/virt-list-partitions.pl:45
38590 "C<virt-list-partitions> is a command line tool to list the partitions that "
38591 "are contained in a virtual machine or disk image. It is mainly useful as a "
38592 "first step to using L<virt-resize(1)>."
38596 #: ../tools/virt-list-partitions.pl:50
38598 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
38599 "functionality. For more complex cases you should look at the "
38600 "L<guestfish(1)> tool."
38604 #: ../tools/virt-list-partitions.pl:113
38605 msgid "Show sizes in human-readable form (eg. \"1G\")."
38609 #: ../tools/virt-list-partitions.pl:123
38611 "With this option, C<virt-list-partitions> displays the type and size of each "
38612 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
38616 #: ../tools/virt-list-partitions.pl:130
38621 #: ../tools/virt-list-partitions.pl:132
38626 #: ../tools/virt-list-partitions.pl:134
38627 msgid "Display the total size of each block device (as a separate row or rows)."
38631 #: ../tools/virt-list-partitions.pl:267
38633 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
38634 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
38635 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38639 #: ../tools/virt-list-partitions.pl:283
38640 msgid "Copyright (C) 2009-2010 Red Hat Inc."
38644 #: ../tools/virt-make-fs.pl:37
38645 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
38649 #: ../tools/virt-make-fs.pl:41
38652 " virt-make-fs [--options] input.tar output.img\n"
38657 #: ../tools/virt-make-fs.pl:43
38660 " virt-make-fs [--options] input.tar.gz output.img\n"
38665 #: ../tools/virt-make-fs.pl:45
38668 " virt-make-fs [--options] directory output.img\n"
38673 #: ../tools/virt-make-fs.pl:49
38675 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
38676 "archive or some files in a directory. It is similar to tools like "
38677 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
38678 "it can create common filesystem types like ext2/3 or NTFS, which can be "
38679 "useful if you want to attach these filesystems to existing virtual machines "
38680 "(eg. to import large amounts of read-only data to a VM)."
38684 #: ../tools/virt-make-fs.pl:57
38685 msgid "Basic usage is:"
38689 #: ../tools/virt-make-fs.pl:59
38692 " virt-make-fs input output\n"
38697 #: ../tools/virt-make-fs.pl:61
38699 "where C<input> is either a directory containing files that you want to add, "
38700 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
38701 "C<output> is a disk image. The input type is detected automatically. The "
38702 "output disk image defaults to a raw ext2 image unless you specify extra "
38703 "flags (see L</OPTIONS> below)."
38707 #: ../tools/virt-make-fs.pl:67
38708 msgid "EXTRA SPACE"
38712 #: ../tools/virt-make-fs.pl:69
38714 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
38715 "the files that it contains, but might have extra space. Depending on how "
38716 "you are going to use the output, you might think this extra space is wasted "
38717 "and want to minimize it, or you might want to leave space so that more files "
38718 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
38719 "but you can use the I<--size> flag to leave space in the filesystem if you "
38724 #: ../tools/virt-make-fs.pl:77
38726 "An alternative way to leave extra space but not make the output image any "
38727 "bigger is to use an alternative disk image format (instead of the default "
38728 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
38729 "image format (check your hypervisor supports this before using it). This "
38730 "allows you to choose a large I<--size> but the extra space won't actually be "
38731 "allocated in the image until you try to store something in it."
38735 #: ../tools/virt-make-fs.pl:85
38737 "Don't forget that you can also use local commands including L<resize2fs(8)> "
38738 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
38739 "to build another image from scratch."
38743 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
38748 #: ../tools/virt-make-fs.pl:91
38751 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
38756 #: ../tools/virt-make-fs.pl:93
38757 msgid "FILESYSTEM TYPE"
38761 #: ../tools/virt-make-fs.pl:95
38763 "The default filesystem type is C<ext2>. Just about any filesystem type that "
38764 "libguestfs supports can be used (but I<not> read-only formats like "
38765 "ISO9660). Here are some of the more common choices:"
38769 #: ../tools/virt-make-fs.pl:101
38774 #: ../tools/virt-make-fs.pl:103
38776 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
38777 "you are not going to use the filesystem in a way that requires the journal, "
38778 "then this is just wasted overhead."
38782 #: ../tools/virt-make-fs.pl:107
38783 msgid "I<ntfs> or I<vfat>"
38787 #: ../tools/virt-make-fs.pl:109
38788 msgid "Useful if exporting data to a Windows guest."
38792 #: ../tools/virt-make-fs.pl:111
38794 "I<Note for vfat>: The tar archive or local directory must only contain files "
38795 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
38796 "program running within libguestfs is unable to change the ownership of "
38797 "non-root files, since vfat itself does not support this."
38801 #: ../tools/virt-make-fs.pl:116
38806 #: ../tools/virt-make-fs.pl:118
38808 "Lower overhead than C<ext2>, but certain limitations on filename length and "
38809 "total filesystem size."
38813 #: ../tools/virt-make-fs.pl:125
38816 " virt-make-fs --type=minix input minixfs.img\n"
38821 #: ../tools/virt-make-fs.pl:127
38822 msgid "TO PARTITION OR NOT TO PARTITION"
38826 #: ../tools/virt-make-fs.pl:129
38827 msgid "Optionally virt-make-fs can add a partition table to the output disk."
38831 #: ../tools/virt-make-fs.pl:131
38833 "Adding a partition can make the disk image more compatible with certain "
38834 "virtualized operating systems which don't expect to see a filesystem "
38835 "directly located on a block device (Linux doesn't care and will happily "
38836 "handle both types)."
38840 #: ../tools/virt-make-fs.pl:136
38842 "On the other hand, if you have a partition table then the output image is no "
38843 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
38844 "directly on a partitioned disk image. (However libguestfs tools such as "
38845 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
38849 #: ../tools/virt-make-fs.pl:144
38850 msgid "Add an MBR partition:"
38854 #: ../tools/virt-make-fs.pl:146
38857 " virt-make-fs --partition -- input disk.img\n"
38862 #: ../tools/virt-make-fs.pl:148
38864 "If the output disk image could be terabyte-sized or larger, it's better to "
38865 "use an EFI/GPT-compatible partition table:"
38869 #: ../tools/virt-make-fs.pl:151
38872 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
38877 #: ../tools/virt-make-fs.pl:179
38878 msgid "Enable debugging information."
38882 #: ../tools/virt-make-fs.pl:185
38883 msgid "B<--size=E<lt>NE<gt>>"
38887 #: ../tools/virt-make-fs.pl:187
38888 msgid "B<--size=+E<lt>NE<gt>>"
38892 #: ../tools/virt-make-fs.pl:189
38893 msgid "B<-s E<lt>NE<gt>>"
38897 #: ../tools/virt-make-fs.pl:191
38898 msgid "B<-s +E<lt>NE<gt>>"
38902 #: ../tools/virt-make-fs.pl:193
38903 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
38907 #: ../tools/virt-make-fs.pl:196
38909 "If this option is I<not> given, then the output image will be just large "
38910 "enough to contain all the files, with not much wasted space."
38914 #: ../tools/virt-make-fs.pl:199
38916 "To choose a fixed size output disk, specify an absolute number followed by "
38917 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
38918 "Petabytes or Exabytes. This must be large enough to contain all the input "
38919 "files, else you will get an error."
38923 #: ../tools/virt-make-fs.pl:204
38925 "To leave extra space, specify C<+> (plus sign) and a number followed by "
38926 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
38927 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
38928 "the input files, and (approximately) an extra 200 MB free space."
38932 #: ../tools/virt-make-fs.pl:210
38934 "Note that virt-make-fs estimates free space, and therefore will not produce "
38935 "filesystems containing precisely the free space requested. (It is much more "
38936 "expensive and time-consuming to produce a filesystem which has precisely the "
38937 "desired free space)."
38941 #: ../tools/virt-make-fs.pl:219
38942 msgid "B<--format=E<lt>fmtE<gt>>"
38946 #: ../tools/virt-make-fs.pl:221
38947 msgid "B<-F E<lt>fmtE<gt>>"
38951 #: ../tools/virt-make-fs.pl:223
38952 msgid "Choose the output disk image format."
38956 #: ../tools/virt-make-fs.pl:225
38957 msgid "The default is C<raw> (raw disk image)."
38961 #: ../tools/virt-make-fs.pl:227
38963 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
38964 "that would really make sense here is C<qcow2>."
38968 #: ../tools/virt-make-fs.pl:234
38969 msgid "B<--type=E<lt>fsE<gt>>"
38973 #: ../tools/virt-make-fs.pl:236
38974 msgid "B<-t E<lt>fsE<gt>>"
38978 #: ../tools/virt-make-fs.pl:238
38979 msgid "Choose the output filesystem type."
38983 #: ../tools/virt-make-fs.pl:240
38984 msgid "The default is C<ext2>."
38988 #: ../tools/virt-make-fs.pl:242
38989 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
38993 #: ../tools/virt-make-fs.pl:249
38994 msgid "B<--partition>"
38998 #: ../tools/virt-make-fs.pl:251
38999 msgid "B<--partition=E<lt>parttypeE<gt>>"
39003 #: ../tools/virt-make-fs.pl:253
39005 "If specified, this flag adds an MBR partition table to the output disk "
39010 #: ../tools/virt-make-fs.pl:256
39012 "You can change the partition table type, eg. I<--partition=gpt> for large "
39017 #: ../tools/virt-make-fs.pl:259
39019 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
39020 "might consider the next parameter to be the partition type. For example:"
39024 #: ../tools/virt-make-fs.pl:263
39027 " virt-make-fs --partition input.tar ...\n"
39032 #: ../tools/virt-make-fs.pl:265
39034 "would cause virt-make-fs to think you wanted to use a partition type of "
39035 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
39036 "dash) between options and the input file argument:"
39040 #: ../tools/virt-make-fs.pl:269
39043 " virt-make-fs --partition -- input.tar ...\n"
39048 #: ../tools/virt-make-fs.pl:541
39050 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
39051 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
39052 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
39056 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
39058 "When reporting bugs, please enable debugging and capture the I<complete> "
39063 #: ../tools/virt-make-fs.pl:558
39066 " export LIBGUESTFS_DEBUG=1\n"
39067 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
39072 #: ../tools/virt-make-fs.pl:561
39074 "Attach /tmp/virt-make-fs.log to a new bug report at "
39075 "L<https://bugzilla.redhat.com/>"
39079 #: ../tools/virt-tar.pl:33
39080 msgid "virt-tar - Extract or upload files to a virtual machine"
39084 #: ../tools/virt-tar.pl:37
39087 " virt-tar [--options] -x domname directory tarball\n"
39092 #: ../tools/virt-tar.pl:39
39095 " virt-tar [--options] -u domname tarball directory\n"
39100 #: ../tools/virt-tar.pl:41
39103 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
39108 #: ../tools/virt-tar.pl:43
39111 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
39116 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
39121 #: ../tools/virt-tar.pl:47
39123 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
39124 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
39128 #: ../tools/virt-tar.pl:52
39129 msgid "Download C</home> from the VM into a local tarball:"
39133 #: ../tools/virt-tar.pl:54
39136 " virt-tar -x domname /home home.tar\n"
39141 #: ../tools/virt-tar.pl:56
39144 " virt-tar -zx domname /home home.tar.gz\n"
39149 #: ../tools/virt-tar.pl:58
39150 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
39154 #: ../tools/virt-tar.pl:60
39157 " virt-tar -u domname uploadstuff.tar /tmp\n"
39162 #: ../tools/virt-tar.pl:62
39165 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
39170 #: ../tools/virt-tar.pl:66
39172 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
39173 "virtual machines. If you do this, you risk disk corruption in the VM. "
39174 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
39178 #: ../tools/virt-tar.pl:71
39180 "You can use I<-x> (extract) on live virtual machines, but you might get "
39181 "inconsistent results or errors if there is filesystem activity inside the "
39182 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
39183 "work, but the only way to guarantee consistent results is if the virtual "
39184 "machine is shut down."
39188 #: ../tools/virt-tar.pl:79
39190 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
39191 "parts of a guest filesystem. There are many possibilities: making backups, "
39192 "uploading data files, snooping on guest activity, fixing or customizing "
39197 #: ../tools/virt-tar.pl:84
39199 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
39200 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
39201 "should look at the L<guestfish(1)> tool."
39205 #: ../tools/virt-tar.pl:88
39207 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
39208 "its contents (recursively) from the virtual machine into a local tarball. "
39209 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
39210 "virtual machine. You cannot use these two options together."
39214 #: ../tools/virt-tar.pl:94
39216 "In addition, you may need to use the I<-z> (gZip) option to enable "
39217 "compression. When uploading, you have to specify I<-z> if the upload file "
39218 "is compressed because virt-tar won't detect this on its own."
39222 #: ../tools/virt-tar.pl:98
39224 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
39225 "example it cannot do PKZip files or bzip2 compression. If you want that "
39226 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
39227 "the L<libguestfs(3)> API)."
39231 #: ../tools/virt-tar.pl:160
39232 msgid "B<--extract>"
39236 #: ../tools/virt-tar.pl:162
39237 msgid "B<--download>"
39241 #: ../tools/virt-tar.pl:164
39246 #: ../tools/virt-tar.pl:166
39247 msgid "B<--upload>"
39251 #: ../tools/virt-tar.pl:168
39253 "Use I<-x> to extract (download) a directory from a virtual machine to a "
39258 #: ../tools/virt-tar.pl:171
39260 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
39261 "Please read the L</WARNING> section above before using this option."
39265 #: ../tools/virt-tar.pl:175
39266 msgid "You must specify exactly one of these options."
39270 #: ../tools/virt-tar.pl:181
39275 #: ../tools/virt-tar.pl:183
39280 #: ../tools/virt-tar.pl:185
39281 msgid "Specify that the input or output tarball is gzip-compressed."
39285 #: ../tools/virt-tar.pl:298
39287 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
39288 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39289 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
39290 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39294 #: ../tools/virt-win-reg.pl:37
39296 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
39301 #: ../tools/virt-win-reg.pl:41
39304 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
39309 #: ../tools/virt-win-reg.pl:43
39312 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
39317 #: ../tools/virt-win-reg.pl:45
39320 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
39325 #: ../tools/virt-win-reg.pl:47
39328 " virt-win-reg --merge domname [input.reg ...]\n"
39333 #: ../tools/virt-win-reg.pl:49
39336 " virt-win-reg [--options] disk.img ... # instead of domname\n"
39341 #: ../tools/virt-win-reg.pl:53
39343 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
39344 "virtual machines. If you do this, you I<will> get irreversible disk "
39345 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
39346 "but doesn't catch all cases."
39350 #: ../tools/virt-win-reg.pl:58
39352 "Modifying the Windows Registry is an inherently risky operation. The format "
39353 "is deliberately obscure and undocumented, and Registry changes can leave the "
39354 "system unbootable. Therefore when using the I<--merge> option, make sure "
39355 "you have a reliable backup first."
39359 #: ../tools/virt-win-reg.pl:65
39361 "This program can export and merge Windows Registry entries from a Windows "
39366 #: ../tools/virt-win-reg.pl:68
39368 "The first parameter is the libvirt guest name or the raw disk image of a "
39373 #: ../tools/virt-win-reg.pl:71
39375 "If I<--merge> is I<not> specified, then the chosen registry key is "
39376 "displayed/exported (recursively). For example:"
39380 #: ../tools/virt-win-reg.pl:74
39383 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
39388 #: ../tools/virt-win-reg.pl:76
39389 msgid "You can also display single values from within registry keys, for example:"
39393 #: ../tools/virt-win-reg.pl:79
39396 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
39397 " $ virt-win-reg Windows7 $cvkey ProductName\n"
39398 " Windows 7 Enterprise\n"
39403 #: ../tools/virt-win-reg.pl:83
39405 "With I<--merge>, you can merge a textual regedit file into the Windows "
39410 #: ../tools/virt-win-reg.pl:86
39413 " $ virt-win-reg --merge Windows7 changes.reg\n"
39418 #: ../tools/virt-win-reg.pl:90
39420 "This program is only meant for simple access to the registry. If you want "
39421 "to do complicated things with the registry, we suggest you download the "
39422 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
39423 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
39424 "L<hivexregedit(1)>."
39428 #: ../tools/virt-win-reg.pl:159
39433 #: ../tools/virt-win-reg.pl:161
39435 "In merge mode, this merges a textual regedit file into the Windows Registry "
39436 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
39437 "displays or exports Registry entries instead."
39441 #: ../tools/virt-win-reg.pl:165
39443 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
39444 "result in disk corruption. However exporting (without this flag) is always "
39449 #: ../tools/virt-win-reg.pl:173
39450 msgid "B<--encoding> UTF-16LE|ASCII"
39454 #: ../tools/virt-win-reg.pl:175
39456 "When merging (only), you may need to specify the encoding for strings to be "
39457 "used in the hive file. This is explained in detail in "
39458 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
39462 #: ../tools/virt-win-reg.pl:179
39464 "The default is to use UTF-16LE, which should work with recent versions of "
39469 #: ../tools/virt-win-reg.pl:186
39470 msgid "B<--unsafe-printable-strings>"
39474 #: ../tools/virt-win-reg.pl:188
39476 "When exporting (only), assume strings are UTF-16LE and print them as strings "
39477 "instead of hex sequences. Remove the final zero codepoint from strings if "
39482 #: ../tools/virt-win-reg.pl:192
39484 "This is unsafe and does not preserve the fidelity of strings in the original "
39485 "Registry for various reasons:"
39489 #: ../tools/virt-win-reg.pl:199
39491 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
39492 "other encodings will be corrupted by this transformation."
39496 #: ../tools/virt-win-reg.pl:204
39498 "Assumes that everything which has type 1 or 2 is really a string and that "
39499 "everything else is not a string, but the type field in real Registries is "
39504 #: ../tools/virt-win-reg.pl:210
39506 "Loses information about whether a zero codepoint followed the string in the "
39511 #: ../tools/virt-win-reg.pl:215
39513 "This all happens because the Registry itself contains no information about "
39514 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
39518 #: ../tools/virt-win-reg.pl:219
39520 "You should only use this option for quick hacking and debugging of the "
39521 "Registry contents, and I<never> use it if the output is going to be passed "
39522 "into another program or stored in another Registry."
39526 #: ../tools/virt-win-reg.pl:556
39527 msgid "SUPPORTED SYSTEMS"
39531 #: ../tools/virt-win-reg.pl:558
39533 "The program currently supports Windows NT-derived guests starting with "
39534 "Windows XP through to at least Windows 7."
39538 #: ../tools/virt-win-reg.pl:561
39539 msgid "The following Registry keys are supported:"
39543 #: ../tools/virt-win-reg.pl:565
39544 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
39548 #: ../tools/virt-win-reg.pl:567
39549 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
39553 #: ../tools/virt-win-reg.pl:569
39554 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
39558 #: ../tools/virt-win-reg.pl:571
39559 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
39563 #: ../tools/virt-win-reg.pl:573
39564 msgid "C<HKEY_USERS\\.DEFAULT>"
39568 #: ../tools/virt-win-reg.pl:575
39569 msgid "C<HKEY_USERS\\I<SID>>"
39573 #: ../tools/virt-win-reg.pl:577
39574 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
39578 #: ../tools/virt-win-reg.pl:579
39579 msgid "C<HKEY_USERS\\I<username>>"
39583 #: ../tools/virt-win-reg.pl:581
39584 msgid "where I<username> is a local user name (this is a libguestfs extension)."
39588 #: ../tools/virt-win-reg.pl:585
39590 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
39595 #: ../tools/virt-win-reg.pl:588
39597 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
39598 "supported (there is no \"current user\")."
39602 #: ../tools/virt-win-reg.pl:591
39607 #: ../tools/virt-win-reg.pl:593
39609 "C<virt-win-reg> expects that regedit files have already been reencoded in "
39610 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
39611 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
39612 "with Windows-style line endings, you may need to reencode the whole file "
39613 "before or after processing."
39617 #: ../tools/virt-win-reg.pl:599
39619 "To reencode a file from Windows format to Linux (before processing it with "
39620 "the I<--merge> option), you would do something like this:"
39624 #: ../tools/virt-win-reg.pl:602
39627 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
39632 #: ../tools/virt-win-reg.pl:604
39634 "To go in the opposite direction, after exporting and before sending the file "
39635 "to a Windows user, do something like this:"
39639 #: ../tools/virt-win-reg.pl:607
39642 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
39647 #: ../tools/virt-win-reg.pl:609
39648 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
39652 #: ../tools/virt-win-reg.pl:611
39654 "If you are unsure about the current encoding, use the L<file(1)> command. "
39655 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
39656 "Windows-style (CRLF) line endings, like this:"
39660 #: ../tools/virt-win-reg.pl:615
39663 " $ file software.reg\n"
39664 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
39665 " with CRLF line terminators\n"
39670 #: ../tools/virt-win-reg.pl:619
39671 msgid "This file would need conversion before you could I<--merge> it."
39675 #: ../tools/virt-win-reg.pl:621
39676 msgid "CurrentControlSet etc."
39680 #: ../tools/virt-win-reg.pl:623
39682 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
39683 "Registry at the level of the hive file, and therefore you cannot modify "
39688 #: ../tools/virt-win-reg.pl:627
39690 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
39691 "circumstances it might refer to another control set. The way to find out is "
39692 "to look at the C<HKLM\\SYSTEM\\Select> key:"
39696 #: ../tools/virt-win-reg.pl:631
39699 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
39700 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
39701 " \"Current\"=dword:00000001\n"
39702 " \"Default\"=dword:00000001\n"
39703 " \"Failed\"=dword:00000000\n"
39704 " \"LastKnownGood\"=dword:00000002\n"
39709 #: ../tools/virt-win-reg.pl:638
39710 msgid "\"Current\" is the one which Windows will choose when it boots."
39714 #: ../tools/virt-win-reg.pl:640
39715 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
39719 #: ../tools/virt-win-reg.pl:643
39720 msgid "WINDOWS TIPS"
39724 #: ../tools/virt-win-reg.pl:645
39726 "Note that some of these tips modify the guest disk image. The guest I<must> "
39727 "be shut off, else you will get disk corruption."
39731 #: ../tools/virt-win-reg.pl:648
39732 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
39736 #: ../tools/virt-win-reg.pl:650
39738 "Prepare a DOS batch script, VBScript or executable. Upload this using "
39739 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
39740 "is uploaded into C<C:\\>:"
39744 #: ../tools/virt-win-reg.pl:654
39747 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
39752 #: ../tools/virt-win-reg.pl:656
39753 msgid "Prepare a regedit file containing the registry change:"
39757 #: ../tools/virt-win-reg.pl:658
39760 " cat > test.reg <<'EOF'\n"
39761 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
39762 " \"Test\"=\"c:\\\\test.bat\"\n"
39768 #: ../tools/virt-win-reg.pl:663
39770 "In this example we use the key C<RunOnce> which means that the script will "
39771 "run precisely once when the first user logs in. If you want it to run every "
39772 "time a user logs in, replace C<RunOnce> with C<Run>."
39776 #: ../tools/virt-win-reg.pl:667
39777 msgid "Now update the registry:"
39781 #: ../tools/virt-win-reg.pl:669
39784 " virt-win-reg --merge WindowsGuest test.reg\n"
39789 #: ../tools/virt-win-reg.pl:671
39790 msgid "INSTALLING A SERVICE"
39794 #: ../tools/virt-win-reg.pl:673
39796 "This section assumes you are familiar with Windows services, and you either "
39797 "have a program which handles the Windows Service Control Protocol directly "
39798 "or you want to run any program using a service wrapper like SrvAny or the "
39803 #: ../tools/virt-win-reg.pl:678
39805 "First upload the program and optionally the service wrapper. In this case "
39806 "the test program is called C<test.exe> and we are using the RHSrvAny "
39811 #: ../tools/virt-win-reg.pl:682
39814 " guestfish -i -d WindowsGuest <<EOF\n"
39815 " upload rhsrvany.exe /rhsrvany.exe\n"
39816 " upload test.exe /test.exe\n"
39822 #: ../tools/virt-win-reg.pl:687
39824 "Prepare a regedit file containing the registry changes. In this example, "
39825 "the first registry change is needed for the service itself or the service "
39826 "wrapper (if used). The second registry change is only needed because I am "
39827 "using the RHSrvAny service wrapper."
39831 #: ../tools/virt-win-reg.pl:692
39834 " cat > service.reg <<'EOF'\n"
39835 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
39836 " \"Type\"=dword:00000010\n"
39837 " \"Start\"=dword:00000002\n"
39838 " \"ErrorControl\"=dword:00000001\n"
39839 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
39840 " \"DisplayName\"=\"RHSrvAny\"\n"
39841 " \"ObjectName\"=\"NetworkService\"\n"
39846 #: ../tools/virt-win-reg.pl:701
39849 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
39850 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
39851 " \"PWD\"=\"c:\\\\Temp\"\n"
39857 #: ../tools/virt-win-reg.pl:712
39859 "For use of C<ControlSet001> see the section above in this manual page. You "
39860 "may need to adjust this according to the control set that is in use by the "
39865 #: ../tools/virt-win-reg.pl:718
39867 "C<\"ObjectName\"> controls the privileges that the service will have. An "
39868 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
39869 "privileged account."
39873 #: ../tools/virt-win-reg.pl:724
39875 "For the meaning of the magic numbers, see this Microsoft KB article: "
39876 "L<http://support.microsoft.com/kb/103000>."
39880 #: ../tools/virt-win-reg.pl:729
39881 msgid "Update the registry:"
39885 #: ../tools/virt-win-reg.pl:731
39888 " virt-win-reg --merge WindowsGuest service.reg\n"
39893 #: ../tools/virt-win-reg.pl:735
39895 "Be careful when passing parameters containing C<\\> (backslash) in the "
39896 "shell. Usually you will have to use 'single quotes' or double backslashes "
39897 "(but not both) to protect them from the shell."
39901 #: ../tools/virt-win-reg.pl:739
39902 msgid "Paths and value names are case-insensitive."
39906 #: ../tools/virt-win-reg.pl:748
39908 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
39909 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
39910 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
39911 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39915 #: ../tools/virt-win-reg.pl:766
39918 " export LIBGUESTFS_DEBUG=1\n"
39919 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
39924 #: ../tools/virt-win-reg.pl:769
39926 "Attach /tmp/virt-win-reg.log to a new bug report at "
39927 "L<https://bugzilla.redhat.com/>"