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.21\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-10-14 15:06+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:42 ../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:92 ../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:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160 ../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:48 ../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:50 ../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:52 ../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:54
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:56 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174 ../fuse/guestmount.pod:102 ../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:59 ../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:61 ../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:63 ../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:66 ../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:69 ../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:71 ../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:73 ../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:95 ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:142 ../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:97 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235 ../fuse/guestmount.pod:144 ../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:99 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237 ../fuse/guestmount.pod:146 ../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:104 ../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:108 ../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:112 ../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:115 ../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:138 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390 ../fuse/guestmount.pod:266 ../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:140 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392 ../fuse/guestmount.pod:268 ../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:142 ../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:144 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397 ../fuse/guestmount.pod:272 ../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:146 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399 ../fuse/guestmount.pod:274 ../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:148 ../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:150 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412 ../fuse/guestmount.pod:287 ../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:152 ../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:475 ../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:477 ../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:482 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114 ../fuse/guestmount.pod:312 ../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:283 ../clone/virt-sysprep.pod:287 ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295 ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322 ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362 ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388 ../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:2013 ../fish/guestfish-actions.pod:2019 ../fish/guestfish-actions.pod:2027 ../fish/guestfish-actions.pod:2034 ../fish/guestfish-actions.pod:2041 ../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:3020 ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3034 ../src/guestfs-actions.pod:3041 ../src/guestfs-actions.pod:3048 ../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:486 ../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:1268 ../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:317 ../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:501 ../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:503 ../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:505 ../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:1300 ../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:332 ../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:507 ../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:509 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305 ../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:337 ../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:514 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310 ../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:342 ../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:519 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315 ../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:347 ../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:1051 ../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:135 ../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:172 ../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:174 ../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:314 ../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:4258
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 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2550 "recommend that you don't. The time you might want to run it as root is when "
2551 "you need root in order to access the disk image, but even in this case it "
2552 "would be better to change the permissions on the disk image to be writable "
2553 "as the non-root user running virt-sysprep."
2557 #: ../clone/virt-sysprep.pod:35
2559 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2560 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2561 "machines in preparation for cloning them. Having said that, virt-sysprep "
2562 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2563 "Windows sysprepping in a future version, and we already have code to do it."
2567 #: ../clone/virt-sysprep.pod:76
2568 msgid "B<--enable=...>"
2572 #: ../clone/virt-sysprep.pod:78
2574 "Choose which sysprep operations to perform. Give a comma-separated list of "
2575 "operations, for example:"
2579 #: ../clone/virt-sysprep.pod:81
2582 " --enable=ssh-hostkeys,udev-persistent-net\n"
2587 #: ../clone/virt-sysprep.pod:83
2588 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2592 #: ../clone/virt-sysprep.pod:85
2594 "If the I<--enable> option is not given, then we default to trying all "
2595 "possible sysprep operations. But some sysprep operations are skipped for "
2600 #: ../clone/virt-sysprep.pod:89
2602 "Use I<--list-operations> to list operations supported by a particular "
2603 "version of virt-sysprep."
2607 #: ../clone/virt-sysprep.pod:92
2608 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2612 #: ../clone/virt-sysprep.pod:106
2615 " virt-sysprep --format=raw -a disk.img\n"
2620 #: ../clone/virt-sysprep.pod:110
2623 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2628 #: ../clone/virt-sysprep.pod:119
2629 msgid "B<--hostname> newhostname"
2633 #: ../clone/virt-sysprep.pod:121
2635 "Change the hostname. See the L</hostname> operation below. If not given, "
2636 "defaults to C<localhost.localdomain>."
2640 #: ../clone/virt-sysprep.pod:124
2641 msgid "B<--list-operations>"
2645 #: ../clone/virt-sysprep.pod:126
2646 msgid "List the operations supported by the virt-sysprep program."
2650 #: ../clone/virt-sysprep.pod:128
2651 msgid "B<--selinux-relabel>"
2655 #: ../clone/virt-sysprep.pod:130
2656 msgid "B<--no-selinux-relabel>"
2660 #: ../clone/virt-sysprep.pod:132
2662 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2663 "I<--no-selinux-relabel> disables relabelling."
2667 #: ../clone/virt-sysprep.pod:135
2669 "The default is to try to detect if SELinux relabelling is required. See "
2670 "L</SELINUX RELABELLING> below for more details."
2674 #: ../clone/virt-sysprep.pod:156
2679 #: ../clone/virt-sysprep.pod:158
2681 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2682 "enabled>, although some are skipped depending on the type of guest."
2686 #: ../clone/virt-sysprep.pod:162
2688 "Operations can be individually enabled using the I<--enable> option. Use a "
2689 "comma-separated list, for example:"
2693 #: ../clone/virt-sysprep.pod:165
2696 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2701 #: ../clone/virt-sysprep.pod:167
2703 "To list the operations supported by the current version of virt-sysprep, use "
2704 "I<--list-operations>."
2708 #: ../clone/virt-sysprep.pod:170
2710 "Future versions of virt-sysprep may add more operations. If you are using "
2711 "virt-sysprep and want predictable behaviour, specify only the operations "
2712 "that you want to have enabled."
2716 #: ../clone/virt-sysprep.pod:174
2721 #: ../clone/virt-sysprep.pod:176
2722 msgid "Remove user at-jobs and cron-jobs."
2726 #: ../clone/virt-sysprep.pod:178
2727 msgid "dhcp-client-state"
2731 #: ../clone/virt-sysprep.pod:180
2732 msgid "Remove DHCP client leases."
2736 #: ../clone/virt-sysprep.pod:182
2737 msgid "dhcp-server-state"
2741 #: ../clone/virt-sysprep.pod:184
2742 msgid "Remove DHCP server leases."
2746 #: ../clone/virt-sysprep.pod:186
2751 #: ../clone/virt-sysprep.pod:188
2753 "Changes the hostname of the guest to the value given in the I<--hostname> "
2758 #: ../clone/virt-sysprep.pod:191
2760 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2761 "C<localhost.localdomain>."
2765 #: ../clone/virt-sysprep.pod:194
2770 #: ../clone/virt-sysprep.pod:196
2771 msgid "Remove many log files."
2775 #: ../clone/virt-sysprep.pod:198
2780 #: ../clone/virt-sysprep.pod:200
2781 msgid "Remove email from the local mail spool directory."
2785 #: ../clone/virt-sysprep.pod:202
2790 #: ../clone/virt-sysprep.pod:204
2792 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2793 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2797 #: ../clone/virt-sysprep.pod:207
2802 #: ../clone/virt-sysprep.pod:209
2804 "Write some random bytes from the host into the random seed file of the "
2809 #: ../clone/virt-sysprep.pod:212
2810 msgid "See C</RANDOM SEED> below."
2814 #: ../clone/virt-sysprep.pod:214
2815 msgid "rhn-systemid"
2819 #: ../clone/virt-sysprep.pod:216
2820 msgid "Remove the RHN system ID."
2824 #: ../clone/virt-sysprep.pod:218
2829 #: ../clone/virt-sysprep.pod:220
2830 msgid "Remove the Smolt hardware UUID."
2834 #: ../clone/virt-sysprep.pod:222
2835 msgid "ssh-hostkeys"
2839 #: ../clone/virt-sysprep.pod:224
2840 msgid "Remove the SSH host keys in the guest."
2844 #: ../clone/virt-sysprep.pod:226
2846 "The SSH host keys are regenerated (differently) next time the guest is "
2851 #: ../clone/virt-sysprep.pod:229
2853 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2854 "stark warning about the host key changing:"
2858 #: ../clone/virt-sysprep.pod:232
2861 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2862 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2863 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2864 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2869 #: ../clone/virt-sysprep.pod:237
2870 msgid "udev-persistent-net"
2874 #: ../clone/virt-sysprep.pod:239
2876 "Remove udev persistent net rules which map the guest's existing MAC address "
2877 "to a fixed ethernet device (eg. eth0)."
2881 #: ../clone/virt-sysprep.pod:242
2883 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2884 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2885 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2886 "Erasing the udev persistent net rules avoids this."
2890 #: ../clone/virt-sysprep.pod:247
2895 #: ../clone/virt-sysprep.pod:249
2896 msgid "Remove the utmp file."
2900 #: ../clone/virt-sysprep.pod:251
2902 "This records who is currently logged in on a machine. In modern Linux "
2903 "distros it is stored in a ramdisk and hence not part of the virtual "
2904 "machine's disk, but it was stored on disk in older distros."
2908 #: ../clone/virt-sysprep.pod:255
2913 #: ../clone/virt-sysprep.pod:257
2914 msgid "Remove the yum UUID."
2918 #: ../clone/virt-sysprep.pod:259
2920 "Yum creates a fresh UUID the next time it runs when it notices that the "
2921 "original UUID has been erased."
2925 #: ../clone/virt-sysprep.pod:262
2926 msgid "COPYING AND CLONING"
2930 #: ../clone/virt-sysprep.pod:264
2932 "Virt-sysprep can be used as part of a process of cloning guests, or to "
2933 "prepare a template from which guests can be cloned. There are many "
2934 "different ways to achieve this using the virt tools, and this section is "
2935 "just an introduction."
2939 #: ../clone/virt-sysprep.pod:269
2940 msgid "A virtual machine (when switched off) consists of two parts:"
2944 #: ../clone/virt-sysprep.pod:273
2945 msgid "I<configuration>"
2949 #: ../clone/virt-sysprep.pod:275
2951 "The configuration or description of the guest. eg. The libvirt XML (see "
2952 "C<virsh dumpxml>), the running configuration of the guest, or another "
2953 "external format like OVF."
2957 #: ../clone/virt-sysprep.pod:279
2958 msgid "Some configuration items that might need to be changed:"
2962 #: ../clone/virt-sysprep.pod:285
2967 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
2972 #: ../clone/virt-sysprep.pod:293
2973 msgid "path to block device(s)"
2977 #: ../clone/virt-sysprep.pod:297
2978 msgid "network card MAC address"
2982 #: ../clone/virt-sysprep.pod:301
2983 msgid "I<block device(s)>"
2987 #: ../clone/virt-sysprep.pod:303
2989 "One or more hard disk images, themselves containing files, directories, "
2990 "applications, kernels, configuration, etc."
2994 #: ../clone/virt-sysprep.pod:306
2995 msgid "Some things inside the block devices that might need to be changed:"
2999 #: ../clone/virt-sysprep.pod:312
3000 msgid "hostname and other net configuration"
3004 #: ../clone/virt-sysprep.pod:320
3005 msgid "SSH host keys"
3009 #: ../clone/virt-sysprep.pod:324
3010 msgid "Windows unique security ID (SID)"
3014 #: ../clone/virt-sysprep.pod:328
3015 msgid "Puppet registration"
3019 #: ../clone/virt-sysprep.pod:334
3020 msgid "COPYING THE BLOCK DEVICE"
3024 #: ../clone/virt-sysprep.pod:336
3026 "Starting with an original guest, you probably wish to copy the guest block "
3027 "device and its configuration to make a template. Then once you are happy "
3028 "with the template, you will want to make many clones from it."
3032 #: ../clone/virt-sysprep.pod:341
3038 " original guest --------> template ---------->\n"
3039 " \\------> cloned\n"
3040 " \\-----> guests\n"
3046 #: ../clone/virt-sysprep.pod:349
3048 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3053 #: ../clone/virt-sysprep.pod:352
3057 " original guest --------> template ---------->\n"
3058 " \\------> cloned\n"
3059 " \\-----> guests\n"
3065 #: ../clone/virt-sysprep.pod:358
3066 msgid "There are some smarter (and faster) ways too:"
3070 #: ../clone/virt-sysprep.pod:364
3074 " template ---------->\n"
3075 " \\------> cloned\n"
3076 " \\-----> guests\n"
3082 #: ../clone/virt-sysprep.pod:370
3084 "Use the block device as a backing file and create a snapshot on top for each "
3085 "guest. The advantage is that you don't need to copy the block device (very "
3086 "fast) and only changes are stored (less storage required)."
3090 #: ../clone/virt-sysprep.pod:375
3092 "Note that writing to the backing file once you have created guests on top of "
3093 "it is not possible: you will corrupt the guests."
3097 #: ../clone/virt-sysprep.pod:378
3099 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3100 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3101 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3102 "also create cheap snapshots from files or LUNs."
3106 #: ../clone/virt-sysprep.pod:386
3107 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3111 #: ../clone/virt-sysprep.pod:390
3112 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3116 #: ../clone/virt-sysprep.pod:394
3121 #: ../clone/virt-sysprep.pod:396
3123 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3124 "and/or modify the external libvirt configuration of a guest. It will reset "
3125 "the name, UUID and MAC address of the guest in the libvirt XML."
3129 #: ../clone/virt-sysprep.pod:401
3131 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3132 "image. This was the original motivation to write virt-sysprep."
3136 #: ../clone/virt-sysprep.pod:404
3141 #: ../clone/virt-sysprep.pod:406
3145 " original guest --------> template\n"
3150 #: ../clone/virt-sysprep.pod:409
3152 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3153 "it easier to compress and/or faster to copy."
3157 #: ../clone/virt-sysprep.pod:412
3159 "Notice that since virt-sparsify also copies the image, you can use it to "
3160 "make the initial copy (instead of C<dd>)."
3164 #: ../clone/virt-sysprep.pod:415
3169 #: ../clone/virt-sysprep.pod:417
3173 " template ---------->\n"
3174 " \\------> cloned\n"
3175 " \\-----> guests\n"
3181 #: ../clone/virt-sysprep.pod:423
3183 "If you want to give people cloned guests, but let them pick the size of the "
3184 "guest themselves (eg. depending on how much they are prepared to pay for "
3185 "disk space), then instead of copying the template, you can run "
3186 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3187 "ideal for cloning guests from a template."
3191 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1149
3196 #: ../clone/virt-sysprep.pod:431
3198 "Although virt-sysprep removes some sensitive information from the guest, it "
3199 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3200 "above, and the implementation of the operations in the shell script. You "
3201 "should also examine the guest afterwards."
3205 #: ../clone/virt-sysprep.pod:436
3207 "Sensitive files are simply removed. The data they contained may still exist "
3208 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3209 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3210 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3215 #: ../clone/virt-sysprep.pod:442
3220 #: ../clone/virt-sysprep.pod:444
3221 msgid "I<(This section applies to Linux guests only)>"
3225 #: ../clone/virt-sysprep.pod:446
3227 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3228 "from the host into the guest's random seed file."
3232 #: ../clone/virt-sysprep.pod:449
3234 "If this is just done once and the guest is cloned from the same template, "
3235 "then each guest will start with the same entropy, and things like SSH host "
3236 "keys and TCP sequence numbers may be predictable."
3240 #: ../clone/virt-sysprep.pod:453
3242 "Therefore you should arrange to add more randomness I<after> cloning from a "
3243 "template too, which can be done by just enabling the C<random-seed> "
3248 #: ../clone/virt-sysprep.pod:457
3251 " cp template.img newguest.img\n"
3252 " virt-sysprep --enable=random-seed -a newguest.img\n"
3257 #: ../clone/virt-sysprep.pod:460
3258 msgid "SELINUX RELABELLING"
3262 #: ../clone/virt-sysprep.pod:462
3263 msgid "I<(This section applies to Linux guests using SELinux only)>"
3267 #: ../clone/virt-sysprep.pod:464
3269 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3270 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3271 "next time the guest is booted. This process interrupts boot and can take "
3276 #: ../clone/virt-sysprep.pod:469
3278 "You can force relabelling for all guests by supplying the "
3279 "I<--selinux-relabel> option."
3283 #: ../clone/virt-sysprep.pod:472
3285 "You can disable relabelling entirely by supplying the "
3286 "I<--no-selinux-relabel> option."
3290 #: ../clone/virt-sysprep.pod:484
3291 msgid "This program returns 0 on success, or 1 if there was an error."
3295 #: ../clone/virt-sysprep.pod:488
3297 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3298 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3299 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3300 "L<http://libvirt.org/>."
3304 #: ../df/virt-df.pod:5
3305 msgid "virt-df - Display free space on virtual filesystems"
3309 #: ../df/virt-df.pod:9
3312 " virt-df [--options]\n"
3317 #: ../df/virt-df.pod:11
3320 " virt-df [--options] -d domname\n"
3325 #: ../df/virt-df.pod:13
3328 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3333 #: ../df/virt-df.pod:17
3336 " virt-df [--options] domname\n"
3341 #: ../df/virt-df.pod:19
3344 " virt-df [--options] disk.img [disk.img ...]\n"
3349 #: ../df/virt-df.pod:23
3351 "C<virt-df> is a command line tool to display free space on virtual machine "
3352 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3353 "allocated to a virtual machine, but can look inside disk images to see how "
3354 "much space is really being used."
3358 #: ../df/virt-df.pod:28
3360 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3361 "to get a list of all active and inactive guests, and performs a C<df>-type "
3362 "operation on each one in turn, printing out the results."
3366 #: ../df/virt-df.pod:32
3368 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3369 "C<df>-type operation on either the single named libvirt domain, or on the "
3370 "disk image(s) listed on the command line (which must all belong to a single "
3371 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3372 "single guest>. If you want to run on multiple guests, then you have to "
3373 "invoke C<virt-df> multiple times."
3377 #: ../df/virt-df.pod:39
3379 "Use the I<--csv> option to get a format which can be easily parsed by other "
3380 "programs. Other options are similar to the standard L<df(1)> command."
3384 #: ../df/virt-df.pod:45
3386 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3387 "output human-readable:"
3391 #: ../df/virt-df.pod:48
3394 " # virt-df -d F14x64 -h\n"
3395 " Filesystem Size Used Available Use%\n"
3396 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3397 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3402 #: ../df/virt-df.pod:53
3403 msgid "Show disk usage for a disk image file called C<test.img>:"
3407 #: ../df/virt-df.pod:55
3410 " $ virt-df -a test1.img\n"
3411 " Filesystem 1K-blocks Used Available Use%\n"
3412 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3417 #: ../df/virt-df.pod:112
3420 " virt-df --format=raw -a disk.img\n"
3425 #: ../df/virt-df.pod:116
3428 " virt-df --format=raw -a disk.img --format -a another.img\n"
3433 #: ../df/virt-df.pod:129
3434 msgid "Print sizes in human-readable format."
3438 #: ../df/virt-df.pod:131
3439 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3443 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3448 #: ../df/virt-df.pod:135
3453 #: ../df/virt-df.pod:137
3454 msgid "Print inodes instead of blocks."
3458 #: ../df/virt-df.pod:139
3459 msgid "B<--one-per-guest>"
3463 #: ../df/virt-df.pod:141
3465 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3466 "disks from several guests to a single libguestfs appliance."
3470 #: ../df/virt-df.pod:144
3471 msgid "You might use this option in the following circumstances:"
3475 #: ../df/virt-df.pod:150
3477 "If you think an untrusted guest might actively try to exploit the libguestfs "
3478 "appliance kernel, then this prevents one guest from interfering with the "
3479 "stats printed for another guest."
3483 #: ../df/virt-df.pod:156
3485 "If the kernel has a bug which stops it from accessing a filesystem in one "
3486 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3487 "and report stats for further guests."
3491 #: ../df/virt-df.pod:165
3493 "Print UUIDs instead of names. This is useful for following a guest even "
3494 "when the guest is migrated or renamed, or when two guests happen to have the "
3499 #: ../df/virt-df.pod:169
3501 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3502 "images, we still print the disk image name even when this option is "
3507 #: ../df/virt-df.pod:229
3509 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3510 "L<http://libguestfs.org/>."
3514 #: ../edit/virt-edit.pod:5
3515 msgid "virt-edit - Edit a file in a virtual machine"
3519 #: ../edit/virt-edit.pod:9
3522 " virt-edit [--options] -d domname file [file ...]\n"
3527 #: ../edit/virt-edit.pod:11
3530 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3535 #: ../edit/virt-edit.pod:13
3538 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3543 #: ../edit/virt-edit.pod:17
3546 " virt-edit domname file\n"
3551 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3554 " virt-edit disk.img [disk.img ...] file\n"
3559 #: ../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
3564 #: ../edit/virt-edit.pod:23
3566 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3567 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3568 "doing this, but doesn't catch all cases."
3572 #: ../edit/virt-edit.pod:29
3574 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3575 "exists in the named virtual machine (or disk image)."
3579 #: ../edit/virt-edit.pod:32
3581 "Multiple filenames can be given, in which case they are each edited in "
3582 "turn. Each filename must be a full path, starting at the root directory "
3583 "(starting with '/')."
3587 #: ../edit/virt-edit.pod:36
3588 msgid "If you want to just view a file, use L<virt-cat(1)>."
3592 #: ../edit/virt-edit.pod:38
3594 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3595 "L</USING GUESTFISH> below)."
3599 #: ../edit/virt-edit.pod:41
3601 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3602 "that and much more."
3606 #: ../edit/virt-edit.pod:46
3607 msgid "Edit the named files interactively:"
3611 #: ../edit/virt-edit.pod:48
3614 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3619 #: ../edit/virt-edit.pod:50
3622 " virt-edit -d mydomain /etc/passwd\n"
3627 #: ../edit/virt-edit.pod:52
3628 msgid "For Windows guests, some Windows paths are understood:"
3632 #: ../edit/virt-edit.pod:54
3635 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3640 #: ../edit/virt-edit.pod:56
3642 "If Perl is installed, you can also edit files non-interactively (see "
3643 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3647 #: ../edit/virt-edit.pod:60
3650 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3655 #: ../edit/virt-edit.pod:81
3656 msgid "B<-b> extension"
3660 #: ../edit/virt-edit.pod:83
3661 msgid "B<--backup> extension"
3665 #: ../edit/virt-edit.pod:85
3667 "Create a backup of the original file I<in the guest disk image>. The backup "
3668 "has the original filename with C<extension> added."
3672 #: ../edit/virt-edit.pod:88
3674 "Usually the first character of C<extension> would be a dot C<.> so you would "
3679 #: ../edit/virt-edit.pod:91
3682 " virt-edit -b .orig [etc]\n"
3687 #: ../edit/virt-edit.pod:93
3688 msgid "By default, no backup file is made."
3692 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181 ../fuse/guestmount.pod:105 ../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
3697 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183 ../fuse/guestmount.pod:107 ../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
3698 msgid "B<--connect URI>"
3702 #: ../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
3704 "If you specify guest block devices directly, then libvirt is not used at "
3709 #: ../edit/virt-edit.pod:114
3711 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3712 "off so you cannot see what you are typing. If you are not worried about "
3713 "Tempest attacks and there is no one else in the room you can specify this "
3714 "flag to see what you are typing."
3718 #: ../edit/virt-edit.pod:119
3723 #: ../edit/virt-edit.pod:121
3724 msgid "B<--expr> EXPR"
3728 #: ../edit/virt-edit.pod:123
3730 "Instead of launching the external editor, non-interactively apply the Perl "
3731 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3736 #: ../edit/virt-edit.pod:127
3738 "Be careful to properly quote the expression to prevent it from being altered "
3743 #: ../edit/virt-edit.pod:130
3744 msgid "Note that this option is only available when Perl 5 is installed."
3748 #: ../edit/virt-edit.pod:132
3749 msgid "B<--format> raw|qcow2|..."
3753 #: ../edit/virt-edit.pod:143
3756 " virt-edit --format=raw -a disk.img file\n"
3761 #: ../edit/virt-edit.pod:147
3764 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3769 #: ../edit/virt-edit.pod:181
3770 msgid "Previous versions of virt-edit allowed you to write either:"
3774 #: ../edit/virt-edit.pod:187
3777 " virt-edit guestname file\n"
3782 #: ../edit/virt-edit.pod:195
3783 msgid "NON-INTERACTIVE EDITING"
3787 #: ../edit/virt-edit.pod:197
3789 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3790 "administrator can interactively edit the file."
3794 #: ../edit/virt-edit.pod:200
3796 "There are two ways also to use C<virt-edit> from scripts in order to make "
3797 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3798 "like this, it's less error-prone to write scripts directly using the "
3799 "libguestfs API and Augeas for configuration file editing.)"
3803 #: ../edit/virt-edit.pod:206
3805 "The first method is to temporarily set C<$EDITOR> to any script or program "
3806 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3807 "update C<tmpfile> in place however it likes."
3811 #: ../edit/virt-edit.pod:210
3813 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3814 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3815 "instances of C<foo> with C<bar> in a file:"
3819 #: ../edit/virt-edit.pod:214
3822 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3827 #: ../edit/virt-edit.pod:216
3829 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3830 "For example to delete root's password you could do:"
3834 #: ../edit/virt-edit.pod:219
3837 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3842 #: ../edit/virt-edit.pod:221
3844 "What really happens is that the snippet is evaluated as a Perl expression "
3845 "for each line of the file. The line, including the final C<\\n>, is passed "
3846 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3850 #: ../edit/virt-edit.pod:226
3852 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3853 "C<apache> user account from the password file you can do:"
3857 #: ../edit/virt-edit.pod:229
3860 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3865 #: ../edit/virt-edit.pod:231
3867 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3868 "the end of the file is rather difficult this way since there is no concept "
3869 "of \"last line of the file\" - your expression just doesn't get called "
3870 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3875 #: ../edit/virt-edit.pod:237
3877 "The variable C<$lineno> contains the current line number. As is "
3878 "traditional, the first line in the file is number C<1>."
3882 #: ../edit/virt-edit.pod:240
3884 "The return value from the expression is ignored, but the expression may call "
3885 "C<die> in order to abort the whole program, leaving the original file "
3890 #: ../edit/virt-edit.pod:244
3892 "Remember when matching the end of a line that C<$_> may contain the final "
3893 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3894 "newline then neither of these. Thus to match or substitute some text at the "
3895 "end of a line, use this regular expression:"
3899 #: ../edit/virt-edit.pod:249
3902 " /some text(\\r?\\n)?$/\n"
3907 #: ../edit/virt-edit.pod:251
3909 "Alternately, use the perl C<chomp> function, being careful not to chomp "
3910 "C<$_> itself (since that would remove all newlines from the file):"
3914 #: ../edit/virt-edit.pod:255
3917 " my $m = $_; chomp $m; $m =~ /some text$/\n"
3922 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
3923 msgid "WINDOWS PATHS"
3927 #: ../edit/virt-edit.pod:259
3929 "C<virt-edit> has a limited ability to understand Windows drive letters and "
3930 "paths (eg. C<E:\\foo\\bar.txt>)."
3934 #: ../edit/virt-edit.pod:262
3935 msgid "If and only if the guest is running Windows then:"
3939 #: ../edit/virt-edit.pod:268
3941 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
3942 "to the correct filesystem."
3946 #: ../edit/virt-edit.pod:273
3948 "Any backslash (C<\\>) characters in the path are replaced with forward "
3949 "slashes so that libguestfs can process it."
3953 #: ../edit/virt-edit.pod:278
3955 "The path is resolved case insensitively to locate the file that should be "
3960 #: ../edit/virt-edit.pod:283
3961 msgid "There are some known shortcomings:"
3965 #: ../edit/virt-edit.pod:289
3966 msgid "Some NTFS symbolic links may not be followed correctly."
3970 #: ../edit/virt-edit.pod:293
3971 msgid "NTFS junction points that cross filesystems are not followed."
3975 #: ../edit/virt-edit.pod:299
3977 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
3978 "C<virt-edit> doesn't work."
3982 #: ../edit/virt-edit.pod:302
3983 msgid "Using C<virt-edit> is approximately equivalent to doing:"
3987 #: ../edit/virt-edit.pod:304
3990 " guestfish --rw -i -d domname edit /file\n"
3995 #: ../edit/virt-edit.pod:306
3997 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4002 #: ../edit/virt-edit.pod:309
4004 "The command above uses libguestfs's guest inspection feature and so does not "
4005 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4006 "disk images that don't contain guests. To edit a file on a disk image "
4011 #: ../edit/virt-edit.pod:314
4014 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4019 #: ../edit/virt-edit.pod:316
4021 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4022 "the disk image to edit, and C</file> is the full path to the file."
4026 #: ../edit/virt-edit.pod:320
4028 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4029 "C<write> or C<upload> instead:"
4033 #: ../edit/virt-edit.pod:323
4036 " guestfish --rw -i -d domname touch /newfile\n"
4041 #: ../edit/virt-edit.pod:325
4044 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4049 #: ../edit/virt-edit.pod:327
4052 " guestfish --rw -i -d domname upload localfile /newfile\n"
4057 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119 ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232 ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
4058 msgid "ENVIRONMENT VARIABLES"
4062 #: ../edit/virt-edit.pod:333
4067 #: ../edit/virt-edit.pod:335
4069 "If set, this string is used as the editor. It may contain arguments, "
4070 "eg. C<\"emacs -nw\">"
4074 #: ../edit/virt-edit.pod:338
4075 msgid "If not set, C<vi> is used."
4079 #: ../edit/virt-edit.pod:356
4081 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4082 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4083 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4087 #: ../erlang/examples/guestfs-erlang.pod:5
4088 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4092 #: ../erlang/examples/guestfs-erlang.pod:9
4095 " {ok, G} = guestfs:create(),\n"
4096 " ok = guestfs:add_drive_opts(G, Disk,\n"
4097 " [{format, \"raw\"}, {readonly, true}]),\n"
4098 " ok = guestfs:launch(G),\n"
4099 " [Device] = guestfs:list_devices(G),\n"
4100 " ok = guestfs:close(G).\n"
4105 #: ../erlang/examples/guestfs-erlang.pod:18
4107 "This manual page documents how to call libguestfs from the Erlang "
4108 "programming language. This page just documents the differences from the C "
4109 "API and gives some examples. If you are not familiar with using libguestfs, "
4110 "you also need to read L<guestfs(3)>."
4114 #: ../erlang/examples/guestfs-erlang.pod:23
4115 msgid "OPENING AND CLOSING THE HANDLE"
4119 #: ../erlang/examples/guestfs-erlang.pod:25
4121 "The Erlang bindings are implemented using an external program called "
4122 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4123 "should specify the full path to the program:"
4127 #: ../erlang/examples/guestfs-erlang.pod:29
4130 " {ok, G} = guestfs:create().\n"
4135 #: ../erlang/examples/guestfs-erlang.pod:31
4138 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4143 #: ../erlang/examples/guestfs-erlang.pod:33
4144 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4148 #: ../erlang/examples/guestfs-erlang.pod:36
4149 msgid "To close the handle:"
4153 #: ../erlang/examples/guestfs-erlang.pod:38
4156 " ok = guestfs:close(G).\n"
4161 #: ../erlang/examples/guestfs-erlang.pod:40
4162 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4166 #: ../erlang/examples/guestfs-erlang.pod:42
4168 "For functions that take optional arguments, the first arguments are the "
4169 "non-optional ones. The last argument is a list of tuples supplying the "
4170 "remaining optional arguments."
4174 #: ../erlang/examples/guestfs-erlang.pod:46
4177 " ok = guestfs:add_drive_opts(G, Disk,\n"
4178 " [{format, \"raw\"}, {readonly, true}]).\n"
4183 #: ../erlang/examples/guestfs-erlang.pod:49
4184 msgid "If the last argument would be an empty list, you can also omit it:"
4188 #: ../erlang/examples/guestfs-erlang.pod:51
4191 " ok = guestfs:add_drive_opts(G, Disk).\n"
4196 #: ../erlang/examples/guestfs-erlang.pod:53
4197 msgid "RETURN VALUES AND ERRORS"
4201 #: ../erlang/examples/guestfs-erlang.pod:55
4203 "On success, most functions return a C<Result> term (which could be a list, "
4204 "string, tuple etc.). If there is nothing for the function to return, then "
4205 "the atom C<ok> is returned."
4209 #: ../erlang/examples/guestfs-erlang.pod:59
4210 msgid "On error, you would see one of the following tuples:"
4214 #: ../erlang/examples/guestfs-erlang.pod:63
4215 msgid "C<{error, Msg, Errno}>"
4219 #: ../erlang/examples/guestfs-erlang.pod:65
4220 msgid "This indicates an ordinary error from the function."
4224 #: ../erlang/examples/guestfs-erlang.pod:67
4226 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4231 #: ../erlang/examples/guestfs-erlang.pod:70
4232 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4236 #: ../erlang/examples/guestfs-erlang.pod:72
4237 msgid "C<{unknown, Function}>"
4241 #: ../erlang/examples/guestfs-erlang.pod:74
4243 "This indicates that the function you called is not known. Generally this "
4244 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4245 "which you should not do."
4249 #: ../erlang/examples/guestfs-erlang.pod:78
4250 msgid "C<Function> is the name of the unknown function."
4254 #: ../erlang/examples/guestfs-erlang.pod:80
4255 msgid "C<{unknownarg, Arg}>"
4259 #: ../erlang/examples/guestfs-erlang.pod:82
4261 "This indicates that you called a function with optional arguments, with an "
4262 "unknown argument name."
4266 #: ../erlang/examples/guestfs-erlang.pod:85
4267 msgid "C<Arg> is the name of the unknown argument."
4271 #: ../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
4272 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4276 #: ../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
4281 #: ../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
4282 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4286 #: ../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
4291 #: ../erlang/examples/guestfs-erlang.pod:99
4293 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4294 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4295 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4296 "L<http://libguestfs.org/>."
4300 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../fish/guestfish.pod:1296 ../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:328 ../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
4305 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../fish/guestfish.pod:1298 ../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:330 ../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
4306 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4310 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4311 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4315 #: ../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
4317 "The examples in this manual page may be freely copied, modified and "
4318 "distributed without any restrictions."
4322 #: ../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
4324 "This library is free software; you can redistribute it and/or modify it "
4325 "under the terms of the GNU Lesser General Public License as published by the "
4326 "Free Software Foundation; either version 2 of the License, or (at your "
4327 "option) any later version."
4331 #: ../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
4333 "This library is distributed in the hope that it will be useful, but WITHOUT "
4334 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4335 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4340 #: ../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
4342 "You should have received a copy of the GNU Lesser General Public License "
4343 "along with this library; if not, write to the Free Software Foundation, "
4344 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4348 #: ../examples/guestfs-examples.pod:5
4349 msgid "guestfs-examples - Examples of using libguestfs from C"
4353 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4356 " #include <guestfs.h>\n"
4361 #: ../examples/guestfs-examples.pod:11
4364 " guestfs_h *g = guestfs_create ();\n"
4365 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4366 " guestfs_launch (g);\n"
4371 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4374 " cc prog.c -o prog -lguestfs\n"
4376 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4381 #: ../examples/guestfs-examples.pod:21
4383 "This manual page contains examples of calling libguestfs from the C "
4384 "programming language. If you are not familiar with using libguestfs, you "
4385 "also need to read L<guestfs(3)>."
4389 #: ../examples/guestfs-examples.pod:35
4391 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4392 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4393 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4397 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4398 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4402 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4407 #: ../examples/guestfs-recipes.pod:5
4409 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4410 "here. The only way which works for both sorts of output is to just write "
4411 "the URL directly. Do NOT use L<...> for URLs."
4415 #: ../examples/guestfs-recipes.pod:9
4417 "We break with tradition here and don't use ALL CAPS for the section "
4418 "headings, as this makes them much easier to read."
4422 #: ../examples/guestfs-recipes.pod:16
4423 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4427 #: ../examples/guestfs-recipes.pod:20
4429 "This page contains recipes for and links to things you can do using "
4430 "libguestfs, L<guestfish(1)> and the virt tools."
4434 #: ../examples/guestfs-recipes.pod:23
4435 msgid "Audit a virtual machine for setuid files"
4439 #: ../examples/guestfs-recipes.pod:25
4441 "The link below contains a small program which can be used to audit a Linux "
4442 "virtual machine to see what setuid and setgid files it contains."
4446 #: ../examples/guestfs-recipes.pod:28
4447 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4451 #: ../examples/guestfs-recipes.pod:30
4452 msgid "Change the background image in a Windows XP VM"
4456 #: ../examples/guestfs-recipes.pod:32
4458 "The links below explain how to use L<guestfish(1)> to change the background "
4459 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4460 "be substantially different for each version of Windows."
4464 #: ../examples/guestfs-recipes.pod:37
4466 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4467 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4471 #: ../examples/guestfs-recipes.pod:40
4472 msgid "Cloning a virtual machine (Linux)"
4476 #: ../examples/guestfs-recipes.pod:42
4478 "The guestfish technique described in the link below works well for most "
4479 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4484 #: ../examples/guestfs-recipes.pod:46
4485 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4489 #: ../examples/guestfs-recipes.pod:48
4491 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4496 #: ../examples/guestfs-recipes.pod:51
4497 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4501 #: ../examples/guestfs-recipes.pod:53
4502 msgid "Cloning a virtual machine (Windows)"
4506 #: ../examples/guestfs-recipes.pod:55
4508 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4509 "straightforward. Currently there is code in the Aeolus Oz project which "
4510 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4511 "we may add sysprepping ability."
4515 #: ../examples/guestfs-recipes.pod:60
4517 "https://github.com/clalancette/oz "
4518 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4522 #: ../examples/guestfs-recipes.pod:63
4523 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4527 #: ../examples/guestfs-recipes.pod:65
4528 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4532 #: ../examples/guestfs-recipes.pod:67
4535 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4540 #: ../examples/guestfs-recipes.pod:69
4541 msgid "To export just a subdirectory, eg. C</files>, do:"
4545 #: ../examples/guestfs-recipes.pod:71
4548 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4553 #: ../examples/guestfs-recipes.pod:73
4554 msgid "Create empty disk images"
4558 #: ../examples/guestfs-recipes.pod:75
4560 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4561 "The useful guide below explains the options available."
4565 #: ../examples/guestfs-recipes.pod:78
4566 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4570 #: ../examples/guestfs-recipes.pod:80
4571 msgid "Dump raw filesystem content from inside a disk image or VM"
4575 #: ../examples/guestfs-recipes.pod:82
4577 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4578 "filesystem content from any filesystem in a disk image or a VM (even one "
4579 "which is encrypted or buried inside an LV):"
4583 #: ../examples/guestfs-recipes.pod:86
4586 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4591 #: ../examples/guestfs-recipes.pod:88
4594 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4599 #: ../examples/guestfs-recipes.pod:90
4600 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4604 #: ../examples/guestfs-recipes.pod:92
4605 msgid "Edit grub configuration in a VM"
4609 #: ../examples/guestfs-recipes.pod:94
4610 msgid "You can use this to:"
4614 #: ../examples/guestfs-recipes.pod:100
4615 msgid "Fix a virtual machine that does not boot."
4619 #: ../examples/guestfs-recipes.pod:104
4620 msgid "Change which kernel is used to boot the VM."
4624 #: ../examples/guestfs-recipes.pod:108
4625 msgid "Change kernel command line options."
4629 #: ../examples/guestfs-recipes.pod:112
4630 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4634 #: ../examples/guestfs-recipes.pod:114
4637 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4642 #: ../examples/guestfs-recipes.pod:116
4644 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4649 #: ../examples/guestfs-recipes.pod:119
4652 " virt-rescue -d BrokenGuest\n"
4657 #: ../examples/guestfs-recipes.pod:121
4658 msgid "Export any directory from a VM"
4662 #: ../examples/guestfs-recipes.pod:123
4663 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4667 #: ../examples/guestfs-recipes.pod:126
4670 " virt-copy-out -d Guest /home .\n"
4675 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1327 ../fish/guestfish-actions.pod:1592 ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2033 ../src/guestfs-actions.pod:2457 ../src/guestfs-actions.pod:3016 ../src/guestfs.pod:1670 ../tools/virt-win-reg.pl:706
4680 #: ../examples/guestfs-recipes.pod:134
4682 "The final dot of the command is not a printing error. It means we want to "
4683 "copy out to the current directory."
4687 #: ../examples/guestfs-recipes.pod:139
4688 msgid "This creates a directory called C<home> under the current directory."
4692 #: ../examples/guestfs-recipes.pod:143
4694 "If the guest is a Windows guest then you can use drive letters and "
4695 "backslashes, but you must prefix the path with C<win:> and quote it to "
4696 "protect it from the shell, like this:"
4700 #: ../examples/guestfs-recipes.pod:147
4703 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4708 #: ../examples/guestfs-recipes.pod:149
4709 msgid "To get the output as a compressed tarball, do:"
4713 #: ../examples/guestfs-recipes.pod:151
4716 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4721 #: ../examples/guestfs-recipes.pod:153
4723 "Although it sounds tempting, this is usually not a reliable way to get a "
4724 "backup from a running guest. See the entry in the FAQ: "
4725 "http://libguestfs.org/FAQ.html#backup"
4729 #: ../examples/guestfs-recipes.pod:157
4730 msgid "Find out which user is using the most space"
4734 #: ../examples/guestfs-recipes.pod:159
4736 "This simple script examines a Linux guest to find out which user is using "
4737 "the most space in their home directory:"
4741 #: ../examples/guestfs-recipes.pod:162
4749 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4757 #: ../examples/guestfs-recipes.pod:166
4766 #: ../examples/guestfs-recipes.pod:169
4769 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4774 #: ../examples/guestfs-recipes.pod:171
4777 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4778 " echo -n \"$dir/$d\"\n"
4780 " guestfish --remote du \"$dir/$d\";\n"
4781 " done | sort -nr -k 2\n"
4786 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4789 " guestfish --remote exit\n"
4794 #: ../examples/guestfs-recipes.pod:179
4795 msgid "Get DHCP address from a VM"
4799 #: ../examples/guestfs-recipes.pod:181
4801 "The link below explains the many different possible techniques for getting "
4802 "the last assigned DHCP address of a virtual machine."
4806 #: ../examples/guestfs-recipes.pod:184
4807 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4811 #: ../examples/guestfs-recipes.pod:186
4813 "In the libguestfs source examples directory you will find the latest version "
4814 "of the C<virt-dhcp-address.c> program."
4818 #: ../examples/guestfs-recipes.pod:189
4819 msgid "Get the operating system product name string"
4823 #: ../examples/guestfs-recipes.pod:191
4824 msgid "Save the following script into a file called C<product-name.sh>:"
4828 #: ../examples/guestfs-recipes.pod:193
4833 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4834 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4835 " guestfish --remote inspect-get-product-name \"$root\"\n"
4836 " guestfish --remote exit\n"
4841 #: ../examples/guestfs-recipes.pod:200
4842 msgid "Make the script executable and run it on a named guest:"
4846 #: ../examples/guestfs-recipes.pod:202
4849 " # product-name.sh RHEL60x64\n"
4850 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4855 #: ../examples/guestfs-recipes.pod:205
4857 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4858 "C<xpath> command line tool or from your favourite programming language:"
4862 #: ../examples/guestfs-recipes.pod:209
4865 " # virt-inspector RHEL60x64 > xml\n"
4866 " # xpath '//product_name' < xml\n"
4869 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4870 "(Santiago)</product_name>\n"
4875 #: ../examples/guestfs-recipes.pod:215
4876 msgid "Get the default boot kernel for a Linux VM"
4880 #: ../examples/guestfs-recipes.pod:217
4882 "The link below contains a program to print the default boot kernel for a "
4887 #: ../examples/guestfs-recipes.pod:220
4888 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4892 #: ../examples/guestfs-recipes.pod:222
4894 "It uses Augeas, and the technique is generally applicable for many different "
4899 #: ../examples/guestfs-recipes.pod:229
4900 msgid "listing the user accounts in the guest"
4904 #: ../examples/guestfs-recipes.pod:233
4905 msgid "what repositories is it configured to use"
4909 #: ../examples/guestfs-recipes.pod:237
4910 msgid "what NTP servers does it connect to"
4914 #: ../examples/guestfs-recipes.pod:241
4915 msgid "what were the boot messages last time it booted"
4919 #: ../examples/guestfs-recipes.pod:245
4920 msgid "listing who was logged in recently"
4924 #: ../examples/guestfs-recipes.pod:249
4925 msgid "http://augeas.net/"
4929 #: ../examples/guestfs-recipes.pod:251
4930 msgid "Install RPMs in a guest"
4934 #: ../examples/guestfs-recipes.pod:253
4936 "The link below contains a method to install RPMs in a guest. In fact the "
4937 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4938 "installs them next time the guest is booted. You could use this technique "
4939 "to install vital security updates in an offline guest."
4943 #: ../examples/guestfs-recipes.pod:259
4944 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4948 #: ../examples/guestfs-recipes.pod:261
4949 msgid "List applications installed in a VM"
4953 #: ../examples/guestfs-recipes.pod:263
4954 msgid "Save the following to a file C<list-apps.sh>:"
4958 #: ../examples/guestfs-recipes.pod:265
4963 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4964 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4965 " guestfish --remote inspect-list-applications \"$root\"\n"
4966 " guestfish --remote exit\n"
4971 #: ../examples/guestfs-recipes.pod:272
4973 "Make the file executable and then you can run it on any named virtual "
4978 #: ../examples/guestfs-recipes.pod:275
4981 " # list-apps.sh WinGuest\n"
4983 " app_name: Mozilla Firefox (3.6.12)\n"
4984 " app_display_name: Mozilla Firefox (3.6.12)\n"
4986 " app_version: 3.6.12 (en-GB)\n"
4988 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
4989 " app_trans_path:\n"
4990 " app_publisher: Mozilla\n"
4991 " app_url: http://www.mozilla.com/en-GB/\n"
4992 " app_source_package:\n"
4994 " app_description: Mozilla Firefox\n"
4997 " app_name: VLC media player\n"
4998 " app_display_name: VLC media player 1.1.5\n"
5000 " app_version: 1.1.5\n"
5002 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5003 " app_trans_path:\n"
5004 " app_publisher: VideoLAN\n"
5005 " app_url: http://www.videolan.org/\n"
5006 " app_source_package:\n"
5008 " app_description:\n"
5014 #: ../examples/guestfs-recipes.pod:305
5016 "If you want to run the script on disk images (instead of libvirt virtual "
5017 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5018 "L<virt-inspector(1)>."
5022 #: ../examples/guestfs-recipes.pod:309
5023 msgid "List files and directories in a VM"
5027 #: ../examples/guestfs-recipes.pod:311
5028 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5032 #: ../examples/guestfs-recipes.pod:313
5035 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5040 #: ../examples/guestfs-recipes.pod:315
5041 msgid "List services in a Windows VM"
5045 #: ../examples/guestfs-recipes.pod:317
5047 "The link below contains a script that can be used to list out the services "
5048 "from a Windows VM, and whether those services run at boot time or are loaded "
5053 #: ../examples/guestfs-recipes.pod:321
5054 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5058 #: ../examples/guestfs-recipes.pod:323
5059 msgid "Make a disk image sparse"
5063 #: ../examples/guestfs-recipes.pod:325
5065 "The link below contains some guides for making a disk image sparse (or "
5066 "reintroducing sparseness)."
5070 #: ../examples/guestfs-recipes.pod:328
5071 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5075 #: ../examples/guestfs-recipes.pod:330
5076 msgid "Monitor disk usage over time"
5080 #: ../examples/guestfs-recipes.pod:332
5082 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5083 "The link below contains a guide."
5087 #: ../examples/guestfs-recipes.pod:335
5088 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5092 #: ../examples/guestfs-recipes.pod:337
5093 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5097 #: ../examples/guestfs-recipes.pod:339
5099 "L<guestfish(1)> plus the tools described in the link below can be used to "
5100 "read out the Windows Event Log from any virtual machine running Windows "
5101 "Vista or a later version."
5105 #: ../examples/guestfs-recipes.pod:343
5106 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5110 #: ../examples/guestfs-recipes.pod:345
5111 msgid "Remove root password (Linux)"
5115 #: ../examples/guestfs-recipes.pod:347
5117 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5118 "files. One use is to remove the root password from a Linux guest:"
5122 #: ../examples/guestfs-recipes.pod:350
5125 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5130 #: ../examples/guestfs-recipes.pod:352
5131 msgid "Remove Administrator password (Windows)"
5135 #: ../examples/guestfs-recipes.pod:354
5137 "The link below contains one technique for removing the Administrator "
5138 "password from a Windows VM, or to be more precise, it gives you a command "
5139 "prompt the next time you log in which you can use to bypass any security:"
5143 #: ../examples/guestfs-recipes.pod:359
5144 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5148 #: ../examples/guestfs-recipes.pod:361
5149 msgid "Unpack a live CD"
5153 #: ../examples/guestfs-recipes.pod:363
5155 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5156 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5157 "layers, as outlined in the guide below."
5161 #: ../examples/guestfs-recipes.pod:367
5162 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5166 #: ../examples/guestfs-recipes.pod:369
5167 msgid "Uploading and downloading files"
5171 #: ../examples/guestfs-recipes.pod:371
5173 "The link below contains general tips on uploading (copying in) and "
5174 "downloading (copying out) files from VMs."
5178 #: ../examples/guestfs-recipes.pod:374
5179 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5183 #: ../examples/guestfs-recipes.pod:376
5184 msgid "Use libguestfs tools on VMware ESX guests"
5188 #: ../examples/guestfs-recipes.pod:378
5190 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5191 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5195 #: ../examples/guestfs-recipes.pod:382
5196 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5200 #: ../examples/guestfs-recipes.pod:386
5202 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5203 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5204 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5205 "L<http://libguestfs.org/>."
5209 #: ../examples/guestfs-recipes.pod:403
5210 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5214 #: ../fish/guestfish-actions.pod:1
5219 #: ../fish/guestfish-actions.pod:3
5222 " add-cdrom filename\n"
5227 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5228 msgid "This function adds a virtual CD-ROM disk image to the guest."
5232 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5233 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5237 #: ../fish/guestfish-actions.pod:15
5239 "This call checks for the existence of C<filename>. This stops you from "
5240 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5241 "and C<http:> URLs. To specify those, use the general L</config> call "
5246 #: ../fish/guestfish-actions.pod:22
5248 "If you just want to add an ISO file (often you use this as an efficient way "
5249 "to transfer large files into the guest), then you should probably use "
5250 "L</add-drive-ro> instead."
5254 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:163 ../fish/guestfish-actions.pod:177
5256 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5261 #: ../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:3170 ../fish/guestfish-actions.pod:3481 ../fish/guestfish-actions.pod:3529 ../fish/guestfish-actions.pod:4442 ../fish/guestfish-actions.pod:4465 ../fish/guestfish-actions.pod:4487 ../fish/guestfish-actions.pod:4525 ../fish/guestfish-actions.pod:5174 ../fish/guestfish-actions.pod:5280 ../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:4784 ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:5406 ../src/guestfs-actions.pod:6688 ../src/guestfs-actions.pod:6732 ../src/guestfs-actions.pod:6766 ../src/guestfs-actions.pod:6829 ../src/guestfs-actions.pod:7761 ../src/guestfs-actions.pod:7870 ../src/guestfs-actions.pod:8053
5263 "Deprecated functions will not be removed from the API, but the fact that "
5264 "they are deprecated indicates that there are problems with correct use of "
5269 #: ../fish/guestfish-actions.pod:35
5274 #: ../fish/guestfish-actions.pod:37
5279 #: ../fish/guestfish-actions.pod:39
5282 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
5288 #: ../fish/guestfish-actions.pod:41
5290 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5291 "It works by connecting to libvirt, requesting the domain and domain XML from "
5292 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5296 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5298 "The number of disks added is returned. This operation is atomic: if an "
5299 "error is returned, then no disks are added."
5303 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5305 "This function does some minimal checks to make sure the libvirt domain is "
5306 "not running (unless C<readonly> is true). In a future version we will try "
5307 "to acquire the libvirt lock on each disk."
5311 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5313 "Disks must be accessible locally. This often means that adding disks from a "
5314 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5315 "unless those disks are accessible via the same device path locally too."
5319 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5321 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5322 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5323 "default libvirt URI (or one set through an environment variable, see the "
5324 "libvirt documentation for full details)."
5328 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5330 "The optional C<live> flag controls whether this call will try to connect to "
5331 "a running virtual machine C<guestfsd> process if it sees a suitable "
5332 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5333 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5334 "DAEMONS> for more information."
5338 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5340 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5341 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5342 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5347 #: ../fish/guestfish-actions.pod:76
5349 "The other optional parameters are passed directly through to "
5350 "L</add-drive-opts>."
5354 #: ../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:2048 ../fish/guestfish-actions.pod:3219 ../fish/guestfish-actions.pod:3382 ../fish/guestfish-actions.pod:3517
5356 "This command has one or more optional arguments. See L</OPTIONAL "
5361 #: ../fish/guestfish-actions.pod:81
5366 #: ../fish/guestfish-actions.pod:83
5369 " add-drive filename\n"
5374 #: ../fish/guestfish-actions.pod:85
5376 "This function is the equivalent of calling L</add-drive-opts> with no "
5377 "optional parameters, so the disk is added writable, with the format being "
5378 "detected automatically."
5382 #: ../fish/guestfish-actions.pod:89
5384 "Automatic detection of the format opens you up to a potential security hole "
5385 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5386 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5387 "you should think about replacing calls to this function with calls to "
5388 "L</add-drive-opts>, and specifying the format."
5392 #: ../fish/guestfish-actions.pod:96
5393 msgid "add-drive-opts"
5397 #: ../fish/guestfish-actions.pod:98
5402 #: ../fish/guestfish-actions.pod:100
5405 " add-drive-opts filename [readonly:..] [format:..] [iface:..]\n"
5410 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:160
5412 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5413 "The first time you call this function, the disk appears as C</dev/sda>, the "
5414 "second time as C</dev/sdb>, and so on."
5418 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:165
5420 "You don't necessarily need to be root when using libguestfs. However you "
5421 "obviously do need sufficient permissions to access the filename for whatever "
5422 "operations you want to perform (ie. read access if you just want to read the "
5423 "image or write access if you want to modify the image)."
5427 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:171
5428 msgid "This call checks that C<filename> exists."
5432 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:173 ../src/guestfs-actions.pod:4821
5433 msgid "The optional arguments are:"
5437 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:177
5442 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:179
5444 "If true then the image is treated as read-only. Writes are still allowed, "
5445 "but they are stored in a temporary snapshot overlay which is discarded at "
5446 "the end. The disk that you add is not modified."
5450 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:183
5455 #: ../fish/guestfish-actions.pod:127
5457 "This forces the image format. If you omit this (or use L</add-drive> or "
5458 "L</add-drive-ro>) then the format is automatically detected. Possible "
5459 "formats include C<raw> and C<qcow2>."
5463 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:189
5465 "Automatic detection of the format opens you up to a potential security hole "
5466 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5467 "RHBZ#642934. Specifying the format closes this security hole."
5471 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:194
5476 #: ../fish/guestfish-actions.pod:138
5478 "This rarely-used option lets you emulate the behaviour of the deprecated "
5479 "L</add-drive-with-if> call (q.v.)"
5483 #: ../fish/guestfish-actions.pod:145
5484 msgid "add-drive-ro"
5488 #: ../fish/guestfish-actions.pod:147
5493 #: ../fish/guestfish-actions.pod:149
5496 " add-drive-ro filename\n"
5501 #: ../fish/guestfish-actions.pod:151
5503 "This function is the equivalent of calling L</add-drive-opts> with the "
5504 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5505 "is added read-only, with the format being detected automatically."
5509 #: ../fish/guestfish-actions.pod:156
5510 msgid "add-drive-ro-with-if"
5514 #: ../fish/guestfish-actions.pod:158
5517 " add-drive-ro-with-if filename iface\n"
5522 #: ../fish/guestfish-actions.pod:160
5524 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5525 "interface emulation to use at run time."
5529 #: ../fish/guestfish-actions.pod:170
5530 msgid "add-drive-with-if"
5534 #: ../fish/guestfish-actions.pod:172
5537 " add-drive-with-if filename iface\n"
5542 #: ../fish/guestfish-actions.pod:174
5544 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5545 "interface emulation to use at run time."
5549 #: ../fish/guestfish-actions.pod:184
5554 #: ../fish/guestfish-actions.pod:186
5557 " aug-clear augpath\n"
5562 #: ../fish/guestfish-actions.pod:188 ../src/guestfs-actions.pod:290
5564 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5565 "L<augtool(1)> C<clear> command."
5569 #: ../fish/guestfish-actions.pod:191
5574 #: ../fish/guestfish-actions.pod:193
5582 #: ../fish/guestfish-actions.pod:195
5584 "Close the current Augeas handle and free up any resources used by it. After "
5585 "calling this, you have to call L</aug-init> again before you can use any "
5586 "other Augeas functions."
5590 #: ../fish/guestfish-actions.pod:200
5595 #: ../fish/guestfish-actions.pod:202
5598 " aug-defnode name expr val\n"
5603 #: ../fish/guestfish-actions.pod:204 ../src/guestfs-actions.pod:319
5604 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5608 #: ../fish/guestfish-actions.pod:207
5610 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5611 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5612 "containing that single node."
5616 #: ../fish/guestfish-actions.pod:211 ../src/guestfs-actions.pod:326
5618 "On success this returns a pair containing the number of nodes in the "
5619 "nodeset, and a boolean flag if a node was created."
5623 #: ../fish/guestfish-actions.pod:215
5628 #: ../fish/guestfish-actions.pod:217
5631 " aug-defvar name expr\n"
5636 #: ../fish/guestfish-actions.pod:219 ../src/guestfs-actions.pod:343
5638 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5639 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5643 #: ../fish/guestfish-actions.pod:223 ../src/guestfs-actions.pod:347
5645 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5646 "evaluates to something which is not a nodeset."
5650 #: ../fish/guestfish-actions.pod:226
5655 #: ../fish/guestfish-actions.pod:228
5658 " aug-get augpath\n"
5663 #: ../fish/guestfish-actions.pod:230 ../src/guestfs-actions.pod:360
5665 "Look up the value associated with C<path>. If C<path> matches exactly one "
5666 "node, the C<value> is returned."
5670 #: ../fish/guestfish-actions.pod:233
5675 #: ../fish/guestfish-actions.pod:235
5678 " aug-init root flags\n"
5683 #: ../fish/guestfish-actions.pod:237 ../src/guestfs-actions.pod:375
5685 "Create a new Augeas handle for editing configuration files. If there was "
5686 "any previous Augeas handle associated with this guestfs session, then it is "
5691 #: ../fish/guestfish-actions.pod:241
5692 msgid "You must call this before using any other L</aug-*> commands."
5696 #: ../fish/guestfish-actions.pod:244 ../src/guestfs-actions.pod:382
5697 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5701 #: ../fish/guestfish-actions.pod:247 ../src/guestfs-actions.pod:385
5703 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5704 "logical I<or> of the following integers:"
5708 #: ../fish/guestfish-actions.pod:253 ../src/guestfs-actions.pod:391
5709 msgid "C<AUG_SAVE_BACKUP> = 1"
5713 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:393
5714 msgid "Keep the original file with a C<.augsave> extension."
5718 #: ../fish/guestfish-actions.pod:257 ../src/guestfs-actions.pod:395
5719 msgid "C<AUG_SAVE_NEWFILE> = 2"
5723 #: ../fish/guestfish-actions.pod:259 ../src/guestfs-actions.pod:397
5725 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5726 "original. Overrides C<AUG_SAVE_BACKUP>."
5730 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:400
5731 msgid "C<AUG_TYPE_CHECK> = 4"
5735 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:402
5736 msgid "Typecheck lenses."
5740 #: ../fish/guestfish-actions.pod:266
5742 "This option is only useful when debugging Augeas lenses. Use of this option "
5743 "may require additional memory for the libguestfs appliance. You may need to "
5744 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5748 #: ../fish/guestfish-actions.pod:271 ../src/guestfs-actions.pod:409
5749 msgid "C<AUG_NO_STDINC> = 8"
5753 #: ../fish/guestfish-actions.pod:273 ../src/guestfs-actions.pod:411
5754 msgid "Do not use standard load path for modules."
5758 #: ../fish/guestfish-actions.pod:275 ../src/guestfs-actions.pod:413
5759 msgid "C<AUG_SAVE_NOOP> = 16"
5763 #: ../fish/guestfish-actions.pod:277 ../src/guestfs-actions.pod:415
5764 msgid "Make save a no-op, just record what would have been changed."
5768 #: ../fish/guestfish-actions.pod:279 ../src/guestfs-actions.pod:417
5769 msgid "C<AUG_NO_LOAD> = 32"
5773 #: ../fish/guestfish-actions.pod:281
5774 msgid "Do not load the tree in L</aug-init>."
5778 #: ../fish/guestfish-actions.pod:285
5779 msgid "To close the handle, you can call L</aug-close>."
5783 #: ../fish/guestfish-actions.pod:287 ../src/guestfs-actions.pod:425
5784 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5788 #: ../fish/guestfish-actions.pod:289
5793 #: ../fish/guestfish-actions.pod:291
5796 " aug-insert augpath label true|false\n"
5801 #: ../fish/guestfish-actions.pod:293 ../src/guestfs-actions.pod:439
5803 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5804 "or after C<path> (depending on the boolean flag C<before>)."
5808 #: ../fish/guestfish-actions.pod:297 ../src/guestfs-actions.pod:443
5810 "C<path> must match exactly one existing node in the tree, and C<label> must "
5811 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5815 #: ../fish/guestfish-actions.pod:301
5820 #: ../fish/guestfish-actions.pod:303
5828 #: ../fish/guestfish-actions.pod:305 ../src/guestfs-actions.pod:456
5829 msgid "Load files into the tree."
5833 #: ../fish/guestfish-actions.pod:307 ../src/guestfs-actions.pod:458
5834 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5838 #: ../fish/guestfish-actions.pod:310
5843 #: ../fish/guestfish-actions.pod:312
5851 #: ../fish/guestfish-actions.pod:314
5853 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5854 "resulting nodes into alphabetical order."
5858 #: ../fish/guestfish-actions.pod:317
5863 #: ../fish/guestfish-actions.pod:319
5866 " aug-match augpath\n"
5871 #: ../fish/guestfish-actions.pod:321 ../src/guestfs-actions.pod:486
5873 "Returns a list of paths which match the path expression C<path>. The "
5874 "returned paths are sufficiently qualified so that they match exactly one "
5875 "node in the current tree."
5879 #: ../fish/guestfish-actions.pod:325
5884 #: ../fish/guestfish-actions.pod:327
5887 " aug-mv src dest\n"
5892 #: ../fish/guestfish-actions.pod:329 ../src/guestfs-actions.pod:503
5894 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5895 "C<dest> is overwritten if it exists."
5899 #: ../fish/guestfish-actions.pod:332
5904 #: ../fish/guestfish-actions.pod:334
5912 #: ../fish/guestfish-actions.pod:336 ../src/guestfs-actions.pod:516
5913 msgid "Remove C<path> and all of its children."
5917 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:518
5918 msgid "On success this returns the number of entries which were removed."
5922 #: ../fish/guestfish-actions.pod:340
5927 #: ../fish/guestfish-actions.pod:342
5935 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:529
5936 msgid "This writes all pending changes to disk."
5940 #: ../fish/guestfish-actions.pod:346
5942 "The flags which were passed to L</aug-init> affect exactly how files are "
5947 #: ../fish/guestfish-actions.pod:349
5952 #: ../fish/guestfish-actions.pod:351
5955 " aug-set augpath val\n"
5960 #: ../fish/guestfish-actions.pod:353 ../src/guestfs-actions.pod:545
5961 msgid "Set the value associated with C<path> to C<val>."
5965 #: ../fish/guestfish-actions.pod:355
5967 "In the Augeas API, it is possible to clear a node by setting the value to "
5968 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5969 "this call. Instead you must use the L</aug-clear> call."
5973 #: ../fish/guestfish-actions.pod:360
5978 #: ../fish/guestfish-actions.pod:362
5981 " available 'groups ...'\n"
5986 #: ../fish/guestfish-actions.pod:364 ../src/guestfs-actions.pod:562
5988 "This command is used to check the availability of some groups of "
5989 "functionality in the appliance, which not all builds of the libguestfs "
5990 "appliance will be able to provide."
5994 #: ../fish/guestfish-actions.pod:368
5996 "The libguestfs groups, and the functions that those groups correspond to, "
5997 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
5998 "runtime by calling L</available-all-groups>."
6002 #: ../fish/guestfish-actions.pod:373 ../src/guestfs-actions.pod:571
6004 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6005 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6006 "and Augeas (configuration file editing) functions."
6010 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:576
6011 msgid "The command returns no error if I<all> requested groups are available."
6015 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:578
6017 "It fails with an error if one or more of the requested groups is unavailable "
6022 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:581
6024 "If an unknown group name is included in the list of groups then an error is "
6029 #: ../fish/guestfish-actions.pod:386 ../src/guestfs-actions.pod:584
6034 #: ../fish/guestfish-actions.pod:392
6035 msgid "You must call L</launch> before calling this function."
6039 #: ../fish/guestfish-actions.pod:394 ../src/guestfs-actions.pod:592
6041 "The reason is because we don't know what groups are supported by the "
6042 "appliance/daemon until it is running and can be queried."
6046 #: ../fish/guestfish-actions.pod:400 ../src/guestfs-actions.pod:598
6048 "If a group of functions is available, this does not necessarily mean that "
6049 "they will work. You still have to check for errors when calling individual "
6050 "API functions even if they are available."
6054 #: ../fish/guestfish-actions.pod:407 ../src/guestfs-actions.pod:605
6056 "It is usually the job of distro packagers to build complete functionality "
6057 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6058 "with all requirements satisfied, will support everything."
6062 #: ../fish/guestfish-actions.pod:414
6064 "This call was added in version C<1.0.80>. In previous versions of "
6065 "libguestfs all you could do would be to speculatively execute a command to "
6066 "find out if the daemon implemented it. See also L</version>."
6070 #: ../fish/guestfish-actions.pod:421
6071 msgid "available-all-groups"
6075 #: ../fish/guestfish-actions.pod:423
6078 " available-all-groups\n"
6083 #: ../fish/guestfish-actions.pod:425
6085 "This command returns a list of all optional groups that this daemon knows "
6086 "about. Note this returns both supported and unsupported groups. To find "
6087 "out which ones the daemon can actually support you have to call "
6088 "L</available> on each member of the returned list."
6092 #: ../fish/guestfish-actions.pod:431
6093 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6097 #: ../fish/guestfish-actions.pod:433
6102 #: ../fish/guestfish-actions.pod:435
6105 " base64-in (base64file|-) filename\n"
6110 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:649
6111 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6115 #: ../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:4745 ../fish/guestfish-actions.pod:4757 ../fish/guestfish-actions.pod:4768 ../fish/guestfish-actions.pod:4779 ../fish/guestfish-actions.pod:4831 ../fish/guestfish-actions.pod:4840 ../fish/guestfish-actions.pod:4894 ../fish/guestfish-actions.pod:4917
6116 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6120 #: ../fish/guestfish-actions.pod:442
6125 #: ../fish/guestfish-actions.pod:444
6128 " base64-out filename (base64file|-)\n"
6133 #: ../fish/guestfish-actions.pod:446 ../src/guestfs-actions.pod:663
6135 "This command downloads the contents of C<filename>, writing it out to local "
6136 "file C<base64file> encoded as base64."
6140 #: ../fish/guestfish-actions.pod:451
6141 msgid "blockdev-flushbufs"
6145 #: ../fish/guestfish-actions.pod:453
6148 " blockdev-flushbufs device\n"
6153 #: ../fish/guestfish-actions.pod:455 ../src/guestfs-actions.pod:676
6154 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6158 #: ../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
6159 msgid "This uses the L<blockdev(8)> command."
6163 #: ../fish/guestfish-actions.pod:460
6164 msgid "blockdev-getbsz"
6168 #: ../fish/guestfish-actions.pod:462
6171 " blockdev-getbsz device\n"
6176 #: ../fish/guestfish-actions.pod:464 ../src/guestfs-actions.pod:691
6177 msgid "This returns the block size of a device."
6181 #: ../fish/guestfish-actions.pod:466 ../fish/guestfish-actions.pod:529 ../src/guestfs-actions.pod:693 ../src/guestfs-actions.pod:793
6183 "(Note this is different from both I<size in blocks> and I<filesystem block "
6188 #: ../fish/guestfish-actions.pod:471
6189 msgid "blockdev-getro"
6193 #: ../fish/guestfish-actions.pod:473
6196 " blockdev-getro device\n"
6201 #: ../fish/guestfish-actions.pod:475 ../src/guestfs-actions.pod:708
6203 "Returns a boolean indicating if the block device is read-only (true if "
6204 "read-only, false if not)."
6208 #: ../fish/guestfish-actions.pod:480
6209 msgid "blockdev-getsize64"
6213 #: ../fish/guestfish-actions.pod:482
6216 " blockdev-getsize64 device\n"
6221 #: ../fish/guestfish-actions.pod:484 ../src/guestfs-actions.pod:723
6222 msgid "This returns the size of the device in bytes."
6226 #: ../fish/guestfish-actions.pod:486
6227 msgid "See also L</blockdev-getsz>."
6231 #: ../fish/guestfish-actions.pod:490
6232 msgid "blockdev-getss"
6236 #: ../fish/guestfish-actions.pod:492
6239 " blockdev-getss device\n"
6244 #: ../fish/guestfish-actions.pod:494 ../src/guestfs-actions.pod:739
6246 "This returns the size of sectors on a block device. Usually 512, but can be "
6247 "larger for modern devices."
6251 #: ../fish/guestfish-actions.pod:497
6252 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6256 #: ../fish/guestfish-actions.pod:502
6257 msgid "blockdev-getsz"
6261 #: ../fish/guestfish-actions.pod:504
6264 " blockdev-getsz device\n"
6269 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:757
6271 "This returns the size of the device in units of 512-byte sectors (even if "
6272 "the sectorsize isn't 512 bytes ... weird)."
6276 #: ../fish/guestfish-actions.pod:509
6278 "See also L</blockdev-getss> for the real sector size of the device, and "
6279 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6283 #: ../fish/guestfish-actions.pod:515
6284 msgid "blockdev-rereadpt"
6288 #: ../fish/guestfish-actions.pod:517
6291 " blockdev-rereadpt device\n"
6296 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:776
6297 msgid "Reread the partition table on C<device>."
6301 #: ../fish/guestfish-actions.pod:523
6302 msgid "blockdev-setbsz"
6306 #: ../fish/guestfish-actions.pod:525
6309 " blockdev-setbsz device blocksize\n"
6314 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:791
6315 msgid "This sets the block size of a device."
6319 #: ../fish/guestfish-actions.pod:534
6320 msgid "blockdev-setro"
6324 #: ../fish/guestfish-actions.pod:536
6327 " blockdev-setro device\n"
6332 #: ../fish/guestfish-actions.pod:538 ../src/guestfs-actions.pod:808
6333 msgid "Sets the block device named C<device> to read-only."
6337 #: ../fish/guestfish-actions.pod:542
6338 msgid "blockdev-setrw"
6342 #: ../fish/guestfish-actions.pod:544
6345 " blockdev-setrw device\n"
6350 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:822
6351 msgid "Sets the block device named C<device> to read-write."
6355 #: ../fish/guestfish-actions.pod:550
6356 msgid "btrfs-filesystem-resize"
6360 #: ../fish/guestfish-actions.pod:552
6363 " btrfs-filesystem-resize mountpoint [size:..]\n"
6368 #: ../fish/guestfish-actions.pod:554 ../src/guestfs-actions.pod:844
6369 msgid "This command resizes a btrfs filesystem."
6373 #: ../fish/guestfish-actions.pod:556 ../src/guestfs-actions.pod:846
6375 "Note that unlike other resize calls, the filesystem has to be mounted and "
6376 "the parameter is the mountpoint not the device (this is a requirement of "
6381 #: ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:3492 ../src/guestfs-actions.pod:850 ../src/guestfs-actions.pod:5345
6382 msgid "The optional parameters are:"
6386 #: ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:3496 ../src/guestfs-actions.pod:854 ../src/guestfs-actions.pod:5349
6391 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:856
6393 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6394 "resized to the maximum size."
6398 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:861
6399 msgid "See also L<btrfs(8)>."
6403 #: ../fish/guestfish-actions.pod:575
6404 msgid "case-sensitive-path"
6408 #: ../fish/guestfish-actions.pod:577
6411 " case-sensitive-path path\n"
6416 #: ../fish/guestfish-actions.pod:579 ../src/guestfs-actions.pod:895
6418 "This can be used to resolve case insensitive paths on a filesystem which is "
6419 "case sensitive. The use case is to resolve paths which you have read from "
6420 "Windows configuration files or the Windows Registry, to the true path."
6424 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:900
6426 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6427 "(and probably others), which is that although the underlying filesystem is "
6428 "case-insensitive, the driver exports the filesystem to Linux as "
6433 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:905
6435 "One consequence of this is that special directories such as C<c:\\windows> "
6436 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6437 "precise details of how they were created. In Windows itself this would not "
6442 #: ../fish/guestfish-actions.pod:595 ../src/guestfs-actions.pod:911
6444 "Bug or feature? You decide: "
6445 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6449 #: ../fish/guestfish-actions.pod:598 ../src/guestfs-actions.pod:914
6451 "This function resolves the true case of each element in the path and returns "
6452 "the case-sensitive path."
6456 #: ../fish/guestfish-actions.pod:601
6458 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6459 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6460 "how the directories were originally created under Windows)."
6464 #: ../fish/guestfish-actions.pod:606 ../src/guestfs-actions.pod:922
6465 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6469 #: ../fish/guestfish-actions.pod:609
6470 msgid "See also L</realpath>."
6474 #: ../fish/guestfish-actions.pod:611
6479 #: ../fish/guestfish-actions.pod:613
6487 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3912 ../src/guestfs-actions.pod:938 ../src/guestfs-actions.pod:5988
6488 msgid "Return the contents of the file named C<path>."
6492 #: ../fish/guestfish-actions.pod:617
6494 "Note that this function cannot correctly handle binary files (specifically, "
6495 "files containing C<\\0> character which is treated as end of string). For "
6496 "those you need to use the L</read-file> or L</download> functions which have "
6497 "a more complex interface."
6501 #: ../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:3782 ../fish/guestfish-actions.pod:3797 ../fish/guestfish-actions.pod:3873 ../fish/guestfish-actions.pod:3890 ../fish/guestfish-actions.pod:3905 ../fish/guestfish-actions.pod:4586 ../fish/guestfish-actions.pod:4632 ../fish/guestfish-actions.pod:4717 ../fish/guestfish-actions.pod:4732 ../fish/guestfish-actions.pod:5138 ../fish/guestfish-actions.pod:5150 ../fish/guestfish-actions.pod:5168 ../fish/guestfish-actions.pod:5185 ../fish/guestfish-actions.pod:5195 ../fish/guestfish-actions.pod:5252 ../fish/guestfish-actions.pod:5262 ../fish/guestfish-actions.pod:5291 ../fish/guestfish-actions.pod:5301 ../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:5770 ../src/guestfs-actions.pod:5796 ../src/guestfs-actions.pod:5927 ../src/guestfs-actions.pod:5953 ../src/guestfs-actions.pod:5977 ../src/guestfs-actions.pod:6944 ../src/guestfs-actions.pod:6999 ../src/guestfs-actions.pod:7145 ../src/guestfs-actions.pod:7169 ../src/guestfs-actions.pod:7834 ../src/guestfs-actions.pod:7854 ../src/guestfs-actions.pod:7887 ../src/guestfs-actions.pod:7906 ../src/guestfs-actions.pod:7925 ../src/guestfs-actions.pod:8019 ../src/guestfs-actions.pod:8038 ../src/guestfs-actions.pod:8084 ../src/guestfs-actions.pod:8103
6503 "Because of the message protocol, there is a transfer limit of somewhere "
6504 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6508 #: ../fish/guestfish-actions.pod:625
6513 #: ../fish/guestfish-actions.pod:627
6516 " checksum csumtype path\n"
6521 #: ../fish/guestfish-actions.pod:629 ../src/guestfs-actions.pod:960
6522 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6526 #: ../fish/guestfish-actions.pod:632 ../src/guestfs-actions.pod:963
6528 "The type of checksum to compute is given by the C<csumtype> parameter which "
6529 "must have one of the following values:"
6533 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:968
6538 #: ../fish/guestfish-actions.pod:639 ../src/guestfs-actions.pod:970
6540 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6545 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:973
6550 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:975
6551 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6555 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:977
6560 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:979
6561 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6565 #: ../fish/guestfish-actions.pod:650 ../src/guestfs-actions.pod:981
6570 #: ../fish/guestfish-actions.pod:652 ../src/guestfs-actions.pod:983
6571 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6575 #: ../fish/guestfish-actions.pod:654 ../src/guestfs-actions.pod:985
6580 #: ../fish/guestfish-actions.pod:656 ../src/guestfs-actions.pod:987
6581 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6585 #: ../fish/guestfish-actions.pod:658 ../src/guestfs-actions.pod:989
6590 #: ../fish/guestfish-actions.pod:660 ../src/guestfs-actions.pod:991
6591 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6595 #: ../fish/guestfish-actions.pod:662 ../src/guestfs-actions.pod:993
6600 #: ../fish/guestfish-actions.pod:664 ../src/guestfs-actions.pod:995
6601 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6605 #: ../fish/guestfish-actions.pod:668 ../src/guestfs-actions.pod:999
6606 msgid "The checksum is returned as a printable string."
6610 #: ../fish/guestfish-actions.pod:670
6611 msgid "To get the checksum for a device, use L</checksum-device>."
6615 #: ../fish/guestfish-actions.pod:672
6616 msgid "To get the checksums for many files, use L</checksums-out>."
6620 #: ../fish/guestfish-actions.pod:674
6621 msgid "checksum-device"
6625 #: ../fish/guestfish-actions.pod:676
6628 " checksum-device csumtype device\n"
6633 #: ../fish/guestfish-actions.pod:678
6635 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6636 "device named C<device>. For the types of checksums supported see the "
6637 "L</checksum> command."
6641 #: ../fish/guestfish-actions.pod:682
6642 msgid "checksums-out"
6646 #: ../fish/guestfish-actions.pod:684
6649 " checksums-out csumtype directory (sumsfile|-)\n"
6654 #: ../fish/guestfish-actions.pod:686 ../src/guestfs-actions.pod:1034
6656 "This command computes the checksums of all regular files in C<directory> and "
6657 "then emits a list of those checksums to the local output file C<sumsfile>."
6661 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1038
6663 "This can be used for verifying the integrity of a virtual machine. However "
6664 "to be properly secure you should pay attention to the output of the checksum "
6665 "command (it uses the ones from GNU coreutils). In particular when the "
6666 "filename is not printable, coreutils uses a special backslash syntax. For "
6667 "more information, see the GNU coreutils info file."
6671 #: ../fish/guestfish-actions.pod:700
6676 #: ../fish/guestfish-actions.pod:702
6679 " chmod mode path\n"
6684 #: ../fish/guestfish-actions.pod:704 ../src/guestfs-actions.pod:1057
6686 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6691 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1060
6693 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6694 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6699 #: ../fish/guestfish-actions.pod:711 ../fish/guestfish-actions.pod:3145 ../fish/guestfish-actions.pod:3284 ../fish/guestfish-actions.pod:3294 ../fish/guestfish-actions.pod:3304 ../src/guestfs-actions.pod:1064 ../src/guestfs-actions.pod:4752 ../src/guestfs-actions.pod:4961 ../src/guestfs-actions.pod:4980 ../src/guestfs-actions.pod:4999
6700 msgid "The mode actually set is affected by the umask."
6704 #: ../fish/guestfish-actions.pod:713
6709 #: ../fish/guestfish-actions.pod:715
6712 " chown owner group path\n"
6717 #: ../fish/guestfish-actions.pod:717 ../src/guestfs-actions.pod:1078
6718 msgid "Change the file owner to C<owner> and group to C<group>."
6722 #: ../fish/guestfish-actions.pod:719 ../fish/guestfish-actions.pod:2580 ../src/guestfs-actions.pod:1080 ../src/guestfs-actions.pod:3823
6724 "Only numeric uid and gid are supported. If you want to use names, you will "
6725 "need to locate and parse the password file yourself (Augeas support makes "
6726 "this relatively easy)."
6730 #: ../fish/guestfish-actions.pod:723
6735 #: ../fish/guestfish-actions.pod:725
6738 " command 'arguments ...'\n"
6743 #: ../fish/guestfish-actions.pod:727 ../src/guestfs-actions.pod:1094
6745 "This call runs a command from the guest filesystem. The filesystem must be "
6746 "mounted, and must contain a compatible operating system (ie. something "
6747 "Linux, with the same or compatible processor architecture)."
6751 #: ../fish/guestfish-actions.pod:732
6753 "The single parameter is an argv-style list of arguments. The first element "
6754 "is the name of the program to run. Subsequent elements are parameters. The "
6755 "list must be non-empty (ie. must contain a program name). Note that the "
6756 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6760 #: ../fish/guestfish-actions.pod:739 ../src/guestfs-actions.pod:1106
6761 msgid "The return value is anything printed to I<stdout> by the command."
6765 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1109
6767 "If the command returns a non-zero exit status, then this function returns an "
6768 "error message. The error message string is the content of I<stderr> from "
6773 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1113
6775 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6776 "C</bin>. If you require a program from another location, you should provide "
6777 "the full path in the first parameter."
6781 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1118
6783 "Shared libraries and data files required by the program must be available on "
6784 "filesystems which are mounted in the correct places. It is the caller's "
6785 "responsibility to ensure all filesystems that are needed are mounted at the "
6790 #: ../fish/guestfish-actions.pod:760
6791 msgid "command-lines"
6795 #: ../fish/guestfish-actions.pod:762
6798 " command-lines 'arguments ...'\n"
6803 #: ../fish/guestfish-actions.pod:764
6804 msgid "This is the same as L</command>, but splits the result into a list of lines."
6808 #: ../fish/guestfish-actions.pod:767
6809 msgid "See also: L</sh-lines>"
6813 #: ../fish/guestfish-actions.pod:772
6814 msgid "compress-device-out"
6818 #: ../fish/guestfish-actions.pod:774
6821 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6826 #: ../fish/guestfish-actions.pod:776 ../src/guestfs-actions.pod:1168
6828 "This command compresses C<device> and writes it out to the local file "
6833 #: ../fish/guestfish-actions.pod:779
6835 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6840 #: ../fish/guestfish-actions.pod:786
6841 msgid "compress-out"
6845 #: ../fish/guestfish-actions.pod:788
6848 " compress-out ctype file (zfile|-) [level:..]\n"
6853 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1220
6855 "This command compresses C<file> and writes it out to the local file "
6860 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1223
6862 "The compression program used is controlled by the C<ctype> parameter. "
6863 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6864 "Some compression types may not be supported by particular builds of "
6865 "libguestfs, in which case you will get an error containing the substring "
6866 "\"not supported\"."
6870 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1229
6872 "The optional C<level> parameter controls compression level. The meaning and "
6873 "default for this parameter depends on the compression program being used."
6877 #: ../fish/guestfish-actions.pod:807
6882 #: ../fish/guestfish-actions.pod:809
6885 " config qemuparam qemuvalue\n"
6890 #: ../fish/guestfish-actions.pod:811 ../src/guestfs-actions.pod:1270
6892 "This can be used to add arbitrary qemu command line parameters of the form "
6893 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6894 "setting some parameters which would interfere with parameters that we use."
6898 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1275
6899 msgid "The first character of C<param> string must be a C<-> (dash)."
6903 #: ../fish/guestfish-actions.pod:818 ../src/guestfs-actions.pod:1277
6904 msgid "C<value> can be NULL."
6908 #: ../fish/guestfish-actions.pod:820
6913 #: ../fish/guestfish-actions.pod:822
6916 " copy-size src dest size\n"
6921 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1291
6923 "This command copies exactly C<size> bytes from one source device or file "
6924 "C<src> to another destination device or file C<dest>."
6928 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1294
6930 "Note this will fail if the source is too short or if the destination is not "
6935 #: ../fish/guestfish-actions.pod:830
6940 #: ../fish/guestfish-actions.pod:832
6948 #: ../fish/guestfish-actions.pod:834 ../src/guestfs-actions.pod:1313
6950 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6951 "destination filename or destination directory."
6955 #: ../fish/guestfish-actions.pod:837
6960 #: ../fish/guestfish-actions.pod:839
6968 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1327
6970 "This copies a file or directory from C<src> to C<dest> recursively using the "
6975 #: ../fish/guestfish-actions.pod:844
6980 #: ../fish/guestfish-actions.pod:846
6988 #: ../fish/guestfish-actions.pod:848 ../src/guestfs-actions.pod:1341
6990 "This command copies from one source device or file C<src> to another "
6991 "destination device or file C<dest>. Normally you would use this to copy to "
6992 "or from a device or partition, for example to duplicate a filesystem."
6996 #: ../fish/guestfish-actions.pod:853
6998 "If the destination is a device, it must be as large or larger than the "
6999 "source file or device, otherwise the copy will fail. This command cannot do "
7000 "partial copies (see L</copy-size>)."
7004 #: ../fish/guestfish-actions.pod:857
7009 #: ../fish/guestfish-actions.pod:859
7017 #: ../fish/guestfish-actions.pod:861 ../src/guestfs-actions.pod:1359
7018 msgid "This command runs the C<df> command to report disk space used."
7022 #: ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:874
7024 "This command is mostly useful for interactive sessions. It is I<not> "
7025 "intended that you try to parse the output string. Use L</statvfs> from "
7030 #: ../fish/guestfish-actions.pod:867
7035 #: ../fish/guestfish-actions.pod:869
7043 #: ../fish/guestfish-actions.pod:871 ../src/guestfs-actions.pod:1375
7045 "This command runs the C<df -h> command to report disk space used in "
7046 "human-readable format."
7050 #: ../fish/guestfish-actions.pod:878
7055 #: ../fish/guestfish-actions.pod:880
7063 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1392
7065 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7066 "This is sometimes useful for extended debugging of problems."
7070 #: ../fish/guestfish-actions.pod:886
7072 "Another way to get the same information is to enable verbose messages with "
7073 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7074 "before running the program."
7078 #: ../fish/guestfish-actions.pod:891
7083 #: ../fish/guestfish-actions.pod:893
7086 " download remotefilename (filename|-)\n"
7091 #: ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:908 ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1438
7093 "Download file C<remotefilename> and save it as C<filename> on the local "
7098 #: ../fish/guestfish-actions.pod:898 ../fish/guestfish-actions.pod:4890 ../src/guestfs-actions.pod:1416 ../src/guestfs-actions.pod:7404
7099 msgid "C<filename> can also be a named pipe."
7103 #: ../fish/guestfish-actions.pod:900
7104 msgid "See also L</upload>, L</cat>."
7108 #: ../fish/guestfish-actions.pod:904
7109 msgid "download-offset"
7113 #: ../fish/guestfish-actions.pod:906
7116 " download-offset remotefilename (filename|-) offset size\n"
7121 #: ../fish/guestfish-actions.pod:911 ../src/guestfs-actions.pod:1441
7123 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7124 "region must be within the file or device)."
7128 #: ../fish/guestfish-actions.pod:914
7130 "Note that there is no limit on the amount of data that can be downloaded "
7131 "with this call, unlike with L</pread>, and this call always reads the full "
7132 "amount unless an error occurs."
7136 #: ../fish/guestfish-actions.pod:919
7137 msgid "See also L</download>, L</pread>."
7141 #: ../fish/guestfish-actions.pod:923
7146 #: ../fish/guestfish-actions.pod:925
7149 " drop-caches whattodrop\n"
7154 #: ../fish/guestfish-actions.pod:927 ../src/guestfs-actions.pod:1466
7156 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7157 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7158 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7162 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1471
7163 msgid "Setting C<whattodrop> to 3 should drop everything."
7167 #: ../fish/guestfish-actions.pod:934 ../src/guestfs-actions.pod:1473
7169 "This automatically calls L<sync(2)> before the operation, so that the "
7170 "maximum guest memory is freed."
7174 #: ../fish/guestfish-actions.pod:937
7179 #: ../fish/guestfish-actions.pod:939
7187 #: ../fish/guestfish-actions.pod:941 ../src/guestfs-actions.pod:1486
7189 "This command runs the C<du -s> command to estimate file space usage for "
7194 #: ../fish/guestfish-actions.pod:944 ../src/guestfs-actions.pod:1489
7196 "C<path> can be a file or a directory. If C<path> is a directory then the "
7197 "estimate includes the contents of the directory and all subdirectories "
7202 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1493
7203 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7207 #: ../fish/guestfish-actions.pod:951
7212 #: ../fish/guestfish-actions.pod:953
7215 " e2fsck-f device\n"
7220 #: ../fish/guestfish-actions.pod:955 ../src/guestfs-actions.pod:1511
7222 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7223 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7228 #: ../fish/guestfish-actions.pod:959
7230 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7231 "should use L</fsck>."
7235 #: ../fish/guestfish-actions.pod:962
7240 #: ../fish/guestfish-actions.pod:964
7243 " echo-daemon 'words ...'\n"
7248 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1528
7250 "This command concatenates the list of C<words> passed with single spaces "
7251 "between them and returns the resulting string."
7255 #: ../fish/guestfish-actions.pod:969 ../src/guestfs-actions.pod:1531
7256 msgid "You can use this command to test the connection through to the daemon."
7260 #: ../fish/guestfish-actions.pod:971
7261 msgid "See also L</ping-daemon>."
7265 #: ../fish/guestfish-actions.pod:973
7270 #: ../fish/guestfish-actions.pod:975
7273 " egrep regex path\n"
7278 #: ../fish/guestfish-actions.pod:977 ../src/guestfs-actions.pod:1547
7279 msgid "This calls the external C<egrep> program and returns the matching lines."
7283 #: ../fish/guestfish-actions.pod:983
7288 #: ../fish/guestfish-actions.pod:985
7291 " egrepi regex path\n"
7296 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1566
7297 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7301 #: ../fish/guestfish-actions.pod:993
7306 #: ../fish/guestfish-actions.pod:995
7309 " equal file1 file2\n"
7314 #: ../fish/guestfish-actions.pod:997 ../src/guestfs-actions.pod:1585
7316 "This compares the two files C<file1> and C<file2> and returns true if their "
7317 "content is exactly equal, or false otherwise."
7321 #: ../fish/guestfish-actions.pod:1000 ../src/guestfs-actions.pod:1588
7322 msgid "The external L<cmp(1)> program is used for the comparison."
7326 #: ../fish/guestfish-actions.pod:1002
7331 #: ../fish/guestfish-actions.pod:1004
7339 #: ../fish/guestfish-actions.pod:1006 ../src/guestfs-actions.pod:1600
7341 "This returns C<true> if and only if there is a file, directory (or anything) "
7342 "with the given C<path> name."
7346 #: ../fish/guestfish-actions.pod:1009
7347 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7351 #: ../fish/guestfish-actions.pod:1011
7356 #: ../fish/guestfish-actions.pod:1013
7359 " fallocate path len\n"
7364 #: ../fish/guestfish-actions.pod:1015 ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1642
7366 "This command preallocates a file (containing zero bytes) named C<path> of "
7367 "size C<len> bytes. If the file exists already, it is overwritten."
7371 #: ../fish/guestfish-actions.pod:1019 ../src/guestfs-actions.pod:1627
7373 "Do not confuse this with the guestfish-specific C<alloc> command which "
7374 "allocates a file in the host and attaches it as a device."
7378 #: ../fish/guestfish-actions.pod:1023
7380 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7385 #: ../fish/guestfish-actions.pod:1030
7390 #: ../fish/guestfish-actions.pod:1032
7393 " fallocate64 path len\n"
7398 #: ../fish/guestfish-actions.pod:1038
7400 "Note that this call allocates disk blocks for the file. To create a sparse "
7401 "file use L</truncate-size> instead."
7405 #: ../fish/guestfish-actions.pod:1041
7407 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7408 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7409 "maximum size of files created through that call to 1GB."
7413 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1654
7415 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7416 "commands which create a file in the host and attach it as a device."
7420 #: ../fish/guestfish-actions.pod:1050
7425 #: ../fish/guestfish-actions.pod:1052
7428 " fgrep pattern path\n"
7433 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1669
7434 msgid "This calls the external C<fgrep> program and returns the matching lines."
7438 #: ../fish/guestfish-actions.pod:1060
7443 #: ../fish/guestfish-actions.pod:1062
7446 " fgrepi pattern path\n"
7451 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1688
7452 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7456 #: ../fish/guestfish-actions.pod:1070
7461 #: ../fish/guestfish-actions.pod:1072
7469 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1706
7471 "This call uses the standard L<file(1)> command to determine the type or "
7472 "contents of the file."
7476 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1709
7478 "This call will also transparently look inside various types of compressed "
7483 #: ../fish/guestfish-actions.pod:1080 ../src/guestfs-actions.pod:1712
7485 "The exact command which runs is C<file -zb path>. Note in particular that "
7486 "the filename is not prepended to the output (the I<-b> option)."
7490 #: ../fish/guestfish-actions.pod:1084 ../src/guestfs-actions.pod:1716
7492 "The output depends on the output of the underlying L<file(1)> command and it "
7493 "can change in future in ways beyond our control. In other words, the output "
7494 "is not guaranteed by the ABI."
7498 #: ../fish/guestfish-actions.pod:1088
7500 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7501 "(etc), L</is-zero>."
7505 #: ../fish/guestfish-actions.pod:1091
7506 msgid "file-architecture"
7510 #: ../fish/guestfish-actions.pod:1093
7513 " file-architecture filename\n"
7518 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1734
7520 "This detects the architecture of the binary C<filename>, and returns it if "
7525 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1737
7526 msgid "Currently defined architectures are:"
7530 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1741
7535 #: ../fish/guestfish-actions.pod:1104 ../src/guestfs-actions.pod:1743
7537 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7538 "irrespective of the precise processor requirements of the binary."
7542 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1746
7547 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1748
7548 msgid "64 bit x86-64."
7552 #: ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1750
7557 #: ../fish/guestfish-actions.pod:1113 ../src/guestfs-actions.pod:1752
7558 msgid "32 bit SPARC."
7562 #: ../fish/guestfish-actions.pod:1115 ../src/guestfs-actions.pod:1754
7567 #: ../fish/guestfish-actions.pod:1117 ../src/guestfs-actions.pod:1756
7568 msgid "64 bit SPARC V9 and above."
7572 #: ../fish/guestfish-actions.pod:1119 ../src/guestfs-actions.pod:1758
7577 #: ../fish/guestfish-actions.pod:1121 ../src/guestfs-actions.pod:1760
7578 msgid "Intel Itanium."
7582 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1762
7587 #: ../fish/guestfish-actions.pod:1125 ../src/guestfs-actions.pod:1764
7588 msgid "32 bit Power PC."
7592 #: ../fish/guestfish-actions.pod:1127 ../src/guestfs-actions.pod:1766
7597 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1768
7598 msgid "64 bit Power PC."
7602 #: ../fish/guestfish-actions.pod:1133 ../src/guestfs-actions.pod:1772
7603 msgid "Libguestfs may return other architecture strings in future."
7607 #: ../fish/guestfish-actions.pod:1135 ../src/guestfs-actions.pod:1774
7608 msgid "The function works on at least the following types of files:"
7612 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1780
7613 msgid "many types of Un*x and Linux binary"
7617 #: ../fish/guestfish-actions.pod:1145 ../src/guestfs-actions.pod:1784
7618 msgid "many types of Un*x and Linux shared library"
7622 #: ../fish/guestfish-actions.pod:1149 ../src/guestfs-actions.pod:1788
7623 msgid "Windows Win32 and Win64 binaries"
7627 #: ../fish/guestfish-actions.pod:1153 ../src/guestfs-actions.pod:1792
7628 msgid "Windows Win32 and Win64 DLLs"
7632 #: ../fish/guestfish-actions.pod:1155 ../src/guestfs-actions.pod:1794
7633 msgid "Win32 binaries and DLLs return C<i386>."
7637 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1796
7638 msgid "Win64 binaries and DLLs return C<x86_64>."
7642 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1800
7643 msgid "Linux kernel modules"
7647 #: ../fish/guestfish-actions.pod:1165 ../src/guestfs-actions.pod:1804
7648 msgid "Linux new-style initrd images"
7652 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1808
7653 msgid "some non-x86 Linux vmlinuz kernels"
7657 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1812
7658 msgid "What it can't do currently:"
7662 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1818
7663 msgid "static libraries (libfoo.a)"
7667 #: ../fish/guestfish-actions.pod:1183 ../src/guestfs-actions.pod:1822
7668 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7672 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1826
7673 msgid "x86 Linux vmlinuz kernels"
7677 #: ../fish/guestfish-actions.pod:1189 ../src/guestfs-actions.pod:1828
7679 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7680 "compressed code, and are horribly hard to unpack. If you want to find the "
7681 "architecture of a kernel, use the architecture of the associated initrd or "
7682 "kernel module(s) instead."
7686 #: ../fish/guestfish-actions.pod:1196
7691 #: ../fish/guestfish-actions.pod:1198
7699 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1846
7700 msgid "This command returns the size of C<file> in bytes."
7704 #: ../fish/guestfish-actions.pod:1202
7706 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7707 "L</is-file> etc. To get the size of block devices, use "
7708 "L</blockdev-getsize64>."
7712 #: ../fish/guestfish-actions.pod:1206
7717 #: ../fish/guestfish-actions.pod:1208
7720 " fill c len path\n"
7725 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:1864
7727 "This command creates a new file called C<path>. The initial content of the "
7728 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7733 #: ../fish/guestfish-actions.pod:1214
7735 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7736 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7741 #: ../fish/guestfish-actions.pod:1219
7742 msgid "fill-pattern"
7746 #: ../fish/guestfish-actions.pod:1221
7749 " fill-pattern pattern len path\n"
7754 #: ../fish/guestfish-actions.pod:1223
7756 "This function is like L</fill> except that it creates a new file of length "
7757 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7758 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7763 #: ../fish/guestfish-actions.pod:1228
7768 #: ../fish/guestfish-actions.pod:1230
7776 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:1910
7778 "This command lists out all files and directories, recursively, starting at "
7779 "C<directory>. It is essentially equivalent to running the shell command "
7780 "C<find directory -print> but some post-processing happens on the output, "
7785 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1915
7787 "This returns a list of strings I<without any prefix>. Thus if the directory "
7792 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:1918
7802 #: ../fish/guestfish-actions.pod:1244
7803 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
7807 #: ../fish/guestfish-actions.pod:1247 ../src/guestfs-actions.pod:1925
7818 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1930
7819 msgid "If C<directory> is not a directory, then this command returns an error."
7823 #: ../fish/guestfish-actions.pod:1255 ../src/guestfs-actions.pod:1933
7824 msgid "The returned list is sorted."
7828 #: ../fish/guestfish-actions.pod:1257
7829 msgid "See also L</find0>."
7833 #: ../fish/guestfish-actions.pod:1262
7838 #: ../fish/guestfish-actions.pod:1264
7841 " find0 directory (files|-)\n"
7846 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:1953
7848 "This command lists out all files and directories, recursively, starting at "
7849 "C<directory>, placing the resulting list in the external file called "
7854 #: ../fish/guestfish-actions.pod:1270
7855 msgid "This command works the same way as L</find> with the following exceptions:"
7859 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:1964
7860 msgid "The resulting list is written to an external file."
7864 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:1968
7866 "Items (filenames) in the result are separated by C<\\0> characters. See "
7867 "L<find(1)> option I<-print0>."
7871 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1973
7872 msgid "This command is not limited in the number of names that it can return."
7876 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1978
7877 msgid "The result list is not sorted."
7881 #: ../fish/guestfish-actions.pod:1297
7882 msgid "findfs-label"
7886 #: ../fish/guestfish-actions.pod:1299
7889 " findfs-label label\n"
7894 #: ../fish/guestfish-actions.pod:1301 ../src/guestfs-actions.pod:1992
7896 "This command searches the filesystems and returns the one which has the "
7897 "given label. An error is returned if no such filesystem can be found."
7901 #: ../fish/guestfish-actions.pod:1305
7902 msgid "To find the label of a filesystem, use L</vfs-label>."
7906 #: ../fish/guestfish-actions.pod:1307
7911 #: ../fish/guestfish-actions.pod:1309
7914 " findfs-uuid uuid\n"
7919 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2009
7921 "This command searches the filesystems and returns the one which has the "
7922 "given UUID. An error is returned if no such filesystem can be found."
7926 #: ../fish/guestfish-actions.pod:1315
7927 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
7931 #: ../fish/guestfish-actions.pod:1317
7936 #: ../fish/guestfish-actions.pod:1319
7939 " fsck fstype device\n"
7944 #: ../fish/guestfish-actions.pod:1321 ../src/guestfs-actions.pod:2027
7946 "This runs the filesystem checker (fsck) on C<device> which should have "
7947 "filesystem type C<fstype>."
7951 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2030
7953 "The returned integer is the status. See L<fsck(8)> for the list of status "
7954 "codes from C<fsck>."
7958 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2039
7959 msgid "Multiple status codes can be summed together."
7963 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2043
7965 "A non-zero return code can mean \"success\", for example if errors have been "
7966 "corrected on the filesystem."
7970 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2048
7971 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7975 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2053
7976 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7980 #: ../fish/guestfish-actions.pod:1349
7985 #: ../fish/guestfish-actions.pod:1351
7993 #: ../fish/guestfish-actions.pod:1353 ../src/guestfs-actions.pod:2064
7995 "Return the additional kernel options which are added to the guest kernel "
8000 #: ../fish/guestfish-actions.pod:1356 ../src/guestfs-actions.pod:2067
8001 msgid "If C<NULL> then no options are added."
8005 #: ../fish/guestfish-actions.pod:1358
8006 msgid "get-attach-method"
8010 #: ../fish/guestfish-actions.pod:1360
8013 " get-attach-method\n"
8018 #: ../fish/guestfish-actions.pod:1362
8019 msgid "Return the current attach method. See L</set-attach-method>."
8023 #: ../fish/guestfish-actions.pod:1364
8024 msgid "get-autosync"
8028 #: ../fish/guestfish-actions.pod:1366
8036 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2092
8037 msgid "Get the autosync flag."
8041 #: ../fish/guestfish-actions.pod:1370
8046 #: ../fish/guestfish-actions.pod:1372
8054 #: ../fish/guestfish-actions.pod:1374 ../src/guestfs-actions.pod:2103
8055 msgid "Return the direct appliance mode flag."
8059 #: ../fish/guestfish-actions.pod:1376
8064 #: ../fish/guestfish-actions.pod:1378
8067 " get-e2label device\n"
8072 #: ../fish/guestfish-actions.pod:1380 ../src/guestfs-actions.pod:2122
8073 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8077 #: ../fish/guestfish-actions.pod:1383
8079 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8084 #: ../fish/guestfish-actions.pod:1390
8089 #: ../fish/guestfish-actions.pod:1392
8092 " get-e2uuid device\n"
8097 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2143
8098 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8102 #: ../fish/guestfish-actions.pod:1397
8104 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8109 #: ../fish/guestfish-actions.pod:1404
8114 #: ../fish/guestfish-actions.pod:1406
8122 #: ../fish/guestfish-actions.pod:1408 ../src/guestfs-actions.pod:2156
8123 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8127 #: ../fish/guestfish-actions.pod:1411
8129 "If L</set-memsize> was not called on this handle, and if "
8130 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8131 "value for memsize."
8135 #: ../fish/guestfish-actions.pod:1415 ../fish/guestfish-actions.pod:1472 ../fish/guestfish-actions.pod:4238 ../fish/guestfish-actions.pod:4340 ../src/guestfs-actions.pod:2163 ../src/guestfs-actions.pod:2255 ../src/guestfs-actions.pod:6449 ../src/guestfs-actions.pod:6575
8136 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8140 #: ../fish/guestfish-actions.pod:1418
8145 #: ../fish/guestfish-actions.pod:1420
8153 #: ../fish/guestfish-actions.pod:1422 ../src/guestfs-actions.pod:2175
8154 msgid "This returns the enable network flag."
8158 #: ../fish/guestfish-actions.pod:1424
8163 #: ../fish/guestfish-actions.pod:1426
8171 #: ../fish/guestfish-actions.pod:1428 ../src/guestfs-actions.pod:2186
8172 msgid "Return the current search path."
8176 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2188
8178 "This is always non-NULL. If it wasn't set already, then this will return "
8183 #: ../fish/guestfish-actions.pod:1433
8188 #: ../fish/guestfish-actions.pod:1435
8196 #: ../fish/guestfish-actions.pod:1437 ../src/guestfs-actions.pod:2201
8197 msgid "This returns the process group flag."
8201 #: ../fish/guestfish-actions.pod:1439
8206 #: ../fish/guestfish-actions.pod:1441
8211 #: ../fish/guestfish-actions.pod:1443
8219 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2212
8221 "Return the process ID of the qemu subprocess. If there is no qemu "
8222 "subprocess, then this will return an error."
8226 #: ../fish/guestfish-actions.pod:1448 ../src/guestfs-actions.pod:2215
8227 msgid "This is an internal call used for debugging and testing."
8231 #: ../fish/guestfish-actions.pod:1450
8236 #: ../fish/guestfish-actions.pod:1452
8244 #: ../fish/guestfish-actions.pod:1454 ../src/guestfs-actions.pod:2226
8245 msgid "Return the current qemu binary."
8249 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2228
8251 "This is always non-NULL. If it wasn't set already, then this will return "
8252 "the default qemu binary name."
8256 #: ../fish/guestfish-actions.pod:1459
8257 msgid "get-recovery-proc"
8261 #: ../fish/guestfish-actions.pod:1461
8264 " get-recovery-proc\n"
8269 #: ../fish/guestfish-actions.pod:1463 ../src/guestfs-actions.pod:2241
8270 msgid "Return the recovery process enabled flag."
8274 #: ../fish/guestfish-actions.pod:1465
8279 #: ../fish/guestfish-actions.pod:1467
8287 #: ../fish/guestfish-actions.pod:1469
8289 "This returns the current setting of the selinux flag which is passed to the "
8290 "appliance at boot time. See L</set-selinux>."
8294 #: ../fish/guestfish-actions.pod:1475
8299 #: ../fish/guestfish-actions.pod:1477
8307 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2267
8308 msgid "This returns the number of virtual CPUs assigned to the appliance."
8312 #: ../fish/guestfish-actions.pod:1481
8317 #: ../fish/guestfish-actions.pod:1483
8325 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2278
8327 "This returns the current state as an opaque integer. This is only useful "
8328 "for printing debug and internal error messages."
8332 #: ../fish/guestfish-actions.pod:1488 ../fish/guestfish-actions.pod:2447 ../fish/guestfish-actions.pod:2465 ../fish/guestfish-actions.pod:2503 ../fish/guestfish-actions.pod:2519 ../src/guestfs-actions.pod:2281 ../src/guestfs-actions.pod:3600 ../src/guestfs-actions.pod:3629 ../src/guestfs-actions.pod:3690 ../src/guestfs-actions.pod:3717
8333 msgid "For more information on states, see L<guestfs(3)>."
8337 #: ../fish/guestfish-actions.pod:1490
8342 #: ../fish/guestfish-actions.pod:1492
8350 #: ../fish/guestfish-actions.pod:1494 ../src/guestfs-actions.pod:2292
8351 msgid "Return the command trace flag."
8355 #: ../fish/guestfish-actions.pod:1496
8360 #: ../fish/guestfish-actions.pod:1498
8368 #: ../fish/guestfish-actions.pod:1500
8370 "Return the current umask. By default the umask is C<022> unless it has been "
8371 "set by calling L</umask>."
8375 #: ../fish/guestfish-actions.pod:1503
8380 #: ../fish/guestfish-actions.pod:1505
8388 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2315
8389 msgid "This returns the verbose messages flag."
8393 #: ../fish/guestfish-actions.pod:1509
8398 #: ../fish/guestfish-actions.pod:1511
8406 #: ../fish/guestfish-actions.pod:1513 ../src/guestfs-actions.pod:2326
8407 msgid "This gets the SELinux security context of the daemon."
8411 #: ../fish/guestfish-actions.pod:1515
8412 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8416 #: ../fish/guestfish-actions.pod:1518
8421 #: ../fish/guestfish-actions.pod:1520
8424 " getxattr path name\n"
8429 #: ../fish/guestfish-actions.pod:1522
8431 "Get a single extended attribute from file C<path> named C<name>. This call "
8432 "follows symlinks. If you want to lookup an extended attribute for the "
8433 "symlink itself, use L</lgetxattr>."
8437 #: ../fish/guestfish-actions.pod:1526 ../fish/guestfish-actions.pod:2592
8439 "Normally it is better to get all extended attributes from a file in one go "
8440 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8441 "buggy and do not provide a way to list out attributes. For these "
8442 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8443 "attributes you want in advance and call this function."
8447 #: ../fish/guestfish-actions.pod:1533 ../fish/guestfish-actions.pod:2599 ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:3850
8449 "Extended attribute values are blobs of binary data. If there is no extended "
8450 "attribute named C<name>, this returns an error."
8454 #: ../fish/guestfish-actions.pod:1536
8455 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8459 #: ../fish/guestfish-actions.pod:1538
8464 #: ../fish/guestfish-actions.pod:1540
8472 #: ../fish/guestfish-actions.pod:1542 ../src/guestfs-actions.pod:2372
8473 msgid "This call lists the extended attributes of the file or directory C<path>."
8477 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2375
8479 "At the system call level, this is a combination of the L<listxattr(2)> and "
8480 "L<getxattr(2)> calls."
8484 #: ../fish/guestfish-actions.pod:1548
8485 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8489 #: ../fish/guestfish-actions.pod:1550
8494 #: ../fish/guestfish-actions.pod:1552
8497 " glob-expand pattern\n"
8502 #: ../fish/guestfish-actions.pod:1554 ../src/guestfs-actions.pod:2392
8504 "This command searches for all the pathnames matching C<pattern> according to "
8505 "the wildcard expansion rules used by the shell."
8509 #: ../fish/guestfish-actions.pod:1558 ../src/guestfs-actions.pod:2396
8510 msgid "If no paths match, then this returns an empty list (note: not an error)."
8514 #: ../fish/guestfish-actions.pod:1561 ../src/guestfs-actions.pod:2399
8516 "It is just a wrapper around the C L<glob(3)> function with flags "
8517 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8521 #: ../fish/guestfish-actions.pod:1565
8526 #: ../fish/guestfish-actions.pod:1567
8529 " grep regex path\n"
8534 #: ../fish/guestfish-actions.pod:1569 ../src/guestfs-actions.pod:2416
8535 msgid "This calls the external C<grep> program and returns the matching lines."
8539 #: ../fish/guestfish-actions.pod:1575
8544 #: ../fish/guestfish-actions.pod:1577
8547 " grepi regex path\n"
8552 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2435
8553 msgid "This calls the external C<grep -i> program and returns the matching lines."
8557 #: ../fish/guestfish-actions.pod:1585
8558 msgid "grub-install"
8562 #: ../fish/guestfish-actions.pod:1587
8565 " grub-install root device\n"
8570 #: ../fish/guestfish-actions.pod:1589 ../src/guestfs-actions.pod:2454
8572 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8573 "with the root directory being C<root>."
8577 #: ../fish/guestfish-actions.pod:1598 ../src/guestfs-actions.pod:2463
8579 "There is currently no way in the API to install grub2, which is used by most "
8580 "modern Linux guests. It is possible to run the grub2 command from the "
8581 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8585 #: ../fish/guestfish-actions.pod:1605 ../src/guestfs-actions.pod:2470
8587 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8588 "compatible with itself, so this only works in rather narrow circumstances. "
8589 "Careful testing with each guest version is advisable."
8593 #: ../fish/guestfish-actions.pod:1612 ../src/guestfs-actions.pod:2477
8595 "If grub-install reports the error \"No suitable drive was found in the "
8596 "generated device map.\" it may be that you need to create a "
8597 "C</boot/grub/device.map> file first that contains the mapping between grub "
8598 "device names and Linux device names. It is usually sufficient to create a "
8603 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2484
8611 #: ../fish/guestfish-actions.pod:1621 ../src/guestfs-actions.pod:2486
8612 msgid "replacing C</dev/vda> with the name of the installation device."
8616 #: ../fish/guestfish-actions.pod:1625
8621 #: ../fish/guestfish-actions.pod:1627
8629 #: ../fish/guestfish-actions.pod:1629 ../src/guestfs-actions.pod:2500
8631 "This command returns up to the first 10 lines of a file as a list of "
8636 #: ../fish/guestfish-actions.pod:1635
8641 #: ../fish/guestfish-actions.pod:1637
8644 " head-n nrlines path\n"
8649 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2519
8651 "If the parameter C<nrlines> is a positive number, this returns the first "
8652 "C<nrlines> lines of the file C<path>."
8656 #: ../fish/guestfish-actions.pod:1642 ../src/guestfs-actions.pod:2522
8658 "If the parameter C<nrlines> is a negative number, this returns lines from "
8659 "the file C<path>, excluding the last C<nrlines> lines."
8663 #: ../fish/guestfish-actions.pod:1645 ../fish/guestfish-actions.pod:4730 ../src/guestfs-actions.pod:2525 ../src/guestfs-actions.pod:7163
8664 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8668 #: ../fish/guestfish-actions.pod:1650
8673 #: ../fish/guestfish-actions.pod:1652
8681 #: ../fish/guestfish-actions.pod:1654 ../src/guestfs-actions.pod:2542
8683 "This runs C<hexdump -C> on the given C<path>. The result is the "
8684 "human-readable, canonical hex dump of the file."
8688 #: ../fish/guestfish-actions.pod:1660
8693 #: ../fish/guestfish-actions.pod:1662
8696 " initrd-cat initrdpath filename\n"
8701 #: ../fish/guestfish-actions.pod:1664 ../src/guestfs-actions.pod:2561
8703 "This command unpacks the file C<filename> from the initrd file called "
8704 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8709 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2565
8711 "For example, in guestfish you could use the following command to examine the "
8712 "boot script (usually called C</init>) contained in a Linux initrd or "
8717 #: ../fish/guestfish-actions.pod:1672 ../src/guestfs-actions.pod:2569
8720 " initrd-cat /boot/initrd-<version>.img init\n"
8725 #: ../fish/guestfish-actions.pod:1674
8726 msgid "See also L</initrd-list>."
8730 #: ../fish/guestfish-actions.pod:1679
8735 #: ../fish/guestfish-actions.pod:1681
8738 " initrd-list path\n"
8743 #: ../fish/guestfish-actions.pod:1683 ../src/guestfs-actions.pod:2588
8744 msgid "This command lists out files contained in an initrd."
8748 #: ../fish/guestfish-actions.pod:1685 ../src/guestfs-actions.pod:2590
8750 "The files are listed without any initial C</> character. The files are "
8751 "listed in the order they appear (not necessarily alphabetical). Directory "
8752 "names are listed as separate items."
8756 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2594
8758 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8759 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8764 #: ../fish/guestfish-actions.pod:1693
8765 msgid "inotify-add-watch"
8769 #: ../fish/guestfish-actions.pod:1695
8772 " inotify-add-watch path mask\n"
8777 #: ../fish/guestfish-actions.pod:1697 ../src/guestfs-actions.pod:2611
8778 msgid "Watch C<path> for the events listed in C<mask>."
8782 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2613
8784 "Note that if C<path> is a directory then events within that directory are "
8785 "watched, but this does I<not> happen recursively (in subdirectories)."
8789 #: ../fish/guestfish-actions.pod:1703 ../src/guestfs-actions.pod:2617
8791 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8792 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8796 #: ../fish/guestfish-actions.pod:1707
8797 msgid "inotify-close"
8801 #: ../fish/guestfish-actions.pod:1709
8809 #: ../fish/guestfish-actions.pod:1711 ../src/guestfs-actions.pod:2630
8811 "This closes the inotify handle which was previously opened by inotify_init. "
8812 "It removes all watches, throws away any pending events, and deallocates all "
8817 #: ../fish/guestfish-actions.pod:1715
8818 msgid "inotify-files"
8822 #: ../fish/guestfish-actions.pod:1717
8830 #: ../fish/guestfish-actions.pod:1719
8832 "This function is a helpful wrapper around L</inotify-read> which just "
8833 "returns a list of pathnames of objects that were touched. The returned "
8834 "pathnames are sorted and deduplicated."
8838 #: ../fish/guestfish-actions.pod:1723
8839 msgid "inotify-init"
8843 #: ../fish/guestfish-actions.pod:1725
8846 " inotify-init maxevents\n"
8851 #: ../fish/guestfish-actions.pod:1727 ../src/guestfs-actions.pod:2659
8853 "This command creates a new inotify handle. The inotify subsystem can be "
8854 "used to notify events which happen to objects in the guest filesystem."
8858 #: ../fish/guestfish-actions.pod:1731
8860 "C<maxevents> is the maximum number of events which will be queued up between "
8861 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8862 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
8863 "default was 16384 events. Beyond this limit, the kernel throws away events, "
8864 "but records the fact that it threw them away by setting a flag "
8865 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
8869 #: ../fish/guestfish-actions.pod:1741
8871 "Before any events are generated, you have to add some watches to the "
8872 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
8873 "L</inotify-watch-all>."
8877 #: ../fish/guestfish-actions.pod:1747
8879 "Queued up events should be read periodically by calling L</inotify-read> (or "
8880 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
8881 "If you don't read the events out often enough then you risk the internal "
8882 "queue overflowing."
8886 #: ../fish/guestfish-actions.pod:1754
8888 "The handle should be closed after use by calling L</inotify-close>. This "
8889 "also removes any watches automatically."
8893 #: ../fish/guestfish-actions.pod:1758 ../src/guestfs-actions.pod:2690
8895 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8896 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8897 "that there is one global inotify handle per libguestfs instance."
8901 #: ../fish/guestfish-actions.pod:1763
8902 msgid "inotify-read"
8906 #: ../fish/guestfish-actions.pod:1765
8914 #: ../fish/guestfish-actions.pod:1767 ../src/guestfs-actions.pod:2704
8916 "Return the complete queue of events that have happened since the previous "
8921 #: ../fish/guestfish-actions.pod:1770 ../src/guestfs-actions.pod:2707
8922 msgid "If no events have happened, this returns an empty list."
8926 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2709
8928 "I<Note>: In order to make sure that all events have been read, you must call "
8929 "this function repeatedly until it returns an empty list. The reason is that "
8930 "the call will read events up to the maximum appliance-to-host message size "
8931 "and leave remaining events in the queue."
8935 #: ../fish/guestfish-actions.pod:1778
8936 msgid "inotify-rm-watch"
8940 #: ../fish/guestfish-actions.pod:1780
8943 " inotify-rm-watch wd\n"
8948 #: ../fish/guestfish-actions.pod:1782
8949 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
8953 #: ../fish/guestfish-actions.pod:1785
8954 msgid "inspect-get-arch"
8958 #: ../fish/guestfish-actions.pod:1787
8961 " inspect-get-arch root\n"
8966 #: ../fish/guestfish-actions.pod:1789
8968 "This returns the architecture of the inspected operating system. The "
8969 "possible return values are listed under L</file-architecture>."
8973 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2744
8975 "If the architecture could not be determined, then the string C<unknown> is "
8980 #: ../fish/guestfish-actions.pod:1796 ../fish/guestfish-actions.pod:1891 ../fish/guestfish-actions.pod:1970 ../fish/guestfish-actions.pod:1982 ../fish/guestfish-actions.pod:2066 ../fish/guestfish-actions.pod:2128 ../fish/guestfish-actions.pod:2149 ../fish/guestfish-actions.pod:2163 ../fish/guestfish-actions.pod:2203 ../fish/guestfish-actions.pod:2239 ../fish/guestfish-actions.pod:2252 ../fish/guestfish-actions.pod:2265 ../fish/guestfish-actions.pod:2275 ../fish/guestfish-actions.pod:2285 ../fish/guestfish-actions.pod:2297 ../fish/guestfish-actions.pod:2393 ../fish/guestfish-actions.pod:2427 ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:2849 ../src/guestfs-actions.pod:2953 ../src/guestfs-actions.pod:2972 ../src/guestfs-actions.pod:3103 ../src/guestfs-actions.pod:3187 ../src/guestfs-actions.pod:3215 ../src/guestfs-actions.pod:3236 ../src/guestfs-actions.pod:3289 ../src/guestfs-actions.pod:3333 ../src/guestfs-actions.pod:3353 ../src/guestfs-actions.pod:3373 ../src/guestfs-actions.pod:3390 ../src/guestfs-actions.pod:3406 ../src/guestfs-actions.pod:3424 ../src/guestfs-actions.pod:3526 ../src/guestfs-actions.pod:3567
8981 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8985 #: ../fish/guestfish-actions.pod:1798
8986 msgid "inspect-get-distro"
8990 #: ../fish/guestfish-actions.pod:1800
8993 " inspect-get-distro root\n"
8998 #: ../fish/guestfish-actions.pod:1802 ../src/guestfs-actions.pod:2760
8999 msgid "This returns the distro (distribution) of the inspected operating system."
9003 #: ../fish/guestfish-actions.pod:1805 ../src/guestfs-actions.pod:2763
9004 msgid "Currently defined distros are:"
9008 #: ../fish/guestfish-actions.pod:1809 ../src/guestfs-actions.pod:2767
9009 msgid "\"archlinux\""
9013 #: ../fish/guestfish-actions.pod:1811 ../src/guestfs-actions.pod:2769
9018 #: ../fish/guestfish-actions.pod:1813 ../src/guestfs-actions.pod:2771
9023 #: ../fish/guestfish-actions.pod:1815 ../src/guestfs-actions.pod:2773
9028 #: ../fish/guestfish-actions.pod:1817 ../src/guestfs-actions.pod:2775
9033 #: ../fish/guestfish-actions.pod:1819 ../src/guestfs-actions.pod:2777
9038 #: ../fish/guestfish-actions.pod:1821 ../src/guestfs-actions.pod:2779
9043 #: ../fish/guestfish-actions.pod:1823 ../src/guestfs-actions.pod:2781
9048 #: ../fish/guestfish-actions.pod:1825 ../src/guestfs-actions.pod:2783
9053 #: ../fish/guestfish-actions.pod:1827 ../src/guestfs-actions.pod:2785
9058 #: ../fish/guestfish-actions.pod:1829 ../src/guestfs-actions.pod:2787
9059 msgid "\"linuxmint\""
9063 #: ../fish/guestfish-actions.pod:1831 ../src/guestfs-actions.pod:2789
9068 #: ../fish/guestfish-actions.pod:1833 ../src/guestfs-actions.pod:2791
9073 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2793
9078 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2795
9079 msgid "\"mandriva\""
9083 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2797
9088 #: ../fish/guestfish-actions.pod:1841 ../src/guestfs-actions.pod:2799
9093 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2801
9098 #: ../fish/guestfish-actions.pod:1845 ../src/guestfs-actions.pod:2803
9099 msgid "\"opensuse\""
9103 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2805
9108 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2807
9113 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2809
9118 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2811
9119 msgid "\"redhat-based\""
9123 #: ../fish/guestfish-actions.pod:1855 ../src/guestfs-actions.pod:2813
9124 msgid "Some Red Hat-derived distro."
9128 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2815
9133 #: ../fish/guestfish-actions.pod:1859 ../src/guestfs-actions.pod:2817
9134 msgid "Red Hat Enterprise Linux."
9138 #: ../fish/guestfish-actions.pod:1861 ../src/guestfs-actions.pod:2819
9139 msgid "\"scientificlinux\""
9143 #: ../fish/guestfish-actions.pod:1863 ../src/guestfs-actions.pod:2821
9144 msgid "Scientific Linux."
9148 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2823
9149 msgid "\"slackware\""
9153 #: ../fish/guestfish-actions.pod:1867 ../src/guestfs-actions.pod:2825
9158 #: ../fish/guestfish-actions.pod:1869 ../src/guestfs-actions.pod:2827
9159 msgid "\"ttylinux\""
9163 #: ../fish/guestfish-actions.pod:1871 ../src/guestfs-actions.pod:2829
9168 #: ../fish/guestfish-actions.pod:1873 ../src/guestfs-actions.pod:2831
9173 #: ../fish/guestfish-actions.pod:1875 ../src/guestfs-actions.pod:2833
9178 #: ../fish/guestfish-actions.pod:1877 ../fish/guestfish-actions.pod:1961 ../fish/guestfish-actions.pod:2230 ../src/guestfs-actions.pod:2835 ../src/guestfs-actions.pod:2944 ../src/guestfs-actions.pod:3324
9183 #: ../fish/guestfish-actions.pod:1879 ../src/guestfs-actions.pod:2837
9184 msgid "The distro could not be determined."
9188 #: ../fish/guestfish-actions.pod:1881 ../fish/guestfish-actions.pod:2218 ../src/guestfs-actions.pod:2839 ../src/guestfs-actions.pod:3312
9193 #: ../fish/guestfish-actions.pod:1883 ../src/guestfs-actions.pod:2841
9195 "Windows does not have distributions. This string is returned if the OS type "
9200 #: ../fish/guestfish-actions.pod:1888 ../fish/guestfish-actions.pod:1967 ../fish/guestfish-actions.pod:2236 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3330
9202 "Future versions of libguestfs may return other strings here. The caller "
9203 "should be prepared to handle any string."
9207 #: ../fish/guestfish-actions.pod:1893
9208 msgid "inspect-get-drive-mappings"
9212 #: ../fish/guestfish-actions.pod:1895
9215 " inspect-get-drive-mappings root\n"
9220 #: ../fish/guestfish-actions.pod:1897 ../src/guestfs-actions.pod:2862
9222 "This call is useful for Windows which uses a primitive system of assigning "
9223 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9224 "Windows Registry to find out how disks/partitions are mapped to drive "
9225 "letters, and returns a hash table as in the example below:"
9229 #: ../fish/guestfish-actions.pod:1903 ../src/guestfs-actions.pod:2868
9239 #: ../fish/guestfish-actions.pod:1907 ../src/guestfs-actions.pod:2872
9241 "Note that keys are drive letters. For Windows, the key is case insensitive "
9242 "and just contains the drive letter, without the customary colon separator "
9247 #: ../fish/guestfish-actions.pod:1911 ../src/guestfs-actions.pod:2876
9249 "In future we may support other operating systems that also used drive "
9250 "letters, but the keys for those might not be case insensitive and might be "
9251 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9256 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:2881
9258 "For Windows guests, currently only hard drive mappings are returned. "
9259 "Removable disks (eg. DVD-ROMs) are ignored."
9263 #: ../fish/guestfish-actions.pod:1919 ../src/guestfs-actions.pod:2884
9265 "For guests that do not use drive mappings, or if the drive mappings could "
9266 "not be determined, this returns an empty hash table."
9270 #: ../fish/guestfish-actions.pod:1922
9272 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9273 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
9277 #: ../fish/guestfish-actions.pod:1926
9278 msgid "inspect-get-filesystems"
9282 #: ../fish/guestfish-actions.pod:1928
9285 " inspect-get-filesystems root\n"
9290 #: ../fish/guestfish-actions.pod:1930 ../src/guestfs-actions.pod:2905
9292 "This returns a list of all the filesystems that we think are associated with "
9293 "this operating system. This includes the root filesystem, other ordinary "
9294 "filesystems, and non-mounted devices like swap partitions."
9298 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2910
9300 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9301 "to be shared between operating systems."
9305 #: ../fish/guestfish-actions.pod:1938
9307 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9308 "L</inspect-get-mountpoints>."
9312 #: ../fish/guestfish-actions.pod:1941
9313 msgid "inspect-get-format"
9317 #: ../fish/guestfish-actions.pod:1943
9320 " inspect-get-format root\n"
9325 #: ../fish/guestfish-actions.pod:1945 ../src/guestfs-actions.pod:2928
9327 "This returns the format of the inspected operating system. You can use it "
9328 "to detect install images, live CDs and similar."
9332 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:2931
9333 msgid "Currently defined formats are:"
9337 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:2935
9338 msgid "\"installed\""
9342 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:2937
9343 msgid "This is an installed operating system."
9347 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:2939
9348 msgid "\"installer\""
9352 #: ../fish/guestfish-actions.pod:1958 ../src/guestfs-actions.pod:2941
9354 "The disk image being inspected is not an installed operating system, but a "
9355 "I<bootable> install disk, live CD, or similar."
9359 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2946
9360 msgid "The format of this disk image is not known."
9364 #: ../fish/guestfish-actions.pod:1972
9365 msgid "inspect-get-hostname"
9369 #: ../fish/guestfish-actions.pod:1974
9372 " inspect-get-hostname root\n"
9377 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:2966
9379 "This function returns the hostname of the operating system as found by "
9380 "inspection of the guest's configuration files."
9384 #: ../fish/guestfish-actions.pod:1979 ../src/guestfs-actions.pod:2969
9386 "If the hostname could not be determined, then the string C<unknown> is "
9391 #: ../fish/guestfish-actions.pod:1984
9392 msgid "inspect-get-icon"
9396 #: ../fish/guestfish-actions.pod:1986
9399 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9404 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:2995
9406 "This function returns an icon corresponding to the inspected operating "
9407 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9408 "to PNG if necessary)."
9412 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:2999
9414 "If it was not possible to get an icon this function returns a zero-length "
9415 "(non-NULL) buffer. I<Callers must check for this case>."
9419 #: ../fish/guestfish-actions.pod:1995 ../src/guestfs-actions.pod:3002
9421 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9422 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9423 "this file will be returned. You can disable favicons by passing the "
9424 "optional C<favicon> boolean as false (default is true)."
9428 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:3008
9430 "If finding the favicon fails, then we look in other places in the guest for "
9435 #: ../fish/guestfish-actions.pod:2004 ../src/guestfs-actions.pod:3011
9437 "If the optional C<highquality> boolean is true then only high quality icons "
9438 "are returned, which means only icons of high resolution with an alpha "
9439 "channel. The default (false) is to return any icon we can, even if it is of "
9440 "substandard quality."
9444 #: ../fish/guestfish-actions.pod:2015 ../src/guestfs-actions.pod:3022
9446 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9447 "before you call this, since it needs to read information from the guest "
9448 "filesystem during the call."
9452 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3028
9454 "B<Security:> The icon data comes from the untrusted guest, and should be "
9455 "treated with caution. PNG files have been known to contain exploits. "
9456 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9457 "trying to process or display the icon."
9461 #: ../fish/guestfish-actions.pod:2029 ../src/guestfs-actions.pod:3036
9463 "The PNG image returned can be any size. It might not be square. Libguestfs "
9464 "tries to return the largest, highest quality icon available. The "
9465 "application must scale the icon to the required size."
9469 #: ../fish/guestfish-actions.pod:2036 ../src/guestfs-actions.pod:3043
9471 "Extracting icons from Windows guests requires the external C<wrestool> "
9472 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9473 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9474 "installed separately."
9478 #: ../fish/guestfish-actions.pod:2043 ../src/guestfs-actions.pod:3050
9480 "Operating system icons are usually trademarks. Seek legal advice before "
9481 "using trademarks in applications."
9485 #: ../fish/guestfish-actions.pod:2050
9486 msgid "inspect-get-major-version"
9490 #: ../fish/guestfish-actions.pod:2052
9493 " inspect-get-major-version root\n"
9498 #: ../fish/guestfish-actions.pod:2054 ../src/guestfs-actions.pod:3091
9499 msgid "This returns the major version number of the inspected operating system."
9503 #: ../fish/guestfish-actions.pod:2057 ../src/guestfs-actions.pod:3094
9505 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9506 "popular public names used by the operating system. Notably the operating "
9507 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9508 "1). You can find out the real versions corresponding to releases of Windows "
9509 "by consulting Wikipedia or MSDN."
9513 #: ../fish/guestfish-actions.pod:2064 ../fish/guestfish-actions.pod:2075 ../src/guestfs-actions.pod:3101 ../src/guestfs-actions.pod:3118
9514 msgid "If the version could not be determined, then C<0> is returned."
9518 #: ../fish/guestfish-actions.pod:2068
9519 msgid "inspect-get-minor-version"
9523 #: ../fish/guestfish-actions.pod:2070
9526 " inspect-get-minor-version root\n"
9531 #: ../fish/guestfish-actions.pod:2072 ../src/guestfs-actions.pod:3115
9532 msgid "This returns the minor version number of the inspected operating system."
9536 #: ../fish/guestfish-actions.pod:2077
9538 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9539 "L</inspect-get-major-version>."
9543 #: ../fish/guestfish-actions.pod:2080
9544 msgid "inspect-get-mountpoints"
9548 #: ../fish/guestfish-actions.pod:2082
9551 " inspect-get-mountpoints root\n"
9556 #: ../fish/guestfish-actions.pod:2084 ../src/guestfs-actions.pod:3133
9558 "This returns a hash of where we think the filesystems associated with this "
9559 "operating system should be mounted. Callers should note that this is at "
9560 "best an educated guess made by reading configuration files such as "
9561 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9562 "are non-existent or not mountable and callers should be prepared to handle "
9563 "or ignore failures if they try to mount them."
9567 #: ../fish/guestfish-actions.pod:2093 ../src/guestfs-actions.pod:3142
9569 "Each element in the returned hashtable has a key which is the path of the "
9570 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9571 "mounted there (eg. C</dev/sda1>)."
9575 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3147
9576 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9580 #: ../fish/guestfish-actions.pod:2101
9582 "For operating systems like Windows which still use drive letters, this call "
9583 "will only return an entry for the first drive \"mounted on\" C</>. For "
9584 "information about the mapping of drive letters to partitions, see "
9585 "L</inspect-get-drive-mappings>."
9589 #: ../fish/guestfish-actions.pod:2107
9591 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9592 "L</inspect-get-filesystems>."
9596 #: ../fish/guestfish-actions.pod:2110
9597 msgid "inspect-get-package-format"
9601 #: ../fish/guestfish-actions.pod:2112
9604 " inspect-get-package-format root\n"
9609 #: ../fish/guestfish-actions.pod:2114
9611 "This function and L</inspect-get-package-management> return the package "
9612 "format and package management tool used by the inspected operating system. "
9613 "For example for Fedora these functions would return C<rpm> (package format) "
9614 "and C<yum> (package management)."
9618 #: ../fish/guestfish-actions.pod:2120 ../src/guestfs-actions.pod:3179
9620 "This returns the string C<unknown> if we could not determine the package "
9621 "format I<or> if the operating system does not have a real packaging system "
9626 #: ../fish/guestfish-actions.pod:2124 ../src/guestfs-actions.pod:3183
9628 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
9629 "C<pkgsrc>. Future versions of libguestfs may return other strings."
9633 #: ../fish/guestfish-actions.pod:2130
9634 msgid "inspect-get-package-management"
9638 #: ../fish/guestfish-actions.pod:2132
9641 " inspect-get-package-management root\n"
9646 #: ../fish/guestfish-actions.pod:2134
9648 "L</inspect-get-package-format> and this function return the package format "
9649 "and package management tool used by the inspected operating system. For "
9650 "example for Fedora these functions would return C<rpm> (package format) and "
9651 "C<yum> (package management)."
9655 #: ../fish/guestfish-actions.pod:2140 ../src/guestfs-actions.pod:3206
9657 "This returns the string C<unknown> if we could not determine the package "
9658 "management tool I<or> if the operating system does not have a real packaging "
9659 "system (eg. Windows)."
9663 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3210
9665 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9666 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
9667 "versions of libguestfs may return other strings."
9671 #: ../fish/guestfish-actions.pod:2151
9672 msgid "inspect-get-product-name"
9676 #: ../fish/guestfish-actions.pod:2153
9679 " inspect-get-product-name root\n"
9684 #: ../fish/guestfish-actions.pod:2155 ../src/guestfs-actions.pod:3228
9686 "This returns the product name of the inspected operating system. The "
9687 "product name is generally some freeform string which can be displayed to the "
9688 "user, but should not be parsed by programs."
9692 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3233
9694 "If the product name could not be determined, then the string C<unknown> is "
9699 #: ../fish/guestfish-actions.pod:2165
9700 msgid "inspect-get-product-variant"
9704 #: ../fish/guestfish-actions.pod:2167
9707 " inspect-get-product-variant root\n"
9712 #: ../fish/guestfish-actions.pod:2169 ../src/guestfs-actions.pod:3249
9713 msgid "This returns the product variant of the inspected operating system."
9717 #: ../fish/guestfish-actions.pod:2172 ../src/guestfs-actions.pod:3252
9719 "For Windows guests, this returns the contents of the Registry key "
9720 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9721 "which is usually a string such as C<Client> or C<Server> (other values are "
9722 "possible). This can be used to distinguish consumer and enterprise versions "
9723 "of Windows that have the same version number (for example, Windows 7 and "
9724 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9725 "the latter is C<Server>)."
9729 #: ../fish/guestfish-actions.pod:2181 ../src/guestfs-actions.pod:3261
9731 "For enterprise Linux guests, in future we intend this to return the product "
9732 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9733 "implemented at present."
9737 #: ../fish/guestfish-actions.pod:2185 ../src/guestfs-actions.pod:3265
9739 "If the product variant could not be determined, then the string C<unknown> "
9744 #: ../fish/guestfish-actions.pod:2188
9746 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9747 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9751 #: ../fish/guestfish-actions.pod:2192
9752 msgid "inspect-get-roots"
9756 #: ../fish/guestfish-actions.pod:2194
9759 " inspect-get-roots\n"
9764 #: ../fish/guestfish-actions.pod:2196
9766 "This function is a convenient way to get the list of root devices, as "
9767 "returned from a previous call to L</inspect-os>, but without redoing the "
9768 "whole inspection process."
9772 #: ../fish/guestfish-actions.pod:2200
9774 "This returns an empty list if either no root devices were found or the "
9775 "caller has not called L</inspect-os>."
9779 #: ../fish/guestfish-actions.pod:2205
9780 msgid "inspect-get-type"
9784 #: ../fish/guestfish-actions.pod:2207
9787 " inspect-get-type root\n"
9792 #: ../fish/guestfish-actions.pod:2209 ../src/guestfs-actions.pod:3303
9794 "This returns the type of the inspected operating system. Currently defined "
9799 #: ../fish/guestfish-actions.pod:2214 ../src/guestfs-actions.pod:3308
9804 #: ../fish/guestfish-actions.pod:2216 ../src/guestfs-actions.pod:3310
9805 msgid "Any Linux-based operating system."
9809 #: ../fish/guestfish-actions.pod:2220 ../src/guestfs-actions.pod:3314
9810 msgid "Any Microsoft Windows operating system."
9814 #: ../fish/guestfish-actions.pod:2222 ../src/guestfs-actions.pod:3316
9819 #: ../fish/guestfish-actions.pod:2224 ../src/guestfs-actions.pod:3318
9824 #: ../fish/guestfish-actions.pod:2226 ../src/guestfs-actions.pod:3320
9829 #: ../fish/guestfish-actions.pod:2228 ../src/guestfs-actions.pod:3322
9834 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3326
9835 msgid "The operating system type could not be determined."
9839 #: ../fish/guestfish-actions.pod:2241
9840 msgid "inspect-get-windows-current-control-set"
9844 #: ../fish/guestfish-actions.pod:2243
9847 " inspect-get-windows-current-control-set root\n"
9852 #: ../fish/guestfish-actions.pod:2245 ../src/guestfs-actions.pod:3346
9854 "This returns the Windows CurrentControlSet of the inspected guest. The "
9855 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9859 #: ../fish/guestfish-actions.pod:2248 ../src/guestfs-actions.pod:3349
9861 "This call assumes that the guest is Windows and that the Registry could be "
9862 "examined by inspection. If this is not the case then an error is returned."
9866 #: ../fish/guestfish-actions.pod:2254
9867 msgid "inspect-get-windows-systemroot"
9871 #: ../fish/guestfish-actions.pod:2256
9874 " inspect-get-windows-systemroot root\n"
9879 #: ../fish/guestfish-actions.pod:2258 ../src/guestfs-actions.pod:3366
9881 "This returns the Windows systemroot of the inspected guest. The systemroot "
9882 "is a directory path such as C</WINDOWS>."
9886 #: ../fish/guestfish-actions.pod:2261 ../src/guestfs-actions.pod:3369
9888 "This call assumes that the guest is Windows and that the systemroot could be "
9889 "determined by inspection. If this is not the case then an error is "
9894 #: ../fish/guestfish-actions.pod:2267
9895 msgid "inspect-is-live"
9899 #: ../fish/guestfish-actions.pod:2269
9902 " inspect-is-live root\n"
9907 #: ../fish/guestfish-actions.pod:2271
9909 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9910 "then this returns true if a live image was detected on the disk."
9914 #: ../fish/guestfish-actions.pod:2277
9915 msgid "inspect-is-multipart"
9919 #: ../fish/guestfish-actions.pod:2279
9922 " inspect-is-multipart root\n"
9927 #: ../fish/guestfish-actions.pod:2281
9929 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9930 "then this returns true if the disk is part of a set."
9934 #: ../fish/guestfish-actions.pod:2287
9935 msgid "inspect-is-netinst"
9939 #: ../fish/guestfish-actions.pod:2289
9942 " inspect-is-netinst root\n"
9947 #: ../fish/guestfish-actions.pod:2291
9949 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9950 "then this returns true if the disk is a network installer, ie. not a "
9951 "self-contained install CD but one which is likely to require network access "
9952 "to complete the install."
9956 #: ../fish/guestfish-actions.pod:2299
9957 msgid "inspect-list-applications"
9961 #: ../fish/guestfish-actions.pod:2301
9964 " inspect-list-applications root\n"
9969 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3436
9970 msgid "Return the list of applications installed in the operating system."
9974 #: ../fish/guestfish-actions.pod:2305
9976 "I<Note:> This call works differently from other parts of the inspection "
9977 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
9978 "then mount up the disks, before calling this. Listing applications is a "
9979 "significantly more difficult operation which requires access to the full "
9980 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
9981 "are just returning data cached in the libguestfs handle, this call actually "
9982 "reads parts of the mounted filesystems during the call."
9986 #: ../fish/guestfish-actions.pod:2315 ../src/guestfs-actions.pod:3448
9988 "This returns an empty list if the inspection code was not able to determine "
9989 "the list of applications."
9993 #: ../fish/guestfish-actions.pod:2318 ../src/guestfs-actions.pod:3451
9994 msgid "The application structure contains the following fields:"
9998 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3455
10003 #: ../fish/guestfish-actions.pod:2324 ../src/guestfs-actions.pod:3457
10005 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10006 "guests, this is the package name."
10010 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3460
10011 msgid "C<app_display_name>"
10015 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3462
10017 "The display name of the application, sometimes localized to the install "
10018 "language of the guest operating system."
10022 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3465
10024 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10025 "to display something can use C<app_name> instead."
10029 #: ../fish/guestfish-actions.pod:2335 ../src/guestfs-actions.pod:3468
10030 msgid "C<app_epoch>"
10034 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3470
10036 "For package managers which use epochs, this contains the epoch of the "
10037 "package (an integer). If unavailable, this is returned as C<0>."
10041 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3473
10042 msgid "C<app_version>"
10046 #: ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:3475
10048 "The version string of the application or package. If unavailable this is "
10049 "returned as an empty string C<\"\">."
10053 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3478
10054 msgid "C<app_release>"
10058 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3480
10060 "The release string of the application or package, for package managers that "
10061 "use this. If unavailable this is returned as an empty string C<\"\">."
10065 #: ../fish/guestfish-actions.pod:2351 ../src/guestfs-actions.pod:3484
10066 msgid "C<app_install_path>"
10070 #: ../fish/guestfish-actions.pod:2353 ../src/guestfs-actions.pod:3486
10072 "The installation path of the application (on operating systems such as "
10073 "Windows which use installation paths). This path is in the format used by "
10074 "the guest operating system, it is not a libguestfs path."
10078 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3491
10079 msgid "If unavailable this is returned as an empty string C<\"\">."
10083 #: ../fish/guestfish-actions.pod:2360 ../src/guestfs-actions.pod:3493
10084 msgid "C<app_trans_path>"
10088 #: ../fish/guestfish-actions.pod:2362 ../src/guestfs-actions.pod:3495
10090 "The install path translated into a libguestfs path. If unavailable this is "
10091 "returned as an empty string C<\"\">."
10095 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3498
10096 msgid "C<app_publisher>"
10100 #: ../fish/guestfish-actions.pod:2367 ../src/guestfs-actions.pod:3500
10102 "The name of the publisher of the application, for package managers that use "
10103 "this. If unavailable this is returned as an empty string C<\"\">."
10107 #: ../fish/guestfish-actions.pod:2371 ../src/guestfs-actions.pod:3504
10112 #: ../fish/guestfish-actions.pod:2373 ../src/guestfs-actions.pod:3506
10114 "The URL (eg. upstream URL) of the application. If unavailable this is "
10115 "returned as an empty string C<\"\">."
10119 #: ../fish/guestfish-actions.pod:2376 ../src/guestfs-actions.pod:3509
10120 msgid "C<app_source_package>"
10124 #: ../fish/guestfish-actions.pod:2378 ../src/guestfs-actions.pod:3511
10126 "For packaging systems which support this, the name of the source package. "
10127 "If unavailable this is returned as an empty string C<\"\">."
10131 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3514
10132 msgid "C<app_summary>"
10136 #: ../fish/guestfish-actions.pod:2383 ../src/guestfs-actions.pod:3516
10138 "A short (usually one line) description of the application or package. If "
10139 "unavailable this is returned as an empty string C<\"\">."
10143 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3519
10144 msgid "C<app_description>"
10148 #: ../fish/guestfish-actions.pod:2388 ../src/guestfs-actions.pod:3521
10150 "A longer description of the application or package. If unavailable this is "
10151 "returned as an empty string C<\"\">."
10155 #: ../fish/guestfish-actions.pod:2395
10160 #: ../fish/guestfish-actions.pod:2397
10168 #: ../fish/guestfish-actions.pod:2399 ../src/guestfs-actions.pod:3539
10170 "This function uses other libguestfs functions and certain heuristics to "
10171 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10172 "for operating systems."
10176 #: ../fish/guestfish-actions.pod:2403 ../src/guestfs-actions.pod:3543
10177 msgid "The list returned is empty if no operating systems were found."
10181 #: ../fish/guestfish-actions.pod:2405 ../src/guestfs-actions.pod:3545
10183 "If one operating system was found, then this returns a list with a single "
10184 "element, which is the name of the root filesystem of this operating system. "
10185 "It is also possible for this function to return a list containing more than "
10186 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10187 "element being the root filesystem of one of the operating systems."
10191 #: ../fish/guestfish-actions.pod:2412
10193 "You can pass the root string(s) returned to other L</inspect-get-*> "
10194 "functions in order to query further information about each operating system, "
10195 "such as the name and version."
10199 #: ../fish/guestfish-actions.pod:2417
10201 "This function uses other libguestfs features such as L</mount-ro> and "
10202 "L</umount-all> in order to mount and unmount filesystems and look at the "
10203 "contents. This should be called with no disks currently mounted. The "
10204 "function may also use Augeas, so any existing Augeas handle will be closed."
10208 #: ../fish/guestfish-actions.pod:2423 ../src/guestfs-actions.pod:3563
10210 "This function cannot decrypt encrypted disks. The caller must do that first "
10211 "(supplying the necessary keys) if the disk is encrypted."
10215 #: ../fish/guestfish-actions.pod:2429 ../fish/guestfish-actions.pod:2627 ../fish/guestfish-actions.pod:2686
10216 msgid "See also L</list-filesystems>."
10220 #: ../fish/guestfish-actions.pod:2431
10221 msgid "is-blockdev"
10225 #: ../fish/guestfish-actions.pod:2433
10228 " is-blockdev path\n"
10233 #: ../fish/guestfish-actions.pod:2435 ../src/guestfs-actions.pod:3583
10235 "This returns C<true> if and only if there is a block device with the given "
10240 #: ../fish/guestfish-actions.pod:2438 ../fish/guestfish-actions.pod:2456 ../fish/guestfish-actions.pod:2475 ../fish/guestfish-actions.pod:2484 ../fish/guestfish-actions.pod:2494 ../fish/guestfish-actions.pod:2528 ../fish/guestfish-actions.pod:2537
10241 msgid "See also L</stat>."
10245 #: ../fish/guestfish-actions.pod:2440
10250 #: ../fish/guestfish-actions.pod:2442
10258 #: ../fish/guestfish-actions.pod:2444 ../src/guestfs-actions.pod:3597
10260 "This returns true iff this handle is busy processing a command (in the "
10265 #: ../fish/guestfish-actions.pod:2449
10270 #: ../fish/guestfish-actions.pod:2451
10273 " is-chardev path\n"
10278 #: ../fish/guestfish-actions.pod:2453 ../src/guestfs-actions.pod:3612
10280 "This returns C<true> if and only if there is a character device with the "
10281 "given C<path> name."
10285 #: ../fish/guestfish-actions.pod:2458
10290 #: ../fish/guestfish-actions.pod:2460
10298 #: ../fish/guestfish-actions.pod:2462 ../src/guestfs-actions.pod:3626
10300 "This returns true iff this handle is being configured (in the C<CONFIG> "
10305 #: ../fish/guestfish-actions.pod:2467
10310 #: ../fish/guestfish-actions.pod:2469
10318 #: ../fish/guestfish-actions.pod:2471 ../src/guestfs-actions.pod:3641
10320 "This returns C<true> if and only if there is a directory with the given "
10321 "C<path> name. Note that it returns false for other objects like files."
10325 #: ../fish/guestfish-actions.pod:2477
10330 #: ../fish/guestfish-actions.pod:2479
10338 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3657
10340 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10341 "given C<path> name."
10345 #: ../fish/guestfish-actions.pod:2486
10350 #: ../fish/guestfish-actions.pod:2488
10358 #: ../fish/guestfish-actions.pod:2490 ../src/guestfs-actions.pod:3672
10360 "This returns C<true> if and only if there is a regular file with the given "
10361 "C<path> name. Note that it returns false for other objects like "
10366 #: ../fish/guestfish-actions.pod:2496
10367 msgid "is-launching"
10371 #: ../fish/guestfish-actions.pod:2498
10379 #: ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:3687
10381 "This returns true iff this handle is launching the subprocess (in the "
10382 "C<LAUNCHING> state)."
10386 #: ../fish/guestfish-actions.pod:2505
10391 #: ../fish/guestfish-actions.pod:2507
10399 #: ../fish/guestfish-actions.pod:2509 ../src/guestfs-actions.pod:3702
10401 "This command tests whether C<device> is a logical volume, and returns true "
10402 "iff this is the case."
10406 #: ../fish/guestfish-actions.pod:2512
10411 #: ../fish/guestfish-actions.pod:2514
10419 #: ../fish/guestfish-actions.pod:2516 ../src/guestfs-actions.pod:3714
10421 "This returns true iff this handle is ready to accept commands (in the "
10426 #: ../fish/guestfish-actions.pod:2521
10431 #: ../fish/guestfish-actions.pod:2523
10434 " is-socket path\n"
10439 #: ../fish/guestfish-actions.pod:2525 ../src/guestfs-actions.pod:3729
10441 "This returns C<true> if and only if there is a Unix domain socket with the "
10442 "given C<path> name."
10446 #: ../fish/guestfish-actions.pod:2530
10451 #: ../fish/guestfish-actions.pod:2532
10454 " is-symlink path\n"
10459 #: ../fish/guestfish-actions.pod:2534 ../src/guestfs-actions.pod:3744
10461 "This returns C<true> if and only if there is a symbolic link with the given "
10466 #: ../fish/guestfish-actions.pod:2539
10471 #: ../fish/guestfish-actions.pod:2541
10479 #: ../fish/guestfish-actions.pod:2543 ../src/guestfs-actions.pod:3759
10481 "This returns true iff the file exists and the file is empty or it contains "
10486 #: ../fish/guestfish-actions.pod:2546
10487 msgid "is-zero-device"
10491 #: ../fish/guestfish-actions.pod:2548
10494 " is-zero-device device\n"
10499 #: ../fish/guestfish-actions.pod:2550 ../src/guestfs-actions.pod:3772
10500 msgid "This returns true iff the device exists and contains all zero bytes."
10504 #: ../fish/guestfish-actions.pod:2552 ../src/guestfs-actions.pod:3774
10505 msgid "Note that for large devices this can take a long time to run."
10509 #: ../fish/guestfish-actions.pod:2554
10510 msgid "kill-subprocess"
10514 #: ../fish/guestfish-actions.pod:2556
10517 " kill-subprocess\n"
10522 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3785
10523 msgid "This kills the qemu subprocess. You should never need to call this."
10527 #: ../fish/guestfish-actions.pod:2560
10532 #: ../fish/guestfish-actions.pod:2562
10537 #: ../fish/guestfish-actions.pod:2564
10545 #: ../fish/guestfish-actions.pod:2566 ../src/guestfs-actions.pod:3796
10547 "Internally libguestfs is implemented by running a virtual machine using "
10552 #: ../fish/guestfish-actions.pod:2569 ../src/guestfs-actions.pod:3799
10554 "You should call this after configuring the handle (eg. adding drives) but "
10555 "before performing any actions."
10559 #: ../fish/guestfish-actions.pod:2572
10564 #: ../fish/guestfish-actions.pod:2574
10567 " lchown owner group path\n"
10572 #: ../fish/guestfish-actions.pod:2576
10574 "Change the file owner to C<owner> and group to C<group>. This is like "
10575 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10580 #: ../fish/guestfish-actions.pod:2584
10585 #: ../fish/guestfish-actions.pod:2586
10588 " lgetxattr path name\n"
10593 #: ../fish/guestfish-actions.pod:2588 ../src/guestfs-actions.pod:3839
10595 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10596 "is a symlink, then this call returns an extended attribute from the symlink."
10600 #: ../fish/guestfish-actions.pod:2602
10601 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10605 #: ../fish/guestfish-actions.pod:2604
10610 #: ../fish/guestfish-actions.pod:2606
10613 " lgetxattrs path\n"
10618 #: ../fish/guestfish-actions.pod:2608
10620 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10621 "it returns the extended attributes of the link itself."
10625 #: ../fish/guestfish-actions.pod:2612
10630 #: ../fish/guestfish-actions.pod:2614
10638 #: ../fish/guestfish-actions.pod:2616 ../src/guestfs-actions.pod:3882
10640 "List all 9p filesystems attached to the guest. A list of mount tags is "
10645 #: ../fish/guestfish-actions.pod:2619
10646 msgid "list-devices"
10650 #: ../fish/guestfish-actions.pod:2621
10658 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3896
10659 msgid "List all the block devices."
10663 #: ../fish/guestfish-actions.pod:2625 ../src/guestfs-actions.pod:3898
10664 msgid "The full block device names are returned, eg. C</dev/sda>."
10668 #: ../fish/guestfish-actions.pod:2629
10669 msgid "list-dm-devices"
10673 #: ../fish/guestfish-actions.pod:2631
10676 " list-dm-devices\n"
10681 #: ../fish/guestfish-actions.pod:2633 ../src/guestfs-actions.pod:3913
10682 msgid "List all device mapper devices."
10686 #: ../fish/guestfish-actions.pod:2635
10688 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10689 "previous call to L</luks-open>."
10693 #: ../fish/guestfish-actions.pod:2638
10695 "Device mapper devices which correspond to logical volumes are I<not> "
10696 "returned in this list. Call L</lvs> if you want to list logical volumes."
10700 #: ../fish/guestfish-actions.pod:2642
10701 msgid "list-filesystems"
10705 #: ../fish/guestfish-actions.pod:2644
10708 " list-filesystems\n"
10713 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:3933
10715 "This inspection command looks for filesystems on partitions, block devices "
10716 "and logical volumes, returning a list of devices containing filesystems and "
10721 #: ../fish/guestfish-actions.pod:2650 ../src/guestfs-actions.pod:3937
10723 "The return value is a hash, where the keys are the devices containing "
10724 "filesystems, and the values are the filesystem types. For example:"
10728 #: ../fish/guestfish-actions.pod:2654 ../src/guestfs-actions.pod:3941
10731 " \"/dev/sda1\" => \"ntfs\"\n"
10732 " \"/dev/sda2\" => \"ext2\"\n"
10733 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10734 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10739 #: ../fish/guestfish-actions.pod:2659 ../src/guestfs-actions.pod:3946
10741 "The value can have the special value \"unknown\", meaning the content of the "
10742 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10746 #: ../fish/guestfish-actions.pod:2663
10748 "This command runs other libguestfs commands, which might include L</mount> "
10749 "and L</umount>, and therefore you should use this soon after launch and only "
10750 "when nothing is mounted."
10754 #: ../fish/guestfish-actions.pod:2667
10756 "Not all of the filesystems returned will be mountable. In particular, swap "
10757 "partitions are returned in the list. Also this command does not check that "
10758 "each filesystem found is valid and mountable, and some filesystems might be "
10759 "mountable but require special options. Filesystems may not all belong to a "
10760 "single logical operating system (use L</inspect-os> to look for OSes)."
10764 #: ../fish/guestfish-actions.pod:2675
10765 msgid "list-partitions"
10769 #: ../fish/guestfish-actions.pod:2677
10772 " list-partitions\n"
10777 #: ../fish/guestfish-actions.pod:2679 ../src/guestfs-actions.pod:3975
10778 msgid "List all the partitions detected on all block devices."
10782 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:3977
10783 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10787 #: ../fish/guestfish-actions.pod:2683
10789 "This does not return logical volumes. For that you will need to call "
10794 #: ../fish/guestfish-actions.pod:2688
10799 #: ../fish/guestfish-actions.pod:2690
10807 #: ../fish/guestfish-actions.pod:2692 ../src/guestfs-actions.pod:3996
10809 "List the files in C<directory> (relative to the root directory, there is no "
10810 "cwd) in the format of 'ls -la'."
10814 #: ../fish/guestfish-actions.pod:2695 ../src/guestfs-actions.pod:3999
10816 "This command is mostly useful for interactive sessions. It is I<not> "
10817 "intended that you try to parse the output string."
10821 #: ../fish/guestfish-actions.pod:2698
10826 #: ../fish/guestfish-actions.pod:2700
10829 " ln target linkname\n"
10834 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4014
10835 msgid "This command creates a hard link using the C<ln> command."
10839 #: ../fish/guestfish-actions.pod:2704
10844 #: ../fish/guestfish-actions.pod:2706
10847 " ln-f target linkname\n"
10852 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4027
10854 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10855 "option removes the link (C<linkname>) if it exists already."
10859 #: ../fish/guestfish-actions.pod:2711
10864 #: ../fish/guestfish-actions.pod:2713
10867 " ln-s target linkname\n"
10872 #: ../fish/guestfish-actions.pod:2715 ../src/guestfs-actions.pod:4041
10873 msgid "This command creates a symbolic link using the C<ln -s> command."
10877 #: ../fish/guestfish-actions.pod:2717
10882 #: ../fish/guestfish-actions.pod:2719
10885 " ln-sf target linkname\n"
10890 #: ../fish/guestfish-actions.pod:2721 ../src/guestfs-actions.pod:4054
10892 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
10893 "option removes the link (C<linkname>) if it exists already."
10897 #: ../fish/guestfish-actions.pod:2724
10898 msgid "lremovexattr"
10902 #: ../fish/guestfish-actions.pod:2726
10905 " lremovexattr xattr path\n"
10910 #: ../fish/guestfish-actions.pod:2728
10912 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
10913 "it removes an extended attribute of the link itself."
10917 #: ../fish/guestfish-actions.pod:2732
10922 #: ../fish/guestfish-actions.pod:2734
10930 #: ../fish/guestfish-actions.pod:2736 ../src/guestfs-actions.pod:4082
10932 "List the files in C<directory> (relative to the root directory, there is no "
10933 "cwd). The '.' and '..' entries are not returned, but hidden files are "
10938 #: ../fish/guestfish-actions.pod:2740
10940 "This command is mostly useful for interactive sessions. Programs should "
10941 "probably use L</readdir> instead."
10945 #: ../fish/guestfish-actions.pod:2743
10950 #: ../fish/guestfish-actions.pod:2745
10953 " lsetxattr xattr val vallen path\n"
10958 #: ../fish/guestfish-actions.pod:2747
10960 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
10961 "sets an extended attribute of the link itself."
10965 #: ../fish/guestfish-actions.pod:2751
10970 #: ../fish/guestfish-actions.pod:2753
10978 #: ../fish/guestfish-actions.pod:2755 ../fish/guestfish-actions.pod:4565 ../src/guestfs-actions.pod:4118 ../src/guestfs-actions.pod:6903
10979 msgid "Returns file information for the given C<path>."
10983 #: ../fish/guestfish-actions.pod:2757
10985 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
10986 "the link is stat-ed, not the file it refers to."
10990 #: ../fish/guestfish-actions.pod:2761 ../src/guestfs-actions.pod:4124
10991 msgid "This is the same as the C<lstat(2)> system call."
10995 #: ../fish/guestfish-actions.pod:2763
11000 #: ../fish/guestfish-actions.pod:2765
11003 " lstatlist path 'names ...'\n"
11008 #: ../fish/guestfish-actions.pod:2767
11010 "This call allows you to perform the L</lstat> operation on multiple files, "
11011 "where all files are in the directory C<path>. C<names> is the list of files "
11012 "from this directory."
11016 #: ../fish/guestfish-actions.pod:2771 ../src/guestfs-actions.pod:4143
11018 "On return you get a list of stat structs, with a one-to-one correspondence "
11019 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11020 "then the C<ino> field of that structure is set to C<-1>."
11024 #: ../fish/guestfish-actions.pod:2776
11026 "This call is intended for programs that want to efficiently list a directory "
11027 "contents without making many round-trips. See also L</lxattrlist> for a "
11028 "similarly efficient call for getting extended attributes. Very long "
11029 "directory listings might cause the protocol message size to be exceeded, "
11030 "causing this call to fail. The caller must split up such requests into "
11031 "smaller groups of names."
11035 #: ../fish/guestfish-actions.pod:2784
11036 msgid "luks-add-key"
11040 #: ../fish/guestfish-actions.pod:2786
11043 " luks-add-key device keyslot\n"
11048 #: ../fish/guestfish-actions.pod:2788 ../src/guestfs-actions.pod:4171
11050 "This command adds a new key on LUKS device C<device>. C<key> is any "
11051 "existing key, and is used to access the device. C<newkey> is the new key to "
11052 "add. C<keyslot> is the key slot that will be replaced."
11056 #: ../fish/guestfish-actions.pod:2793
11058 "Note that if C<keyslot> already contains a key, then this command will "
11059 "fail. You have to use L</luks-kill-slot> first to remove that key."
11063 #: ../fish/guestfish-actions.pod:2797 ../fish/guestfish-actions.pod:2819 ../fish/guestfish-actions.pod:2832 ../fish/guestfish-actions.pod:2846 ../fish/guestfish-actions.pod:2872 ../fish/guestfish-actions.pod:2882
11065 "This command has one or more key or passphrase parameters. Guestfish will "
11066 "prompt for these separately."
11070 #: ../fish/guestfish-actions.pod:2800
11075 #: ../fish/guestfish-actions.pod:2802
11078 " luks-close device\n"
11083 #: ../fish/guestfish-actions.pod:2804
11085 "This closes a LUKS device that was created earlier by L</luks-open> or "
11086 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
11087 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11088 "underlying block device."
11092 #: ../fish/guestfish-actions.pod:2810
11093 msgid "luks-format"
11097 #: ../fish/guestfish-actions.pod:2812
11100 " luks-format device keyslot\n"
11105 #: ../fish/guestfish-actions.pod:2814 ../src/guestfs-actions.pod:4212
11107 "This command erases existing data on C<device> and formats the device as a "
11108 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11109 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11113 #: ../fish/guestfish-actions.pod:2822 ../fish/guestfish-actions.pod:2835 ../fish/guestfish-actions.pod:2922 ../fish/guestfish-actions.pod:3573 ../fish/guestfish-actions.pod:4099 ../fish/guestfish-actions.pod:4436 ../fish/guestfish-actions.pod:4459 ../fish/guestfish-actions.pod:4481 ../fish/guestfish-actions.pod:5227 ../src/guestfs-actions.pod:4219 ../src/guestfs-actions.pod:4242 ../src/guestfs-actions.pod:4385 ../src/guestfs-actions.pod:5478 ../src/guestfs-actions.pod:6266 ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:6747 ../src/guestfs-actions.pod:6780 ../src/guestfs-actions.pod:7979
11115 "B<This command is dangerous. Without careful use you can easily destroy all "
11120 #: ../fish/guestfish-actions.pod:2825
11121 msgid "luks-format-cipher"
11125 #: ../fish/guestfish-actions.pod:2827
11128 " luks-format-cipher device keyslot cipher\n"
11133 #: ../fish/guestfish-actions.pod:2829
11135 "This command is the same as L</luks-format> but it also allows you to set "
11136 "the C<cipher> used."
11140 #: ../fish/guestfish-actions.pod:2838
11141 msgid "luks-kill-slot"
11145 #: ../fish/guestfish-actions.pod:2840
11148 " luks-kill-slot device keyslot\n"
11153 #: ../fish/guestfish-actions.pod:2842 ../src/guestfs-actions.pod:4259
11155 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11156 "device C<device>. C<key> must be one of the I<other> keys."
11160 #: ../fish/guestfish-actions.pod:2849
11165 #: ../fish/guestfish-actions.pod:2851
11168 " luks-open device mapname\n"
11173 #: ../fish/guestfish-actions.pod:2853 ../src/guestfs-actions.pod:4279
11175 "This command opens a block device which has been encrypted according to the "
11176 "Linux Unified Key Setup (LUKS) standard."
11180 #: ../fish/guestfish-actions.pod:2856 ../src/guestfs-actions.pod:4282
11181 msgid "C<device> is the encrypted block device or partition."
11185 #: ../fish/guestfish-actions.pod:2858 ../src/guestfs-actions.pod:4284
11187 "The caller must supply one of the keys associated with the LUKS block "
11188 "device, in the C<key> parameter."
11192 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4287
11194 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11195 "writes to this block device are decrypted from and encrypted to the "
11196 "underlying C<device> respectively."
11200 #: ../fish/guestfish-actions.pod:2865
11202 "If this block device contains LVM volume groups, then calling L</vgscan> "
11203 "followed by L</vg-activate-all> will make them visible."
11207 #: ../fish/guestfish-actions.pod:2869
11208 msgid "Use L</list-dm-devices> to list all device mapper devices."
11212 #: ../fish/guestfish-actions.pod:2875
11213 msgid "luks-open-ro"
11217 #: ../fish/guestfish-actions.pod:2877
11220 " luks-open-ro device mapname\n"
11225 #: ../fish/guestfish-actions.pod:2879
11227 "This is the same as L</luks-open> except that a read-only mapping is "
11232 #: ../fish/guestfish-actions.pod:2885
11237 #: ../fish/guestfish-actions.pod:2887
11240 " lvcreate logvol volgroup mbytes\n"
11245 #: ../fish/guestfish-actions.pod:2889 ../src/guestfs-actions.pod:4333
11247 "This creates an LVM logical volume called C<logvol> on the volume group "
11248 "C<volgroup>, with C<size> megabytes."
11252 #: ../fish/guestfish-actions.pod:2892
11253 msgid "lvm-canonical-lv-name"
11257 #: ../fish/guestfish-actions.pod:2894
11260 " lvm-canonical-lv-name lvname\n"
11265 #: ../fish/guestfish-actions.pod:2896 ../src/guestfs-actions.pod:4346
11267 "This converts alternative naming schemes for LVs that you might find to the "
11268 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11273 #: ../fish/guestfish-actions.pod:2900 ../src/guestfs-actions.pod:4350
11275 "This command returns an error if the C<lvname> parameter does not refer to a "
11280 #: ../fish/guestfish-actions.pod:2903
11281 msgid "See also L</is-lv>."
11285 #: ../fish/guestfish-actions.pod:2905
11286 msgid "lvm-clear-filter"
11290 #: ../fish/guestfish-actions.pod:2907
11293 " lvm-clear-filter\n"
11298 #: ../fish/guestfish-actions.pod:2909
11300 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11305 #: ../fish/guestfish-actions.pod:2912 ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4368 ../src/guestfs-actions.pod:4410
11306 msgid "This command also clears the LVM cache and performs a volume group scan."
11310 #: ../fish/guestfish-actions.pod:2915
11311 msgid "lvm-remove-all"
11315 #: ../fish/guestfish-actions.pod:2917
11318 " lvm-remove-all\n"
11323 #: ../fish/guestfish-actions.pod:2919 ../src/guestfs-actions.pod:4380
11325 "This command removes all LVM logical volumes, volume groups and physical "
11330 #: ../fish/guestfish-actions.pod:2925
11331 msgid "lvm-set-filter"
11335 #: ../fish/guestfish-actions.pod:2927
11338 " lvm-set-filter 'devices ...'\n"
11343 #: ../fish/guestfish-actions.pod:2929 ../src/guestfs-actions.pod:4396
11345 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11346 "block devices in the list C<devices>, and will ignore all other attached "
11351 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4400
11353 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11354 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11355 "there are two types of duplication possible: either cloned PVs/VGs which "
11356 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11357 "same name. In normal operation you cannot create this situation, but you "
11358 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11359 "inside the LVM metadata."
11363 #: ../fish/guestfish-actions.pod:2946 ../src/guestfs-actions.pod:4413
11364 msgid "You can filter whole block devices or individual partitions."
11368 #: ../fish/guestfish-actions.pod:2948 ../src/guestfs-actions.pod:4415
11370 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11371 "filesystem), even if you are not filtering out that VG."
11375 #: ../fish/guestfish-actions.pod:2952
11380 #: ../fish/guestfish-actions.pod:2954
11383 " lvremove device\n"
11388 #: ../fish/guestfish-actions.pod:2956 ../src/guestfs-actions.pod:4429
11390 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11391 "LV, such as C</dev/VG/LV>."
11395 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4432
11397 "You can also remove all LVs in a volume group by specifying the VG name, "
11402 #: ../fish/guestfish-actions.pod:2962
11407 #: ../fish/guestfish-actions.pod:2964
11410 " lvrename logvol newlogvol\n"
11415 #: ../fish/guestfish-actions.pod:2966 ../src/guestfs-actions.pod:4446
11416 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11420 #: ../fish/guestfish-actions.pod:2968
11425 #: ../fish/guestfish-actions.pod:2970
11428 " lvresize device mbytes\n"
11433 #: ../fish/guestfish-actions.pod:2972 ../src/guestfs-actions.pod:4459
11435 "This resizes (expands or shrinks) an existing LVM logical volume to "
11436 "C<mbytes>. When reducing, data in the reduced part is lost."
11440 #: ../fish/guestfish-actions.pod:2976
11441 msgid "lvresize-free"
11445 #: ../fish/guestfish-actions.pod:2978
11448 " lvresize-free lv percent\n"
11453 #: ../fish/guestfish-actions.pod:2980 ../src/guestfs-actions.pod:4474
11455 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11456 "remaining free space in the volume group. Commonly you would call this with "
11457 "pc = 100 which expands the logical volume as much as possible, using all "
11458 "remaining free space in the volume group."
11462 #: ../fish/guestfish-actions.pod:2986
11467 #: ../fish/guestfish-actions.pod:2988
11475 #: ../fish/guestfish-actions.pod:2990 ../src/guestfs-actions.pod:4489
11477 "List all the logical volumes detected. This is the equivalent of the "
11478 "L<lvs(8)> command."
11482 #: ../fish/guestfish-actions.pod:2993 ../src/guestfs-actions.pod:4492
11484 "This returns a list of the logical volume device names "
11485 "(eg. C</dev/VolGroup00/LogVol00>)."
11489 #: ../fish/guestfish-actions.pod:2996
11490 msgid "See also L</lvs-full>, L</list-filesystems>."
11494 #: ../fish/guestfish-actions.pod:2998
11499 #: ../fish/guestfish-actions.pod:3000
11507 #: ../fish/guestfish-actions.pod:3002 ../src/guestfs-actions.pod:4508
11509 "List all the logical volumes detected. This is the equivalent of the "
11510 "L<lvs(8)> command. The \"full\" version includes all fields."
11514 #: ../fish/guestfish-actions.pod:3005
11519 #: ../fish/guestfish-actions.pod:3007
11527 #: ../fish/guestfish-actions.pod:3009 ../src/guestfs-actions.pod:4523
11528 msgid "This command returns the UUID of the LVM LV C<device>."
11532 #: ../fish/guestfish-actions.pod:3011
11537 #: ../fish/guestfish-actions.pod:3013
11540 " lxattrlist path 'names ...'\n"
11545 #: ../fish/guestfish-actions.pod:3015 ../src/guestfs-actions.pod:4537
11547 "This call allows you to get the extended attributes of multiple files, where "
11548 "all files are in the directory C<path>. C<names> is the list of files from "
11553 #: ../fish/guestfish-actions.pod:3019 ../src/guestfs-actions.pod:4541
11555 "On return you get a flat list of xattr structs which must be interpreted "
11556 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11557 "C<attrval> in this struct is zero-length to indicate there was an error "
11558 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11559 "number (the number of following attributes for this file, which could be "
11560 "C<\"0\">). Then after the first xattr struct are the zero or more "
11561 "attributes for the first named file. This repeats for the second and "
11562 "subsequent files."
11566 #: ../fish/guestfish-actions.pod:3029
11568 "This call is intended for programs that want to efficiently list a directory "
11569 "contents without making many round-trips. See also L</lstatlist> for a "
11570 "similarly efficient call for getting standard stats. Very long directory "
11571 "listings might cause the protocol message size to be exceeded, causing this "
11572 "call to fail. The caller must split up such requests into smaller groups of "
11577 #: ../fish/guestfish-actions.pod:3037
11582 #: ../fish/guestfish-actions.pod:3039
11590 #: ../fish/guestfish-actions.pod:3041 ../src/guestfs-actions.pod:4571
11591 msgid "Create a directory named C<path>."
11595 #: ../fish/guestfish-actions.pod:3043
11600 #: ../fish/guestfish-actions.pod:3045
11603 " mkdir-mode path mode\n"
11608 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4584
11610 "This command creates a directory, setting the initial permissions of the "
11611 "directory to C<mode>."
11615 #: ../fish/guestfish-actions.pod:3050 ../src/guestfs-actions.pod:4587
11617 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11618 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11623 #: ../fish/guestfish-actions.pod:3054
11624 msgid "See also L</mkdir>, L</umask>"
11628 #: ../fish/guestfish-actions.pod:3056
11633 #: ../fish/guestfish-actions.pod:3058
11641 #: ../fish/guestfish-actions.pod:3060 ../src/guestfs-actions.pod:4603
11643 "Create a directory named C<path>, creating any parent directories as "
11644 "necessary. This is like the C<mkdir -p> shell command."
11648 #: ../fish/guestfish-actions.pod:3063
11653 #: ../fish/guestfish-actions.pod:3065
11656 " mkdtemp template\n"
11661 #: ../fish/guestfish-actions.pod:3067 ../src/guestfs-actions.pod:4616
11663 "This command creates a temporary directory. The C<template> parameter "
11664 "should be a full pathname for the temporary directory name with the final "
11665 "six characters being \"XXXXXX\"."
11669 #: ../fish/guestfish-actions.pod:3072 ../src/guestfs-actions.pod:4621
11671 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11672 "being suitable for Windows filesystems."
11676 #: ../fish/guestfish-actions.pod:3075 ../src/guestfs-actions.pod:4624
11677 msgid "The name of the temporary directory that was created is returned."
11681 #: ../fish/guestfish-actions.pod:3078 ../src/guestfs-actions.pod:4627
11682 msgid "The temporary directory is created with mode 0700 and is owned by root."
11686 #: ../fish/guestfish-actions.pod:3081 ../src/guestfs-actions.pod:4630
11688 "The caller is responsible for deleting the temporary directory and its "
11689 "contents after use."
11693 #: ../fish/guestfish-actions.pod:3084 ../src/guestfs-actions.pod:4633
11694 msgid "See also: L<mkdtemp(3)>"
11698 #: ../fish/guestfish-actions.pod:3086
11703 #: ../fish/guestfish-actions.pod:3088
11706 " mke2fs-J fstype blocksize device journal\n"
11711 #: ../fish/guestfish-actions.pod:3090 ../src/guestfs-actions.pod:4649
11713 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11714 "C<journal>. It is equivalent to the command:"
11718 #: ../fish/guestfish-actions.pod:3094 ../src/guestfs-actions.pod:4653
11721 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11726 #: ../fish/guestfish-actions.pod:3096
11727 msgid "See also L</mke2journal>."
11731 #: ../fish/guestfish-actions.pod:3098
11736 #: ../fish/guestfish-actions.pod:3100
11739 " mke2fs-JL fstype blocksize device label\n"
11744 #: ../fish/guestfish-actions.pod:3102 ../src/guestfs-actions.pod:4670
11746 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11747 "the journal labeled C<label>."
11751 #: ../fish/guestfish-actions.pod:3105
11752 msgid "See also L</mke2journal-L>."
11756 #: ../fish/guestfish-actions.pod:3107
11761 #: ../fish/guestfish-actions.pod:3109
11764 " mke2fs-JU fstype blocksize device uuid\n"
11769 #: ../fish/guestfish-actions.pod:3111 ../src/guestfs-actions.pod:4688
11771 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11772 "the journal with UUID C<uuid>."
11776 #: ../fish/guestfish-actions.pod:3114
11777 msgid "See also L</mke2journal-U>."
11781 #: ../fish/guestfish-actions.pod:3116
11782 msgid "mke2journal"
11786 #: ../fish/guestfish-actions.pod:3118
11789 " mke2journal blocksize device\n"
11794 #: ../fish/guestfish-actions.pod:3120 ../src/guestfs-actions.pod:4704
11796 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11801 #: ../fish/guestfish-actions.pod:3123 ../src/guestfs-actions.pod:4707
11804 " mke2fs -O journal_dev -b blocksize device\n"
11809 #: ../fish/guestfish-actions.pod:3125
11810 msgid "mke2journal-L"
11814 #: ../fish/guestfish-actions.pod:3127
11817 " mke2journal-L blocksize label device\n"
11822 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4721
11823 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11827 #: ../fish/guestfish-actions.pod:3131
11828 msgid "mke2journal-U"
11832 #: ../fish/guestfish-actions.pod:3133
11835 " mke2journal-U blocksize uuid device\n"
11840 #: ../fish/guestfish-actions.pod:3135 ../src/guestfs-actions.pod:4735
11841 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11845 #: ../fish/guestfish-actions.pod:3137
11850 #: ../fish/guestfish-actions.pod:3139
11853 " mkfifo mode path\n"
11858 #: ../fish/guestfish-actions.pod:3141
11860 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11861 "is just a convenient wrapper around L</mknod>."
11865 #: ../fish/guestfish-actions.pod:3147
11870 #: ../fish/guestfish-actions.pod:3149
11873 " mkfs fstype device\n"
11878 #: ../fish/guestfish-actions.pod:3151 ../src/guestfs-actions.pod:4765
11880 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11881 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11885 #: ../fish/guestfish-actions.pod:3155
11890 #: ../fish/guestfish-actions.pod:3157
11893 " mkfs-b fstype blocksize device\n"
11898 #: ../fish/guestfish-actions.pod:3159
11900 "This call is similar to L</mkfs>, but it allows you to control the block "
11901 "size of the resulting filesystem. Supported block sizes depend on the "
11902 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11906 #: ../fish/guestfish-actions.pod:3164 ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4793 ../src/guestfs-actions.pod:4831
11908 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11913 #: ../fish/guestfish-actions.pod:3167
11915 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
11920 #: ../fish/guestfish-actions.pod:3174
11925 #: ../fish/guestfish-actions.pod:3176
11928 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
11929 "[sectorsize:..]\n"
11934 #: ../fish/guestfish-actions.pod:3178 ../src/guestfs-actions.pod:4818
11936 "This function creates a filesystem on C<device>. The filesystem type is "
11937 "C<fstype>, for example C<ext3>."
11941 #: ../fish/guestfish-actions.pod:3185 ../src/guestfs-actions.pod:4825
11942 msgid "C<blocksize>"
11946 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4827
11948 "The filesystem block size. Supported block sizes depend on the filesystem "
11949 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11954 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4834
11955 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
11959 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4836
11960 msgid "C<features>"
11964 #: ../fish/guestfish-actions.pod:3198 ../src/guestfs-actions.pod:4838
11965 msgid "This passes the I<-O> parameter to the external mkfs program."
11969 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4840
11971 "For certain filesystem types, this allows extra filesystem features to be "
11972 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
11976 #: ../fish/guestfish-actions.pod:3204 ../src/guestfs-actions.pod:4844
11978 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
11983 #: ../fish/guestfish-actions.pod:3207 ../src/guestfs-actions.pod:4847
11988 #: ../fish/guestfish-actions.pod:3209 ../src/guestfs-actions.pod:4849
11990 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
11991 "sets the inode size (only for ext2/3/4 filesystems at present)."
11995 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4852
11996 msgid "C<sectorsize>"
12000 #: ../fish/guestfish-actions.pod:3214 ../src/guestfs-actions.pod:4854
12002 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12003 "sets sector size for ufs filesystem."
12007 #: ../fish/guestfish-actions.pod:3221
12008 msgid "mkmountpoint"
12012 #: ../fish/guestfish-actions.pod:3223
12015 " mkmountpoint exemptpath\n"
12020 #: ../fish/guestfish-actions.pod:3225
12022 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12023 "to create extra mountpoints before mounting the first filesystem."
12027 #: ../fish/guestfish-actions.pod:3229 ../src/guestfs-actions.pod:4897
12029 "These calls are I<only> necessary in some very limited circumstances, mainly "
12030 "the case where you want to mount a mix of unrelated and/or read-only "
12031 "filesystems together."
12035 #: ../fish/guestfish-actions.pod:3233 ../src/guestfs-actions.pod:4901
12037 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12038 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12039 "inside that. You can unpack this as follows in guestfish:"
12043 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4906
12046 " add-ro Fedora-11-i686-Live.iso\n"
12048 " mkmountpoint /cd\n"
12049 " mkmountpoint /sqsh\n"
12050 " mkmountpoint /ext3fs\n"
12051 " mount /dev/sda /cd\n"
12052 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12053 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12058 #: ../fish/guestfish-actions.pod:3247 ../src/guestfs-actions.pod:4915
12059 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12063 #: ../fish/guestfish-actions.pod:3249
12065 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12066 "unexpected errors if you try to mix these calls. It is safest to manually "
12067 "unmount filesystems and remove mountpoints after use."
12071 #: ../fish/guestfish-actions.pod:3253
12073 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12074 "for this to work for manual mountpoints, you must ensure that the innermost "
12075 "mountpoints have the longest pathnames, as in the example code above."
12079 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:4926
12080 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12084 #: ../fish/guestfish-actions.pod:3260
12086 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12087 "L</umount-all> to be called when the handle is closed which can also trigger "
12092 #: ../fish/guestfish-actions.pod:3264
12097 #: ../fish/guestfish-actions.pod:3266
12100 " mknod mode devmajor devminor path\n"
12105 #: ../fish/guestfish-actions.pod:3268 ../src/guestfs-actions.pod:4945
12107 "This call creates block or character special devices, or named pipes "
12112 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:4948
12114 "The C<mode> parameter should be the mode, using the standard constants. "
12115 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12116 "used when creating block and character special devices."
12120 #: ../fish/guestfish-actions.pod:3276
12122 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12123 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12124 "regular file). These constants are available in the standard Linux header "
12125 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12126 "wrappers around this command which bitwise OR in the appropriate constant "
12131 #: ../fish/guestfish-actions.pod:3286
12136 #: ../fish/guestfish-actions.pod:3288
12139 " mknod-b mode devmajor devminor path\n"
12144 #: ../fish/guestfish-actions.pod:3290
12146 "This call creates a block device node called C<path> with mode C<mode> and "
12147 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12148 "wrapper around L</mknod>."
12152 #: ../fish/guestfish-actions.pod:3296
12157 #: ../fish/guestfish-actions.pod:3298
12160 " mknod-c mode devmajor devminor path\n"
12165 #: ../fish/guestfish-actions.pod:3300
12167 "This call creates a char device node called C<path> with mode C<mode> and "
12168 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12169 "wrapper around L</mknod>."
12173 #: ../fish/guestfish-actions.pod:3306
12178 #: ../fish/guestfish-actions.pod:3308
12186 #: ../fish/guestfish-actions.pod:3310 ../src/guestfs-actions.pod:5011
12187 msgid "Create a swap partition on C<device>."
12191 #: ../fish/guestfish-actions.pod:3312
12196 #: ../fish/guestfish-actions.pod:3314
12199 " mkswap-L label device\n"
12204 #: ../fish/guestfish-actions.pod:3316 ../src/guestfs-actions.pod:5024
12205 msgid "Create a swap partition on C<device> with label C<label>."
12209 #: ../fish/guestfish-actions.pod:3318 ../src/guestfs-actions.pod:5026
12211 "Note that you cannot attach a swap label to a block device "
12212 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12213 "the kernel or swap tools."
12217 #: ../fish/guestfish-actions.pod:3322
12222 #: ../fish/guestfish-actions.pod:3324
12225 " mkswap-U uuid device\n"
12230 #: ../fish/guestfish-actions.pod:3326 ../src/guestfs-actions.pod:5041
12231 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12235 #: ../fish/guestfish-actions.pod:3328
12236 msgid "mkswap-file"
12240 #: ../fish/guestfish-actions.pod:3330
12243 " mkswap-file path\n"
12248 #: ../fish/guestfish-actions.pod:3332 ../src/guestfs-actions.pod:5053
12249 msgid "Create a swap file."
12253 #: ../fish/guestfish-actions.pod:3334
12255 "This command just writes a swap file signature to an existing file. To "
12256 "create the file itself, use something like L</fallocate>."
12260 #: ../fish/guestfish-actions.pod:3337
12265 #: ../fish/guestfish-actions.pod:3339
12268 " modprobe modulename\n"
12273 #: ../fish/guestfish-actions.pod:3341 ../src/guestfs-actions.pod:5068
12274 msgid "This loads a kernel module in the appliance."
12278 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5070
12280 "The kernel module must have been whitelisted when libguestfs was built (see "
12281 "C<appliance/kmod.whitelist.in> in the source)."
12285 #: ../fish/guestfish-actions.pod:3346
12290 #: ../fish/guestfish-actions.pod:3348
12293 " mount device mountpoint\n"
12298 #: ../fish/guestfish-actions.pod:3350 ../src/guestfs-actions.pod:5084
12300 "Mount a guest disk at a position in the filesystem. Block devices are named "
12301 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12302 "those block devices contain partitions, they will have the usual names "
12303 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12307 #: ../fish/guestfish-actions.pod:3356 ../src/guestfs-actions.pod:5090
12309 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12310 "mounted on C</> before others can be mounted. Other filesystems can only be "
12311 "mounted on directories which already exist."
12315 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5095
12317 "The mounted filesystem is writable, if we have sufficient permissions on the "
12318 "underlying device."
12322 #: ../fish/guestfish-actions.pod:3364
12324 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12325 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12326 "problems for users. If your program might need to work with older versions "
12327 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12328 "first parameter if you don't want any options)."
12332 #: ../fish/guestfish-actions.pod:3371
12337 #: ../fish/guestfish-actions.pod:3373
12340 " mount-9p mounttag mountpoint [options:..]\n"
12345 #: ../fish/guestfish-actions.pod:3375 ../src/guestfs-actions.pod:5124
12347 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12352 #: ../fish/guestfish-actions.pod:3378 ../src/guestfs-actions.pod:5127
12354 "If required, C<trans=virtio> will be automatically added to the options. "
12355 "Any other options required can be passed in the optional C<options> "
12360 #: ../fish/guestfish-actions.pod:3384
12365 #: ../fish/guestfish-actions.pod:3386
12368 " mount-loop file mountpoint\n"
12373 #: ../fish/guestfish-actions.pod:3388 ../src/guestfs-actions.pod:5166
12375 "This command lets you mount C<file> (a filesystem image in a file) on a "
12376 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12381 #: ../fish/guestfish-actions.pod:3392
12382 msgid "mount-options"
12386 #: ../fish/guestfish-actions.pod:3394
12389 " mount-options options device mountpoint\n"
12394 #: ../fish/guestfish-actions.pod:3396
12396 "This is the same as the L</mount> command, but it allows you to set the "
12397 "mount options as for the L<mount(8)> I<-o> flag."
12401 #: ../fish/guestfish-actions.pod:3400 ../src/guestfs-actions.pod:5186
12403 "If the C<options> parameter is an empty string, then no options are passed "
12404 "(all options default to whatever the filesystem uses)."
12408 #: ../fish/guestfish-actions.pod:3404
12413 #: ../fish/guestfish-actions.pod:3406
12416 " mount-ro device mountpoint\n"
12421 #: ../fish/guestfish-actions.pod:3408
12423 "This is the same as the L</mount> command, but it mounts the filesystem with "
12424 "the read-only (I<-o ro>) flag."
12428 #: ../fish/guestfish-actions.pod:3411
12433 #: ../fish/guestfish-actions.pod:3413
12436 " mount-vfs options vfstype device mountpoint\n"
12441 #: ../fish/guestfish-actions.pod:3415
12443 "This is the same as the L</mount> command, but it allows you to set both the "
12444 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12448 #: ../fish/guestfish-actions.pod:3419
12449 msgid "mountpoints"
12453 #: ../fish/guestfish-actions.pod:3421
12461 #: ../fish/guestfish-actions.pod:3423
12463 "This call is similar to L</mounts>. That call returns a list of devices. "
12464 "This one returns a hash table (map) of device name to directory where the "
12465 "device is mounted."
12469 #: ../fish/guestfish-actions.pod:3427
12474 #: ../fish/guestfish-actions.pod:3429
12482 #: ../fish/guestfish-actions.pod:3431 ../src/guestfs-actions.pod:5247
12484 "This returns the list of currently mounted filesystems. It returns the list "
12485 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12489 #: ../fish/guestfish-actions.pod:3434 ../src/guestfs-actions.pod:5250
12490 msgid "Some internal mounts are not shown."
12494 #: ../fish/guestfish-actions.pod:3436
12495 msgid "See also: L</mountpoints>"
12499 #: ../fish/guestfish-actions.pod:3438
12504 #: ../fish/guestfish-actions.pod:3440
12512 #: ../fish/guestfish-actions.pod:3442 ../src/guestfs-actions.pod:5267
12514 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12515 "destination filename or destination directory."
12519 #: ../fish/guestfish-actions.pod:3445
12520 msgid "ntfs-3g-probe"
12524 #: ../fish/guestfish-actions.pod:3447
12527 " ntfs-3g-probe true|false device\n"
12532 #: ../fish/guestfish-actions.pod:3449 ../src/guestfs-actions.pod:5281
12534 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12535 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12536 "read-write, and some cannot be mounted at all)."
12540 #: ../fish/guestfish-actions.pod:3453 ../src/guestfs-actions.pod:5285
12542 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12543 "can be mounted read-write. Set it to false if you want to test if the "
12544 "volume can be mounted read-only."
12548 #: ../fish/guestfish-actions.pod:3457 ../src/guestfs-actions.pod:5289
12550 "The return value is an integer which C<0> if the operation would succeed, or "
12551 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12555 #: ../fish/guestfish-actions.pod:3461
12560 #: ../fish/guestfish-actions.pod:3463
12563 " ntfsresize device\n"
12568 #: ../fish/guestfish-actions.pod:3465 ../fish/guestfish-actions.pod:3489 ../src/guestfs-actions.pod:5310 ../src/guestfs-actions.pod:5342
12570 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12571 "size of the underlying device."
12575 #: ../fish/guestfish-actions.pod:3468 ../src/guestfs-actions.pod:5313
12577 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12578 "consistency check (for safety). You have to boot into Windows to perform "
12579 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12580 "resize filesystems which have been marked in this way. So in effect it is "
12581 "not possible to call ntfsresize multiple times on a single filesystem "
12582 "without booting into Windows between each resize."
12586 #: ../fish/guestfish-actions.pod:3476 ../fish/guestfish-actions.pod:3515 ../src/guestfs-actions.pod:5321 ../src/guestfs-actions.pod:5368
12587 msgid "See also L<ntfsresize(8)>."
12591 #: ../fish/guestfish-actions.pod:3478 ../fish/guestfish-actions.pod:3526
12593 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12598 #: ../fish/guestfish-actions.pod:3485
12599 msgid "ntfsresize-opts"
12603 #: ../fish/guestfish-actions.pod:3487
12606 " ntfsresize-opts device [size:..] [force:..]\n"
12611 #: ../fish/guestfish-actions.pod:3498 ../src/guestfs-actions.pod:5351
12613 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12614 "resized to fit the container (eg. partition)."
12618 #: ../fish/guestfish-actions.pod:3501 ../src/guestfs-actions.pod:5354
12623 #: ../fish/guestfish-actions.pod:3503 ../src/guestfs-actions.pod:5356
12625 "If this option is true, then force the resize of the filesystem even if the "
12626 "filesystem is marked as requiring a consistency check."
12630 #: ../fish/guestfish-actions.pod:3506
12632 "After the resize operation, the filesystem is always marked as requiring a "
12633 "consistency check (for safety). You have to boot into Windows to perform "
12634 "this check and clear this condition. If you I<don't> set the C<force> "
12635 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12636 "a single filesystem without booting into Windows between each resize."
12640 #: ../fish/guestfish-actions.pod:3519
12641 msgid "ntfsresize-size"
12645 #: ../fish/guestfish-actions.pod:3521
12648 " ntfsresize-size device size\n"
12653 #: ../fish/guestfish-actions.pod:3523
12655 "This command is the same as L</ntfsresize> except that it allows you to "
12656 "specify the new size (in bytes) explicitly."
12660 #: ../fish/guestfish-actions.pod:3533
12665 #: ../fish/guestfish-actions.pod:3535
12668 " part-add device prlogex startsect endsect\n"
12673 #: ../fish/guestfish-actions.pod:3537
12675 "This command adds a partition to C<device>. If there is no partition table "
12676 "on the device, call L</part-init> first."
12680 #: ../fish/guestfish-actions.pod:3540 ../src/guestfs-actions.pod:5429
12682 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12683 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12684 "C<logical>) and C<e> (or C<extended>) partition types."
12688 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5434
12690 "C<startsect> and C<endsect> are the start and end of the partition in "
12691 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12692 "from the end of the disk (C<-1> is the last sector)."
12696 #: ../fish/guestfish-actions.pod:3549
12698 "Creating a partition which covers the whole disk is not so easy. Use "
12699 "L</part-disk> to do that."
12703 #: ../fish/guestfish-actions.pod:3552
12708 #: ../fish/guestfish-actions.pod:3554
12711 " part-del device partnum\n"
12716 #: ../fish/guestfish-actions.pod:3556 ../src/guestfs-actions.pod:5452
12717 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12721 #: ../fish/guestfish-actions.pod:3558 ../src/guestfs-actions.pod:5454
12723 "Note that in the case of MBR partitioning, deleting an extended partition "
12724 "also deletes any logical partitions it contains."
12728 #: ../fish/guestfish-actions.pod:3562
12733 #: ../fish/guestfish-actions.pod:3564
12736 " part-disk device parttype\n"
12741 #: ../fish/guestfish-actions.pod:3566
12743 "This command is simply a combination of L</part-init> followed by "
12744 "L</part-add> to create a single primary partition covering the whole disk."
12748 #: ../fish/guestfish-actions.pod:3570
12750 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12751 "possible values are described in L</part-init>."
12755 #: ../fish/guestfish-actions.pod:3576
12756 msgid "part-get-bootable"
12760 #: ../fish/guestfish-actions.pod:3578
12763 " part-get-bootable device partnum\n"
12768 #: ../fish/guestfish-actions.pod:3580 ../src/guestfs-actions.pod:5490
12770 "This command returns true if the partition C<partnum> on C<device> has the "
12771 "bootable flag set."
12775 #: ../fish/guestfish-actions.pod:3583
12776 msgid "See also L</part-set-bootable>."
12780 #: ../fish/guestfish-actions.pod:3585
12781 msgid "part-get-mbr-id"
12785 #: ../fish/guestfish-actions.pod:3587
12788 " part-get-mbr-id device partnum\n"
12793 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5506
12795 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12796 "partition C<partnum>."
12800 #: ../fish/guestfish-actions.pod:3592 ../fish/guestfish-actions.pod:3736
12802 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12803 "undefined results for other partition table types (see "
12804 "L</part-get-parttype>)."
12808 #: ../fish/guestfish-actions.pod:3596
12809 msgid "part-get-parttype"
12813 #: ../fish/guestfish-actions.pod:3598
12816 " part-get-parttype device\n"
12821 #: ../fish/guestfish-actions.pod:3600 ../src/guestfs-actions.pod:5523
12823 "This command examines the partition table on C<device> and returns the "
12824 "partition table type (format) being used."
12828 #: ../fish/guestfish-actions.pod:3603
12830 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12831 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12832 "possible, although unusual. See L</part-init> for a full list."
12836 #: ../fish/guestfish-actions.pod:3608
12841 #: ../fish/guestfish-actions.pod:3610
12844 " part-init device parttype\n"
12849 #: ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5543
12851 "This creates an empty partition table on C<device> of one of the partition "
12852 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12853 "(for large disks)."
12857 #: ../fish/guestfish-actions.pod:3616
12859 "Initially there are no partitions. Following this, you should call "
12860 "L</part-add> for each partition required."
12864 #: ../fish/guestfish-actions.pod:3619 ../src/guestfs-actions.pod:5550
12865 msgid "Possible values for C<parttype> are:"
12869 #: ../fish/guestfish-actions.pod:3623 ../src/guestfs-actions.pod:5554
12874 #: ../fish/guestfish-actions.pod:3625 ../src/guestfs-actions.pod:5556
12879 #: ../fish/guestfish-actions.pod:3627 ../src/guestfs-actions.pod:5558
12880 msgid "Intel EFI / GPT partition table."
12884 #: ../fish/guestfish-actions.pod:3629 ../src/guestfs-actions.pod:5560
12886 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12887 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12888 "the C<mbr> format."
12892 #: ../fish/guestfish-actions.pod:3633 ../src/guestfs-actions.pod:5564
12897 #: ../fish/guestfish-actions.pod:3635 ../src/guestfs-actions.pod:5566
12902 #: ../fish/guestfish-actions.pod:3637 ../src/guestfs-actions.pod:5568
12904 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12905 "Windows. This partition type will B<only> work for device sizes up to 2 "
12906 "TB. For large disks we recommend using C<gpt>."
12910 #: ../fish/guestfish-actions.pod:3644 ../src/guestfs-actions.pod:5575
12911 msgid "Other partition table types that may work but are not supported include:"
12915 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5580
12920 #: ../fish/guestfish-actions.pod:3651 ../src/guestfs-actions.pod:5582
12921 msgid "AIX disk labels."
12925 #: ../fish/guestfish-actions.pod:3653 ../src/guestfs-actions.pod:5584
12930 #: ../fish/guestfish-actions.pod:3655 ../src/guestfs-actions.pod:5586
12935 #: ../fish/guestfish-actions.pod:3657 ../src/guestfs-actions.pod:5588
12936 msgid "Amiga \"Rigid Disk Block\" format."
12940 #: ../fish/guestfish-actions.pod:3659 ../src/guestfs-actions.pod:5590
12945 #: ../fish/guestfish-actions.pod:3661 ../src/guestfs-actions.pod:5592
12946 msgid "BSD disk labels."
12950 #: ../fish/guestfish-actions.pod:3663 ../src/guestfs-actions.pod:5594
12955 #: ../fish/guestfish-actions.pod:3665 ../src/guestfs-actions.pod:5596
12956 msgid "DASD, used on IBM mainframes."
12960 #: ../fish/guestfish-actions.pod:3667 ../src/guestfs-actions.pod:5598
12965 #: ../fish/guestfish-actions.pod:3669 ../src/guestfs-actions.pod:5600
12966 msgid "MIPS/SGI volumes."
12970 #: ../fish/guestfish-actions.pod:3671 ../src/guestfs-actions.pod:5602
12975 #: ../fish/guestfish-actions.pod:3673 ../src/guestfs-actions.pod:5604
12976 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12980 #: ../fish/guestfish-actions.pod:3675 ../src/guestfs-actions.pod:5606
12985 #: ../fish/guestfish-actions.pod:3677 ../src/guestfs-actions.pod:5608
12986 msgid "NEC PC-98 format, common in Japan apparently."
12990 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5610
12995 #: ../fish/guestfish-actions.pod:3681 ../src/guestfs-actions.pod:5612
12996 msgid "Sun disk labels."
13000 #: ../fish/guestfish-actions.pod:3685
13005 #: ../fish/guestfish-actions.pod:3687
13008 " part-list device\n"
13013 #: ../fish/guestfish-actions.pod:3689 ../src/guestfs-actions.pod:5626
13015 "This command parses the partition table on C<device> and returns the list of "
13016 "partitions found."
13020 #: ../fish/guestfish-actions.pod:3692 ../src/guestfs-actions.pod:5629
13021 msgid "The fields in the returned structure are:"
13025 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5633
13026 msgid "B<part_num>"
13030 #: ../fish/guestfish-actions.pod:3698 ../src/guestfs-actions.pod:5635
13031 msgid "Partition number, counting from 1."
13035 #: ../fish/guestfish-actions.pod:3700 ../src/guestfs-actions.pod:5637
13036 msgid "B<part_start>"
13040 #: ../fish/guestfish-actions.pod:3702
13042 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13043 "the device's sector size, see L</blockdev-getss>."
13047 #: ../fish/guestfish-actions.pod:3705 ../src/guestfs-actions.pod:5642
13048 msgid "B<part_end>"
13052 #: ../fish/guestfish-actions.pod:3707 ../src/guestfs-actions.pod:5644
13053 msgid "End of the partition in bytes."
13057 #: ../fish/guestfish-actions.pod:3709 ../src/guestfs-actions.pod:5646
13058 msgid "B<part_size>"
13062 #: ../fish/guestfish-actions.pod:3711 ../src/guestfs-actions.pod:5648
13063 msgid "Size of the partition in bytes."
13067 #: ../fish/guestfish-actions.pod:3715
13068 msgid "part-set-bootable"
13072 #: ../fish/guestfish-actions.pod:3717
13075 " part-set-bootable device partnum true|false\n"
13080 #: ../fish/guestfish-actions.pod:3719 ../src/guestfs-actions.pod:5666
13082 "This sets the bootable flag on partition numbered C<partnum> on device "
13083 "C<device>. Note that partitions are numbered from 1."
13087 #: ../fish/guestfish-actions.pod:3722 ../src/guestfs-actions.pod:5669
13089 "The bootable flag is used by some operating systems (notably Windows) to "
13090 "determine which partition to boot from. It is by no means universally "
13095 #: ../fish/guestfish-actions.pod:3726
13096 msgid "part-set-mbr-id"
13100 #: ../fish/guestfish-actions.pod:3728
13103 " part-set-mbr-id device partnum idbyte\n"
13108 #: ../fish/guestfish-actions.pod:3730 ../src/guestfs-actions.pod:5685
13110 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13111 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13112 "documentation are in fact hexadecimal numbers, but usually documented "
13113 "without any leading \"0x\" which might be confusing."
13117 #: ../fish/guestfish-actions.pod:3740
13118 msgid "part-set-name"
13122 #: ../fish/guestfish-actions.pod:3742
13125 " part-set-name device partnum name\n"
13130 #: ../fish/guestfish-actions.pod:3744 ../src/guestfs-actions.pod:5707
13132 "This sets the partition name on partition numbered C<partnum> on device "
13133 "C<device>. Note that partitions are numbered from 1."
13137 #: ../fish/guestfish-actions.pod:3747 ../src/guestfs-actions.pod:5710
13139 "The partition name can only be set on certain types of partition table. "
13140 "This works on C<gpt> but not on C<mbr> partitions."
13144 #: ../fish/guestfish-actions.pod:3750
13145 msgid "part-to-dev"
13149 #: ../fish/guestfish-actions.pod:3752
13152 " part-to-dev partition\n"
13157 #: ../fish/guestfish-actions.pod:3754 ../src/guestfs-actions.pod:5723
13159 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13160 "partition number, returning the device name (eg. \"/dev/sdb\")."
13164 #: ../fish/guestfish-actions.pod:3758
13166 "The named partition must exist, for example as a string returned from "
13167 "L</list-partitions>."
13171 #: ../fish/guestfish-actions.pod:3761
13172 msgid "ping-daemon"
13176 #: ../fish/guestfish-actions.pod:3763
13184 #: ../fish/guestfish-actions.pod:3765 ../src/guestfs-actions.pod:5740
13186 "This is a test probe into the guestfs daemon running inside the qemu "
13187 "subprocess. Calling this function checks that the daemon responds to the "
13188 "ping message, without affecting the daemon or attached block device(s) in "
13193 #: ../fish/guestfish-actions.pod:3770
13198 #: ../fish/guestfish-actions.pod:3772
13201 " pread path count offset\n"
13206 #: ../fish/guestfish-actions.pod:3774 ../src/guestfs-actions.pod:5758
13208 "This command lets you read part of a file. It reads C<count> bytes of the "
13209 "file, starting at C<offset>, from file C<path>."
13213 #: ../fish/guestfish-actions.pod:3777 ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:5787
13215 "This may read fewer bytes than requested. For further details see the "
13216 "L<pread(2)> system call."
13220 #: ../fish/guestfish-actions.pod:3780
13221 msgid "See also L</pwrite>, L</pread-device>."
13225 #: ../fish/guestfish-actions.pod:3785
13226 msgid "pread-device"
13230 #: ../fish/guestfish-actions.pod:3787
13233 " pread-device device count offset\n"
13238 #: ../fish/guestfish-actions.pod:3789 ../src/guestfs-actions.pod:5784
13240 "This command lets you read part of a file. It reads C<count> bytes of "
13241 "C<device>, starting at C<offset>."
13245 #: ../fish/guestfish-actions.pod:3795
13246 msgid "See also L</pread>."
13250 #: ../fish/guestfish-actions.pod:3800
13255 #: ../fish/guestfish-actions.pod:3802
13258 " pvcreate device\n"
13263 #: ../fish/guestfish-actions.pod:3804 ../src/guestfs-actions.pod:5807
13265 "This creates an LVM physical volume on the named C<device>, where C<device> "
13266 "should usually be a partition name such as C</dev/sda1>."
13270 #: ../fish/guestfish-actions.pod:3808
13275 #: ../fish/guestfish-actions.pod:3810
13278 " pvremove device\n"
13283 #: ../fish/guestfish-actions.pod:3812 ../src/guestfs-actions.pod:5821
13285 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13290 #: ../fish/guestfish-actions.pod:3815 ../src/guestfs-actions.pod:5824
13292 "The implementation uses the C<pvremove> command which refuses to wipe "
13293 "physical volumes that contain any volume groups, so you have to remove those "
13298 #: ../fish/guestfish-actions.pod:3819
13303 #: ../fish/guestfish-actions.pod:3821
13306 " pvresize device\n"
13311 #: ../fish/guestfish-actions.pod:3823 ../src/guestfs-actions.pod:5838
13313 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13314 "the new size of the underlying device."
13318 #: ../fish/guestfish-actions.pod:3826
13319 msgid "pvresize-size"
13323 #: ../fish/guestfish-actions.pod:3828
13326 " pvresize-size device size\n"
13331 #: ../fish/guestfish-actions.pod:3830
13333 "This command is the same as L</pvresize> except that it allows you to "
13334 "specify the new size (in bytes) explicitly."
13338 #: ../fish/guestfish-actions.pod:3833
13343 #: ../fish/guestfish-actions.pod:3835
13351 #: ../fish/guestfish-actions.pod:3837 ../src/guestfs-actions.pod:5864
13353 "List all the physical volumes detected. This is the equivalent of the "
13354 "L<pvs(8)> command."
13358 #: ../fish/guestfish-actions.pod:3840 ../src/guestfs-actions.pod:5867
13360 "This returns a list of just the device names that contain PVs "
13361 "(eg. C</dev/sda2>)."
13365 #: ../fish/guestfish-actions.pod:3843
13366 msgid "See also L</pvs-full>."
13370 #: ../fish/guestfish-actions.pod:3845
13375 #: ../fish/guestfish-actions.pod:3847
13383 #: ../fish/guestfish-actions.pod:3849 ../src/guestfs-actions.pod:5883
13385 "List all the physical volumes detected. This is the equivalent of the "
13386 "L<pvs(8)> command. The \"full\" version includes all fields."
13390 #: ../fish/guestfish-actions.pod:3852
13395 #: ../fish/guestfish-actions.pod:3854
13403 #: ../fish/guestfish-actions.pod:3856 ../src/guestfs-actions.pod:5898
13404 msgid "This command returns the UUID of the LVM PV C<device>."
13408 #: ../fish/guestfish-actions.pod:3858
13413 #: ../fish/guestfish-actions.pod:3860
13416 " pwrite path content offset\n"
13421 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:5914
13423 "This command writes to part of a file. It writes the data buffer C<content> "
13424 "to the file C<path> starting at offset C<offset>."
13428 #: ../fish/guestfish-actions.pod:3865 ../src/guestfs-actions.pod:5917
13430 "This command implements the L<pwrite(2)> system call, and like that system "
13431 "call it may not write the full data requested. The return value is the "
13432 "number of bytes that were actually written to the file. This could even be "
13433 "0, although short writes are unlikely for regular files in ordinary "
13438 #: ../fish/guestfish-actions.pod:3871
13439 msgid "See also L</pread>, L</pwrite-device>."
13443 #: ../fish/guestfish-actions.pod:3876
13444 msgid "pwrite-device"
13448 #: ../fish/guestfish-actions.pod:3878
13451 " pwrite-device device content offset\n"
13456 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:5941
13458 "This command writes to part of a device. It writes the data buffer "
13459 "C<content> to C<device> starting at offset C<offset>."
13463 #: ../fish/guestfish-actions.pod:3883 ../src/guestfs-actions.pod:5944
13465 "This command implements the L<pwrite(2)> system call, and like that system "
13466 "call it may not write the full data requested (although short writes to disk "
13467 "devices and partitions are probably impossible with standard Linux kernels)."
13471 #: ../fish/guestfish-actions.pod:3888
13472 msgid "See also L</pwrite>."
13476 #: ../fish/guestfish-actions.pod:3893
13481 #: ../fish/guestfish-actions.pod:3895
13484 " read-file path\n"
13489 #: ../fish/guestfish-actions.pod:3897 ../src/guestfs-actions.pod:5965
13490 msgid "This calls returns the contents of the file C<path> as a buffer."
13494 #: ../fish/guestfish-actions.pod:3900
13496 "Unlike L</cat>, this function can correctly handle files that contain "
13497 "embedded ASCII NUL characters. However unlike L</download>, this function "
13498 "is limited in the total size of file that can be handled."
13502 #: ../fish/guestfish-actions.pod:3908
13507 #: ../fish/guestfish-actions.pod:3910
13510 " read-lines path\n"
13515 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:5990
13517 "The file contents are returned as a list of lines. Trailing C<LF> and "
13518 "C<CRLF> character sequences are I<not> returned."
13522 #: ../fish/guestfish-actions.pod:3917
13524 "Note that this function cannot correctly handle binary files (specifically, "
13525 "files containing C<\\0> character which is treated as end of line). For "
13526 "those you need to use the L</read-file> function which has a more complex "
13531 #: ../fish/guestfish-actions.pod:3922
13536 #: ../fish/guestfish-actions.pod:3924
13544 #: ../fish/guestfish-actions.pod:3926 ../src/guestfs-actions.pod:6010
13545 msgid "This returns the list of directory entries in directory C<dir>."
13549 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6012
13551 "All entries in the directory are returned, including C<.> and C<..>. The "
13552 "entries are I<not> sorted, but returned in the same order as the underlying "
13557 #: ../fish/guestfish-actions.pod:3932 ../src/guestfs-actions.pod:6016
13559 "Also this call returns basic file type information about each file. The "
13560 "C<ftyp> field will contain one of the following characters:"
13564 #: ../fish/guestfish-actions.pod:3937 ../src/guestfs-actions.pod:6021
13569 #: ../fish/guestfish-actions.pod:3939 ../src/guestfs-actions.pod:6023
13570 msgid "Block special"
13574 #: ../fish/guestfish-actions.pod:3941 ../src/guestfs-actions.pod:6025
13579 #: ../fish/guestfish-actions.pod:3943 ../src/guestfs-actions.pod:6027
13580 msgid "Char special"
13584 #: ../fish/guestfish-actions.pod:3945 ../src/guestfs-actions.pod:6029
13589 #: ../fish/guestfish-actions.pod:3947 ../src/guestfs-actions.pod:6031
13594 #: ../fish/guestfish-actions.pod:3949 ../src/guestfs-actions.pod:6033
13599 #: ../fish/guestfish-actions.pod:3951 ../src/guestfs-actions.pod:6035
13600 msgid "FIFO (named pipe)"
13604 #: ../fish/guestfish-actions.pod:3953 ../src/guestfs-actions.pod:6037
13609 #: ../fish/guestfish-actions.pod:3955 ../src/guestfs-actions.pod:6039
13610 msgid "Symbolic link"
13614 #: ../fish/guestfish-actions.pod:3957 ../src/guestfs-actions.pod:6041
13619 #: ../fish/guestfish-actions.pod:3959 ../src/guestfs-actions.pod:6043
13620 msgid "Regular file"
13624 #: ../fish/guestfish-actions.pod:3961 ../src/guestfs-actions.pod:6045
13629 #: ../fish/guestfish-actions.pod:3963 ../src/guestfs-actions.pod:6047
13634 #: ../fish/guestfish-actions.pod:3965 ../src/guestfs-actions.pod:6049
13639 #: ../fish/guestfish-actions.pod:3967 ../src/guestfs-actions.pod:6051
13640 msgid "Unknown file type"
13644 #: ../fish/guestfish-actions.pod:3969 ../src/guestfs-actions.pod:6053
13649 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6055
13650 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13654 #: ../fish/guestfish-actions.pod:3976
13656 "This function is primarily intended for use by programs. To get a simple "
13657 "list of names, use L</ls>. To get a printable directory for human "
13658 "consumption, use L</ll>."
13662 #: ../fish/guestfish-actions.pod:3980
13667 #: ../fish/guestfish-actions.pod:3982
13675 #: ../fish/guestfish-actions.pod:3984 ../src/guestfs-actions.pod:6076
13676 msgid "This command reads the target of a symbolic link."
13680 #: ../fish/guestfish-actions.pod:3986
13681 msgid "readlinklist"
13685 #: ../fish/guestfish-actions.pod:3988
13688 " readlinklist path 'names ...'\n"
13693 #: ../fish/guestfish-actions.pod:3990 ../src/guestfs-actions.pod:6090
13695 "This call allows you to do a C<readlink> operation on multiple files, where "
13696 "all files are in the directory C<path>. C<names> is the list of files from "
13701 #: ../fish/guestfish-actions.pod:3994 ../src/guestfs-actions.pod:6094
13703 "On return you get a list of strings, with a one-to-one correspondence to the "
13704 "C<names> list. Each string is the value of the symbolic link."
13708 #: ../fish/guestfish-actions.pod:3998 ../src/guestfs-actions.pod:6098
13710 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13711 "result string is the empty string C<\"\">. However the whole operation is "
13712 "completed even if there were C<readlink(2)> errors, and so you can call this "
13713 "function with names where you don't know if they are symbolic links already "
13714 "(albeit slightly less efficient)."
13718 #: ../fish/guestfish-actions.pod:4005 ../src/guestfs-actions.pod:6105
13720 "This call is intended for programs that want to efficiently list a directory "
13721 "contents without making many round-trips. Very long directory listings "
13722 "might cause the protocol message size to be exceeded, causing this call to "
13723 "fail. The caller must split up such requests into smaller groups of names."
13727 #: ../fish/guestfish-actions.pod:4012
13732 #: ../fish/guestfish-actions.pod:4014
13740 #: ../fish/guestfish-actions.pod:4016 ../src/guestfs-actions.pod:6124
13742 "Return the canonicalized absolute pathname of C<path>. The returned path "
13743 "has no C<.>, C<..> or symbolic link path elements."
13747 #: ../fish/guestfish-actions.pod:4019
13748 msgid "removexattr"
13752 #: ../fish/guestfish-actions.pod:4021
13755 " removexattr xattr path\n"
13760 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6139
13761 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
13765 #: ../fish/guestfish-actions.pod:4026
13766 msgid "See also: L</lremovexattr>, L<attr(5)>."
13770 #: ../fish/guestfish-actions.pod:4028
13775 #: ../fish/guestfish-actions.pod:4030
13778 " resize2fs device\n"
13783 #: ../fish/guestfish-actions.pod:4032 ../src/guestfs-actions.pod:6154
13785 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13786 "underlying device."
13790 #: ../fish/guestfish-actions.pod:4035
13792 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13793 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13794 "gives an error about this and sometimes not. In any case, it is always safe "
13795 "to call L</e2fsck-f> before calling this function."
13799 #: ../fish/guestfish-actions.pod:4041
13800 msgid "resize2fs-M"
13804 #: ../fish/guestfish-actions.pod:4043
13807 " resize2fs-M device\n"
13812 #: ../fish/guestfish-actions.pod:4045
13814 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13815 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13820 #: ../fish/guestfish-actions.pod:4049
13822 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13823 "and read the C<Block size> and C<Block count> values. These two numbers, "
13824 "multiplied together, give the resulting size of the minimal filesystem in "
13829 #: ../fish/guestfish-actions.pod:4054
13830 msgid "resize2fs-size"
13834 #: ../fish/guestfish-actions.pod:4056
13837 " resize2fs-size device size\n"
13842 #: ../fish/guestfish-actions.pod:4058
13844 "This command is the same as L</resize2fs> except that it allows you to "
13845 "specify the new size (in bytes) explicitly."
13849 #: ../fish/guestfish-actions.pod:4061
13854 #: ../fish/guestfish-actions.pod:4063
13862 #: ../fish/guestfish-actions.pod:4065 ../src/guestfs-actions.pod:6206
13863 msgid "Remove the single file C<path>."
13867 #: ../fish/guestfish-actions.pod:4067
13872 #: ../fish/guestfish-actions.pod:4069
13880 #: ../fish/guestfish-actions.pod:4071 ../src/guestfs-actions.pod:6218
13882 "Remove the file or directory C<path>, recursively removing the contents if "
13883 "its a directory. This is like the C<rm -rf> shell command."
13887 #: ../fish/guestfish-actions.pod:4075
13892 #: ../fish/guestfish-actions.pod:4077
13900 #: ../fish/guestfish-actions.pod:4079 ../src/guestfs-actions.pod:6232
13901 msgid "Remove the single directory C<path>."
13905 #: ../fish/guestfish-actions.pod:4081
13906 msgid "rmmountpoint"
13910 #: ../fish/guestfish-actions.pod:4083
13913 " rmmountpoint exemptpath\n"
13918 #: ../fish/guestfish-actions.pod:4085
13920 "This calls removes a mountpoint that was previously created with "
13921 "L</mkmountpoint>. See L</mkmountpoint> for full details."
13925 #: ../fish/guestfish-actions.pod:4089
13926 msgid "scrub-device"
13930 #: ../fish/guestfish-actions.pod:4091
13933 " scrub-device device\n"
13938 #: ../fish/guestfish-actions.pod:4093 ../src/guestfs-actions.pod:6258
13940 "This command writes patterns over C<device> to make data retrieval more "
13945 #: ../fish/guestfish-actions.pod:4096 ../fish/guestfish-actions.pod:4111 ../fish/guestfish-actions.pod:4124 ../src/guestfs-actions.pod:6261 ../src/guestfs-actions.pod:6282 ../src/guestfs-actions.pod:6301
13947 "It is an interface to the L<scrub(1)> program. See that manual page for "
13952 #: ../fish/guestfish-actions.pod:4102
13957 #: ../fish/guestfish-actions.pod:4104
13960 " scrub-file file\n"
13965 #: ../fish/guestfish-actions.pod:4106 ../src/guestfs-actions.pod:6277
13967 "This command writes patterns over a file to make data retrieval more "
13972 #: ../fish/guestfish-actions.pod:4109 ../src/guestfs-actions.pod:6280
13973 msgid "The file is I<removed> after scrubbing."
13977 #: ../fish/guestfish-actions.pod:4114
13978 msgid "scrub-freespace"
13982 #: ../fish/guestfish-actions.pod:4116
13985 " scrub-freespace dir\n"
13990 #: ../fish/guestfish-actions.pod:4118
13992 "This command creates the directory C<dir> and then fills it with files until "
13993 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
13994 "deletes them. The intention is to scrub any free space on the partition "
13995 "containing C<dir>."
13999 #: ../fish/guestfish-actions.pod:4127
14004 #: ../fish/guestfish-actions.pod:4129
14009 #: ../fish/guestfish-actions.pod:4131
14012 " set-append append\n"
14017 #: ../fish/guestfish-actions.pod:4133 ../src/guestfs-actions.pod:6314
14019 "This function is used to add additional options to the guest kernel command "
14024 #: ../fish/guestfish-actions.pod:4136 ../src/guestfs-actions.pod:6317
14026 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14027 "environment variable."
14031 #: ../fish/guestfish-actions.pod:4139 ../src/guestfs-actions.pod:6320
14033 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14034 "(libguestfs always adds a few of its own)."
14038 #: ../fish/guestfish-actions.pod:4142
14039 msgid "set-attach-method"
14043 #: ../fish/guestfish-actions.pod:4144
14044 msgid "attach-method"
14048 #: ../fish/guestfish-actions.pod:4146
14051 " set-attach-method attachmethod\n"
14056 #: ../fish/guestfish-actions.pod:4148 ../src/guestfs-actions.pod:6333
14058 "Set the method that libguestfs uses to connect to the back end guestfsd "
14059 "daemon. Possible methods are:"
14063 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6338 ../src/guestfs.pod:2901
14064 msgid "C<appliance>"
14068 #: ../fish/guestfish-actions.pod:4155 ../src/guestfs-actions.pod:6340
14070 "Launch an appliance and connect to it. This is the ordinary method and the "
14075 #: ../fish/guestfish-actions.pod:4158 ../src/guestfs-actions.pod:6343
14076 msgid "C<unix:I<path>>"
14080 #: ../fish/guestfish-actions.pod:4160 ../src/guestfs-actions.pod:6345
14081 msgid "Connect to the Unix domain socket I<path>."
14085 #: ../fish/guestfish-actions.pod:4162 ../src/guestfs-actions.pod:6347
14087 "This method lets you connect to an existing daemon or (using virtio-serial) "
14088 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14089 "RUNNING DAEMONS>."
14093 #: ../fish/guestfish-actions.pod:4168
14094 msgid "set-autosync"
14098 #: ../fish/guestfish-actions.pod:4170
14103 #: ../fish/guestfish-actions.pod:4172
14106 " set-autosync true|false\n"
14111 #: ../fish/guestfish-actions.pod:4174 ../src/guestfs-actions.pod:6363
14113 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14114 "effort attempt to make filesystems consistent and synchronized when the "
14115 "handle is closed (also if the program exits without closing handles)."
14119 #: ../fish/guestfish-actions.pod:4179 ../src/guestfs-actions.pod:6368
14121 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14122 "disabled by default)."
14126 #: ../fish/guestfish-actions.pod:4182
14131 #: ../fish/guestfish-actions.pod:4184
14136 #: ../fish/guestfish-actions.pod:4186
14139 " set-direct true|false\n"
14144 #: ../fish/guestfish-actions.pod:4188 ../src/guestfs-actions.pod:6381
14146 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14147 "passed directly through to the appliance once it is launched."
14151 #: ../fish/guestfish-actions.pod:4192
14153 "One consequence of this is that log messages aren't caught by the library "
14154 "and handled by L</set-log-message-callback>, but go straight to stdout."
14158 #: ../fish/guestfish-actions.pod:4196 ../src/guestfs-actions.pod:6389
14159 msgid "You probably don't want to use this unless you know what you are doing."
14163 #: ../fish/guestfish-actions.pod:4199 ../src/guestfs-actions.pod:6392
14164 msgid "The default is disabled."
14168 #: ../fish/guestfish-actions.pod:4201
14169 msgid "set-e2label"
14173 #: ../fish/guestfish-actions.pod:4203
14176 " set-e2label device label\n"
14181 #: ../fish/guestfish-actions.pod:4205 ../src/guestfs-actions.pod:6405
14183 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14184 "C<label>. Filesystem labels are limited to 16 characters."
14188 #: ../fish/guestfish-actions.pod:4209
14190 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14191 "label on a filesystem."
14195 #: ../fish/guestfish-actions.pod:4212
14200 #: ../fish/guestfish-actions.pod:4214
14203 " set-e2uuid device uuid\n"
14208 #: ../fish/guestfish-actions.pod:4216 ../src/guestfs-actions.pod:6423
14210 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14211 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14212 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14216 #: ../fish/guestfish-actions.pod:4221
14218 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14219 "UUID of a filesystem."
14223 #: ../fish/guestfish-actions.pod:4224
14224 msgid "set-memsize"
14228 #: ../fish/guestfish-actions.pod:4226
14233 #: ../fish/guestfish-actions.pod:4228
14236 " set-memsize memsize\n"
14241 #: ../fish/guestfish-actions.pod:4230
14243 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14244 "This only has any effect if called before L</launch>."
14248 #: ../fish/guestfish-actions.pod:4234 ../src/guestfs-actions.pod:6445
14250 "You can also change this by setting the environment variable "
14251 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14255 #: ../fish/guestfish-actions.pod:4241
14256 msgid "set-network"
14260 #: ../fish/guestfish-actions.pod:4243
14265 #: ../fish/guestfish-actions.pod:4245
14268 " set-network true|false\n"
14273 #: ../fish/guestfish-actions.pod:4247 ../src/guestfs-actions.pod:6462
14275 "If C<network> is true, then the network is enabled in the libguestfs "
14276 "appliance. The default is false."
14280 #: ../fish/guestfish-actions.pod:4250 ../src/guestfs-actions.pod:6465
14282 "This affects whether commands are able to access the network (see "
14283 "L<guestfs(3)/RUNNING COMMANDS>)."
14287 #: ../fish/guestfish-actions.pod:4253
14288 msgid "You must call this before calling L</launch>, otherwise it has no effect."
14292 #: ../fish/guestfish-actions.pod:4256
14297 #: ../fish/guestfish-actions.pod:4260
14300 " set-path searchpath\n"
14305 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6481
14306 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14310 #: ../fish/guestfish-actions.pod:4264 ../src/guestfs-actions.pod:6483
14312 "The default is C<$libdir/guestfs> unless overridden by setting "
14313 "C<LIBGUESTFS_PATH> environment variable."
14317 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6486
14318 msgid "Setting C<path> to C<NULL> restores the default path."
14322 #: ../fish/guestfish-actions.pod:4269
14327 #: ../fish/guestfish-actions.pod:4271
14332 #: ../fish/guestfish-actions.pod:4273
14335 " set-pgroup true|false\n"
14340 #: ../fish/guestfish-actions.pod:4275 ../src/guestfs-actions.pod:6498
14342 "If C<pgroup> is true, child processes are placed into their own process "
14347 #: ../fish/guestfish-actions.pod:4278 ../src/guestfs-actions.pod:6501
14349 "The practical upshot of this is that signals like C<SIGINT> (from users "
14350 "pressing C<^C>) won't be received by the child process."
14354 #: ../fish/guestfish-actions.pod:4281 ../src/guestfs-actions.pod:6504
14356 "The default for this flag is false, because usually you want C<^C> to kill "
14361 #: ../fish/guestfish-actions.pod:4284
14366 #: ../fish/guestfish-actions.pod:4286
14371 #: ../fish/guestfish-actions.pod:4288
14379 #: ../fish/guestfish-actions.pod:4290 ../src/guestfs-actions.pod:6517
14380 msgid "Set the qemu binary that we will use."
14384 #: ../fish/guestfish-actions.pod:4292 ../src/guestfs-actions.pod:6519
14385 msgid "The default is chosen when the library was compiled by the configure script."
14389 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6522
14391 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14396 #: ../fish/guestfish-actions.pod:4298 ../src/guestfs-actions.pod:6525
14397 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14401 #: ../fish/guestfish-actions.pod:4300 ../src/guestfs-actions.pod:6527
14403 "Note that you should call this function as early as possible after creating "
14404 "the handle. This is because some pre-launch operations depend on testing "
14405 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14406 "don't retest features, and so you might see inconsistent results. Using the "
14407 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14408 "the qemu binary at the same time as the handle is created."
14412 #: ../fish/guestfish-actions.pod:4308
14413 msgid "set-recovery-proc"
14417 #: ../fish/guestfish-actions.pod:4310
14418 msgid "recovery-proc"
14422 #: ../fish/guestfish-actions.pod:4312
14425 " set-recovery-proc true|false\n"
14430 #: ../fish/guestfish-actions.pod:4314
14432 "If this is called with the parameter C<false> then L</launch> does not "
14433 "create a recovery process. The purpose of the recovery process is to stop "
14434 "runaway qemu processes in the case where the main program aborts abruptly."
14438 #: ../fish/guestfish-actions.pod:4319
14440 "This only has any effect if called before L</launch>, and the default is "
14445 #: ../fish/guestfish-actions.pod:4322 ../src/guestfs-actions.pod:6553
14447 "About the only time when you would want to disable this is if the main "
14448 "process will fork itself into the background (\"daemonize\" itself). In "
14449 "this case the recovery process thinks that the main program has disappeared "
14450 "and so kills qemu, which is not very helpful."
14454 #: ../fish/guestfish-actions.pod:4328
14455 msgid "set-selinux"
14459 #: ../fish/guestfish-actions.pod:4330
14464 #: ../fish/guestfish-actions.pod:4332
14467 " set-selinux true|false\n"
14472 #: ../fish/guestfish-actions.pod:4334 ../src/guestfs-actions.pod:6569
14474 "This sets the selinux flag that is passed to the appliance at boot time. "
14475 "The default is C<selinux=0> (disabled)."
14479 #: ../fish/guestfish-actions.pod:4337 ../src/guestfs-actions.pod:6572
14481 "Note that if SELinux is enabled, it is always in Permissive mode "
14482 "(C<enforcing=0>)."
14486 #: ../fish/guestfish-actions.pod:4343
14491 #: ../fish/guestfish-actions.pod:4345
14496 #: ../fish/guestfish-actions.pod:4347
14504 #: ../fish/guestfish-actions.pod:4349 ../src/guestfs-actions.pod:6588
14506 "Change the number of virtual CPUs assigned to the appliance. The default is "
14507 "C<1>. Increasing this may improve performance, though often it has no "
14512 #: ../fish/guestfish-actions.pod:4353
14513 msgid "This function must be called before L</launch>."
14517 #: ../fish/guestfish-actions.pod:4355
14522 #: ../fish/guestfish-actions.pod:4357
14527 #: ../fish/guestfish-actions.pod:4359
14530 " set-trace true|false\n"
14535 #: ../fish/guestfish-actions.pod:4361 ../src/guestfs-actions.pod:6604
14537 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14538 "return values are traced."
14542 #: ../fish/guestfish-actions.pod:4364 ../src/guestfs-actions.pod:6607
14544 "If you want to trace C API calls into libguestfs (and other libraries) then "
14545 "possibly a better way is to use the external ltrace(1) command."
14549 #: ../fish/guestfish-actions.pod:4368 ../src/guestfs-actions.pod:6611
14551 "Command traces are disabled unless the environment variable "
14552 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14556 #: ../fish/guestfish-actions.pod:4371
14558 "Trace messages are normally sent to C<stderr>, unless you register a "
14559 "callback to send them somewhere else (see L</set-event-callback>)."
14563 #: ../fish/guestfish-actions.pod:4375
14564 msgid "set-verbose"
14568 #: ../fish/guestfish-actions.pod:4377
14573 #: ../fish/guestfish-actions.pod:4379
14576 " set-verbose true|false\n"
14581 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6628
14582 msgid "If C<verbose> is true, this turns on verbose messages."
14586 #: ../fish/guestfish-actions.pod:4383 ../src/guestfs-actions.pod:6630
14588 "Verbose messages are disabled unless the environment variable "
14589 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14593 #: ../fish/guestfish-actions.pod:4386
14595 "Verbose messages are normally sent to C<stderr>, unless you register a "
14596 "callback to send them somewhere else (see L</set-event-callback>)."
14600 #: ../fish/guestfish-actions.pod:4390
14605 #: ../fish/guestfish-actions.pod:4392
14608 " setcon context\n"
14613 #: ../fish/guestfish-actions.pod:4394 ../src/guestfs-actions.pod:6647
14615 "This sets the SELinux security context of the daemon to the string "
14620 #: ../fish/guestfish-actions.pod:4397 ../src/guestfs-actions.pod:6650
14621 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14625 #: ../fish/guestfish-actions.pod:4399
14630 #: ../fish/guestfish-actions.pod:4401
14633 " setxattr xattr val vallen path\n"
14638 #: ../fish/guestfish-actions.pod:4403 ../src/guestfs-actions.pod:6665
14640 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14641 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14645 #: ../fish/guestfish-actions.pod:4407
14646 msgid "See also: L</lsetxattr>, L<attr(5)>."
14650 #: ../fish/guestfish-actions.pod:4409
14655 #: ../fish/guestfish-actions.pod:4411
14658 " sfdisk device cyls heads sectors 'lines ...'\n"
14663 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6692
14665 "This is a direct interface to the L<sfdisk(8)> program for creating "
14666 "partitions on block devices."
14670 #: ../fish/guestfish-actions.pod:4416 ../src/guestfs-actions.pod:6695
14671 msgid "C<device> should be a block device, for example C</dev/sda>."
14675 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6697
14677 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14678 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14679 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14680 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14681 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14682 "the kernel) cannot work out the right geometry and you will need to tell it."
14686 #: ../fish/guestfish-actions.pod:4426 ../src/guestfs-actions.pod:6705
14688 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14689 "refer to the L<sfdisk(8)> manpage."
14693 #: ../fish/guestfish-actions.pod:4429 ../src/guestfs-actions.pod:6708
14695 "To create a single partition occupying the whole disk, you would pass "
14696 "C<lines> as a single element list, when the single element being the string "
14701 #: ../fish/guestfish-actions.pod:4433
14702 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14706 #: ../fish/guestfish-actions.pod:4439 ../fish/guestfish-actions.pod:4462 ../fish/guestfish-actions.pod:4484
14708 "I<This function is deprecated.> In new code, use the L</part_add> call "
14713 #: ../fish/guestfish-actions.pod:4446
14718 #: ../fish/guestfish-actions.pod:4448
14721 " sfdiskM device 'lines ...'\n"
14726 #: ../fish/guestfish-actions.pod:4450
14728 "This is a simplified interface to the L</sfdisk> command, where partition "
14729 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14730 "you don't need to specify the cyls, heads and sectors parameters which were "
14731 "rarely if ever used anyway."
14735 #: ../fish/guestfish-actions.pod:4456
14736 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14740 #: ../fish/guestfish-actions.pod:4469
14745 #: ../fish/guestfish-actions.pod:4471
14748 " sfdisk-N device partnum cyls heads sectors line\n"
14753 #: ../fish/guestfish-actions.pod:4473 ../src/guestfs-actions.pod:6770
14755 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14756 "(note: C<n> counts from 1)."
14760 #: ../fish/guestfish-actions.pod:4476
14762 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
14763 "cyls/heads/sectors parameters."
14767 #: ../fish/guestfish-actions.pod:4479
14768 msgid "See also: L</part-add>"
14772 #: ../fish/guestfish-actions.pod:4491
14773 msgid "sfdisk-disk-geometry"
14777 #: ../fish/guestfish-actions.pod:4493
14780 " sfdisk-disk-geometry device\n"
14785 #: ../fish/guestfish-actions.pod:4495
14787 "This displays the disk geometry of C<device> read from the partition table. "
14788 "Especially in the case where the underlying block device has been resized, "
14789 "this can be different from the kernel's idea of the geometry (see "
14790 "L</sfdisk-kernel-geometry>)."
14794 #: ../fish/guestfish-actions.pod:4500 ../fish/guestfish-actions.pod:4509 ../src/guestfs-actions.pod:6796 ../src/guestfs-actions.pod:6812
14795 msgid "The result is in human-readable format, and not designed to be parsed."
14799 #: ../fish/guestfish-actions.pod:4503
14800 msgid "sfdisk-kernel-geometry"
14804 #: ../fish/guestfish-actions.pod:4505
14807 " sfdisk-kernel-geometry device\n"
14812 #: ../fish/guestfish-actions.pod:4507 ../src/guestfs-actions.pod:6810
14813 msgid "This displays the kernel's idea of the geometry of C<device>."
14817 #: ../fish/guestfish-actions.pod:4512
14822 #: ../fish/guestfish-actions.pod:4514
14825 " sfdisk-l device\n"
14830 #: ../fish/guestfish-actions.pod:4516 ../src/guestfs-actions.pod:6833
14832 "This displays the partition table on C<device>, in the human-readable output "
14833 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14837 #: ../fish/guestfish-actions.pod:4520
14838 msgid "See also: L</part-list>"
14842 #: ../fish/guestfish-actions.pod:4522
14844 "I<This function is deprecated.> In new code, use the L</part_list> call "
14849 #: ../fish/guestfish-actions.pod:4529
14854 #: ../fish/guestfish-actions.pod:4531
14862 #: ../fish/guestfish-actions.pod:4533 ../src/guestfs-actions.pod:6850
14864 "This call runs a command from the guest filesystem via the guest's "
14869 #: ../fish/guestfish-actions.pod:4536
14870 msgid "This is like L</command>, but passes the command to:"
14874 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6855
14877 " /bin/sh -c \"command\"\n"
14882 #: ../fish/guestfish-actions.pod:4540 ../src/guestfs-actions.pod:6857
14884 "Depending on the guest's shell, this usually results in wildcards being "
14885 "expanded, shell expressions being interpolated and so on."
14889 #: ../fish/guestfish-actions.pod:4544
14890 msgid "All the provisos about L</command> apply to this call."
14894 #: ../fish/guestfish-actions.pod:4546
14899 #: ../fish/guestfish-actions.pod:4548
14902 " sh-lines command\n"
14907 #: ../fish/guestfish-actions.pod:4550
14908 msgid "This is the same as L</sh>, but splits the result into a list of lines."
14912 #: ../fish/guestfish-actions.pod:4553
14913 msgid "See also: L</command-lines>"
14917 #: ../fish/guestfish-actions.pod:4555
14922 #: ../fish/guestfish-actions.pod:4557
14930 #: ../fish/guestfish-actions.pod:4559 ../src/guestfs-actions.pod:6891
14931 msgid "Sleep for C<secs> seconds."
14935 #: ../fish/guestfish-actions.pod:4561
14940 #: ../fish/guestfish-actions.pod:4563
14948 #: ../fish/guestfish-actions.pod:4567 ../src/guestfs-actions.pod:6905
14949 msgid "This is the same as the C<stat(2)> system call."
14953 #: ../fish/guestfish-actions.pod:4569
14958 #: ../fish/guestfish-actions.pod:4571
14966 #: ../fish/guestfish-actions.pod:4573 ../src/guestfs-actions.pod:6919
14968 "Returns file system statistics for any mounted file system. C<path> should "
14969 "be a file or directory in the mounted file system (typically it is the mount "
14970 "point itself, but it doesn't need to be)."
14974 #: ../fish/guestfish-actions.pod:4577 ../src/guestfs-actions.pod:6923
14975 msgid "This is the same as the C<statvfs(2)> system call."
14979 #: ../fish/guestfish-actions.pod:4579
14984 #: ../fish/guestfish-actions.pod:4581
14992 #: ../fish/guestfish-actions.pod:4583 ../src/guestfs-actions.pod:6937
14994 "This runs the L<strings(1)> command on a file and returns the list of "
14995 "printable strings found."
14999 #: ../fish/guestfish-actions.pod:4589
15004 #: ../fish/guestfish-actions.pod:4591
15007 " strings-e encoding path\n"
15012 #: ../fish/guestfish-actions.pod:4593
15014 "This is like the L</strings> command, but allows you to specify the encoding "
15015 "of strings that are looked for in the source file C<path>."
15019 #: ../fish/guestfish-actions.pod:4597 ../src/guestfs-actions.pod:6960
15020 msgid "Allowed encodings are:"
15024 #: ../fish/guestfish-actions.pod:4601 ../src/guestfs-actions.pod:6964
15029 #: ../fish/guestfish-actions.pod:4603
15031 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15032 "ISO-8859-X (this is what L</strings> uses)."
15036 #: ../fish/guestfish-actions.pod:4606 ../src/guestfs-actions.pod:6969
15041 #: ../fish/guestfish-actions.pod:4608 ../src/guestfs-actions.pod:6971
15042 msgid "Single 8-bit-byte characters."
15046 #: ../fish/guestfish-actions.pod:4610 ../src/guestfs-actions.pod:6973
15051 #: ../fish/guestfish-actions.pod:4612 ../src/guestfs-actions.pod:6975
15052 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15056 #: ../fish/guestfish-actions.pod:4615 ../src/guestfs-actions.pod:6978
15057 msgid "l (lower case letter L)"
15061 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6980
15063 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15064 "examining binaries in Windows guests."
15068 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6983
15073 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6985
15074 msgid "32-bit big endian such as UCS-4BE."
15078 #: ../fish/guestfish-actions.pod:4624 ../src/guestfs-actions.pod:6987
15083 #: ../fish/guestfish-actions.pod:4626 ../src/guestfs-actions.pod:6989
15084 msgid "32-bit little endian such as UCS-4LE."
15088 #: ../fish/guestfish-actions.pod:4630 ../src/guestfs-actions.pod:6993
15089 msgid "The returned strings are transcoded to UTF-8."
15093 #: ../fish/guestfish-actions.pod:4635
15094 msgid "swapoff-device"
15098 #: ../fish/guestfish-actions.pod:4637
15101 " swapoff-device device\n"
15106 #: ../fish/guestfish-actions.pod:4639
15108 "This command disables the libguestfs appliance swap device or partition "
15109 "named C<device>. See L</swapon-device>."
15113 #: ../fish/guestfish-actions.pod:4643
15114 msgid "swapoff-file"
15118 #: ../fish/guestfish-actions.pod:4645
15121 " swapoff-file file\n"
15126 #: ../fish/guestfish-actions.pod:4647 ../src/guestfs-actions.pod:7024
15127 msgid "This command disables the libguestfs appliance swap on file."
15131 #: ../fish/guestfish-actions.pod:4649
15132 msgid "swapoff-label"
15136 #: ../fish/guestfish-actions.pod:4651
15139 " swapoff-label label\n"
15144 #: ../fish/guestfish-actions.pod:4653 ../src/guestfs-actions.pod:7036
15146 "This command disables the libguestfs appliance swap on labeled swap "
15151 #: ../fish/guestfish-actions.pod:4656
15152 msgid "swapoff-uuid"
15156 #: ../fish/guestfish-actions.pod:4658
15159 " swapoff-uuid uuid\n"
15164 #: ../fish/guestfish-actions.pod:4660 ../src/guestfs-actions.pod:7049
15166 "This command disables the libguestfs appliance swap partition with the given "
15171 #: ../fish/guestfish-actions.pod:4663
15172 msgid "swapon-device"
15176 #: ../fish/guestfish-actions.pod:4665
15179 " swapon-device device\n"
15184 #: ../fish/guestfish-actions.pod:4667
15186 "This command enables the libguestfs appliance to use the swap device or "
15187 "partition named C<device>. The increased memory is made available for all "
15188 "commands, for example those run using L</command> or L</sh>."
15192 #: ../fish/guestfish-actions.pod:4672 ../src/guestfs-actions.pod:7067
15194 "Note that you should not swap to existing guest swap partitions unless you "
15195 "know what you are doing. They may contain hibernation information, or other "
15196 "information that the guest doesn't want you to trash. You also risk leaking "
15197 "information about the host to the guest this way. Instead, attach a new "
15198 "host device to the guest and swap on that."
15202 #: ../fish/guestfish-actions.pod:4679
15203 msgid "swapon-file"
15207 #: ../fish/guestfish-actions.pod:4681
15210 " swapon-file file\n"
15215 #: ../fish/guestfish-actions.pod:4683
15216 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
15220 #: ../fish/guestfish-actions.pod:4686
15221 msgid "swapon-label"
15225 #: ../fish/guestfish-actions.pod:4688
15228 " swapon-label label\n"
15233 #: ../fish/guestfish-actions.pod:4690
15235 "This command enables swap to a labeled swap partition. See "
15236 "L</swapon-device> for other notes."
15240 #: ../fish/guestfish-actions.pod:4693
15241 msgid "swapon-uuid"
15245 #: ../fish/guestfish-actions.pod:4695
15248 " swapon-uuid uuid\n"
15253 #: ../fish/guestfish-actions.pod:4697
15255 "This command enables swap to a swap partition with the given UUID. See "
15256 "L</swapon-device> for other notes."
15260 #: ../fish/guestfish-actions.pod:4700
15265 #: ../fish/guestfish-actions.pod:4702
15273 #: ../fish/guestfish-actions.pod:4704 ../src/guestfs-actions.pod:7122
15275 "This syncs the disk, so that any writes are flushed through to the "
15276 "underlying disk image."
15280 #: ../fish/guestfish-actions.pod:4707 ../src/guestfs-actions.pod:7125
15282 "You should always call this if you have modified a disk image, before "
15283 "closing the handle."
15287 #: ../fish/guestfish-actions.pod:4710
15292 #: ../fish/guestfish-actions.pod:4712
15300 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7138
15301 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15305 #: ../fish/guestfish-actions.pod:4720
15310 #: ../fish/guestfish-actions.pod:4722
15313 " tail-n nrlines path\n"
15318 #: ../fish/guestfish-actions.pod:4724 ../src/guestfs-actions.pod:7157
15320 "If the parameter C<nrlines> is a positive number, this returns the last "
15321 "C<nrlines> lines of the file C<path>."
15325 #: ../fish/guestfish-actions.pod:4727 ../src/guestfs-actions.pod:7160
15327 "If the parameter C<nrlines> is a negative number, this returns lines from "
15328 "the file C<path>, starting with the C<-nrlines>th line."
15332 #: ../fish/guestfish-actions.pod:4735
15337 #: ../fish/guestfish-actions.pod:4737
15340 " tar-in (tarfile|-) directory\n"
15345 #: ../fish/guestfish-actions.pod:4739 ../src/guestfs-actions.pod:7181
15347 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15348 "tar file) into C<directory>."
15352 #: ../fish/guestfish-actions.pod:4742
15353 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15357 #: ../fish/guestfish-actions.pod:4747
15362 #: ../fish/guestfish-actions.pod:4749
15365 " tar-out directory (tarfile|-)\n"
15370 #: ../fish/guestfish-actions.pod:4751 ../src/guestfs-actions.pod:7198
15372 "This command packs the contents of C<directory> and downloads it to local "
15377 #: ../fish/guestfish-actions.pod:4754
15378 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15382 #: ../fish/guestfish-actions.pod:4759
15387 #: ../fish/guestfish-actions.pod:4761
15390 " tgz-in (tarball|-) directory\n"
15395 #: ../fish/guestfish-actions.pod:4763 ../src/guestfs-actions.pod:7215
15397 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15398 "tar file) into C<directory>."
15402 #: ../fish/guestfish-actions.pod:4766
15403 msgid "To upload an uncompressed tarball, use L</tar-in>."
15407 #: ../fish/guestfish-actions.pod:4770
15412 #: ../fish/guestfish-actions.pod:4772
15415 " tgz-out directory (tarball|-)\n"
15420 #: ../fish/guestfish-actions.pod:4774 ../src/guestfs-actions.pod:7231
15422 "This command packs the contents of C<directory> and downloads it to local "
15427 #: ../fish/guestfish-actions.pod:4777
15428 msgid "To download an uncompressed tarball, use L</tar-out>."
15432 #: ../fish/guestfish-actions.pod:4781
15437 #: ../fish/guestfish-actions.pod:4783
15445 #: ../fish/guestfish-actions.pod:4785 ../src/guestfs-actions.pod:7246
15447 "Touch acts like the L<touch(1)> command. It can be used to update the "
15448 "timestamps on a file, or, if the file does not exist, to create a new "
15449 "zero-length file."
15453 #: ../fish/guestfish-actions.pod:4789 ../src/guestfs-actions.pod:7250
15455 "This command only works on regular files, and will fail on other file types "
15456 "such as directories, symbolic links, block special etc."
15460 #: ../fish/guestfish-actions.pod:4792
15465 #: ../fish/guestfish-actions.pod:4794
15473 #: ../fish/guestfish-actions.pod:4796 ../src/guestfs-actions.pod:7263
15475 "This command truncates C<path> to a zero-length file. The file must exist "
15480 #: ../fish/guestfish-actions.pod:4799
15481 msgid "truncate-size"
15485 #: ../fish/guestfish-actions.pod:4801
15488 " truncate-size path size\n"
15493 #: ../fish/guestfish-actions.pod:4803 ../src/guestfs-actions.pod:7277
15495 "This command truncates C<path> to size C<size> bytes. The file must exist "
15500 #: ../fish/guestfish-actions.pod:4806
15502 "If the current file size is less than C<size> then the file is extended to "
15503 "the required size with zero bytes. This creates a sparse file (ie. disk "
15504 "blocks are not allocated for the file until you write to it). To create a "
15505 "non-sparse file of zeroes, use L</fallocate64> instead."
15509 #: ../fish/guestfish-actions.pod:4812
15514 #: ../fish/guestfish-actions.pod:4814
15517 " tune2fs-l device\n"
15522 #: ../fish/guestfish-actions.pod:4816 ../src/guestfs-actions.pod:7296
15524 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15529 #: ../fish/guestfish-actions.pod:4819 ../src/guestfs-actions.pod:7299
15531 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15532 "for more details. The list of fields returned isn't clearly defined, and "
15533 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15534 "and the filesystem itself."
15538 #: ../fish/guestfish-actions.pod:4824
15543 #: ../fish/guestfish-actions.pod:4826
15546 " txz-in (tarball|-) directory\n"
15551 #: ../fish/guestfish-actions.pod:4828 ../src/guestfs-actions.pod:7319
15553 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15554 "tar file) into C<directory>."
15558 #: ../fish/guestfish-actions.pod:4833
15563 #: ../fish/guestfish-actions.pod:4835
15566 " txz-out directory (tarball|-)\n"
15571 #: ../fish/guestfish-actions.pod:4837 ../src/guestfs-actions.pod:7333
15573 "This command packs the contents of C<directory> and downloads it to local "
15574 "file C<tarball> (as an xz compressed tar archive)."
15578 #: ../fish/guestfish-actions.pod:4842
15583 #: ../fish/guestfish-actions.pod:4844
15591 #: ../fish/guestfish-actions.pod:4846 ../src/guestfs-actions.pod:7346
15593 "This function sets the mask used for creating new files and device nodes to "
15598 #: ../fish/guestfish-actions.pod:4849 ../src/guestfs-actions.pod:7349
15600 "Typical umask values would be C<022> which creates new files with "
15601 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15602 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15606 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7354
15608 "The default umask is C<022>. This is important because it means that "
15609 "directories and device nodes will be created with C<0644> or C<0755> mode "
15610 "even if you specify C<0777>."
15614 #: ../fish/guestfish-actions.pod:4858
15615 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15619 #: ../fish/guestfish-actions.pod:4861 ../src/guestfs-actions.pod:7361
15620 msgid "This call returns the previous umask."
15624 #: ../fish/guestfish-actions.pod:4863
15629 #: ../fish/guestfish-actions.pod:4865
15634 #: ../fish/guestfish-actions.pod:4867
15637 " umount pathordevice\n"
15642 #: ../fish/guestfish-actions.pod:4869 ../src/guestfs-actions.pod:7373
15644 "This unmounts the given filesystem. The filesystem may be specified either "
15645 "by its mountpoint (path) or the device which contains the filesystem."
15649 #: ../fish/guestfish-actions.pod:4873
15654 #: ../fish/guestfish-actions.pod:4875
15655 msgid "unmount-all"
15659 #: ../fish/guestfish-actions.pod:4877
15667 #: ../fish/guestfish-actions.pod:4879 ../src/guestfs-actions.pod:7386
15668 msgid "This unmounts all mounted filesystems."
15672 #: ../fish/guestfish-actions.pod:4881 ../src/guestfs-actions.pod:7388
15673 msgid "Some internal mounts are not unmounted by this call."
15677 #: ../fish/guestfish-actions.pod:4883
15682 #: ../fish/guestfish-actions.pod:4885
15685 " upload (filename|-) remotefilename\n"
15690 #: ../fish/guestfish-actions.pod:4887 ../fish/guestfish-actions.pod:4900 ../src/guestfs-actions.pod:7401 ../src/guestfs-actions.pod:7425
15691 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15695 #: ../fish/guestfish-actions.pod:4892
15696 msgid "See also L</download>."
15700 #: ../fish/guestfish-actions.pod:4896
15701 msgid "upload-offset"
15705 #: ../fish/guestfish-actions.pod:4898
15708 " upload-offset (filename|-) remotefilename offset\n"
15713 #: ../fish/guestfish-actions.pod:4903 ../src/guestfs-actions.pod:7428
15715 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15716 "The intention is to overwrite parts of existing files or devices, although "
15717 "if a non-existant file is specified then it is created with a \"hole\" "
15718 "before C<offset>. The size of the data written is implicit in the size of "
15719 "the source C<filename>."
15723 #: ../fish/guestfish-actions.pod:4910
15725 "Note that there is no limit on the amount of data that can be uploaded with "
15726 "this call, unlike with L</pwrite>, and this call always writes the full "
15727 "amount unless an error occurs."
15731 #: ../fish/guestfish-actions.pod:4915
15732 msgid "See also L</upload>, L</pwrite>."
15736 #: ../fish/guestfish-actions.pod:4919
15741 #: ../fish/guestfish-actions.pod:4921
15744 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15749 #: ../fish/guestfish-actions.pod:4923 ../src/guestfs-actions.pod:7461
15750 msgid "This command sets the timestamps of a file with nanosecond precision."
15754 #: ../fish/guestfish-actions.pod:4926 ../src/guestfs-actions.pod:7464
15756 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15761 #: ../fish/guestfish-actions.pod:4929 ../src/guestfs-actions.pod:7467
15763 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15764 "nanoseconds from the epoch."
15768 #: ../fish/guestfish-actions.pod:4932 ../src/guestfs-actions.pod:7470
15770 "If the C<*nsecs> field contains the special value C<-1> then the "
15771 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15772 "ignored in this case)."
15776 #: ../fish/guestfish-actions.pod:4936 ../src/guestfs-actions.pod:7474
15778 "If the C<*nsecs> field contains the special value C<-2> then the "
15779 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15784 #: ../fish/guestfish-actions.pod:4940
15789 #: ../fish/guestfish-actions.pod:4942
15797 #: ../fish/guestfish-actions.pod:4944 ../src/guestfs-actions.pod:7487
15798 msgid "Return the libguestfs version number that the program is linked against."
15802 #: ../fish/guestfish-actions.pod:4947 ../src/guestfs-actions.pod:7490
15804 "Note that because of dynamic linking this is not necessarily the version of "
15805 "libguestfs that you compiled against. You can compile the program, and then "
15806 "at runtime dynamically link against a completely different C<libguestfs.so> "
15811 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7495
15813 "This call was added in version C<1.0.58>. In previous versions of "
15814 "libguestfs there was no way to get the version number. From C code you can "
15815 "use dynamic linker functions to find out if this symbol exists (if it "
15816 "doesn't, then it's an earlier version)."
15820 #: ../fish/guestfish-actions.pod:4958 ../src/guestfs-actions.pod:7501
15822 "The call returns a structure with four elements. The first three (C<major>, "
15823 "C<minor> and C<release>) are numbers and correspond to the usual version "
15824 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15825 "but may be used for distro-specific information."
15829 #: ../fish/guestfish-actions.pod:4964 ../src/guestfs-actions.pod:7507
15830 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
15834 #: ../fish/guestfish-actions.pod:4967 ../src/guestfs-actions.pod:7510
15835 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15839 #: ../fish/guestfish-actions.pod:4969
15841 "I<Note:> Don't use this call to test for availability of features. In "
15842 "enterprise distributions we backport features from later versions into "
15843 "earlier versions, making this an unreliable way to test for features. Use "
15844 "L</available> instead."
15848 #: ../fish/guestfish-actions.pod:4975
15853 #: ../fish/guestfish-actions.pod:4977
15856 " vfs-label device\n"
15861 #: ../fish/guestfish-actions.pod:4979 ../src/guestfs-actions.pod:7530
15862 msgid "This returns the filesystem label of the filesystem on C<device>."
15866 #: ../fish/guestfish-actions.pod:4982 ../src/guestfs-actions.pod:7533
15867 msgid "If the filesystem is unlabeled, this returns the empty string."
15871 #: ../fish/guestfish-actions.pod:4984
15872 msgid "To find a filesystem from the label, use L</findfs-label>."
15876 #: ../fish/guestfish-actions.pod:4986
15881 #: ../fish/guestfish-actions.pod:4988
15884 " vfs-type device\n"
15889 #: ../fish/guestfish-actions.pod:4990 ../src/guestfs-actions.pod:7548
15891 "This command gets the filesystem type corresponding to the filesystem on "
15896 #: ../fish/guestfish-actions.pod:4993 ../src/guestfs-actions.pod:7551
15898 "For most filesystems, the result is the name of the Linux VFS module which "
15899 "would be used to mount this filesystem if you mounted it without specifying "
15900 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15904 #: ../fish/guestfish-actions.pod:4998
15909 #: ../fish/guestfish-actions.pod:5000
15912 " vfs-uuid device\n"
15917 #: ../fish/guestfish-actions.pod:5002 ../src/guestfs-actions.pod:7567
15918 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15922 #: ../fish/guestfish-actions.pod:5005 ../src/guestfs-actions.pod:7570
15923 msgid "If the filesystem does not have a UUID, this returns the empty string."
15927 #: ../fish/guestfish-actions.pod:5007
15928 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
15932 #: ../fish/guestfish-actions.pod:5009
15933 msgid "vg-activate"
15937 #: ../fish/guestfish-actions.pod:5011
15940 " vg-activate true|false 'volgroups ...'\n"
15945 #: ../fish/guestfish-actions.pod:5013 ../src/guestfs-actions.pod:7586
15947 "This command activates or (if C<activate> is false) deactivates all logical "
15948 "volumes in the listed volume groups C<volgroups>."
15952 #: ../fish/guestfish-actions.pod:5016 ../src/guestfs-actions.pod:7589
15953 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15957 #: ../fish/guestfish-actions.pod:5018 ../src/guestfs-actions.pod:7591
15959 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15960 "activated or deactivated."
15964 #: ../fish/guestfish-actions.pod:5021
15965 msgid "vg-activate-all"
15969 #: ../fish/guestfish-actions.pod:5023
15972 " vg-activate-all true|false\n"
15977 #: ../fish/guestfish-actions.pod:5025 ../src/guestfs-actions.pod:7604
15979 "This command activates or (if C<activate> is false) deactivates all logical "
15980 "volumes in all volume groups."
15984 #: ../fish/guestfish-actions.pod:5028 ../src/guestfs-actions.pod:7607
15985 msgid "This command is the same as running C<vgchange -a y|n>"
15989 #: ../fish/guestfish-actions.pod:5030
15994 #: ../fish/guestfish-actions.pod:5032
15997 " vgcreate volgroup 'physvols ...'\n"
16002 #: ../fish/guestfish-actions.pod:5034 ../src/guestfs-actions.pod:7620
16004 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16005 "of physical volumes C<physvols>."
16009 #: ../fish/guestfish-actions.pod:5037
16014 #: ../fish/guestfish-actions.pod:5039
16017 " vglvuuids vgname\n"
16022 #: ../fish/guestfish-actions.pod:5041 ../src/guestfs-actions.pod:7633
16024 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16025 "volumes created in this volume group."
16029 #: ../fish/guestfish-actions.pod:5044
16031 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16032 "logical volumes and volume groups."
16036 #: ../fish/guestfish-actions.pod:5047
16037 msgid "See also L</vgpvuuids>."
16041 #: ../fish/guestfish-actions.pod:5049
16046 #: ../fish/guestfish-actions.pod:5051
16049 " vgpvuuids vgname\n"
16054 #: ../fish/guestfish-actions.pod:5053 ../src/guestfs-actions.pod:7653
16056 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16057 "volumes that this volume group resides on."
16061 #: ../fish/guestfish-actions.pod:5056
16063 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16064 "physical volumes and volume groups."
16068 #: ../fish/guestfish-actions.pod:5059
16069 msgid "See also L</vglvuuids>."
16073 #: ../fish/guestfish-actions.pod:5061
16078 #: ../fish/guestfish-actions.pod:5063
16081 " vgremove vgname\n"
16086 #: ../fish/guestfish-actions.pod:5065 ../src/guestfs-actions.pod:7673
16087 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16091 #: ../fish/guestfish-actions.pod:5067 ../src/guestfs-actions.pod:7675
16092 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16096 #: ../fish/guestfish-actions.pod:5070
16101 #: ../fish/guestfish-actions.pod:5072
16104 " vgrename volgroup newvolgroup\n"
16109 #: ../fish/guestfish-actions.pod:5074 ../src/guestfs-actions.pod:7689
16110 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16114 #: ../fish/guestfish-actions.pod:5076
16119 #: ../fish/guestfish-actions.pod:5078
16127 #: ../fish/guestfish-actions.pod:5080 ../src/guestfs-actions.pod:7700
16129 "List all the volumes groups detected. This is the equivalent of the "
16130 "L<vgs(8)> command."
16134 #: ../fish/guestfish-actions.pod:5083 ../src/guestfs-actions.pod:7703
16136 "This returns a list of just the volume group names that were detected "
16137 "(eg. C<VolGroup00>)."
16141 #: ../fish/guestfish-actions.pod:5086
16142 msgid "See also L</vgs-full>."
16146 #: ../fish/guestfish-actions.pod:5088
16151 #: ../fish/guestfish-actions.pod:5090
16159 #: ../fish/guestfish-actions.pod:5092 ../src/guestfs-actions.pod:7719
16161 "List all the volumes groups detected. This is the equivalent of the "
16162 "L<vgs(8)> command. The \"full\" version includes all fields."
16166 #: ../fish/guestfish-actions.pod:5095
16171 #: ../fish/guestfish-actions.pod:5097
16179 #: ../fish/guestfish-actions.pod:5099 ../src/guestfs-actions.pod:7733
16181 "This rescans all block devices and rebuilds the list of LVM physical "
16182 "volumes, volume groups and logical volumes."
16186 #: ../fish/guestfish-actions.pod:5102
16191 #: ../fish/guestfish-actions.pod:5104
16199 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7746
16200 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16204 #: ../fish/guestfish-actions.pod:5108
16209 #: ../fish/guestfish-actions.pod:5110
16217 #: ../fish/guestfish-actions.pod:5112 ../src/guestfs-actions.pod:7786
16219 "This command counts the characters in a file, using the C<wc -c> external "
16224 #: ../fish/guestfish-actions.pod:5115
16229 #: ../fish/guestfish-actions.pod:5117
16237 #: ../fish/guestfish-actions.pod:5119 ../src/guestfs-actions.pod:7799
16239 "This command counts the lines in a file, using the C<wc -l> external "
16244 #: ../fish/guestfish-actions.pod:5122
16249 #: ../fish/guestfish-actions.pod:5124
16257 #: ../fish/guestfish-actions.pod:5126 ../src/guestfs-actions.pod:7812
16259 "This command counts the words in a file, using the C<wc -w> external "
16264 #: ../fish/guestfish-actions.pod:5129
16269 #: ../fish/guestfish-actions.pod:5131
16272 " write path content\n"
16277 #: ../fish/guestfish-actions.pod:5133 ../src/guestfs-actions.pod:7827
16279 "This call creates a file called C<path>. The content of the file is the "
16280 "string C<content> (which can contain any 8 bit data)."
16284 #: ../fish/guestfish-actions.pod:5136
16285 msgid "See also L</write-append>."
16289 #: ../fish/guestfish-actions.pod:5141
16290 msgid "write-append"
16294 #: ../fish/guestfish-actions.pod:5143
16297 " write-append path content\n"
16302 #: ../fish/guestfish-actions.pod:5145 ../src/guestfs-actions.pod:7847
16304 "This call appends C<content> to the end of file C<path>. If C<path> does "
16305 "not exist, then a new file is created."
16309 #: ../fish/guestfish-actions.pod:5148
16310 msgid "See also L</write>."
16314 #: ../fish/guestfish-actions.pod:5153
16319 #: ../fish/guestfish-actions.pod:5155
16322 " write-file path content size\n"
16327 #: ../fish/guestfish-actions.pod:5157 ../src/guestfs-actions.pod:7874
16329 "This call creates a file called C<path>. The contents of the file is the "
16330 "string C<content> (which can contain any 8 bit data), with length C<size>."
16334 #: ../fish/guestfish-actions.pod:5161 ../src/guestfs-actions.pod:7878
16336 "As a special case, if C<size> is C<0> then the length is calculated using "
16337 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16341 #: ../fish/guestfish-actions.pod:5165 ../src/guestfs-actions.pod:7882
16343 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16344 "I<not> work, even if the length is specified."
16348 #: ../fish/guestfish-actions.pod:5171
16349 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16353 #: ../fish/guestfish-actions.pod:5178
16358 #: ../fish/guestfish-actions.pod:5180
16361 " zegrep regex path\n"
16366 #: ../fish/guestfish-actions.pod:5182 ../src/guestfs-actions.pod:7899
16367 msgid "This calls the external C<zegrep> program and returns the matching lines."
16371 #: ../fish/guestfish-actions.pod:5188
16376 #: ../fish/guestfish-actions.pod:5190
16379 " zegrepi regex path\n"
16384 #: ../fish/guestfish-actions.pod:5192 ../src/guestfs-actions.pod:7918
16385 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16389 #: ../fish/guestfish-actions.pod:5198
16394 #: ../fish/guestfish-actions.pod:5200
16402 #: ../fish/guestfish-actions.pod:5202 ../src/guestfs-actions.pod:7936
16403 msgid "This command writes zeroes over the first few blocks of C<device>."
16407 #: ../fish/guestfish-actions.pod:5204 ../src/guestfs-actions.pod:7938
16409 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16410 "securely wipe the device). It should be sufficient to remove any partition "
16411 "tables, filesystem superblocks and so on."
16415 #: ../fish/guestfish-actions.pod:5208 ../fish/guestfish-actions.pod:5223 ../src/guestfs-actions.pod:7942 ../src/guestfs-actions.pod:7968
16417 "If blocks are already zero, then this command avoids writing zeroes. This "
16418 "prevents the underlying device from becoming non-sparse or growing "
16423 #: ../fish/guestfish-actions.pod:5212
16424 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16428 #: ../fish/guestfish-actions.pod:5215
16429 msgid "zero-device"
16433 #: ../fish/guestfish-actions.pod:5217
16436 " zero-device device\n"
16441 #: ../fish/guestfish-actions.pod:5219
16443 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16444 "which just zeroes the first few blocks of a device."
16448 #: ../fish/guestfish-actions.pod:5230
16453 #: ../fish/guestfish-actions.pod:5232
16456 " zerofree device\n"
16461 #: ../fish/guestfish-actions.pod:5234 ../src/guestfs-actions.pod:7990
16463 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16464 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16465 "possible to compress the filesystem more effectively."
16469 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:7995
16470 msgid "You should B<not> run this program if the filesystem is mounted."
16474 #: ../fish/guestfish-actions.pod:5242 ../src/guestfs-actions.pod:7998
16476 "It is possible that using this program can damage the filesystem or data on "
16481 #: ../fish/guestfish-actions.pod:5245
16486 #: ../fish/guestfish-actions.pod:5247
16489 " zfgrep pattern path\n"
16494 #: ../fish/guestfish-actions.pod:5249 ../src/guestfs-actions.pod:8012
16495 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16499 #: ../fish/guestfish-actions.pod:5255
16504 #: ../fish/guestfish-actions.pod:5257
16507 " zfgrepi pattern path\n"
16512 #: ../fish/guestfish-actions.pod:5259 ../src/guestfs-actions.pod:8031
16513 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16517 #: ../fish/guestfish-actions.pod:5265
16522 #: ../fish/guestfish-actions.pod:5267
16525 " zfile meth path\n"
16530 #: ../fish/guestfish-actions.pod:5269 ../src/guestfs-actions.pod:8057
16531 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16535 #: ../fish/guestfish-actions.pod:5272 ../src/guestfs-actions.pod:8060
16536 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16540 #: ../fish/guestfish-actions.pod:5274
16541 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16545 #: ../fish/guestfish-actions.pod:5277
16546 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16550 #: ../fish/guestfish-actions.pod:5284
16555 #: ../fish/guestfish-actions.pod:5286
16558 " zgrep regex path\n"
16563 #: ../fish/guestfish-actions.pod:5288 ../src/guestfs-actions.pod:8077
16564 msgid "This calls the external C<zgrep> program and returns the matching lines."
16568 #: ../fish/guestfish-actions.pod:5294
16573 #: ../fish/guestfish-actions.pod:5296
16576 " zgrepi regex path\n"
16581 #: ../fish/guestfish-actions.pod:5298 ../src/guestfs-actions.pod:8096
16582 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16586 #: ../fish/guestfish-commands.pod:1
16591 #: ../fish/guestfish-commands.pod:3
16596 #: ../fish/guestfish-commands.pod:5
16599 " alloc filename size\n"
16604 #: ../fish/guestfish-commands.pod:7
16606 "This creates an empty (zeroed) file of the given size, and then adds so it "
16607 "can be further examined."
16611 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16612 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16616 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16617 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16621 #: ../fish/guestfish-commands.pod:14
16623 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16624 "image, see L</PREPARED DISK IMAGES>."
16628 #: ../fish/guestfish-commands.pod:17
16633 #: ../fish/guestfish-commands.pod:19
16636 " copy-in local [local ...] /remotedir\n"
16641 #: ../fish/guestfish-commands.pod:21
16643 "C<copy-in> copies local files or directories recursively into the disk "
16644 "image, placing them in the directory called C</remotedir> (which must "
16645 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16646 "other commands as necessary."
16650 #: ../fish/guestfish-commands.pod:26
16652 "Multiple local files and directories can be specified, but the last "
16653 "parameter must always be a remote directory. Wildcards cannot be used."
16657 #: ../fish/guestfish-commands.pod:30
16662 #: ../fish/guestfish-commands.pod:32
16665 " copy-out remote [remote ...] localdir\n"
16670 #: ../fish/guestfish-commands.pod:34
16672 "C<copy-out> copies remote files or directories recursively out of the disk "
16673 "image, placing them on the host disk in a local directory called C<localdir> "
16674 "(which must exist). This guestfish meta-command turns into a sequence of "
16675 "L</download>, L</tar-out> and other commands as necessary."
16679 #: ../fish/guestfish-commands.pod:40
16681 "Multiple remote files and directories can be specified, but the last "
16682 "parameter must always be a local directory. To download to the current "
16683 "directory, use C<.> as in:"
16687 #: ../fish/guestfish-commands.pod:44
16690 " copy-out /home .\n"
16695 #: ../fish/guestfish-commands.pod:46
16697 "Wildcards cannot be used in the ordinary command, but you can use them with "
16698 "the help of L</glob> like this:"
16702 #: ../fish/guestfish-commands.pod:49
16705 " glob copy-out /home/* .\n"
16710 #: ../fish/guestfish-commands.pod:51
16715 #: ../fish/guestfish-commands.pod:53
16718 " display filename\n"
16723 #: ../fish/guestfish-commands.pod:55
16725 "Use C<display> (a graphical display program) to display an image file. It "
16726 "downloads the file, and runs C<display> on it."
16730 #: ../fish/guestfish-commands.pod:58
16732 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16733 "environment variable. For example to use the GNOME display program:"
16737 #: ../fish/guestfish-commands.pod:61
16740 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16745 #: ../fish/guestfish-commands.pod:63
16746 msgid "See also L<display(1)>."
16750 #: ../fish/guestfish-commands.pod:65
16755 #: ../fish/guestfish-commands.pod:67
16758 " echo [params ...]\n"
16763 #: ../fish/guestfish-commands.pod:69
16764 msgid "This echos the parameters to the terminal."
16768 #: ../fish/guestfish-commands.pod:71
16773 #: ../fish/guestfish-commands.pod:73
16778 #: ../fish/guestfish-commands.pod:75
16783 #: ../fish/guestfish-commands.pod:77
16791 #: ../fish/guestfish-commands.pod:79
16793 "This is used to edit a file. It downloads the file, edits it locally using "
16794 "your editor, then uploads the result."
16798 #: ../fish/guestfish-commands.pod:82
16800 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16801 "or C<emacs> you will get those corresponding editors."
16805 #: ../fish/guestfish-commands.pod:86
16810 #: ../fish/guestfish-commands.pod:88
16813 " glob command args...\n"
16818 #: ../fish/guestfish-commands.pod:90
16820 "Expand wildcards in any paths in the args list, and run C<command> "
16821 "repeatedly on each matching path."
16825 #: ../fish/guestfish-commands.pod:93
16826 msgid "See L</WILDCARDS AND GLOBBING>."
16830 #: ../fish/guestfish-commands.pod:95
16835 #: ../fish/guestfish-commands.pod:97
16838 " hexedit <filename|device>\n"
16839 " hexedit <filename|device> <max>\n"
16840 " hexedit <filename|device> <start> <max>\n"
16845 #: ../fish/guestfish-commands.pod:101
16847 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
16852 #: ../fish/guestfish-commands.pod:104
16854 "This command works by downloading potentially the whole file or device, "
16855 "editing it locally, then uploading it. If the file or device is large, you "
16856 "have to specify which part you wish to edit by using C<max> and/or C<start> "
16857 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
16858 "usual modifiers allowed such as C<1M> (1 megabyte)."
16862 #: ../fish/guestfish-commands.pod:111
16863 msgid "For example to edit the first few sectors of a disk you might do:"
16867 #: ../fish/guestfish-commands.pod:114
16870 " hexedit /dev/sda 1M\n"
16875 #: ../fish/guestfish-commands.pod:116
16877 "which would allow you to edit anywhere within the first megabyte of the "
16882 #: ../fish/guestfish-commands.pod:119
16883 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
16887 #: ../fish/guestfish-commands.pod:121
16890 " hexedit /dev/sda1 0x400 0x400\n"
16895 #: ../fish/guestfish-commands.pod:123
16896 msgid "(assuming the superblock is in the standard location)."
16900 #: ../fish/guestfish-commands.pod:125
16902 "This command requires the external L<hexedit(1)> program. You can specify "
16903 "another program to use by setting the C<HEXEDITOR> environment variable."
16907 #: ../fish/guestfish-commands.pod:129
16908 msgid "See also L</hexdump>."
16912 #: ../fish/guestfish-commands.pod:131
16917 #: ../fish/guestfish-commands.pod:133
16925 #: ../fish/guestfish-commands.pod:135
16926 msgid "Change the local directory, ie. the current directory of guestfish itself."
16930 #: ../fish/guestfish-commands.pod:138
16931 msgid "Note that C<!cd> won't do what you might expect."
16935 #: ../fish/guestfish-commands.pod:140
16940 #: ../fish/guestfish-commands.pod:142
16945 #: ../fish/guestfish-commands.pod:144
16953 #: ../fish/guestfish-commands.pod:146
16954 msgid "Opens the manual page for guestfish."
16958 #: ../fish/guestfish-commands.pod:148
16963 #: ../fish/guestfish-commands.pod:150
16968 #: ../fish/guestfish-commands.pod:152
16976 #: ../fish/guestfish-commands.pod:154
16984 #: ../fish/guestfish-commands.pod:156
16985 msgid "This is used to view a file."
16989 #: ../fish/guestfish-commands.pod:158
16991 "The default viewer is C<$PAGER>. However if you use the alternate command "
16992 "C<less> you will get the C<less> command specifically."
16996 #: ../fish/guestfish-commands.pod:161
17001 #: ../fish/guestfish-commands.pod:163
17009 #: ../fish/guestfish-commands.pod:165
17011 "Close and reopen the libguestfs handle. It is not necessary to use this "
17012 "normally, because the handle is closed properly when guestfish exits. "
17013 "However this is occasionally useful for testing."
17017 #: ../fish/guestfish-commands.pod:169
17022 #: ../fish/guestfish-commands.pod:171
17025 " setenv VAR value\n"
17030 #: ../fish/guestfish-commands.pod:173
17031 msgid "Set the environment variable C<VAR> to the string C<value>."
17035 #: ../fish/guestfish-commands.pod:175
17036 msgid "To print the value of an environment variable use a shell command such as:"
17040 #: ../fish/guestfish-commands.pod:178
17048 #: ../fish/guestfish-commands.pod:180
17053 #: ../fish/guestfish-commands.pod:182
17056 " sparse filename size\n"
17061 #: ../fish/guestfish-commands.pod:184
17063 "This creates an empty sparse file of the given size, and then adds so it can "
17064 "be further examined."
17068 #: ../fish/guestfish-commands.pod:187
17070 "In all respects it works the same as the L</alloc> command, except that the "
17071 "image file is allocated sparsely, which means that disk blocks are not "
17072 "assigned to the file until they are needed. Sparse disk files only use "
17073 "space when written to, but they are slower and there is a danger you could "
17074 "run out of real disk space during a write operation."
17078 #: ../fish/guestfish-commands.pod:197
17083 #: ../fish/guestfish-commands.pod:199
17091 #: ../fish/guestfish-commands.pod:201
17093 "This command returns a list of the optional groups known to the daemon, and "
17094 "indicates which ones are supported by this build of the libguestfs "
17099 #: ../fish/guestfish-commands.pod:205
17100 msgid "See also L<guestfs(3)/AVAILABILITY>."
17104 #: ../fish/guestfish-commands.pod:207
17109 #: ../fish/guestfish-commands.pod:209
17112 " time command args...\n"
17117 #: ../fish/guestfish-commands.pod:211
17119 "Run the command as usual, but print the elapsed time afterwards. This can "
17120 "be useful for benchmarking operations."
17124 #: ../fish/guestfish-commands.pod:214
17129 #: ../fish/guestfish-commands.pod:216
17137 #: ../fish/guestfish-commands.pod:218
17138 msgid "Remove C<VAR> from the environment."
17142 #: ../fish/guestfish.pod:5
17143 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17147 #: ../fish/guestfish.pod:9
17150 " guestfish [--options] [commands]\n"
17155 #: ../fish/guestfish.pod:11
17163 #: ../fish/guestfish.pod:13
17166 " guestfish [--ro|--rw] -a disk.img\n"
17171 #: ../fish/guestfish.pod:15
17174 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17179 #: ../fish/guestfish.pod:17
17182 " guestfish -d libvirt-domain\n"
17187 #: ../fish/guestfish.pod:19
17190 " guestfish [--ro|--rw] -a disk.img -i\n"
17195 #: ../fish/guestfish.pod:21
17198 " guestfish -d libvirt-domain -i\n"
17203 #: ../fish/guestfish.pod:25
17205 "Using guestfish in read/write mode on live virtual machines can be "
17206 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17207 "option to use guestfish safely if the disk image or virtual machine might be "
17212 #: ../fish/guestfish.pod:32
17214 "Guestfish is a shell and command-line tool for examining and modifying "
17215 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17216 "functionality of the guestfs API, see L<guestfs(3)>."
17220 #: ../fish/guestfish.pod:36
17222 "Guestfish gives you structured access to the libguestfs API, from shell "
17223 "scripts or the command line or interactively. If you want to rescue a "
17224 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17229 #: ../fish/guestfish.pod:43
17230 msgid "As an interactive shell"
17234 #: ../fish/guestfish.pod:45
17242 #: ../fish/guestfish.pod:47
17245 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17246 " editing virtual machine filesystems.\n"
17251 #: ../fish/guestfish.pod:50
17254 " Type: 'help' for a list of commands\n"
17255 " 'man' to read the manual\n"
17256 " 'quit' to quit the shell\n"
17261 #: ../fish/guestfish.pod:54
17264 " ><fs> add-ro disk.img\n"
17266 " ><fs> list-filesystems\n"
17267 " /dev/sda1: ext4\n"
17268 " /dev/vg_guest/lv_root: ext4\n"
17269 " /dev/vg_guest/lv_swap: swap\n"
17270 " ><fs> mount /dev/vg_guest/lv_root /\n"
17271 " ><fs> cat /etc/fstab\n"
17273 " # Created by anaconda\n"
17280 #: ../fish/guestfish.pod:67
17281 msgid "From shell scripts"
17285 #: ../fish/guestfish.pod:69
17286 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17290 #: ../fish/guestfish.pod:71
17293 " guestfish <<_EOF_\n"
17296 " mount /dev/vg_guest/lv_root /\n"
17297 " write /etc/motd \"Welcome, new users\"\n"
17303 #: ../fish/guestfish.pod:78
17304 msgid "List the LVM logical volumes in a disk image:"
17308 #: ../fish/guestfish.pod:80
17311 " guestfish -a disk.img --ro <<_EOF_\n"
17319 #: ../fish/guestfish.pod:85
17320 msgid "List all the filesystems in a disk image:"
17324 #: ../fish/guestfish.pod:87
17327 " guestfish -a disk.img --ro <<_EOF_\n"
17329 " list-filesystems\n"
17335 #: ../fish/guestfish.pod:92
17336 msgid "On one command line"
17340 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17341 msgid "Update C</etc/resolv.conf> in a guest:"
17345 #: ../fish/guestfish.pod:96
17349 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17350 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17355 #: ../fish/guestfish.pod:100
17356 msgid "Edit C</boot/grub/grub.conf> interactively:"
17360 #: ../fish/guestfish.pod:102
17363 " guestfish --rw --add disk.img \\\n"
17364 " --mount /dev/vg_guest/lv_root \\\n"
17365 " --mount /dev/sda1:/boot \\\n"
17366 " edit /boot/grub/grub.conf\n"
17371 #: ../fish/guestfish.pod:107
17372 msgid "Mount disks automatically"
17376 #: ../fish/guestfish.pod:109
17378 "Use the I<-i> option to automatically mount the disks from a virtual "
17383 #: ../fish/guestfish.pod:112
17386 " guestfish --ro -a disk.img -i cat /etc/group\n"
17391 #: ../fish/guestfish.pod:114
17394 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17399 #: ../fish/guestfish.pod:116
17400 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17404 #: ../fish/guestfish.pod:118
17407 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17412 #: ../fish/guestfish.pod:120
17413 msgid "As a script interpreter"
17417 #: ../fish/guestfish.pod:122
17418 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17422 #: ../fish/guestfish.pod:124
17425 " #!/usr/bin/guestfish -f\n"
17426 " sparse test1.img 100M\n"
17428 " part-disk /dev/sda mbr\n"
17429 " mkfs ext2 /dev/sda1\n"
17434 #: ../fish/guestfish.pod:130
17435 msgid "Start with a prepared disk"
17439 #: ../fish/guestfish.pod:132
17441 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17442 "single ext2-formatted partition:"
17446 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
17449 " guestfish -N fs\n"
17454 #: ../fish/guestfish.pod:137
17455 msgid "To list what is available do:"
17459 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
17462 " guestfish -N help | less\n"
17467 #: ../fish/guestfish.pod:141
17468 msgid "Remote control"
17472 #: ../fish/guestfish.pod:143
17475 " eval \"`guestfish --listen`\"\n"
17476 " guestfish --remote add-ro disk.img\n"
17477 " guestfish --remote run\n"
17478 " guestfish --remote lvs\n"
17483 #: ../fish/guestfish.pod:154
17484 msgid "Displays general help on options."
17488 #: ../fish/guestfish.pod:158
17489 msgid "B<--cmd-help>"
17493 #: ../fish/guestfish.pod:160
17494 msgid "Lists all available guestfish commands."
17498 #: ../fish/guestfish.pod:162
17503 #: ../fish/guestfish.pod:164
17504 msgid "B<--cmd-help cmd>"
17508 #: ../fish/guestfish.pod:166
17509 msgid "Displays detailed help on a single command C<cmd>."
17513 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
17514 msgid "B<-a image>"
17518 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
17519 msgid "B<--add image>"
17523 #: ../fish/guestfish.pod:172
17524 msgid "Add a block device or virtual machine image to the shell."
17528 #: ../fish/guestfish.pod:177
17530 "Using this flag is mostly equivalent to using the C<add> command, with "
17531 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17532 "the I<--format=...> flag was given."
17536 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
17538 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17539 "URI to use. The default is to use the default libvirt connection."
17543 #: ../fish/guestfish.pod:189
17548 #: ../fish/guestfish.pod:191
17550 "If using the I<--listen> option and a csh-like shell, use this option. See "
17551 "section L</REMOTE CONTROL AND CSH> below."
17555 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
17556 msgid "B<-d libvirt-domain>"
17560 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
17561 msgid "B<--domain libvirt-domain>"
17565 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
17567 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17568 "used, then any libvirt domain can be used. However in write mode, only "
17569 "libvirt domains which are shut down can be named here."
17573 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
17574 msgid "Domain UUIDs can be used instead of names."
17578 #: ../fish/guestfish.pod:204
17580 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17581 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17582 "if the I<--format:...> flag was given."
17586 #: ../fish/guestfish.pod:208
17591 #: ../fish/guestfish.pod:210
17592 msgid "B<--no-dest-paths>"
17596 #: ../fish/guestfish.pod:212
17598 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17599 "to hit the tab key to complete paths on the guest filesystem, but this "
17600 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17601 "allow this feature to be disabled."
17605 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
17607 "When prompting for keys and passphrases, guestfish normally turns echoing "
17608 "off so you cannot see what you are typing. If you are not worried about "
17609 "Tempest attacks and there is no one else in the room you can specify this "
17610 "flag to see what you are typing."
17614 #: ../fish/guestfish.pod:224
17619 #: ../fish/guestfish.pod:226
17620 msgid "B<--file file>"
17624 #: ../fish/guestfish.pod:228
17625 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17629 #: ../fish/guestfish.pod:231
17632 " #!/usr/bin/guestfish -f\n"
17637 #: ../fish/guestfish.pod:244
17640 " guestfish --format=raw -a disk.img\n"
17645 #: ../fish/guestfish.pod:248
17648 " guestfish --format=raw -a disk.img --format -a another.img\n"
17653 #: ../fish/guestfish.pod:253
17655 "If you have untrusted raw-format guest disk images, you should use this "
17656 "option to specify the disk format. This avoids a possible security problem "
17657 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17661 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
17662 msgid "B<--inspector>"
17666 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
17668 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17669 "system and mount filesystems as they would be mounted on the real virtual "
17674 #: ../fish/guestfish.pod:266
17675 msgid "Typical usage is either:"
17679 #: ../fish/guestfish.pod:268
17682 " guestfish -d myguest -i\n"
17687 #: ../fish/guestfish.pod:270
17688 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17692 #: ../fish/guestfish.pod:272
17695 " guestfish --ro -d myguest -i\n"
17700 #: ../fish/guestfish.pod:274
17701 msgid "(for active domains, readonly), or specify the block device directly:"
17705 #: ../fish/guestfish.pod:276
17708 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17713 #: ../fish/guestfish.pod:278
17715 "Note that the command line syntax changed slightly over older versions of "
17716 "guestfish. You can still use the old syntax:"
17720 #: ../fish/guestfish.pod:281
17723 " guestfish [--ro] -i disk.img\n"
17728 #: ../fish/guestfish.pod:283
17731 " guestfish [--ro] -i libvirt-domain\n"
17736 #: ../fish/guestfish.pod:285
17738 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17739 "then using other commands to mount the filesystems that were found."
17743 #: ../fish/guestfish.pod:294
17744 msgid "B<--listen>"
17748 #: ../fish/guestfish.pod:296
17750 "Fork into the background and listen for remote commands. See section "
17751 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17755 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
17760 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
17762 "Connect to a live virtual machine. (Experimental, see "
17763 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
17767 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
17768 msgid "B<-m dev[:mountpoint[:options]]>"
17772 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
17773 msgid "B<--mount dev[:mountpoint[:options]]>"
17777 #: ../fish/guestfish.pod:308
17778 msgid "Mount the named partition or logical volume on the given mountpoint."
17782 #: ../fish/guestfish.pod:310
17783 msgid "If the mountpoint is omitted, it defaults to C</>."
17787 #: ../fish/guestfish.pod:312
17788 msgid "You have to mount something on C</> before most commands will work."
17792 #: ../fish/guestfish.pod:314
17794 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17799 #: ../fish/guestfish.pod:317
17801 "If you don't know what filesystems a disk image contains, you can either run "
17802 "guestfish without this option, then list the partitions, filesystems and LVs "
17803 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17804 "commands), or you can use the L<virt-filesystems(1)> program."
17808 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
17810 "The third (and rarely used) part of the mount parameter is the list of mount "
17811 "options used to mount the underlying filesystem. If this is not given, then "
17812 "the mount options are either the empty string or C<ro> (the latter if the "
17813 "I<--ro> flag is used). By specifying the mount options, you override this "
17814 "default choice. Probably the only time you would use this is to enable ACLs "
17815 "and/or extended attributes if the filesystem can support them:"
17819 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
17822 " -m /dev/sda1:/:acl,user_xattr\n"
17827 #: ../fish/guestfish.pod:333
17828 msgid "Using this flag is equivalent to using the C<mount-options> command."
17832 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:358
17837 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
17838 msgid "B<--no-sync>"
17842 #: ../fish/guestfish.pod:339
17844 "Disable autosync. This is enabled by default. See the discussion of "
17845 "autosync in the L<guestfs(3)> manpage."
17849 #: ../fish/guestfish.pod:342
17854 #: ../fish/guestfish.pod:344
17855 msgid "B<--new type>"
17859 #: ../fish/guestfish.pod:346
17864 #: ../fish/guestfish.pod:348
17866 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17867 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17868 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17873 #: ../fish/guestfish.pod:353
17874 msgid "B<--progress-bars>"
17878 #: ../fish/guestfish.pod:355
17879 msgid "Enable progress bars, even when guestfish is used non-interactively."
17883 #: ../fish/guestfish.pod:357
17885 "Progress bars are enabled by default when guestfish is used as an "
17886 "interactive shell."
17890 #: ../fish/guestfish.pod:360
17891 msgid "B<--no-progress-bars>"
17895 #: ../fish/guestfish.pod:362
17896 msgid "Disable progress bars."
17900 #: ../fish/guestfish.pod:364
17901 msgid "B<--remote[=pid]>"
17905 #: ../fish/guestfish.pod:366
17907 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17908 "CONTROL GUESTFISH OVER A SOCKET> below."
17912 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:161
17917 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:163
17922 #: ../fish/guestfish.pod:373
17924 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17925 "mounts are done read-only."
17929 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
17931 "The option must always be used if the disk image or virtual machine might be "
17932 "running, and is generally recommended in cases where you don't need write "
17933 "access to the disk."
17937 #: ../fish/guestfish.pod:380
17939 "Note that prepared disk images created with I<-N> are not affected by this "
17940 "option. Also commands like C<add> are not affected - you have to specify "
17941 "the C<readonly:true> option explicitly if you need it."
17945 #: ../fish/guestfish.pod:384
17946 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17950 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:173
17951 msgid "B<--selinux>"
17955 #: ../fish/guestfish.pod:388
17956 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17960 #: ../fish/guestfish.pod:394
17962 "Enable very verbose messages. This is particularly useful if you find a "
17967 #: ../fish/guestfish.pod:401
17968 msgid "Display the guestfish / libguestfs version number and exit."
17972 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:194
17977 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:196
17982 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
17984 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17985 "mounts are done read-write."
17989 #: ../fish/guestfish.pod:410
17990 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
17994 #: ../fish/guestfish.pod:414
17995 msgid "Echo each command before executing it."
17999 #: ../fish/guestfish.pod:418
18000 msgid "COMMANDS ON COMMAND LINE"
18004 #: ../fish/guestfish.pod:420
18005 msgid "Any additional (non-option) arguments are treated as commands to execute."
18009 #: ../fish/guestfish.pod:423
18011 "Commands to execute should be separated by a colon (C<:>), where the colon "
18012 "is a separate parameter. Thus:"
18016 #: ../fish/guestfish.pod:426
18019 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18024 #: ../fish/guestfish.pod:428
18026 "If there are no additional arguments, then we enter a shell, either an "
18027 "interactive shell with a prompt (if the input is a terminal) or a "
18028 "non-interactive shell."
18032 #: ../fish/guestfish.pod:432
18034 "In either command line mode or non-interactive shell, the first command that "
18035 "gives an error causes the whole shell to exit. In interactive mode (with a "
18036 "prompt) if a command fails, you can continue to enter commands."
18040 #: ../fish/guestfish.pod:437
18041 msgid "USING launch (OR run)"
18045 #: ../fish/guestfish.pod:439
18047 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18048 "then launch it, then mount any disks you need, and finally issue "
18049 "actions/commands. So the general order of the day is:"
18053 #: ../fish/guestfish.pod:447
18054 msgid "add or -a/--add"
18058 #: ../fish/guestfish.pod:451
18059 msgid "launch (aka run)"
18063 #: ../fish/guestfish.pod:455
18064 msgid "mount or -m/--mount"
18068 #: ../fish/guestfish.pod:459
18069 msgid "any other commands"
18073 #: ../fish/guestfish.pod:463
18075 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18076 "guest before mounting or performing any other commands."
18080 #: ../fish/guestfish.pod:466
18082 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18083 "I<--new> options were given then C<run> is done automatically, simply "
18084 "because guestfish can't perform the action you asked for without doing this."
18088 #: ../fish/guestfish.pod:471
18089 msgid "OPENING DISKS FOR READ AND WRITE"
18093 #: ../fish/guestfish.pod:473
18095 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18096 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18097 "I<-i> and I<-m> open disk images read-only or for writing."
18101 #: ../fish/guestfish.pod:478
18103 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18104 "opening disk images supplied on the command line for write. To open a disk "
18105 "image read-only you have to do I<-a image --ro>."
18109 #: ../fish/guestfish.pod:482
18111 "This matters: If you accidentally open a live VM disk image writable then "
18112 "you will cause irreversible disk corruption."
18116 #: ../fish/guestfish.pod:485
18118 "In a future libguestfs we intend to change the default the other way. Disk "
18119 "images will be opened read-only. You will have to either specify "
18120 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18121 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18122 "access for disk images specified by those other command line options."
18126 #: ../fish/guestfish.pod:492
18128 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18129 "which does nothing (it is already the default). However it is highly "
18130 "recommended that you use this option to indicate that you need write access, "
18131 "and prepare your scripts for the day when this option will be required for "
18136 #: ../fish/guestfish.pod:498
18138 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18139 "other libguestfs program apart from guestfish and guestmount."
18143 #: ../fish/guestfish.pod:501
18148 #: ../fish/guestfish.pod:503
18150 "You can quote ordinary parameters using either single or double quotes. For "
18155 #: ../fish/guestfish.pod:506
18158 " add \"file with a space.img\"\n"
18163 #: ../fish/guestfish.pod:508
18166 " rm '/file name'\n"
18171 #: ../fish/guestfish.pod:510
18179 #: ../fish/guestfish.pod:512
18181 "A few commands require a list of strings to be passed. For these, use a "
18182 "whitespace-separated list, enclosed in quotes. Strings containing "
18183 "whitespace to be passed through must be enclosed in single quotes. A "
18184 "literal single quote must be escaped with a backslash."
18188 #: ../fish/guestfish.pod:517
18191 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18192 " command \"/bin/echo 'foo bar'\"\n"
18193 " command \"/bin/echo \\'foo\\'\"\n"
18198 #: ../fish/guestfish.pod:521
18199 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18203 #: ../fish/guestfish.pod:523
18205 "In double-quoted arguments (only) use backslash to insert special "
18210 #: ../fish/guestfish.pod:528
18215 #: ../fish/guestfish.pod:530
18216 msgid "Alert (bell) character."
18220 #: ../fish/guestfish.pod:532
18225 #: ../fish/guestfish.pod:534
18226 msgid "Backspace character."
18230 #: ../fish/guestfish.pod:536
18235 #: ../fish/guestfish.pod:538
18236 msgid "Form feed character."
18240 #: ../fish/guestfish.pod:540
18245 #: ../fish/guestfish.pod:542
18246 msgid "Newline character."
18250 #: ../fish/guestfish.pod:544
18255 #: ../fish/guestfish.pod:546
18256 msgid "Carriage return character."
18260 #: ../fish/guestfish.pod:548
18265 #: ../fish/guestfish.pod:550
18266 msgid "Horizontal tab character."
18270 #: ../fish/guestfish.pod:552
18275 #: ../fish/guestfish.pod:554
18276 msgid "Vertical tab character."
18280 #: ../fish/guestfish.pod:556
18285 #: ../fish/guestfish.pod:558
18286 msgid "A literal double quote character."
18290 #: ../fish/guestfish.pod:560
18295 #: ../fish/guestfish.pod:562
18297 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18302 #: ../fish/guestfish.pod:565
18307 #: ../fish/guestfish.pod:567
18308 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18312 #: ../fish/guestfish.pod:570
18314 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18319 #: ../fish/guestfish.pod:573
18324 #: ../fish/guestfish.pod:575
18325 msgid "A literal backslash character."
18329 #: ../fish/guestfish.pod:579
18330 msgid "OPTIONAL ARGUMENTS"
18334 #: ../fish/guestfish.pod:581
18336 "Some commands take optional arguments. These arguments appear in this "
18337 "documentation as C<[argname:..]>. You can use them as in these examples:"
18341 #: ../fish/guestfish.pod:585
18344 " add-drive-opts filename\n"
18349 #: ../fish/guestfish.pod:587
18352 " add-drive-opts filename readonly:true\n"
18357 #: ../fish/guestfish.pod:589
18360 " add-drive-opts filename format:qcow2 readonly:false\n"
18365 #: ../fish/guestfish.pod:591
18367 "Each optional argument can appear at most once. All optional arguments must "
18368 "appear after the required ones."
18372 #: ../fish/guestfish.pod:594
18377 #: ../fish/guestfish.pod:596
18378 msgid "This section applies to all commands which can take integers as parameters."
18382 #: ../fish/guestfish.pod:599
18383 msgid "SIZE SUFFIX"
18387 #: ../fish/guestfish.pod:601
18389 "When the command takes a parameter measured in bytes, you can use one of the "
18390 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18394 #: ../fish/guestfish.pod:607
18395 msgid "B<k> or B<K> or B<KiB>"
18399 #: ../fish/guestfish.pod:609
18400 msgid "The size in kilobytes (multiplied by 1024)."
18404 #: ../fish/guestfish.pod:611
18409 #: ../fish/guestfish.pod:613
18410 msgid "The size in SI 1000 byte units."
18414 #: ../fish/guestfish.pod:615
18415 msgid "B<M> or B<MiB>"
18419 #: ../fish/guestfish.pod:617
18420 msgid "The size in megabytes (multiplied by 1048576)."
18424 #: ../fish/guestfish.pod:619
18429 #: ../fish/guestfish.pod:621
18430 msgid "The size in SI 1000000 byte units."
18434 #: ../fish/guestfish.pod:623
18435 msgid "B<G> or B<GiB>"
18439 #: ../fish/guestfish.pod:625
18440 msgid "The size in gigabytes (multiplied by 2**30)."
18444 #: ../fish/guestfish.pod:627
18449 #: ../fish/guestfish.pod:629
18450 msgid "The size in SI 10**9 byte units."
18454 #: ../fish/guestfish.pod:631
18455 msgid "B<T> or B<TiB>"
18459 #: ../fish/guestfish.pod:633
18460 msgid "The size in terabytes (multiplied by 2**40)."
18464 #: ../fish/guestfish.pod:635
18469 #: ../fish/guestfish.pod:637
18470 msgid "The size in SI 10**12 byte units."
18474 #: ../fish/guestfish.pod:639
18475 msgid "B<P> or B<PiB>"
18479 #: ../fish/guestfish.pod:641
18480 msgid "The size in petabytes (multiplied by 2**50)."
18484 #: ../fish/guestfish.pod:643
18489 #: ../fish/guestfish.pod:645
18490 msgid "The size in SI 10**15 byte units."
18494 #: ../fish/guestfish.pod:647
18495 msgid "B<E> or B<EiB>"
18499 #: ../fish/guestfish.pod:649
18500 msgid "The size in exabytes (multiplied by 2**60)."
18504 #: ../fish/guestfish.pod:651
18509 #: ../fish/guestfish.pod:653
18510 msgid "The size in SI 10**18 byte units."
18514 #: ../fish/guestfish.pod:655
18515 msgid "B<Z> or B<ZiB>"
18519 #: ../fish/guestfish.pod:657
18520 msgid "The size in zettabytes (multiplied by 2**70)."
18524 #: ../fish/guestfish.pod:659
18529 #: ../fish/guestfish.pod:661
18530 msgid "The size in SI 10**21 byte units."
18534 #: ../fish/guestfish.pod:663
18535 msgid "B<Y> or B<YiB>"
18539 #: ../fish/guestfish.pod:665
18540 msgid "The size in yottabytes (multiplied by 2**80)."
18544 #: ../fish/guestfish.pod:667
18549 #: ../fish/guestfish.pod:669
18550 msgid "The size in SI 10**24 byte units."
18554 #: ../fish/guestfish.pod:675
18557 " truncate-size /file 1G\n"
18562 #: ../fish/guestfish.pod:677
18563 msgid "would truncate the file to 1 gigabyte."
18567 #: ../fish/guestfish.pod:679
18569 "Be careful because a few commands take sizes in kilobytes or megabytes "
18570 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18571 "Adding a suffix will probably not do what you expect."
18575 #: ../fish/guestfish.pod:683
18576 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18580 #: ../fish/guestfish.pod:685
18582 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18583 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18587 #: ../fish/guestfish.pod:688
18590 " 1234 decimal number 1234\n"
18591 " 02322 octal number, equivalent to decimal 1234\n"
18592 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18597 #: ../fish/guestfish.pod:692
18599 "When using the C<chmod> command, you almost always want to specify an octal "
18600 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18601 "L<chmod(1)> program):"
18605 #: ../fish/guestfish.pod:696
18608 " chmod 0777 /public # OK\n"
18609 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18614 #: ../fish/guestfish.pod:699
18616 "Commands that return numbers usually print them in decimal, but some "
18617 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18618 "octal, preceeded by C<0>)."
18622 #: ../fish/guestfish.pod:703
18623 msgid "WILDCARDS AND GLOBBING"
18627 #: ../fish/guestfish.pod:705
18629 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18630 "(globbing) by default. So for example the following will not do what you "
18635 #: ../fish/guestfish.pod:709
18643 #: ../fish/guestfish.pod:711
18645 "Assuming you don't have a directory called literally C</home/*> then the "
18646 "above command will return an error."
18650 #: ../fish/guestfish.pod:714
18651 msgid "To perform wildcard expansion, use the C<glob> command."
18655 #: ../fish/guestfish.pod:716
18658 " glob rm-rf /home/*\n"
18663 #: ../fish/guestfish.pod:718
18665 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18666 "many times), equivalent to:"
18670 #: ../fish/guestfish.pod:721
18673 " rm-rf /home/jim\n"
18674 " rm-rf /home/joe\n"
18675 " rm-rf /home/mary\n"
18680 #: ../fish/guestfish.pod:725
18681 msgid "C<glob> only works on simple guest paths and not on device names."
18685 #: ../fish/guestfish.pod:727
18687 "If you have several parameters, each containing a wildcard, then glob will "
18688 "perform a Cartesian product."
18692 #: ../fish/guestfish.pod:730
18697 #: ../fish/guestfish.pod:732
18699 "Any line which starts with a I<#> character is treated as a comment and "
18700 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18701 "a command. For example:"
18705 #: ../fish/guestfish.pod:736
18708 " # this is a comment\n"
18709 " # this is a comment\n"
18710 " foo # NOT a comment\n"
18715 #: ../fish/guestfish.pod:740
18716 msgid "Blank lines are also ignored."
18720 #: ../fish/guestfish.pod:742
18721 msgid "RUNNING COMMANDS LOCALLY"
18725 #: ../fish/guestfish.pod:744
18727 "Any line which starts with a I<!> character is treated as a command sent to "
18728 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18732 #: ../fish/guestfish.pod:748
18736 " tgz-out /remote local/remote-data.tar.gz\n"
18741 #: ../fish/guestfish.pod:751
18743 "will create a directory C<local> on the host, and then export the contents "
18744 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18745 "(See C<tgz-out>)."
18749 #: ../fish/guestfish.pod:755
18751 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18752 "effect, due to the way that subprocesses work in Unix."
18756 #: ../fish/guestfish.pod:758
18757 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18761 #: ../fish/guestfish.pod:760
18763 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18764 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18765 "and executed as guestfish commands."
18769 #: ../fish/guestfish.pod:764
18771 "Thus you can use shell script to construct arbitrary guestfish commands "
18772 "which are then parsed by guestfish."
18776 #: ../fish/guestfish.pod:767
18778 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18779 "through C</foo.100>) using guestfish commands alone. However this is simple "
18780 "if we use a shell script to create the guestfish commands for us:"
18784 #: ../fish/guestfish.pod:772
18787 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18792 #: ../fish/guestfish.pod:774
18793 msgid "or with names like C</foo.001>:"
18797 #: ../fish/guestfish.pod:776
18800 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18805 #: ../fish/guestfish.pod:778
18807 "When using guestfish interactively it can be helpful to just run the shell "
18808 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18809 "ordinary I<!> local command), see what guestfish commands it would run, and "
18810 "when you are happy with those prepend the C<E<lt>> character to run the "
18811 "guestfish commands for real."
18815 #: ../fish/guestfish.pod:784
18820 #: ../fish/guestfish.pod:786
18822 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18823 "command (a guestfish command) to the second command (any host command). For "
18828 #: ../fish/guestfish.pod:790
18831 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18836 #: ../fish/guestfish.pod:792
18838 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18839 "program). The above command would list all accounts in the guest filesystem "
18840 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18844 #: ../fish/guestfish.pod:797
18847 " hexdump /bin/ls | head\n"
18848 " list-devices | tail -1\n"
18849 " tgz-out / - | tar ztf -\n"
18854 #: ../fish/guestfish.pod:801
18856 "The space before the pipe symbol is required, any space after the pipe "
18857 "symbol is optional. Everything after the pipe symbol is just passed "
18858 "straight to the host shell, so it can contain redirections, globs and "
18859 "anything else that makes sense on the host side."
18863 #: ../fish/guestfish.pod:806
18865 "To use a literal argument which begins with a pipe symbol, you have to quote "
18870 #: ../fish/guestfish.pod:809
18878 #: ../fish/guestfish.pod:811
18879 msgid "HOME DIRECTORIES"
18883 #: ../fish/guestfish.pod:813
18885 "If a parameter starts with the character C<~> then the tilde may be expanded "
18886 "as a home directory path (either C<~> for the current user's home directory, "
18887 "or C<~user> for another user)."
18891 #: ../fish/guestfish.pod:817
18893 "Note that home directory expansion happens for users known I<on the host>, "
18894 "not in the guest filesystem."
18898 #: ../fish/guestfish.pod:820
18900 "To use a literal argument which begins with a tilde, you have to quote it, "
18905 #: ../fish/guestfish.pod:823
18913 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
18914 msgid "ENCRYPTED DISKS"
18918 #: ../fish/guestfish.pod:827
18920 "Libguestfs has some support for Linux guests encrypted according to the "
18921 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18922 "disk encryption systems used by modern Linux guests. Currently only "
18923 "LVM-on-LUKS is supported."
18927 #: ../fish/guestfish.pod:832
18928 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18932 #: ../fish/guestfish.pod:834
18935 " ><fs> vfs-type /dev/sda2\n"
18941 #: ../fish/guestfish.pod:837
18943 "Then open those devices using L</luks-open>. This creates a device-mapper "
18944 "device called C</dev/mapper/luksdev>."
18948 #: ../fish/guestfish.pod:840
18951 " ><fs> luks-open /dev/sda2 luksdev\n"
18952 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18957 #: ../fish/guestfish.pod:843
18959 "Finally you have to tell LVM to scan for volume groups on the newly created "
18964 #: ../fish/guestfish.pod:846
18968 " vg-activate-all true\n"
18973 #: ../fish/guestfish.pod:849
18974 msgid "The logical volume(s) can now be mounted in the usual way."
18978 #: ../fish/guestfish.pod:851
18980 "Before closing a LUKS device you must unmount any logical volumes on it and "
18981 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18982 "one. Then you can close the mapper device:"
18986 #: ../fish/guestfish.pod:855
18989 " vg-activate false /dev/VG\n"
18990 " luks-close /dev/mapper/luksdev\n"
18995 #: ../fish/guestfish.pod:860
18997 "If a path is prefixed with C<win:> then you can use Windows-style drive "
18998 "letters and paths (with some limitations). The following commands are "
19003 #: ../fish/guestfish.pod:864
19006 " file /WINDOWS/system32/config/system.LOG\n"
19011 #: ../fish/guestfish.pod:866
19014 " file win:\\windows\\system32\\config\\system.log\n"
19019 #: ../fish/guestfish.pod:868
19022 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19027 #: ../fish/guestfish.pod:870
19029 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19030 "where the drive is mounted, prepending that to the path, changing all "
19031 "backslash characters to forward slash, then resolving the result using "
19032 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
19033 "then the parameter might be rewritten like this:"
19037 #: ../fish/guestfish.pod:876
19040 " win:e:\\foo\\bar => /e/FOO/bar\n"
19045 #: ../fish/guestfish.pod:878
19046 msgid "This only works in argument positions that expect a path."
19050 #: ../fish/guestfish.pod:880
19051 msgid "UPLOADING AND DOWNLOADING FILES"
19055 #: ../fish/guestfish.pod:882
19057 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19058 "others which upload from or download to a local file, you can use the "
19059 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19063 #: ../fish/guestfish.pod:886
19071 #: ../fish/guestfish.pod:888
19072 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19076 #: ../fish/guestfish.pod:891
19079 " tar-out /etc - | tar tf -\n"
19084 #: ../fish/guestfish.pod:893
19086 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19087 "command (see L</PIPES>)."
19091 #: ../fish/guestfish.pod:896
19093 "When using C<-> to read from stdin, the input is read up to the end of "
19094 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19095 "some arbitrary end marker:"
19099 #: ../fish/guestfish.pod:900
19102 " upload -<<END /foo\n"
19111 #: ../fish/guestfish.pod:906
19113 "Any string of characters can be used instead of C<END>. The end marker must "
19114 "appear on a line of its own, without any preceeding or following characters "
19115 "(not even spaces)."
19119 #: ../fish/guestfish.pod:910
19121 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19122 "upload local files (so-called \"FileIn\" parameters in the generator)."
19126 #: ../fish/guestfish.pod:913
19127 msgid "EXIT ON ERROR BEHAVIOUR"
19131 #: ../fish/guestfish.pod:915
19133 "By default, guestfish will ignore any errors when in interactive mode "
19134 "(ie. taking commands from a human over a tty), and will exit on the first "
19135 "error in non-interactive mode (scripts, commands given on the command line)."
19139 #: ../fish/guestfish.pod:920
19141 "If you prefix a command with a I<-> character, then that command will not "
19142 "cause guestfish to exit, even if that (one) command returns an error."
19146 #: ../fish/guestfish.pod:924
19147 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19151 #: ../fish/guestfish.pod:926
19153 "Guestfish can be remote-controlled over a socket. This is useful "
19154 "particularly in shell scripts where you want to make several different "
19155 "changes to a filesystem, but you don't want the overhead of starting up a "
19156 "guestfish process each time."
19160 #: ../fish/guestfish.pod:931
19161 msgid "Start a guestfish server process using:"
19165 #: ../fish/guestfish.pod:933
19168 " eval \"`guestfish --listen`\"\n"
19173 #: ../fish/guestfish.pod:935
19174 msgid "and then send it commands by doing:"
19178 #: ../fish/guestfish.pod:937
19181 " guestfish --remote cmd [...]\n"
19186 #: ../fish/guestfish.pod:939
19187 msgid "To cause the server to exit, send it the exit command:"
19191 #: ../fish/guestfish.pod:943
19193 "Note that the server will normally exit if there is an error in a command. "
19194 "You can change this in the usual way. See section L</EXIT ON ERROR "
19199 #: ../fish/guestfish.pod:947
19200 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19204 #: ../fish/guestfish.pod:949
19206 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19207 "is how the I<--remote> option knows where to send the commands. You can "
19208 "have several guestfish listener processes running using:"
19212 #: ../fish/guestfish.pod:953
19215 " eval \"`guestfish --listen`\"\n"
19216 " pid1=$GUESTFISH_PID\n"
19217 " eval \"`guestfish --listen`\"\n"
19218 " pid2=$GUESTFISH_PID\n"
19220 " guestfish --remote=$pid1 cmd\n"
19221 " guestfish --remote=$pid2 cmd\n"
19226 #: ../fish/guestfish.pod:961
19227 msgid "REMOTE CONTROL AND CSH"
19231 #: ../fish/guestfish.pod:963
19233 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19238 #: ../fish/guestfish.pod:966
19241 " eval \"`guestfish --listen --csh`\"\n"
19246 #: ../fish/guestfish.pod:968
19247 msgid "REMOTE CONTROL DETAILS"
19251 #: ../fish/guestfish.pod:970
19253 "Remote control happens over a Unix domain socket called "
19254 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19255 "of the process, and C<$PID> is the process ID of the server."
19259 #: ../fish/guestfish.pod:974
19260 msgid "Guestfish client and server versions must match exactly."
19264 #: ../fish/guestfish.pod:976
19265 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19269 #: ../fish/guestfish.pod:978
19271 "From Bash, you can use the following code which creates a guestfish "
19272 "instance, correctly quotes the command line, handles failure to start, and "
19273 "cleans up guestfish when the script exits:"
19277 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
19285 #: ../fish/guestfish.pod:986
19288 " guestfish[0]=\"guestfish\"\n"
19289 " guestfish[1]=\"--listen\"\n"
19290 " guestfish[2]=\"--ro\"\n"
19291 " guestfish[3]=\"-a\"\n"
19292 " guestfish[4]=\"disk.img\"\n"
19297 #: ../fish/guestfish.pod:992
19300 " GUESTFISH_PID=\n"
19301 " eval $(\"${guestfish[@]}\")\n"
19302 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19303 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19310 #: ../fish/guestfish.pod:999
19313 " cleanup_guestfish ()\n"
19315 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
19317 " trap cleanup_guestfish EXIT ERR\n"
19322 #: ../fish/guestfish.pod:1005
19325 " guestfish --remote -- run\n"
19330 #: ../fish/guestfish.pod:1007
19338 #: ../fish/guestfish.pod:1009
19339 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19343 #: ../fish/guestfish.pod:1011
19345 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19346 "context hangs, ie. don't do (note the backquotes):"
19350 #: ../fish/guestfish.pod:1014
19353 " a=`guestfish --remote run`\n"
19358 #: ../fish/guestfish.pod:1016
19360 "Since the C<run> command produces no output on stdout, this is not useful "
19361 "anyway. For further information see "
19362 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19366 #: ../fish/guestfish.pod:1020
19367 msgid "PREPARED DISK IMAGES"
19371 #: ../fish/guestfish.pod:1022
19373 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19374 "preformatted disk images that guestfish can make for you to save typing. "
19375 "This is particularly useful for testing purposes. This option is used "
19376 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19377 "can be mixed with I<-a>)."
19381 #: ../fish/guestfish.pod:1028
19383 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19384 "the second and so on. Existing files in the current directory are "
19389 #: ../fish/guestfish.pod:1032
19391 "The type briefly describes how the disk should be sized, partitioned, how "
19392 "filesystem(s) should be created, and how content should be added. "
19393 "Optionally the type can be followed by extra parameters, separated by C<:> "
19394 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19395 "sparsely-allocated disk, containing a single partition, with the partition "
19396 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19397 "on a 1GB disk instead."
19401 #: ../fish/guestfish.pod:1040
19402 msgid "To list the available types and any extra parameters they take, run:"
19406 #: ../fish/guestfish.pod:1044
19408 "Note that the prepared filesystem is not mounted. You would usually have to "
19409 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19413 #: ../fish/guestfish.pod:1048
19415 "If any I<-N> or I<--new> options are given, the guest is automatically "
19420 #: ../fish/guestfish.pod:1053
19421 msgid "Create a 100MB disk with an ext4-formatted partition:"
19425 #: ../fish/guestfish.pod:1055
19428 " guestfish -N fs:ext4\n"
19433 #: ../fish/guestfish.pod:1057
19434 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19438 #: ../fish/guestfish.pod:1059
19441 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19446 #: ../fish/guestfish.pod:1061
19447 msgid "Create a blank 200MB disk:"
19451 #: ../fish/guestfish.pod:1063
19454 " guestfish -N disk:200M\n"
19459 #: ../fish/guestfish.pod:1065
19460 msgid "PROGRESS BARS"
19464 #: ../fish/guestfish.pod:1067
19466 "Some (not all) long-running commands send progress notification messages as "
19467 "they are running. Guestfish turns these messages into progress bars."
19471 #: ../fish/guestfish.pod:1071
19473 "When a command that supports progress bars takes longer than two seconds to "
19474 "run, and if progress bars are enabled, then you will see one appearing below "
19479 #: ../fish/guestfish.pod:1075
19482 " ><fs> copy-size /large-file /another-file 2048M\n"
19483 " / 10% [#####-----------------------------------------] 00:30\n"
19488 #: ../fish/guestfish.pod:1078
19490 "The spinner on the left hand side moves round once for every progress "
19491 "notification received from the backend. This is a (reasonably) golden "
19492 "assurance that the command is \"doing something\" even if the progress bar "
19493 "is not moving, because the command is able to send the progress "
19494 "notifications. When the bar reaches 100% and the command finishes, the "
19495 "spinner disappears."
19499 #: ../fish/guestfish.pod:1085
19501 "Progress bars are enabled by default when guestfish is used interactively. "
19502 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19503 "and you can disable them completely using I<--no-progress-bars>."
19507 #: ../fish/guestfish.pod:1090
19508 msgid "GUESTFISH COMMANDS"
19512 #: ../fish/guestfish.pod:1092
19514 "The commands in this section are guestfish convenience commands, in other "
19515 "words, they are not part of the L<guestfs(3)> API."
19519 #: ../fish/guestfish.pod:1095
19524 #: ../fish/guestfish.pod:1097
19533 #: ../fish/guestfish.pod:1100
19534 msgid "Without any parameter, this provides general help."
19538 #: ../fish/guestfish.pod:1102
19539 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19543 #: ../fish/guestfish.pod:1104
19544 msgid "quit | exit"
19548 #: ../fish/guestfish.pod:1106
19549 msgid "This exits guestfish. You can also use C<^D> key."
19553 #: ../fish/guestfish.pod:1108
19554 msgid "@FISH_COMMANDS@"
19558 #: ../fish/guestfish.pod:1110
19563 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1505
19568 #: ../fish/guestfish.pod:1116
19570 "guestfish returns 0 if the commands completed without error, or 1 if there "
19575 #: ../fish/guestfish.pod:1123
19580 #: ../fish/guestfish.pod:1125
19582 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19587 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3198
19588 msgid "FEBOOTSTRAP_KERNEL"
19592 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3200
19593 msgid "FEBOOTSTRAP_MODULES"
19597 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3202
19599 "These two environment variables allow the kernel that libguestfs uses in the "
19600 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19601 "most recent host kernel is chosen. For more information about kernel "
19602 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19603 "available in febootstrap E<ge> 3.8."
19607 #: ../fish/guestfish.pod:1138
19608 msgid "GUESTFISH_DISPLAY_IMAGE"
19612 #: ../fish/guestfish.pod:1140
19614 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19615 "If not set, it uses L<display(1)>."
19619 #: ../fish/guestfish.pod:1143
19620 msgid "GUESTFISH_PID"
19624 #: ../fish/guestfish.pod:1145
19626 "Used with the I<--remote> option to specify the remote guestfish process to "
19627 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19631 #: ../fish/guestfish.pod:1149
19636 #: ../fish/guestfish.pod:1151
19638 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19639 "not specified, the external L<hexedit(1)> program is used."
19643 #: ../fish/guestfish.pod:1155
19648 #: ../fish/guestfish.pod:1157
19650 "If compiled with GNU readline support, various files in the home directory "
19651 "can be used. See L</FILES>."
19655 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3208
19656 msgid "LIBGUESTFS_APPEND"
19660 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3210
19661 msgid "Pass additional options to the guest kernel."
19665 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3212
19666 msgid "LIBGUESTFS_DEBUG"
19670 #: ../fish/guestfish.pod:1166
19672 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19673 "effect as using the B<-v> option."
19677 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3217
19678 msgid "LIBGUESTFS_MEMSIZE"
19682 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3219
19683 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19687 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3222
19690 " LIBGUESTFS_MEMSIZE=700\n"
19695 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3224
19696 msgid "LIBGUESTFS_PATH"
19700 #: ../fish/guestfish.pod:1178
19702 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19703 "the discussion of paths in L<guestfs(3)>."
19707 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3229
19708 msgid "LIBGUESTFS_QEMU"
19712 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3231
19714 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19715 "which was found at compile time by the configure script is used."
19719 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3237
19720 msgid "LIBGUESTFS_TRACE"
19724 #: ../fish/guestfish.pod:1189
19725 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19729 #: ../fish/guestfish.pod:1191
19734 #: ../fish/guestfish.pod:1193
19736 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19741 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3242
19746 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3244
19748 "Location of temporary directory, defaults to C</tmp> except for the cached "
19749 "supermin appliance which defaults to C</var/tmp>."
19753 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3247
19755 "If libguestfs was compiled to use the supermin appliance then the real "
19756 "appliance is cached in this directory, shared between all handles belonging "
19757 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19758 "use in case C</var/tmp> is not large enough."
19762 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:273
19767 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:277
19768 msgid "$HOME/.libguestfs-tools.rc"
19772 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:279
19773 msgid "/etc/libguestfs-tools.conf"
19777 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:281
19779 "This configuration file controls the default read-only or read-write mode "
19780 "(I<--ro> or I<--rw>)."
19784 #: ../fish/guestfish.pod:1220
19785 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
19789 #: ../fish/guestfish.pod:1222
19790 msgid "$HOME/.guestfish"
19794 #: ../fish/guestfish.pod:1224
19796 "If compiled with GNU readline support, then the command history is saved in "
19801 #: ../fish/guestfish.pod:1227
19802 msgid "$HOME/.inputrc"
19806 #: ../fish/guestfish.pod:1229
19807 msgid "/etc/inputrc"
19811 #: ../fish/guestfish.pod:1231
19813 "If compiled with GNU readline support, then these files can be used to "
19814 "configure readline. For further information, please see "
19815 "L<readline(3)/INITIALIZATION FILE>."
19819 #: ../fish/guestfish.pod:1235
19820 msgid "To write rules which only apply to guestfish, use:"
19824 #: ../fish/guestfish.pod:1237
19834 #: ../fish/guestfish.pod:1241
19836 "Variables that you can set in inputrc that change the behaviour of guestfish "
19837 "in useful ways include:"
19841 #: ../fish/guestfish.pod:1246
19842 msgid "completion-ignore-case (default: on)"
19846 #: ../fish/guestfish.pod:1248
19848 "By default, guestfish will ignore case when tab-completing paths on the "
19853 #: ../fish/guestfish.pod:1251
19856 " set completion-ignore-case off\n"
19861 #: ../fish/guestfish.pod:1253
19862 msgid "to make guestfish case sensitive."
19866 #: ../fish/guestfish.pod:1257
19871 #: ../fish/guestfish.pod:1259
19872 msgid "test2.img (etc)"
19876 #: ../fish/guestfish.pod:1261
19878 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
19879 "will be created in the file C<test1.img> in the current directory. The "
19880 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
19881 "the same name will be overwritten."
19885 #: ../fish/guestfish.pod:1270
19887 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
19888 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
19889 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
19890 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
19891 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
19892 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
19893 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
19894 "L<febootstrap-supermin-helper(8)>."
19898 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3339 ../test-tool/libguestfs-test-tool.pod:112
19899 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
19903 #: ../fish/virt-copy-in.pod:5
19904 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
19908 #: ../fish/virt-copy-in.pod:9
19911 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
19916 #: ../fish/virt-copy-in.pod:11
19919 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
19924 #: ../fish/virt-copy-in.pod:15
19926 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
19927 "causing disk corruption. The virtual machine must be shut down before you "
19928 "use this command."
19932 #: ../fish/virt-copy-in.pod:21
19934 "C<virt-copy-in> copies files and directories from the local disk into a "
19935 "virtual machine disk image or named libvirt domain."
19939 #: ../fish/virt-copy-in.pod:24
19941 "You can give one of more filenames and directories on the command line. "
19942 "Directories are copied in recursively. The final parameter must be the "
19943 "destination directory in the disk image which must be an absolute path "
19944 "starting with a C</> character."
19948 #: ../fish/virt-copy-in.pod:33
19951 " virt-copy-in -d MyGuest resolv.conf /etc\n"
19956 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
19957 msgid "Upload a home directory to a guest:"
19961 #: ../fish/virt-copy-in.pod:37
19964 " virt-copy-in -d MyGuest skel /home\n"
19969 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
19970 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
19974 #: ../fish/virt-copy-in.pod:41
19976 "This command is just a simple shell script wrapper around the "
19977 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
19978 "trivial copy, you are probably better off using guestfish directly."
19982 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
19984 "Since the shell script just passes options straight to guestfish, read "
19985 "L<guestfish(1)> to see the full list of options."
19989 #: ../fish/virt-copy-in.pod:52
19991 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
19992 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19996 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
19997 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20001 #: ../fish/virt-copy-out.pod:5
20003 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20008 #: ../fish/virt-copy-out.pod:9
20011 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20016 #: ../fish/virt-copy-out.pod:11
20019 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20024 #: ../fish/virt-copy-out.pod:15
20026 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20027 "image or named libvirt domain."
20031 #: ../fish/virt-copy-out.pod:18
20033 "You can give one of more filenames and directories on the command line. "
20034 "Directories are copied out recursively."
20038 #: ../fish/virt-copy-out.pod:23
20039 msgid "Download the home directories from a virtual machine:"
20043 #: ../fish/virt-copy-out.pod:25
20047 " virt-copy-out -d MyGuest /home homes\n"
20052 #: ../fish/virt-copy-out.pod:30
20054 "This command is just a simple shell script wrapper around the "
20055 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
20056 "trivial copy, you are probably better off using guestfish directly."
20060 #: ../fish/virt-copy-out.pod:41
20062 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
20063 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20067 #: ../fish/virt-tar-in.pod:5
20068 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20072 #: ../fish/virt-tar-in.pod:9
20075 " virt-tar-in -a disk.img data.tar /destination\n"
20080 #: ../fish/virt-tar-in.pod:11
20083 " virt-tar-in -d domain data.tar /destination\n"
20088 #: ../fish/virt-tar-in.pod:13
20091 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20096 #: ../fish/virt-tar-in.pod:17
20098 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20099 "causing disk corruption. The virtual machine must be shut down before you "
20100 "use this command."
20104 #: ../fish/virt-tar-in.pod:23
20106 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20107 "image or named libvirt domain."
20111 #: ../fish/virt-tar-in.pod:26
20113 "The first parameter is the tar file. Use C<-> to read the tar file from "
20114 "standard input. The second parameter is the absolute target directory to "
20119 #: ../fish/virt-tar-in.pod:34
20122 " virt-tar-in -d MyGuest homes.tar /home\n"
20127 #: ../fish/virt-tar-in.pod:38
20129 "This command is just a simple shell script wrapper around the "
20130 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
20131 "copy, you are probably better off using guestfish directly."
20135 #: ../fish/virt-tar-in.pod:49
20137 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20138 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
20139 "L<http://libguestfs.org/>."
20143 #: ../fish/virt-tar-out.pod:5
20144 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20148 #: ../fish/virt-tar-out.pod:9
20151 " virt-tar-out -a disk.img /dir files.tar\n"
20156 #: ../fish/virt-tar-out.pod:11
20159 " virt-tar-out -d domain /dir files.tar\n"
20164 #: ../fish/virt-tar-out.pod:13
20167 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20172 #: ../fish/virt-tar-out.pod:17
20173 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20177 #: ../fish/virt-tar-out.pod:20
20179 "The first parameter is the absolute path of the virtual machine directory. "
20180 "The second parameter is the tar file to write. Use C<-> to write to "
20185 #: ../fish/virt-tar-out.pod:26
20186 msgid "Download the home directories from a guest:"
20190 #: ../fish/virt-tar-out.pod:28
20193 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20198 #: ../fish/virt-tar-out.pod:32
20200 "This command is just a simple shell script wrapper around the "
20201 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
20202 "trivial copy, you are probably better off using guestfish directly."
20206 #: ../fish/virt-tar-out.pod:43
20208 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20209 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20213 #: ../fuse/guestmount.pod:5
20214 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20218 #: ../fuse/guestmount.pod:9
20221 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20226 #: ../fuse/guestmount.pod:11
20229 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20234 #: ../fuse/guestmount.pod:13
20237 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20242 #: ../fuse/guestmount.pod:17
20244 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20245 "machines. If you do this, you risk disk corruption in the VM."
20249 #: ../fuse/guestmount.pod:22
20251 "The guestmount program can be used to mount virtual machine filesystems and "
20252 "other disk images on the host. It uses libguestfs for access to the guest "
20253 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20254 "a mountable device."
20258 #: ../fuse/guestmount.pod:27
20260 "Along with other options, you have to give at least one device (I<-a> "
20261 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20262 "option) or use the I<-i> inspection option. How this works is better "
20263 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20268 #: ../fuse/guestmount.pod:33
20270 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20271 "by you, and the filesystem will not be visible to any other users unless you "
20272 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20273 "the filesystem, use the C<fusermount -u> command."
20277 #: ../fuse/guestmount.pod:41
20279 "For a typical Windows guest which has its main filesystem on the first "
20284 #: ../fuse/guestmount.pod:44
20287 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20292 #: ../fuse/guestmount.pod:46
20294 "For a typical Linux guest which has a /boot filesystem on the first "
20295 "partition, and the root filesystem on a logical volume:"
20299 #: ../fuse/guestmount.pod:49
20302 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20307 #: ../fuse/guestmount.pod:51
20308 msgid "To get libguestfs to detect guest mountpoints for you:"
20312 #: ../fuse/guestmount.pod:53
20315 " guestmount -a guest.img -i --ro /mnt\n"
20320 #: ../fuse/guestmount.pod:55
20321 msgid "For a libvirt guest called \"Guest\" you could do:"
20325 #: ../fuse/guestmount.pod:57
20328 " guestmount -d Guest -i --ro /mnt\n"
20333 #: ../fuse/guestmount.pod:59
20335 "If you don't know what filesystems are contained in a guest or disk image, "
20336 "use L<virt-filesystems(1)> first:"
20340 #: ../fuse/guestmount.pod:62
20343 " virt-filesystems MyGuest\n"
20348 #: ../fuse/guestmount.pod:64
20350 "If you want to trace the libguestfs calls but without excessive debugging "
20351 "information, we recommend:"
20355 #: ../fuse/guestmount.pod:67
20358 " guestmount [...] --trace /mnt\n"
20363 #: ../fuse/guestmount.pod:69
20364 msgid "If you want to debug the program, we recommend:"
20368 #: ../fuse/guestmount.pod:71
20371 " guestmount [...] --trace --verbose /mnt\n"
20376 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:544
20381 #: ../fuse/guestmount.pod:75
20382 msgid "Other users cannot see the filesystem by default"
20386 #: ../fuse/guestmount.pod:77
20388 "If you mount a filesystem as one user (eg. root), then other users will not "
20389 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20390 "option when mounting:"
20394 #: ../fuse/guestmount.pod:81
20397 " sudo guestmount [...] -o allow_other /mnt\n"
20402 #: ../fuse/guestmount.pod:83
20403 msgid "Enabling FUSE"
20407 #: ../fuse/guestmount.pod:85
20409 "On some distros, you may need to add yourself to a special group "
20410 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
20411 "Debian and derivatives."
20415 #: ../fuse/guestmount.pod:89
20417 "On other distros, no special group is required. It is not necessary on "
20418 "Fedora or Red Hat Enterprise Linux."
20422 #: ../fuse/guestmount.pod:100
20423 msgid "Add a block device or virtual machine image."
20427 #: ../fuse/guestmount.pod:123
20428 msgid "B<--dir-cache-timeout N>"
20432 #: ../fuse/guestmount.pod:125
20434 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20435 "seconds. The readdir cache [actually, there are several semi-independent "
20436 "caches] is populated after a readdir(2) call with the stat and extended "
20437 "attributes of the files in the directory, in anticipation that they will be "
20438 "requested soon after."
20442 #: ../fuse/guestmount.pod:131
20444 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20445 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20446 "requests, only cache existing ones."
20450 #: ../fuse/guestmount.pod:151
20452 "If you have untrusted raw-format guest disk images, you should use this "
20453 "option to specify the disk format. This avoids a possible security problem "
20454 "with malicious guests (CVE-2010-3851). See also "
20455 "L<guestfs(3)/guestfs_add_drive_opts>."
20459 #: ../fuse/guestmount.pod:156
20460 msgid "B<--fuse-help>"
20464 #: ../fuse/guestmount.pod:158
20465 msgid "Display help on special FUSE options (see I<-o> below)."
20469 #: ../fuse/guestmount.pod:162
20470 msgid "Display brief help and exit."
20474 #: ../fuse/guestmount.pod:186
20476 "Mount the named partition or logical volume on the given mountpoint B<in the "
20477 "guest> (this has nothing to do with mountpoints in the host)."
20481 #: ../fuse/guestmount.pod:189
20483 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20484 "something on C</>."
20488 #: ../fuse/guestmount.pod:206
20490 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20491 "unmounted. If you specify this option, then we don't attempt to sync the "
20492 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20496 #: ../fuse/guestmount.pod:211
20497 msgid "B<-o option>"
20501 #: ../fuse/guestmount.pod:213
20502 msgid "B<--option option>"
20506 #: ../fuse/guestmount.pod:215
20507 msgid "Pass extra options to FUSE."
20511 #: ../fuse/guestmount.pod:217
20513 "To get a list of all the extra options supported by FUSE, use the command "
20514 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20515 "of them are a good idea."
20519 #: ../fuse/guestmount.pod:221
20522 " guestmount --fuse-help\n"
20527 #: ../fuse/guestmount.pod:223
20528 msgid "Some potentially useful FUSE options:"
20532 #: ../fuse/guestmount.pod:227
20533 msgid "B<-o allow_other>"
20537 #: ../fuse/guestmount.pod:229
20538 msgid "Allow other users to see the filesystem."
20542 #: ../fuse/guestmount.pod:231
20543 msgid "B<-o attr_timeout=N>"
20547 #: ../fuse/guestmount.pod:233
20548 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20552 #: ../fuse/guestmount.pod:235
20553 msgid "B<-o kernel_cache>"
20557 #: ../fuse/guestmount.pod:237
20559 "Allow the kernel to cache files (reduces the number of reads that have to go "
20560 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20561 "afford the extra memory usage."
20565 #: ../fuse/guestmount.pod:241
20566 msgid "B<-o uid=N> B<-o gid=N>"
20570 #: ../fuse/guestmount.pod:243
20572 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20573 "the chosen values."
20577 #: ../fuse/guestmount.pod:252
20579 "Add devices and mount everything read-only. Also disallow writes and make "
20580 "the disk appear read-only to FUSE."
20584 #: ../fuse/guestmount.pod:255
20586 "This is highly recommended if you are not going to edit the guest disk. If "
20587 "the guest is running and this option is I<not> supplied, then there is a "
20588 "strong risk of disk corruption in the guest. We try to prevent this from "
20589 "happening, but it is not always possible."
20593 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
20594 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20598 #: ../fuse/guestmount.pod:264
20599 msgid "Enable SELinux support for the guest."
20603 #: ../fuse/guestmount.pod:270
20604 msgid "Enable verbose messages from underlying libguestfs."
20608 #: ../fuse/guestmount.pod:276
20609 msgid "Display the program version and exit."
20613 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20614 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20618 #: ../fuse/guestmount.pod:289
20623 #: ../fuse/guestmount.pod:291
20624 msgid "Trace libguestfs calls and entry into each FUSE function."
20628 #: ../fuse/guestmount.pod:293
20629 msgid "This also stops the daemon from forking into the background."
20633 #: ../fuse/guestmount.pod:319
20635 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20636 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20637 "L<http://fuse.sf.net/>."
20641 #: ../fuse/guestmount.pod:334
20642 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20646 #: ../inspector/virt-inspector.pod:5
20648 "virt-inspector - Display operating system version and other information "
20649 "about a virtual machine"
20653 #: ../inspector/virt-inspector.pod:9
20656 " virt-inspector [--options] -d domname\n"
20661 #: ../inspector/virt-inspector.pod:11
20664 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20669 #: ../inspector/virt-inspector.pod:15
20672 " virt-inspector domname\n"
20677 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20680 " virt-inspector disk.img [disk.img ...]\n"
20685 #: ../inspector/virt-inspector.pod:21
20687 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20688 "determine the version of the operating system and other information about "
20689 "the virtual machine."
20693 #: ../inspector/virt-inspector.pod:25
20694 msgid "Virt-inspector produces XML output for feeding into other programs."
20698 #: ../inspector/virt-inspector.pod:27
20700 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20701 "the libvirt domain (see: C<virsh list --all>)."
20705 #: ../inspector/virt-inspector.pod:30
20707 "You can also run virt-inspector directly on disk images from a single "
20708 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20709 "has several block devices, in which case you should list several I<-a> "
20710 "options one after another, with the first corresponding to the guest's "
20711 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20715 #: ../inspector/virt-inspector.pod:37
20717 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20718 "keys and similar."
20722 #: ../inspector/virt-inspector.pod:40
20724 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20725 "inspect several virtual machines, you have to run virt-inspector several "
20726 "times (for example, from a shell script for-loop)."
20730 #: ../inspector/virt-inspector.pod:45
20732 "Because virt-inspector needs direct access to guest images, it won't "
20733 "normally work over remote libvirt connections."
20737 #: ../inspector/virt-inspector.pod:48
20739 "All of the information available from virt-inspector is also available "
20740 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20741 "The same information can also be fetched using guestfish or via libguestfs "
20742 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20743 "WITH OTHER PROGRAMMING LANGUAGES>)."
20747 #: ../inspector/virt-inspector.pod:81
20749 "Libvirt is only used if you specify a C<domname> on the command line. If "
20750 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20755 #: ../inspector/virt-inspector.pod:94
20757 "When prompting for keys and passphrases, virt-inspector normally turns "
20758 "echoing off so you cannot see what you are typing. If you are not worried "
20759 "about Tempest attacks and there is no one else in the room you can specify "
20760 "this flag to see what you are typing."
20764 #: ../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
20766 "Specify the format of disk images given on the command line. If this is "
20767 "omitted then the format is autodetected from the content of the disk image."
20771 #: ../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
20773 "If disk images are requested from libvirt, then this program asks libvirt "
20774 "for this information. In this case, the value of the format parameter is "
20779 #: ../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
20781 "If working with untrusted raw-format guest disk images, you should ensure "
20782 "the format is always specified."
20786 #: ../inspector/virt-inspector.pod:139
20787 msgid "Previous versions of virt-inspector allowed you to write either:"
20791 #: ../inspector/virt-inspector.pod:145
20794 " virt-inspector guestname\n"
20799 #: ../inspector/virt-inspector.pod:153
20804 #: ../inspector/virt-inspector.pod:155
20806 "The virt-inspector XML is described precisely in a RELAX NG schema file "
20807 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
20808 "just an overview."
20812 #: ../inspector/virt-inspector.pod:159
20814 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
20815 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
20816 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
20817 "which is vanishingly rare in real world VMs."
20821 #: ../inspector/virt-inspector.pod:164
20822 msgid "E<lt>operatingsystemE<gt>"
20826 #: ../inspector/virt-inspector.pod:166
20828 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20829 "describe the operating system, its architecture, the descriptive \"product "
20830 "name\" string, the type of OS and so on, as in this example:"
20834 #: ../inspector/virt-inspector.pod:170
20837 " <operatingsystems>\n"
20838 " <operatingsystem>\n"
20839 " <root>/dev/sda2</root>\n"
20840 " <name>windows</name>\n"
20841 " <arch>i386</arch>\n"
20842 " <distro>windows</distro>\n"
20843 " <product_name>Windows 7 Enterprise</product_name>\n"
20844 " <product_variant>Client</product_variant>\n"
20845 " <major_version>6</major_version>\n"
20846 " <minor_version>1</minor_version>\n"
20847 " <windows_systemroot>/Windows</windows_systemroot>\n"
20848 " <format>installed</format>\n"
20853 #: ../inspector/virt-inspector.pod:183
20855 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
20856 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
20857 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
20858 "architecture. The other fields are fairly self-explanatory, but because "
20859 "these fields are taken directly from the libguestfs inspection API you can "
20860 "find precise information from L<guestfs(3)/INSPECTION>."
20864 #: ../inspector/virt-inspector.pod:191
20866 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
20867 "of view of libguestfs (block devices may have completely different names "
20868 "inside the VM itself)."
20872 #: ../inspector/virt-inspector.pod:195
20873 msgid "E<lt>mountpointsE<gt>"
20877 #: ../inspector/virt-inspector.pod:197
20879 "Un*x-like guests typically have multiple filesystems which are mounted at "
20880 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
20881 "element which looks like this:"
20885 #: ../inspector/virt-inspector.pod:201
20888 " <operatingsystems>\n"
20889 " <operatingsystem>\n"
20892 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
20893 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
20894 " </mountpoints>\n"
20899 #: ../inspector/virt-inspector.pod:209
20901 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
20902 "and may have completely different names inside the guest. Only mountable "
20903 "filesystems appear in this list, not things like swap devices."
20907 #: ../inspector/virt-inspector.pod:214
20908 msgid "E<lt>filesystemsE<gt>"
20912 #: ../inspector/virt-inspector.pod:216
20914 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
20915 "filesystems belonging to the guest, including swap and empty partitions. "
20916 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
20917 "this OS or shared with this OS and other OSes)."
20921 #: ../inspector/virt-inspector.pod:222
20922 msgid "You might see something like this:"
20926 #: ../inspector/virt-inspector.pod:224
20929 " <operatingsystems>\n"
20930 " <operatingsystem>\n"
20933 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20934 " <type>ext4</type>\n"
20935 " <label>Fedora-13-x86_64</label>\n"
20936 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
20942 #: ../inspector/virt-inspector.pod:234
20944 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
20945 "the label, and the UUID."
20949 #: ../inspector/virt-inspector.pod:237
20950 msgid "E<lt>applicationsE<gt>"
20954 #: ../inspector/virt-inspector.pod:239
20956 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
20957 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
20962 #: ../inspector/virt-inspector.pod:243
20964 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
20965 "Typical values would be C<rpm> and C<deb>."
20969 #: ../inspector/virt-inspector.pod:246
20971 "E<lt>package_managementE<gt>, if present, describes the package manager. "
20972 "Typical values include C<yum>, C<up2date> and C<apt>"
20976 #: ../inspector/virt-inspector.pod:249
20977 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
20981 #: ../inspector/virt-inspector.pod:252
20984 " <operatingsystems>\n"
20985 " <operatingsystem>\n"
20987 " <applications>\n"
20989 " <name>coreutils</name>\n"
20990 " <version>8.5</version>\n"
20991 " <release>1</release>\n"
20992 " </application>\n"
20997 #: ../inspector/virt-inspector.pod:262
20999 "The version and release fields may not be available for some types guests. "
21000 "Other fields are possible, see "
21001 "L<guestfs(3)/guestfs_inspect_list_applications>."
21005 #: ../inspector/virt-inspector.pod:266
21006 msgid "E<lt>drive_mappingsE<gt>"
21010 #: ../inspector/virt-inspector.pod:268
21012 "For operating systems like Windows which use drive letters, virt-inspector "
21013 "is able to find out how drive letters map to filesystems."
21017 #: ../inspector/virt-inspector.pod:272
21020 " <operatingsystems>\n"
21021 " <operatingsystem>\n"
21023 " <drive_mappings>\n"
21024 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21025 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21026 " </drive_mappings>\n"
21031 #: ../inspector/virt-inspector.pod:280
21033 "In the example above, drive C maps to the filesystem on the second partition "
21034 "on the first disk, and drive E maps to the filesystem on the first partition "
21035 "on the second disk."
21039 #: ../inspector/virt-inspector.pod:284
21041 "Note that this only covers permanent local filesystem mappings, not things "
21042 "like network shares. Furthermore NTFS volume mount points may not be listed "
21047 #: ../inspector/virt-inspector.pod:288
21048 msgid "E<lt>iconE<gt>"
21052 #: ../inspector/virt-inspector.pod:290
21054 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21055 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21056 "very large and high quality."
21060 #: ../inspector/virt-inspector.pod:294
21063 " <operatingsystems>\n"
21064 " <operatingsystem>\n"
21067 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21068 " [... many lines of base64 data ...]\n"
21074 #: ../inspector/virt-inspector.pod:302
21076 "To display the icon, you have to extract it and convert the base64 data back "
21077 "to a binary file. Use an XPath query or simply an editor to extract the "
21078 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21083 #: ../inspector/virt-inspector.pod:307
21086 " base64 -i -d < icon.data > icon.png\n"
21091 #: ../inspector/virt-inspector.pod:309
21092 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21096 #: ../inspector/virt-inspector.pod:311
21098 "Virt-inspector can detect some operating system installers on install disks, "
21099 "live CDs, bootable USB keys and more."
21103 #: ../inspector/virt-inspector.pod:314
21105 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21106 "fields may be present to indicate a live CD, network installer, or one part "
21107 "of a multipart CD. For example:"
21111 #: ../inspector/virt-inspector.pod:318
21114 " <operatingsystems>\n"
21115 " <operatingsystem>\n"
21116 " <root>/dev/sda</root>\n"
21117 " <name>linux</name>\n"
21118 " <arch>i386</arch>\n"
21119 " <distro>ubuntu</distro>\n"
21120 " <product_name>Ubuntu 10.10 "Maverick "
21121 "Meerkat"</product_name>\n"
21122 " <major_version>10</major_version>\n"
21123 " <minor_version>10</minor_version>\n"
21124 " <format>installer</format>\n"
21130 #: ../inspector/virt-inspector.pod:330
21131 msgid "USING XPATH"
21135 #: ../inspector/virt-inspector.pod:332
21137 "You can use the XPath query language to select parts of the XML. We "
21138 "recommend using C<xmlstarlet> to perform XPath queries from the command "
21143 #: ../inspector/virt-inspector.pod:338
21146 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21148 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21149 " <type>ext4</type>\n"
21155 #: ../inspector/virt-inspector.pod:344
21158 " $ virt-inspector -d Guest | \\\n"
21159 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21165 #: ../inspector/virt-inspector.pod:348
21168 " $ virt-inspector -d Guest | \\\n"
21169 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21170 " [displays the guest icon, if there is one]\n"
21175 #: ../inspector/virt-inspector.pod:359
21176 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21180 #: ../inspector/virt-inspector.pod:361
21182 "Early versions of libguestfs shipped with a different virt-inspector program "
21183 "written in Perl (the current version is written in C). The XML output of "
21184 "the Perl virt-inspector was different and it could also output in other "
21185 "formats like text."
21189 #: ../inspector/virt-inspector.pod:366
21190 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
21194 #: ../inspector/virt-inspector.pod:369
21196 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21197 "versions of virt-inspector with different names:"
21201 #: ../inspector/virt-inspector.pod:372
21204 " virt-inspector Old Perl version.\n"
21205 " virt-inspector2 New C version.\n"
21210 #: ../inspector/virt-inspector.pod:382
21212 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
21213 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21217 #: ../inspector/virt-inspector.pod:399
21218 msgid "Matthew Booth L<mbooth@redhat.com>"
21222 #: ../java/examples/guestfs-java.pod:5
21223 msgid "guestfs-java - How to use libguestfs from Java"
21227 #: ../java/examples/guestfs-java.pod:9
21230 " import com.redhat.et.libguestfs.*;\n"
21235 #: ../java/examples/guestfs-java.pod:11
21238 " GuestFS g = new GuestFS ();\n"
21239 " g.add_drive_opts (\"disk.img\", null);\n"
21245 #: ../java/examples/guestfs-java.pod:17
21247 "This manual page documents how to call libguestfs from the Java programming "
21248 "language. This page just documents the differences from the C API and gives "
21249 "some examples. If you are not familiar with using libguestfs, you also need "
21250 "to read L<guestfs(3)>."
21254 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21255 msgid "CLOSING THE HANDLE"
21259 #: ../java/examples/guestfs-java.pod:24
21261 "The handle is closed when it is reaped by the garbage collector. Because "
21262 "libguestfs handles include a lot of state, it is also possible to close (and "
21263 "hence free) them explicitly by calling the C<close> method."
21267 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
21272 #: ../java/examples/guestfs-java.pod:31
21274 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21275 "exception. This has a single parameter which is the error message (a "
21280 #: ../java/examples/guestfs-java.pod:35
21281 msgid "Calling any method on a closed handle raises the same exception."
21285 #: ../java/examples/guestfs-java.pod:47
21287 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21288 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21289 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21290 "L<http://caml.inria.fr/>."
21294 #: ../ocaml/examples/guestfs-ocaml.pod:5
21295 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21299 #: ../ocaml/examples/guestfs-ocaml.pod:9
21300 msgid "Module style:"
21304 #: ../ocaml/examples/guestfs-ocaml.pod:11
21307 " let g = Guestfs.create () in\n"
21308 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21309 " Guestfs.launch g;\n"
21314 #: ../ocaml/examples/guestfs-ocaml.pod:15
21315 msgid "Object-oriented style:"
21319 #: ../ocaml/examples/guestfs-ocaml.pod:17
21322 " let g = new Guestfs.guestfs () in\n"
21323 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21329 #: ../ocaml/examples/guestfs-ocaml.pod:21
21332 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21334 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21339 #: ../ocaml/examples/guestfs-ocaml.pod:27
21341 "This manual page documents how to call libguestfs from the OCaml programming "
21342 "language. This page just documents the differences from the C API and gives "
21343 "some examples. If you are not familiar with using libguestfs, you also need "
21344 "to read L<guestfs(3)>."
21348 #: ../ocaml/examples/guestfs-ocaml.pod:32
21349 msgid "PROGRAMMING STYLES"
21353 #: ../ocaml/examples/guestfs-ocaml.pod:34
21355 "There are two different programming styles supported by the OCaml bindings. "
21356 "You can use a module style, with each C function mapped to an OCaml "
21361 #: ../ocaml/examples/guestfs-ocaml.pod:38
21364 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21369 #: ../ocaml/examples/guestfs-ocaml.pod:40
21374 #: ../ocaml/examples/guestfs-ocaml.pod:42
21377 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21382 #: ../ocaml/examples/guestfs-ocaml.pod:44
21384 "Alternately you can use an object-oriented style, calling methods on the "
21385 "class C<Guestfs.guestfs>:"
21389 #: ../ocaml/examples/guestfs-ocaml.pod:47
21392 " method set_verbose : bool -> unit\n"
21397 #: ../ocaml/examples/guestfs-ocaml.pod:49
21399 "The object-oriented style is usually briefer, and the minor performance "
21400 "penalty isn't noticable in the general overhead of performing libguestfs "
21405 #: ../ocaml/examples/guestfs-ocaml.pod:55
21407 "The handle is closed when it is reaped by the garbage collector. Because "
21408 "libguestfs handles include a lot of state, it is also possible to close (and "
21409 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21414 #: ../ocaml/examples/guestfs-ocaml.pod:62
21416 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21417 "exception. This has a single parameter which is the error message (a "
21422 #: ../ocaml/examples/guestfs-ocaml.pod:66
21424 "Calling any function/method on a closed handle raises "
21425 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21430 #: ../ocaml/examples/guestfs-ocaml.pod:80
21432 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21433 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21434 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21435 "L<http://caml.inria.fr/>."
21439 #: ../perl/examples/guestfs-perl.pod:5
21440 msgid "guestfs-perl - How to use libguestfs from Perl"
21444 #: ../perl/examples/guestfs-perl.pod:9
21447 " use Sys::Guestfs;\n"
21452 #: ../perl/examples/guestfs-perl.pod:11
21455 " my $h = Sys::Guestfs->new ();\n"
21456 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21457 " $h->launch ();\n"
21458 " $h->mount_options ('', '/dev/sda1', '/');\n"
21459 " $h->touch ('/hello');\n"
21465 #: ../perl/examples/guestfs-perl.pod:20
21467 "This manual page documents how to call libguestfs from the Perl programming "
21468 "language. This page just documents the differences from the C API and gives "
21469 "some examples. If you are not familiar with using libguestfs, you also need "
21470 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21474 #: ../perl/examples/guestfs-perl.pod:26
21479 #: ../perl/examples/guestfs-perl.pod:28
21481 "Errors from libguestfs functions turn into calls to C<croak> (see "
21486 #: ../perl/examples/guestfs-perl.pod:41
21488 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21489 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21490 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21491 "L<http://libguestfs.org/>."
21495 #: ../python/examples/guestfs-python.pod:5
21496 msgid "guestfs-python - How to use libguestfs from Python"
21500 #: ../python/examples/guestfs-python.pod:9
21503 " import guestfs\n"
21504 " g = guestfs.GuestFS ()\n"
21505 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21511 #: ../python/examples/guestfs-python.pod:16
21513 "This manual page documents how to call libguestfs from the Python "
21514 "programming language. This page just documents the differences from the C "
21515 "API and gives some examples. If you are not familiar with using libguestfs, "
21516 "you also need to read L<guestfs(3)>."
21520 #: ../python/examples/guestfs-python.pod:23
21522 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21523 "single string argument which is the error message."
21527 #: ../python/examples/guestfs-python.pod:26
21528 msgid "MORE DOCUMENTATION"
21532 #: ../python/examples/guestfs-python.pod:28
21537 #: ../python/examples/guestfs-python.pod:30
21541 " >>> import guestfs\n"
21542 " >>> help (guestfs)\n"
21547 #: ../python/examples/guestfs-python.pod:44
21549 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21550 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21551 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21555 #: ../rescue/virt-rescue.pod:5
21556 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21560 #: ../rescue/virt-rescue.pod:9
21563 " virt-rescue [--options] -d domname\n"
21568 #: ../rescue/virt-rescue.pod:11
21571 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21576 #: ../rescue/virt-rescue.pod:15
21579 " virt-rescue [--options] domname\n"
21584 #: ../rescue/virt-rescue.pod:17
21587 " virt-rescue [--options] disk.img [disk.img ...]\n"
21592 #: ../rescue/virt-rescue.pod:21
21594 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21595 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21596 "you from doing this, but doesn't catch all cases."
21600 #: ../rescue/virt-rescue.pod:25
21602 "However if you use the I<--ro> (read only) option, then you can attach a "
21603 "shell to a live virtual machine. The results might be strange or "
21604 "inconsistent at times but you won't get disk corruption."
21608 #: ../rescue/virt-rescue.pod:31
21610 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21611 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21612 "recovery tools which you can use to examine or rescue a virtual machine or "
21617 #: ../rescue/virt-rescue.pod:36
21619 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21620 "on disk image(s):"
21624 #: ../rescue/virt-rescue.pod:39
21627 " virt-rescue -d GuestName\n"
21632 #: ../rescue/virt-rescue.pod:41
21635 " virt-rescue --ro -a /path/to/disk.img\n"
21640 #: ../rescue/virt-rescue.pod:43
21643 " virt-rescue -a /dev/sdc\n"
21648 #: ../rescue/virt-rescue.pod:45
21649 msgid "For live VMs you I<must> use the --ro option."
21653 #: ../rescue/virt-rescue.pod:47
21655 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21656 "in an interactive bash shell where you can use many ordinary Linux "
21657 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21658 "appliance. You must mount the virtual machine's filesystems by hand. There "
21659 "is an empty directory called C</sysroot> where you can mount filesystems."
21663 #: ../rescue/virt-rescue.pod:54
21665 "In the example below, we list logical volumes, then choose one to mount "
21666 "under C</sysroot>:"
21670 #: ../rescue/virt-rescue.pod:57
21674 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21675 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21676 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21677 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21678 " ><rescue> ls /sysroot\n"
21683 #: ../rescue/virt-rescue.pod:64
21685 "If you don't know what filesystems are available on the virtual machine then "
21686 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21690 #: ../rescue/virt-rescue.pod:70
21692 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21693 "virtual machine. For example you can use it on a blank file if you want to "
21694 "partition that file (although we would recommend using L<guestfish(1)> "
21695 "instead as it is more suitable for this purpose). You can even use "
21696 "virt-rescue on things like SD cards."
21700 #: ../rescue/virt-rescue.pod:76
21702 "Virt-rescue does not require root. You only need to run it as root if you "
21703 "need root to open the disk image."
21707 #: ../rescue/virt-rescue.pod:79
21709 "This tool is just designed for quick interactive hacking on a virtual "
21710 "machine. For more structured access to a virtual machine disk image, you "
21711 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21712 "make scripted changes to guests, use L<guestfish(1)>."
21716 #: ../rescue/virt-rescue.pod:103
21717 msgid "B<--append kernelopts>"
21721 #: ../rescue/virt-rescue.pod:105
21722 msgid "Pass additional options to the rescue kernel."
21726 #: ../rescue/virt-rescue.pod:135
21729 " virt-rescue --format=raw -a disk.img\n"
21734 #: ../rescue/virt-rescue.pod:139
21737 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21742 #: ../rescue/virt-rescue.pod:148
21747 #: ../rescue/virt-rescue.pod:150
21748 msgid "B<--memsize MB>"
21752 #: ../rescue/virt-rescue.pod:152
21754 "Change the amount of memory allocated to the rescue system. The default is "
21755 "set by libguestfs and is small but adequate for running system tools. The "
21756 "occasional program might need more memory. The parameter is specified in "
21761 #: ../rescue/virt-rescue.pod:157
21762 msgid "B<--network>"
21766 #: ../rescue/virt-rescue.pod:159
21767 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
21771 #: ../rescue/virt-rescue.pod:165
21772 msgid "Open the image read-only."
21776 #: ../rescue/virt-rescue.pod:175
21778 "Enable SELinux in the rescue appliance. You should read "
21779 "L<guestfs(3)/SELINUX> before using this option."
21783 #: ../rescue/virt-rescue.pod:178
21788 #: ../rescue/virt-rescue.pod:180
21789 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
21793 #: ../rescue/virt-rescue.pod:198
21795 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
21796 "are done read-write."
21800 #: ../rescue/virt-rescue.pod:211
21801 msgid "Previous versions of virt-rescue allowed you to write either:"
21805 #: ../rescue/virt-rescue.pod:213
21808 " virt-rescue disk.img [disk.img ...]\n"
21813 #: ../rescue/virt-rescue.pod:217
21816 " virt-rescue guestname\n"
21821 #: ../rescue/virt-rescue.pod:225
21826 #: ../rescue/virt-rescue.pod:227
21828 "Adding the I<--network> option enables QEMU user networking in the rescue "
21829 "appliance. There are some differences between user networking and ordinary "
21834 #: ../rescue/virt-rescue.pod:233
21835 msgid "ping does not work"
21839 #: ../rescue/virt-rescue.pod:235
21841 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
21842 "send the ping packets, and because virt-rescue must be able to run as "
21843 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
21844 "command. The ping command will appear to resolve addresses but will not be "
21845 "able to send or receive any packets. This does not mean that the network is "
21850 #: ../rescue/virt-rescue.pod:242
21851 msgid "cannot receive connections"
21855 #: ../rescue/virt-rescue.pod:244
21856 msgid "QEMU user networking cannot receive incoming connections."
21860 #: ../rescue/virt-rescue.pod:246
21861 msgid "making TCP connections"
21865 #: ../rescue/virt-rescue.pod:248
21867 "The virt-rescue appliance needs to be small and so does not include many "
21868 "network tools. In particular there is no L<telnet(1)> command. You can "
21869 "make TCP connections from the shell using the magical "
21870 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
21874 #: ../rescue/virt-rescue.pod:253
21877 " exec 3<>/dev/tcp/redhat.com/80\n"
21878 " echo \"GET /\" >&3\n"
21884 #: ../rescue/virt-rescue.pod:257
21885 msgid "See L<bash(1)> for more details."
21889 #: ../rescue/virt-rescue.pod:263
21891 "Several environment variables affect virt-rescue. See "
21892 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
21896 #: ../rescue/virt-rescue.pod:290
21898 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21899 "L<http://libguestfs.org/>."
21903 #: ../resize/virt-resize.pod:5
21904 msgid "virt-resize - Resize a virtual machine disk"
21908 #: ../resize/virt-resize.pod:9
21911 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
21912 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
21913 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
21918 #: ../resize/virt-resize.pod:15
21920 "Virt-resize is a tool which can resize a virtual machine disk, making it "
21921 "larger or smaller overall, and resizing or deleting any partitions contained "
21926 #: ../resize/virt-resize.pod:19
21928 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
21929 "not> be used on live virtual machines - for consistent results, shut the "
21930 "virtual machine down before resizing it."
21934 #: ../resize/virt-resize.pod:23
21936 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
21937 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
21941 #: ../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
21946 #: ../resize/virt-resize.pod:33
21948 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
21949 "fill the extra 5GB of space."
21953 #: ../resize/virt-resize.pod:36
21956 " virt-filesystems --long -h --all -a olddisk\n"
21961 #: ../resize/virt-resize.pod:38
21964 " truncate -r olddisk newdisk\n"
21965 " truncate -s +5G newdisk\n"
21970 #: ../resize/virt-resize.pod:41
21973 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
21974 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
21979 #: ../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
21984 #: ../resize/virt-resize.pod:46
21986 "As above, but make the /boot partition 200MB bigger, while giving the "
21987 "remaining space to /dev/sda2:"
21991 #: ../resize/virt-resize.pod:49
21994 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21995 " olddisk newdisk\n"
22000 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486 ../src/guestfs.pod:1436
22005 #: ../resize/virt-resize.pod:54
22007 "As in the first example, but expand a logical volume as the final step. "
22008 "This is what you would typically use for Linux guests that use LVM:"
22012 #: ../resize/virt-resize.pod:58
22015 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22016 " olddisk newdisk\n"
22021 #: ../resize/virt-resize.pod:61
22026 #: ../resize/virt-resize.pod:63
22028 "As in the first example, but the output format will be qcow2 instead of a "
22033 #: ../resize/virt-resize.pod:66
22036 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22037 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22042 #: ../resize/virt-resize.pod:71
22043 msgid "DETAILED USAGE"
22047 #: ../resize/virt-resize.pod:73
22048 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22052 #: ../resize/virt-resize.pod:77
22053 msgid "1. Shut down the virtual machine"
22057 #: ../resize/virt-resize.pod:79
22058 msgid "2. Locate input disk image"
22062 #: ../resize/virt-resize.pod:81
22064 "Locate the input disk image (ie. the file or device on the host containing "
22065 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22066 "dumpxml> like this to find the disk image name:"
22070 #: ../resize/virt-resize.pod:85
22073 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22074 " Found 1 nodes:\n"
22076 " <source dev=\"/dev/vg/lv_guest\" />\n"
22081 #: ../resize/virt-resize.pod:90
22082 msgid "3. Look at current sizing"
22086 #: ../resize/virt-resize.pod:92
22087 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22091 #: ../resize/virt-resize.pod:95
22094 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22095 " Name Type Size Parent\n"
22096 " /dev/sda1 partition 101M /dev/sda\n"
22097 " /dev/sda2 partition 7.9G /dev/sda\n"
22098 " /dev/sda device 8.0G -\n"
22103 #: ../resize/virt-resize.pod:101
22105 "(This example is a virtual machine with an 8 GB disk which we would like to "
22106 "expand up to 10 GB)."
22110 #: ../resize/virt-resize.pod:104
22111 msgid "4. Create output disk"
22115 #: ../resize/virt-resize.pod:106
22117 "Virt-resize cannot do in-place disk modifications. You have to have space "
22118 "to store the resized output disk."
22122 #: ../resize/virt-resize.pod:109
22123 msgid "To store the resized disk image in a file, create a file of a suitable size:"
22127 #: ../resize/virt-resize.pod:112
22130 " # rm -f outdisk\n"
22131 " # truncate -s 10G outdisk\n"
22136 #: ../resize/virt-resize.pod:115
22137 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22141 #: ../resize/virt-resize.pod:117
22144 " # lvcreate -L 10G -n lv_name vg_name\n"
22149 #: ../resize/virt-resize.pod:119
22150 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22154 #: ../resize/virt-resize.pod:121
22157 " # virsh pool-list\n"
22158 " # virsh vol-create-as poolname newvol 10G\n"
22163 #: ../resize/virt-resize.pod:124
22168 #: ../resize/virt-resize.pod:126
22170 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22171 "file) and the output disk. The output disk is the one created in the "
22176 #: ../resize/virt-resize.pod:130
22179 " # virt-resize indisk outdisk\n"
22184 #: ../resize/virt-resize.pod:132
22186 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22187 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22188 "larger, then an extra, empty partition is created at the end of the disk "
22189 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22194 #: ../resize/virt-resize.pod:138
22196 "More realistically you'd want to expand existing partitions in the disk "
22197 "image by passing extra options (for the full list see the L</OPTIONS> "
22202 #: ../resize/virt-resize.pod:142
22204 "L</--expand> is the most useful option. It expands the named partition "
22205 "within the disk to fill any extra space:"
22209 #: ../resize/virt-resize.pod:145
22212 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22217 #: ../resize/virt-resize.pod:147
22219 "(In this case, an extra partition is I<not> created at the end of the disk, "
22220 "because there will be no unused space)."
22224 #: ../resize/virt-resize.pod:150
22226 "L</--resize> is the other commonly used option. The following would "
22227 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22228 "rest of the available space:"
22232 #: ../resize/virt-resize.pod:154
22235 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22236 " indisk outdisk\n"
22241 #: ../resize/virt-resize.pod:157
22243 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22244 "if virt-resize knows how, it will resize the contents, the equivalent of "
22245 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22246 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22247 "filesystems, so you would have to online resize them after booting the "
22252 #: ../resize/virt-resize.pod:164
22253 msgid "Other options are covered below."
22257 #: ../resize/virt-resize.pod:166
22262 #: ../resize/virt-resize.pod:168
22263 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22267 #: ../resize/virt-resize.pod:170
22268 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22272 #: ../resize/virt-resize.pod:172
22275 " # virsh edit guestname\n"
22280 #: ../resize/virt-resize.pod:174
22282 "Change E<lt>source ...E<gt>, see "
22283 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
22287 #: ../resize/virt-resize.pod:177
22288 msgid "Then start up the domain with the new, resized disk:"
22292 #: ../resize/virt-resize.pod:179
22295 " # virsh start guestname\n"
22300 #: ../resize/virt-resize.pod:181
22302 "and check that it still works. See also the L</NOTES> section below for "
22303 "additional information."
22307 #: ../resize/virt-resize.pod:184
22308 msgid "7. Resize LVs etc inside the guest"
22312 #: ../resize/virt-resize.pod:186
22313 msgid "(This can also be done offline using L<guestfish(1)>)"
22317 #: ../resize/virt-resize.pod:188
22319 "Once the guest has booted you should see the new space available, at least "
22320 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22321 "may need to resize LVs inside PVs, and also resize filesystem types that "
22322 "virt-resize does not know how to expand."
22326 #: ../resize/virt-resize.pod:195
22327 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22331 #: ../resize/virt-resize.pod:197
22333 "Shrinking is somewhat more complex than expanding, and only an overview is "
22338 #: ../resize/virt-resize.pod:200
22340 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22341 "filesystems). The user has to shrink content before passing the disk image "
22342 "to virt-resize, and virt-resize will check that the content has been shrunk "
22347 #: ../resize/virt-resize.pod:205
22348 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22352 #: ../resize/virt-resize.pod:207
22354 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22355 "steps 3 and 4 above to allocate a new disk image."
22359 #: ../resize/virt-resize.pod:210
22360 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22364 #: ../resize/virt-resize.pod:213
22365 msgid "IGNORING OR DELETING PARTITIONS"
22369 #: ../resize/virt-resize.pod:215
22371 "virt-resize also gives a convenient way to ignore or delete partitions when "
22372 "copying from the input disk to the output disk. Ignoring a partition speeds "
22373 "up the copy where you don't care about the existing contents of a "
22374 "partition. Deleting a partition removes it completely, but note that it "
22375 "also renumbers any partitions after the one which is deleted, which can "
22376 "leave some guests unbootable."
22380 #: ../resize/virt-resize.pod:222
22381 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22385 #: ../resize/virt-resize.pod:224
22387 "If the input disk is in qcow2 format, then you may prefer that the output is "
22388 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22389 "the fly. The output format is simply determined by the format of the empty "
22390 "output container that you provide. Thus to create qcow2 output, use:"
22394 #: ../resize/virt-resize.pod:230
22397 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22402 #: ../resize/virt-resize.pod:232
22403 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22407 #: ../resize/virt-resize.pod:234
22408 msgid "Similarly, to get non-sparse raw output use:"
22412 #: ../resize/virt-resize.pod:236
22415 " fallocate -l size outdisk\n"
22420 #: ../resize/virt-resize.pod:238
22422 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22423 "if=/dev/zero of=outdisk bs=1M count=..>)"
22427 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
22428 msgid "Display help."
22432 #: ../resize/virt-resize.pod:249
22437 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22442 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
22443 msgid "Enable debugging messages."
22447 #: ../resize/virt-resize.pod:255
22448 msgid "B<--delete part>"
22452 #: ../resize/virt-resize.pod:257
22454 "Delete the named partition. It would be more accurate to describe this as "
22455 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22456 "the original disk image is left intact."
22460 #: ../resize/virt-resize.pod:261
22462 "Note that when you delete a partition, then anything contained in the "
22463 "partition is also deleted. Furthermore, this causes any partitions that "
22464 "come after to be I<renumbered>, which can easily make your guest unbootable."
22468 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
22469 msgid "You can give this option multiple times."
22473 #: ../resize/virt-resize.pod:268
22474 msgid "B<--expand part>"
22478 #: ../resize/virt-resize.pod:270
22480 "Expand the named partition so it uses up all extra space (space left over "
22481 "after any other resize changes that you request have been done)."
22485 #: ../resize/virt-resize.pod:273
22487 "If virt-resize knows how, it will expand the direct content of the "
22488 "partition. For example, if the partition is an LVM PV, it will expand the "
22489 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22490 "content it doesn't know about alone."
22494 #: ../resize/virt-resize.pod:278
22495 msgid "Currently virt-resize can resize:"
22499 #: ../resize/virt-resize.pod:284
22500 msgid "ext2, ext3 and ext4 filesystems."
22504 #: ../resize/virt-resize.pod:288
22505 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22509 #: ../resize/virt-resize.pod:290
22511 "The filesystem must have been shut down consistently last time it was used. "
22512 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22513 "consistency check, so at the first boot after resizing Windows will check "
22518 #: ../resize/virt-resize.pod:297
22520 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22521 "inside the PV, but see the I<--LV-expand> option. The user could also "
22522 "resize LVs as desired after boot."
22526 #: ../resize/virt-resize.pod:303
22527 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22531 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
22532 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22536 #: ../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
22537 msgid "B<--format> raw"
22541 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
22543 "Specify the format of the input disk image. If this flag is not given then "
22544 "it is auto-detected from the image itself."
22548 #: ../resize/virt-resize.pod:317
22550 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22551 "AND NON-SPARSE RAW FORMATS>."
22555 #: ../resize/virt-resize.pod:320
22556 msgid "B<--ignore part>"
22560 #: ../resize/virt-resize.pod:322
22562 "Ignore the named partition. Effectively this means the partition is "
22563 "allocated on the destination disk, but the content is not copied across from "
22564 "the source disk. The content of the partition will be blank (all zero "
22569 #: ../resize/virt-resize.pod:329
22570 msgid "B<--LV-expand logvol>"
22574 #: ../resize/virt-resize.pod:331
22576 "This takes the logical volume and, as a final step, expands it to fill all "
22577 "the space available in its volume group. A typical usage, assuming a Linux "
22578 "guest with a single PV C</dev/sda2> and a root device called "
22579 "C</dev/vg_guest/lv_root> would be:"
22583 #: ../resize/virt-resize.pod:336
22586 " virt-resize indisk outdisk \\\n"
22587 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22592 #: ../resize/virt-resize.pod:339
22594 "This would first expand the partition (and PV), and then expand the root "
22595 "device to fill the extra space in the PV."
22599 #: ../resize/virt-resize.pod:342
22601 "The contents of the LV are also resized if virt-resize knows how to do "
22602 "that. You can stop virt-resize from trying to expand the content by using "
22603 "the option I<--no-expand-content>."
22607 #: ../resize/virt-resize.pod:346
22608 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
22612 #: ../resize/virt-resize.pod:348
22614 "You can give this option multiple times, I<but> it doesn't make sense to do "
22615 "this unless the logical volumes you specify are all in different volume "
22620 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
22621 msgid "B<--machine-readable>"
22625 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
22627 "This option is used to make the output more machine friendly when being "
22628 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
22632 #: ../resize/virt-resize.pod:360
22633 msgid "B<--dryrun>"
22637 #: ../resize/virt-resize.pod:362
22638 msgid "Print a summary of what would be done, but don't do anything."
22642 #: ../resize/virt-resize.pod:364
22643 msgid "B<--no-copy-boot-loader>"
22647 #: ../resize/virt-resize.pod:366
22649 "By default, virt-resize copies over some sectors at the start of the disk "
22650 "(up to the beginning of the first partition). Commonly these sectors "
22651 "contain the Master Boot Record (MBR) and the boot loader, and are required "
22652 "in order for the guest to boot correctly."
22656 #: ../resize/virt-resize.pod:371
22658 "If you specify this flag, then this initial copy is not done. You may need "
22659 "to reinstall the boot loader in this case."
22663 #: ../resize/virt-resize.pod:374
22664 msgid "B<--no-extra-partition>"
22668 #: ../resize/virt-resize.pod:376
22670 "By default, virt-resize creates an extra partition if there is any extra, "
22671 "unused space after all resizing has happened. Use this option to prevent "
22672 "the extra partition from being created. If you do this then the extra space "
22673 "will be inaccessible until you run fdisk, parted, or some other partitioning "
22674 "tool in the guest."
22678 #: ../resize/virt-resize.pod:382
22680 "Note that if the surplus space is smaller than 10 MB, no extra partition "
22685 #: ../resize/virt-resize.pod:385
22686 msgid "B<--no-expand-content>"
22690 #: ../resize/virt-resize.pod:387
22692 "By default, virt-resize will try to expand the direct contents of "
22693 "partitions, if it knows how (see I<--expand> option above)."
22697 #: ../resize/virt-resize.pod:390
22699 "If you give the I<--no-expand-content> option then virt-resize will not "
22704 #: ../resize/virt-resize.pod:393
22705 msgid "B<--ntfsresize-force>"
22709 #: ../resize/virt-resize.pod:395
22711 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
22712 "the NTFS disk is marked as needing a consistency check. You have to use "
22713 "this option if you want to resize a Windows guest multiple times without "
22714 "booting into Windows between each resize."
22718 #: ../resize/virt-resize.pod:401
22719 msgid "B<--output-format> raw"
22723 #: ../resize/virt-resize.pod:403
22725 "Specify the format of the output disk image. If this flag is not given then "
22726 "it is auto-detected from the image itself."
22730 #: ../resize/virt-resize.pod:409
22732 "Note that this option I<does not create> the output format. This option "
22733 "just tells libguestfs what it is so it doesn't try to guess it. You still "
22734 "need to create the output disk with the right format. See L</QCOW2 AND "
22735 "NON-SPARSE RAW FORMATS>."
22739 #: ../resize/virt-resize.pod:418
22740 msgid "Don't print the summary."
22744 #: ../resize/virt-resize.pod:420
22745 msgid "B<--resize part=size>"
22749 #: ../resize/virt-resize.pod:422
22751 "Resize the named partition (expanding or shrinking it) so that it has the "
22756 #: ../resize/virt-resize.pod:425
22758 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
22759 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
22760 "size; or as a relative number or percentage. For example:"
22764 #: ../resize/virt-resize.pod:431
22767 " --resize /dev/sda2=10G\n"
22772 #: ../resize/virt-resize.pod:433
22775 " --resize /dev/sda4=90%\n"
22780 #: ../resize/virt-resize.pod:435
22783 " --resize /dev/sda2=+1G\n"
22788 #: ../resize/virt-resize.pod:437
22791 " --resize /dev/sda2=-200M\n"
22796 #: ../resize/virt-resize.pod:439
22799 " --resize /dev/sda1=+128K\n"
22804 #: ../resize/virt-resize.pod:441
22807 " --resize /dev/sda1=+10%\n"
22812 #: ../resize/virt-resize.pod:443
22815 " --resize /dev/sda1=-10%\n"
22820 #: ../resize/virt-resize.pod:445
22822 "You can increase the size of any partition. Virt-resize will expand the "
22823 "direct content of the partition if it knows how (see I<--expand> below)."
22827 #: ../resize/virt-resize.pod:449
22829 "You can only I<decrease> the size of partitions that contain filesystems or "
22830 "PVs which have already been shrunk. Virt-resize will check this has been "
22831 "done before proceeding, or else will print an error (see also "
22832 "I<--resize-force>)."
22836 #: ../resize/virt-resize.pod:456
22837 msgid "B<--resize-force part=size>"
22841 #: ../resize/virt-resize.pod:458
22843 "This is the same as I<--resize> except that it will let you decrease the "
22844 "size of any partition. Generally this means you will lose any data which "
22845 "was at the end of the partition you shrink, but you may not care about that "
22846 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
22847 "as a swap partition)."
22851 #: ../resize/virt-resize.pod:464
22852 msgid "See also the I<--ignore> option."
22856 #: ../resize/virt-resize.pod:466
22857 msgid "B<--shrink part>"
22861 #: ../resize/virt-resize.pod:468
22863 "Shrink the named partition until the overall disk image fits in the "
22864 "destination. The named partition B<must> contain a filesystem or PV which "
22865 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
22866 "online tools). Virt-resize will check this and give an error if it has not "
22871 #: ../resize/virt-resize.pod:474
22873 "The amount by which the overall disk must be shrunk (after carrying out all "
22874 "other operations requested by the user) is called the \"deficit\". For "
22875 "example, a straight copy (assume no other operations) from a 5GB disk image "
22876 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
22877 "would give an error unless the user specified a partition to shrink and that "
22878 "partition had more than a gigabyte of free space."
22882 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
22883 msgid "MACHINE READABLE OUTPUT"
22887 #: ../resize/virt-resize.pod:494
22889 "The I<--machine-readable> option can be used to make the output more machine "
22890 "friendly, which is useful when calling virt-resize from other programs, GUIs "
22895 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
22896 msgid "There are two ways to use this option."
22900 #: ../resize/virt-resize.pod:500
22902 "Firstly use the option on its own to query the capabilities of the "
22903 "virt-resize binary. Typical output looks like this:"
22907 #: ../resize/virt-resize.pod:503
22910 " $ virt-resize --machine-readable\n"
22912 " ntfsresize-force\n"
22920 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
22922 "A list of features is printed, one per line, and the program exits with "
22927 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
22929 "Secondly use the option in conjunction with other options to make the "
22930 "regular program output more machine friendly."
22934 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
22935 msgid "At the moment this means:"
22939 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
22941 "Progress bar messages can be parsed from stdout by looking for this regular "
22946 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
22949 " ^[0-9]+/[0-9]+$\n"
22954 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
22956 "The calling program should treat messages sent to stdout (except for "
22957 "progress bar messages) as status messages. They can be logged and/or "
22958 "displayed to the user."
22962 #: ../resize/virt-resize.pod:535
22964 "The calling program should treat messages sent to stderr as error messages. "
22965 "In addition, virt-resize exits with a non-zero status code if there was a "
22970 #: ../resize/virt-resize.pod:541
22972 "Versions of the program prior to 1.13.9 did not support the "
22973 "I<--machine-readable> option and will return an error."
22977 #: ../resize/virt-resize.pod:546
22978 msgid "\"Partition 1 does not end on cylinder boundary.\""
22982 #: ../resize/virt-resize.pod:548
22984 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
22985 "means the partitions will not be aligned to the ancient CHS geometry. "
22986 "However CHS geometry is meaningless for disks manufactured since the early "
22987 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
22988 "cylinders is not required by any modern operating system."
22992 #: ../resize/virt-resize.pod:555
22993 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
22997 #: ../resize/virt-resize.pod:557
22999 "In Windows Vista and later versions, Microsoft switched to using a separate "
23000 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23001 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
23002 "the boot partition. Doing so seems to break the guest completely. However "
23003 "expanding the second partition (ie. C: drive) should work."
23007 #: ../resize/virt-resize.pod:564
23009 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23010 "NTFS partitions have been expanded. This is just a safety check and (unless "
23011 "it find errors) is nothing to worry about."
23015 #: ../resize/virt-resize.pod:568
23016 msgid "GUEST BOOT STUCK AT \"GRUB\""
23020 #: ../resize/virt-resize.pod:570
23022 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23023 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
23024 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
23025 "although we think is to do with partition alignment."
23029 #: ../resize/virt-resize.pod:575
23032 " guestfish -i -a newdisk\n"
23033 " ><fs> cat /boot/grub/device.map\n"
23034 " # check the contents of this file are sensible or\n"
23035 " # edit the file if necessary\n"
23036 " ><fs> grub-install / /dev/vda\n"
23042 #: ../resize/virt-resize.pod:582
23044 "For more flexible guest reconfiguration, including if you need to specify "
23045 "other parameters to grub-install, use L<virt-rescue(1)>."
23049 #: ../resize/virt-resize.pod:585
23050 msgid "ALTERNATIVE TOOLS"
23054 #: ../resize/virt-resize.pod:587
23056 "There are several proprietary tools for resizing partitions. We won't "
23057 "mention any here."
23061 #: ../resize/virt-resize.pod:590
23063 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23064 "operations on disk images. They can resize and move partitions, but I don't "
23065 "think they can do anything with the contents, and they certainly don't "
23070 #: ../resize/virt-resize.pod:595
23072 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23073 "but at a much lower level. You will probably end up hand-calculating sector "
23074 "offsets, which is something that virt-resize was designed to avoid. If you "
23075 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23080 #: ../resize/virt-resize.pod:615
23082 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
23083 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
23084 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
23085 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
23086 "L<virt-sparsify(1)>, L<http://libguestfs.org/>."
23090 #: ../ruby/examples/guestfs-ruby.pod:5
23091 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23095 #: ../ruby/examples/guestfs-ruby.pod:9
23098 " require 'guestfs'\n"
23099 " g = Guestfs::Guestfs.new()\n"
23100 " g.add_drive_opts(\"disk.img\",\n"
23101 " :readonly => 1, :format => \"raw\")\n"
23107 #: ../ruby/examples/guestfs-ruby.pod:17
23109 "This manual page documents how to call libguestfs from the Ruby programming "
23110 "language. This page just documents the differences from the C API and gives "
23111 "some examples. If you are not familiar with using libguestfs, you also need "
23112 "to read L<guestfs(3)>."
23116 #: ../ruby/examples/guestfs-ruby.pod:24
23118 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23119 "This has a single parameter which is the error message (a string)."
23123 #: ../ruby/examples/guestfs-ruby.pod:38
23125 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23126 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23127 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23131 #: ../sparsify/virt-sparsify.pod:5
23132 msgid "virt-sparsify - Make a virtual machine disk sparse"
23136 #: ../sparsify/virt-sparsify.pod:9
23139 " virt-sparsify [--options] indisk outdisk\n"
23144 #: ../sparsify/virt-sparsify.pod:13
23146 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23147 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23148 "the disk image can be converted back to free space on the host."
23152 #: ../sparsify/virt-sparsify.pod:18
23154 "Virt-sparsify can locate and sparsify free space in most filesystems "
23155 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23159 #: ../sparsify/virt-sparsify.pod:21
23161 "Virt-sparsify can also convert between some disk formats, for example "
23162 "converting a raw disk image to a thin-provisioned qcow2 image."
23166 #: ../sparsify/virt-sparsify.pod:24
23168 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23169 "machines. If a virtual machine has more than one attached disk, you must "
23170 "sparsify each one separately."
23174 #: ../sparsify/virt-sparsify.pod:28
23175 msgid "IMPORTANT LIMITATIONS"
23179 #: ../sparsify/virt-sparsify.pod:34
23181 "Virt-sparsify does not do in-place modifications. It copies from a source "
23182 "image to a destination image, leaving the source unchanged. I<Check that "
23183 "the sparsification was successful before deleting the source image>."
23187 #: ../sparsify/virt-sparsify.pod:41
23188 msgid "The virtual machine I<must be shut down> before using this tool."
23192 #: ../sparsify/virt-sparsify.pod:45
23194 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23195 "(1 temporary copy + 1 destination image). This is in the worst case and "
23196 "usually much less space is required."
23200 #: ../sparsify/virt-sparsify.pod:51
23201 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23205 #: ../sparsify/virt-sparsify.pod:56
23206 msgid "Virt-sparsify cannot handle encrypted disks."
23210 #: ../sparsify/virt-sparsify.pod:60
23212 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23213 "this space is often used for critical items like bootloaders so it's not "
23218 #: ../sparsify/virt-sparsify.pod:66
23220 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23221 "to do this unless we can be sure there is no hibernation data, so at the "
23222 "moment swap partitions are ignored."
23226 #: ../sparsify/virt-sparsify.pod:72
23228 "You may also want to read the manual pages for the associated tools "
23229 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
23233 #: ../sparsify/virt-sparsify.pod:77
23234 msgid "Typical usage is:"
23238 #: ../sparsify/virt-sparsify.pod:79
23241 " virt-sparsify indisk outdisk\n"
23246 #: ../sparsify/virt-sparsify.pod:81
23248 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23249 "is created, or overwritten if it already exists. The format of the input "
23250 "disk is detected (eg. qcow2) and the same format is used for the output "
23255 #: ../sparsify/virt-sparsify.pod:86
23256 msgid "To convert between formats, use the I<--convert> option:"
23260 #: ../sparsify/virt-sparsify.pod:88
23263 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23268 #: ../sparsify/virt-sparsify.pod:90
23270 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23271 "can find within the source disk image. You can get it to ignore (don't zero "
23272 "free space on) certain filesystems by doing:"
23276 #: ../sparsify/virt-sparsify.pod:94
23279 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23284 #: ../sparsify/virt-sparsify.pod:96
23285 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23289 #: ../sparsify/virt-sparsify.pod:107
23290 msgid "B<--convert> raw"
23294 #: ../sparsify/virt-sparsify.pod:109
23295 msgid "B<--convert> qcow2"
23299 #: ../sparsify/virt-sparsify.pod:111
23300 msgid "B<--convert> [other formats]"
23304 #: ../sparsify/virt-sparsify.pod:113
23306 "Use C<output-format> as the format for the destination image. If this is "
23307 "not specified, then the input format is used."
23311 #: ../sparsify/virt-sparsify.pod:116
23312 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23316 #: ../sparsify/virt-sparsify.pod:118
23318 "You can also use any format supported by the L<qemu-img(1)> program, "
23319 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23323 #: ../sparsify/virt-sparsify.pod:122
23325 "Specifying the I<--convert> option is usually a good idea, because then "
23326 "virt-sparsify doesn't need to try to guess the input format."
23330 #: ../sparsify/virt-sparsify.pod:127
23331 msgid "B<--format> qcow2"
23335 #: ../sparsify/virt-sparsify.pod:135
23336 msgid "B<--ignore> filesystem"
23340 #: ../sparsify/virt-sparsify.pod:137
23341 msgid "B<--ignore> volgroup"
23345 #: ../sparsify/virt-sparsify.pod:139
23347 "Ignore the named filesystem. Free space on the filesystem will not be "
23348 "zeroed, but existing blocks of zeroes will still be sparsified."
23352 #: ../sparsify/virt-sparsify.pod:142
23354 "In the second form, this ignores the named volume group. Use the volume "
23355 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23359 #: ../sparsify/virt-sparsify.pod:157
23360 msgid "This disables progress bars and other unnecessary output."
23364 #: ../sparsify/virt-sparsify.pod:179
23366 "The I<--machine-readable> option can be used to make the output more machine "
23367 "friendly, which is useful when calling virt-sparsify from other programs, "
23372 #: ../sparsify/virt-sparsify.pod:185
23374 "Firstly use the option on its own to query the capabilities of the "
23375 "virt-sparsify binary. Typical output looks like this:"
23379 #: ../sparsify/virt-sparsify.pod:188
23382 " $ virt-sparsify --machine-readable\n"
23390 #: ../sparsify/virt-sparsify.pod:218
23392 "The calling program should treat messages sent to stderr as error messages. "
23393 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23398 #: ../sparsify/virt-sparsify.pod:224
23400 "All versions of virt-sparsify have supported the I<--machine-readable> "
23405 #: ../sparsify/virt-sparsify.pod:238
23407 "Location of the temporary directory used for the potentially large temporary "
23412 #: ../sparsify/virt-sparsify.pod:241
23414 "You should ensure there is enough free space in the worst case for a full "
23415 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23416 "to another directory that has enough space."
23420 #: ../sparsify/virt-sparsify.pod:245
23421 msgid "This defaults to C</tmp>."
23425 #: ../sparsify/virt-sparsify.pod:249
23426 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23430 #: ../sparsify/virt-sparsify.pod:253
23432 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23433 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23434 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23438 #: ../src/guestfs-actions.pod:1
23439 msgid "guestfs_add_cdrom"
23443 #: ../src/guestfs-actions.pod:3
23447 " guestfs_add_cdrom (guestfs_h *g,\n"
23448 " const char *filename);\n"
23453 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:249 ../src/guestfs-actions.pod:270
23455 "I<This function is deprecated.> In new code, use the "
23456 "L</guestfs_add_drive_opts> call instead."
23460 #: ../src/guestfs-actions.pod:24
23462 "This call checks for the existence of C<filename>. This stops you from "
23463 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23464 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23469 #: ../src/guestfs-actions.pod:31
23471 "If you just want to add an ISO file (often you use this as an efficient way "
23472 "to transfer large files into the guest), then you should probably use "
23473 "C<guestfs_add_drive_ro> instead."
23477 #: ../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:3787 ../src/guestfs-actions.pod:3802 ../src/guestfs-actions.pod:3827 ../src/guestfs-actions.pod:4016 ../src/guestfs-actions.pod:4030 ../src/guestfs-actions.pod:4043 ../src/guestfs-actions.pod:4057 ../src/guestfs-actions.pod:4072 ../src/guestfs-actions.pod:4108 ../src/guestfs-actions.pod:4180 ../src/guestfs-actions.pod:4200 ../src/guestfs-actions.pod:4217 ../src/guestfs-actions.pod:4240 ../src/guestfs-actions.pod:4263 ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:4317 ../src/guestfs-actions.pod:4336 ../src/guestfs-actions.pod:4371 ../src/guestfs-actions.pod:4383 ../src/guestfs-actions.pod:4419 ../src/guestfs-actions.pod:4435 ../src/guestfs-actions.pod:4448 ../src/guestfs-actions.pod:4463 ../src/guestfs-actions.pod:4480 ../src/guestfs-actions.pod:4573 ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4606 ../src/guestfs-actions.pod:4657 ../src/guestfs-actions.pod:4675 ../src/guestfs-actions.pod:4693 ../src/guestfs-actions.pod:4709 ../src/guestfs-actions.pod:4723 ../src/guestfs-actions.pod:4737 ../src/guestfs-actions.pod:4754 ../src/guestfs-actions.pod:4769 ../src/guestfs-actions.pod:4796 ../src/guestfs-actions.pod:4859 ../src/guestfs-actions.pod:4932 ../src/guestfs-actions.pod:4963 ../src/guestfs-actions.pod:4982 ../src/guestfs-actions.pod:5001 ../src/guestfs-actions.pod:5013 ../src/guestfs-actions.pod:5030 ../src/guestfs-actions.pod:5043 ../src/guestfs-actions.pod:5058 ../src/guestfs-actions.pod:5073 ../src/guestfs-actions.pod:5105 ../src/guestfs-actions.pod:5131 ../src/guestfs-actions.pod:5170 ../src/guestfs-actions.pod:5190 ../src/guestfs-actions.pod:5204 ../src/guestfs-actions.pod:5221 ../src/guestfs-actions.pod:5270 ../src/guestfs-actions.pod:5323 ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5413 ../src/guestfs-actions.pod:5441 ../src/guestfs-actions.pod:5458 ../src/guestfs-actions.pod:5476 ../src/guestfs-actions.pod:5616 ../src/guestfs-actions.pod:5673 ../src/guestfs-actions.pod:5695 ../src/guestfs-actions.pod:5713 ../src/guestfs-actions.pod:5745 ../src/guestfs-actions.pod:5811 ../src/guestfs-actions.pod:5828 ../src/guestfs-actions.pod:5841 ../src/guestfs-actions.pod:5855 ../src/guestfs-actions.pod:6144 ../src/guestfs-actions.pod:6163 ../src/guestfs-actions.pod:6182 ../src/guestfs-actions.pod:6196 ../src/guestfs-actions.pod:6208 ../src/guestfs-actions.pod:6222 ../src/guestfs-actions.pod:6234 ../src/guestfs-actions.pod:6248 ../src/guestfs-actions.pod:6264 ../src/guestfs-actions.pod:6285 ../src/guestfs-actions.pod:6304 ../src/guestfs-actions.pod:6323 ../src/guestfs-actions.pod:6353 ../src/guestfs-actions.pod:6371 ../src/guestfs-actions.pod:6394 ../src/guestfs-actions.pod:6412 ../src/guestfs-actions.pod:6431 ../src/guestfs-actions.pod:6452 ../src/guestfs-actions.pod:6471 ../src/guestfs-actions.pod:6488 ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6535 ../src/guestfs-actions.pod:6559 ../src/guestfs-actions.pod:6578 ../src/guestfs-actions.pod:6594 ../src/guestfs-actions.pod:6618 ../src/guestfs-actions.pod:6637 ../src/guestfs-actions.pod:6652 ../src/guestfs-actions.pod:6671 ../src/guestfs-actions.pod:6715 ../src/guestfs-actions.pod:6745 ../src/guestfs-actions.pod:6778 ../src/guestfs-actions.pod:6893 ../src/guestfs-actions.pod:7014 ../src/guestfs-actions.pod:7026 ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7052 ../src/guestfs-actions.pod:7074 ../src/guestfs-actions.pod:7087 ../src/guestfs-actions.pod:7100 ../src/guestfs-actions.pod:7113 ../src/guestfs-actions.pod:7128 ../src/guestfs-actions.pod:7187 ../src/guestfs-actions.pod:7204 ../src/guestfs-actions.pod:7220 ../src/guestfs-actions.pod:7236 ../src/guestfs-actions.pod:7253 ../src/guestfs-actions.pod:7266 ../src/guestfs-actions.pod:7286 ../src/guestfs-actions.pod:7322 ../src/guestfs-actions.pod:7336 ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7390 ../src/guestfs-actions.pod:7408 ../src/guestfs-actions.pod:7442 ../src/guestfs-actions.pod:7478 ../src/guestfs-actions.pod:7594 ../src/guestfs-actions.pod:7609 ../src/guestfs-actions.pod:7623 ../src/guestfs-actions.pod:7678 ../src/guestfs-actions.pod:7691 ../src/guestfs-actions.pod:7736 ../src/guestfs-actions.pod:7776 ../src/guestfs-actions.pod:7832 ../src/guestfs-actions.pod:7852 ../src/guestfs-actions.pod:7885 ../src/guestfs-actions.pod:7949 ../src/guestfs-actions.pod:7972 ../src/guestfs-actions.pod:8001
23478 msgid "This function returns 0 on success or -1 on error."
23482 #: ../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:3789 ../src/guestfs-actions.pod:3809 ../src/guestfs-actions.pod:5107 ../src/guestfs-actions.pod:6373 ../src/guestfs-actions.pod:6490 ../src/guestfs-actions.pod:6639 ../src/guestfs-actions.pod:7130 ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7778
23483 msgid "(Added in 0.3)"
23487 #: ../src/guestfs-actions.pod:41
23488 msgid "guestfs_add_domain"
23492 #: ../src/guestfs-actions.pod:43
23496 " guestfs_add_domain (guestfs_h *g,\n"
23497 " const char *dom,\n"
23503 #: ../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:2987 ../src/guestfs-actions.pod:4808 ../src/guestfs-actions.pod:5117 ../src/guestfs-actions.pod:5334
23505 "You may supply a list of optional arguments to this call. Use zero or more "
23506 "of the following pairs of parameters, and terminate the list with C<-1> on "
23507 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23511 #: ../src/guestfs-actions.pod:53
23514 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23515 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23516 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23517 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23518 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23523 #: ../src/guestfs-actions.pod:59
23525 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23526 "It works by connecting to libvirt, requesting the domain and domain XML from "
23527 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23532 #: ../src/guestfs-actions.pod:94
23534 "The other optional parameters are passed directly through to "
23535 "C<guestfs_add_drive_opts>."
23539 #: ../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:3105 ../src/guestfs-actions.pod:3123 ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5513 ../src/guestfs-actions.pod:5925 ../src/guestfs-actions.pod:5951 ../src/guestfs-actions.pod:7363 ../src/guestfs-actions.pod:7789 ../src/guestfs-actions.pod:7802 ../src/guestfs-actions.pod:7815
23540 msgid "On error this function returns -1."
23544 #: ../src/guestfs-actions.pod:99
23545 msgid "(Added in 1.7.4)"
23549 #: ../src/guestfs-actions.pod:101
23550 msgid "guestfs_add_domain_va"
23554 #: ../src/guestfs-actions.pod:103
23558 " guestfs_add_domain_va (guestfs_h *g,\n"
23559 " const char *dom,\n"
23560 " va_list args);\n"
23565 #: ../src/guestfs-actions.pod:108
23566 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23570 #: ../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:3071 ../src/guestfs-actions.pod:3083 ../src/guestfs-actions.pod:4873 ../src/guestfs-actions.pod:4885 ../src/guestfs-actions.pod:5145 ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5383 ../src/guestfs-actions.pod:5394
23571 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23575 #: ../src/guestfs-actions.pod:112
23576 msgid "guestfs_add_domain_argv"
23580 #: ../src/guestfs-actions.pod:114
23584 " guestfs_add_domain_argv (guestfs_h *g,\n"
23585 " const char *dom,\n"
23586 " const struct guestfs_add_domain_argv *optargs);\n"
23591 #: ../src/guestfs-actions.pod:119
23592 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23596 #: ../src/guestfs-actions.pod:123
23597 msgid "guestfs_add_drive"
23601 #: ../src/guestfs-actions.pod:125
23605 " guestfs_add_drive (guestfs_h *g,\n"
23606 " const char *filename);\n"
23611 #: ../src/guestfs-actions.pod:129
23613 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
23614 "optional parameters, so the disk is added writable, with the format being "
23615 "detected automatically."
23619 #: ../src/guestfs-actions.pod:133
23621 "Automatic detection of the format opens you up to a potential security hole "
23622 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23623 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23624 "you should think about replacing calls to this function with calls to "
23625 "C<guestfs_add_drive_opts>, and specifying the format."
23629 #: ../src/guestfs-actions.pod:144
23630 msgid "guestfs_add_drive_opts"
23634 #: ../src/guestfs-actions.pod:146
23638 " guestfs_add_drive_opts (guestfs_h *g,\n"
23639 " const char *filename,\n"
23645 #: ../src/guestfs-actions.pod:156
23648 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
23649 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
23650 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
23655 #: ../src/guestfs-actions.pod:185
23657 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
23658 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
23659 "Possible formats include C<raw> and C<qcow2>."
23663 #: ../src/guestfs-actions.pod:196
23665 "This rarely-used option lets you emulate the behaviour of the deprecated "
23666 "C<guestfs_add_drive_with_if> call (q.v.)"
23670 #: ../src/guestfs-actions.pod:203
23671 msgid "(Added in 1.5.23)"
23675 #: ../src/guestfs-actions.pod:205
23676 msgid "guestfs_add_drive_opts_va"
23680 #: ../src/guestfs-actions.pod:207
23684 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
23685 " const char *filename,\n"
23686 " va_list args);\n"
23691 #: ../src/guestfs-actions.pod:212
23692 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
23696 #: ../src/guestfs-actions.pod:216
23697 msgid "guestfs_add_drive_opts_argv"
23701 #: ../src/guestfs-actions.pod:218
23705 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
23706 " const char *filename,\n"
23707 " const struct guestfs_add_drive_opts_argv "
23713 #: ../src/guestfs-actions.pod:223
23714 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
23718 #: ../src/guestfs-actions.pod:227
23719 msgid "guestfs_add_drive_ro"
23723 #: ../src/guestfs-actions.pod:229
23727 " guestfs_add_drive_ro (guestfs_h *g,\n"
23728 " const char *filename);\n"
23733 #: ../src/guestfs-actions.pod:233
23735 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
23736 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
23737 "disk is added read-only, with the format being detected automatically."
23741 #: ../src/guestfs-actions.pod:240
23742 msgid "(Added in 1.0.38)"
23746 #: ../src/guestfs-actions.pod:242
23747 msgid "guestfs_add_drive_ro_with_if"
23751 #: ../src/guestfs-actions.pod:244
23755 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
23756 " const char *filename,\n"
23757 " const char *iface);\n"
23762 #: ../src/guestfs-actions.pod:256
23764 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
23765 "QEMU interface emulation to use at run time."
23769 #: ../src/guestfs-actions.pod:261 ../src/guestfs-actions.pod:282 ../src/guestfs-actions.pod:2580
23770 msgid "(Added in 1.0.84)"
23774 #: ../src/guestfs-actions.pod:263
23775 msgid "guestfs_add_drive_with_if"
23779 #: ../src/guestfs-actions.pod:265
23783 " guestfs_add_drive_with_if (guestfs_h *g,\n"
23784 " const char *filename,\n"
23785 " const char *iface);\n"
23790 #: ../src/guestfs-actions.pod:277
23792 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
23793 "QEMU interface emulation to use at run time."
23797 #: ../src/guestfs-actions.pod:284
23798 msgid "guestfs_aug_clear"
23802 #: ../src/guestfs-actions.pod:286
23806 " guestfs_aug_clear (guestfs_h *g,\n"
23807 " const char *augpath);\n"
23812 #: ../src/guestfs-actions.pod:295 ../src/guestfs-actions.pod:2308
23813 msgid "(Added in 1.3.4)"
23817 #: ../src/guestfs-actions.pod:297
23818 msgid "guestfs_aug_close"
23822 #: ../src/guestfs-actions.pod:299
23826 " guestfs_aug_close (guestfs_h *g);\n"
23831 #: ../src/guestfs-actions.pod:302
23833 "Close the current Augeas handle and free up any resources used by it. After "
23834 "calling this, you have to call C<guestfs_aug_init> again before you can use "
23835 "any other Augeas functions."
23839 #: ../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:6002
23840 msgid "(Added in 0.7)"
23844 #: ../src/guestfs-actions.pod:311
23845 msgid "guestfs_aug_defnode"
23849 #: ../src/guestfs-actions.pod:313
23852 " struct guestfs_int_bool *\n"
23853 " guestfs_aug_defnode (guestfs_h *g,\n"
23854 " const char *name,\n"
23855 " const char *expr,\n"
23856 " const char *val);\n"
23861 #: ../src/guestfs-actions.pod:322
23863 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23864 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
23865 "containing that single node."
23869 #: ../src/guestfs-actions.pod:330
23871 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
23872 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
23876 #: ../src/guestfs-actions.pod:336
23877 msgid "guestfs_aug_defvar"
23881 #: ../src/guestfs-actions.pod:338
23885 " guestfs_aug_defvar (guestfs_h *g,\n"
23886 " const char *name,\n"
23887 " const char *expr);\n"
23892 #: ../src/guestfs-actions.pod:354
23893 msgid "guestfs_aug_get"
23897 #: ../src/guestfs-actions.pod:356
23901 " guestfs_aug_get (guestfs_h *g,\n"
23902 " const char *augpath);\n"
23907 #: ../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:2851 ../src/guestfs-actions.pod:2955 ../src/guestfs-actions.pod:2974 ../src/guestfs-actions.pod:3189 ../src/guestfs-actions.pod:3217 ../src/guestfs-actions.pod:3238 ../src/guestfs-actions.pod:3272 ../src/guestfs-actions.pod:3335 ../src/guestfs-actions.pod:3355 ../src/guestfs-actions.pod:3375 ../src/guestfs-actions.pod:4002 ../src/guestfs-actions.pod:4355 ../src/guestfs-actions.pod:4525 ../src/guestfs-actions.pod:4635 ../src/guestfs-actions.pod:5531 ../src/guestfs-actions.pod:5730 ../src/guestfs-actions.pod:5900 ../src/guestfs-actions.pod:6078 ../src/guestfs-actions.pod:6127 ../src/guestfs-actions.pod:6799 ../src/guestfs-actions.pod:6815 ../src/guestfs-actions.pod:6839 ../src/guestfs-actions.pod:6863 ../src/guestfs-actions.pod:7537 ../src/guestfs-actions.pod:7556 ../src/guestfs-actions.pod:7574 ../src/guestfs-actions.pod:7748 ../src/guestfs-actions.pod:8065
23909 "This function returns a string, or NULL on error. I<The caller must free "
23910 "the returned string after use>."
23914 #: ../src/guestfs-actions.pod:368
23915 msgid "guestfs_aug_init"
23919 #: ../src/guestfs-actions.pod:370
23923 " guestfs_aug_init (guestfs_h *g,\n"
23924 " const char *root,\n"
23930 #: ../src/guestfs-actions.pod:379
23931 msgid "You must call this before using any other C<guestfs_aug_*> commands."
23935 #: ../src/guestfs-actions.pod:404
23937 "This option is only useful when debugging Augeas lenses. Use of this option "
23938 "may require additional memory for the libguestfs appliance. You may need to "
23939 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
23940 "C<guestfs_set_memsize>."
23944 #: ../src/guestfs-actions.pod:419
23945 msgid "Do not load the tree in C<guestfs_aug_init>."
23949 #: ../src/guestfs-actions.pod:423
23950 msgid "To close the handle, you can call C<guestfs_aug_close>."
23954 #: ../src/guestfs-actions.pod:431
23955 msgid "guestfs_aug_insert"
23959 #: ../src/guestfs-actions.pod:433
23963 " guestfs_aug_insert (guestfs_h *g,\n"
23964 " const char *augpath,\n"
23965 " const char *label,\n"
23971 #: ../src/guestfs-actions.pod:451
23972 msgid "guestfs_aug_load"
23976 #: ../src/guestfs-actions.pod:453
23980 " guestfs_aug_load (guestfs_h *g);\n"
23985 #: ../src/guestfs-actions.pod:465
23986 msgid "guestfs_aug_ls"
23990 #: ../src/guestfs-actions.pod:467
23994 " guestfs_aug_ls (guestfs_h *g,\n"
23995 " const char *augpath);\n"
24000 #: ../src/guestfs-actions.pod:471
24002 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24003 "sorting the resulting nodes into alphabetical order."
24007 #: ../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:2916 ../src/guestfs-actions.pod:3291 ../src/guestfs-actions.pod:3571 ../src/guestfs-actions.pod:3885 ../src/guestfs-actions.pod:3902 ../src/guestfs-actions.pod:3922 ../src/guestfs-actions.pod:3984 ../src/guestfs-actions.pod:4089 ../src/guestfs-actions.pod:4497 ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5872 ../src/guestfs-actions.pod:5998 ../src/guestfs-actions.pod:6112 ../src/guestfs-actions.pod:6879 ../src/guestfs-actions.pod:6940 ../src/guestfs-actions.pod:6995 ../src/guestfs-actions.pod:7141 ../src/guestfs-actions.pod:7165 ../src/guestfs-actions.pod:7641 ../src/guestfs-actions.pod:7661 ../src/guestfs-actions.pod:7708 ../src/guestfs-actions.pod:7902 ../src/guestfs-actions.pod:7921 ../src/guestfs-actions.pod:8015 ../src/guestfs-actions.pod:8034 ../src/guestfs-actions.pod:8080 ../src/guestfs-actions.pod:8099
24009 "This function returns a NULL-terminated array of strings (like "
24010 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
24011 "strings and the array after use>."
24015 #: ../src/guestfs-actions.pod:478 ../src/guestfs-actions.pod:1068 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:3649 ../src/guestfs-actions.pod:3680 ../src/guestfs-actions.pod:4338 ../src/guestfs-actions.pod:4388 ../src/guestfs-actions.pod:4575 ../src/guestfs-actions.pod:4608 ../src/guestfs-actions.pod:4771 ../src/guestfs-actions.pod:5258 ../src/guestfs-actions.pod:5813 ../src/guestfs-actions.pod:6210 ../src/guestfs-actions.pod:6224 ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6720 ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:7392 ../src/guestfs-actions.pod:7625 ../src/guestfs-actions.pod:7890
24016 msgid "(Added in 0.8)"
24020 #: ../src/guestfs-actions.pod:480
24021 msgid "guestfs_aug_match"
24025 #: ../src/guestfs-actions.pod:482
24029 " guestfs_aug_match (guestfs_h *g,\n"
24030 " const char *augpath);\n"
24035 #: ../src/guestfs-actions.pod:496
24036 msgid "guestfs_aug_mv"
24040 #: ../src/guestfs-actions.pod:498
24044 " guestfs_aug_mv (guestfs_h *g,\n"
24045 " const char *src,\n"
24046 " const char *dest);\n"
24051 #: ../src/guestfs-actions.pod:510
24052 msgid "guestfs_aug_rm"
24056 #: ../src/guestfs-actions.pod:512
24060 " guestfs_aug_rm (guestfs_h *g,\n"
24061 " const char *augpath);\n"
24066 #: ../src/guestfs-actions.pod:524
24067 msgid "guestfs_aug_save"
24071 #: ../src/guestfs-actions.pod:526
24075 " guestfs_aug_save (guestfs_h *g);\n"
24080 #: ../src/guestfs-actions.pod:531
24082 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24087 #: ../src/guestfs-actions.pod:538
24088 msgid "guestfs_aug_set"
24092 #: ../src/guestfs-actions.pod:540
24096 " guestfs_aug_set (guestfs_h *g,\n"
24097 " const char *augpath,\n"
24098 " const char *val);\n"
24103 #: ../src/guestfs-actions.pod:547
24105 "In the Augeas API, it is possible to clear a node by setting the value to "
24106 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24107 "this call. Instead you must use the C<guestfs_aug_clear> call."
24111 #: ../src/guestfs-actions.pod:556
24112 msgid "guestfs_available"
24116 #: ../src/guestfs-actions.pod:558
24120 " guestfs_available (guestfs_h *g,\n"
24121 " char *const *groups);\n"
24126 #: ../src/guestfs-actions.pod:566
24128 "The libguestfs groups, and the functions that those groups correspond to, "
24129 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24130 "runtime by calling C<guestfs_available_all_groups>."
24134 #: ../src/guestfs-actions.pod:590
24135 msgid "You must call C<guestfs_launch> before calling this function."
24139 #: ../src/guestfs-actions.pod:612
24141 "This call was added in version C<1.0.80>. In previous versions of "
24142 "libguestfs all you could do would be to speculatively execute a command to "
24143 "find out if the daemon implemented it. See also C<guestfs_version>."
24147 #: ../src/guestfs-actions.pod:621 ../src/guestfs-actions.pod:1352
24148 msgid "(Added in 1.0.80)"
24152 #: ../src/guestfs-actions.pod:623
24153 msgid "guestfs_available_all_groups"
24157 #: ../src/guestfs-actions.pod:625
24161 " guestfs_available_all_groups (guestfs_h *g);\n"
24166 #: ../src/guestfs-actions.pod:628
24168 "This command returns a list of all optional groups that this daemon knows "
24169 "about. Note this returns both supported and unsupported groups. To find "
24170 "out which ones the daemon can actually support you have to call "
24171 "C<guestfs_available> on each member of the returned list."
24175 #: ../src/guestfs-actions.pod:634
24176 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24180 #: ../src/guestfs-actions.pod:640
24181 msgid "(Added in 1.3.15)"
24185 #: ../src/guestfs-actions.pod:642
24186 msgid "guestfs_base64_in"
24190 #: ../src/guestfs-actions.pod:644
24194 " guestfs_base64_in (guestfs_h *g,\n"
24195 " const char *base64file,\n"
24196 " const char *filename);\n"
24201 #: ../src/guestfs-actions.pod:654 ../src/guestfs-actions.pod:668
24202 msgid "(Added in 1.3.5)"
24206 #: ../src/guestfs-actions.pod:656
24207 msgid "guestfs_base64_out"
24211 #: ../src/guestfs-actions.pod:658
24215 " guestfs_base64_out (guestfs_h *g,\n"
24216 " const char *filename,\n"
24217 " const char *base64file);\n"
24222 #: ../src/guestfs-actions.pod:670
24223 msgid "guestfs_blockdev_flushbufs"
24227 #: ../src/guestfs-actions.pod:672
24231 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24232 " const char *device);\n"
24237 #: ../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
24238 msgid "(Added in 0.9.3)"
24242 #: ../src/guestfs-actions.pod:685
24243 msgid "guestfs_blockdev_getbsz"
24247 #: ../src/guestfs-actions.pod:687
24251 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24252 " const char *device);\n"
24257 #: ../src/guestfs-actions.pod:702
24258 msgid "guestfs_blockdev_getro"
24262 #: ../src/guestfs-actions.pod:704
24266 " guestfs_blockdev_getro (guestfs_h *g,\n"
24267 " const char *device);\n"
24272 #: ../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:3392 ../src/guestfs-actions.pod:3408 ../src/guestfs-actions.pod:3426 ../src/guestfs-actions.pod:3588 ../src/guestfs-actions.pod:3602 ../src/guestfs-actions.pod:3617 ../src/guestfs-actions.pod:3631 ../src/guestfs-actions.pod:3647 ../src/guestfs-actions.pod:3662 ../src/guestfs-actions.pod:3678 ../src/guestfs-actions.pod:3692 ../src/guestfs-actions.pod:3705 ../src/guestfs-actions.pod:3719 ../src/guestfs-actions.pod:3734 ../src/guestfs-actions.pod:3749 ../src/guestfs-actions.pod:3762 ../src/guestfs-actions.pod:3776 ../src/guestfs-actions.pod:5495
24273 msgid "This function returns a C truth value on success or -1 on error."
24277 #: ../src/guestfs-actions.pod:717
24278 msgid "guestfs_blockdev_getsize64"
24282 #: ../src/guestfs-actions.pod:719
24286 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24287 " const char *device);\n"
24292 #: ../src/guestfs-actions.pod:725
24293 msgid "See also C<guestfs_blockdev_getsz>."
24297 #: ../src/guestfs-actions.pod:733
24298 msgid "guestfs_blockdev_getss"
24302 #: ../src/guestfs-actions.pod:735
24306 " guestfs_blockdev_getss (guestfs_h *g,\n"
24307 " const char *device);\n"
24312 #: ../src/guestfs-actions.pod:742
24314 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24319 #: ../src/guestfs-actions.pod:751
24320 msgid "guestfs_blockdev_getsz"
24324 #: ../src/guestfs-actions.pod:753
24328 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24329 " const char *device);\n"
24334 #: ../src/guestfs-actions.pod:760
24336 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24337 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24341 #: ../src/guestfs-actions.pod:770
24342 msgid "guestfs_blockdev_rereadpt"
24346 #: ../src/guestfs-actions.pod:772
24350 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24351 " const char *device);\n"
24356 #: ../src/guestfs-actions.pod:784
24357 msgid "guestfs_blockdev_setbsz"
24361 #: ../src/guestfs-actions.pod:786
24365 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24366 " const char *device,\n"
24367 " int blocksize);\n"
24372 #: ../src/guestfs-actions.pod:802
24373 msgid "guestfs_blockdev_setro"
24377 #: ../src/guestfs-actions.pod:804
24381 " guestfs_blockdev_setro (guestfs_h *g,\n"
24382 " const char *device);\n"
24387 #: ../src/guestfs-actions.pod:816
24388 msgid "guestfs_blockdev_setrw"
24392 #: ../src/guestfs-actions.pod:818
24396 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24397 " const char *device);\n"
24402 #: ../src/guestfs-actions.pod:830
24403 msgid "guestfs_btrfs_filesystem_resize"
24407 #: ../src/guestfs-actions.pod:832
24411 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24412 " const char *mountpoint,\n"
24418 #: ../src/guestfs-actions.pod:842
24421 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24426 #: ../src/guestfs-actions.pod:865
24427 msgid "(Added in 1.11.17)"
24431 #: ../src/guestfs-actions.pod:867
24432 msgid "guestfs_btrfs_filesystem_resize_va"
24436 #: ../src/guestfs-actions.pod:869
24440 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24441 " const char *mountpoint,\n"
24442 " va_list args);\n"
24447 #: ../src/guestfs-actions.pod:874
24448 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24452 #: ../src/guestfs-actions.pod:878
24453 msgid "guestfs_btrfs_filesystem_resize_argv"
24457 #: ../src/guestfs-actions.pod:880
24461 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24462 " const char *mountpoint,\n"
24464 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24469 #: ../src/guestfs-actions.pod:885
24470 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24474 #: ../src/guestfs-actions.pod:889
24475 msgid "guestfs_case_sensitive_path"
24479 #: ../src/guestfs-actions.pod:891
24483 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24484 " const char *path);\n"
24489 #: ../src/guestfs-actions.pod:917
24491 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24492 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24493 "how the directories were originally created under Windows)."
24497 #: ../src/guestfs-actions.pod:925
24498 msgid "See also C<guestfs_realpath>."
24502 #: ../src/guestfs-actions.pod:930 ../src/guestfs-actions.pod:7559
24503 msgid "(Added in 1.0.75)"
24507 #: ../src/guestfs-actions.pod:932
24508 msgid "guestfs_cat"
24512 #: ../src/guestfs-actions.pod:934
24516 " guestfs_cat (guestfs_h *g,\n"
24517 " const char *path);\n"
24522 #: ../src/guestfs-actions.pod:940
24524 "Note that this function cannot correctly handle binary files (specifically, "
24525 "files containing C<\\0> character which is treated as end of string). For "
24526 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24527 "functions which have a more complex interface."
24531 #: ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3988 ../src/guestfs-actions.pod:4005 ../src/guestfs-actions.pod:4093 ../src/guestfs-actions.pod:4501 ../src/guestfs-actions.pod:4515 ../src/guestfs-actions.pod:5876 ../src/guestfs-actions.pod:5890 ../src/guestfs-actions.pod:7712 ../src/guestfs-actions.pod:7726
24532 msgid "(Added in 0.4)"
24536 #: ../src/guestfs-actions.pod:953
24537 msgid "guestfs_checksum"
24541 #: ../src/guestfs-actions.pod:955
24545 " guestfs_checksum (guestfs_h *g,\n"
24546 " const char *csumtype,\n"
24547 " const char *path);\n"
24552 #: ../src/guestfs-actions.pod:1001
24553 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24557 #: ../src/guestfs-actions.pod:1003
24558 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24562 #: ../src/guestfs-actions.pod:1008 ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:2285 ../src/guestfs-actions.pod:3604 ../src/guestfs-actions.pod:3633 ../src/guestfs-actions.pod:3694 ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:7415
24563 msgid "(Added in 1.0.2)"
24567 #: ../src/guestfs-actions.pod:1010
24568 msgid "guestfs_checksum_device"
24572 #: ../src/guestfs-actions.pod:1012
24576 " guestfs_checksum_device (guestfs_h *g,\n"
24577 " const char *csumtype,\n"
24578 " const char *device);\n"
24583 #: ../src/guestfs-actions.pod:1017
24585 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24586 "device named C<device>. For the types of checksums supported see the "
24587 "C<guestfs_checksum> command."
24591 #: ../src/guestfs-actions.pod:1024 ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5460 ../src/guestfs-actions.pod:5497 ../src/guestfs-actions.pod:5515 ../src/guestfs-actions.pod:5697 ../src/guestfs-actions.pod:7324 ../src/guestfs-actions.pod:7338 ../src/guestfs-actions.pod:7738
24592 msgid "(Added in 1.3.2)"
24596 #: ../src/guestfs-actions.pod:1026
24597 msgid "guestfs_checksums_out"
24601 #: ../src/guestfs-actions.pod:1028
24605 " guestfs_checksums_out (guestfs_h *g,\n"
24606 " const char *csumtype,\n"
24607 " const char *directory,\n"
24608 " const char *sumsfile);\n"
24613 #: ../src/guestfs-actions.pod:1048
24614 msgid "(Added in 1.3.7)"
24618 #: ../src/guestfs-actions.pod:1050
24619 msgid "guestfs_chmod"
24623 #: ../src/guestfs-actions.pod:1052
24627 " guestfs_chmod (guestfs_h *g,\n"
24629 " const char *path);\n"
24634 #: ../src/guestfs-actions.pod:1070
24635 msgid "guestfs_chown"
24639 #: ../src/guestfs-actions.pod:1072
24643 " guestfs_chown (guestfs_h *g,\n"
24646 " const char *path);\n"
24651 #: ../src/guestfs-actions.pod:1088
24652 msgid "guestfs_command"
24656 #: ../src/guestfs-actions.pod:1090
24660 " guestfs_command (guestfs_h *g,\n"
24661 " char *const *arguments);\n"
24666 #: ../src/guestfs-actions.pod:1099
24668 "The single parameter is an argv-style list of arguments. The first element "
24669 "is the name of the program to run. Subsequent elements are parameters. The "
24670 "list must be non-empty (ie. must contain a program name). Note that the "
24671 "command runs directly, and is I<not> invoked via the shell (see "
24676 #: ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1150 ../src/guestfs-actions.pod:1726
24677 msgid "(Added in 0.9.1)"
24681 #: ../src/guestfs-actions.pod:1132
24682 msgid "guestfs_command_lines"
24686 #: ../src/guestfs-actions.pod:1134
24690 " guestfs_command_lines (guestfs_h *g,\n"
24691 " char *const *arguments);\n"
24696 #: ../src/guestfs-actions.pod:1138
24698 "This is the same as C<guestfs_command>, but splits the result into a list of "
24703 #: ../src/guestfs-actions.pod:1141
24704 msgid "See also: C<guestfs_sh_lines>"
24708 #: ../src/guestfs-actions.pod:1152
24709 msgid "guestfs_compress_device_out"
24713 #: ../src/guestfs-actions.pod:1154
24717 " guestfs_compress_device_out (guestfs_h *g,\n"
24718 " const char *ctype,\n"
24719 " const char *device,\n"
24720 " const char *zdevice,\n"
24726 #: ../src/guestfs-actions.pod:1166
24729 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
24734 #: ../src/guestfs-actions.pod:1171
24736 "The C<ctype> and optional C<level> parameters have the same meaning as in "
24737 "C<guestfs_compress_out>."
24741 #: ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:2271 ../src/guestfs-actions.pod:6596
24742 msgid "(Added in 1.13.15)"
24746 #: ../src/guestfs-actions.pod:1178
24747 msgid "guestfs_compress_device_out_va"
24751 #: ../src/guestfs-actions.pod:1180
24755 " guestfs_compress_device_out_va (guestfs_h *g,\n"
24756 " const char *ctype,\n"
24757 " const char *device,\n"
24758 " const char *zdevice,\n"
24759 " va_list args);\n"
24764 #: ../src/guestfs-actions.pod:1187
24765 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
24769 #: ../src/guestfs-actions.pod:1191
24770 msgid "guestfs_compress_device_out_argv"
24774 #: ../src/guestfs-actions.pod:1193
24778 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
24779 " const char *ctype,\n"
24780 " const char *device,\n"
24781 " const char *zdevice,\n"
24783 "guestfs_compress_device_out_argv *optargs);\n"
24788 #: ../src/guestfs-actions.pod:1200
24789 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
24793 #: ../src/guestfs-actions.pod:1204
24794 msgid "guestfs_compress_out"
24798 #: ../src/guestfs-actions.pod:1206
24802 " guestfs_compress_out (guestfs_h *g,\n"
24803 " const char *ctype,\n"
24804 " const char *file,\n"
24805 " const char *zfile,\n"
24811 #: ../src/guestfs-actions.pod:1218
24814 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
24819 #: ../src/guestfs-actions.pod:1237
24820 msgid "guestfs_compress_out_va"
24824 #: ../src/guestfs-actions.pod:1239
24828 " guestfs_compress_out_va (guestfs_h *g,\n"
24829 " const char *ctype,\n"
24830 " const char *file,\n"
24831 " const char *zfile,\n"
24832 " va_list args);\n"
24837 #: ../src/guestfs-actions.pod:1246
24838 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
24842 #: ../src/guestfs-actions.pod:1250
24843 msgid "guestfs_compress_out_argv"
24847 #: ../src/guestfs-actions.pod:1252
24851 " guestfs_compress_out_argv (guestfs_h *g,\n"
24852 " const char *ctype,\n"
24853 " const char *file,\n"
24854 " const char *zfile,\n"
24855 " const struct guestfs_compress_out_argv "
24861 #: ../src/guestfs-actions.pod:1259
24862 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
24866 #: ../src/guestfs-actions.pod:1263
24867 msgid "guestfs_config"
24871 #: ../src/guestfs-actions.pod:1265
24875 " guestfs_config (guestfs_h *g,\n"
24876 " const char *qemuparam,\n"
24877 " const char *qemuvalue);\n"
24882 #: ../src/guestfs-actions.pod:1283
24883 msgid "guestfs_copy_size"
24887 #: ../src/guestfs-actions.pod:1285
24891 " guestfs_copy_size (guestfs_h *g,\n"
24892 " const char *src,\n"
24893 " const char *dest,\n"
24894 " int64_t size);\n"
24899 #: ../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:3804 ../src/guestfs-actions.pod:7410 ../src/guestfs-actions.pod:7444 ../src/guestfs-actions.pod:7951 ../src/guestfs-actions.pod:7974
24901 "This long-running command can generate progress notification messages so "
24902 "that the caller can display a progress bar or indicator. To receive these "
24903 "messages, the caller must register a progress event callback. See "
24904 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
24908 #: ../src/guestfs-actions.pod:1304 ../src/guestfs-actions.pod:4528 ../src/guestfs-actions.pod:5903 ../src/guestfs-actions.pod:7645 ../src/guestfs-actions.pod:7665 ../src/guestfs-actions.pod:7751
24909 msgid "(Added in 1.0.87)"
24913 #: ../src/guestfs-actions.pod:1306
24918 #: ../src/guestfs-actions.pod:1308
24922 " guestfs_cp (guestfs_h *g,\n"
24923 " const char *src,\n"
24924 " const char *dest);\n"
24929 #: ../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:5272 ../src/guestfs-actions.pod:5747
24930 msgid "(Added in 1.0.18)"
24934 #: ../src/guestfs-actions.pod:1320
24935 msgid "guestfs_cp_a"
24939 #: ../src/guestfs-actions.pod:1322
24943 " guestfs_cp_a (guestfs_h *g,\n"
24944 " const char *src,\n"
24945 " const char *dest);\n"
24950 #: ../src/guestfs-actions.pod:1334
24955 #: ../src/guestfs-actions.pod:1336
24959 " guestfs_dd (guestfs_h *g,\n"
24960 " const char *src,\n"
24961 " const char *dest);\n"
24966 #: ../src/guestfs-actions.pod:1346
24968 "If the destination is a device, it must be as large or larger than the "
24969 "source file or device, otherwise the copy will fail. This command cannot do "
24970 "partial copies (see C<guestfs_copy_size>)."
24974 #: ../src/guestfs-actions.pod:1354
24979 #: ../src/guestfs-actions.pod:1356
24983 " guestfs_df (guestfs_h *g);\n"
24988 #: ../src/guestfs-actions.pod:1361 ../src/guestfs-actions.pod:1378
24990 "This command is mostly useful for interactive sessions. It is I<not> "
24991 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
24996 #: ../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:4638 ../src/guestfs-actions.pod:5172 ../src/guestfs-actions.pod:7148 ../src/guestfs-actions.pod:7172 ../src/guestfs-actions.pod:7791 ../src/guestfs-actions.pod:7804 ../src/guestfs-actions.pod:7817
24997 msgid "(Added in 1.0.54)"
25001 #: ../src/guestfs-actions.pod:1370
25002 msgid "guestfs_df_h"
25006 #: ../src/guestfs-actions.pod:1372
25010 " guestfs_df_h (guestfs_h *g);\n"
25015 #: ../src/guestfs-actions.pod:1387
25016 msgid "guestfs_dmesg"
25020 #: ../src/guestfs-actions.pod:1389
25024 " guestfs_dmesg (guestfs_h *g);\n"
25029 #: ../src/guestfs-actions.pod:1396
25031 "Another way to get the same information is to enable verbose messages with "
25032 "C<guestfs_set_verbose> or by setting the environment variable "
25033 "C<LIBGUESTFS_DEBUG=1> before running the program."
25037 #: ../src/guestfs-actions.pod:1406
25038 msgid "guestfs_download"
25042 #: ../src/guestfs-actions.pod:1408
25046 " guestfs_download (guestfs_h *g,\n"
25047 " const char *remotefilename,\n"
25048 " const char *filename);\n"
25053 #: ../src/guestfs-actions.pod:1418
25054 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25058 #: ../src/guestfs-actions.pod:1429
25059 msgid "guestfs_download_offset"
25063 #: ../src/guestfs-actions.pod:1431
25067 " guestfs_download_offset (guestfs_h *g,\n"
25068 " const char *remotefilename,\n"
25069 " const char *filename,\n"
25070 " int64_t offset,\n"
25071 " int64_t size);\n"
25076 #: ../src/guestfs-actions.pod:1444
25078 "Note that there is no limit on the amount of data that can be downloaded "
25079 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25080 "full amount unless an error occurs."
25084 #: ../src/guestfs-actions.pod:1449
25085 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25089 #: ../src/guestfs-actions.pod:1458 ../src/guestfs-actions.pod:7449
25090 msgid "(Added in 1.5.17)"
25094 #: ../src/guestfs-actions.pod:1460
25095 msgid "guestfs_drop_caches"
25099 #: ../src/guestfs-actions.pod:1462
25103 " guestfs_drop_caches (guestfs_h *g,\n"
25104 " int whattodrop);\n"
25109 #: ../src/guestfs-actions.pod:1480
25114 #: ../src/guestfs-actions.pod:1482
25118 " guestfs_du (guestfs_h *g,\n"
25119 " const char *path);\n"
25124 #: ../src/guestfs-actions.pod:1505
25125 msgid "guestfs_e2fsck_f"
25129 #: ../src/guestfs-actions.pod:1507
25133 " guestfs_e2fsck_f (guestfs_h *g,\n"
25134 " const char *device);\n"
25139 #: ../src/guestfs-actions.pod:1515
25141 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25142 "Normally you should use C<guestfs_fsck>."
25146 #: ../src/guestfs-actions.pod:1520
25147 msgid "(Added in 1.0.29)"
25151 #: ../src/guestfs-actions.pod:1522
25152 msgid "guestfs_echo_daemon"
25156 #: ../src/guestfs-actions.pod:1524
25160 " guestfs_echo_daemon (guestfs_h *g,\n"
25161 " char *const *words);\n"
25166 #: ../src/guestfs-actions.pod:1533
25167 msgid "See also C<guestfs_ping_daemon>."
25171 #: ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:2296 ../src/guestfs-actions.pod:6620
25172 msgid "(Added in 1.0.69)"
25176 #: ../src/guestfs-actions.pod:1540
25177 msgid "guestfs_egrep"
25181 #: ../src/guestfs-actions.pod:1542
25185 " guestfs_egrep (guestfs_h *g,\n"
25186 " const char *regex,\n"
25187 " const char *path);\n"
25192 #: ../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:4018 ../src/guestfs-actions.pod:4032 ../src/guestfs-actions.pod:4045 ../src/guestfs-actions.pod:4059 ../src/guestfs-actions.pod:5060 ../src/guestfs-actions.pod:6081 ../src/guestfs-actions.pod:6130 ../src/guestfs-actions.pod:7016 ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7041 ../src/guestfs-actions.pod:7054 ../src/guestfs-actions.pod:7076 ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7102 ../src/guestfs-actions.pod:7115 ../src/guestfs-actions.pod:7909 ../src/guestfs-actions.pod:7928 ../src/guestfs-actions.pod:8022 ../src/guestfs-actions.pod:8041 ../src/guestfs-actions.pod:8087 ../src/guestfs-actions.pod:8106
25193 msgid "(Added in 1.0.66)"
25197 #: ../src/guestfs-actions.pod:1559
25198 msgid "guestfs_egrepi"
25202 #: ../src/guestfs-actions.pod:1561
25206 " guestfs_egrepi (guestfs_h *g,\n"
25207 " const char *regex,\n"
25208 " const char *path);\n"
25213 #: ../src/guestfs-actions.pod:1578
25214 msgid "guestfs_equal"
25218 #: ../src/guestfs-actions.pod:1580
25222 " guestfs_equal (guestfs_h *g,\n"
25223 " const char *file1,\n"
25224 " const char *file2);\n"
25229 #: ../src/guestfs-actions.pod:1594
25230 msgid "guestfs_exists"
25234 #: ../src/guestfs-actions.pod:1596
25238 " guestfs_exists (guestfs_h *g,\n"
25239 " const char *path);\n"
25244 #: ../src/guestfs-actions.pod:1603
25245 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
25249 #: ../src/guestfs-actions.pod:1609
25250 msgid "guestfs_fallocate"
25254 #: ../src/guestfs-actions.pod:1611
25258 " guestfs_fallocate (guestfs_h *g,\n"
25259 " const char *path,\n"
25265 #: ../src/guestfs-actions.pod:1616
25267 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25272 #: ../src/guestfs-actions.pod:1635
25273 msgid "guestfs_fallocate64"
25277 #: ../src/guestfs-actions.pod:1637
25281 " guestfs_fallocate64 (guestfs_h *g,\n"
25282 " const char *path,\n"
25288 #: ../src/guestfs-actions.pod:1646
25290 "Note that this call allocates disk blocks for the file. To create a sparse "
25291 "file use C<guestfs_truncate_size> instead."
25295 #: ../src/guestfs-actions.pod:1649
25297 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
25298 "oversight it only allowed 30 bit lengths to be specified, effectively "
25299 "limiting the maximum size of files created through that call to 1GB."
25303 #: ../src/guestfs-actions.pod:1660
25304 msgid "(Added in 1.3.17)"
25308 #: ../src/guestfs-actions.pod:1662
25309 msgid "guestfs_fgrep"
25313 #: ../src/guestfs-actions.pod:1664
25317 " guestfs_fgrep (guestfs_h *g,\n"
25318 " const char *pattern,\n"
25319 " const char *path);\n"
25324 #: ../src/guestfs-actions.pod:1681
25325 msgid "guestfs_fgrepi"
25329 #: ../src/guestfs-actions.pod:1683
25333 " guestfs_fgrepi (guestfs_h *g,\n"
25334 " const char *pattern,\n"
25335 " const char *path);\n"
25340 #: ../src/guestfs-actions.pod:1700
25341 msgid "guestfs_file"
25345 #: ../src/guestfs-actions.pod:1702
25349 " guestfs_file (guestfs_h *g,\n"
25350 " const char *path);\n"
25355 #: ../src/guestfs-actions.pod:1720
25357 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25358 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
25362 #: ../src/guestfs-actions.pod:1728
25363 msgid "guestfs_file_architecture"
25367 #: ../src/guestfs-actions.pod:1730
25371 " guestfs_file_architecture (guestfs_h *g,\n"
25372 " const char *filename);\n"
25377 #: ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:2001 ../src/guestfs-actions.pod:2018 ../src/guestfs-actions.pod:2752 ../src/guestfs-actions.pod:2854 ../src/guestfs-actions.pod:2920 ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3125 ../src/guestfs-actions.pod:3165 ../src/guestfs-actions.pod:3241 ../src/guestfs-actions.pod:3338 ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3707
25378 msgid "(Added in 1.5.3)"
25382 #: ../src/guestfs-actions.pod:1840
25383 msgid "guestfs_filesize"
25387 #: ../src/guestfs-actions.pod:1842
25391 " guestfs_filesize (guestfs_h *g,\n"
25392 " const char *file);\n"
25397 #: ../src/guestfs-actions.pod:1848
25399 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
25400 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
25401 "devices, use C<guestfs_blockdev_getsize64>."
25405 #: ../src/guestfs-actions.pod:1854
25406 msgid "(Added in 1.0.82)"
25410 #: ../src/guestfs-actions.pod:1856
25411 msgid "guestfs_fill"
25415 #: ../src/guestfs-actions.pod:1858
25419 " guestfs_fill (guestfs_h *g,\n"
25422 " const char *path);\n"
25427 #: ../src/guestfs-actions.pod:1868
25429 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25430 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
25431 "bytes use C<guestfs_fill_pattern>."
25435 #: ../src/guestfs-actions.pod:1880
25436 msgid "(Added in 1.0.79)"
25440 #: ../src/guestfs-actions.pod:1882
25441 msgid "guestfs_fill_pattern"
25445 #: ../src/guestfs-actions.pod:1884
25449 " guestfs_fill_pattern (guestfs_h *g,\n"
25450 " const char *pattern,\n"
25452 " const char *path);\n"
25457 #: ../src/guestfs-actions.pod:1890
25459 "This function is like C<guestfs_fill> except that it creates a new file of "
25460 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
25461 "pattern is truncated if necessary to ensure the length of the file is "
25462 "exactly C<len> bytes."
25466 #: ../src/guestfs-actions.pod:1902
25467 msgid "(Added in 1.3.12)"
25471 #: ../src/guestfs-actions.pod:1904
25472 msgid "guestfs_find"
25476 #: ../src/guestfs-actions.pod:1906
25480 " guestfs_find (guestfs_h *g,\n"
25481 " const char *directory);\n"
25486 #: ../src/guestfs-actions.pod:1922
25487 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
25491 #: ../src/guestfs-actions.pod:1935
25492 msgid "See also C<guestfs_find0>."
25496 #: ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:4465 ../src/guestfs-actions.pod:6165
25497 msgid "(Added in 1.0.27)"
25501 #: ../src/guestfs-actions.pod:1946
25502 msgid "guestfs_find0"
25506 #: ../src/guestfs-actions.pod:1948
25510 " guestfs_find0 (guestfs_h *g,\n"
25511 " const char *directory,\n"
25512 " const char *files);\n"
25517 #: ../src/guestfs-actions.pod:1957
25519 "This command works the same way as C<guestfs_find> with the following "
25524 #: ../src/guestfs-actions.pod:1984
25525 msgid "(Added in 1.0.74)"
25529 #: ../src/guestfs-actions.pod:1986
25530 msgid "guestfs_findfs_label"
25534 #: ../src/guestfs-actions.pod:1988
25538 " guestfs_findfs_label (guestfs_h *g,\n"
25539 " const char *label);\n"
25544 #: ../src/guestfs-actions.pod:1996
25545 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
25549 #: ../src/guestfs-actions.pod:2003
25550 msgid "guestfs_findfs_uuid"
25554 #: ../src/guestfs-actions.pod:2005
25558 " guestfs_findfs_uuid (guestfs_h *g,\n"
25559 " const char *uuid);\n"
25564 #: ../src/guestfs-actions.pod:2013
25565 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
25569 #: ../src/guestfs-actions.pod:2020
25570 msgid "guestfs_fsck"
25574 #: ../src/guestfs-actions.pod:2022
25578 " guestfs_fsck (guestfs_h *g,\n"
25579 " const char *fstype,\n"
25580 " const char *device);\n"
25585 #: ../src/guestfs-actions.pod:2057 ../src/guestfs-actions.pod:7956
25586 msgid "(Added in 1.0.16)"
25590 #: ../src/guestfs-actions.pod:2059
25591 msgid "guestfs_get_append"
25595 #: ../src/guestfs-actions.pod:2061
25599 " guestfs_get_append (guestfs_h *g);\n"
25604 #: ../src/guestfs-actions.pod:2069
25606 "This function returns a string which may be NULL. There is no way to return "
25607 "an error from this function. The string is owned by the guest handle and "
25608 "must I<not> be freed."
25612 #: ../src/guestfs-actions.pod:2073 ../src/guestfs-actions.pod:5843 ../src/guestfs-actions.pod:6325 ../src/guestfs-actions.pod:6783 ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6818 ../src/guestfs-actions.pod:6842 ../src/guestfs-actions.pod:7596 ../src/guestfs-actions.pod:7611 ../src/guestfs-actions.pod:8003
25613 msgid "(Added in 1.0.26)"
25617 #: ../src/guestfs-actions.pod:2075
25618 msgid "guestfs_get_attach_method"
25622 #: ../src/guestfs-actions.pod:2077
25626 " guestfs_get_attach_method (guestfs_h *g);\n"
25631 #: ../src/guestfs-actions.pod:2080
25632 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
25636 #: ../src/guestfs-actions.pod:2085 ../src/guestfs-actions.pod:6355
25637 msgid "(Added in 1.9.8)"
25641 #: ../src/guestfs-actions.pod:2087
25642 msgid "guestfs_get_autosync"
25646 #: ../src/guestfs-actions.pod:2089
25650 " guestfs_get_autosync (guestfs_h *g);\n"
25655 #: ../src/guestfs-actions.pod:2098
25656 msgid "guestfs_get_direct"
25660 #: ../src/guestfs-actions.pod:2100
25664 " guestfs_get_direct (guestfs_h *g);\n"
25669 #: ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:6396
25670 msgid "(Added in 1.0.72)"
25674 #: ../src/guestfs-actions.pod:2109
25675 msgid "guestfs_get_e2label"
25679 #: ../src/guestfs-actions.pod:2111
25683 " guestfs_get_e2label (guestfs_h *g,\n"
25684 " const char *device);\n"
25689 #: ../src/guestfs-actions.pod:2115
25691 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
25696 #: ../src/guestfs-actions.pod:2128 ../src/guestfs-actions.pod:2149 ../src/guestfs-actions.pod:6414 ../src/guestfs-actions.pod:6433
25697 msgid "(Added in 1.0.15)"
25701 #: ../src/guestfs-actions.pod:2130
25702 msgid "guestfs_get_e2uuid"
25706 #: ../src/guestfs-actions.pod:2132
25710 " guestfs_get_e2uuid (guestfs_h *g,\n"
25711 " const char *device);\n"
25716 #: ../src/guestfs-actions.pod:2136
25718 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
25723 #: ../src/guestfs-actions.pod:2151
25724 msgid "guestfs_get_memsize"
25728 #: ../src/guestfs-actions.pod:2153
25732 " guestfs_get_memsize (guestfs_h *g);\n"
25737 #: ../src/guestfs-actions.pod:2159
25739 "If C<guestfs_set_memsize> was not called on this handle, and if "
25740 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25741 "value for memsize."
25745 #: ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4965 ../src/guestfs-actions.pod:4984 ../src/guestfs-actions.pod:5003 ../src/guestfs-actions.pod:5015 ../src/guestfs-actions.pod:5032 ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:6068 ../src/guestfs-actions.pod:6454 ../src/guestfs-actions.pod:6750 ../src/guestfs-actions.pod:7365
25746 msgid "(Added in 1.0.55)"
25750 #: ../src/guestfs-actions.pod:2170
25751 msgid "guestfs_get_network"
25755 #: ../src/guestfs-actions.pod:2172
25759 " guestfs_get_network (guestfs_h *g);\n"
25764 #: ../src/guestfs-actions.pod:2179 ../src/guestfs-actions.pod:6473
25765 msgid "(Added in 1.5.4)"
25769 #: ../src/guestfs-actions.pod:2181
25770 msgid "guestfs_get_path"
25774 #: ../src/guestfs-actions.pod:2183
25778 " guestfs_get_path (guestfs_h *g);\n"
25783 #: ../src/guestfs-actions.pod:2191 ../src/guestfs-actions.pod:2231
25785 "This function returns a string, or NULL on error. The string is owned by "
25786 "the guest handle and must I<not> be freed."
25790 #: ../src/guestfs-actions.pod:2196
25791 msgid "guestfs_get_pgroup"
25795 #: ../src/guestfs-actions.pod:2198
25799 " guestfs_get_pgroup (guestfs_h *g);\n"
25804 #: ../src/guestfs-actions.pod:2205 ../src/guestfs-actions.pod:6509 ../src/guestfs-actions.pod:7857
25805 msgid "(Added in 1.11.18)"
25809 #: ../src/guestfs-actions.pod:2207
25810 msgid "guestfs_get_pid"
25814 #: ../src/guestfs-actions.pod:2209
25818 " guestfs_get_pid (guestfs_h *g);\n"
25823 #: ../src/guestfs-actions.pod:2219
25824 msgid "(Added in 1.0.56)"
25828 #: ../src/guestfs-actions.pod:2221
25829 msgid "guestfs_get_qemu"
25833 #: ../src/guestfs-actions.pod:2223
25837 " guestfs_get_qemu (guestfs_h *g);\n"
25842 #: ../src/guestfs-actions.pod:2234 ../src/guestfs-actions.pod:6537
25843 msgid "(Added in 1.0.6)"
25847 #: ../src/guestfs-actions.pod:2236
25848 msgid "guestfs_get_recovery_proc"
25852 #: ../src/guestfs-actions.pod:2238
25856 " guestfs_get_recovery_proc (guestfs_h *g);\n"
25861 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:3829 ../src/guestfs-actions.pod:4160 ../src/guestfs-actions.pod:4563 ../src/guestfs-actions.pod:4595 ../src/guestfs-actions.pod:5773 ../src/guestfs-actions.pod:6116 ../src/guestfs-actions.pod:6561 ../src/guestfs-actions.pod:7268 ../src/guestfs-actions.pod:7288 ../src/guestfs-actions.pod:7480
25862 msgid "(Added in 1.0.77)"
25866 #: ../src/guestfs-actions.pod:2247
25867 msgid "guestfs_get_selinux"
25871 #: ../src/guestfs-actions.pod:2249
25875 " guestfs_get_selinux (guestfs_h *g);\n"
25880 #: ../src/guestfs-actions.pod:2252
25882 "This returns the current setting of the selinux flag which is passed to the "
25883 "appliance at boot time. See C<guestfs_set_selinux>."
25887 #: ../src/guestfs-actions.pod:2260 ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:6580 ../src/guestfs-actions.pod:6654
25888 msgid "(Added in 1.0.67)"
25892 #: ../src/guestfs-actions.pod:2262
25893 msgid "guestfs_get_smp"
25897 #: ../src/guestfs-actions.pod:2264
25901 " guestfs_get_smp (guestfs_h *g);\n"
25906 #: ../src/guestfs-actions.pod:2273
25907 msgid "guestfs_get_state"
25911 #: ../src/guestfs-actions.pod:2275
25915 " guestfs_get_state (guestfs_h *g);\n"
25920 #: ../src/guestfs-actions.pod:2287
25921 msgid "guestfs_get_trace"
25925 #: ../src/guestfs-actions.pod:2289
25929 " guestfs_get_trace (guestfs_h *g);\n"
25934 #: ../src/guestfs-actions.pod:2298
25935 msgid "guestfs_get_umask"
25939 #: ../src/guestfs-actions.pod:2300
25943 " guestfs_get_umask (guestfs_h *g);\n"
25948 #: ../src/guestfs-actions.pod:2303
25950 "Return the current umask. By default the umask is C<022> unless it has been "
25951 "set by calling C<guestfs_umask>."
25955 #: ../src/guestfs-actions.pod:2310
25956 msgid "guestfs_get_verbose"
25960 #: ../src/guestfs-actions.pod:2312
25964 " guestfs_get_verbose (guestfs_h *g);\n"
25969 #: ../src/guestfs-actions.pod:2321
25970 msgid "guestfs_getcon"
25974 #: ../src/guestfs-actions.pod:2323
25978 " guestfs_getcon (guestfs_h *g);\n"
25983 #: ../src/guestfs-actions.pod:2328
25984 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
25988 #: ../src/guestfs-actions.pod:2336
25989 msgid "guestfs_getxattr"
25993 #: ../src/guestfs-actions.pod:2338
25997 " guestfs_getxattr (guestfs_h *g,\n"
25998 " const char *path,\n"
25999 " const char *name,\n"
26000 " size_t *size_r);\n"
26005 #: ../src/guestfs-actions.pod:2344
26007 "Get a single extended attribute from file C<path> named C<name>. This call "
26008 "follows symlinks. If you want to lookup an extended attribute for the "
26009 "symlink itself, use C<guestfs_lgetxattr>."
26013 #: ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:3843
26015 "Normally it is better to get all extended attributes from a file in one go "
26016 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26017 "implementations are buggy and do not provide a way to list out attributes. "
26018 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26019 "extended attributes you want in advance and call this function."
26023 #: ../src/guestfs-actions.pod:2358
26024 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26028 #: ../src/guestfs-actions.pod:2360 ../src/guestfs-actions.pod:2573 ../src/guestfs-actions.pod:3055 ../src/guestfs-actions.pod:3855 ../src/guestfs-actions.pod:5766 ../src/guestfs-actions.pod:5792 ../src/guestfs-actions.pod:5973
26030 "This function returns a buffer, or NULL on error. The size of the returned "
26031 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26036 #: ../src/guestfs-actions.pod:2364 ../src/guestfs-actions.pod:3859
26037 msgid "(Added in 1.7.24)"
26041 #: ../src/guestfs-actions.pod:2366
26042 msgid "guestfs_getxattrs"
26046 #: ../src/guestfs-actions.pod:2368
26049 " struct guestfs_xattr_list *\n"
26050 " guestfs_getxattrs (guestfs_h *g,\n"
26051 " const char *path);\n"
26056 #: ../src/guestfs-actions.pod:2378
26057 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26061 #: ../src/guestfs-actions.pod:2380 ../src/guestfs-actions.pod:3871 ../src/guestfs-actions.pod:4559
26063 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26064 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26068 #: ../src/guestfs-actions.pod:2384 ../src/guestfs-actions.pod:3875 ../src/guestfs-actions.pod:4074 ../src/guestfs-actions.pod:4110 ../src/guestfs-actions.pod:6146 ../src/guestfs-actions.pod:6673 ../src/guestfs-actions.pod:8068
26069 msgid "(Added in 1.0.59)"
26073 #: ../src/guestfs-actions.pod:2386
26074 msgid "guestfs_glob_expand"
26078 #: ../src/guestfs-actions.pod:2388
26082 " guestfs_glob_expand (guestfs_h *g,\n"
26083 " const char *pattern);\n"
26088 #: ../src/guestfs-actions.pod:2407 ../src/guestfs-actions.pod:6866 ../src/guestfs-actions.pod:6883
26089 msgid "(Added in 1.0.50)"
26093 #: ../src/guestfs-actions.pod:2409
26094 msgid "guestfs_grep"
26098 #: ../src/guestfs-actions.pod:2411
26102 " guestfs_grep (guestfs_h *g,\n"
26103 " const char *regex,\n"
26104 " const char *path);\n"
26109 #: ../src/guestfs-actions.pod:2428
26110 msgid "guestfs_grepi"
26114 #: ../src/guestfs-actions.pod:2430
26118 " guestfs_grepi (guestfs_h *g,\n"
26119 " const char *regex,\n"
26120 " const char *path);\n"
26125 #: ../src/guestfs-actions.pod:2447
26126 msgid "guestfs_grub_install"
26130 #: ../src/guestfs-actions.pod:2449
26134 " guestfs_grub_install (guestfs_h *g,\n"
26135 " const char *root,\n"
26136 " const char *device);\n"
26141 #: ../src/guestfs-actions.pod:2492
26142 msgid "(Added in 1.0.17)"
26146 #: ../src/guestfs-actions.pod:2494
26147 msgid "guestfs_head"
26151 #: ../src/guestfs-actions.pod:2496
26155 " guestfs_head (guestfs_h *g,\n"
26156 " const char *path);\n"
26161 #: ../src/guestfs-actions.pod:2512
26162 msgid "guestfs_head_n"
26166 #: ../src/guestfs-actions.pod:2514
26170 " guestfs_head_n (guestfs_h *g,\n"
26172 " const char *path);\n"
26177 #: ../src/guestfs-actions.pod:2536
26178 msgid "guestfs_hexdump"
26182 #: ../src/guestfs-actions.pod:2538
26186 " guestfs_hexdump (guestfs_h *g,\n"
26187 " const char *path);\n"
26192 #: ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:6947 ../src/guestfs-actions.pod:7002
26193 msgid "(Added in 1.0.22)"
26197 #: ../src/guestfs-actions.pod:2553
26198 msgid "guestfs_initrd_cat"
26202 #: ../src/guestfs-actions.pod:2555
26206 " guestfs_initrd_cat (guestfs_h *g,\n"
26207 " const char *initrdpath,\n"
26208 " const char *filename,\n"
26209 " size_t *size_r);\n"
26214 #: ../src/guestfs-actions.pod:2571
26215 msgid "See also C<guestfs_initrd_list>."
26219 #: ../src/guestfs-actions.pod:2582
26220 msgid "guestfs_initrd_list"
26224 #: ../src/guestfs-actions.pod:2584
26228 " guestfs_initrd_list (guestfs_h *g,\n"
26229 " const char *path);\n"
26234 #: ../src/guestfs-actions.pod:2604
26235 msgid "guestfs_inotify_add_watch"
26239 #: ../src/guestfs-actions.pod:2606
26243 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26244 " const char *path,\n"
26250 #: ../src/guestfs-actions.pod:2625
26251 msgid "guestfs_inotify_close"
26255 #: ../src/guestfs-actions.pod:2627
26259 " guestfs_inotify_close (guestfs_h *g);\n"
26264 #: ../src/guestfs-actions.pod:2638
26265 msgid "guestfs_inotify_files"
26269 #: ../src/guestfs-actions.pod:2640
26273 " guestfs_inotify_files (guestfs_h *g);\n"
26278 #: ../src/guestfs-actions.pod:2643
26280 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26281 "returns a list of pathnames of objects that were touched. The returned "
26282 "pathnames are sorted and deduplicated."
26286 #: ../src/guestfs-actions.pod:2653
26287 msgid "guestfs_inotify_init"
26291 #: ../src/guestfs-actions.pod:2655
26295 " guestfs_inotify_init (guestfs_h *g,\n"
26296 " int maxevents);\n"
26301 #: ../src/guestfs-actions.pod:2663
26303 "C<maxevents> is the maximum number of events which will be queued up between "
26304 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
26305 "passed as C<0>, then the kernel (or previously set) default is used. For "
26306 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
26307 "throws away events, but records the fact that it threw them away by setting "
26308 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
26309 "C<guestfs_inotify_read>)."
26313 #: ../src/guestfs-actions.pod:2673
26315 "Before any events are generated, you have to add some watches to the "
26316 "internal watch list. See: C<guestfs_inotify_add_watch>, "
26317 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26321 #: ../src/guestfs-actions.pod:2679
26323 "Queued up events should be read periodically by calling "
26324 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26325 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
26326 "often enough then you risk the internal queue overflowing."
26330 #: ../src/guestfs-actions.pod:2686
26332 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
26333 "This also removes any watches automatically."
26337 #: ../src/guestfs-actions.pod:2699
26338 msgid "guestfs_inotify_read"
26342 #: ../src/guestfs-actions.pod:2701
26345 " struct guestfs_inotify_event_list *\n"
26346 " guestfs_inotify_read (guestfs_h *g);\n"
26351 #: ../src/guestfs-actions.pod:2715
26353 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
26354 "there was an error. I<The caller must call "
26355 "C<guestfs_free_inotify_event_list> after use>."
26359 #: ../src/guestfs-actions.pod:2721
26360 msgid "guestfs_inotify_rm_watch"
26364 #: ../src/guestfs-actions.pod:2723
26368 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
26374 #: ../src/guestfs-actions.pod:2727
26376 "Remove a previously defined inotify watch. See "
26377 "C<guestfs_inotify_add_watch>."
26381 #: ../src/guestfs-actions.pod:2734
26382 msgid "guestfs_inspect_get_arch"
26386 #: ../src/guestfs-actions.pod:2736
26390 " guestfs_inspect_get_arch (guestfs_h *g,\n"
26391 " const char *root);\n"
26396 #: ../src/guestfs-actions.pod:2740
26398 "This returns the architecture of the inspected operating system. The "
26399 "possible return values are listed under C<guestfs_file_architecture>."
26403 #: ../src/guestfs-actions.pod:2754
26404 msgid "guestfs_inspect_get_distro"
26408 #: ../src/guestfs-actions.pod:2756
26412 " guestfs_inspect_get_distro (guestfs_h *g,\n"
26413 " const char *root);\n"
26418 #: ../src/guestfs-actions.pod:2856
26419 msgid "guestfs_inspect_get_drive_mappings"
26423 #: ../src/guestfs-actions.pod:2858
26427 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
26428 " const char *root);\n"
26433 #: ../src/guestfs-actions.pod:2887
26435 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26436 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
26440 #: ../src/guestfs-actions.pod:2891 ../src/guestfs-actions.pod:3159 ../src/guestfs-actions.pod:3962 ../src/guestfs-actions.pod:5234 ../src/guestfs-actions.pod:7304
26442 "This function returns a NULL-terminated array of strings, or NULL if there "
26443 "was an error. The array of strings will always have length C<2n+1>, where "
26444 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
26445 "caller must free the strings and the array after use>."
26449 #: ../src/guestfs-actions.pod:2897 ../src/guestfs-actions.pod:3358
26450 msgid "(Added in 1.9.17)"
26454 #: ../src/guestfs-actions.pod:2899
26455 msgid "guestfs_inspect_get_filesystems"
26459 #: ../src/guestfs-actions.pod:2901
26463 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
26464 " const char *root);\n"
26469 #: ../src/guestfs-actions.pod:2913
26471 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26472 "C<guestfs_inspect_get_mountpoints>."
26476 #: ../src/guestfs-actions.pod:2922
26477 msgid "guestfs_inspect_get_format"
26481 #: ../src/guestfs-actions.pod:2924
26485 " guestfs_inspect_get_format (guestfs_h *g,\n"
26486 " const char *root);\n"
26491 #: ../src/guestfs-actions.pod:2958 ../src/guestfs-actions.pod:3394 ../src/guestfs-actions.pod:3410 ../src/guestfs-actions.pod:3428 ../src/guestfs-actions.pod:6184
26492 msgid "(Added in 1.9.4)"
26496 #: ../src/guestfs-actions.pod:2960
26497 msgid "guestfs_inspect_get_hostname"
26501 #: ../src/guestfs-actions.pod:2962
26505 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
26506 " const char *root);\n"
26511 #: ../src/guestfs-actions.pod:2977
26512 msgid "(Added in 1.7.9)"
26516 #: ../src/guestfs-actions.pod:2979
26517 msgid "guestfs_inspect_get_icon"
26521 #: ../src/guestfs-actions.pod:2981
26525 " guestfs_inspect_get_icon (guestfs_h *g,\n"
26526 " const char *root,\n"
26527 " size_t *size_r,\n"
26533 #: ../src/guestfs-actions.pod:2992
26536 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
26537 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
26542 #: ../src/guestfs-actions.pod:3059 ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:5133
26543 msgid "(Added in 1.11.12)"
26547 #: ../src/guestfs-actions.pod:3061
26548 msgid "guestfs_inspect_get_icon_va"
26552 #: ../src/guestfs-actions.pod:3063
26556 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
26557 " const char *root,\n"
26558 " size_t *size_r,\n"
26559 " va_list args);\n"
26564 #: ../src/guestfs-actions.pod:3069
26565 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
26569 #: ../src/guestfs-actions.pod:3073
26570 msgid "guestfs_inspect_get_icon_argv"
26574 #: ../src/guestfs-actions.pod:3075
26578 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
26579 " const char *root,\n"
26580 " size_t *size_r,\n"
26581 " const struct guestfs_inspect_get_icon_argv "
26587 #: ../src/guestfs-actions.pod:3081
26588 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
26592 #: ../src/guestfs-actions.pod:3085
26593 msgid "guestfs_inspect_get_major_version"
26597 #: ../src/guestfs-actions.pod:3087
26601 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
26602 " const char *root);\n"
26607 #: ../src/guestfs-actions.pod:3109
26608 msgid "guestfs_inspect_get_minor_version"
26612 #: ../src/guestfs-actions.pod:3111
26616 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
26617 " const char *root);\n"
26622 #: ../src/guestfs-actions.pod:3120
26624 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26625 "C<guestfs_inspect_get_major_version>."
26629 #: ../src/guestfs-actions.pod:3127
26630 msgid "guestfs_inspect_get_mountpoints"
26634 #: ../src/guestfs-actions.pod:3129
26638 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
26639 " const char *root);\n"
26644 #: ../src/guestfs-actions.pod:3150
26646 "For operating systems like Windows which still use drive letters, this call "
26647 "will only return an entry for the first drive \"mounted on\" C</>. For "
26648 "information about the mapping of drive letters to partitions, see "
26649 "C<guestfs_inspect_get_drive_mappings>."
26653 #: ../src/guestfs-actions.pod:3156
26655 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26656 "C<guestfs_inspect_get_filesystems>."
26660 #: ../src/guestfs-actions.pod:3167
26661 msgid "guestfs_inspect_get_package_format"
26665 #: ../src/guestfs-actions.pod:3169
26669 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
26670 " const char *root);\n"
26675 #: ../src/guestfs-actions.pod:3173
26677 "This function and C<guestfs_inspect_get_package_management> return the "
26678 "package format and package management tool used by the inspected operating "
26679 "system. For example for Fedora these functions would return C<rpm> (package "
26680 "format) and C<yum> (package management)."
26684 #: ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:3220
26685 msgid "(Added in 1.7.5)"
26689 #: ../src/guestfs-actions.pod:3194
26690 msgid "guestfs_inspect_get_package_management"
26694 #: ../src/guestfs-actions.pod:3196
26698 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
26699 " const char *root);\n"
26704 #: ../src/guestfs-actions.pod:3200
26706 "C<guestfs_inspect_get_package_format> and this function return the package "
26707 "format and package management tool used by the inspected operating system. "
26708 "For example for Fedora these functions would return C<rpm> (package format) "
26709 "and C<yum> (package management)."
26713 #: ../src/guestfs-actions.pod:3222
26714 msgid "guestfs_inspect_get_product_name"
26718 #: ../src/guestfs-actions.pod:3224
26722 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
26723 " const char *root);\n"
26728 #: ../src/guestfs-actions.pod:3243
26729 msgid "guestfs_inspect_get_product_variant"
26733 #: ../src/guestfs-actions.pod:3245
26737 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
26738 " const char *root);\n"
26743 #: ../src/guestfs-actions.pod:3268
26745 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26746 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
26750 #: ../src/guestfs-actions.pod:3275
26751 msgid "(Added in 1.9.13)"
26755 #: ../src/guestfs-actions.pod:3277
26756 msgid "guestfs_inspect_get_roots"
26760 #: ../src/guestfs-actions.pod:3279
26764 " guestfs_inspect_get_roots (guestfs_h *g);\n"
26769 #: ../src/guestfs-actions.pod:3282
26771 "This function is a convenient way to get the list of root devices, as "
26772 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
26773 "the whole inspection process."
26777 #: ../src/guestfs-actions.pod:3286
26779 "This returns an empty list if either no root devices were found or the "
26780 "caller has not called C<guestfs_inspect_os>."
26784 #: ../src/guestfs-actions.pod:3295
26785 msgid "(Added in 1.7.3)"
26789 #: ../src/guestfs-actions.pod:3297
26790 msgid "guestfs_inspect_get_type"
26794 #: ../src/guestfs-actions.pod:3299
26798 " guestfs_inspect_get_type (guestfs_h *g,\n"
26799 " const char *root);\n"
26804 #: ../src/guestfs-actions.pod:3340
26805 msgid "guestfs_inspect_get_windows_current_control_set"
26809 #: ../src/guestfs-actions.pod:3342
26813 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
26814 " const char *root);\n"
26819 #: ../src/guestfs-actions.pod:3360
26820 msgid "guestfs_inspect_get_windows_systemroot"
26824 #: ../src/guestfs-actions.pod:3362
26828 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
26829 " const char *root);\n"
26834 #: ../src/guestfs-actions.pod:3378
26835 msgid "(Added in 1.5.25)"
26839 #: ../src/guestfs-actions.pod:3380
26840 msgid "guestfs_inspect_is_live"
26844 #: ../src/guestfs-actions.pod:3382
26848 " guestfs_inspect_is_live (guestfs_h *g,\n"
26849 " const char *root);\n"
26854 #: ../src/guestfs-actions.pod:3386
26856 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26857 "disk), then this returns true if a live image was detected on the disk."
26861 #: ../src/guestfs-actions.pod:3396
26862 msgid "guestfs_inspect_is_multipart"
26866 #: ../src/guestfs-actions.pod:3398
26870 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
26871 " const char *root);\n"
26876 #: ../src/guestfs-actions.pod:3402
26878 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26879 "disk), then this returns true if the disk is part of a set."
26883 #: ../src/guestfs-actions.pod:3412
26884 msgid "guestfs_inspect_is_netinst"
26888 #: ../src/guestfs-actions.pod:3414
26892 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
26893 " const char *root);\n"
26898 #: ../src/guestfs-actions.pod:3418
26900 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26901 "disk), then this returns true if the disk is a network installer, ie. not a "
26902 "self-contained install CD but one which is likely to require network access "
26903 "to complete the install."
26907 #: ../src/guestfs-actions.pod:3430
26908 msgid "guestfs_inspect_list_applications"
26912 #: ../src/guestfs-actions.pod:3432
26915 " struct guestfs_application_list *\n"
26916 " guestfs_inspect_list_applications (guestfs_h *g,\n"
26917 " const char *root);\n"
26922 #: ../src/guestfs-actions.pod:3438
26924 "I<Note:> This call works differently from other parts of the inspection "
26925 "API. You have to call C<guestfs_inspect_os>, then "
26926 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
26927 "this. Listing applications is a significantly more difficult operation "
26928 "which requires access to the full filesystem. Also note that unlike the "
26929 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
26930 "the libguestfs handle, this call actually reads parts of the mounted "
26931 "filesystems during the call."
26935 #: ../src/guestfs-actions.pod:3528
26937 "This function returns a C<struct guestfs_application_list *>, or NULL if "
26938 "there was an error. I<The caller must call C<guestfs_free_application_list> "
26943 #: ../src/guestfs-actions.pod:3532
26944 msgid "(Added in 1.7.8)"
26948 #: ../src/guestfs-actions.pod:3534
26949 msgid "guestfs_inspect_os"
26953 #: ../src/guestfs-actions.pod:3536
26957 " guestfs_inspect_os (guestfs_h *g);\n"
26962 #: ../src/guestfs-actions.pod:3552
26964 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
26965 "functions in order to query further information about each operating system, "
26966 "such as the name and version."
26970 #: ../src/guestfs-actions.pod:3557
26972 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
26973 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
26974 "the contents. This should be called with no disks currently mounted. The "
26975 "function may also use Augeas, so any existing Augeas handle will be closed."
26979 #: ../src/guestfs-actions.pod:3569 ../src/guestfs-actions.pod:3900 ../src/guestfs-actions.pod:3982
26980 msgid "See also C<guestfs_list_filesystems>."
26984 #: ../src/guestfs-actions.pod:3577
26985 msgid "guestfs_is_blockdev"
26989 #: ../src/guestfs-actions.pod:3579
26993 " guestfs_is_blockdev (guestfs_h *g,\n"
26994 " const char *path);\n"
26999 #: ../src/guestfs-actions.pod:3586 ../src/guestfs-actions.pod:3615 ../src/guestfs-actions.pod:3645 ../src/guestfs-actions.pod:3660 ../src/guestfs-actions.pod:3676 ../src/guestfs-actions.pod:3732 ../src/guestfs-actions.pod:3747
27000 msgid "See also C<guestfs_stat>."
27004 #: ../src/guestfs-actions.pod:3590 ../src/guestfs-actions.pod:3619 ../src/guestfs-actions.pod:3664 ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3751
27005 msgid "(Added in 1.5.10)"
27009 #: ../src/guestfs-actions.pod:3592
27010 msgid "guestfs_is_busy"
27014 #: ../src/guestfs-actions.pod:3594
27018 " guestfs_is_busy (guestfs_h *g);\n"
27023 #: ../src/guestfs-actions.pod:3606
27024 msgid "guestfs_is_chardev"
27028 #: ../src/guestfs-actions.pod:3608
27032 " guestfs_is_chardev (guestfs_h *g,\n"
27033 " const char *path);\n"
27038 #: ../src/guestfs-actions.pod:3621
27039 msgid "guestfs_is_config"
27043 #: ../src/guestfs-actions.pod:3623
27047 " guestfs_is_config (guestfs_h *g);\n"
27052 #: ../src/guestfs-actions.pod:3635
27053 msgid "guestfs_is_dir"
27057 #: ../src/guestfs-actions.pod:3637
27061 " guestfs_is_dir (guestfs_h *g,\n"
27062 " const char *path);\n"
27067 #: ../src/guestfs-actions.pod:3651
27068 msgid "guestfs_is_fifo"
27072 #: ../src/guestfs-actions.pod:3653
27076 " guestfs_is_fifo (guestfs_h *g,\n"
27077 " const char *path);\n"
27082 #: ../src/guestfs-actions.pod:3666
27083 msgid "guestfs_is_file"
27087 #: ../src/guestfs-actions.pod:3668
27091 " guestfs_is_file (guestfs_h *g,\n"
27092 " const char *path);\n"
27097 #: ../src/guestfs-actions.pod:3682
27098 msgid "guestfs_is_launching"
27102 #: ../src/guestfs-actions.pod:3684
27106 " guestfs_is_launching (guestfs_h *g);\n"
27111 #: ../src/guestfs-actions.pod:3696
27112 msgid "guestfs_is_lv"
27116 #: ../src/guestfs-actions.pod:3698
27120 " guestfs_is_lv (guestfs_h *g,\n"
27121 " const char *device);\n"
27126 #: ../src/guestfs-actions.pod:3709
27127 msgid "guestfs_is_ready"
27131 #: ../src/guestfs-actions.pod:3711
27135 " guestfs_is_ready (guestfs_h *g);\n"
27140 #: ../src/guestfs-actions.pod:3723
27141 msgid "guestfs_is_socket"
27145 #: ../src/guestfs-actions.pod:3725
27149 " guestfs_is_socket (guestfs_h *g,\n"
27150 " const char *path);\n"
27155 #: ../src/guestfs-actions.pod:3738
27156 msgid "guestfs_is_symlink"
27160 #: ../src/guestfs-actions.pod:3740
27164 " guestfs_is_symlink (guestfs_h *g,\n"
27165 " const char *path);\n"
27170 #: ../src/guestfs-actions.pod:3753
27171 msgid "guestfs_is_zero"
27175 #: ../src/guestfs-actions.pod:3755
27179 " guestfs_is_zero (guestfs_h *g,\n"
27180 " const char *path);\n"
27185 #: ../src/guestfs-actions.pod:3764 ../src/guestfs-actions.pod:3778
27186 msgid "(Added in 1.11.8)"
27190 #: ../src/guestfs-actions.pod:3766
27191 msgid "guestfs_is_zero_device"
27195 #: ../src/guestfs-actions.pod:3768
27199 " guestfs_is_zero_device (guestfs_h *g,\n"
27200 " const char *device);\n"
27205 #: ../src/guestfs-actions.pod:3780
27206 msgid "guestfs_kill_subprocess"
27210 #: ../src/guestfs-actions.pod:3782
27214 " guestfs_kill_subprocess (guestfs_h *g);\n"
27219 #: ../src/guestfs-actions.pod:3791
27220 msgid "guestfs_launch"
27224 #: ../src/guestfs-actions.pod:3793
27228 " guestfs_launch (guestfs_h *g);\n"
27233 #: ../src/guestfs-actions.pod:3811
27234 msgid "guestfs_lchown"
27238 #: ../src/guestfs-actions.pod:3813
27242 " guestfs_lchown (guestfs_h *g,\n"
27245 " const char *path);\n"
27250 #: ../src/guestfs-actions.pod:3819
27252 "Change the file owner to C<owner> and group to C<group>. This is like "
27253 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27254 "changed, not the target."
27258 #: ../src/guestfs-actions.pod:3831
27259 msgid "guestfs_lgetxattr"
27263 #: ../src/guestfs-actions.pod:3833
27267 " guestfs_lgetxattr (guestfs_h *g,\n"
27268 " const char *path,\n"
27269 " const char *name,\n"
27270 " size_t *size_r);\n"
27275 #: ../src/guestfs-actions.pod:3853
27276 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27280 #: ../src/guestfs-actions.pod:3861
27281 msgid "guestfs_lgetxattrs"
27285 #: ../src/guestfs-actions.pod:3863
27288 " struct guestfs_xattr_list *\n"
27289 " guestfs_lgetxattrs (guestfs_h *g,\n"
27290 " const char *path);\n"
27295 #: ../src/guestfs-actions.pod:3867
27297 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
27298 "then it returns the extended attributes of the link itself."
27302 #: ../src/guestfs-actions.pod:3877
27303 msgid "guestfs_list_9p"
27307 #: ../src/guestfs-actions.pod:3879
27311 " guestfs_list_9p (guestfs_h *g);\n"
27316 #: ../src/guestfs-actions.pod:3891
27317 msgid "guestfs_list_devices"
27321 #: ../src/guestfs-actions.pod:3893
27325 " guestfs_list_devices (guestfs_h *g);\n"
27330 #: ../src/guestfs-actions.pod:3908
27331 msgid "guestfs_list_dm_devices"
27335 #: ../src/guestfs-actions.pod:3910
27339 " guestfs_list_dm_devices (guestfs_h *g);\n"
27344 #: ../src/guestfs-actions.pod:3915
27346 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
27347 "previous call to C<guestfs_luks_open>."
27351 #: ../src/guestfs-actions.pod:3918
27353 "Device mapper devices which correspond to logical volumes are I<not> "
27354 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
27359 #: ../src/guestfs-actions.pod:3926 ../src/guestfs-actions.pod:5372
27360 msgid "(Added in 1.11.15)"
27364 #: ../src/guestfs-actions.pod:3928
27365 msgid "guestfs_list_filesystems"
27369 #: ../src/guestfs-actions.pod:3930
27373 " guestfs_list_filesystems (guestfs_h *g);\n"
27378 #: ../src/guestfs-actions.pod:3950
27380 "This command runs other libguestfs commands, which might include "
27381 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
27382 "soon after launch and only when nothing is mounted."
27386 #: ../src/guestfs-actions.pod:3954
27388 "Not all of the filesystems returned will be mountable. In particular, swap "
27389 "partitions are returned in the list. Also this command does not check that "
27390 "each filesystem found is valid and mountable, and some filesystems might be "
27391 "mountable but require special options. Filesystems may not all belong to a "
27392 "single logical operating system (use C<guestfs_inspect_os> to look for "
27397 #: ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:5733
27398 msgid "(Added in 1.5.15)"
27402 #: ../src/guestfs-actions.pod:3970
27403 msgid "guestfs_list_partitions"
27407 #: ../src/guestfs-actions.pod:3972
27411 " guestfs_list_partitions (guestfs_h *g);\n"
27416 #: ../src/guestfs-actions.pod:3979
27418 "This does not return logical volumes. For that you will need to call "
27423 #: ../src/guestfs-actions.pod:3990
27428 #: ../src/guestfs-actions.pod:3992
27432 " guestfs_ll (guestfs_h *g,\n"
27433 " const char *directory);\n"
27438 #: ../src/guestfs-actions.pod:4007
27443 #: ../src/guestfs-actions.pod:4009
27447 " guestfs_ln (guestfs_h *g,\n"
27448 " const char *target,\n"
27449 " const char *linkname);\n"
27454 #: ../src/guestfs-actions.pod:4020
27455 msgid "guestfs_ln_f"
27459 #: ../src/guestfs-actions.pod:4022
27463 " guestfs_ln_f (guestfs_h *g,\n"
27464 " const char *target,\n"
27465 " const char *linkname);\n"
27470 #: ../src/guestfs-actions.pod:4034
27471 msgid "guestfs_ln_s"
27475 #: ../src/guestfs-actions.pod:4036
27479 " guestfs_ln_s (guestfs_h *g,\n"
27480 " const char *target,\n"
27481 " const char *linkname);\n"
27486 #: ../src/guestfs-actions.pod:4047
27487 msgid "guestfs_ln_sf"
27491 #: ../src/guestfs-actions.pod:4049
27495 " guestfs_ln_sf (guestfs_h *g,\n"
27496 " const char *target,\n"
27497 " const char *linkname);\n"
27502 #: ../src/guestfs-actions.pod:4061
27503 msgid "guestfs_lremovexattr"
27507 #: ../src/guestfs-actions.pod:4063
27511 " guestfs_lremovexattr (guestfs_h *g,\n"
27512 " const char *xattr,\n"
27513 " const char *path);\n"
27518 #: ../src/guestfs-actions.pod:4068
27520 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
27521 "link, then it removes an extended attribute of the link itself."
27525 #: ../src/guestfs-actions.pod:4076
27530 #: ../src/guestfs-actions.pod:4078
27534 " guestfs_ls (guestfs_h *g,\n"
27535 " const char *directory);\n"
27540 #: ../src/guestfs-actions.pod:4086
27542 "This command is mostly useful for interactive sessions. Programs should "
27543 "probably use C<guestfs_readdir> instead."
27547 #: ../src/guestfs-actions.pod:4095
27548 msgid "guestfs_lsetxattr"
27552 #: ../src/guestfs-actions.pod:4097
27556 " guestfs_lsetxattr (guestfs_h *g,\n"
27557 " const char *xattr,\n"
27558 " const char *val,\n"
27560 " const char *path);\n"
27565 #: ../src/guestfs-actions.pod:4104
27567 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
27568 "then it sets an extended attribute of the link itself."
27572 #: ../src/guestfs-actions.pod:4112
27573 msgid "guestfs_lstat"
27577 #: ../src/guestfs-actions.pod:4114
27580 " struct guestfs_stat *\n"
27581 " guestfs_lstat (guestfs_h *g,\n"
27582 " const char *path);\n"
27587 #: ../src/guestfs-actions.pod:4120
27589 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
27590 "link, then the link is stat-ed, not the file it refers to."
27594 #: ../src/guestfs-actions.pod:4126 ../src/guestfs-actions.pod:6907
27596 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
27597 "error. I<The caller must call C<guestfs_free_stat> after use>."
27601 #: ../src/guestfs-actions.pod:4130 ../src/guestfs-actions.pod:6911 ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:7310
27602 msgid "(Added in 0.9.2)"
27606 #: ../src/guestfs-actions.pod:4132
27607 msgid "guestfs_lstatlist"
27611 #: ../src/guestfs-actions.pod:4134
27614 " struct guestfs_stat_list *\n"
27615 " guestfs_lstatlist (guestfs_h *g,\n"
27616 " const char *path,\n"
27617 " char *const *names);\n"
27622 #: ../src/guestfs-actions.pod:4139
27624 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
27625 "files, where all files are in the directory C<path>. C<names> is the list "
27626 "of files from this directory."
27630 #: ../src/guestfs-actions.pod:4148
27632 "This call is intended for programs that want to efficiently list a directory "
27633 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
27634 "for a similarly efficient call for getting extended attributes. Very long "
27635 "directory listings might cause the protocol message size to be exceeded, "
27636 "causing this call to fail. The caller must split up such requests into "
27637 "smaller groups of names."
27641 #: ../src/guestfs-actions.pod:4156
27643 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
27644 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
27648 #: ../src/guestfs-actions.pod:4162
27649 msgid "guestfs_luks_add_key"
27653 #: ../src/guestfs-actions.pod:4164
27657 " guestfs_luks_add_key (guestfs_h *g,\n"
27658 " const char *device,\n"
27659 " const char *key,\n"
27660 " const char *newkey,\n"
27666 #: ../src/guestfs-actions.pod:4176
27668 "Note that if C<keyslot> already contains a key, then this command will "
27669 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
27673 #: ../src/guestfs-actions.pod:4182 ../src/guestfs-actions.pod:4222 ../src/guestfs-actions.pod:4245 ../src/guestfs-actions.pod:4265 ../src/guestfs-actions.pod:4300 ../src/guestfs-actions.pod:4319
27675 "This function takes a key or passphrase parameter which could contain "
27676 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
27681 #: ../src/guestfs-actions.pod:4186 ../src/guestfs-actions.pod:4226 ../src/guestfs-actions.pod:4249 ../src/guestfs-actions.pod:4269
27682 msgid "(Added in 1.5.2)"
27686 #: ../src/guestfs-actions.pod:4188
27687 msgid "guestfs_luks_close"
27691 #: ../src/guestfs-actions.pod:4190
27695 " guestfs_luks_close (guestfs_h *g,\n"
27696 " const char *device);\n"
27701 #: ../src/guestfs-actions.pod:4194
27703 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
27704 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
27705 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
27706 "underlying block device."
27710 #: ../src/guestfs-actions.pod:4202 ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4373 ../src/guestfs-actions.pod:4421
27711 msgid "(Added in 1.5.1)"
27715 #: ../src/guestfs-actions.pod:4204
27716 msgid "guestfs_luks_format"
27720 #: ../src/guestfs-actions.pod:4206
27724 " guestfs_luks_format (guestfs_h *g,\n"
27725 " const char *device,\n"
27726 " const char *key,\n"
27732 #: ../src/guestfs-actions.pod:4228
27733 msgid "guestfs_luks_format_cipher"
27737 #: ../src/guestfs-actions.pod:4230
27741 " guestfs_luks_format_cipher (guestfs_h *g,\n"
27742 " const char *device,\n"
27743 " const char *key,\n"
27745 " const char *cipher);\n"
27750 #: ../src/guestfs-actions.pod:4237
27752 "This command is the same as C<guestfs_luks_format> but it also allows you to "
27753 "set the C<cipher> used."
27757 #: ../src/guestfs-actions.pod:4251
27758 msgid "guestfs_luks_kill_slot"
27762 #: ../src/guestfs-actions.pod:4253
27766 " guestfs_luks_kill_slot (guestfs_h *g,\n"
27767 " const char *device,\n"
27768 " const char *key,\n"
27774 #: ../src/guestfs-actions.pod:4271
27775 msgid "guestfs_luks_open"
27779 #: ../src/guestfs-actions.pod:4273
27783 " guestfs_luks_open (guestfs_h *g,\n"
27784 " const char *device,\n"
27785 " const char *key,\n"
27786 " const char *mapname);\n"
27791 #: ../src/guestfs-actions.pod:4291
27793 "If this block device contains LVM volume groups, then calling "
27794 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
27799 #: ../src/guestfs-actions.pod:4295
27800 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
27804 #: ../src/guestfs-actions.pod:4306
27805 msgid "guestfs_luks_open_ro"
27809 #: ../src/guestfs-actions.pod:4308
27813 " guestfs_luks_open_ro (guestfs_h *g,\n"
27814 " const char *device,\n"
27815 " const char *key,\n"
27816 " const char *mapname);\n"
27821 #: ../src/guestfs-actions.pod:4314
27823 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
27828 #: ../src/guestfs-actions.pod:4325
27829 msgid "guestfs_lvcreate"
27833 #: ../src/guestfs-actions.pod:4327
27837 " guestfs_lvcreate (guestfs_h *g,\n"
27838 " const char *logvol,\n"
27839 " const char *volgroup,\n"
27845 #: ../src/guestfs-actions.pod:4340
27846 msgid "guestfs_lvm_canonical_lv_name"
27850 #: ../src/guestfs-actions.pod:4342
27854 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
27855 " const char *lvname);\n"
27860 #: ../src/guestfs-actions.pod:4353
27861 msgid "See also C<guestfs_is_lv>."
27865 #: ../src/guestfs-actions.pod:4358
27866 msgid "(Added in 1.5.24)"
27870 #: ../src/guestfs-actions.pod:4360
27871 msgid "guestfs_lvm_clear_filter"
27875 #: ../src/guestfs-actions.pod:4362
27879 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
27884 #: ../src/guestfs-actions.pod:4365
27886 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
27887 "see every block device."
27891 #: ../src/guestfs-actions.pod:4375
27892 msgid "guestfs_lvm_remove_all"
27896 #: ../src/guestfs-actions.pod:4377
27900 " guestfs_lvm_remove_all (guestfs_h *g);\n"
27905 #: ../src/guestfs-actions.pod:4390
27906 msgid "guestfs_lvm_set_filter"
27910 #: ../src/guestfs-actions.pod:4392
27914 " guestfs_lvm_set_filter (guestfs_h *g,\n"
27915 " char *const *devices);\n"
27920 #: ../src/guestfs-actions.pod:4423
27921 msgid "guestfs_lvremove"
27925 #: ../src/guestfs-actions.pod:4425
27929 " guestfs_lvremove (guestfs_h *g,\n"
27930 " const char *device);\n"
27935 #: ../src/guestfs-actions.pod:4437 ../src/guestfs-actions.pod:5830 ../src/guestfs-actions.pod:7680
27936 msgid "(Added in 1.0.13)"
27940 #: ../src/guestfs-actions.pod:4439
27941 msgid "guestfs_lvrename"
27945 #: ../src/guestfs-actions.pod:4441
27949 " guestfs_lvrename (guestfs_h *g,\n"
27950 " const char *logvol,\n"
27951 " const char *newlogvol);\n"
27956 #: ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:7693
27957 msgid "(Added in 1.0.83)"
27961 #: ../src/guestfs-actions.pod:4452
27962 msgid "guestfs_lvresize"
27966 #: ../src/guestfs-actions.pod:4454
27970 " guestfs_lvresize (guestfs_h *g,\n"
27971 " const char *device,\n"
27977 #: ../src/guestfs-actions.pod:4467
27978 msgid "guestfs_lvresize_free"
27982 #: ../src/guestfs-actions.pod:4469
27986 " guestfs_lvresize_free (guestfs_h *g,\n"
27987 " const char *lv,\n"
27993 #: ../src/guestfs-actions.pod:4482
27994 msgid "(Added in 1.3.3)"
27998 #: ../src/guestfs-actions.pod:4484
27999 msgid "guestfs_lvs"
28003 #: ../src/guestfs-actions.pod:4486
28007 " guestfs_lvs (guestfs_h *g);\n"
28012 #: ../src/guestfs-actions.pod:4495
28013 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28017 #: ../src/guestfs-actions.pod:4503
28018 msgid "guestfs_lvs_full"
28022 #: ../src/guestfs-actions.pod:4505
28025 " struct guestfs_lvm_lv_list *\n"
28026 " guestfs_lvs_full (guestfs_h *g);\n"
28031 #: ../src/guestfs-actions.pod:4511
28033 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28034 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
28039 #: ../src/guestfs-actions.pod:4517
28040 msgid "guestfs_lvuuid"
28044 #: ../src/guestfs-actions.pod:4519
28048 " guestfs_lvuuid (guestfs_h *g,\n"
28049 " const char *device);\n"
28054 #: ../src/guestfs-actions.pod:4530
28055 msgid "guestfs_lxattrlist"
28059 #: ../src/guestfs-actions.pod:4532
28062 " struct guestfs_xattr_list *\n"
28063 " guestfs_lxattrlist (guestfs_h *g,\n"
28064 " const char *path,\n"
28065 " char *const *names);\n"
28070 #: ../src/guestfs-actions.pod:4551
28072 "This call is intended for programs that want to efficiently list a directory "
28073 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28074 "a similarly efficient call for getting standard stats. Very long directory "
28075 "listings might cause the protocol message size to be exceeded, causing this "
28076 "call to fail. The caller must split up such requests into smaller groups of "
28081 #: ../src/guestfs-actions.pod:4565
28082 msgid "guestfs_mkdir"
28086 #: ../src/guestfs-actions.pod:4567
28090 " guestfs_mkdir (guestfs_h *g,\n"
28091 " const char *path);\n"
28096 #: ../src/guestfs-actions.pod:4577
28097 msgid "guestfs_mkdir_mode"
28101 #: ../src/guestfs-actions.pod:4579
28105 " guestfs_mkdir_mode (guestfs_h *g,\n"
28106 " const char *path,\n"
28112 #: ../src/guestfs-actions.pod:4591
28113 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28117 #: ../src/guestfs-actions.pod:4597
28118 msgid "guestfs_mkdir_p"
28122 #: ../src/guestfs-actions.pod:4599
28126 " guestfs_mkdir_p (guestfs_h *g,\n"
28127 " const char *path);\n"
28132 #: ../src/guestfs-actions.pod:4610
28133 msgid "guestfs_mkdtemp"
28137 #: ../src/guestfs-actions.pod:4612
28141 " guestfs_mkdtemp (guestfs_h *g,\n"
28142 " const char *template);\n"
28147 #: ../src/guestfs-actions.pod:4640
28148 msgid "guestfs_mke2fs_J"
28152 #: ../src/guestfs-actions.pod:4642
28156 " guestfs_mke2fs_J (guestfs_h *g,\n"
28157 " const char *fstype,\n"
28158 " int blocksize,\n"
28159 " const char *device,\n"
28160 " const char *journal);\n"
28165 #: ../src/guestfs-actions.pod:4655
28166 msgid "See also C<guestfs_mke2journal>."
28170 #: ../src/guestfs-actions.pod:4659 ../src/guestfs-actions.pod:4677 ../src/guestfs-actions.pod:4695 ../src/guestfs-actions.pod:4711 ../src/guestfs-actions.pod:4725 ../src/guestfs-actions.pod:4739 ../src/guestfs-actions.pod:4798 ../src/guestfs-actions.pod:5075
28171 msgid "(Added in 1.0.68)"
28175 #: ../src/guestfs-actions.pod:4661
28176 msgid "guestfs_mke2fs_JL"
28180 #: ../src/guestfs-actions.pod:4663
28184 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28185 " const char *fstype,\n"
28186 " int blocksize,\n"
28187 " const char *device,\n"
28188 " const char *label);\n"
28193 #: ../src/guestfs-actions.pod:4673
28194 msgid "See also C<guestfs_mke2journal_L>."
28198 #: ../src/guestfs-actions.pod:4679
28199 msgid "guestfs_mke2fs_JU"
28203 #: ../src/guestfs-actions.pod:4681
28207 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28208 " const char *fstype,\n"
28209 " int blocksize,\n"
28210 " const char *device,\n"
28211 " const char *uuid);\n"
28216 #: ../src/guestfs-actions.pod:4691
28217 msgid "See also C<guestfs_mke2journal_U>."
28221 #: ../src/guestfs-actions.pod:4697
28222 msgid "guestfs_mke2journal"
28226 #: ../src/guestfs-actions.pod:4699
28230 " guestfs_mke2journal (guestfs_h *g,\n"
28231 " int blocksize,\n"
28232 " const char *device);\n"
28237 #: ../src/guestfs-actions.pod:4713
28238 msgid "guestfs_mke2journal_L"
28242 #: ../src/guestfs-actions.pod:4715
28246 " guestfs_mke2journal_L (guestfs_h *g,\n"
28247 " int blocksize,\n"
28248 " const char *label,\n"
28249 " const char *device);\n"
28254 #: ../src/guestfs-actions.pod:4727
28255 msgid "guestfs_mke2journal_U"
28259 #: ../src/guestfs-actions.pod:4729
28263 " guestfs_mke2journal_U (guestfs_h *g,\n"
28264 " int blocksize,\n"
28265 " const char *uuid,\n"
28266 " const char *device);\n"
28271 #: ../src/guestfs-actions.pod:4741
28272 msgid "guestfs_mkfifo"
28276 #: ../src/guestfs-actions.pod:4743
28280 " guestfs_mkfifo (guestfs_h *g,\n"
28282 " const char *path);\n"
28287 #: ../src/guestfs-actions.pod:4748
28289 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28290 "is just a convenient wrapper around C<guestfs_mknod>."
28294 #: ../src/guestfs-actions.pod:4758
28295 msgid "guestfs_mkfs"
28299 #: ../src/guestfs-actions.pod:4760
28303 " guestfs_mkfs (guestfs_h *g,\n"
28304 " const char *fstype,\n"
28305 " const char *device);\n"
28310 #: ../src/guestfs-actions.pod:4773
28311 msgid "guestfs_mkfs_b"
28315 #: ../src/guestfs-actions.pod:4775
28319 " guestfs_mkfs_b (guestfs_h *g,\n"
28320 " const char *fstype,\n"
28321 " int blocksize,\n"
28322 " const char *device);\n"
28327 #: ../src/guestfs-actions.pod:4781
28329 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
28334 #: ../src/guestfs-actions.pod:4788
28336 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
28337 "block size of the resulting filesystem. Supported block sizes depend on the "
28338 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28342 #: ../src/guestfs-actions.pod:4800
28343 msgid "guestfs_mkfs_opts"
28347 #: ../src/guestfs-actions.pod:4802
28351 " guestfs_mkfs_opts (guestfs_h *g,\n"
28352 " const char *fstype,\n"
28353 " const char *device,\n"
28359 #: ../src/guestfs-actions.pod:4813
28362 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
28363 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
28364 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
28365 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
28370 #: ../src/guestfs-actions.pod:4861
28371 msgid "(Added in 1.7.19)"
28375 #: ../src/guestfs-actions.pod:4863
28376 msgid "guestfs_mkfs_opts_va"
28380 #: ../src/guestfs-actions.pod:4865
28384 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
28385 " const char *fstype,\n"
28386 " const char *device,\n"
28387 " va_list args);\n"
28392 #: ../src/guestfs-actions.pod:4871
28393 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
28397 #: ../src/guestfs-actions.pod:4875
28398 msgid "guestfs_mkfs_opts_argv"
28402 #: ../src/guestfs-actions.pod:4877
28406 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
28407 " const char *fstype,\n"
28408 " const char *device,\n"
28409 " const struct guestfs_mkfs_opts_argv *optargs);\n"
28414 #: ../src/guestfs-actions.pod:4883
28415 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
28419 #: ../src/guestfs-actions.pod:4887
28420 msgid "guestfs_mkmountpoint"
28424 #: ../src/guestfs-actions.pod:4889
28428 " guestfs_mkmountpoint (guestfs_h *g,\n"
28429 " const char *exemptpath);\n"
28434 #: ../src/guestfs-actions.pod:4893
28436 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
28437 "that can be used to create extra mountpoints before mounting the first "
28442 #: ../src/guestfs-actions.pod:4917
28444 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
28445 "may get unexpected errors if you try to mix these calls. It is safest to "
28446 "manually unmount filesystems and remove mountpoints after use."
28450 #: ../src/guestfs-actions.pod:4921
28452 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
28453 "first, so for this to work for manual mountpoints, you must ensure that the "
28454 "innermost mountpoints have the longest pathnames, as in the example code "
28459 #: ../src/guestfs-actions.pod:4928
28461 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
28462 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
28463 "can also trigger these issues."
28467 #: ../src/guestfs-actions.pod:4934 ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:6250
28468 msgid "(Added in 1.0.62)"
28472 #: ../src/guestfs-actions.pod:4936
28473 msgid "guestfs_mknod"
28477 #: ../src/guestfs-actions.pod:4938
28481 " guestfs_mknod (guestfs_h *g,\n"
28485 " const char *path);\n"
28490 #: ../src/guestfs-actions.pod:4953
28492 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28493 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28494 "regular file). These constants are available in the standard Linux header "
28495 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
28496 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
28497 "the appropriate constant for you."
28501 #: ../src/guestfs-actions.pod:4967
28502 msgid "guestfs_mknod_b"
28506 #: ../src/guestfs-actions.pod:4969
28510 " guestfs_mknod_b (guestfs_h *g,\n"
28514 " const char *path);\n"
28519 #: ../src/guestfs-actions.pod:4976
28521 "This call creates a block device node called C<path> with mode C<mode> and "
28522 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28523 "wrapper around C<guestfs_mknod>."
28527 #: ../src/guestfs-actions.pod:4986
28528 msgid "guestfs_mknod_c"
28532 #: ../src/guestfs-actions.pod:4988
28536 " guestfs_mknod_c (guestfs_h *g,\n"
28540 " const char *path);\n"
28545 #: ../src/guestfs-actions.pod:4995
28547 "This call creates a char device node called C<path> with mode C<mode> and "
28548 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28549 "wrapper around C<guestfs_mknod>."
28553 #: ../src/guestfs-actions.pod:5005
28554 msgid "guestfs_mkswap"
28558 #: ../src/guestfs-actions.pod:5007
28562 " guestfs_mkswap (guestfs_h *g,\n"
28563 " const char *device);\n"
28568 #: ../src/guestfs-actions.pod:5017
28569 msgid "guestfs_mkswap_L"
28573 #: ../src/guestfs-actions.pod:5019
28577 " guestfs_mkswap_L (guestfs_h *g,\n"
28578 " const char *label,\n"
28579 " const char *device);\n"
28584 #: ../src/guestfs-actions.pod:5034
28585 msgid "guestfs_mkswap_U"
28589 #: ../src/guestfs-actions.pod:5036
28593 " guestfs_mkswap_U (guestfs_h *g,\n"
28594 " const char *uuid,\n"
28595 " const char *device);\n"
28600 #: ../src/guestfs-actions.pod:5047
28601 msgid "guestfs_mkswap_file"
28605 #: ../src/guestfs-actions.pod:5049
28609 " guestfs_mkswap_file (guestfs_h *g,\n"
28610 " const char *path);\n"
28615 #: ../src/guestfs-actions.pod:5055
28617 "This command just writes a swap file signature to an existing file. To "
28618 "create the file itself, use something like C<guestfs_fallocate>."
28622 #: ../src/guestfs-actions.pod:5062
28623 msgid "guestfs_modprobe"
28627 #: ../src/guestfs-actions.pod:5064
28631 " guestfs_modprobe (guestfs_h *g,\n"
28632 " const char *modulename);\n"
28637 #: ../src/guestfs-actions.pod:5077
28638 msgid "guestfs_mount"
28642 #: ../src/guestfs-actions.pod:5079
28646 " guestfs_mount (guestfs_h *g,\n"
28647 " const char *device,\n"
28648 " const char *mountpoint);\n"
28653 #: ../src/guestfs-actions.pod:5098
28655 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
28656 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
28657 "problems for users. If your program might need to work with older versions "
28658 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
28659 "for the first parameter if you don't want any options)."
28663 #: ../src/guestfs-actions.pod:5109
28664 msgid "guestfs_mount_9p"
28668 #: ../src/guestfs-actions.pod:5111
28672 " guestfs_mount_9p (guestfs_h *g,\n"
28673 " const char *mounttag,\n"
28674 " const char *mountpoint,\n"
28680 #: ../src/guestfs-actions.pod:5122
28683 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
28688 #: ../src/guestfs-actions.pod:5135
28689 msgid "guestfs_mount_9p_va"
28693 #: ../src/guestfs-actions.pod:5137
28697 " guestfs_mount_9p_va (guestfs_h *g,\n"
28698 " const char *mounttag,\n"
28699 " const char *mountpoint,\n"
28700 " va_list args);\n"
28705 #: ../src/guestfs-actions.pod:5143
28706 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
28710 #: ../src/guestfs-actions.pod:5147
28711 msgid "guestfs_mount_9p_argv"
28715 #: ../src/guestfs-actions.pod:5149
28719 " guestfs_mount_9p_argv (guestfs_h *g,\n"
28720 " const char *mounttag,\n"
28721 " const char *mountpoint,\n"
28722 " const struct guestfs_mount_9p_argv *optargs);\n"
28727 #: ../src/guestfs-actions.pod:5155
28728 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
28732 #: ../src/guestfs-actions.pod:5159
28733 msgid "guestfs_mount_loop"
28737 #: ../src/guestfs-actions.pod:5161
28741 " guestfs_mount_loop (guestfs_h *g,\n"
28742 " const char *file,\n"
28743 " const char *mountpoint);\n"
28748 #: ../src/guestfs-actions.pod:5174
28749 msgid "guestfs_mount_options"
28753 #: ../src/guestfs-actions.pod:5176
28757 " guestfs_mount_options (guestfs_h *g,\n"
28758 " const char *options,\n"
28759 " const char *device,\n"
28760 " const char *mountpoint);\n"
28765 #: ../src/guestfs-actions.pod:5182
28767 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28768 "the mount options as for the L<mount(8)> I<-o> flag."
28772 #: ../src/guestfs-actions.pod:5192 ../src/guestfs-actions.pod:5206 ../src/guestfs-actions.pod:5223
28773 msgid "(Added in 1.0.10)"
28777 #: ../src/guestfs-actions.pod:5194
28778 msgid "guestfs_mount_ro"
28782 #: ../src/guestfs-actions.pod:5196
28786 " guestfs_mount_ro (guestfs_h *g,\n"
28787 " const char *device,\n"
28788 " const char *mountpoint);\n"
28793 #: ../src/guestfs-actions.pod:5201
28795 "This is the same as the C<guestfs_mount> command, but it mounts the "
28796 "filesystem with the read-only (I<-o ro>) flag."
28800 #: ../src/guestfs-actions.pod:5208
28801 msgid "guestfs_mount_vfs"
28805 #: ../src/guestfs-actions.pod:5210
28809 " guestfs_mount_vfs (guestfs_h *g,\n"
28810 " const char *options,\n"
28811 " const char *vfstype,\n"
28812 " const char *device,\n"
28813 " const char *mountpoint);\n"
28818 #: ../src/guestfs-actions.pod:5217
28820 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28821 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
28826 #: ../src/guestfs-actions.pod:5225
28827 msgid "guestfs_mountpoints"
28831 #: ../src/guestfs-actions.pod:5227
28835 " guestfs_mountpoints (guestfs_h *g);\n"
28840 #: ../src/guestfs-actions.pod:5230
28842 "This call is similar to C<guestfs_mounts>. That call returns a list of "
28843 "devices. This one returns a hash table (map) of device name to directory "
28844 "where the device is mounted."
28848 #: ../src/guestfs-actions.pod:5242
28849 msgid "guestfs_mounts"
28853 #: ../src/guestfs-actions.pod:5244
28857 " guestfs_mounts (guestfs_h *g);\n"
28862 #: ../src/guestfs-actions.pod:5252
28863 msgid "See also: C<guestfs_mountpoints>"
28867 #: ../src/guestfs-actions.pod:5260
28872 #: ../src/guestfs-actions.pod:5262
28876 " guestfs_mv (guestfs_h *g,\n"
28877 " const char *src,\n"
28878 " const char *dest);\n"
28883 #: ../src/guestfs-actions.pod:5274
28884 msgid "guestfs_ntfs_3g_probe"
28888 #: ../src/guestfs-actions.pod:5276
28892 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
28894 " const char *device);\n"
28899 #: ../src/guestfs-actions.pod:5295
28900 msgid "(Added in 1.0.43)"
28904 #: ../src/guestfs-actions.pod:5297
28905 msgid "guestfs_ntfsresize"
28909 #: ../src/guestfs-actions.pod:5299
28913 " guestfs_ntfsresize (guestfs_h *g,\n"
28914 " const char *device);\n"
28919 #: ../src/guestfs-actions.pod:5303 ../src/guestfs-actions.pod:5403
28921 "I<This function is deprecated.> In new code, use the "
28922 "L</guestfs_ntfsresize_opts> call instead."
28926 #: ../src/guestfs-actions.pod:5327
28927 msgid "guestfs_ntfsresize_opts"
28931 #: ../src/guestfs-actions.pod:5329
28935 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
28936 " const char *device,\n"
28942 #: ../src/guestfs-actions.pod:5339
28945 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
28946 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
28951 #: ../src/guestfs-actions.pod:5359
28953 "After the resize operation, the filesystem is always marked as requiring a "
28954 "consistency check (for safety). You have to boot into Windows to perform "
28955 "this check and clear this condition. If you I<don't> set the C<force> "
28956 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
28957 "times on a single filesystem without booting into Windows between each "
28962 #: ../src/guestfs-actions.pod:5374
28963 msgid "guestfs_ntfsresize_opts_va"
28967 #: ../src/guestfs-actions.pod:5376
28971 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
28972 " const char *device,\n"
28973 " va_list args);\n"
28978 #: ../src/guestfs-actions.pod:5381
28979 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
28983 #: ../src/guestfs-actions.pod:5385
28984 msgid "guestfs_ntfsresize_opts_argv"
28988 #: ../src/guestfs-actions.pod:5387
28992 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
28993 " const char *device,\n"
28994 " const struct guestfs_ntfsresize_opts_argv "
29000 #: ../src/guestfs-actions.pod:5392
29001 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29005 #: ../src/guestfs-actions.pod:5396
29006 msgid "guestfs_ntfsresize_size"
29010 #: ../src/guestfs-actions.pod:5398
29014 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29015 " const char *device,\n"
29016 " int64_t size);\n"
29021 #: ../src/guestfs-actions.pod:5410
29023 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29024 "to specify the new size (in bytes) explicitly."
29028 #: ../src/guestfs-actions.pod:5415 ../src/guestfs-actions.pod:5857 ../src/guestfs-actions.pod:5930 ../src/guestfs-actions.pod:6198 ../src/guestfs-actions.pod:7837
29029 msgid "(Added in 1.3.14)"
29033 #: ../src/guestfs-actions.pod:5417
29034 msgid "guestfs_part_add"
29038 #: ../src/guestfs-actions.pod:5419
29042 " guestfs_part_add (guestfs_h *g,\n"
29043 " const char *device,\n"
29044 " const char *prlogex,\n"
29045 " int64_t startsect,\n"
29046 " int64_t endsect);\n"
29051 #: ../src/guestfs-actions.pod:5426
29053 "This command adds a partition to C<device>. If there is no partition table "
29054 "on the device, call C<guestfs_part_init> first."
29058 #: ../src/guestfs-actions.pod:5438
29060 "Creating a partition which covers the whole disk is not so easy. Use "
29061 "C<guestfs_part_disk> to do that."
29065 #: ../src/guestfs-actions.pod:5443 ../src/guestfs-actions.pod:5481 ../src/guestfs-actions.pod:5534 ../src/guestfs-actions.pod:5618 ../src/guestfs-actions.pod:5656 ../src/guestfs-actions.pod:5675 ../src/guestfs-actions.pod:5715
29066 msgid "(Added in 1.0.78)"
29070 #: ../src/guestfs-actions.pod:5445
29071 msgid "guestfs_part_del"
29075 #: ../src/guestfs-actions.pod:5447
29079 " guestfs_part_del (guestfs_h *g,\n"
29080 " const char *device,\n"
29086 #: ../src/guestfs-actions.pod:5462
29087 msgid "guestfs_part_disk"
29091 #: ../src/guestfs-actions.pod:5464
29095 " guestfs_part_disk (guestfs_h *g,\n"
29096 " const char *device,\n"
29097 " const char *parttype);\n"
29102 #: ../src/guestfs-actions.pod:5469
29104 "This command is simply a combination of C<guestfs_part_init> followed by "
29105 "C<guestfs_part_add> to create a single primary partition covering the whole "
29110 #: ../src/guestfs-actions.pod:5473
29112 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29113 "possible values are described in C<guestfs_part_init>."
29117 #: ../src/guestfs-actions.pod:5483
29118 msgid "guestfs_part_get_bootable"
29122 #: ../src/guestfs-actions.pod:5485
29126 " guestfs_part_get_bootable (guestfs_h *g,\n"
29127 " const char *device,\n"
29133 #: ../src/guestfs-actions.pod:5493
29134 msgid "See also C<guestfs_part_set_bootable>."
29138 #: ../src/guestfs-actions.pod:5499
29139 msgid "guestfs_part_get_mbr_id"
29143 #: ../src/guestfs-actions.pod:5501
29147 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29148 " const char *device,\n"
29154 #: ../src/guestfs-actions.pod:5509 ../src/guestfs-actions.pod:5691
29156 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29157 "undefined results for other partition table types (see "
29158 "C<guestfs_part_get_parttype>)."
29162 #: ../src/guestfs-actions.pod:5517
29163 msgid "guestfs_part_get_parttype"
29167 #: ../src/guestfs-actions.pod:5519
29171 " guestfs_part_get_parttype (guestfs_h *g,\n"
29172 " const char *device);\n"
29177 #: ../src/guestfs-actions.pod:5526
29179 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29180 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29181 "possible, although unusual. See C<guestfs_part_init> for a full list."
29185 #: ../src/guestfs-actions.pod:5536
29186 msgid "guestfs_part_init"
29190 #: ../src/guestfs-actions.pod:5538
29194 " guestfs_part_init (guestfs_h *g,\n"
29195 " const char *device,\n"
29196 " const char *parttype);\n"
29201 #: ../src/guestfs-actions.pod:5547
29203 "Initially there are no partitions. Following this, you should call "
29204 "C<guestfs_part_add> for each partition required."
29208 #: ../src/guestfs-actions.pod:5620
29209 msgid "guestfs_part_list"
29213 #: ../src/guestfs-actions.pod:5622
29216 " struct guestfs_partition_list *\n"
29217 " guestfs_part_list (guestfs_h *g,\n"
29218 " const char *device);\n"
29223 #: ../src/guestfs-actions.pod:5639
29225 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29226 "the device's sector size, see C<guestfs_blockdev_getss>."
29230 #: ../src/guestfs-actions.pod:5652
29232 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29233 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29238 #: ../src/guestfs-actions.pod:5658
29239 msgid "guestfs_part_set_bootable"
29243 #: ../src/guestfs-actions.pod:5660
29247 " guestfs_part_set_bootable (guestfs_h *g,\n"
29248 " const char *device,\n"
29250 " int bootable);\n"
29255 #: ../src/guestfs-actions.pod:5677
29256 msgid "guestfs_part_set_mbr_id"
29260 #: ../src/guestfs-actions.pod:5679
29264 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29265 " const char *device,\n"
29272 #: ../src/guestfs-actions.pod:5699
29273 msgid "guestfs_part_set_name"
29277 #: ../src/guestfs-actions.pod:5701
29281 " guestfs_part_set_name (guestfs_h *g,\n"
29282 " const char *device,\n"
29284 " const char *name);\n"
29289 #: ../src/guestfs-actions.pod:5717
29290 msgid "guestfs_part_to_dev"
29294 #: ../src/guestfs-actions.pod:5719
29298 " guestfs_part_to_dev (guestfs_h *g,\n"
29299 " const char *partition);\n"
29304 #: ../src/guestfs-actions.pod:5727
29306 "The named partition must exist, for example as a string returned from "
29307 "C<guestfs_list_partitions>."
29311 #: ../src/guestfs-actions.pod:5735
29312 msgid "guestfs_ping_daemon"
29316 #: ../src/guestfs-actions.pod:5737
29320 " guestfs_ping_daemon (guestfs_h *g);\n"
29325 #: ../src/guestfs-actions.pod:5749
29326 msgid "guestfs_pread"
29330 #: ../src/guestfs-actions.pod:5751
29334 " guestfs_pread (guestfs_h *g,\n"
29335 " const char *path,\n"
29337 " int64_t offset,\n"
29338 " size_t *size_r);\n"
29343 #: ../src/guestfs-actions.pod:5764
29344 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
29348 #: ../src/guestfs-actions.pod:5775
29349 msgid "guestfs_pread_device"
29353 #: ../src/guestfs-actions.pod:5777
29357 " guestfs_pread_device (guestfs_h *g,\n"
29358 " const char *device,\n"
29360 " int64_t offset,\n"
29361 " size_t *size_r);\n"
29366 #: ../src/guestfs-actions.pod:5790
29367 msgid "See also C<guestfs_pread>."
29371 #: ../src/guestfs-actions.pod:5799
29372 msgid "(Added in 1.5.21)"
29376 #: ../src/guestfs-actions.pod:5801
29377 msgid "guestfs_pvcreate"
29381 #: ../src/guestfs-actions.pod:5803
29385 " guestfs_pvcreate (guestfs_h *g,\n"
29386 " const char *device);\n"
29391 #: ../src/guestfs-actions.pod:5815
29392 msgid "guestfs_pvremove"
29396 #: ../src/guestfs-actions.pod:5817
29400 " guestfs_pvremove (guestfs_h *g,\n"
29401 " const char *device);\n"
29406 #: ../src/guestfs-actions.pod:5832
29407 msgid "guestfs_pvresize"
29411 #: ../src/guestfs-actions.pod:5834
29415 " guestfs_pvresize (guestfs_h *g,\n"
29416 " const char *device);\n"
29421 #: ../src/guestfs-actions.pod:5845
29422 msgid "guestfs_pvresize_size"
29426 #: ../src/guestfs-actions.pod:5847
29430 " guestfs_pvresize_size (guestfs_h *g,\n"
29431 " const char *device,\n"
29432 " int64_t size);\n"
29437 #: ../src/guestfs-actions.pod:5852
29439 "This command is the same as C<guestfs_pvresize> except that it allows you to "
29440 "specify the new size (in bytes) explicitly."
29444 #: ../src/guestfs-actions.pod:5859
29445 msgid "guestfs_pvs"
29449 #: ../src/guestfs-actions.pod:5861
29453 " guestfs_pvs (guestfs_h *g);\n"
29458 #: ../src/guestfs-actions.pod:5870
29459 msgid "See also C<guestfs_pvs_full>."
29463 #: ../src/guestfs-actions.pod:5878
29464 msgid "guestfs_pvs_full"
29468 #: ../src/guestfs-actions.pod:5880
29471 " struct guestfs_lvm_pv_list *\n"
29472 " guestfs_pvs_full (guestfs_h *g);\n"
29477 #: ../src/guestfs-actions.pod:5886
29479 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
29480 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
29485 #: ../src/guestfs-actions.pod:5892
29486 msgid "guestfs_pvuuid"
29490 #: ../src/guestfs-actions.pod:5894
29494 " guestfs_pvuuid (guestfs_h *g,\n"
29495 " const char *device);\n"
29500 #: ../src/guestfs-actions.pod:5905
29501 msgid "guestfs_pwrite"
29505 #: ../src/guestfs-actions.pod:5907
29509 " guestfs_pwrite (guestfs_h *g,\n"
29510 " const char *path,\n"
29511 " const char *content,\n"
29512 " size_t content_size,\n"
29513 " int64_t offset);\n"
29518 #: ../src/guestfs-actions.pod:5923
29519 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
29523 #: ../src/guestfs-actions.pod:5932
29524 msgid "guestfs_pwrite_device"
29528 #: ../src/guestfs-actions.pod:5934
29532 " guestfs_pwrite_device (guestfs_h *g,\n"
29533 " const char *device,\n"
29534 " const char *content,\n"
29535 " size_t content_size,\n"
29536 " int64_t offset);\n"
29541 #: ../src/guestfs-actions.pod:5949
29542 msgid "See also C<guestfs_pwrite>."
29546 #: ../src/guestfs-actions.pod:5956
29547 msgid "(Added in 1.5.20)"
29551 #: ../src/guestfs-actions.pod:5958
29552 msgid "guestfs_read_file"
29556 #: ../src/guestfs-actions.pod:5960
29560 " guestfs_read_file (guestfs_h *g,\n"
29561 " const char *path,\n"
29562 " size_t *size_r);\n"
29567 #: ../src/guestfs-actions.pod:5968
29569 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
29570 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
29571 "function is limited in the total size of file that can be handled."
29575 #: ../src/guestfs-actions.pod:5980
29576 msgid "(Added in 1.0.63)"
29580 #: ../src/guestfs-actions.pod:5982
29581 msgid "guestfs_read_lines"
29585 #: ../src/guestfs-actions.pod:5984
29589 " guestfs_read_lines (guestfs_h *g,\n"
29590 " const char *path);\n"
29595 #: ../src/guestfs-actions.pod:5993
29597 "Note that this function cannot correctly handle binary files (specifically, "
29598 "files containing C<\\0> character which is treated as end of line). For "
29599 "those you need to use the C<guestfs_read_file> function which has a more "
29600 "complex interface."
29604 #: ../src/guestfs-actions.pod:6004
29605 msgid "guestfs_readdir"
29609 #: ../src/guestfs-actions.pod:6006
29612 " struct guestfs_dirent_list *\n"
29613 " guestfs_readdir (guestfs_h *g,\n"
29614 " const char *dir);\n"
29619 #: ../src/guestfs-actions.pod:6060
29621 "This function is primarily intended for use by programs. To get a simple "
29622 "list of names, use C<guestfs_ls>. To get a printable directory for human "
29623 "consumption, use C<guestfs_ll>."
29627 #: ../src/guestfs-actions.pod:6064
29629 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
29630 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
29635 #: ../src/guestfs-actions.pod:6070
29636 msgid "guestfs_readlink"
29640 #: ../src/guestfs-actions.pod:6072
29644 " guestfs_readlink (guestfs_h *g,\n"
29645 " const char *path);\n"
29650 #: ../src/guestfs-actions.pod:6083
29651 msgid "guestfs_readlinklist"
29655 #: ../src/guestfs-actions.pod:6085
29659 " guestfs_readlinklist (guestfs_h *g,\n"
29660 " const char *path,\n"
29661 " char *const *names);\n"
29666 #: ../src/guestfs-actions.pod:6118
29667 msgid "guestfs_realpath"
29671 #: ../src/guestfs-actions.pod:6120
29675 " guestfs_realpath (guestfs_h *g,\n"
29676 " const char *path);\n"
29681 #: ../src/guestfs-actions.pod:6132
29682 msgid "guestfs_removexattr"
29686 #: ../src/guestfs-actions.pod:6134
29690 " guestfs_removexattr (guestfs_h *g,\n"
29691 " const char *xattr,\n"
29692 " const char *path);\n"
29697 #: ../src/guestfs-actions.pod:6142
29698 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
29702 #: ../src/guestfs-actions.pod:6148
29703 msgid "guestfs_resize2fs"
29707 #: ../src/guestfs-actions.pod:6150
29711 " guestfs_resize2fs (guestfs_h *g,\n"
29712 " const char *device);\n"
29717 #: ../src/guestfs-actions.pod:6157
29719 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
29720 "C<device> before calling this command. For unknown reasons C<resize2fs> "
29721 "sometimes gives an error about this and sometimes not. In any case, it is "
29722 "always safe to call C<guestfs_e2fsck_f> before calling this function."
29726 #: ../src/guestfs-actions.pod:6167
29727 msgid "guestfs_resize2fs_M"
29731 #: ../src/guestfs-actions.pod:6169
29735 " guestfs_resize2fs_M (guestfs_h *g,\n"
29736 " const char *device);\n"
29741 #: ../src/guestfs-actions.pod:6173
29743 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
29744 "resized to its minimum size. This works like the I<-M> option to the "
29745 "C<resize2fs> command."
29749 #: ../src/guestfs-actions.pod:6177
29751 "To get the resulting size of the filesystem you should call "
29752 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
29753 "These two numbers, multiplied together, give the resulting size of the "
29754 "minimal filesystem in bytes."
29758 #: ../src/guestfs-actions.pod:6186
29759 msgid "guestfs_resize2fs_size"
29763 #: ../src/guestfs-actions.pod:6188
29767 " guestfs_resize2fs_size (guestfs_h *g,\n"
29768 " const char *device,\n"
29769 " int64_t size);\n"
29774 #: ../src/guestfs-actions.pod:6193
29776 "This command is the same as C<guestfs_resize2fs> except that it allows you "
29777 "to specify the new size (in bytes) explicitly."
29781 #: ../src/guestfs-actions.pod:6200
29786 #: ../src/guestfs-actions.pod:6202
29790 " guestfs_rm (guestfs_h *g,\n"
29791 " const char *path);\n"
29796 #: ../src/guestfs-actions.pod:6212
29797 msgid "guestfs_rm_rf"
29801 #: ../src/guestfs-actions.pod:6214
29805 " guestfs_rm_rf (guestfs_h *g,\n"
29806 " const char *path);\n"
29811 #: ../src/guestfs-actions.pod:6226
29812 msgid "guestfs_rmdir"
29816 #: ../src/guestfs-actions.pod:6228
29820 " guestfs_rmdir (guestfs_h *g,\n"
29821 " const char *path);\n"
29826 #: ../src/guestfs-actions.pod:6238
29827 msgid "guestfs_rmmountpoint"
29831 #: ../src/guestfs-actions.pod:6240
29835 " guestfs_rmmountpoint (guestfs_h *g,\n"
29836 " const char *exemptpath);\n"
29841 #: ../src/guestfs-actions.pod:6244
29843 "This calls removes a mountpoint that was previously created with "
29844 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
29848 #: ../src/guestfs-actions.pod:6252
29849 msgid "guestfs_scrub_device"
29853 #: ../src/guestfs-actions.pod:6254
29857 " guestfs_scrub_device (guestfs_h *g,\n"
29858 " const char *device);\n"
29863 #: ../src/guestfs-actions.pod:6269 ../src/guestfs-actions.pod:6287 ../src/guestfs-actions.pod:6306
29864 msgid "(Added in 1.0.52)"
29868 #: ../src/guestfs-actions.pod:6271
29869 msgid "guestfs_scrub_file"
29873 #: ../src/guestfs-actions.pod:6273
29877 " guestfs_scrub_file (guestfs_h *g,\n"
29878 " const char *file);\n"
29883 #: ../src/guestfs-actions.pod:6289
29884 msgid "guestfs_scrub_freespace"
29888 #: ../src/guestfs-actions.pod:6291
29892 " guestfs_scrub_freespace (guestfs_h *g,\n"
29893 " const char *dir);\n"
29898 #: ../src/guestfs-actions.pod:6295
29900 "This command creates the directory C<dir> and then fills it with files until "
29901 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
29902 "and deletes them. The intention is to scrub any free space on the partition "
29903 "containing C<dir>."
29907 #: ../src/guestfs-actions.pod:6308
29908 msgid "guestfs_set_append"
29912 #: ../src/guestfs-actions.pod:6310
29916 " guestfs_set_append (guestfs_h *g,\n"
29917 " const char *append);\n"
29922 #: ../src/guestfs-actions.pod:6327
29923 msgid "guestfs_set_attach_method"
29927 #: ../src/guestfs-actions.pod:6329
29931 " guestfs_set_attach_method (guestfs_h *g,\n"
29932 " const char *attachmethod);\n"
29937 #: ../src/guestfs-actions.pod:6357
29938 msgid "guestfs_set_autosync"
29942 #: ../src/guestfs-actions.pod:6359
29946 " guestfs_set_autosync (guestfs_h *g,\n"
29947 " int autosync);\n"
29952 #: ../src/guestfs-actions.pod:6375
29953 msgid "guestfs_set_direct"
29957 #: ../src/guestfs-actions.pod:6377
29961 " guestfs_set_direct (guestfs_h *g,\n"
29967 #: ../src/guestfs-actions.pod:6385
29969 "One consequence of this is that log messages aren't caught by the library "
29970 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
29975 #: ../src/guestfs-actions.pod:6398
29976 msgid "guestfs_set_e2label"
29980 #: ../src/guestfs-actions.pod:6400
29984 " guestfs_set_e2label (guestfs_h *g,\n"
29985 " const char *device,\n"
29986 " const char *label);\n"
29991 #: ../src/guestfs-actions.pod:6409
29993 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
29994 "the existing label on a filesystem."
29998 #: ../src/guestfs-actions.pod:6416
29999 msgid "guestfs_set_e2uuid"
30003 #: ../src/guestfs-actions.pod:6418
30007 " guestfs_set_e2uuid (guestfs_h *g,\n"
30008 " const char *device,\n"
30009 " const char *uuid);\n"
30014 #: ../src/guestfs-actions.pod:6428
30016 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30017 "the existing UUID of a filesystem."
30021 #: ../src/guestfs-actions.pod:6435
30022 msgid "guestfs_set_memsize"
30026 #: ../src/guestfs-actions.pod:6437
30030 " guestfs_set_memsize (guestfs_h *g,\n"
30036 #: ../src/guestfs-actions.pod:6441
30038 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30039 "This only has any effect if called before C<guestfs_launch>."
30043 #: ../src/guestfs-actions.pod:6456
30044 msgid "guestfs_set_network"
30048 #: ../src/guestfs-actions.pod:6458
30052 " guestfs_set_network (guestfs_h *g,\n"
30058 #: ../src/guestfs-actions.pod:6468
30060 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30065 #: ../src/guestfs-actions.pod:6475
30066 msgid "guestfs_set_path"
30070 #: ../src/guestfs-actions.pod:6477
30074 " guestfs_set_path (guestfs_h *g,\n"
30075 " const char *searchpath);\n"
30080 #: ../src/guestfs-actions.pod:6492
30081 msgid "guestfs_set_pgroup"
30085 #: ../src/guestfs-actions.pod:6494
30089 " guestfs_set_pgroup (guestfs_h *g,\n"
30095 #: ../src/guestfs-actions.pod:6511
30096 msgid "guestfs_set_qemu"
30100 #: ../src/guestfs-actions.pod:6513
30104 " guestfs_set_qemu (guestfs_h *g,\n"
30105 " const char *qemu);\n"
30110 #: ../src/guestfs-actions.pod:6539
30111 msgid "guestfs_set_recovery_proc"
30115 #: ../src/guestfs-actions.pod:6541
30119 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30120 " int recoveryproc);\n"
30125 #: ../src/guestfs-actions.pod:6545
30127 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30128 "not create a recovery process. The purpose of the recovery process is to "
30129 "stop runaway qemu processes in the case where the main program aborts "
30134 #: ../src/guestfs-actions.pod:6550
30136 "This only has any effect if called before C<guestfs_launch>, and the default "
30141 #: ../src/guestfs-actions.pod:6563
30142 msgid "guestfs_set_selinux"
30146 #: ../src/guestfs-actions.pod:6565
30150 " guestfs_set_selinux (guestfs_h *g,\n"
30156 #: ../src/guestfs-actions.pod:6582
30157 msgid "guestfs_set_smp"
30161 #: ../src/guestfs-actions.pod:6584
30165 " guestfs_set_smp (guestfs_h *g,\n"
30171 #: ../src/guestfs-actions.pod:6592
30172 msgid "This function must be called before C<guestfs_launch>."
30176 #: ../src/guestfs-actions.pod:6598
30177 msgid "guestfs_set_trace"
30181 #: ../src/guestfs-actions.pod:6600
30185 " guestfs_set_trace (guestfs_h *g,\n"
30191 #: ../src/guestfs-actions.pod:6614
30193 "Trace messages are normally sent to C<stderr>, unless you register a "
30194 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30198 #: ../src/guestfs-actions.pod:6622
30199 msgid "guestfs_set_verbose"
30203 #: ../src/guestfs-actions.pod:6624
30207 " guestfs_set_verbose (guestfs_h *g,\n"
30213 #: ../src/guestfs-actions.pod:6633
30215 "Verbose messages are normally sent to C<stderr>, unless you register a "
30216 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30220 #: ../src/guestfs-actions.pod:6641
30221 msgid "guestfs_setcon"
30225 #: ../src/guestfs-actions.pod:6643
30229 " guestfs_setcon (guestfs_h *g,\n"
30230 " const char *context);\n"
30235 #: ../src/guestfs-actions.pod:6656
30236 msgid "guestfs_setxattr"
30240 #: ../src/guestfs-actions.pod:6658
30244 " guestfs_setxattr (guestfs_h *g,\n"
30245 " const char *xattr,\n"
30246 " const char *val,\n"
30248 " const char *path);\n"
30253 #: ../src/guestfs-actions.pod:6669
30254 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30258 #: ../src/guestfs-actions.pod:6675
30259 msgid "guestfs_sfdisk"
30263 #: ../src/guestfs-actions.pod:6677
30267 " guestfs_sfdisk (guestfs_h *g,\n"
30268 " const char *device,\n"
30272 " char *const *lines);\n"
30277 #: ../src/guestfs-actions.pod:6685 ../src/guestfs-actions.pod:6729 ../src/guestfs-actions.pod:6763
30279 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
30284 #: ../src/guestfs-actions.pod:6712
30285 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
30289 #: ../src/guestfs-actions.pod:6722
30290 msgid "guestfs_sfdiskM"
30294 #: ../src/guestfs-actions.pod:6724
30298 " guestfs_sfdiskM (guestfs_h *g,\n"
30299 " const char *device,\n"
30300 " char *const *lines);\n"
30305 #: ../src/guestfs-actions.pod:6736
30307 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
30308 "partition sizes are specified in megabytes only (rounded to the nearest "
30309 "cylinder) and you don't need to specify the cyls, heads and sectors "
30310 "parameters which were rarely if ever used anyway."
30314 #: ../src/guestfs-actions.pod:6742
30316 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
30317 "C<guestfs_part_disk>"
30321 #: ../src/guestfs-actions.pod:6752
30322 msgid "guestfs_sfdisk_N"
30326 #: ../src/guestfs-actions.pod:6754
30330 " guestfs_sfdisk_N (guestfs_h *g,\n"
30331 " const char *device,\n"
30336 " const char *line);\n"
30341 #: ../src/guestfs-actions.pod:6773
30343 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
30344 "for the cyls/heads/sectors parameters."
30348 #: ../src/guestfs-actions.pod:6776
30349 msgid "See also: C<guestfs_part_add>"
30353 #: ../src/guestfs-actions.pod:6785
30354 msgid "guestfs_sfdisk_disk_geometry"
30358 #: ../src/guestfs-actions.pod:6787
30362 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
30363 " const char *device);\n"
30368 #: ../src/guestfs-actions.pod:6791
30370 "This displays the disk geometry of C<device> read from the partition table. "
30371 "Especially in the case where the underlying block device has been resized, "
30372 "this can be different from the kernel's idea of the geometry (see "
30373 "C<guestfs_sfdisk_kernel_geometry>)."
30377 #: ../src/guestfs-actions.pod:6804
30378 msgid "guestfs_sfdisk_kernel_geometry"
30382 #: ../src/guestfs-actions.pod:6806
30386 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
30387 " const char *device);\n"
30392 #: ../src/guestfs-actions.pod:6820
30393 msgid "guestfs_sfdisk_l"
30397 #: ../src/guestfs-actions.pod:6822
30401 " guestfs_sfdisk_l (guestfs_h *g,\n"
30402 " const char *device);\n"
30407 #: ../src/guestfs-actions.pod:6826
30409 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
30414 #: ../src/guestfs-actions.pod:6837
30415 msgid "See also: C<guestfs_part_list>"
30419 #: ../src/guestfs-actions.pod:6844
30424 #: ../src/guestfs-actions.pod:6846
30428 " guestfs_sh (guestfs_h *g,\n"
30429 " const char *command);\n"
30434 #: ../src/guestfs-actions.pod:6853
30435 msgid "This is like C<guestfs_command>, but passes the command to:"
30439 #: ../src/guestfs-actions.pod:6861
30440 msgid "All the provisos about C<guestfs_command> apply to this call."
30444 #: ../src/guestfs-actions.pod:6868
30445 msgid "guestfs_sh_lines"
30449 #: ../src/guestfs-actions.pod:6870
30453 " guestfs_sh_lines (guestfs_h *g,\n"
30454 " const char *command);\n"
30459 #: ../src/guestfs-actions.pod:6874
30461 "This is the same as C<guestfs_sh>, but splits the result into a list of "
30466 #: ../src/guestfs-actions.pod:6877
30467 msgid "See also: C<guestfs_command_lines>"
30471 #: ../src/guestfs-actions.pod:6885
30472 msgid "guestfs_sleep"
30476 #: ../src/guestfs-actions.pod:6887
30480 " guestfs_sleep (guestfs_h *g,\n"
30486 #: ../src/guestfs-actions.pod:6895
30487 msgid "(Added in 1.0.41)"
30491 #: ../src/guestfs-actions.pod:6897 ../src/guestfs-structs.pod:109
30492 msgid "guestfs_stat"
30496 #: ../src/guestfs-actions.pod:6899
30499 " struct guestfs_stat *\n"
30500 " guestfs_stat (guestfs_h *g,\n"
30501 " const char *path);\n"
30506 #: ../src/guestfs-actions.pod:6913 ../src/guestfs-structs.pod:135
30507 msgid "guestfs_statvfs"
30511 #: ../src/guestfs-actions.pod:6915
30514 " struct guestfs_statvfs *\n"
30515 " guestfs_statvfs (guestfs_h *g,\n"
30516 " const char *path);\n"
30521 #: ../src/guestfs-actions.pod:6925
30523 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
30524 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
30528 #: ../src/guestfs-actions.pod:6931
30529 msgid "guestfs_strings"
30533 #: ../src/guestfs-actions.pod:6933
30537 " guestfs_strings (guestfs_h *g,\n"
30538 " const char *path);\n"
30543 #: ../src/guestfs-actions.pod:6949
30544 msgid "guestfs_strings_e"
30548 #: ../src/guestfs-actions.pod:6951
30552 " guestfs_strings_e (guestfs_h *g,\n"
30553 " const char *encoding,\n"
30554 " const char *path);\n"
30559 #: ../src/guestfs-actions.pod:6956
30561 "This is like the C<guestfs_strings> command, but allows you to specify the "
30562 "encoding of strings that are looked for in the source file C<path>."
30566 #: ../src/guestfs-actions.pod:6966
30568 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30569 "ISO-8859-X (this is what C<guestfs_strings> uses)."
30573 #: ../src/guestfs-actions.pod:7004
30574 msgid "guestfs_swapoff_device"
30578 #: ../src/guestfs-actions.pod:7006
30582 " guestfs_swapoff_device (guestfs_h *g,\n"
30583 " const char *device);\n"
30588 #: ../src/guestfs-actions.pod:7010
30590 "This command disables the libguestfs appliance swap device or partition "
30591 "named C<device>. See C<guestfs_swapon_device>."
30595 #: ../src/guestfs-actions.pod:7018
30596 msgid "guestfs_swapoff_file"
30600 #: ../src/guestfs-actions.pod:7020
30604 " guestfs_swapoff_file (guestfs_h *g,\n"
30605 " const char *file);\n"
30610 #: ../src/guestfs-actions.pod:7030
30611 msgid "guestfs_swapoff_label"
30615 #: ../src/guestfs-actions.pod:7032
30619 " guestfs_swapoff_label (guestfs_h *g,\n"
30620 " const char *label);\n"
30625 #: ../src/guestfs-actions.pod:7043
30626 msgid "guestfs_swapoff_uuid"
30630 #: ../src/guestfs-actions.pod:7045
30634 " guestfs_swapoff_uuid (guestfs_h *g,\n"
30635 " const char *uuid);\n"
30640 #: ../src/guestfs-actions.pod:7056
30641 msgid "guestfs_swapon_device"
30645 #: ../src/guestfs-actions.pod:7058
30649 " guestfs_swapon_device (guestfs_h *g,\n"
30650 " const char *device);\n"
30655 #: ../src/guestfs-actions.pod:7062
30657 "This command enables the libguestfs appliance to use the swap device or "
30658 "partition named C<device>. The increased memory is made available for all "
30659 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
30663 #: ../src/guestfs-actions.pod:7078
30664 msgid "guestfs_swapon_file"
30668 #: ../src/guestfs-actions.pod:7080
30672 " guestfs_swapon_file (guestfs_h *g,\n"
30673 " const char *file);\n"
30678 #: ../src/guestfs-actions.pod:7084
30680 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
30685 #: ../src/guestfs-actions.pod:7091
30686 msgid "guestfs_swapon_label"
30690 #: ../src/guestfs-actions.pod:7093
30694 " guestfs_swapon_label (guestfs_h *g,\n"
30695 " const char *label);\n"
30700 #: ../src/guestfs-actions.pod:7097
30702 "This command enables swap to a labeled swap partition. See "
30703 "C<guestfs_swapon_device> for other notes."
30707 #: ../src/guestfs-actions.pod:7104
30708 msgid "guestfs_swapon_uuid"
30712 #: ../src/guestfs-actions.pod:7106
30716 " guestfs_swapon_uuid (guestfs_h *g,\n"
30717 " const char *uuid);\n"
30722 #: ../src/guestfs-actions.pod:7110
30724 "This command enables swap to a swap partition with the given UUID. See "
30725 "C<guestfs_swapon_device> for other notes."
30729 #: ../src/guestfs-actions.pod:7117
30730 msgid "guestfs_sync"
30734 #: ../src/guestfs-actions.pod:7119
30738 " guestfs_sync (guestfs_h *g);\n"
30743 #: ../src/guestfs-actions.pod:7132
30744 msgid "guestfs_tail"
30748 #: ../src/guestfs-actions.pod:7134
30752 " guestfs_tail (guestfs_h *g,\n"
30753 " const char *path);\n"
30758 #: ../src/guestfs-actions.pod:7150
30759 msgid "guestfs_tail_n"
30763 #: ../src/guestfs-actions.pod:7152
30767 " guestfs_tail_n (guestfs_h *g,\n"
30769 " const char *path);\n"
30774 #: ../src/guestfs-actions.pod:7174
30775 msgid "guestfs_tar_in"
30779 #: ../src/guestfs-actions.pod:7176
30783 " guestfs_tar_in (guestfs_h *g,\n"
30784 " const char *tarfile,\n"
30785 " const char *directory);\n"
30790 #: ../src/guestfs-actions.pod:7184
30791 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
30795 #: ../src/guestfs-actions.pod:7189 ../src/guestfs-actions.pod:7206 ../src/guestfs-actions.pod:7222 ../src/guestfs-actions.pod:7238
30796 msgid "(Added in 1.0.3)"
30800 #: ../src/guestfs-actions.pod:7191
30801 msgid "guestfs_tar_out"
30805 #: ../src/guestfs-actions.pod:7193
30809 " guestfs_tar_out (guestfs_h *g,\n"
30810 " const char *directory,\n"
30811 " const char *tarfile);\n"
30816 #: ../src/guestfs-actions.pod:7201
30818 "To download a compressed tarball, use C<guestfs_tgz_out> or "
30819 "C<guestfs_txz_out>."
30823 #: ../src/guestfs-actions.pod:7208
30824 msgid "guestfs_tgz_in"
30828 #: ../src/guestfs-actions.pod:7210
30832 " guestfs_tgz_in (guestfs_h *g,\n"
30833 " const char *tarball,\n"
30834 " const char *directory);\n"
30839 #: ../src/guestfs-actions.pod:7218
30840 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
30844 #: ../src/guestfs-actions.pod:7224
30845 msgid "guestfs_tgz_out"
30849 #: ../src/guestfs-actions.pod:7226
30853 " guestfs_tgz_out (guestfs_h *g,\n"
30854 " const char *directory,\n"
30855 " const char *tarball);\n"
30860 #: ../src/guestfs-actions.pod:7234
30861 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
30865 #: ../src/guestfs-actions.pod:7240
30866 msgid "guestfs_touch"
30870 #: ../src/guestfs-actions.pod:7242
30874 " guestfs_touch (guestfs_h *g,\n"
30875 " const char *path);\n"
30880 #: ../src/guestfs-actions.pod:7257
30881 msgid "guestfs_truncate"
30885 #: ../src/guestfs-actions.pod:7259
30889 " guestfs_truncate (guestfs_h *g,\n"
30890 " const char *path);\n"
30895 #: ../src/guestfs-actions.pod:7270
30896 msgid "guestfs_truncate_size"
30900 #: ../src/guestfs-actions.pod:7272
30904 " guestfs_truncate_size (guestfs_h *g,\n"
30905 " const char *path,\n"
30906 " int64_t size);\n"
30911 #: ../src/guestfs-actions.pod:7280
30913 "If the current file size is less than C<size> then the file is extended to "
30914 "the required size with zero bytes. This creates a sparse file (ie. disk "
30915 "blocks are not allocated for the file until you write to it). To create a "
30916 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
30920 #: ../src/guestfs-actions.pod:7290
30921 msgid "guestfs_tune2fs_l"
30925 #: ../src/guestfs-actions.pod:7292
30929 " guestfs_tune2fs_l (guestfs_h *g,\n"
30930 " const char *device);\n"
30935 #: ../src/guestfs-actions.pod:7312
30936 msgid "guestfs_txz_in"
30940 #: ../src/guestfs-actions.pod:7314
30944 " guestfs_txz_in (guestfs_h *g,\n"
30945 " const char *tarball,\n"
30946 " const char *directory);\n"
30951 #: ../src/guestfs-actions.pod:7326
30952 msgid "guestfs_txz_out"
30956 #: ../src/guestfs-actions.pod:7328
30960 " guestfs_txz_out (guestfs_h *g,\n"
30961 " const char *directory,\n"
30962 " const char *tarball);\n"
30967 #: ../src/guestfs-actions.pod:7340
30968 msgid "guestfs_umask"
30972 #: ../src/guestfs-actions.pod:7342
30976 " guestfs_umask (guestfs_h *g,\n"
30982 #: ../src/guestfs-actions.pod:7358
30984 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
30985 "C<guestfs_mkdir>."
30989 #: ../src/guestfs-actions.pod:7367
30990 msgid "guestfs_umount"
30994 #: ../src/guestfs-actions.pod:7369
30998 " guestfs_umount (guestfs_h *g,\n"
30999 " const char *pathordevice);\n"
31004 #: ../src/guestfs-actions.pod:7381
31005 msgid "guestfs_umount_all"
31009 #: ../src/guestfs-actions.pod:7383
31013 " guestfs_umount_all (guestfs_h *g);\n"
31018 #: ../src/guestfs-actions.pod:7394
31019 msgid "guestfs_upload"
31023 #: ../src/guestfs-actions.pod:7396
31027 " guestfs_upload (guestfs_h *g,\n"
31028 " const char *filename,\n"
31029 " const char *remotefilename);\n"
31034 #: ../src/guestfs-actions.pod:7406
31035 msgid "See also C<guestfs_download>."
31039 #: ../src/guestfs-actions.pod:7417
31040 msgid "guestfs_upload_offset"
31044 #: ../src/guestfs-actions.pod:7419
31048 " guestfs_upload_offset (guestfs_h *g,\n"
31049 " const char *filename,\n"
31050 " const char *remotefilename,\n"
31051 " int64_t offset);\n"
31056 #: ../src/guestfs-actions.pod:7435
31058 "Note that there is no limit on the amount of data that can be uploaded with "
31059 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31060 "full amount unless an error occurs."
31064 #: ../src/guestfs-actions.pod:7440
31065 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31069 #: ../src/guestfs-actions.pod:7451
31070 msgid "guestfs_utimens"
31074 #: ../src/guestfs-actions.pod:7453
31078 " guestfs_utimens (guestfs_h *g,\n"
31079 " const char *path,\n"
31080 " int64_t atsecs,\n"
31081 " int64_t atnsecs,\n"
31082 " int64_t mtsecs,\n"
31083 " int64_t mtnsecs);\n"
31088 #: ../src/guestfs-actions.pod:7482 ../src/guestfs-structs.pod:175
31089 msgid "guestfs_version"
31093 #: ../src/guestfs-actions.pod:7484
31096 " struct guestfs_version *\n"
31097 " guestfs_version (guestfs_h *g);\n"
31102 #: ../src/guestfs-actions.pod:7512
31104 "I<Note:> Don't use this call to test for availability of features. In "
31105 "enterprise distributions we backport features from later versions into "
31106 "earlier versions, making this an unreliable way to test for features. Use "
31107 "C<guestfs_available> instead."
31111 #: ../src/guestfs-actions.pod:7518
31113 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31114 "error. I<The caller must call C<guestfs_free_version> after use>."
31118 #: ../src/guestfs-actions.pod:7522
31119 msgid "(Added in 1.0.58)"
31123 #: ../src/guestfs-actions.pod:7524
31124 msgid "guestfs_vfs_label"
31128 #: ../src/guestfs-actions.pod:7526
31132 " guestfs_vfs_label (guestfs_h *g,\n"
31133 " const char *device);\n"
31138 #: ../src/guestfs-actions.pod:7535
31139 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31143 #: ../src/guestfs-actions.pod:7540 ../src/guestfs-actions.pod:7577
31144 msgid "(Added in 1.3.18)"
31148 #: ../src/guestfs-actions.pod:7542
31149 msgid "guestfs_vfs_type"
31153 #: ../src/guestfs-actions.pod:7544
31157 " guestfs_vfs_type (guestfs_h *g,\n"
31158 " const char *device);\n"
31163 #: ../src/guestfs-actions.pod:7561
31164 msgid "guestfs_vfs_uuid"
31168 #: ../src/guestfs-actions.pod:7563
31172 " guestfs_vfs_uuid (guestfs_h *g,\n"
31173 " const char *device);\n"
31178 #: ../src/guestfs-actions.pod:7572
31179 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31183 #: ../src/guestfs-actions.pod:7579
31184 msgid "guestfs_vg_activate"
31188 #: ../src/guestfs-actions.pod:7581
31192 " guestfs_vg_activate (guestfs_h *g,\n"
31194 " char *const *volgroups);\n"
31199 #: ../src/guestfs-actions.pod:7598
31200 msgid "guestfs_vg_activate_all"
31204 #: ../src/guestfs-actions.pod:7600
31208 " guestfs_vg_activate_all (guestfs_h *g,\n"
31209 " int activate);\n"
31214 #: ../src/guestfs-actions.pod:7613
31215 msgid "guestfs_vgcreate"
31219 #: ../src/guestfs-actions.pod:7615
31223 " guestfs_vgcreate (guestfs_h *g,\n"
31224 " const char *volgroup,\n"
31225 " char *const *physvols);\n"
31230 #: ../src/guestfs-actions.pod:7627
31231 msgid "guestfs_vglvuuids"
31235 #: ../src/guestfs-actions.pod:7629
31239 " guestfs_vglvuuids (guestfs_h *g,\n"
31240 " const char *vgname);\n"
31245 #: ../src/guestfs-actions.pod:7636
31247 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31248 "associate logical volumes and volume groups."
31252 #: ../src/guestfs-actions.pod:7639
31253 msgid "See also C<guestfs_vgpvuuids>."
31257 #: ../src/guestfs-actions.pod:7647
31258 msgid "guestfs_vgpvuuids"
31262 #: ../src/guestfs-actions.pod:7649
31266 " guestfs_vgpvuuids (guestfs_h *g,\n"
31267 " const char *vgname);\n"
31272 #: ../src/guestfs-actions.pod:7656
31274 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
31275 "associate physical volumes and volume groups."
31279 #: ../src/guestfs-actions.pod:7659
31280 msgid "See also C<guestfs_vglvuuids>."
31284 #: ../src/guestfs-actions.pod:7667
31285 msgid "guestfs_vgremove"
31289 #: ../src/guestfs-actions.pod:7669
31293 " guestfs_vgremove (guestfs_h *g,\n"
31294 " const char *vgname);\n"
31299 #: ../src/guestfs-actions.pod:7682
31300 msgid "guestfs_vgrename"
31304 #: ../src/guestfs-actions.pod:7684
31308 " guestfs_vgrename (guestfs_h *g,\n"
31309 " const char *volgroup,\n"
31310 " const char *newvolgroup);\n"
31315 #: ../src/guestfs-actions.pod:7695
31316 msgid "guestfs_vgs"
31320 #: ../src/guestfs-actions.pod:7697
31324 " guestfs_vgs (guestfs_h *g);\n"
31329 #: ../src/guestfs-actions.pod:7706
31330 msgid "See also C<guestfs_vgs_full>."
31334 #: ../src/guestfs-actions.pod:7714
31335 msgid "guestfs_vgs_full"
31339 #: ../src/guestfs-actions.pod:7716
31342 " struct guestfs_lvm_vg_list *\n"
31343 " guestfs_vgs_full (guestfs_h *g);\n"
31348 #: ../src/guestfs-actions.pod:7722
31350 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
31351 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
31356 #: ../src/guestfs-actions.pod:7728
31357 msgid "guestfs_vgscan"
31361 #: ../src/guestfs-actions.pod:7730
31365 " guestfs_vgscan (guestfs_h *g);\n"
31370 #: ../src/guestfs-actions.pod:7740
31371 msgid "guestfs_vguuid"
31375 #: ../src/guestfs-actions.pod:7742
31379 " guestfs_vguuid (guestfs_h *g,\n"
31380 " const char *vgname);\n"
31385 #: ../src/guestfs-actions.pod:7753
31386 msgid "guestfs_wait_ready"
31390 #: ../src/guestfs-actions.pod:7755
31394 " guestfs_wait_ready (guestfs_h *g);\n"
31399 #: ../src/guestfs-actions.pod:7758
31401 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
31406 #: ../src/guestfs-actions.pod:7765
31407 msgid "This function is a no op."
31411 #: ../src/guestfs-actions.pod:7767
31413 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
31414 "calling C<guestfs_launch> to wait for the launch to complete. However this "
31415 "is no longer necessary because C<guestfs_launch> now does the waiting."
31419 #: ../src/guestfs-actions.pod:7772
31421 "If you see any calls to this function in code then you can just remove them, "
31422 "unless you want to retain compatibility with older versions of the API."
31426 #: ../src/guestfs-actions.pod:7780
31427 msgid "guestfs_wc_c"
31431 #: ../src/guestfs-actions.pod:7782
31435 " guestfs_wc_c (guestfs_h *g,\n"
31436 " const char *path);\n"
31441 #: ../src/guestfs-actions.pod:7793
31442 msgid "guestfs_wc_l"
31446 #: ../src/guestfs-actions.pod:7795
31450 " guestfs_wc_l (guestfs_h *g,\n"
31451 " const char *path);\n"
31456 #: ../src/guestfs-actions.pod:7806
31457 msgid "guestfs_wc_w"
31461 #: ../src/guestfs-actions.pod:7808
31465 " guestfs_wc_w (guestfs_h *g,\n"
31466 " const char *path);\n"
31471 #: ../src/guestfs-actions.pod:7819
31472 msgid "guestfs_write"
31476 #: ../src/guestfs-actions.pod:7821
31480 " guestfs_write (guestfs_h *g,\n"
31481 " const char *path,\n"
31482 " const char *content,\n"
31483 " size_t content_size);\n"
31488 #: ../src/guestfs-actions.pod:7830
31489 msgid "See also C<guestfs_write_append>."
31493 #: ../src/guestfs-actions.pod:7839
31494 msgid "guestfs_write_append"
31498 #: ../src/guestfs-actions.pod:7841
31502 " guestfs_write_append (guestfs_h *g,\n"
31503 " const char *path,\n"
31504 " const char *content,\n"
31505 " size_t content_size);\n"
31510 #: ../src/guestfs-actions.pod:7850
31511 msgid "See also C<guestfs_write>."
31515 #: ../src/guestfs-actions.pod:7859
31516 msgid "guestfs_write_file"
31520 #: ../src/guestfs-actions.pod:7861
31524 " guestfs_write_file (guestfs_h *g,\n"
31525 " const char *path,\n"
31526 " const char *content,\n"
31532 #: ../src/guestfs-actions.pod:7867
31534 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
31539 #: ../src/guestfs-actions.pod:7892
31540 msgid "guestfs_zegrep"
31544 #: ../src/guestfs-actions.pod:7894
31548 " guestfs_zegrep (guestfs_h *g,\n"
31549 " const char *regex,\n"
31550 " const char *path);\n"
31555 #: ../src/guestfs-actions.pod:7911
31556 msgid "guestfs_zegrepi"
31560 #: ../src/guestfs-actions.pod:7913
31564 " guestfs_zegrepi (guestfs_h *g,\n"
31565 " const char *regex,\n"
31566 " const char *path);\n"
31571 #: ../src/guestfs-actions.pod:7930
31572 msgid "guestfs_zero"
31576 #: ../src/guestfs-actions.pod:7932
31580 " guestfs_zero (guestfs_h *g,\n"
31581 " const char *device);\n"
31586 #: ../src/guestfs-actions.pod:7946
31588 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
31589 "C<guestfs_is_zero_device>"
31593 #: ../src/guestfs-actions.pod:7958
31594 msgid "guestfs_zero_device"
31598 #: ../src/guestfs-actions.pod:7960
31602 " guestfs_zero_device (guestfs_h *g,\n"
31603 " const char *device);\n"
31608 #: ../src/guestfs-actions.pod:7964
31610 "This command writes zeroes over the entire C<device>. Compare with "
31611 "C<guestfs_zero> which just zeroes the first few blocks of a device."
31615 #: ../src/guestfs-actions.pod:7982
31616 msgid "(Added in 1.3.1)"
31620 #: ../src/guestfs-actions.pod:7984
31621 msgid "guestfs_zerofree"
31625 #: ../src/guestfs-actions.pod:7986
31629 " guestfs_zerofree (guestfs_h *g,\n"
31630 " const char *device);\n"
31635 #: ../src/guestfs-actions.pod:8005
31636 msgid "guestfs_zfgrep"
31640 #: ../src/guestfs-actions.pod:8007
31644 " guestfs_zfgrep (guestfs_h *g,\n"
31645 " const char *pattern,\n"
31646 " const char *path);\n"
31651 #: ../src/guestfs-actions.pod:8024
31652 msgid "guestfs_zfgrepi"
31656 #: ../src/guestfs-actions.pod:8026
31660 " guestfs_zfgrepi (guestfs_h *g,\n"
31661 " const char *pattern,\n"
31662 " const char *path);\n"
31667 #: ../src/guestfs-actions.pod:8043
31668 msgid "guestfs_zfile"
31672 #: ../src/guestfs-actions.pod:8045
31676 " guestfs_zfile (guestfs_h *g,\n"
31677 " const char *meth,\n"
31678 " const char *path);\n"
31683 #: ../src/guestfs-actions.pod:8050
31685 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
31690 #: ../src/guestfs-actions.pod:8062
31692 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
31697 #: ../src/guestfs-actions.pod:8070
31698 msgid "guestfs_zgrep"
31702 #: ../src/guestfs-actions.pod:8072
31706 " guestfs_zgrep (guestfs_h *g,\n"
31707 " const char *regex,\n"
31708 " const char *path);\n"
31713 #: ../src/guestfs-actions.pod:8089
31714 msgid "guestfs_zgrepi"
31718 #: ../src/guestfs-actions.pod:8091
31722 " guestfs_zgrepi (guestfs_h *g,\n"
31723 " const char *regex,\n"
31724 " const char *path);\n"
31729 #: ../src/guestfs-availability.pod:3
31734 #: ../src/guestfs-availability.pod:5
31736 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
31737 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
31738 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
31739 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
31740 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
31744 #: ../src/guestfs-availability.pod:21
31749 #: ../src/guestfs-availability.pod:23
31750 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
31754 #: ../src/guestfs-availability.pod:26
31759 #: ../src/guestfs-availability.pod:28
31760 msgid "The following functions: L</guestfs_grub_install>"
31764 #: ../src/guestfs-availability.pod:31
31769 #: ../src/guestfs-availability.pod:33
31771 "The following functions: L</guestfs_inotify_add_watch> "
31772 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
31773 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
31777 #: ../src/guestfs-availability.pod:41
31778 msgid "B<linuxfsuuid>"
31782 #: ../src/guestfs-availability.pod:43
31784 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
31785 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
31789 #: ../src/guestfs-availability.pod:50
31790 msgid "B<linuxmodules>"
31794 #: ../src/guestfs-availability.pod:52
31795 msgid "The following functions: L</guestfs_modprobe>"
31799 #: ../src/guestfs-availability.pod:55
31800 msgid "B<linuxxattrs>"
31804 #: ../src/guestfs-availability.pod:57
31806 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
31807 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
31808 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
31809 "L</guestfs_setxattr>"
31813 #: ../src/guestfs-availability.pod:68
31818 #: ../src/guestfs-availability.pod:70
31820 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
31821 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
31822 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
31826 #: ../src/guestfs-availability.pod:79
31831 #: ../src/guestfs-availability.pod:81
31833 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
31834 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
31835 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
31836 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
31837 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
31838 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
31839 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
31840 "L</guestfs_vgs_full>"
31844 #: ../src/guestfs-availability.pod:104
31849 #: ../src/guestfs-availability.pod:106
31851 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
31852 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
31856 #: ../src/guestfs-availability.pod:112
31861 #: ../src/guestfs-availability.pod:114
31862 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
31866 #: ../src/guestfs-availability.pod:117
31867 msgid "B<ntfsprogs>"
31871 #: ../src/guestfs-availability.pod:119
31873 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
31874 "L</guestfs_ntfsresize_size>"
31878 #: ../src/guestfs-availability.pod:124
31879 msgid "B<realpath>"
31883 #: ../src/guestfs-availability.pod:126
31884 msgid "The following functions: L</guestfs_realpath>"
31888 #: ../src/guestfs-availability.pod:129
31893 #: ../src/guestfs-availability.pod:131
31895 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
31896 "L</guestfs_scrub_freespace>"
31900 #: ../src/guestfs-availability.pod:136
31905 #: ../src/guestfs-availability.pod:138
31906 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
31910 #: ../src/guestfs-availability.pod:142
31915 #: ../src/guestfs-availability.pod:144
31916 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
31920 #: ../src/guestfs-availability.pod:148
31921 msgid "B<zerofree>"
31925 #: ../src/guestfs-availability.pod:150
31926 msgid "The following functions: L</guestfs_zerofree>"
31930 #: ../src/guestfs-structs.pod:1
31931 msgid "guestfs_int_bool"
31935 #: ../src/guestfs-structs.pod:3
31938 " struct guestfs_int_bool {\n"
31946 #: ../src/guestfs-structs.pod:8
31949 " struct guestfs_int_bool_list {\n"
31950 " uint32_t len; /* Number of elements in list. */\n"
31951 " struct guestfs_int_bool *val; /* Elements. */\n"
31957 #: ../src/guestfs-structs.pod:13
31960 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
31961 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
31966 #: ../src/guestfs-structs.pod:16
31967 msgid "guestfs_lvm_pv"
31971 #: ../src/guestfs-structs.pod:18
31974 " struct guestfs_lvm_pv {\n"
31975 " char *pv_name;\n"
31976 " /* The next field is NOT nul-terminated, be careful when printing it: "
31978 " char pv_uuid[32];\n"
31980 " uint64_t pv_size;\n"
31981 " uint64_t dev_size;\n"
31982 " uint64_t pv_free;\n"
31983 " uint64_t pv_used;\n"
31984 " char *pv_attr;\n"
31985 " int64_t pv_pe_count;\n"
31986 " int64_t pv_pe_alloc_count;\n"
31987 " char *pv_tags;\n"
31988 " uint64_t pe_start;\n"
31989 " int64_t pv_mda_count;\n"
31990 " uint64_t pv_mda_free;\n"
31996 #: ../src/guestfs-structs.pod:36
31999 " struct guestfs_lvm_pv_list {\n"
32000 " uint32_t len; /* Number of elements in list. */\n"
32001 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32007 #: ../src/guestfs-structs.pod:41
32010 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32011 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32016 #: ../src/guestfs-structs.pod:44
32017 msgid "guestfs_lvm_vg"
32021 #: ../src/guestfs-structs.pod:46
32024 " struct guestfs_lvm_vg {\n"
32025 " char *vg_name;\n"
32026 " /* The next field is NOT nul-terminated, be careful when printing it: "
32028 " char vg_uuid[32];\n"
32030 " char *vg_attr;\n"
32031 " uint64_t vg_size;\n"
32032 " uint64_t vg_free;\n"
32033 " char *vg_sysid;\n"
32034 " uint64_t vg_extent_size;\n"
32035 " int64_t vg_extent_count;\n"
32036 " int64_t vg_free_count;\n"
32037 " int64_t max_lv;\n"
32038 " int64_t max_pv;\n"
32039 " int64_t pv_count;\n"
32040 " int64_t lv_count;\n"
32041 " int64_t snap_count;\n"
32042 " int64_t vg_seqno;\n"
32043 " char *vg_tags;\n"
32044 " int64_t vg_mda_count;\n"
32045 " uint64_t vg_mda_free;\n"
32051 #: ../src/guestfs-structs.pod:69
32054 " struct guestfs_lvm_vg_list {\n"
32055 " uint32_t len; /* Number of elements in list. */\n"
32056 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32062 #: ../src/guestfs-structs.pod:74
32065 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32066 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32071 #: ../src/guestfs-structs.pod:77
32072 msgid "guestfs_lvm_lv"
32076 #: ../src/guestfs-structs.pod:79
32079 " struct guestfs_lvm_lv {\n"
32080 " char *lv_name;\n"
32081 " /* The next field is NOT nul-terminated, be careful when printing it: "
32083 " char lv_uuid[32];\n"
32084 " char *lv_attr;\n"
32085 " int64_t lv_major;\n"
32086 " int64_t lv_minor;\n"
32087 " int64_t lv_kernel_major;\n"
32088 " int64_t lv_kernel_minor;\n"
32089 " uint64_t lv_size;\n"
32090 " int64_t seg_count;\n"
32092 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32093 " float snap_percent;\n"
32094 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32095 " float copy_percent;\n"
32096 " char *move_pv;\n"
32097 " char *lv_tags;\n"
32098 " char *mirror_log;\n"
32099 " char *modules;\n"
32105 #: ../src/guestfs-structs.pod:101
32108 " struct guestfs_lvm_lv_list {\n"
32109 " uint32_t len; /* Number of elements in list. */\n"
32110 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32116 #: ../src/guestfs-structs.pod:106
32119 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32120 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32125 #: ../src/guestfs-structs.pod:111
32128 " struct guestfs_stat {\n"
32132 " int64_t nlink;\n"
32137 " int64_t blksize;\n"
32138 " int64_t blocks;\n"
32139 " int64_t atime;\n"
32140 " int64_t mtime;\n"
32141 " int64_t ctime;\n"
32147 #: ../src/guestfs-structs.pod:127
32150 " struct guestfs_stat_list {\n"
32151 " uint32_t len; /* Number of elements in list. */\n"
32152 " struct guestfs_stat *val; /* Elements. */\n"
32158 #: ../src/guestfs-structs.pod:132
32161 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32162 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32167 #: ../src/guestfs-structs.pod:137
32170 " struct guestfs_statvfs {\n"
32171 " int64_t bsize;\n"
32172 " int64_t frsize;\n"
32173 " int64_t blocks;\n"
32174 " int64_t bfree;\n"
32175 " int64_t bavail;\n"
32176 " int64_t files;\n"
32177 " int64_t ffree;\n"
32178 " int64_t favail;\n"
32181 " int64_t namemax;\n"
32187 #: ../src/guestfs-structs.pod:151
32190 " struct guestfs_statvfs_list {\n"
32191 " uint32_t len; /* Number of elements in list. */\n"
32192 " struct guestfs_statvfs *val; /* Elements. */\n"
32198 #: ../src/guestfs-structs.pod:156
32201 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32202 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32207 #: ../src/guestfs-structs.pod:159
32208 msgid "guestfs_dirent"
32212 #: ../src/guestfs-structs.pod:161
32215 " struct guestfs_dirent {\n"
32224 #: ../src/guestfs-structs.pod:167
32227 " struct guestfs_dirent_list {\n"
32228 " uint32_t len; /* Number of elements in list. */\n"
32229 " struct guestfs_dirent *val; /* Elements. */\n"
32235 #: ../src/guestfs-structs.pod:172
32238 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32239 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32244 #: ../src/guestfs-structs.pod:177
32247 " struct guestfs_version {\n"
32248 " int64_t major;\n"
32249 " int64_t minor;\n"
32250 " int64_t release;\n"
32257 #: ../src/guestfs-structs.pod:184
32260 " struct guestfs_version_list {\n"
32261 " uint32_t len; /* Number of elements in list. */\n"
32262 " struct guestfs_version *val; /* Elements. */\n"
32268 #: ../src/guestfs-structs.pod:189
32271 " void guestfs_free_version (struct guestfs_free_version *);\n"
32272 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
32277 #: ../src/guestfs-structs.pod:192
32278 msgid "guestfs_xattr"
32282 #: ../src/guestfs-structs.pod:194
32285 " struct guestfs_xattr {\n"
32286 " char *attrname;\n"
32287 " /* The next two fields describe a byte array. */\n"
32288 " uint32_t attrval_len;\n"
32289 " char *attrval;\n"
32295 #: ../src/guestfs-structs.pod:201
32298 " struct guestfs_xattr_list {\n"
32299 " uint32_t len; /* Number of elements in list. */\n"
32300 " struct guestfs_xattr *val; /* Elements. */\n"
32306 #: ../src/guestfs-structs.pod:206
32309 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
32310 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
32315 #: ../src/guestfs-structs.pod:209
32316 msgid "guestfs_inotify_event"
32320 #: ../src/guestfs-structs.pod:211
32323 " struct guestfs_inotify_event {\n"
32324 " int64_t in_wd;\n"
32325 " uint32_t in_mask;\n"
32326 " uint32_t in_cookie;\n"
32327 " char *in_name;\n"
32333 #: ../src/guestfs-structs.pod:218
32336 " struct guestfs_inotify_event_list {\n"
32337 " uint32_t len; /* Number of elements in list. */\n"
32338 " struct guestfs_inotify_event *val; /* Elements. */\n"
32344 #: ../src/guestfs-structs.pod:223
32347 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
32348 " void guestfs_free_inotify_event_list (struct "
32349 "guestfs_free_inotify_event_list *);\n"
32354 #: ../src/guestfs-structs.pod:226
32355 msgid "guestfs_partition"
32359 #: ../src/guestfs-structs.pod:228
32362 " struct guestfs_partition {\n"
32363 " int32_t part_num;\n"
32364 " uint64_t part_start;\n"
32365 " uint64_t part_end;\n"
32366 " uint64_t part_size;\n"
32372 #: ../src/guestfs-structs.pod:235
32375 " struct guestfs_partition_list {\n"
32376 " uint32_t len; /* Number of elements in list. */\n"
32377 " struct guestfs_partition *val; /* Elements. */\n"
32383 #: ../src/guestfs-structs.pod:240
32386 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
32387 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
32392 #: ../src/guestfs-structs.pod:243
32393 msgid "guestfs_application"
32397 #: ../src/guestfs-structs.pod:245
32400 " struct guestfs_application {\n"
32401 " char *app_name;\n"
32402 " char *app_display_name;\n"
32403 " int32_t app_epoch;\n"
32404 " char *app_version;\n"
32405 " char *app_release;\n"
32406 " char *app_install_path;\n"
32407 " char *app_trans_path;\n"
32408 " char *app_publisher;\n"
32409 " char *app_url;\n"
32410 " char *app_source_package;\n"
32411 " char *app_summary;\n"
32412 " char *app_description;\n"
32418 #: ../src/guestfs-structs.pod:260
32421 " struct guestfs_application_list {\n"
32422 " uint32_t len; /* Number of elements in list. */\n"
32423 " struct guestfs_application *val; /* Elements. */\n"
32429 #: ../src/guestfs-structs.pod:265
32432 " void guestfs_free_application (struct guestfs_free_application *);\n"
32433 " void guestfs_free_application_list (struct guestfs_free_application_list "
32439 #: ../src/guestfs.pod:5
32440 msgid "guestfs - Library for accessing and modifying virtual machine images"
32444 #: ../src/guestfs.pod:11
32447 " guestfs_h *g = guestfs_create ();\n"
32448 " guestfs_add_drive (g, \"guest.img\");\n"
32449 " guestfs_launch (g);\n"
32450 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32451 " guestfs_touch (g, \"/hello\");\n"
32452 " guestfs_umount (g, \"/\");\n"
32453 " guestfs_close (g);\n"
32458 #: ../src/guestfs.pod:25
32460 "Libguestfs is a library for accessing and modifying guest disk images. "
32461 "Amongst the things this is good for: making batch configuration changes to "
32462 "guests, getting disk used/free statistics (see also: virt-df), migrating "
32463 "between virtualization systems (see also: virt-p2v), performing partial "
32464 "backups, performing partial guest clones, cloning guests and changing "
32465 "registry/UUID/hostname info, and much else besides."
32469 #: ../src/guestfs.pod:33
32471 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
32472 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
32473 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
32478 #: ../src/guestfs.pod:38
32480 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
32481 "what filesystem is in each LV, etc.). It can also run commands in the "
32482 "context of the guest. Also you can access filesystems over FUSE."
32486 #: ../src/guestfs.pod:43
32488 "Libguestfs is a library that can be linked with C and C++ management "
32489 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
32490 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
32495 #: ../src/guestfs.pod:48
32497 "You don't need to be root to use libguestfs, although obviously you do need "
32498 "enough permissions to access the disk images."
32502 #: ../src/guestfs.pod:51
32504 "Libguestfs is a large API because it can do many things. For a gentle "
32505 "introduction, please read the L</API OVERVIEW> section next."
32509 #: ../src/guestfs.pod:54
32511 "There are also some example programs in the L<guestfs-examples(3)> manual "
32516 #: ../src/guestfs.pod:57
32517 msgid "API OVERVIEW"
32521 #: ../src/guestfs.pod:59
32523 "This section provides a gentler overview of the libguestfs API. We also try "
32524 "to group API calls together, where that may not be obvious from reading "
32525 "about the individual calls in the main section of this manual."
32529 #: ../src/guestfs.pod:64
32534 #: ../src/guestfs.pod:66
32536 "Before you can use libguestfs calls, you have to create a handle. Then you "
32537 "must add at least one disk image to the handle, followed by launching the "
32538 "handle, then performing whatever operations you want, and finally closing "
32539 "the handle. By convention we use the single letter C<g> for the name of the "
32540 "handle variable, although of course you can use any name you want."
32544 #: ../src/guestfs.pod:73
32545 msgid "The general structure of all libguestfs-using programs looks like this:"
32549 #: ../src/guestfs.pod:76
32552 " guestfs_h *g = guestfs_create ();\n"
32557 #: ../src/guestfs.pod:78
32560 " /* Call guestfs_add_drive additional times if there are\n"
32561 " * multiple disk images.\n"
32563 " guestfs_add_drive (g, \"guest.img\");\n"
32568 #: ../src/guestfs.pod:83
32571 " /* Most manipulation calls won't work until you've launched\n"
32572 " * the handle 'g'. You have to do this _after_ adding drives\n"
32573 " * and _before_ other commands.\n"
32575 " guestfs_launch (g);\n"
32580 #: ../src/guestfs.pod:89
32583 " /* Now you can examine what partitions, LVs etc are available.\n"
32585 " char **partitions = guestfs_list_partitions (g);\n"
32586 " char **logvols = guestfs_lvs (g);\n"
32591 #: ../src/guestfs.pod:94
32594 " /* To access a filesystem in the image, you must mount it.\n"
32596 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32601 #: ../src/guestfs.pod:98
32604 " /* Now you can perform filesystem actions on the guest\n"
32607 " guestfs_touch (g, \"/hello\");\n"
32612 #: ../src/guestfs.pod:103
32615 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
32616 " * it is done automatically when you close the handle. See\n"
32617 " * discussion of autosync in this page.\n"
32619 " guestfs_sync (g);\n"
32624 #: ../src/guestfs.pod:109
32627 " /* Close the handle 'g'. */\n"
32628 " guestfs_close (g);\n"
32633 #: ../src/guestfs.pod:112
32635 "The code above doesn't include any error checking. In real code you should "
32636 "check return values carefully for errors. In general all functions that "
32637 "return integers return C<-1> on error, and all functions that return "
32638 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
32639 "how to handle errors, and consult the documentation for each function call "
32640 "below to see precisely how they return error indications. See "
32641 "L<guestfs-examples(3)> for fully worked examples."
32645 #: ../src/guestfs.pod:121
32646 msgid "DISK IMAGES"
32650 #: ../src/guestfs.pod:123
32652 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
32653 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
32654 "actual block device, or simply an empty file of zeroes that you have created "
32655 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
32660 #: ../src/guestfs.pod:129
32662 "The call you should use in modern code for adding drives is "
32663 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
32664 "specifying that the format is raw, do:"
32668 #: ../src/guestfs.pod:133
32671 " guestfs_add_drive_opts (g, filename,\n"
32672 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32678 #: ../src/guestfs.pod:137
32679 msgid "You can add a disk read-only using:"
32683 #: ../src/guestfs.pod:139
32686 " guestfs_add_drive_opts (g, filename,\n"
32687 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32688 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32694 #: ../src/guestfs.pod:144
32696 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
32697 "libguestfs won't modify the file."
32701 #: ../src/guestfs.pod:147
32703 "Be extremely cautious if the disk image is in use, eg. if it is being used "
32704 "by a virtual machine. Adding it read-write will almost certainly cause disk "
32705 "corruption, but adding it read-only is safe."
32709 #: ../src/guestfs.pod:151
32711 "You must add at least one disk image, and you may add multiple disk images. "
32712 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
32713 "first one you added), C</dev/sdb> (for the second one you added), etc."
32717 #: ../src/guestfs.pod:156
32719 "Once L</guestfs_launch> has been called you cannot add any more images. You "
32720 "can call L</guestfs_list_devices> to get a list of the device names, in the "
32721 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
32725 #: ../src/guestfs.pod:161
32730 #: ../src/guestfs.pod:163
32732 "Before you can read or write files, create directories and so on in a disk "
32733 "image that contains filesystems, you have to mount those filesystems using "
32734 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
32735 "a disk image contains (for example) one partition with a filesystem on that "
32736 "partition, then you can mount it directly:"
32740 #: ../src/guestfs.pod:170
32743 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
32748 #: ../src/guestfs.pod:172
32750 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
32751 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
32752 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
32753 "that these are libguestfs virtual devices, and are nothing to do with host "
32758 #: ../src/guestfs.pod:178
32760 "If you are given a disk image and you don't know what it contains then you "
32761 "have to find out. Libguestfs can do that too: use "
32762 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
32763 "and LVs, and either try mounting each to see what is mountable, or else "
32764 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
32765 "filesystems, use L</guestfs_list_filesystems>."
32769 #: ../src/guestfs.pod:186
32771 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
32772 "L</INSPECTION> below). But you might find it easier to look at higher level "
32773 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
32777 #: ../src/guestfs.pod:191
32779 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
32780 "several other variations of the C<guestfs_mount_*> call."
32784 #: ../src/guestfs.pod:194
32785 msgid "FILESYSTEM ACCESS AND MODIFICATION"
32789 #: ../src/guestfs.pod:196
32791 "The majority of the libguestfs API consists of fairly low-level calls for "
32792 "accessing and modifying the files, directories, symlinks etc on mounted "
32793 "filesystems. There are over a hundred such calls which you can find listed "
32794 "in detail below in this man page, and we don't even pretend to cover them "
32795 "all in this overview."
32799 #: ../src/guestfs.pod:202
32801 "Specify filenames as full paths, starting with C<\"/\"> and including the "
32806 #: ../src/guestfs.pod:205
32808 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
32809 "the file called C<\"etc/passwd\"> then you could do:"
32813 #: ../src/guestfs.pod:208
32816 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
32821 #: ../src/guestfs.pod:210
32823 "This would return C<data> as a newly allocated buffer containing the full "
32824 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
32825 "or C<NULL> if there was an error."
32829 #: ../src/guestfs.pod:214
32831 "As another example, to create a top-level directory on that filesystem "
32832 "called C<\"var\"> you would do:"
32836 #: ../src/guestfs.pod:217
32839 " guestfs_mkdir (g, \"/var\");\n"
32844 #: ../src/guestfs.pod:219
32845 msgid "To create a symlink you could do:"
32849 #: ../src/guestfs.pod:221
32852 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
32853 " \"/etc/rc3.d/S30portmap\");\n"
32858 #: ../src/guestfs.pod:224
32860 "Libguestfs will reject attempts to use relative paths and there is no "
32861 "concept of a current working directory."
32865 #: ../src/guestfs.pod:227
32867 "Libguestfs can return errors in many situations: for example if the "
32868 "filesystem isn't writable, or if a file or directory that you requested "
32869 "doesn't exist. If you are using the C API (documented here) you have to "
32870 "check for those error conditions after each call. (Other language bindings "
32871 "turn these errors into exceptions)."
32875 #: ../src/guestfs.pod:233
32877 "File writes are affected by the per-handle umask, set by calling "
32878 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
32882 #: ../src/guestfs.pod:236
32883 msgid "PARTITIONING"
32887 #: ../src/guestfs.pod:238
32889 "Libguestfs contains API calls to read, create and modify partition tables on "
32894 #: ../src/guestfs.pod:241
32896 "In the common case where you want to create a single partition covering the "
32897 "whole disk, you should use the L</guestfs_part_disk> call:"
32901 #: ../src/guestfs.pod:245
32904 " const char *parttype = \"mbr\";\n"
32905 " if (disk_is_larger_than_2TB)\n"
32906 " parttype = \"gpt\";\n"
32907 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
32912 #: ../src/guestfs.pod:250
32914 "Obviously this effectively wipes anything that was on that disk image "
32919 #: ../src/guestfs.pod:253
32924 #: ../src/guestfs.pod:255
32926 "Libguestfs provides access to a large part of the LVM2 API, such as "
32927 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
32928 "unless you familiarize yourself with the concepts of physical volumes, "
32929 "volume groups and logical volumes."
32933 #: ../src/guestfs.pod:260
32935 "This author strongly recommends reading the LVM HOWTO, online at "
32936 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
32940 #: ../src/guestfs.pod:263
32941 msgid "DOWNLOADING"
32945 #: ../src/guestfs.pod:265
32947 "Use L</guestfs_cat> to download small, text only files. This call is "
32948 "limited to files which are less than 2 MB and which cannot contain any ASCII "
32949 "NUL (C<\\0>) characters. However the API is very simple to use."
32953 #: ../src/guestfs.pod:269
32955 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
32956 "bit data, since it returns a (pointer, size) pair. However it is still "
32957 "limited to \"small\" files, less than 2 MB."
32961 #: ../src/guestfs.pod:273
32963 "L</guestfs_download> can be used to download any file, with no limits on "
32964 "content or size (even files larger than 4 GB)."
32968 #: ../src/guestfs.pod:276
32969 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
32973 #: ../src/guestfs.pod:279
32978 #: ../src/guestfs.pod:281
32980 "It's often the case that you want to write a file or files to the disk "
32985 #: ../src/guestfs.pod:284
32987 "To write a small file with fixed content, use L</guestfs_write>. To create "
32988 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
32989 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
32990 "variety of other functions for creating test files, for example "
32991 "L</guestfs_fill> and L</guestfs_fill_pattern>."
32995 #: ../src/guestfs.pod:290
32997 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
32998 "file content or size (even files larger than 4 GB)."
33002 #: ../src/guestfs.pod:293
33003 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33007 #: ../src/guestfs.pod:295
33009 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33010 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
33011 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
33012 "the drive in a predictable way (eg. adding it last after all other drives) "
33013 "then you can get the device name from L</guestfs_list_devices> and mount it "
33014 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
33015 "sometimes non-portable between kernel versions, and they don't support "
33016 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
33017 "using a label or UUID, use an ISO image instead."
33021 #: ../src/guestfs.pod:306
33026 #: ../src/guestfs.pod:308
33028 "There are various different commands for copying between files and devices "
33029 "and in and out of the guest filesystem. These are summarised in the table "
33034 #: ../src/guestfs.pod:314
33035 msgid "B<file> to B<file>"
33039 #: ../src/guestfs.pod:316
33041 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33042 "directories recursively."
33046 #: ../src/guestfs.pod:319
33047 msgid "B<file or device> to B<file or device>"
33051 #: ../src/guestfs.pod:321
33053 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
33054 "devices in the guest."
33058 #: ../src/guestfs.pod:324
33059 msgid "Example: duplicate the contents of an LV:"
33063 #: ../src/guestfs.pod:326
33066 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
33071 #: ../src/guestfs.pod:328
33073 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33074 "(C</dev/VG/Original>). To copy less than the whole source device, use "
33075 "L</guestfs_copy_size>."
33079 #: ../src/guestfs.pod:332
33080 msgid "B<file on the host> to B<file or device>"
33084 #: ../src/guestfs.pod:334
33085 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33089 #: ../src/guestfs.pod:336
33090 msgid "B<file or device> to B<file on the host>"
33094 #: ../src/guestfs.pod:338
33095 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33099 #: ../src/guestfs.pod:342
33100 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33104 #: ../src/guestfs.pod:344
33106 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
33107 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33108 "appears you can only upload and download to files. However many Un*x-like "
33109 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
33110 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
33111 "stderr, and arbitrary file descriptor N."
33115 #: ../src/guestfs.pod:352
33116 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33120 #: ../src/guestfs.pod:355
33123 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33128 #: ../src/guestfs.pod:357
33129 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33133 #: ../src/guestfs.pod:359
33136 " char devfd[64];\n"
33137 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33138 " guestfs_tar_out (g, \"/\", devfd);\n"
33143 #: ../src/guestfs.pod:363
33144 msgid "LISTING FILES"
33148 #: ../src/guestfs.pod:365
33150 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33151 "L<guestfish(1)>-equivalent command C<ll>)."
33155 #: ../src/guestfs.pod:368
33157 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33158 "programs, as a flat list of strings."
33162 #: ../src/guestfs.pod:371
33164 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33165 "directory, plus additional information about each one. It is more "
33166 "equivalent to using the L<readdir(3)> call on a local filesystem."
33170 #: ../src/guestfs.pod:375
33172 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
33177 #: ../src/guestfs.pod:378
33178 msgid "RUNNING COMMANDS"
33182 #: ../src/guestfs.pod:380
33184 "Although libguestfs is primarily an API for manipulating files inside guest "
33185 "images, we also provide some limited facilities for running commands inside "
33190 #: ../src/guestfs.pod:384
33191 msgid "There are many limitations to this:"
33195 #: ../src/guestfs.pod:390
33197 "The kernel version that the command runs under will be different from what "
33202 #: ../src/guestfs.pod:395
33204 "If the command needs to communicate with daemons, then most likely they "
33205 "won't be running."
33209 #: ../src/guestfs.pod:400
33210 msgid "The command will be running in limited memory."
33214 #: ../src/guestfs.pod:404
33216 "The network may not be available unless you enable it (see "
33217 "L</guestfs_set_network>)."
33221 #: ../src/guestfs.pod:409
33222 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33226 #: ../src/guestfs.pod:413
33227 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33231 #: ../src/guestfs.pod:418
33233 "For SELinux guests, you may need to enable SELinux and load policy first. "
33234 "See L</SELINUX> in this manpage."
33238 #: ../src/guestfs.pod:423
33240 "I<Security:> It is not safe to run commands from untrusted, possibly "
33241 "malicious guests. These commands may attempt to exploit your program by "
33242 "sending unexpected output. They could also try to exploit the Linux kernel "
33243 "or qemu provided by the libguestfs appliance. They could use the network "
33244 "provided by the libguestfs appliance to bypass ordinary network partitions "
33245 "and firewalls. They could use the elevated privileges or different SELinux "
33246 "context of your program to their advantage."
33250 #: ../src/guestfs.pod:432
33252 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
33253 "(a script which runs when the guest next boots normally), and to have this "
33254 "script run the commands you want in the normal context of the running guest, "
33255 "network security and so on. For information about other security issues, "
33256 "see L</SECURITY>."
33260 #: ../src/guestfs.pod:440
33262 "The two main API calls to run commands are L</guestfs_command> and "
33263 "L</guestfs_sh> (there are also variations)."
33267 #: ../src/guestfs.pod:443
33269 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
33270 "shell globs, redirections, etc will work."
33274 #: ../src/guestfs.pod:446
33275 msgid "CONFIGURATION FILES"
33279 #: ../src/guestfs.pod:448
33281 "To read and write configuration files in Linux guest filesystems, we "
33282 "strongly recommend using Augeas. For example, Augeas understands how to "
33283 "read and write, say, a Linux shadow password file or X.org configuration "
33284 "file, and so avoids you having to write that code."
33288 #: ../src/guestfs.pod:453
33290 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
33291 "document Augeas itself here because there is excellent documentation on the "
33292 "L<http://augeas.net/> website."
33296 #: ../src/guestfs.pod:457
33298 "If you don't want to use Augeas (you fool!) then try calling "
33299 "L</guestfs_read_lines> to get the file as a list of lines which you can "
33304 #: ../src/guestfs.pod:461
33309 #: ../src/guestfs.pod:463
33311 "We support SELinux guests. To ensure that labeling happens correctly in "
33312 "SELinux guests, you need to enable SELinux and load the guest's policy:"
33316 #: ../src/guestfs.pod:471
33317 msgid "Before launching, do:"
33321 #: ../src/guestfs.pod:473
33324 " guestfs_set_selinux (g, 1);\n"
33329 #: ../src/guestfs.pod:477
33331 "After mounting the guest's filesystem(s), load the policy. This is best "
33332 "done by running the L<load_policy(8)> command in the guest itself:"
33336 #: ../src/guestfs.pod:481
33339 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
33344 #: ../src/guestfs.pod:483
33346 "(Older versions of C<load_policy> require you to specify the name of the "
33351 #: ../src/guestfs.pod:488
33353 "Optionally, set the security context for the API. The correct security "
33354 "context to use can only be known by inspecting the guest. As an example:"
33358 #: ../src/guestfs.pod:492
33361 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
33366 #: ../src/guestfs.pod:496
33367 msgid "This will work for running commands and editing existing files."
33371 #: ../src/guestfs.pod:498
33373 "When new files are created, you may need to label them explicitly, for "
33374 "example by running the external command C<restorecon pathname>."
33378 #: ../src/guestfs.pod:502
33383 #: ../src/guestfs.pod:504
33385 "Certain calls are affected by the current file mode creation mask (the "
33386 "\"umask\"). In particular ones which create files or directories, such as "
33387 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
33388 "either the default mode that the file is created with or modifies the mode "
33393 #: ../src/guestfs.pod:510
33395 "The default umask is C<022>, so files are created with modes such as C<0644> "
33396 "and directories with C<0755>."
33400 #: ../src/guestfs.pod:513
33402 "There are two ways to avoid being affected by umask. Either set umask to 0 "
33403 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
33404 "L</guestfs_chmod> after creating each file or directory."
33408 #: ../src/guestfs.pod:517
33409 msgid "For more information about umask, see L<umask(2)>."
33413 #: ../src/guestfs.pod:521
33415 "Libguestfs allows you to access Linux guests which have been encrypted using "
33416 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
33417 "standard. This includes nearly all whole disk encryption systems used by "
33418 "modern Linux guests."
33422 #: ../src/guestfs.pod:527
33424 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
33425 "returns the string C<crypto_LUKS>)."
33429 #: ../src/guestfs.pod:530
33431 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
33432 "will require the passphrase!"
33436 #: ../src/guestfs.pod:533
33438 "Opening a LUKS device creates a new device mapper device called "
33439 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
33440 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
33441 "decrypted from and encrypted to the underlying block device respectively."
33445 #: ../src/guestfs.pod:539
33447 "LVM volume groups on the device can be made visible by calling "
33448 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
33449 "volume(s) can now be mounted in the usual way."
33453 #: ../src/guestfs.pod:543
33455 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
33456 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
33457 "[\"/dev/VG\"])>. Then close the mapper device by calling "
33458 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
33459 "underlying encrypted block device)."
33463 #: ../src/guestfs.pod:550
33468 #: ../src/guestfs.pod:552
33470 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
33471 "contains operating systems, an install CD or a live CD. (These APIs used to "
33472 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
33473 "version 1.5.3 the most frequently used part of this library has been "
33474 "rewritten in C and moved into the core code)."
33478 #: ../src/guestfs.pod:559
33480 "Add all disks belonging to the unknown virtual machine and call "
33481 "L</guestfs_launch> in the usual way."
33485 #: ../src/guestfs.pod:562
33487 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
33488 "and certain heuristics, and returns a list of operating systems that were "
33489 "found. An empty list means none were found. A single element is the root "
33490 "filesystem of the operating system. For dual- or multi-boot guests, "
33491 "multiple roots can be returned, each one corresponding to a separate "
33492 "operating system. (Multi-boot virtual machines are extremely rare in the "
33493 "world of virtualization, but since this scenario can happen, we have built "
33494 "libguestfs to deal with it.)"
33498 #: ../src/guestfs.pod:571
33500 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
33501 "to get additional details about that operating system. For example, call "
33502 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
33503 "Windows and Linux-based operating systems respectively."
33507 #: ../src/guestfs.pod:577
33509 "Un*x-like and Linux-based operating systems usually consist of several "
33510 "filesystems which are mounted at boot time (for example, a separate boot "
33511 "partition mounted on C</boot>). The inspection rules are able to detect how "
33512 "filesystems correspond to mount points. Call "
33513 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
33514 "hash table like this example:"
33518 #: ../src/guestfs.pod:584
33521 " /boot => /dev/sda1\n"
33522 " / => /dev/vg_guest/lv_root\n"
33523 " /usr => /dev/vg_guest/lv_usr\n"
33528 #: ../src/guestfs.pod:588
33530 "The caller can then make calls to L</guestfs_mount_options> to mount the "
33531 "filesystems as suggested."
33535 #: ../src/guestfs.pod:591
33537 "Be careful to mount filesystems in the right order (eg. C</> before "
33538 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
33543 #: ../src/guestfs.pod:595
33545 "Inspection currently only works for some common operating systems. "
33546 "Contributors are welcome to send patches for other operating systems that we "
33547 "currently cannot detect."
33551 #: ../src/guestfs.pod:599
33553 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
33554 "for more details. The L</guestfs_inspect_os> function just ignores any "
33555 "encrypted devices."
33559 #: ../src/guestfs.pod:603
33561 "A note on the implementation: The call L</guestfs_inspect_os> performs "
33562 "inspection and caches the results in the guest handle. Subsequent calls to "
33563 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
33564 "re-read the disks. If you change the content of the guest disks, you can "
33565 "redo inspection by calling L</guestfs_inspect_os> again. "
33566 "(L</guestfs_inspect_list_applications> works a little differently from the "
33567 "other calls and does read the disks. See documentation for that function "
33572 #: ../src/guestfs.pod:612
33573 msgid "INSPECTING INSTALL DISKS"
33577 #: ../src/guestfs.pod:614
33579 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
33584 #: ../src/guestfs.pod:617
33586 "Call L</guestfs_inspect_get_format> to return the format of the operating "
33587 "system, which currently can be C<installed> (a regular operating system) or "
33588 "C<installer> (some sort of install disk)."
33592 #: ../src/guestfs.pod:621
33594 "Further information is available about the operating system that can be "
33595 "installed using the regular inspection APIs like "
33596 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
33601 #: ../src/guestfs.pod:626
33603 "Some additional information specific to installer disks is also available "
33604 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
33605 "L</guestfs_inspect_is_multipart> calls."
33609 #: ../src/guestfs.pod:631
33610 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
33614 #: ../src/guestfs.pod:633
33616 "Libguestfs can mount NTFS partitions. It does this using the "
33617 "L<http://www.ntfs-3g.org/> driver."
33621 #: ../src/guestfs.pod:636
33622 msgid "DRIVE LETTERS AND PATHS"
33626 #: ../src/guestfs.pod:638
33628 "DOS and Windows still use drive letters, and the filesystems are always "
33629 "treated as case insensitive by Windows itself, and therefore you might find "
33630 "a Windows configuration file referring to a path like "
33631 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
33632 "that directory might be referred to as C</WINDOWS/System32>."
33636 #: ../src/guestfs.pod:644
33638 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
33639 "L</guestfs_inspect_get_drive_mappings>)"
33643 #: ../src/guestfs.pod:647
33645 "Dealing with separator characters (backslash vs forward slash) is outside "
33646 "the scope of libguestfs, but usually a simple character replacement will "
33651 #: ../src/guestfs.pod:651
33653 "To resolve the case insensitivity of paths, call "
33654 "L</guestfs_case_sensitive_path>."
33658 #: ../src/guestfs.pod:654
33659 msgid "ACCESSING THE WINDOWS REGISTRY"
33663 #: ../src/guestfs.pod:656
33665 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
33666 "files, through the library C<hivex> which is part of the libguestfs project "
33667 "although ships as a separate tarball. You have to locate and download the "
33668 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
33669 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
33670 "L<virt-win-reg(1)> for more help on this issue."
33674 #: ../src/guestfs.pod:664
33675 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
33679 #: ../src/guestfs.pod:666
33681 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
33682 "provide something which looks like a Linux symlink. The way it tries to do "
33683 "the rewriting is described here:"
33687 #: ../src/guestfs.pod:670
33688 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
33692 #: ../src/guestfs.pod:672
33694 "The essential problem is that ntfs-3g simply does not have enough "
33695 "information to do a correct job. NTFS links can contain drive letters and "
33696 "references to external device GUIDs that ntfs-3g has no way of resolving. "
33697 "It is almost certainly the case that libguestfs callers should ignore what "
33698 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
33702 #: ../src/guestfs.pod:679
33704 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
33705 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
33706 "attribute, and read the raw reparse data from that (you can find the format "
33707 "documented in various places around the web)."
33711 #: ../src/guestfs.pod:684
33712 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
33716 #: ../src/guestfs.pod:686
33718 "There are other useful extended attributes that can be read from ntfs-3g "
33719 "filesystems (using L</guestfs_getxattr>). See:"
33723 #: ../src/guestfs.pod:689
33724 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
33728 #: ../src/guestfs.pod:691
33729 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
33733 #: ../src/guestfs.pod:693
33735 "Although we don't want to discourage you from using the C API, we will "
33736 "mention here that the same API is also available in other languages."
33740 #: ../src/guestfs.pod:696
33742 "The API is broadly identical in all supported languages. This means that "
33743 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
33744 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
33745 "OCaml. In other words, a straightforward, predictable isomorphism between "
33750 #: ../src/guestfs.pod:702
33752 "Error messages are automatically transformed into exceptions if the language "
33757 #: ../src/guestfs.pod:705
33759 "We don't try to \"object orientify\" parts of the API in OO languages, "
33760 "although contributors are welcome to write higher level APIs above what we "
33761 "provide in their favourite languages if they wish."
33765 #: ../src/guestfs.pod:711
33770 #: ../src/guestfs.pod:713
33772 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
33773 "identical to the C API. C++ classes and exceptions are not used."
33777 #: ../src/guestfs.pod:717
33782 #: ../src/guestfs.pod:719
33784 "The C# bindings are highly experimental. Please read the warnings at the "
33785 "top of C<csharp/Libguestfs.cs>."
33789 #: ../src/guestfs.pod:722
33794 #: ../src/guestfs.pod:724
33795 msgid "See L<guestfs-erlang(3)>."
33799 #: ../src/guestfs.pod:726
33804 #: ../src/guestfs.pod:728
33806 "This is the only language binding that is working but incomplete. Only "
33807 "calls which return simple integers have been bound in Haskell, and we are "
33808 "looking for help to complete this binding."
33812 #: ../src/guestfs.pod:732
33817 #: ../src/guestfs.pod:734
33819 "Full documentation is contained in the Javadoc which is distributed with "
33820 "libguestfs. For examples, see L<guestfs-java(3)>."
33824 #: ../src/guestfs.pod:737
33829 #: ../src/guestfs.pod:739
33830 msgid "See L<guestfs-ocaml(3)>."
33834 #: ../src/guestfs.pod:741
33839 #: ../src/guestfs.pod:743
33840 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
33844 #: ../src/guestfs.pod:745
33849 #: ../src/guestfs.pod:747
33851 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
33852 "the php-libguestfs package for your distribution."
33856 #: ../src/guestfs.pod:750
33857 msgid "The PHP binding only works correctly on 64 bit machines."
33861 #: ../src/guestfs.pod:752
33866 #: ../src/guestfs.pod:754
33867 msgid "See L<guestfs-python(3)>."
33871 #: ../src/guestfs.pod:756
33876 #: ../src/guestfs.pod:758
33877 msgid "See L<guestfs-ruby(3)>."
33881 #: ../src/guestfs.pod:760
33882 msgid "B<shell scripts>"
33886 #: ../src/guestfs.pod:762
33887 msgid "See L<guestfish(1)>."
33891 #: ../src/guestfs.pod:766
33892 msgid "LIBGUESTFS GOTCHAS"
33896 #: ../src/guestfs.pod:768
33898 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
33899 "system [...] that works in the way it is documented but is counterintuitive "
33900 "and almost invites mistakes.\""
33904 #: ../src/guestfs.pod:772
33906 "Since we developed libguestfs and the associated tools, there are several "
33907 "things we would have designed differently, but are now stuck with for "
33908 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
33909 "release, you can expect these to change. Beware of them."
33913 #: ../src/guestfs.pod:780
33914 msgid "Autosync / forgetting to sync."
33918 #: ../src/guestfs.pod:782
33920 "I<Update:> Autosync is enabled by default for all API users starting from "
33921 "libguestfs 1.5.24. This section only applies to older versions."
33925 #: ../src/guestfs.pod:785
33927 "When modifying a filesystem from C or another language, you B<must> unmount "
33928 "all filesystems and call L</guestfs_sync> explicitly before you close the "
33929 "libguestfs handle. You can also call:"
33933 #: ../src/guestfs.pod:789
33936 " guestfs_set_autosync (g, 1);\n"
33941 #: ../src/guestfs.pod:791
33943 "to have the unmount/sync done automatically for you when the handle 'g' is "
33944 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
33949 #: ../src/guestfs.pod:795
33951 "If you forget to do this, then it is entirely possible that your changes "
33952 "won't be written out, or will be partially written, or (very rarely) that "
33953 "you'll get disk corruption."
33957 #: ../src/guestfs.pod:799
33959 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
33960 "guestfish scripts that forget to sync will work just fine, which can make "
33961 "this very puzzling if you are trying to debug a problem."
33965 #: ../src/guestfs.pod:803
33966 msgid "Mount option C<-o sync> should not be the default."
33970 #: ../src/guestfs.pod:805
33972 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
33973 "libguestfs 1.13.16. This section only applies to older versions."
33977 #: ../src/guestfs.pod:808
33979 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
33980 "However C<-o sync> does not add any reliability benefit, but does have a "
33981 "very large performance impact."
33985 #: ../src/guestfs.pod:812
33987 "The work around is to use L</guestfs_mount_options> and set the mount "
33988 "options that you actually want to use."
33992 #: ../src/guestfs.pod:815
33993 msgid "Read-only should be the default."
33997 #: ../src/guestfs.pod:817
33999 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34000 "specify I<--rw> if you want to make changes to the image."
34004 #: ../src/guestfs.pod:820
34005 msgid "This would reduce the potential to corrupt live VM images."
34009 #: ../src/guestfs.pod:822
34011 "Note that many filesystems change the disk when you just mount and unmount, "
34012 "even if you didn't perform any writes. You need to use "
34013 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
34017 #: ../src/guestfs.pod:826
34018 msgid "guestfish command line is hard to use."
34022 #: ../src/guestfs.pod:828
34024 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34025 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34026 "exist, so it fails. In earlier versions of guestfish the error message was "
34027 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34028 "we should have used C<guestfish -c command> to run commands."
34032 #: ../src/guestfs.pod:835
34033 msgid "guestfish megabyte modifiers don't work right on all commands"
34037 #: ../src/guestfs.pod:837
34039 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34040 "other modifiers). What guestfish actually does is to multiply the number "
34041 "part by the modifier part and pass the result to the C API. However this "
34042 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34043 "expecting some other unit (eg. megabytes)."
34047 #: ../src/guestfs.pod:844
34048 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34052 #: ../src/guestfs.pod:846
34055 " lvcreate LV VG 100M\n"
34060 #: ../src/guestfs.pod:848
34062 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34063 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34064 "megabytes * megabytes) logical volume. The error message you get from this "
34065 "is also a little obscure."
34069 #: ../src/guestfs.pod:853
34071 "This could be fixed in the generator by specially marking parameters and "
34072 "return values which take bytes or other units."
34076 #: ../src/guestfs.pod:856
34077 msgid "Ambiguity between devices and paths"
34081 #: ../src/guestfs.pod:858
34083 "There is a subtle ambiguity in the API between a device name "
34084 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
34085 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34089 #: ../src/guestfs.pod:863
34091 "In the current API we usually resolve this ambiguity by having two separate "
34092 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34093 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34094 "detecting if the path supplied begins with C</dev/>."
34098 #: ../src/guestfs.pod:869
34100 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34101 "make paths/devices into structured names. One way to do this would be to "
34102 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34103 "aspect of grub. Another way would be to use a structured type, equivalent "
34104 "to this OCaml type:"
34108 #: ../src/guestfs.pod:875
34111 " type path = Path of string | Device of int | Partition of int * int\n"
34116 #: ../src/guestfs.pod:877
34117 msgid "which would allow you to pass arguments like:"
34121 #: ../src/guestfs.pod:879
34124 " Path \"/foo/bar\"\n"
34125 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34126 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34127 " Path \"/dev/sdb2\" (* not a device *)\n"
34132 #: ../src/guestfs.pod:884
34134 "As you can see there are still problems to resolve even with this "
34135 "representation. Also consider how it might work in guestfish."
34139 #: ../src/guestfs.pod:889
34140 msgid "KEYS AND PASSPHRASES"
34144 #: ../src/guestfs.pod:891
34146 "Certain libguestfs calls take a parameter that contains sensitive key "
34147 "material, passed in as a C string."
34151 #: ../src/guestfs.pod:894
34153 "In the future we would hope to change the libguestfs implementation so that "
34154 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34155 "swap. However this is I<not> done at the moment, because of the complexity "
34156 "of such an implementation."
34160 #: ../src/guestfs.pod:899
34162 "Therefore you should be aware that any key parameter you pass to libguestfs "
34163 "might end up being written out to the swap partition. If this is a concern, "
34164 "scrub the swap partition or don't use libguestfs on encrypted devices."
34168 #: ../src/guestfs.pod:904
34169 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34173 #: ../src/guestfs.pod:906
34175 "All high-level libguestfs actions are synchronous. If you want to use "
34176 "libguestfs asynchronously then you must create a thread."
34180 #: ../src/guestfs.pod:909
34182 "Only use the handle from a single thread. Either use the handle exclusively "
34183 "from one thread, or provide your own mutex so that two threads cannot issue "
34184 "calls on the same handle at the same time."
34188 #: ../src/guestfs.pod:913
34190 "See the graphical program guestfs-browser for one possible architecture for "
34191 "multithreaded programs using libvirt and libguestfs."
34195 #: ../src/guestfs.pod:916
34200 #: ../src/guestfs.pod:918
34202 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34207 #: ../src/guestfs.pod:921
34209 "By default it looks for these in the directory C<$libdir/guestfs> "
34210 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34214 #: ../src/guestfs.pod:924
34216 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34217 "to change the directories that libguestfs will search in. The value is a "
34218 "colon-separated list of paths. The current directory is I<not> searched "
34219 "unless the path contains an empty element or C<.>. For example "
34220 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34221 "then C</usr/lib/guestfs>."
34225 #: ../src/guestfs.pod:931
34226 msgid "QEMU WRAPPERS"
34230 #: ../src/guestfs.pod:933
34232 "If you want to compile your own qemu, run qemu from a non-standard location, "
34233 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
34238 #: ../src/guestfs.pod:937
34240 "There is one important rule to remember: you I<must C<exec qemu>> as the "
34241 "last command in the shell script (so that qemu replaces the shell and "
34242 "becomes the direct child of the libguestfs-using program). If you don't do "
34243 "this, then the qemu process won't be cleaned up correctly."
34247 #: ../src/guestfs.pod:942
34249 "Here is an example of a wrapper, where I have built my own copy of qemu from "
34254 #: ../src/guestfs.pod:945
34258 " qemudir=/home/rjones/d/qemu\n"
34259 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
34265 #: ../src/guestfs.pod:949
34267 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
34268 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
34273 #: ../src/guestfs.pod:953
34276 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
34281 #: ../src/guestfs.pod:955
34283 "Note that libguestfs also calls qemu with the -help and -version options in "
34284 "order to determine features."
34288 #: ../src/guestfs.pod:958
34290 "Wrappers can also be used to edit the options passed to qemu. In the "
34291 "following example, the C<-machine ...> option (C<-machine> and the following "
34292 "argument) are removed from the command line and replaced with C<-machine "
34293 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
34294 "right one to remove, putting the remaining options into the C<args> array."
34298 #: ../src/guestfs.pod:967
34302 " while [ $# -gt 0 ]; do\n"
34303 " case \"$1\" in\n"
34307 " args[i]=\"$1\"\n"
34316 #: ../src/guestfs.pod:979
34319 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
34324 #: ../src/guestfs.pod:981
34325 msgid "ATTACHING TO RUNNING DAEMONS"
34329 #: ../src/guestfs.pod:983
34331 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
34332 "babies. Use with caution."
34336 #: ../src/guestfs.pod:986
34338 "I<Note (2):> This section explains how to attach to a running daemon from a "
34339 "low level perspective. For most users, simply using virt tools such as "
34340 "L<guestfish(1)> with the I<--live> option will \"just work\"."
34344 #: ../src/guestfs.pod:990
34345 msgid "Using guestfs_set_attach_method"
34349 #: ../src/guestfs.pod:992
34351 "By calling L</guestfs_set_attach_method> you can change how the library "
34352 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
34353 "L</ARCHITECTURE> for some background)."
34357 #: ../src/guestfs.pod:996
34359 "The normal attach method is C<appliance>, where a small appliance is created "
34360 "containing the daemon, and then the library connects to this."
34364 #: ../src/guestfs.pod:999
34366 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
34367 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
34368 "daemon over the Unix domain socket."
34372 #: ../src/guestfs.pod:1003
34374 "The normal use for this is to connect to a running virtual machine that "
34375 "contains a C<guestfsd> daemon, and send commands so you can read and write "
34376 "files inside the live virtual machine."
34380 #: ../src/guestfs.pod:1007
34381 msgid "Using guestfs_add_domain with live flag"
34385 #: ../src/guestfs.pod:1009
34387 "L</guestfs_add_domain> provides some help for getting the correct attach "
34388 "method. If you pass the C<live> option to this function, then (if the "
34389 "virtual machine is running) it will examine the libvirt XML looking for a "
34390 "virtio-serial channel to connect to:"
34394 #: ../src/guestfs.pod:1015
34401 " <channel type='unix'>\n"
34402 " <source mode='bind' path='/path/to/socket'/>\n"
34403 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
34412 #: ../src/guestfs.pod:1027
34414 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
34415 "method to C<unix:/path/to/socket>."
34419 #: ../src/guestfs.pod:1030
34421 "Some of the libguestfs tools (including guestfish) support a I<--live> "
34422 "option which is passed through to L</guestfs_add_domain> thus allowing you "
34423 "to attach to and modify live virtual machines."
34427 #: ../src/guestfs.pod:1034
34429 "The virtual machine needs to have been set up beforehand so that it has the "
34430 "virtio-serial channel and so that guestfsd is running inside it."
34434 #: ../src/guestfs.pod:1038
34435 msgid "ABI GUARANTEE"
34439 #: ../src/guestfs.pod:1040
34441 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
34442 "actions as outlined in this section. Although we will deprecate some "
34443 "actions, for example if they get replaced by newer calls, we will keep the "
34444 "old actions forever. This allows you the developer to program in confidence "
34445 "against the libguestfs API."
34449 #: ../src/guestfs.pod:1046
34450 msgid "BLOCK DEVICE NAMING"
34454 #: ../src/guestfs.pod:1048
34456 "In the kernel there is now quite a profusion of schemata for naming block "
34457 "devices (in this context, by I<block device> I mean a physical or virtual "
34458 "hard drive). The original Linux IDE driver used names starting with "
34459 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
34460 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
34461 "replacement for the old IDE driver (particularly for SATA devices) those "
34462 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
34463 "machines with paravirtualized drivers. This has created several different "
34464 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
34469 #: ../src/guestfs.pod:1060
34471 "As discussed above, libguestfs uses a qemu appliance running an embedded "
34472 "Linux kernel to access block devices. We can run a variety of appliances "
34473 "based on a variety of Linux kernels."
34477 #: ../src/guestfs.pod:1064
34479 "This causes a problem for libguestfs because many API calls use device or "
34480 "partition names. Working scripts and the recipe (example) scripts that we "
34481 "make available over the internet could fail if the naming scheme changes."
34485 #: ../src/guestfs.pod:1069
34487 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
34488 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
34489 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
34490 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
34494 #: ../src/guestfs.pod:1075
34496 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
34497 "L</guestfs_list_partitions> and similar calls return the true names of the "
34498 "devices and partitions as known to the appliance."
34502 #: ../src/guestfs.pod:1080
34503 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
34507 #: ../src/guestfs.pod:1082
34509 "Usually this translation is transparent. However in some (very rare) cases "
34510 "you may need to know the exact algorithm. Such cases include where you use "
34511 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
34512 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
34517 #: ../src/guestfs.pod:1088
34519 "The algorithm is applied only to I<parameters> which are known to be either "
34520 "device or partition names. Return values from functions such as "
34521 "L</guestfs_list_devices> are never changed."
34525 #: ../src/guestfs.pod:1096
34526 msgid "Is the string a parameter which is a device or partition name?"
34530 #: ../src/guestfs.pod:1100
34531 msgid "Does the string begin with C</dev/sd>?"
34535 #: ../src/guestfs.pod:1104
34537 "Does the named device exist? If so, we use that device. However if I<not> "
34538 "then we continue with this algorithm."
34542 #: ../src/guestfs.pod:1109
34543 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
34547 #: ../src/guestfs.pod:1111
34548 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
34552 #: ../src/guestfs.pod:1113
34553 msgid "If that named device exists, use it. If not, continue."
34557 #: ../src/guestfs.pod:1117
34558 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
34562 #: ../src/guestfs.pod:1119
34563 msgid "If that named device exists, use it. If not, return an error."
34567 #: ../src/guestfs.pod:1123
34568 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
34572 #: ../src/guestfs.pod:1125
34574 "Although the standard naming scheme and automatic translation is useful for "
34575 "simple programs and guestfish scripts, for larger programs it is best not to "
34576 "rely on this mechanism."
34580 #: ../src/guestfs.pod:1129
34582 "Where possible for maximum future portability programs using libguestfs "
34583 "should use these future-proof techniques:"
34587 #: ../src/guestfs.pod:1136
34589 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
34590 "device names, and then use those names directly."
34594 #: ../src/guestfs.pod:1139
34595 msgid "Since those device names exist by definition, they will never be translated."
34599 #: ../src/guestfs.pod:1144
34601 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
34602 "filesystem labels."
34606 #: ../src/guestfs.pod:1151
34608 "This section discusses security implications of using libguestfs, "
34609 "particularly with untrusted or malicious guests or disk images."
34613 #: ../src/guestfs.pod:1154
34614 msgid "GENERAL SECURITY CONSIDERATIONS"
34618 #: ../src/guestfs.pod:1156
34620 "Be careful with any files or data that you download from a guest (by "
34621 "\"download\" we mean not just the L</guestfs_download> command but any "
34622 "command that reads files, filenames, directories or anything else from a "
34623 "disk image). An attacker could manipulate the data to fool your program "
34624 "into doing the wrong thing. Consider cases such as:"
34628 #: ../src/guestfs.pod:1166
34629 msgid "the data (file etc) not being present"
34633 #: ../src/guestfs.pod:1170
34634 msgid "being present but empty"
34638 #: ../src/guestfs.pod:1174
34639 msgid "being much larger than normal"
34643 #: ../src/guestfs.pod:1178
34644 msgid "containing arbitrary 8 bit data"
34648 #: ../src/guestfs.pod:1182
34649 msgid "being in an unexpected character encoding"
34653 #: ../src/guestfs.pod:1186
34654 msgid "containing homoglyphs."
34658 #: ../src/guestfs.pod:1190
34659 msgid "SECURITY OF MOUNTING FILESYSTEMS"
34663 #: ../src/guestfs.pod:1192
34665 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
34666 "(VFS) module can sometimes be escalated into exploits by deliberately "
34667 "creating a malicious, malformed filesystem. These exploits are very severe "
34668 "for two reasons. Firstly there are very many filesystem drivers in the "
34669 "kernel, and many of them are infrequently used and not much developer "
34670 "attention has been paid to the code. Linux userspace helps potential "
34671 "crackers by detecting the filesystem type and automatically choosing the "
34672 "right VFS driver, even if that filesystem type is obscure or unexpected for "
34673 "the administrator. Secondly, a kernel-level exploit is like a local root "
34674 "exploit (worse in some ways), giving immediate and total access to the "
34675 "system right down to the hardware level."
34679 #: ../src/guestfs.pod:1205
34681 "That explains why you should never mount a filesystem from an untrusted "
34682 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
34683 "inside a qemu virtual machine, usually running as a non-root user. The "
34684 "attacker would need to write a filesystem which first exploited the kernel, "
34685 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
34686 "the libguestfs protocol, and finally to be as serious as the host kernel "
34687 "exploit it would need to escalate its privileges to root. This multi-step "
34688 "escalation, performed by a static piece of data, is thought to be extremely "
34689 "hard to do, although we never say 'never' about security issues."
34693 #: ../src/guestfs.pod:1216
34695 "In any case callers can reduce the attack surface by forcing the filesystem "
34696 "type when mounting (use L</guestfs_mount_vfs>)."
34700 #: ../src/guestfs.pod:1219
34701 msgid "PROTOCOL SECURITY"
34705 #: ../src/guestfs.pod:1221
34707 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
34708 "defined upper message size. However a program that uses libguestfs must "
34709 "also take care - for example you can write a program that downloads a binary "
34710 "from a disk image and executes it locally, and no amount of protocol "
34711 "security will save you from the consequences."
34715 #: ../src/guestfs.pod:1227
34716 msgid "INSPECTION SECURITY"
34720 #: ../src/guestfs.pod:1229
34722 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
34723 "directly from the guest, and these could contain any 8 bit data. Callers "
34724 "should be careful to escape these before printing them to a structured file "
34725 "(for example, use HTML escaping if creating a web page)."
34729 #: ../src/guestfs.pod:1235
34731 "Guest configuration may be altered in unusual ways by the administrator of "
34732 "the virtual machine, and may not reflect reality (particularly for untrusted "
34733 "or actively malicious guests). For example we parse the hostname from "
34734 "configuration files like C</etc/sysconfig/network> that we find in the "
34735 "guest, but the guest administrator can easily manipulate these files to "
34736 "provide the wrong hostname."
34740 #: ../src/guestfs.pod:1243
34742 "The inspection API parses guest configuration using two external libraries: "
34743 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
34744 "designed to be robust in the face of malicious data, although denial of "
34745 "service attacks are still possible, for example with oversized configuration "
34750 #: ../src/guestfs.pod:1249
34751 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
34755 #: ../src/guestfs.pod:1251
34757 "Be very cautious about running commands from the guest. By running a "
34758 "command in the guest, you are giving CPU time to a binary that you do not "
34759 "control, under the same user account as the library, albeit wrapped in qemu "
34760 "virtualization. More information and alternatives can be found in the "
34761 "section L</RUNNING COMMANDS>."
34765 #: ../src/guestfs.pod:1257
34766 msgid "CVE-2010-3851"
34770 #: ../src/guestfs.pod:1259
34771 msgid "https://bugzilla.redhat.com/642934"
34775 #: ../src/guestfs.pod:1261
34777 "This security bug concerns the automatic disk format detection that qemu "
34778 "does on disk images."
34782 #: ../src/guestfs.pod:1264
34784 "A raw disk image is just the raw bytes, there is no header. Other disk "
34785 "images like qcow2 contain a special header. Qemu deals with this by looking "
34786 "for one of the known headers, and if none is found then assuming the disk "
34787 "image must be raw."
34791 #: ../src/guestfs.pod:1269
34793 "This allows a guest which has been given a raw disk image to write some "
34794 "other header. At next boot (or when the disk image is accessed by "
34795 "libguestfs) qemu would do autodetection and think the disk image format was, "
34796 "say, qcow2 based on the header written by the guest."
34800 #: ../src/guestfs.pod:1274
34802 "This in itself would not be a problem, but qcow2 offers many features, one "
34803 "of which is to allow a disk image to refer to another image (called the "
34804 "\"backing disk\"). It does this by placing the path to the backing disk "
34805 "into the qcow2 header. This path is not validated and could point to any "
34806 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
34807 "\"holes\" in the qcow2 disk image, which of course is completely under the "
34808 "control of the attacker."
34812 #: ../src/guestfs.pod:1282
34813 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
34817 #: ../src/guestfs.pod:1289
34818 msgid "You have enabled the network or have opened the disk in write mode."
34822 #: ../src/guestfs.pod:1293
34824 "You are also running untrusted code from the guest (see L</RUNNING "
34829 #: ../src/guestfs.pod:1298
34831 "The way to avoid this is to specify the expected disk format when adding "
34832 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
34833 "should always do this if the disk is raw format, and it's a good idea for "
34838 #: ../src/guestfs.pod:1303
34840 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
34841 "format is fetched from libvirt and passed through."
34845 #: ../src/guestfs.pod:1306
34847 "For libguestfs tools, use the I<--format> command line parameter as "
34852 #: ../src/guestfs.pod:1309
34853 msgid "CONNECTION MANAGEMENT"
34857 #: ../src/guestfs.pod:1311
34858 msgid "guestfs_h *"
34862 #: ../src/guestfs.pod:1313
34864 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
34865 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
34866 "handle and release all resources used."
34870 #: ../src/guestfs.pod:1317
34872 "For information on using multiple handles and threads, see the section "
34873 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
34877 #: ../src/guestfs.pod:1320
34878 msgid "guestfs_create"
34882 #: ../src/guestfs.pod:1322
34885 " guestfs_h *guestfs_create (void);\n"
34890 #: ../src/guestfs.pod:1324
34891 msgid "Create a connection handle."
34895 #: ../src/guestfs.pod:1326
34897 "On success this returns a non-NULL pointer to a handle. On error it returns "
34902 #: ../src/guestfs.pod:1329
34904 "You have to \"configure\" the handle after creating it. This includes "
34905 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
34906 "handle at least once."
34910 #: ../src/guestfs.pod:1333
34911 msgid "After configuring the handle, you have to call L</guestfs_launch>."
34915 #: ../src/guestfs.pod:1335
34917 "You may also want to configure error handling for the handle. See the "
34918 "L</ERROR HANDLING> section below."
34922 #: ../src/guestfs.pod:1338
34923 msgid "guestfs_close"
34927 #: ../src/guestfs.pod:1340
34930 " void guestfs_close (guestfs_h *g);\n"
34935 #: ../src/guestfs.pod:1342
34936 msgid "This closes the connection handle and frees up all resources used."
34940 #: ../src/guestfs.pod:1344
34942 "If autosync was set on the handle and the handle was launched, then this "
34943 "implicitly calls various functions to unmount filesystems and sync the "
34944 "disk. See L</guestfs_set_autosync> for more details."
34948 #: ../src/guestfs.pod:1348
34949 msgid "If a close callback was set on the handle, then it is called."
34953 #: ../src/guestfs.pod:1350
34954 msgid "ERROR HANDLING"
34958 #: ../src/guestfs.pod:1352
34960 "API functions can return errors. For example, almost all functions that "
34961 "return C<int> will return C<-1> to indicate an error."
34965 #: ../src/guestfs.pod:1355
34967 "Additional information is available for errors: an error message string and "
34968 "optionally an error number (errno) if the thing that failed was a system "
34973 #: ../src/guestfs.pod:1359
34975 "You can get at the additional information about the last error on the handle "
34976 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
34977 "up an error handler with L</guestfs_set_error_handler>."
34981 #: ../src/guestfs.pod:1364
34983 "When the handle is created, a default error handler is installed which "
34984 "prints the error message string to C<stderr>. For small short-running "
34985 "command line programs it is sufficient to do:"
34989 #: ../src/guestfs.pod:1368
34992 " if (guestfs_launch (g) == -1)\n"
34993 " exit (EXIT_FAILURE);\n"
34998 #: ../src/guestfs.pod:1371
35000 "since the default error handler will ensure that an error message has been "
35001 "printed to C<stderr> before the program exits."
35005 #: ../src/guestfs.pod:1374
35007 "For other programs the caller will almost certainly want to install an "
35008 "alternate error handler or do error handling in-line like this:"
35012 #: ../src/guestfs.pod:1377
35015 " /* This disables the default behaviour of printing errors\n"
35017 " guestfs_set_error_handler (g, NULL, NULL);\n"
35022 #: ../src/guestfs.pod:1381
35025 " if (guestfs_launch (g) == -1) {\n"
35026 " /* Examine the error message and print it etc. */\n"
35027 " char *msg = guestfs_last_error (g);\n"
35028 " int errnum = guestfs_last_errno (g);\n"
35029 " fprintf (stderr, \"%s\", msg);\n"
35030 " if (errnum != 0)\n"
35031 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35032 " fprintf (stderr, \"\\n\");\n"
35039 #: ../src/guestfs.pod:1392
35041 "Out of memory errors are handled differently. The default action is to call "
35042 "L<abort(3)>. If this is undesirable, then you can set a handler using "
35043 "L</guestfs_set_out_of_memory_handler>."
35047 #: ../src/guestfs.pod:1396
35049 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35050 "because there is no handle if this happens there is no way to get additional "
35051 "error information. However L</guestfs_create> is supposed to be a "
35052 "lightweight operation which can only fail because of insufficient memory (it "
35053 "returns NULL in this case)."
35057 #: ../src/guestfs.pod:1402
35058 msgid "guestfs_last_error"
35062 #: ../src/guestfs.pod:1404
35065 " const char *guestfs_last_error (guestfs_h *g);\n"
35070 #: ../src/guestfs.pod:1406
35072 "This returns the last error message that happened on C<g>. If there has not "
35073 "been an error since the handle was created, then this returns C<NULL>."
35077 #: ../src/guestfs.pod:1410
35079 "The lifetime of the returned string is until the next error occurs, or "
35080 "L</guestfs_close> is called."
35084 #: ../src/guestfs.pod:1413
35085 msgid "guestfs_last_errno"
35089 #: ../src/guestfs.pod:1415
35092 " int guestfs_last_errno (guestfs_h *g);\n"
35097 #: ../src/guestfs.pod:1417
35098 msgid "This returns the last error number (errno) that happened on C<g>."
35102 #: ../src/guestfs.pod:1419
35103 msgid "If successful, an errno integer not equal to zero is returned."
35107 #: ../src/guestfs.pod:1421
35108 msgid "If no error, this returns 0. This call can return 0 in three situations:"
35112 #: ../src/guestfs.pod:1428
35113 msgid "There has not been any error on the handle."
35117 #: ../src/guestfs.pod:1432
35119 "There has been an error but the errno was meaningless. This corresponds to "
35120 "the case where the error did not come from a failed system call, but for "
35121 "some other reason."
35125 #: ../src/guestfs.pod:1438
35127 "There was an error from a failed system call, but for some reason the errno "
35128 "was not captured and returned. This usually indicates a bug in libguestfs."
35132 #: ../src/guestfs.pod:1444
35134 "Libguestfs tries to convert the errno from inside the applicance into a "
35135 "corresponding errno for the caller (not entirely trivial: the appliance "
35136 "might be running a completely different operating system from the library "
35137 "and error numbers are not standardized across Un*xen). If this could not be "
35138 "done, then the error is translated to C<EINVAL>. In practice this should "
35139 "only happen in very rare circumstances."
35143 #: ../src/guestfs.pod:1452
35144 msgid "guestfs_set_error_handler"
35148 #: ../src/guestfs.pod:1454
35151 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35153 " const char *msg);\n"
35154 " void guestfs_set_error_handler (guestfs_h *g,\n"
35155 " guestfs_error_handler_cb cb,\n"
35156 " void *opaque);\n"
35161 #: ../src/guestfs.pod:1461
35163 "The callback C<cb> will be called if there is an error. The parameters "
35164 "passed to the callback are an opaque data pointer and the error message "
35169 #: ../src/guestfs.pod:1465
35171 "C<errno> is not passed to the callback. To get that the callback must call "
35172 "L</guestfs_last_errno>."
35176 #: ../src/guestfs.pod:1468
35178 "Note that the message string C<msg> is freed as soon as the callback "
35179 "function returns, so if you want to stash it somewhere you must make your "
35184 #: ../src/guestfs.pod:1472
35185 msgid "The default handler prints messages on C<stderr>."
35189 #: ../src/guestfs.pod:1474
35190 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35194 #: ../src/guestfs.pod:1476
35195 msgid "guestfs_get_error_handler"
35199 #: ../src/guestfs.pod:1478
35202 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35203 " void **opaque_rtn);\n"
35208 #: ../src/guestfs.pod:1481
35209 msgid "Returns the current error handler callback."
35213 #: ../src/guestfs.pod:1483
35214 msgid "guestfs_set_out_of_memory_handler"
35218 #: ../src/guestfs.pod:1485
35221 " typedef void (*guestfs_abort_cb) (void);\n"
35222 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35223 " guestfs_abort_cb);\n"
35228 #: ../src/guestfs.pod:1489
35230 "The callback C<cb> will be called if there is an out of memory situation. "
35231 "I<Note this callback must not return>."
35235 #: ../src/guestfs.pod:1492
35236 msgid "The default is to call L<abort(3)>."
35240 #: ../src/guestfs.pod:1494
35241 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
35245 #: ../src/guestfs.pod:1497
35246 msgid "guestfs_get_out_of_memory_handler"
35250 #: ../src/guestfs.pod:1499
35253 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
35258 #: ../src/guestfs.pod:1501
35259 msgid "This returns the current out of memory handler."
35263 #: ../src/guestfs.pod:1503
35268 #: ../src/guestfs.pod:1507
35273 #: ../src/guestfs.pod:1509
35278 #: ../src/guestfs.pod:1511
35279 msgid "AVAILABILITY"
35283 #: ../src/guestfs.pod:1513
35284 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
35288 #: ../src/guestfs.pod:1515
35290 "Using L</guestfs_available> you can test availability of the following "
35291 "groups of functions. This test queries the appliance to see if the "
35292 "appliance you are currently using supports the functionality."
35296 #: ../src/guestfs.pod:1520
35297 msgid "@AVAILABILITY@"
35301 #: ../src/guestfs.pod:1522
35302 msgid "GUESTFISH supported COMMAND"
35306 #: ../src/guestfs.pod:1524
35308 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
35309 "prints out the available groups and whether they are supported by this build "
35310 "of libguestfs. Note however that you have to do C<run> first."
35314 #: ../src/guestfs.pod:1529
35315 msgid "SINGLE CALLS AT COMPILE TIME"
35319 #: ../src/guestfs.pod:1531
35321 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
35322 "function, such as:"
35326 #: ../src/guestfs.pod:1534
35329 " #define LIBGUESTFS_HAVE_DD 1\n"
35334 #: ../src/guestfs.pod:1536
35335 msgid "if L</guestfs_dd> is available."
35339 #: ../src/guestfs.pod:1538
35341 "Before version 1.5.8, if you needed to test whether a single libguestfs "
35342 "function is available at compile time, we recommended using build tools such "
35343 "as autoconf or cmake. For example in autotools you could use:"
35347 #: ../src/guestfs.pod:1543
35350 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
35351 " AC_CHECK_FUNCS([guestfs_dd])\n"
35356 #: ../src/guestfs.pod:1546
35358 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
35363 #: ../src/guestfs.pod:1549
35364 msgid "SINGLE CALLS AT RUN TIME"
35368 #: ../src/guestfs.pod:1551
35370 "Testing at compile time doesn't guarantee that a function really exists in "
35371 "the library. The reason is that you might be dynamically linked against a "
35372 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
35373 "This situation unfortunately results in a segmentation fault, which is a "
35374 "shortcoming of the C dynamic linking system itself."
35378 #: ../src/guestfs.pod:1558
35380 "You can use L<dlopen(3)> to test if a function is available at run time, as "
35381 "in this example program (note that you still need the compile time check as "
35386 #: ../src/guestfs.pod:1562
35389 " #include <stdio.h>\n"
35390 " #include <stdlib.h>\n"
35391 " #include <unistd.h>\n"
35392 " #include <dlfcn.h>\n"
35393 " #include <guestfs.h>\n"
35398 #: ../src/guestfs.pod:1568
35403 " #ifdef LIBGUESTFS_HAVE_DD\n"
35405 " int has_function;\n"
35410 #: ../src/guestfs.pod:1574
35413 " /* Test if the function guestfs_dd is really available. */\n"
35414 " dl = dlopen (NULL, RTLD_LAZY);\n"
35416 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
35417 " exit (EXIT_FAILURE);\n"
35419 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
35425 #: ../src/guestfs.pod:1583
35428 " if (!has_function)\n"
35429 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
35431 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
35432 " /* Now it's safe to call\n"
35433 " guestfs_dd (g, \"foo\", \"bar\");\n"
35437 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
35444 #: ../src/guestfs.pod:1596
35446 "You may think the above is an awful lot of hassle, and it is. There are "
35447 "other ways outside of the C linking system to ensure that this kind of "
35448 "incompatibility never arises, such as using package versioning:"
35452 #: ../src/guestfs.pod:1601
35455 " Requires: libguestfs >= 1.0.80\n"
35460 #: ../src/guestfs.pod:1603
35461 msgid "CALLS WITH OPTIONAL ARGUMENTS"
35465 #: ../src/guestfs.pod:1605
35467 "A recent feature of the API is the introduction of calls which take optional "
35468 "arguments. In C these are declared 3 ways. The main way is as a call which "
35469 "takes variable arguments (ie. C<...>), as in this example:"
35473 #: ../src/guestfs.pod:1610
35476 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
35481 #: ../src/guestfs.pod:1612
35483 "Call this with a list of optional arguments, terminated by C<-1>. So to "
35484 "call with no optional arguments specified:"
35488 #: ../src/guestfs.pod:1615
35491 " guestfs_add_drive_opts (g, filename, -1);\n"
35496 #: ../src/guestfs.pod:1617
35497 msgid "With a single optional argument:"
35501 #: ../src/guestfs.pod:1619
35504 " guestfs_add_drive_opts (g, filename,\n"
35505 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35511 #: ../src/guestfs.pod:1623
35516 #: ../src/guestfs.pod:1625
35519 " guestfs_add_drive_opts (g, filename,\n"
35520 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35521 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35527 #: ../src/guestfs.pod:1630
35529 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
35534 #: ../src/guestfs.pod:1633
35535 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
35539 #: ../src/guestfs.pod:1635
35541 "The second variant has the same name with the suffix C<_va>, which works the "
35542 "same way but takes a C<va_list>. See the C manual for details. For the "
35543 "example function, this is declared:"
35547 #: ../src/guestfs.pod:1639
35550 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
35551 " va_list args);\n"
35556 #: ../src/guestfs.pod:1642
35557 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
35561 #: ../src/guestfs.pod:1644
35563 "The third variant is useful where you need to construct these calls. You "
35564 "pass in a structure where you fill in the optional fields. The structure "
35565 "has a bitmask as the first element which you must set to indicate which "
35566 "fields you have filled in. For our example function the structure and call "
35571 #: ../src/guestfs.pod:1650
35574 " struct guestfs_add_drive_opts_argv {\n"
35575 " uint64_t bitmask;\n"
35577 " const char *format;\n"
35580 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
35581 " const struct guestfs_add_drive_opts_argv *optargs);\n"
35586 #: ../src/guestfs.pod:1659
35587 msgid "You could call it like this:"
35591 #: ../src/guestfs.pod:1661
35594 " struct guestfs_add_drive_opts_argv optargs = {\n"
35595 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
35596 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
35597 " .readonly = 1,\n"
35598 " .format = \"qcow2\"\n"
35604 #: ../src/guestfs.pod:1668
35607 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
35612 #: ../src/guestfs.pod:1676
35613 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
35617 #: ../src/guestfs.pod:1681
35618 msgid "You do not need to fill in all fields of the structure."
35622 #: ../src/guestfs.pod:1685
35624 "There must be a one-to-one correspondence between fields of the structure "
35625 "that are filled in, and bits set in the bitmask."
35629 #: ../src/guestfs.pod:1690
35630 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
35634 #: ../src/guestfs.pod:1692
35636 "In other languages, optional arguments are expressed in the way that is "
35637 "natural for that language. We refer you to the language-specific "
35638 "documentation for more details on that."
35642 #: ../src/guestfs.pod:1696
35643 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
35647 #: ../src/guestfs.pod:1698
35648 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
35652 #: ../src/guestfs.pod:1700
35654 "B<Note:> This section documents the generic event mechanism introduced in "
35655 "libguestfs 1.10, which you should use in new code if possible. The old "
35656 "functions C<guestfs_set_log_message_callback>, "
35657 "C<guestfs_set_subprocess_quit_callback>, "
35658 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
35659 "C<guestfs_set_progress_callback> are no longer documented in this manual "
35660 "page. Because of the ABI guarantee, the old functions continue to work."
35664 #: ../src/guestfs.pod:1709
35666 "Handles generate events when certain things happen, such as log messages "
35667 "being generated, progress messages during long-running operations, or the "
35668 "handle being closed. The API calls described below let you register a "
35669 "callback to be called when events happen. You can register multiple "
35670 "callbacks (for the same, different or overlapping sets of events), and "
35671 "individually remove callbacks. If callbacks are not removed, then they "
35672 "remain in force until the handle is closed."
35676 #: ../src/guestfs.pod:1717
35678 "In the current implementation, events are only generated synchronously: that "
35679 "means that events (and hence callbacks) can only happen while you are in the "
35680 "middle of making another libguestfs call. The callback is called in the "
35685 #: ../src/guestfs.pod:1722
35687 "Events may contain a payload, usually nothing (void), an array of 64 bit "
35688 "unsigned integers, or a message buffer. Payloads are discussed later on."
35692 #: ../src/guestfs.pod:1726
35693 msgid "CLASSES OF EVENTS"
35697 #: ../src/guestfs.pod:1730
35698 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
35702 #: ../src/guestfs.pod:1733
35704 "The callback function will be called while the handle is being closed "
35705 "(synchronously from L</guestfs_close>)."
35709 #: ../src/guestfs.pod:1736
35711 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
35712 "handles that are open when the program exits. This means that this callback "
35713 "might be called indirectly from L<exit(3)>, which can cause unexpected "
35714 "problems in higher-level languages (eg. if your HLL interpreter has already "
35715 "been cleaned up by the time this is called, and if your callback then jumps "
35716 "into some HLL function)."
35720 #: ../src/guestfs.pod:1743
35722 "If no callback is registered: the handle is closed without any callback "
35727 #: ../src/guestfs.pod:1746
35728 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
35732 #: ../src/guestfs.pod:1749
35734 "The callback function will be called when the child process quits, either "
35735 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
35736 "corresponds to a transition from any state to the CONFIG state)."
35740 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
35741 msgid "If no callback is registered: the event is ignored."
35745 #: ../src/guestfs.pod:1755
35746 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
35750 #: ../src/guestfs.pod:1758
35752 "The callback function will be called when the child process becomes ready "
35753 "first time after it has been launched. (This corresponds to a transition "
35754 "from LAUNCHING to the READY state)."
35758 #: ../src/guestfs.pod:1764
35759 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
35763 #: ../src/guestfs.pod:1767
35765 "Some long-running operations can generate progress messages. If this "
35766 "callback is registered, then it will be called each time a progress message "
35767 "is generated (usually two seconds after the operation started, and three "
35768 "times per second thereafter until it completes, although the frequency may "
35769 "change in future versions)."
35773 #: ../src/guestfs.pod:1773
35775 "The callback receives in the payload four unsigned 64 bit numbers which are "
35776 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
35780 #: ../src/guestfs.pod:1776
35782 "The units of C<total> are not defined, although for some operations C<total> "
35783 "may relate in some way to the amount of data to be transferred (eg. in bytes "
35784 "or megabytes), and C<position> may be the portion which has been "
35789 #: ../src/guestfs.pod:1781
35790 msgid "The only defined and stable parts of the API are:"
35794 #: ../src/guestfs.pod:1787
35796 "The callback can display to the user some type of progress bar or indicator "
35797 "which shows the ratio of C<position>:C<total>."
35801 #: ../src/guestfs.pod:1792
35802 msgid "0 E<lt>= C<position> E<lt>= C<total>"
35806 #: ../src/guestfs.pod:1796
35808 "If any progress notification is sent during a call, then a final progress "
35809 "notification is always sent when C<position> = C<total> (I<unless> the call "
35810 "fails with an error)."
35814 #: ../src/guestfs.pod:1800
35816 "This is to simplify caller code, so callers can easily set the progress "
35817 "indicator to \"100%\" at the end of the operation, without requiring special "
35818 "code to detect this case."
35822 #: ../src/guestfs.pod:1806
35824 "For some calls we are unable to estimate the progress of the call, but we "
35825 "can still generate progress messages to indicate activity. This is known as "
35826 "\"pulse mode\", and is directly supported by certain progress bar "
35827 "implementations (eg. GtkProgressBar)."
35831 #: ../src/guestfs.pod:1811
35833 "For these calls, zero or more progress messages are generated with "
35834 "C<position = 0> and C<total = 1>, followed by a final message with "
35835 "C<position = total = 1>."
35839 #: ../src/guestfs.pod:1815
35841 "As noted above, if the call fails with an error then the final message may "
35842 "not be generated."
35846 #: ../src/guestfs.pod:1820
35848 "The callback also receives the procedure number (C<proc_nr>) and serial "
35849 "number (C<serial>) of the call. These are only useful for debugging "
35850 "protocol issues, and the callback can normally ignore them. The callback "
35851 "may want to print these numbers in error messages or debugging messages."
35855 #: ../src/guestfs.pod:1826
35856 msgid "If no callback is registered: progress messages are discarded."
35860 #: ../src/guestfs.pod:1828
35861 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
35865 #: ../src/guestfs.pod:1831
35867 "The callback function is called whenever a log message is generated by qemu, "
35868 "the appliance kernel, guestfsd (daemon), or utility programs."
35872 #: ../src/guestfs.pod:1834
35874 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
35875 "(L</guestfs_launch>) then additional debug messages are generated."
35879 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
35881 "If no callback is registered: the messages are discarded unless the verbose "
35882 "flag is set in which case they are sent to stderr. You can override the "
35883 "printing of verbose messages to stderr by setting up a callback."
35887 #: ../src/guestfs.pod:1842
35888 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
35892 #: ../src/guestfs.pod:1845
35894 "The callback function is called whenever a log message is generated by the "
35895 "library part of libguestfs."
35899 #: ../src/guestfs.pod:1848
35901 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
35902 "messages are generated."
35906 #: ../src/guestfs.pod:1856
35907 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
35911 #: ../src/guestfs.pod:1859
35913 "The callback function is called whenever a trace message is generated. This "
35914 "only applies if the trace flag (L</guestfs_set_trace>) is set."
35918 #: ../src/guestfs.pod:1862
35920 "If no callback is registered: the messages are sent to stderr. You can "
35921 "override the printing of trace messages to stderr by setting up a callback."
35925 #: ../src/guestfs.pod:1866
35926 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
35930 #: ../src/guestfs.pod:1869
35931 msgid "The callback function is called whenever a libguestfs function is entered."
35935 #: ../src/guestfs.pod:1872
35937 "The payload is a string which contains the name of the function that we are "
35938 "entering (not including C<guestfs_> prefix)."
35942 #: ../src/guestfs.pod:1875
35944 "Note that libguestfs functions can call themselves, so you may see many "
35945 "events from a single call. A few libguestfs functions do not generate this "
35950 #: ../src/guestfs.pod:1883
35951 msgid "guestfs_set_event_callback"
35955 #: ../src/guestfs.pod:1885
35958 " int guestfs_set_event_callback (guestfs_h *g,\n"
35959 " guestfs_event_callback cb,\n"
35960 " uint64_t event_bitmask,\n"
35962 " void *opaque);\n"
35967 #: ../src/guestfs.pod:1891
35969 "This function registers a callback (C<cb>) for all event classes in the "
35970 "C<event_bitmask>."
35974 #: ../src/guestfs.pod:1894
35976 "For example, to register for all log message events, you could call this "
35977 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
35978 "To register a single callback for all possible classes of events, use "
35979 "C<GUESTFS_EVENT_ALL>."
35983 #: ../src/guestfs.pod:1900
35984 msgid "C<flags> should always be passed as 0."
35988 #: ../src/guestfs.pod:1902
35990 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
35991 "it for any purpose."
35995 #: ../src/guestfs.pod:1905
35997 "The return value is the event handle (an integer) which you can use to "
35998 "delete the callback (see below)."
36002 #: ../src/guestfs.pod:1908
36004 "If there is an error, this function returns C<-1>, and sets the error in the "
36005 "handle in the usual way (see L</guestfs_last_error> etc.)"
36009 #: ../src/guestfs.pod:1911
36011 "Callbacks remain in effect until they are deleted, or until the handle is "
36016 #: ../src/guestfs.pod:1914
36018 "In the case where multiple callbacks are registered for a particular event "
36019 "class, all of the callbacks are called. The order in which multiple "
36020 "callbacks are called is not defined."
36024 #: ../src/guestfs.pod:1918
36025 msgid "guestfs_delete_event_callback"
36029 #: ../src/guestfs.pod:1920
36032 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36037 #: ../src/guestfs.pod:1922
36039 "Delete a callback that was previously registered. C<event_handle> should be "
36040 "the integer that was returned by a previous call to "
36041 "C<guestfs_set_event_callback> on the same handle."
36045 #: ../src/guestfs.pod:1926
36046 msgid "guestfs_event_callback"
36050 #: ../src/guestfs.pod:1928
36053 " typedef void (*guestfs_event_callback) (\n"
36056 " uint64_t event,\n"
36057 " int event_handle,\n"
36059 " const char *buf, size_t buf_len,\n"
36060 " const uint64_t *array, size_t array_len);\n"
36065 #: ../src/guestfs.pod:1937
36066 msgid "This is the type of the event callback function that you have to provide."
36070 #: ../src/guestfs.pod:1940
36072 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36073 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36074 "handle, and C<flags> which in the current API you should ignore."
36078 #: ../src/guestfs.pod:1944
36080 "The remaining parameters contain the event payload (if any). Each event may "
36081 "contain a payload, which usually relates to the event class, but for future "
36082 "proofing your code should be written to handle any payload for any event "
36087 #: ../src/guestfs.pod:1949
36089 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36090 "there is no message buffer). Note that this message buffer can contain "
36091 "arbitrary 8 bit data, including NUL bytes."
36095 #: ../src/guestfs.pod:1953
36097 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36098 "moment this is only used for progress messages."
36102 #: ../src/guestfs.pod:1956
36103 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36107 #: ../src/guestfs.pod:1958
36109 "One motivation for the generic event API was to allow GUI programs to "
36110 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36111 "unconditionally to C<stderr>."
36115 #: ../src/guestfs.pod:1962
36117 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36118 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36119 "messages are not events; you must capture error messages separately)."
36123 #: ../src/guestfs.pod:1967
36125 "Programs have to set up a callback to capture the classes of events of "
36130 #: ../src/guestfs.pod:1970
36134 " guestfs_set_event_callback\n"
36135 " (g, message_callback,\n"
36136 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36137 " GUESTFS_EVENT_TRACE,\n"
36138 " 0, NULL) == -1)\n"
36139 " if (eh == -1) {\n"
36140 " // handle error in the usual way\n"
36146 #: ../src/guestfs.pod:1980
36148 "The callback can then direct messages to the appropriate place. In this "
36149 "example, messages are directed to syslog:"
36153 #: ../src/guestfs.pod:1983
36157 " message_callback (\n"
36160 " uint64_t event,\n"
36161 " int event_handle,\n"
36163 " const char *buf, size_t buf_len,\n"
36164 " const uint64_t *array, size_t array_len)\n"
36166 " const int priority = LOG_USER|LOG_INFO;\n"
36167 " if (buf_len > 0)\n"
36168 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36174 #: ../src/guestfs.pod:1998
36175 msgid "CANCELLING LONG TRANSFERS"
36179 #: ../src/guestfs.pod:2000
36181 "Some operations can be cancelled by the caller while they are in progress. "
36182 "Currently only operations that involve uploading or downloading data can be "
36183 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36184 "parameters in the generator)."
36188 #: ../src/guestfs.pod:2005
36189 msgid "guestfs_user_cancel"
36193 #: ../src/guestfs.pod:2007
36196 " void guestfs_user_cancel (guestfs_h *g);\n"
36201 #: ../src/guestfs.pod:2009
36202 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
36206 #: ../src/guestfs.pod:2012
36208 "Unlike most other libguestfs calls, this function is signal safe and thread "
36209 "safe. You can call it from a signal handler or from another thread, without "
36210 "needing to do any locking."
36214 #: ../src/guestfs.pod:2016
36216 "The transfer that was in progress (if there is one) will stop shortly "
36217 "afterwards, and will return an error. The errno (see "
36218 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36219 "out if the operation was cancelled or failed because of another error."
36223 #: ../src/guestfs.pod:2022
36225 "No cleanup is performed: for example, if a file was being uploaded then "
36226 "after cancellation there may be a partially uploaded file. It is the "
36227 "caller's responsibility to clean up if necessary."
36231 #: ../src/guestfs.pod:2026
36232 msgid "There are two common places that you might call C<guestfs_user_cancel>."
36236 #: ../src/guestfs.pod:2028
36238 "In an interactive text-based program, you might call it from a C<SIGINT> "
36239 "signal handler so that pressing C<^C> cancels the current operation. (You "
36240 "also need to call L</guestfs_set_pgroup> so that child processes don't "
36241 "receive the C<^C> signal)."
36245 #: ../src/guestfs.pod:2033
36247 "In a graphical program, when the main thread is displaying a progress bar "
36248 "with a cancel button, wire up the cancel button to call this function."
36252 #: ../src/guestfs.pod:2037
36253 msgid "PRIVATE DATA AREA"
36257 #: ../src/guestfs.pod:2039
36259 "You can attach named pieces of private data to the libguestfs handle, fetch "
36260 "them by name, and walk over them, for the lifetime of the handle. This is "
36261 "called the private data area and is only available from the C API."
36265 #: ../src/guestfs.pod:2044
36266 msgid "To attach a named piece of data, use the following call:"
36270 #: ../src/guestfs.pod:2046
36273 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
36278 #: ../src/guestfs.pod:2048
36280 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
36281 "pointer (which can be C<NULL>). Any previous item with the same key is "
36286 #: ../src/guestfs.pod:2052
36288 "You can use any C<key> you want, but your key should I<not> start with an "
36289 "underscore character. Keys beginning with an underscore character are "
36290 "reserved for internal libguestfs purposes (eg. for implementing language "
36291 "bindings). It is recommended that you prefix the key with some unique "
36292 "string to avoid collisions with other users."
36296 #: ../src/guestfs.pod:2058
36297 msgid "To retrieve the pointer, use:"
36301 #: ../src/guestfs.pod:2060
36304 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
36309 #: ../src/guestfs.pod:2062
36311 "This function returns C<NULL> if either no data is found associated with "
36312 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
36317 #: ../src/guestfs.pod:2066
36319 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
36320 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
36321 "all. In particular, libguestfs does I<not> try to free the data when the "
36322 "handle is closed. If the data must be freed, then the caller must either "
36323 "free it before calling L</guestfs_close> or must set up a close callback to "
36324 "do it (see L</GUESTFS_EVENT_CLOSE>)."
36328 #: ../src/guestfs.pod:2073
36329 msgid "To walk over all entries, use these two functions:"
36333 #: ../src/guestfs.pod:2075
36336 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
36341 #: ../src/guestfs.pod:2077
36344 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
36349 #: ../src/guestfs.pod:2079
36351 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
36352 "not have any particular meaning -- keys are not returned in any defined "
36353 "order). A pointer to the key is returned in C<*key_rtn> and the "
36354 "corresponding data pointer is returned from the function. C<NULL> is "
36355 "returned if there are no keys stored in the handle."
36359 #: ../src/guestfs.pod:2085
36361 "C<guestfs_next_private> returns the next key, pointer pair. The return "
36362 "value of this function is also C<NULL> is there are no further entries to "
36367 #: ../src/guestfs.pod:2089
36368 msgid "Notes about walking over entries:"
36372 #: ../src/guestfs.pod:2095
36373 msgid "You must not call C<guestfs_set_private> while walking over the entries."
36377 #: ../src/guestfs.pod:2100
36379 "The handle maintains an internal iterator which is reset when you call "
36380 "C<guestfs_first_private>. This internal iterator is invalidated when you "
36381 "call C<guestfs_set_private>."
36385 #: ../src/guestfs.pod:2106
36386 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
36390 #: ../src/guestfs.pod:2108
36393 " guestfs_set_private (g, key, NULL);\n"
36398 #: ../src/guestfs.pod:2110
36399 msgid "then that C<key> is not returned when walking."
36403 #: ../src/guestfs.pod:2114
36405 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
36406 "C<guestfs_next_private> or C<guestfs_set_private>."
36410 #: ../src/guestfs.pod:2120
36412 "The following example code shows how to print all keys and data pointers "
36413 "that are associated with the handle C<g>:"
36417 #: ../src/guestfs.pod:2123
36420 " const char *key;\n"
36421 " void *data = guestfs_first_private (g, &key);\n"
36422 " while (data != NULL)\n"
36424 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36425 " data = guestfs_next_private (g, &key);\n"
36431 #: ../src/guestfs.pod:2131
36433 "More commonly you are only interested in keys that begin with an "
36434 "application-specific prefix C<foo_>. Modify the loop like so:"
36438 #: ../src/guestfs.pod:2134
36441 " const char *key;\n"
36442 " void *data = guestfs_first_private (g, &key);\n"
36443 " while (data != NULL)\n"
36445 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36446 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36447 " data = guestfs_next_private (g, &key);\n"
36453 #: ../src/guestfs.pod:2143
36455 "If you need to modify keys while walking, then you have to jump back to the "
36456 "beginning of the loop. For example, to delete all keys prefixed with "
36461 #: ../src/guestfs.pod:2147
36464 " const char *key;\n"
36467 " data = guestfs_first_private (g, &key);\n"
36468 " while (data != NULL)\n"
36470 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36472 " guestfs_set_private (g, key, NULL);\n"
36473 " /* note that 'key' pointer is now invalid, and so is\n"
36474 " the internal iterator */\n"
36477 " data = guestfs_next_private (g, &key);\n"
36483 #: ../src/guestfs.pod:2163
36485 "Note that the above loop is guaranteed to terminate because the keys are "
36486 "being deleted, but other manipulations of keys within the loop might not "
36487 "terminate unless you also maintain an indication of which keys have been "
36492 #: ../src/guestfs.pod:2168
36497 #: ../src/guestfs.pod:2170
36499 "The libguestfs C library can be probed using systemtap or DTrace. This is "
36500 "true of any library, not just libguestfs. However libguestfs also contains "
36501 "static markers to help in probing internal operations."
36505 #: ../src/guestfs.pod:2174
36506 msgid "You can list all the static markers by doing:"
36510 #: ../src/guestfs.pod:2176
36513 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
36514 " .provider(\"guestfs\").mark(\"*\")'\n"
36519 #: ../src/guestfs.pod:2179
36521 "B<Note:> These static markers are I<not> part of the stable API and may "
36522 "change in future versions."
36526 #: ../src/guestfs.pod:2182
36527 msgid "SYSTEMTAP SCRIPT EXAMPLE"
36531 #: ../src/guestfs.pod:2184
36533 "This script contains examples of displaying both the static markers and some "
36534 "ordinary C entry points:"
36538 #: ../src/guestfs.pod:2187
36546 #: ../src/guestfs.pod:2189
36549 " function display_time () {\n"
36550 " now = gettimeofday_us ();\n"
36553 " delta = now - last;\n"
36559 #: ../src/guestfs.pod:2196
36562 " printf (\"%d (+%d):\", now, delta);\n"
36568 #: ../src/guestfs.pod:2199
36573 " printf (\"ready\\n\");\n"
36579 #: ../src/guestfs.pod:2204
36582 " /* Display all calls to static markers. */\n"
36583 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36584 " .provider(\"guestfs\").mark(\"*\") ? {\n"
36585 " display_time();\n"
36586 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
36592 #: ../src/guestfs.pod:2211
36595 " /* Display all calls to guestfs_mkfs* functions. */\n"
36596 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36597 " .function(\"guestfs_mkfs*\") ? {\n"
36598 " display_time();\n"
36599 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
36605 #: ../src/guestfs.pod:2218
36607 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
36608 "program. Note that you either have to be root, or you have to add yourself "
36609 "to several special stap groups. Consult the systemtap documentation for "
36610 "more information."
36614 #: ../src/guestfs.pod:2223
36617 " # stap /tmp/test.stap\n"
36623 #: ../src/guestfs.pod:2226
36624 msgid "In another terminal, run a guestfish command such as this:"
36628 #: ../src/guestfs.pod:2230
36629 msgid "In the first terminal, stap trace output similar to this is shown:"
36633 #: ../src/guestfs.pod:2232
36636 " 1318248056692655 (+0):\tlaunch_start\n"
36637 " 1318248056692850 (+195): launch_build_appliance_start\n"
36638 " 1318248056818285 (+125435): launch_build_appliance_end\n"
36639 " 1318248056838059 (+19774): launch_run_qemu\n"
36640 " 1318248061071167 (+4233108): launch_end\n"
36641 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
36642 "device=0x1024e60\n"
36647 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
36652 #: ../src/guestfs.pod:2241
36654 "<!-- old anchor for the next section --> <a "
36655 "name=\"state_machine_and_low_level_event_api\"/>"
36659 #: ../src/guestfs.pod:2246
36660 msgid "ARCHITECTURE"
36664 #: ../src/guestfs.pod:2248
36666 "Internally, libguestfs is implemented by running an appliance (a special "
36667 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
36668 "process of the main program."
36672 #: ../src/guestfs.pod:2252
36675 " ___________________\n"
36677 " | main program |\n"
36679 " | | child process / appliance\n"
36680 " | | __________________________\n"
36682 " +-------------------+ RPC | +-----------------+ |\n"
36683 " | libguestfs <--------------------> guestfsd | |\n"
36684 " | | | +-----------------+ |\n"
36685 " \\___________________/ | | Linux kernel | |\n"
36686 " | +--^--------------+ |\n"
36687 " \\_________|________________/\n"
36689 " _______v______\n"
36692 " | disk image |\n"
36693 " \\______________/\n"
36698 #: ../src/guestfs.pod:2272
36700 "The library, linked to the main program, creates the child process and hence "
36701 "the appliance in the L</guestfs_launch> function."
36705 #: ../src/guestfs.pod:2275
36707 "Inside the appliance is a Linux kernel and a complete stack of userspace "
36708 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
36709 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
36710 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
36711 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
36712 "attached to the qemu process which translates device access by the "
36713 "appliance's Linux kernel into accesses to the image."
36717 #: ../src/guestfs.pod:2284
36719 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
36720 "Although the disk image you are attached to might also be used by some "
36721 "virtual machine, libguestfs doesn't know or care about this. (But you will "
36722 "care if both libguestfs's qemu process and your virtual machine are trying "
36723 "to update the disk image at the same time, since these usually results in "
36724 "massive disk corruption)."
36728 #: ../src/guestfs.pod:2291
36729 msgid "STATE MACHINE"
36733 #: ../src/guestfs.pod:2293
36734 msgid "libguestfs uses a state machine to model the child process:"
36738 #: ../src/guestfs.pod:2295
36742 " guestfs_create\n"
36750 " / | \\ \\ guestfs_launch\n"
36751 " / | _\\__V______\n"
36753 " / | | LAUNCHING |\n"
36754 " / | \\___________/\n"
36756 " / | guestfs_launch\n"
36758 " ______ / __|____V\n"
36759 " / \\ ------> / \\\n"
36760 " | BUSY | | READY |\n"
36761 " \\______/ <------ \\________/\n"
36766 #: ../src/guestfs.pod:2317
36768 "The normal transitions are (1) CONFIG (when the handle is created, but there "
36769 "is no child process), (2) LAUNCHING (when the child process is booting up), "
36770 "(3) alternating between READY and BUSY as commands are issued to, and "
36771 "carried out by, the child process."
36775 #: ../src/guestfs.pod:2322
36777 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
36778 "asynchronously at any time (eg. due to some internal error), and that causes "
36779 "the state to transition back to CONFIG."
36783 #: ../src/guestfs.pod:2326
36785 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
36786 "issued when in the CONFIG state."
36790 #: ../src/guestfs.pod:2329
36792 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
36793 "L</guestfs_launch> blocks until the child process is READY to accept "
36794 "commands (or until some failure or timeout). L</guestfs_launch> internally "
36795 "moves the state from CONFIG to LAUNCHING while it is running."
36799 #: ../src/guestfs.pod:2335
36801 "API actions such as L</guestfs_mount> can only be issued when in the READY "
36802 "state. These API calls block waiting for the command to be carried out "
36803 "(ie. the state to transition to BUSY and then back to READY). There are no "
36804 "non-blocking versions, and no way to issue more than one command per handle "
36805 "at the same time."
36809 #: ../src/guestfs.pod:2341
36811 "Finally, the child process sends asynchronous messages back to the main "
36812 "program, such as kernel log messages. You can register a callback to "
36813 "receive these messages."
36817 #: ../src/guestfs.pod:2345
36822 #: ../src/guestfs.pod:2347
36823 msgid "APPLIANCE BOOT PROCESS"
36827 #: ../src/guestfs.pod:2349
36829 "This process has evolved and continues to evolve. The description here "
36830 "corresponds only to the current version of libguestfs and is provided for "
36831 "information only."
36835 #: ../src/guestfs.pod:2353
36837 "In order to follow the stages involved below, enable libguestfs debugging "
36838 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
36842 #: ../src/guestfs.pod:2358
36843 msgid "Create the appliance"
36847 #: ../src/guestfs.pod:2360
36849 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
36850 "initrd and the appliance."
36854 #: ../src/guestfs.pod:2363
36856 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
36857 "directory if C<TMPDIR> is set)."
36861 #: ../src/guestfs.pod:2366
36863 "For a complete description of how the appliance is created and cached, read "
36864 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
36868 #: ../src/guestfs.pod:2370
36869 msgid "Start qemu and boot the kernel"
36873 #: ../src/guestfs.pod:2372
36874 msgid "qemu is invoked to boot the kernel."
36878 #: ../src/guestfs.pod:2374
36879 msgid "Run the initrd"
36883 #: ../src/guestfs.pod:2376
36885 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
36886 "appliance. The purpose of the initrd is to load enough kernel modules in "
36887 "order that the appliance itself can be mounted and started."
36891 #: ../src/guestfs.pod:2380
36893 "The initrd is a cpio archive called "
36894 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
36898 #: ../src/guestfs.pod:2383
36900 "When the initrd has started you will see messages showing that kernel "
36901 "modules are being loaded, similar to this:"
36905 #: ../src/guestfs.pod:2386
36908 " febootstrap: ext2 mini initrd starting up\n"
36909 " febootstrap: mounting /sys\n"
36910 " febootstrap: internal insmod libcrc32c.ko\n"
36911 " febootstrap: internal insmod crc32c-intel.ko\n"
36916 #: ../src/guestfs.pod:2391
36917 msgid "Find and mount the appliance device"
36921 #: ../src/guestfs.pod:2393
36923 "The appliance is a sparse file containing an ext2 filesystem which contains "
36924 "a familiar (although reduced in size) Linux operating system. It would "
36925 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
36929 #: ../src/guestfs.pod:2397
36931 "The regular disks being inspected by libguestfs are the first devices "
36932 "exposed by qemu (eg. as C</dev/vda>)."
36936 #: ../src/guestfs.pod:2400
36938 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
36939 "there was only one regular disk)."
36943 #: ../src/guestfs.pod:2403
36945 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
36946 "and switch root into the appliance, and run C</init> from the appliance."
36950 #: ../src/guestfs.pod:2407
36951 msgid "If this works successfully you will see messages such as:"
36955 #: ../src/guestfs.pod:2409
36958 " febootstrap: picked /sys/block/vdb/dev as root device\n"
36959 " febootstrap: creating /dev/root as block special 252:16\n"
36960 " febootstrap: mounting new root on /root\n"
36961 " febootstrap: chroot\n"
36962 " Starting /init script ...\n"
36967 #: ../src/guestfs.pod:2415
36969 "Note that C<Starting /init script ...> indicates that the appliance's init "
36970 "script is now running."
36974 #: ../src/guestfs.pod:2418
36975 msgid "Initialize the appliance"
36979 #: ../src/guestfs.pod:2420
36981 "The appliance itself now initializes itself. This involves starting certain "
36982 "processes like C<udev>, possibly printing some debug information, and "
36983 "finally running the daemon (C<guestfsd>)."
36987 #: ../src/guestfs.pod:2424
36992 #: ../src/guestfs.pod:2426
36994 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
36999 #: ../src/guestfs.pod:2429
37002 " verbose daemon enabled\n"
37007 #: ../src/guestfs.pod:2431
37009 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37010 "connected on the other end to the library."
37014 #: ../src/guestfs.pod:2434
37016 "The daemon connects to this port (and hence to the library) and sends a four "
37017 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37018 "protocol (see below)."
37022 #: ../src/guestfs.pod:2440
37023 msgid "COMMUNICATION PROTOCOL"
37027 #: ../src/guestfs.pod:2442
37029 "Don't rely on using this protocol directly. This section documents how it "
37030 "currently works, but it may change at any time."
37034 #: ../src/guestfs.pod:2445
37036 "The protocol used to talk between the library and the daemon running inside "
37037 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37038 "1014, RFC 1832, RFC 4506)."
37042 #: ../src/guestfs.pod:2449
37044 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37045 "this file is automatically generated)."
37049 #: ../src/guestfs.pod:2452
37051 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37052 "and C<FileOut> parameters, which are handled with very simple request/reply "
37053 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37054 "parameters, which use the same request and reply messages, but they may also "
37055 "be followed by files sent using a chunked encoding."
37059 #: ../src/guestfs.pod:2459
37060 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37064 #: ../src/guestfs.pod:2461
37065 msgid "For ordinary functions, the request message is:"
37069 #: ../src/guestfs.pod:2463
37072 " total length (header + arguments,\n"
37073 " but not including the length word itself)\n"
37074 " struct guestfs_message_header (encoded as XDR)\n"
37075 " struct guestfs_<foo>_args (encoded as XDR)\n"
37080 #: ../src/guestfs.pod:2468
37082 "The total length field allows the daemon to allocate a fixed size buffer "
37083 "into which it slurps the rest of the message. As a result, the total length "
37084 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37085 "effective size of any request is limited to somewhere under this size."
37089 #: ../src/guestfs.pod:2474
37091 "Note also that many functions don't take any arguments, in which case the "
37092 "C<guestfs_I<foo>_args> is completely omitted."
37096 #: ../src/guestfs.pod:2477
37098 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37099 "receiver knows what type of args structure to expect, or none at all."
37103 #: ../src/guestfs.pod:2481
37105 "For functions that take optional arguments, the optional arguments are "
37106 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37107 "arguments. A bitmask in the header indicates which optional arguments are "
37108 "meaningful. The bitmask is also checked to see if it contains bits set "
37109 "which the daemon does not know about (eg. if more optional arguments were "
37110 "added in a later version of the library), and this causes the call to be "
37115 #: ../src/guestfs.pod:2489
37116 msgid "The reply message for ordinary functions is:"
37120 #: ../src/guestfs.pod:2491
37123 " total length (header + ret,\n"
37124 " but not including the length word itself)\n"
37125 " struct guestfs_message_header (encoded as XDR)\n"
37126 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37131 #: ../src/guestfs.pod:2496
37133 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37134 "functions that return no formal return values."
37138 #: ../src/guestfs.pod:2499
37139 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37143 #: ../src/guestfs.pod:2502
37145 "In the case of an error, a flag is set in the header, and the reply message "
37146 "is slightly changed:"
37150 #: ../src/guestfs.pod:2505
37153 " total length (header + error,\n"
37154 " but not including the length word itself)\n"
37155 " struct guestfs_message_header (encoded as XDR)\n"
37156 " struct guestfs_message_error (encoded as XDR)\n"
37161 #: ../src/guestfs.pod:2510
37163 "The C<guestfs_message_error> structure contains the error message as a "
37168 #: ../src/guestfs.pod:2513
37169 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37173 #: ../src/guestfs.pod:2515
37175 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37176 "The normal request message is sent (see above). However this is followed by "
37177 "a sequence of file chunks."
37181 #: ../src/guestfs.pod:2519
37184 " total length (header + arguments,\n"
37185 " but not including the length word itself,\n"
37186 " and not including the chunks)\n"
37187 " struct guestfs_message_header (encoded as XDR)\n"
37188 " struct guestfs_<foo>_args (encoded as XDR)\n"
37189 " sequence of chunks for FileIn param #0\n"
37190 " sequence of chunks for FileIn param #1 etc.\n"
37195 #: ../src/guestfs.pod:2527
37196 msgid "The \"sequence of chunks\" is:"
37200 #: ../src/guestfs.pod:2529
37203 " length of chunk (not including length word itself)\n"
37204 " struct guestfs_chunk (encoded as XDR)\n"
37205 " length of chunk\n"
37206 " struct guestfs_chunk (encoded as XDR)\n"
37208 " length of chunk\n"
37209 " struct guestfs_chunk (with data.data_len == 0)\n"
37214 #: ../src/guestfs.pod:2537
37216 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
37217 "is set in the final chunk to indicate either successful completion or early "
37222 #: ../src/guestfs.pod:2541
37224 "At time of writing there are no functions that have more than one FileIn "
37225 "parameter. However this is (theoretically) supported, by sending the "
37226 "sequence of chunks for each FileIn parameter one after another (from left to "
37231 #: ../src/guestfs.pod:2546
37233 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
37234 "transfer. The library does this by sending a chunk with a special flag set "
37235 "to indicate cancellation. When the daemon sees this, it cancels the whole "
37236 "RPC, does I<not> send any reply, and goes back to reading the next request."
37240 #: ../src/guestfs.pod:2552
37242 "The daemon may also cancel. It does this by writing a special word "
37243 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
37244 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
37245 "cancel chunk). The special word is chosen so that even if cancellation "
37246 "happens right at the end of the transfer (after the library has finished "
37247 "writing and has started listening for the reply), the \"spurious\" cancel "
37248 "flag will not be confused with the reply message."
37252 #: ../src/guestfs.pod:2561
37254 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
37255 "limit), and also files where the size is not known in advance (eg. from "
37256 "pipes or sockets). However the chunks are rather small "
37257 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
37258 "to keep much in memory."
37262 #: ../src/guestfs.pod:2567
37263 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
37267 #: ../src/guestfs.pod:2569
37269 "The protocol for FileOut parameters is exactly the same as for FileIn "
37270 "parameters, but with the roles of daemon and library reversed."
37274 #: ../src/guestfs.pod:2572
37277 " total length (header + ret,\n"
37278 " but not including the length word itself,\n"
37279 " and not including the chunks)\n"
37280 " struct guestfs_message_header (encoded as XDR)\n"
37281 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37282 " sequence of chunks for FileOut param #0\n"
37283 " sequence of chunks for FileOut param #1 etc.\n"
37288 #: ../src/guestfs.pod:2580
37289 msgid "INITIAL MESSAGE"
37293 #: ../src/guestfs.pod:2582
37295 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
37296 "which indicates that the guest and daemon is alive. This is what "
37297 "L</guestfs_launch> waits for."
37301 #: ../src/guestfs.pod:2586
37302 msgid "PROGRESS NOTIFICATION MESSAGES"
37306 #: ../src/guestfs.pod:2588
37308 "The daemon may send progress notification messages at any time. These are "
37309 "distinguished by the normal length word being replaced by "
37310 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
37314 #: ../src/guestfs.pod:2592
37316 "The library turns them into progress callbacks (see "
37317 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
37322 #: ../src/guestfs.pod:2596
37324 "The daemon self-limits the frequency of progress messages it sends (see "
37325 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
37330 #: ../src/guestfs.pod:2600
37331 msgid "LIBGUESTFS VERSION NUMBERS"
37335 #: ../src/guestfs.pod:2602
37337 "Since April 2010, libguestfs has started to make separate development and "
37338 "stable releases, along with corresponding branches in our git repository. "
37339 "These separate releases can be identified by version number:"
37343 #: ../src/guestfs.pod:2607
37346 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
37347 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
37353 " | `-------- sub-version\n"
37355 " `------ always '1' because we don't change the ABI\n"
37360 #: ../src/guestfs.pod:2618
37361 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
37365 #: ../src/guestfs.pod:2620
37367 "As time passes we cherry pick fixes from the development branch and backport "
37368 "those into the stable branch, the effect being that the stable branch should "
37369 "get more stable and less buggy over time. So the stable releases are ideal "
37370 "for people who don't need new features but would just like the software to "
37375 #: ../src/guestfs.pod:2626
37376 msgid "Our criteria for backporting changes are:"
37380 #: ../src/guestfs.pod:2632
37382 "Documentation changes which don't affect any code are backported unless the "
37383 "documentation refers to a future feature which is not in stable."
37387 #: ../src/guestfs.pod:2638
37389 "Bug fixes which are not controversial, fix obvious problems, and have been "
37390 "well tested are backported."
37394 #: ../src/guestfs.pod:2643
37396 "Simple rearrangements of code which shouldn't affect how it works get "
37397 "backported. This is so that the code in the two branches doesn't get too "
37398 "far out of step, allowing us to backport future fixes more easily."
37402 #: ../src/guestfs.pod:2649
37404 "We I<don't> backport new features, new APIs, new tools etc, except in one "
37405 "exceptional case: the new feature is required in order to implement an "
37406 "important bug fix."
37410 #: ../src/guestfs.pod:2655
37412 "A new stable branch starts when we think the new features in development are "
37413 "substantial and compelling enough over the current stable branch to warrant "
37414 "it. When that happens we create new stable and development versions 1.N.0 "
37415 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
37416 "stable at this point, but by backporting fixes from development, that branch "
37417 "will stabilize over time."
37421 #: ../src/guestfs.pod:2663
37422 msgid "EXTENDING LIBGUESTFS"
37426 #: ../src/guestfs.pod:2665
37427 msgid "ADDING A NEW API ACTION"
37431 #: ../src/guestfs.pod:2667
37433 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
37434 "documentation) are generated, and this makes it easy to extend the "
37439 #: ../src/guestfs.pod:2671
37440 msgid "To add a new API action there are two changes:"
37444 #: ../src/guestfs.pod:2677
37446 "You need to add a description of the call (name, parameters, return type, "
37447 "tests, documentation) to C<generator/generator_actions.ml>."
37451 #: ../src/guestfs.pod:2680
37453 "There are two sorts of API action, depending on whether the call goes "
37454 "through to the daemon in the appliance, or is serviced entirely by the "
37455 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
37456 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
37457 "an example of the latter, since a trace flag is maintained in the handle and "
37458 "all tracing is done on the library side."
37462 #: ../src/guestfs.pod:2688
37464 "Most new actions are of the first type, and get added to the "
37465 "C<daemon_functions> list. Each function has a unique procedure number used "
37466 "in the RPC protocol which is assigned to that action when we publish "
37467 "libguestfs and cannot be reused. Take the latest procedure number and "
37472 #: ../src/guestfs.pod:2694
37474 "For library-only actions of the second type, add to the "
37475 "C<non_daemon_functions> list. Since these functions are serviced by the "
37476 "library and do not travel over the RPC mechanism to the daemon, these "
37477 "functions do not need a procedure number, and so the procedure number is set "
37482 #: ../src/guestfs.pod:2702
37483 msgid "Implement the action (in C):"
37487 #: ../src/guestfs.pod:2704
37489 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
37490 "C<daemon/> directory."
37494 #: ../src/guestfs.pod:2707
37496 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
37497 "(note: double underscore) in the C<src/> directory."
37501 #: ../src/guestfs.pod:2710
37502 msgid "In either case, use another function as an example of what to do."
37506 #: ../src/guestfs.pod:2714
37507 msgid "After making these changes, use C<make> to compile."
37511 #: ../src/guestfs.pod:2716
37513 "Note that you don't need to implement the RPC, language bindings, manual "
37514 "pages or anything else. It's all automatically generated from the OCaml "
37519 #: ../src/guestfs.pod:2720
37520 msgid "ADDING TESTS FOR AN API ACTION"
37524 #: ../src/guestfs.pod:2722
37526 "You can supply zero or as many tests as you want per API call. The tests "
37527 "can either be added as part of the API description "
37528 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
37529 "drop a script into C<regressions/>. Note that adding a script to "
37530 "C<regressions/> is slower, so if possible use the first method."
37534 #: ../src/guestfs.pod:2728
37536 "The following describes the test environment used when you add an API test "
37537 "in C<generator_actions.ml>."
37541 #: ../src/guestfs.pod:2731
37542 msgid "The test environment has 4 block devices:"
37546 #: ../src/guestfs.pod:2735
37547 msgid "C</dev/sda> 500MB"
37551 #: ../src/guestfs.pod:2737
37552 msgid "General block device for testing."
37556 #: ../src/guestfs.pod:2739
37557 msgid "C</dev/sdb> 50MB"
37561 #: ../src/guestfs.pod:2741
37563 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
37568 #: ../src/guestfs.pod:2744
37569 msgid "C</dev/sdc> 10MB"
37573 #: ../src/guestfs.pod:2746
37574 msgid "Used in a few tests where two block devices are needed."
37578 #: ../src/guestfs.pod:2748
37579 msgid "C</dev/sdd>"
37583 #: ../src/guestfs.pod:2750
37584 msgid "ISO with fixed content (see C<images/test.iso>)."
37588 #: ../src/guestfs.pod:2754
37590 "To be able to run the tests in a reasonable amount of time, the libguestfs "
37591 "appliance and block devices are reused between tests. So don't try testing "
37592 "L</guestfs_kill_subprocess> :-x"
37596 #: ../src/guestfs.pod:2758
37598 "Each test starts with an initial scenario, selected using one of the "
37599 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
37600 "initialize the disks mentioned above in a particular way as documented in "
37601 "C<generator_types.ml>. You should not assume anything about the previous "
37602 "contents of other disks that are not initialized."
37606 #: ../src/guestfs.pod:2764
37608 "You can add a prerequisite clause to any individual test. This is a "
37609 "run-time check, which, if it fails, causes the test to be skipped. Useful "
37610 "if testing a command which might not work on all variations of libguestfs "
37611 "builds. A test that has prerequisite of C<Always> means to run "
37616 #: ../src/guestfs.pod:2770
37618 "In addition, packagers can skip individual tests by setting environment "
37619 "variables before running C<make check>."
37623 #: ../src/guestfs.pod:2773
37626 " SKIP_TEST_<CMD>_<NUM>=1\n"
37631 #: ../src/guestfs.pod:2775
37632 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
37636 #: ../src/guestfs.pod:2777
37641 #: ../src/guestfs.pod:2779
37644 " SKIP_TEST_<CMD>=1\n"
37649 #: ../src/guestfs.pod:2781
37650 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
37654 #: ../src/guestfs.pod:2783
37655 msgid "Packagers can run only certain tests by setting for example:"
37659 #: ../src/guestfs.pod:2785
37662 " TEST_ONLY=\"vfs_type zerofree\"\n"
37667 #: ../src/guestfs.pod:2787
37669 "See C<capitests/tests.c> for more details of how these environment variables "
37674 #: ../src/guestfs.pod:2790
37675 msgid "DEBUGGING NEW API ACTIONS"
37679 #: ../src/guestfs.pod:2792
37680 msgid "Test new actions work before submitting them."
37684 #: ../src/guestfs.pod:2794
37685 msgid "You can use guestfish to try out new commands."
37689 #: ../src/guestfs.pod:2796
37691 "Debugging the daemon is a problem because it runs inside a minimal "
37692 "environment. However you can fprintf messages in the daemon to stderr, and "
37693 "they will show up if you use C<guestfish -v>."
37697 #: ../src/guestfs.pod:2800
37698 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
37702 #: ../src/guestfs.pod:2802
37704 "Our C source code generally adheres to some basic code-formatting "
37705 "conventions. The existing code base is not totally consistent on this "
37706 "front, but we do prefer that contributed code be formatted similarly. In "
37707 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
37708 "indentation level, and other than that, follow the K&R style."
37712 #: ../src/guestfs.pod:2808
37714 "If you use Emacs, add the following to one of one of your start-up files "
37715 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
37719 #: ../src/guestfs.pod:2811
37722 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
37723 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
37724 " (add-hook 'find-file-hook\n"
37725 " '(lambda () (if (and buffer-file-name\n"
37726 " (string-match \"/libguestfs\\\\>\"\n"
37727 " (buffer-file-name))\n"
37728 " (not (string-equal mode-name \"Change Log\"))\n"
37729 " (not (string-equal mode-name \"Makefile\")))\n"
37730 " (setq indent-tabs-mode nil))))\n"
37735 #: ../src/guestfs.pod:2821
37738 " ;;; When editing C sources in libguestfs, use this style.\n"
37739 " (defun libguestfs-c-mode ()\n"
37740 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
37742 " (c-set-style \"K&R\")\n"
37743 " (setq c-indent-level 2)\n"
37744 " (setq c-basic-offset 2))\n"
37745 " (add-hook 'c-mode-hook\n"
37746 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
37747 " (buffer-file-name))\n"
37748 " (libguestfs-c-mode))))\n"
37753 #: ../src/guestfs.pod:2833
37754 msgid "Enable warnings when compiling (and fix any problems this finds):"
37758 #: ../src/guestfs.pod:2836
37761 " ./configure --enable-gcc-warnings\n"
37766 #: ../src/guestfs.pod:2838
37767 msgid "Useful targets are:"
37771 #: ../src/guestfs.pod:2840
37774 " make syntax-check # checks the syntax of the C code\n"
37775 " make check # runs the test suite\n"
37780 #: ../src/guestfs.pod:2843
37781 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
37785 #: ../src/guestfs.pod:2845
37787 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
37788 "which are used to do shell quoting."
37792 #: ../src/guestfs.pod:2850
37797 #: ../src/guestfs.pod:2852
37799 "Simple shell quoted string. Any spaces or other shell characters are "
37804 #: ../src/guestfs.pod:2855
37809 #: ../src/guestfs.pod:2857
37811 "Same as C<%Q> except the string is treated as a path which is prefixed by "
37816 #: ../src/guestfs.pod:2864
37819 " asprintf (&cmd, \"cat %R\", path);\n"
37824 #: ../src/guestfs.pod:2866
37825 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
37829 #: ../src/guestfs.pod:2868
37831 "I<Note:> Do I<not> use these when you are passing parameters to the "
37832 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
37833 "because they are not passed via the shell (instead, straight to exec). You "
37834 "probably want to use the C<sysroot_path()> function however."
37838 #: ../src/guestfs.pod:2874
37839 msgid "SUBMITTING YOUR NEW API ACTIONS"
37843 #: ../src/guestfs.pod:2876
37845 "Submit patches to the mailing list: "
37846 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
37847 "L<rjones@redhat.com>."
37851 #: ../src/guestfs.pod:2880
37852 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
37856 #: ../src/guestfs.pod:2882
37857 msgid "We support i18n (gettext anyhow) in the library."
37861 #: ../src/guestfs.pod:2884
37863 "However many messages come from the daemon, and we don't translate those at "
37864 "the moment. One reason is that the appliance generally has all locale files "
37865 "removed from it, because they take up a lot of space. So we'd have to readd "
37866 "some of those, as well as copying our PO files into the appliance."
37870 #: ../src/guestfs.pod:2890
37872 "Debugging messages are never translated, since they are intended for the "
37877 #: ../src/guestfs.pod:2893
37878 msgid "SOURCE CODE SUBDIRECTORIES"
37882 #: ../src/guestfs.pod:2897
37887 #: ../src/guestfs.pod:2899
37888 msgid "L<virt-alignment-scan(1)> command and documentation."
37892 #: ../src/guestfs.pod:2903
37893 msgid "The libguestfs appliance, build scripts and so on."
37897 #: ../src/guestfs.pod:2905
37898 msgid "C<capitests>"
37902 #: ../src/guestfs.pod:2907
37903 msgid "Automated tests of the C API."
37907 #: ../src/guestfs.pod:2909
37912 #: ../src/guestfs.pod:2911
37914 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
37919 #: ../src/guestfs.pod:2914
37924 #: ../src/guestfs.pod:2916
37926 "Safety and liveness tests of components that libguestfs depends upon (not of "
37927 "libguestfs itself). Mainly this is for qemu and the kernel."
37931 #: ../src/guestfs.pod:2919
37936 #: ../src/guestfs.pod:2921
37938 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
37939 "command and documentation."
37943 #: ../src/guestfs.pod:2924
37948 #: ../src/guestfs.pod:2926
37949 msgid "Outside contributions, experimental parts."
37953 #: ../src/guestfs.pod:2928
37958 #: ../src/guestfs.pod:2930
37960 "The daemon that runs inside the libguestfs appliance and carries out "
37965 #: ../src/guestfs.pod:2933
37970 #: ../src/guestfs.pod:2935
37971 msgid "L<virt-df(1)> command and documentation."
37975 #: ../src/guestfs.pod:2937
37980 #: ../src/guestfs.pod:2939
37981 msgid "L<virt-edit(1)> command and documentation."
37985 #: ../src/guestfs.pod:2941
37986 msgid "C<examples>"
37990 #: ../src/guestfs.pod:2943
37991 msgid "C API example code."
37995 #: ../src/guestfs.pod:2945
38000 #: ../src/guestfs.pod:2947
38002 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38003 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38004 "L<virt-tar-out(1)>."
38008 #: ../src/guestfs.pod:2951
38013 #: ../src/guestfs.pod:2953
38014 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38018 #: ../src/guestfs.pod:2955
38019 msgid "C<generator>"
38023 #: ../src/guestfs.pod:2957
38025 "The crucially important generator, used to automatically generate large "
38026 "amounts of boilerplate C code for things like RPC and bindings."
38030 #: ../src/guestfs.pod:2960
38035 #: ../src/guestfs.pod:2962
38036 msgid "Files used by the test suite."
38040 #: ../src/guestfs.pod:2964
38041 msgid "Some \"phony\" guest images which we test against."
38045 #: ../src/guestfs.pod:2966
38046 msgid "C<inspector>"
38050 #: ../src/guestfs.pod:2968
38051 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38055 #: ../src/guestfs.pod:2970
38060 #: ../src/guestfs.pod:2972
38061 msgid "Logo used on the website. The fish is called Arthur by the way."
38065 #: ../src/guestfs.pod:2974
38070 #: ../src/guestfs.pod:2976
38071 msgid "M4 macros used by autoconf."
38075 #: ../src/guestfs.pod:2978
38080 #: ../src/guestfs.pod:2980
38081 msgid "Translations of simple gettext strings."
38085 #: ../src/guestfs.pod:2982
38090 #: ../src/guestfs.pod:2984
38092 "The build infrastructure and PO files for translations of manpages and POD "
38093 "files. Eventually this will be combined with the C<po> directory, but that "
38094 "is rather complicated."
38098 #: ../src/guestfs.pod:2988
38099 msgid "C<regressions>"
38103 #: ../src/guestfs.pod:2990
38104 msgid "Regression tests."
38108 #: ../src/guestfs.pod:2992
38113 #: ../src/guestfs.pod:2994
38114 msgid "L<virt-rescue(1)> command and documentation."
38118 #: ../src/guestfs.pod:2996
38123 #: ../src/guestfs.pod:2998
38124 msgid "L<virt-resize(1)> command and documentation."
38128 #: ../src/guestfs.pod:3000
38129 msgid "C<sparsify>"
38133 #: ../src/guestfs.pod:3002
38134 msgid "L<virt-sparsify(1)> command and documentation."
38138 #: ../src/guestfs.pod:3004
38143 #: ../src/guestfs.pod:3006
38144 msgid "Source code to the C library."
38148 #: ../src/guestfs.pod:3008
38153 #: ../src/guestfs.pod:3010
38154 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38158 #: ../src/guestfs.pod:3012
38159 msgid "C<test-tool>"
38163 #: ../src/guestfs.pod:3014
38165 "Test tool for end users to test if their qemu/kernel combination will work "
38170 #: ../src/guestfs.pod:3017
38175 #: ../src/guestfs.pod:3019
38180 #: ../src/guestfs.pod:3021
38185 #: ../src/guestfs.pod:3023
38190 #: ../src/guestfs.pod:3025
38195 #: ../src/guestfs.pod:3027
38200 #: ../src/guestfs.pod:3029
38205 #: ../src/guestfs.pod:3031
38210 #: ../src/guestfs.pod:3033
38215 #: ../src/guestfs.pod:3035
38216 msgid "Language bindings."
38220 #: ../src/guestfs.pod:3039
38221 msgid "MAKING A STABLE RELEASE"
38225 #: ../src/guestfs.pod:3041
38227 "When we make a stable release, there are several steps documented here. See "
38228 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
38233 #: ../src/guestfs.pod:3049
38234 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
38238 #: ../src/guestfs.pod:3054
38239 msgid "Finalize RELEASE-NOTES."
38243 #: ../src/guestfs.pod:3058
38244 msgid "Update ROADMAP."
38248 #: ../src/guestfs.pod:3062
38249 msgid "Run C<src/api-support/update-from-tarballs.sh>."
38253 #: ../src/guestfs.pod:3066
38254 msgid "Push and pull from Transifex."
38258 #: ../src/guestfs.pod:3068
38263 #: ../src/guestfs.pod:3070
38271 #: ../src/guestfs.pod:3072
38272 msgid "to push the latest POT files to Transifex. Then run:"
38276 #: ../src/guestfs.pod:3074
38284 #: ../src/guestfs.pod:3076
38285 msgid "which is a wrapper to pull the latest translated C<*.po> files."
38289 #: ../src/guestfs.pod:3080
38291 "Create new stable and development directories under "
38292 "L<http://libguestfs.org/download>."
38296 #: ../src/guestfs.pod:3085
38297 msgid "Create the branch in git:"
38301 #: ../src/guestfs.pod:3087
38304 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
38305 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
38306 " git branch stable-1.XX\n"
38307 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
38312 #: ../src/guestfs.pod:3094
38317 #: ../src/guestfs.pod:3096
38318 msgid "PROTOCOL LIMITS"
38322 #: ../src/guestfs.pod:3098
38324 "Internally libguestfs uses a message-based protocol to pass API calls and "
38325 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
38326 "plenty more detail about this). The maximum message size used by the "
38327 "protocol is slightly less than 4 MB. For some API calls you may need to be "
38328 "aware of this limit. The API calls which may be affected are individually "
38329 "documented, with a link back to this section of the documentation."
38333 #: ../src/guestfs.pod:3106
38335 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
38336 "a simple string. Because this string is at some point internally encoded as "
38337 "a message, the maximum size that it can return is slightly under 4 MB. If "
38338 "the requested file is larger than this then you will get an error."
38342 #: ../src/guestfs.pod:3112
38344 "In order to transfer large files into and out of the guest filesystem, you "
38345 "need to use particular calls that support this. The sections L</UPLOADING> "
38346 "and L</DOWNLOADING> document how to do this."
38350 #: ../src/guestfs.pod:3116
38352 "You might also consider mounting the disk image using our FUSE filesystem "
38353 "support (L<guestmount(1)>)."
38357 #: ../src/guestfs.pod:3119
38358 msgid "MAXIMUM NUMBER OF DISKS"
38362 #: ../src/guestfs.pod:3121
38363 msgid "When using virtio disks (the default) the current limit is B<25> disks."
38367 #: ../src/guestfs.pod:3124
38369 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
38370 "slots. However febootstrap only understands disks with names C</dev/vda> "
38371 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
38376 #: ../src/guestfs.pod:3129
38378 "We are working to substantially raise this limit in future versions but it "
38379 "requires complex changes to qemu."
38383 #: ../src/guestfs.pod:3132
38385 "In future versions of libguestfs it should also be possible to \"hot plug\" "
38386 "disks (add and remove disks after calling L</guestfs_launch>). This also "
38387 "requires changes to qemu."
38391 #: ../src/guestfs.pod:3136
38392 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
38396 #: ../src/guestfs.pod:3138
38397 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
38401 #: ../src/guestfs.pod:3140
38403 "This is because it reserves 4 bits for the minor device number (thus "
38404 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
38408 #: ../src/guestfs.pod:3143
38410 "If you attach a disk with more than 15 partitions, the extra partitions are "
38411 "ignored by libguestfs."
38415 #: ../src/guestfs.pod:3146
38416 msgid "MAXIMUM SIZE OF A DISK"
38420 #: ../src/guestfs.pod:3148
38421 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
38425 #: ../src/guestfs.pod:3150
38427 "We have tested block devices up to 1 exabyte (2**60 or "
38428 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
38433 #: ../src/guestfs.pod:3154
38435 "Although libguestfs probably does not impose any limit, the underlying host "
38436 "storage will. If you store disk images on a host ext4 filesystem, then the "
38437 "maximum size will be limited by the maximum ext4 file size (currently 16 "
38438 "TB). If you store disk images as host logical volumes then you are limited "
38439 "by the maximum size of an LV."
38443 #: ../src/guestfs.pod:3160
38445 "For the hugest disk image files, we recommend using XFS on the host for "
38450 #: ../src/guestfs.pod:3163
38451 msgid "MAXIMUM SIZE OF A PARTITION"
38455 #: ../src/guestfs.pod:3165
38457 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
38458 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
38459 "address a partition located beyond 2 TB on the disk."
38463 #: ../src/guestfs.pod:3169
38465 "It is recommended that you use GPT partitions on disks which are larger than "
38466 "this size. GPT uses 64 bit sector numbers and so can address partitions "
38467 "which are theoretically larger than the largest disk we could support."
38471 #: ../src/guestfs.pod:3174
38472 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
38476 #: ../src/guestfs.pod:3176
38478 "This depends on the filesystem type. libguestfs itself does not impose any "
38479 "known limit. Consult Wikipedia or the filesystem documentation to find out "
38480 "what these limits are."
38484 #: ../src/guestfs.pod:3180
38485 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
38489 #: ../src/guestfs.pod:3182
38491 "The API functions L</guestfs_upload>, L</guestfs_download>, "
38492 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
38493 "uploads and downloads."
38497 #: ../src/guestfs.pod:3186
38498 msgid "INSPECTION LIMITS"
38502 #: ../src/guestfs.pod:3188
38504 "The inspection code has several arbitrary limits on things like the size of "
38505 "Windows Registry hive it will read, and the length of product name. These "
38506 "are intended to stop a malicious guest from consuming arbitrary amounts of "
38507 "memory and disk space on the host, and should not be reached in practice. "
38508 "See the source code for more information."
38512 #: ../src/guestfs.pod:3214
38514 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
38515 "effect as calling C<guestfs_set_verbose (g, 1)>."
38519 #: ../src/guestfs.pod:3226
38521 "Set the path that libguestfs uses to search for a supermin appliance. See "
38522 "the discussion of paths in section L</PATH> above."
38526 #: ../src/guestfs.pod:3235
38527 msgid "See also L</QEMU WRAPPERS> above."
38531 #: ../src/guestfs.pod:3239
38533 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
38534 "effect as calling C<guestfs_set_trace (g, 1)>."
38538 #: ../src/guestfs.pod:3257
38540 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
38541 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
38542 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
38543 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
38544 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
38545 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
38546 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
38547 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
38548 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
38549 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
38550 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
38551 "L<http://libguestfs.org/>."
38555 #: ../src/guestfs.pod:3293
38557 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
38558 "L<lvm(8)>, L<disktype(1)>."
38562 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
38567 #: ../src/guestfs.pod:3302
38568 msgid "To get a list of bugs against libguestfs use this link:"
38572 #: ../src/guestfs.pod:3304
38573 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
38577 #: ../src/guestfs.pod:3306
38578 msgid "To report a new bug against libguestfs use this link:"
38582 #: ../src/guestfs.pod:3308
38583 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
38587 #: ../src/guestfs.pod:3310
38588 msgid "When reporting a bug, please check:"
38592 #: ../src/guestfs.pod:3316
38593 msgid "That the bug hasn't been reported already."
38597 #: ../src/guestfs.pod:3320
38598 msgid "That you are testing a recent version."
38602 #: ../src/guestfs.pod:3324
38603 msgid "Describe the bug accurately, and give a way to reproduce it."
38607 #: ../src/guestfs.pod:3328
38609 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
38614 #: ../test-tool/libguestfs-test-tool.pod:5
38615 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
38619 #: ../test-tool/libguestfs-test-tool.pod:9
38622 " libguestfs-test-tool [--options]\n"
38627 #: ../test-tool/libguestfs-test-tool.pod:13
38629 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
38630 "to check basic libguestfs functionality is working. This is needed because "
38631 "libguestfs occasionally breaks for reasons beyond our control: usually "
38632 "because of changes in the underlying qemu or kernel packages, or the host "
38637 #: ../test-tool/libguestfs-test-tool.pod:19
38638 msgid "If you suspect a problem in libguestfs, then just run:"
38642 #: ../test-tool/libguestfs-test-tool.pod:21
38645 " libguestfs-test-tool\n"
38650 #: ../test-tool/libguestfs-test-tool.pod:23
38651 msgid "It will print lots of diagnostic messages."
38655 #: ../test-tool/libguestfs-test-tool.pod:25
38656 msgid "If it runs to completion successfully, you will see this near the end:"
38660 #: ../test-tool/libguestfs-test-tool.pod:27
38663 " ===== TEST FINISHED OK =====\n"
38668 #: ../test-tool/libguestfs-test-tool.pod:29
38669 msgid "and the test tool will exit with code 0."
38673 #: ../test-tool/libguestfs-test-tool.pod:31
38675 "If it fails (and/or exits with non-zero error code), please paste the "
38676 "I<complete, unedited> output of the test tool into a bug report. More "
38677 "information about reporting bugs can be found on the "
38678 "L<http://libguestfs.org/> website."
38682 #: ../test-tool/libguestfs-test-tool.pod:42
38683 msgid "Display short usage information and exit."
38687 #: ../test-tool/libguestfs-test-tool.pod:44
38688 msgid "B<--qemu qemu_binary>"
38692 #: ../test-tool/libguestfs-test-tool.pod:46
38694 "If you have downloaded another qemu binary, point this option at the full "
38695 "path of the binary to try it."
38699 #: ../test-tool/libguestfs-test-tool.pod:49
38700 msgid "B<--qemudir qemu_source_dir>"
38704 #: ../test-tool/libguestfs-test-tool.pod:51
38706 "If you have compiled qemu from source, point this option at the source "
38707 "directory to try it."
38711 #: ../test-tool/libguestfs-test-tool.pod:54
38716 #: ../test-tool/libguestfs-test-tool.pod:56
38717 msgid "B<--timeout N>"
38721 #: ../test-tool/libguestfs-test-tool.pod:58
38723 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
38724 "minutes) which does not usually need to be adjusted."
38728 #: ../test-tool/libguestfs-test-tool.pod:63
38729 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
38733 #: ../test-tool/libguestfs-test-tool.pod:65
38735 "If you have compiled another version of qemu from source and would like to "
38736 "try that, then you can use the I<--qemudir> option to point to the qemu "
38737 "source directory."
38741 #: ../test-tool/libguestfs-test-tool.pod:69
38743 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
38744 "option to point to the binary."
38748 #: ../test-tool/libguestfs-test-tool.pod:72
38750 "Note when using these options, you can ignore the business of qemu wrapper "
38751 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
38752 "wrapper script for you if one is needed."
38756 #: ../test-tool/libguestfs-test-tool.pod:76
38757 msgid "TRYING OUT A DIFFERENT KERNEL"
38761 #: ../test-tool/libguestfs-test-tool.pod:78
38763 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
38764 "libguestfs tries. You do this by setting the environment variables "
38765 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
38769 #: ../test-tool/libguestfs-test-tool.pod:82
38771 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
38776 #: ../test-tool/libguestfs-test-tool.pod:85
38777 msgid "SELF-DIAGNOSIS"
38781 #: ../test-tool/libguestfs-test-tool.pod:87
38783 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
38784 "produced by libguestfs-test-tool and/or possible errors."
38788 #: ../test-tool/libguestfs-test-tool.pod:92
38790 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
38791 "I<1> if there was an error."
38795 #: ../test-tool/libguestfs-test-tool.pod:97
38797 "For the full list of environment variables which may affect libguestfs, "
38798 "please see the L<guestfs(3)> manual page."
38802 #: ../test-tool/libguestfs-test-tool.pod:102
38803 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
38807 #: ../tools/virt-list-filesystems.pl:32
38808 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
38812 #: ../tools/virt-list-filesystems.pl:36
38815 " virt-list-filesystems [--options] domname\n"
38820 #: ../tools/virt-list-filesystems.pl:38
38823 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
38828 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
38830 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
38835 #: ../tools/virt-list-filesystems.pl:45
38837 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
38838 "are contained in a virtual machine or disk image."
38842 #: ../tools/virt-list-filesystems.pl:49
38844 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
38845 "functionality. For more complex cases you should look at the "
38846 "L<guestfish(1)> tool."
38850 #: ../tools/virt-list-filesystems.pl:112
38852 "With this option, C<virt-list-filesystems> displays the type of each "
38853 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
38857 #: ../tools/virt-list-filesystems.pl:119
38862 #: ../tools/virt-list-filesystems.pl:123
38864 "Normally we only show mountable filesystems. If this option is given then "
38865 "swap devices are shown too."
38869 #: ../tools/virt-list-filesystems.pl:197
38871 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
38872 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
38873 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38877 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
38878 msgid "Copyright (C) 2009 Red Hat Inc."
38882 #: ../tools/virt-list-partitions.pl:32
38883 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
38887 #: ../tools/virt-list-partitions.pl:36
38890 " virt-list-partitions [--options] domname\n"
38895 #: ../tools/virt-list-partitions.pl:38
38898 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
38903 #: ../tools/virt-list-partitions.pl:45
38905 "C<virt-list-partitions> is a command line tool to list the partitions that "
38906 "are contained in a virtual machine or disk image. It is mainly useful as a "
38907 "first step to using L<virt-resize(1)>."
38911 #: ../tools/virt-list-partitions.pl:50
38913 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
38914 "functionality. For more complex cases you should look at the "
38915 "L<guestfish(1)> tool."
38919 #: ../tools/virt-list-partitions.pl:113
38920 msgid "Show sizes in human-readable form (eg. \"1G\")."
38924 #: ../tools/virt-list-partitions.pl:123
38926 "With this option, C<virt-list-partitions> displays the type and size of each "
38927 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
38931 #: ../tools/virt-list-partitions.pl:130
38936 #: ../tools/virt-list-partitions.pl:132
38941 #: ../tools/virt-list-partitions.pl:134
38942 msgid "Display the total size of each block device (as a separate row or rows)."
38946 #: ../tools/virt-list-partitions.pl:267
38948 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
38949 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
38950 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38954 #: ../tools/virt-list-partitions.pl:283
38955 msgid "Copyright (C) 2009-2010 Red Hat Inc."
38959 #: ../tools/virt-make-fs.pl:37
38960 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
38964 #: ../tools/virt-make-fs.pl:41
38967 " virt-make-fs [--options] input.tar output.img\n"
38972 #: ../tools/virt-make-fs.pl:43
38975 " virt-make-fs [--options] input.tar.gz output.img\n"
38980 #: ../tools/virt-make-fs.pl:45
38983 " virt-make-fs [--options] directory output.img\n"
38988 #: ../tools/virt-make-fs.pl:49
38990 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
38991 "archive or some files in a directory. It is similar to tools like "
38992 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
38993 "it can create common filesystem types like ext2/3 or NTFS, which can be "
38994 "useful if you want to attach these filesystems to existing virtual machines "
38995 "(eg. to import large amounts of read-only data to a VM)."
38999 #: ../tools/virt-make-fs.pl:57
39000 msgid "Basic usage is:"
39004 #: ../tools/virt-make-fs.pl:59
39007 " virt-make-fs input output\n"
39012 #: ../tools/virt-make-fs.pl:61
39014 "where C<input> is either a directory containing files that you want to add, "
39015 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39016 "C<output> is a disk image. The input type is detected automatically. The "
39017 "output disk image defaults to a raw ext2 image unless you specify extra "
39018 "flags (see L</OPTIONS> below)."
39022 #: ../tools/virt-make-fs.pl:67
39023 msgid "EXTRA SPACE"
39027 #: ../tools/virt-make-fs.pl:69
39029 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39030 "the files that it contains, but might have extra space. Depending on how "
39031 "you are going to use the output, you might think this extra space is wasted "
39032 "and want to minimize it, or you might want to leave space so that more files "
39033 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39034 "but you can use the I<--size> flag to leave space in the filesystem if you "
39039 #: ../tools/virt-make-fs.pl:77
39041 "An alternative way to leave extra space but not make the output image any "
39042 "bigger is to use an alternative disk image format (instead of the default "
39043 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39044 "image format (check your hypervisor supports this before using it). This "
39045 "allows you to choose a large I<--size> but the extra space won't actually be "
39046 "allocated in the image until you try to store something in it."
39050 #: ../tools/virt-make-fs.pl:85
39052 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39053 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39054 "to build another image from scratch."
39058 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
39063 #: ../tools/virt-make-fs.pl:91
39066 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
39071 #: ../tools/virt-make-fs.pl:93
39072 msgid "FILESYSTEM TYPE"
39076 #: ../tools/virt-make-fs.pl:95
39078 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39079 "libguestfs supports can be used (but I<not> read-only formats like "
39080 "ISO9660). Here are some of the more common choices:"
39084 #: ../tools/virt-make-fs.pl:101
39089 #: ../tools/virt-make-fs.pl:103
39091 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39092 "you are not going to use the filesystem in a way that requires the journal, "
39093 "then this is just wasted overhead."
39097 #: ../tools/virt-make-fs.pl:107
39098 msgid "I<ntfs> or I<vfat>"
39102 #: ../tools/virt-make-fs.pl:109
39103 msgid "Useful if exporting data to a Windows guest."
39107 #: ../tools/virt-make-fs.pl:111
39109 "I<Note for vfat>: The tar archive or local directory must only contain files "
39110 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39111 "program running within libguestfs is unable to change the ownership of "
39112 "non-root files, since vfat itself does not support this."
39116 #: ../tools/virt-make-fs.pl:116
39121 #: ../tools/virt-make-fs.pl:118
39123 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39124 "total filesystem size."
39128 #: ../tools/virt-make-fs.pl:125
39131 " virt-make-fs --type=minix input minixfs.img\n"
39136 #: ../tools/virt-make-fs.pl:127
39137 msgid "TO PARTITION OR NOT TO PARTITION"
39141 #: ../tools/virt-make-fs.pl:129
39142 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39146 #: ../tools/virt-make-fs.pl:131
39148 "Adding a partition can make the disk image more compatible with certain "
39149 "virtualized operating systems which don't expect to see a filesystem "
39150 "directly located on a block device (Linux doesn't care and will happily "
39151 "handle both types)."
39155 #: ../tools/virt-make-fs.pl:136
39157 "On the other hand, if you have a partition table then the output image is no "
39158 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39159 "directly on a partitioned disk image. (However libguestfs tools such as "
39160 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39164 #: ../tools/virt-make-fs.pl:144
39165 msgid "Add an MBR partition:"
39169 #: ../tools/virt-make-fs.pl:146
39172 " virt-make-fs --partition -- input disk.img\n"
39177 #: ../tools/virt-make-fs.pl:148
39179 "If the output disk image could be terabyte-sized or larger, it's better to "
39180 "use an EFI/GPT-compatible partition table:"
39184 #: ../tools/virt-make-fs.pl:151
39187 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39192 #: ../tools/virt-make-fs.pl:179
39193 msgid "Enable debugging information."
39197 #: ../tools/virt-make-fs.pl:185
39198 msgid "B<--size=E<lt>NE<gt>>"
39202 #: ../tools/virt-make-fs.pl:187
39203 msgid "B<--size=+E<lt>NE<gt>>"
39207 #: ../tools/virt-make-fs.pl:189
39208 msgid "B<-s E<lt>NE<gt>>"
39212 #: ../tools/virt-make-fs.pl:191
39213 msgid "B<-s +E<lt>NE<gt>>"
39217 #: ../tools/virt-make-fs.pl:193
39218 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
39222 #: ../tools/virt-make-fs.pl:196
39224 "If this option is I<not> given, then the output image will be just large "
39225 "enough to contain all the files, with not much wasted space."
39229 #: ../tools/virt-make-fs.pl:199
39231 "To choose a fixed size output disk, specify an absolute number followed by "
39232 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39233 "Petabytes or Exabytes. This must be large enough to contain all the input "
39234 "files, else you will get an error."
39238 #: ../tools/virt-make-fs.pl:204
39240 "To leave extra space, specify C<+> (plus sign) and a number followed by "
39241 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39242 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
39243 "the input files, and (approximately) an extra 200 MB free space."
39247 #: ../tools/virt-make-fs.pl:210
39249 "Note that virt-make-fs estimates free space, and therefore will not produce "
39250 "filesystems containing precisely the free space requested. (It is much more "
39251 "expensive and time-consuming to produce a filesystem which has precisely the "
39252 "desired free space)."
39256 #: ../tools/virt-make-fs.pl:219
39257 msgid "B<--format=E<lt>fmtE<gt>>"
39261 #: ../tools/virt-make-fs.pl:221
39262 msgid "B<-F E<lt>fmtE<gt>>"
39266 #: ../tools/virt-make-fs.pl:223
39267 msgid "Choose the output disk image format."
39271 #: ../tools/virt-make-fs.pl:225
39272 msgid "The default is C<raw> (raw disk image)."
39276 #: ../tools/virt-make-fs.pl:227
39278 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
39279 "that would really make sense here is C<qcow2>."
39283 #: ../tools/virt-make-fs.pl:234
39284 msgid "B<--type=E<lt>fsE<gt>>"
39288 #: ../tools/virt-make-fs.pl:236
39289 msgid "B<-t E<lt>fsE<gt>>"
39293 #: ../tools/virt-make-fs.pl:238
39294 msgid "Choose the output filesystem type."
39298 #: ../tools/virt-make-fs.pl:240
39299 msgid "The default is C<ext2>."
39303 #: ../tools/virt-make-fs.pl:242
39304 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
39308 #: ../tools/virt-make-fs.pl:249
39309 msgid "B<--partition>"
39313 #: ../tools/virt-make-fs.pl:251
39314 msgid "B<--partition=E<lt>parttypeE<gt>>"
39318 #: ../tools/virt-make-fs.pl:253
39320 "If specified, this flag adds an MBR partition table to the output disk "
39325 #: ../tools/virt-make-fs.pl:256
39327 "You can change the partition table type, eg. I<--partition=gpt> for large "
39332 #: ../tools/virt-make-fs.pl:259
39334 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
39335 "might consider the next parameter to be the partition type. For example:"
39339 #: ../tools/virt-make-fs.pl:263
39342 " virt-make-fs --partition input.tar ...\n"
39347 #: ../tools/virt-make-fs.pl:265
39349 "would cause virt-make-fs to think you wanted to use a partition type of "
39350 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
39351 "dash) between options and the input file argument:"
39355 #: ../tools/virt-make-fs.pl:269
39358 " virt-make-fs --partition -- input.tar ...\n"
39363 #: ../tools/virt-make-fs.pl:541
39365 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
39366 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
39367 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
39371 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
39373 "When reporting bugs, please enable debugging and capture the I<complete> "
39378 #: ../tools/virt-make-fs.pl:558
39381 " export LIBGUESTFS_DEBUG=1\n"
39382 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
39387 #: ../tools/virt-make-fs.pl:561
39389 "Attach /tmp/virt-make-fs.log to a new bug report at "
39390 "L<https://bugzilla.redhat.com/>"
39394 #: ../tools/virt-tar.pl:33
39395 msgid "virt-tar - Extract or upload files to a virtual machine"
39399 #: ../tools/virt-tar.pl:37
39402 " virt-tar [--options] -x domname directory tarball\n"
39407 #: ../tools/virt-tar.pl:39
39410 " virt-tar [--options] -u domname tarball directory\n"
39415 #: ../tools/virt-tar.pl:41
39418 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
39423 #: ../tools/virt-tar.pl:43
39426 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
39431 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
39436 #: ../tools/virt-tar.pl:47
39438 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
39439 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
39443 #: ../tools/virt-tar.pl:52
39444 msgid "Download C</home> from the VM into a local tarball:"
39448 #: ../tools/virt-tar.pl:54
39451 " virt-tar -x domname /home home.tar\n"
39456 #: ../tools/virt-tar.pl:56
39459 " virt-tar -zx domname /home home.tar.gz\n"
39464 #: ../tools/virt-tar.pl:58
39465 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
39469 #: ../tools/virt-tar.pl:60
39472 " virt-tar -u domname uploadstuff.tar /tmp\n"
39477 #: ../tools/virt-tar.pl:62
39480 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
39485 #: ../tools/virt-tar.pl:66
39487 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
39488 "virtual machines. If you do this, you risk disk corruption in the VM. "
39489 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
39493 #: ../tools/virt-tar.pl:71
39495 "You can use I<-x> (extract) on live virtual machines, but you might get "
39496 "inconsistent results or errors if there is filesystem activity inside the "
39497 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
39498 "work, but the only way to guarantee consistent results is if the virtual "
39499 "machine is shut down."
39503 #: ../tools/virt-tar.pl:79
39505 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
39506 "parts of a guest filesystem. There are many possibilities: making backups, "
39507 "uploading data files, snooping on guest activity, fixing or customizing "
39512 #: ../tools/virt-tar.pl:84
39514 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
39515 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
39516 "should look at the L<guestfish(1)> tool."
39520 #: ../tools/virt-tar.pl:88
39522 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
39523 "its contents (recursively) from the virtual machine into a local tarball. "
39524 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
39525 "virtual machine. You cannot use these two options together."
39529 #: ../tools/virt-tar.pl:94
39531 "In addition, you may need to use the I<-z> (gZip) option to enable "
39532 "compression. When uploading, you have to specify I<-z> if the upload file "
39533 "is compressed because virt-tar won't detect this on its own."
39537 #: ../tools/virt-tar.pl:98
39539 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
39540 "example it cannot do PKZip files or bzip2 compression. If you want that "
39541 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
39542 "the L<libguestfs(3)> API)."
39546 #: ../tools/virt-tar.pl:160
39547 msgid "B<--extract>"
39551 #: ../tools/virt-tar.pl:162
39552 msgid "B<--download>"
39556 #: ../tools/virt-tar.pl:164
39561 #: ../tools/virt-tar.pl:166
39562 msgid "B<--upload>"
39566 #: ../tools/virt-tar.pl:168
39568 "Use I<-x> to extract (download) a directory from a virtual machine to a "
39573 #: ../tools/virt-tar.pl:171
39575 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
39576 "Please read the L</WARNING> section above before using this option."
39580 #: ../tools/virt-tar.pl:175
39581 msgid "You must specify exactly one of these options."
39585 #: ../tools/virt-tar.pl:181
39590 #: ../tools/virt-tar.pl:183
39595 #: ../tools/virt-tar.pl:185
39596 msgid "Specify that the input or output tarball is gzip-compressed."
39600 #: ../tools/virt-tar.pl:298
39602 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
39603 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39604 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
39605 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39609 #: ../tools/virt-win-reg.pl:37
39611 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
39616 #: ../tools/virt-win-reg.pl:41
39619 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
39624 #: ../tools/virt-win-reg.pl:43
39627 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
39632 #: ../tools/virt-win-reg.pl:45
39635 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
39640 #: ../tools/virt-win-reg.pl:47
39643 " virt-win-reg --merge domname [input.reg ...]\n"
39648 #: ../tools/virt-win-reg.pl:49
39651 " virt-win-reg [--options] disk.img ... # instead of domname\n"
39656 #: ../tools/virt-win-reg.pl:53
39658 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
39659 "virtual machines. If you do this, you I<will> get irreversible disk "
39660 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
39661 "but doesn't catch all cases."
39665 #: ../tools/virt-win-reg.pl:58
39667 "Modifying the Windows Registry is an inherently risky operation. The format "
39668 "is deliberately obscure and undocumented, and Registry changes can leave the "
39669 "system unbootable. Therefore when using the I<--merge> option, make sure "
39670 "you have a reliable backup first."
39674 #: ../tools/virt-win-reg.pl:65
39676 "This program can export and merge Windows Registry entries from a Windows "
39681 #: ../tools/virt-win-reg.pl:68
39683 "The first parameter is the libvirt guest name or the raw disk image of a "
39688 #: ../tools/virt-win-reg.pl:71
39690 "If I<--merge> is I<not> specified, then the chosen registry key is "
39691 "displayed/exported (recursively). For example:"
39695 #: ../tools/virt-win-reg.pl:74
39698 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
39703 #: ../tools/virt-win-reg.pl:76
39704 msgid "You can also display single values from within registry keys, for example:"
39708 #: ../tools/virt-win-reg.pl:79
39711 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
39712 " $ virt-win-reg Windows7 $cvkey ProductName\n"
39713 " Windows 7 Enterprise\n"
39718 #: ../tools/virt-win-reg.pl:83
39720 "With I<--merge>, you can merge a textual regedit file into the Windows "
39725 #: ../tools/virt-win-reg.pl:86
39728 " $ virt-win-reg --merge Windows7 changes.reg\n"
39733 #: ../tools/virt-win-reg.pl:90
39735 "This program is only meant for simple access to the registry. If you want "
39736 "to do complicated things with the registry, we suggest you download the "
39737 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
39738 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
39739 "L<hivexregedit(1)>."
39743 #: ../tools/virt-win-reg.pl:159
39748 #: ../tools/virt-win-reg.pl:161
39750 "In merge mode, this merges a textual regedit file into the Windows Registry "
39751 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
39752 "displays or exports Registry entries instead."
39756 #: ../tools/virt-win-reg.pl:165
39758 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
39759 "result in disk corruption. However exporting (without this flag) is always "
39764 #: ../tools/virt-win-reg.pl:173
39765 msgid "B<--encoding> UTF-16LE|ASCII"
39769 #: ../tools/virt-win-reg.pl:175
39771 "When merging (only), you may need to specify the encoding for strings to be "
39772 "used in the hive file. This is explained in detail in "
39773 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
39777 #: ../tools/virt-win-reg.pl:179
39779 "The default is to use UTF-16LE, which should work with recent versions of "
39784 #: ../tools/virt-win-reg.pl:186
39785 msgid "B<--unsafe-printable-strings>"
39789 #: ../tools/virt-win-reg.pl:188
39791 "When exporting (only), assume strings are UTF-16LE and print them as strings "
39792 "instead of hex sequences. Remove the final zero codepoint from strings if "
39797 #: ../tools/virt-win-reg.pl:192
39799 "This is unsafe and does not preserve the fidelity of strings in the original "
39800 "Registry for various reasons:"
39804 #: ../tools/virt-win-reg.pl:199
39806 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
39807 "other encodings will be corrupted by this transformation."
39811 #: ../tools/virt-win-reg.pl:204
39813 "Assumes that everything which has type 1 or 2 is really a string and that "
39814 "everything else is not a string, but the type field in real Registries is "
39819 #: ../tools/virt-win-reg.pl:210
39821 "Loses information about whether a zero codepoint followed the string in the "
39826 #: ../tools/virt-win-reg.pl:215
39828 "This all happens because the Registry itself contains no information about "
39829 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
39833 #: ../tools/virt-win-reg.pl:219
39835 "You should only use this option for quick hacking and debugging of the "
39836 "Registry contents, and I<never> use it if the output is going to be passed "
39837 "into another program or stored in another Registry."
39841 #: ../tools/virt-win-reg.pl:556
39842 msgid "SUPPORTED SYSTEMS"
39846 #: ../tools/virt-win-reg.pl:558
39848 "The program currently supports Windows NT-derived guests starting with "
39849 "Windows XP through to at least Windows 7."
39853 #: ../tools/virt-win-reg.pl:561
39854 msgid "The following Registry keys are supported:"
39858 #: ../tools/virt-win-reg.pl:565
39859 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
39863 #: ../tools/virt-win-reg.pl:567
39864 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
39868 #: ../tools/virt-win-reg.pl:569
39869 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
39873 #: ../tools/virt-win-reg.pl:571
39874 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
39878 #: ../tools/virt-win-reg.pl:573
39879 msgid "C<HKEY_USERS\\.DEFAULT>"
39883 #: ../tools/virt-win-reg.pl:575
39884 msgid "C<HKEY_USERS\\I<SID>>"
39888 #: ../tools/virt-win-reg.pl:577
39889 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
39893 #: ../tools/virt-win-reg.pl:579
39894 msgid "C<HKEY_USERS\\I<username>>"
39898 #: ../tools/virt-win-reg.pl:581
39899 msgid "where I<username> is a local user name (this is a libguestfs extension)."
39903 #: ../tools/virt-win-reg.pl:585
39905 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
39910 #: ../tools/virt-win-reg.pl:588
39912 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
39913 "supported (there is no \"current user\")."
39917 #: ../tools/virt-win-reg.pl:591
39922 #: ../tools/virt-win-reg.pl:593
39924 "C<virt-win-reg> expects that regedit files have already been reencoded in "
39925 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
39926 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
39927 "with Windows-style line endings, you may need to reencode the whole file "
39928 "before or after processing."
39932 #: ../tools/virt-win-reg.pl:599
39934 "To reencode a file from Windows format to Linux (before processing it with "
39935 "the I<--merge> option), you would do something like this:"
39939 #: ../tools/virt-win-reg.pl:602
39942 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
39947 #: ../tools/virt-win-reg.pl:604
39949 "To go in the opposite direction, after exporting and before sending the file "
39950 "to a Windows user, do something like this:"
39954 #: ../tools/virt-win-reg.pl:607
39957 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
39962 #: ../tools/virt-win-reg.pl:609
39963 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
39967 #: ../tools/virt-win-reg.pl:611
39969 "If you are unsure about the current encoding, use the L<file(1)> command. "
39970 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
39971 "Windows-style (CRLF) line endings, like this:"
39975 #: ../tools/virt-win-reg.pl:615
39978 " $ file software.reg\n"
39979 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
39980 " with CRLF line terminators\n"
39985 #: ../tools/virt-win-reg.pl:619
39986 msgid "This file would need conversion before you could I<--merge> it."
39990 #: ../tools/virt-win-reg.pl:621
39991 msgid "CurrentControlSet etc."
39995 #: ../tools/virt-win-reg.pl:623
39997 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
39998 "Registry at the level of the hive file, and therefore you cannot modify "
40003 #: ../tools/virt-win-reg.pl:627
40005 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40006 "circumstances it might refer to another control set. The way to find out is "
40007 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40011 #: ../tools/virt-win-reg.pl:631
40014 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40015 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40016 " \"Current\"=dword:00000001\n"
40017 " \"Default\"=dword:00000001\n"
40018 " \"Failed\"=dword:00000000\n"
40019 " \"LastKnownGood\"=dword:00000002\n"
40024 #: ../tools/virt-win-reg.pl:638
40025 msgid "\"Current\" is the one which Windows will choose when it boots."
40029 #: ../tools/virt-win-reg.pl:640
40030 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
40034 #: ../tools/virt-win-reg.pl:643
40035 msgid "WINDOWS TIPS"
40039 #: ../tools/virt-win-reg.pl:645
40041 "Note that some of these tips modify the guest disk image. The guest I<must> "
40042 "be shut off, else you will get disk corruption."
40046 #: ../tools/virt-win-reg.pl:648
40047 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40051 #: ../tools/virt-win-reg.pl:650
40053 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40054 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40055 "is uploaded into C<C:\\>:"
40059 #: ../tools/virt-win-reg.pl:654
40062 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40067 #: ../tools/virt-win-reg.pl:656
40068 msgid "Prepare a regedit file containing the registry change:"
40072 #: ../tools/virt-win-reg.pl:658
40075 " cat > test.reg <<'EOF'\n"
40076 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40077 " \"Test\"=\"c:\\\\test.bat\"\n"
40083 #: ../tools/virt-win-reg.pl:663
40085 "In this example we use the key C<RunOnce> which means that the script will "
40086 "run precisely once when the first user logs in. If you want it to run every "
40087 "time a user logs in, replace C<RunOnce> with C<Run>."
40091 #: ../tools/virt-win-reg.pl:667
40092 msgid "Now update the registry:"
40096 #: ../tools/virt-win-reg.pl:669
40099 " virt-win-reg --merge WindowsGuest test.reg\n"
40104 #: ../tools/virt-win-reg.pl:671
40105 msgid "INSTALLING A SERVICE"
40109 #: ../tools/virt-win-reg.pl:673
40111 "This section assumes you are familiar with Windows services, and you either "
40112 "have a program which handles the Windows Service Control Protocol directly "
40113 "or you want to run any program using a service wrapper like SrvAny or the "
40118 #: ../tools/virt-win-reg.pl:678
40120 "First upload the program and optionally the service wrapper. In this case "
40121 "the test program is called C<test.exe> and we are using the RHSrvAny "
40126 #: ../tools/virt-win-reg.pl:682
40129 " guestfish -i -d WindowsGuest <<EOF\n"
40130 " upload rhsrvany.exe /rhsrvany.exe\n"
40131 " upload test.exe /test.exe\n"
40137 #: ../tools/virt-win-reg.pl:687
40139 "Prepare a regedit file containing the registry changes. In this example, "
40140 "the first registry change is needed for the service itself or the service "
40141 "wrapper (if used). The second registry change is only needed because I am "
40142 "using the RHSrvAny service wrapper."
40146 #: ../tools/virt-win-reg.pl:692
40149 " cat > service.reg <<'EOF'\n"
40150 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
40151 " \"Type\"=dword:00000010\n"
40152 " \"Start\"=dword:00000002\n"
40153 " \"ErrorControl\"=dword:00000001\n"
40154 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
40155 " \"DisplayName\"=\"RHSrvAny\"\n"
40156 " \"ObjectName\"=\"NetworkService\"\n"
40161 #: ../tools/virt-win-reg.pl:701
40164 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
40165 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
40166 " \"PWD\"=\"c:\\\\Temp\"\n"
40172 #: ../tools/virt-win-reg.pl:712
40174 "For use of C<ControlSet001> see the section above in this manual page. You "
40175 "may need to adjust this according to the control set that is in use by the "
40180 #: ../tools/virt-win-reg.pl:718
40182 "C<\"ObjectName\"> controls the privileges that the service will have. An "
40183 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
40184 "privileged account."
40188 #: ../tools/virt-win-reg.pl:724
40190 "For the meaning of the magic numbers, see this Microsoft KB article: "
40191 "L<http://support.microsoft.com/kb/103000>."
40195 #: ../tools/virt-win-reg.pl:729
40196 msgid "Update the registry:"
40200 #: ../tools/virt-win-reg.pl:731
40203 " virt-win-reg --merge WindowsGuest service.reg\n"
40208 #: ../tools/virt-win-reg.pl:735
40210 "Be careful when passing parameters containing C<\\> (backslash) in the "
40211 "shell. Usually you will have to use 'single quotes' or double backslashes "
40212 "(but not both) to protect them from the shell."
40216 #: ../tools/virt-win-reg.pl:739
40217 msgid "Paths and value names are case-insensitive."
40221 #: ../tools/virt-win-reg.pl:748
40223 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
40224 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
40225 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
40226 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40230 #: ../tools/virt-win-reg.pl:766
40233 " export LIBGUESTFS_DEBUG=1\n"
40234 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
40239 #: ../tools/virt-win-reg.pl:769
40241 "Attach /tmp/virt-win-reg.log to a new bug report at "
40242 "L<https://bugzilla.redhat.com/>"